/* app.css — tokens copied verbatim from Code.gs knoxBaseCSS_() so the
   installed app and the existing GAS-served volunteer pages read as
   one product, not two. If the brand tokens ever change, change them
   there first and mirror here.

   Typography note (21 Aug 2026): the app shell switched from
   Lora/DM Sans to a single sans-serif family everywhere (headings
   included), to read as more like Airbnb's type system. Round 1 used
   Inter; per Guy's feedback that Inter didn't read as Airbnb-like
   enough and sizes were still too small next to a real Airbnb
   screenshot, round 2 (same day) switched to Poppins — a rounder,
   more geometric face closer to Airbnb Cereal's warmth — and pushed
   heading sizes substantially larger. This is an INTENTIONAL
   divergence from knoxBaseCSS_() (Code.gs), which still serves
   Lora/DM Sans on GAS-rendered volunteer pages — the app and the web
   pages will look different in typeface until/unless Guy asks to
   bring the GAS side along too. */

:root {
  --navy: #1a2e4a;
  --navy-mid: #2b4570;
  --gold: #b8932a;
  --gold-light: #f5e9c8;
  --gold-pale: #fdf8ee;
  --green: #2d7a4f;
  --green-light: #eaf5ee;
  --green-dark: #1f5a3a;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --amber-dark: #7c4a00;
  --red: #c0392b;
  --red-light: #fdecea;
  --red-dark: #7e2520;
  --bg: #f7f9fb;
  --bg-alt: #f4f7fb;
  --text: #1e2d3d;
  --muted: #5a6a7e;
  --text-faint: #a8bdd4;
  --border: #dde4ed;
  --purple: #5b21b6;
  --purple-light: #f3f0ff;
  --card: #ffffff;
  --radius: 8px;
  --radius-lg: 14px;

  /* app-shell-only additions, not part of the GAS token set */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Airbnb-inspired additions (16 Aug 2026) — restrained, single-tier
     elevation and a proper "message bubble" radius, layered on top of
     the existing Rostas palette rather than replacing it. */
  --radius-bubble: 18px;
  --shadow-card: 0 1px 2px rgba(26, 46, 74, 0.05), 0 2px 10px rgba(26, 46, 74, 0.06);

  /* Design-system handoff additions (17 Aug 2026) — flatter card shadow,
     button radius, and pill radius from the new mobile design system
     (colors_and_type.css: --r-lg / --r-pill / --shadow-sm). */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.07);
  --r-lg: 6px;
  --r-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--gold); }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ── App header — mirrors knoxHeader_() volunteer layout, sized per the
   17 Aug 2026 design handoff (44px mark, 20px title). Top padding stays
   dynamic via --safe-top rather than the design file's flat 54px, since
   that already accounts for the notch/status bar across real devices. ── */

.app-header {
  background: var(--navy);
  color: #fff;
  padding: calc(20px + var(--safe-top)) 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header__mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.app-header__mark img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.app-header__title {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.app-header__subtitle {
  font-size: 18px; /* 21 Aug 2026: bumped alongside the Inter switch, per Guy's "increase further" call */
  color: #fff; /* 21 Aug 2026 round 5: gold (round 4) didn't stick — Guy asked for white instead */
  letter-spacing: 0.01em;
  margin-top: 2px;
}

/* Settings entry point — small gear icon, top-right of the header.
   17 Aug 2026: chosen over a tap-anywhere-on-header pattern because a
   plain-text header gives volunteers no visual cue it's tappable; a
   gear icon is a near-universal settings affordance even for
   non-technical users. margin-left:auto pushes it to the far edge of
   the existing flex row without disturbing the mark/title layout. */
.app-header__settings {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-header__settings:active {
  background: rgba(255, 255, 255, 0.22);
}

.app-header__settings .msr {
  font-size: 22px;
}

/* ── Screen container (spinner/confirm/error/need-link states) ───────── */

.screen {
  min-height: calc(100vh - 64px);
  padding: 28px 20px calc(28px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.screen__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--gold-pale);
  border: 1.5px solid var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 26px;
}

.screen__title {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 27px;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin-bottom: 8px;
  max-width: 320px;
}

.screen__body {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 24px;
}

.screen__contact {
  font-weight: 700;
  color: var(--text);
}

/* ── Buttons ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--r-lg);
  font-size: 17px;
  font-weight: 600;
  border: none;
  width: 100%;
  max-width: 300px;
}

.btn--primary {
  background: var(--navy);
  color: #fff;
}

.btn--primary:active { background: var(--navy-mid); }

.btn--primary:disabled {
  background: var(--border);
  color: var(--muted);
}

.btn--ghost {
  background: rgba(26, 46, 74, 0.06);
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn--secondary {
  background: var(--gold);
  color: #fff;
}

.btn--secondary:active { background: #a17f22; }

/* Notifications card CTA specifically (not the other .btn--ghost uses,
   e.g. the install-dismiss buttons) — Guy asked for a gold border here
   to match the gold-bordered notification icon above it. */
#notif-view-all {
  border: 1.5px solid var(--gold);
  color: var(--gold);
}

/* Home-card CTAs (design-system handoff, 17 Aug 2026) — smaller, full
   width within the card, matching colors_and_type.css button spec. */
.btn--card {
  width: 100%;
  max-width: none;
  padding: 11px 16px;
  font-size: 16.5px;
  font-weight: 600;
  margin-top: 4px;
}

/* Full-width action buttons outside cards (availability save, etc.). */
.btn--wide {
  width: 100%;
  max-width: none;
  padding: 14px 16px;
  font-size: 16.5px;
}

/* ── Spinner ───────────────────────────────────────────────────────── */

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--gold-light);
  border-top-color: var(--gold);
  animation: rostas-spin 0.8s linear infinite;
  margin-bottom: 20px;
}

@keyframes rostas-spin {
  to { transform: rotate(360deg); }
}

/* ── Error state ──────────────────────────────────────────────────── */

.screen__icon--error {
  background: var(--red-light);
  border-color: #f5a7a7;
  color: var(--red);
}

/* ── Shared page title block — eyebrow / h1 / subtitle (design-system
   handoff, 17 Aug 2026). Used at the top of Home, Availability, and
   Notification-history screens. ─────────────────────────────────────── */

.eyebrow {
  display: block;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.page-header {
  text-align: left;
}

.page-header .eyebrow { margin-bottom: 6px; }

.page-header__h1 {
  margin: 0 0 2px;
  font-family: "Poppins", sans-serif;
  font-weight: 600; /* 21 Aug 2026 round 3: 700 read too heavy at this size, per Guy's "Hi Alani" feedback */
  font-size: 2rem;
  line-height: 1.15; /* 21 Aug 2026 round 4: unset before, so it inherited body's 1.5 — at 32px that alone read as "too much padding" above/below the text even though margins were already small */
  letter-spacing: -0.01em;
  color: var(--navy);
}

.page-header__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

/* ── Home / Availability / Notifications screen shell ─────────────────
   Left-aligned scrolling column, 18px gap between blocks, per the
   design-system handoff (17 Aug 2026). ───────────────────────────────── */

.home-screen {
  padding: 22px 18px 32px;
  padding-bottom: calc(32px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

/* Home screen only — tighter vertical rhythm above/below the "Hi
   {name}" heading, so the third card (Availability) sits closer to
   the fold on smaller screens. Availability/Notifications screens
   keep the roomier default spacing (unchanged). */
.home-screen--tight {
  padding-top: 6px; /* 21 Aug 2026 round 4: was 12px — Guy said too much space above/below "Hi Alani" */
  gap: 10px;
}

/* 21 Aug 2026 round 6: halves the space specifically between "Hi Alani"
   and the first card, without touching the 10px gap between the cards
   themselves (that's shared by every child of .home-screen--tight, so it
   can't be trimmed just for the first gap without this). */
.home-screen--tight .page-header {
  margin-bottom: -5px;
}

/* ── Home cards ────────────────────────────────────────────────────── */

.home-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Gold labels next to the home-card icons — separate from the shared
   .eyebrow class (used for page-top labels) so this can be sized
   independently. */
.home-card__label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

/* 21 Aug 2026 round 5: "Your next assignment" label specifically, per
   Guy's request — every other card's label stays the default gold. */
.home-card__label--navy {
  color: var(--navy);
}

.home-card__title {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--navy);
}

/* 21 Aug 2026 round 5: "Set your availability" title specifically, per
   Guy's request — every other card's title stays the default navy. */
.home-card__title--gold {
  color: var(--gold);
}

.home-card__body {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.5;
}

/* Install card's "what you get" bullets — same size/colour as
   .home-card__body, just with a real list instead of one paragraph. */
.home-card__list {
  margin: 0;
  padding-left: 18px;
  font-size: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.home-card__list li + li {
  margin-top: 2px;
}

.home-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-card__icon--gold-pale { background: var(--gold-pale); color: var(--gold); border: 1.5px solid var(--gold); }
.home-card__icon--navy      { background: var(--navy);      color: #fff; }
.home-card__icon--gold      { background: var(--gold);      color: #fff; }

.msr {
  font-family: 'Material Symbols Rounded';
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 18px;
  line-height: 1;
}

/* ── Availability screen ──────────────────────────────────────────────
   2-column date grid, pill legend, per the design-system handoff
   (17 Aug 2026). ─────────────────────────────────────────────────────── */

.avail-back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 0;
  margin-bottom: 4px;
  align-self: flex-start;
}

.avail-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.avail-legend__item {
  font-size: 14px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  border: 1px solid;
}

/* 21 Aug 2026 round 7: "Can't make it" link inline after the "Your next
   assignment" date — same colours/shape as the GAS roster page's own
   .cant-make-it-btn (Phase4_RosterView.js) so this reads as the same
   action wherever a volunteer meets it. Shared base styling with
   .home-card__respond-link below (21 Aug 2026, Notifications card) — same
   pill look, different placement: this one sits inline after the date
   text, that one sits at the right end of the Notifications card header. */
.home-card__cant-make-it-link,
.home-card__respond-link {
  display: inline-block;
  vertical-align: middle;
  background: #fff;
  border: 1.5px solid #c0392b;
  color: #c0392b;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

.home-card__cant-make-it-link {
  margin-left: 8px;
}

.home-card__respond-link {
  margin-left: auto;
}

.home-card__cant-make-it-link:active,
.home-card__respond-link:active {
  background: #fdecea;
}

.avail-legend__item--available   { background: var(--green-light);  border-color: var(--green); color: var(--green-dark); }
.avail-legend__item--unsure      { background: var(--amber-light);  border-color: var(--amber); color: var(--amber-dark); }
.avail-legend__item--unavailable { background: var(--red-light);    border-color: var(--red);   color: var(--red-dark); }

.avail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.avail-card {
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  border: 1.5px solid;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s;
}

.avail-card:active { transform: scale(0.96); }

.avail-card--available   { background: var(--green-light);  border-color: var(--green); }
.avail-card--unsure      { background: var(--amber-light);  border-color: var(--amber); }
.avail-card--unavailable { background: var(--red-light);    border-color: var(--red); }

.avail-card__display {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.avail-card__icon {
  font-size: 16px;
  margin: 4px 0;
}

.avail-card--available   .avail-card__icon { color: var(--green); }
.avail-card--available   .avail-card__status { color: var(--green-dark); }
.avail-card--unsure      .avail-card__icon { color: var(--amber); }
.avail-card--unsure      .avail-card__status { color: var(--amber-dark); }
.avail-card--unavailable .avail-card__icon { color: var(--red); }
.avail-card--unavailable .avail-card__status { color: var(--red-dark); }

.avail-card__status {
  font-size: 13.5px;
  font-weight: 600;
}

.avail-empty {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  padding: 20px 4px;
}

.avail-toast {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 11px 20px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 200;
  max-width: 300px;
  text-align: center;
}

.avail-toast--show { opacity: 1; }

/* ── Notification history (item 28) ──────────────────────────────────── */

/* "Message bubble" treatment — these show real push-notification text, so
   they're styled to read like a message rather than a generic action card:
   a warm tint instead of flat white, a rounded-rectangle shape with one
   squared corner (the classic "received message" bubble tell), roomier
   padding, and larger, more legible type. Inspired by Airbnb's messaging
   surfaces (tinted bubble fill, restrained single-tier shadow, ~17px body
   type) — colours stay Rostas' own. Font family is Poppins, matching the
   rest of the app shell (21 Aug 2026 switch); GAS-served volunteer pages
   still use Lora/DM Sans via knoxBaseCSS_() until/unless that's brought
   along too. */

.notif-item {
  width: 100%;
  background: var(--gold-pale);
  border: 1px solid var(--gold-light);
  border-radius: 4px var(--radius-bubble) var(--radius-bubble) var(--radius-bubble);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.notif-item:last-child { margin-bottom: 0; }

.notif-item__title {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.notif-item__body {
  font-size: 18px;
  color: var(--text);
  margin-top: 5px;
  line-height: 1.6;
}

.notif-item__time {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 10px;
}

.notif-empty {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  padding: 20px 4px;
}

/* ── Modal / bottom sheet — shared by the Settings modal (gear icon) and
   the one-time push pre-prompt (17 Aug 2026). ─────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 46, 74, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 300;
}

.modal-sheet {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 18px 18px 0 0;
  padding: 22px 20px calc(22px + var(--safe-bottom));
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
  text-align: left;
}

.modal-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-sheet__title {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.modal-sheet__body {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 18px;
}

.modal-sheet__close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  padding: 4px 6px;
}

/* Settings modal — push toggle row */

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
}

.settings-row__label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.settings-row__hint {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}

.toggle {
  position: relative;
  width: 46px;
  height: 27px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  background: var(--border);
  border: none;
  padding: 0;
  transition: background 0.15s;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.toggle--on {
  background: var(--green);
}

.toggle--on::after {
  transform: translateX(19px);
}

.toggle:disabled {
  opacity: 0.5;
}

/* Settings modal — Install/Remove rows (17 Aug 2026 later) — a visual
   divider once the modal holds more than one row, and a fixed-size
   button so "Install" doesn't get squeezed by the flex row's push
   toggle sibling sizing. */

.settings-row + .settings-row {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 10px;
}

#settings-install-btn {
  flex-shrink: 0;
}

/* Push pre-prompt sheet */

.push-prompt__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.push-prompt__dismiss {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px;
  text-align: center;
}
