/* ---------- Hero ---------- */
.hero {
  container-type: inline-size; /* the title sizes itself to this width */
  padding-top: var(--s-6);
  display: grid;
  gap: var(--s-4);
}

/* Always one line: "Waitlisted? Beat the chart." is ~11.8em wide, so 7.8% of the column
   leaves a little slack at every width. */
.hero__title {
  font-size: clamp(20px, 6.6vw, 44px); /* fallback without container units */
  font-size: min(44px, 7.8cqi);
  white-space: nowrap;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: var(--s-1) 0 0;
}

.hero__lead {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.5;
  max-width: 42ch;
  text-wrap: pretty;
}

/* ---------- Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.pill--outline {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
}

.pill--accent,
.pill--lime {
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}

.pill--dark {
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
}

.pill--ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok);
}

.pill--warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn);
}

.pill--muted {
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

/* ---------- Card + form ---------- */
.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--r-lg);
}

.search-card {
  padding: var(--s-4);
  display: grid;
  gap: var(--s-4);
  box-shadow: var(--shadow-lift);
}

.field {
  display: grid;
  gap: var(--s-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field__label {
  display: inline-flex;
  align-items: center;
  height: 18px; /* same with or without an icon, so labels in a row line up */
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: lowercase;
  color: var(--ink-2);
}

.field__label .icon {
  color: var(--accent);
}

.field__label--dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.field__help {
  font-size: 12px;
  color: var(--muted);
}

.field__status:empty {
  display: none;
}
.field__status {
  justify-self: start;
}

.input,
.select {
  width: 100%;
  min-height: 56px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 0 var(--s-4);
  font-size: 17px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:hover,
.select:hover:not(:disabled) {
  border-color: var(--accent-soft);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint);
}

.input--mono {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.input[aria-invalid='true'] {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.input::placeholder {
  color: var(--muted);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  font-weight: 600;
  padding-right: 44px;
  text-overflow: ellipsis;
}

.select:disabled {
  border-color: var(--line);
  color: var(--muted);
  font-weight: 500;
  background: var(--field);
}

/* Matches the compact pills it sits beside (Class row). */
.input--compact {
  min-height: 0;
  height: var(--control-compact, 40px);
  padding: 0 var(--s-3);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

/* Spinner arrows push the centred number off-centre; arrow keys still step the value. */
.input--compact::-webkit-inner-spin-button,
.input--compact::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stations {
  display: grid;
  gap: var(--s-4);
}

.field-row {
  --control-compact: 40px; /* Class pills and Travellers input share this height */
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-4);
  align-items: end;
}

.field--narrow {
  width: 88px;
}

/* Segmented control -> row of pills (Today / Tomorrow / class) */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.segmented--3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.segmented__opt {
  position: relative;
  flex: 0 0 auto;
}

.segmented__opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.segmented__opt input:disabled {
  cursor: not-allowed;
}

.segmented__opt span {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 44px;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.segmented__opt small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

.segmented--3 .segmented__opt span {
  min-height: 56px;
}

.segmented__opt input:hover:not(:disabled) + span {
  border-color: var(--accent-soft);
}

.segmented__opt input:checked + span {
  background: var(--accent-tint);
  border-color: var(--accent-border);
  color: var(--accent);
}

.segmented__opt input:checked + span small {
  color: var(--accent);
}

.segmented__opt input:focus-visible + span {
  box-shadow: var(--focus);
}

.segmented__opt input:disabled + span {
  color: var(--muted);
  opacity: 0.55;
  text-decoration: line-through;
}

.segmented--compact .segmented__opt span {
  min-height: 0;
  height: var(--control-compact, 40px);
  font-size: 13px;
}

/* Hint */
.hint {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-md);
  padding: var(--s-3);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}

.hint__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--accent);
}

.form-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  font-size: 14px;
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-4);
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.btn:hover:not(:disabled) {
  border-color: var(--accent-soft);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  min-height: 56px;
  font-size: 17px;
  box-shadow: var(--shadow-lift);
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: #fff; /* a.btn: beat the global a:hover colour (sticks after a tap on phones) */
}

.btn--primary:disabled {
  opacity: 0.6;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 40px;
  font-size: 14px;
  padding: 0 var(--s-3);
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}

.btn--dark {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn--dark:hover:not(:disabled) {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: #fff;
}

@media (max-width: 420px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- "Get the extension" notice (index.html, shown when it isn't installed) ---------- */
.extension-notice {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-lg);
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  color: var(--accent-ink);
  font-size: 15px;
  line-height: 1.5;
}
.extension-notice a:not(.btn) {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}
.site-footer a {
  color: inherit;
}
.extension-notice--ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok);
  font-weight: 600;
}

/* Phones/tablets: Nischint needs the desktop extension. */
.extension-notice--mobile {
  display: grid;
  gap: 6px;
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-ink);
}
.extension-notice__title {
  font-size: 16px;
  color: var(--warn-ink);
}
.extension-notice__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 6px;
}
.extension-notice--mobile .extension-notice__actions a {
  color: var(--warn-ink);
  font-weight: 600;
  white-space: normal;
}
/* The search can't run here: make the button say so instead of failing after a tap. */
.is-mobile-device #search-form button[type='submit'] {
  opacity: 0.55;
}
/* Long status messages (e.g. "needs a laptop") wrap instead of widening the form. */
.field__status .pill {
  white-space: normal;
  max-width: 100%;
  line-height: 1.35;
}
