/*
 * The parts every page on css/app.css is built from: the same app bar, rows,
 * groups, segmented buttons, fields and buttons as the timetable pages
 * (css/timetable-app.css keeps its own copy for the full-screen timetable), plus
 * the layout of a normal scrolling page - a header, sections, cards, text,
 * tables and the footer. A page marks itself with <html class="bc-ui"> so the
 * site navigation leaves its styling alone.
 */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { background: var(--app); line-height: 1.45; }
[hidden] { display: none !important; }
a { color: var(--accent); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* The navigation is drawn by js/shared-nav.js; keep its room so the page does not jump. */
#site-nav-placeholder { display: block; min-height: 57px; }
@media (min-width: 701px) { #site-nav-placeholder { min-height: 93px; } }

/* ---------- app bar (a page's own header row) ---------- */
.appbar {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 6px;
}
/* Below the navigation, which already keeps clear of the notch. */
#site-nav-placeholder ~ * .appbar { padding-top: 10px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: inherit; }
.icon-btn:hover { background: var(--chip); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.title-block { min-width: 0; text-align: left; }
.title-block h1 {
  display: flex; align-items: center; gap: 4px; margin: 0;
  font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .01em; line-height: 1; text-transform: uppercase;
}
.title-block h1 span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-block p { margin: 3px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-actions { display: flex; gap: 2px; }

/* ---------- small controls ---------- */
.chip {
  flex: none; height: 32px; padding: 0 12px; border-radius: 16px;
  border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; gap: 6px;
  color: inherit; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.chip:hover { background: var(--chip); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--ink); color: var(--app); border-color: var(--ink); }
.chip:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; background: var(--chip); border-radius: 10px; padding: 3px; }
.seg button, .seg a { padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: inherit; text-decoration: none; }
.seg button[aria-pressed="true"], .seg a[aria-current="page"] { background: var(--ink); color: var(--app); }
.pill {
  display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 6px;
  background: var(--chip); color: var(--muted); font-size: 10.5px; font-weight: 700; vertical-align: 1px;
}
.pill.on { background: var(--accent); color: var(--accent-ink); }
.av {
  --c: #8a7a75;
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--c); color: #fff;
  font-style: normal; font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.av.sm { width: 24px; height: 24px; font-size: 9.5px; }
.summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.summary span { padding: 5px 10px; border-radius: 999px; background: var(--chip); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.summary b { color: var(--ink); font-size: 14px; }

/* ---------- buttons ---------- */
.primary {
  width: 100%; height: 50px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 15px; text-decoration: none;
}
.primary.secondary { background: var(--chip); color: var(--ink); }
.primary.warnbtn { background: var(--warn); }
.primary:disabled, .primary.is-busy { opacity: .6; }
/* A button that sizes to its text, for pages rather than forms. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 14.5px; text-decoration: none; white-space: nowrap;
}
.button.secondary { background: var(--chip); color: var(--ink); }
.button.secondary:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.button.small { min-height: 34px; padding: 0 14px; border-radius: 17px; font-size: 13px; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-plain { display: block; width: 100%; padding: 12px 14px; color: var(--accent); font-weight: 600; text-align: left; }
.btn-link { display: block; padding: 12px 14px; color: var(--accent); font-weight: 600; text-decoration: none; }
.btn-link + .btn-link { border-top: 1px solid var(--line-strong); }
.danger-link { display: block; margin: 18px auto 0; padding: 10px 14px; color: var(--warn); font-weight: 600; font-size: 13px; }
.inline-link { color: var(--accent); font-weight: 600; text-decoration: none; }

/* ---------- grouped rows (settings-style lists) ---------- */
.page-h {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 18px 0 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.group { border-radius: 14px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong); margin-bottom: 14px; overflow: hidden; }
.group-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.group-row + .group-row { border-top: 1px solid var(--line-strong); }
.group-row > :first-child { flex: 1 1 8rem; min-width: 0; }
.group-row label { font-weight: 600; }
.group-row small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.group-row select { height: 32px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); padding: 0 6px; font: inherit; }
.linkrow {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; padding: 11px 14px; text-align: left; color: inherit; text-decoration: none;
}
.group .linkrow + .linkrow { border-top: 1px solid var(--line-strong); }
.linkrow span { font-weight: 600; color: var(--accent); }
.linkrow small { font-size: 12px; color: var(--muted); }
/* A row with an icon, text and a chevron, like the profile menu. */
.menu-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 14px; gap: 12px; align-items: center;
  width: 100%; padding: 12px 14px; color: inherit; text-decoration: none; text-align: left;
}
.group .menu-row + .menu-row { border-top: 1px solid var(--line-strong); }
.menu-row:hover { background: var(--chip); }
.menu-row:focus-visible { outline-offset: -2px; }
.menu-row svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.menu-row > svg:first-child { color: var(--accent); }
.menu-row b { display: block; font-weight: 600; font-size: 14px; }
.menu-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.menu-row .chev { width: 14px; height: 14px; opacity: .45; }
.menu-row .value { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.notes li { padding: 12px 14px; line-height: 1.45; font-size: 13px; }
.notes li + li { border-top: 1px solid var(--line-strong); }
.notes li b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.notes li span { color: var(--muted); }
.infonote { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--chip); font-size: 13px; line-height: 1.45; }
.infonote b { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.infonote p { margin: 0; }
.empty {
  padding: 28px 18px; border-radius: 16px; border: 1px dashed var(--line-strong);
  color: var(--muted); text-align: center; line-height: 1.5;
}

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
.field input, .field select, .field textarea {
  min-height: 46px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink); padding: 0 12px; font: inherit; font-weight: 500; font-size: 16px;
  width: 100%;
}
.field textarea { min-height: 140px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.field small { font-weight: 400; color: var(--muted); font-size: 12px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.form-error { margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: 13px; line-height: 1.4; }
.form-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 13px; }
.form-links button, .form-links a { color: var(--accent); font-weight: 600; text-decoration: none; font-size: inherit; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 4px; }
.status { margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--chip); color: var(--ink); font-size: 13px; line-height: 1.4; }
.status[data-tone="error"] { background: var(--warn-soft); }
/* Out of sight until it has something to say, but still in the accessibility
   tree, so a screen reader also reads out the first message. */
.status:not(.is-visible) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- a scrolling page ---------- */
/* A page uses the whole width of the screen; only running text keeps a
   readable line length (the ch limits on .lede, .section-lede and .prose). */
.site-main {
  width: 100%;
  padding: 18px 16px calc(40px + env(safe-area-inset-bottom, 0px));
}
.page-head { margin: 4px 0 22px; }
.eyebrow {
  display: block; margin: 0 0 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.page-title {
  margin: 0; max-width: 30ch;
  font-family: var(--display); font-weight: 800; font-size: clamp(34px, 6vw, 52px); line-height: .95;
  text-transform: uppercase; text-wrap: balance;
}
.lede { margin: 10px 0 0; max-width: 62ch; color: var(--muted); font-size: 15px; line-height: 1.55; }
.page-head .actions { margin-top: 18px; }
.section { margin-top: 34px; }
.section:first-child { margin-top: 0; }
.section-title {
  margin: 0 0 4px;
  font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; text-transform: uppercase;
}
.section-lede { margin: 0 0 14px; max-width: 64ch; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* Cards in a grid. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; }
.card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px; border-radius: 14px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong);
  color: inherit; text-decoration: none;
}
a.card:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.card h3 {
  margin: 0; font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.05; text-transform: uppercase;
}
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card .card-kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.card .card-foot { margin-top: auto; padding-top: 6px; }
.card.stripe { box-shadow: inset 3px 0 0 var(--stage, var(--accent)), inset 0 0 0 1px var(--line-strong); padding-left: 16px; }

/* Numbered steps. */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 10px; }
.steps li {
  counter-increment: step; position: relative;
  padding: 14px 14px 14px 52px; border-radius: 14px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 13px; color: var(--muted); line-height: 1.5;
}
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 13px;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--app); font-weight: 800; font-size: 13px;
}
.steps li b { display: block; margin-bottom: 2px; color: var(--ink); font-size: 14px; }

/* Questions and answers that fold open. */
.faq { border-radius: 14px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong); margin-bottom: 14px; overflow: hidden; }
.faq details + details { border-top: 1px solid var(--line-strong); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 14px; cursor: pointer; list-style: none; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; color: var(--muted); font-size: 18px; font-weight: 500; line-height: 1; }
.faq details[open] > summary::after { content: "−"; }
.faq details > :not(summary) { margin: 0; padding: 0 14px 14px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.faq details > :not(summary) + :not(summary) { padding-top: 0; }
.faq details > ol, .faq details > ul { padding-left: 36px; }

/* Long text: help articles, the privacy policy, the terms. */
.prose { max-width: 70ch; font-size: 15px; line-height: 1.65; }
.prose h2 { margin: 32px 0 8px; font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.05; text-transform: uppercase; }
.prose h3 { margin: 22px 0 6px; font-size: 16px; line-height: 1.3; }
.prose p, .prose ul, .prose ol { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose a { color: var(--accent); font-weight: 600; }
.prose strong { color: var(--ink); }
.prose > :first-child { margin-top: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; }

/* Data tables and code, for the API page. */
.table-wrap { overflow-x: auto; border-radius: 14px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong); margin-bottom: 14px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.data-table tr + tr td, .data-table thead + tbody tr td { border-top: 1px solid var(--line-strong); }
.data-table td:first-child { white-space: nowrap; }
code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .92em; }
:not(pre) > code { padding: 1px 5px; border-radius: 5px; background: var(--chip); overflow-wrap: anywhere; }
pre {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; overflow-x: auto;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 12.5px; line-height: 1.55;
}
.method {
  display: inline-block; min-width: 46px; padding: 2px 6px; border-radius: 6px; text-align: center;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; letter-spacing: .04em;
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line-strong); }
.site-footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 18px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  color: var(--muted); font-size: 12.5px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer a { color: inherit; font-weight: 600; text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- the toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  transform: translateX(-50%);
  width: max-content; max-width: min(440px, calc(100% - 32px));
  padding: 10px 14px; border-radius: 12px;
  background: var(--ink); color: var(--app);
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
}

@media (min-width: 701px) {
  .site-main { padding: 28px clamp(24px, 3vw, 48px) 56px; }
  .site-footer-inner { padding-inline: clamp(24px, 3vw, 48px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
