/* Card AR · phone first, bright and friendly. System fonts only. */
:root {
  --ink: #12213b; --ink-soft: #55657f; --sky: #2b7bff; --sun: #ffcf33; --coral: #ff6b3d; --mint: #2fd6b0;
  --glass: rgba(255, 255, 255, 0.86); --glass-strong: rgba(255, 255, 255, 0.96); --line: rgba(18, 33, 59, 0.1);
  --shadow: 0 6px 22px rgba(18, 33, 59, 0.14);
  --g: 16px;
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --peek: 132px;                 /* parts sheet, collapsed: handle + title + chip row */
  --open: min(52dvh, 440px);     /* parts sheet, expanded */
  --actions: 84px;
  --side: 320px;                 /* docked side panel (landscape / wide) */
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 16px/1.35 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(120% 75% at 50% 0%, #dcefff 0%, #eef6ff 48%, #fff3dc 100%);
}
body[data-view="camera"] { background: #000; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ── the 3D / camera view ───────────────────────────────────────── */
.viewport { position: fixed; inset: 0; overflow: hidden; touch-action: none; }
.viewport canvas { display: block; }
body[data-view="start"] .viewport, body.picking .viewport { visibility: hidden; }
/* 3D view: the model is framed in the space above the controls. */
/* 3D view: a studio stage that makes models pop (owner): a mid slate-indigo
   centre, lightly tinted by the subject, falling to deep navy at the edges. */
body[data-view="3d"]:not(.live-bg) {
  background: radial-gradient(115% 80% at 50% 36%, color-mix(in srgb, var(--tint, #5b74d6) 26%, #3a4a76) 0%, #24305a 42%, #121a33 78%, #0a1022 100%);
}
body[data-view="3d"] .act { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
body[data-view="3d"] .viewport { bottom: calc(var(--actions) + var(--peek) + var(--sb)); transition: bottom .35s ease; }
body[data-view="3d"].sheet-open .viewport { bottom: calc(var(--actions) + var(--open) + var(--sb)); }

/* ── top bar: one row ───────────────────────────────────────────── */
.topbar { position: fixed; z-index: 20; top: calc(12px + var(--st)); left: calc(var(--g) + var(--sl)); right: calc(var(--g) + var(--sr)); display: flex; align-items: center; gap: 12px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.round { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--glass); color: var(--ink); box-shadow: var(--shadow); text-decoration: none; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .15s ease; }
.round:active { transform: scale(.92); }
.round.small { width: 42px; height: 42px; }
.round.small svg { width: 20px; height: 20px; }
.round.ghost { background: transparent; box-shadow: none; backdrop-filter: none; }
.title { min-width: 0; display: flex; flex-direction: column; padding: 6px 16px; border-radius: 16px; background: var(--glass); box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.title strong { font-size: 18px; font-weight: 900; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title span { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
body[data-view="start"] .title { display: none; }

/* ── short hint: fades by itself ─────────────────────────────────── */
.hint { position: fixed; z-index: 15; left: 50%; top: calc(76px + var(--st)); max-width: calc(100% - 2 * var(--g)); width: max-content; margin: 0; padding: 9px 16px; border-radius: 999px; font-size: 15px; font-weight: 800; text-align: center; background: var(--glass-strong); box-shadow: var(--shadow); transform: translate(-50%, -6px); opacity: 0; pointer-events: none; transition: opacity .35s ease, transform .35s ease; }
.hint.show { opacity: 1; transform: translate(-50%, 0); }
.hint[data-state="found"] { background: #e6fff6; color: #075f4b; }
.hint[data-state="lost"] { background: #fff4d2; color: #634400; }
.hint[data-state="error"] { background: #ffe6e0; color: #8a1f0b; }
body[data-view="start"] .hint { display: none; }

/* finder frame while no card is found */
.finder { position: fixed; z-index: 5; left: 50%; top: 45%; width: min(76vw, 420px); aspect-ratio: 10 / 7; transform: translate(-50%, -50%); pointer-events: none; }
.finder i { position: absolute; width: 36px; height: 36px; border: 5px solid #fff; filter: drop-shadow(0 0 6px rgba(43, 123, 255, .9)); animation: breathe 1.6s ease-in-out infinite; }
.finder i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; }
.finder i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 16px 0 0; }
.finder i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 16px; }
.finder i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 16px 0; }
.finder span { position: absolute; left: 6%; right: 6%; height: 3px; top: 10%; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--sun), transparent); animation: sweep 2.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); } }
@keyframes sweep { 50% { top: 88%; } }

/* zoom: two small round buttons on the right edge */
.zoom { position: fixed; z-index: 12; right: calc(var(--g) + var(--sr)); top: calc(128px + var(--st)); display: grid; gap: 10px; }
body[data-view="start"] .zoom, body.picking .zoom { display: none; }

/* ── dock: actions + parts sheet ─────────────────────────────────── */
.dock { position: fixed; z-index: 14; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; pointer-events: none; }
.dock > * { pointer-events: auto; }
body[data-view="start"] .dock, body.picking .dock { display: none; }
.actions { display: flex; justify-content: safe center; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 8px calc(var(--g) + var(--sr)) 10px calc(var(--g) + var(--sl)); }
body[data-view="camera"] [data-only="3d"], body[data-view="3d"] [data-only="camera"] { display: none; }
/* Camera: while identifying there is no model yet; "Other card" only while tracking. */
body[data-track="identify"] #pose, body[data-track="identify"] #spin, body:not([data-track="tracking"]) #rescan { display: none; }
/* A model on its own over the live camera (no card, no tracking). */
.live-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.viewport > canvas { position: relative; z-index: 1; }
body.live-bg { background: #000; }
body.live-bg .act { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
/* AR in your room: the DOM overlay sits over the camera, so nothing opaque behind it. */
html:has(body[data-view="room"]), body[data-view="room"] { background: transparent; }
body[data-view="room"] .act { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
body[data-view="room"] [data-only="3d"], body[data-view="room"] [data-only="camera"], body:not([data-view="room"]) [data-only="room"] { display: none; }
a.act { text-decoration: none; }
.room-cta { position: fixed; z-index: 18; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(18, 33, 59, .35); }
.room-cta .start-card { display: grid; gap: 12px; }
.room-cta h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.link-like { border: 0; background: none; text-decoration: underline; cursor: pointer; }
.identify-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.act { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; font-size: 12px; font-weight: 800; color: var(--ink); text-shadow: 0 1px 2px rgba(255, 255, 255, .8); }
body[data-view="camera"] .act { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.act > span { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--glass-strong); color: var(--ink); box-shadow: var(--shadow); transition: transform .15s ease, background .2s ease; }
.act:active > span { transform: scale(.9); }
.act[aria-pressed="true"] > span { background: var(--sun); }
.act[aria-pressed="mixed"] > span { background: #fff1c2; }
.act.accent > span { background: var(--coral); color: #fff; }
.act b { font: inherit; max-width: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sheet { display: flex; flex-direction: column; height: calc(var(--peek) + var(--sb)); padding-bottom: var(--sb); border-radius: 26px 26px 0 0; background: var(--glass-strong); box-shadow: 0 -8px 30px rgba(18, 33, 59, .16); transition: height .35s cubic-bezier(.2, .9, .3, 1); }
body.sheet-open .sheet { height: calc(var(--open) + var(--sb)); }
.sheet-head { position: relative; display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 22px calc(var(--g) + 4px) 8px; text-align: left; cursor: grab; touch-action: none; }
.grip { position: absolute; left: 50%; top: 8px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: rgba(18, 33, 59, .2); }
.sheet-title { font-size: 17px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { font-size: 13px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.selected { display: flex; align-items: center; gap: 10px; margin: 0 var(--g) 6px; padding: 8px 6px 8px 12px; border-radius: 16px; background: #fff4c7; }
.selected > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.selected strong { font-size: 16px; }
.selected span { font-size: 13px; color: #4f3d00; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chips { list-style: none; margin: 0; padding: 2px var(--g) 10px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chips li { scroll-snap-align: start; }
body.sheet-open .chips, body.part-selected .chips { display: none; }
.part { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px 8px 10px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-weight: 800; font-size: 15px; white-space: nowrap; transition: background .2s ease, border-color .2s ease; }
.part[aria-pressed="true"] { border-color: #e2a400; background: #fff3c4; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), 0 0 0 1px rgba(18, 33, 59, .18); }
.sheet-body { flex: 1; min-height: 0; overflow: auto; padding: 0 var(--g) var(--g); overscroll-behavior: contain; }
.search input { width: 100%; min-height: 44px; margin-bottom: 10px; padding: 0 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.list .part { width: 100%; height: 100%; border-radius: 16px; white-space: normal; text-align: left; line-height: 1.2; }
.none { color: var(--ink-soft); padding: 8px; }

/* pinned 3D label */
.pin { position: fixed; z-index: 11; left: 0; top: 0; pointer-events: none; }
.pin::before { content: ""; position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--sun); border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(255, 207, 51, .45); animation: blip 1.2s ease-in-out infinite; }
.pin::after { content: ""; position: absolute; left: -1px; bottom: 8px; width: 2px; height: 24px; background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, .35); }
.pin span { position: absolute; bottom: 32px; left: 0; transform: translateX(-50%); max-width: 60vw; padding: 6px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
@keyframes blip { 50% { transform: scale(1.25); } }

/* ── start screen ───────────────────────────────────────────────── */
.start { position: fixed; inset: 0; overflow: auto; display: grid; place-items: center; padding: calc(76px + var(--st)) calc(var(--g) + var(--sr)) calc(var(--g) + var(--sb)) calc(var(--g) + var(--sl)); }
body:not([data-view="start"]) .start { display: none; }
.start-card { width: min(100%, 460px); padding: 20px; border-radius: 28px; background: var(--glass-strong); box-shadow: 0 18px 50px rgba(18, 33, 59, .14); text-align: center; }
.start h1 { margin: 4px 0 6px; font-size: clamp(28px, 7.4vw, 36px); line-height: 1.05; letter-spacing: -0.03em; }
.lead { margin: 0 auto 16px; color: var(--ink-soft); font-size: 17px; font-weight: 700; }
.lead span { white-space: nowrap; }
.hero { position: relative; height: 112px; margin: 0 auto; width: 190px; }
.hero-card { position: absolute; left: 22px; right: 22px; bottom: 6px; height: 60px; border-radius: 12px; background: linear-gradient(135deg, #fff, #e7f1ff); border: 3px solid #fff; box-shadow: 0 10px 22px rgba(18, 33, 59, .16); transform: perspective(300px) rotateX(48deg); }
.hero-ring { position: absolute; left: 62px; right: 62px; bottom: 23px; height: 28px; border-radius: 50%; border: 5px solid transparent; background: conic-gradient(var(--mint), var(--sky), #ff6fb5, var(--sun), var(--mint)) border-box; -webkit-mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0); animation: ring 2.4s linear infinite; }
.hero-pop { position: absolute; left: 50%; bottom: 36px; font-size: 42px; transform: translateX(-50%); animation: pop 2.4s cubic-bezier(.2, 1.6, .4, 1) infinite; }
@keyframes ring { to { filter: hue-rotate(360deg); } }
@keyframes pop { 0%, 12% { transform: translate(-50%, 30px) scale(.3); opacity: 0; } 45%, 85% { transform: translate(-50%, -18px) scale(1); opacity: 1; } 100% { transform: translate(-50%, -12px) scale(1); opacity: 0; } }
.expect { display: flex; gap: 12px; align-items: center; margin: 0 auto 16px; padding: 8px 14px 8px 8px; border-radius: 18px; background: #eef5ff; text-align: left; width: fit-content; max-width: 100%; }
.expect img { border-radius: 8px; box-shadow: 0 2px 8px rgba(18, 33, 59, .16); }
.expect p { margin: 0; }
.expect small { color: var(--ink-soft); }
progress { width: 100%; height: 10px; margin: 0 0 12px; accent-color: var(--sky); }
.start-actions { display: grid; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 22px; border-radius: 18px; font-size: 18px; font-weight: 900; transition: transform .12s ease; }
.button.primary { background: linear-gradient(180deg, #ff8a5c, var(--coral)); color: #fff; box-shadow: 0 6px 0 #d24a1f, 0 12px 24px rgba(255, 107, 61, .3); }
.button.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #d24a1f; }
.button.secondary { background: #e8f2ff; color: #123f8f; }
.button:disabled { opacity: .5; cursor: default; }
.small-link { display: inline-block; margin-top: 14px; color: #123f8f; font-weight: 800; }
.start-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; background: #ffe6e0; color: #8a1f0b; font-weight: 700; }
.desktop-hint { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 12px; border-radius: 18px; background: #fff8e1; text-align: left; }
.desktop-hint canvas { flex: none; border-radius: 10px; background: #fff; }
.desktop-hint p { margin: 0; font-size: 14px; }
.desktop-hint small { color: var(--ink-soft); word-break: break-all; }
.note { margin: 14px 0 0; color: var(--ink-soft); font-size: 13px; }

/* card picker (3D view) */
.picker { position: fixed; z-index: 16; inset: 0; overflow: auto; padding: calc(76px + var(--st)) calc(var(--g) + var(--sr)) calc(var(--g) + var(--sb)) calc(var(--g) + var(--sl)); }
.picker h2 { margin: 0 0 14px; font-size: 24px; text-align: center; }
.picker-grid { list-style: none; margin: 0 auto; padding: 0; max-width: 980px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.picker-grid button { width: 100%; padding: 8px; border-radius: 18px; background: #fff; box-shadow: 0 6px 16px rgba(18, 33, 59, .1); font-weight: 800; display: grid; gap: 6px; }
.picker-grid img { width: 100%; height: auto; border-radius: 10px; }

/* ── landscape phones and wide screens: parts dock on the right ─── */
@media (min-width: 900px), (orientation: landscape) and (max-height: 560px) {
  .dock { top: calc(72px + var(--st)); left: auto; right: calc(var(--g) + var(--sr)); bottom: calc(var(--g) + var(--sb)); width: var(--side); }
  .actions { position: fixed; left: calc(var(--g) + var(--sl)); right: calc(var(--side) + 2 * var(--g) + var(--sr)); bottom: calc(8px + var(--sb)); padding: 0; }
  .sheet, body.sheet-open .sheet { height: auto; flex: 1; min-height: 0; border-radius: 24px; padding-bottom: 0; }
  .sheet-head { cursor: default; padding-top: 16px; }
  .grip { display: none; }
  .chips, body.sheet-open .chips { display: none; }
  .zoom { right: calc(var(--side) + 2 * var(--g) + var(--sr)); }
  body[data-view="3d"] .viewport, body[data-view="3d"].sheet-open .viewport { bottom: calc(var(--actions) + var(--sb)); right: calc(var(--side) + var(--g) + var(--sr)); }
}
@media (orientation: landscape) and (max-height: 560px) {
  :root { --actions: 76px; }
  .act > span { width: 44px; height: 44px; }
  .start { place-items: start center; }
}
@media (prefers-reduced-motion: reduce) {
  .finder i, .finder span, .hero-ring, .hero-pop, .pin::before { animation: none; }
  .sheet, .viewport, .hint { transition: none; }
}

/* Top bar: Cards and Models next to the title (owner, 2026-10-14). */
.title { flex: 1 1 auto; }
.top-nav { display: flex; gap: 8px; margin-left: auto; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--glass); color: var(--ink); font-weight: 800; font-size: 14px; text-decoration: none; box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pill svg { width: 18px; height: 18px; }
@media (max-width: 420px) { .pill { padding: 0; width: 44px; justify-content: center; } .pill span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
body[data-view="start"] .top-nav { display: none; }
.zoom [data-only="3d"] { display: none; }
body[data-view="3d"] .zoom [data-only="3d"] { display: grid; }
.round[aria-pressed="mixed"] { background: #fff1c2; }
.round[aria-pressed="true"] { background: var(--sun); }

/* Smooth: immediate pressed feedback, a cross-fade between views, a draggable sheet. */
.act > span, .round, .pill, .part, .button { transition: transform .14s cubic-bezier(.2, .8, .3, 1), opacity .14s ease-out, background .2s ease; }
.act:active > span, .round:active, .pill:active, .part:active { transform: scale(.92); opacity: .85; }
.viewport.fade-in { animation: view-in .28s ease-out; }
@keyframes view-in { from { opacity: 0; } to { opacity: 1; } }
.sheet.dragging { transition: none !important; }
a.act { text-decoration: none; }
body:not([data-track="identify"]) #to-scan { display: none; }
@media (prefers-reduced-motion: reduce) { .viewport.fade-in { animation: none; } .act > span, .round, .pill, .part, .button { transition: none; } }
/* "In your room": the way into AR, a wide blue pill that stands out from the round tools (owner). */
.act.room-cta-btn { width: auto; flex-direction: row; gap: 8px; padding: 0 18px 0 6px; height: 50px; border-radius: 25px; background: #0284c7; color: #fff; text-shadow: none; font-size: 14px; box-shadow: 0 6px 18px rgba(2, 132, 199, .45); }
.act.room-cta-btn > span { width: 38px; height: 38px; background: #fff; color: #0284c7; box-shadow: none; }
.act.room-cta-btn:active { transform: scale(.96); }
/* Every animation as a button (owner): a labelled row that says it scrolls, above the action bar. */
.clips { padding: 0 calc(var(--g) + var(--sr)) 4px calc(var(--g) + var(--sl)); }
.clips[hidden] { display: none; }
.clips-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px; font-size: 12px; font-weight: 800; color: var(--ink); text-shadow: 0 1px 2px rgba(255, 255, 255, .8); }
body[data-view="camera"] .clips-head, body[data-view="room"] .clips-head { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.clips-swipe { color: #0284c7; font-weight: 800; }
.clips-scroll { position: relative; }
.clips-scroll::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 36px; pointer-events: none; background: linear-gradient(90deg, rgba(246, 248, 245, 0), rgba(246, 248, 245, .95)); }
.clips-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 36px 2px 2px; }
.clips-row::-webkit-scrollbar { display: none; }
.clip-chip { flex: none; height: 36px; padding: 0 14px 0 30px; border-radius: 18px; border: 1px solid rgba(2, 132, 199, .35); background: var(--glass-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%230284c7'/%3E%3C/svg%3E") no-repeat 11px center / 13px; color: var(--ink); font-size: 13px; font-weight: 800; text-transform: capitalize; box-shadow: var(--shadow); }
.clip-chip.on { border-color: transparent; color: #04122a; background: linear-gradient(135deg, #7dd3fc, #a5b4fc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%2304122a'/%3E%3C/svg%3E") no-repeat 11px center / 13px; background-blend-mode: normal; }
.clip-chip.on { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%2304122a'/%3E%3C/svg%3E") no-repeat 11px center / 13px, linear-gradient(135deg, #7dd3fc, #a5b4fc); }
/* The 3D view has no Camera button on the website (owner); the elements stay for the code that turns the camera off. */
#live, #to-camera { display: none !important; }
.zoom [hidden] { display: none; }
/* Animations: one vertical column of buttons down the left, mirroring the tools on the right (owner). */
.clips { position: fixed; z-index: 13; left: calc(var(--g) + var(--sl)); top: calc(128px + var(--st)); width: min(190px, 46vw); padding: 0; }
.clips-head { flex-direction: column; align-items: flex-start; gap: 2px; padding: 0 2px 6px; }
.clips-scroll::after { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 34px; background: linear-gradient(180deg, rgba(246, 248, 245, 0), rgba(246, 248, 245, .9)); border-radius: 0 0 14px 14px; }
.clips-row { flex-direction: column; align-items: stretch; overflow-x: hidden; overflow-y: auto; max-height: min(46vh, 340px); padding: 2px 2px 30px; }
.clip-chip { width: 100%; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px), (orientation: landscape) and (max-height: 560px) { .clips { top: calc(84px + var(--st)); } }
.clips-head { color: #e0f2fe; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.clips-swipe { color: #7dd3fc; }
/* The animations list has no fade box (owner: "extra box"); its heading sits on a dark label to read on any background. */
.clips-scroll::after { content: none; }
.clips-row { padding-bottom: 2px; }
.clips-head { align-self: flex-start; display: inline-flex; padding: 5px 9px; margin-bottom: 6px; border-radius: 10px; background: rgba(6, 10, 20, .72); color: #f0f9ff; text-shadow: none; }
.clips-swipe { color: #7dd3fc; text-shadow: none; font-size: 11px; }
/* Wide screens: the parts panel opens from the Parts button. */
@media (min-width: 900px), (orientation: landscape) and (max-height: 560px) {
  body:not(.parts-panel) .dock .sheet { display: none; }
  body:not(.parts-panel) .zoom { right: calc(var(--g) + var(--sr)); }
  body:not(.parts-panel)[data-view="3d"] .viewport { right: 0; }
}
/* Parts panel in the 3D view's dark navy look (owner: "match the theme"): dark glass, light text, sky for the chosen part. */
.sheet { background: rgba(8, 13, 26, .9); color: #e2e8f0; border: 1px solid rgba(148, 163, 184, .2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 -8px 30px rgba(0, 0, 0, .35); }
.grip { background: rgba(226, 232, 240, .3); }
.sheet-title { color: #f8fafc; }
.count { color: #7dd3fc; }
.part { border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #f1f5f9; }
.part:hover { background: rgba(255, 255, 255, .1); }
.part[aria-pressed="true"] { border-color: transparent; background: linear-gradient(135deg, #7dd3fc, #a5b4fc); color: #04122a; }
.dot { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5), 0 0 0 1px rgba(0, 0, 0, .3); }
.selected { background: rgba(125, 211, 252, .14); border: 1px solid rgba(125, 211, 252, .4); color: #f8fafc; }
.selected span { color: #cbd5e1; }
.search input { border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #f1f5f9; }
.search input::placeholder { color: #94a3b8; }
.none { color: #94a3b8; }
/* Wide screens: the panel is only as tall as its list, opened by the Parts button. */
@media (min-width: 900px), (orientation: landscape) and (max-height: 560px) {
  .sheet, body.sheet-open .sheet { flex: none; height: auto; max-height: 100%; border-radius: 22px; }
  .list { grid-template-columns: 1fr; }
}
/* Full animation names (owner: "1 Empty A…" was cut off): wrap to two lines instead of truncating. */
.clip-chip { height: auto; min-height: 36px; padding-top: 7px; padding-bottom: 7px; white-space: normal; line-height: 1.2; text-align: left; overflow: visible; text-overflow: clip; font-size: 12.5px; background-position: 11px 50%; }
/* Layers (a model with a layers.json, e.g. the Human Body Explorer body): a dark panel beside the tool column, in the Parts panel's look. */
.layers-panel { position: fixed; z-index: 16; top: calc(128px + var(--st)); right: calc(var(--g) + var(--sr) + 52px); width: min(270px, calc(100vw - 2 * var(--g) - 60px)); max-height: calc(100dvh - 128px - var(--st) - var(--actions) - var(--peek) - var(--sb) - 12px); min-height: 160px; overflow: auto; overscroll-behavior: contain; padding: 12px 12px 10px; border-radius: 22px; background: rgba(8, 13, 26, .92); color: #e2e8f0; border: 1px solid rgba(148, 163, 184, .2); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.layers-head { display: flex; align-items: center; gap: 8px; padding: 0 0 4px 6px; }
.layers-head h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 900; color: #f8fafc; }
.layers-head .round.small { width: 36px; height: 36px; color: #e2e8f0; }
.layers-reset { min-height: 32px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #7dd3fc; font-size: 13px; font-weight: 800; }
.layers-tip { margin: 0 6px 8px; color: #94a3b8; font-size: 12px; line-height: 1.3; }
.layers-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.layer { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); color: #f1f5f9; font-weight: 800; font-size: 15px; text-align: left; }
.layer:hover { background: rgba(255, 255, 255, .09); }
.layer .layer-name { flex: 1; min-width: 0; }
.layer small { flex: none; font-size: 11px; font-weight: 700; color: #fbbf24; }
.layer .switch { position: relative; flex: none; width: 38px; height: 22px; border-radius: 11px; background: rgba(148, 163, 184, .35); transition: background .2s ease; }
.layer .switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.layer[aria-checked="true"] .switch { background: linear-gradient(135deg, #7dd3fc, #a5b4fc); }
.layer[aria-checked="true"] .switch::after { transform: translateX(16px); }
.layer[aria-checked="false"] .layer-name { color: #94a3b8; }
body[data-view="start"] .layers-panel, body.picking .layers-panel { display: none; }
#layers-btn[aria-pressed="true"] { background: linear-gradient(135deg, #7dd3fc, #a5b4fc); color: #04122a; }
@media (min-width: 900px), (orientation: landscape) and (max-height: 560px) {
  .layers-panel { top: calc(84px + var(--st)); right: calc(var(--side) + 2 * var(--g) + var(--sr) + 52px); max-height: calc(100dvh - 84px - var(--st) - var(--actions) - var(--sb)); }
  body:not(.parts-panel) .layers-panel { right: calc(var(--g) + var(--sr) + 52px); }
}
@media (prefers-reduced-motion: reduce) { .layer .switch, .layer .switch::after { transition: none; } }
/* The richer part card (subtitle, system, More: try this, location, function…). */
.selected em { font-style: normal; font-size: 12px; font-weight: 800; color: #7dd3fc; }
.more-link { align-self: flex-start; margin-top: 2px; padding: 2px 0; color: #7dd3fc; font-size: 13px; font-weight: 800; text-decoration: underline; }
body.part-more .selected span { display: block; -webkit-line-clamp: unset; overflow: visible; }
body.part-more .selected > div { max-height: min(36dvh, 300px); overflow: auto; overscroll-behavior: contain; }
.selected-info { margin-top: 6px; font-size: 13px; color: #cbd5e1; }
.selected-info p { margin: 0 0 6px; line-height: 1.35; }
.selected-info .caution { padding: 6px 8px; border-radius: 10px; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .25); color: #fde68a; }
.selected-info .try { padding: 6px 8px; border-radius: 10px; background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .25); color: #cffafe; }
.selected-info dl { margin: 0; display: grid; gap: 4px; }
.selected-info dt { font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #7dd3fc; }
.selected-info dd { margin: 0 0 4px; line-height: 1.35; }

/* The AI tutor's talk panel (a mascot in the 3D view): subtitles on a see-through band, then the bar. */
body.has-tutor #clips { display: none !important; }
.tutor-talk { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); width: min(640px, calc(100% - 24px)); z-index: 30; display: grid; gap: 8px; pointer-events: none; }
.tutor-talk > * { pointer-events: auto; }
.tt-subs { text-align: center; display: grid; gap: 4px; }
.tt-status { margin: 0; font: 700 13px/1.3 system-ui, sans-serif; color: #7dd3fc; text-shadow: 0 1px 4px #000c; }
.tt-status.bad { color: #fda4af; }
.tt-line { margin: 0; font: 700 18px/1.7 system-ui, sans-serif; color: #fff; max-height: 34vh; overflow: auto; }
.tt-line span { background: rgba(4, 10, 26, .62); padding: 2px 8px; box-decoration-break: clone; -webkit-box-decoration-break: clone; border-radius: 6px; }
.tt-bar { display: flex; gap: 6px; align-items: center; margin: 0; }
.tt-toggle { min-width: 52px; height: 46px; border-radius: 14px; border: 1px solid #94a3b84d; background: #0f172ad9; color: #e2e8f0; font: 700 12px system-ui, sans-serif; }
.tt-toggle.on { background: #7dd3fc; color: #04122a; border-color: #7dd3fc; }
.tt-input { flex: 1; min-width: 0; height: 46px; border-radius: 23px; border: 1px solid #94a3b84d; background: #0f172ae6; color: #f8fafc; padding: 0 14px; font: 15px system-ui, sans-serif; }
.tt-mic { width: 52px; height: 52px; border-radius: 50%; border: 0; background: #fb7185; font-size: 22px; }
.tt-mic.live { background: #f43f5e; box-shadow: 0 0 0 6px #f43f5e40; }
