:root {
  color-scheme: light dark;
  --bg: #fbfbfa;
  --fg: #16171a;
  --muted: #5d6067;
  --line: #e0e0dd;
  --card: #ffffff;
  --accent: #c60018;      /* the one red everyone in Switzerland recognises */
  --accent-fg: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151a;
    --fg: #ececf1;
    --muted: #9b9fa8;
    --line: #2a2c34;
    --card: #1c1e25;
    --accent: #ff4d5e;
    --accent-fg: #1a0004;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 20px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

header { margin-bottom: 2rem; }

h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -.02em;
}

.tagline {
  margin: .25rem 0 0;
  color: var(--muted);
}

#ask-form {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}

#question {
  flex: 1;
  min-width: 0;
  padding: .8rem 1rem;
  font-size: 1rem;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .6rem;
}

#question:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#submit {
  padding: .8rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent);
  border: 0;
  border-radius: .6rem;
  cursor: pointer;
}

#submit[disabled] { opacity: .55; cursor: progress; }

#examples {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 2rem;
}

.example {
  padding: .35rem .7rem;
  font: inherit;
  font-size: .85rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.example:hover { color: var(--fg); border-color: var(--muted); }

.card {
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .8rem;
  box-shadow: var(--shadow);
}

.route {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 0 0 .35rem;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.route svg { flex: none; color: var(--muted); }

.when {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: .95rem;
}

.go {
  display: inline-block;
  padding: .75rem 1.3rem;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent);
  border-radius: .6rem;
  text-decoration: none;
}

.note {
  margin: 1rem 0 0;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}

.alts {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .4rem;
}

.alt {
  padding: .25rem .6rem;
  font: inherit;
  font-size: .8rem;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.alt:hover { border-color: var(--accent); }

.share {
  margin-top: .9rem;
  font-size: .85rem;
  color: var(--muted);
}

.share button {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

footer {
  margin-top: 3rem;
  color: var(--muted);
  font-size: .8rem;
}

footer a { color: inherit; }

.error { border-color: var(--accent); }

.chip {
  padding: .25rem .6rem;
  font-size: .8rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.alts { margin-bottom: 1rem; }

.langs {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .75rem;
}

.lang {
  padding: 0;
  font: inherit;
  font-size: .8rem;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
}

.lang.current { text-decoration: none; font-weight: 600; color: var(--fg); }

/* Countdown before leaving for SBB. */
.countdown {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: .9rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.countdown .cancel {
  font: inherit;
  color: var(--fg);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .25rem .8rem;
  cursor: pointer;
}

.countdown .cancel:hover { border-color: var(--accent); color: var(--accent); }

/* Debug view. Only rendered when a valid debug token was supplied. */
.debug {
  margin-top: 1rem;
  padding: .9rem 1.1rem;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: .8rem;
  font-size: .85rem;
}

.debug summary {
  cursor: pointer;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--muted);
}

.debug-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .15rem .8rem;
  margin: .8rem 0 0;
}

.debug-facts dt { color: var(--muted); }
.debug-facts dd { margin: 0; font-variant-numeric: tabular-nums; }

.debug-label {
  margin: 1rem 0 .3rem;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.debug pre {
  margin: 0;
  padding: .7rem .8rem;
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: .5rem;
  font-size: .78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Debug mode is sticky, invisible in the URL, and changes behaviour, so it
   announces itself across the top of the page rather than in a corner. */
.debug-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem 1.25rem;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: .85rem;
  line-height: 1.45;
}

.debug-banner.rejected { background: var(--muted); }

.debug-banner-text { max-width: 62ch; }

.debug-banner strong { font-weight: 700; }

.debug-banner button {
  flex: none;
  padding: .4rem .9rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: inherit;
  background: rgba(0, 0, 0, .22);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.debug-banner button:hover { background: rgba(0, 0, 0, .38); }
