/* 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. */

: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: "DM Sans", sans-serif;
  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: "Lora", serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.15;
}

.app-header__subtitle {
  font-size: 17.4px; /* another ~2pt larger than round 4's 14.7px, per Guy's 17 Aug ask */
  color: var(--text-faint);
  letter-spacing: 0.02em;
  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: "Lora", serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 8px;
  max-width: 320px;
}

.screen__body {
  font-size: 15.5px;
  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: 13px 26px;
  border-radius: var(--r-lg);
  font-size: 15px;
  font-weight: 700;
  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; }

/* 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: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
}

/* Full-width action buttons outside cards (availability save, etc.). */
.btn--wide {
  width: 100%;
  max-width: none;
  padding: 13px 16px;
  font-size: 14.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: "DM Sans", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

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

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

.page-header__h1 {
  margin: 0 0 4px;
  font-family: "Lora", serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--navy);
}

.page-header__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  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: 12px;
  gap: 10px;
}

/* ── 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. 13.8px = 1pt larger than .eyebrow's 12.5px. */
.home-card__label {
  font-size: 13.8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.home-card__title {
  font-family: "Lora", serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}

.home-card__body {
  font-size: 15px;
  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: 15px;
  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); }
.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: 13.5px;
  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: 13.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  border: 1px solid;
}

.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: 13.5px;
  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: 13px;
  font-weight: 600;
}

.avail-empty {
  font-size: 15px;
  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: 13px;
  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, ~16px body
   type) — colours stay Rostas' own; font family stays DM Sans/Lora to
   match every GAS-served volunteer page (Code.gs's knoxBaseCSS_() is the
   master token source this file mirrors). */

.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: "Lora", serif;
  font-weight: 700;
  font-size: 15.5px;
  color: var(--navy);
}

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

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

.notif-empty {
  font-size: 15px;
  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: "Lora", serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--navy);
}

.modal-sheet__body {
  font-size: 15px;
  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: 15px;
  font-weight: 600;
  color: var(--text);
}

.settings-row__hint {
  font-size: 13px;
  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: 14px;
  font-weight: 600;
  padding: 10px;
  text-align: center;
}
