/* backstage.css v1 (Oct 6, 2026) -- shared look for Backstage section pages.
   The home/sign-in page (index.html) keeps its own styles. Same palette. */
:root {
  --night: #22305a;
  --night-deep: #18223f;
  --paper: #fffdf7;
  --ink: #1c2333;
  --muted: #5b6275;
  --stripe: #c8302b;
  --butter: #f2c230;
  --butter-soft: #fff3cf;
  --line: #d9d4c4;
  --error: #a3261f;
  --green: #1d7a57;
  --green-soft: #e6f4ee;
  --red-soft: #fbe9e7;
  --slate-soft: #eceae2;
  --blue-soft: #e8eefb;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--ink);
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  min-height: 100vh;
  background-color: #0f1718;
  background-image:
    linear-gradient(rgba(10, 20, 30, 0.45), rgba(10, 20, 30, 0.7)),
    url("/images/crowd-confetti.jpg");
  background-size: 100% 100%, cover;
  background-position: 0 0, center 30%;
  background-attachment: fixed;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px calc(env(safe-area-inset-bottom, 0px) + 96px);
}
.page { max-width: 560px; margin: 0 auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--butter); outline-offset: 2px; }

/* Header */
.bs-head { display: flex; justify-content: space-between; align-items: center; }
.bs-signout {
  color: #fff; font: inherit; font-weight: 600; font-size: 16px;
  background: none; border: 0; padding: 6px 0; text-decoration: underline; cursor: pointer;
}
/* Big, obvious way back: a paper-colored pill with a home icon */
.bs-home {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); color: var(--night);
  font: inherit; font-weight: 600; font-size: 17px;
  padding: 10px 18px; border-radius: 24px; text-decoration: none;
  box-shadow: 0 4px 12px rgba(8, 12, 28, 0.3);
}
.bs-home .ti { font-size: 22px; }
.bs-home-wide { display: flex; justify-content: center; width: 100%; margin-top: 18px; }

/* Floating back-to-top (same idea as the toolkit's pc-nav button, sized for thumbs) */
.bs-totop {
  position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); z-index: 25;
  width: 52px; height: 52px; border-radius: 50%; border: 0; padding: 0;
  background: var(--butter); color: var(--night-deep); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  opacity: 0; transform: scale(0.9); pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, bottom 0.15s ease;
}
.bs-totop .ti { font-size: 26px; }
.bs-totop.bs-visible { opacity: 1; transform: scale(1); pointer-events: auto; }
.bs-totop.bs-above-bar { bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }
.bs-title {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 700; font-size: 40px; line-height: 1.05;
  color: #fff; margin: 8px 0 14px;
}

/* Sections and cards */
.section-head { color: #fff; font-size: 17px; font-weight: 600; margin: 22px 2px 8px; }
.section-sub { color: #e7e9ef; font-size: 14px; margin: -4px 2px 10px; }
.card {
  background: var(--paper); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 6px 18px rgba(8, 12, 28, 0.25);
}
.card.amber { background: var(--butter-soft); border: 2px solid var(--butter); }
.card.green { background: var(--green-soft); }
.card.red { background: var(--red-soft); }
.card.slate { background: var(--slate-soft); }
.card.blue { background: var(--blue-soft); }
.card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.card p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.row-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.row-name { font-weight: 600; font-size: 17px; }
.row-date { font-weight: 600; font-size: 15px; color: var(--muted); white-space: nowrap; }
.row-line { font-size: 15px; color: var(--muted); margin-top: 2px; }
.row-post { font-size: 15px; font-weight: 600; color: var(--night); margin-top: 4px; }
.row-post.pending { color: var(--muted); font-weight: 400; font-style: italic; }
.row-note { font-size: 14px; color: var(--muted); margin-top: 6px; }
.drift { display: inline-block; font-size: 14px; background: var(--blue-soft); color: var(--night); border-radius: 6px; padding: 2px 8px; margin-top: 6px; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn-row > * { flex: 1; }
.pill {
  display: inline-block; font-size: 13px; font-weight: 600;
  padding: 2px 10px; border-radius: 10px; white-space: nowrap;
}
.pill.green { background: var(--green); color: #fff; }
.pill.red { background: var(--error); color: #fff; }
.pill.slate { background: #d6d3c8; color: var(--ink); }
.pill.amber { background: var(--butter); color: var(--ink); }
.status-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* Buttons */
button.primary, button.yes, button.no, button.ghost, a.primary {
  font: inherit; font-weight: 600; font-size: 16px;
  padding: 11px 14px; border-radius: 8px; cursor: pointer; text-align: center;
  text-decoration: none; display: inline-block;
}
button.primary, a.primary { background: var(--night); color: #fff; border: 0; }
button.yes { background: var(--green); color: #fff; border: 0; }
button.no { background: #fff; color: var(--ink); border: 2px solid var(--line); }
button.ghost { background: none; border: 0; color: var(--night); text-decoration: underline; padding: 4px 0; font-weight: 600; font-size: 15px; }
button:disabled { opacity: 0.55; cursor: default; }

/* Banners */
.banner { border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; font-size: 15px; font-weight: 600; }
.banner.amber { background: var(--butter-soft); border: 2px solid var(--butter); color: #6b4a00; }
.banner.red { background: var(--red-soft); border: 2px solid #e6b3ad; color: var(--error); }
.banner.blue { background: var(--blue-soft); border: 2px solid #b9c8ee; color: var(--night); }
.banner a { color: inherit; }
.locked { opacity: 0.45; pointer-events: none; user-select: none; }

/* Error card that replaces the page when a load fails */
.load-error { background: var(--paper); border-radius: 12px; padding: 16px; color: var(--error); }
.load-error button { margin-top: 10px; }
/* Loading: popcorn popping out of a kettle, no words (Oct 19, 2026).
   The page's loading text stays in the HTML for screen readers but is not shown. */
.loading {
  height: 110px; padding: 0; margin: 10px 0;
  font-size: 0; color: transparent; overflow: hidden;
  background: center / 120px 96px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='96' viewBox='0 0 120 96'%3E%3Cdefs%3E%3Cg id='k'%3E%3Ccircle cx='-3' cy='1' r='4' fill='%23fffdf7'/%3E%3Ccircle cx='2' cy='-2' r='4' fill='%23fff3cf'/%3E%3Ccircle cx='3' cy='3' r='4' fill='%23fffdf7'/%3E%3C/g%3E%3C/defs%3E%3Cg opacity='0'%3E%3Cuse href='%23k'/%3E%3CanimateMotion dur='1.6s' begin='0s' repeatCount='indefinite' path='M60 40 Q42 -14 22 74'/%3E%3Canimate attributeName='opacity' dur='1.6s' begin='0s' repeatCount='indefinite' values='0;1;1;0' keyTimes='0;0.1;0.75;1'/%3E%3C/g%3E%3Cg opacity='0'%3E%3Cuse href='%23k'/%3E%3CanimateMotion dur='1.6s' begin='0.32s' repeatCount='indefinite' path='M60 40 Q76 -18 96 74'/%3E%3Canimate attributeName='opacity' dur='1.6s' begin='0.32s' repeatCount='indefinite' values='0;1;1;0' keyTimes='0;0.1;0.75;1'/%3E%3C/g%3E%3Cg opacity='0'%3E%3Cuse href='%23k'/%3E%3CanimateMotion dur='1.6s' begin='0.64s' repeatCount='indefinite' path='M60 40 Q56 -24 46 74'/%3E%3Canimate attributeName='opacity' dur='1.6s' begin='0.64s' repeatCount='indefinite' values='0;1;1;0' keyTimes='0;0.1;0.75;1'/%3E%3C/g%3E%3Cg opacity='0'%3E%3Cuse href='%23k'/%3E%3CanimateMotion dur='1.6s' begin='0.96s' repeatCount='indefinite' path='M60 40 Q84 -8 108 70'/%3E%3Canimate attributeName='opacity' dur='1.6s' begin='0.96s' repeatCount='indefinite' values='0;1;1;0' keyTimes='0;0.1;0.75;1'/%3E%3C/g%3E%3Cg opacity='0'%3E%3Cuse href='%23k'/%3E%3CanimateMotion dur='1.6s' begin='1.28s' repeatCount='indefinite' path='M60 40 Q34 -6 10 70'/%3E%3Canimate attributeName='opacity' dur='1.6s' begin='1.28s' repeatCount='indefinite' values='0;1;1;0' keyTimes='0;0.1;0.75;1'/%3E%3C/g%3E%3Cg transform='rotate(-14 34 40)'%3E%3Crect x='28' y='34' width='64' height='7' rx='3' fill='%23d9d4c4'/%3E%3Crect x='54' y='28' width='12' height='7' rx='3' fill='%23d9d4c4'/%3E%3C/g%3E%3Crect x='30' y='44' width='60' height='40' rx='8' fill='%23c8302b'/%3E%3Crect x='40' y='44' width='8' height='40' fill='%23fffdf7'/%3E%3Crect x='56' y='44' width='8' height='40' fill='%23fffdf7'/%3E%3Crect x='72' y='44' width='8' height='40' fill='%23fffdf7'/%3E%3Crect x='26' y='82' width='68' height='6' rx='3' fill='%23d9d4c4'/%3E%3C/svg%3E");
}

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  font: inherit; font-size: 15px; font-weight: 600;
  padding: 7px 12px; border-radius: 18px; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.6); background: transparent; color: #fff;
}
.chip.on { background: var(--paper); color: var(--night); border-color: var(--paper); }

/* Inputs */
input[type=text], input[type=tel] {
  width: 100%; font: inherit; font-size: 16px; padding: 9px 11px;
  border: 2px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus { outline: none; border-color: var(--night); }
.note-row { display: flex; gap: 8px; margin-top: 10px; }
.note-row input { flex: 1; min-width: 0; }
.note-row button { flex: none; }

/* Sheet (decline reasons) */
.sheet-back {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 20;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--paper); width: 100%; max-width: 560px; border-radius: 16px 16px 0 0;
  padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
}
.sheet h3 { margin: 0 0 4px; font-size: 19px; }
.sheet p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.sheet .warn { background: var(--butter-soft); border: 1px solid var(--butter); border-radius: 8px; padding: 9px 11px; font-size: 14px; color: #6b4a00; margin-bottom: 12px; }
.reason {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 16px; font-weight: 600;
  padding: 12px 14px; margin-bottom: 8px; border: 2px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); cursor: pointer;
}
.reason.on { border-color: var(--night); background: var(--blue-soft); }

/* Day rows */
.day { display: flex; align-items: center; gap: 10px; }
.day .grow { flex: 1; min-width: 0; }
.day-choice { display: flex; gap: 6px; }
.day-choice button {
  font: inherit; font-size: 15px; font-weight: 600; padding: 8px 14px; border-radius: 18px;
  border: 2px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
}
.day-choice button.yes-on { background: var(--green); border-color: var(--green); color: #fff; }
.day-choice button.no-on { background: #6b7280; border-color: #6b7280; color: #fff; }
.unanswered { color: #9a6a00; font-weight: 600; font-size: 14px; }

/* Save bar */
.save-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: var(--night-deep); color: #fff;
  padding: 12px 14px calc(env(safe-area-inset-bottom, 0px) + 12px);
  display: flex; justify-content: center;
}
.save-bar .inner { width: 100%; max-width: 560px; display: flex; align-items: center; gap: 12px; }
.save-bar .grow { flex: 1; font-size: 15px; }
.save-bar button { background: var(--butter); color: var(--ink); border: 0; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; cursor: pointer; }

/* Toast */
.bs-toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  transform: translateX(-50%); background: var(--night-deep); color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 15px; z-index: 30;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); max-width: 90vw; text-align: center;
}
.more { display: block; width: 100%; margin-top: 4px; color: #fff; text-decoration: underline; background: none; border: 0; font: inherit; font-weight: 600; padding: 8px; cursor: pointer; }
.fine { color: #e7e9ef; font-size: 13px; margin: 14px 2px 0; }
.fine a { color: #fff; }
