/* The sample clinic page. Copyright (c) 2026 DocHelp. All rights reserved.
   The builder's look (tokens and parts from _clinic-builder/v3/css/app.css and clinic.css): cream, aubergine,
   Fraunces and Manrope, the same top bar, switches, chips, view tools, walk pad and corner mark. */
:root {
  --aubergine-deep: #1A0F2E;
  --aubergine: #2D1B4E;
  --royal: #5B2A8C;
  --orchid: #8B5FBF;
  --lilac: #B794D6;
  --lilac-wash: #F2ECF8;
  --cream: #F8F5F0;
  --cream-dim: #EFEAE2;
  --ink: #0A0A0F;
  --slate: #6B6862;
  --stone: #D4D2CD;
  --card: #FFFFFF;
  --line: rgba(10, 10, 15, 0.08);
  --line-strong: rgba(10, 10, 15, 0.14);
  --shadow-soft: 0 1px 2px rgba(26, 15, 46, 0.06), 0 8px 24px rgba(26, 15, 46, 0.08);
  --topbar: 64px;
  --bottombar: 0px;
  --legal: 30px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--cream); color: var(--ink); font-family: var(--font-ui); font-size: 14px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.app { position: fixed; inset: 0; display: block; background: var(--cream); }

/* top bar */
.topbar {
  position: absolute; left: 0; right: 0; top: 0; height: var(--topbar); z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 20px;
  background: rgba(248, 245, 240, 0.92); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; color: inherit; text-decoration: none; border-radius: 12px; justify-self: start; }
.brand:focus-visible { outline: 2px solid var(--orchid); outline-offset: 3px; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; color: var(--aubergine); }
.brand-sub { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--slate); font-weight: 600; transition: color 200ms var(--ease); }
.brand-sub .back { width: 13px; height: 13px; margin-left: -3px; }
.brand:hover .brand-sub { color: var(--royal); }
.tb-mid-slot { display: flex; justify-content: center; }
.tb-mid { display: flex; align-items: center; gap: 10px; }
.tb-right { display: flex; align-items: center; justify-content: flex-end; min-width: 0; }

/* switches */
.seg {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr;
  background: #ECE8E2; border-radius: 999px; padding: 4px; box-shadow: inset 0 0 0 1px var(--line);
}
.seg button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  min-width: 96px; height: 36px; padding: 0 16px; border-radius: 999px; white-space: nowrap;
  font-weight: 600; font-size: 14px; color: var(--slate); transition: color 240ms var(--ease);
}
.seg button[aria-checked="true"] { color: var(--aubergine); }
.seg button:focus-visible { outline: 2px solid var(--orchid); outline-offset: 2px; }
.seg-ind {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: #fff; border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(26, 15, 46, 0.08); transition: transform 220ms var(--ease);
}
.viewseg[data-active="walk"] .seg-ind { transform: translateX(100%); }
/* the level switch: each button as wide as its name ("Overseas-sourced" is long); main.js sizes and moves the marker */
.seg3 { grid-template-columns: auto auto auto; }
.seg3 .seg-ind { left: 0; width: 0; transition: transform 220ms var(--ease), width 220ms var(--ease); }

/* chips and the Go to room menu */
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--card); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 200ms var(--ease), border-color 200ms var(--ease), color 200ms;
}
.chip svg { width: 18px; height: 18px; }
.chip:hover { border-color: var(--lilac); }
.chip:focus-visible, .tool:focus-visible, .enter-btn:focus-visible { outline: 2px solid var(--orchid); outline-offset: 2px; }
.goto { position: relative; }
.goto-btn { gap: 7px; padding: 0 12px 0 14px; }
.goto-btn .chev { width: 15px; height: 15px; color: var(--slate); transition: transform 200ms var(--ease); }
.goto-btn[aria-expanded="true"] { border-color: var(--orchid); background: var(--lilac-wash); }
.goto-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.goto-pop {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 45;
  width: 300px; max-height: min(70vh, 540px); overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border-radius: 16px; padding: 6px; border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(26, 15, 46, 0.08), 0 18px 48px rgba(26, 15, 46, 0.18); scrollbar-width: thin; scrollbar-color: var(--stone) transparent;
}
.goto-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 10px;
  background: none; cursor: pointer; text-align: left; font-weight: 600; font-size: 14px;
}
.goto-item:hover, .goto-item:focus-visible { background: var(--lilac-wash); outline: none; }
.goto-item[aria-current="true"] { color: var(--royal); background: var(--lilac-wash); }
.goto-item .gi-icon svg { width: 18px; height: 18px; display: block; }
.goto-item .gi-label { flex: 1; min-width: 0; }
.goto-item .gi-area { color: var(--slate); font-weight: 500; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.goto-item.whole { border-bottom: 1px solid var(--line); border-radius: 10px 10px 4px 4px; margin-bottom: 2px; }

/* the 3D view */
.stage { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--legal) + var(--bottombar)); overflow: hidden; background: var(--cream); }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#view.dragging { cursor: grabbing; }
.view-tools { position: absolute; left: 20px; top: calc(var(--topbar) + 16px); display: flex; gap: 8px; z-index: 5; }
.tool {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 13px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-weight: 600; cursor: pointer; box-shadow: var(--shadow-soft); transition: background 200ms;
}
.tool:hover { background: #fff; }
.tool svg { width: 18px; height: 18px; }
.chip:active, .tool:active, .seg button:active { transform: scale(0.97); }
.walk-room {
  display: inline-flex; align-items: center; height: 44px; margin: 0; padding: 0 16px; border-radius: 999px;
  background: rgba(45, 27, 78, 0.86); color: var(--cream); font-weight: 700; font-size: 13px; pointer-events: none; white-space: nowrap;
}
.enter-btn {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 6;
  display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 30px 0 24px; border: 0; border-radius: 999px;
  background: var(--aubergine); color: #fff; font-weight: 700; font-size: 17px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(26, 15, 46, 0.3), 0 10px 26px rgba(45, 27, 78, 0.32); transition: background 200ms;
}
.enter-btn:hover { background: var(--royal); }
.enter-btn:active { transform: translateX(-50%) scale(0.97); }
.enter-btn svg { width: 22px; height: 22px; }
.walk-pad {
  position: absolute; left: 20px; bottom: 22px; width: 132px; height: 132px; border-radius: 50%; z-index: 6; touch-action: none;
  background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.85); box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center;
}
.walk-pad.active { background: rgba(255, 255, 255, 0.7); }
.walk-knob { width: 56px; height: 56px; border-radius: 50%; background: var(--aubergine); opacity: 0.82; box-shadow: 0 4px 14px rgba(26, 15, 46, 0.3); pointer-events: none; }
/* the light mark: bottom right of the 3D view in every view (the walk pad has the bottom left on touch screens) */
.mark {
  position: absolute; right: 20px; bottom: 16px; z-index: 4; display: flex; align-items: center; gap: 7px;
  color: var(--aubergine); opacity: 0.3; pointer-events: none; -webkit-user-select: none; user-select: none;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
}
.mark svg { width: 22px; height: 22px; }
.level-note {
  position: absolute; left: 50%; top: calc(var(--topbar) + 18px); transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 10px; min-width: 230px; padding: 9px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft); font-size: 12.5px; font-weight: 600; color: var(--royal); pointer-events: none; white-space: nowrap;
}
.note-bar { flex: 0 0 64px; display: block; height: 3px; border-radius: 3px; background: rgba(45, 27, 78, 0.1); overflow: hidden; }
.note-bar i { display: block; height: 100%; width: 0; background: var(--royal); border-radius: 3px; transition: width 300ms var(--ease); }

/* loading: a thin bar in the middle; files not there yet: the bar just breathes */
.loader { position: absolute; left: 50%; top: calc(50% + var(--topbar) / 2); width: 180px; transform: translate(-50%, -50%); z-index: 6; transition: opacity 400ms var(--ease); }
.loader.done { opacity: 0; pointer-events: none; }
.loader-bar { display: block; height: 3px; border-radius: 3px; background: rgba(45, 27, 78, 0.1); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--aubergine); border-radius: 3px; transition: width 300ms var(--ease); }
/* the 3D view cannot open (no WebGL 2, or the level did not download): one line and the way to the films */
.fail { position: absolute; inset: 0; z-index: 9; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; }
.fail[hidden] { display: none; }
.fail p { margin: 0; font-size: 16px; color: var(--aubergine); font-weight: 600; }
.app.failed .loader { display: none; }
.loader.waiting .loader-bar i { width: 30% !important; animation: wait 1.8s var(--ease) infinite alternate; }
@keyframes wait { from { transform: translateX(-10%); } to { transform: translateX(240%); } }
.app.booting .tb-mid, .app.booting .tb-right, .app.booting .view-tools { opacity: 0.55; pointer-events: none; }

/* the copyright line under the view */
.foot-bar { position: absolute; left: 0; right: 0; bottom: var(--legal); height: var(--bottombar); z-index: 7; }
.legal {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--legal); z-index: 8; display: flex; align-items: center; justify-content: center;
  padding: 0 16px; font-size: 12px; color: var(--slate); background: var(--cream); border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden;
}

/* phones and narrow screens: the view switch and Go to room in a bar at the foot of the view (as the builder); up to
   960 px, where the top bar has no room for both switches and the brand (main.js narrow() matches) */
@media (max-width: 960px) {
  :root { --topbar: 56px; --bottombar: 56px; --legal: 26px; }
  .topbar { grid-template-columns: auto minmax(0, 1fr); padding: 0 12px; gap: 8px; }
  .brand-text { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .tb-mid-slot { display: none; }
  .tb-right { justify-content: flex-end; }
  .seg button { min-width: 0; height: 40px; padding: 0 10px; font-size: 13px; }
  .seg { padding: 2px; }
  .seg-ind { top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); }
  #levelSeg button { height: 44px; }
  .foot-bar {
    display: flex; align-items: center; padding: 6px 10px;
    background: rgba(248, 245, 240, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .foot-bar .tb-mid { width: 100%; justify-content: space-between; gap: 8px; }
  .foot-bar .seg button { height: 44px; padding: 0 16px; }
  .foot-bar .goto { position: static; }
  .foot-bar .goto-pop { position: absolute; top: auto; bottom: calc(100% + 8px); left: 12px; right: 12px; width: auto; transform: none; max-height: calc(70vh - 80px); }
  .foot-bar .goto-btn .chev { display: none; }
  .view-tools { left: 12px; top: calc(var(--topbar) + 10px); max-width: calc(100% - 24px); }
  .tool { height: 44px; padding: 0 14px 0 12px; }
  .walk-pad { left: 14px; bottom: 14px; width: 120px; height: 120px; }
  .enter-btn { left: auto; right: 12px; bottom: 40px; transform: none; height: 52px; padding: 0 24px 0 20px; }
  .enter-btn:active { transform: scale(0.97); }
  .mark { right: 12px; bottom: 10px; font-size: 13px; }
  .mark svg { width: 18px; height: 18px; }
  .legal { font-size: 11.5px; }
}
/* computers 961 to 1399 px: the brand and the level switch take what they need, the view switch centred between */
@media (min-width: 961px) and (max-width: 1399px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
}
@media (max-width: 380px) {
  .seg3 button, #levelSeg button { padding: 0 8px; font-size: 12.5px; }
  .foot-bar .seg button { padding: 0 12px; }
  .goto-btn.chip { padding: 0 10px 0 8px; }
}
@media (hover: none) { .chip:hover { border-color: var(--line-strong); } .tool:hover { background: rgba(255, 255, 255, 0.86); } .goto-item:hover { background: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
