:root {
  color-scheme: light;
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --sidebar: #111827;
  --line: #d5dce7;
  --line-strong: #b8c2d1;
  --text: #172033;
  --muted: #64748b;
  --accent: #5b21b6;
  --accent-soft: #ede9fe;
  --blue: #2563eb;
  --red: #dc2626;
  --green: #15803d;
  --amber: #b45309;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Malgun Gothic", "Segoe UI", system-ui, sans-serif;
}

.app-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 17px;
  margin-bottom: 12px;
}

h3 {
  font-size: 14px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--green);
  background: #ecfdf5;
  font-size: 13px;
  font-weight: 800;
}

.shell {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: calc(100vh - 82px);
}

.sidebar {
  background: var(--sidebar);
  padding: 16px;
}

.nav-button,
.tab,
.refresh {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.nav-button {
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  border-color: #374151;
  background: #1f2937;
  color: #e5e7eb;
}

.nav-button.active {
  border-color: #a78bfa;
  background: #4c1d95;
  color: #ffffff;
}

.tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.content {
  padding: 20px;
  min-width: 0;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.delete-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.danger-button {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--red);
  border-radius: 6px;
  padding: 8px 11px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

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

.tabs {
  display: flex;
  gap: 8px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.metric strong {
  font-size: 24px;
}

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

.list,
.timeline {
  display: grid;
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.compact-card {
  border-left: 4px solid var(--blue);
}

.record-card {
  padding: 18px;
}

.selectable-card {
  position: relative;
}

.select-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.select-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.card-header,
.match-scoreboard {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.card-title,
.team-name {
  font-weight: 900;
}

.team-name {
  font-size: 20px;
  width: 38%;
}

.team-name.right {
  text-align: right;
}

.meta,
.record-kicker {
  color: var(--muted);
  font-size: 12px;
}

.center {
  text-align: center;
}

.score {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  white-space: nowrap;
}

.record-title {
  font-size: 23px;
  margin: 4px 0 10px;
}

.original-body {
  white-space: pre-wrap;
  line-height: 1.62;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.generated-headline {
  margin-top: 12px;
  border-left: 4px solid var(--red);
  background: #fff7ed;
  padding: 10px 12px;
  font-weight: 900;
}

.generated-summary {
  color: var(--muted);
  line-height: 1.55;
}

.event-list,
.reaction-section {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.chip {
  border: 1px solid var(--line);
  background: #f1f5f9;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  color: var(--muted);
}

.chip b {
  color: var(--text);
}

.event {
  font-size: 13px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.event.red-card {
  color: var(--red);
  border-color: #fecaca;
  background: #fef2f2;
  font-weight: 900;
}

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

.reaction {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fbfdff;
}

.reaction.press {
  background: #f8fafc;
}

.reaction-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.reaction-head span {
  color: var(--muted);
  font-size: 12px;
}

.reaction-title {
  color: var(--blue);
  font-weight: 900;
  margin-bottom: 4px;
}

.reaction-body {
  line-height: 1.5;
}

.empty {
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.empty.slim {
  padding: 10px;
  font-size: 13px;
}

@media (max-width: 820px) {
  .app-header {
    align-items: flex-start;
    gap: 12px;
    padding: 18px;
    flex-direction: column;
  }

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

  .sidebar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .nav-button {
    width: auto;
    white-space: nowrap;
    margin-bottom: 0;
  }

  .metric-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .match-scoreboard {
    align-items: center;
  }

  .team-name {
    font-size: 15px;
  }

  .score {
    font-size: 22px;
  }
}
