:root {
  color-scheme: dark;
  --bg: #070b16;
  --bg-2: #0c1220;
  --panel: #111827;
  --panel-2: #151b2c;
  --line: #25324a;
  --line-strong: #36517a;
  --text: #e6edf7;
  --muted: #94a3b8;
  --subtle: #64748b;
  --accent: #ef476f;
  --accent-2: #60a5fa;
  --good: #42e8b4;
  --warn: #fbbf24;
  --shadow: 0 24px 80px rgba(0, 0, 0, .42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body, #root { width: 100%; min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 78% 12%, rgba(14, 165, 233, .14), transparent 34rem),
    radial-gradient(circle at 18% 90%, rgba(239, 71, 111, .12), transparent 32rem),
    linear-gradient(135deg, #070b16 0%, #0a1020 52%, #080b14 100%);
  color: var(--text);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  border-radius: .75rem;
  background: var(--accent-2);
  color: #06111f;
  padding: .75rem 1rem;
  font-weight: 800;
}
.skip-link:focus { top: 1rem; }
.source-nav {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.source-nav:focus-within {
  z-index: 999;
  width: auto;
  height: auto;
  clip: auto;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  background: #0b1120;
  border: 1px solid var(--line);
  border-radius: .75rem;
  margin: .75rem;
  padding: .75rem;
}
.source-nav a { color: #bfdbfe; }
.noscript {
  margin: 3rem auto;
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: rgba(17, 24, 39, .88);
  padding: 2rem;
}

.ag-app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 36rem;
  overflow: hidden;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(8, 13, 25, .94);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  gap: .8rem;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(96, 165, 250, .45);
  border-radius: .8rem;
  background: rgba(37, 99, 235, .14);
  color: var(--accent-2);
  font-weight: 900;
}
.brand-title { font-weight: 850; line-height: 1.1; }
.brand-subtitle { color: var(--muted); font-size: .72rem; margin-top: .15rem; }
.sidebar-scroll {
  min-height: 0;
  overflow: auto;
  padding: .75rem;
  scrollbar-gutter: stable;
}
.module-group-title {
  margin: 1rem .55rem .45rem;
  color: var(--subtle);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.module-button {
  width: 100%;
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: center;
  margin: .18rem 0;
  border: 1px solid transparent;
  border-radius: .75rem;
  background: transparent;
  color: #cbd5e1;
  padding: .65rem .7rem;
  text-align: left;
}
.module-button:hover {
  border-color: rgba(96, 165, 250, .25);
  background: rgba(30, 41, 59, .62);
  color: #fff;
}
.module-button.is-active {
  border-color: rgba(239, 71, 111, .55);
  background: linear-gradient(90deg, rgba(239, 71, 111, .25), rgba(30, 41, 59, .35));
  color: #fff;
}
.module-icon { opacity: .95; }
.module-name { display: block; font-size: .86rem; font-weight: 750; line-height: 1.2; }
.module-meta { display: block; margin-top: .12rem; color: var(--subtle); font-size: .68rem; }
.module-badge {
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 999px;
  color: var(--subtle);
  padding: .14rem .38rem;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
}
.module-badge.live { border-color: rgba(66, 232, 180, .35); color: var(--good); }
.module-badge.full { border-color: rgba(251, 191, 36, .35); color: var(--warn); }
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: .8rem 1rem;
  color: var(--muted);
  font-size: .78rem;
}
.sidebar-footer a { color: var(--accent-2); text-decoration: none; }

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  flex: 0 0 auto;
  z-index: 10;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 4.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 22, .88);
  backdrop-filter: blur(18px);
  padding: .75rem 1rem;
}
.mobile-menu {
  display: none;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--panel);
  color: var(--text);
  padding: .55rem .8rem;
}
.topbar-title { min-width: 10rem; }
.topbar-title strong { display: block; font-size: .96rem; }
.topbar-title span { display: block; color: var(--muted); font-size: .78rem; margin-top: .15rem; }
.topbar-actions {
  display: flex;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
  gap: .6rem;
  align-items: center;
}
.searchbox {
  display: flex;
  flex: 1 1 20rem;
  align-items: center;
  gap: .5rem;
  min-width: 14rem;
  max-width: 34rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: rgba(15, 23, 42, .78);
  padding: .45rem .65rem;
}
.searchbox input {
  width: 100%;
  min-width: 8rem;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
}
.searchbox-button {
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: .55rem;
  background: rgba(96, 165, 250, .12);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: .74rem;
  padding: .28rem .5rem;
}
.searchbox-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tm-search-scopes__global {
  display: flex;
  flex: 0 1 18rem;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}
.tm-search-scopes__global label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.tm-search-scopes__global input {
  flex: 1 1 8rem;
  min-width: 7rem;
  width: auto;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: rgba(15, 23, 42, .78);
  color: var(--text);
  padding: .5rem .65rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 999px;
  background: rgba(96, 165, 250, .08);
  color: #bfdbfe;
  padding: .34rem .62rem;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: auto;
  padding: clamp(.8rem, 1.2vw, 1.25rem);
  scrollbar-gutter: stable;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(min(100%, 22rem), .75fr);
  gap: 1rem;
  align-items: start;
}
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(17, 24, 39, .82);
  box-shadow: var(--shadow);
}
.hero-copy { padding: 1.4rem; }
.eyebrow {
  color: #93c5fd;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; line-height: 1.08; }
h1 {
  margin-top: .65rem;
  max-width: 15ch;
  font-size: clamp(2.35rem, 4.8vw, 4.75rem);
  letter-spacing: -.06em;
  text-wrap: balance;
}
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1rem; }
p { color: #cbd5e1; line-height: 1.65; }
.hero p { max-width: 74ch; }
.cta-row, .toolbar, .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}
.button {
  border: 1px solid var(--line-strong);
  border-radius: .75rem;
  background: rgba(15, 23, 42, .86);
  color: var(--text);
  padding: .72rem .95rem;
  font-weight: 820;
  text-decoration: none;
}
.button:hover { border-color: var(--accent-2); background: rgba(30, 41, 59, .95); }
.button.primary { border-color: rgba(239, 71, 111, .7); background: var(--accent); color: #020617; }
.button.ghost { border-color: transparent; color: #bfdbfe; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}
.metric {
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: rgba(15, 23, 42, .66);
  padding: .85rem;
}
.metric strong { display: block; font-size: 1.35rem; }
.metric span { color: var(--muted); font-size: .78rem; }
.notice {
  border: 1px solid rgba(251, 191, 36, .35);
  border-radius: 1rem;
  background: rgba(120, 53, 15, .18);
  padding: 1rem;
  align-self: start;
}
.notice strong { color: #fde68a; }
.notice p { margin-bottom: 0; }
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.grid > * { min-width: 0; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }
.card { min-width: 0; padding: 1rem; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
}
.card-head p { margin: .25rem 0 0; color: var(--muted); font-size: .86rem; }
.select, .text-field {
  border: 1px solid var(--line);
  border-radius: .72rem;
  background: #0b1120;
  color: var(--text);
  padding: .65rem .75rem;
}
.list {
  display: grid;
  align-content: start;
  gap: .45rem;
  max-height: 34rem;
  overflow: auto;
  padding-right: .2rem;
  scrollbar-gutter: stable;
}
.list-item {
  width: 100%;
  border: 1px solid rgba(37, 50, 74, .8);
  border-radius: .75rem;
  background: rgba(10, 16, 30, .74);
  color: var(--text);
  padding: .75rem;
  text-align: left;
}
.list-item:hover, .list-item.is-selected { border-color: rgba(239, 71, 111, .55); background: rgba(239, 71, 111, .10); }
.item-title {
  display: flex;
  min-width: 0;
  gap: .5rem;
  justify-content: space-between;
  font-weight: 800;
}
.item-title > * {
  min-width: 0;
  overflow-wrap: break-word;
}
.item-meta { margin-top: .28rem; color: var(--subtle); font-size: .75rem; }
.navigator-workspace,
.split-workspace {
  display: grid;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  gap: 1rem;
}
.navigator-workspace { grid-template-columns: minmax(0, 1fr); }
.navigator-workspace.has-detail {
  grid-template-columns: minmax(32rem, 1fr) clamp(20rem, 25vw, 28rem);
}
.matrix-panel,
.split-list-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}
.matrix-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .65rem;
  justify-content: space-between;
  min-width: 0;
  margin: 0 -.15rem .65rem;
  border-top: 1px solid rgba(37, 50, 74, .7);
  border-bottom: 1px solid rgba(37, 50, 74, .7);
  background: rgba(8, 13, 25, .48);
  padding: .5rem;
}
.matrix-control-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}
.matrix-control {
  min-height: 1.9rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: #0b1120;
  color: #cbd5e1;
  padding: .3rem .55rem;
  font-size: .72rem;
  font-weight: 750;
}
.matrix-control:hover { border-color: var(--accent-2); color: #fff; }
.matrix-scale {
  min-width: 3.4rem;
  color: #93c5fd;
  font: 750 .72rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}
.matrix-help {
  color: var(--subtle);
  font-size: .7rem;
  white-space: nowrap;
}
.matrix-viewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 24rem;
  border: 1px solid rgba(37, 50, 74, .88);
  border-radius: .65rem;
  background:
    linear-gradient(rgba(96, 165, 250, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, .035) 1px, transparent 1px),
    #0d1117;
  background-size: 24px 24px;
  cursor: grab;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}
.matrix-viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.matrix-track {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  width: max-content;
  min-height: 100%;
  padding: .5rem;
  zoom: var(--matrix-scale, .82);
}
.tactic-column {
  flex: 0 0 138px;
  width: 138px;
  min-width: 138px;
}
.tactic-title {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  min-height: 4rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 3px;
  border: 1px solid rgba(248, 113, 113, .3);
  border-radius: .3rem;
  background: #7f1d1d;
  padding: .35rem .3rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.tactic-name {
  color: #fff;
  font-size: .68rem;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}
.tactic-meta {
  margin-top: .16rem;
  color: #fca5a5;
  font: 700 .55rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.tactic-expand {
  margin-top: .3rem;
  border: 1px solid rgba(254, 202, 202, .24);
  border-radius: .3rem;
  background: rgba(0, 0, 0, .2);
  color: #fee2e2;
  padding: .18rem .38rem;
  font-size: .55rem;
  font-weight: 800;
}
.tactic-expand:hover { border-color: rgba(254, 202, 202, .7); background: rgba(0, 0, 0, .38); }
.tactic-techniques { display: grid; gap: 3px; }
.technique-group { min-width: 0; }
.technique-row {
  position: relative;
  display: flex;
  min-height: 3.25rem;
  border-left: 3px solid #374151;
  border-radius: .24rem;
  background: #1f2937;
  overflow: hidden;
}
.technique {
  width: 100%;
  min-width: 0;
  min-height: 3.25rem;
  margin: 0;
  border: 0;
  background: transparent;
  color: #dbeafe;
  padding: .4rem .45rem;
  text-align: left;
}
.technique.has-subtechniques { padding-right: 1.65rem; }
.technique:hover,
.technique.is-hit {
  background: rgba(37, 99, 235, .24);
}
.technique.is-hit { box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .75); }
.technique.is-selected {
  background: #7f1d1d;
  box-shadow: inset 0 0 0 1px #ef476f;
}
.technique-row:has(.technique.is-selected) { border-left-color: #ef476f; }
.tech-id {
  display: block;
  color: #93c5fd;
  font: 900 .58rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1;
}
.tech-name {
  display: -webkit-box;
  margin-top: .22rem;
  overflow: hidden;
  color: #f1f5f9;
  font-size: .65rem;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.subtechnique-toggle {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  width: 1.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  border-left: 1px solid rgba(148, 163, 184, .15);
  background: rgba(0, 0, 0, .25);
  color: #94a3b8;
  font-size: .72rem;
}
.subtechnique-toggle:hover { background: rgba(0, 0, 0, .48); color: #fff; }
.subtechnique-count { font-size: .5rem; font-weight: 800; }
.subtechnique-list {
  display: grid;
  gap: 2px;
  margin: 2px 0 3px .65rem;
  border-left: 2px solid #1d4ed8;
  padding-left: 2px;
}
.technique-sub {
  min-height: 2.35rem;
  border-radius: .2rem;
  background: #111827;
  padding: .32rem .4rem;
}
.technique-sub.is-selected { background: #7f1d1d; }
.technique-sub .tech-name {
  font-size: .58rem;
  -webkit-line-clamp: 2;
}
.more-count, .empty-column {
  display: block;
  color: var(--subtle);
  font-size: .7rem;
  padding: .5rem;
}
.navigator-detail,
.split-detail-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}
.navigator-detail .card-head {
  position: sticky;
  top: -1rem;
  z-index: 3;
  margin: -1rem -1rem .85rem;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 24, 39, .97);
  padding: 1rem;
}
.detail-source-link {
  display: inline-block;
  margin-top: .45rem;
  color: #93c5fd;
  font-size: .78rem;
  font-weight: 750;
  text-decoration: none;
}
.detail-source-link:hover { text-decoration: underline; }
.split-workspace {
  grid-template-columns: minmax(20rem, .78fr) minmax(0, 1.22fr);
}
.split-list-panel .workspace-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}
.split-detail-panel > .card { min-height: 100%; }
.detail {
  display: grid;
  gap: .8rem;
}
.detail-section {
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: rgba(8, 13, 25, .56);
  padding: .85rem;
}
.detail-section h3 { margin-bottom: .4rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 999px;
  color: #cbd5e1;
  padding: .28rem .48rem;
  font-size: .72rem;
}
.library-list { max-height: 48rem; }
.library-item {
  display: grid;
  gap: .35rem;
}
.library-item p {
  margin: 0;
  color: #cbd5e1;
  font-size: .88rem;
}
.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.item-actions a {
  color: #bfdbfe;
  font-weight: 800;
  text-decoration: none;
}
.source-grid {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}
.source-card {
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: rgba(8, 13, 25, .66);
  color: var(--text);
  display: grid;
  gap: .25rem;
  padding: .85rem;
  text-decoration: none;
}
.source-card:hover { border-color: rgba(96, 165, 250, .55); }
.source-card span, .small-note { color: var(--muted); font-size: .84rem; }
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .75rem;
}
.module-card {
  min-height: 9rem;
  border: 1px solid var(--line);
  border-radius: .95rem;
  background: rgba(15, 23, 42, .66);
  padding: .9rem;
  text-align: left;
  color: var(--text);
}
.module-card:hover { border-color: rgba(96, 165, 250, .55); }
.module-card strong { display: block; margin: .35rem 0; }
.module-card p { margin: 0; color: var(--muted); font-size: .82rem; }
.module-card-link {
  color: #93c5fd;
  display: block;
  font-size: .7rem;
  line-height: 1.35;
  margin-top: .55rem;
  overflow-wrap: anywhere;
}
.coverage-bars { display: grid; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: 12rem 1fr 3rem; gap: .6rem; align-items: center; color: var(--muted); font-size: .78rem; }
.bar { height: .58rem; border-radius: 999px; background: #0b1120; overflow: hidden; border: 1px solid var(--line); }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .62);
  padding: 1rem;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  width: min(680px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 1rem;
  background: #0b1120;
  box-shadow: var(--shadow);
}
.workspace-dialog-search {
  width: 100%;
  min-width: 0;
}
.modal-head, .modal-body, .modal-actions { padding: 1rem; }
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}
.modal-body ul { color: #cbd5e1; line-height: 1.65; }
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  border-top: 1px solid var(--line);
}
.close-button {
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: transparent;
  color: var(--muted);
  padding: .4rem .6rem;
}
.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 120;
  max-width: 28rem;
  border: 1px solid rgba(66, 232, 180, .35);
  border-radius: .9rem;
  background: rgba(6, 78, 59, .94);
  color: #d1fae5;
  padding: .85rem 1rem;
  box-shadow: var(--shadow);
}
.hidden { display: none !important; }

@media (max-width: 1080px) {
  .ag-app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 50;
    transform: translateX(-102%);
    transition: transform .2s ease;
    width: min(88vw, 320px);
  }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
  .topbar { flex-wrap: wrap; }
  .topbar-title { flex: 1 1 14rem; }
  .topbar-actions { flex: 1 1 100%; justify-content: stretch; }
  .searchbox { min-width: 0; width: auto; max-width: none; }
  .tm-search-scopes__global input { width: 9rem; }
  .hero { grid-template-columns: 1fr; }
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: 1 / -1; }
}
@media (min-width: 1081px) and (max-width: 1420px) {
  .main { padding: 1rem; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  h1 { max-width: 18ch; font-size: clamp(2.4rem, 5vw, 4.1rem); }
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .topbar-title { flex: 1 1 100%; }
  .topbar-actions { flex: 1 1 100%; justify-content: stretch; }
  .searchbox { max-width: none; }
  .navigator-workspace.has-detail {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
  }
  .matrix-help { display: none; }
}
@media (max-width: 900px) {
  .navigator-workspace,
  .navigator-workspace.has-detail,
  .split-workspace {
    height: auto;
    min-height: 100%;
    grid-template-columns: minmax(0, 1fr);
  }
  .matrix-panel {
    height: clamp(38rem, 82dvh, 50rem);
    min-height: 0;
  }
  .matrix-viewport { min-height: 0; }
  .navigator-detail,
  .split-detail-panel {
    max-height: none;
    overflow: visible;
  }
  .split-list-panel {
    height: clamp(30rem, 68dvh, 40rem);
    min-height: 0;
  }
}
@media (max-width: 680px) {
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-title { flex: 0 0 auto; width: 100%; }
  .topbar-actions {
    flex: 0 0 auto;
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .searchbox {
    flex: 0 0 auto;
    width: 100%;
    min-height: 2.75rem;
  }
  .tm-search-scopes__global { align-items: stretch; }
  .tm-search-scopes__global input { flex: 1; width: auto; min-width: 0; }
  .main { padding: .85rem; }
  h1 { max-width: none; font-size: clamp(1.9rem, 10vw, 3rem); }
  .metrics { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; }
  .card-head { flex-direction: column; }
  .card-head .toolbar { width: 100%; }
  .card-head .toolbar > * { flex: 1 1 auto; }
  .card-head .toolbar .select,
  .card-head .toolbar .button { width: 100%; }
  .matrix-panel { padding: .7rem; }
  .matrix-controls {
    align-items: stretch;
    flex-direction: column;
  }
  .matrix-control-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .matrix-control { min-width: 0; }
  .matrix-help { white-space: normal; }
  .matrix-viewport { min-height: 0; }
  .navigator-detail .card-head {
    align-items: stretch;
    flex-direction: row;
  }
  .item-title { flex-direction: column; }
  .tm-search-scopes__global { flex: 0 0 auto; width: 100%; }
  .tm-search-scopes__global .button { flex: 0 0 auto; }
  .modal-backdrop { padding: .55rem; }
  .modal {
    max-height: calc(100dvh - 1.1rem);
    overflow: auto;
  }
  .modal-head { align-items: flex-start; }
  .modal-actions > * { flex: 1 1 12rem; text-align: center; }
}

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