:root {
  --panel: rgba(13, 17, 22, 0.8);
  --panel-soft: rgba(21, 27, 33, 0.76);
  --panel-softer: rgba(255, 255, 255, 0.03);
  --text: #f2efe9;
  --muted: #a8aaa8;
  --accent: #c94934;
  --accent-soft: #ff8b5b;
  --accent-glow: rgba(201, 73, 52, 0.28);
  --line: rgba(255, 255, 255, 0.08);
  --good: #9fd4a8;
  --bad: #ef9696;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(201, 73, 52, 0.16), transparent 20%),
    radial-gradient(circle at 80% 10%, rgba(255, 139, 91, 0.1), transparent 15%),
    radial-gradient(circle at bottom right, rgba(145, 32, 24, 0.16), transparent 18%),
    linear-gradient(180deg, #080b0d 0%, #11161b 58%, #171d23 100%);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.012) 0,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 5px
    ),
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 24%, transparent 76%, rgba(255, 255, 255, 0.018));
  mix-blend-mode: screen;
  opacity: 0.34;
}

.page-shell {
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 24px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(250px, 0.72fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
}

.hero-copy-block {
  display: grid;
  align-content: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: #d0b8af;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.85rem);
  line-height: 0.95;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-copy,
.panel-header p,
.helper,
.notes-version,
.field span,
.field input,
.field select,
.hero-card-label,
.effect-meta,
.breakdown-row span,
.picker-option-meta {
  color: var(--muted);
}

.hero-card,
.panel {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(16px);
}

.hero-card::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 22%),
    linear-gradient(135deg, transparent 55%, rgba(201, 73, 52, 0.07));
}

.hero-card > *,
.panel > * {
  position: relative;
  z-index: 1;
}

.hero-card {
  justify-self: end;
  width: 100%;
  max-width: 320px;
}

.locale-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 999px;
  min-width: 54px;
  min-height: 36px;
  padding: 6px 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.locale-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.075);
}

.hero-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.94fr) minmax(460px, 1.06fr);
  gap: 14px;
}

.controls {
  grid-column: 1 / 2;
}

.inspector {
  grid-column: 2 / 3;
}

.breakdown-note,
.about-panel {
  grid-column: 1 / 3;
}

.panel-header {
  margin-bottom: 10px;
}

.panel-header.compact {
  margin-bottom: 8px;
}

.toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.squad-actions {
  margin: 10px 0 6px;
}

.button-row,
.survivor-tabs,
.inspector-tabs,
.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inspector-tabs {
  margin-bottom: 12px;
}

.results-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 10px;
}

.compact-toggle {
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

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

.dr-filter-row {
  margin: 2px 0 8px;
}

.metric-filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.metric-filter-chip.metric-filter-chip-text {
  width: auto;
  min-width: 0;
  padding: 0 11px;
}

.metric-filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.metric-filter-chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
}

.metric-filter-chip.active {
  border-color: rgba(255, 139, 91, 0.45);
  background: rgba(201, 73, 52, 0.18);
  box-shadow: 0 8px 18px rgba(201, 73, 52, 0.16);
}

.metric-filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.metric-filter-icon .metric-icon,
.metric-filter-icon .metric-icon-svg {
  width: 18px;
  height: 18px;
}

.inspector-tabs button,
.survivor-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
}

.inspector-tabs button.active,
.survivor-tab.active {
  background: linear-gradient(135deg, rgba(201, 73, 52, 0.94), rgba(255, 139, 91, 0.9));
  color: #fff7f1;
  border-color: transparent;
  box-shadow: 0 10px 24px var(--accent-glow);
}

.survivor-tab small {
  display: block;
  opacity: 0.8;
}

.survivor-tab-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.obsession-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.obsession-toggle:hover {
  transform: translateY(-1px);
}

.obsession-toggle.active {
  background: linear-gradient(135deg, rgba(201, 73, 52, 0.94), rgba(255, 139, 91, 0.9));
  color: #fff7f1;
  border-color: transparent;
  box-shadow: 0 10px 24px var(--accent-glow);
}

.obsession-icon {
  width: 32px;
  height: 32px;
  display: block;
  image-rendering: auto;
}

.obsession-icon-small {
  width: 22px;
  height: 22px;
}

.obsession-target-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  border-radius: 12px;
  min-height: 43px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.obsession-target-toggle:hover {
  transform: translateY(-1px);
}

.obsession-target-toggle.active {
  background: linear-gradient(135deg, rgba(201, 73, 52, 0.94), rgba(255, 139, 91, 0.9));
  color: #fff7f1;
  border-color: transparent;
  box-shadow: 0 10px 24px var(--accent-glow);
}

.inspector-pane {
  display: none;
}

.inspector-pane.active {
  display: block;
}

.estimate-note {
  display: grid;
  gap: 3px;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.estimate-note span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.estimate-note strong {
  font-size: 0.58rem;
}

.summary-card .estimate-note strong,
.breakdown-card .estimate-note strong {
  font-size: 0.7rem;
  margin-top: 0;
}

.movement-estimate small {
  color: var(--muted);
  line-height: 1.35;
}

.movement-profile-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.movement-profile-list span {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.25;
}

.movement-profile-list strong {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.notes-version {
  margin: 10px 0 0;
  text-align: right;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notes-disclaimer {
  margin-top: 10px;
}

.notes-separator {
  color: rgba(255, 255, 255, 0.18);
}

.notes-version a {
  color: #f0c5b4;
  text-decoration: none;
  border-bottom: 1px solid rgba(240, 197, 180, 0.22);
  padding-bottom: 1px;
}

.notes-version a:hover {
  color: #ffd6c7;
  border-bottom-color: rgba(255, 214, 199, 0.5);
}

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

.about-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.about-social-card {
  margin-top: 12px;
}

.about-schedule {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.about-actions {
  justify-content: flex-start;
  margin: 0;
}

.kofi-widget-inline {
  margin-top: 4px;
}

.kofi-widget-stack {
  display: grid;
  gap: 8px;
}

.role-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  background: rgba(255, 255, 255, 0.025);
  padding: 6px;
  border-radius: 16px;
}

.role-toggle button,
.action-button,
.selection-card button,
.picker-trigger {
  appearance: none;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.role-toggle button {
  background: transparent;
  color: var(--text);
  padding: 10px 14px;
  font-weight: 700;
}

.role-toggle button.active,
.action-button {
  background: linear-gradient(135deg, rgba(201, 73, 52, 0.94), rgba(255, 139, 91, 0.9));
  color: #fff7f1;
  box-shadow: 0 10px 24px var(--accent-glow);
}

.action-button {
  width: 100%;
  padding: 9px 12px;
  font-weight: 700;
  margin: 0;
}

.action-button.subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: none;
}

.action-button-inline {
  width: auto;
  min-width: 140px;
  align-self: end;
}

.compact-button {
  width: auto;
  min-width: 145px;
}

.action-button:hover,
.role-toggle button:hover,
.selection-card button:hover,
.picker-trigger:hover,
.selection-group-toggle:hover {
  transform: translateY(-1px);
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.field-grid,
.extras-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.compact-grid {
  grid-template-columns: minmax(0, 1fr) auto;
}

.field-full {
  grid-column: 1 / -1;
}

.extras-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-extras-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(110px, 0.55fr) minmax(130px, 0.65fr);
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.field input,
.field select {
  width: 100%;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.field-compact {
  max-width: 180px;
}

#killerConfig {
  grid-template-columns: minmax(0, 1fr) minmax(160px, 180px) minmax(150px, 170px);
  align-items: end;
}

.field.checkbox {
  align-content: end;
}

.field.checkbox input {
  width: auto;
}

.hidden {
  display: none;
}

.squad-box {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-softer);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.picker {
  position: relative;
  display: grid;
  gap: 6px;
}

.picker-trigger {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.picker-trigger::after {
  content: "▾";
  color: var(--muted);
  flex: 0 0 auto;
}

.picker-trigger.open::after {
  content: "▴";
}

.picker-value {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.picker-value-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
}

.picker-value-copy strong,
.picker-option-copy strong {
  color: var(--text);
}

.picker-value-copy span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.thumb.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff4ee;
  background: linear-gradient(135deg, rgba(201, 73, 52, 0.95), rgba(255, 139, 91, 0.92));
}

.thumb.placeholder svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.rarity-common {
  background-color: rgba(145, 154, 170, 0.18);
  border-color: rgba(145, 154, 170, 0.55);
  box-shadow: 0 0 0 1px rgba(145, 154, 170, 0.22), 0 0 18px rgba(145, 154, 170, 0.2);
}

.rarity-uncommon {
  background-color: rgba(98, 190, 119, 0.2);
  border-color: rgba(98, 190, 119, 0.58);
  box-shadow: 0 0 0 1px rgba(98, 190, 119, 0.2), 0 0 18px rgba(98, 190, 119, 0.24);
}

.rarity-rare {
  background-color: rgba(77, 145, 255, 0.18);
  border-color: rgba(77, 145, 255, 0.56);
  box-shadow: 0 0 0 1px rgba(77, 145, 255, 0.2), 0 0 18px rgba(77, 145, 255, 0.22);
}

.rarity-very-rare {
  background-color: rgba(184, 89, 255, 0.18);
  border-color: rgba(184, 89, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(184, 89, 255, 0.22), 0 0 18px rgba(184, 89, 255, 0.25);
}

.rarity-event {
  background: linear-gradient(135deg, rgba(255, 184, 77, 0.24), rgba(255, 99, 71, 0.24));
  border-color: rgba(255, 184, 77, 0.58);
  box-shadow: 0 0 0 1px rgba(255, 184, 77, 0.22), 0 0 18px rgba(255, 138, 76, 0.28);
}

.rarity-visceral {
  background: linear-gradient(135deg, rgba(189, 56, 56, 0.26), rgba(122, 23, 23, 0.26));
  border-color: rgba(215, 86, 86, 0.62);
  box-shadow: 0 0 0 1px rgba(215, 86, 86, 0.2), 0 0 18px rgba(177, 46, 46, 0.28);
}

.picker-menu {
  position: static;
  inset: auto;
  max-height: 285px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 8px;
  background: rgba(13, 16, 20, 0.98);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.picker-menu.hidden {
  display: none;
}

.picker-empty {
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.9rem;
}

.picker-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
}

.picker-option:hover,
.picker-option.selected {
  border-color: rgba(201, 73, 52, 0.45);
  background: rgba(201, 73, 52, 0.14);
}

.scroll-top-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(201, 73, 52, 0.96), rgba(255, 139, 91, 0.92));
  color: #fff7f1;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(201, 73, 52, 0.28);
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.scroll-top-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-button:hover {
  box-shadow: 0 18px 34px rgba(201, 73, 52, 0.36);
  transform: translateY(-2px);
}

.picker-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.picker-option-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.summary-cards,
.selection-list,
.breakdown-grid {
  display: grid;
  gap: 10px;
}

.summary-cards,
.breakdown-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card,
.selection-card,
.selection-group,
.breakdown-card,
.empty-state {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  padding: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.summary-card strong {
  display: block;
  font-size: 1.7rem;
  margin-top: 6px;
}

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

.metric-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  flex: 0 0 auto;
}

.metric-icon-svg {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: #ffb08b;
  flex: 0 0 auto;
}

.metric-icon-svg svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.summary-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.selection-group {
  display: grid;
  gap: 10px;
}

.selection-group-toggle {
  width: 100%;
  list-style: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
}

.selection-group-toggle::-webkit-details-marker {
  display: none;
}

.selection-group-toggle::after {
  content: "▾";
  color: var(--muted);
  display: block;
  text-align: right;
  margin-top: -18px;
}

.selection-group:not([open]) .selection-group-toggle::after {
  content: "▸";
}

.selection-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selection-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.obsession-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.selection-group-grid {
  display: grid;
  gap: 10px;
}

.survivor-loadout-layout {
  display: grid;
  gap: 12px;
}

.killer-loadout-layout {
  display: grid;
  gap: 12px;
}

.loadout-section {
  display: grid;
  gap: 8px;
}

.loadout-section-title {
  margin: 0;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

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

.item-addon-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  min-height: 360px;
}

.item-column,
.addon-column,
.extras-selection-grid,
.killer-addon-grid {
  display: grid;
  gap: 10px;
  align-content: start;
}

.killer-addon-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item-column,
.addon-column {
  align-self: stretch;
}

.item-column {
  height: 100%;
}

.item-column .selection-card {
  height: 100%;
  min-height: 100%;
  align-content: center;
}

.item-column .selection-card .selection-card-header {
  align-items: center;
}

.item-column .selection-card .effect-list {
  align-items: center;
}

.item-column .selection-card button {
  justify-self: center;
}

.addon-column {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  height: 100%;
}

.addon-column .selection-card,
.addon-column .empty-state {
  min-height: 0;
  height: 100%;
}

.selection-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  align-content: start;
}

.selection-card-header,
.breakdown-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.selection-card-header > div {
  min-width: 0;
}

.selection-card-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.selection-card-title-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.selection-card h3 {
  margin: 0;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.effect-list {
  display: grid;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.effect-editor {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) auto minmax(0, 1.65fr);
  gap: 10px;
  align-items: end;
}

.effect-meta-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.targeting-editor {
  display: grid;
  gap: 6px;
}

.targeting-label,
.targeting-hint {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.target-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.target-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.target-chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.075);
}

.target-chip.active {
  border-color: rgba(255, 139, 91, 0.45);
  background: rgba(201, 73, 52, 0.18);
  color: #fff4ee;
  box-shadow: 0 8px 18px rgba(201, 73, 52, 0.14);
}

.selection-card button {
  justify-self: start;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 8px 11px;
}

.breakdown-card h3 {
  margin-bottom: 8px;
}

.breakdown-row {
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.breakdown-row:first-of-type {
  border-top: 0;
}

.breakdown-row strong.positive {
  color: var(--good);
}

.breakdown-row strong.negative {
  color: var(--bad);
}

.source-link {
  color: #ffb18b;
  text-decoration: none;
  font-weight: 600;
  flex: 0 0 auto;
  align-self: flex-start;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .layout,
  .hero,
  .extras-grid,
  .breakdown-grid,
  .field-grid,
  .summary-cards,
  .effect-editor,
  .compact-grid,
  .compact-extras-grid,
  .perk-grid,
  .item-addon-layout,
  #killerConfig {
    grid-template-columns: 1fr;
  }

  .controls,
  .inspector,
  .breakdown-note {
    grid-column: auto;
  }

  .button-row,
  .squad-actions {
    flex-direction: column;
  }

  .action-button-inline,
  .compact-button,
  .field-compact,
  .hero-card {
    width: 100%;
    max-width: none;
  }

  .scroll-top-button {
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
}
