:root {
  --bg: #f5efe5;
  --bg-accent: #e6dcc8;
  --card: rgba(255, 251, 245, 0.88);
  --border: rgba(78, 58, 44, 0.16);
  --text: #1d1a16;
  --muted: #62564b;
  --highlight: #8b4513;
  --highlight-soft: #d68f4b;
  --shadow: 0 24px 60px rgba(50, 33, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(214, 143, 75, 0.28), transparent 32%),
    radial-gradient(circle at top right, rgba(91, 132, 177, 0.18), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, #fbf8f2 100%);
}

body.auth-locked .page {
  display: none;
}

body.auth-ready .auth-shell {
  display: none;
}

.page {
  width: min(1800px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 16px 0 32px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(860px, 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 248, 238, 0.96), rgba(246, 237, 222, 0.86));
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.auth-form {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

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

.auth-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(78, 58, 44, 0.2);
  border-radius: 12px;
  background: white;
  font: inherit;
}

.auth-message {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 248, 238, 0.96), rgba(246, 237, 222, 0.86));
  box-shadow: var(--shadow);
}

.eyebrow,
.card-kicker,
.meta-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--muted);
}

h1 {
  margin: 0 0 2px;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  line-height: 1;
}

.lede {
  max-width: 980px;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--muted);
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.meta-card,
.card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.meta-card {
  padding: 5px 8px;
  border-radius: 12px;
}

.meta-card strong {
  display: block;
  margin-top: 2px;
  font-size: 0.76rem;
}

.hero-actions {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.refresh-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  background: linear-gradient(135deg, var(--highlight), var(--highlight-soft));
  box-shadow: 0 10px 24px rgba(139, 69, 19, 0.22);
}

.refresh-button:hover {
  filter: brightness(1.04);
}

.secondary-button {
  background: linear-gradient(135deg, #4d5d6b, #74879a);
}

.status-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.pager-grid {
  display: block;
}

.checklist-card {
  margin-top: 10px;
  padding: 6px 10px;
}

.pager-card {
  margin-top: 10px;
  padding: 8px 10px;
}

.pager-head {
  margin-bottom: 6px;
}

.pager-actions {
  display: flex;
  gap: 6px;
}

.floating-refresh-button {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  background: linear-gradient(135deg, #5e6c7b, #8393a5);
  box-shadow: 0 10px 24px rgba(70, 85, 102, 0.24);
  opacity: 0.88;
  transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.floating-refresh-button:hover {
  filter: brightness(1.05);
  opacity: 1;
}

.floating-refresh-button.is-refreshing,
.refresh-button.is-refreshing {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  box-shadow: 0 10px 24px rgba(180, 100, 20, 0.26);
}

.pager-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pager-tab {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.pager-tab.is-active {
  background: linear-gradient(135deg, var(--highlight), var(--highlight-soft));
  color: white;
  box-shadow: 0 10px 24px rgba(139, 69, 19, 0.18);
}

.checklist-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  margin-top: 4px;
  padding-bottom: 2px;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 4px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
}

.check-item strong {
  font-size: 0.7rem;
}

.check-item span {
  color: var(--muted);
  font-size: 0.66rem;
}

.checklist-card .card-head {
  margin-bottom: 2px;
}

.checklist-card h2 {
  font-size: 0.88rem;
}

.checklist-card .caption {
  margin-top: 2px;
  font-size: 0.66rem;
}

.checklist-card .status-pill {
  padding: 4px 8px;
  font-size: 0.68rem;
}

.card-wide {
  grid-column: 1 / -1;
}

.card {
  padding: 14px;
}

.pager-grid > .card {
  display: none;
}

.pager-grid > .card.is-active {
  display: block;
  padding: 10px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

h2 {
  margin: 4px 0 0;
  font-size: 1.3rem;
}

.open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: white;
  background: linear-gradient(135deg, var(--highlight), var(--highlight-soft));
  white-space: nowrap;
}

img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: white;
}

.interactive-chart {
  width: 100%;
  min-height: 1040px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: white;
}

.pager-grid > .card.is-active .interactive-chart {
  min-height: calc(100vh - 280px);
}

.caption {
  margin: 8px 0 0;
  color: var(--muted);
  word-break: break-word;
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .page {
    width: min(100vw - 20px, 1400px);
    padding-top: 10px;
  }

  .hero,
  .card {
    padding: 14px;
    border-radius: 18px;
  }

  .card-head {
    flex-direction: column;
  }

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