/* Design: gallery white, quiet hairlines, a warm serif for headlines (Source Serif 4) and a clean
   humanist sans for everything you read or tap (Figtree), close to Warby Parker's pairing. Both are open fonts, self-hosted. */
@font-face { font-family: "Figtree"; src: url("/fonts/figtree.woff2?v=1") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url("/fonts/source-serif.woff2?v=1") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
:root {
  --paper: #ffffff;
  --surface: #ffffff;
  --soft: #f7f7f5;
  --ink: #121417;
  --ink-2: #63666b;
  --ink-3: #8d9095;
  --line: #e8e8e5;
  --line-2: #d6d6d2;
  --accent: #1c3557;
  --accent-ink: #ffffff;
  --accent-soft: #eef2f7;
  --bench: #f5f4f2;
  --bench-line: #a9a9a4;
  --ok: #2f6b45;
  --ok-soft: #ebf4ee;
  --warn: #8a5a12;
  --warn-soft: #fbf3e4;
  --bad: #a43a35;
  --bad-soft: #f9ebea;
  --shadow: 0 1px 2px rgba(18, 20, 23, 0.04), 0 12px 32px rgba(18, 20, 23, 0.08);
  --shadow-lg: 0 2px 6px rgba(18, 20, 23, 0.05), 0 24px 64px rgba(18, 20, 23, 0.16);
  --serif: "Source Serif", Georgia, "Times New Roman", serif;
  --font: "Figtree", "Helvetica Neue", -apple-system, system-ui, "Segoe UI", Arial, sans-serif;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; }
h1 { font-size: 34px; }
h2 { font-size: 23px; }
h3, h4 { font-size: 15px; font-weight: 600; letter-spacing: 0.005em; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.tiny { font-size: 13px; line-height: 1.5; }
.center-text { text-align: center; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: #dfe7f2; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- buttons & inputs ---------- */
.btn {
  appearance: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0.005em; padding: 10px 18px; border-radius: 999px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  min-height: 44px; text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn[hidden], [hidden] { display: none !important; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #142844; border-color: #142844; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink); padding-inline: 12px; }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 34px; padding: 6px 13px; font-size: 14px; }
.btn.lg { min-height: 52px; padding: 13px 26px; font-size: 16px; }
.btn.block { width: 100%; }
.ic { width: 18px; height: 18px; flex: none; display: inline-block; }
.drop .ic { width: 30px; height: 30px; color: var(--ink-2); }

label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: 0.01em; }
label.field > span.hint { font-weight: 400; color: var(--ink-2); font-size: 13px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="search"], input[type="password"], select, textarea {
  font: inherit; font-size: 15px; font-weight: 400; letter-spacing: normal; color: var(--ink); background-color: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 12px; width: 100%; min-height: 44px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23121417' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: #bdbdb8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(28, 53, 87, 0.12); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid3, .grid4 { grid-template-columns: 1fr 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.stack.lg { gap: 28px; }

/* chips & pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 36px; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.chip:hover { border-color: var(--ink); }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- app chrome ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1280px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); }
.brand-mark { width: 40px; height: 20px; flex: none; color: var(--ink); }
.brand-name { font-family: var(--serif); font-weight: 500; font-size: 21px; letter-spacing: 0.01em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; color: var(--ink-2); letter-spacing: 0.04em; }
.topbar .spacer { flex: 1; }
.tabs { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 12px 13px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; border-bottom: 2px solid transparent; white-space: nowrap; display: flex; gap: 8px; align-items: center; transition: color 0.15s, border-color 0.15s; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .count { font-size: 11px; font-weight: 600; background: var(--ink); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; }
main.wrap { max-width: 1280px; margin: 0 auto; padding: 36px 28px 96px; }
.pagehead { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.pagehead p { color: var(--ink-2); max-width: 64ch; margin-top: 8px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--ink); font-size: 14px; }
.notice.info { background: var(--accent-soft); }
.notice b { font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel-pad { padding: 20px; }

/* ---------- frame cards + bench ---------- */
.frame-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px 20px; }
.fcard { background: transparent; border: 0; border-radius: var(--r-md); display: flex; flex-direction: column; text-align: left; font: inherit; color: inherit; padding: 0; }
.fcard > .bench { border-radius: var(--r-md); transition: background 0.2s, box-shadow 0.2s; }
button.fcard { cursor: pointer; }
button.fcard:hover > .bench { background: #efeeeb; }
button.fcard:hover .fcard-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.fcard[aria-pressed="true"] > .bench { box-shadow: inset 0 0 0 1.5px var(--ink); }
.panel.fcard, div.fcard { border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
div.fcard > .bench { border-radius: 0; }
.bench { background: var(--bench); padding: 22px 18px 12px; position: relative; }
.bench svg { width: 100%; height: auto; overflow: visible; }
.bench .tag { position: absolute; top: 12px; left: 12px; }
.fcard-body { padding: 12px 2px 4px; display: grid; gap: 2px; flex: 1; }
div.fcard .fcard-body { padding: 14px 16px 16px; }
.fcard-title { font-weight: 600; font-size: 16px; }
.fcard-meta { font-size: 14px; color: var(--ink-2); }
.fcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.price { font-weight: 500; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--ink); }
.swatch { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.14); display: inline-block; vertical-align: -2px; }
.sizeline { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: #fbfbfa; }
td .name { font-weight: 600; }
.thumbs { display: flex; gap: 4px; }
.thumbs img { width: 54px; height: 24px; object-fit: contain; background: var(--bench); border-radius: 6px; padding: 2px; }

/* ---------- drawer / modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(18, 20, 23, 0.36); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 50; display: flex; justify-content: flex-end; animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.99); } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer { width: min(780px, 100%); height: 100%; background: #fafaf9; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide 0.22s ease-out; }
.drawer-head { padding: 18px 24px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.drawer-head h2 { flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; display: grid; gap: 22px; align-content: start; }
.drawer-foot { padding: 14px 24px max(14px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.scrim.center { justify-content: center; align-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: 100%; overflow-y: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: rise 0.22s ease-out; position: relative; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.drop { border: 1.5px dashed var(--line-2); border-radius: var(--r-md); padding: 22px; display: grid; gap: 8px; justify-items: center; text-align: center; background: var(--surface); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.drop:hover { border-color: var(--ink); background: var(--soft); }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #ecebe8 25%, transparent 25%), linear-gradient(-45deg, #ecebe8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ecebe8 75%), linear-gradient(-45deg, transparent 75%, #ecebe8 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; border-radius: var(--r-md); border: 1px solid var(--line); }
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-row img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.ai-note { font-size: 14px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }

.spinner { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; z-index: 1100; font-size: 15px; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); animation: rise 0.2s ease-out; }

.icon-x { position: absolute; top: 12px; right: 12px; min-height: 40px; width: 40px; padding: 0; }

.ai-tag { position: absolute; top: 6px; left: 6px; background: rgba(18,20,23,0.78); color: #fff; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; pointer-events: none; }
.ai-tag.lg { top: 14px; left: 14px; font-size: 12px; padding: 4px 11px; }

/* picks */
.pick { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.pick img { width: 110px; height: 44px; object-fit: contain; background: var(--bench); border-radius: 8px; padding: 3px; }
.pick textarea { min-height: 40px; font-size: 14px; padding: 6px 8px; }

/* outreach */
.outreach { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .outreach { grid-template-columns: 1fr; } }
.plist { display: grid; }
.plist button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.plist button:hover { background: var(--soft); }
.plist button[aria-current="true"] { background: var(--accent-soft); }
.plist button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.msg { white-space: pre-wrap; font-size: 15px; line-height: 1.6; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; overflow-wrap: anywhere; }
.sms { background: var(--accent-soft); border-radius: 20px 20px 20px 6px; padding: 12px 16px; max-width: 380px; font-size: 15px; overflow-wrap: anywhere; }

/* ---------- patient shop ---------- */
.shop { --gutter: 28px; }
.preview-bar { background: var(--ink); color: #fff; font-size: 14px; }
.preview-bar .in { max-width: 1280px; margin: 0 auto; padding: 8px 28px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.preview-bar select { width: auto; min-height: 32px; padding: 2px 30px 2px 10px; font-size: 14px; background-color: transparent; color: inherit; border-color: rgba(255,255,255,0.35); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); }
.preview-bar select option { color: #121417; }
.preview-bar .btn { min-height: 32px; padding: 3px 12px; font-size: 14px; background: transparent; color: inherit; border-color: rgba(255,255,255,0.35); }
.shop-main { max-width: 1280px; margin: 0 auto; padding: 32px 28px 96px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); grid-template-areas: "stage hello" "stage rest"; grid-template-rows: auto 1fr; column-gap: 48px; row-gap: 28px; align-items: start; }
.shop-main > .stage-col { grid-area: stage; }
.shop-main > #shop-hello { grid-area: hello; }
.shop-main > .shop-rest { grid-area: rest; }
@media (max-width: 960px) { .shop-main { grid-template-columns: 1fr; grid-template-areas: "hello" "stage" "rest"; grid-template-rows: auto; padding-top: 22px; row-gap: 22px; } }
@media (max-width: 640px) { .preview-bar .hint-text { display: none; } .preview-bar .in { padding: 6px 16px; gap: 8px; } }
.stage-col { position: sticky; top: 86px; display: grid; gap: 14px; }
@media (max-width: 960px) { .stage-col { position: static; } }
.stage { position: relative; }

.stage-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stage-tools .spacer { flex: 1; }

.strip { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.strip button { all: unset; box-sizing: border-box; flex: 0 0 148px; scroll-snap-align: start; border-radius: var(--r-md); cursor: pointer; display: grid; gap: 6px; }

.strip button span { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-inline: 2px; }

.strip button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hello { display: grid; gap: 12px; }
.hello h1 { font-size: 40px; line-height: 1.08; }
.hello p { color: var(--ink-2); font-size: 17px; max-width: 46ch; }
@media (max-width: 520px) { .hello h1 { font-size: 31px; } .hello p { font-size: 16px; } }
.rx-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.current { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 14px; }
.current h2 { font-size: 26px; }
.current .why { font-size: 15px; background: var(--soft); border-radius: var(--r-md); padding: 12px 14px; }
.current .why b { font-weight: 600; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select { width: auto; min-height: 38px; padding: 4px 32px 4px 14px; font-size: 14px; border-radius: 999px; }
.bagbtn { position: relative; }
.bagbtn .n { position: absolute; top: -5px; right: -5px; background: var(--ink); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 600; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; }
.line-item { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line-item img { width: 96px; height: 40px; object-fit: contain; background: var(--bench); border-radius: 8px; padding: 3px; }
.totals { display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-weight: 600; font-size: 18px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.slots .chip { text-align: center; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.days .chip { display: grid; justify-items: center; line-height: 1.2; padding: 8px 12px; border-radius: var(--r-md); min-width: 66px; }
.days .chip small { font-size: 12px; opacity: 0.7; }
.confirm { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 36px 22px; }
.confirm h2 { font-size: 28px; }
.confirm svg { width: 56px; height: 56px; }
.footer { text-align: center; color: var(--ink-3); font-size: 13px; letter-spacing: 0.02em; padding: 32px 16px 48px; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 640px) {
  h1 { font-size: 29px; }
  .topbar-in { padding: 10px 16px; gap: 10px; }
  .brand-name { font-size: 19px; }
  main.wrap { padding: 22px 16px 80px; }
  .grid2 { grid-template-columns: 1fr; }
  .shop-main { padding-inline: 16px; }
  .drawer-body { padding: 18px; }
  .pick { grid-template-columns: 80px 1fr; }
  .pick img { width: 80px; }
  .pick > :last-child { grid-column: 1 / -1; }
  .stage { border-radius: var(--r-md); }
  .frame-grid { gap: 22px 14px; }
}

.linkbtn { background: none; border: 0; padding: 0; margin-left: 6px; color: var(--accent); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }

table.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
table.mini th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; padding: 2px 6px 4px 0; }
table.mini td { padding: 4px 6px 4px 0; border-top: 1px solid var(--line); }
table.mini td.num, table.mini th:not(:first-child) { text-align: right; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 640px) {
  .stage-tools .btn.primary { flex: 1 1 100%; }
  .stage-tools > .btn:not(.ghost):not(.primary) { flex: 1 1 40%; }
  .stage-tools .spacer { display: none; }
  .hello h1 { font-size: 31px; }
}


/* ---------- try-on video viewer ---------- */
.reel { --ar: 1.7778; position: relative; width: min(100%, calc(76vh * var(--ar))); aspect-ratio: var(--ar); margin-inline: auto; border-radius: var(--r-lg); overflow: hidden; background: var(--bench); touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.reel:active { cursor: grabbing; }
.reel-poster, .reel-cv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel-cv { opacity: 0; transition: opacity .25s; }
.reel.live .reel-cv { opacity: 1; }
.reel-hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: 44px; height: 30px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: rgba(18, 20, 23, .38); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: opacity .4s; pointer-events: none; }
.reel-hint svg { width: 20px; height: 20px; }
.reel.touched .reel-hint { opacity: 0; }
.reel-load { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .35); transition: opacity .4s; }
.reel-load i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.reel.ready .reel-load { opacity: 0; }
.stage-tools { justify-content: center; min-height: 34px; margin-top: 6px; }
.stage-bench { aspect-ratio: 16 / 10; background: var(--bench); border-radius: var(--r-lg); display: grid; place-items: center; padding: 8%; }
.stage-bench svg { width: 100%; height: auto; }

/* ---------- thumbnails ---------- */
.thumb { all: unset; box-sizing: border-box; position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; width: 100%; background: var(--bench); border-radius: var(--r-md); overflow: hidden; cursor: pointer; transition: box-shadow .15s; }
.thumb > svg { width: 84%; height: auto; }
.thumb .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.thumb .tag { position: absolute; top: 10px; left: 10px; background: rgba(255, 255, 255, .94); }
.thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fcard:hover .thumb .poster, .thumb:hover .poster { transform: scale(1.03); }
.fcard { cursor: pointer; }
.fcard[aria-pressed="true"] .thumb { box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 1.5px var(--ink); }
.fcard-body { gap: 3px; }
.fcard-foot { margin-top: 0; }
.thumb-empty { color: var(--line-2); }
.thumb-empty .brand-mark { width: 64px; height: auto; }
.shop-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 26px 16px; }
.spinner.xs { width: 11px; height: 11px; border-width: 1.5px; }
.strip button { flex-basis: 156px; }
.strip button .thumb { aspect-ratio: 4 / 3; }
.strip button[aria-pressed="true"] .thumb { box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 1.5px var(--ink); }
.strip button > span:last-child { font-size: 13px; font-weight: 600; }
.current .why { font-style: italic; }

/* ---------- frame editor ---------- */
.fe .drawer-body { gap: 30px; padding-bottom: 40px; }
.fe-step { display: grid; gap: 14px; }
.fe-label { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: -0.01em; }
.fe-n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.fe-sub { font-family: var(--font); font-size: 13px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.fe-empty { display: grid; justify-items: center; gap: 12px; padding: 34px 20px 26px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-lg); text-align: center; }
.fe-turn { color: var(--ink-3); animation: turn 3.2s ease-in-out infinite; }
.fe-turn .brand-mark { width: 74px; height: auto; }
@keyframes turn { 0%, 100% { transform: perspective(300px) rotateY(-55deg); } 50% { transform: perspective(300px) rotateY(55deg); } }
.fe-vid { border-radius: var(--r-lg); overflow: hidden; background: var(--bench); display: grid; place-items: center; max-height: 46vh; }
.fe-vid video { width: 100%; max-height: 46vh; object-fit: contain; display: block; }
.fe-wait { display: grid; justify-items: center; gap: 10px; padding: 40px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-align: center; }
.fe-wait .spinner { width: 22px; height: 22px; }
.fe-wait .bar { width: min(280px, 80%); height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.fe-wait .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.fe-fail { padding: 12px 16px; border-radius: var(--r-md); background: var(--bad-soft); color: var(--bad); font-size: 14px; margin-bottom: 10px; }
.fe-links { display: flex; align-items: center; gap: 18px; font-size: 14px; margin-top: 10px; }
.fe-links.center { justify-content: center; margin-top: 0; }
.fe-links .spacer { flex: 1; }
.fe-links .linkbtn, .fe-links a.linkbtn { font-size: 14px; margin: 0; text-decoration: none; font-weight: 600; }
.fe-links .linkbtn:hover { text-decoration: underline; }
.arm-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.arm-tile { aspect-ratio: 16 / 9; border-radius: var(--r-md); border: 1px dashed var(--line-2); background: var(--surface) center / cover no-repeat; display: grid; place-content: center; justify-items: center; gap: 4px; font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color .15s, box-shadow .15s; position: relative; overflow: hidden; }
.arm-tile:hover { border-color: var(--ink); }
.arm-tile .arm-ic .ic { width: 22px; height: 22px; color: var(--ink-2); }
.arm-tile.has { border-style: solid; border-color: transparent; }
.arm-tile.has > * { background: rgba(255, 255, 255, .9); border-radius: 999px; padding: 2px 10px; }
.arm-tile.has .arm-ic { display: none; }
.arm-tile.has > span:last-child { position: absolute; left: 8px; bottom: 8px; font-size: 12px; }
.arm-tile.nudge { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(28, 53, 87, .1); animation: nudge 1.6s ease-in-out 2; }
@keyframes nudge { 50% { box-shadow: 0 0 0 7px rgba(28, 53, 87, .05); } }
.ok-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.fe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.size-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; color: var(--ink-3); font-weight: 400; }
.field > .fe-sub { margin-left: 4px; }
div.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; cursor: pointer; justify-self: start; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + .sw { background: var(--ok); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.fe-more summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.fe-more summary::-webkit-details-marker { display: none; }
.fe-more summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.fe-more[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.fe .drawer { width: min(620px, 100%); }
.drawer.fe { width: min(620px, 100%); }
@media (max-width: 640px) { .reel, .stage-bench { border-radius: var(--r-md); } .fe-label { font-size: 19px; } }
#shop-stage { scroll-margin-top: 84px; }
.stage-tools:empty { display: none; }
.current .grid2 { grid-template-columns: 1fr 1fr; }
.drawer { min-width: 0; }
.drawer-body > * { min-width: 0; }
.fe-grid input, .size-row input { min-width: 0; width: 100%; }
@media (max-width: 640px) {
  .topbar .who { display: none; }
  .topbar [data-act="open-shop"] span { display: none; }
  .topbar [data-act="open-shop"] { padding-inline: 13px; }
  .topbar [data-act="logout"] { padding-inline: 8px; font-size: 14px; }
  .topbar .brand-sub { display: none; }
}

/* ---------- brand ---------- */
.logo { height: 40px; width: auto; display: block; }
.brand { text-decoration: none; }
.brand-tag { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding-left: 14px; border-left: 1px solid var(--line-2); }
.top-phone { font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.top-phone:hover { text-decoration: underline; }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-photo { position: relative; overflow: hidden; background: var(--soft); }
.login-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% 50%; max-width: none; }
.login-side { display: grid; place-items: center; padding: 48px 28px; }
.login-box { width: min(380px, 100%); gap: 22px; }
.login-box .logo { height: 56px; }
.login-box h1 { font-size: 30px; }
@media (max-width: 800px) {
  .login { grid-template-columns: 1fr; grid-template-rows: 34vh auto; }
  .login-side { place-items: start center; padding-top: 32px; }
}
.visit { max-width: 1280px; margin: 72px auto 0; padding: 0 28px; display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 56px; align-items: center; }
.visit-photo { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-lg); background: var(--soft); }
.visit-text { display: grid; gap: 14px; justify-items: start; }
.visit-text h2 { font-size: 40px; line-height: 1.08; }
.visit-text p { font-size: 17px; }
.visit-text .row { margin-top: 8px; gap: 10px; }
@media (max-width: 900px) { .visit { grid-template-columns: 1fr; gap: 24px; margin-top: 56px; padding: 0 18px; } .visit-photo { aspect-ratio: 4 / 3; } .visit-text h2 { font-size: 32px; } }

/* ---------- try-on video (always 16:9) ---------- */
.reel { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: var(--bench); touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.reel:active { cursor: grabbing; }
.reel-v { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.reel.tall .reel-v { object-fit: contain; }
.reel-bg { position: absolute; inset: -8%; width: 116%; height: 116%; max-width: none; object-fit: cover; filter: blur(28px) saturate(1.1); opacity: .85; pointer-events: none; }
.turn { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin: 18px auto 0; width: min(440px, 88%); color: var(--ink-2); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.turn-ic svg { width: 24px; height: 24px; }
.turn-track { position: relative; height: 3px; border-radius: 3px; background: var(--line-2); }
.turn-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: var(--ink); }
.turn-knob { position: absolute; top: 50%; left: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line-2), 0 2px 8px rgba(18, 20, 23, .14); display: grid; place-items: center; transition: transform .15s; }
.turn-knob svg { width: 16px; height: 16px; }
.turn:hover .turn-knob, .turn:focus-visible .turn-knob { transform: scale(1.08); }
.turn:focus-visible .turn-knob { box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(18, 20, 23, .14); }
.reel-box:not(.touched) .turn-knob { animation: knob 2.4s ease-in-out infinite; }
@keyframes knob { 0%, 100% { box-shadow: 0 0 0 1px var(--line-2), 0 2px 8px rgba(18, 20, 23, .14); } 50% { box-shadow: 0 0 0 1px var(--line-2), 0 0 0 8px rgba(18, 20, 23, .06), 0 2px 8px rgba(18, 20, 23, .14); } }
.turn-cap { text-align: center; font-size: 14px; color: var(--ink-2); margin-top: 10px; }
.thumb .poster.tall { object-position: 50% 40%; }
.fe-phone { color: var(--ink-3); animation: tilt 3s ease-in-out infinite; }
.fe-phone svg { width: 64px; height: 40px; }
@keyframes tilt { 0%, 15% { transform: rotate(-90deg); } 40%, 85% { transform: rotate(0deg); } 100% { transform: rotate(-90deg); } }
.fe-tip { margin-top: 10px; padding: 10px 14px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); font-size: 14px; }
@media (max-width: 640px) { .logo { height: 34px; } .top-phone { display: none; } .turn { width: 92%; } }
@media (prefers-reduced-motion: reduce) { .fe-phone, .turn-knob { animation: none !important; } }
