/* ConfCall in Tea Party Patriots Action brand colors (knowledge/editorial/*_TPPA_Brand_Guidelines.md
   in the show project): Patriot Blue #003A70, Liberty Red #E41E2E, Accent Gray #D9D9D6, and
   #F6F6F6 as the light background. Only lighter and darker versions of those colors are used.
   Type is Open Sans, the brand's body font (Nexa, the display font, needs a web license). */

@font-face {
  font-family: "Open Sans";
  src: url("/static/opensans.woff2") format("woff2");
  font-weight: 300 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --patriot-blue: #003A70;
  --liberty-red: #E41E2E;
  --accent-gray: #D9D9D6;

  --bg: #F6F6F6;
  --card: #ffffff;
  --text: #0f1d2e;
  --muted: #5a6573;
  --line: #D9D9D6;
  --accent: #003A70;          /* links, selected tab, primary buttons */
  --accent-hover: #002a52;
  --live: #E41E2E;            /* broadcast convention: the live dot is red */
  --live-bg: #eaf0f7;         /* light Patriot Blue */
  --ok: #003A70;
  --ok-bg: #e3ebf4;
  --warn: #b3121f;
  --warn-bg: #fdecee;         /* light Liberty Red */
  --danger: #c8102e;
  --band: #003A70;            /* the line-picker band */
  --field: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071a2e;            /* darker Patriot Blue */
    --card: #0d2846;
    --text: #eef2f6;
    --muted: #a7b4c3;
    --line: #1f3d60;
    --accent: #8fb3db;        /* lighter Patriot Blue, readable on navy */
    --accent-hover: #b4cde8;
    --live: #ff4b58;
    --live-bg: #12345a;
    --ok: #cfe0f2;
    --ok-bg: #163d66;
    --warn: #ff8a93;
    --warn-bg: #3a1622;
    --danger: #ff6b76;
    --band: #003A70;
    --field: #0a2340;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body.center { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
a { color: var(--accent); }
h1 { font-size: 1.35rem; font-weight: 800; margin: 0 0 .5rem; color: var(--text); letter-spacing: -.01em; }
h2 { font-size: .8rem; margin: 1.5rem 0 .5rem; color: var(--muted); font-weight: 700;
     text-transform: uppercase; letter-spacing: .08em; }

/* ---- header: white band with the logo, a Liberty Red rule, then the Patriot Blue line band ---- */
header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: #ffffff; color: #0f1d2e;
  border-bottom: 4px solid var(--liberty-red);
  position: sticky; top: 0; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { height: 40px; width: auto; display: block; }
.brand .divider { width: 1px; align-self: stretch; background: var(--accent-gray); }
.brand .product { min-width: 0; }
header .title { font-weight: 800; font-size: 1.15rem; color: var(--patriot-blue); letter-spacing: -.01em; line-height: 1.1; }
header .who { color: #5a6573; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header form { margin: 0; }
header button.secondary { color: var(--patriot-blue); border-color: var(--accent-gray); background: #fff; }
header button.secondary:hover { border-color: var(--patriot-blue); }
@media (max-width: 560px) {
  .brand img { height: 30px; }
  .brand { gap: 10px; }
  header .who { display: none; }
}

.lines-band { background: var(--band); }
.lines { display: flex; gap: 8px; padding: 10px 16px; max-width: 960px; margin: 0 auto; flex-wrap: wrap; }
.lines button {
  font: inherit; font-weight: 700; border-radius: 999px; padding: 6px 16px; cursor: pointer;
  background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .45);
}
.lines button:hover { border-color: #fff; }
.lines button[aria-selected="true"] { background: #fff; color: var(--patriot-blue); border-color: #fff; }

nav { display: flex; gap: 4px; padding: 8px 16px 0; max-width: 960px; margin: 0 auto; }
nav button {
  border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700;
  padding: 8px 12px; border-bottom: 3px solid transparent; cursor: pointer;
}
nav button:hover { color: var(--text); }
nav button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--liberty-red); }

main { max-width: 960px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.card.narrow { max-width: 420px; width: 100%; }

/* ---- sign-in and other single-card pages ---- */
.signin { text-align: center; padding: 28px 24px; border-top: 4px solid var(--liberty-red); }
.signin img { width: 240px; max-width: 80%; height: auto; margin: 0 auto 18px; display: block; }
.signin .button { margin-top: 8px; padding: 10px 20px; }
@media (prefers-color-scheme: dark) {
  .signin { background: #ffffff; color: #0f1d2e; }
  .signin h1 { color: #0f1d2e; }
  .signin p { color: #3c4754; }
  .signin a:not(.button) { color: #003A70; }
}

/* ---- live ---- */
.status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.status.live { background: var(--live-bg); border-color: transparent; border-left: 4px solid var(--live); }
.status.live .dot { background: var(--live); animation: pulse 2s infinite; }
.status .big { font-size: 1.25rem; font-weight: 800; }
.status .sub { color: var(--muted); }
@keyframes pulse { 50% { opacity: .35; } }

ul.people { list-style: none; margin: 0; padding: 0; }
ul.people li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
ul.people li:last-child { border-bottom: 0; }
.name { font-weight: 700; }
.meta { color: var(--muted); font-size: .9rem; }
.unknown { background: var(--warn-bg); margin: 0 -16px; padding: 12px 16px !important; }
.unknown .name { color: var(--warn); }
.empty { color: var(--muted); padding: 8px 0; }

/* ---- controls ---- */
.button, button.primary, button.secondary {
  display: inline-block; font: inherit; font-weight: 700; border-radius: 8px; padding: 8px 14px;
  cursor: pointer; text-decoration: none; border: 1px solid transparent;
}
.button, button.primary { background: var(--patriot-blue); color: #fff; }
.button:hover, button.primary:hover { background: var(--accent-hover); }
@media (prefers-color-scheme: dark) {
  .button, button.primary { background: #ffffff; color: var(--patriot-blue); }
  .button:hover, button.primary:hover { background: var(--accent-gray); }
  .signin .button { background: var(--patriot-blue); color: #fff; }
}
button.secondary { background: none; color: var(--text); border-color: var(--line); }
button.secondary:hover { border-color: var(--accent); }
button.link { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
button.link:hover { text-decoration: underline; }
button.danger { color: var(--danger); }

input, select {
  font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type="checkbox"] { accent-color: var(--patriot-blue); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > input { flex: 1 1 180px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.error { color: var(--danger); margin-top: 8px; }
.inactive .name { color: var(--muted); text-decoration: line-through; }
[hidden] { display: none !important; }

.dial { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; }
.dial strong { font-size: 1.2rem; font-weight: 800; color: var(--text); }
.badge { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--warn-bg); color: var(--danger); }
.setup { background: var(--warn-bg); border-color: transparent; border-left: 4px solid var(--liberty-red); margin-bottom: 12px; }
.setup ul { margin: 6px 0 0; padding-left: 20px; }
.form { display: grid; gap: 10px; margin-bottom: 12px; }
.form label { display: grid; gap: 4px; color: var(--muted); font-size: .9rem; }
.form label.check, label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
.checks { margin: 8px 0; gap: 16px; }
.checks label { display: flex; gap: 6px; align-items: center; }
.expected-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0 0; color: var(--muted); }

dialog { border: 1px solid var(--line); border-top: 4px solid var(--liberty-red); border-radius: 12px; padding: 0;
         background: var(--card); color: var(--text); width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 20, 40, .55); }
.picker { display: grid; gap: 10px; padding: 16px; margin: 0; }
.picker-list { max-height: 50vh; overflow-y: auto; overflow-x: hidden; display: grid; gap: 6px; padding: 4px 0; }
.picker-bulk { gap: 16px; }

/* ---- attendance: call cards and by-person view ---- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-weight: 700; background: none; color: var(--muted); border: 0; padding: 6px 12px; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--patriot-blue); color: #fff; }
.call-card { margin-bottom: 12px; display: grid; gap: 10px; }
.call-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.call-sum { font-weight: 700; color: var(--ok); }
.call-sum.has-absent { color: var(--text); }
.att-row { display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: start; }
.att-label { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .88rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; font-weight: 600; }
.chip.bad { background: var(--warn-bg); border-color: transparent; color: var(--danger); font-weight: 700; }
.chip.neutral { color: var(--muted); }
.call-card > button.link { justify-self: start; }
.pct { font-weight: 800; font-size: 1.1rem; color: var(--ok); }
.pct.low { color: var(--danger); }
@media (max-width: 480px) { .att-row { grid-template-columns: 1fr; gap: 4px; } }
