:root {
  color-scheme: light dark;
  --ink: #123b43;
  --muted: #5d7479;
  --teal: #0d6570;
  --teal-bright: #178a96;
  --orange: #ed8a3b;
  --paper: #f9fcfb;
  --mist: #e9f5f5;
  --line: rgba(18, 59, 67, 0.16);
  --shadow: 0 24px 70px rgba(13, 71, 79, 0.14);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(78, 180, 190, 0.22), transparent 28rem),
    radial-gradient(circle at 92% 92%, rgba(237, 138, 59, 0.16), transparent 26rem),
    var(--mist);
}

.topbar {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand img { filter: drop-shadow(0 5px 8px rgba(13, 101, 112, 0.2)); }
.brand span { display: grid; line-height: 1; }
.brand strong { font-size: 1.2rem; letter-spacing: -0.04em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; }

.account { display: flex; align-items: center; gap: 12px; }
.identity { color: var(--muted); font-size: 0.86rem; }

main {
  width: min(900px, calc(100% - 40px));
  margin: 4vh auto 0;
  padding-bottom: max(50px, env(safe-area-inset-bottom));
}

.intro { max-width: 760px; margin: 0 auto 36px; text-align: center; }
.eyebrow { margin: 0 0 16px; color: var(--teal-bright); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.2em; }
h1 { max-width: 700px; margin: 0 auto; font-size: clamp(2.3rem, 7vw, 5rem); line-height: 0.98; letter-spacing: -0.065em; }
.lede { max-width: 680px; margin: 24px auto 0; color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.18rem); line-height: 1.65; }

.consume-card {
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-gate {
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(18px, 4vw, 32px);
  align-items: start;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--teal), var(--teal-bright));
  box-shadow: 0 10px 30px rgba(13, 101, 112, 0.22);
  font-size: 0.9rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.auth-gate .eyebrow { margin-bottom: 10px; }
.auth-gate h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); letter-spacing: -0.035em; }
.auth-gate p:not(.eyebrow) { max-width: 620px; margin: 14px 0 22px; color: var(--muted); line-height: 1.6; }
.auth-gate .button { width: auto; min-width: 220px; }
.auth-gate .auth-pending { margin-bottom: 0; padding: 11px 13px; border-radius: 12px; background: rgba(13, 101, 112, 0.08); }

.dropzone {
  min-height: 260px;
  padding: 34px 20px;
  border: 2px dashed rgba(13, 101, 112, 0.32);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(145deg, rgba(225, 245, 246, 0.7), rgba(255, 250, 244, 0.7));
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone:hover, .dropzone.dragging { border-color: var(--orange); background: rgba(255, 244, 232, 0.9); transform: translateY(-2px); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone strong { font-size: clamp(1.1rem, 3vw, 1.45rem); }
.dropzone > span:last-child { color: var(--muted); font-size: 0.92rem; }

.drop-icon {
  width: 68px;
  height: 68px;
  margin-bottom: 8px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--teal);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(13, 101, 112, 0.12);
}
.drop-icon svg { width: 38px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.queue-wrap { margin-top: 24px; }
.queue-heading { display: flex; justify-content: space-between; align-items: center; }
.queue-heading h2 { margin: 0; font-size: 1rem; }
.queue { margin: 14px 0 18px; padding: 0; display: grid; gap: 8px; list-style: none; }
.queue li { padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; display: flex; justify-content: space-between; gap: 16px; background: rgba(255,255,255,0.55); }
.queue .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue .size { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }

.button { min-height: 42px; padding: 0 17px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 0.88rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.button-primary { width: 100%; min-height: 50px; color: white; background: linear-gradient(120deg, var(--teal), var(--teal-bright)); box-shadow: 0 10px 22px rgba(13, 101, 112, 0.22); }
.button-secondary { color: var(--teal); border: 1px solid var(--line); background: rgba(255,255,255,0.65); }
.button:disabled { opacity: 0.55; cursor: wait; }
.text-button { padding: 5px; border: 0; color: var(--teal); background: none; font: inherit; font-size: 0.85rem; cursor: pointer; }
.status { min-height: 0; margin-top: 16px; border-radius: 12px; line-height: 1.5; }
.status:not(:empty) { padding: 12px 14px; background: rgba(13, 101, 112, 0.08); }
.status.error { color: #8a2f25; background: rgba(190, 62, 45, 0.1); }
.status.success { color: #185e43; background: rgba(42, 143, 98, 0.11); }

.routes { margin: 32px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.routes article { min-height: 150px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; display: flex; gap: 14px; background: rgba(249,252,251,0.58); }
.route-number { color: var(--orange); font: 750 0.72rem ui-monospace, monospace; }
.routes h2 { margin: 0 0 8px; font-size: 1rem; }
.routes p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.routes code { color: var(--teal); font-weight: 700; }
.privacy-note { max-width: 700px; margin: 0 auto; color: var(--muted); text-align: center; font-size: 0.78rem; line-height: 1.55; }
.hidden { display: none !important; }

@media (max-width: 720px) {
  .topbar { width: min(100% - 24px, 1120px); padding: 14px 0; align-items: flex-start; }
  .account { align-items: flex-end; flex-direction: column; gap: 7px; }
  .identity { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { width: min(100% - 24px, 900px); margin-top: 5vh; }
  .routes { grid-template-columns: 1fr; }
  .routes article { min-height: 0; }
  .auth-gate { grid-template-columns: 1fr; }
  .auth-gate .button { width: 100%; }
}

@media (prefers-color-scheme: dark) {
  :root { --ink: #e5f4f3; --muted: #a7bebf; --paper: #102d32; --mist: #09262b; --line: rgba(208,239,239,0.15); --shadow: 0 24px 70px rgba(0,0,0,0.28); }
  .consume-card { border-color: rgba(255,255,255,0.08); }
  .auth-gate { border-color: rgba(255,255,255,0.08); }
  .dropzone { background: linear-gradient(145deg, rgba(17,69,75,0.78), rgba(65,44,26,0.45)); }
  .dropzone:hover, .dropzone.dragging { background: rgba(81, 52, 29, 0.68); }
  .drop-icon, .button-secondary, .queue li { background: rgba(255,255,255,0.07); }
  .routes article { background: rgba(16,45,50,0.62); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
