:root {
  color-scheme: light;
  --bg: #f2f4f1;
  --panel: rgba(255, 255, 255, 0.9);
  --ink: #1c2521;
  --muted: #60706a;
  --line: rgba(28, 37, 33, 0.12);
  --accent: #006b5b;
  --accent-strong: #2a8f77;
  --danger: #9b2226;
  --success: #386641;
  --soft: #eef4f1;
  --shadow: 0 24px 70px rgba(28, 37, 33, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Calibri, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(0, 107, 91, 0.12), transparent 28%),
    radial-gradient(circle at right, rgba(42, 143, 119, 0.1), transparent 24%),
    linear-gradient(180deg, #f8fbf9 0%, var(--bg) 100%);
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 32px auto 48px;
  display: grid;
  gap: 24px;
}

.hero,
.panel {
  backdrop-filter: blur(12px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 34px 34px 30px;
}

.heroTop {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.heroContent {
  flex: 1 1 auto;
  min-width: 0;
}

.heroLogo {
  width: min(180px, 24vw);
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

h1,
h2 {
  margin: 0;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 1;
  max-width: none;
}

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

.lead {
  max-width: none;
  margin: 16px 0 0;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--muted);
}

.panel {
  padding: 28px;
}

button:focus {
  outline: 3px solid rgba(10, 147, 150, 0.18);
  outline-offset: 2px;
}

.selectorSection + .selectorSection {
  margin-top: 18px;
}

.selectorGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.selectorGrid .selectorSection + .selectorSection {
  margin-top: 0;
}

.selectorHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.selectorHeader span {
  font-size: 1rem;
  font-weight: 700;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

button.secondary {
  color: var(--ink);
  background: rgba(28, 37, 33, 0.08);
}

.status {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--soft);
  color: var(--ink);
  line-height: 1.45;
  border: 1px solid var(--line);
}

.downloadSection {
  margin-top: 16px;
}

.downloadHelp {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.statusGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 16px;
  margin-top: 18px;
}

.statusPanel {
  display: grid;
  gap: 8px;
}

.statusTitle {
  font-size: 0.92rem;
  font-weight: 700;
}

.status[data-type="working"] {
  background: rgba(0, 107, 91, 0.12);
}

.status[data-type="success"] {
  background: rgba(56, 102, 65, 0.12);
  color: var(--success);
}

.status[data-type="error"] {
  background: rgba(155, 34, 38, 0.11);
  color: var(--danger);
}

.meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  line-height: 1.5;
  color: var(--muted);
}

.selectionSummary {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--soft);
  line-height: 1.5;
  color: var(--ink);
  border: 1px solid var(--line);
}

.checklist {
  margin-top: 16px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.checkboxRow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  line-height: 1.45;
}

.checkboxRow:hover {
  background: var(--soft);
}

.checkboxRow input {
  inline-size: 16px;
  block-size: 16px;
  accent-color: var(--accent);
}

.analysisHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.analysisMeta {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.yearControls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.yearBadge {
  min-width: 72px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(28, 37, 33, 0.08);
  text-align: center;
  font-weight: 600;
}

.analysisEmpty {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--soft);
  color: var(--muted);
  line-height: 1.5;
  border: 1px solid var(--line);
}

.analysisTableWrap {
  margin-top: 18px;
  overflow-x: auto;
}

.analysisTable {
  width: 100%;
  border-collapse: collapse;
}

.analysisTable th,
.analysisTable td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.analysisTable th {
  font-size: 0.92rem;
  background: var(--soft);
  position: sticky;
  top: 0;
}

.analysisTable td:not(:first-child),
.analysisTable th:not(:first-child) {
  text-align: center;
}

code {
  font-family: "Courier New", Courier, monospace;
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    margin: 20px auto;
  }

  .hero,
  .panel {
    border-radius: 20px;
  }

  .hero,
  .panel {
    padding: 20px;
  }

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

  .heroLogo {
    width: min(160px, 42vw);
  }

  button {
    width: 100%;
  }

  .selectorHeader,
  .selectorActions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .analysisHeader,
  .yearControls {
    flex-direction: column;
    align-items: stretch;
  }

  .statusGrid,
  .meta {
    grid-template-columns: 1fr;
  }

  .yearBadge {
    width: 100%;
  }
}
