:root {
  --ink: #1a1f24;
  --muted: #5c6770;
  --line: #d5cec0;
  --paper: #f3efe8;
  --panel: #fffcf7;
  --accent: #c45c26;
  --navy: #102a43;
  --shadow: 0 10px 30px rgba(16, 42, 67, 0.12);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, #efe2d4 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #d9e3ec 0%, transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

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

.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

h1 {
  margin: 4px 0 0;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  letter-spacing: -0.03em;
}

h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-card {
  width: min(100%, 380px);
  background: var(--panel);
  border: 1px solid #e4dccf;
  border-radius: 18px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
}

.gate-card .sub {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.gate-card input {
  width: 100%;
  border: 1px solid #d7cfc2;
  border-radius: 12px;
  padding: 14px 14px;
  font-size: 16px;
  background: #fff;
  margin-bottom: 12px;
}

.gate-card button,
.download,
.ghost,
.tab,
.chip {
  appearance: none;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.gate-card button {
  width: 100%;
  padding: 14px;
  background: var(--navy);
  color: #fff;
  font-size: 1rem;
}

.error {
  color: #9b2c2c;
  font-size: 0.9rem;
  margin: 10px 0 0;
}

.app {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid #d7cfc2;
  padding: 8px 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  background: #efe8de;
  color: var(--ink);
  border: 1px solid #e0d6c8;
  font-size: 0.92rem;
}

.tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.latest-card,
.archive-item,
.panel,
.note-card {
  background: var(--panel);
  border: 1px solid #e4dccf;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.latest-card { margin-bottom: 28px; }

.latest-meta,
.archive-item .meta,
.panel-body,
.note-card {
  padding: 14px;
}

.latest-meta h2,
.panel-body h2,
.archive-item .meta strong {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-transform: none;
  font-size: 1.15rem;
}

.latest-meta p,
.archive-item .meta span,
.muted {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.poster-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #e8e2d8;
  cursor: zoom-in;
}

.poster-btn img {
  display: block;
  width: 100%;
  height: auto;
}

.actions {
  display: flex;
  gap: 10px;
  padding: 12px 14px 14px;
}

.actions a,
.actions button.primary {
  flex: 1;
  text-align: center;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 0;
}

.archive-list,
.notes-list {
  display: grid;
  gap: 12px;
}

.archive-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  min-height: 84px;
  align-items: center;
}

.archive-item img {
  width: 96px;
  height: 100%;
  object-fit: cover;
  background: #e8e2d8;
}

.archive-item button.open {
  margin-right: 12px;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
}

.panel { margin-bottom: 16px; }
.panel-body h3 {
  margin: 16px 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.route-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  background: #efe8de;
  color: var(--ink);
  border: 1px solid #e0d6c8;
  padding: 8px 10px;
  font-size: 0.85rem;
  border-radius: 999px;
}

.note-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  background: #e8eef4;
  color: var(--navy);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.warn { background: var(--accent); color: #fff; }
.note-card p { margin: 0; line-height: 1.45; }

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.filter-row .tab { padding: 8px 12px; font-size: 0.85rem; }

.foot {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 28, 0.92);
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  padding: 12px;
  z-index: 50;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100dvh - 120px);
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  justify-self: end;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  padding: 4px 10px;
}

.lightbox .download {
  margin-top: 10px;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  text-decoration: none;
}

.empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

[hidden] { display: none !important; }

@media (min-width: 720px) {
  .archive-list { grid-template-columns: 1fr 1fr; }
}
