:root {
  --ink: #424242;
  --muted: #727272;
  --soft-muted: #9b9b97;
  --paper: #f3f2ed;
  --panel: #fbfaf7;
  --white: #ffffff;
  --line: #deddd7;
  --line-strong: #c9c8c1;
  --olive: #9d9b72;
  --blue: #99cbe5;
  --orange: #efa52f;
  --red: #a70c37;
  --deep: #4e4e4e;
  --shadow: 0 18px 48px rgba(42, 43, 41, 0.12);
  --panel-width: 390px;
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
body { font-family: var(--font); color: var(--ink); background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(153, 203, 229, .42);
  outline-offset: 2px;
}

.app-shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: var(--panel-width) minmax(0, 1fr);
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 240ms ease;
}
.app-shell.panel-collapsed { grid-template-columns: 0 minmax(0, 1fr); }

.control-panel {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--panel);
  border-right: 1px solid var(--line);
  transition: transform 240ms ease, opacity 160ms ease;
}
.panel-collapsed .control-panel { transform: translateX(-100%); opacity: 0; pointer-events: none; }

.brand-header {
  flex: 0 0 auto;
  min-height: 88px;
  display: flex;
  align-items: center;
  padding: 15px 52px 15px 22px;
  border-bottom: 1px solid var(--line);
}
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-symbol { width: 48px; height: 48px; flex: 0 0 48px; object-fit: contain; display: block; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.brand-copy strong { color: var(--ink); font-size: 18px; font-weight: 700; letter-spacing: -.025em; white-space: nowrap; }
.brand-copy span { color: var(--muted); font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.icon-button { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: 24px; line-height: 1; }
.icon-button:hover { background: #efeee8; }

.panel-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 9px 20px 0;
  border-bottom: 1px solid var(--line);
}
.panel-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 10px 4px 12px; cursor: pointer; font-size: 12px; font-weight: 600; }
.panel-tab.active { color: var(--ink); border-color: var(--red); }

.panel-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-gutter: stable;
}
.panel-scroll::-webkit-scrollbar { width: 9px; }
.panel-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid transparent; border-radius: 999px; background-clip: padding-box; }
.panel-section { display: none; padding: 24px 22px 72px; }
.panel-section.active { display: block; }
.section-intro { margin-bottom: 22px; }
.eyebrow { display: block; text-transform: uppercase; letter-spacing: .13em; font-size: 9px; font-weight: 700; color: var(--red); margin-bottom: 8px; }
.section-intro h1, .section-intro h2, .map-overview h2, .selected-heading h2 { margin: 0 0 9px; line-height: 1.12; font-weight: 600; }
.section-intro h1 { font-size: 26px; }
.section-intro h2, .map-overview h2, .selected-heading h2 { font-size: 21px; }
.section-intro p, .map-overview > p { margin: 0; color: var(--muted); line-height: 1.52; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field > span { font-size: 11px; font-weight: 600; color: #54544f; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.45;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field textarea { resize: vertical; min-height: 44px; }
.field input:hover, .field textarea:hover { border-color: #aaa99f; }
.field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(153,203,229,.18); outline: 0; }
.additional-context { margin: 1px 0 17px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.additional-context summary { cursor: pointer; padding: 13px 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.additional-context summary span { float: right; color: var(--soft-muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.additional-context[open] summary { margin-bottom: 8px; }

.primary-button, .secondary-button, .tool-button { border-radius: 10px; cursor: pointer; transition: transform 120ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease; }
.primary-button { width: 100%; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--deep); background: var(--deep); color: var(--white); padding: 12px 14px; font-size: 13px; font-weight: 600; }
.primary-button:hover { background: #373737; transform: translateY(-1px); }
.primary-button.compact-full { margin-top: 14px; }
.delete-node-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 9px;
  padding: 10px 13px;
  border: 1px solid #d9b8c2;
  border-radius: 10px;
  background: transparent;
  color: var(--red);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.delete-node-button:hover { background: #fff1f4; border-color: #c98b9e; }
.delete-node-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.secondary-button { width: 100%; border: 1px solid var(--line-strong); background: var(--white); padding: 10px 13px; font-size: 12px; font-weight: 600; margin-top: 8px; }
.secondary-button:hover { border-color: var(--olive); background: #fafaf7; }
.secondary-button.inline { width: auto; padding: 10px 18px; }
button:disabled { opacity: .46; cursor: not-allowed; transform: none !important; }
.form-note { color: var(--soft-muted); font-size: 10px; line-height: 1.45; text-align: center; margin: 12px 15px 0; }
.api-notice { padding: 10px 11px; margin: 0 0 12px; border-radius: 9px; background: #fff6e8; border: 1px solid #ead5b1; color: #765a24; font-size: 11px; line-height: 1.45; }

.panel-footer { flex: 0 0 43px; min-height: 43px; display: flex; align-items: center; gap: 8px; padding: 0 22px; border-top: 1px solid var(--line); color: var(--muted); background: var(--panel); font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #aaa; }
.status-dot.ready { background: #5a8b68; box-shadow: 0 0 0 4px rgba(90,139,104,.12); }
.status-dot.offline { background: #c2755f; }
.status-separator { opacity: .48; }
.footer-credit { color: inherit; text-decoration: none; white-space: nowrap; transition: color 150ms ease; }
.footer-credit:hover, .footer-credit:focus-visible { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.panel-toggle-button {
  position: fixed;
  left: calc(var(--panel-width) - 21px);
  top: 31px;
  z-index: 32;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 5px 20px rgba(0,0,0,.09);
  cursor: pointer;
  transition: left 240ms ease, background 150ms ease, box-shadow 150ms ease;
}
.panel-toggle-button:hover { background: #f2f1eb; box-shadow: 0 7px 24px rgba(0,0,0,.12); }
.panel-toggle-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 240ms ease;
}
.panel-collapsed .panel-toggle-button { left: 18px; }
.panel-collapsed .panel-toggle-button svg { transform: rotate(180deg); }

.map-overview { margin-bottom: 17px; }
.reflection-card, .seed-question { margin-top: 15px; border-left: 3px solid var(--orange); background: #fff8ea; padding: 11px 12px; border-radius: 0 10px 10px 0; }
.reflection-card small, .seed-question small { display: block; color: #82622a; text-transform: uppercase; letter-spacing: .11em; font-size: 8px; font-weight: 700; margin-bottom: 5px; }
.reflection-card p, .seed-question p { margin: 0; font-size: 12px; line-height: 1.48; }

.selected-panel { margin-bottom: 18px; }
.selected-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.selected-heading h2 { margin-bottom: 0; }
.selected-description { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 11px 0 10px; }
.node-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.node-tag { display: inline-flex; align-items: center; border: 0; border-radius: 999px; background: var(--tag-colour, #e8e7e1); padding: 6px 10px; color: #555650; font-size: 9px; font-weight: 600; }
.node-source { color: var(--soft-muted); font-size: 9px; }
.node-details { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.node-details > div { padding: 11px 0; border-bottom: 1px solid var(--line); }
.node-details dt { color: var(--soft-muted); text-transform: uppercase; letter-spacing: .09em; font-size: 8px; font-weight: 700; margin-bottom: 4px; }
.node-details dd { margin: 0; color: #555550; font-size: 11.5px; line-height: 1.45; }

.conversation-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; color: var(--soft-muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.conversation-divider::before, .conversation-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.chat-log { display: flex; flex-direction: column; gap: 10px; min-height: 105px; max-height: 300px; overflow-y: auto; padding-right: 3px; margin-bottom: 12px; }
.chat-message { border-radius: 11px; padding: 11px 12px; font-size: 12px; line-height: 1.48; }
.chat-message p { margin: 0; white-space: pre-wrap; }
.chat-message.assistant { background: #f0f1ed; border: 1px solid #dedfd9; }
.chat-message.user { background: #fff; border: 1px solid var(--line); margin-left: 22px; }
.chat-role { display: block; margin-bottom: 5px; color: var(--red); text-transform: uppercase; letter-spacing: .1em; font-size: 8px; font-weight: 700; }
.chat-message.user .chat-role { color: var(--muted); }
.chat-reflection { margin-top: 8px !important; color: #6f623f; font-style: italic; }
.prompt-shortcuts { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 10px; }
.prompt-shortcuts button { border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 9px; padding: 6px 9px; cursor: pointer; }
.prompt-shortcuts button:hover { border-color: var(--blue); color: var(--ink); }
.chat-composer textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 11px; padding: 11px 12px; resize: vertical; font-size: 12.5px; margin-bottom: 8px; }

.visualisation {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 60px minmax(0, 1fr) 43px;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
}
.canvas-header {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 0 18px 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(243,242,237,.97);
  backdrop-filter: blur(10px);
  transition: padding-left 220ms ease;
}
.panel-collapsed .canvas-header { padding-left: 72px; }
.canvas-title-group { min-width: 0; }
.canvas-header h2 { margin: 0; max-width: min(52vw, 680px); font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.canvas-actions { position: relative; display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.tool-button { border: 1px solid transparent; background: transparent; padding: 7px 9px; color: var(--muted); font-size: 11px; font-weight: 600; }
.tool-button:hover, .tool-button[aria-expanded="true"] { background: rgba(255,255,255,.78); border-color: var(--line); color: var(--ink); }
.danger { color: #9d4d3a !important; }
.layer-control { position: relative; }
.layer-button span { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; margin-left: 4px; padding: 2px 6px; border-radius: 999px; background: #e8e7e1; color: #686862; font-size: 9px; }
.layers-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 278px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(251,250,247,.98);
  box-shadow: 0 14px 38px rgba(40,40,38,.16);
  backdrop-filter: blur(10px);
}
.layers-popover-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 9px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.layers-popover-heading strong { font-size: 11px; }
.layers-popover-heading button { border: 0; padding: 0; background: transparent; color: var(--red); font-size: 9px; font-weight: 600; cursor: pointer; }
.layers-help { margin: 0 0 11px; color: var(--soft-muted); font-size: 8.8px; line-height: 1.4; }
.layer-options { display: block; }
.layer-chip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.layer-options-divider { height: 1px; margin: 13px 0 9px; background: var(--line); }
.layer-option.layer-chip { position: relative; display: block; cursor: pointer; }
.layer-option.layer-chip input { position: absolute; opacity: 0; pointer-events: none; }
.layer-option.layer-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--layer-colour);
  color: #51524d;
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
  transition: opacity 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.layer-option.layer-chip:hover span { box-shadow: inset 0 0 0 1px rgba(66,66,66,.14); }
.layer-option.layer-chip input:not(:checked) + span { opacity: .34; background: #efeee9; border-color: #d9d8d1; color: #73736e; }
.layer-option.layer-chip input:focus-visible + span { outline: 3px solid rgba(153,203,229,.42); outline-offset: 2px; }
.relationship-controls { display: grid; gap: 2px; }
.relationship-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 3px; cursor: pointer; }
.relationship-option > span { display: grid; gap: 2px; }
.relationship-option strong { color: #555650; font-size: 10px; font-weight: 600; }
.relationship-option small { color: var(--soft-muted); font-size: 8.5px; }
.relationship-option input { position: absolute; opacity: 0; pointer-events: none; }
.relationship-option.disabled { opacity: .42; cursor: not-allowed; }
.toggle-switch { position: relative; display: block; width: 34px; height: 20px; border-radius: 999px; background: #cfcec7; transition: background 150ms ease; }
.toggle-switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform 150ms ease; }
.relationship-option input:checked + .toggle-switch { background: var(--red); }
.relationship-option input:checked + .toggle-switch::after { transform: translateX(14px); }
.relationship-option input:focus-visible + .toggle-switch { outline: 3px solid rgba(153,203,229,.42); outline-offset: 2px; }

.canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  contain: layout paint;
  background: #f5f4ef;
}
#mapSvg { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 220ms ease; touch-action: none; }
#mapSvg.visible { opacity: 1; }
.empty-state { position: absolute; z-index: 4; left: 50%; top: 48%; transform: translate(-50%, -50%); width: min(650px, calc(100% - 50px)); text-align: center; }
.empty-state.hidden { display: none; }
.empty-logo { width: 112px; height: 112px; max-width: 34%; object-fit: contain; margin-bottom: 18px; opacity: .94; }
.empty-product-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin: 0 0 11px;
}
.empty-product-lockup strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.02em;
}
.empty-product-lockup span {
  color: var(--red);
  font-size: 9px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.empty-state h2 { margin: 7px auto 12px; max-width: 620px; font-size: 32px; line-height: 1.13; font-weight: 600; }
.empty-state p { margin: 0 auto 22px; max-width: 610px; color: var(--muted); line-height: 1.55; font-size: 14px; }
.canvas-footer { min-height: 43px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 15px; min-width: 0; padding: 0 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; background: var(--paper); }
.footer-warning { text-align: right; color: #7d7568; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.loading-overlay { position: absolute; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; text-align: center; background: rgba(245,244,239,.86); backdrop-filter: blur(5px); }
.loading-overlay strong { font-size: 18px; font-weight: 600; margin-top: 17px; }
.loading-overlay p { max-width: 390px; margin: 7px 24px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.loading-seed-icon { width: 78px; height: 78px; object-fit: contain; animation: seed-spin 1.7s linear infinite; filter: drop-shadow(0 8px 14px rgba(55,55,50,.10)); }
@keyframes seed-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .loading-seed-icon { animation: seed-breathe 1.5s ease-in-out infinite alternate; }
  @keyframes seed-breathe { from { opacity: .72; transform: scale(.96); } to { opacity: 1; transform: scale(1.02); } }
}

.toast { position: fixed; z-index: 100; left: 50%; bottom: 44px; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; background: #424242; color: #fff; border-radius: 10px; padding: 10px 14px; font-size: 11px; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: 180ms ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* D3 map */
.map-edge { fill: none; stroke: #858782; stroke-width: 1.25; opacity: .62; pointer-events: none; }
.map-edge.highlighted { stroke: #454541; stroke-width: 2; opacity: .92; }
.edge-label-layer { pointer-events: none; }
.edge-label-bg { fill: rgba(247,246,241,.96); stroke: #deddd7; stroke-width: .75; }
.edge-label-text { fill: #666762; font-size: 10.5px; font-weight: 400; letter-spacing: 0; pointer-events: none; }
.edge-label-group.dimmed { opacity: .08; }
.map-node { cursor: pointer; }
.node-card { stroke-width: 1.25; filter: drop-shadow(0 6px 12px rgba(52,53,50,.08)); }
.map-node.selected .node-card { stroke: #424242 !important; stroke-width: 2.25; filter: drop-shadow(0 8px 16px rgba(40,40,38,.16)); }
.map-node.dimmed { opacity: .18; }
.map-edge.dimmed { opacity: .08; }
.node-label { fill: #454541; font-size: 13.2px; font-weight: 600; pointer-events: none; }
.node-lens-pill { pointer-events: none; }
.node-lens-label { fill: #555650; font-size: 8px; font-weight: 650; letter-spacing: .055em; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.map-node.starting-point .node-lens-label { fill: var(--red); }
.canvas-wrap { cursor: grab; }
.canvas-wrap:active { cursor: grabbing; }

@media (max-width: 1080px) {
  .canvas-actions .tool-button:nth-last-child(2) { display: none; }
}
@media (max-width: 920px) {
  :root { --panel-width: 350px; }
  .canvas-actions .tool-button:nth-last-child(3) { display: none; }
  .canvas-header h2 { max-width: 38vw; }
}
@media (max-width: 680px) {
  .app-shell { grid-template-columns: 1fr; }
  .control-panel { position: fixed; width: min(390px, 94vw); left: 0; top: 0; box-shadow: var(--shadow); }
  .app-shell.panel-collapsed .control-panel { transform: translateX(-100%); }
  .visualisation { grid-column: 1; }
  .canvas-header { padding-left: 60px; }
  .canvas-header h2 { max-width: 36vw; font-size: 15px; }
  .canvas-actions .tool-button:not(.layer-button):not(#fitButton) { display: none; }
    .footer-warning { display: none; }
  .canvas-footer { grid-template-columns: 1fr; }
  .canvas-footer .footer-warning { display: none; }
  .layers-popover { position: fixed; top: 66px; right: 12px; }
}

/* Temporal canvas scaffold */
.temporal-zone-layer { pointer-events: none; }
.temporal-zone,
.temporal-transition { stroke: none; }
.temporal-zone.zone-current,
.temporal-zone.zone-immediate,
.temporal-zone.zone-long_term { fill: #f3f2ed; }
.temporal-transition { display: none; }
.temporal-divider {
  stroke: #9b9d96;
  stroke-width: 1.5;
  stroke-dasharray: 1 7;
  stroke-linecap: round;
  opacity: .72;
  vector-effect: non-scaling-stroke;
}
.temporal-label {
  fill: #858680;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  text-anchor: middle;
}

/* Safer optional relationship labels */
.edge-label-bg {
  fill: rgba(247,246,241,.94);
  stroke: none;
}
.edge-label-text {
  fill: #696a65;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
}

.zoom-controls {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 18;
  display: grid;
  grid-template-columns: 30px minmax(96px, 150px) 30px 44px;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(251,250,247,.94);
  box-shadow: 0 8px 24px rgba(42,43,41,.12);
  backdrop-filter: blur(9px);
}
.zoom-controls button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.zoom-controls button:hover { border-color: #aaa99f; background: #f7f6f1; }
.zoom-controls input[type="range"] {
  width: 100%;
  accent-color: var(--red);
  cursor: pointer;
}
.zoom-controls output {
  display: block;
  min-width: 38px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  text-align: center;
  cursor: pointer;
}

@media (max-width: 760px) {
  .zoom-controls { grid-template-columns: 30px 86px 30px; right: 10px; bottom: 10px; }
  .zoom-controls output { display: none; }
}

/* v2.8 — fixed temporal scaffold */
.temporal-zone-layer { pointer-events: none; }
#loadJsonInput { display: none !important; }

@media (min-width: 681px) and (max-width: 720px) {
  .panel-toggle-button { left: calc(var(--panel-width) - 21px); }
}
@media (max-width: 680px) {
  .panel-toggle-button { left: calc(min(390px, 94vw) - 21px); }
  .panel-collapsed .panel-toggle-button { left: 14px; }
}
