/* City Clinic Studio shell (scoped). Colours follow the site's V3 tokens, so light and dark follow the site switch. */
.ccst{--bg:var(--cc-ground);--card:var(--cc-surface);--ink:var(--cc-ink);--muted:var(--cc-ink2);--line:var(--cc-line);--accent:var(--cc-accent);--btn:var(--cc-btn,#80634E);--btn-ink:#fff;--warn:#B4533C;--good:#7FB59B;--gold:#E7CFA5;
--stage-a:#1D3B36;--stage-b:#0F211F;--stage-ink:#F5F4F0;--stage-muted:#A9B8B3;--font:'Work Sans',system-ui,-apple-system,'Segoe UI',sans-serif;--top:68px;
display:flex;flex-direction:column;gap:16px;color:var(--ink);font-family:var(--font);font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased}
:root[data-theme="dark"] .ccst{--warn:#E08E78}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .ccst{--warn:#E08E78}}
.admin-bar .ccst{--top:100px}
.ccst .stage{scroll-margin-top:calc(var(--top) + 6px)}
.ccst [hidden]{display:none!important}
.ccst h2{font-family:var(--font)!important;letter-spacing:0!important}
.ccst button{letter-spacing:0}

/* Layout idea: the 3D treatment stage is the page. Instruments sit in a tray on the stage; points and reward stay quiet below. */
.ccst,.ccst *{box-sizing:border-box}
.ccst button{font-family:inherit;font-size:15px;cursor:pointer}
.ccst button:focus-visible,.ccst input:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.ccst .ghost{background:none;border:1px solid var(--line);color:var(--ink);border-radius:999px;padding:6px 14px;min-height:36px}
.ccst .ghost:hover{border-color:var(--accent)}
.ccst .primary{background:var(--btn);color:var(--btn-ink);border:0;border-radius:999px;padding:12px 26px;font-weight:600;min-height:46px;transition:transform .15s,box-shadow .15s}
.ccst .primary:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 6px 16px rgba(0,0,0,.25)}
.ccst .primary:disabled{opacity:.45;cursor:default}
.ccst .row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}

.ccst .stage{position:relative;border-radius:20px;overflow:hidden;aspect-ratio:16/10;max-height:84vh;width:100%;
  background:radial-gradient(ellipse at 50% 38%,var(--stage-a) 0%,var(--stage-b) 78%);color:var(--stage-ink);user-select:none;-webkit-user-select:none}
@media (max-width:640px){.ccst .stage{aspect-ratio:3/4.5}}
.ccst canvas{display:block;width:100%;height:100%}
.ccst .stage.playing canvas{touch-action:none;cursor:none}
.ccst .viewbtns .snd[aria-pressed="true"]{background:var(--gold);color:#152B28;border-color:var(--gold)}
.ccst .viewbtns .snd.nudge{animation:nudge 1.1s ease-in-out infinite}
.ccst .viewbtns .zb{min-width:34px;font-size:16px;line-height:1;padding:4px 10px}
.ccst .viewbtns .zb:disabled{opacity:.35}
.ccst .stage.turning canvas{cursor:ew-resize}
.ccst .stage.review canvas{touch-action:none;cursor:ew-resize}
.ccst .stage.review #soundBtn,.ccst .stage.review #pauseBtn{display:none}
.ccst .layer{position:absolute;inset:0;pointer-events:none}
.ccst .hudtop{position:absolute;left:14px;right:14px;top:12px;display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.ccst .case small,.ccst .meter small{display:block;font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--stage-muted)}
.ccst .case b{font-weight:500;font-size:16px;display:block;max-width:26ch;line-height:1.25}
.ccst .meter{min-width:130px;text-align:right}
.ccst .meter .t{font-variant-numeric:tabular-nums;font-size:16px;font-weight:500}
.ccst .mbar{height:6px;border-radius:9px;background:rgba(245,244,240,.16);overflow:hidden;margin:5px 0 6px}
.ccst .mbar i{display:block;height:100%;width:100%;background:var(--good);border-radius:9px;transition:width .25s,background .25s}
.ccst #heatRow{visibility:hidden}
.ccst #heatRow.on{visibility:visible}
.ccst #heatBar{background:var(--gold);transition:none}
.ccst .coach{position:absolute;left:0;right:0;bottom:98px;text-align:center;padding:0 16px;font-size:14.5px;color:var(--stage-ink);text-shadow:0 1px 8px rgba(0,0,0,.5)}
.ccst .coach span{display:inline-block;background:rgba(10,24,22,.55);border:1px solid rgba(245,244,240,.14);padding:5px 14px;border-radius:14px;backdrop-filter:blur(6px)}
.ccst .tray{position:absolute;left:0;right:0;bottom:12px;display:flex;justify-content:center;gap:6px;padding:0 8px;pointer-events:none}
.ccst .tool{pointer-events:auto;position:relative;width:74px;min-height:72px;border-radius:14px;border:1px solid rgba(245,244,240,.16);background:rgba(10,24,22,.6);color:var(--stage-ink);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:6px 2px;font-size:10.5px;line-height:1.15;backdrop-filter:blur(6px);transition:transform .15s,background .15s,border-color .15s}
.ccst .tool svg{width:26px;height:26px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.ccst .tool[aria-pressed="true"]{background:var(--gold);color:#152B28;border-color:var(--gold);transform:translateY(-6px)}
.ccst .tool:disabled{opacity:.28;cursor:default}
.ccst .tool .n{position:absolute;top:-6px;right:-4px;min-width:20px;height:20px;border-radius:10px;background:var(--btn);color:#fff;font-size:11.5px;font-weight:600;display:none;align-items:center;justify-content:center;padding:0 5px}
.ccst .tool .n.on{display:flex}
.ccst .tool.nudge{animation:nudge 1.1s ease-in-out infinite}
@keyframes nudge{50%{border-color:var(--gold);box-shadow:0 0 0 4px rgba(231,207,165,.22)}}
@media (max-width:520px){.ccst .tool{width:54px;min-height:62px;font-size:9.5px}.ccst .tool svg{width:22px;height:22px}.ccst .coach{bottom:84px;font-size:13.5px}.ccst .case b{font-size:14.5px;max-width:18ch}.ccst .meter{min-width:104px}}
.ccst .float{position:absolute;font-weight:600;font-size:17px;color:var(--gold);transform:translate(-50%,-50%);animation:rise .9s ease-out forwards;text-shadow:0 2px 8px rgba(0,0,0,.6);white-space:nowrap}
.ccst .float.bad{color:#F0A08C}
@keyframes rise{to{transform:translate(-50%,-150%);opacity:0}}
.ccst #ring{position:absolute;width:54px;height:54px;transform:translate(-50%,-50%);display:none}
.ccst #ring circle{fill:none;stroke-width:4}
.ccst #ring .bg{stroke:rgba(10,24,22,.55)}
.ccst #ring .fg{stroke:var(--gold);stroke-linecap:round;transform:rotate(-90deg);transform-origin:50% 50%}
.ccst .toast{position:absolute;left:50%;top:84px;transform:translateX(-50%);background:rgba(10,24,22,.82);border:1px solid rgba(245,244,240,.18);padding:7px 16px;border-radius:999px;font-size:14px;opacity:0;transition:opacity .2s;white-space:nowrap;max-width:92%}
.ccst .toast.on{opacity:1}
.ccst .overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:flex-start;padding:26px;background:linear-gradient(100deg,rgba(10,24,22,.94) 0%,rgba(10,24,22,.8) 45%,rgba(10,24,22,.25) 100%)}
.ccst .overlay[hidden]{display:none}
@media (max-width:640px){.ccst .overlay{align-items:flex-end;background:linear-gradient(to top,rgba(10,24,22,.96) 0%,rgba(10,24,22,.86) 55%,rgba(10,24,22,.2) 100%)}}
.ccst .panel{max-width:440px;display:flex;flex-direction:column;gap:12px;align-items:flex-start}
.ccst .panel h2{margin:0;font-weight:500;font-size:28px;line-height:1.15;text-wrap:balance}
.ccst .panel p{margin:0;color:var(--stage-muted);font-size:15px}
.ccst .panel .big{font-size:46px;font-weight:500;line-height:1;font-variant-numeric:tabular-nums}
.ccst .stars{display:flex;gap:6px}
.ccst .stars svg{width:30px;height:30px;fill:rgba(245,244,240,.16)}
.ccst .stars svg.on{fill:var(--gold)}
.ccst .lines{font-size:14px;color:var(--stage-muted);font-variant-numeric:tabular-nums;display:grid;grid-template-columns:auto auto;gap:2px 18px}
.ccst .lines b{color:var(--stage-ink);font-weight:500;text-align:right}
.ccst .overlay .ghost,.ccst .viewbtns .ghost{color:var(--stage-ink);border-color:rgba(245,244,240,.3);background:rgba(10,24,22,.5)}
.ccst .snd{position:absolute;left:12px;top:66px;pointer-events:auto;font-size:12px;padding:4px 10px;min-height:28px;color:var(--stage-muted);border-color:rgba(245,244,240,.18);background:rgba(10,24,22,.5)}


.ccst .reward{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:18px;display:flex;flex-direction:column;gap:12px}
.ccst .reward h2{margin:0;font-size:18px;font-weight:600}
.ccst .reward p{margin:0;color:var(--muted);font-size:15px;max-width:64ch}
.ccst .bar{height:8px;border-radius:99px;background:var(--line);overflow:hidden}
.ccst .bar i{display:block;height:100%;width:0;background:var(--accent);border-radius:99px;transition:width .6s}
.ccst .pts{display:flex;justify-content:space-between;font-variant-numeric:tabular-nums;font-size:14px;color:var(--muted)}
.ccst .pts b{color:var(--ink);font-weight:600;font-size:18px}
.ccst .note{font-size:13px;color:var(--muted)}
.ccst .tools{font-size:13px;color:var(--muted);border-top:1px dashed var(--line);padding-top:12px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.ccst .tools button{font-size:13px;padding:4px 12px;min-height:30px}
.ccst .tools select{font:inherit;font-size:13px;color:var(--ink);background:var(--card);border:1px solid var(--line);border-radius:8px;padding:4px 8px;min-height:30px}

.ccst .modal{position:fixed;inset:0;background:rgba(10,24,22,.6);display:flex;align-items:center;justify-content:center;padding:16px;z-index:100000;overflow:auto}
.ccst .modal[hidden]{display:none}
.ccst .sheet{background:var(--bg);color:var(--ink);border-radius:18px;padding:22px;width:100%;max-width:480px;max-height:100%;overflow:auto}
.ccst .sheet h2{margin:0;font-weight:500;font-size:22px}
.ccst .sheet p{margin:0;color:var(--muted);font-size:14px}
.ccst .grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.ccst .grid .full{grid-column:1/-1}
@media (max-width:420px){.ccst .grid{grid-template-columns:1fr}}
.ccst label.f{display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--muted)}
.ccst input[type=text],.ccst input[type=email],.ccst input[type=tel]{font:inherit;color:var(--ink);background:var(--card);border:1px solid var(--line);border-radius:10px;padding:10px 12px;min-height:44px;width:100%}
.ccst label.c{display:flex;gap:10px;font-size:14px;align-items:flex-start}
.ccst label.c input{margin-top:3px;width:18px;height:18px;accent-color:var(--btn);flex:none}
.ccst .preview-note{font-size:12.5px;border:1px dashed var(--accent);border-radius:10px;padding:8px 10px;color:var(--muted)}
.ccst .col{display:flex;flex-direction:column;gap:14px}

/* v2 layout: bars above and below the 3D view, nothing covers the teeth */
.ccst .stage{aspect-ratio:auto;max-height:none;display:flex;flex-direction:column}
.ccst .topbar{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:12px 14px 0}
.ccst .coach{position:static;padding:8px 14px 2px;min-height:44px;text-align:center;font-size:14.5px;text-shadow:none}
.ccst .view{position:relative;width:100%;aspect-ratio:16/11;max-height:max(340px,calc(100vh - 360px));min-height:0;background:#0C1C1A}
@media (max-width:640px){.ccst .view{aspect-ratio:4/5;max-height:none}.ccst .toast{white-space:normal;text-align:center;width:92%;border-radius:14px}.ccst .viewbtns{left:6px;right:6px;bottom:6px;gap:4px;justify-content:center;flex-wrap:wrap}.ccst .hint{display:none}.ccst .viewbtns .snd{font-size:11px;padding:3px 8px;white-space:nowrap}}
.ccst .tray{position:static;padding:10px 8px 12px;pointer-events:auto}
.ccst .toast{top:8px}
.ccst .viewbtns{position:absolute;left:10px;bottom:8px;display:flex;gap:6px;pointer-events:auto}
.ccst .snd{position:static;font-size:12px;padding:4px 10px;min-height:28px}
.ccst .hint{position:absolute;right:12px;bottom:12px;font-size:12px;color:var(--stage-muted)}
@media (max-width:520px){.ccst .tray{gap:4px;flex-wrap:wrap}.ccst .tool{width:auto;flex:1 1 17%;min-width:0;min-height:52px;font-size:9.5px}.ccst .hint{display:none}}
.ccst .overlay.solid{background:rgba(10,24,22,.985)}
.ccst .scan{position:absolute;inset:0;display:none;background:rgba(40,90,150,.16)}
.ccst .scan.on{display:block}
.ccst .scan i{position:absolute;top:0;bottom:0;left:0;width:3px;background:#9CC8FF;box-shadow:0 0 26px 8px rgba(156,200,255,.55);animation:sweep 2.4s linear forwards}
.ccst .scan span{position:absolute;left:14px;top:12px;font-size:11px;letter-spacing:.2em;text-transform:uppercase;color:#BFDcff}
@keyframes sweep{to{left:100%}}
.ccst .panel input[type=text]{max-width:280px}
.ccst .how{display:grid;grid-template-columns:repeat(2,1fr);gap:14px 22px}
@media (max-width:640px){.ccst .how{grid-template-columns:1fr}}
.ccst .how div{display:grid;grid-template-columns:34px 1fr;gap:2px 10px;font-size:14.5px;color:var(--muted)}
.ccst .how svg{width:26px;height:26px;stroke:var(--accent);fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;grid-row:1/3}
.ccst .how b{color:var(--ink);font-weight:600}
.ccst .how span{grid-column:2}
.ccst .tabs{display:flex;gap:6px}
.ccst .tabs button[aria-pressed="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.ccst .board{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.ccst .board li{display:grid;grid-template-columns:2.4em 1fr auto;gap:10px;padding:9px 10px;border-top:1px solid var(--line);font-variant-numeric:tabular-nums;align-items:baseline}
.ccst .board li i{font-style:normal;color:var(--muted)}
.ccst .board li b{font-weight:500}
.ccst .board li.me{border:1px solid var(--accent);border-radius:10px;background:rgba(154,122,98,.1)}
.ccst .board li.me b{font-weight:600}
.ccst .board li.gap{display:block;text-align:center;color:var(--muted);padding:2px}
.ccst .nickrow{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}
.ccst .nickrow label{flex:1 1 200px}

/* v3: comfortable touch sizes, one instruction at a time, icon controls, even tool rows, tabs under the game, phone landscape */
.ccst .reward[hidden],.ccst .tools[hidden]{display:none}
.ccst .case small,.ccst .meter small{font-size:11px}
.ccst .tool{font-size:11.5px}
.ccst .scan span{font-size:11.5px}
.ccst .coach{position:relative;inset:auto;min-height:48px;display:flex;align-items:center;justify-content:center}
.ccst .coach .toast{top:50%;transform:translate(-50%,-50%);background:#0F211F;border-color:rgba(231,207,165,.5);white-space:normal;text-align:center;width:max-content;max-width:calc(100% - 20px);border-radius:14px;line-height:1.3;z-index:2;pointer-events:none}
.ccst .coach:has(.toast.on)>span{visibility:hidden}
.ccst .snd,.ccst .viewbtns .snd{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:4px 12px;font-size:12.5px;white-space:nowrap}
.ccst .snd svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;display:none;flex:none}
/* zoom glyphs */.ccst .viewbtns .zb{font-size:17px;min-width:40px;line-height:1}
.ccst #soundBtn[aria-pressed="true"] .x,.ccst #soundBtn[aria-pressed="false"] .w{display:none}
.ccst .tabs .ghost{min-height:40px}
.ccst .seg{display:flex;gap:4px;background:var(--card);border:1px solid var(--line);border-radius:999px;padding:4px}
.ccst .seg button{flex:1 1 0;min-width:0;border:0;background:none;color:var(--muted);border-radius:999px;min-height:44px;font-weight:500;font-size:14.5px;padding:0 8px}
.ccst .seg button[aria-selected="true"]{background:var(--ink);color:var(--bg)}
.ccst .loadbar{height:8px;border-radius:99px;background:rgba(245,244,240,.16);overflow:hidden;width:min(320px,100%)}
.ccst .loadbar i{display:block;height:100%;width:0;background:var(--gold);border-radius:99px;transition:width .2s}
.ccst .tray{--tc:5}
@media (max-width:640px){
  .ccst .tray{flex-wrap:wrap;gap:4px;justify-content:center;padding:8px 8px 10px}
  .ccst .tool{width:auto;flex:0 0 calc((100% - (var(--tc) - 1)*4px)/var(--tc));min-width:0;min-height:56px;font-size:11px}
  .ccst .tool[aria-pressed="true"]{transform:none}
  .ccst .view{max-height:max(280px,calc(100dvh - var(--top) - 326px))}
  .ccst .viewbtns{left:6px;right:6px;bottom:6px;gap:6px;justify-content:center;flex-wrap:nowrap}
  .ccst .snd,.ccst .viewbtns .snd{min-height:44px;min-width:44px;padding:0 12px;font-size:13px}
  .ccst .snd svg{display:block}
  .ccst .snd .lbl{display:none}
  .ccst .viewbtns .zb{display:none}
  .ccst .coach{min-height:56px;font-size:13.5px}
  .ccst .ghost,.ccst .tabs .ghost{min-height:44px}
  .ccst .seg button{font-size:13.5px}
  .ccst .hint{display:none}
}
@media (pointer:coarse){.ccst .snd,.ccst .viewbtns .snd,.ccst .ghost,.ccst .tabs .ghost{min-height:44px}}
@media (orientation:landscape) and (max-height:520px){
  .ccst .stage{display:grid;grid-template-columns:minmax(0,auto) minmax(0,1fr) auto auto;grid-template-rows:auto minmax(0,1fr);height:calc(100dvh - var(--top) - 12px);min-height:280px}
  .ccst .topbar{display:contents}
  .ccst .case{grid-column:1;grid-row:1;padding:8px 0 6px 12px;max-width:210px}
  .ccst .case b{font-size:14px}
  .ccst .coach{grid-column:2;grid-row:1;min-height:0;padding:6px 10px;font-size:13px}
  .ccst .meter{grid-column:3;grid-row:1;padding:8px 12px 6px 0;min-width:0;display:grid;grid-template-columns:auto 84px;gap:2px 8px;align-items:center;text-align:right}
  .ccst .meter .mbar{margin:0}
  .ccst .meter .t{font-size:14px}
  .ccst #heatRow{display:contents}
  .ccst .view{grid-column:1/4;grid-row:2;aspect-ratio:auto;max-height:none;height:auto;min-height:0}
  .ccst .tray{grid-column:4;grid-row:1/3;display:grid;grid-template-columns:repeat(2,64px);align-content:center;justify-content:center;gap:5px;padding:8px;flex-wrap:nowrap}
  .ccst .tool{width:auto;flex:none;min-height:50px;font-size:11px;padding:4px 2px}
  .ccst .tool svg{width:22px;height:22px}
  .ccst .tool[aria-pressed="true"]{transform:none}
  .ccst .viewbtns{left:8px;right:auto;bottom:6px;gap:6px;justify-content:flex-start}
  .ccst .snd,.ccst .viewbtns .snd{min-height:44px;min-width:44px;padding:0 12px}
  .ccst .snd svg{display:block}
  .ccst .snd .lbl{display:none}
  .ccst .viewbtns .zb{display:inline-flex}
  .ccst .hint{display:none}
  .ccst .overlay{align-items:center;padding:12px 18px;overflow:auto;background:linear-gradient(100deg,rgba(10,24,22,.95) 0%,rgba(10,24,22,.84) 55%,rgba(10,24,22,.3) 100%)}
  .ccst .panel{gap:8px;max-width:540px}
  .ccst .panel h2{font-size:21px}
  .ccst .panel p{font-size:13.5px}
  .ccst .panel .big{font-size:32px}
  .ccst .stars svg{width:22px;height:22px}
  .ccst .ghost{min-height:44px}
}
@media (prefers-reduced-motion:reduce){.ccst,.ccst *{transition:none!important;animation:none!important}}
