/* Dental Studio configurator. A clinical, calm look: white glass panels over the 3D room, one teal accent, ink text.
   Layout: the scene fills the window; bar (top), panel (left), chat (right), dock (bottom) float over it.
   Below 900 px the panel and the chat become bottom sheets and the bar slims to icons. */

:root {
  --ink: #0f1b24;
  --ink-2: #3c4a55;
  --muted: #6b7882;
  --line: rgba(15, 27, 36, 0.09);
  --line-2: rgba(15, 27, 36, 0.16);
  --glass: rgba(255, 255, 255, 0.86);
  --glass-2: rgba(255, 255, 255, 0.94);
  --card: #ffffff;
  --soft: #f3f5f6;
  --accent: #0e7f90;
  --accent-2: #0b6676;
  --accent-soft: #e3f3f5;
  --warn: #b4572e;
  --ok: #2f8a5b;
  --radius: 18px;
  --shadow: 0 18px 48px -18px rgba(15, 27, 36, 0.32), 0 2px 8px rgba(15, 27, 36, 0.06);
  --shadow-sm: 0 6px 18px -8px rgba(15, 27, 36, 0.3);
  --panel-w: 392px;
  --chat-w: 360px;
  --gap: 16px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #e8e7e3; color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: 0.4; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.scene { position: fixed; inset: 0; }
.scene canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.scene .labels { position: absolute; inset: 0; pointer-events: none; }

/* ---------------------------------------------------------------- bar */
.bar { position: fixed; top: var(--gap); left: var(--gap); right: var(--gap); display: flex; align-items: center; gap: 12px; pointer-events: none; z-index: 20; }
.pill { pointer-events: auto; display: flex; align-items: center; gap: 4px; background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 999px; box-shadow: var(--shadow-sm); padding: 5px; }
.brand { padding: 6px 16px 6px 8px; gap: 10px; }
.brand .mark { width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--ink); fill: #fff; }
.brand b { display: block; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: 12px; line-height: 1.1; }
.views { margin: 0 auto; }
.views button, .seg button { padding: 7px 14px; border-radius: 999px; font-weight: 500; font-size: 14px; color: var(--ink-2); transition: background .15s, color .15s; white-space: nowrap; }
.views button:hover, .seg button:hover { background: rgba(15, 27, 36, 0.06); }
.views button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--ink); color: #fff; }
.seg .qs { display: none; }
.seg { display: flex; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); }
.icon { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; font-weight: 500; font-size: 14px; color: var(--ink-2); }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon:hover { background: rgba(15, 27, 36, 0.06); }
.icon[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-2); }
.icon.primary { background: var(--accent); color: #fff; }
.icon.primary:hover { background: var(--accent-2); }
.icon.sm { padding: 6px; }
.icon.sm svg { width: 18px; height: 18px; }
.lang { padding: 7px 11px; border-radius: 999px; font-weight: 700; font-size: 13px; letter-spacing: .04em; color: var(--ink-2); border: 1px solid var(--line-2); margin-left: 2px; }
.lang:hover { background: rgba(15, 27, 36, 0.06); }

/* ---------------------------------------------------------------- panel */
.panel { position: fixed; z-index: 15; top: calc(var(--gap) + 66px); left: var(--gap); bottom: calc(var(--gap) + 84px); width: var(--panel-w); display: flex; flex-direction: column;
  background: var(--glass-2); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border: 1px solid rgba(255,255,255,.75); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.grab { display: none; }
.ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px 16px 10px 20px; }
.ph-title b { display: block; font-size: 21px; letter-spacing: -0.02em; line-height: 1.15; }
.ph-title span { color: var(--muted); font-size: 13.5px; }
.ph-tools { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.chip { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink-2); margin-left: 4px; white-space: nowrap; }
.chip:hover { background: var(--soft); }
.tabs { display: flex; gap: 2px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { padding: 7px 12px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--muted); white-space: nowrap; position: relative; }
.tabs button:hover { color: var(--ink); background: var(--soft); }
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--soft); }
.tabs button .n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; }
.opts { flex: 1; overflow-y: auto; padding: 6px 12px 24px; scroll-behavior: smooth; overscroll-behavior: contain; }
.opt { padding: 14px 8px 16px; border-bottom: 1px solid var(--line); scroll-margin-top: 8px; }
.opt:last-child { border-bottom: 0; }
.opt.flash { animation: flash 1.4s ease-out; border-radius: 12px; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.opt-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.opt-h h3 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -0.005em; }
.opt-h .cur { color: var(--muted); font-size: 13px; text-align: right; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 2px 7px 2px 5px; border-radius: 999px; background: var(--soft); white-space: nowrap; margin-top: 3px; }
.badge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.badge.vis { color: var(--accent-2); background: var(--accent-soft); }
.opt-help { color: var(--muted); font-size: 12.5px; margin: -4px 0 10px; }
.peerdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-left: 4px; box-shadow: 0 0 0 2px #fff; vertical-align: middle; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 8px; }
.sw { position: relative; aspect-ratio: 1; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), inset 0 -6px 10px -6px rgba(0,0,0,.25), inset 0 6px 10px -6px rgba(255,255,255,.4); transition: transform .12s; }
.sw:hover { transform: scale(1.07); }
.sw[aria-checked="true"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ink); }
.sw .pr { position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); display: grid; place-items: center; font-size: 9px; font-weight: 700; color: var(--accent-2); }

.choices { display: grid; gap: 6px; }
.ch { display: flex; align-items: flex-start; gap: 11px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); transition: border-color .12s, box-shadow .12s, background .12s; }
.ch:hover:not(:disabled) { border-color: rgba(15,27,36,.32); }
.ch[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: #fbfefe; }
.ch .dot { flex: 0 0 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; }
.ch.multi .dot { border-radius: 6px; }
.ch[aria-checked="true"] .dot { border-color: var(--accent); background: var(--accent); }
.ch[aria-checked="true"] .dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.ch.multi[aria-checked="true"] .dot::after { width: 9px; height: 5px; border-radius: 0; background: none; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.ch .sw-mini { flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); margin-top: 1px; }
.ch .tx { flex: 1; min-width: 0; }
.ch .tx b { display: block; font-weight: 550; font-size: 14px; line-height: 1.3; }
.ch .tx small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.ch .tx .req { color: var(--warn); }
.ch .p { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; margin-top: 1px; }
.ch .p.zero { color: var(--muted); font-weight: 500; }
.ch .p.neg { color: var(--ok); }

.acc { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.acc .tx { flex: 1; }
.acc .tx b { display: block; font-weight: 550; font-size: 14px; }
.acc .tx small { color: var(--muted); font-size: 12.5px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; background: #fff; }
.stepper button { width: 32px; height: 32px; font-size: 18px; line-height: 1; color: var(--ink-2); }
.stepper button:hover:not(:disabled) { background: var(--soft); }
.stepper span { min-width: 22px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }

.specs { margin: 6px 8px 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------------------------------------------------------- dock */
.dock { position: fixed; z-index: 16; left: var(--gap); bottom: var(--gap); width: var(--panel-w); display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 18px;
  background: var(--ink); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.dock-price { flex: 1; min-width: 0; line-height: 1.15; }
.dock-name { display: block; font-size: 12px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-price b { font-size: 21px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dock-price .muted { color: rgba(255,255,255,.6); font-size: 12.5px; margin-left: 4px; }
.dock-gross { display: block; font-size: 12px; color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; }
.dock .primary, .dock .ghost { padding: 11px 15px; border-radius: 12px; font-weight: 650; font-size: 14px; white-space: nowrap; }
.dock .ghost { color: #fff; border: 1px solid rgba(255,255,255,.25); }
.dock .ghost:hover { background: rgba(255,255,255,.08); }
.dock .ghost.sq { padding: 10px; }
.dock .ghost.sq svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.primary { background: var(--accent); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 650; }
.primary:hover:not(:disabled) { background: var(--accent-2); }
.dock .primary { background: #fff; color: var(--ink); }
.dock .primary:hover { background: #e9f6f8; }
.dock.bump b { animation: bump .5s ease-out; display: inline-block; }
@keyframes bump { 0% { transform: translateY(0); } 30% { transform: translateY(-3px); color: #9fe7ef; } 100% { transform: none; } }

/* ---------------------------------------------------------------- chat */
.chat { position: fixed; z-index: 15; right: var(--gap); bottom: var(--gap); width: var(--chat-w); max-height: calc(100% - var(--gap) * 2 - 66px); display: flex; flex-direction: column;
  background: var(--glass-2); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border: 1px solid rgba(255,255,255,.75); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 11px; padding: 12px 14px; text-align: left; width: 100%; }
.spark { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; background: linear-gradient(135deg, #0e7f90, #3a5bd9); display: grid; place-items: center; }
.spark svg { width: 20px; height: 20px; fill: #fff; }
.chat-titles { flex: 1; min-width: 0; }
.chat-titles b { display: block; font-size: 15px; }
.chat-titles small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; transition: transform .2s; }
.chat.folded .chev { transform: rotate(180deg); }
.chat.folded .chat-body { display: none; }
.people { display: flex; }
.people i { width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; display: grid; place-items: center; margin-left: -6px; box-shadow: 0 0 0 2px #fff; }
.chat-body { display: flex; flex-direction: column; min-height: 0; flex: 1; border-top: 1px solid var(--line); }
.conn { padding: 6px 14px; font-size: 12.5px; color: var(--warn); background: #fff6f1; }
.log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-height: 160px; max-height: 46vh; overscroll-behavior: contain; }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.ai { background: #fff; border: 1px solid var(--line); border-top-left-radius: 5px; align-self: flex-start; }
.msg.me { background: var(--ink); color: #fff; border-top-right-radius: 5px; align-self: flex-end; }
.msg.other { background: var(--accent-soft); border-top-left-radius: 5px; align-self: flex-start; }
.msg .who { display: block; font-size: 11.5px; font-weight: 700; color: var(--accent-2); margin-bottom: 1px; }
.msg.me .who { color: rgba(255,255,255,.6); }
.msg img { display: block; max-width: 100%; border-radius: 9px; margin-top: 6px; }
.msg .meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--accent-2); }
.msg .meta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.sys { align-self: center; font-size: 12px; color: var(--muted); }
.typing { align-self: flex-start; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.sugg button { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 12.5px; font-weight: 550; color: var(--ink-2); text-align: left; }
.sugg button:hover { border-color: var(--accent); color: var(--accent-2); }
.pending { position: relative; margin: 0 14px 8px; width: 72px; }
.pending img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; }
.pending button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px 10px; border-top: 1px solid var(--line); background: #fff; }
.composer textarea { flex: 1; resize: none; border: 0; outline: none; padding: 8px 4px; max-height: 120px; background: transparent; font-size: 14.5px; }
.photo, .send { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; display: grid; place-items: center; cursor: pointer; }
.photo svg { width: 21px; height: 21px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.photo:hover { background: var(--soft); }
.send { background: var(--accent); }
.send svg { width: 18px; height: 18px; fill: #fff; }
.send:disabled { opacity: .35; }

/* ---------------------------------------------------------------- 3D overlays */
.tip { position: fixed; z-index: 30; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 9px; font-size: 13px; font-weight: 550; white-space: nowrap; transform: translate(14px, 14px); box-shadow: var(--shadow-sm); }
.tip small { color: rgba(255,255,255,.65); font-weight: 450; margin-left: 4px; }
.dim { padding: 3px 8px; border-radius: 7px; background: #0f6f86; color: #fff; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 3px 10px -3px rgba(0,0,0,.35); }
.dim-soft { background: rgba(255,255,255,.92); color: #0f6f86; border: 1px dashed #0f6f86; }
.peer { display: flex; align-items: center; gap: 5px; transform: translate(50%, -50%); }
.peer i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px rgba(255,255,255,.85); }
.peer span { background: var(--c); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 7px; }

/* ---------------------------------------------------------------- start */
.start { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 30% 20%, rgba(232,240,242,.75), rgba(214,221,224,.88)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow-y: auto; }
.start-card { width: min(1180px, 100%); }
.start header { position: relative; text-align: center; margin: 0 auto 26px; max-width: 720px; }
.start h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 12px; }
.start header p { color: var(--ink-2); margin: 0; font-size: 16px; }
.start header .lang { position: absolute; top: -6px; right: -60px; background: #fff; }
.models { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.model { display: flex; flex-direction: column; text-align: left; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; border: 1px solid rgba(255,255,255,.8); }
.model:hover { transform: translateY(-4px); box-shadow: 0 28px 60px -24px rgba(15,27,36,.45); }
.model .img { aspect-ratio: 4 / 3.2; background: linear-gradient(180deg, #f1f2f1, #e3e5e4); display: grid; place-items: center; overflow: hidden; }
.model .img img { width: 100%; height: 100%; object-fit: cover; }
.model .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.model b { font-size: 19px; letter-spacing: -0.02em; }
.model .tg { color: var(--accent-2); font-weight: 600; font-size: 13.5px; }
.model p { margin: 0; color: var(--muted); font-size: 13.5px; flex: 1; }
.model .row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.model .from { font-size: 13px; color: var(--muted); }
.model .from strong { color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.model .go { font-weight: 650; color: var(--accent-2); font-size: 14px; display: inline-flex; align-items: center; gap: 7px; }
/* busy: the 3D view is still being built, or a picked model loads (main.js paintStart) */
.start .wait { display: none; align-items: center; justify-content: center; gap: 10px; width: fit-content; margin: 16px auto 0; padding: 9px 18px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-weight: 600; font-size: 14px; color: var(--ink); }
.start.busy .wait { display: flex; }
.start.busy .model { cursor: progress; }
.start.busy .model:hover { transform: none; box-shadow: var(--shadow); }
.start.busy .model .go { color: var(--muted); }
.model[aria-disabled="true"] { opacity: .62; }
.start.busy .model.picked { opacity: 1; outline: 2px solid var(--accent); outline-offset: -2px; }
.start.busy .model.picked .go { color: var(--accent-2); }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; flex-shrink: 0; }

/* ---------------------------------------------------------------- dialogs */
.modal { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
.modal::backdrop { background: rgba(15, 27, 36, 0.38); backdrop-filter: blur(3px); }
.modal-card { width: 480px; max-width: 100%; background: #fff; border-radius: 22px; padding: 22px 24px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.modal-card.wide { width: 640px; }
.modal-card header { display: flex; align-items: center; justify-content: space-between; }
.modal-card h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.modal-card p { margin: 0; }
.modal-card footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.x { width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--muted); }
.x:hover { background: var(--soft); }
.modal label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.modal input, .modal textarea { border: 1px solid var(--line-2); border-radius: 11px; padding: 10px 12px; font-weight: 450; font-size: 14.5px; outline: none; background: #fff; }
.modal input:focus, .modal textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal .check { flex-direction: row; align-items: center; gap: 9px; font-weight: 500; }
.modal .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.err { color: var(--warn); font-size: 13px; min-height: 1px; }
.btn { display: inline-flex; align-items: center; text-decoration: none; padding: 11px 16px; border-radius: 12px; font-weight: 650; }
.modal .ghost { border: 1px solid var(--line-2); color: var(--ink); }
.modal .ghost:hover { background: var(--soft); }
.qsum { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 12px; background: var(--soft); font-size: 14px; }
.qsum b { font-variant-numeric: tabular-nums; }
.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; padding-left: 12px; }
.lines .grp { color: var(--muted); font-size: 12px; display: block; }
.lines tr.tot td { border-bottom: 0; padding-top: 12px; font-size: 16px; font-weight: 700; }
.lines tr.sub td { color: var(--muted); font-weight: 500; border-bottom: 0; padding: 2px 0; }
.incl { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; }

/* ---------------------------------------------------------------- loading, toasts, AR */
.loading { position: fixed; z-index: 35; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 999px; background: var(--glass-2); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; transition: opacity .3s; }
.loading.done { opacity: 0; pointer-events: none; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; z-index: 50; left: 50%; top: 84px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); max-width: min(520px, calc(100vw - 32px)); animation: toast .25s ease-out; }
@keyframes toast { from { opacity: 0; transform: translateY(-6px); } }
.ar-qr { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(15,27,36,.4); backdrop-filter: blur(3px); }
.ar-qr-card { background: #fff; border-radius: 22px; padding: 24px; width: min(380px, calc(100vw - 32px)); text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.ar-qr-card b { font-size: 18px; }
.ar-qr-card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.ar-qr-code { width: 220px; height: 220px; }
.ar-qr-code svg { width: 100%; height: 100%; }
.ar-overlay { position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 24px 16px; pointer-events: none; }
.ar-hint { align-self: center; background: rgba(15,27,36,.75); color: #fff; padding: 10px 14px; border-radius: 12px; font-size: 15px; }
.ar-actions { display: flex; justify-content: center; gap: 10px; pointer-events: auto; }
.ar-actions button { background: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 650; }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1280px) { .views { display: none; } }
@media (max-width: 1100px) { .icon .lbl { display: none; } .icon { padding: 7px 9px; } }
@media (max-width: 900px) {
  :root { --gap: 10px; }
  .brand small { display: none; }
  /* phones keep the quality picker, with short labels (Std / HD / Ultra) */
  .seg .qf { display: none; }
  .seg .qs { display: inline; }
  .seg button { padding: 7px 10px; font-size: 13px; }
  .brand { padding: 5px 12px 5px 6px; }
  .bar .actions { margin-left: auto; }
  /* the sheet takes about a quarter of the visible screen (svh: Safari's toolbars shown), so the chair above it stays
     large; it scrolls inside, and its grab folds it to the header */
  .panel { top: auto; bottom: calc(var(--gap) + 74px); left: var(--gap); right: var(--gap); width: auto; height: 24vh; height: clamp(180px, 25svh, 250px); transition: height .25s; }
  .panel.min { height: 86px; }
  .grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 6px auto -2px; cursor: grab; }
  .ph { padding: 6px 10px 4px 14px; align-items: center; }
  .ph-title b { font-size: 16px; }
  .ph-title span { display: none; }
  .ph-tools .chip { padding: 5px 10px; font-size: 12.5px; }
  .tabs { padding: 0 8px 6px; }
  .tabs button { padding: 5px 10px; font-size: 13px; }
  .opts { padding: 4px 10px 16px; }
  .opt { padding: 10px 6px 12px; }
  .opt-h { margin-bottom: 8px; }
  .dock { left: var(--gap); right: var(--gap); width: auto; padding: 8px 8px 8px 14px; }
  .dock .ghost:not(.sq) { display: none; }
  .dock-price b { font-size: 18px; }
  .chat { left: var(--gap); right: var(--gap); width: auto; top: calc(var(--gap) + 58px); bottom: auto; max-height: calc(100% - 160px); }
  .chat.folded { left: auto; width: auto; }
  .chat.folded .chat-titles, .chat.folded .chev, .chat.folded .people { display: none; }
  .chat.folded .chat-head { padding: 7px; }
  .models { grid-template-columns: 1fr 1fr; }
  .start header .lang { position: static; margin-top: 12px; }
  .grid2 { grid-template-columns: 1fr; }
}
/* narrow phones (iPhone 393 px): the bar fits brand mark + quality + 3 icons + language */
@media (max-width: 420px) { .bar .seg button { padding: 7px 8px; } .bar .icon { padding: 7px; } }
@media (max-width: 380px) { .bar .seg button { padding: 7px 6px; } }
@media (max-width: 560px) { .bar .brand > div { display: none; } .bar .brand { padding: 5px; } .models { grid-template-columns: 1fr; } .model .img { aspect-ratio: 16 / 9; } }

@media print { body { overflow: visible; } }
.thumb .bar, .thumb .panel, .thumb .chat, .thumb .dock, .thumb .tip, .thumb .loading, .thumb .toasts { display: none !important; }
