:root {
  --ink: #16222f;
  --muted: #5f6f7d;
  --line: #d6dde3;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --accent: #0f766e;
  --accent-2: #ca8a04;
  --accent-soft: #dff7f1;
  --bg-1: #f3f7f9;
  --bg-2: #e1eef3;
  --bg-3: #fff7e8;
  --shadow: 0 24px 60px rgba(16, 32, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 22rem),
    radial-gradient(circle at top right, rgba(202, 138, 4, 0.14), transparent 20rem),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 48%, var(--bg-3));
}

.page-shell {
  min-height: 100vh;
}

.topbar-tools {
  display: flex;
  justify-content: flex-end;
  padding: 0.9rem clamp(1.2rem, 2vw, 2rem) 0;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.4rem 0.3rem 0.6rem;
  border: 1px solid rgba(22, 34, 47, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.82rem;
  backdrop-filter: blur(10px);
}

.language-switcher-label {
  white-space: nowrap;
}

.language-switcher select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  min-height: 1.8rem;
  padding: 0 0.15rem;
}

.language-switcher select:focus {
  outline: none;
}

.topband {
  padding: 2rem clamp(1.2rem, 2vw, 2rem) 1.5rem;
}

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

.topband h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.2rem, 5vw, 4.75rem);
  line-height: 0.96;
}

.lede {
  margin: 1rem 0 0;
  max-width: 52rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}

.workspace {
  padding: 0 clamp(1.2rem, 2vw, 2rem) 2rem;
  display: grid;
  gap: 1.2rem;
}

.controls-panel,
.preview-panel,
.notes-panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
}

.controls-panel {
  border-radius: 16px;
  padding: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.control-group {
  display: grid;
  gap: 0.45rem;
}

.control-group label,
.status-label,
.section-kicker,
.summary-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.control-group select {
  width: 100%;
  min-height: 2.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 0.8rem;
  background: var(--panel-strong);
  color: var(--ink);
  font: inherit;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.button {
  min-height: 2.9rem;
  padding: 0 1rem;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), #115e59);
  color: white;
}

.button-secondary {
  background: linear-gradient(135deg, var(--accent-2), #a16207);
  color: white;
}

.button-ghost {
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
}

.status-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(22, 34, 47, 0.08);
}

.status-value {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.preview-panel {
  border-radius: 20px;
  padding: 1rem;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.preview-header h2 {
  margin: 0.25rem 0 0;
  font-size: 1.4rem;
}

.source-note {
  margin: 0;
  max-width: 36rem;
  text-align: right;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.summary-strip {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-strip article {
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 250, 0.92));
  border: 1px solid rgba(22, 34, 47, 0.08);
  padding: 0.9rem;
}

.summary-strip strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1rem;
}

.table-wrap {
  margin-top: 1rem;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(22, 34, 47, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.schedule-table th,
.schedule-table td {
  padding: 0.9rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(22, 34, 47, 0.08);
  vertical-align: top;
}

.schedule-table thead th {
  position: sticky;
  top: 0;
  background: #f6fafb;
  z-index: 1;
}

.match-code {
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.schedule-cards {
  display: none;
  margin-top: 1rem;
  gap: 0.9rem;
}

.schedule-card {
  border-radius: 16px;
  background: white;
  border: 1px solid rgba(22, 34, 47, 0.08);
  padding: 1rem;
}

.schedule-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.card-meta {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.notes-panel {
  border-radius: 18px;
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.note-block {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(22, 34, 47, 0.08);
  padding: 0.95rem;
}

.note-block h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.note-block p,
.faq-block ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.faq-block ul {
  padding-left: 1.15rem;
}

@media (max-width: 980px) {
  .controls-panel,
  .status-row,
  .summary-strip,
  .notes-panel {
    grid-template-columns: 1fr;
  }

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

  .source-note {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .topbar-tools {
    padding-top: 0.7rem;
  }

  .language-switcher {
    width: auto;
    max-width: 100%;
  }

  .controls-panel {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    display: none;
  }

  .schedule-cards {
    display: grid;
  }

  .topband h1 {
    max-width: 100%;
  }
}

@media print {
  .topbar-tools {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .topband {
    padding: 0 0 0.8rem;
  }

  .workspace {
    padding: 0;
  }

  .controls-panel,
  .notes-panel,
  .schedule-cards {
    display: none !important;
  }

  .preview-panel {
    border: 0;
    box-shadow: none;
    padding: 0;
    background: white;
  }

  .summary-strip {
    margin: 0.5rem 0 0.8rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-strip article {
    border: 1px solid #d4d4d4;
    background: white;
  }

  .table-wrap {
    display: block;
    overflow: visible;
    border: 0;
  }

  .schedule-table {
    min-width: 0;
  }

  .schedule-table thead th {
    position: static;
    background: white;
  }

  .schedule-table th,
  .schedule-table td {
    padding: 0.45rem 0.35rem;
    font-size: 11px;
  }

  .pill {
    background: white;
    border: 1px solid #b5b5b5;
  }
}
