/* ==========================================================================
   Grappling Lab · Gameplan Studio — Precision Fight Lab (Signature Edition)
   Self-hosted Geist & JetBrains Mono, strict CSP, zero external fonts,
   full Standard / Blackout / Precision theme parity.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(./fonts/geist-gyByhwUxId8gMEwcGFU.woff2) format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(./fonts/geist-gyByhwUxId8gMEwcGFU.woff2) format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/geist-gyByhwUxId8gMEwcGFU.woff2) format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(./fonts/jetbrainsmono-tDbv2o-flEEny0FZhsfKu5WU4zr3EBX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2)
    format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(./fonts/jetbrainsmono-tDbv2o-flEEny0FZhsfKu5WU4zr3EBX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2)
    format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/jetbrainsmono-tDbv2o-flEEny0FZhsfKu5WU4zr3EBX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2)
    format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #11141a;
  --surface: #191e26;
  --surface-subtle: #161b23;
  --surface-elevated: #222a35;
  --line: rgba(227, 234, 245, 0.11);
  --line-strong: rgba(227, 234, 245, 0.23);
  --text: #f3f5f8;
  --text-dim: #bdc8d6;
  --muted: #a1afbf;
  --accent: #65dce9;
  --accent-hover: #9deaf3;
  --accent-soft: rgba(101, 220, 233, 0.11);
  --accent-border: rgba(101, 220, 233, 0.42);
  --on-primary: #11141a;
  --focus-ring: #65dce9;
  --emerald: #34d399;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --violet: #a78bfa;
  --emerald-soft: rgba(52, 211, 153, 0.14);
  --emerald-border: rgba(52, 211, 153, 0.45);
  --amber-soft: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(245, 158, 11, 0.48);
  --rose-soft: rgba(244, 63, 94, 0.14);
  --rose-border: rgba(244, 63, 94, 0.45);
  --card-radius: 14px;
  --subpanel-radius: 10px;
  --control-radius: 8px;
  --pill-radius: 6px;
  --shadow-card: inset 0 1px 0 0 rgba(255, 255, 255, 0.055), 0 8px 24px -6px rgba(0, 0, 0, 0.38), 0 2px 6px -1px rgba(0, 0, 0, 0.24);
  --shadow-subpanel: inset 0 1px 0 0 rgba(255, 255, 255, 0.04), 0 2px 8px -2px rgba(0, 0, 0, 0.25);
  --shadow-modal: inset 0 1px 0 0 rgba(255, 255, 255, 0.08), 0 28px 68px rgba(0, 0, 0, 0.68);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-family: var(--font-sans);
}

:root[data-palette="dark"] {
  --bg: #080806;
  --surface: #231d17;
  --surface-subtle: #14110e;
  --surface-elevated: #352b22;
  --line: rgba(235, 215, 184, 0.12);
  --line-strong: rgba(235, 215, 184, 0.24);
  --text: #f7f1e7;
  --text-dim: #d6c6b3;
  --muted: #b6a48f;
  --accent: #f0d9ae;
  --accent-hover: #fff0d2;
  --accent-soft: rgba(240, 217, 174, 0.13);
  --accent-border: rgba(240, 217, 174, 0.44);
  --on-primary: #14110e;
  --focus-ring: #f0d9ae;
  --emerald: #6ab88e;
  --amber: #d4a359;
  --rose: #d97a84;
  --violet: #c0a8e6;
  --emerald-soft: rgba(106, 184, 142, 0.14);
  --emerald-border: rgba(106, 184, 142, 0.45);
  --amber-soft: rgba(212, 163, 89, 0.15);
  --amber-border: rgba(212, 163, 89, 0.48);
  --rose-soft: rgba(217, 122, 132, 0.15);
  --rose-border: rgba(217, 122, 132, 0.45);
}

:root[data-palette="precision"] {
  --bg: #080d1a;
  --surface: #10192e;
  --surface-subtle: #0b1223;
  --surface-elevated: #172442;
  --line: rgba(118, 165, 255, 0.2);
  --line-strong: rgba(118, 165, 255, 0.38);
  --text: #f2f6ff;
  --text-dim: #b6c7e8;
  --muted: #90a9d6;
  --accent: #ccf53d;
  --accent-hover: #defa75;
  --accent-soft: rgba(204, 245, 61, 0.14);
  --accent-border: rgba(204, 245, 61, 0.52);
  --on-primary: #080d1a;
  --focus-ring: #defa75;
}

:root[data-palette="atelier"] {
  --bg: #f2efe9;
  --surface: #fbfaf7;
  --surface-subtle: #e7e3da;
  --surface-elevated: #ffffff;
  --line: rgba(20, 23, 31, 0.16);
  --line-strong: rgba(20, 23, 31, 0.3);
  --text: #14171f;
  --text-dim: #39404e;
  --muted: #4c5565;
  --accent: #a82a0e;
  --accent-hover: #872009;
  --accent-soft: rgba(168, 42, 14, 0.1);
  --accent-border: rgba(168, 42, 14, 0.45);
  --on-primary: #fbfaf7;
  --focus-ring: #a82a0e;
  --emerald: #0a6845;
  --amber: #8a4900;
  --rose: #ae152f;
}

:root[data-palette="monolith"] {
  --bg: #09090a;
  --surface: #161619;
  --surface-subtle: #101012;
  --surface-elevated: #212126;
  --line: rgba(245, 245, 241, 0.16);
  --line-strong: rgba(245, 245, 241, 0.32);
  --text: #f5f5f1;
  --text-dim: #c5c5c0;
  --muted: #9e9e98;
  --accent: #ff5c38;
  --accent-hover: #ff7e61;
  --accent-soft: rgba(255, 92, 56, 0.14);
  --accent-border: rgba(255, 92, 56, 0.54);
  --on-primary: #09090a;
  --focus-ring: #ff8e75;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-color: var(--line-strong) transparent;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

:where(input, textarea) {
  caret-color: var(--accent);
}

:where(a) {
  text-underline-offset: 0.18em;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.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;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Header bar */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--accent-border);
  border-radius: var(--control-radius);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  background: var(--accent-soft);
  box-shadow: var(--shadow-subpanel);
}

.kicker {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.back-portal-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.identity h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-actions,
.toolbar,
.segments,
.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.top-actions {
  gap: 6px;
  position: relative;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  color: var(--text);
  min-height: 40px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
  transition:
    background-color 150ms var(--ease-out),
    border-color 150ms var(--ease-out),
    color 150ms var(--ease-out),
    transform 100ms var(--ease-out);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.top-actions .btn {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 12px;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-primary);
  font-weight: 700;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.28), 0 1px 3px rgba(0, 0, 0, 0.32);
}

.btn.danger {
  border-color: var(--rose-border);
  background: var(--rose-soft);
  color: var(--rose);
}

.btn.small {
  font-size: 12px;
  padding: 6px 10px;
  min-height: 36px;
}

.btn.toggle-on {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.pill {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  background: var(--accent-soft);
  white-space: nowrap;
}

/* 3-column tactical studio shell */
.main {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr) 316px;
  min-height: 0;
  flex: 1;
}

.main.focus-mode {
  grid-template-columns: minmax(0, 1fr) !important;
}

.main.focus-mode .side {
  display: none !important;
}

.side {
  background: var(--surface-subtle);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.right {
  border-left: 1px solid var(--line);
  border-right: 0;
}

.side h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.side h2.side-plan-title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-transform: none;
  color: var(--text);
  margin: 6px 0 12px;
}

.side p {
  color: var(--text-dim);
  line-height: 1.55;
  font-size: 13px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  padding: 10px 12px;
  border-radius: var(--subpanel-radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-subpanel);
}

.metric strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.metric span {
  font-size: 11px;
  color: var(--muted);
}

/* Form fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-dim);
}

.field input,
.field select,
.field textarea,
.search {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  min-height: 42px;
  padding: 8px 11px;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Node list & Start-badge separation */
.node-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 44vh;
  overflow: auto;
  padding: 2px;
}

.node-list button {
  width: 100%;
  text-align: left;
  min-height: 46px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--subpanel-radius);
  padding: 9px 11px;
  transition:
    background-color 140ms var(--ease-out),
    border-color 140ms var(--ease-out),
    transform 100ms var(--ease-out);
}

.node-list button:active {
  transform: scale(0.985);
}

.node-list button > span:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
  color: var(--text);
}

.node-list button.active {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.node-list small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* Workspace & tactical canvas */
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.workspace-head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
  flex-wrap: wrap;
}

.workspace-head h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 2px;
}

.workspace-head p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.segments {
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--subpanel-radius);
}

.segments button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--pill-radius);
  padding: 7px 13px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.segments button[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-primary);
  font-weight: 700;
}

.edit-pane {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 570px;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background-color: var(--bg);
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 12px 12px;
}

.canvas-wrap.panning {
  cursor: grabbing;
}

.canvas-wrap.space-pan,
.canvas-wrap.space-pan * {
  cursor: grab !important;
}

.canvas-wrap.space-pan.panning,
.canvas-wrap.space-pan.panning * {
  cursor: grabbing !important;
}

.world {
  width: 2400px;
  height: 1550px;
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

.edges {
  position: absolute;
  inset: 0;
  width: 2400px;
  height: 1550px;
  overflow: visible;
  pointer-events: none;
}

.edge-path {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.25;
  opacity: 0.68;
  transition: stroke 140ms ease, opacity 140ms ease, stroke-width 140ms ease;
}

.edge-path.active {
  stroke: var(--accent);
  stroke-width: 3.25;
  opacity: 0.95;
}

.edge-path.selected-edge {
  stroke: var(--accent-hover);
  stroke-width: 3.75;
  opacity: 1;
}

.edge-path.path-hi {
  stroke: var(--emerald);
  stroke-width: 3.75;
  opacity: 1;
}

.edge-path.dimmed {
  opacity: 0.24;
}

.edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 18;
  pointer-events: stroke;
  cursor: pointer;
}

.edge-label {
  font-size: 12.5px;
  font-weight: 500;
  fill: var(--text-dim);
  pointer-events: all;
  cursor: pointer;
  user-select: none;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.edge-label.path-hi {
  fill: var(--emerald);
  font-weight: 700;
}

.edge-label.dimmed {
  opacity: 0.35;
}

.preview-edge {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 3;
  stroke-dasharray: 7 5;
  pointer-events: none;
}

.guide-line {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  opacity: 0.75;
  pointer-events: none;
}

/* Technique Nodes */
.node {
  position: absolute;
  width: 228px;
  min-height: 118px;
  border: 1px solid var(--line-strong);
  border-top-width: 2px;
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: 13px;
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, opacity 160ms ease, background 160ms ease;
}

.node:active {
  cursor: grabbing;
}

.node.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-card);
}

.node.root {
  border-color: var(--accent-border);
}

.node[data-kind="attack"] {
  border-top-color: var(--accent);
}

.node[data-kind="control"] {
  border-top-color: var(--violet);
}

.node[data-kind="defense"] {
  border-top-color: var(--amber);
}

.node[data-kind="result"] {
  border-top-color: var(--emerald);
}

.canvas-wrap.heatmap-on .node[data-mastery="1"] {
  background: var(--surface);
  border-color: var(--rose-border);
  border-top-color: var(--rose);
}

.canvas-wrap.heatmap-on .node[data-mastery="2"] {
  background: var(--surface);
  border-color: var(--amber-border);
  border-top-color: var(--amber);
}

.canvas-wrap.heatmap-on .node[data-mastery="3"] {
  background: var(--surface);
  border-color: var(--emerald-border);
  border-top-color: var(--emerald);
}

.canvas-wrap.heatmap-on .node[data-mastery="0"] {
  opacity: 0.62;
}

.node.filtered-out {
  opacity: 0.22 !important;
}

.node.multi-selected {
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-card);
}

.node.path-hi {
  border-color: var(--emerald) !important;
  box-shadow: 0 0 0 2px var(--emerald-soft), var(--shadow-card) !important;
}

.node.drop-target {
  border-color: var(--emerald) !important;
  box-shadow: 0 0 0 3px var(--emerald-soft), var(--shadow-card) !important;
}

.node .nhead {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
}

.tag.defense {
  color: var(--amber);
}

.tag.result {
  color: var(--emerald);
}

.tag.control {
  color: var(--violet);
}

.node .index {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  color: var(--muted);
}

.node strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  color: var(--text);
}

.node p {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-dim);
  margin: 6px 0 0;
  max-height: 40px;
  overflow: hidden;
}

.node-cue {
  margin-top: 6px;
  padding: 4px 7px;
  border-radius: var(--pill-radius);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  color: var(--muted);
}

.mastery-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid currentColor;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.node-port {
  position: absolute;
  right: -11px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-elevated);
  border: 2px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: crosshair;
  opacity: 0.85;
  transition: transform 120ms ease, opacity 120ms ease, background-color 120ms ease;
}

.node-port::before {
  content: "";
  position: absolute;
  inset: -11px;
  border-radius: 50%;
}

.node.selected .node-port,
.node-port:focus-visible {
  opacity: 1;
}

.start-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--pill-radius);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  margin-left: 6px;
  vertical-align: middle;
}

.warn-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--pill-radius);
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-border);
  margin-left: 6px;
  vertical-align: middle;
}

.inline-title-input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: var(--pill-radius);
  padding: 3px 6px;
  font-size: 14px;
  font-weight: 700;
  outline: none;
}

.inline-edge-editor {
  position: absolute;
  z-index: 12;
  transform: translate(-50%, -50%);
  width: 240px;
  padding: 7px 10px;
  border-radius: var(--subpanel-radius);
  background: var(--surface-elevated);
  color: var(--text);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-modal);
  font-size: 13px;
  outline: none;
}

.canvas-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-strong);
  border-radius: var(--subpanel-radius);
  padding: 5px;
  align-items: center;
  box-shadow: var(--shadow-card);
}

.canvas-controls output {
  display: block;
  min-width: 44px;
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-dim);
}

.hint {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--subpanel-radius);
  color: var(--text-dim);
  padding: 8px 12px;
  font-size: 12px;
  max-width: calc(100% - 28px);
}

.canvas-bottom {
  padding: 10px 18px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--surface-subtle);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.status {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--emerald);
  font-family: var(--font-mono);
  font-size: 11px;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
}

.notice {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--subpanel-radius);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

/* Right inspector */
.inspector-empty {
  padding: 20px 0;
  color: var(--muted);
  line-height: 1.65;
}

.edge-item {
  border: 1px solid var(--line);
  border-radius: var(--subpanel-radius);
  padding: 11px;
  margin: 8px 0;
  background: var(--surface);
}

.edge-item.focused {
  border-color: var(--accent-border);
  background: var(--surface-elevated);
}

.edge-item .row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.edge-item .edge-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.edge-item input,
.edge-item select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  padding: 7px 9px;
  font-size: 12px;
}

.edge-item input:focus,
.edge-item select:focus {
  border-color: var(--accent);
  outline: none;
}

.inspector-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.inspector-section h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 10px;
  letter-spacing: 0.06em;
}

.incoming-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.incoming-btn {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}

.incoming-btn small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.plan-switcher {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  border-radius: var(--subpanel-radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.plan-switcher select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  padding: 8px 9px;
  font-size: 12px;
}

.plan-switcher .row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.plan-switcher .btn.small {
  flex: 1;
  min-height: 36px;
  padding: 5px 7px;
  font-size: 11.5px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.filter-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  min-height: 30px;
  cursor: pointer;
}

.filter-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.health-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 9px;
  padding: 8px 11px;
  border-radius: var(--control-radius);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  border: 1px solid var(--emerald-border);
  background: var(--emerald-soft);
  color: var(--emerald);
  cursor: pointer;
}

.health-pill.warn {
  border-color: var(--amber-border);
  background: var(--amber-soft);
  color: var(--amber);
}

.warn-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--subpanel-radius);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  color: var(--amber);
  font-size: 12px;
  line-height: 1.45;
}

.path-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--subpanel-radius);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.export-menu,
.ctx-menu {
  position: fixed;
  z-index: 28;
  min-width: 248px;
  padding: 6px;
  border-radius: var(--card-radius);
  background: var(--surface-elevated);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-menu button,
.ctx-menu button {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  border-radius: var(--control-radius);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
  min-height: 36px;
  cursor: pointer;
}

.export-menu button:disabled,
.ctx-menu button:disabled {
  opacity: 0.45;
  cursor: default;
}

.export-menu button small,
.ctx-menu button small {
  color: var(--muted);
  font-size: 11px;
}

.export-menu button.danger-item,
.ctx-menu button.danger-item {
  color: var(--rose);
}

.menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 6px;
}

.ctx-label {
  padding: 4px 10px 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.marquee-box {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  background: var(--accent-soft);
  border: 1.5px dashed var(--accent);
  border-radius: var(--pill-radius);
}

.group-bar {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--surface-elevated);
  border: 1px solid var(--accent-border);
  border-radius: var(--subpanel-radius);
  padding: 6px 10px;
  box-shadow: var(--shadow-modal);
}

.group-bar .count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-right: 4px;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}

.minimap {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  width: 196px;
  height: 127px;
  border-radius: var(--subpanel-radius);
  background: var(--surface-subtle);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: crosshair;
}

.minimap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.minimap-view {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.connect-popover {
  position: absolute;
  z-index: 8;
  width: 286px;
  padding: 14px;
  border-radius: var(--card-radius);
  background: var(--surface-elevated);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-modal);
}

.connect-popover h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text);
}

.connect-popover input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.connect-popover input:focus {
  border-color: var(--accent);
  outline: none;
}

.connect-popover .pop-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}

/* Practice Simulator */
.simulator {
  padding: 24px;
  max-width: 740px;
  width: 100%;
  margin: 24px auto;
}

.sim-toolbar {
  margin-top: 18px;
}

.sim-card {
  padding: 24px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
}

.sim-card h3 {
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.02em;
  margin: 10px 0;
  line-height: 1.2;
}

.sim-card p {
  color: var(--text-dim);
  line-height: 1.6;
}

.sim-choice {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-strong);
  border-radius: var(--subpanel-radius);
  min-height: 52px;
  transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out), transform 100ms var(--ease-out);
}

.sim-choice:active {
  transform: scale(0.99);
}

.sim-choice.drilled {
  border-color: var(--emerald-border);
}

.sim-choice .drill-dot {
  font-size: 11px;
  color: var(--emerald);
  margin-left: 6px;
}

.sim-history {
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.sim-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.sim-metric {
  padding: 10px 12px;
  border-radius: var(--subpanel-radius);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
}

.sim-metric strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.sim-metric span {
  font-size: 11px;
  color: var(--muted);
}

.sim-options-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: center;
}

.sparring-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--subpanel-radius);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-size: 13px;
  color: var(--text);
}

.sparring-summary {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--subpanel-radius);
  background: var(--surface-subtle);
  border: 1px solid var(--line-strong);
}

.sparring-summary h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--accent);
}

.sparring-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.sim-cue-box {
  margin: 10px 0 4px;
  padding: 9px 12px;
  border-radius: var(--control-radius);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--text);
  font-size: 12px;
}

.sim-rate-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sim-rate-bar span {
  font-size: 11px;
  color: var(--muted);
  margin-right: 4px;
}

.rate-btn {
  background: var(--surface-subtle);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  min-height: 32px;
  cursor: pointer;
}

.rate-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.sim-timer-track {
  height: 5px;
  border-radius: 99px;
  background: var(--surface-subtle);
  overflow: hidden;
  margin: 12px 0 6px;
}

.sim-timer-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transition: width 80ms linear;
}

.sim-timer-fill.urgent {
  background: var(--rose);
}

.recall-veil {
  margin-top: 14px;
  padding: 18px;
  border-radius: var(--subpanel-radius);
  border: 1px dashed var(--accent-border);
  background: var(--surface-subtle);
  text-align: center;
}

.recall-veil p {
  margin: 0 0 12px;
  color: var(--text-dim);
  font-size: 13px;
}

.sim-crumb {
  background: none;
  border: 0;
  color: var(--accent);
  padding: 2px 4px;
  border-radius: var(--pill-radius);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: inherit;
  cursor: pointer;
}

.sim-key {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--pill-radius);
  background: var(--surface-elevated);
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  flex: none;
}

.sim-choice-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Non-obstructing bottom-center toast (never covers right inspector controls) */
.toast {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 25;
  padding: 11px 16px;
  border-radius: var(--subpanel-radius);
  background: var(--surface-elevated);
  border: 1px solid var(--accent-border);
  color: var(--text);
  box-shadow: var(--shadow-card);
  max-width: min(440px, calc(100vw - 32px));
  font-size: 13px;
}

.toast-undo-btn {
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: var(--pill-radius);
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 30px;
}

/* Modals */
.studio-modal {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.86);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  padding: 16px;
}

.studio-card {
  width: 100%;
  max-width: 580px;
  max-height: 86dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px;
  border-radius: var(--card-radius);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--accent);
  box-shadow: var(--shadow-modal);
}

.studio-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.studio-card h4 {
  margin: 16px 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.quick-text-area {
  width: 100%;
  min-height: 210px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--subpanel-radius);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
}

.quick-text-area:focus {
  border-color: var(--accent);
}

.shortcut-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.shortcut-row kbd {
  font-family: var(--font-mono);
  background: var(--surface-subtle);
  border: 1px solid var(--line-strong);
  border-radius: var(--pill-radius);
  padding: 2px 7px;
  font-size: 11px;
  color: var(--accent);
}

.cmd-input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--subpanel-radius);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 10px;
  outline: none;
}

.cmd-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 52dvh;
  overflow: auto;
}

.cmd-item {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--control-radius);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  cursor: pointer;
}

.cmd-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.cmd-item small {
  color: var(--muted);
  font-size: 11px;
}

.bar-stack {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-subtle);
  margin: 8px 0 10px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.analysis-stat {
  padding: 10px;
  border-radius: var(--subpanel-radius);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
}

.analysis-stat strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 19px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.analysis-stat span {
  font-size: 11px;
  color: var(--muted);
}

.analysis-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 5px 0 0;
  padding: 6px 10px;
  border-radius: var(--control-radius);
  background: var(--surface-subtle);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  cursor: pointer;
}

.cycle-item {
  padding: 8px 10px;
  border-radius: var(--control-radius);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  line-height: 1.45;
}

.drop-overlay {
  position: fixed;
  inset: 12px;
  z-index: 30;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: var(--card-radius);
  background: rgba(17, 20, 26, 0.88);
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled):not(.primary) {
    background: var(--surface-elevated);
    border-color: var(--accent-border);
  }
  .btn.primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
  }
  .node-list button:hover {
    border-color: var(--accent-border);
    background: var(--surface-elevated);
  }
  .sim-choice:hover {
    background: var(--surface-elevated);
    border-color: var(--accent-border);
  }
  .export-menu button:not(:disabled):hover,
  .ctx-menu button:not(:disabled):hover {
    background: var(--surface);
  }
  .export-menu button.danger-item:not(:disabled):hover,
  .ctx-menu button.danger-item:not(:disabled):hover {
    background: var(--rose-soft);
  }
  .node:hover .node-port {
    opacity: 1;
  }
  .node-port:hover {
    transform: translateY(-50%) scale(1.16);
    background: var(--accent-soft);
  }
  .edge-label:hover {
    fill: var(--text);
  }
  .incoming-btn:hover {
    border-color: var(--accent-border);
    background: var(--surface-elevated);
  }
  .sim-crumb:hover {
    background: var(--accent-soft);
  }
  .cmd-item:hover {
    background: var(--accent-soft);
    border-color: var(--accent-border);
  }
  .analysis-chip-btn:hover {
    border-color: var(--accent-border);
    background: var(--surface-elevated);
  }
}

@media (pointer: coarse), (max-width: 767px) {
  .btn,
  .btn.primary,
  .top-actions .btn,
  .btn.small,
  .plan-switcher .btn.small,
  .health-pill,
  .filter-chip,
  .rate-btn,
  .segments button,
  .analysis-chip-btn {
    min-height: 44px;
  }

  #zoom-in,
  #zoom-out,
  #fit {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 1140px) {
  .main {
    grid-template-columns: 210px minmax(0, 1fr) 270px;
  }
  .side {
    padding: 16px 12px;
  }
}

@media (max-width: 870px) {
  .main {
    grid-template-columns: minmax(0, 1fr);
  }
  .side.left {
    order: 2;
    border-top: 1px solid var(--line);
    border-right: 0;
  }
  .right {
    order: 3;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .workspace {
    order: 1;
  }
  .node-list {
    max-height: 230px;
  }
  .canvas-wrap {
    min-height: 540px;
  }
  .top {
    flex-wrap: wrap;
    padding: 12px 14px;
  }
  .top-actions {
    width: 100%;
  }
  .top-actions .btn {
    flex: 1;
  }
}

@media (max-width: 680px) {
  .minimap {
    display: none;
  }
  .sim-metrics,
  .analysis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .toast {
    left: 12px;
    right: 12px;
    transform: none;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .btn {
    font-size: 12px;
  }
  .workspace-head {
    padding: 11px;
  }
  .identity h1 {
    font-size: 16px;
  }
  .pill {
    font-size: 10px;
  }
  .hint {
    font-size: 11px;
  }
  .canvas-wrap {
    min-height: 480px;
  }
  .simulator {
    padding: 14px;
  }
  .sim-card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
