/* Room Atlas viewer: the graph a room landing page embeds (website/README.md).
   The viewer runs in a sandboxed frame and does not load /styles.css, so the
   Delegate tokens it uses are copied here; tests/test_room_atlas.py keeps them
   equal to styles.css. Dark is the token default, light follows data-theme. */
:root {
  color-scheme: dark;
  --canvas: #12061A;
  --card: #2A1F31;
  --hairline: #362B3C;
  --ink: #EFFAFF;
  --body: #D0CDD1;
  --muted: #9376A9;
  --accent: #AEE5FF;
  --tonal: #413848;
  --tonal-hover: #4D4453;
  --ctl-border: #716A76;
  --overlay: #362B3C;
  --font-body: "Geist", -apple-system, "Segoe UI", sans-serif;
  --radius-ctl: 8px;

  /* Canvas colours, read by atlas.js. */
  --atlas-bg: var(--canvas);
  --atlas-grid: #2A1F31;
  --atlas-label-bg: rgb(18 6 26 / .92);
  --atlas-label: #D0CDD1;
  --atlas-label-strong: #EFFAFF;
  --atlas-area: #9376A9;
  --atlas-area-touched: #D0CDD1;
  --atlas-node: #716A76;
  --atlas-node-faint: #413848;
  --atlas-edge: #5A4F61;
  --atlas-dependency: #8C83B8;
  --atlas-untouched: #AEE5FF;
  --atlas-focus: #AEE5FF;
  --atlas-lightness: 72%;
  --atlas-trails: #8EC4FF, #FFB877, #C3A2FF, #6AB9FF, #FFCB8E, #D4B8FF, #9DB8FF, #FFA77A, #B9A0EF;
  --atlas-native-atlas: #FFC48A;
  --atlas-native-room: #9DB8FF;
  --atlas-native-problem: #FFB877;
  --atlas-native-statement: #90A7CF;
  --atlas-native-message: #7592AD;
  --atlas-native-reference: #C3AFF0;
}
:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #FCFCFC;
  --card: #FCFCFC;
  --hairline: #DBD1E2;
  --ink: #2D1043;
  --body: #12061A;
  --muted: #716A76;
  --accent: #4B1B6F;
  --tonal: #FCFCFC;
  --tonal-hover: #EFFAFF;
  --ctl-border: #9376A9;
  --overlay: #FCFCFC;

  --atlas-grid: #E6DFEB;
  --atlas-label-bg: rgb(252 252 252 / .92);
  --atlas-label: #2D1043;
  --atlas-label-strong: #12061A;
  --atlas-area: #716A76;
  --atlas-area-touched: #2D1043;
  --atlas-node: #9376A9;
  --atlas-node-faint: #DBD1E2;
  --atlas-edge: #C9BED2;
  --atlas-dependency: #A8936A;
  --atlas-untouched: #4B1B6F;
  --atlas-focus: #4A8FD6;
  --atlas-lightness: 58%;
  --atlas-trails: #4A8FD6, #F2994A, #8A4BD3, #6FA6E0, #F5B36B, #A46BE0, #3A6FB8, #EE8A55, #9D7BEA;
  --atlas-native-atlas: #E8995A;
  --atlas-native-room: #4A8FD6;
  --atlas-native-problem: #F2994A;
  --atlas-native-statement: #4A62A0;
  --atlas-native-message: #4F6D8A;
  --atlas-native-reference: #7356B8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--body); font: 14px/1.5 var(--font-body); }
button { font: inherit; color: var(--ink); background: var(--tonal); border: 1px solid var(--ctl-border); border-radius: var(--radius-ctl); padding: 8px 11px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { button:hover { background: var(--tonal-hover); } }
button:focus-visible { background: var(--tonal-hover); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The embed shows the graph alone: the export's other views stay in the
   markup because atlas.js wires them up, but they never show here. */
#mapSwitch, #proofMap, #atlasView > header, #atlasView > .worknav, #atlasView > .toolbar,
#atlasView > footer, #atlasView #catalog, #atlasView #details { display: none !important; }
#atlasView .layout { display: block; height: 100vh; height: 100dvh; }

#scene { position: relative; overflow: hidden; height: 100%; min-width: 0; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#map { position: absolute; inset: 0; }
#sceneCaption { position: absolute; z-index: 2; top: 12px; left: 16px; right: 16px; pointer-events: none; color: var(--muted); font-size: 12px; }
#legend { position: absolute; bottom: 16px; left: 16px; max-width: 290px; padding: 9px 12px; pointer-events: none; background: var(--overlay); border: 1px solid var(--hairline); border-radius: var(--radius-ctl); color: var(--body); font-size: 11px; }
.atlas-placement #legend { max-width: 200px; }
.atlas-placement #classicEvidenceLegend { display: none; }
.key { display: inline-block; width: 20px; margin: 0 7px 3px 0; border-top: 2px solid; }
.dashed { border-top-style: dashed; }
.dotted { border-top-style: dotted; }
#tip { position: absolute; display: none; max-width: 280px; padding: 6px 9px; pointer-events: none; background: var(--overlay); border: 1px solid var(--hairline); border-radius: 6px; color: var(--ink); font-size: 12px; }
#empty { position: absolute; inset: 45% 15%; display: none; text-align: center; color: var(--muted); }
#toast { position: fixed; z-index: 10; bottom: 20px; left: 50%; transform: translateX(-50%); display: none; padding: 12px 20px; background: var(--overlay); border: 1px solid var(--hairline); border-radius: var(--radius-ctl); color: var(--ink); }
.controls { position: absolute; right: 15px; bottom: 16px; display: flex; gap: 6px; }
/* 32px targets so a finger can zoom the graph. */
.controls button { min-width: 32px; min-height: 32px; padding: 5px 10px; }
#scene:not(.interactive) .controls, #scene:not(.interactive) #legend { visibility: hidden; }
@media (max-width: 700px) { #legend { bottom: 60px; } }
