/* =========================================================
   BruiseTrace — Figma "bruise" page (fileKey WaMO8ZmueTtRgINBCQCapp)
   Desktop 1200/1280 · Tablet 800 · Mobile 375
   Breakpoints: desktop ≥ 940px (940px app column, centred),
                tablet 800–939px, mobile < 800px
   Component states follow the "main component" section:
   BT1 = default, BT2 = hover, BT3 = selected/active,
   BOX1 = default, BOX2 = current pass, BOX3 = saved pass
   ========================================================= */

:root {
  /* Figma variables */
  --bruise-color-1: #1a1a1a;      /* text */
  --bruise-2: #727272;            /* secondary text */
  --bruise-color-2-text: #727272;
  --bruise-color-3: #bfbfbf;      /* default borders */
  --bruise-blue: #0d6fff;         /* --bruise-color-1 on buttons */
  --bt-stroke-blue: #92b1ff;
  --bruise-color-box2: #eaf0ff;
  --bruise-red: #ff383c;          /* --bruise-color-2 on Analyze */
  --bt-stroke-red: #ff9c9e;
  --bruise-6: #ffffff;
  --navy: #364153;
  --navy-stroke: #86a2e1;
  --tagline: #91b3ff;
  --avatar-bg: #f3e8ff;
  --info-blue: #155dfc;
  --card-border: #e5e7eb;
  --pass-number: #45556c;
  --slider-track: #e2e8f0;
  --slider-thumb: #64748b;
  --photo-border: #80b4ff;
  --dot: #ebebeb;

  /* Figma effects */
  --shadow-card: drop-shadow(0 8px 15px rgba(60, 65, 125, 0.2));      /* Box shadow mobile */
  --shadow-box: drop-shadow(0 8px 16px rgba(31, 38, 135, 0.15));      /* ALL BOX shadow */
  --shadow-menu: 1px 2px 1.7px 0 rgba(169, 190, 242, 0.53);
  --shadow-bt2: drop-shadow(1px 2px 0.85px rgba(169, 190, 242, 0.53));
  --shadow-red: drop-shadow(1px 1px 1px rgba(186, 47, 50, 0.51));     /* red shadow */

  --font: "Inter", system-ui, sans-serif;
  --app-w: 940px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body.page-analysis { min-height: 1080px; }
body { font-family: var(--font); color: var(--bruise-color-1); background: #fff; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--bruise-blue); outline-offset: 2px; }
.br-m { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* =========================================================
   Header (HEADER)
   ========================================================= */
.topbar {
  position: relative;
  width: var(--app-w);
  height: 50px;
  margin-inline: auto;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 50px;
}
.topbar__brand { display: flex; align-items: center; justify-content: space-between; width: 440px; }
.topbar__title { font-weight: 700; font-size: 20px; line-height: 20px; letter-spacing: 0.2px; color: #fff; white-space: nowrap; }
.topbar__tagline { width: 261px; font-size: 13px; line-height: 20px; letter-spacing: -0.15px; color: var(--tagline); white-space: nowrap; }
.topbar__user { display: flex; align-items: center; justify-content: flex-end; gap: 11px; width: 83px; }
.topbar__user[href] { cursor: pointer; }   /* 'Io Kim' → the portfolio (js/app.js sets the address) */
.topbar__name { width: 40px; font-weight: 500; font-size: 14px; line-height: 20px; letter-spacing: -0.15px; color: #fff; white-space: nowrap; transform: translateY(0.5px); }
.topbar__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-bg); display: flex; align-items: center; justify-content: center; flex: none; }
.topbar__avatar img { width: 26px; height: 26px; }

/* =========================================================
   App frame
   ========================================================= */
.app { width: var(--app-w); margin-inline: auto; display: flex; align-items: flex-start; padding-right: 18px; }

/* ---- Left menu (line1) ---- */
.sidenav { flex: none; width: 221px; padding: 20px 0 0 38px; }
.sidenav__buttons { display: flex; flex-direction: column; gap: 20px; width: 148px; }
.menu-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 32px;
  border: 1px solid var(--navy);
  border-radius: 8px;
  background: var(--bruise-6);
  box-shadow: var(--shadow-menu);
  color: var(--navy);
  font-weight: 600;
  font-size: 15px;
  line-height: 28px;
  text-align: center;
}
.menu-btn.is-on { background: var(--navy); border-color: var(--navy-stroke); color: #fff; }
.sidenav__list { margin: 52px 0 0 5.5px; width: 137px; font-weight: 600; font-size: 13px; color: #1a1a1a; }
.sidenav__list a { display: block; }
.sidenav__item { height: 12px; line-height: 17px; display: flex; align-items: center; }
.sidenav__sub { height: 10px; font-size: 11px; line-height: 10px; white-space: pre; }
.sidenav__list--home .sidenav__item + .sidenav__group { margin-top: 46px; }
.sidenav__list--home .sidenav__group + .sidenav__item { margin-top: 52px; }
.sidenav__group { display: flex; flex-direction: column; gap: 23px; }
/* analysis page: right-aligned list (box 140 wide, 67px pitch) */
.sidenav__list--analysis { margin: 20px 0 0 3px; width: 140px; display: flex; flex-direction: column; align-items: flex-end; gap: 50px; }
.sidenav__list--analysis a { height: 17px; line-height: 17px; }
.sidenav__list--analysis a.is-current { color: var(--navy); }

/* ---- Content column (line2) ---- */
.content { flex: none; width: 701px; margin-top: 10px; display: flex; flex-direction: column; gap: 11px; padding-bottom: 20px; }

/* ---- Cards ---- */
.card { position: relative; background: #fff; border-radius: 8px; filter: var(--shadow-card); }
.card__title { position: absolute; left: 20px; top: 20px; width: 175px; height: 14px; font-weight: 700; font-size: 16px; line-height: 12px; white-space: nowrap; }
.card__hint { position: absolute; right: 20px; text-align: right; font-size: 11px; white-space: nowrap; }
.card__hint--1 { top: 54px; height: 5px; line-height: 5px; font-weight: 600; }
.card__hint--2 { top: 69px; height: 13px; line-height: 13px; font-weight: 400; }

.card--age, .card--guide { height: 228px; }

/* chips (BT/Estimated bruise age) */
.chips { position: absolute; right: 20px; bottom: 20px; width: 430px; display: grid; grid-template-columns: repeat(4, 100px); justify-content: space-between; row-gap: 11px; }
.chip {
  position: relative;
  width: 100px;
  height: 32px;
  border: 1px solid var(--bruise-color-3);
  border-radius: 8px;
  background: #fff;
  font-weight: 500;
  font-size: 12px;
  line-height: 20px;
  letter-spacing: -0.5px;
  color: var(--bruise-color-2-text);
  text-align: center;
}
/* BT2 hover / BT3 selected are 2px larger than BT1 in Figma */
.chip:hover, .tool:hover, .save-btn:hover { margin: -1px; width: calc(100% + 2px); height: 34px; filter: var(--shadow-bt2); }
.chip:hover, .chip.is-on { margin: -1px; width: 102px; height: 34px; }
.chip.is-on { background: var(--bruise-blue); border-color: var(--bt-stroke-blue); color: #fff; filter: var(--shadow-bt2); }

/* tools (BT/Guided selection flow) */
.tools { position: absolute; right: 19px; top: 149px; display: flex; gap: 10px; }
.tools__col { width: 137px; display: flex; flex-direction: column; gap: 15px; }
.tool {
  position: relative;
  width: 137px;
  height: 32px;
  border: 1px solid var(--bruise-color-3);
  border-radius: 8px;
  background: #fff;
  font-weight: 500;
  font-size: 12px;
  line-height: 20px;
  letter-spacing: -0.5px;
  color: var(--bruise-color-2-text);
  text-align: center;
}
.tool:hover { margin: -1px -1px 1px; width: 139px; }
.tool.is-on { margin: -1px -1px 1px; width: 139px; height: 34px; background: var(--bruise-blue); border-color: var(--bt-stroke-blue); color: #fff; filter: var(--shadow-bt2); }
.tool--upload { border-color: var(--bruise-blue); color: var(--bruise-blue); font-weight: 600; letter-spacing: 0; }
.tool--upload span { position: absolute; left: calc(50% - 48.5px); top: calc(50% - 10px); width: 79px; text-align: center; }
.tool--upload img { position: absolute; left: calc(50% + 36.8px); top: calc(50% - 6.5px); width: 12.48px; height: 11px; }
.tool--upload .ico-on { display: none; }
.tool--upload.is-on .ico-off { display: none; }
.tool--upload.is-on .ico-on { display: block; }

/* sliders (Container: track 8px, thumb 16px) */
.slider { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border-radius: 999px; background: var(--slider-track); cursor: pointer; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--slider-thumb); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1); }
.slider::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--slider-thumb); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1); }
.slider::-moz-range-track { height: 8px; border-radius: 999px; background: var(--slider-track); }

/* ---- Work row: photo + passes ---- */
.work { display: flex; gap: 11px; align-items: flex-start; }
.photo-card { flex: none; }
.photo {
  position: relative;
  width: 500px;
  height: 500px;
  /* Figma: 2px stroke, dash pattern [10, 10] — drawn with gradients because CSS "dashed" has no dash length */
  --dash: linear-gradient(90deg, var(--photo-border) 50%, transparent 50%);
  --dash-v: linear-gradient(180deg, var(--photo-border) 50%, transparent 50%);
  background-color: #fff;
  background-image: var(--dash), var(--dash), var(--dash-v), var(--dash-v), radial-gradient(circle, var(--dot) 0 2px, rgba(235, 235, 235, 0.4) 2.5px, transparent 3px);
  background-size: 20px 2px, 20px 2px, 2px 20px, 2px 20px, 24px 24px;
  background-position: 0 0, 0 100%, 0 0, 100% 0, -2px -3px;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y, repeat;
  filter: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
}
.photo.is-drag { --dash: linear-gradient(90deg, var(--bruise-blue) 50%, transparent 50%); --dash-v: linear-gradient(180deg, var(--bruise-blue) 50%, transparent 50%); }
.photo__empty { position: absolute; left: 50%; top: 50%; width: 124px; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 16px; pointer-events: none; }
.photo__empty img { width: 25.67px; height: 21px; margin: -1.17px; }
.photo__empty p { font-weight: 700; font-size: 20px; line-height: 21px; letter-spacing: -0.15px; color: var(--bruise-blue); text-align: center; white-space: nowrap; }
.photo.has-image { cursor: crosshair; background-image: var(--dash), var(--dash), var(--dash-v), var(--dash-v); }
.photo.has-image .photo__empty { display: none; }
.photo__stage { position: absolute; transform-origin: center center; }
.photo__stage img, .photo__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo__stage canvas { opacity: 0.45; }
.photo:not(.has-image) .photo__stage { display: none; }

/* passes (BOX/Pass, BT/Pass) */
.passes { flex: none; width: 190px; height: 500px; display: flex; flex-direction: column; justify-content: space-between; }
.pass {
  position: relative;
  height: 145px;
  border-radius: 8px;
  background: #fff;
  filter: var(--shadow-card);
}
.pass::after { content: ""; position: absolute; inset: 0; border-radius: 8px; pointer-events: none; }
.pass.is-current::after { border: 1.5px solid var(--bruise-blue); }
.pass.is-saved { background: var(--bruise-color-box2); }
.pass.is-saved::after { border: 1.5px solid var(--bt-stroke-blue); }
.pass__title { position: absolute; right: 18px; top: 19px; width: 55px; height: 12px; font-weight: 700; font-size: 16px; line-height: 12px; white-space: nowrap; }
.pass__no { display: none; }
.pass__same { position: absolute; left: 57px; top: 45px; width: 113px; height: 20px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.pass__same input { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; border: 1px solid var(--bruise-2); background: #fff; cursor: pointer; margin: 0; flex: none; }
.pass__same input:checked { background: var(--bruise-blue); border-color: var(--bruise-blue); box-shadow: inset 0 0 0 2px #fff; }
.pass__same input:disabled { cursor: default; }
.pass__same span { font-weight: 600; font-size: 11px; line-height: 20px; color: #151515; white-space: nowrap; }
.pass__px { position: absolute; right: 20px; top: 68px; height: 10px; font-size: 11px; line-height: 10px; text-align: right; white-space: nowrap; }
.save-btn {
  position: absolute;
  left: 75px;
  top: 92px;
  width: 95px;
  height: 32px;
  border: 1px solid var(--bruise-color-3);
  border-radius: 8px;
  background: #fff;
  font-weight: 500;
  font-size: 12px;
  line-height: 20px;
  letter-spacing: -0.5px;
  color: var(--bruise-color-2-text);
}
.save-btn:hover { margin: -1px; width: 97px; height: 34px; }
.save-btn.is-cancel { margin: -1px; width: 97px; height: 34px; background: var(--bruise-blue); border-color: var(--bt-stroke-blue); color: #fff; filter: var(--shadow-bt2); }
.save-btn:disabled { cursor: default; opacity: 0.5; }

/* BT/Analyze */
.analyze {
  height: 35px;
  border: 1px solid var(--bruise-red);
  border-radius: 8px;
  background: #fff;
  color: var(--bruise-red);
  font-weight: 600;
  font-size: 13px;
  line-height: 17px;
}
.analyze:hover { margin: -1px; height: 37px; filter: var(--shadow-red); }
.analyze.is-ready { margin: -1px; height: 37px; background: var(--bruise-red); border-color: var(--bt-stroke-red); color: #fff; filter: var(--shadow-red); }
.flash { animation: flash 1.2s ease-out 2; }
@keyframes flash { 0%, 100% { background: transparent; } 30% { background: rgba(255, 56, 60, 0.18); } }
.photo.flash { animation: photo-flash 1.2s ease-out 2; }
@keyframes photo-flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px var(--bruise-red); } }

/* ---- Mobile bottom menu (BT/1-line-S/Menu bar-mobile FIX) ---- */
.mobilebar { display: none; }

/* =========================================================
   Analysis cards (/page)
   ========================================================= */
.grid { flex: none; width: 701px; margin-top: 10px; display: grid; grid-template-columns: 345px 345px; column-gap: 11px; align-items: start; padding-bottom: 20px; }
.col { display: flex; flex-direction: column; gap: 11px; }
.acard { position: relative; width: 345px; background: #fff; border: 1px solid var(--card-border); border-radius: 8px; filter: var(--shadow-box); }
.acard__title { position: absolute; left: 19px; top: 19px; height: 13px; font-weight: 700; font-size: 16px; line-height: 12px; display: flex; align-items: center; white-space: nowrap; }
.blue-box {
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: var(--bruise-color-box2);
  border: 1px solid var(--info-blue);
  border-bottom-width: 5px;
  border-radius: 8px;
  color: var(--info-blue);
  font-weight: 600;
  font-size: 13px;
  line-height: 17px;
  text-align: center;
}
.blue-box p { position: absolute; left: 24px; top: 25px; width: 294px; }
.blue-box p span { display: block; }

.acard--healing { height: 446px; }
.acard--healing .blue-box { height: 160px; }
.heal { position: absolute; left: 19px; top: 62px; width: 305px; height: 193px; color: var(--bruise-2); }
.heal__box { position: absolute; left: 0.5px; width: 305px; height: 65px; border: 1px solid; }
.heal__box--green { top: 0; border-color: #34c759; border-radius: 6px; }
.heal__box--orange { top: 128px; border-color: #ff8d28; border-radius: 8px; }
.heal__dot { position: absolute; width: 45px; height: 45px; border-radius: 25px; font-size: 10px; line-height: 15px; letter-spacing: -0.2px; display: flex; align-items: center; justify-content: center; }
.heal__dot--yellow { left: 250px; top: 10px; background: #cfffdb; }
.heal__dot--red { right: 9.5px; top: 138px; background: #ffe6d0; }
.heal__text { position: absolute; left: 10px; width: 232px; }
.heal__text--expected { top: 12px; }
.heal__text--expected b { margin: -2px 0 8px; }
.heal__text--visual { top: 136px; }
.heal__text b { display: block; height: 12px; font-weight: 700; font-size: 12px; line-height: 15px; letter-spacing: -0.45px; margin-bottom: 6px; }
.heal__text--visual b { height: 15px; }
.heal__text span { display: block; font-size: 10px; line-height: 15px; letter-spacing: -0.2px; }
.heal__pointer { position: absolute; left: 33.5px; width: 238px; height: 17.15px; }
.heal__pointer--green { top: 65px; }
.heal__pointer--orange { top: 111px; transform: scaleY(-1); }
.heal__pointer--multi { display: none; left: 0; width: 305px; background-repeat: no-repeat; background-size: 238px 17.15px; }
/* Tablet frame: a pointer above/below every stage (S1–S5), 58px apart */
.heal__pointer--multi.heal__pointer--green { background-image: url("../assets/pointer-green.svg"), url("../assets/pointer-green.svg"), url("../assets/pointer-green.svg"), url("../assets/pointer-green.svg"), url("../assets/pointer-green.svg"); background-position: -82px 0, -24px 0, 34px 0, 92px 0, 150px 0; }
.heal__pointer--multi.heal__pointer--orange { background-image: url("../assets/pointer-orange.svg"), url("../assets/pointer-orange.svg"), url("../assets/pointer-orange.svg"), url("../assets/pointer-orange.svg"), url("../assets/pointer-orange.svg"); background-position: -82px 0, -24px 0, 34px 0, 92px 0, 150px 0; }
.stagebar { position: absolute; left: 0; top: 82px; width: 305px; height: 29px; border-radius: 12.75px; background: #ececec; overflow: hidden; }
.stagebar::before { content: ""; position: absolute; right: 0; top: 0; width: 83px; height: 29px; background: url("../assets/flip-white.png") 0 0 / 18px 18px; }
.stagebar::after { content: ""; position: absolute; inset: 0; border: 1px solid #99a1af; border-radius: 12.75px; background-image: linear-gradient(90deg, #c80505 7.6923%, #4c1b5c 20.673%, #250f83 33.654%, #743c14 53.365%, #ffd078 72.596%, rgba(227, 194, 133, 0) 92.308%); }
.stagebar ol { position: relative; z-index: 1; list-style: none; display: flex; gap: 39px; justify-content: center; width: 250px; height: 29px; margin: -1px 0 0 28.5px; align-items: center; font-weight: 600; font-size: 15px; line-height: 0; color: #fff; }
.stagebar li:last-child { color: #1a1a1a; }

.acard--quant { height: 370px; }
.acard--quant .acard__title { left: 20px; }
.acard--quant .blue-box { height: 112px; }
.bars { position: absolute; left: 29px; top: 82px; width: 285px; height: 125px; font-size: 11px; color: var(--bruise-2); }
.bars__row { position: absolute; left: 0; right: 0; height: 9px; }
.bars__row > span:first-child { position: absolute; left: 0; top: 2px; height: 5px; line-height: 5px; font-weight: 600; white-space: nowrap; }
.bars__track { position: absolute; left: 47px; top: 0; width: 164px; height: 9px; border-radius: 999px; background: #e5e7eb; }
.bars__fill { position: absolute; left: 47px; top: 0; width: 77px; height: 9px; border-radius: 999px; }
.bars__val { position: absolute; right: 0; top: -2px; line-height: 13px; white-space: nowrap; }
.bars__patch { position: absolute; left: 181px; top: 38px; width: 28px; height: 20px; background: #fff; }
.scores { position: absolute; left: 24px; top: 25px; width: 295px; height: 56px; color: var(--info-blue); text-align: left; }
.scores__col { position: absolute; top: 0; display: flex; flex-direction: column; gap: 3px; }
.scores__col:first-child { left: 0; width: 118px; }
.scores__col:last-child { right: 0; width: 150px; }
.scores__label { height: 10px; font-size: 11px; line-height: 5px; padding-top: 2.5px; white-space: nowrap; }
.scores__value { height: 24px; font-weight: 700; font-size: 17px; line-height: 28px; letter-spacing: -0.45px; white-space: nowrap; }
.scores__level { height: 16px; font-size: 13px; line-height: 17px; }

.acard--intensity { height: 313px; }
.acard--intensity .blue-box { height: 107px; bottom: -3px; }
.acard--consistency { height: 330px; }
.acard--consistency .blue-box { height: 124px; bottom: -3px; }
.dots { position: absolute; left: 19px; top: 72px; width: 305px; }
.dots__row { position: relative; height: 60px; width: 296px; margin-left: 4.5px; }
.ring { position: absolute; top: 1.5px; width: 57px; height: 57px; }
.ring i { position: absolute; border-radius: 50%; }
.pills { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.pill { height: 25px; width: 72px; border: 1px solid var(--bruise-color-3); border-radius: 999px; background: #fff; font-weight: 500; font-size: 12px; line-height: 23px; letter-spacing: -0.5px; color: var(--bruise-color-3); text-align: center; white-space: nowrap; }
.pill.is-on { width: 74px; height: 27px; border: 1.5px solid var(--bruise-red); color: var(--bruise-2); line-height: 24px; }
.pills--3 { gap: 27px; width: 306px; margin-left: -0.5px; }
.pills--3 .pill, .pills--3 .pill.is-on { width: 84px; }

.acard--note { height: 160px; padding: 20px; }
.acard--note h2 { margin: -1px 0 0 -1px;  height: 13px; font-weight: 700; font-size: 16px; line-height: 12px; display: flex; align-items: center; }
.acard--note img { position: absolute; right: 19px; top: 32px; width: 20px; height: 20px; }
.acard--note p { position: absolute; left: 24px; top: 64px; width: 295px; font-size: 11px; line-height: 13px; color: var(--bruise-2); }

/* =========================================================
   Tablet 800–939px
   ========================================================= */
@media (max-width: 939px) {
  .topbar { width: 100%; padding: 0 0 0 43px; justify-content: flex-start; }
  .topbar__brand { width: auto; gap: 0; }
  .topbar__title { width: 157px; font-size: 16px; }
  .topbar__tagline { width: 232px; font-size: 12px; }
  .topbar__user { position: absolute; left: calc(100% - 117px); width: auto; }
  .topbar__name { width: 40px; }

  .app { width: 100%; padding-right: 14px; }
  .sidenav { width: 181px; padding: 20px 0 0 37px; }
  .sidenav__buttons { width: 110px; gap: 15px; }
  .menu-btn { width: 110px; height: 30px; font-size: 11px; }
  .sidenav__list { display: none; }
  .content { flex: 1; width: auto; }

  .work { gap: 10px; }
  .photo-card { flex: 1; min-width: 0; }
  .photo { width: 100%; height: auto; aspect-ratio: 1; }
  .passes { width: 169px; height: auto; gap: 7px; justify-content: flex-start; }
  .pass { height: 122px; }
  .pass__title { right: auto; left: 99px; top: 14px; width: 50px; font-size: 15px; }
  .pass__same { left: 44px; top: 35px; width: 105px; }
  .pass__same input { width: 12px; height: 12px; }
  .pass__same span { font-size: 10px; }
  .pass__px { right: 20px; top: 56px; font-size: 10px; height: 8px; line-height: 8px; }
  .save-btn { left: 54px; top: 75px; }
  .analyze { height: 38px; margin: 1px 0 0 1px; }
  .analyze:hover, .analyze.is-ready { margin: 0 -1px -1px; height: 39px; }

  /* analysis */
  .app--analysis { padding-right: 10px; }
  .app--analysis .sidenav { width: 93px; padding: 20px 0 0 10px; }
  .app--analysis .sidenav__buttons { width: 76px; }
  .app--analysis .menu-btn { width: 76px; }
  .grid { flex: none; width: 697px; column-gap: 7px; }
  .heal__pointer--single { display: none; }
  .acard--healing { height: 466px; }
  .heal { top: 72px; }
  .heal__text--expected { top: 9px; }
  .heal__text--visual { top: 134px; }
  .heal__pointer--multi { display: block; }
}

/* =========================================================
   Mobile < 800px
   ========================================================= */
@media (max-width: 799px) {
  body { padding-bottom: 52px; }
  body.page-home { min-height: 1470px; }
  body.page-analysis { min-height: 1954px; }
  .topbar { height: 40px; padding: 0 16.5px 0 15.5px; justify-content: space-between; }
  .topbar__brand { gap: 6px; width: 284px; justify-content: flex-start; }
  .topbar__title { width: 84px; font-size: 14px; letter-spacing: -0.2px; }
  .topbar__tagline { width: auto; font-size: 10px; letter-spacing: -0.2px; }
  .topbar__user { position: static; width: 59px; gap: 0; }
  .topbar__name { width: 40px; margin-right: -5px; font-size: 10px; }
  .topbar__avatar { width: 19px; height: 19px; }
  .topbar__avatar img { width: 18px; height: 18px; }

  .app { display: block; padding: 0; }
  /* analysis column is a fixed 345px centred column (Figma constraint: Center); width cap only keeps shadow rendering identical to the 375 baseline */
  .app--analysis { max-width: 600px; }
  .sidenav { display: none; }
  .content { width: 100%; margin-top: 1px; gap: 1px; padding-bottom: 20px; }
  .card { border-radius: 8px; }
  .card--age { height: 310px; }
  .card--guide { height: 316px; }
  .card__hint--1 { top: 76px; }
  .card__hint--2 { top: 91px; }
  .card--guide .card__hint--1 { top: 96px; }
  .br-m { display: inline; }
  .card--guide .card__hint--2 { top: 111px; height: 26px; }
  .chips { left: 21px; right: 21px; top: 133px; bottom: auto; width: auto; grid-template-columns: 1fr 1fr; column-gap: 13px; row-gap: 10px; }
  .chip { width: 100%; }
  .chip:hover, .chip.is-on { width: calc(100% + 2px); }
  .tools { left: 22px; right: 20px; top: 167px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 13px; row-gap: 19px; }
  .tools__col { width: auto; }
  .tools__col--upload { grid-column: 2; margin-right: -7px; }
  .tools__col--upload .tool { width: calc(100% - 7px); }
  .tool, .tool:hover, .tool.is-on { width: 100%; }

  .work { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .photo-card { width: 100%; padding: 10px; background: #fff; border-radius: 8px; filter: var(--shadow-card); }
  .photo { filter: none; }
  .passes { width: auto; margin: 0 10px; gap: 8px; }
  .pass { height: 90px; }
  .pass__title { display: none; }
  .pass__no { display: block; position: absolute; left: 22px; top: 34px; height: 11px; font-weight: 700; font-size: 32px; line-height: 12px; color: var(--pass-number); }
  /* Figma Mobile: text boxes are right-aligned with their right edge 138px from the card edge (Save starts at 121px → 17px gap) */
  .pass__same { left: auto; right: 138px; top: 25px; width: 140px; }
  .pass__same input { width: 13px; height: 13px; }
  .pass__same span { font-size: 14px; line-height: 20px; }
  .pass__px { right: 138px; top: 56px; height: 3px; line-height: 3px; font-size: 12px; }
  .pass:first-child .pass__px { top: 53px; }
  .save-btn, .save-btn:hover, .save-btn.is-cancel { left: auto; right: 18px; top: 24px; width: 103px; height: 42px; margin: 0; font-size: 14px; }
  .analyze, .analyze:hover, .analyze.is-ready { margin: 2px 0 0; height: 48px; font-size: 16px; background: var(--bruise-red); border-color: var(--bt-stroke-red); color: #fff; filter: var(--shadow-red); }

  .mobilebar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: 52px; align-items: center; justify-content: center; gap: 20px; }
  .mobilebar::before { content: ""; position: absolute; inset: 0; background: var(--navy); opacity: 0.6; }
  .mobilebar .menu-btn { position: relative; width: 80px; height: 30px; font-size: 11px; }

  /* analysis */
  .grid { width: 345px; margin: 10px auto 0; display: flex; flex-direction: column; gap: 11px; }
  .col { display: contents; }
  .heal__pointer--single { display: block; }
  .heal__pointer--multi { display: none; }
  .acard--healing { order: 1; } .acard--quant { order: 2; } .acard--intensity { order: 3; } .acard--consistency { order: 4; } .acard--note { order: 5; }
}

/* =========================================================
   Narrower than the 375px Mobile frame (e.g. 320px):
   no new layout — header text truncates and the analysis column scales down
   ========================================================= */
@media (max-width: 374px) {
  .topbar__brand { flex: 1; min-width: 0; width: auto; }
  .topbar__tagline { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar__user { flex: none; }
  .grid { zoom: 0.853; }
  /* Pass rows: narrower Save (103→84px) and the text column follows it, so
     "same as previous" no longer runs into the big pass number */
  .save-btn, .save-btn:hover, .save-btn.is-cancel { width: 84px; }
  .pass__same { right: 114px; width: auto; gap: 6px; }
  .pass__px, .pass:first-child .pass__px { right: 114px; }
}
