@font-face {
  font-family: Overlay Display;
  src: url("/dashboard/overlay-editor/stats-focus/assets/font-supercell-bold.otf") format("opentype");
  font-display: swap;
}

:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
  --canvas: #141519;
  --surface: #1c1d23;
  --active: #2a2b32;
  --input: #15161b;
  --ink: #efeff2;
  --muted: #b9b8c2;
  --edge: #34333f;
  --accent: #cdbce3;
  --accent-ink: #221a2e;
  --user: #8bd6b0;
  --viewer: #e9b495;
  --live: #ffa3ad;
  --crown-blue: #8fbcff;
  --crown-red: #ffa0a8;
  --evo-edge: #b8a1d7;
  --evo-fill: #8d6fae;
  --evo-gold: #c2a47f;
  --width: 1160px;
  --header-height: 65px;
  color: var(--ink);
  background: var(--canvas);
  scrollbar-gutter: stable;
  scroll-padding-top: 64px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #faf9fb;
  --surface: #fff;
  --active: #f0ebf5;
  --input: #fbfafc;
  --ink: #292430;
  --muted: #625c6c;
  --edge: #e1dce7;
  --accent: #65537d;
  --accent-ink: #fff;
  --user: #28724e;
  --viewer: #8e5130;
  --live: #a92943;
  --crown-blue: #2656a1;
  --crown-red: #b42742;
  --evo-edge: #806499;
  --evo-fill: #a088ba;
  --evo-gold: #a88359;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; line-height: 1.5; }
body:has(dialog[open]) { overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }
img { display: block; max-width: 100%; }
code { font-family: ui-monospace, Consolas, monospace; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 12px; left: 12px; z-index: 6; padding: 8px 12px; background: var(--surface); }
.wrap { width: min(calc(100% - 72px), var(--width)); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--edge); }
.site-header-inner {
  height: calc(var(--header-height) - 1px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.brand { width: max-content; display: inline-flex; align-items: center; gap: 8px; font-size: 1.06rem; font-weight: 680; letter-spacing: -.035em; }
.brand img { object-fit: contain; }
.site-nav { display: flex; gap: clamp(16px, 3vw, 34px); color: var(--muted); font-size: .9rem; }
.site-nav a:hover, .header-cta:hover { color: var(--accent); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: clamp(5px, 1.3vw, 16px); }
.header-cta { white-space: nowrap; font-size: .86rem; font-weight: 640; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65em;
  min-height: 43px;
  padding: .62em 1em;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .91rem;
  font-weight: 650;
  white-space: nowrap;
}
.primary { color: var(--accent-ink); background: var(--accent); }
.primary:hover { filter: brightness(.94); }
.secondary { color: var(--ink); border-color: var(--edge); background: var(--surface); }
.secondary:hover { border-color: var(--accent); }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font-size: .88rem;
  font-weight: 650;
  text-align: left;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.hero {
  display: grid;
  grid-template-rows: 1fr auto;
  isolation: isolate;
  position: relative;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  border-bottom: 1px solid var(--edge);
}
.hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(black 32%, #000b 67%, transparent 100%);
}
.evo-shard {
  --shard-shape: polygon(4% 27%, 93% 3%, 98% 5%, 100% 10%, 76% 91%, 71% 97%, 25% 100%, 20% 94%, 0% 34%);
  position: absolute;
  width: clamp(170px, 18vw, 266px);
  aspect-ratio: 1.1;
  right: max(22px, calc((100% - var(--width)) / 2 - 30px));
  top: clamp(16px, 4svh, 44px);
}
.shard-outline, .shard-face {
  position: absolute;
  clip-path: var(--shard-shape);
}
.shard-outline {
  inset: 0;
  background: linear-gradient(143deg, color-mix(in srgb, var(--evo-edge) 30%, var(--canvas)), var(--canvas) 88%);
}
.shard-face {
  inset: 2px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--evo-fill) 10%, var(--canvas)), var(--canvas) 82%);
}
.evo-gem {
  position: absolute;
  top: 28%;
  right: 24%;
  width: 17%;
  aspect-ratio: 1;
  transform: rotate(45deg);
  border: 2px solid color-mix(in srgb, var(--evo-gold) 45%, var(--canvas));
  border-radius: 15%;
  background: conic-gradient(at 47% 45%,
    color-mix(in srgb, var(--evo-edge) 44%, var(--canvas)) 0 90deg,
    color-mix(in srgb, var(--evo-fill) 32%, var(--canvas)) 90deg 180deg,
    color-mix(in srgb, var(--evo-fill) 48%, var(--canvas)) 180deg 270deg,
    color-mix(in srgb, var(--evo-edge) 58%, var(--canvas)) 270deg);
}
.evo-gem::after {
  content: '';
  position: absolute;
  top: 17%;
  right: 17%;
  width: 23%;
  aspect-ratio: 1;
  background: color-mix(in srgb, var(--canvas) 64%, white);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  align-items: center;
  gap: clamp(35px, 6vw, 92px);
  padding-block: clamp(38px, 7vh, 88px);
}
.intro { min-width: 0; }
.hero-label {
  color: var(--accent);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.hero-label span { padding-inline: .32em; }
h1, h2 { text-wrap: balance; }
h1 {
  font-size: clamp(2.95rem, 5.5vw, 5.08rem);
  font-weight: 680;
  line-height: 1.02;
  letter-spacing: -.065em;
  margin: .24em 0 .3em;
}
h1 em { display: block; color: var(--accent); font-style: normal; }
.intro-copy { max-width: 40ch; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.16rem); line-height: 1.55; }
.hero-actions { margin-top: 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.mod-sign-in:not([hidden]) { display: inline-block; margin-top: 10px; font-size: .88rem; }
.explore-link { justify-self: center; padding: 5px 10px 16px; color: var(--muted); font-size: .81rem; }
.has-scrolled .explore-link { visibility: hidden; }
.explore-link span { display: inline-block; margin-left: 4px; color: var(--accent); }
.explore-link:hover { color: var(--accent); }

.hero-chat { min-width: 0; }
.chat-panel, .feature-panel {
  overflow: hidden;
  border: 1px solid var(--edge);
  border-radius: 13px;
  background: var(--surface);
}
.chat-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.hero-chat .chat-panel { box-shadow: 0 16px 38px #100a161c; }
.chat-header, .panel-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 55px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--edge);
}
.chat-mark {
  width: 22px;
  height: 18px;
  color: var(--accent);
  border: 1.5px solid currentColor;
  border-radius: 5px 5px 5px 1px;
  display: grid;
  place-items: center;
  flex: none;
}
.chat-mark::after { content: "···"; line-height: 1; letter-spacing: .09em; margin-top: -4px; }
.chat-header strong, .panel-heading strong { font-size: .86rem; }
.panel-heading small { margin-left: auto; color: var(--muted); font-size: .73rem; }
#expand-chat { margin-left: auto; }
.icon-button {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 1.28rem;
}
.icon-button:hover { color: var(--accent); background: var(--active); border-color: var(--edge); }
.expand-icon { position: relative; width: 13px; height: 13px; }
.expand-icon::before, .expand-icon::after { content: ""; position: absolute; width: 7px; height: 7px; }
.expand-icon::before { top: 0; right: 0; border-top: 1.5px solid; border-right: 1.5px solid; }
.expand-icon::after { bottom: 0; left: 0; border-bottom: 1.5px solid; border-left: 1.5px solid; }
.chat-log {
  height: clamp(162px, 27svh, 250px);
  min-height: 0;
  overflow: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--edge) transparent;
  padding: 9px 12px;
  display: grid;
  align-content: start;
  gap: 6px;
}
.chat-log:focus-visible { outline-offset: -3px; }
.chat-message { color: var(--muted); font-size: .81rem; overflow-wrap: anywhere; }
.chat-message strong { color: var(--viewer); margin-right: 3px; }
.chat-message.is-streamer strong, .chat-message.is-you strong { color: var(--user); }
.chat-message.is-bot, .chat-message.is-you { color: var(--ink); }
.chat-message.is-bot strong { color: var(--accent); }
.chat-bot-badge { display: none; }
#expanded-chat .chat-bot-badge {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: var(--active);
  color: var(--accent);
  font-size: .65rem;
  font-weight: 800;
  line-height: 1.4;
  vertical-align: .07em;
}
.chat-result {
  width: fit-content;
  min-width: min(100%, 285px);
  max-width: 100%;
  margin-top: 3px;
  padding: 5px 8px;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: var(--input);
}
.chat-result h3 { font-size: .93rem; line-height: 1.2; margin-bottom: 3px; overflow-wrap: anywhere; }
.chat-result-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.chat-result-head h3 { margin: 0; }
.chat-result-head .copy-deck { margin-inline-start: auto; }
.copy-deck { width: 28px; height: 28px; flex:none; }
.copy-glyph { width:10px; height:12px; border:1px solid currentColor; border-radius:2px; position:relative; }
.copy-glyph::before { content:""; position:absolute; inset:-4px 2px 2px -4px; border:1px solid currentColor; border-right:none; border-bottom:none; border-radius:2px; }
.medal-value { display:inline-flex; align-items:center; gap:3px; white-space:nowrap; }
.medal-icon, .overlay-sample .medal-icon { display:inline-block; vertical-align:middle; width:1.1em; height:1.15em; object-fit:contain; }
.chat-result-list, .chat-card-grid { list-style: none; padding: 0; margin: 0; }
.chat-result-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 9px;
  padding: 3px 0;
  border-top: 1px solid var(--edge);
  line-height: 1.35;
}
.rank-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.chat-result-list:not(.has-rank-heading) .rank-line:first-child { border-top: 0; }
.rank-identity { display: flex; align-items: baseline; flex-wrap: wrap; gap: 1px 6px; }
.rank-medals { color: var(--muted); white-space: nowrap; }
.chat-stat { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.chat-result-name { font-weight: 650; overflow-wrap: anywhere; }
.chat-result-row small, .result-note, .result-condition { color: var(--muted); font-size: .77rem; }
.result-note { display: block; margin-top: 3px; }
.chat-result .text-link { font-size:.78rem; }
.chat-result details { padding:4px 0; }
.chat-result summary { cursor:pointer; }
.chat-pages { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding-block: 4px; }
.chat-pages span { color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-pages button { font-size: 1.2rem; }
.chat-pages button:disabled { opacity: .45; cursor: default; }
.chat-result .deck-disclosure + .deck-disclosure { border-top: 1px solid var(--edge); margin-top: 4px; padding-top: 7px; }
.deck-disclosure > .chat-result { border: 0; padding: 0; }
.deck-disclosure[open] > summary .deck-peek { display: none; }
.deck-identity { display: inline-flex; align-items: baseline; gap: 6px 9px; flex-wrap: wrap; }
.battle-crowns { display: inline-flex; align-items: center; gap: 4px; font-weight: 750; }
.battle-crowns.is-blue { color: var(--crown-blue); }
.battle-crowns.is-red { color: var(--crown-red); }
.battle-crown {
  width: 1.1em;
  height: .85em;
  background: currentColor;
  clip-path: polygon(0 13%, 28% 45%, 50% 0, 72% 45%, 100% 13%, 86% 100%, 14% 100%);
}
.match-row { display:grid; grid-template-columns:minmax(0, 1fr) minmax(38px, 26%) auto; align-items:center; }
.match-icons { display:flex; flex-wrap:wrap; align-items:center; gap:2px; }
.chat-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-block: 4px;
}
.chat-card {
  display: grid;
  justify-items: center;
  align-content: start;
  padding: 2px;
  gap: 0;
  border: 1px solid var(--edge);
  border-radius: 5px;
  text-align: center;
  font-size: .67rem;
  overflow-wrap: anywhere;
}
.chat-card .card-art { width: min(49px, 100%); height: 43px; object-fit: contain; }
.chat-card-grid.deck-peek { grid-template-columns: repeat(8, minmax(0, 30px)); gap: 3px; margin: 4px 0 1px; }
.deck-peek .card-art { width: 100%; height: auto; aspect-ratio: 0.82; object-fit: contain; }
.chat-result-row .card-art { width: 20px; height: 22px; object-fit: contain; align-self: center; }
.chat-controls { border-top: 1px solid var(--edge); padding: 10px 12px 12px; display: grid; gap: 7px; }
.command-suggestions, .panel-controls { display: flex; gap: 5px; flex-wrap: wrap; }
.command-suggestions button, .panel-controls button {
  border: 1px solid transparent;
  border-radius: 5px;
  background: none;
  color: var(--muted);
  padding: .43em .63em;
  font-size: .8rem;
  font-weight: 600;
}
.command-suggestions button { background: var(--input); border-color: var(--edge); color: var(--accent); }
.command-suggestions button, .command-tabs button { font-family: ui-monospace, Consolas, monospace; }
.command-suggestions button:hover, .panel-controls button:hover { border-color: var(--edge); color: var(--accent); }
.panel-controls button[aria-pressed="true"] { background: var(--active); color: var(--accent); }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.chat-form input {
  width: 100%;
  min-width: 0;
  padding: 0 .68em;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--input);
  color: var(--ink);
}
.chat-form input::placeholder { color: var(--muted); }
.chat-form .button { min-height: 36px; padding: .35em .8em; font-size: .81rem; border-radius: 6px; }
.chat-form .button:disabled { opacity: .6; cursor: progress; }

.feature-navigation {
  position: sticky;
  z-index: 2;
  top: 0;
  background: var(--canvas);
  border-bottom: 1px solid var(--edge);
}
.feature-navigation .wrap {
  min-height: 53px;
  display: grid;
  align-items: center;
}
.feature-links {
  display: flex;
  gap: clamp(13px, 3.2vw, 36px);
  align-items: center;
  justify-content: center;
}
.feature-navigation a { color: var(--muted); font-size: .84rem; font-weight: 630; white-space: nowrap; }
.feature-navigation a:hover, .feature-navigation a[aria-current="location"] { color: var(--accent); }
.feature-navigation a[aria-current="location"] { text-decoration: underline; text-underline-offset: 7px; }
.feature { border-bottom: 1px solid var(--edge); }
.feature-inner {
  display: grid;
  grid-template-columns: minmax(0, .73fr) minmax(0, 1.27fr);
  align-items: center;
  gap: clamp(30px, 8vw, 110px);
  padding-block: clamp(53px, 7.5vw, 108px);
}
.feature--reverse .feature-inner { grid-template-columns: minmax(0, 1.27fr) minmax(0, .73fr); }
.feature--reverse .section-heading { grid-column: 2; grid-row: 1; }
.feature--reverse .feature-panel { grid-column: 1; grid-row: 1; }
.section-heading { min-width: 0; }
.section-heading h2, .setup h2 {
  font-size: clamp(1.85rem, 3.2vw, 3.17rem);
  font-weight: 665;
  line-height: 1.1;
  letter-spacing: -.045em;
  text-wrap: initial;
}
.section-heading p, .setup p { margin-top: 12px; color: var(--muted); max-width: 43ch; }
.section-heading p code { color: var(--accent); font-size: .92em; }
.section-heading .text-link { margin-top: 15px; }
.panel-controls, .panel-footer { padding: 10px 13px; }
.panel-controls { border-bottom: 1px solid var(--edge); }
.panel-footer { border-top: 1px solid var(--edge); }
.panel-footer button { min-height: 28px; }
.command-result, .record-content { display: grid; align-content: start; gap: 7px; padding: 16px 14px; }
.command-result { block-size: 9.25rem; overflow-y: auto; }
.command-result:focus-visible { outline-offset: -3px; }
.panel-label { margin-top: 5px; color: var(--muted); font-size: .86rem; }
.chat-example { color: var(--ink); font-size: .91rem; overflow-wrap: anywhere; }
.chat-example b { color: var(--accent); margin-right: 4px; }
.chat-example:first-child b { color: var(--user); }

.overlay-scene {
  display: grid;
  position: relative;
  place-items: center;
  padding: 43px 10px 29px;
  min-height: clamp(195px, 29vw, 340px);
  background: linear-gradient(#11152422, #15102285), url("/dashboard/overlay-editor/assets/preview-scene-city.jpeg") center 47% / cover;
}
.scene-label {
  position: absolute;
  top: 11px;
  left: 11px;
  background: #141321e8;
  color: #f0ebf8;
  border: 1px solid #ffffff3d;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: .74rem;
}
.overlay-sample {
  width: max-content;
  max-width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: clamp(7px, 1.5vw, 14px);
  padding: 10px clamp(10px, 2vw, 20px);
  background: #111321ec;
  color: #fff;
  border: 1px solid #c6b8dfbd;
  border-radius: 9px;
  white-space: nowrap;
}
.overlay-sample img { width: clamp(31px, 6vw, 52px); height: auto; max-height: 52px; object-fit: contain; flex: none; }
.overlay-sample div + div { border-left: 1px solid #9690ae57; padding-left: clamp(7px, 1.5vw, 14px); }
.overlay-sample small { display: block; color: #d6cde2; font-size: .64rem; font-weight: 650; margin-bottom: 3px; }
.overlay-sample strong { display: block; font-family: Overlay Display, system-ui, sans-serif; font-size: clamp(1rem, 2.55vw, 1.62rem); line-height: 1.2; }
.overlay-sample .win { color: #8aefb5; }
.overlay-sample .loss { color: #ff98ad; }
.result-list { display: flex; gap: 3px; }
.result-list b { padding: 2px 4px; border-radius: 3px; font-size: .65rem; font-weight: 750; }
.result-list .win { background: #23523d; }
.result-list .loss { background: #60253a; }
.title-content { padding: 15px; }
.title-content .panel-label { margin: 0; }
.title-content #title-sample { margin-top: 7px; padding: 10px; border: 1px solid var(--edge); border-radius: 6px; overflow-wrap: anywhere; }
.title-content strong { color: var(--accent); }
.trusted { border-bottom: 1px solid var(--edge); }
.trusted-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: clamp(8px, 2vw, 26px);
  padding-block: 12px;
}
.trusted h2 { font-size: 1rem; }
.trusted p { color: var(--muted); font-size: .9rem; }
.channel-window {
  flex-basis: 100%;
  container-type: inline-size;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
.channel-track { display: flex; width: max-content; animation: channel-loop var(--channel-duration, 25s) linear infinite; }
.channel-window:hover .channel-track { animation-play-state: paused; }
.channel-window:focus-within { overflow-x: auto; }
.channel-window:focus-within .channel-track { animation: none; }
.channel-window:focus-within .channel-list[aria-hidden] { display: none; }
.channel-list { display: flex; flex: none; min-width: 100cqi; justify-content: space-around; align-items: center; gap: 30px; padding: 8px 15px; margin: 0; list-style: none; }
.channel-list a { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); white-space: nowrap; font-size: .89rem; font-weight: 640; }
.channel-list a:hover { color: var(--accent); }
.channel-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--live);
  font-size: .67rem;
  font-weight: 750;
  text-transform: uppercase;
}
.channel-live::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
@keyframes channel-loop { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .channel-window { overflow: visible; mask-image: none; }
  .channel-track { animation: none; width: 100%; }
  .channel-list { width: 100%; flex-wrap: wrap; justify-content: start; gap: 8px 16px; padding: 4px 0; }
  .channel-list[aria-hidden] { display: none; }
}
.setup { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: clamp(52px, 8vw, 88px); }
.setup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 13px 20px; }
.site-footer { border-top: 1px solid var(--edge); }
.footer-inner {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr) max-content;
  gap: 16px;
  align-items: center;
  width: min(calc(100% - 56px), 1400px);
  margin-inline: auto;
  padding-block: 24px;
}
.footer-name { display: block; font-weight: 660; }
.site-footer small { display: block; color: var(--muted); font-size: .75rem; }
.fan-disclaimer { color: var(--muted); font-size: .75rem; line-height: 1.6; text-align: center; }
.fan-disclaimer a { color: var(--accent); font-weight: 550; }
.fan-disclaimer a:hover { color: var(--ink); }
.footer-links { display: flex; align-items: center; justify-self: end; gap: 10px; }
.footer-links a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; color: var(--muted); }
.footer-links a:hover { color: var(--ink); background: var(--active); }
.footer-links .footer-privacy { width: auto; padding-inline: 8px; white-space: nowrap; font-size: .8rem; }

#command-dialog {
  width: calc(100% - 24px);
  height: calc(100dvh - 24px);
  max-width: none;
  max-height: none;
  padding: 0;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--edge);
  border-radius: 14px;
}
#command-dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr); }
dialog::backdrop { background: #0e0a17bb; }
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--edge);
}
.dialog-header h2 { font-size: 1.13rem; font-weight: 680; }
.dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(265px, 26vw, 335px);
  gap: clamp(8px, 1vw, 15px);
  min-height: 0;
  padding: 8px clamp(8px, 1.7vw, 25px) 8px clamp(8px, 1vw, 16px);
}
.dialog-actions { display: flex; align-items: center; gap: 8px; }
#toggle-command-guide { display: none; }
#command-guide {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--surface);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
#command-guide-heading { font-size: .98rem; font-weight: 680; }
.command-guide-intro { margin: 3px 0 13px; color: var(--muted); font-size: .875rem; }
#command-guide details { border-top: 1px solid var(--edge); }
#command-guide summary { padding: 12px 2px; cursor: pointer; font-size: .875rem; font-weight: 650; }
#command-guide summary code { color: var(--accent); margin-inline-end: 5px; }
.command-guide-body { display: grid; gap: 8px; padding: 0 2px 13px; color: var(--muted); font-size: .875rem; }
.command-guide-body p { overflow-wrap: anywhere; }
.command-example {
  display: grid;
  gap: 2px;
  justify-items: start;
  min-height: 41px;
  padding: 5px 9px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--input);
  color: var(--ink);
  text-align: left;
  overflow-wrap: anywhere;
}
.command-example:hover { border-color: var(--accent); }
.command-example code { color: var(--accent); font-size: .875rem; }
.command-example span { color: var(--muted); font-size: .8rem; }
.command-guide-tip { display: grid; gap: 6px; padding: 10px; margin-block-start: 2px; border: 1px solid var(--edge); border-radius: 7px; background: var(--active); }
.command-guide-tip strong { color: var(--ink); }
#expanded-chat, #expanded-chat .chat-panel { height: 100%; min-height:0; }
#expanded-chat .chat-panel { grid-template-rows: minmax(0, 1fr) auto; }
#expanded-chat .chat-log { height: auto; gap: 11px; padding: 13px clamp(9px, 1.4vw, 22px); }
#expanded-chat .chat-message { justify-self: start; width: fit-content; min-width: 0; max-width: min(96%, 690px); }
#expanded-chat .chat-sender { display: block; margin-block-end: 3px; }
#expanded-chat .chat-message:has(> .chat-body) { padding: 6px 10px; border: 1px solid var(--edge); border-radius: 3px 10px 10px; background: var(--input); }
#expanded-chat .chat-message.is-you { background: var(--active); }
#expanded-chat .chat-result { min-width: min(100%, clamp(272px, 42vw, 580px)); }
#expanded-chat .deck-disclosure > .chat-result { min-width: 0; }
#expanded-chat .chat-header, .command-suggestions[hidden] { display: none; }
@media (min-width: 700px) { #expanded-chat .chat-card-grid:not(.deck-peek) { grid-template-columns:repeat(8, minmax(0, 1fr)); } }

@media (max-width: 880px) {
  .wrap { width: min(calc(100% - 42px), var(--width)); }
  .hero-inner { gap: 29px; }
  .feature-inner { gap: 25px; }
}
@media (max-width: 720px) {
  :root { --header-height: 54px; }
  .wrap { width: calc(100% - 32px); }
  .site-header-inner { grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
  .brand img { width: 30px; height: 30px; }
  .hero { min-height: 0; grid-template-rows: auto auto; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); align-content: start; align-items: start; gap: 23px; padding-block: 26px; }
  h1 { font-size: clamp(2.15rem, 9vw, 3.3rem); text-wrap: initial; }
  .intro-copy { font-size: .93rem; }
  .hero-actions { margin-top: 15px; }
  .hero-actions .button { min-height: 39px; }
  .chat-log { height: 165px; }
  .evo-shard { width: 112px; right: 16px; top: 12px; opacity: .67; }
  .explore-link { padding-bottom: 12px; }
  .feature-links {
    flex-wrap: wrap;
    gap: 8px 18px;
    padding-block: 12px;
  }
  .feature-inner, .feature--reverse .feature-inner { grid-template-columns: minmax(0, 1fr); gap: 23px; }
  .feature--reverse .section-heading, .feature--reverse .feature-panel { grid-area: auto; }
  .setup { display: grid; justify-content: start; }
  #command-dialog { width: calc(100% - 12px); height: calc(100dvh - 12px); }
  .dialog-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); padding-inline: 6px; }
  #toggle-command-guide { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 8px; border: 1px solid var(--edge); border-radius: 6px; background: var(--surface); color: var(--accent); font-size: .85rem; }
  #command-guide { display: none; padding: 13px; }
  .show-command-guide #command-guide { display: block; }
  .show-command-guide #expanded-chat { display: none; }
  #command-guide summary, .command-example { min-height: 44px; }
  #expanded-chat .chat-form input { font-size: 1rem; }
  .footer-inner { width: calc(100% - 32px); grid-template-columns: minmax(0, 1fr); text-align: center; gap: 12px; }
  .footer-links { justify-self: center; }
}
@media (max-width: 410px) {
  .header-cta { font-size: .79rem; }
  .chat-header { min-height: 49px; padding-block: 7px; }
}
@media (max-width: 365px) {
  .wrap { width: calc(100% - 25px); }
  .site-header-inner { gap: 8px; }
  .brand { font-size: .97rem; gap: 5px; }
  .hero-actions { gap: 6px; }
  .hero-actions .button { padding-inline: .74em; font-size: .81rem; }
  .command-result { block-size: 10.5rem; }
}
