/* Phyziowork Portal Mockup — Trace v24 brand tokens */
:root {
  --shell: #0c0e12;
  --shell-elev: #14171e;
  --shell-mid: #1a1d24;
  --shell-line: #2a2f38;
  --on-shell: #f4f1ea;
  --on-shell-muted: #a8b0bc;
  --gold: #c4a878;
  --gold-bright: #e8d4aa;
  --gold-deep: #a88b5c;
  --gold-line: rgba(196, 168, 120, 0.45);
  --gold-soft: rgba(196, 168, 120, 0.12);
  --gold-glow: 0 0 0 1px rgba(196, 168, 120, 0.4), 0 0 14px rgba(196, 168, 120, 0.18);
  --ok: #4a8f6a;
  --ok-soft: rgba(74, 143, 106, 0.15);
  --warn: #b45309;
  --danger: #c45c5c;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* page-95-v0.1 · rem baseline; desktop ~95vw below */
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--on-shell);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(196, 168, 120, 0.08), transparent 55%),
    linear-gradient(180deg, #10131a 0%, var(--shell) 48%, #080a0d 100%);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

/* ---------- Shell layout ---------- */
/* page-95-v0.1 · mobile full-bleed; desktop ~95vw set in media below */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px 32px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--gold-line);
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(12, 14, 18, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: none;
  overflow: hidden;
}

.brand-mark img,
.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.brand-text { display: flex; flex-direction: column; gap: 2px; }

.brand-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--on-shell);
}

.brand-trace {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.36em;
  color: var(--gold-bright);
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge-demo {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-line);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--gold-soft);
}

/* ---- i18n-v0.1 language switch · top-right ---- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: rgba(12, 14, 18, 0.72);
  flex-shrink: 0;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--on-shell-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 11px;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
}
.lang-btn + .lang-btn {
  border-left: 1px solid var(--gold-line);
}
.lang-btn.is-active,
.lang-btn[aria-pressed="true"] {
  background: var(--gold-soft);
  color: var(--gold-bright);
}
.lang-btn:hover {
  color: var(--gold);
}
.lang-switch--global {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 120;
}
/* When header chrome is present, hide the floating twin to avoid double chips */
.lang-switch--header {
  margin-right: 2px;
}
body:not(.rom-mode):not(.intro-playing) .lang-switch--global {
  display: none;
}
body.rom-mode .lang-switch--global {
  /* ROM top dock already has .lang-switch--rom — avoid double chips */
  display: none;
}
body.intro-playing .lang-switch--global {
  display: inline-flex;
  opacity: 0.85;
}
.lang-switch--rom {
  align-self: center;
  margin-left: 6px;
  margin-right: 4px;
  background: rgba(8, 10, 13, 0.85);
}
.lang-switch--rom .lang-btn {
  font-size: 10px;
  padding: 3px 8px;
}
@media (max-width: 720px) {
  .lang-switch--global { top: 10px; right: 10px; }
  .lang-btn { padding: 4px 8px; font-size: 10px; }
}

.site-footer {
  margin-top: auto;
  padding: 28px 4px 8px;
  border-top: 1px solid var(--shell-line);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 11px;
  color: var(--on-shell-muted);
  letter-spacing: 0.04em;
  line-height: 1.7;
}

/* ---------- Views ---------- */
.view { display: none; animation: fadeIn 0.35s ease; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Landing ---------- */
.hero {
  padding: 48px 0 32px;
  text-align: center;
}

.hero-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--on-shell);
}

.hero p {
  margin: 0 auto 36px;
  max-width: 420px;
  color: var(--on-shell-muted);
  font-size: 14px;
}

.entrance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .entrance-grid { grid-template-columns: 1fr 1fr; }
}

.entrance-card {
  position: relative;
  text-align: left;
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--gold-line);
  background: linear-gradient(165deg, var(--shell-elev) 0%, var(--shell-mid) 100%);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.entrance-card:hover {
  border-color: rgba(232, 212, 170, 0.65);
  box-shadow: var(--gold-glow), var(--shadow-lg);
  transform: translateY(-2px);
}

.entrance-card:focus-visible {
  outline: none;
  box-shadow: var(--gold-glow), 0 0 0 3px rgba(196, 168, 120, 0.35);
}

.entrance-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--gold-bright);
}

.entrance-card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.entrance-card p {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--on-shell-muted);
  line-height: 1.6;
}

.entrance-cta {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  text-transform: uppercase;
}

.landing-note {
  margin: 40px auto 0;
  max-width: 520px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--shell-line);
  background: rgba(20, 23, 30, 0.6);
  font-size: 12px;
  color: var(--on-shell-muted);
  text-align: center;
  line-height: 1.65;
}

/* ---------- Panels / cards ---------- */
.page-head {
  padding: 28px 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.page-head h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.page-head .sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--on-shell-muted);
}

.panel {
  border-radius: var(--radius);
  border: 1px solid var(--shell-line);
  background: var(--shell-elev);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel + .panel { margin-top: 16px; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(196, 168, 120, 0.06), transparent);
}

.panel-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.panel-body { padding: 16px 18px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1.2fr 0.8fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--shell-mid);
  color: var(--on-shell);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover { border-color: var(--gold-line); color: var(--gold-bright); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-gold {
  border-color: var(--gold-line);
  background: linear-gradient(180deg, rgba(196, 168, 120, 0.22), rgba(196, 168, 120, 0.08));
  color: var(--gold-bright);
  box-shadow: var(--gold-glow);
}

.btn-gold:hover {
  background: linear-gradient(180deg, rgba(196, 168, 120, 0.32), rgba(196, 168, 120, 0.12));
  color: #fff8e8;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--on-shell-muted);
}

.btn-ghost:hover { color: var(--gold-bright); background: var(--gold-soft); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------- Lists / rows ---------- */
.list { list-style: none; margin: 0; padding: 0; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--shell-line);
}

.list-row:last-child { border-bottom: none; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-bright);
  flex-shrink: 0;
}

.row-main { flex: 1; min-width: 0; }

.row-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 2px;
  writing-mode: horizontal-tb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.row-meta {
  font-size: 12px;
  color: var(--on-shell-muted);
  margin: 0;
}

.tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--shell-line);
  color: var(--on-shell-muted);
  white-space: nowrap;
}

.tag-ok {
  border-color: rgba(74, 143, 106, 0.45);
  color: #7dba96;
  background: var(--ok-soft);
}

.tag-gold {
  border-color: var(--gold-line);
  color: var(--gold-bright);
  background: var(--gold-soft);
}

/* ---------- Progress ---------- */
.progress-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 520px) {
  .progress-cards { grid-template-columns: 1fr 1fr; }
}

.stat-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--shell-mid);
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-shell-muted);
  margin: 0 0 8px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  margin: 0 0 4px;
}

.stat-hint {
  font-size: 12px;
  color: var(--on-shell-muted);
  margin: 0;
}

.bar-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--shell);
  border: 1px solid var(--shell-line);
  overflow: hidden;
  margin-top: 12px;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  transition: width 0.6s ease;
}

.chart-wrap {
  margin-top: 8px;
  padding: 12px 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--shell);
}

.chart-svg { width: 100%; height: 120px; display: block; }

.chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
  font-size: 11px;
  color: var(--on-shell-muted);
}

.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.leg-rom::before { background: var(--gold-bright); }
.leg-pain::before { background: #7dba96; }

/* ---------- Login ---------- */
.login-wrap {
  max-width: 400px;
  margin: 40px auto 0;
}

.login-wrap .panel-body { padding: 24px; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-shell-muted);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--shell);
  color: var(--on-shell);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  border-color: var(--gold-line);
  box-shadow: 0 0 0 3px rgba(196, 168, 120, 0.2);
}

.field input::placeholder { color: #5c6570; }

.login-hint {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--on-shell-muted);
  text-align: center;
  line-height: 1.6;
}

/* ---------- Client nav ---------- */
.client-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--shell);
  margin-bottom: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.client-tab {
  flex: 1;
  min-width: max-content;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--on-shell-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.client-tab.active {
  background: var(--gold-soft);
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px var(--gold-line);
}

.client-tab:hover:not(.active) { color: var(--on-shell); }

.client-pane { display: none; }
.client-pane.active { display: block; animation: fadeIn 0.3s ease; }

.summary-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--shell-line);
}

.summary-block:last-child { border-bottom: none; padding-bottom: 0; }
.summary-block:first-child { padding-top: 0; }

.summary-block h3 {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.summary-block p {
  margin: 0;
  font-size: 14px;
  color: var(--on-shell);
  line-height: 1.65;
}

/* ---------- Modal / toast ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay.open { display: flex; }

.modal {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--gold-line);
  background: var(--shell-elev);
  box-shadow: var(--shadow-lg), var(--gold-glow);
  padding: 24px;
  animation: fadeIn 0.25s ease;
}

.modal h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}

.modal p {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--on-shell-muted);
  line-height: 1.65;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  max-width: min(420px, calc(100% - 32px));
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-line);
  background: var(--shell-elev);
  box-shadow: var(--shadow-lg);
  font-size: 0.9375rem; /* v19.2.10-tipfonts · was 13px */
  color: var(--on-shell);
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  text-align: center;
  line-height: 1.5;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ---------- Therapist extras ---------- */
.cta-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--gold-line);
  background:
    linear-gradient(135deg, rgba(196, 168, 120, 0.14), transparent 50%),
    var(--shell-elev);
  margin-bottom: 16px;
  box-shadow: var(--gold-glow);
}

.cta-banner h2 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: 0.06em;
}

.cta-banner p {
  margin: 0;
  font-size: 12px;
  color: var(--on-shell-muted);
}

.time-pill {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
}

.back-row {
  margin-bottom: 8px;
}

@media (max-width: 480px) {
  .hero { padding: 32px 0 24px; }
  .panel-body { padding: 14px; }
  .cta-banner { padding: 16px; }
}

/* ---------- Expanded: HEP / messages / docs / notes ---------- */
.hep-card {
  /* hep-mobile-v0.1 · desktop: thumb | body | actions */
  padding: 14px 0;
  border-bottom: 1px solid var(--shell-line);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.hep-card:last-child { border-bottom: none; padding-bottom: 0; }
.hep-card:first-child { padding-top: 0; }

.hep-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid var(--gold-line);
  background:
    linear-gradient(145deg, rgba(196, 168, 120, 0.2), transparent 55%),
    var(--shell-mid);
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.2;
  flex-shrink: 0;
}

.hep-body {
  min-width: 0;
}
.hep-title,
.hep-body .row-title {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.hep-meta { font-size: 12px; color: var(--on-shell-muted); margin: 4px 0 0; }
.hep-sets {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-top: 6px;
}
.hep-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-shrink: 0;
}

.msg-thread { display: flex; flex-direction: column; gap: 12px; max-height: 360px; overflow-y: auto; }

.msg-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid var(--shell-line);
}

.msg-bubble.clinic {
  align-self: flex-start;
  background: var(--shell-mid);
  border-color: var(--shell-line);
}

.msg-bubble.me {
  align-self: flex-end;
  background: var(--gold-soft);
  border-color: var(--gold-line);
}

.msg-time {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--on-shell-muted);
}

.msg-compose {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--shell-line);
}

.msg-compose input {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--shell);
  color: var(--on-shell);
  outline: none;
}
.msg-compose input:focus { border-color: var(--gold-line); }

.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--shell-line);
}
.doc-row:last-child { border-bottom: none; padding-bottom: 0; }
.doc-row:first-child { padding-top: 0; }

.doc-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.outcome-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .outcome-grid { grid-template-columns: 1fr 1fr; }
}

.note-draft {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--shell);
  color: var(--on-shell);
  resize: vertical;
  outline: none;
  line-height: 1.55;
}
.note-draft:focus { border-color: var(--gold-line); box-shadow: 0 0 0 3px rgba(196, 168, 120, 0.2); }

.caseload-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--shell-line);
  background: transparent;
  color: var(--on-shell-muted);
  font-size: 12px;
  cursor: pointer;
}
.filter-chip.active {
  border-color: var(--gold-line);
  color: var(--gold-bright);
  background: var(--gold-soft);
}

.therapist-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--shell);
  margin-bottom: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.therapist-tab {
  flex: 1;
  min-width: max-content;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--on-shell-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.therapist-tab.active {
  background: var(--gold-soft);
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px var(--gold-line);
}

.therapist-pane { display: none; }
.therapist-pane.active { display: block; animation: fadeIn 0.3s ease; }

/* ---- unread-dot-v0.1 · therapist tab unread tip ---- */
.therapist-tab {
  position: relative;
}
.therapist-tab-unread {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53935;
  box-shadow: 0 0 0 2px var(--shell, #1a1a1a);
  pointer-events: none;
}
.therapist-tab-unread[hidden] {
  display: none !important;
}
.therapist-tab.is-unread {
  font-weight: 600;
}
.shift-cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.btn-xfer-cancel,
.shift-cover-cancel {
  border: 1px solid var(--shell-line, #444);
}

.check-done {
  /* desktop default; mobile overrides ≥44px below */
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid var(--gold-line);
  background: transparent;
  color: var(--gold-bright);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.check-done.done {
  background: var(--ok-soft);
  border-color: rgba(74, 143, 106, 0.45);
  color: #7dba96;
}

.inspire-note {
  margin-top: 24px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--shell-line);
  font-size: 11px;
  color: var(--on-shell-muted);
  line-height: 1.65;
}


/* ---------- Innovation v2 ---------- */
.tag-warn {
  border-color: rgba(180, 83, 9, 0.5);
  color: #e8a86a;
  background: rgba(180, 83, 9, 0.15);
}
.tag-danger {
  border-color: rgba(196, 92, 92, 0.5);
  color: #e09090;
  background: rgba(196, 92, 92, 0.12);
}

.focus-card {
  padding: 14px 0;
  border-bottom: 1px solid var(--shell-line);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.focus-card:last-child { border-bottom: none; padding-bottom: 0; }
.focus-card:first-child { padding-top: 0; }
.focus-reason {
  font-size: 12px;
  color: var(--on-shell-muted);
  margin: 4px 0 0;
  line-height: 1.5;
}
.focus-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--shell-line);
  display: grid; place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.focus-icon.vas { border-color: rgba(196,92,92,0.45); background: rgba(196,92,92,0.12); }
.focus-icon.hep { border-color: rgba(180,83,9,0.45); background: rgba(180,83,9,0.12); }
.focus-icon.flag { border-color: rgba(196,92,92,0.55); background: rgba(196,92,92,0.18); color: #e09090; }

.handoff-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .handoff-grid { grid-template-columns: 1fr 1fr; }
}
.handoff-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--shell-mid);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.handoff-card .hc-top {
  display: flex; align-items: center; gap: 10px;
}
.handoff-card .hc-angles {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  line-height: 1.6;
}
.handoff-card .hc-goal {
  font-size: 13px;
  color: var(--on-shell);
  margin: 0;
}
.handoff-card .hc-meta {
  font-size: 11px;
  color: var(--on-shell-muted);
  margin: 0;
}
.handoff-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.diff-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--shell-line);
  font-size: 13px;
}
.diff-row:last-child { border-bottom: none; }
.diff-label { color: var(--on-shell-muted); }
.diff-vals { font-family: var(--mono); color: var(--on-shell); letter-spacing: 0.03em; }
.diff-delta {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.diff-delta.up {
  color: #7dba96;
  background: var(--ok-soft);
  border: 1px solid rgba(74,143,106,0.4);
}
.diff-delta.down {
  color: #e09090;
  background: rgba(196,92,92,0.12);
  border: 1px solid rgba(196,92,92,0.4);
}
.diff-delta.flat {
  color: var(--on-shell-muted);
  border: 1px solid var(--shell-line);
}

.rhythm-meter {
  margin-top: 8px;
}
.rhythm-bar {
  height: 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--shell-line);
  background: var(--shell);
  overflow: hidden;
  display: flex;
}
.rhythm-seg {
  height: 100%;
  transition: width 0.5s ease;
}
.rhythm-seg.full { background: linear-gradient(90deg, #a88b5c, #e8d4aa); }
.rhythm-seg.mid { background: linear-gradient(90deg, #3d6b52, #7dba96); }
.rhythm-seg.light { background: rgba(168,176,188,0.25); }
.rhythm-legend {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 10px; font-size: 11px; color: var(--on-shell-muted);
}
.rhythm-status {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px; font-size: 14px; font-weight: 600;
  letter-spacing: 0.06em; color: var(--gold-bright);
}

.toggle-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0;
}
.toggle {
  position: relative;
  width: 44px; height: 26px; flex-shrink: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--shell-line);
  background: var(--shell);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.toggle.on {
  background: var(--gold-soft);
  border-color: var(--gold-line);
}
.toggle::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--on-shell-muted);
  transition: transform 0.2s, background 0.2s;
}
.toggle.on::after {
  transform: translateX(18px);
  background: var(--gold-bright);
}
.toggle-copy h3 {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--on-shell);
}
.toggle-copy p {
  margin: 0;
  font-size: 12px;
  color: var(--on-shell-muted);
  line-height: 1.65;
}

/* Body notes */
.note-sliders { display: flex; flex-direction: column; gap: 18px; }
.slider-block label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--on-shell-muted); margin-bottom: 8px;
}
.slider-block .val {
  font-family: var(--mono); color: var(--gold-bright); font-size: 14px;
  letter-spacing: 0.04em; text-transform: none;
}
.slider-block input[type="range"] {
  width: 100%;
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: var(--radius-pill);
  background: var(--shell); border: 1px solid var(--shell-line);
  outline: none;
}
.slider-block input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold-bright);
  border: 1px solid var(--gold-deep);
  box-shadow: var(--gold-glow);
  cursor: pointer;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.mood-chip {
  padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--shell-line); background: transparent;
  color: var(--on-shell-muted); font-size: 13px; cursor: pointer;
}
.mood-chip.active {
  border-color: var(--gold-line); color: var(--gold-bright); background: var(--gold-soft);
}
.mini-chart {
  margin-top: 16px; padding: 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--shell-line);
  background: var(--shell);
}
.mini-chart h3 {
  margin: 0 0 10px; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold);
}

/* Form compare */
.compare-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.form-shot {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-line);
  background:
    linear-gradient(160deg, rgba(196,168,120,0.1), transparent 50%),
    repeating-linear-gradient(0deg, transparent, transparent 11px, rgba(42,47,56,0.5) 11px, rgba(42,47,56,0.5) 12px),
    var(--shell-mid);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.form-shot .placeholder-figure {
  width: 42%; height: 70%;
  border: 1.5px dashed rgba(232,212,170,0.45);
  border-radius: 40% 40% 30% 30%;
  position: relative;
}
.form-shot .rom-badge {
  position: absolute;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--gold-line);
  background: rgba(12,14,18,0.85);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}
.form-shot .rom-badge.b1 { top: 18%; right: 8%; }
.form-shot .rom-badge.b2 { bottom: 22%; left: 8%; }
.form-shot .week-label {
  position: absolute; top: 10px; left: 10px;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); background: rgba(12,14,18,0.7);
  padding: 3px 8px; border-radius: var(--radius-pill);
  border: 1px solid var(--gold-line);
}
.compare-caption {
  margin-top: 12px; font-size: 13px; color: var(--on-shell-muted); line-height: 1.6;
  text-align: center;
}

/* Ask suggestions */
.ask-list { list-style: none; margin: 0; padding: 0; }
.ask-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--shell-line);
}
.ask-item:last-child { border-bottom: none; }
.ask-num {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--gold-line); background: var(--gold-soft);
  display: grid; place-items: center;
  font-size: 11px; color: var(--gold-bright); flex-shrink: 0;
}
.ask-item p { margin: 0; font-size: 14px; line-height: 1.55; }
.ask-item .ask-why {
  display: block; margin-top: 4px; font-size: 11px; color: var(--on-shell-muted);
}

/* Roadmap */
.roadmap {
  display: flex; align-items: stretch; gap: 0;
  margin: 8px 0 4px; position: relative;
}
.roadmap::before {
  content: "";
  position: absolute; top: 18px; left: 12%; right: 12%;
  height: 2px; background: var(--shell-line); z-index: 0;
}
.road-stage {
  flex: 1; text-align: center; position: relative; z-index: 1;
  padding: 0 4px;
}
.road-dot {
  width: 16px; height: 16px; border-radius: 50%;
  margin: 10px auto 10px;
  border: 2px solid var(--shell-line);
  background: var(--shell-elev);
}
.road-stage.done .road-dot {
  border-color: var(--gold-line);
  background: var(--gold-bright);
  box-shadow: var(--gold-glow);
}
.road-stage.current .road-dot {
  border-color: var(--gold-bright);
  background: var(--shell-elev);
  box-shadow: 0 0 0 4px rgba(196,168,120,0.25);
}
.road-stage .road-title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--on-shell-muted); margin: 0 0 4px;
}
.road-stage.done .road-title,
.road-stage.current .road-title { color: var(--gold-bright); }
.road-stage .road-sub {
  font-size: 11px; color: var(--on-shell-muted); margin: 0; line-height: 1.4;
}
.road-pin {
  display: inline-block; margin-top: 8px;
  font-size: 10px; letter-spacing: 0.1em;
  color: var(--gold-bright); border: 1px solid var(--gold-line);
  padding: 2px 8px; border-radius: var(--radius-pill); background: var(--gold-soft);
}

/* Celebration */
.celebrate-banner {
  display: none;
  align-items: center; gap: 14px;
  padding: 14px 16px; margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--gold-line);
  background:
    linear-gradient(120deg, rgba(196,168,120,0.18), transparent 55%),
    var(--shell-elev);
  box-shadow: var(--gold-glow);
  animation: fadeIn 0.45s ease;
}
.celebrate-banner.show { display: flex; }
.celebrate-banner .spark {
  font-size: 22px; line-height: 1;
}
.celebrate-banner h3 {
  margin: 0 0 2px; font-size: 14px; letter-spacing: 0.06em; color: var(--gold-bright);
}
.celebrate-banner p {
  margin: 0; font-size: 12px; color: var(--on-shell-muted);
}

.streak-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--gold-bright);
  border: 1px solid var(--gold-line); background: var(--gold-soft);
  padding: 4px 10px; border-radius: var(--radius-pill);
  letter-spacing: 0.06em;
}

.innov-kicker {
  display: inline-block;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 4px;
}

/* ========== Mock v3 additions ========== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* bench-metrics-v0.1 · 3 equal KPIs (成功率／回覆率／診症時數); 反饋 removed */
.score-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  align-items: stretch;
  width: 100%;
  max-width: 480px;
}
.score-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f4f1ea;
  border: 1px solid #2a2f38;
  background: #14171e;
  padding: 8px 10px;
  border-radius: 10px;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.score-chip > span {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.score-chip em {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--on-shell-muted);
  text-transform: none;
  line-height: 1.25;
  white-space: normal;
  max-width: 100%;
}
@media (max-width: 520px) {
  .score-chips {
    max-width: none;
    gap: 6px;
  }
  .score-chip {
    padding: 7px 8px;
    font-size: 11px;
  }
  .score-chip em {
    font-size: 9px;
  }
}

.collab-status {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 8px 12px;
  border: 1px solid var(--gold-line); border-radius: var(--radius-sm);
  background: var(--gold-soft);
}
.collab-text { font-size: 12px; color: var(--on-shell-muted); }

.handoff-transfer {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 8px; align-items: center;
}
.xfer-select, select, textarea, input[type="text"], input[type="email"], input[type="password"] {
  background: var(--shell-mid);
  border: 1px solid var(--shell-line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--on-shell);
}
.xfer-select { flex: 1; min-width: 140px; font-size: 12px; }
.xfer-status {
  margin: 8px 0 0; font-size: 12px; color: var(--gold-bright);
}

.assign-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.assign-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--shell-line);
  border-radius: var(--radius-sm); background: var(--shell-elev);
  font-size: 13px; cursor: pointer;
}
.assign-item input { margin-top: 3px; accent-color: var(--gold); }

.quota-readonly {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 640px) {
  .quota-readonly { grid-template-columns: 1fr; }
}
.quota-card {
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--shell-line); background: var(--shell-elev);
}

.login-wall {
  margin-top: 14px; padding: 12px 14px;
  font-size: 12px; line-height: 1.55; color: var(--on-shell-muted);
  border: 1px dashed var(--gold-line); border-radius: var(--radius-sm);
  background: rgba(196,168,120,0.06);
}

.revisit-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin: 12px 0 4px;
  border-radius: var(--radius);
  border: 1px solid var(--gold-line);
  background: linear-gradient(120deg, rgba(196,168,120,0.14), transparent 60%), var(--shell-elev);
}
.revisit-banner h3 {
  margin: 0 0 2px; font-size: 13px; letter-spacing: 0.04em; color: var(--gold-bright);
}
.revisit-banner p { margin: 0; font-size: 12px; color: var(--on-shell-muted); }
.revisit-banner .spark { font-size: 18px; }
.revisit-banner .btn { margin-left: auto; }

.goal-card {
  padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line); background: var(--shell-elev);
}
.goal-line { margin: 0; font-size: 14px; line-height: 1.55; }
.goal-line strong { color: var(--gold-bright); }

.watermarked { position: relative; }
.watermark-banner {
  display: block; text-align: center;
  font-size: 10px; letter-spacing: 0.06em; line-height: 1.45;
  color: var(--gold); background: var(--gold-soft);
  border-bottom: 1px solid var(--gold-line);
  padding: 8px 12px;
}
.clinic-id-line {
  margin: 12px 0 0; font-size: 11px; color: var(--on-shell-muted);
  letter-spacing: 0.04em; text-align: center;
}
.terms-snip { font-size: 11px; color: var(--on-shell-muted); }

.hw-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--shell-line);
}
.hw-item:last-of-type { border-bottom: none; }
.hw-check {
  display: flex; align-items: flex-start; gap: 10px; flex: 1; cursor: pointer;
  font-size: 13px;
}
.hw-check input { margin-top: 3px; accent-color: var(--gold); }
.hw-check strong { display: block; color: var(--on-shell); }
.hw-meta { display: block; font-size: 12px; color: var(--on-shell-muted); margin-top: 2px; }

.sat-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sat-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--shell-line); background: var(--shell-elev);
  cursor: pointer; color: var(--on-shell-muted);
}
.sat-btn.active {
  border-color: var(--gold-line); background: var(--gold-soft);
  color: var(--gold-bright); box-shadow: var(--gold-glow);
}

.quota-bar {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  align-items: flex-end; margin-bottom: 14px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--gold-line); background: var(--gold-soft);
}
.quota-tip {
  margin: 0; max-width: 240px; font-size: 12px; line-height: 1.5;
  color: var(--gold-bright); text-align: right;
}

.mode-switch { display: flex; gap: 6px; margin-bottom: 12px; }
.mode-btn {
  flex: 1; padding: 8px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--shell-line); background: var(--shell-elev);
  cursor: pointer; font-size: 13px; color: var(--on-shell-muted);
}
.mode-btn.active {
  border-color: var(--gold-line); color: var(--gold-bright);
  background: var(--gold-soft);
}

.attach-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 10px 0;
}
.attach-preview { font-size: 12px; color: var(--gold); }

.video-mock {
  position: relative; aspect-ratio: 16/10;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--shell-line);
  background:
    radial-gradient(circle at 30% 40%, rgba(196,168,120,0.15), transparent 50%),
    var(--shell-mid);
  margin-bottom: 12px;
}
.video-frame {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  gap: 6px; color: var(--on-shell-muted);
}
.video-frame span { font-size: 14px; color: var(--gold-bright); letter-spacing: 0.08em; }
.video-frame small { font-size: 11px; max-width: 220px; }
.video-self {
  position: absolute; right: 12px; bottom: 12px;
  width: 72px; height: 54px; border-radius: 8px;
  border: 1px solid var(--gold-line); background: var(--shell-elev);
  display: grid; place-items: center; font-size: 11px; color: var(--gold);
}
.video-controls { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-quota-list { display: flex; flex-direction: column; gap: 10px; }
.admin-quota-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--shell-line);
  border-radius: var(--radius-sm); background: var(--shell-elev);
}
.admin-stepper { display: flex; gap: 6px; }

.entrance-card-admin { grid-column: 1 / -1; max-width: 420px; margin: 0 auto; }
.field { margin-bottom: 12px; }
.field label {
  display: block; font-size: 11px; letter-spacing: 0.1em;
  color: var(--on-shell-muted); margin-bottom: 6px; text-transform: uppercase;
}
.field select, .field textarea, .field input {
  width: 100%;
}
.hep-card .btn-video-note { flex-shrink: 0; font-size: 11px; padding: 4px 8px; }

.feedback-row .row-meta { white-space: normal; }

.remote-thread { max-height: 260px; }


/* ========== Mock v4 · Guest-first landing + tap UX ========== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.guest-hero h1 {
  letter-spacing: 0.12em;
  font-weight: 500;
}

/* login-privacy-host-v0.2 · staff desk chrome on staff host */
.staff-entry {
  width: 100%;
}
.staff-entry[hidden] {
  display: none !important;
}
#guest-landing-chrome[hidden] {
  display: none !important;
}
body.staff-host .staff-hero h1 {
  letter-spacing: 0.08em;
  font-weight: 500;
}


/* entrance-cards-v0.1 · equal-size guest / book CTAs */
.guest-primary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 420px;
  width: 100%;
  margin: 0 auto 28px;
  align-items: stretch;
  box-sizing: border-box;
}
@media (min-width: 720px) {
  .guest-primary,
  .guest-primary--grid {
    grid-template-columns: 1fr 1fr;
    max-width: min(920px, 92%);
    gap: 16px;
  }
}

.guest-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  min-height: 7.25rem;
  box-sizing: border-box;
  text-align: left;
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--gold-line);
  background:
    linear-gradient(145deg, rgba(232, 212, 170, 0.14), transparent 55%),
    linear-gradient(165deg, var(--shell-elev), var(--shell-mid));
  box-shadow: var(--gold-glow), var(--shadow);
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s;
}
.guest-cta[hidden] {
  display: none !important;
}
.guest-cta:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 212, 170, 0.7);
}
.guest-cta-soft {
  background: linear-gradient(165deg, var(--shell-elev), var(--shell-mid));
  box-shadow: var(--shadow);
  border-color: var(--shell-line);
}
.guest-cta-kicker {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.guest-cta-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--on-shell);
}
.guest-cta-sub {
  font-size: 12px;
  color: var(--on-shell-muted);
}

.guest-glance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}
@media (min-width: 520px) {
  .guest-glance { grid-template-columns: repeat(4, 1fr); max-width: 720px; }
}
.glance-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: rgba(20, 23, 30, 0.85);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s, background 0.18s;
}
.glance-card:hover {
  border-color: var(--gold-line);
  background: var(--shell-elev);
}
.glance-emoji { font-size: 1.2rem; line-height: 1; }
.glance-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--on-shell);
}
.glance-sub {
  font-size: 11px;
  color: var(--on-shell-muted);
  line-height: 1.4;
}

.landing-note.quiet {
  margin-top: 32px;
  border-style: solid;
  border-color: transparent;
  background: transparent;
  color: var(--on-shell-muted);
  opacity: 0.85;
}

/* Secret staff passage — corner, easy to miss */
.secret-wrap {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.secret-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(42, 47, 56, 0.9);
  background: rgba(12, 14, 18, 0.55);
  padding: 0;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.2s, border-color 0.2s;
}
.secret-dot:hover,
.secret-dot[aria-expanded="true"] {
  opacity: 0.85;
  border-color: var(--gold-line);
}
.secret-dot-mark {
  display: block;
  width: 4px;
  height: 4px;
  margin: 0 auto;
  border-radius: 50%;
  background: rgba(168, 176, 188, 0.55);
}
.secret-sheet {
  min-width: 160px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: rgba(12, 14, 18, 0.96);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}
.secret-sheet[hidden] { display: none !important; }
.secret-label {
  margin: 0 0 8px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--on-shell-muted);
  text-align: right;
}
.secret-link {
  display: block;
  width: 100%;
  text-align: right;
  border: none;
  background: transparent;
  color: var(--on-shell-muted);
  font-size: 12px;
  padding: 8px 6px;
  cursor: pointer;
  border-radius: 6px;
}
.secret-link:hover {
  color: var(--gold-bright);
  background: var(--gold-soft);
}

/* Tap hub on client home */
.tap-hub {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 16px;
}
@media (min-width: 640px) {
  .tap-hub { grid-template-columns: repeat(6, 1fr); }
}
.tap-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 12px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--shell-line);
  background: var(--shell-elev);
  cursor: pointer;
  transition: border-color 0.18s, transform 0.15s, background 0.18s;
}
.tap-card:hover {
  border-color: var(--gold-line);
  transform: translateY(-1px);
}
.tap-card-accent {
  border-color: var(--gold-line);
  background: linear-gradient(160deg, rgba(232, 212, 170, 0.12), var(--shell-elev));
}
.tap-emoji { font-size: 1.2rem; line-height: 1; }
.tap-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--on-shell);
  text-align: center;
}

.client-tabs-compact {
  margin-bottom: 12px;
  opacity: 0.92;
}
.client-tabs-compact .client-tab {
  font-size: 11px;
  padding: 6px 10px;
}

.btn-tap-lg {
  min-height: 48px;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.login-human .login-hello {
  margin: 4px 0 4px;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.login-more {
  margin-top: 14px;
  color: var(--on-shell-muted);
  font-size: 12px;
}
.login-more summary {
  cursor: pointer;
  letter-spacing: 0.06em;
  color: var(--gold);
  list-style: none;
}
.login-more summary::-webkit-details-marker { display: none; }

.chip-prompt {
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-shell);
  letter-spacing: 0.02em;
}
.chip-prompt:first-child { margin-top: 0; }

.feel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feel-chip {
  flex: 1 1 auto;
  min-width: 64px;
  padding: 12px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--shell-line);
  background: var(--shell-mid);
  color: var(--on-shell);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.feel-chip:hover {
  border-color: var(--gold-line);
}
.feel-chip.active {
  border-color: var(--gold-bright);
  background: var(--gold-soft);
  color: var(--gold-bright);
  box-shadow: var(--gold-glow);
}

.converse-form .converse-step {
  margin-bottom: 6px;
}
.sat-row .sat-btn {
  font-size: 1.35rem;
  min-width: 48px;
  min-height: 48px;
  line-height: 1;
}

/* ========== Mock v5 · Cinematic ENTER (tunnel / depth zoom) ========== */
.intro-enter {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: #050608;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.55s ease, visibility 0.55s;
}
.intro-enter[hidden] { display: none; }
.intro-enter.is-exiting {
  pointer-events: none;
}
.intro-enter.is-exiting .intro-tunnel {
  animation: introTunnelExit 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.intro-enter.is-exiting .intro-fore {
  animation: introForeExit 0.55s ease forwards;
}
.intro-enter.is-exiting .intro-door-l {
  animation: introDoorL 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.intro-enter.is-exiting .intro-door-r {
  animation: introDoorR 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.intro-enter.is-gone {
  opacity: 0;
  visibility: hidden;
}


/* Trace v17.3 · true-3D intro canvas (replaces flat PNG flyby stage) */
.intro-3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}
.intro-enter.is-flyby .intro-3d-canvas {
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 8;
  animation: none; /* oneshot3: no fade-in cut */
}
.intro-enter.is-flyby .intro-flyby {
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 6;
}
.intro-enter.is-flyby .flyby-haze,
.intro-enter.is-flyby .flyby-horizon,
.intro-enter.is-flyby .flyby-ground {
  opacity: 0 !important;
  animation: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: 0 !important;
}
.intro-enter.is-flyby .flyby-fitworld {
  z-index: 2; /* under canvas */
}
.intro-enter.is-flyby .intro-3d-canvas {
  z-index: 12 !important;
}
/* Trace v17.9 · canvas above all flyby overlays */
.intro-enter.is-flyby #intro-3d,
.intro-enter.is-flyby canvas.intro-3d-canvas {
  position: absolute;
  inset: 0;
  z-index: 20 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
  background: #050608;
}
.intro-flyby { z-index: 4; }
.intro-enter.is-flyby .intro-flyby { z-index: 6; }

@keyframes intro3dFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.flyby-stage-legacy,
.intro-enter.is-flyby .flyby-stage-legacy,
.intro-enter.is-flyby .flyby-runner {
  display: none !important;
  visibility: hidden !important;
}

/* Phase 2 · Mock v11 photoreal flyby: PUSH INTO vanishing point; figures approach camera on centre path, ghost-dissolve */
.intro-enter.is-flyby .intro-door-l,
.intro-enter.is-flyby .intro-door-r,
.intro-enter.is-flyby .intro-door,
.intro-enter.is-flyby .intro-fore,
.intro-enter.is-flyby .intro-mark,
.intro-enter.is-flyby .intro-void {
  /* oneshot3: hide CSS door — 3D doorway only */
  animation: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.intro-enter.is-flyby .intro-tunnel {
  /* oneshot3: CSS tunnel killed — 3D continuous cam owns entry */
  animation: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.intro-enter.is-flyby .intro-void {
  animation: none;
  opacity: 0.5;
}
.intro-enter.is-flyby .intro-door {
  z-index: 6;
}
.intro-enter.is-flyby .intro-fore {
  animation: introForeToFlyby 0.55s ease forwards;
}
.intro-enter.is-flyby .intro-mark {
  animation: introMarkFade 0.4s ease forwards;
}
.intro-enter.is-flyby .intro-flyby {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}
.intro-enter.is-flyby .flyby-stage {
  /* camera PUSHES INTO depth (translateZ / scale toward vanishing point) */
  animation: flybyDepthPush 9s cubic-bezier(0.2, 0.65, 0.25, 1) forwards;
}
.intro-enter.is-flyby .flyby-f1 {
  animation: approachF1 9s cubic-bezier(0.22, 0.7, 0.28, 1) forwards;
}
.intro-enter.is-flyby .flyby-f2 {
  animation: approachF2 9s cubic-bezier(0.22, 0.7, 0.28, 1) forwards;
}
.intro-enter.is-flyby .flyby-f3 {
  animation: approachF3 9s cubic-bezier(0.22, 0.7, 0.28, 1) forwards;
}
.intro-enter.is-flyby .flyby-f4 {
  animation: approachF4 9s cubic-bezier(0.22, 0.7, 0.28, 1) forwards;
}
.intro-enter.is-flyby .flyby-f1 .flyby-label {
  animation: flybyLabelPulse 9s linear forwards;
}
.intro-enter.is-flyby .flyby-f2 .flyby-label {
  animation: flybyLabelPulse2 9s linear forwards;
}
.intro-enter.is-flyby .flyby-f3 .flyby-label {
  animation: flybyLabelPulseMid 9s linear forwards;
}
.intro-enter.is-flyby .flyby-f4 .flyby-label {
  animation: flybyLabelPulseSport 9s linear forwards;
}
.intro-enter.is-flyby .flyby-haze {
  animation: none !important;
  opacity: 0 !important;
}
.intro-enter.is-flyby .flyby-fitworld {
  opacity: 1;
  visibility: visible;
}
.intro-enter.is-flyby.is-fitworld .flyby-fitworld-bloom,
.intro-enter.is-flyby .flyby-fitworld-bloom {
  animation: fitworldBloom 9s cubic-bezier(0.2, 0.7, 0.25, 1) forwards;
}
.intro-enter.is-flyby .flyby-fitworld-ring.r1 {
  animation: fitworldRing 4s ease forwards;
}
.intro-enter.is-flyby .flyby-fitworld-ring.r2 {
  animation: fitworldRing 4s ease forwards;
  animation-delay: 0.12s;
}
.intro-enter.is-flyby .flyby-fitworld-ring.r3 {
  animation: fitworldRing 4s ease forwards;
  animation-delay: 0.24s;
}
.intro-enter.is-flyby .flyby-fitworld-ground {
  animation: fitworldGround 4s ease forwards;
}
.intro-enter.is-flyby .flyby-fitworld-label {
  animation: fitworldLabel 4s ease forwards;
}
.intro-enter.is-fitworld .flyby-fitworld-bloom {
  filter: blur(0);
}

.intro-stage {
  position: absolute;
  inset: 0;
  perspective: 900px;
  transform-style: preserve-3d;
}

.intro-void {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 45% 40% at 50% 50%, rgba(196, 168, 120, 0.14), transparent 55%),
    radial-gradient(ellipse 80% 70% at 50% 55%, #0c0e12 0%, #050608 70%);
  animation: introVoidPulse 5s ease-in-out infinite;
}

.intro-tunnel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(120vw, 900px);
  height: min(120vw, 900px);
  transform: translate(-50%, -50%) translateZ(0);
  animation: introTunnelIn 2.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.intro-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(18% + var(--i) * 12%);
  height: calc(18% + var(--i) * 12%);
  margin: 0;
  border: 1px solid rgba(232, 212, 170, calc(0.55 - var(--i) * 0.06));
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.15);
  box-shadow:
    0 0 0 1px rgba(196, 168, 120, 0.08),
    inset 0 0 24px rgba(196, 168, 120, calc(0.08 + var(--i) * 0.01));
  animation: introRingRush 5.2s cubic-bezier(0.15, 0.7, 0.25, 1) forwards;
  animation-delay: calc(var(--i) * 0.09s);
}

.intro-vanishing {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #e8d4aa 0%, rgba(196, 168, 120, 0.4) 40%, transparent 70%);
  box-shadow: 0 0 40px 12px rgba(232, 212, 170, 0.35);
  animation: introVanishGrow 5.2s ease forwards;
}

.intro-beam {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 55%;
  transform: translate(-50%, -100%) rotate(0deg);
  background: linear-gradient(180deg, transparent, rgba(232, 212, 170, 0.35), transparent);
  opacity: 0;
  animation: introBeam 5s ease forwards;
  animation-delay: 0.4s;
}
.intro-beam-2 {
  transform: translate(-50%, 0%) rotate(0deg);
  height: 50%;
  animation-delay: 0.55s;
}

.intro-motion {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  height: 42%;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: introMotionIn 4.8s ease forwards;
}

.intro-arc {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: introArcDraw 3.2s ease forwards;
  animation-delay: 0.9s;
}
.intro-arc.a2 { animation-delay: 1.15s; }
.intro-dot {
  opacity: 0;
  animation: introDotIn 2s ease forwards;
  animation-delay: 1.6s;
}

.intro-door {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.intro-door-l,
.intro-door-r {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.2%;
  background:
    linear-gradient(90deg, rgba(8, 10, 13, 0.97), rgba(12, 14, 18, 0.88));
  border: none;
}
.intro-door-l {
  left: 0;
  border-right: 1px solid rgba(196, 168, 120, 0.22);
  transform-origin: left center;
  animation: introDoorIdleL 2.8s ease forwards;
}
.intro-door-r {
  right: 0;
  border-left: 1px solid rgba(196, 168, 120, 0.22);
  transform-origin: right center;
  animation: introDoorIdleR 2.8s ease forwards;
}

.intro-fore {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 24px;
  animation: introForeIn 2.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.intro-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 0;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  box-shadow: none;
}
.intro-mark img,
.intro-logo { width: 48px; height: 48px; object-fit: contain; display: block; }

.intro-name {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--gold-bright);
  text-indent: 0.28em;
}
.intro-trace {
  margin: 10px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.55em;
  color: var(--gold);
  text-indent: 0.55em;
  font-weight: 400;
}
.intro-tag {
  margin: 22px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  color: var(--on-shell-muted);
  text-indent: 0.42em;
  text-transform: uppercase;
}

.intro-skip {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 10;
  border: 1px solid rgba(196, 168, 120, 0.35);
  background: rgba(12, 14, 18, 0.55);
  color: var(--gold-bright);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  letter-spacing: 0.12em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.15s, background 0.15s;
}
.intro-skip:hover {
  border-color: var(--gold-bright);
  background: rgba(196, 168, 120, 0.12);
}


.intro-bar {
  position: absolute;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(200px, 50vw);
  height: 2px;
  border-radius: 2px;
  background: rgba(196, 168, 120, 0.15);
  overflow: hidden;
  z-index: 10;
}
.intro-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  /* intro-run-depth-5s-v0.2 · INTRO_MS = 5000ms */
  animation: introBar 5s linear forwards;
}

body.intro-playing .site-header {
  opacity: 0;
  pointer-events: none;
}
body.intro-playing .app-shell {
  filter: brightness(0.35);
  transition: filter 0.4s ease;
}
body:not(.intro-playing) .app-shell {
  filter: none;
  transition: filter 0.6s ease;
}

.intro-flyby {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  perspective: 1100px;
  transform-style: preserve-3d;
}
.flyby-haze {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 40% at 50% 48%, rgba(196, 168, 120, 0.18), transparent 58%),
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(12, 14, 18, 0.95), transparent 55%),
    linear-gradient(180deg, #050608 0%, #0a0c10 45%, #0c0e12 100%);
  opacity: 0 !important;
  pointer-events: none;
}
.flyby-horizon {
  /* vanishing point — eye-level corridor into depth */
  position: absolute;
  left: 50%;
  top: 48%;
  width: 140%;
  height: 140%;
  margin-left: -70%;
  margin-top: -42%;
  background:
    radial-gradient(ellipse 14% 10% at 50% 48%, rgba(232, 212, 170, 0.28), transparent 55%),
    linear-gradient(90deg, transparent 47%, rgba(232, 212, 170, 0.07) 50%, transparent 53%);
  opacity: 0.7;
  pointer-events: none;
}
.flyby-ground {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -5%;
  height: 55%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(8, 10, 13, 0.25) 35%, rgba(5, 6, 8, 0.92) 100%);
  transform: perspective(700px) rotateX(58deg);
  transform-origin: center top;
  opacity: 0.55;
}
.flyby-fitworld {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.flyby-fitworld-bloom {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 246, 228, 0.95) 0%, rgba(232, 212, 170, 0.55) 28%, rgba(196, 168, 120, 0.18) 55%, transparent 72%);
  box-shadow: 0 0 60px 20px rgba(232, 212, 170, 0.25);
  transform: scale(0.2);
  opacity: 0;
  filter: blur(0.5px);
}
.flyby-fitworld-ring {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 1px solid rgba(232, 212, 170, 0.35);
  opacity: 0;
  transform: scale(0.3);
}
.flyby-fitworld-ring.r2 { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: rgba(196, 168, 120, 0.28); }
.flyby-fitworld-ring.r3 { width: 96px; height: 96px; margin: -48px 0 0 -48px; border-color: rgba(196, 168, 120, 0.18); }
.flyby-fitworld-ground {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 70%;
  height: 28%;
  margin-left: -35%;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(232, 212, 170, 0.22), transparent 70%);
  opacity: 0;
  transform: scaleX(0.4);
}
.flyby-fitworld-label {
  position: relative;
  z-index: 2;
  margin-top: 18vh;
  font-size: 0.7rem;
  letter-spacing: 0.42em;
  color: var(--gold-bright);
  text-indent: 0.42em;
  opacity: 0;
  text-shadow: 0 0 18px rgba(196, 168, 120, 0.45);
}

.flyby-stage {
  position: absolute;
  inset: 0;
  transform-origin: 50% 48%;
  perspective: 1100px;
  transform-style: preserve-3d;
  will-change: transform;
}
.flyby-runner {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(42vw, 220px);
  height: min(68vw, 360px);
  margin-left: calc(min(42vw, 220px) / -2);
  margin-top: calc(min(68vw, 360px) / -2);
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
  opacity: 0;
  /* keep near centre path — --ox is a small lateral offset only */
  --ox: 0vw;
}
.flyby-runner .flyby-fig {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter:
    drop-shadow(0 18px 36px rgba(0, 0, 0, 0.65))
    drop-shadow(0 0 28px rgba(196, 168, 120, 0.22));
  /* photoreal cutouts on charcoal — normal blend keeps detail */
  opacity: 0.97;
}
.flyby-runner .flyby-label {
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  color: var(--gold-bright);
  text-indent: 0.32em;
  opacity: 0;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(196, 168, 120, 0.35);
  pointer-events: none;
}

@keyframes introForeToFlyby {
  to { opacity: 0; transform: scale(1.12) translateY(-8px); filter: blur(6px); }
}
@keyframes introMarkFade {
  to { opacity: 0; transform: scale(0.85); filter: blur(4px); }
}
@keyframes flybyHazeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Tunnel rings rush AT / PAST the viewer (depth entry) */
@keyframes flybyTunnelRush {
  0% { transform: translate(-50%, -50%) scale(1.15) translateZ(0); opacity: 0.85; }
  55% { transform: translate(-50%, -50%) scale(2.1) translateZ(120px); opacity: 0.55; }
  100% { transform: translate(-50%, -50%) scale(3.4) translateZ(280px); opacity: 0.12; }
}
/* Camera advances INTO the vanishing point */
@keyframes flybyDepthPush {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  35% { transform: translate3d(0, 0.4%, 80px) scale(1.06); }
  70% { transform: translate3d(0, -0.2%, 200px) scale(1.16); }
  100% { transform: translate3d(0, -0.6%, 360px) scale(1.32); }
}
/* Continuous Z approach (near-centre) + ghost dissolve — 4 staggered windows inside one 4s pass */
@keyframes approachF1 {
  0% { transform: translate3d(var(--ox), 3%, -560px) scale(0.16); opacity: 0; filter: blur(2.5px) brightness(0.55); }
  4% { opacity: 0.95; filter: blur(0.8px) brightness(0.9); }
  18% { transform: translate3d(calc(var(--ox) * 0.5), 0.4%, -80px) scale(0.85); opacity: 1; filter: blur(0) brightness(1); }
  26% { transform: translate3d(calc(var(--ox) * 0.2), -0.4%, 50px) scale(1.22); opacity: 0.75; filter: blur(1.5px) brightness(0.7); }
  34% { transform: translate3d(0, -1%, 120px) scale(1.48); opacity: 0.2; filter: blur(5px) brightness(0.25); }
  40%, 100% { transform: translate3d(0, -1.2%, 170px) scale(1.62); opacity: 0; filter: blur(10px) brightness(0.08); }
}
@keyframes approachF2 {
  0%, 12% { transform: translate3d(var(--ox), 3%, -560px) scale(0.16); opacity: 0; filter: blur(2.5px) brightness(0.55); }
  16% { opacity: 0.95; filter: blur(0.8px) brightness(0.9); }
  30% { transform: translate3d(calc(var(--ox) * 0.5), 0.4%, -80px) scale(0.85); opacity: 1; filter: blur(0) brightness(1); }
  38% { transform: translate3d(calc(var(--ox) * 0.2), -0.4%, 50px) scale(1.22); opacity: 0.75; filter: blur(1.5px) brightness(0.7); }
  46% { transform: translate3d(0, -1%, 120px) scale(1.48); opacity: 0.2; filter: blur(5px) brightness(0.25); }
  52%, 100% { transform: translate3d(0, -1.2%, 170px) scale(1.62); opacity: 0; filter: blur(10px) brightness(0.08); }
}
@keyframes approachF3 {
  0%, 28% { transform: translate3d(var(--ox), 3%, -560px) scale(0.16); opacity: 0; filter: blur(2.5px) brightness(0.55); }
  32% { opacity: 0.95; filter: blur(0.8px) brightness(0.9); }
  46% { transform: translate3d(calc(var(--ox) * 0.5), 0.4%, -80px) scale(0.85); opacity: 1; filter: blur(0) brightness(1); }
  54% { transform: translate3d(calc(var(--ox) * 0.2), -0.4%, 50px) scale(1.22); opacity: 0.75; filter: blur(1.5px) brightness(0.7); }
  62% { transform: translate3d(0, -1%, 120px) scale(1.48); opacity: 0.2; filter: blur(5px) brightness(0.25); }
  68%, 100% { transform: translate3d(0, -1.2%, 170px) scale(1.62); opacity: 0; filter: blur(10px) brightness(0.08); }
}
@keyframes approachF4 {
  0%, 44% { transform: translate3d(var(--ox), 3%, -560px) scale(0.16); opacity: 0; filter: blur(2.5px) brightness(0.55); }
  48% { opacity: 0.95; filter: blur(0.8px) brightness(0.9); }
  62% { transform: translate3d(calc(var(--ox) * 0.5), 0.4%, -80px) scale(0.85); opacity: 1; filter: blur(0) brightness(1); }
  72% { transform: translate3d(calc(var(--ox) * 0.2), -0.4%, 50px) scale(1.22); opacity: 0.75; filter: blur(1.5px) brightness(0.7); }
  82% { transform: translate3d(0, -1%, 120px) scale(1.48); opacity: 0.25; filter: blur(5px) brightness(0.28); }
  90%, 100% { transform: translate3d(0, -1.2%, 170px) scale(1.62); opacity: 0; filter: blur(10px) brightness(0.08); }
}
@keyframes flybyLabelPulse {
  0%, 4% { opacity: 0; }
  10% { opacity: 0.85; }
  24% { opacity: 0.6; }
  34%, 100% { opacity: 0; }
}
@keyframes flybyLabelPulse2 {
  0%, 14% { opacity: 0; }
  20% { opacity: 0.85; }
  36% { opacity: 0.55; }
  46%, 100% { opacity: 0; }
}
@keyframes flybyLabelPulseMid {
  0%, 30% { opacity: 0; }
  36% { opacity: 0.85; }
  52% { opacity: 0.55; }
  62%, 100% { opacity: 0; }
}
@keyframes flybyLabelPulseSport {
  0%, 48% { opacity: 0; }
  54% { opacity: 0.9; }
  72% { opacity: 0.55; }
  84%, 100% { opacity: 0; }
}
/* Fit world expands as camera arrives at vanishing point */
@keyframes fitworldBloom {
  0%, 55% { transform: scale(0.25); opacity: 0; }
  68% { transform: scale(1.2); opacity: 0.55; }
  82% { transform: scale(4.5); opacity: 0.85; }
  100% { transform: scale(12); opacity: 0.95; }
}
@keyframes fitworldRing {
  0%, 58% { transform: scale(0.4); opacity: 0; }
  70% { opacity: 0.55; }
  100% { transform: scale(8); opacity: 0; }
}
@keyframes fitworldGround {
  0%, 60% { opacity: 0; transform: scaleX(0.35); }
  100% { opacity: 0.75; transform: scaleX(1.1); }
}
@keyframes fitworldLabel {
  0%, 72% { opacity: 0; transform: translateY(8px); }
  82% { opacity: 0.9; transform: translateY(0); }
  100% { opacity: 0.75; transform: translateY(0); }
}

@keyframes introVoidPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.92; }
}
@keyframes introTunnelIn {
  0% { transform: translate(-50%, -50%) scale(0.55); opacity: 0.6; }
  70% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.35); opacity: 1; }
}
@keyframes introTunnelExit {
  to { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}
@keyframes introRingRush {
  0% { transform: translate(-50%, -50%) scale(0.12); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: calc(0.15 + var(--i) * 0.05); }
}
@keyframes introVanishGrow {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(3.2); opacity: 0.85; }
}
@keyframes introBeam {
  0% { opacity: 0; }
  25% { opacity: 0.7; }
  100% { opacity: 0.25; }
}
@keyframes introMotionIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  40% { opacity: 0.9; }
  100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1.05); }
}
@keyframes introArcDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes introDotIn {
  to { opacity: 1; }
}
@keyframes introDoorIdleL {
  /* v19.5.2: part early — first beat after 進入 is THROUGH doorway */
  0% { transform: translateX(0); }
  25% { transform: translateX(-18%); }
  100% { transform: translateX(-42%); }
}
@keyframes introDoorIdleR {
  0% { transform: translateX(0); }
  25% { transform: translateX(18%); }
  100% { transform: translateX(42%); }
}
@keyframes introDoorL {
  to { transform: translateX(-105%); }
}
@keyframes introDoorR {
  to { transform: translateX(105%); }
}
@keyframes introForeIn {
  0% { opacity: 0; transform: scale(0.72) translateY(12px); filter: blur(6px); }
  35% { opacity: 0; transform: scale(0.85) translateY(8px); filter: blur(4px); }
  55% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
  85% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1.08); }
}
@keyframes introForeExit {
  to { opacity: 0; transform: scale(1.35); filter: blur(8px); }
}

/* v18.9.1 · P0.1 end cue — big Cantonese during last ~1.5s (is-fitworld) */
.intro-enter-cue {
  position: absolute;
  left: 50%;
  bottom: max(52px, calc(env(safe-area-inset-bottom) + 36px));
  transform: translateX(-50%) translateY(6px);
  z-index: 11;
  margin: 0;
  padding: 0;
  font-size: clamp(1.4rem, 5vw, 2.15rem);
  font-weight: 650;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: var(--gold-bright);
  text-shadow: 0 0 28px rgba(196, 168, 120, 0.55), 0 2px 12px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.intro-enter.is-fitworld .intro-enter-cue {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes introBar {
  from { width: 0%; }
  to { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .intro-tunnel,
  .intro-ring,
  .intro-vanishing,
  .intro-beam,
  .intro-motion,
  .intro-arc,
  .intro-door-l,
  .intro-door-r,
  .intro-fore,
  .intro-bar-fill,
  .flyby-stage,
  .flyby-runner,
  .flyby-fig,
  .flyby-label,
  .flyby-haze,
  .flyby-fitworld-bloom,
  .flyby-fitworld-ring,
  .flyby-fitworld-ground,
  .flyby-fitworld-label {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }
  .intro-fore { opacity: 1; transform: none; filter: none; }
  .intro-door-l { transform: translateX(-40%); }
  .intro-door-r { transform: translateX(40%); }
  .intro-enter.is-flyby .intro-flyby { opacity: 1; visibility: visible; }
  .intro-enter.is-flyby .flyby-haze { opacity: 0 !important; visibility: hidden !important; }
  .intro-enter.is-flyby .flyby-fitworld { opacity: 1; visibility: visible; }
  .intro-enter.is-flyby .flyby-fitworld-bloom {
    transform: scale(6);
    opacity: 0.8;
  }
  .intro-enter.is-flyby .flyby-fitworld-label { opacity: 0.85; }
  .intro-enter.is-fitworld .intro-enter-cue { opacity: 1; transform: translateX(-50%) translateY(0); }
  .intro-enter.is-flyby .flyby-f4 {
    transform: translate3d(0, 0%, 40px) scale(1.1);
    opacity: 1;
    filter: none;
  }
  .intro-enter.is-flyby .flyby-f4 .flyby-label { opacity: 0.85; }
  .intro-enter.is-flyby .flyby-f1,
  .intro-enter.is-flyby .flyby-f2,
  .intro-enter.is-flyby .flyby-f3 {
    opacity: 0;
  }
}



/* intro-revert-first-v0.1: intro-gate canvas overrides removed — cinematic tunnel/flyby restored */


/* ===== capture-stable-v0.1 · observation area + fixed near-joint slots (CSS) ===== */
.rom-stage--fill .rom-stage-inner {
  /* already flex:1; reinforce max canvas share */
  flex: 1 1 auto;
  min-height: 0;
}
.rom-dock-right {
  padding: 8px 6px;
}
.rom-dock-left {
  padding: 8px 4px;
}
.rom-ex-btn {
  min-height: 48px !important;
  font-size: 12px;
  padding: 8px 4px;
}

/* ---- therapist-booking-bench-v0.1 · identity picker + shift card ---- */
.therapist-bench-bar {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.06);
}
.therapist-bench-bar-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.therapist-bench-label {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--on-shell-muted);
}
.therapist-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.therapist-pick-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #3a404c;
  background: #1a1d24; /* solid dark — not translucent; survives light parents + button{color:inherit} */
  color: #f4f1ea;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.therapist-pick-btn:hover {
  border-color: #c9a227;
  background: #22262f;
  color: #f4f1ea;
}
.therapist-pick-btn.active {
  background: #2a2416; /* gold-tinted dark, still solid */
  border-color: #c9a227;
  color: #f5e6b0;
}
.therapist-pick-btn:focus-visible {
  outline: 2px solid #c9a227;
  outline-offset: 2px;
}
.shift-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  padding: 16px;
}
.shift-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.shift-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  background: rgba(201, 162, 39, 0.25);
  color: #f5e6b0;
  flex-shrink: 0;
}
.shift-room {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.shift-notes {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--on-shell-muted);
}
#bench-focus-list .focus-card {
  margin-top: 10px;
}

/* therapist-booking-bench-v0.2 · shared-scope banner */
.bench-shared-scope {
  color: var(--on-shell-muted);
  font-style: italic;
  border-left: 3px solid var(--gold, #c9a227);
  padding-left: 8px;
}

/* ---- therapist-login-cliniko-focus-v0.1 · personal login + session bar ---- */
.staff-gate-account {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--gold-line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--on-shell);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}
.staff-gate-account:focus {
  outline: 2px solid var(--gold-bright);
  outline-offset: 1px;
}
.therapist-session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
}
.therapist-session-bar[hidden] {
  display: none !important;
}
.therapist-session-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-bright, #c9a227);
}
#therapist-pick-wrap[hidden] {
  display: none !important;
}


/* ---- cliniko-today-unavailable-blocks-v0.1 · today appts vs blocked ---- */
.today-section-title {
  margin: 18px 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--on-shell-muted);
}
.today-section-title:first-of-type { margin-top: 4px; }
.today-section-title--blocks {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--shell-line);
  color: var(--on-shell-muted);
}
.list--blocks .list-row--block {
  opacity: 0.92;
}
.list--blocks .avatar--block {
  background: rgba(120, 120, 130, 0.18);
  color: var(--on-shell-muted);
  font-size: 14px;
}
.tag-block {
  border-color: rgba(120, 120, 130, 0.45);
  color: var(--on-shell-muted);
  background: rgba(120, 120, 130, 0.12);
}
#bench-today-blocks-soft:not([hidden]) {
  margin-top: 10px;
  border-style: solid;
  border-color: rgba(180, 83, 9, 0.35);
  color: #c4a574;
}

/* ---- cliniko-tx-summary-packages-v0.1 · 客人焦點：治療摘要 + 套票／餘額 ---- */
.patient-focus {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--shell-line);
}
.patient-focus--today {
  margin-top: 22px;
  padding: 14px 14px 12px;
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  border-top-style: solid;
  background: rgba(201, 162, 39, 0.04);
}
.patient-focus-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.patient-focus-head-main .row-title {
  margin: 0;
  font-size: 15px;
}
.patient-focus-head-main .row-meta {
  margin: 2px 0 0;
}
.patient-focus-card {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--shell-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.patient-focus-card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.patient-focus-card-h h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--on-shell);
}
.patient-focus-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 720px) {
  .patient-focus-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.pf-tx-list,
.pf-pkg-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pf-tx-item,
.pf-pkg-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--shell-line);
}
.pf-tx-item:last-child,
.pf-pkg-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.pf-tx-item:first-child,
.pf-pkg-item:first-child {
  padding-top: 0;
}
.pf-tx-meta,
.pf-pkg-meta {
  font-size: 11px;
  color: var(--on-shell-muted);
  margin: 0 0 2px;
}
.pf-tx-summary,
.pf-pkg-remain {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--on-shell);
}
.pf-pkg-name {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
}
.pf-pkg-remain {
  color: var(--gold, #c9a227);
  font-weight: 600;
}
.patient-focus-foot {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.patient-focus-foot .inspire-note {
  margin: 0;
  flex: 1 1 220px;
}
.focus-card {
  cursor: pointer;
  border-radius: 8px;
  padding-left: 6px;
  padding-right: 6px;
  margin-left: -6px;
  margin-right: -6px;
  transition: background 0.12s ease;
}
.focus-card:hover,
.focus-card:focus-within {
  background: rgba(201, 162, 39, 0.08);
}
.focus-card.is-selected {
  background: rgba(201, 162, 39, 0.14);
  outline: 1px solid rgba(201, 162, 39, 0.35);
}
.list-row.is-pf-selected {
  background: rgba(201, 162, 39, 0.1);
  border-radius: 8px;
}
.list-row[data-patient-key] {
  cursor: pointer;
}

/* Admin expanded · slots / members */
.admin-slot-meter { display:flex; gap:8px; margin:12px 0 16px; }
.admin-slot-dot { width:14px; height:14px; border-radius:50%; background:#2a2f3a; border:1px solid #4a5160; }
.admin-slot-dot.on { background:#c9a227; border-color:#e0c35a; }
.admin-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.admin-search { display:block; margin-bottom:12px; }
.admin-search input {
  width:100%; box-sizing:border-box; padding:10px 12px; border-radius:10px;
  border:1px solid #3a4150; background:#12151c; color:#e8eaed;
}


/* ---- Caspar voice pack · anon / today / finance / audit / login / bio ---- */
.train-anon-block h3 { margin: 0 0 8px; font-size: 15px; }
.train-anon-block p { margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--on-shell-muted, #a8b0c0); }
.train-anon-block .btn { margin-top: 4px; }

.today-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.today-row-actions .today-act {
  font-size: 11px;
  padding: 4px 8px;
}
.today-row-actions .today-act[aria-pressed="true"] {
  background: rgba(201, 162, 39, 0.28);
  border-color: rgba(201, 162, 39, 0.55);
}
.list-row.is-need-change,
.list-row.is-ask-other {
  background: rgba(201, 162, 39, 0.07);
  border-radius: 8px;
}
.today-flag-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: #c9a227;
}

.finance-subh {
  margin: 14px 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.finance-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.finance-prefix {
  font-size: 12px;
  color: var(--on-shell-muted, #a8b0c0);
}
.finance-amount {
  width: 110px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #3a4150;
  background: #12151c;
  color: #e8eaed;
  font-size: 13px;
}
.finance-total {
  margin: 10px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #e0c35a;
}
.audit-row .row-meta { font-size: 12px; }

.login-forgot-wrap { margin: 4px 0 12px; }
.btn-link {
  background: none;
  border: none;
  color: #c9a227;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.forgot-panel {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #3a4150;
  background: rgba(18, 21, 28, 0.85);
}
.forgot-panel h3 { margin: 0 0 8px; font-size: 15px; }

.bio-login-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.bio-login-row .btn { width: 100%; }

/* Guest path: hide ROM entry (also use [hidden]) */
.glance-card-rom[hidden],
.tap-card-rom[hidden] { display: none !important; }

#login-pass::placeholder {
  color: #6b7280;
  opacity: 1;
}


/* Pi demo: large one-tap staff login (no keyboard) */
.staff-demo-tap {
  display: block;
  width: 100%;
  margin: 4px 0 14px;
  padding: 16px 18px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: #0b1220;
  background: linear-gradient(180deg, #f5d76e 0%, #d4a017 100%);
  border: 2px solid #b8860b;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(212, 160, 23, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.staff-demo-tap:hover,
.staff-demo-tap:focus-visible {
  filter: brightness(1.06);
  outline: 2px solid #f0c040;
  outline-offset: 2px;
}
.staff-demo-tap:active {
  transform: translateY(1px);
  filter: brightness(0.96);
}


/* ===== rom-stage-v0.2 · phone ROM: maximize camera stage (Caspar) ===== */
/* Goal: stage/canvas first; docks compact; primary actions ≥44px; four-view slim. */
@media (max-width: 768px) {
  .rom-dock-top {
    padding-top: max(4px, env(safe-area-inset-top, 0px));
    padding-left: max(6px, env(safe-area-inset-left, 0px));
    padding-right: max(6px, env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 640px) {
  /* Stage row gets most of the viewport */
  .rom-immersive {
    grid-template-rows: auto minmax(58vh, 1fr) auto auto;
  }
  .rom-stage--fill {
    min-height: 58vh;
  }
  .rom-stage--fill .rom-stage-inner {
    min-height: 52vh;
    flex: 1 1 auto;
  }

  /* --- Top chrome: slim; hide rarely used ops --- */
  .rom-dock-top {
    gap: 4px 6px;
    min-height: 40px;
    flex-wrap: nowrap;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .rom-dock-title {
    font-size: 11px;
    max-width: 36vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rom-dock-actions {
    gap: 3px;
  }
  .rom-dock-actions .btn {
    min-height: 44px;
    padding: 6px 8px;
    font-size: 12px;
  }
  #rom-btn-av,
  #rom-btn-apply-height,
  #rom-btn-clear,
  #rom-btn-refresh {
    display: none;
  }

  /* --- Under-stage chrome: shrink hard --- */
  .rom-stage--fill .rom-metrics {
    min-height: 0;
    max-height: 28px;
    padding: 2px 6px;
    font-size: 0.75rem;
    gap: 4px 6px;
  }
  .rom-metrics .rom-metric-pill {
    padding: 1px 6px;
  }
  .rom-stage--fill .rom-protocol-results {
    max-height: 40px;
    padding: 2px 6px;
  }
  /* Four-view: single slim row (not 2×2) so stage stays tall */
  .rom-stage--fill .rom-fourview-strip:not(:empty) {
    max-height: 64px;
    padding: 4px 6px;
    gap: 4px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .rom-fourview-card {
    min-height: 0;
    border-radius: 6px;
  }
  .rom-fourview-card img {
    height: 40px;
  }
  .rom-fourview-card .cap {
    font-size: 0.62rem;
    line-height: 1.15;
    padding: 1px 3px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rom-fourview-card.is-empty .cap {
    padding: 8px 3px;
  }

  /* --- HUD: compact overlay; don't eat canvas --- */
  .rom-hud {
    left: 4px;
    right: 4px;
    bottom: 4px;
    gap: 4px;
    z-index: 28;
  }
  .rom-hud-angles {
    max-width: min(62vw, 260px);
    gap: 2px;
  }
  .rom-angle,
  .rom-angle--pair,
  .rom-action-line {
    font-size: 12px;
    padding: 2px 6px;
    line-height: 1.25;
  }
  .rom-angle-compact,
  .rom-pair-minmax,
  .rom-method-strip {
    font-size: 10px;
    padding: 1px 5px;
    line-height: 1.25;
  }
  .rom-framing-hint {
    font-size: 0.75rem;
    padding: 3px 6px;
  }
  .rom-method-toggle {
    font-size: 11px;
    min-height: 28px;
    padding: 2px 8px;
  }
  .rom-hud-right {
    max-width: 32%;
    gap: 2px;
  }
  .rom-status {
    font-size: 9px;
    font-weight: 500;
    padding: 3px 6px;
    max-width: 100%;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .rom-build {
    display: none;
  }
  .rom-stage-fab--tr {
    top: 6px;
    right: 6px;
    gap: 5px;
    z-index: 30;
  }
  .rom-stage-fab--tr .btn {
    min-height: 44px;
    min-width: 64px;
    padding: 8px 12px;
    font-size: 13px;
  }

  /* --- Left dock: one compact primary bar --- */
  .rom-dock-left {
    padding: 4px 8px;
    gap: 4px 6px;
  }
  .rom-cam-dual-hint {
    display: none;
  }
  /* Secondary overlays collapsed into compact bar (hidden on narrow — see 480) */
  #rom-btn-bones,
  #rom-btn-pois,
  #rom-btn-balance,
  #rom-btn-autoframe,
  #rom-btn-reset-pois {
    flex: 0 0 auto;
    min-width: 0;
    min-height: 44px;
    padding: 6px 7px;
    font-size: 11px;
  }
  #rom-btn-mode-auto,
  #rom-btn-mode-manual,
  #rom-btn-live-skel {
    order: 1;
    min-height: 44px;
  }
  .rom-facing-field {
    flex: 1 1 140px;
    max-width: none;
    width: auto;
    margin: 0;
    order: 90;
  }
  .rom-facing-field span {
    font-size: 11px;
  }
  .rom-facing-field select {
    min-height: 44px;
    font-size: 14px;
    padding: 6px 10px;
  }
  #rom-btn-skip-coach {
    flex: 1 1 110px;
    order: 91;
    min-height: 44px;
    margin: 0;
  }

  /* --- Right dock: compact; primary save / export stay large --- */
  .rom-dock-right {
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 5px;
  }
  .rom-dock-label {
    flex: 0 0 100%;
    margin: 2px 0 0;
    font-size: 10px;
    letter-spacing: 0.08em;
  }
  .rom-dock-label:first-child {
    margin-top: 0;
  }
  .rom-view-grid {
    gap: 4px;
  }
  .rom-view-grid .btn {
    min-height: 40px;
    font-size: 11px;
    padding: 4px 2px;
  }
  #rom-btn-capture-view,
  #rom-autopack-toggle {
    flex: 1 1 calc(50% - 6px);
    min-height: 44px;
    margin: 0;
  }
  .rom-autopack-toggle {
    justify-content: center;
  }
  .rom-btn-clear-fourviews {
    flex: 1 1 100%;
    width: auto;
    margin-top: 0;
    min-height: 40px;
    font-size: 12px;
  }
  #rom-btn-save-session {
    flex: 1 1 100%;
    width: auto;
    min-height: 48px !important;
    font-size: 15px;
    font-weight: 700;
  }
  #rom-btn-save-angle,
  #rom-btn-export {
    flex: 1 1 calc(50% - 6px);
    min-height: 44px;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .rom-immersive {
    grid-template-rows: auto minmax(62vh, 1fr) auto auto;
  }
  .rom-stage--fill {
    min-height: 62vh;
  }
  .rom-stage--fill .rom-stage-inner {
    min-height: 56vh;
  }
  /* Hide gait/sway/squat + advanced overlays — free stage */
  .rom-dock-right > .rom-dock-label:first-of-type,
  #rom-btn-gait,
  #rom-btn-fall,
  #rom-btn-squat {
    display: none;
  }
  #rom-btn-bones,
  #rom-btn-pois,
  #rom-btn-balance,
  #rom-btn-autoframe,
  #rom-btn-reset-pois {
    display: none;
  }
  .rom-stage--fill .rom-fourview-strip:not(:empty) {
    max-height: 56px;
  }
  .rom-fourview-card img {
    height: 36px;
  }
  .rom-fourview-card .cap {
    display: none;
  }
  .rom-hud-angles {
    max-width: min(60vw, 240px);
  }
  .rom-dock-title em {
    font-size: 10px;
  }
  /* Primary still tappable */
  #rom-btn-save-session,
  #rom-fab-locate,
  #rom-fab-save,
  .rom-facing-field select {
    min-height: 44px !important;
  }
}


/* rom-report-v0.1 · Trace client progress + saved exam reports */
.rom-progress-list,
.rom-report-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.rom-progress-block {
  padding: 10px 12px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.rom-progress-ul {
  margin: 6px 0 0;
  padding-left: 1.1em;
  font-size: 13px;
  line-height: 1.45;
}
.rom-progress-ul li span {
  opacity: 0.75;
}
.rom-progress-delta {
  margin: 6px 0 0;
  font-size: 12px;
}
.rom-hist-item--report .meta strong {
  color: var(--gold, #c9a227);
}
.rom-history-note {
  margin: 0 0 8px;
  font-size: 12px;
}


/* secure-msg-v0.1 · first-day secure message gate */
.secure-msg-rule {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--shell-elev);
}
.secure-msg-rule-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold-bright, #c9a227);
}
.secure-msg-rule-body {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--on-shell-muted);
}
.secure-msg-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--shell-line);
  background: var(--shell-mid);
}
.secure-msg-banner--open {
  border-color: var(--gold-line);
  background: linear-gradient(120deg, rgba(196,168,120,0.14), transparent 70%), var(--shell-elev);
}
.secure-msg-banner--closed {
  border-color: rgba(180, 90, 90, 0.35);
  background: rgba(180, 90, 90, 0.08);
}
.secure-msg-banner-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--on-shell);
}
.secure-msg-welcome {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-bright, #c9a227);
}
.msg-compose.is-locked {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.2);
}
.msg-compose.is-locked input,
.msg-compose.is-locked button {
  cursor: not-allowed;
}
.secure-msg-demo-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--on-shell-muted);
  cursor: pointer;
  user-select: none;
}
.secure-msg-demo-toggle input {
  margin-top: 2px;
  flex-shrink: 0;
}
.secure-msg-therapist .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}


/* ---- ChartOpen 60s brief · status-chartopen-v0.1 ---- */
.chartopen-brief {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(232, 212, 170, 0.08);
  border: 1px solid rgba(232, 212, 170, 0.22);
}
.chartopen-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 8px 12px;
  align-items: start;
}
.chartopen-row--focus {
  padding-top: 8px;
  border-top: 1px dashed rgba(232, 212, 170, 0.28);
}
.chartopen-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold, #e8d4aa);
  letter-spacing: 0.02em;
}
.chartopen-val {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--on-shell, #f2f4f7);
}
.patient-focus-more {
  margin-top: 10px;
}
.patient-focus-more > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--on-shell-muted, #a8b0bc);
  list-style: none;
  padding: 6px 0;
}
.patient-focus-more > summary::-webkit-details-marker { display: none; }
.patient-focus-more[open] > summary { margin-bottom: 8px; }

/* ===== rom-dock-swipe-v0.1 · phone capture swipe + tap fix ===== */
body.rom-mode .secret-wrap {
  display: none !important; /* was z-index 50 over dock 40 — blocked taps */
}

.rom-phone-dock__tabs,
.rom-phone-dock__hint {
  display: none;
}

/* Desktop: unwrap so left/right still grid into immersive */
@media (min-width: 641px) {
  .rom-phone-dock,
  .rom-phone-dock__scroller,
  .rom-phone-page,
  .rom-phone-page--capture,
  .rom-phone-page--tools {
    display: contents;
  }
  .rom-dock-left { grid-area: left; }
  .rom-dock-right { grid-area: right; }
}

@media (max-width: 640px) {
  .rom-immersive {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "top"
      "stage"
      "dock";
  }
  .rom-stage--fill {
    min-height: 0 !important; /* was 62vh — overflow clipped docks / broke taps */
  }
  .rom-stage--fill .rom-stage-inner {
    min-height: 0 !important;
  }
  .rom-phone-dock {
    grid-area: dock;
    display: flex;
    flex-direction: column;
    z-index: 70;
    pointer-events: auto !important;
    touch-action: manipulation;
    position: relative;
    isolation: isolate;
    max-height: min(42vh, 360px);
    background: rgba(10, 12, 16, 0.96);
    border-top: 1px solid rgba(196, 168, 120, 0.35);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .rom-phone-dock,
  .rom-phone-dock * {
    pointer-events: auto;
  }
  .rom-phone-dock__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 8px 2px;
    overflow-x: hidden;
    overflow-y: visible;
    width: 100%;
    box-sizing: border-box;
  }
  .rom-phone-dock__tabs::-webkit-scrollbar { display: none; }
  .rom-phone-tab {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(196, 168, 120, 0.35);
    background: rgba(18, 22, 28, 0.9);
    color: rgba(232, 213, 168, 0.85);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
  }
  .rom-phone-tab.is-on,
  .rom-phone-tab[aria-selected="true"] {
    border-color: rgba(232, 213, 168, 0.85);
    background: linear-gradient(135deg, rgba(196, 168, 120, 0.28), rgba(12, 14, 18, 0.5));
    color: #f5e6c8;
  }
  .rom-phone-dock__hint {
    display: block;
    margin: 0;
    padding: 0 10px 4px;
    font-size: 11px;
    color: var(--on-shell-muted, #9aa3b2);
  }
  /* rom-cam-portrait-uw-v0.1 · no horizontal swipe; tabs show one page; buttons wrap in viewport */
  .rom-phone-dock__scroller {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-x: none;
  }
  .rom-phone-page {
    display: none;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    max-height: none;
    padding: 4px 8px 8px;
    box-sizing: border-box;
    pointer-events: auto !important;
  }
  .rom-phone-page.is-on {
    display: block;
  }
  .rom-phone-page .rom-dock-left,
  .rom-phone-page .rom-dock-right {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 4px 0;
    border: none;
    background: transparent;
    backdrop-filter: none;
    max-height: none;
    overflow: visible;
  }
  .rom-phone-page .rom-dock-left .btn,
  .rom-phone-page .rom-dock-right .btn,
  .rom-phone-capture-facing .btn {
    width: auto;
    flex: 0 1 auto;
    min-height: 40px;
    min-width: 0;
    max-width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    pointer-events: auto !important;
  }
  .rom-phone-page .rom-view-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  .rom-phone-page .rom-view-grid .btn {
    min-width: 0;
    width: 100%;
  }
  .rom-phone-capture-facing {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: stretch;
  }
  .rom-phone-capture-facing .rom-view-grid {
    flex: 1 1 100%;
  }
  .rom-phone-capture-facing .rom-dock-label {
    flex: 0 0 100%;
    margin: 0;
  }
  #rom-btn-capture-view,
  #rom-autopack-toggle {
    flex: 1 1 calc(50% - 6px);
    min-height: 44px;
  }
  .rom-btn-clear-fourviews {
    flex: 1 1 100%;
    min-height: 40px;
  }
  #rom-btn-save-session {
    flex: 1 1 100%;
    min-height: 48px !important;
  }
  /* FABs always above dock */
  .rom-stage-fab--tr {
    z-index: 75 !important;
    pointer-events: auto !important;
  }
}

/* ===== special-tests-v0.1 · Physio-pedia stepwise flow ===== */
.special-tests-view {
  padding: 12px 14px 28px;
  max-width: 720px;
  margin: 0 auto;
}
.special-tests-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.special-tests-header h1 {
  margin: 0;
  flex: 1 1 auto;
  font-size: 1.25rem;
  color: var(--gold-bright, #e8d5a8);
}
.st-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}
.st-step {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--shell-line, #333);
  font-size: 12px;
  color: var(--on-shell-muted, #9aa3b2);
}
.st-step.is-on {
  border-color: rgba(196, 168, 120, 0.65);
  color: var(--gold-bright, #e8d5a8);
  background: rgba(196, 168, 120, 0.12);
}
.st-lead {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-shell, #eee);
}
.st-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.st-region-btn {
  min-height: 48px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid rgba(196, 168, 120, 0.35);
  background: rgba(18, 22, 28, 0.9);
  color: #f0e2c4;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.st-region-btn.is-on {
  border-color: rgba(232, 213, 168, 0.9);
  box-shadow: 0 0 0 1px rgba(232, 213, 168, 0.25);
}
.st-test-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.st-test-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--shell-line, #333);
  background: var(--shell-elev, #1a1a1a);
}
.st-test-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--gold-bright, #e8d5a8);
}
.st-test-card p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--on-shell-muted, #9aa3b2);
}
.st-test-card .st-pos-toggle {
  min-height: 44px;
  width: 100%;
}
.st-test-card.is-positive {
  border-color: rgba(220, 120, 90, 0.55);
  background: rgba(180, 70, 50, 0.1);
}
.st-pane-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.st-findings-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.st-findings-list li {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(220, 120, 90, 0.4);
  background: rgba(180, 70, 50, 0.08);
  font-size: 14px;
  line-height: 1.4;
}
.st-findings-list li strong {
  color: var(--gold-bright, #e8d5a8);
}
.st-empty[hidden],
.st-pane[hidden] {
  display: none !important;
}



/* ===== special-test-mode-v0.1 · 主動／被動／其他 + clickable steps ===== */
.st-step-clickable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.st-step-clickable:hover {
  border-color: rgba(196, 168, 120, 0.55);
  color: var(--gold-bright, #e8d5a8);
  background: rgba(196, 168, 120, 0.08);
}
.st-step-clickable:focus-visible {
  outline: 2px solid rgba(232, 213, 168, 0.7);
  outline-offset: 2px;
}
.st-test-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.st-test-head h3 {
  margin: 0;
  flex: 1 1 auto;
}
.st-mode-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.st-mode-active {
  color: #b8e0c8;
  background: rgba(60, 140, 90, 0.22);
  border-color: rgba(90, 180, 120, 0.45);
}
.st-mode-passive {
  color: #c8d4f0;
  background: rgba(70, 100, 180, 0.22);
  border-color: rgba(110, 140, 210, 0.45);
}
.st-mode-other {
  color: #f0d8a8;
  background: rgba(180, 130, 50, 0.2);
  border-color: rgba(210, 160, 70, 0.45);
}
.st-mode-tip {
  margin: 0 0 6px !important;
  font-size: 12px !important;
  color: var(--gold-bright, #e8d5a8) !important;
  opacity: 0.9;
}
.st-test-card .st-how {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--on-shell-muted, #9aa3b2);
}
.st-finding-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.st-finding-top strong {
  flex: 1 1 auto;
}
.st-pos-badge {
  font-size: 11px;
  font-weight: 700;
  color: #f0a090;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(220, 120, 90, 0.5);
  background: rgba(180, 70, 50, 0.15);
}
.st-finding-mode {
  margin: 6px 0 0;
  font-size: 12px;
}
.st-mode-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--on-shell-muted, #9aa3b2);
}
.st-mode-legend .st-mode-tag {
  font-size: 10px;
}

/* ===== focus-inline-v0.1 · last record expands under selected 今日焦點 row ===== */
.patient-focus-host:empty {
  display: none;
}
#bench-focus-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
#bench-focus-list .focus-card {
  margin-top: 0;
}
#bench-focus-list .patient-focus--inline {
  margin: 4px 0 12px;
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(201, 162, 39, 0.07);
  animation: pfInlineIn 0.18s ease;
}
#bench-focus-list .focus-card.is-selected {
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
  outline: none;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-bottom-color: transparent;
  background: rgba(201, 162, 39, 0.12);
}
#bench-focus-list .focus-card.is-selected + .patient-focus--inline {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: 0;
}
@keyframes pfInlineIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}




/* ===== rom-cam-portrait-uw-v0.1 · restored base ROM media/layout (lost in intro edit) ===== */
.rom-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* cover fills stage, crops overflow, no black bars, no stretch — hidden while 3D avatar shows */
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}
.rom-avatar3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  z-index: 0;
  background: #080a0d;
  pointer-events: none;
}
.rom-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  /* cover fills stage when showing camera frame */
  object-fit: cover;
  object-position: center;
  cursor: crosshair;
  touch-action: none;
  background: transparent;
  z-index: 1;
}
.rom-canvas--hud {
  background: transparent;
  /* v18.8: fill so top-left balance HUD is never mid-cropped by cover */
  object-fit: fill;
}
.rom-hud {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  z-index: 28; /* DOM HUD above canvas paint */
}
.rom-hud-angles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: min(72vw, 420px);
  min-width: 0;
}
/* v18.8.1: pair name is status-sized; degrees live near joints on canvas */
.rom-angle {
  font-family: var(--font, inherit);
  font-size: clamp(15px, 2.2vw, 18px); /* v19.2.10-tipfonts · aide-readable */
  font-weight: 600;
  color: var(--gold-bright);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(12, 14, 18, 0.72);
  border: 1px solid var(--gold-line);
  letter-spacing: 0.02em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.rom-angle--pair {
  font-size: clamp(15px, 2.2vw, 18px); /* v19.2.10-tipfonts */
  font-weight: 600;
}
.rom-angle-compact {
  font-family: var(--mono);
  font-size: 0.9375rem; /* v19.2.10-tipfonts · was 12px */
  line-height: 1.35;
  color: rgba(232, 212, 170, 0.9);
  background: rgba(12, 14, 18, 0.65);
  border: 1px solid rgba(196, 168, 120, 0.3);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  max-width: 100%;
}
.rom-action-line {
  font-size: clamp(15px, 2.2vw, 18px); /* v19.2.10-tipfonts */
  font-weight: 700;
  color: #c8e8f4;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(20, 36, 48, 0.78);
  border: 1px solid rgba(126, 200, 227, 0.45);
  max-width: 100%;
}
.rom-framing-hint {
  /* v19.2.10-tipfonts · match Lab-Go TL HUD ~15–20px / 1rem; fixed bottom HUD slot */
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #ffd0b8;
  background: rgba(40, 18, 12, 0.82);
  border: 1px solid rgba(255, 160, 120, 0.55);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.rom-hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 48%;
}
.rom-method-toggle {
  pointer-events: auto;
  font-size: 0.875rem; /* v19.2.10-tipfonts · was 11px */
  line-height: 1.2;
  color: rgba(126, 200, 227, 0.95);
  background: rgba(12, 14, 18, 0.65);
  border: 1px solid rgba(126, 200, 227, 0.4);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  cursor: pointer;
}
.rom-method-toggle:hover {
  background: rgba(30, 40, 50, 0.85);
}
.rom-pair-minmax,
.rom-method-strip {
  font-size: 0.9375rem; /* v19.2.10-tipfonts · was 11px */
  line-height: 1.35;
  color: rgba(232, 212, 170, 0.88);
  background: rgba(12, 14, 18, 0.72);
  border: 1px solid rgba(196, 168, 120, 0.35);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.rom-method-strip {
  color: rgba(126, 200, 227, 0.95);
}
.rom-status {
  font-size: 0.9375rem; /* v19.2.10-tipfonts · was 12px · aide status */
  font-weight: 600;
  color: var(--on-shell-muted);
  background: rgba(12, 14, 18, 0.65);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--shell-line);
  max-width: 55%;
  text-align: right;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.rom-build {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(196, 168, 120, 0.45);
  background: rgba(12, 14, 18, 0.72);
  color: #e8d4aa;
  font-size: 0.8125rem; /* meta · keep slightly under tip band */
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.rom-hint {
  margin: 12px 14px 14px;
  font-size: 13px;
  line-height: 1.55;
}
.rom-hint strong {
  color: var(--gold-bright);
  font-weight: 600;
}

@media (max-width: 640px) {
  .rom-stage-inner {
    aspect-ratio: 16 / 9;
    max-height: min(82vh, 860px);
  }
  .rom-video,
  .rom-canvas,
  .rom-avatar3d {
    object-fit: cover;
  }
  .rom-actions {
    width: 100%;
  }
  .rom-actions .btn {
    flex: 1 1 auto;
  }
}

.rom-field-sm {
  flex: 0 1 180px;
  min-width: 140px;
}
.rom-overlay-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding-top: 4px;
  border-top: 1px dashed var(--shell-line);
  margin-top: 2px;
}
.rom-toggle.is-on {
  border-color: var(--gold-line);
  color: var(--gold-bright);
  background: linear-gradient(135deg, rgba(196, 168, 120, 0.18), rgba(12, 14, 18, 0.4));
  box-shadow: var(--gold-glow);
}
.rom-hint code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--gold-bright);
  background: rgba(12, 14, 18, 0.55);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--gold-line);
}


/* ---- ROM v14 extensions ---- */
.rom-chip-label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  opacity: 0.85;
  margin-right: 2px;
}
.rom-view-btn.is-on {
  border-color: rgba(126, 200, 227, 0.55);
  color: #9fd6e8;
  background: linear-gradient(135deg, rgba(126, 200, 227, 0.16), rgba(12, 14, 18, 0.4));
}
.rom-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px 4px;
  font-size: 1rem; /* v19.2.4 · match canvas TL readability */
  color: rgba(232, 212, 170, 0.85);
}
.rom-metrics .rom-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(196, 168, 120, 0.35);
  background: rgba(12, 14, 18, 0.55);
}
.rom-metrics .rom-metric-pill strong {
  color: #9fd6e8;
  font-weight: 600;
}
.rom-fourview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 8px 14px 12px;
}
.rom-fourview-card {
  border: 1px solid rgba(196, 168, 120, 0.28);
  border-radius: 10px;
  background: #0c0e12; /* solid dark card — empty state never white-on-white */
  overflow: hidden;
  min-height: 72px;
  color: #e8d4aa;
}
.rom-fourview-card.has-thumb {
  cursor: pointer;
}
.rom-fourview-card.has-thumb:hover,
.rom-fourview-card.has-thumb:focus-visible {
  border-color: rgba(196, 168, 120, 0.7);
  box-shadow: 0 0 0 1px rgba(196, 168, 120, 0.35);
  outline: none;
}
.rom-fourview-card img {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: cover;
  background: #0a0c10;
  pointer-events: none;
}
.rom-fourview-card .cap {
  padding: 4px 8px 6px;
  font-size: 0.78rem;
  color: #e8d4aa; /* readable on solid dark card */
}
.rom-fourview-card.is-empty .cap {
  padding: 28px 8px;
  text-align: center;
  color: #c4b090;
  opacity: 0.85;
}
.rom-btn-clear-fourviews {
  margin-top: 6px;
  width: 100%;
  opacity: 0.92;
}
.rom-history {
  margin-top: 16px;
}
.rom-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.rom-history-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--gold-bright);
}
.rom-history-sub {
  margin: 18px 0 8px;
  font-size: 0.95rem;
  color: rgba(232, 212, 170, 0.9);
}
.rom-session-list,
.rom-angle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rom-hist-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(196, 168, 120, 0.22);
  background: rgba(12, 14, 18, 0.45);
}
.rom-hist-item img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: #0a0c10;
}
.rom-hist-item .meta {
  font-size: 0.84rem;
  color: rgba(232, 212, 170, 0.88);
}
.rom-hist-item .meta small {
  display: block;
  opacity: 0.65;
  margin-top: 2px;
}
.rom-hist-item .rom-hist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rom-session-review {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(126, 200, 227, 0.28);
  background: rgba(12, 14, 18, 0.55);
}
.rom-session-review pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  color: rgba(232, 212, 170, 0.8);
  max-height: 280px;
  overflow: auto;
}
.rom-field input[type="number"] {
  width: 100%;
  background: rgba(12, 14, 18, 0.65);
  border: 1px solid var(--shell-line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
}
@media (max-width: 720px) {
  .rom-fourview-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rom-hist-item { grid-template-columns: 56px 1fr; }
  .rom-hist-item .rom-hist-actions { grid-column: 1 / -1; }
}


/* ---- ROM v17 · clickability · results · FAB · shortcuts ---- */
.rom-toolbar {
  position: relative;
  z-index: 30;
  pointer-events: auto;
}
.rom-toolbar .btn,
.rom-toolbar select,
.rom-toolbar input,
.rom-overlay-toggles .btn {
  pointer-events: auto;
  min-height: 44px;
  position: relative;
  z-index: 31;
}
.rom-canvas { z-index: 1; background: #080a0d; }
.rom-stage-fab {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 36; /* above canvas HUD labels — 儲存／定位 never buried */
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}
.rom-stage-fab .btn {
  min-height: 44px;
  min-width: 44px;
  pointer-events: auto;
  box-shadow: 0 4px 18px rgba(0,0,0,0.55);
  background: rgba(12, 14, 18, 0.94);
  border: 1px solid rgba(196, 168, 120, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.rom-protocol-results {
  margin: 10px 14px 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(196, 168, 120, 0.45);
  background: rgba(12, 14, 18, 0.72);
  color: #e8d4aa;
  font-size: 0.9rem;
  line-height: 1.55;
  display: none;
}
.rom-protocol-results.is-visible { display: block; }
.rom-protocol-results h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--gold-bright);
}
.rom-protocol-results .rom-result-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}
.rom-shortcuts-hint {
  margin: 4px 14px 12px;
  font-size: 12px;
  color: var(--on-shell-muted);
  line-height: 1.5;
}
.rom-shortcuts-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(196,168,120,0.35);
  background: rgba(12,14,18,0.55);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold-bright);
}


/* ---- Trace v18.8 · immersive ROM · fixed docks · pair HUD · no drawer ---- */
body.rom-mode {
  overflow: hidden;
}
body.rom-mode .app-shell {
  max-width: none;
  padding: 0;
  min-height: 100dvh;
  height: 100dvh;
}
body.rom-mode .site-header {
  display: none;
}
body.rom-mode .site-footer {
  display: none;
}
body.rom-mode .view.active.rom-view {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  animation: none;
}

.rom-stage {
  overflow: hidden;
}
.rom-stage-inner {
  position: relative;
  background: #080a0d;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-line);
  aspect-ratio: 16 / 9;
  max-height: min(82vh, 860px);
  overflow: hidden;
}

.rom-immersive {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  /* capture-stable-v0.1 · larger main observation: narrower side docks */
  grid-template-columns: 52px minmax(0, 1fr) 88px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "top top top"
    "left stage right";
  background: #080a0d;
  width: 100%;
  height: 100%;
}

/* rom-cam-portrait-uw-v0.2 · MUST follow base .rom-immersive (earlier max-640 was overridden) */
@media (max-width: 640px) {
  .rom-immersive {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    grid-template-areas:
      "top"
      "stage"
      "dock" !important;
  }
  .rom-phone-dock {
    grid-area: dock !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-self: stretch;
  }
  .rom-stage--fill {
    grid-area: stage !important;
    min-height: 40vh;
  }
  /* Keep start/reopen camera reachable on phone */
  .rom-dock-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
  }
  .rom-dock-actions #rom-btn-start {
    display: inline-flex !important;
    min-height: 40px;
  }
  /* Show primary toggles; wrap in dock */
  .rom-phone-page--capture .rom-dock-left {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100%;
  }
  #rom-btn-bones,
  #rom-btn-pois,
  #rom-btn-balance,
  #rom-btn-autoframe,
  #rom-btn-reset-pois,
  #rom-btn-live-skel {
    display: inline-flex !important;
  }
}


.rom-dock {
  z-index: 40;
  pointer-events: auto;
  background: rgba(12, 14, 18, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(196, 168, 120, 0.28);
}

.rom-dock-top {
  grid-area: top;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 10px;
  padding: 6px 10px; /* capture-stable-v0.1 · slightly shorter top chrome */
  border-left: none;
  border-right: none;
  border-top: none;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 48px;
}
.rom-dock-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}
.rom-dock-title em {
  font-style: normal;
  color: #9fd6e8;
}
.rom-dock-back {
  flex-shrink: 0;
  min-width: 40px;
  min-height: 40px;
}
.rom-dock-fields {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}
.rom-mini-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  flex: 0 1 120px;
  min-width: 96px;
}
.rom-mini-field.rom-mini-grow { flex: 1 1 160px; min-width: 120px; }
.rom-mini-field.rom-mini-narrow { flex: 0 0 78px; min-width: 72px; }

/* Caspar dual-cam · clinic Insta360 / phone built-in */
.rom-cam-mode-label {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold, #c9a227);
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.35);
  white-space: nowrap;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rom-cam-dual-hint {
  margin: 8px 0 4px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--on-shell-muted, #9aa3b2);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border: 1px dashed rgba(201, 162, 39, 0.28);
}
.rom-facing-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 0;
  width: 100%;
  max-width: 140px;
}
.rom-facing-field span {
  font-size: 10px;
  color: var(--on-shell-muted, #9aa3b2);
}
.rom-facing-field select {
  min-height: 36px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--shell-line, #333);
  background: var(--shell-elev, #1a1a1a);
  color: var(--on-shell, #eee);
  font-size: 12px;
}
.cta-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
/* assess-entry-v0.1 · three CTA buttons one horizontal row, equal width on mobile */
.cta-banner-actions--row3 {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  flex: 1 1 100%;
}
.cta-banner-actions--row3 > .btn {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  font-size: 12.5px;
  padding-left: 6px;
  padding-right: 6px;
  line-height: 1.25;
}
.cta-banner--assess {
  flex-direction: column;
  align-items: stretch;
}
.cta-banner-main { flex: 1 1 auto; min-width: 0; }
.cta-chrome-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(232, 212, 170, 0.72);
}
.assess-cta-region {
  margin-top: 12px;
}
.assess-cta-region > summary.assess-cta-region-label,
.assess-cta-region-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(232, 212, 170, 0.9);
  cursor: pointer;
  list-style: none;
}
.assess-cta-region > summary.assess-cta-region-label::-webkit-details-marker { display: none; }
.assess-cta-region > summary.assess-cta-region-label::before {
  content: "▸ ";
  opacity: 0.7;
}
.assess-cta-region[open] > summary.assess-cta-region-label::before { content: "▾ "; }
.assess-cta-picker {
  margin: 10px 0 4px;
}
.assess-cta-picker .secure-msg-pick-list {
  max-height: 220px;
}
.assess-cta-gate-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(232, 212, 170, 0.45);
  background: rgba(12, 14, 18, 0.45);
  color: #e8d4aa;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 13px;
}
.assess-cta-gate-msg[hidden] { display: none !important; }
#cta-assess-entry.is-no-patient .cta-banner-actions--row3 > .btn {
  opacity: 0.45;
  filter: grayscale(0.25);
  cursor: not-allowed;
}
.assess-inherited-patient {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(232, 212, 170, 0.08);
  border: 1px solid rgba(232, 212, 170, 0.22);
  font-size: 13px;
  color: rgba(232, 212, 170, 0.9);
}
.assess-inherited-patient strong { color: #e8d4aa; }
.rom-client-readout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}
.rom-client-readout strong {
  font-size: 12px;
  color: #e8d4aa;
  font-weight: 700;
  white-space: nowrap;
}
.assess-cta-region-grid {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}
.assess-cta-region-hint {
  margin: 8px 0 0;
  font-size: 11px;
}
.cta-btn-cam {
  border-color: rgba(100, 180, 210, 0.45) !important;
  color: #9fd4e8 !important;
}
.cta-btn-st {
  border-color: rgba(160, 140, 200, 0.45) !important;
}
/* always one horizontal row; equal width especially on mobile (Caspar 2026-10-17) */
.cta-banner-actions--row3 {
  flex-direction: row;
  flex-wrap: nowrap;
}
@media (min-width: 720px) {
  .cta-banner--assess {
    flex-direction: column;
    align-items: stretch;
  }
  .cta-banner-actions--row3 {
    width: 100%;
    max-width: 560px;
  }
}
@media (max-width: 719px) {
  .cta-banner-actions--row3 > .btn {
    font-size: 11.5px;
    padding-left: 4px;
    padding-right: 4px;
  }
}

/* camera chrome · ROM */
.rom-view.is-camera-chrome .rom-dock-top {
  border-bottom: 1px solid rgba(100, 180, 210, 0.4);
  background: linear-gradient(180deg, rgba(40, 90, 110, 0.28), transparent 85%);
}
.rom-chrome-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.rom-chrome-titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  margin-right: 6px;
}
.rom-dock-kicker {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.03em;
  color: rgba(159, 212, 232, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rom-view.is-camera-chrome .rom-dock-title {
  color: #b7e2f2;
}

/* Trace vs special-tests chrome */
.st-chrome-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.st-chrome-titles {
  flex: 1 1 auto;
  min-width: 0;
}
.st-chrome-titles h1 {
  margin: 0;
  font-size: 1.2rem;
}
.st-chrome-kicker {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--on-shell-muted, #9aa3b2);
}
.special-tests-view.is-trace-chrome .special-tests-header {
  background: linear-gradient(135deg, rgba(196, 168, 120, 0.16), transparent 60%);
  border-bottom: 1px solid rgba(196, 168, 120, 0.35);
  margin: -4px -4px 8px;
  padding: 10px 12px;
  border-radius: 10px;
}
.special-tests-view.is-trace-chrome .st-chrome-titles h1 {
  color: var(--gold-bright, #e8d5a8);
}
.special-tests-view.is-special-chrome .special-tests-header {
  background: linear-gradient(135deg, rgba(140, 120, 190, 0.14), transparent 60%);
  border-bottom: 1px solid rgba(160, 140, 200, 0.3);
  margin: -4px -4px 8px;
  padding: 10px 12px;
  border-radius: 10px;
}
.special-tests-view.is-special-chrome .st-chrome-titles h1 {
  color: #d4c4f0;
}

.rom-mini-field span {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--on-shell-muted);
  white-space: nowrap;
}
.rom-mini-field select,
.rom-mini-field input {
  width: 100%;
  min-height: 36px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--shell-line);
  background: var(--shell-elev);
  color: var(--on-shell);
  font-size: 12px;
}
.rom-dock-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.rom-dock-actions .btn {
  min-height: 40px;
  padding: 6px 10px;
}

.rom-dock-left {
  grid-area: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 6px;
  border-top: none;
  border-left: none;
  border-bottom: none;
  align-items: stretch;
  overflow-y: auto;
  overflow-x: hidden;
}
.rom-dock-left .btn {
  min-height: 40px;
  padding: 6px 4px;
  font-size: 11px;
  width: 100%;
  writing-mode: horizontal-tb;
}

.rom-dock-right {
  grid-area: right;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  border-top: none;
  border-right: none;
  border-bottom: none;
  overflow-y: auto;
  overflow-x: hidden;
  align-items: stretch;
}
.rom-dock-label {
  margin: 4px 0 0;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
  opacity: 0.85;
}
.rom-ex-btn {
  min-height: 52px !important;
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.rom-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.rom-view-grid .btn {
  min-height: 44px;
  padding: 6px 4px;
}

.rom-stage--fill {
  grid-area: stage;
  margin: 0;
  border-radius: 0;
  border: none;
  background: #080a0d;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.rom-stage--fill .rom-stage-inner {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  max-height: none;
  height: 100%;
  border-radius: 0;
  border: none;
}
.rom-stage--fill .rom-protocol-results,
.rom-stage--fill .rom-metrics,
.rom-stage--fill .rom-fourview-strip {
  flex: 0 0 auto;
  max-height: 88px; /* v19.2.4 · room for 1rem pills */
  overflow: auto;
  margin: 0;
  padding: 6px 10px;
  background: rgba(12,14,18,0.92);
  border-top: 1px solid rgba(196,168,120,0.22);
}
/* v19.2.6-stable-hud · pin metrics bar so pill reflow doesn't jump stage chrome */
.rom-stage--fill .rom-metrics {
  min-height: 52px;
  max-height: 88px;
  position: relative; /* stays in flow under canvas — not landmark-tracked */
}
.rom-stage--fill .rom-fourview-strip {
  max-height: 0;
  padding: 0;
  overflow: hidden;
  border: none;
}
/* v19.2.5 · fit real card (img ~88 + cap ~28 + pad) — was 88px and cropped thumbs */
.rom-stage--fill .rom-fourview-strip:not(:empty) {
  max-height: 148px;
  padding: 8px 10px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

/* FABs · top-RIGHT — leave top-LEFT free for canvas balance info */
.rom-stage-fab--tr {
  left: auto;
  right: 12px;
  top: 12px;
  flex-direction: column;
  align-items: flex-end;
}
.rom-stage-fab--tr .btn {
  min-width: 72px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.rom-stage-fab--tr .btn.btn-gold {
  background: linear-gradient(135deg, rgba(196, 168, 120, 0.95), rgba(160, 130, 80, 0.92));
  color: #0c0e12;
  border-color: rgba(232, 212, 170, 0.85);
}

.rom-hint--compact {
  margin: 0;
  padding: 6px 12px 10px;
  font-size: 0.875rem; /* v19.2.10-tipfonts · was 11px (hidden in rom-mode) */
  flex: 0 0 auto;
  background: rgba(12,14,18,0.95);
  border-top: 1px solid var(--shell-line);
}
body.rom-mode .rom-history {
  display: none; /* secondary — don't steal screen; reopen later if needed */
}
body.rom-mode .rom-hint--compact {
  display: none; /* keep stage max */
}

/* Non-rom-mode fallback (if class missing): still usable */
.rom-view:not(.active) .rom-immersive { display: none; }

@media (max-width: 900px) {
  .rom-immersive {
    grid-template-columns: 48px minmax(0, 1fr) 80px;
  }
  .rom-ex-btn { min-height: 48px !important; font-size: 12px; }
  .rom-dock-fields { display: none; } /* keep actions + exercise visible without scroll hunt */
  .rom-dock-top { justify-content: space-between; }
}

/* v19.2.9-livevideo · 現場＋骨架 default: hide 3D avatar; video drawn on #rom-canvas */
.rom-avatar3d--hidden {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}
.rom-stage--live-skel .rom-avatar3d {
  display: none !important;
}
.rom-stage--avatar .rom-avatar3d {
  display: block;
  visibility: visible;
}
.rom-stage--avatar .rom-avatar3d.rom-avatar3d--hidden {
  display: none !important;
}
/* Toggle label stays readable in left dock */
#rom-btn-live-skel {
  min-width: 5.5rem;
  white-space: nowrap;
}



/* ===== rom-cam-uw-face-v0.3 · phone: full FOV contain (no digital zoom crop) ===== */
@media (max-width: 640px) {
  .rom-stage--fill .rom-stage-inner {
    aspect-ratio: auto;
    width: 100%;
    max-width: 100%;
  }
  .rom-canvas,
  .rom-video,
  .rom-avatar3d {
    object-fit: contain;
    object-position: center center;
  }
}

/* ===== rom-side-thumbs-v0.1 · side strip + tap-again lightbox ===== */
.rom-stage-inner {
  position: relative;
}
.rom-side-thumbs.rom-fourview-strip,
.rom-stage--fill .rom-side-thumbs.rom-fourview-strip {
  position: absolute;
  left: 6px;
  top: 56px;
  bottom: auto;
  z-index: 32;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 64px;
  max-height: calc(100% - 110px);
  max-width: 72px;
  margin: 0;
  padding: 6px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(8, 10, 14, 0.55);
  border: 1px solid rgba(196, 168, 120, 0.35);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  pointer-events: auto;
  grid-template-columns: none;
}
.rom-stage--fill .rom-side-thumbs.rom-fourview-strip:empty,
.rom-stage--fill .rom-side-thumbs.rom-fourview-strip:not(.has-captures),
.rom-side-thumbs.rom-fourview-strip[hidden] {
  display: none !important;
  max-height: 0;
  padding: 0;
  border: none;
}
.rom-side-thumbs.rom-fourview-strip.has-captures {
  display: flex !important;
}
.rom-side-thumbs .rom-fourview-card.is-empty {
  display: none;
}
.rom-side-thumbs .rom-fourview-card.has-thumb {
  flex: 0 0 auto;
  width: 56px;
  min-height: 0;
  border-radius: 8px;
  border-color: rgba(196, 168, 120, 0.55);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.rom-side-thumbs .rom-fourview-card img {
  height: 48px;
  width: 56px;
  object-fit: cover;
}
.rom-side-thumbs .rom-fourview-card .cap {
  display: none;
}
@media (max-width: 640px) {
  .rom-side-thumbs.rom-fourview-strip,
  .rom-stage--fill .rom-side-thumbs.rom-fourview-strip {
    left: 4px;
    top: 52px;
    width: 56px;
    max-width: 60px;
    padding: 4px 3px;
    gap: 4px;
    max-height: calc(100% - 96px);
  }
  .rom-side-thumbs .rom-fourview-card.has-thumb {
    width: 48px;
  }
  .rom-side-thumbs .rom-fourview-card img {
    height: 42px;
    width: 48px;
  }
  /* keep under-stage strip rules from fighting side rail */
  .rom-stage--fill .rom-side-thumbs.rom-fourview-strip:not(:empty) {
    max-height: calc(100% - 96px);
    padding: 4px 3px;
    grid-template-columns: none;
  }
}

/* Special Tests · kind badges */
.st-test-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.st-test-card__top h3 {
  margin: 0;
  flex: 1 1 auto;
  font-size: 1rem;
}
.st-kind-badge {
  display: inline-block;
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid rgba(196, 168, 120, 0.45);
  background: rgba(196, 168, 120, 0.12);
  color: #e8d5a8;
  white-space: nowrap;
}
.st-kind-badge[data-st-kind="active"] {
  border-color: rgba(120, 196, 160, 0.55);
  background: rgba(80, 160, 120, 0.18);
  color: #b8e8cc;
}
.st-kind-badge[data-st-kind="passive"] {
  border-color: rgba(120, 168, 220, 0.55);
  background: rgba(80, 130, 190, 0.18);
  color: #b8d4f0;
}
.st-kind-badge[data-st-kind="other"] {
  border-color: rgba(220, 170, 100, 0.55);
  background: rgba(180, 130, 60, 0.18);
  color: #f0d4a8;
}
.st-findings-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}


/* ===== focus-names-v0.1 · 今日焦點展開：全名＋暱稱 ===== */
.pf-identity {
  display: grid;
  gap: 4px;
  margin: 0 0 4px;
}
.pf-name-line {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  gap: 8px;
  align-items: baseline;
  margin: 0;
  line-height: 1.35;
}
.pf-name-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted, #8a8578);
  text-transform: none;
}
.pf-name-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--on-shell, #1a1814);
  word-break: break-word;
}
.pf-name-val--nick {
  font-size: 15px;
  font-weight: 650;
  color: var(--gold, #c9a227);
}
#bench-pf-region,
#bench-pf-today-region {
  margin: 2px 0 0;
  font-size: 12px;
}

/* ===== voice-note-v0.1 · 60s MediaRecorder modal + clip chips ===== */
.modal-voice-note {
  max-width: 440px;
  width: min(440px, 94vw);
}
.voice-timer-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}
.voice-timer {
  font-size: 28px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--on-shell, #1a1814);
  letter-spacing: 0.02em;
}
.voice-timer-max {
  font-size: 14px;
  color: var(--muted, #8a8578);
}
.voice-state {
  margin-left: auto;
  font-size: 12px;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.15);
  color: var(--gold, #a07d12);
}
.voice-state.is-rec {
  background: rgba(196, 64, 64, 0.16);
  color: #b33;
  animation: voice-pulse 1.1s ease-in-out infinite;
}
.voice-state.is-ready {
  background: rgba(56, 140, 90, 0.14);
  color: #2a7a48;
}
@keyframes voice-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.voice-wave {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 48px;
  margin: 0 0 14px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(26, 24, 20, 0.04);
  border: 1px solid rgba(26, 24, 20, 0.08);
}
.voice-wave .bar {
  display: block;
  width: 4px;
  height: 10px;
  border-radius: 2px;
  background: var(--gold, #c9a227);
  opacity: 0.45;
  transition: height 0.12s ease;
}
.voice-wave.is-live .bar {
  opacity: 1;
  animation: voice-bar 0.7s ease-in-out infinite alternate;
}
.voice-wave.is-live .bar:nth-child(1) { animation-delay: 0.05s; }
.voice-wave.is-live .bar:nth-child(2) { animation-delay: 0.12s; }
.voice-wave.is-live .bar:nth-child(3) { animation-delay: 0.02s; }
.voice-wave.is-live .bar:nth-child(4) { animation-delay: 0.18s; }
.voice-wave.is-live .bar:nth-child(5) { animation-delay: 0.08s; }
.voice-wave.is-live .bar:nth-child(6) { animation-delay: 0.22s; }
.voice-wave.is-live .bar:nth-child(7) { animation-delay: 0.04s; }
.voice-wave.is-live .bar:nth-child(8) { animation-delay: 0.15s; }
.voice-wave.is-live .bar:nth-child(9) { animation-delay: 0.1s; }
.voice-wave.is-live .bar:nth-child(10) { animation-delay: 0.2s; }
.voice-wave.is-live .bar:nth-child(11) { animation-delay: 0.06s; }
.voice-wave.is-live .bar:nth-child(12) { animation-delay: 0.16s; }
@keyframes voice-bar {
  from { height: 8px; }
  to { height: 34px; }
}
.voice-audio {
  width: 100%;
  margin: 0 0 12px;
}
.voice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}
.voice-actions .btn { flex: 1 1 auto; min-width: 96px; }
.voice-secure-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(196, 64, 64, 0.1);
  color: #8a3030;
  font-size: 13px;
  line-height: 1.4;
}
.voice-note-foot {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.35;
}
.handoff-voice-clip,
.pf-voice-clip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.28);
  font-size: 13px;
}
.handoff-voice-clip[hidden],
.pf-voice-clip[hidden] { display: none !important; }
.voice-clip-label { font-weight: 650; color: var(--on-shell, #1a1814); }
.voice-clip-meta { color: var(--muted, #8a8578); font-size: 12px; }
.chartopen-row--voice {
  align-items: flex-start;
}
.pf-voice-slot {
  display: grid;
  gap: 8px;
}
.pf-voice-slot .pf-voice-empty { font-size: 13px; }
.btn-voice-note.has-clip {
  border-color: rgba(42, 122, 72, 0.45);
  color: #2a7a48;
}


/* ===== secure-msg-picker-v0.1 · 今日第一日客人 list + search ===== */
.secure-msg-picker {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(26, 24, 20, 0.03);
  border: 1px solid rgba(26, 24, 20, 0.08);
}
.secure-msg-picker-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--on-shell, #1a1814);
}
.secure-msg-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(26, 24, 20, 0.14);
  font-size: 14px;
  margin-bottom: 8px;
}
.secure-msg-pick-list {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
}
.secure-msg-pick-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.secure-msg-pick-item:hover {
  border-color: rgba(201, 162, 39, 0.45);
  background: rgba(201, 162, 39, 0.08);
}
.secure-msg-pick-item.is-selected {
  border-color: rgba(201, 162, 39, 0.7);
  background: rgba(201, 162, 39, 0.16);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35);
}

/* sensor-layout-v0.2 · selected = bright; unselected = dark gray */
.secure-msg-pick-item.is-dimmed {
  opacity: 1;
  filter: none;
  background: #141416 !important;
  border-color: #2a2a30 !important;
  color: #5c5c66 !important;
  box-shadow: none !important;
}
.secure-msg-pick-item.is-dimmed .secure-msg-pick-name,
.secure-msg-pick-item.is-dimmed .secure-msg-pick-meta,
.secure-msg-pick-item.is-dimmed .secure-msg-pick-sub {
  color: #5c5c66 !important;
}
.secure-msg-pick-item.is-dimmed .secure-msg-pick-av {
  background: #2a2a30 !important;
  color: #6a6a74 !important;
}
.secure-msg-pick-item.is-dimmed:hover {
  background: #1c1c20 !important;
  border-color: #3a3a42 !important;
  color: #7a7a84 !important;
}
.secure-msg-pick-list.has-selection .secure-msg-pick-item.is-selected {
  opacity: 1;
  filter: none;
  position: relative;
  z-index: 1;
  background: #e8c458 !important;
  border-color: #f0d070 !important;
  box-shadow: 0 0 0 3px rgba(232, 196, 88, 0.55);
  color: #1a1814 !important;
  font-weight: 700;
}
.secure-msg-pick-list.has-selection .secure-msg-pick-item.is-selected .secure-msg-pick-name {
  color: #1a1814 !important;
  font-weight: 800;
}
.secure-msg-pick-list.has-selection .secure-msg-pick-item.is-selected .secure-msg-pick-meta,
.secure-msg-pick-list.has-selection .secure-msg-pick-item.is-selected .secure-msg-pick-sub {
  color: #3a3428 !important;
}
.secure-msg-pick-list.has-selection .secure-msg-pick-item.is-selected .secure-msg-pick-av {
  background: rgba(26, 24, 20, 0.85) !important;
  color: #e8d4aa !important;
}


.secure-msg-pick-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(26, 24, 20, 0.08);
  font-weight: 700;
  font-size: 13px;
}
.secure-msg-pick-main { min-width: 0; }
.secure-msg-pick-name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  writing-mode: horizontal-tb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.secure-msg-pick-meta {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted, #8a8578);
}
.secure-msg-pick-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(42, 122, 72, 0.12);
  color: #2a7a48;
  white-space: nowrap;
}
.secure-msg-picked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 13px;
}
.secure-msg-pick-empty {
  margin: 6px 0;
  font-size: 13px;
  color: var(--muted, #8a8578);
}

/* ===== batch-ux-v0.5 · 今日狀態圖＋字／今日家課／摘要揀客 ===== */
.feel-row--icons .feel-chip,
.mood-row--icons .mood-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 58px;
  padding: 10px 12px;
  line-height: 1.15;
}
.feel-ico {
  font-size: 1.35rem;
  line-height: 1;
}
.feel-lbl {
  font-size: 12px;
  font-weight: 600;
}
.mood-row--icons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mood-row--icons .mood-chip {
  border-radius: var(--radius-pill, 999px);
}
.hep-progress-board {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(26, 24, 20, 0.08);
  background: rgba(26, 24, 20, 0.03);
}
.hep-progress-h,
.hep-assign-h {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}
.hep-assign-h { margin-top: 8px; }
.hep-progress-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.hep-progress-item {
  /* hep-name-layout-v0.1 · name full width, meta below, tag right — no vertical char wrap */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name tag"
    "meta tag";
  column-gap: 10px;
  row-gap: 4px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(26, 24, 20, 0.06);
  font-size: 13px;
}
.hep-progress-name {
  grid-area: name;
  font-weight: 700;
  writing-mode: horizontal-tb;
  direction: ltr;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  line-height: 1.3;
}
.hep-progress-meta {
  grid-area: meta;
  color: var(--muted, #8a8578);
  font-size: 12px;
  min-width: 0;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
.hep-progress-item > .tag {
  grid-area: tag;
  align-self: center;
  flex-shrink: 0;
  white-space: nowrap;
}
.notes-picker { margin-bottom: 14px; }
#cpane-homework { display: none !important; }


/* ===== batch-ux-v0.5 · white-card contrast / preappt lock / admin+ / feedback ===== */
.secure-msg-pick-item,
.hep-progress-item {
  color: #1a1814 !important;
  background: #fff;
}
.secure-msg-pick-item .secure-msg-pick-name,
.hep-progress-item .hep-progress-name {
  color: #0c0e12 !important;
}
.secure-msg-pick-item .secure-msg-pick-meta,
.hep-progress-item .hep-progress-meta {
  color: #5c564c !important;
}
.secure-msg-pick-av {
  color: #1a1814;
  background: rgba(26, 24, 20, 0.08);
}
.secure-msg-search {
  color: #1a1814;
  background: #fff;
}
.secure-msg-search::placeholder {
  color: #6b6560;
  opacity: 1;
}

.revisit-banner {
  position: relative;
  overflow: hidden;
}
.revisit-banner.is-locked {
  opacity: 0.55;
  filter: grayscale(0.55);
}
.revisit-banner.is-locked .btn {
  pointer-events: none;
  opacity: 0.5;
}
.revisit-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(12, 14, 18, 0.55);
  text-align: center;
  pointer-events: none;
  z-index: 2;
}
.revisit-lock-ico { font-size: 22px; line-height: 1; }
.revisit-lock-text {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #f4f1ea;
  letter-spacing: 0.02em;
}
.tap-card.is-locked,
.client-tab.is-locked {
  opacity: 0.45;
  filter: grayscale(0.4);
}
.revisit-lock-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed rgba(201, 162, 39, 0.35);
  background: rgba(12, 14, 18, 0.35);
  margin-bottom: 12px;
}
.revisit-lock-pane .revisit-lock-text {
  color: var(--on-shell, #f4f1ea);
  font-size: 16px;
}

/* boss-dot-left-v0.1 · scrollable gate + fixed bottom-LEFT boss-dot (away from 進入) */
#modal-staff-gate.overlay.open {
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 12px 12px 28px;
}
#modal-staff-gate .staff-gate-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 48px);
  max-height: calc(100vh - 48px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 28px;
}
#modal-staff-gate .adminplus-dot,
.adminplus-dot {
  position: absolute;
  left: 14px;
  right: auto;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0.55;
  z-index: 5;
  /* tiny visible speck via ::after; large hit target — bottom-LEFT of overlay */
}
#modal-staff-gate .adminplus-dot::after,
.adminplus-dot::after {
  content: "";
  position: absolute;
  left: 6px;
  right: auto;
  bottom: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(244, 241, 234, 0.28);
  pointer-events: none;
}
#modal-staff-gate .adminplus-dot:hover,
#modal-staff-gate .adminplus-dot:focus,
.adminplus-dot:hover,
.adminplus-dot:focus {
  opacity: 0.95;
  outline: none;
}
#modal-staff-gate .adminplus-dot:hover::after,
#modal-staff-gate .adminplus-dot:focus::after,
.adminplus-dot:hover::after,
.adminplus-dot:focus::after {
  background: rgba(201, 162, 39, 0.55);
}
.modal-adminplus-stealth {
  max-width: 220px;
  padding: 18px 16px 14px;
  text-align: center;
}
.adminplus-stealth-pin {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: #0c0e12;
  color: #f4f1ea;
  font-size: 16px;
  letter-spacing: 0.2em;
  text-align: center;
}
.adminplus-stealth-pin.is-shake {
  animation: adminplus-shake 0.35s ease;
}
@keyframes adminplus-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.voice-seek-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 10px 0 6px;
  font-size: 12px;
}
.voice-seek-lab { color: var(--on-shell-muted, #a8b0bc); }
.voice-seek-time { font-variant-numeric: tabular-nums; min-width: 2.5em; }
.voice-transcript-wrap { margin: 8px 0; }
.voice-transcript-wrap textarea {
  width: 100%;
  margin-top: 4px;
  border-radius: 8px;
  padding: 8px;
  font: inherit;
}

.client-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-ov-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-ov-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  background: rgba(12, 14, 18, 0.35);
  text-align: center;
}
.admin-ov-val {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold, #c9a227);
}
.admin-ov-lab {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--on-shell-muted, #a8b0bc);
}
.finance-amount-ro {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.owner-only-note {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #8a6a12;
  background: rgba(201, 162, 39, 0.12);
  border: 1px dashed rgba(201, 162, 39, 0.35);
}
.is-owner-only-locked {
  opacity: 0.72;
}
#admin-role-badge.is-boss {
  background: rgba(201, 162, 39, 0.25);
}


/* ===== special-test-pt-v0.1 · assess patient-first gate ===== */
.st-patient-picker,
.assess-picker { margin-bottom: 14px; }
.st-need-patient,
.rom-need-patient {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 48px;
  margin: 10px 0 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px dashed rgba(232, 212, 170, 0.45);
  background: rgba(12, 14, 18, 0.55);
  color: #e8d4aa;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 15px;
}
.st-need-patient[hidden],
.rom-need-patient[hidden] { display: none !important; }
.st-flow.is-locked {
  position: relative;
  opacity: 0.45;
  filter: grayscale(0.35);
  pointer-events: none;
  user-select: none;
}
.st-flow.is-locked::after {
  content: "先揀客人";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: rgba(232, 212, 170, 0.95);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  z-index: 2;
}
#view-rom.rom-no-patient .rom-stage,
#view-rom.rom-no-patient .rom-phone-dock,
#view-rom.rom-no-patient .rom-dock-actions .btn-gold,
#view-rom.rom-no-patient #rom-btn-start,
#view-rom.rom-no-patient #rom-btn-save-session,
#view-rom.rom-no-patient #rom-btn-save-angle,
#view-rom.rom-no-patient #rom-fab-save,
#view-rom.rom-no-patient #rom-btn-capture-view {
  opacity: 0.55;
}
#view-rom.rom-no-patient .rom-stage,
#view-rom.rom-no-patient .rom-phone-dock,
#view-rom.rom-no-patient #rom-btn-start,
#view-rom.rom-no-patient #rom-btn-save-session,
#view-rom.rom-no-patient #rom-btn-save-angle,
#view-rom.rom-no-patient #rom-fab-save,
#view-rom.rom-no-patient #rom-btn-capture-view,
#view-rom.rom-no-patient #rom-btn-export {
  pointer-events: none;
}
#view-rom.rom-no-patient .rom-client-field {
  outline: 2px solid rgba(232, 212, 170, 0.65);
  outline-offset: 2px;
  border-radius: 8px;
}
.assess-cta-patient {
  margin: 8px 0 0;
  font-size: 13px;
  color: rgba(232, 212, 170, 0.85);
}
.assess-cta-patient strong { color: #e8d4aa; }
.rom-client-field select:invalid,
.rom-client-field select option[value=""] {
  color: #8a8578;
}
/* assess-entry-v0.2 · entry patient-first; inner flows inherit readout only */
#view-rom.rom-no-patient .rom-client-readout {
  outline: 2px solid rgba(232, 212, 170, 0.65);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ===== hep-mobile-v0.1 · mobile vs desktop HEP / attach / goal tip ===== */
.hep-card .btn-video-note { flex-shrink: 0; }

@media (min-width: 641px) {
  .hep-card {
    grid-template-columns: 56px minmax(0, 1fr) auto;
  }
  .hep-actions {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .hep-card {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "thumb body"
      "actions actions";
    column-gap: 12px;
    row-gap: 10px;
    padding: 16px 0;
  }
  .hep-thumb {
    grid-area: thumb;
    width: 48px;
    height: 48px;
  }
  .hep-body { grid-area: body; }
  .hep-actions {
    grid-area: actions;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding-top: 2px;
  }
  .check-done {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    font-size: 18px;
    border-width: 1.5px;
  }
  .hep-card .btn-video-note {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 13px;
  }
  .hep-title,
  .hep-body .row-title {
    font-size: 15px;
  }
}

.hep-attach-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.hep-photo-count {
  font-size: 12px;
  color: var(--on-shell-muted);
  letter-spacing: 0.04em;
}
.hep-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.hep-photo-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--shell-line);
  background: var(--shell-mid);
}
.hep-photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hep-photo-slot .hep-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.hep-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.hep-link-input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--shell-line);
  background: var(--shell-mid);
  color: var(--on-shell);
  font-size: 14px;
}
.hep-link-preview {
  margin: 8px 0 0;
  font-size: 13px;
  word-break: break-all;
  color: var(--gold-bright);
}
.hep-link-preview a { color: inherit; }
@media (max-width: 640px) {
  .hep-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hep-photo-slot .hep-photo-remove {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }
  .hep-link-input { min-height: 44px; }
  #btn-hep-photo,
  #btn-hep-link,
  #btn-hep-attach-save { min-height: 44px; }
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.therapist-goal-tip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(229, 57, 53, 0.45);
  background: rgba(229, 57, 53, 0.12);
  color: #1a1814;
}
.therapist-goal-tip[hidden] { display: none !important; }
.therapist-goal-tip.is-unread {
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.25);
}
.therapist-goal-tip-main {
  flex: 1 1 200px;
  min-width: 0;
}
.therapist-goal-tip-main strong {
  display: block;
  color: #c62828;
  font-size: 14px;
  margin-bottom: 4px;
}
.therapist-goal-tip-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #1a1814;
}
.therapist-goal-tip-hw {
  margin: 6px 0 0;
  font-size: 12px;
  color: #5c564c;
}
.therapist-goal-tip.is-acked {
  border-color: rgba(74, 143, 106, 0.4);
  background: rgba(74, 143, 106, 0.1);
  box-shadow: none;
}
.therapist-goal-tip.is-acked .therapist-goal-tip-main strong {
  color: #2e6b48;
}
.therapist-tab[data-ttab="hepassign"].is-unread {
  font-weight: 700;
}


/* assess-modes-v0.1 · Trace 外接傳感器 · gold chrome (≠ blue camera, ≠ purple special) */
.trace-sensor-view.is-sensor-chrome .trace-sensor-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(196, 168, 120, 0.22), transparent 65%);
  border-bottom: 1px solid rgba(196, 168, 120, 0.42);
  margin: -4px -4px 10px;
  padding: 10px 12px;
  border-radius: 10px;
}
.ts-chrome-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.ts-chrome-titles { flex: 1 1 auto; min-width: 0; }
.ts-chrome-titles h1 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--gold-bright, #e8d5a8);
}
.ts-chrome-kicker {
  margin: 2px 0 0;
  font-size: 11px;
  color: rgba(232, 212, 170, 0.75);
}
.ts-flow.is-locked { opacity: 0.55; pointer-events: none; }
.ts-connect-card {
  border: 1px solid rgba(196, 168, 120, 0.35);
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(40, 34, 22, 0.55), rgba(18, 16, 12, 0.4));
  margin-bottom: 14px;
}
.ts-connect-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ts-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.25);
  flex-shrink: 0;
}
.ts-status-dot[data-state="on"] {
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.28);
}
.ts-status-dot[data-state="partial"] {
  background: #e8c458;
  box-shadow: 0 0 0 3px rgba(232, 196, 88, 0.3);
}
.ts-connect-main { flex: 1 1 auto; min-width: 0; }
.ts-connect-title { margin: 0; font-weight: 700; color: #e8d4aa; font-size: 14px; }
.ts-connect-meta { margin: 2px 0 0; font-size: 11px; color: rgba(232, 212, 170, 0.7); }
.ts-connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
.ts-mini-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: rgba(232, 212, 170, 0.8);
  min-width: 140px;
}
.ts-mini-field.select,
.ts-mini-field select,
.ts-mini-field input {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(196, 168, 120, 0.35);
  background: rgba(12, 14, 18, 0.55);
  color: #e8d4aa;
  font: inherit;
}
.ts-mini-grow { flex: 1 1 180px; }
.ts-mini-field #ts-bridge-url {
  min-width: 240px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.ts-attach-row { margin: 0 0 12px; }
.ts-lead { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: rgba(232, 212, 170, 0.9); }
.ts-attach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ts-chip {
  border: 1px solid rgba(196, 168, 120, 0.35);
  background: rgba(12, 14, 18, 0.4);
  color: #e8d4aa;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ts-chip.is-on {
  background: rgba(196, 168, 120, 0.28);
  border-color: rgba(232, 212, 170, 0.7);
  box-shadow: inset 0 0 0 1px rgba(232, 212, 170, 0.25);
  font-weight: 700;
}
.ts-dials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
@media (max-width: 640px) {
  .ts-dials { grid-template-columns: 1fr; }
}
.ts-dial {
  border: 1px solid rgba(196, 168, 120, 0.28);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  background: rgba(20, 18, 14, 0.55);
}
.ts-dial-label { margin: 0 0 8px; font-size: 12px; color: rgba(232, 212, 170, 0.85); }
.ts-dial-ring {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 8px;
  border-radius: 50%;
  border: 2px solid rgba(196, 168, 120, 0.4);
  background:
    radial-gradient(circle at center, rgba(12,14,18,0.9) 0 28%, transparent 29%),
    conic-gradient(from 0deg, rgba(196,168,120,0.08), rgba(196,168,120,0.22), rgba(196,168,120,0.08));
}
.ts-dial-arm {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 36px;
  margin-left: -1px;
  margin-top: -36px;
  background: #e8d4aa;
  transform-origin: bottom center;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(232, 212, 170, 0.45);
}
.ts-dial-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #e8d4aa;
}
.ts-dial-val { margin: 0; font-size: 22px; color: #e8d4aa; }
.ts-unit { font-size: 13px; opacity: 0.75; margin-left: 2px; }
.ts-capture-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 10px;
}
.ts-captures {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.ts-capture-item {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(196, 168, 120, 0.25);
  background: rgba(196, 168, 120, 0.08);
  font-size: 12px;
  color: rgba(232, 212, 170, 0.92);
}
.cta-btn-trace {
  border-color: rgba(196, 168, 120, 0.65) !important;
}



/* sensor-layout-v0.2 · site-wide: MUCH higher contrast */
.focus-card.is-dimmed,
.list-row.is-dimmed,
.hep-progress-item.is-dimmed {
  opacity: 1;
  filter: none;
  background: #141416 !important;
  border-color: #2a2a30 !important;
  color: #5c5c66 !important;
  box-shadow: none !important;
}
.focus-card.is-dimmed:hover,
.list-row.is-dimmed:hover,
.hep-progress-item.is-dimmed:hover {
  background: #1c1c20 !important;
  border-color: #3a3a42 !important;
  color: #7a7a84 !important;
}
.focus-card.is-dimmed .focus-name,
.focus-card.is-dimmed .focus-meta,
.focus-card.is-dimmed .pf-name,
.list-row.is-dimmed .list-name,
.list-row.is-dimmed .list-meta,
.hep-progress-item.is-dimmed .hep-progress-name,
.hep-progress-item.is-dimmed .hep-progress-meta,
.hep-progress-item.is-dimmed strong,
.hep-progress-item.is-dimmed span {
  color: #5c5c66 !important;
}
#bench-focus-list.has-selection .focus-card.is-selected,
#bench-today-list.has-selection .list-row.is-pf-selected,
.hep-progress-list.has-selection .hep-progress-item.is-selected {
  opacity: 1;
  filter: none;
  background: #e8c458 !important;
  border-color: #f0d070 !important;
  box-shadow: 0 0 0 3px rgba(232, 196, 88, 0.55);
  color: #1a1814 !important;
}
#bench-focus-list.has-selection .focus-card.is-selected .focus-name,
#bench-focus-list.has-selection .focus-card.is-selected .pf-name,
#bench-today-list.has-selection .list-row.is-pf-selected .list-name,
.hep-progress-list.has-selection .hep-progress-item.is-selected .hep-progress-name,
.hep-progress-list.has-selection .hep-progress-item.is-selected strong {
  color: #1a1814 !important;
  font-weight: 800;
}
.hep-progress-item {
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.hep-progress-item.is-selected {
  background: #e8c458;
  outline: 3px solid rgba(232, 196, 88, 0.7);
  color: #1a1814;
}
.hep-assign-picker { margin: 0 0 12px; }
.hep-assign-picker .secure-msg-pick-list { max-height: 200px; }


/* ========== sensor-layout-v0.2 · Trace region / side / sensors / stability ========== */
.ts-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.ts-mode-btn {
  border: 1px solid rgba(196, 168, 120, 0.35);
  background: rgba(12, 14, 18, 0.4);
  color: #e8d4aa;
  border-radius: 10px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.ts-mode-btn.is-on {
  background: rgba(196, 168, 120, 0.32);
  border-color: rgba(232, 212, 170, 0.85);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(232, 212, 170, 0.3);
}
.ts-region-groups { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; }
.ts-region-group {
  border: 1px solid rgba(196, 168, 120, 0.22);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(18, 16, 12, 0.35);
}
.ts-region-group-title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(232, 212, 170, 0.72);
  text-transform: none;
}
.ts-side-row,
.ts-sensor-count-row,
.ts-stab-angles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  align-items: center;
}
.ts-side-label,
.ts-sensor-count-label,
.ts-stab-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(232, 212, 170, 0.9);
  margin-right: 4px;
  min-width: 4.5em;
}
.ts-side-chip,
.ts-count-chip,
.ts-stab-chip {
  border: 1px solid rgba(196, 168, 120, 0.35);
  background: rgba(12, 14, 18, 0.4);
  color: #e8d4aa;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ts-side-chip.is-on,
.ts-count-chip.is-on,
.ts-stab-chip.is-on {
  background: rgba(196, 168, 120, 0.28);
  border-color: rgba(232, 212, 170, 0.7);
  box-shadow: inset 0 0 0 1px rgba(232, 212, 170, 0.25);
  font-weight: 700;
}
.ts-slot-status {
  margin-top: 10px;
}
.ts-slot-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: rgba(232, 212, 170, 0.72);
}
.ts-sensor-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 0;
}
.ts-sensor-slot {
  border: 1px dashed rgba(196, 168, 120, 0.4);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(20, 18, 14, 0.45);
  font-size: 12px;
  color: rgba(232, 212, 170, 0.88);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ts-sensor-slot.is-on {
  border-style: solid;
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(30, 48, 36, 0.35);
}
.ts-sensor-slot strong { color: #e8d4aa; font-weight: 700; }
.ts-sensor-slot.is-off {
  opacity: 0.4;
  border-style: solid;
  border-color: #3a3a40;
}
.ts-slot-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ts-slot-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6b7280;
  flex-shrink: 0;
}
.ts-slot-dot[data-state="on"] {
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25);
}
.ts-slot-reconn {
  flex-shrink: 0;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
}
.ts-stab-panel {
  border: 1px solid rgba(196, 168, 120, 0.28);
  border-radius: 14px;
  padding: 12px;
  margin: 0 0 14px;
  background: rgba(20, 18, 14, 0.5);
}
.ts-stab-panel[hidden] { display: none !important; }
.ts-stab-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 8px;
}
.ts-stab-metric {
  min-width: 90px;
}
.ts-stab-metric .quiet { font-size: 11px; display: block; margin-bottom: 2px; }
.ts-stab-metric strong { font-size: 20px; color: #e8d4aa; }
.ts-dials.is-stability-mode .ts-dial[data-axis="yaw"] { opacity: 0.55; }
.ts-chip[data-axial="1"] { /* axial regions */ }


/* ========== sensor-layout-v0.2 · body map + S1–S4 + mobile/desktop ========== */
.ts-map-layout {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  gap: 14px 16px;
  margin: 0 0 14px;
  align-items: start;
}
.ts-body-wrap {
  position: sticky;
  top: 8px;
  text-align: center;
}
.ts-body-svg {
  width: 100%;
  max-width: 168px;
  height: auto;
  display: block;
  margin: 0 auto 8px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ts-body-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  min-height: 28px;
}
.ts-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(12, 14, 18, 0.55);
  border: 1px solid rgba(196, 168, 120, 0.3);
  color: #e8d4aa;
}
.ts-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ts-body-marker {
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45));
}
.ts-body-marker text {
  font-size: 9px;
  font-weight: 800;
  fill: #1a1814;
  pointer-events: none;
}
.ts-body-hotspot {
  fill: transparent;
  stroke: transparent;
  cursor: pointer;
}
.ts-body-hotspot:focus {
  outline: none;
  stroke: rgba(232, 212, 170, 0.7);
  stroke-width: 2;
}
.ts-assign-col { min-width: 0; }
.ts-sensor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.ts-sensor-tab {
  --s-color: #e8c458;
  min-width: 52px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--s-color) 55%, transparent);
  background: rgba(12, 14, 18, 0.45);
  color: #e8d4aa;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: grab;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ts-sensor-tab::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--s-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--s-color) 35%, transparent);
}
.ts-sensor-tab.is-on {
  background: color-mix(in srgb, var(--s-color) 28%, rgba(12,14,18,0.5));
  border-color: var(--s-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--s-color) 35%, transparent);
}
.ts-sensor-tab.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}
.ts-sensor-tab[data-sid="1"] { --s-color: #e8c458; }
.ts-sensor-tab[data-sid="2"] { --s-color: #5b9fd4; }
.ts-sensor-tab[data-sid="3"] { --s-color: #6bcf8e; }
.ts-sensor-tab[data-sid="4"] { --s-color: #d48ad4; }
.ts-sensor-tab.is-off { display: none; }

.ts-placement-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ts-placement-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(196, 168, 120, 0.28);
  background: rgba(20, 18, 14, 0.5);
  font-size: 13px;
  color: #e8d4aa;
  min-height: 40px;
}
.ts-placement-item .ts-pl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ts-placement-item .ts-pl-sid {
  font-weight: 800;
  min-width: 1.6em;
}
.ts-placement-item .ts-pl-clear {
  margin-left: auto;
  border: none;
  background: transparent;
  color: rgba(232, 212, 170, 0.65);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  touch-action: manipulation;
}
.ts-placement-item .ts-pl-clear:hover {
  color: #e8d4aa;
  background: rgba(255,255,255,0.06);
}
.ts-placement-empty {
  font-size: 12px;
  color: rgba(232, 212, 170, 0.55);
  padding: 6px 2px;
}

/* Large taps on phone */
.ts-mode-btn {
  min-height: 44px;
  flex: 1 1 140px;
  touch-action: manipulation;
}
.ts-chip,
.ts-side-chip,
.ts-count-chip,
.ts-stab-chip {
  min-height: 40px;
  min-width: 44px;
  padding: 8px 14px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ts-body-drop-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: rgba(232, 212, 170, 0.55);
}

@media (max-width: 720px) {
  .ts-map-layout {
    grid-template-columns: 1fr;
  }
  .ts-body-wrap {
    position: static;
    display: grid;
    grid-template-columns: minmax(120px, 150px) 1fr;
    gap: 10px;
    align-items: center;
    text-align: left;
  }
  .ts-body-wrap > .ts-lead { grid-column: 1 / -1; }
  .ts-body-svg { max-width: 140px; }
  .ts-body-legend { justify-content: flex-start; }
  .ts-sensor-tab {
    min-width: 64px;
    min-height: 48px;
    font-size: 15px;
  }
  .ts-chip,
  .ts-side-chip,
  .ts-count-chip,
  .ts-stab-chip {
    min-height: 44px;
    font-size: 13px;
  }
}

@media (min-width: 721px) {
  .ts-sensor-tab { cursor: grab; }
  .ts-body-svg.is-drop-target {
    outline: 2px dashed rgba(232, 196, 88, 0.7);
    outline-offset: 4px;
    border-radius: 8px;
  }
}

@media (pointer: coarse) {
  .ts-sensor-tab { cursor: pointer; }
  .ts-chip,
  .ts-side-chip,
  .ts-count-chip,
  .ts-stab-chip,
  .ts-mode-btn {
    min-height: 48px;
  }
}


/* ========== sensor-layout-v0.2 · cleaner minimal placement UI ========== */
.ts-sensor-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 10px;
}
.ts-sensor-tab {
  min-width: 0;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 13px;
  gap: 5px;
}
.ts-sensor-tab::before {
  width: 8px;
  height: 8px;
}
.ts-region-groups {
  gap: 8px;
  margin: 0 0 10px;
}
.ts-region-group {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
}
.ts-region-group + .ts-region-group {
  padding-top: 8px;
  border-top: 1px solid rgba(196, 168, 120, 0.14);
}
.ts-region-group-title {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(232, 212, 170, 0.55);
  text-transform: uppercase;
}
.ts-attach-chips {
  gap: 5px;
}
.ts-chip {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
  background: transparent;
  border-color: rgba(196, 168, 120, 0.28);
  min-height: 34px;
}
.ts-chip.is-on {
  background: #e8c458;
  border-color: #f0d070;
  color: #1a1814;
  box-shadow: none;
  font-weight: 800;
}
.ts-side-row {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
  margin: 0 0 10px;
}
.ts-side-row:has(#ts-side-mid:not([hidden])) {
  grid-template-columns: auto repeat(4, minmax(0, 1fr));
}
.ts-side-label {
  min-width: 0;
  margin-right: 0;
  font-size: 11px;
  color: rgba(232, 212, 170, 0.65);
}
.ts-side-chip {
  width: 100%;
  justify-self: stretch;
  text-align: center;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 8px;
  background: transparent;
}
.ts-side-chip.is-on,
.ts-count-chip.is-on,
.ts-stab-chip.is-on {
  background: #e8c458;
  border-color: #f0d070;
  color: #1a1814;
  box-shadow: none;
  font-weight: 800;
}
.ts-lead {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(232, 212, 170, 0.7);
}
.ts-placement-list {
  gap: 4px;
  margin: 0 0 10px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(196, 168, 120, 0.18);
  background: rgba(12, 14, 18, 0.35);
}
.ts-placement-item {
  padding: 6px 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  min-height: 36px;
  font-size: 12px;
}
.ts-placement-item + .ts-placement-item {
  border-top: 1px solid rgba(196, 168, 120, 0.12);
}
.ts-placement-item .ts-pl-clear {
  min-width: 32px;
  min-height: 32px;
  font-size: 16px;
  opacity: 0.7;
}
.ts-sensor-count-row {
  margin: 0 0 8px;
  gap: 5px;
}
.ts-count-chip {
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 8px;
  background: transparent;
}
.ts-stab-duration-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}
.ts-stab-duration-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(232, 212, 170, 0.9);
  min-width: 4.5em;
}
.ts-stab-duration-input {
  width: 72px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(196, 168, 120, 0.4);
  background: rgba(12, 14, 18, 0.65);
  color: #e8d4aa;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}
.ts-stab-duration-unit {
  font-size: 12px;
  color: rgba(232, 212, 170, 0.7);
}
.ts-stab-duration-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 11px;
  color: rgba(232, 212, 170, 0.5);
}
.ts-stab-timer {
  font-size: 22px;
  font-weight: 800;
  color: #e8c458;
  font-variant-numeric: tabular-nums;
  min-width: 3.2em;
}
@media (max-width: 720px) {
  .ts-sensor-tabs { gap: 5px; }
  .ts-sensor-tab {
    min-height: 44px;
    font-size: 14px;
    padding: 8px 6px;
  }
  .ts-chip,
  .ts-side-chip,
  .ts-count-chip {
    min-height: 40px;
  }
  .ts-side-row {
    grid-template-columns: auto repeat(3, minmax(0, 1fr));
  }
}
@media (pointer: coarse) {
  .ts-chip,
  .ts-side-chip,
  .ts-count-chip {
    min-height: 44px;
  }
  .ts-stab-duration-input { min-height: 44px; }
}


/* ========== sensor-ux-v0.3 · multi-S RPY · 示意貼位 · free joints · 歸零@開始 · edge-scroll ========== */
.ts-schematic-note {
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0;
  color: rgba(232, 212, 170, 0.5);
  text-transform: none;
}
.ts-legend-note {
  flex: 1 1 100%;
  font-size: 10px;
  color: rgba(232, 212, 170, 0.5);
  text-align: center;
}
.ts-joint-node { cursor: pointer; }
.ts-joint-node .ts-joint-hit { pointer-events: all; }
.ts-joint-node.is-on .ts-joint-dot {
  filter: drop-shadow(0 0 3px rgba(232, 196, 88, 0.85));
}
.ts-sensor-tab.is-dim:not(.is-off) {
  opacity: 0.42;
  filter: saturate(0.65);
  border-color: rgba(196, 168, 120, 0.22);
  background: rgba(12, 14, 18, 0.28);
}
.ts-sensor-tab.is-on {
  opacity: 1;
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--s-color) 45%, transparent),
    0 4px 12px rgba(0, 0, 0, 0.35);
}
.ts-placement-item.is-active {
  background: rgba(232, 196, 88, 0.12);
  outline: 1px solid rgba(232, 196, 88, 0.35);
}
.ts-start-zero-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ts-ai-tip {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(196, 168, 120, 0.35);
  background: rgba(12, 14, 18, 0.35);
  font-size: 12px;
  color: rgba(232, 212, 170, 0.72);
}
.ts-ai-tip[hidden] { display: none !important; }

/* Per-sensor RPY strips */
.ts-rpy-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
}
.ts-rpy-card {
  --s-color: #e8c458;
  border: 1px solid color-mix(in srgb, var(--s-color) 45%, transparent);
  border-left: 4px solid var(--s-color);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(14, 16, 20, 0.55);
}
.ts-rpy-card.is-active {
  background: color-mix(in srgb, var(--s-color) 12%, rgba(14, 16, 20, 0.55));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--s-color) 25%, transparent);
}
.ts-rpy-card-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.ts-rpy-sid {
  font-weight: 800;
  color: var(--s-color);
  font-size: 14px;
  min-width: 1.8em;
}
.ts-rpy-place {
  font-size: 12px;
  color: rgba(232, 212, 170, 0.78);
}
.ts-rpy-axes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ts-rpy-axis {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(12, 14, 18, 0.45);
  border: 1px solid rgba(196, 168, 120, 0.18);
}
.ts-rpy-axis-lab {
  font-size: 11px;
  font-weight: 700;
  color: rgba(232, 212, 170, 0.7);
  flex: 1 1 100%;
}
.ts-rpy-axis strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  color: #e8d4aa;
}
.ts-rpy-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ts-rpy-tabs::-webkit-scrollbar { display: none; }
.ts-rpy-tab {
  --s-color: #e8c458;
  flex: 0 0 auto;
  min-height: 36px;
  min-width: 48px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--s-color) 55%, transparent);
  background: rgba(12, 14, 18, 0.4);
  color: #e8d4aa;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.ts-rpy-tab.is-on {
  background: color-mix(in srgb, var(--s-color) 28%, rgba(12,14,18,0.5));
  border-color: var(--s-color);
  opacity: 1;
}
.ts-rpy-tab.is-dim { opacity: 0.42; }

/* Edge-aware horizontal rows — iOS-friendly pan (ios-swipe-mixed-v0.1) */
.pw-edge-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  /* No scroll-behavior:smooth here — fights finger momentum on iOS Safari */
}
@media (hover: hover) and (pointer: fine) {
  .pw-edge-scroll {
    scroll-behavior: smooth;
  }
}
.therapist-tabs.pw-edge-scroll,
.client-tabs.pw-edge-scroll,
.therapist-pick.pw-edge-scroll {
  flex-wrap: nowrap !important;
  touch-action: pan-x;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.therapist-tabs.pw-edge-scroll .therapist-tab,
.client-tabs.pw-edge-scroll .client-tab {
  flex: 0 0 auto;
  touch-action: manipulation;
}
/* Peek: trailing pad so next tab label clips under the right fade */
.therapist-tabs.pw-edge-scroll,
.client-tabs.pw-edge-scroll {
  padding-right: 28px;
  scroll-padding-inline: 12px;
}
.ts-attach-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ts-attach-chips.pw-edge-scroll,
.ts-stab-angles-row.pw-edge-scroll {
  flex-wrap: nowrap !important;
}


/* ===== ios-swipe-mixed-v0.1 · tab discoverability (fade + chevrons + dots) ===== */
.pw-tab-scroll-wrap {
  position: relative;
  margin-bottom: 16px;
}
.pw-tab-scroll-wrap > .client-tabs,
.pw-tab-scroll-wrap > .therapist-tabs,
.pw-tab-scroll-wrap > .therapist-pick {
  margin-bottom: 0;
}
.pw-tab-scroll-fade {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 36px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.pw-tab-scroll-fade.is-on {
  opacity: 1;
}
.pw-tab-scroll-fade--left {
  left: 0;
  border-radius: var(--radius-sm, 10px) 0 0 var(--radius-sm, 10px);
  background: linear-gradient(
    90deg,
    var(--shell, #141820) 8%,
    color-mix(in srgb, var(--shell, #141820) 55%, transparent) 55%,
    transparent 100%
  );
}
.pw-tab-scroll-fade--right {
  right: 0;
  border-radius: 0 var(--radius-sm, 10px) var(--radius-sm, 10px) 0;
  background: linear-gradient(
    270deg,
    var(--shell, #141820) 8%,
    color-mix(in srgb, var(--shell, #141820) 55%, transparent) 55%,
    transparent 100%
  );
}
.pw-tab-scroll-chev {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgba(232, 212, 170, 0.45);
  background: color-mix(in srgb, var(--shell-elev, #1c2230) 88%, rgba(201, 162, 39, 0.25));
  color: #e8d4aa;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: opacity 0.18s ease, transform 0.15s ease;
}
.pw-tab-scroll-chev.is-on {
  opacity: 1;
  pointer-events: auto;
}
.pw-tab-scroll-chev:active {
  transform: translateY(-50%) scale(0.94);
}
.pw-tab-scroll-chev--left { left: 2px; }
.pw-tab-scroll-chev--right { right: 2px; }
.pw-tab-scroll-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin: 6px 0 0;
  min-height: 10px;
  pointer-events: none;
}
.pw-tab-scroll-dots[hidden] { display: none !important; }
.pw-tab-scroll-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(154, 163, 178, 0.45);
  transition: background 0.15s ease, transform 0.15s ease;
}
.pw-tab-scroll-dot.is-on {
  background: #c9a227;
  transform: scale(1.25);
}
.pw-tab-scroll-hint {
  margin: 4px 0 0;
  padding: 0 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--on-shell-muted, #9aa3b2);
  text-align: center;
}
.pw-tab-scroll-hint[hidden] { display: none !important; }
@media (max-width: 720px) {
  .pw-tab-scroll-chev {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .pw-tab-scroll-fade { width: 42px; }
}

@media (max-width: 720px) {
  .ts-rpy-axes { grid-template-columns: 1fr; }
  .ts-capture-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .ts-start-zero-group { width: 100%; }
  .ts-start-zero-group .btn { flex: 1 1 auto; min-height: 44px; }
}


/* ===== teammate-monitor-v0.1 · 神隊友監測器 ===== */
.page-head-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.btn-teammate-monitor {
  appearance: none;
  border: 1px solid rgba(232, 212, 170, 0.45);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.22), rgba(61, 126, 166, 0.18));
  color: #e8d4aa;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.12), 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-teammate-monitor:hover,
.btn-teammate-monitor:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(232, 212, 170, 0.75);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.32), rgba(61, 126, 166, 0.26));
  outline: none;
}
.btn-teammate-monitor:active { transform: translateY(0); }

.modal-teammate-monitor {
  max-width: min(560px, calc(100vw - 24px));
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 18px 18px 14px;
}
.tm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.tm-head h3 { margin: 0 0 4px; }
.tm-lead {
  margin: 0 !important;
  font-size: 12px !important;
  color: var(--on-shell-muted) !important;
  line-height: 1.45 !important;
}
.tm-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(201, 162, 39, 0.28), transparent 55%),
    rgba(12, 14, 18, 0.55);
  margin-bottom: 12px;
}
.tm-hero-crown {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}
.tm-hero-body { min-width: 0; flex: 1; }
.tm-hero-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(232, 212, 170, 0.75);
  text-transform: uppercase;
}
.tm-hero-name {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f3e6c4;
  letter-spacing: 0.04em;
}
.tm-hero-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--on-shell-muted);
}
.tm-period {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.tm-period-btn {
  flex: 1;
  appearance: none;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--on-shell-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.tm-period-btn.active,
.tm-period-btn[aria-selected="true"] {
  border-color: rgba(232, 212, 170, 0.55);
  background: rgba(232, 212, 170, 0.12);
  color: #e8d4aa;
}
.tm-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.tm-row {
  display: grid;
  grid-template-columns: 28px 40px minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.03);
}
.tm-row.is-hero {
  border-color: rgba(201, 162, 39, 0.55);
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.14), rgba(255, 255, 255, 0.02));
}
.tm-rank {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: rgba(232, 212, 170, 0.85);
  text-align: center;
}
.tm-rank.is-1 { color: #f5d76e; }
.tm-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: #0c0e12;
  letter-spacing: 0.02em;
}
.tm-main { min-width: 0; }
.tm-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.tm-name {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: #f0e6d0;
}
.tm-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(232, 212, 170, 0.35);
  background: rgba(232, 212, 170, 0.1);
  color: #e8d4aa;
  white-space: nowrap;
}
.tm-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11px;
  color: var(--on-shell-muted);
}
.tm-metrics strong {
  color: #e8d4aa;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tm-vibe {
  margin: 4px 0 0;
  font-size: 11px;
  color: rgba(232, 212, 170, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tm-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.tm-clap {
  appearance: none;
  border: 1px solid rgba(232, 212, 170, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: #e8d4aa;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 64px;
}
.tm-clap:hover,
.tm-clap:focus-visible {
  border-color: rgba(232, 212, 170, 0.7);
  background: rgba(232, 212, 170, 0.12);
  outline: none;
}
.tm-clap.just-clapped {
  animation: tmClapPop 0.35s ease;
}
@keyframes tmClapPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.tm-streak {
  font-size: 10px;
  text-align: center;
  color: rgba(255, 170, 90, 0.95);
  letter-spacing: 0.02em;
}
.tm-cheers {
  border-top: 1px solid var(--shell-line);
  padding-top: 10px;
}
.tm-cheers-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #e8d4aa;
  letter-spacing: 0.04em;
}
.tm-cheer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.tm-cheer-chip {
  appearance: none;
  border: 1px solid rgba(232, 212, 170, 0.3);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(232, 212, 170, 0.9);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.tm-cheer-chip:hover {
  border-color: rgba(232, 212, 170, 0.65);
  background: rgba(232, 212, 170, 0.1);
}
.tm-cheer-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 96px;
  overflow: auto;
}
.tm-cheer-feed li {
  font-size: 11px;
  color: var(--on-shell-muted);
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.tm-cheer-feed li strong { color: #e8d4aa; }
.tm-foot {
  margin: 10px 0 0 !important;
  font-size: 11px !important;
}

@media (max-width: 480px) {
  .page-head-aside {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .btn-teammate-monitor {
    font-size: 11px;
    padding: 7px 10px;
  }
  .tm-row {
    grid-template-columns: 22px 32px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .tm-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
  }
  .tm-clap { min-width: 0; flex: 1; }
  .tm-streak { text-align: right; min-width: 72px; }
  .tm-vibe { white-space: normal; }
}

/* ===== boss-pulse-v0.1 · Admin＋ staff pulse (owner only) ===== */
.panel-boss-pulse {
  border-color: rgba(201, 162, 39, 0.42);
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.12);
}
.panel-boss-pulse[hidden] { display: none !important; }
.boss-pulse-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}
.boss-pulse-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  background: rgba(12, 14, 18, 0.45);
  font-size: 12px;
  color: var(--on-shell-muted, #a8b0bc);
}
.boss-pulse-chip strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold, #c9a227);
  font-variant-numeric: tabular-nums;
}
.boss-pulse-chip.is-flag {
  border-color: rgba(196, 80, 72, 0.55);
  background: rgba(196, 80, 72, 0.12);
  color: #e8b4b0;
}
.boss-pulse-chip.is-flag strong { color: #f0c0bc; }
.boss-pulse-vibe {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #e8d4aa;
  letter-spacing: 0.02em;
}
.boss-pulse-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.boss-pulse-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, 1.2fr);
  gap: 8px 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(168, 176, 188, 0.18);
  background: rgba(12, 14, 18, 0.38);
}
.boss-pulse-row.is-flag {
  border-color: rgba(196, 80, 72, 0.45);
  background: rgba(196, 80, 72, 0.08);
}
.boss-pulse-who {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.boss-pulse-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #5a6270;
  box-shadow: 0 0 0 2px rgba(90, 98, 112, 0.25);
}
.boss-pulse-dot.on {
  background: #3d9b6e;
  box-shadow: 0 0 0 2px rgba(61, 155, 110, 0.28);
}
.boss-pulse-dot.off {
  background: #5a6270;
}
.boss-pulse-name {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  color: #e8d4aa;
  letter-spacing: 0.04em;
}
.boss-pulse-meta {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--on-shell-muted, #a8b0bc);
  line-height: 1.35;
}
.boss-pulse-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--on-shell-muted, #a8b0bc);
}
.boss-pulse-metrics b {
  color: #e8e6e1;
  font-weight: 700;
}
.boss-pulse-delta {
  font-weight: 700;
  font-size: 11px;
  margin-left: 2px;
}
.boss-pulse-delta.up { color: #3d9b6e; }
.boss-pulse-delta.down { color: #d46a62; }
.boss-pulse-delta.flat { color: #8a93a0; }
.boss-pulse-side {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}
.boss-pulse-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(168, 176, 188, 0.22);
  background: rgba(8, 10, 13, 0.45);
  color: var(--on-shell-muted, #a8b0bc);
  white-space: nowrap;
}
.boss-pulse-pill.warn {
  border-color: rgba(201, 162, 39, 0.45);
  color: #e8d4aa;
}
.boss-pulse-pill.danger {
  border-color: rgba(196, 80, 72, 0.55);
  color: #f0c0bc;
  background: rgba(196, 80, 72, 0.12);
}
@media (max-width: 720px) {
  .boss-pulse-row {
    grid-template-columns: 1fr;
  }
  .boss-pulse-side {
    justify-content: flex-start;
  }
}

/* boss-pulse extras · managers + AI tips */
.boss-pulse-sec {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #e8d4aa;
  text-transform: none;
}
.boss-pulse-ai {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.boss-pulse-ai-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  background: rgba(12, 14, 18, 0.42);
}
.boss-pulse-ai-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold, #c9a227);
  letter-spacing: 0.04em;
}
.boss-pulse-ai-brief {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--on-shell-muted, #a8b0bc);
}
.boss-pulse-tip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 6px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.4);
  border: 1px solid rgba(168, 176, 188, 0.14);
  font-size: 12px;
  line-height: 1.4;
  color: #e8e6e1;
}
.boss-pulse-tip:last-child { margin-bottom: 0; }
.boss-pulse-tip-who {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #e8d4aa;
  min-width: 3.5em;
}
.boss-pulse-row.is-mgr {
  border-color: rgba(61, 126, 166, 0.28);
}


/* ========== page-95-v0.1 · permanent desktop layout ~95% viewport ========== */
@media (min-width: 900px) {
  html {
    font-size: 18px; /* rem titles / guest-cta / glance emoji scale ~12.5% */
  }

  body {
    font-size: 1rem;
    line-height: 1.55;
  }

  /* Default every open: shell fills ~95% usable width (2.5% margin each side) */
  .app-shell {
    width: 95vw;
    max-width: 95vw;
    min-height: 95dvh;
    padding: 0 1.5vw 48px;
  }

  .site-header {
    padding: 22px 6px;
    gap: 14px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }
  .brand-mark img,
  .brand-logo {
    width: 36px;
    height: 36px;
  }
  .brand-name { font-size: 15px; }
  .brand-trace { font-size: 11px; letter-spacing: 0.32em; }

  .lang-btn { font-size: 12px; padding: 6px 12px; }

  /* Landing / hero — ride the wider shell */
  .hero { padding: 56px 0 40px; }
  .hero-kicker { font-size: 12px; margin-bottom: 18px; }
  .hero h1 { font-size: clamp(2rem, 3.2vw, 2.65rem); }
  .hero p {
    font-size: 16px;
    max-width: min(640px, 55%);
    margin-bottom: 40px;
  }

  .entrance-grid {
    max-width: 100%;
    gap: 20px;
  }
  .entrance-card { padding: 32px 28px; }
  .entrance-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
  }
  .entrance-card h2 { font-size: 1.3rem; }
  .entrance-card p { font-size: 15px; }
  .entrance-cta { font-size: 13px; }

  .landing-note {
    font-size: 14px;
    max-width: min(720px, 70%);
    padding: 16px 22px;
  }

  /* entrance-cards-v0.1 · desktop equal twin cards */
  .guest-primary,
  .guest-primary--grid {
    max-width: min(1100px, 88%);
    width: 100%;
    gap: 20px;
    margin-bottom: 32px;
    grid-template-columns: 1fr 1fr;
  }
  .guest-cta {
    padding: 28px 30px;
    gap: 6px;
    min-height: 9.5rem;
  }
  .guest-cta-kicker { font-size: 11px; }
  .guest-cta-title { font-size: 1.35rem; }
  .guest-cta-sub { font-size: 14px; }

  .guest-glance {
    max-width: 100%;
    gap: 12px;
  }
  .glance-card { padding: 18px 16px; gap: 6px; }
  .glance-emoji { font-size: 1.35rem; }
  .glance-title { font-size: 15px; }
  .glance-sub { font-size: 13px; }

  /* Panels / page chrome */
  .page-head { padding: 32px 0 24px; gap: 14px; }
  .page-head h1 { font-size: 1.55rem; }
  .page-head .sub { font-size: 15px; }

  .panel + .panel { margin-top: 18px; }
  .panel-header { padding: 16px 22px; }
  .panel-header h2 { font-size: 14px; }
  .panel-body { padding: 20px 22px; }

  /* Buttons / lists */
  .btn {
    padding: 12px 18px;
    font-size: 15px;
    gap: 10px;
  }
  .btn-sm { padding: 8px 14px; font-size: 13px; }

  .list-row { padding: 14px 0; gap: 14px; }
  .avatar {
    width: 46px;
    height: 46px;
    font-size: 14px;
  }

  /* Client hub taps */
  .tap-hub { gap: 12px; margin-bottom: 18px; }
  .tap-card {
    min-height: 92px;
    padding: 14px 10px;
    gap: 8px;
  }
  .tap-emoji { font-size: 1.4rem; }
  .tap-title { font-size: 14px; }

  .client-tabs-compact .client-tab {
    font-size: 13px;
    padding: 8px 12px;
  }

  .btn-tap-lg {
    min-height: 52px;
    font-size: 16px;
  }

  .login-human .login-hello { font-size: 1.65rem; }
  .login-more { font-size: 14px; }
  .chip-prompt { font-size: 15px; }
  .feel-chip {
    min-height: 44px;
    font-size: 14px;
    padding: 10px 14px;
  }

  .secret-label { font-size: 10px; }
  .secret-link { font-size: 13px; padding: 10px 8px; }
}

/* Ultra-wide: still 95vw (no hard px cap — permanent default) */
@media (min-width: 1200px) {
  .app-shell {
    width: 95vw;
    max-width: 95vw;
    padding: 0 1.25vw 56px;
  }
}


/* wt-remember-v0.1 — multi WT9011 slot map + remembered auto-reconnect */
.ts-remember-banner {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.28);
  color: #b7f0c8;
  font-size: 12px;
  font-weight: 600;
}
.ts-remember-banner[hidden] { display: none !important; }
.ts-sensor-slots {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.ts-sensor-slot {
  flex-wrap: wrap;
  align-items: flex-start;
}
.ts-sensor-slot.is-remembered {
  border-style: solid;
  border-color: rgba(232, 196, 88, 0.45);
  background: rgba(48, 40, 20, 0.35);
}
.ts-slot-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ts-slot-sub {
  font-size: 11px;
  color: rgba(232, 212, 170, 0.65);
  word-break: break-all;
}
.ts-slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.ts-slot-dot[data-state="remembered"] {
  background: #e8c458;
  box-shadow: 0 0 0 2px rgba(232, 196, 88, 0.28);
}
.ts-slot-forget {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 11px;
  opacity: 0.85;
}
#ts-btn-autolink:not([hidden]) {
  border-color: rgba(74, 222, 128, 0.45);
  color: #b7f0c8;
}

/* ========== entrance-cards-v0.1 · landing twin CTAs equal grid ========== */
/* (base rules live with .guest-primary; desktop overrides in page-95 block) */


/* wt-silent-v0.1 · hide first-pair count when memory exists */
.ts-pair-setup[hidden] { display: none !important; }
.ts-has-ble-memory .ts-pair-setup { display: none !important; }
.ts-connect-actions.ts-reconnect-only #ts-btn-connect { display: none; }
.ts-silent-status {
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(232, 212, 170, 0.85);
}
.ts-sensor-slot.is-remembered .ts-slot-reconn[data-ble-action="relink"] {
  opacity: 0.55;
  font-size: 12px;
}


/* stab-trials-v0.1 · session trials before Trace */
.ts-trial-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 0 0 8px;
}
.ts-trial-count {
  font-size: 13px;
  color: rgba(232, 212, 170, 0.95);
}
.ts-trial-bar-hint {
  font-size: 11px;
}
.ts-trial-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.ts-trial-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.ts-trial-check input {
  margin-top: 3px;
  flex-shrink: 0;
}
.ts-trial-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(232, 212, 170, 0.62);
}
.ts-trial-del {
  flex-shrink: 0;
  border: 1px solid rgba(196, 168, 120, 0.35);
  background: rgba(40, 28, 20, 0.55);
  color: rgba(232, 180, 140, 0.9);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.2;
}
.ts-trial-del:hover {
  border-color: rgba(220, 140, 100, 0.65);
  color: #f0c8a8;
}
.ts-capture-empty {
  opacity: 0.75;
  font-style: italic;
}
.ts-rpy-empty {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
}


/* stab-dedupe-v0.3 · prominent reconnect CTA + committed trials */
#ts-btn-autolink.ts-btn-reconn-primary:not([hidden]) {
  order: -1;
  flex: 1 1 220px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-color: rgba(232, 196, 88, 0.65);
  box-shadow: 0 0 0 1px rgba(232, 196, 88, 0.25), 0 6px 18px rgba(0, 0, 0, 0.28);
}
.ts-remember-banner.is-need-tap,
.ts-connect-actions.ts-reconnect-only + .ts-remember-banner {
  background: rgba(232, 196, 88, 0.12);
  border-color: rgba(232, 196, 88, 0.4);
  color: #f0e0b0;
}
.ts-trial-item.is-committed {
  opacity: 0.72;
  border-style: dashed;
}
.ts-trial-item.is-committed .ts-trial-check {
  cursor: default;
}
.ts-trial-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(74, 222, 128, 0.16);
  color: #b7f0c8;
  border: 1px solid rgba(74, 222, 128, 0.35);
  vertical-align: middle;
}
.ts-trial-committed-mark {
  margin-left: auto;
  color: #8fd9a8;
  font-weight: 700;
  font-size: 16px;
  padding: 4px 8px;
}
#ts-btn-capture:disabled {
  opacity: 0.55;
}


/* journal-wa-pin-uw-bio-v0.1 · bio row hidden must win over display:flex */
.bio-login-row[hidden]{display:none!important}
.bio-https-tip{margin-top:8px;font-size:12px;color:var(--on-shell-muted,#8a8378);line-height:1.45}
.journal-flash-host{margin:12px 0 16px}
.journal-flash-card{border:1px solid rgba(232,212,170,.35);background:rgba(232,212,170,.08);border-radius:12px;padding:12px 14px;margin-bottom:10px}
.journal-flash-card.is-flashing{animation:journalFlashPulse 1.1s ease-in-out infinite;box-shadow:0 0 0 2px rgba(232,180,80,.55)}
@keyframes journalFlashPulse{0%,100%{background:rgba(232,212,170,.08)}50%{background:rgba(232,180,80,.28)}}
.journal-flash-head{display:flex;justify-content:space-between;gap:8px;margin-bottom:6px;font-size:12px}
.journal-flash-title{margin:0 0 4px;font-weight:700}
.journal-flash-body{margin:0 0 10px;font-size:13px;color:var(--on-shell-muted,#8a8378);white-space:pre-wrap}
.journal-flash-actions,.journal-card-actions{display:flex;flex-wrap:wrap;gap:8px}
.journal-card{border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:12px 14px;margin-bottom:10px;background:rgba(0,0,0,.18)}
.journal-card-head{display:flex;justify-content:space-between;gap:8px;align-items:baseline;margin-bottom:6px}
.journal-card-body{margin:0 0 10px;font-size:13px;white-space:pre-wrap;color:var(--on-shell-muted,#b7b0a4)}
.journal-edit-panel .field{margin-bottom:10px}
.journal-edit-panel textarea{min-height:120px;width:100%}

/* ===== assistant-orders-v0.1 · therapist 助手 panel ===== */
.ao-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.ao-bridge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.ao-bridge-row label {
  font-size: 12px;
  color: var(--muted, #8a96a8);
}
.ao-bridge-row input[type="url"] {
  flex: 1;
  min-width: 200px;
}
.ao-bridge-status {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted, #8a96a8);
}
.ao-bridge-status.ok { color: #2a9d8f; }
.ao-bridge-status.warn { color: #c9a227; }
.ao-order-list .ao-order-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ao-order-list .ao-order-row:last-child { border-bottom: 0; }
@media (max-width: 640px) {
  .ao-order-list .ao-order-row {
    grid-template-columns: 36px 1fr;
  }
  .ao-order-list .ao-order-row .tag,
  .ao-order-list .ao-order-row .btn {
    grid-column: 2;
    justify-self: start;
  }
}


/* ===== assist-quick-focus-v0.1 ===== */
.page-head-aside { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }
.btn-assist-quick {
  appearance: none; border: 1px solid rgba(232,212,170,.55);
  background: linear-gradient(180deg, rgba(232,197,71,.28), rgba(201,162,39,.18));
  color: #e8d4aa; font-weight: 700; font-size: 14px; letter-spacing: .04em;
  padding: 10px 16px; min-height: 44px; min-width: 64px; border-radius: 999px;
  cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.btn-assist-quick:active { transform: scale(.97); background: rgba(232,197,71,.4); }
.btn-assist-quick.is-flash { animation: assistQuickFlash .35s ease; }
@keyframes assistQuickFlash {
  from { box-shadow: 0 0 0 0 rgba(232,197,71,.7); }
  to { box-shadow: 0 0 0 10px rgba(232,197,71,0); }
}

/* 今日焦點：還原直排內容（唔再橫移內容） */
#bench-focus-list {
  display: flex !important;
  flex-direction: column;
  gap: 0;
  overflow-x: visible;
  overflow-y: visible;
  scroll-snap-type: none;
  padding-bottom: 0;
  max-width: none;
  grid-template-rows: unset;
  grid-auto-flow: unset;
  grid-auto-columns: unset;
}
#bench-focus-list .focus-card {
  margin-top: 0;
  scroll-snap-align: unset;
  min-width: 0;
}
#bench-focus-list .patient-focus--inline {
  grid-column: unset;
  min-width: 0;
}

/* 底 tab bar：兩排 + 可橫移睇多項目 */
.therapist-tabs.pw-edge-scroll {
  display: grid !important;
  grid-template-rows: auto auto;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-content: start;
  gap: 4px;
  flex-wrap: unset !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  padding: 4px;
  padding-right: 28px;
  scroll-padding-inline: 12px;
  max-height: none;
}
.therapist-tabs.pw-edge-scroll .therapist-tab {
  flex: unset !important;
  width: max-content;
  min-width: max-content;
  white-space: nowrap;
}

/* 訓練資料貢獻：預設收起 */
details.panel-train-anon {
  border: 1px solid var(--line, rgba(255,255,255,.08));
  border-radius: 14px;
  background: var(--panel, rgba(18,21,28,.9));
  padding: 0;
}
details.panel-train-anon > .panel-header--summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  user-select: none;
}
details.panel-train-anon > .panel-header--summary::-webkit-details-marker { display: none; }
details.panel-train-anon > .panel-header--summary h2 { margin: 0; flex: 1; font-size: 15px; }
.train-anon-chevron { opacity: .65; transition: transform .15s ease; }
details.panel-train-anon[open] .train-anon-chevron { transform: rotate(180deg); }
details.panel-train-anon > .panel-body { padding: 0 14px 14px; }

/* ===== batch-reverse-call-v0.1 · therapist interrupt ===== */
.btn-assist-quick { position: relative; }
.btn-assist-quick.has-revcall {
  border-color: rgba(220, 70, 60, .85);
  box-shadow: 0 0 0 2px rgba(220, 70, 60, .35);
  animation: aoRevDotPulse 1.2s ease-in-out infinite;
}
.ao-assist-dot {
  position: absolute; top: 4px; right: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #e23b2e; box-shadow: 0 0 0 2px rgba(20,20,24,.9);
}
@keyframes aoRevDotPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(220, 70, 60, .35); }
  50% { box-shadow: 0 0 0 6px rgba(220, 70, 60, .15); }
}
.ao-revcall-card {
  position: fixed; inset: 0; z-index: 12000;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; pointer-events: none;
}
.ao-revcall-card[hidden] { display: none !important; }
.ao-revcall-card.is-show { pointer-events: auto; }
.ao-revcall-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
}
.ao-revcall-panel {
  position: relative; z-index: 1;
  width: min(520px, 100%);
  max-height: 55vh;
  margin: 0; padding: 22px 20px 18px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, #2a1a14 0%, #16131a 100%);
  border: 1px solid rgba(232, 120, 90, .45);
  border-bottom: none;
  box-shadow: 0 -12px 40px rgba(0,0,0,.55);
  color: #f5efe6;
}
.ao-revcall-kicker {
  margin: 0 0 4px; font-size: 12px; letter-spacing: .08em;
  color: rgba(232,197,71,.85); text-transform: uppercase;
}
.ao-revcall-title {
  margin: 0 0 10px; font-size: 28px; line-height: 1.15;
  font-weight: 800; color: #fff3e0;
}
.ao-revcall-note {
  margin: 0 0 18px; font-size: 17px; line-height: 1.4;
  color: rgba(245,239,230,.92); min-height: 1.4em;
}
.ao-revcall-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.ao-revcall-btn {
  flex: 1 1 40%; min-height: 48px; border-radius: 12px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  border: 1px solid transparent;
}
.ao-revcall-ack, .ao-revcall-wait {
  background: #c9a227; color: #1a1408; border-color: #e8c447;
}
.ao-revcall-done, .ao-revcall-got {
  background: rgba(255,255,255,.08); color: #f5efe6;
  border-color: rgba(232,212,170,.35);
}
.ao-revcall-got {
  background: #3dba7a; color: #04140c; border-color: #3dba7a;
}
.ao-revcall-btn:active { transform: scale(.98); }
.ao-section-label {
  margin: 0 0 8px; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; color: rgba(232,197,71,.9);
}
.ao-order-row--dim { opacity: .55; }




/* ===== batch-ao-ack-countdown-v0.4 · therapist completion notice ===== */
.ao-completion-card {
  position: fixed; inset: 0; z-index: 12100;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; pointer-events: none;
}
.ao-completion-card[hidden] { display: none !important; }
.ao-completion-card.is-show { pointer-events: auto; }
.ao-completion-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
}
.ao-completion-panel {
  position: relative; z-index: 1;
  width: min(520px, 100%);
  max-height: 50vh;
  margin: 0; padding: 22px 20px 18px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, #1a2a1a 0%, #13181a 100%);
  border: 1px solid rgba(61, 186, 122, .45);
  border-bottom: none;
  box-shadow: 0 -12px 40px rgba(0,0,0,.55);
  color: #eef8f0;
}
.ao-completion-kicker {
  margin: 0 0 4px; font-size: 12px; letter-spacing: .08em;
  color: rgba(61,186,122,.9); text-transform: uppercase;
}
.ao-completion-title {
  margin: 0 0 10px; font-size: 24px; line-height: 1.2;
  font-weight: 800; color: #e8ffe8;
}
.ao-completion-note {
  margin: 0 0 18px; font-size: 16px; line-height: 1.4;
  color: rgba(238,248,240,.92); min-height: 1.4em;
}
.ao-completion-actions { display: flex; gap: 10px; }
.ao-completion-btn {
  flex: 1; min-height: 48px; border-radius: 12px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  border: 1px solid #3dba7a; background: #3dba7a; color: #04140c;
}
.ao-completion-btn:active { transform: scale(.98); }

/* ===== arrival-admin-embed-v0.2.1 · Trace Admin 到達對客 ===== */
.am-embed .am-urgency {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  background: rgba(180, 83, 9, 0.22);
  border: 2px solid var(--warn);
  color: #ffe6a8;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.am-embed .am-urgency[hidden] { display: none !important; }
.am-embed .am-urgency-hot {
  background: rgba(196, 92, 92, 0.28);
  border-color: var(--danger);
  color: #ffd0c4;
  animation: amPulse 1.2s ease-in-out infinite;
}
@keyframes amPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 92, 92, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(196, 92, 92, 0); }
}
.am-embed .am-urgency-meta { font-size: 0.85rem; opacity: 0.9; }
.am-embed .am-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.am-embed .am-ingest-label {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--on-shell-muted);
}
.am-embed .am-ingest-label input,
.am-embed .am-patient-q,
.am-embed select.am-patient,
.am-embed select.am-room {
  background: var(--shell);
  border: 1px solid var(--shell-line);
  color: var(--on-shell);
  padding: 8px 10px;
  border-radius: 8px;
  min-width: 160px;
  font: inherit;
}
.am-embed select.am-patient {
  width: 100%;
  min-height: 9rem;
  margin-top: 6px;
}
.am-embed .am-patient-q { width: 100%; margin-top: 6px; }
.am-embed .am-cliniko-picker {
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 8px 0 10px;
}
.am-embed .am-cliniko-hint { margin: 6px 0 0; }
.am-embed .am-btn {
  background: var(--gold);
  color: #1a140a;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}
.am-embed .am-btn.am-ghost,
.am-embed .am-ghost {
  background: transparent;
  color: var(--on-shell);
  border: 1px solid var(--shell-line);
}
.am-embed .am-status { font-size: 0.85rem; color: var(--on-shell-muted); }
.am-embed .am-status.ok { color: var(--ok); }
.am-embed .am-status.warn { color: var(--warn); }
.am-embed .am-sec {
  font-size: 0.95rem;
  margin: 14px 0 8px;
  color: var(--gold-bright);
}
.am-embed .am-rooms {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
@media (max-width: 720px) {
  .am-embed .am-rooms { grid-template-columns: 1fr 1fr; }
}
.am-embed .am-room-chip {
  background: var(--shell-mid);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--shell-line);
}
.am-embed .am-room-chip.free { border-color: rgba(74, 143, 106, 0.45); }
.am-embed .am-room-chip.reserved,
.am-embed .am-room-chip.occupied { border-color: rgba(196, 168, 120, 0.55); }
.am-embed .am-queue,
.am-embed .am-focus-wrap { display: flex; flex-direction: column; gap: 12px; }
.am-embed .am-card {
  display: flex;
  gap: 12px;
  background: var(--shell-mid);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--shell-line);
}
.am-embed .am-focus {
  border-color: var(--gold);
  box-shadow: var(--gold-glow);
}
.am-embed .am-card-mini { opacity: 0.85; }
.am-embed .am-face {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--shell);
}
.am-embed .am-face-mock {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-shell-muted);
  font-size: 0.85rem;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  background: var(--shell);
}
.am-embed .am-body { flex: 1; min-width: 0; }
.am-embed .am-body h3 { margin: 0 0 4px; font-size: 0.95rem; word-break: break-all; }
.am-embed .am-meta { margin: 0 0 8px; color: var(--on-shell-muted); font-size: 0.8rem; }
.am-embed .am-label { display: block; font-size: 0.8rem; color: var(--on-shell-muted); margin-bottom: 6px; }
.am-embed .am-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.am-embed .am-empty { color: var(--on-shell-muted); }
.am-embed .am-log-row,
.am-embed .am-bind-row {
  background: var(--shell-mid);
  border: 1px solid var(--shell-line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.panel-arrival-match .am-fullscreen-link { color: var(--gold-bright); }


/* ===== desktop-tabs-assess-journal-v0.1 · desktop tabs 1-line +20% · assess pane · journal ===== */
.journal-edit-panel[hidden],
.journal-status[hidden] { display: none !important; }
.journal-edit-panel {
  display: block;
  margin: 12px 0 16px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid rgba(232, 212, 170, 0.35);
  background: rgba(232, 212, 170, 0.07);
}
.journal-edit-panel .field input,
.journal-edit-panel .field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--shell-line, #333);
  background: var(--shell, #12151c);
  color: var(--on-shell, #eee);
  font-size: 14px;
  line-height: 1.45;
}
.journal-edit-panel .field textarea { min-height: 140px; resize: vertical; }
.journal-edit-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.journal-status { margin: 0 0 10px; font-size: 12px; color: var(--gold-bright, #e8d4aa); }
.panel-body--assess-entry { padding-top: 8px; }
.panel-body--assess-entry #cta-assess-entry {
  margin-bottom: 0;
}
#tpane-openassess .cta-banner--assess {
  box-shadow: none;
}

/* Mobile / narrow: keep 2-row grid + horizontal scroll (existing) */
/* Desktop: single row, larger type, no wrap, no chrome overflow */
@media (min-width: 900px) {
  .therapist-tabs.pw-edge-scroll {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    gap: 6px;
    grid-template-rows: none !important;
    grid-auto-flow: unset !important;
    grid-auto-columns: unset !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-height: none;
    padding: 6px;
    padding-right: 20px;
  }
  .therapist-tabs.pw-edge-scroll .therapist-tab {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none;
    white-space: nowrap !important;
    font-size: 15.6px; /* 13px * 1.2 */
    letter-spacing: 0.03em;
    padding: 11px 16px;
    line-height: 1.25;
    overflow: visible;
    text-overflow: clip;
  }
  .therapist-tabs.pw-edge-scroll .therapist-tab .therapist-tab-unread {
    top: 7px;
    right: 7px;
  }
}


/* admin-ui-copy-v0.1 · boss arrival-match status */
.am-boss-status { margin: 8px 0 4px; padding: 12px 14px; border-radius: 12px; background: rgba(212,175,55,0.08); border: 1px solid rgba(212,175,55,0.35); }
.am-boss-status-line { margin: 0 0 6px; font-size: 1.05rem; font-weight: 600; }


/* ===== rom-fixed-wide-v0.1 · desktop full FOV contain + tidy ROM chrome ===== */
@media (min-width: 641px) {
  /* Prefer full sensor FOV (Insta360 ultrawide) — letterbox ok, no CSS cover-crop zoom */
  .rom-canvas,
  .rom-video,
  .rom-avatar3d {
    object-fit: contain;
    object-position: center center;
  }
  .rom-canvas--hud {
    object-fit: contain;
  }

  /* Immersive grid: clearer gutters so docks don't crowd stage */
  .rom-immersive {
    grid-template-columns: 56px minmax(0, 1fr) 108px;
    column-gap: 0;
  }

  .rom-dock-left {
    gap: 8px;
    padding: 12px 6px;
    background: linear-gradient(90deg, rgba(8, 10, 13, 0.88), rgba(8, 10, 13, 0.35));
  }
  .rom-dock-left .btn {
    min-height: 42px;
    border-radius: 10px;
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .rom-dock-right {
    gap: 8px;
    padding: 12px 10px;
    background: linear-gradient(270deg, rgba(8, 10, 13, 0.9), rgba(8, 10, 13, 0.4));
  }
  .rom-dock-label {
    margin: 6px 0 2px;
    opacity: 0.9;
  }
  .rom-ex-btn {
    min-height: 48px !important;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  }
  .rom-view-grid {
    gap: 8px;
  }
  .rom-view-grid .btn {
    min-height: 42px;
    border-radius: 10px;
  }

  /* Top dock: one clean row, less wrap clutter */
  .rom-dock-top {
    gap: 10px 12px;
    padding: 8px 12px;
    align-items: center;
  }
  .rom-dock-fields {
    gap: 8px 10px;
  }
  .rom-dock-actions {
    gap: 8px;
  }
  .rom-dock-actions .btn {
    min-height: 40px;
    border-radius: 10px;
  }

  /* Stage FABs: stack cleanly, clear of canvas HUD */
  .rom-stage-fab--tr {
    top: 14px;
    right: 14px;
    gap: 8px;
  }
  .rom-stage-fab--tr .btn {
    min-width: 76px;
    min-height: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  /* Bottom metrics: single tidy bar */
  .rom-stage--fill .rom-metrics {
    min-height: 44px;
    max-height: 72px;
    padding: 6px 14px;
    gap: 6px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
  }
  .rom-metrics .rom-metric-pill {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8125rem;
  }

  /* HUD overlays: less overlap with FABs / metrics */
  .rom-hud {
    left: 12px;
    right: 12px;
    bottom: 12px;
    gap: 12px;
  }
  .rom-hud-angles {
    max-width: min(48vw, 380px);
    gap: 6px;
  }
  .rom-hud-right {
    max-width: 36%;
    gap: 6px;
  }
  .rom-status {
    max-width: 100%;
  }

  /* Side thumbs: slim strip, don't overlap FABs */
  .rom-side-thumbs.rom-fourview-strip.has-captures,
  .rom-stage--fill .rom-side-thumbs.rom-fourview-strip.has-captures {
    left: 8px;
    top: 56px;
    bottom: auto;
    max-height: calc(100% - 120px);
    width: 72px;
    padding: 4px;
    gap: 6px;
    background: rgba(8, 10, 13, 0.55);
    border-radius: 12px;
    border: 1px solid rgba(196, 168, 120, 0.28);
  }
}

@media (min-width: 1100px) {
  .rom-immersive {
    grid-template-columns: 64px minmax(0, 1fr) 120px;
  }
}


/* ===== rom-fixed-wide-v0.1 · special-tests: hide Physiopedia / external refs after region ===== */
#view-special-tests a[href*="physio-pedia"],
#view-special-tests a[href*="physiopedia"],
#view-special-tests a[href*="wikipedia.org"],
#view-special-tests a.st-ext-ref,
#view-special-tests a.st-ref-link,
#view-special-tests .st-ext-ref,
#view-special-tests .st-pedia-link,
#view-special-tests .st-source-links {
  display: none !important;
}
#st-pane-tests .st-ext-ref,
#st-pane-findings .st-ext-ref {
  display: none !important;
}


/* ===== rom-layout-stable-v0.6 · rail spacing + thumbs clear of HUD + fixed metric slots ===== */
@media (min-width: 641px) {
  /* Wider docks so Chinese labels + scrollbar don't crush buttons */
  .rom-immersive {
    grid-template-columns: 72px minmax(0, 1fr) 132px;
  }

  .rom-dock-left,
  .rom-dock-right {
    gap: 12px;
    scrollbar-gutter: stable;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scroll-padding-bottom: 20px;
    box-sizing: border-box;
  }
  .rom-dock-left > *,
  .rom-dock-right > * {
    flex-shrink: 0;
  }

  .rom-dock-left {
    padding: 12px 8px 20px;
    gap: 10px;
  }
  .rom-dock-left .btn {
    min-height: 44px;
    padding: 8px 6px;
    font-size: 12px;
    line-height: 1.25;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }
  .rom-cam-dual-hint {
    margin: 6px 0 0;
    padding: 6px 4px;
    font-size: 10px;
    line-height: 1.35;
    max-height: none;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    hyphens: auto;
  }

  .rom-dock-right {
    padding: 12px 10px 24px;
    gap: 12px;
  }
  .rom-dock-label {
    margin: 8px 0 0;
    line-height: 1.3;
  }
  .rom-dock-label:first-child {
    margin-top: 0;
  }
  .rom-ex-btn {
    min-height: 56px !important;
    padding: 10px 8px !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    box-sizing: border-box;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    overflow: hidden;
  }
  .rom-view-grid {
    gap: 8px;
  }
  .rom-view-grid .btn {
    min-height: 44px;
  }
  #rom-btn-capture-view,
  #rom-autopack-toggle,
  .rom-btn-clear-fourviews,
  #rom-btn-save-angle,
  #rom-btn-export {
    min-height: 44px;
    flex-shrink: 0;
  }
  /* Keep last save/export fully visible above clip edge */
  .rom-dock-right > :last-child {
    margin-bottom: 8px;
  }

  /* Side capture thumbs: RIGHT rail under FABs — never cover TL canvas HUD metrics */
  .rom-side-thumbs.rom-fourview-strip.has-captures,
  .rom-stage--fill .rom-side-thumbs.rom-fourview-strip.has-captures,
  .rom-side-thumbs.rom-fourview-strip,
  .rom-stage--fill .rom-side-thumbs.rom-fourview-strip {
    left: auto !important;
    right: 10px !important;
    top: 100px !important;
    bottom: auto;
    width: 68px;
    max-width: 72px;
    max-height: calc(100% - 160px);
    z-index: 26; /* below FABs (30+) and below primary HUD feel; still tappable */
  }

  /* Bottom metric pills: reserved value slots — no left/right jiggle on digit updates */
  .rom-stage--fill .rom-metrics {
    min-height: 48px;
    max-height: 80px;
    padding: 8px 14px;
    gap: 8px 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
  }
  .rom-metrics .rom-metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 5px 12px;
    box-sizing: border-box;
    max-width: none;
  }
  .rom-metrics .rom-metric-k {
    flex: 0 0 auto;
    opacity: 0.9;
    white-space: nowrap;
  }
  .rom-metrics .rom-metric-v,
  .rom-metrics .rom-metric-pill strong {
    display: inline-block;
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    font-weight: 600;
    color: #9fd6e8;
    text-align: left;
    white-space: nowrap;
    min-width: 7.5ch;
    box-sizing: border-box;
  }
  .rom-metrics .rom-metric-v--deg {
    min-width: 10ch; /* e.g. 左低 12.5° */
  }
  .rom-metrics .rom-metric-v--cm {
    min-width: 8ch; /* e.g. 37.6 cm */
  }
  .rom-metrics .rom-metric-v--pct {
    min-width: 6ch;
  }
  .rom-metrics .rom-metric-v--pair {
    min-width: 16ch; /* L/R pair + delta */
  }
  .rom-metrics .rom-metric-v--text {
    min-width: 8ch;
    max-width: 22ch;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rom-metrics .rom-metric-v--file {
    min-width: 22ch;
    max-width: 32ch;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rom-metrics .rom-metric-pill--file {
    max-width: 40ch;
  }
}

@media (min-width: 1100px) {
  .rom-immersive {
    grid-template-columns: 80px minmax(0, 1fr) 148px;
  }
}

/* Phone: keep thumbs off TL metrics too; metric slots still stable */
@media (max-width: 640px) {
  .rom-side-thumbs.rom-fourview-strip.has-captures,
  .rom-stage--fill .rom-side-thumbs.rom-fourview-strip.has-captures,
  .rom-side-thumbs.rom-fourview-strip,
  .rom-stage--fill .rom-side-thumbs.rom-fourview-strip {
    left: auto !important;
    right: 4px !important;
    top: 96px !important;
  }
  .rom-metrics .rom-metric-v,
  .rom-metrics .rom-metric-pill strong {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    min-width: 6.5ch;
  }
}
