:root {
  --bg: #f5efe3;
  --surface: #fffaf2;
  --surface-2: #fef6ea;
  --ink: #1e1a17;
  --muted: #5f554a;
  --line: #d7c9b3;
  --accent: #0f6f5f;
  --accent-soft: #d9efe9;
  --warn: #915c11;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(51, 35, 10, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, #fbe2bc 0%, transparent 30%),
    radial-gradient(circle at 85% 30%, #d4eadf 0%, transparent 35%),
    linear-gradient(180deg, #f8f2e8 0%, #f4ebdc 100%);
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.hero h1 {
  margin: 4px 0;
  font-family: "Literata", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 78ch;
  line-height: 1.5;
}

.app-notice {
  margin: 10px 0 0;
  min-height: 1.1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.app-notice.error {
  color: #8b2b1f;
}

.app-notice.loading {
  color: var(--accent);
}

.controls {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.category-list {
  display: block;
}

.profile-tools {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.profile-tools label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
}

.profile-tools select {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font: inherit;
  background: #fff;
}

.category-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  font: inherit;
  background: #fff;
}

.workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

.panel-copy {
  margin-top: 0;
  color: var(--muted);
}

.data-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.action-button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}

.action-button:hover {
  border-color: var(--accent);
}

.tool-status {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.tool-status.error {
  color: #8b2b1f;
}

.tool-status.success {
  color: var(--accent);
}

#candidateCards {
  display: grid;
  gap: 12px;
}

.candidate-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

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

.candidate-head h3 {
  margin: 0;
  font-size: 1rem;
}

.badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fce8cc;
  color: var(--warn);
}

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

.mini-grid label {
  font-size: 0.85rem;
  font-weight: 600;
}

.mini-grid input,
.mini-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  font: inherit;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.spotlight {
  border-width: 2px;
  border-color: var(--accent);
  background: linear-gradient(180deg, #fffdf8 0%, #fff8ec 100%);
}

.spotlight h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin-bottom: 14px;
}

.spotlight .table-wrap {
  overflow-x: auto;
}

.spotlight-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.65fr 1fr;
  align-items: start;
}

.spotlight th,
.spotlight td {
  padding: 14px 12px;
}

.spotlight th {
  font-size: 0.92rem;
}

.spotlight td {
  font-size: 1.05rem;
}

.spotlight td strong {
  font-size: 1.16rem;
}

.movie-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
}

.movie-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f1e7d8;
  margin-bottom: 8px;
}

.movie-poster.hidden {
  display: none;
}

.movie-poster-link {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.movie-poster-link.hidden {
  display: none;
}

.movie-panel h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.movie-detail-row {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.movie-detail-description {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.results-row {
  cursor: pointer;
}

.results-row.active {
  background: var(--accent-soft);
}

.results-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.results-empty {
  color: var(--muted);
  font-style: italic;
}

.explain-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.explain-panel h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.explain-meta,
.explain-notes {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.explain-row {
  display: grid;
  grid-template-columns: 130px 1fr 52px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.explain-bar {
  background: #e9dece;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.explain-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.trend-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.trend-panel h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

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

.trend-window-control {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.trend-window-control select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 7px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.trend-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.83rem;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
}

.legend-dot.nomination {
  background: #0f6f5f;
}

.legend-dot.winner {
  background: #915c11;
}

.legend-dot.source {
  background: #5f554a;
}

.trend-chart {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
}

.trend-source-moves {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.trend-source-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
  font-size: 0.84rem;
}

.trend-source-row .stamp {
  color: var(--muted);
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

td strong {
  font-family: "Literata", serif;
}

.methodology ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .controls,
  .workspace {
    grid-template-columns: 1fr;
  }

  .spotlight-layout {
    grid-template-columns: 1fr;
  }

  .profile-tools {
    flex-wrap: wrap;
    align-items: center;
  }

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

@media (max-width: 620px) {
  .app-shell {
    padding: 14px;
  }

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

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

  .spotlight table,
  .spotlight thead,
  .spotlight tbody,
  .spotlight tr,
  .spotlight th,
  .spotlight td {
    display: block;
  }

  .spotlight thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .spotlight tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: #fff;
  }

  .spotlight td {
    border: 0;
    padding: 6px 0;
    font-size: 0.95rem;
  }

  .spotlight td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
  }
}
