/* ──────────────────────────────────────────────────────────────
   RTNEAT Studio — tokens
   Dark = default lab look; Light is a clean daytime variant.
   ────────────────────────────────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg:            #0a0d12;
  --canvas:        #06080c;
  --surface:       #11151c;
  --surface-2:     #181d26;
  --surface-3:     #1d242e;
  --border:        #20262f;
  --border-strong: #2b333e;
  --hairline:      #15191f;

  --fg:            #e6ecf2;
  --fg-muted:      #8e98a6;
  --fg-dim:        #5b6371;

  --accent:        #4d9aff;
  --accent-strong: #6aabff;
  --accent-glow:   rgba(77,154,255,.45);
  --accent-soft:   rgba(77,154,255,.12);
  --accent-line:   rgba(77,154,255,.55);

  --gold:          #f5c64a;
  --gold-strong:   #ffd766;
  --gold-glow:     rgba(245,198,74,.55);
  --gold-soft:     rgba(245,198,74,.16);

  /* Agent outline colour used in the canvas renderer. Kept as a
     dedicated var so light mode can soften it independently of
     UI muted text. */
  --agent-stroke:  rgba(170,182,196,.70);
  --agent-stroke-dim: rgba(120,130,144,.55);

  --teal:          #5eead4;
  --violet:        #a78bfa;

  --green:         #4ade80;
  --green-glow:    rgba(74,222,128,.45);
  --amber:         #f59e0b;
  --grey:          #4b5563;

  --grid-line:     rgba(255,255,255,.035);
  --grid-dot:      rgba(255,255,255,.07);

  --shadow-1:      0 1px 0 rgba(255,255,255,.02) inset, 0 1px 2px rgba(0,0,0,.4);
  --shadow-2:      0 12px 32px -12px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.4);

  --radius-xs:     4px;
  --radius-sm:     6px;
  --radius:       10px;
  --radius-lg:    14px;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease:          cubic-bezier(.22,.61,.36,1);
  --ease-out:      cubic-bezier(.16,1,.3,1);

  --sidebar-w:     244px;
  --topbar-h:      54px;
  --stats-h:       46px;
  --insp-h:        300px;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg:            #f4f6f9;
  --canvas:        #fbfbfc;
  --surface:       #ffffff;
  --surface-2:     #f3f5f9;
  --surface-3:     #e9edf3;
  --border:        #e3e7ee;
  --border-strong: #cdd3dc;
  --hairline:      #eef0f4;

  --fg:            #0d141d;
  --fg-muted:      #5a6473;
  --fg-dim:        #8a93a0;

  --accent:        #2d6df6;
  --accent-strong: #1f5be0;
  --accent-glow:   rgba(45,109,246,.30);
  --accent-soft:   rgba(45,109,246,.10);
  --accent-line:   rgba(45,109,246,.55);

  /* Warmer, richer gold — pops against the white canvas while
     keeping enough contrast to read on UI surfaces. */
  --gold:          #d97706;
  --gold-strong:   #ea580c;
  --gold-glow:     rgba(217,119,6,.40);
  --gold-soft:     rgba(217,119,6,.16);

  --agent-stroke:  rgba(13,20,29,.22);
  --agent-stroke-dim: rgba(13,20,29,.32);

  --teal:          #0d9488;
  --violet:        #7c3aed;

  --green:         #16a34a;
  --green-glow:    rgba(22,163,74,.35);
  --amber:         #d97706;
  --grey:          #9ca3af;

  --grid-line:     rgba(13,20,29,.06);
  --grid-dot:      rgba(13,20,29,.12);

  --shadow-1:      0 1px 0 rgba(255,255,255,.7) inset, 0 1px 2px rgba(15,23,42,.06);
  --shadow-2:      0 8px 24px -8px rgba(15,23,42,.18), 0 2px 6px rgba(15,23,42,.08);

  color-scheme: light;
}

/* ──────────────────────────────────────────────────────────────
   Base
   ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .35s var(--ease), color .35s var(--ease);
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input  { font: inherit; color: inherit; }

.mono   { font-family: var(--font-mono); font-feature-settings: "tnum","cv11"; }
.micro  { font-size: 10px; }
.dim    { color: var(--fg-dim); }
.gold   { color: var(--gold); }

.lab {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.lab.tiny { font-size: 9.5px; letter-spacing: .16em; }

/* ──────────────────────────────────────────────────────────────
   Studio grid shell
   ────────────────────────────────────────────────────────────── */
#studio {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--insp-h) var(--stats-h);
  grid-template-areas:
    "sidebar topbar"
    "sidebar stage"
    "sidebar inspector"
    "sidebar stats";
  height: 100vh;
  width: 100vw;
  transition: grid-template-columns .32s var(--ease-out);
}
#studio.sidebar-collapsed { grid-template-columns: 0 1fr; }
#studio.sidebar-collapsed #sidebar { transform: translateX(-100%); }
#studio.inspector-collapsed { --insp-h: 0px; }

#backdrop { display: none; }

/* ──────────────────────────────────────────────────────────────
   Sidebar
   ────────────────────────────────────────────────────────────── */
#sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .32s var(--ease-out);
  min-width: 0;
}

.side-head {
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--hairline);
}

.side-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.side-search svg { color: var(--fg-dim); flex-shrink: 0; }
.side-search:focus-within { border-color: var(--accent); background: var(--surface); }
#search {
  flex: 1;
  padding: 7px 0;
  background: transparent;
  border: none;
  outline: none;
  font-size: 12px;
}
#search::placeholder { color: var(--fg-dim); }

.new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .005em;
  transition: background .15s var(--ease), transform .12s var(--ease);
}
.new-btn:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.new-btn:active { transform: scale(.985); }
.new-btn .plus { font-size: 15px; line-height: 1; font-weight: 400; }

.side-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.side-list::-webkit-scrollbar { width: 6px; }
.side-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* Session card */
.session {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 9px;
  row-gap: 2px;
  align-items: center;
  padding: 9px 10px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
  position: relative;
}
.session:hover { background: var(--surface-2); }
.session.active {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.session.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.s-dot {
  grid-row: 1;
  grid-column: 1;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  align-self: center;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  animation: dotPulse 2.6s ease-in-out infinite;
}
.s-dot.stopped { background: var(--grey); box-shadow: none; animation: none; }
.s-dot.paused  { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.35); animation: none; }

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--green-glow); }
  50%      { box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 12%, transparent); }
}

.s-name {
  grid-row: 1;
  grid-column: 2;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.s-meta {
  grid-row: 2;
  grid-column: 2 / -1;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
  display: flex;
  gap: 8px;
}
.s-meta .b { color: var(--gold); }
.session.active .s-meta { color: var(--fg-muted); }

/* Per-session 3-dots menu (rename / delete) */
.s-menu-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--fg-dim);
  font-size: 17px;
  line-height: 1;
  border-radius: var(--radius-xs);
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s var(--ease), background .12s var(--ease), color .12s var(--ease);
}
.session:hover .s-menu-btn,
.session.active .s-menu-btn { opacity: .75; }
.s-menu-btn:hover { background: var(--surface-3); color: var(--fg); opacity: 1; }

.session-menu { min-width: 152px; padding: 5px; transform-origin: top left; }
.session-menu .menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--fg);
  font-size: 12.5px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.session-menu .menu-item:hover { background: var(--surface-3); }
.session-menu .menu-item.danger { color: #f87171; }
.session-menu .menu-item.danger:hover { background: rgba(248,113,113,.12); }

.s-spark {
  grid-row: 1;
  grid-column: 3;
  width: 38px;
  height: 14px;
  display: block;
}

.side-foot {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cluster-row { display: flex; align-items: center; gap: 7px; color: var(--fg-muted); }
.cluster-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px color-mix(in srgb, var(--teal) 60%, transparent);
}

/* ──────────────────────────────────────────────────────────────
   Topbar
   ────────────────────────────────────────────────────────────── */
#topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 5;
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background .12s var(--ease), color .12s var(--ease), border-color .12s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); border-color: var(--border); }

#studio.sidebar-collapsed #sideToggle svg { transform: rotate(180deg); }
#sideToggle svg { transition: transform .3s var(--ease-out); }

.title-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.title-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--grey);
}
.status-dot.running {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  animation: dotPulse 2.6s ease-in-out infinite;
}
.status-dot.paused  { background: var(--amber); animation: none; }
.status-dot.stopped { background: var(--grey); animation: none; }

.actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  transition: background .12s var(--ease), border-color .12s var(--ease),
              color .12s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(.5px); }
.btn.ghost {
  background: transparent;
}
.btn.ghost:hover { background: var(--surface-2); }
.btn.ghost.active-btn {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}
.btn.danger-hover:hover { color: #ff7878; border-color: color-mix(in srgb, #ff7878 35%, var(--border)); }
.btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
[data-theme="light"] .btn.primary { color: white; }

/* Segmented CPU / GPU */
.seg {
  position: relative;
  display: inline-flex;
  height: 32px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.seg-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 38px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--fg-muted);
  border-radius: 4px;
  transition: color .2s var(--ease);
}
.seg-btn.active { color: white; }
.seg-thumb {
  position: absolute;
  z-index: 1;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: var(--accent);
  border-radius: 4px;
  transition: transform .26s var(--ease-out);
  box-shadow: 0 1px 6px var(--accent-glow);
}
.seg[data-pos="1"] .seg-thumb { transform: translateX(100%); }
[data-theme="light"] .seg-btn.active { color: white; }

/* 3-segment variant — used for World boundary picker */
.seg-3 .seg-thumb { width: calc((100% - 6px) / 3); }
.seg-3[data-pos="0"] .seg-thumb { transform: translateX(0); }
.seg-3[data-pos="1"] .seg-thumb { transform: translateX(100%); }
.seg-3[data-pos="2"] .seg-thumb { transform: translateX(200%); }

/* Wider variant — used in the Goal Designer drawer */
.seg-wide {
  height: 36px;
  width: 100%;
  display: flex;
}
.seg-wide .seg-btn {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
  font-size: 12px;
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}

.form-hint {
  margin-top: 2px;
  color: var(--fg-dim);
  letter-spacing: 0;
  text-transform: none;
}

/* ──────────────────────────────────────────────────────────────
   Stage / canvas hero
   ────────────────────────────────────────────────────────────── */
#stage {
  grid-area: stage;
  position: relative;
  overflow: hidden;
  background: var(--canvas);
}
#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Vignette + corner crosshair feel for lab look */
#stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.35) 100%);
  pointer-events: none;
  z-index: 2;
  opacity: .55;
}
[data-theme="light"] #stage::before {
  background: radial-gradient(ellipse at center, transparent 60%, rgba(15,23,42,.06) 100%);
}

/* Overlays */
.overlay {
  position: absolute;
  z-index: 3;
}
.overlay-tl {
  top: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.o-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
}
.o-key {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--fg-dim);
}
.o-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  min-width: 56px;
  text-align: right;
}

.card {
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}

.overlay-bl {
  bottom: 16px;
  left: 16px;
  padding: 12px 14px 12px;
  width: 280px;
}
.overlay-br {
  bottom: 16px;
  right: 16px;
  padding: 12px 14px 8px;
  width: 408px;
  max-width: calc(100vw - 32px);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 3px;
  padding: 2px 6px;
  line-height: 1;
}
.tag.cpu {
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 14%, transparent);
  border-color: color-mix(in srgb, var(--teal) 35%, transparent);
}

/* Live compute-device pill (toolbar). Read-only — the device is selected
   automatically per session; this just shows which one is running now. */
.dev-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent);
  white-space: nowrap;
  user-select: none;
  cursor: default;
}
.dev-pill .dev-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.dev-pill .dev-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--fg-muted);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dev-pill.cpu {
  background: color-mix(in srgb, var(--teal) 12%, transparent);
  border-color: color-mix(in srgb, var(--teal) 35%, transparent);
  color: var(--teal);
}
.dev-pill.cpu .dev-dot {
  background: var(--teal);
  box-shadow: 0 0 6px color-mix(in srgb, var(--teal) 50%, transparent);
}
@media (max-width: 880px) { .dev-pill .dev-name { display: none; } }

/* Timing rows */
.t-row {
  display: grid;
  grid-template-columns: 102px 1fr 56px;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.t-lab {
  font-size: 11px;
  color: var(--fg-muted);
}
.t-bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.t-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: 2px;
  transition: width .3s var(--ease-out);
  box-shadow: 0 0 6px var(--accent-glow);
}
[data-cuda="false"] .t-bar-fill,
.t-bar-fill.cpu {
  background: linear-gradient(90deg, var(--teal), color-mix(in srgb, var(--teal) 60%, white));
  box-shadow: 0 0 6px color-mix(in srgb, var(--teal) 60%, transparent);
}
.t-val {
  font-size: 10.5px;
  color: var(--fg);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Chart card */
.chart-card { padding-bottom: 6px; }
.legend { display: flex; gap: 10px; align-items: center; }
.leg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.leg-swatch {
  width: 10px; height: 2px; border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 4px var(--accent-glow);
}
.leg-best .leg-swatch { background: var(--gold); box-shadow: 0 0 4px var(--gold-glow); }
#chart { display: block; width: 100%; height: 120px; }
.chart-foot {
  display: flex;
  justify-content: space-between;
  color: var(--fg-dim);
  margin-top: 2px;
  padding: 0 2px;
}

/* ──────────────────────────────────────────────────────────────
   Stats bar
   ────────────────────────────────────────────────────────────── */
#stats {
  grid-area: stats;
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0 6px 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
#stats::-webkit-scrollbar { display: none; }

.kpi {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-right: 1px solid var(--hairline);
  white-space: nowrap;
}
.kpi:first-child { padding-left: 0; }
.kpi.push { margin-left: auto; border-right: none; border-left: 1px solid var(--hairline); }

.kpi-lab {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.kpi-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  text-align: right;
}
.kpi-unit { font-size: 10.5px; color: var(--fg-dim); }
.kpi-delta { font-size: 10.5px; color: var(--green); }
.kpi-delta.neg { color: #ff7878; }

.kpi-spark { display: inline-block; line-height: 0; }
#sparkAvg { display: block; }

/* ──────────────────────────────────────────────────────────────
   Drawer — goal designer
   ────────────────────────────────────────────────────────────── */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 380px;
  max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  z-index: 80;
  transform: translateX(0);
  transition: transform .32s var(--ease-out);
}
.drawer.hidden { transform: translateX(100%); pointer-events: none; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--hairline);
}
.drawer-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  margin-top: 4px;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.drawer-body::-webkit-scrollbar { width: 6px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.drawer-group { display: flex; flex-direction: column; gap: 10px; }
.group-head { display: flex; align-items: center; justify-content: space-between; }

.text-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
  outline: none;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.text-input:focus { border-color: var(--accent); background: var(--surface); }

/* Objective rows */
.objectives { display: flex; flex-direction: column; gap: 6px; }
.obj {
  display: grid;
  grid-template-columns: 16px 1fr 48px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.obj.disabled { opacity: .45; }
.obj-checkbox {
  appearance: none;
  width: 14px; height: 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.obj-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.obj-checkbox:checked::after {
  content: "";
  position: absolute;
  inset: 1px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2.5 6.5l2.5 2.5 4.5-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
}
.obj-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.obj-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
}
.obj-meta {
  font-size: 10.5px;
  color: var(--fg-dim);
}

.slider-row {
  display: grid;
  grid-template-columns: 110px 1fr 44px;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
}
.sr-lab { font-size: 12px; color: var(--fg-muted); }
.sr-val {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Slider styling */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  outline: none;
}
.slider::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
}
.slider::-moz-range-track {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  background: var(--accent);
  border: 2px solid var(--surface);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 0 var(--accent-soft), 0 1px 3px rgba(0,0,0,.4);
  transition: box-shadow .18s var(--ease), transform .12s var(--ease);
}
.slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 2px solid var(--surface);
  border-radius: 50%;
  cursor: pointer;
}
.slider:hover::-webkit-slider-thumb,
.slider:focus::-webkit-slider-thumb { box-shadow: 0 0 0 6px var(--accent-soft); }
.obj.disabled .slider::-webkit-slider-thumb { background: var(--fg-dim); }

.formula {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.formula code {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--fg-muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.formula code .w { color: var(--accent); font-weight: 600; }
.formula code .obj-tok { color: var(--fg); }

.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--hairline);
}

/* ──────────────────────────────────────────────────────────────
   Inspector — bottom panel (Timing | Network | Chart)
   ────────────────────────────────────────────────────────────── */
.inspector {
  grid-area: inspector;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
#studio.inspector-collapsed .inspector {
  border-top: none;
}

/* Drag handle — wider hit area than visual */
.insp-resize {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  cursor: ns-resize;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  transition: background .15s var(--ease);
}
.insp-resize:hover,
.insp-resize.dragging {
  background: var(--accent-soft);
}
.resize-grip {
  width: 48px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
  transition: background .15s var(--ease), width .15s var(--ease);
}
.insp-resize:hover .resize-grip,
.insp-resize.dragging .resize-grip {
  background: var(--accent);
  width: 52px;
}

.insp-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 22px;          /* draggable header bar (drag here to resize the panel) */
  padding: 12px 12px 0;  /* clear the resize grip strip at the very top */
  flex-shrink: 0;
  cursor: ns-resize;
}
.insp-head button { cursor: pointer; }
.insp-chart-toggle {
  width: 22px;
  height: 22px;
  margin-top: -2px;
  color: var(--fg-dim);
}
.insp-chart-toggle:hover { color: var(--accent); }
#studio.chart-collapsed .insp-chart-toggle {
  color: var(--fg-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.insp-close {
  width: 22px;
  height: 22px;
  margin-top: -2px;
}
#studio.inspector-collapsed .insp-close svg { transform: rotate(180deg); }
.insp-close svg { transition: transform .25s var(--ease-out); }

.insp-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  min-height: 0;
  transition: grid-template-columns .3s var(--ease-out);
}
#studio.chart-collapsed .insp-body { grid-template-columns: minmax(0, 1fr) 0; }
#studio.chart-collapsed .col-chart {
  opacity: 0;
  pointer-events: none;
  border-left: none;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
}
.col-chart { transition: opacity .25s var(--ease), padding .25s var(--ease); }

.insp-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 4px 14px 14px;
}
.col-chart  { border-left:  1px solid var(--hairline); }

.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  height: 22px;
}
.col-head .lab { margin: 0; }

/* Tabs over the network column */
.net-head { margin-bottom: 6px; }
.insp-tabs { display: flex; gap: 2px; }
.insp-tab {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 6px 10px;
  border: none;
  border-bottom: 1.5px solid transparent;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.insp-tab:hover { color: var(--fg-muted); }
.insp-tab.active { color: var(--fg); border-bottom-color: var(--accent); }

.insp-cursor { display: flex; align-items: center; gap: 6px; }
.insp-current {
  min-width: 130px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  padding: 2px 6px;
}
.insp-current .dim { font-weight: 400; }
.btn-xs {
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* Network drawing area + inline genome stats */
.net-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.net-wrap[hidden] { display: none; }
.net-svg {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: block;
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--surface-2) 60%, transparent), transparent 70%);
}
.net-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--fg-muted);
}
.net-stats > span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.net-stats .k { color: var(--fg-muted); }
.net-stats .v { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Batch timing pane */
.timing-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 4px;
  overflow-y: auto;
}
.timing-wrap[hidden] { display: none; }
.timing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.timing-dev {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
#timingDevice {
  color: var(--accent);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timing-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.timing-wrap .t-row {
  grid-template-columns: 140px 1fr 72px;
  padding: 5px 0;
}
.timing-wrap .t-lab { font-size: 12.5px; color: var(--fg); }
.timing-wrap .t-val { font-size: 12px; }
.timing-wrap .t-bar { height: 5px; }

.timing-foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
  margin: 10px auto 0;
  max-width: 720px;
  width: 100%;
}
.tf-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 10px;
  border-right: 1px solid var(--hairline);
}
.tf-cell:first-child { padding-left: 0; }
.tf-cell:last-child { border-right: none; padding-right: 0; }
.tf-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* Chart in right column */
.chart-wrap { flex: 1; min-height: 0; }
#chart { width: 100%; height: 100%; display: block; }
.chart-foot {
  display: flex;
  justify-content: space-between;
  color: var(--fg-dim);
  margin-top: 4px;
  padding: 0 2px;
}

/* SVG network elements */
.net-svg .node-in       { fill: var(--teal); }
.net-svg .node-hid      { fill: var(--fg-muted); }
.net-svg .node-out      { fill: var(--accent); }
.net-svg .node-stroke   { stroke: var(--surface); stroke-width: 1.5; }
.net-svg .node-best     { stroke: var(--gold); stroke-width: 2; }

.net-svg .node-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  fill: var(--fg-dim);
  text-anchor: middle;
  pointer-events: none;
}

.net-svg .edge {
  fill: none;
  stroke-linecap: round;
  transition: stroke-opacity .25s var(--ease);
}
.net-svg .edge.pos { stroke: var(--accent-line); }
.net-svg .edge.neg { stroke: #ff7878; }

/* Canvas cursor when over an agent */
#world.pickable { cursor: crosshair; }
#world.hover-agent { cursor: pointer; }
#world.panning { cursor: grabbing; }

/* Zoom controls overlay in canvas */
.zoom-ctl {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  user-select: none;
}
.zc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-muted);
  border: none;
  border-right: 1px solid var(--hairline);
  background: transparent;
  cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.zc-btn:hover { background: var(--surface-2); color: var(--accent); }
.zc-fit { color: var(--fg-dim); }
.zc-pct {
  padding: 0 10px;
  font-size: 11px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: center;
}

/* ──────────────────────────────────────────────────────────────
   Popovers — agent style picker
   ────────────────────────────────────────────────────────────── */
.pop {
  position: fixed;
  z-index: 90;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 10px 10px 12px;
  min-width: 240px;
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity .15s var(--ease), transform .18s var(--ease-out);
}
.pop.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.pop-head {
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--hairline);
  margin: -2px -2px 6px;
}
.pop-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.style-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: background .12s var(--ease), border-color .12s var(--ease);
  color: var(--fg);
}
.style-card:hover { background: var(--surface-2); }
.style-card.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.style-card.active .style-name { color: var(--accent); }

.style-preview {
  width: 48px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xs);
  color: var(--fg-muted);
}
.style-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.style-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -.005em;
}
.style-hint {
  font-size: 10.5px;
  color: var(--fg-dim);
}

/* ──────────────────────────────────────────────────────────────
   Mobile
   ────────────────────────────────────────────────────────────── */
/* Bottom nav bar is mobile-only */
#mobileNav { display: none; }

@media (max-width: 880px) {
  #studio {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;          /* fallback for old browsers */
    height: 100dvh;         /* fit the VISIBLE viewport (excludes the mobile address bar) so the bottom nav isn't pushed off-screen */
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr);
    /* Clean app shell: controls bar on top, canvas in the middle, a bottom
       nav to switch views. minmax(0,1fr) caps the column to the viewport. */
    grid-template-rows: auto minmax(0, 1fr) var(--mnav-h);
    grid-template-areas:
      "topbar"
      "stage"
      "mnav";
    --mnav-h: 58px;
  }
  /* Canvas, metrics panel and sessions list share the stage cell; the bottom
     nav decides which one is visible. The canvas is the clear default — no
     other panel sits over it. */
  main#stage, .inspector, #sidebar { grid-area: stage; min-width: 0; }
  .inspector, #sidebar { display: none; }
  #studio[data-mview="metrics"] .inspector {
    display: flex; position: relative; inset: auto;
    z-index: 40; background: var(--bg); border-top: none;
  }
  #studio[data-mview="sessions"] #sidebar {
    display: flex; position: relative; transform: none !important;
    grid-area: stage; width: 100%; height: 100%; z-index: 40;
    box-shadow: none; background: var(--bg);
  }
  footer#stats { display: none; }
  #backdrop { display: none !important; }
  #sideToggle { display: none; }

  /* Bottom navigation bar */
  #mobileNav {
    grid-area: mnav;
    display: flex;
    align-items: stretch;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  #mobileNav .mnav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: none;
    color: var(--fg-dim);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s var(--ease);
  }
  #mobileNav .mnav-btn svg { opacity: .8; }
  #mobileNav .mnav-btn.is-active { color: var(--accent); }
  #mobileNav .mnav-btn.is-active svg { opacity: 1; }
  /* Inspector docks BELOW the canvas on mobile. It used to be a full-screen
     fixed overlay (inset + translateY(0)) which — now that the panel is
     always visible — blanketed the whole simulation. Keep it in the grid. */
  .inspector {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
  }
  .insp-resize { display: none; }
  /* Stack timing + chart vertically (was a 2-row grid that overlapped). */
  .insp-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
  }
  .insp-col { min-height: 0; flex: none; }
  .col-chart {
    border-left: none;
    border-top: 1px solid var(--hairline);
    padding-top: 8px;
  }
  .chart-wrap { height: 130px; flex: none; }
  .net-wrap { min-height: 0; }
  .timing-wrap { min-height: 0; }
  .timing-foot { grid-template-columns: 1fr 1fr 1fr; gap: 0; }
  .tf-val { font-size: 15px; }
  #studio.inspector-open { --insp-h: 0px; }
  #sidebar {
    grid-area: unset;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: min(82vw, 300px);
    z-index: 90;
    transform: translateX(-100%);
    box-shadow: var(--shadow-2);
  }
  #studio.sidebar-collapsed #sidebar { transform: translateX(-100%); }
  #studio.sidebar-open #sidebar { transform: translateX(0); }
  #studio.sidebar-open #backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 85;
    animation: fadeIn .25s var(--ease) forwards;
  }
  #studio.sidebar-collapsed #sideToggle svg { transform: rotate(0); }

  #topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--topbar-h);
    align-content: center;
    gap: 8px;
    row-gap: 8px;
    padding: 8px 10px;
  }
  .title-block { min-width: 0; }
  .title { font-size: 13px; max-width: 60vw; }
  /* control buttons wrap so all of them (incl. Edit) stay reachable */
  #topbar .actions { flex-wrap: wrap; gap: 6px; margin-left: auto; }
  #topbar .actions .btn { padding: 6px 10px; }
  /* stats bar: hide sparklines, keep each KPI at natural width (no squish),
     and let the row scroll horizontally if it still doesn't fit. */
  #stats { gap: 14px; overflow-x: auto; flex-wrap: nowrap; }
  #stats .kpi { flex: 0 0 auto; }
  #stats .kpi-spark { display: none; }
  .title-row .dim { display: none; }

  .actions { gap: 4px; }
  .actions .btn { padding: 0 8px; }
  .actions .btn span:not(.mono):not(.kpi-val) { display: inline; }
  .btn { height: 30px; font-size: 11.5px; }
  .icon-btn { width: 28px; height: 28px; }

  /* hide some buttons on small */
  #resetBtn span, #stopBtn span, #pauseBtn #pauseLabel { display: none; }
  #resetBtn, #stopBtn, #pauseBtn { padding: 0 8px; }

  .seg { height: 30px; }
  .seg-btn { font-size: 10.5px; min-width: 34px; padding: 0 8px; }
  .seg-btn[data-cuda="true"] { opacity: .35; pointer-events: none; }

  /* Overlays compact */
  .overlay-tl .o-row { padding: 3px 8px; }
  .o-key { font-size: 9px; }
  .o-val { font-size: 11px; min-width: 44px; }

  .overlay-bl { width: calc(50% - 18px); padding: 10px 11px; }
  .overlay-br { width: calc(50% - 18px); }
  .t-row { grid-template-columns: 72px 1fr 44px; gap: 6px; }
  .t-lab { font-size: 10px; }
  .t-val { font-size: 9.5px; }
  #chart { height: 90px; }

  #stats { padding: 0 10px; }
  .kpi { padding: 0 10px; gap: 6px; }
  .kpi-lab { font-size: 9px; }
  .kpi-val { font-size: 12px; min-width: 30px; }
  .kpi-spark, .kpi-delta { display: none; }

  /* Drawer becomes bottom sheet */
  .drawer {
    top: auto;
    bottom: 0;
    left: 0; right: 0;
    width: 100%;
    height: auto;
    max-height: 86vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    transform: translateY(0);
  }
  .drawer.hidden { transform: translateY(100%); }
  .drawer-head::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-strong);
  }
  .drawer-head { padding-top: 22px; position: relative; }
  .drawer-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 600px) {
  .overlay-bl { width: calc(100% - 32px); }
  .overlay-br { display: none; }   /* hide chart on tiny screens to preserve the canvas */
  #minimap { width: 116px; height: 76px; left: 8px; bottom: 8px; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
