/* Grappling Lab · MatchLab V1 — Precision Fight Lab 3.0 (5 Themes + Quick Observation) */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(./fonts/geist-gyByhwUxId8gMEwcGFU.woff2) format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(./fonts/geist-gyByhwUxId8gMEwcGFU.woff2) format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/geist-gyByhwUxId8gMEwcGFU.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(./fonts/jetbrainsmono-tDbv2o-flEEny0FZhsfKu5WU4zr3EBX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/jetbrainsmono-tDbv2o-flEEny0FZhsfKu5WU4zr3EBX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2) format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(./fonts/spacegrotesk-600-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/spacegrotesk-700-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(./fonts/barlowcondensed-HTxwL3I-JCGChYJ8VI-L6OOau7B4873z3bWuQ.woff2) format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/barlowcondensed-HTxwL3I-JCGChYJ8VI-L6OOau7B46r2z3bWuQ.woff2) format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(./fonts/newsreader-600-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/newsreader-700-latin.woff2) format("woff2");
}

: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;
  --emerald-soft: rgba(52, 211, 153, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.14);
  --radius-card: 14px;
  --radius-sub: 10px;
  --radius-ctrl: 8px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --video-bg: #07090d;
  --backdrop-tint: rgba(6, 8, 12, 0.72);
}

:root[data-palette="dark"] {
  color-scheme: 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;
}

:root[data-palette="precision"] {
  color-scheme: dark;
  --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;
  --emerald: #34e5a0;
  --amber: #ffb838;
  --rose: #ff5775;
  --radius-card: 6px;
  --radius-sub: 4px;
  --radius-ctrl: 4px;
  --font-display: "Space Grotesk", "Geist", ui-sans-serif, system-ui, sans-serif;
}

:root[data-palette="atelier"] {
  color-scheme: light;
  --bg: #f2efe9;
  --surface: #fbfaf7;
  --surface-subtle: #e7e3da;
  --surface-elevated: #ffffff;
  --line: rgba(20, 23, 31, 0.15);
  --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;
  --emerald-soft: rgba(10, 104, 69, 0.12);
  --amber: #8a4900;
  --amber-soft: rgba(138, 73, 0, 0.12);
  --rose: #ae152f;
  --rose-soft: rgba(174, 21, 47, 0.12);
  --radius-card: 4px;
  --radius-sub: 3px;
  --radius-ctrl: 3px;
  --font-display: "Barlow Condensed", "Geist", ui-sans-serif, system-ui, sans-serif;
  --video-bg: #ebe6dc;
  --backdrop-tint: rgba(20, 23, 31, 0.48);
}

:root[data-palette="monolith"] {
  color-scheme: dark;
  --bg: #09090a;
  --surface: #161619;
  --surface-subtle: #101012;
  --surface-elevated: #212126;
  --line: rgba(245, 245, 241, 0.14);
  --line-strong: rgba(245, 245, 241, 0.28);
  --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;
  --emerald: #3fd68e;
  --amber: #f0b04f;
  --rose: #ff586c;
  --radius-card: 2px;
  --radius-sub: 2px;
  --radius-ctrl: 2px;
  --font-display: "Newsreader", "Geist", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-color: var(--line-strong) transparent; }
::selection { background: var(--accent-soft); color: var(--text); }
:where(input, textarea) { caret-color: var(--accent); }
:where(a) { color: var(--accent); text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

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

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; font-weight: 700; }
h1, h2 { font-family: var(--font-display); }
h1 { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.15; }
h2 { font-size: 17px; line-height: 1.3; }
h3 { font-size: 14px; line-height: 1.35; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; max-width: 100%; }
select { min-width: 0; text-overflow: ellipsis; }

.ml-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ml-muted { color: var(--muted); font-size: 13px; }
.ml-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ml-mt { margin-top: 14px; }
.ml-main { min-width: 0; }

.ml-app {
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px 18px 42px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ml-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.ml-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ml-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--radius-ctrl);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
}
.ml-breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.ml-top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.ml-theme-picker { position: relative; max-width: 100%; }
.ml-theme-picker > summary { list-style: none; gap: 4px; }
.ml-theme-picker > summary::-webkit-details-marker { display: none; }
.ml-theme-picker > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 4px;
  margin-bottom: 3px;
}
.ml-theme-picker[open] > summary::after { transform: rotate(225deg); margin-bottom: -3px; }
.ml-theme-picker:not([open]) > .ml-theme-group { display: none; }
.ml-theme-group {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  min-width: 11rem;
  background: var(--surface);
  padding: 6px;
  border-radius: var(--radius-ctrl);
  border: 1px solid var(--line-strong);
}
.ml-theme-group .ml-chip { justify-content: flex-start; }
@media (max-width: 980px) {
  .ml-theme-picker[open] { flex-basis: 100%; }
  .ml-theme-group {
    position: static;
    margin-top: 6px;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ml-btn, .ml-chip {
  min-height: 44px;
  min-width: 44px;
  padding: 7px 12px;
  border-radius: var(--radius-ctrl);
  border: 1px solid var(--line-strong);
  background: var(--surface-subtle);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.14s var(--ease-out), background 0.14s var(--ease-out), border-color 0.14s var(--ease-out);
}
.ml-btn.touch { min-height: 44px; min-width: 44px; padding: 10px 14px; }
.ml-btn.small, .ml-chip { min-height: 44px; padding: 6px 10px; font-size: 12px; }
.ml-btn:active, .ml-chip:active { transform: scale(0.97); }
.ml-btn.primary { background: var(--accent); color: var(--on-primary); border-color: var(--accent); font-weight: 700; }
.ml-btn[aria-pressed="true"], .ml-chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}
.ml-btn:disabled { opacity: 0.45; cursor: not-allowed; }

@media (hover: hover) and (pointer: fine) {
  .ml-btn:hover, .ml-chip:hover { background: var(--surface-elevated); }
  .ml-btn.primary:hover { background: var(--accent-hover); }
  .ml-outcome-btn:hover { background: var(--surface-elevated); }
}

.ml-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface-subtle);
  padding: 6px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
}
.ml-tab {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-sub);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}
.ml-tab[aria-selected="true"] {
  background: var(--surface-elevated);
  border-color: var(--accent-border);
  color: var(--accent);
}

.ml-panel-grid {
  display: grid;
  grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.ml-sidebar, .ml-stage { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ml-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.ml-compare-card { padding: 0; gap: 0; }
.ml-compare-summary {
  min-height: 44px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}
.ml-compare-summary::-webkit-details-marker { display: none; }
.ml-compare-summary::after { content: "⌄"; color: var(--text-dim); font-size: 16px; }
.ml-compare-card[open] .ml-compare-summary::after { content: "⌃"; }
.ml-compare-summary h2 { display: inline; margin: 0; }
.ml-compare-content { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.ml-compare-card:not([open]) .ml-compare-summary { border-radius: var(--radius-card); }
.ml-card-head, .ml-stage-head, .ml-form-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ml-empty-workspace {
  padding: 16px;
  border-radius: var(--radius-sub);
  border: 1px dashed var(--accent-border);
  background: var(--accent-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ml-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ml-field label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.ml-field input, .ml-field select, .ml-field textarea, .ml-select-compact {
  background: var(--surface-subtle);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctrl);
  padding: 8px 10px;
  min-height: 44px;
}
.ml-field-submit { justify-content: flex-end; gap: 8px; }
.ml-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ml-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ml-row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

.ml-session-list, .ml-event-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ml-session-item {
  width: 100%;
  min-height: 44px;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sub);
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.ml-session-item.is-active { border-color: var(--accent-border); background: var(--accent-soft); }

.ml-video-shell {
  background: var(--video-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sub);
  overflow: hidden;
  min-height: 200px;
  display: grid;
  place-items: center;
}
.ml-video-shell video { width: 100%; max-height: 420px; display: block; background: #000; }
.ml-video-empty { padding: 20px; text-align: center; max-width: 56ch; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ml-stopwatch-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 6px; }
.ml-timecode { font-size: 24px; font-weight: 700; color: var(--accent); min-width: 72px; }

.ml-transport { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; background: var(--surface-subtle); border-radius: var(--radius-sub); border: 1px solid var(--line); }
.ml-timeline-wrap { position: relative; padding: 6px 0; }
.ml-timeline-wrap input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 28px; cursor: pointer; }
.ml-timeline-pins { position: relative; height: 8px; margin-top: 2px; }
.ml-pin { position: absolute; top: 0; width: 6px; height: 8px; border-radius: 2px; transform: translateX(-50%); background: var(--accent); }
.ml-pin.problem { background: var(--rose); }
.ml-pin.success { background: var(--emerald); }

.ml-controls-row, .ml-control-group, .ml-stage-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ml-inline-label { font-size: 12px; color: var(--muted); }
.ml-time-readout { font-size: 13px; color: var(--text-dim); padding: 0 6px; }

.ml-event-form {
  padding: 14px;
  border-radius: var(--radius-sub);
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ml-quick-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ml-quick-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ml-step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}
.ml-pos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 8px; }
.ml-pos-btn {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--radius-ctrl);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  touch-action: manipulation;
}
.ml-pos-btn[aria-pressed="true"] { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent); }

.ml-outcome-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ml-outcome-btn {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-ctrl);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.14s var(--ease-out), background 0.14s var(--ease-out), border-color 0.14s var(--ease-out);
}
.ml-outcome-btn:active { transform: scale(0.97); }
.ml-outcome-btn.success[aria-pressed="true"] {
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: var(--emerald);
}
.ml-outcome-btn.problem[aria-pressed="true"] {
  background: var(--rose-soft);
  border-color: var(--rose);
  color: var(--rose);
}
.ml-outcome-btn.neutral[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}
.ml-quick-save-wrap {
  align-items: flex-start;
}

.ml-advanced-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.ml-advanced-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.ml-advanced-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
}

.ml-check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; min-height: 44px; }

.ml-event-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sub);
  border: 1px solid var(--line);
  background: var(--surface-subtle);
}

.ml-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.ml-badge.success { background: var(--emerald-soft); color: var(--emerald); border-color: rgba(52, 211, 153, 0.42); }
.ml-badge.problem { background: var(--rose-soft); color: var(--rose); border-color: rgba(244, 63, 94, 0.42); }
.ml-badge.preliminary, .ml-badge.amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(245, 158, 11, 0.42); }
.ml-badge.insufficient { background: var(--surface-elevated); color: var(--muted); border-color: var(--line-strong); }

.ml-map-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.ml-svg-wrap { background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius-sub); padding: 10px; overflow-x: auto; }
.ml-svg-wrap svg { width: 100%; height: auto; min-width: 560px; display: block; }
.ml-marker-neutral path { fill: var(--accent); }
.ml-marker-success path { fill: var(--emerald); }
.ml-marker-problem path { fill: var(--rose); }
.ml-svg-node { cursor: pointer; }
.ml-svg-node rect { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; rx: 10; }
.ml-svg-node.is-selected rect { stroke: var(--accent); fill: var(--surface-elevated); stroke-width: 2; }
.ml-svg-node text { fill: var(--text); font-family: var(--font-sans); font-size: 12px; font-weight: 600; }
.ml-svg-node .ml-svg-meta { fill: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.ml-map-inspector { padding: 14px; border-radius: var(--radius-sub); background: var(--surface-subtle); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }

.ml-intel-grid, .ml-dual-grid, .ml-goals-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ml-insight-item, .ml-goal-card, .ml-compare-box {
  padding: 12px;
  border-radius: var(--radius-sub);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ml-notice { padding: 10px 12px; border-radius: var(--radius-sub); background: var(--surface-subtle); border: 1px solid var(--line); color: var(--text-dim); font-size: 13px; }
.ml-dispatch-row { display: flex; flex-wrap: wrap; gap: 6px; }

.ml-dialog {
  max-width: 540px;
  width: calc(100% - 28px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  padding: 18px;
}
.ml-dialog::backdrop { background: var(--backdrop-tint); }
.ml-shortcuts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.ml-shortcuts-grid dt { font-weight: 700; margin-bottom: 2px; }
.ml-shortcuts-grid dd { margin: 0; color: var(--muted); font-size: 12px; }
kbd { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--surface-subtle); border: 1px solid var(--line-strong); }

.ml-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  padding: 10px 14px;
  border-radius: var(--radius-ctrl);
  background: var(--surface-elevated);
  border: 1px solid var(--accent-border);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

@media (max-width: 980px) {
  .ml-panel-grid, .ml-map-layout, .ml-intel-grid, .ml-dual-grid, .ml-goals-grid {
    grid-template-columns: 1fr;
  }
  .ml-row-4, .ml-row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .ml-app { padding: 10px 10px 36px; }
  .ml-row-2, .ml-row-3, .ml-row-4, .ml-shortcuts-grid, .ml-outcome-group { grid-template-columns: 1fr; }
  .ml-tab { flex: 1 1 auto; text-align: center; }
  .ml-pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ml-quick-save-wrap .ml-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ml-btn, .ml-chip, .ml-outcome-btn { transition: none; }
  .ml-btn:active, .ml-chip:active, .ml-outcome-btn:active { transform: none; }
}
