/* ========================================================================== 
   Instaoptics design system
   A precise, editorial interface for an optical measurement workflow.
   ========================================================================== */

:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f3f6fa;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --text: #0a1930;
  --text-2: #314159;
  --muted: #63738b;
  --faint: #91a0b5;

  --brand: #165dff;
  --brand-2: #0747c9;
  --brand-ink: #0b4ec7;
  --teal: #00a896;
  --coral: #f06449;
  --navy: #071a33;
  --navy-2: #0c2647;
  --grad: linear-gradient(135deg, #165dff 0%, #0747c9 100%);
  --grad-soft: #edf4ff;

  --ok: #10b981;   --ok-bg: #ecfdf5;   --ok-ink: #047857;
  --warn: #f59e0b; --warn-bg: #fffbeb; --warn-ink: #b45309;
  --bad: #f43f5e;  --bad-bg: #fff1f2;  --bad-ink: #be123c;

  --c-temple: #f43f5e;   /* lens ends (red lines on the reference image) */
  --c-tb: #22c55e;       /* tops / bottoms (green lines) */
  --c-pupil: #a855f7;    /* pupils (purple) */

  --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(10, 25, 48, .05);
  --shadow: 0 12px 32px -26px rgba(7, 26, 51, .42);
  --shadow-lg: 0 26px 70px -34px rgba(7, 26, 51, .5);
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Manrope', 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.5; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-ink); }
button { font: inherit; color: inherit; }
input { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); letter-spacing: -.028em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(22, 93, 255, .32); outline-offset: 2px; }
* { -webkit-tap-highlight-color: transparent; }

/* ---------------------------------------------------------------- icons */
.ms { font-family: 'Material Symbols Rounded'; font-weight: 500; font-style: normal; font-size: 20px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga'; user-select: none; }
.ms.fill { font-variation-settings: 'FILL' 1; }

/* Gradient icon tiles */
.ic { --g: var(--grad); width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff; background: var(--g); box-shadow: 0 8px 18px -10px rgba(15, 23, 42, .45), inset 0 1px 0 rgba(255,255,255,.25); }
.ic .ms { font-size: 21px; font-variation-settings: 'FILL' 1; }
.ic.sm { width: 32px; height: 32px; border-radius: 10px; }
.ic.sm .ms { font-size: 18px; }
.ic.lg { width: 52px; height: 52px; border-radius: 16px; }
.ic.lg .ms { font-size: 27px; }
.ic.xl { width: 72px; height: 72px; border-radius: 22px; }
.ic.xl .ms { font-size: 36px; }
.ic-sky     { --g: linear-gradient(135deg, #38bdf8, #0284c7); }
.ic-indigo  { --g: linear-gradient(135deg, #818cf8, #4f46e5); }
.ic-violet  { --g: linear-gradient(135deg, #c084fc, #7c3aed); }
.ic-emerald { --g: linear-gradient(135deg, #34d399, #059669); }
.ic-amber   { --g: linear-gradient(135deg, #fbbf24, #ea580c); }
.ic-rose    { --g: linear-gradient(135deg, #fb7185, #e11d48); }
.ic-teal    { --g: linear-gradient(135deg, #2dd4bf, #0d9488); }
.ic-pink    { --g: linear-gradient(135deg, #f472b6, #db2777); }
.ic-slate   { --g: linear-gradient(135deg, #94a3b8, #475569); }
.ic-soft { background: var(--grad-soft); color: var(--brand-ink); box-shadow: none; }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* --------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s, opacity .2s; white-space: nowrap; user-select: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.btn .ms { font-size: 19px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -12px rgba(79, 70, 229, .7); background-size: 140% 140%; }
.btn-primary:hover:not([disabled]) { box-shadow: 0 14px 30px -12px rgba(79, 70, 229, .8); background-position: 100% 0; }
.btn-dark { background: #0f172a; color: #fff; }
.btn-dark:hover:not([disabled]) { background: #1e293b; }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--text-2); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-2); border-color: #c5d0de; }
.btn-soft { background: #eef6ff; color: var(--brand-ink); }
.btn-soft:hover:not([disabled]) { background: #e0efff; }
.btn-success { background: linear-gradient(135deg, #34d399, #059669); color: #fff; box-shadow: 0 10px 24px -12px rgba(5, 150, 105, .7); }
.btn-paypal { background: #ffc439; color: #111827; font-weight: 700; }
.btn-paypal:hover:not([disabled]) { background: #f2ba36; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 15.5px; border-radius: 14px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-ink); font-weight: 600; cursor: pointer; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input-wrap { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 6px 0 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(14, 165, 233, .14); }
.input-wrap > .ms { color: var(--faint); }
.input-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; height: 100%; }
.input-wrap .suffix { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-right: 10px; }
.input-wrap.is-bad { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(244, 63, 94, .12); }
.input-wrap.is-ok { border-color: var(--ok); }
.hint { font-size: 12.5px; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.hint .ms { font-size: 16px; }
.hint.bad { color: var(--bad-ink); }
.hint.ok { color: var(--ok-ink); }
input::placeholder { color: var(--faint); }

/* --------------------------------------------------------------- alerts */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; border: 1px solid; }
.alert .ms { font-size: 19px; flex: none; margin-top: 1px; }
.alert-danger { background: var(--bad-bg); border-color: #fecdd3; color: var(--bad-ink); }
.alert-warn { background: var(--warn-bg); border-color: #fde68a; color: var(--warn-ink); }
.alert-info { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.alert-ok { background: var(--ok-bg); border-color: #a7f3d0; color: var(--ok-ink); }

/* ---------------------------------------------------------- chips/badges */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.chip .ms { font-size: 16px; }
.chip-brand { background: var(--grad-soft); color: #3730a3; border-color: #dbe4ff; }
.chip-ok { background: var(--ok-bg); color: var(--ok-ink); border-color: #a7f3d0; }
.chip-warn { background: var(--warn-bg); color: var(--warn-ink); border-color: #fde68a; }
.chip-bad { background: var(--bad-bg); color: var(--bad-ink); border-color: #fecdd3; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.live { animation: pulse 1.6s infinite; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--mono); }

/* ================================================================ LOGIN */
.auth-body { min-height: 100vh; overflow-x: hidden; background: #fff; }
.auth-bg { display: none; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(430px, .82fr); background: #fff; }
.auth-brand { position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; padding: 42px clamp(34px, 5vw, 72px) 36px; display: flex; flex-direction: column; color: #fff; background: linear-gradient(90deg, rgba(5, 20, 40, .88) 0%, rgba(5, 20, 40, .56) 48%, rgba(5, 20, 40, .08) 100%), url('../img/optical-hero.webp') 57% center / cover no-repeat; }
.auth-brand::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 76px 76px; mask-image: linear-gradient(to bottom, #000, transparent 52%); opacity: .3; }
.auth-brand::after { content: ''; position: absolute; left: clamp(34px, 5vw, 72px); top: 0; width: 92px; height: 4px; background: var(--coral); }
.brand-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 42px; height: 42px; border-radius: 10px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px -12px rgba(22, 93, 255, .8); }
.logo-mark .ms { font-size: 24px; }
.brand-name { font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: -.025em; }
.auth-brand .brand-row .logo-mark { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); box-shadow: none; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.auth-brand .brand-row .brand-name { display: block; color: #fff; }
.auth-brand .brand-row small { display: block; margin-top: -1px; color: rgba(255,255,255,.68); font-size: 11px; letter-spacing: .04em; }
.auth-story { position: relative; z-index: 1; margin-top: auto; max-width: 720px; padding-top: 120px; }
.auth-kicker { display: inline-flex; align-items: center; margin-bottom: 18px; color: #85d9cf; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.auth-kicker::before { content: ''; width: 24px; height: 2px; margin-right: 10px; background: currentColor; }
.auth-brand h1 { max-width: 13ch; font-size: clamp(42px, 5vw, 72px); line-height: 1.02; font-weight: 800; letter-spacing: -.055em; text-wrap: balance; }
.auth-brand .lead { max-width: 52ch; margin-top: 20px; color: rgba(255,255,255,.78); font-size: 17px; line-height: 1.65; }
.feature-list { list-style: none; padding: 22px 0 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; border-top: 1px solid rgba(255,255,255,.2); }
.feature-list li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.feature-list li > .ms { color: #84dccf; font-size: 22px; }
.feature-list li div { display: flex; flex-direction: column; gap: 3px; }
.feature-list strong { color: #fff; font-size: 13px; }
.feature-list li div span { color: rgba(255,255,255,.62); font-size: 11.5px; line-height: 1.45; }
.auth-proof { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin-top: 28px; color: rgba(255,255,255,.72); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.auth-proof > .ms { color: #84dccf; font-size: 17px; }
.auth-proof i { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,.45); }
.auth-card { width: min(100%, 510px); align-self: center; justify-self: center; padding: 56px clamp(32px, 5vw, 58px); display: flex; flex-direction: column; gap: 24px; background: #fff; }
.auth-card-label { display: inline-flex; align-self: flex-start; padding: 6px 10px; border: 1px solid #d8e5ff; border-radius: 6px; color: var(--brand-ink); background: #f5f8ff; font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.auth-card form { display: flex; flex-direction: column; gap: 18px; }
.auth-card-head { display: flex; gap: 16px; align-items: center; padding-bottom: 8px; }
.auth-lock { width: 48px; height: 48px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--brand); background: #edf4ff; border: 1px solid #d8e5ff; }
.auth-lock .ms { font-size: 24px; }
.auth-card-head h2 { font-size: 28px; font-weight: 800; }
.auth-card-head p { max-width: 30ch; margin-top: 3px; color: var(--muted); font-size: 14px; }
.auth-card .input-wrap { height: 56px; border-radius: 9px; background: #fbfcfe; }
.auth-card .btn-primary { height: 56px; margin-top: 4px; }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 7px; padding-top: 4px; color: var(--muted); font-size: 12px; }
.auth-foot .ms { font-size: 16px; color: var(--teal); }
@media (max-width: 960px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { min-height: 360px; padding: 30px 24px; background-position: 62% 42%; }
  .auth-brand::after { left: 24px; }
  .auth-story { padding-top: 86px; }
  .auth-brand h1 { max-width: 14ch; font-size: clamp(34px, 8vw, 48px); }
  .auth-brand .lead, .feature-list, .auth-proof { display: none; }
  .auth-card { width: min(100%, 560px); padding: 42px 24px 54px; }
}
@media (max-width: 520px) {
  .auth-brand { min-height: 285px; background-position: 66% center; }
  .auth-story { padding-top: 54px; }
  .auth-kicker { margin-bottom: 12px; font-size: 10px; }
  .auth-brand h1 { font-size: 32px; }
  .auth-card { padding-top: 34px; }
  .auth-card-head h2 { font-size: 25px; }
}

/* ================================================================ SHELL */
.shell { min-height: 100vh; display: grid; grid-template-columns: 272px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.side-brand .brand-name { font-size: 18px; }
.side-brand small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: -2px; }
.side-section { display: flex; flex-direction: column; gap: 4px; }
.side-title { padding: 0 10px 6px; }
.path-card { margin: 0 4px; padding: 14px; border-radius: 16px; background: var(--grad-soft); border: 1px solid #dbe4ff; display: flex; gap: 12px; align-items: center; }
.path-card strong { display: block; font-size: 14px; }
.path-card span { font-size: 12px; color: var(--muted); }

/* Vertical stepper */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; position: relative; }
.step { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 500; transition: background .2s, color .2s; }
.step::before { content: ''; position: absolute; left: 25px; top: 40px; width: 2px; height: calc(100% - 28px); background: var(--line); }
.step:last-child::before { display: none; }
.step.done::before { background: linear-gradient(var(--ok), #a7f3d0); }
.step .bubble { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--faint); flex: none; position: relative; z-index: 1; transition: all .3s var(--ease); }
.step .bubble .ms { font-size: 18px; }
.step .num { margin-left: auto; font-family: var(--mono); font-size: 11px; opacity: .7; }
.step.done { color: var(--text-2); cursor: pointer; }
.step.done:hover { background: var(--surface-2); }
.step.done .bubble { background: var(--ok-bg); border-color: #a7f3d0; color: var(--ok); }
.step.current { background: #0f172a; color: #fff; box-shadow: 0 10px 24px -14px rgba(15,23,42,.8); }
.step.current .bubble { background: var(--grad); border-color: transparent; color: #fff; }
.step.skipped { opacity: .55; }
.step.skipped .num { color: var(--brand-ink); opacity: 1; }

.side-progress { margin: 0 6px; }
.side-progress .bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 8px; }
.side-progress .bar span { display: block; height: 100%; background: var(--grad); border-radius: 6px; transition: width .6s var(--ease); }
.side-progress .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.dev-note { margin: 0 4px; border-radius: 14px; padding: 12px 14px; background: #fffbeb; border: 1px dashed #fcd34d; font-size: 12.5px; color: #92400e; line-height: 1.5; }
.dev-note .eyebrow { color: #b45309; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.dev-note .eyebrow .ms { font-size: 15px; }
.support-card { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); text-decoration: none; color: var(--text-2); font-size: 13.5px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.support-card:hover { border-color: #bae6fd; box-shadow: var(--shadow); transform: translateY(-1px); }
.support-card strong { display: block; color: var(--text); font-size: 13.5px; }
.support-card span { font-size: 12px; color: var(--muted); }

/* Top bar */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 68px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: rgba(244, 247, 251, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar .crumbs { display: flex; flex-direction: column; min-width: 0; }
.topbar .crumbs .eyebrow { font-size: 11px; }
.topbar .crumbs h1 { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.topbar .mobile-brand { display: none; }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions form { margin: 0; }
.mobile-progress { display: none; height: 4px; background: var(--line); }
.mobile-progress span { display: block; height: 100%; background: var(--grad); transition: width .5s var(--ease); }

.content { padding: 28px; max-width: 1360px; width: 100%; margin: 0 auto; flex: 1; }
.screen { animation: fadeUp .5s var(--ease) both; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.card-pad { padding: 26px; }
.card-head { display: flex; align-items: center; gap: 14px; }
.card-head h2 { font-size: 20px; font-weight: 700; }
.card-head p { color: var(--muted); font-size: 13.5px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-head h2 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.03em; }
.page-head p { color: var(--muted); max-width: 60ch; margin-top: 6px; }

/* ============================================================== WELCOME */
.hero { position: relative; overflow: hidden; padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; gap: 26px; }
.hero::after { content: ''; position: absolute; width: 520px; height: 520px; right: -220px; top: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(14,165,233,.14), transparent 65%); pointer-events: none; }
.hero h2 { font-size: clamp(30px, 3.8vw, 46px); line-height: 1.06; font-weight: 800; letter-spacing: -.035em; max-width: 18ch; }
.hero .lead { font-size: 16.5px; color: var(--muted); max-width: 56ch; }
.path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.path-opt { position: relative; text-align: left; cursor: pointer; border: 1.5px solid var(--line); background: var(--surface); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: border-color .2s, box-shadow .25s, transform .25s var(--ease); }
.path-opt:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c7d2fe; }
.path-opt.active { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(99, 102, 241, .12), var(--shadow); }
.path-opt.active::after { content: 'check'; font-family: 'Material Symbols Rounded'; position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-2); color: #fff; font-size: 15px; display: flex; align-items: center; justify-content: center; animation: pop .3s var(--ease); }
.path-opt strong { font-size: 15px; }
.path-opt span.sub { font-size: 12.5px; color: var(--muted); }
.kit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kit { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.price-tag { display: inline-flex; align-items: baseline; gap: 6px; padding: 10px 16px; border-radius: 14px; background: var(--grad-soft); border: 1px solid #dbe4ff; font-size: 14px; color: #3730a3; }
.price-tag strong { font-size: 22px; font-weight: 800; color: #312e81; }

/* Showcase panel (right column) */
.showcase { padding: 22px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.showcase-photo { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.showcase-photo img { width: 100%; }
.showcase-photo .scanline { position: absolute; top: 0; bottom: 0; width: 18%; background: linear-gradient(90deg, transparent, rgba(14,165,233,.35), transparent); border-right: 2px solid rgba(14,165,233,.8); animation: scan 2.8s var(--ease) infinite; }
.showcase-photo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.showcase-photo svg .ln { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.4s var(--ease) forwards; }
.showcase-photo svg .pt { transform-box: fill-box; transform-origin: center; animation: pop .5s var(--ease) both; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 12px; }
.stat .v { font-family: var(--mono); font-size: 20px; font-weight: 600; white-space: nowrap; }
.stat .v small { font-size: 12px; color: var(--muted); font-family: var(--font); font-weight: 500; }
.stat .k { font-size: 12px; color: var(--muted); }
.how { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: center; font-size: 13.5px; color: var(--text-2); }
.how li .n { width: 24px; height: 24px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }

/* =============================================================== SOURCE */
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.option { position: relative; cursor: pointer; text-align: left; border: 1.5px solid var(--line); border-radius: 24px; background: var(--surface); padding: 28px; min-height: 240px; display: flex; flex-direction: column; gap: 18px; transition: transform .25s var(--ease), box-shadow .25s, border-color .2s; overflow: hidden; }
.option:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c7d2fe; }
.option h3 { font-size: 20px; font-weight: 700; }
.option p { color: var(--muted); font-size: 14px; }
.option .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand-ink); font-size: 14px; }
.option .go .ms { transition: transform .2s; }
.option:hover .go .ms { transform: translateX(4px); }
.option input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.option.featured { background: linear-gradient(160deg, #f0f9ff, #eef2ff); border-color: #c7d2fe; }

/* ============================================================== CAPTURE */
.cam-stage { position: relative; border-radius: 24px; overflow: hidden; background: #0b1220; aspect-ratio: 4 / 3; max-height: 72vh; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); }
.cam-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-stage video.mirror { transform: scaleX(-1); }
.cam-idle { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 24px; color: #e2e8f0; }
.cam-idle h3 { font-size: 19px; font-weight: 700; color: #fff; }
.cam-idle p { font-size: 14px; color: #94a3b8; max-width: 38ch; }
.cam-guides { position: absolute; inset: 0; pointer-events: none; z-index: 2; display: flex; align-items: center; justify-content: center; }
.cam-guides .oval { width: 40%; aspect-ratio: 3 / 4; border-radius: 50%; border: 2.5px dashed rgba(255,255,255,.6); transition: border-color .3s, box-shadow .3s; }
.cam-guides.ok .oval { border-color: #34d399; border-style: solid; box-shadow: 0 0 0 9999px rgba(16,185,129,.06), 0 0 40px rgba(52,211,153,.5); }
.cam-guides .eyeline { position: absolute; left: 14%; right: 14%; top: 47%; /* fallback; app.js sets 65 % up the oval */ border-top: 1.5px solid rgba(56,189,248,.9); }
.cam-guides .eyeline::before { content: 'EYE LEVEL'; position: absolute; top: -20px; left: 0; font: 600 10.5px var(--mono); color: #7dd3fc; letter-spacing: .08em; }
.cam-hud { position: absolute; z-index: 3; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.hud-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(15,23,42,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font: 600 11.5px var(--mono); }
.hud-pill .dot { color: #f43f5e; }
.cam-controls { position: absolute; z-index: 3; bottom: 20px; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 22px; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; background: rgba(255,255,255,.2); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.shutter span { width: 60px; height: 60px; border-radius: 50%; background: #fff; transition: background .2s; }
.shutter:hover span { background: #e0f2fe; }
.shutter:active { transform: scale(.94); }
.cam-round { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(15,23,42,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.flash { position: absolute; inset: 0; z-index: 5; background: #fff; animation: flash .45s ease-out forwards; pointer-events: none; }
.cam-msg { position: absolute; z-index: 3; bottom: 112px; left: 50%; transform: translateX(-50%); padding: 8px 14px; border-radius: 12px; background: rgba(15,23,42,.72); color: #fff; font-size: 13px; font-weight: 600; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }

.instr { display: grid; gap: 14px; }
.instr-block { display: flex; gap: 14px; }
.instr-block ol { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; line-height: 1.8; }
.instr-block strong { font-size: 14.5px; }
.checks { display: flex; flex-direction: column; }
.check { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.check:last-child { border-bottom: 0; }
.check .label { flex: 1; font-size: 14px; font-weight: 500; }
.check .val { font: 600 11.5px var(--mono); color: var(--muted); }
.check .state { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.check .state .ms { font-size: 18px; font-variation-settings: 'FILL' 1; }
.check.wait .state { background: var(--surface-2); color: var(--faint); }
.check.run .state { background: #e0f2fe; color: var(--brand); }
.check.run .state .ms { animation: spin 1s linear infinite; }
.check.pass .state { background: var(--ok-bg); color: var(--ok); animation: pop .35s var(--ease); }
.check.fail .state { background: var(--bad-bg); color: var(--bad); }
.check.skip .state { background: var(--warn-bg); color: var(--warn); }

/* =============================================================== REVIEW */
.photo-frame { position: relative; border-radius: 24px; background: #0b1220; padding: 18px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); overflow: hidden; }
.photo-frame img { border-radius: 14px; max-height: 64vh; width: auto; max-width: 100%; animation: zoomIn .6s var(--ease) both; }
.photo-frame .tag { position: absolute; top: 28px; left: 28px; }
.qa-list { display: grid; gap: 10px; }
.qa { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }

/* ======================================================= FRAME SIZE */
.measure-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; overflow: hidden; }
.measure-visual { background: linear-gradient(160deg, #f0f9ff, #f5f3ff); padding: 30px; display: flex; flex-direction: column; justify-content: center; gap: 18px; border-right: 1px solid var(--line); }
.measure-visual svg { width: 100%; height: auto; }
.measure-visual .bar { animation: barGrow 1.1s var(--ease) both; transform-box: fill-box; }
.measure-form { padding: 30px; display: flex; flex-direction: column; gap: 18px; }
.measure-form h3 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.ruler-tip { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 500; user-select: none; background: none; border: 0; padding: 0; text-align: left; }
.toggle .sw { width: 40px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.toggle.on .sw { background: var(--brand-2); }
.toggle.on .sw::after { transform: translateX(16px); }
.big-input .input-wrap { height: 64px; }
.big-input .input-wrap input { font-family: var(--mono); font-size: 26px; font-weight: 600; }
.substeps { display: flex; gap: 6px; }
.substeps span { height: 5px; flex: 1; border-radius: 9px; background: var(--line); }
.substeps span.on { background: var(--grad); }

/* ============================================================== VERIFY */
.verify-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.stage-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.stage-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ai-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: #fff; background: linear-gradient(135deg, #06b6d4, #8b5cf6, #ec4899); background-size: 200% 200%; animation: gradShift 6s ease infinite; box-shadow: 0 10px 22px -12px rgba(139,92,246,.8); }
.ai-btn[disabled] { opacity: .7; cursor: progress; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-left: auto; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 3px; }
.stage-outer { background: #0b1220; border-radius: 16px; padding: 22px 24px 28px; display: flex; justify-content: center; }
.stage { position: relative; width: 100%; user-select: none; touch-action: pan-x pan-y; }
.guide, .chip-pt, .pupil { touch-action: none; } /* handles capture the gesture; the photo itself can be panned */
.stage-img { position: relative; border-radius: 10px; overflow: hidden; background: #fff; }
.stage-img img { width: 100%; pointer-events: none; }
.stage-dim { position: absolute; inset: 0; background: rgba(2, 6, 23, .08); transition: background .4s; pointer-events: none; }
.stage.scanning .stage-dim { background: rgba(2, 6, 23, .42); }
.stage .scan { position: absolute; top: 0; bottom: 0; width: 14%; background: linear-gradient(90deg, transparent, rgba(56,189,248,.55), transparent); border-right: 2px solid #7dd3fc; animation: scan 1s linear infinite; pointer-events: none; }
.guide { position: absolute; display: flex; align-items: center; justify-content: center; }
.guide .ln { box-shadow: 0 0 0 1px rgba(255,255,255,.35); border-radius: 2px; }
.guide.sel .ln { box-shadow: 0 0 12px currentColor; }
.chip-pt { position: absolute; transform: translate(-50%, -50%); width: 20px; height: 20px; border-radius: 7px; color: #fff; font: 700 11px var(--mono); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.chip-pt.sel { outline: 2px solid #fff; }
.pupil { position: absolute; width: 30px; height: 30px; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid var(--c-pupil); background: rgba(168,85,247,.18); cursor: move; display: flex; align-items: center; justify-content: center; }
.pupil::before, .pupil::after { content: ''; position: absolute; background: var(--c-pupil); }
.pupil::before { left: -10px; right: -10px; top: 50%; height: 1px; }
.pupil::after { top: -10px; bottom: -10px; left: 50%; width: 1px; }
.pupil i { width: 6px; height: 6px; border-radius: 50%; background: #fff; z-index: 1; }
.pupil b { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); font: 700 10.5px var(--mono); color: #fff; background: #7e22ce; padding: 1px 6px; border-radius: 6px; }
.pupil.sel { box-shadow: 0 0 0 3px #fff, 0 0 18px var(--c-pupil); }
.animating .guide, .animating .chip-pt, .animating .pupil { transition: all .9s var(--ease); }
.loupe { position: absolute; top: 10px; right: 10px; width: 132px; height: 132px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 12px 30px rgba(0,0,0,.45); background-color: #fff; background-repeat: no-repeat; pointer-events: none; z-index: 6; }
.loupe::before, .loupe::after { content: ''; position: absolute; background: #f43f5e; }
.loupe::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.loupe::after { top: 50%; left: 0; right: 0; height: 1px; }
.loupe span { position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 600 11px var(--mono); color: #fff; background: #0f172a; padding: 2px 8px; border-radius: 6px; }
.stage-foot { display: flex; justify-content: space-between; font: 600 11px var(--mono); color: var(--muted); padding: 0 4px; }
.pt-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; }
.pt-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; transition: background .15s; }
.pt-row:hover { background: var(--surface-2); }
.pt-row.sel { background: #eef6ff; }
.pt-row .lt { width: 22px; height: 22px; border-radius: 7px; color: #fff; font: 700 11px var(--mono); display: flex; align-items: center; justify-content: center; flex: none; }
.pt-row .nm { flex: 1; font-size: 13.5px; font-weight: 500; }
.pt-row .co { font: 500 12px var(--mono); color: var(--muted); }
.size-box { padding: 14px; border-radius: 14px; background: linear-gradient(160deg, #f0f9ff, #f5f3ff); border: 1px solid #dbe4ff; display: flex; flex-direction: column; gap: 6px; }
.size-box .v { font: 600 15px var(--mono); }

/* ============================================================= PAYMENT */
.locked-preview { position: relative; padding: 26px; overflow: hidden; background: linear-gradient(160deg, #0f172a, #1e1b4b); color: #fff; border: 0; min-height: 320px; display: flex; flex-direction: column; justify-content: center; }
.locked-preview .blur-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; filter: blur(8px); opacity: .7; }
.locked-preview .blur-grid div { padding: 18px; border-radius: 16px; background: rgba(255,255,255,.08); }
.locked-preview .blur-grid b { font: 600 34px var(--mono); }
.lock-over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.lock-over h3 { font-size: 21px; font-weight: 800; }
.lock-over p { color: #c7d2fe; font-size: 14px; max-width: 34ch; }
.lock-badge { width: 64px; height: 64px; border-radius: 20px; background: rgba(255,255,255,.12); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; animation: bob 3s ease-in-out infinite; }
.lock-badge .ms { font-size: 32px; }
.checkout { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.line-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.line-item .price { font: 700 28px var(--mono); }
.pay-methods { display: flex; flex-direction: column; gap: 10px; }
#pp-buttons { min-height: 50px; }
.secure-row { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-flag { font-size: 12px; color: var(--warn-ink); background: var(--warn-bg); border: 1px dashed #fcd34d; padding: 8px 12px; border-radius: 10px; display: flex; gap: 8px; align-items: center; }

/* ============================================================= RESULTS */
.results-hero { position: relative; overflow: hidden; padding: clamp(22px, 3vw, 34px); display: flex; flex-direction: column; gap: 24px; }
.results-hero::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--grad); }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.results-head h2 { font-size: clamp(24px, 2.8vw, 32px); font-weight: 800; letter-spacing: -.03em; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { padding: 20px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; animation: fadeUp .6s var(--ease) both; }
.metric:nth-child(2) { animation-delay: .08s; } .metric:nth-child(3) { animation-delay: .16s; } .metric:nth-child(4) { animation-delay: .24s; }
.metric .top { display: flex; justify-content: space-between; align-items: center; }
.metric .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.metric .val { font: 600 44px/1 var(--mono); letter-spacing: -.04em; }
.metric .val small { font: 500 15px var(--font); color: var(--muted); letter-spacing: 0; }
.metric .sub { font-size: 12px; color: var(--muted); }
.metric::after { content: ''; position: absolute; right: -40px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--grad-soft); opacity: .8; }
.calc-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 26px; font: 500 12.5px var(--mono); }
.calc-table div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.calc-table div b { color: var(--text); font-weight: 600; }
.result-photo { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.result-photo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.action-bar { padding: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.action-bar .input-wrap { flex: 2 1 260px; }

/* ================================================================ SENT */
.success { padding: clamp(28px, 5vw, 60px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }
.success h2 { font-size: 30px; font-weight: 800; }
.success p { font-size: 16px; color: var(--text-2); max-width: 56ch; line-height: 1.65; }
.check-anim { width: 96px; height: 96px; }
.check-anim circle { stroke-dasharray: 290; stroke-dashoffset: 290; animation: draw .8s var(--ease) forwards; }
.check-anim path { stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .5s .6s var(--ease) forwards; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall 2.6s ease-in forwards; }

/* ===================================================== OVERLAYS / TOASTS */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .25s ease both; }
.modal { width: min(460px, 100%); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 26px; display: flex; flex-direction: column; gap: 16px; animation: popIn .35s var(--ease) both; }
.modal h3 { font-size: 19px; font-weight: 800; }
.modal ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.modal li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.modal li .ms { color: var(--bad); font-size: 19px; }
.modal ul.tips li .ms { color: #059669; }   /* advice lists (e.g. card photo tips) are not errors */
.analyze { text-align: center; align-items: center; }
.analyze .orb { width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(from 0deg, #0ea5e9, #8b5cf6, #ec4899, #0ea5e9); animation: spin 1.6s linear infinite; display: flex; align-items: center; justify-content: center; }
.analyze .orb span { width: 70px; height: 70px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }
.analyze .orb .ms { font-size: 30px; color: var(--brand-2); animation: none; }
.analyze-steps { text-align: left; width: 100%; }
.analyze-steps li { opacity: .45; transition: opacity .3s; }
.analyze-steps li.on { opacity: 1; }
.analyze-steps li.on .ms { color: var(--ok); }
.toasts { position: fixed; top: 82px; right: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 260px; max-width: 380px; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500; animation: slideIn .35s var(--ease) both; }
.toast.out { animation: slideOut .3s ease forwards; }

/* ============================================================== RECORDS */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: #fafcff; }
.thumb { width: 92px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 18px; display: flex; align-items: center; gap: 14px; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.kpi .k { font-size: 12.5px; color: var(--muted); }
details.rec summary { cursor: pointer; color: var(--brand-ink); font-weight: 600; font-size: 13px; }
details.rec pre { white-space: pre-wrap; font: 12px var(--mono); background: var(--surface-2); padding: 12px; border-radius: 10px; max-height: 320px; overflow: auto; }

/* ============================================================ ANIMATIONS */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
@keyframes scan { 0% { left: -18%; } 100% { left: 100%; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, 24px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes gradShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes barGrow { from { transform: scale(0, 1); opacity: 0; } to { transform: scale(1, 1); opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(24px); } }
@keyframes fall { to { transform: translateY(520px) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ============================================================ RESPONSIVE */
@media (max-width: 1180px) {
  .grid-2:not(.even) { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .verify-wrap { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 0 16px; height: 62px; }
  .topbar .mobile-brand { display: inline-flex; }
  .topbar .crumbs .eyebrow { display: none; }
  .topbar .crumbs h1 { font-size: 16px; }
  .mobile-progress { display: block; position: sticky; top: 62px; z-index: 19; }
  .content { padding: 16px; }
  .grid-2, .grid-2.even, .measure-card { grid-template-columns: 1fr; }
  .measure-visual { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px; }
  .user-pill .name { display: none; }
}
@media (max-width: 640px) {
  .top-actions .chip, .top-actions a.icon-btn { display: none; }
  .topbar .crumbs { flex: 1; }
  .path-grid { grid-template-columns: 1fr; gap: 8px; }
  .path-opt { flex-direction: row; align-items: center; padding: 12px 14px; }
  .hero { gap: 20px; }
  .showcase .how { display: none; }
  .option-grid, .kit-grid { grid-template-columns: 1fr; }
  .metric .val { font-size: 34px; }
  .card-pad, .checkout, .measure-form { padding: 20px; }
  .legend { margin-left: 0; }
  .stage-outer { padding: 18px 14px 24px; }
  .toasts { left: 12px; right: 12px; top: 74px; }
  .toast { max-width: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .btn-lg { width: 100%; }
}

/* ================================================================= PRINT */
.print-only { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .sidebar, .topbar, .mobile-progress, .io-noprint, .toasts, .overlay { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .print-only { display: block; }
  .card { box-shadow: none; border-color: #ddd; }
  .metric { break-inside: avoid; }
  .metric::after { display: none; }
  .screen { animation: none; }
}

/* Verification zoom (precise placement on small screens) */
.zoom-ctl { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.zoom-ctl .icon-btn { width: 34px; height: 34px; }
.zoom-ctl .icon-btn[disabled] { opacity: .35; cursor: default; }
.zoom-ctl span { font-size: 12px; min-width: 26px; text-align: center; color: var(--text-2); }
.stage-outer.zoomed { justify-content: flex-start; overflow: auto; max-height: 70vh; }

/* ========================================================================== 
   Enterprise optical theme
   These refinements keep the workflow intact while giving every screen a
   more precise, confident visual hierarchy.
   ========================================================================== */

/* Icon language */
.ic { --tone: var(--brand); width: 40px; height: 40px; border-radius: 9px; color: var(--tone); background: color-mix(in srgb, var(--tone) 10%, #fff); border: 1px solid color-mix(in srgb, var(--tone) 22%, #fff); box-shadow: none; }
.ic.sm { width: 32px; height: 32px; border-radius: 8px; }
.ic.lg { width: 48px; height: 48px; border-radius: 11px; }
.ic.xl { width: 60px; height: 60px; border-radius: 13px; }
.ic-sky { --tone: #087ec4; }
.ic-indigo { --tone: #165dff; }
.ic-violet { --tone: #6d4bd1; }
.ic-emerald, .ic-teal { --tone: #008f80; }
.ic-amber { --tone: #d36a16; }
.ic-rose, .ic-pink { --tone: #d94b63; }
.ic-slate { --tone: #53657c; }

/* Controls */
.btn { border-radius: 9px; font-weight: 700; letter-spacing: -.005em; }
.btn-primary { background: var(--brand); box-shadow: 0 10px 24px -15px rgba(22, 93, 255, .8); }
.btn-primary:hover:not([disabled]) { background: var(--brand-2); box-shadow: 0 14px 30px -18px rgba(22, 93, 255, .95); }
.btn-dark { background: var(--navy); }
.btn-success { background: var(--teal); box-shadow: 0 10px 24px -16px rgba(0, 168, 150, .9); }
.btn-ghost { border-color: var(--line-2); background: #fff; }
.btn-ghost:hover:not([disabled]) { border-color: #aebbd0; background: #f7f9fc; }
.btn-soft { color: var(--brand-ink); background: #edf4ff; }
.btn-lg { border-radius: 10px; }
.btn-sm { border-radius: 8px; }
.icon-btn { border-radius: 8px; }
.input-wrap { border-radius: 9px; background: #fff; }
.input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 93, 255, .12); }
.chip { height: 27px; border-radius: 7px; padding: 0 10px; font-size: 12px; }
.chip-brand { color: #0b4ec7; background: #edf4ff; border-color: #d5e3ff; }
.chip-ok { color: #087b6e; background: #edfbf8; border-color: #bcece3; }
.eyebrow { color: #687b95; font-size: 11px; letter-spacing: .13em; }
.alert { border-radius: 10px; }

/* Application frame */
.shell { grid-template-columns: 286px 1fr; }
.sidebar { padding: 26px 18px 20px; gap: 24px; background: #fff; border-right-color: #dfe6ef; }
.side-brand { padding: 0 8px 2px; }
.side-brand .logo-mark { width: 38px; height: 38px; border-radius: 9px; box-shadow: none; }
.side-brand .brand-name { font-size: 17px; }
.side-brand small { color: #76869c; }
.path-card { margin: 0; padding: 15px 14px; border-radius: 10px; color: var(--text); background: #f6f9ff; border: 1px solid #dce6f6; border-left: 3px solid var(--brand); }
.path-card .ic { background: #fff; }
.side-title { padding-left: 8px; }
.step { min-height: 46px; padding: 7px 9px; border-radius: 8px; font-size: 13.5px; }
.step::before { left: 24px; top: 39px; background: #dce3ec; }
.step .bubble { width: 31px; height: 31px; border-radius: 8px; background: #fff; }
.step.done:hover { background: #f7f9fc; }
.step.done .bubble { color: #008f80; background: #edfbf8; border-color: #bcece3; }
.step.current { color: #0b4ec7; background: #edf4ff; box-shadow: inset 3px 0 0 var(--brand); }
.step.current .bubble { color: #fff; background: var(--brand); border-color: var(--brand); }
.side-progress .bar { height: 4px; background: #e3e8f0; }
.side-progress .bar span { background: var(--brand); }
.dev-note { display: none !important; }
.support-card { margin-top: auto; border-radius: 10px; background: #fbfcfe; }
.support-card:hover { border-color: #b9cae3; box-shadow: var(--shadow); transform: translateY(-1px); }

.topbar { height: 72px; padding: 0 32px; background: rgba(255,255,255,.96); border-bottom-color: #dfe6ef; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.topbar .crumbs h1 { font-family: var(--display); font-size: 18px; }
.topbar .icon-btn { border: 1px solid transparent; }
.topbar .icon-btn:hover { border-color: var(--line); background: #f6f8fb; }
.top-actions { gap: 6px; }
.user-pill { border-radius: 9px; background: #f7f9fc; }
.avatar { border-radius: 7px; background: var(--brand); }
.mobile-progress { height: 3px; }
.mobile-progress span { background: var(--brand); }
.content { max-width: 1480px; padding: 32px 36px 46px; }

/* Shared surfaces */
.card { border-color: #dfe6ef; border-radius: 14px; box-shadow: var(--shadow); }
.card-pad { padding: 28px; }
.card-head h2 { font-size: 19px; }
.grid-2 { gap: 22px; }
.page-head { margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-head h2 { font-size: clamp(26px, 2.5vw, 34px); }

/* Welcome screen */
.hero { gap: 28px; padding: clamp(30px, 4vw, 48px); border-top: 4px solid var(--brand); }
.hero::after { width: 270px; height: 270px; right: -54px; top: -54px; border-radius: 0; opacity: .75; background-image: linear-gradient(rgba(22,93,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(22,93,255,.08) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(135deg, #000, transparent 72%); }
.hero h2 { max-width: 16ch; font-size: clamp(34px, 3.5vw, 48px); line-height: 1.04; letter-spacing: -.052em; }
.hero .lead { color: #566980; font-size: 16px; line-height: 1.65; }
.path-grid { gap: 10px; }
.path-opt { min-height: 124px; padding: 16px; border-width: 1px; border-radius: 10px; gap: 14px; }
.path-opt:hover { border-color: #a8bfe8; box-shadow: 0 12px 30px -26px rgba(7,26,51,.5); transform: translateY(-1px); }
.path-opt.active { border-color: var(--brand); background: #f5f8ff; box-shadow: inset 0 0 0 1px var(--brand); }
.path-opt.active::after { top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 6px; background: var(--brand); }
.kit { min-height: 54px; padding: 11px 12px; border-radius: 9px; background: #f8fafc; }
.price-tag { border-radius: 9px; color: #87400e; background: #fff7ed; border-color: #fed7aa; }
.price-tag strong { color: #9a3412; }
.showcase { padding: 24px; gap: 18px; color: #fff; background: var(--navy); border-color: var(--navy); box-shadow: 0 26px 60px -34px rgba(7,26,51,.9); }
.showcase .eyebrow { color: #9fb2ca; }
.showcase .chip-ok { color: #7ee5d9; background: rgba(0,168,150,.12); border-color: rgba(126,229,217,.3); }
.showcase-photo { border-radius: 10px; border-color: rgba(255,255,255,.18); }
.showcase .stat { border-radius: 9px; color: #fff; background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.12); }
.showcase .stat .k, .showcase .stat .v small { color: #9fb2ca; }
.showcase .ic { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #90c8ff; }
.showcase .how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.showcase .how li { color: #bfd0e3; }
.showcase .how li .n { border-radius: 6px; color: #dce8f5; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); }

/* Source, capture and review */
.option-grid { gap: 16px; }
.option { min-height: 230px; padding: 28px; border-radius: 13px; border-width: 1px; }
.option::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--line-2); }
.option.featured { background: #f6f9ff; border-color: #b9d0ff; }
.option.featured::before { background: var(--brand); }
.option:hover { border-color: #9fb9df; box-shadow: 0 22px 50px -34px rgba(7,26,51,.7); transform: translateY(-2px); }
.option .go { color: var(--brand-ink); }
.cam-stage, .photo-frame { border-radius: 14px; box-shadow: 0 26px 60px -36px rgba(7,26,51,.8); }
.cam-stage { background: #06162c; }
.cam-msg, .hud-pill { border-radius: 7px; }
.check .state { border-radius: 7px; }
.photo-frame img { border-radius: 9px; }

/* Measurement and verification */
.measure-card { border-radius: 14px; }
.measure-visual { background: #f5f8fc; }
.measure-form h3 { font-size: 25px; }
.ruler-tip { border-radius: 9px; }
.substeps span { height: 4px; }
.substeps span.on { background: var(--brand); }
.stage-card { border-radius: 14px; }
.stage-outer { border-radius: 10px; background: #06162c; }
.stage-img { border-radius: 7px; }
.ai-btn { border-radius: 8px; background: var(--teal); box-shadow: 0 10px 24px -16px rgba(0,168,150,.9); animation: none; }
.chip-pt { border-radius: 5px; }
.pt-row, .size-box { border-radius: 9px; }

/* Checkout, results and feedback */
.checkout { border-radius: 14px; }
.pay-methods { gap: 10px; }
.secure-row .chip { border-radius: 7px; }
.results-hero { border-top: 4px solid var(--teal); }
.metric { border-radius: 10px; box-shadow: none; }
.metric::after { border-radius: 0; }
.action-bar { border-radius: 12px; }
.modal { border-radius: 14px; }
.analyze .orb { background: conic-gradient(from 0deg, var(--brand), var(--teal), var(--brand)); }
.toast { border-radius: 10px; }

/* Records */
.kpi-grid { gap: 16px; }
.kpi { position: relative; min-height: 102px; padding: 20px; overflow: hidden; }
.kpi::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brand); }
.kpi:nth-child(2)::before { background: var(--teal); }
.kpi:nth-child(3)::before { background: #6d4bd1; }
.kpi:nth-child(4)::before { background: var(--coral); }
.kpi .v { font-family: var(--display); font-size: 28px; }
table.data th { background: #f6f8fb; }
table.data tr:hover td { background: #f8fbff; }
.thumb { border-radius: 6px; }
details.rec pre { border-radius: 8px; }

@media (max-width: 1180px) {
  .showcase .how { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { height: 64px; padding: 0 18px; }
  .mobile-progress { top: 64px; }
  .content { padding: 22px 18px 38px; }
  .grid-2:not(.even), .grid-2.even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .card { border-radius: 12px; }
  body > .topbar .crumbs { display: none; }
  .hero { padding: 26px 20px; gap: 22px; }
  .hero h2 { font-size: 34px; }
  .path-opt { min-height: 0; }
  .showcase { padding: 19px; }
  .showcase .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { min-height: 92px; padding: 16px; }
}

/* ============================================================== ADMIN AREA */
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14px; transition: background .15s, color .15s; }
.nav-link .ms { font-size: 20px; color: var(--muted); }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--navy, #071a33); color: #fff; }
.nav-link.active .ms { color: #fff; }
.admin-side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.admin-tabs { display: none; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.empty { text-align: center; padding: 40px !important; color: var(--muted); }
.nowrap { white-space: nowrap; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; }
.filter-bar .input-wrap { flex: 1 1 260px; height: 44px; }
.filter-bar select { height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--surface); font: inherit; color: var(--text); }
/* 14-day bar chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 210px; padding-top: 20px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.bar-stack { width: 100%; max-width: 34px; min-height: 2px; display: flex; flex-direction: column; border-radius: 6px 6px 2px 2px; overflow: hidden; background: var(--line); animation: barRise .8s var(--ease) both; transform-origin: bottom; }
.bar-stack i { display: block; min-height: 3px; }
.bar-val { font: 600 11px var(--mono); color: var(--text-2); }
.bar-lbl { font: 500 11px var(--mono); color: var(--muted); padding: 6px 0 4px; }
.seg-A { background: #3b82f6; } .seg-B { background: #8b5cf6; } .seg-C { background: #10b981; }
.legend-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.mix { display: flex; flex-direction: column; gap: 18px; }
.mix-row { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.seg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.mix-bar { height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.mix-bar span { display: block; height: 100%; border-radius: 10px; animation: barGrow .9s var(--ease) both; transform-origin: left; }
.mix-foot { display: flex; align-items: center; gap: 6px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
.mix-foot .ms { font-size: 17px; }
.kv { display: grid; gap: 0; font-size: 13.5px; }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; word-break: break-all; }
.mini-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mini-metrics div { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.mini-metrics span { font-size: 12px; color: var(--muted); }
.mini-metrics b { font: 600 22px var(--mono); }
.cust { display: inline-flex; align-items: center; gap: 10px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
/* admin login */
.admin-login-body { min-height: 100vh; background: radial-gradient(900px 500px at 100% 0%, #e6efff, transparent 60%), var(--bg); }
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.admin-login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 30px; display: flex; flex-direction: column; gap: 20px; animation: fadeUp .5s var(--ease) both; }
.admin-login-card h1 { font-size: 24px; }
@keyframes barRise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (max-width: 1180px) { .admin-grid { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 62px; z-index: 18; }
  .admin-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; white-space: nowrap; text-decoration: none; color: var(--text-2); font-size: 13px; font-weight: 600; border: 1px solid var(--line); }
  .admin-tabs a .ms { font-size: 17px; }
  .admin-tabs a.active { background: var(--navy, #071a33); color: #fff; border-color: transparent; }
  .mini-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) { body.admin .top-actions .chip { display: none; } }

/* Phones are held upright: use a portrait camera box so the upright video is
   not cropped, and keep the guidance message clear of the face and shutter. */
@media (max-width: 640px) {
  .cam-stage { aspect-ratio: 3 / 4; max-height: 74vh; }
  .cam-msg { bottom: auto; top: 56px; }
}

/* "Use phone camera app" – a label wrapping a hidden file input (opens the
   native camera at full resolution; used on iPhone where Safari cannot take
   full-resolution stills from the browser). */
.native-cam { position: relative; overflow: hidden; cursor: pointer; }
.native-cam input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

/* iPhone Safari zooms the page when an input's text is under 16px. */
@media (max-width: 980px) {
  input, select, textarea, .input-wrap input { font-size: 16px; }
}

/* ---------------------------------------------------------------------------
   Card-reference photo (frame size without a ruler)
   --------------------------------------------------------------------------- */
.card-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.card-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; }
.measure-form label.btn { position: relative; overflow: hidden; }
.measure-form label.btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.card-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.card-size { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2, #f8fafc); }
.card-size span { font: 700 11px var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.card-size b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.card-size b small { font-size: 12px; font-weight: 600; color: var(--muted); }
.card-size em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.card-size.bad { border-color: #fda4af; background: #fff1f2; }
.card-size.bad b { color: #be123c; }
.card-pts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.card-pts button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 8px; font-size: 12.5px; cursor: pointer; text-align: left; }
.card-pts button.sel { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.card-pts button span { width: 20px; height: 20px; border-radius: 6px; color: #fff; font: 700 11px var(--mono); display: inline-flex; align-items: center; justify-content: center; flex: none; }
#cardStage .guide, #cardStage .chip-pt { touch-action: none; }

/* Verification one eye at a time (client feedback 27 Oct: the finger hid the point) */
.vsteps { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.vsteps button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; border: 0; border-radius: 9px; background: none; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--text-2); }
.vsteps button b { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; background: var(--line); color: var(--text-2); }
.vsteps button .ms { font-size: 18px; }
.vsteps button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(15,23,42,.12); }
.vsteps button.on b { background: #4338ca; color: #fff; }
.vsteps button[disabled] { opacity: .5; cursor: default; }
.stage-view { position: relative; width: 100%; }
.stage-view.crop { overflow: hidden; border-radius: 10px; background: #fff; }
.stage-view.crop .stage-img { border-radius: 0; }
.chip-pt.pupil-handle .ms { font-size: 15px; }
.nudge-pad { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.nudge-pad .lt { width: 22px; height: 22px; border-radius: 7px; color: #fff; font: 700 11px var(--mono); display: flex; align-items: center; justify-content: center; flex: none; }
.nudge-pad .nm { flex: 1; font-size: 13px; font-weight: 600; min-width: 110px; }
.nudge-pad .icon-btn { width: 44px; height: 40px; border: 1px solid var(--line); border-radius: 10px; }
.nudge-pad .icon-btn[disabled] { opacity: .3; cursor: default; }
@media (pointer: coarse) {
  #stage .chip-pt { width: 28px; height: 28px; font-size: 13px; }
  .vsteps button { height: 42px; }
}
.vsteps button { white-space: nowrap; }
.nudge-pad { flex-wrap: nowrap; }
.nudge-pad .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .vsteps button { font-size: 12.5px; gap: 5px; }
  .vsteps button .ms { display: none; }
  .nudge-pad { gap: 4px; padding: 6px; }
  .nudge-pad .icon-btn { width: 40px; flex: none; }
}
#overlay .chip-pt { z-index: 3; } /* a letter always wins over a line hit zone it overlaps */
