:root {
  color-scheme: dark;
  --canvas: #101210;
  --panel: #191b18;
  --panel-raised: #20231f;
  --input: #141613;
  --line: #323830;
  --line-strong: #4e5649;
  --ink: #f2f1e9;
  --muted: #aab1a6;
  --dim: #878f84;
  --amber: #edc475;
  --amber-bright: #ffda93;
  --amber-ink: #272012;
  --amber-wash: #2c281d;
  --teal: #a4d4b5;
  --teal-wash: #1d2a22;
  --red: #f4a197;
  --red-wash: #352323;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --font: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --radius: 10px;
  --page: 1416px;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 280px; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

h1, h2, h3, h4, p { margin: 0; }

h1, h2, h3, h4 { line-height: 1.26; }

a { color: var(--amber); }

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

button, select, input[type="checkbox"] { cursor: pointer; }

button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: 3px;
}

button { touch-action: manipulation; }

input, textarea, select {
  min-width: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
}

input::placeholder, textarea::placeholder { color: var(--dim); }

input[type="checkbox"] { accent-color: var(--amber); }

input[type="search"], input[type="text"], input[type="number"], textarea, select {
  min-height: 40px;
  padding: 8px 10px;
}

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

::selection { color: var(--amber-ink); background: var(--amber-bright); }

.sr-only, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell {
  width: min(calc(100% - 64px), var(--page));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 5;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: #141613;
}

.header-inner {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: clamp(20px, 3.3vw, 48px);
}

.brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  clip-path: polygon(0 0, 75% 0, 100% 25%, 100% 100%, 25% 100%, 0 75%);
  background: var(--amber);
  color: var(--amber-ink);
  font-size: 19px;
  font-weight: 800;
}

.brand-mark svg { width: 22px; height: 22px; }

.brand-copy { display: grid; line-height: 1.2; }

.brand-copy strong, .brand-copy b { font-size: 16px; letter-spacing: .08em; }

.brand-copy small, .header-tag {
  color: var(--muted);
  font: 10px/1.3 var(--mono);
  letter-spacing: .1em;
}

.brand-copy small { margin-top: 4px; }

.main-nav {
  display: flex;
  min-width: 0;
  align-self: stretch;
  gap: 8px;
}

.nav-btn {
  position: relative;
  padding: 0 clamp(10px, 1.5vw, 22px);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-btn:hover, .nav-btn[aria-current="page"] {
  background: #22231d;
  color: var(--amber-bright);
}

.nav-btn[aria-current="page"]::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  background: var(--amber);
  content: "";
}

.nav-btn:focus-visible { outline-offset: -4px; }

.header-tag {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dot, currentColor);
}

.header-tag .dot { color: var(--teal); }

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 154px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-block: 23px 20px;
  padding: clamp(20px, 2.2vw, 32px);
  overflow: hidden;
  border: 1px solid #424337;
  border-left: 3px solid var(--amber);
  border-radius: 2px var(--radius) var(--radius) 2px;
  background: linear-gradient(110deg, #24261e 8%, #1b1f1a 78%);
}

.hero-grid {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 27%;
  background-image:
    linear-gradient(90deg, #e0cb9418 1px, transparent 1px),
    linear-gradient(#e0cb9418 1px, transparent 1px);
  background-position: center;
  background-size: 26px 26px;
  mask-image: linear-gradient(90deg, transparent 2%, #000 100%);
  pointer-events: none;
}

.hero-grid svg {
  position: absolute;
  top: 0;
  right: 10%;
  width: min(100%, 460px);
  height: 100%;
  color: #dec18a;
  opacity: .23;
}

.hero-copy { min-width: 0; }

.eyebrow, .section-label {
  color: var(--amber);
  font: 700 11px/1.4 var(--mono);
  letter-spacing: .12em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  width: 14px;
  height: 6px;
  flex: 0 0 auto;
  background: repeating-linear-gradient(125deg, var(--amber) 0 2px, transparent 2px 4px);
  content: "";
}

.hero h1 {
  margin: 5px 0 7px;
  font-size: clamp(27px, 3.1vw, 43px);
  font-weight: 760;
  letter-spacing: .025em;
}

.hero-text {
  max-width: 62ch;
  color: var(--muted);
  font-size: 13px;
}

.hero-stats {
  display: grid;
  flex: 0 1 340px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.stat {
  display: grid;
  align-content: center;
  min-height: 72px;
  padding: 8px 12px;
  border: 1px solid #454a3c;
  border-radius: 6px;
  background: #1c211ae8;
}

.stat strong {
  color: var(--amber-bright);
  font: 650 26px/1.1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.stat small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.dashboard-left, .dashboard-right {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 12px 17px;
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: var(--panel-raised);
}

.panel-header h2 {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 700;
}

.panel-body { padding: 15px 17px 17px; }

.panel-body > * + * { margin-top: 12px; }

.panel-body > :last-child { margin-bottom: 0; }

.panel-body h3, .detail-section h3 {
  font-size: 14px;
  font-weight: 700;
}

.muted { color: var(--muted); }

.button, .chip, .ban-operator {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel-raised);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.button:not(:disabled):hover, .chip:not(:disabled):hover, .ban-operator:not(:disabled):hover {
  border-color: #a59062;
  background: var(--amber-wash);
  color: var(--amber-bright);
}

.button svg { width: 15px; height: 15px; flex: 0 0 auto; }

.button.small { min-height: 31px; padding: 5px 9px; font-size: 12px; }

.button.small[data-action="remove"], .button.small[data-action="remove-target"],
.button.small[data-action="close-dialog"] {
  min-width: 31px;
  padding: 2px 6px;
  font-size: 17px;
}

.button[aria-pressed="true"] {
  border-color: #9f8046;
  background: var(--amber-wash);
  color: var(--amber-bright);
}

.button.subtle {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.button.primary {
  border-color: var(--amber);
  background: var(--amber);
  color: var(--amber-ink);
  font-weight: 750;
}

.button.primary:not(:disabled):hover {
  border-color: var(--amber-bright);
  background: var(--amber-bright);
  color: var(--amber-ink);
}

.button.danger { border-color: #69463e; color: var(--red); }

.button.danger:not(:disabled):hover {
  border-color: var(--red);
  background: var(--red-wash);
  color: var(--red);
}

.field-row, .controls, .ban-filter, .catalog-controls, .planner-options {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 10px;
}

.field-row label, .ban-filter label, .catalog-controls label, .target-form label,
.planner-options label {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.field-row label.check-control, .planner-options label.check-control, .catalog-controls label.check-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-size: 13px;
}

.check-control input {
  width: 15px;
  min-width: 0;
  height: 15px;
  margin: 0;
}

.field-row input, .ban-filter input, .catalog-controls input { min-width: 100px; }

.catalog-controls .check-control input { min-width: 0; }

.field-row input[type="search"], .ban-filter input[type="search"],
.catalog-controls input[type="search"] { flex: 1 1 180px; }

.field-row label:has(input[type="search"]), .ban-filter label:has(input[type="search"]),
.catalog-controls label:has(input[type="search"]) { flex: 1 1 180px; }

.chip-list, .chips, .ban-list, .lineup-stats, .distribution, .result-members, .result-bonds,
.row-actions, .target-actions, .card-actions, .dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.chip {
  min-height: 31px;
  padding: 4px 10px;
  border-color: var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
}

.chip[aria-pressed="true"] {
  border-color: #9f8046;
  background: var(--amber-wash);
  color: var(--amber-bright);
}

.token, .summary-tag, .pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-raised);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

button.token:hover {
  border-color: #a59062;
  color: var(--amber-bright);
}

.ban-list .token, .token.banned, .pill.banned {
  border-color: #69463e;
  background: var(--red-wash);
  color: var(--red);
}

.pill.danger, .token[data-banned="true"] {
  border-color: #69463e;
  background: var(--red-wash);
  color: var(--red);
}

.pill.goal-hit {
  border-color: #507060;
  background: var(--teal-wash);
  color: var(--teal);
}

.elite-mark { color: var(--amber-bright); }

.ban-list button.token:hover, button.token.banned:hover { border-color: var(--red); }

.token button {
  display: grid;
  width: 20px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font-size: 17px;
  line-height: 1;
}

.token button:hover { background: #ffffff18; }

.notice, .empty {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.notice {
  border-color: #54482f;
  border-left: 2px solid var(--amber);
  background: var(--amber-wash);
  color: #e4ceaa;
}

.notice.danger, .notice.error {
  border-color: #69463e;
  border-left-color: var(--red);
  background: var(--red-wash);
  color: var(--red);
}

.empty { border-style: dashed; }

.empty > strong, .notice > strong { color: var(--ink); }

.empty > p { margin-top: 3px; }

.notice ul { margin: 5px 0 0; padding-inline-start: 18px; }

.ban-list {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ban-list .controls { align-items: center; justify-content: space-between; }

#ban-pool-count { font-size: 12px; }

.ban-bulk { justify-content: flex-start; gap: 7px; }
.ban-import { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--input); }
.ban-import summary { color: var(--amber); cursor: pointer; font-weight: 600; }
.ban-import-body { display: grid; gap: 8px; margin-top: 7px; }
.ban-import-body > label { display: grid; gap: 4px; }
.ban-import-body input[type="file"] { width: 100%; min-width: 0; font-size: 12px; }
#ban-image-status:empty, #ban-image-review:empty { display: none; }
#ban-image-review > * + * { margin-top: 8px; }
.ban-review-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr)); gap: 4px 6px; max-height: 220px; overflow: auto; }
.ban-review-match, .ban-review-choice { display: flex; min-width: 0; align-items: center; gap: 5px; font-size: 12px; }
.ban-review-match { padding: 4px; border: 1px solid var(--line); border-radius: 4px; }
.ban-review-match input { flex: 0 0 auto; }
.ban-review-match .operator-portrait { --portrait-size: 23px; }
.ban-review-match small { color: var(--muted); }
.ban-review-choice { margin-top: 6px; }
.ban-review-choice select { flex: 1 1 auto; min-width: 0; }
.ban-review-preview { width: 27px; height: 27px; object-fit: contain; border-radius: 3px; }

.ban-grid {
  display: grid;
  max-height: 275px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 146px), 1fr));
  gap: 6px;
  padding: 5px;
  overflow: auto;
  scroll-padding: 5px;
  scrollbar-color: var(--line-strong) transparent;
}

.ban-grid > .empty { grid-column: 1 / -1; }

.ban-operator {
  min-width: 0;
  min-height: 39px;
  justify-content: flex-start;
  gap: 7px;
  padding: 5px 7px;
  border-color: var(--line);
  text-align: left;
}

.ban-operator[data-banned="true"], .ban-operator[aria-pressed="true"] {
  border-color: #805049;
  background: var(--red-wash);
  color: var(--red);
}

.ban-operator[data-banned="true"]:not(:disabled):hover,
.ban-operator[aria-pressed="true"]:not(:disabled):hover {
  border-color: var(--red);
  background: #442b2a;
  color: var(--red);
}

.operator-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ban-indicator {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--dim);
  font: 700 16px/1 var(--mono);
  text-align: right;
}

.ban-operator[data-banned="true"] .ban-indicator,
.ban-operator[aria-pressed="true"] .ban-indicator { color: var(--red); }

.tier-tag {
  display: inline-grid;
  min-width: 24px;
  min-height: 23px;
  flex: 0 0 auto;
  place-items: center;
  padding: 2px 4px;
  border: 1px solid #4e5649;
  border-radius: 4px;
  color: #c8cfc4;
  font: 700 11px/1.05 var(--mono);
  white-space: nowrap;
}

.tier-tag[data-tier="3"], .tier-tag.tier-3 { border-color: #426958; color: #9ed7be; }
.tier-tag[data-tier="4"], .tier-tag.tier-4 { border-color: #3e6673; color: #a1d6e4; }
.tier-tag[data-tier="5"], .tier-tag.tier-5 { border-color: #75663d; color: #f4d78e; }
.tier-tag[data-tier="6"], .tier-tag.tier-6 { border-color: #936741; color: #ffbc83; }

.lineup-list, .target-list, .activation-list, .result-list {
  display: grid;
  gap: 7px;
  padding: 0;
  list-style: none;
}

.lineup-row, .target-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
}

.lineup-row[data-conflict="true"], .target-row[data-blocked="true"] {
  border-color: #69463e;
  background: var(--red-wash);
}

.lineup-info {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  overflow-wrap: anywhere;
}

.text-button {
  padding: 2px 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  overflow-wrap: anywhere;
}

.text-button:hover { color: var(--amber-bright); text-decoration: underline; }

.row-actions, .target-actions { justify-content: flex-end; }

.controls:empty, .distribution:empty { display: none; }

.distribution {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  align-items: start;
  gap: 8px;
}

.distribution > div {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.distribution .chips { margin-top: 5px; }

.activation-list details {
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
}

.activation-list details[open] { border-color: var(--line-strong); }

.activation-list summary {
  padding: 2px 0;
  color: var(--muted);
  cursor: pointer;
}

.activation-list summary::marker { color: var(--amber); }

.activation-list details > :not(summary) { margin-top: 6px; }

.bond-state > summary {
  display: flex;
  align-items: center;
  gap: 5px 8px;
}

.bond-state > summary::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  margin-right: 2px;
  rotate: -45deg;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  content: "";
}

.bond-state[open] > summary::before { rotate: 45deg; }

.bond-state > summary > span:last-child {
  margin-left: auto;
  text-align: right;
}

.bond-state > summary > span:last-child, .target-progress {
  color: var(--amber-bright);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.bond-state[data-active="true"] { border-color: #3d5948; background: var(--teal-wash); }

.bond-state[data-active="true"] > summary, .bond-state[data-active="true"] > summary > span:last-child {
  color: var(--teal);
}

.bond-state > summary::-webkit-details-marker { display: none; }

.target-name {
  display: grid;
  min-width: 0;
  flex: 1 1 100px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 6px;
  overflow-wrap: anywhere;
}

.target-progress { grid-column: 2; color: var(--muted); }

.target-row[data-blocked="true"] .target-progress { color: var(--red); }

.target-actions select { min-height: 31px; padding: 4px 6px; font-size: 12px; }

.target-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, auto) auto;
  align-items: end;
  gap: 8px;
}

.target-form select { width: 100%; }

.planner-options input[type="number"] { width: 80px; }

.planner-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.planner-footer .button.primary {
  min-height: 42px;
  padding-inline: 16px;
}

.planner-footer > .muted { flex: 1 1 220px; font-size: 12px; }

.result-list { gap: 11px; }

.result-card {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--amber);
  border-radius: 6px;
  background: var(--panel-raised);
}

.result-header, .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px 10px;
}

.result-header h3 { font-size: 15px; }

.result-header strong { color: var(--amber-bright); font-size: 15px; }

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  color: var(--muted);
  font-size: 12px;
}

.result-card .result-bonds {
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.catalog-panel { margin-top: 23px; }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr));
  gap: 9px;
}

.catalog-grid > .empty { grid-column: 1 / -1; }

.operator-card, .reference-card {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-raised);
  overflow-wrap: anywhere;
}

.operator-card[data-banned="true"], .operator-card.banned { border-color: #69463e; }

.operator-card .card-header h3, .reference-card .card-header h3 {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--ink);
  font-size: 15px;
}

.operator-portrait {
  --portrait-size: 40px;
  display: inline-grid;
  width: var(--portrait-size);
  height: var(--portrait-size);
  flex: 0 0 var(--portrait-size);
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #292c25;
  color: var(--portrait-ink, var(--muted));
}
.operator-portrait img { width: 100%; height: 100%; display: block; object-fit: contain; }
.operator-portrait svg { width: 54%; height: 54%; }
.operator-portrait[data-tier="5"] { border-color: #9c763a; }
.operator-portrait[data-tier="6"] { border-color: #ae6353; }
.operator-identity { display: flex; min-width: 0; align-items: center; gap: 9px; }
.operator-identity > div { min-width: 0; flex: 1 1 auto; }
.operator-identity .muted { font-size: 12px; overflow-wrap: anywhere; }
.dialog-header .operator-portrait { --portrait-size: 56px; }
.ban-operator .operator-portrait, .member-token .operator-portrait { --portrait-size: 24px; }
.lineup-info .operator-portrait, .run-card .operator-portrait { --portrait-size: 32px; }
.member-token { gap: 6px; }
.bond-icon { display: inline-block; width: 15px; height: 15px; flex: 0 0 auto; object-fit: contain; }
.card-header .bond-icon { width: 21px; height: 21px; }

.reference-card summary { cursor: pointer; }

.reference-card summary::marker { color: var(--amber); }

.reference-card summary + .chips { margin-top: 6px; }

.operator-card .card-actions, .reference-card .card-actions {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.effect-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.effect-list li::marker { color: var(--amber); }

.operator-dialog {
  width: min(calc(100% - 30px), 690px);
  max-height: min(calc(100% - 28px), 86vh);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 16px 60px #000a;
}

.operator-dialog::backdrop { background: #070907b8; }

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-raised);
}

.dialog-header h2 { margin-block: 3px 5px; font-size: 19px; }

.dialog-body { padding: 15px 17px; }

.dialog-body > * + * { margin-top: 12px; }

.dialog-body > .dialog-header { margin: -15px -17px 0; }

.detail-section {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
}

.detail-section > * + * { margin-top: 6px; }

dl.detail-section { margin: 0; }

.dialog-body > dl.detail-section { margin-top: 12px; }

.detail-section dt { color: var(--amber-bright); font-size: 12px; font-weight: 700; }

.detail-section dd { margin: 2px 0 0; color: var(--muted); }

.dialog-body > .dialog-actions {
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 26px;
  padding-block: 13px 20px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
}

.live-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.preset-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preset-slot, .run-tier, .route-summary {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
}

.preset-slot .controls, .run-tier .controls { justify-content: flex-start; }
.preset-slot .chips, .run-tier > .muted, .route-summary > * + * { margin-top: 8px; }
.run-tier + .run-tier { margin-top: 10px; }
.run-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-top: 8px;
  padding: 7px 0 0;
  border-top: 1px solid var(--line);
}
.run-card .chips { margin-top: 3px; }
.run-card .pill { font-size: 10px; }
.run-card[data-selected="true"] strong { color: var(--teal); }
.run-card .button[aria-pressed="true"], .expansion-grid [data-selected="true"] .button[aria-pressed="true"] {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-wash);
}
.run-card .subtle[aria-pressed="true"] { border-color: var(--red); color: var(--red); background: var(--red-wash); }
.expansion-grid [data-selected="true"] { border-color: var(--teal); }
#expansion-advice:empty, #core-preview:empty { display: none; }
#core-preview > p { margin-top: 5px; }
#expansion-advice .chips, #route-results .notice .chips { margin-top: 7px; }

.core-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); align-items: end; }
.planner-options.core-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 124px), 1fr)); }
.core-fields > label { min-width: 0; }
.core-fields :is(input, select), .core-fields input[type="number"] { width: 100%; min-width: 0; }
.route-locks { min-width: 0; margin-block: 13px; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: 7px; }
.route-locks legend { padding-inline: 5px; font-size: 13px; font-weight: 700; }
.route-locks legend .muted, .route-locks > p { font-size: 12px; font-weight: 400; }
.route-locks .core-fields { margin: 0; }
.route-locks > p { margin-top: 7px; }
.route-lock-list { padding: 0; margin: 8px 0 0; list-style: none; }
.route-lock-list li { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.route-lock-list .operator-portrait { --portrait-size: 23px; }
.route-summary summary { color: var(--amber); cursor: pointer; }
.route-summary summary + p { margin-top: 5px; }
.route-timeline, .composition-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 10px; }
.route-timeline { align-items: start; }
.route-stage, .route-composition { min-width: 0; align-content: start; }
.route-stage .result-header, .route-composition .result-header { align-items: flex-start; }
.route-stage .section-label, .route-composition .section-label { margin-bottom: 4px; }
.route-stage > * + *, .route-composition > * + * { margin-top: 8px; }
.route-stage .muted, .route-composition .muted { font-size: 12px; }
.route-composition { border-color: #575142; background: #22241e; }
.route-composition h4 { font-size: 15px; }
.route-section-heading { margin: 16px 0 9px; }
.route-section-heading .muted { margin-top: 3px; }
.route-members { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 108px), 1fr)); gap: 5px; }
.route-member {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 4px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--input);
  color: var(--ink);
  text-align: left;
  overflow-wrap: anywhere;
}
.route-member:hover { border-color: var(--line-strong); background: var(--panel-raised); }
.route-member .operator-portrait { --portrait-size: 30px; }
.route-member-label { min-width: 0; }
.route-member-label strong, .route-member-label small { display: block; line-height: 1.25; }
.route-member-label small { margin-top: 2px; color: var(--muted); }
.route-member[data-core="true"] { border-color: var(--amber); background: var(--amber-wash); }
.route-member[data-core="true"] small { color: var(--amber); }
.composition-bonds { padding-top: 8px; border-top: 1px solid var(--line); }
.composition-bonds > strong { display: block; margin-bottom: 4px; font-size: 12px; }
.composition-roles { display: grid; gap: 3px; padding: 0; margin-bottom: 0; list-style: none; font-size: 12px; }
.composition-roles li { display: flex; flex-wrap: wrap; gap: 3px 6px; }
.composition-roles li span { color: var(--teal); }
.route-roles { display: grid; gap: 5px; margin-bottom: 0; }
.route-roles > div { display: grid; grid-template-columns: minmax(0, 82px) 1fr; gap: 6px; font-size: 12px; }
.route-roles dt { font-weight: 700; line-height: 1.35; }
.route-roles dt span { display: block; color: var(--teal); font-size: 11px; font-weight: 400; }
.route-roles dd { margin: 0; color: var(--muted); }
.route-alternative { padding-top: 7px; border-top: 1px solid var(--line); }
.route-alternative .route-members { margin-block: 5px; }
.route-transition { color: var(--teal); font-size: 12px; }
.stack-sources {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
}
.stack-sources summary { cursor: pointer; color: var(--amber); }
.stack-sources > * + * { margin-top: 7px; }
.stack-sources li + li { margin-top: 7px; }
.auxiliary-planner { padding: 13px; }
.auxiliary-planner > summary { color: var(--amber); cursor: pointer; font-weight: 700; }
.auxiliary-planner > summary .muted { margin-inline-start: 6px; font-weight: 400; }
.auxiliary-planner > .panel { margin-top: 10px; }

@media (max-width: 1050px) {
  .shell { width: calc(100% - 36px); }
  .dashboard, .dashboard-left, .dashboard-right { gap: 13px; }
  .panel-header { padding-inline: 13px; }
  .panel-body { padding-inline: 13px; }
  .hero-stats { flex-basis: 270px; }
  .stat { padding-inline: 8px; }
}

@media (max-width: 790px) {
  .header-inner { gap: 14px; }
  .header-tag { display: none; }
  .main-nav { margin-left: auto; }
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  .dashboard-left, .dashboard-right { display: contents; }
  .lineup-panel { order: 1; }
  .auxiliary-planner { order: 2; }
}

@media (max-width: 610px) {
  .shell { width: calc(100% - 24px); }
  .site-header { position: static; }
  .header-inner { min-height: 0; flex-wrap: wrap; gap: 0; }
  .brand { min-height: 54px; }
  .main-nav {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 2px;
    margin-left: 0;
    border-top: 1px solid var(--line);
  }
  .nav-btn { min-height: 42px; flex: 1 1 0; padding-inline: 5px; }
  .nav-btn[aria-current="page"]::after { right: 5px; left: 5px; }
  .hero {
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    margin-block: 13px;
    padding: 15px;
  }
  .hero-stats { flex-basis: auto; }
  .stat { min-height: 56px; }
  .stat strong { font-size: 22px; }
  .hero-text { font-size: 12px; }
  .panel-header { min-height: 61px; }
  .panel-header h2 { font-size: 16px; }
  .ban-grid { max-height: 252px; }
  .catalog-panel { margin-top: 13px; }
  .preset-slots { grid-template-columns: minmax(0, 1fr); }
  .row-actions .button.small, .target-actions .button.small { min-height: 36px; }
}

@media (max-width: 375px) {
  .nav-btn { padding-inline: 3px; font-size: 11px; }
  .panel-body, .panel-header { padding-inline: 10px; }
  .target-form { grid-template-columns: minmax(0, 1fr) minmax(65px, auto); }
  .target-form > .button { grid-column: 1 / -1; }
  .lineup-row, .target-row, .run-card { flex-wrap: wrap; }
  .row-actions, .target-actions { justify-content: flex-start; }
}

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