:root {
  --red: #b3161f; --red-dark: #8c0f17; --gold: #d4a53a; --ink: #1b1d22; --muted: #6b7079;
  --bg: #f4f4f6; --card: #fff; --line: #e1e3e8; --ok: #1f8a4c; --ok-bg: #e4f5ea; --need: #c23b22; --need-bg: #fdeae6; --half-bg: #fff4d6;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #ecedf0; --muted: #a0a4ad; --bg: #15171b; --card: #1f2227; --line: #31353d; --ok-bg: #173c27; --need-bg: #4a1d16; --half-bg: #4a3a12; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--red); }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
header.top { background: var(--red); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 4px solid #111; }
header.top nav a { color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.shield { display: inline-grid; place-items: center; width: 44px; height: 48px; background: var(--gold); color: var(--red-dark); font-weight: 800; font-size: 20px; clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 19px; }
.brand-text small { opacity: .9; font-size: 12px; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px; }
footer a { color: var(--muted); }
h1 { font-size: 26px; margin: 8px 0 8px; }
h2 { font-size: 19px; margin: 28px 0 10px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
.lead { color: var(--ink); margin: 0 0 16px; }
.hint { color: var(--muted); font-size: 14px; }
.back { display: inline-block; margin-bottom: 8px; text-decoration: none; font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card.empty { color: var(--muted); text-align: center; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--red); }
.req-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.name { font-weight: 700; font-size: 18px; }
.meta { color: var(--muted); font-size: 14px; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.need { background: var(--need-bg); color: var(--need); }
.bar { height: 8px; background: var(--line); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ok); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.facts div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-weight: 600; }
.facts span { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.note { background: var(--half-bg); border-radius: 10px; padding: 10px 12px; }
.contacts { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-size: 15px; }
.contacts strong { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.flash { padding: 10px 14px; border-radius: 10px; margin: 10px 0; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--need-bg); color: var(--need); }
/* calendar */
.cal { display: flex; flex-direction: column; gap: 8px; }
.dayrow { display: grid; grid-template-columns: 1fr 100px 100px; gap: 8px; align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.cal.compact .dayrow { grid-template-columns: 1fr 90px 90px auto; }
.dayrow.st-covered { border-color: var(--ok); }
.dayrow.st-open { border-color: var(--need); }
.daylabel { padding: 4px 6px; }
.dow { font-weight: 700; }
.state { font-size: 13px; color: var(--muted); }
.dayrow.st-open .state { color: var(--need); font-weight: 600; }
.dayrow.st-covered .state { color: var(--ok); font-weight: 600; }
.half { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; padding: 8px 4px; font-weight: 700; border: 2px solid transparent; }
.half small { font-weight: 500; font-size: 12px; }
.half.covered { background: var(--ok-bg); color: var(--ok); }
.half.open { background: var(--need-bg); color: var(--need); cursor: pointer; border-color: var(--need); }
.half.open input { position: absolute; opacity: 0; width: 0; height: 0; }
.half.open:has(input:checked) { background: var(--red); color: #fff; border-color: var(--red-dark); }
.half.open:has(input:checked) small { color: #fff; }
.half.open:has(input:checked) small::after { content: " ✓"; }
form.closed .half.open { opacity: .5; cursor: default; }
/* forms */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.grid.three { grid-template-columns: 1.2fr 1.2fr 1fr; }
@media (max-width: 560px) { .grid, .grid.three { grid-template-columns: 1fr; } .dayrow { grid-template-columns: 1fr 80px 80px; } }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
label.wide { grid-column: 1 / -1; }
input, select { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
input:focus, select:focus { outline: 2px solid var(--red); border-color: transparent; }
button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 12px 18px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--red); border-color: var(--red); color: #fff; margin-top: 12px; }
button.primary:hover { background: var(--red-dark); }
button.small, .btn.small { padding: 6px 12px; font-size: 14px; margin-top: 0; }
button.danger { color: var(--need); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
form.inline { display: inline-block; margin: 0 4px; }
form.addday { margin-top: 10px; }
form.addday label { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; }
.kv { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.kv span { color: var(--muted); font-size: 13px; min-width: 130px; }
.kv input { flex: 1; min-width: 200px; font-size: 14px; }
.vol.released { opacity: .55; }
.shiftlist { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 45%; }
.chip { background: var(--ok-bg); color: var(--ok); border-radius: 6px; padding: 2px 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
table.log { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.log td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.log tr.unsent td:last-child { color: var(--need); }
table.log tr.sent td:last-child { color: var(--ok); }
.thanks ul { padding-left: 20px; }
/* platoon colors, same as the Local 36 pocket calendar: 1 green, 2 blue, 3 red, 4 orange */
:root { --p1: #2a9d3f; --p2: #1f5fc4; --p3: #c8102e; --p4: #f26a1b; }
.plt { display: inline-block; padding: 2px 9px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 13px; white-space: nowrap; }
.plt.p1 { background: var(--p1); } .plt.p2 { background: var(--p2); } .plt.p3 { background: var(--p3); } .plt.p4 { background: var(--p4); }
.facts div.plt-fact { border-left: 6px solid var(--line); }
.facts div.plt-fact.p1 { border-left-color: var(--p1); } .facts div.plt-fact.p2 { border-left-color: var(--p2); } .facts div.plt-fact.p3 { border-left-color: var(--p3); } .facts div.plt-fact.p4 { border-left-color: var(--p4); }
.dow .pdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.pdot.p1 { background: var(--p1); } .pdot.p2 { background: var(--p2); } .pdot.p3 { background: var(--p3); } .pdot.p4 { background: var(--p4); }
.brand img.patch { width: 48px; height: 48px; border-radius: 50%; background: transparent; }

h2.sec { margin: 22px 0 6px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
h2.sec.first { margin-top: 4px; }
h2.sec + h1 { margin-top: 0; }
.facts.will div { font-weight: 700; }

/* month grid */
.months { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.month h3 { margin: 0 0 6px; text-align: center; font-size: 17px; }
.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.grid7.head div { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.cell { min-width: 0; overflow: hidden; min-height: 74px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); padding: 4px; }
.cell.blank { border: none; background: transparent; }
.cell.off { opacity: .35; min-height: 40px; }
.cell.st-open { border-color: var(--need); } .cell.st-half { border-color: #d99a00; } .cell.st-covered { border-color: var(--ok); }
.cell .num { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.cell .num .pdot { width: 8px; height: 8px; margin-right: 4px; }
.pill2 { display: block; font-size: 12px; font-weight: 700; text-align: center; border-radius: 6px; padding: 5px 0; margin-top: 3px; border: 1.5px solid transparent; color: var(--ink); }
.pill2.open { background: var(--need-bg); color: var(--need); border-color: var(--need); cursor: pointer; }
.pill2.covered { background: var(--ok-bg); color: var(--ok); }
.pill2.selected, .pill2.open:has(input:checked) { background: var(--red); color: #fff; border-color: var(--red-dark); }
.pill2 input { position: absolute; opacity: 0; width: 0; height: 0; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 6px 0 12px; align-items: center; }
.legend .pill2 { display: inline-block; width: 60px; margin: 0; }
.legend-note { margin-left: 4px; }
.openline { font-size: 14px; margin: 12px 0 0; }
@media (max-width: 420px) { .cell { min-height: 68px; padding: 3px; } .pill2 { font-size: 11px; padding: 4px 0; } .grid7 { gap: 3px; } }
.cell .num { display: flex; justify-content: space-between; align-items: baseline; }
.pnum { font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.pnum.p1 { color: var(--p1); } .pnum.p2 { color: var(--p2); } .pnum.p3 { color: var(--p3); } .pnum.p4 { color: var(--p4); }
.cell.off { opacity: .55; }
.cell.off .num { color: var(--muted); }
.legend-note::before { content: "#1–#4 = platoon working that day · "; }

.thanks-hero { text-align: center; padding: 8px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.bigpatch { width: 160px; height: 160px; border-radius: 50%; filter: drop-shadow(0 6px 14px rgba(0,0,0,.3)); }
.thanks-title { font-size: 34px; font-weight: 900; letter-spacing: .08em; color: var(--red); margin-top: 14px; }
.thanks-sub { font-size: 18px; font-weight: 600; margin-top: 2px; }
.thanks-quote { max-width: 520px; margin: 14px auto 0; font-size: 16px; line-height: 1.5; }
.thanks h2 { margin-top: 6px; }

.pwline { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.pwline input { padding: 6px 10px; font-size: 14px; width: 150px; }

.askbtn { display: block; text-align: center; margin: 4px 0 14px; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--ink); }
label.check input { width: 20px; height: 20px; margin-top: 2px; }
.card.ask { border-color: var(--gold); }

.hero { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.hero h1 { margin: 0; }
.memberphoto { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--line); }
.tiny { font-size: 13px; }
.withphoto { display: flex; gap: 10px; align-items: center; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.photocard img { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; }
input[type=file] { padding: 8px; }

button.armed { background: var(--need); color: #fff; border-color: var(--need); }

/* overnight fixes */
select, textarea { max-width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
textarea { resize: vertical; }
label .hint { margin-top: 2px; }
.card, .cell, .vol, .req-head, .meta, .name { overflow-wrap: anywhere; }
.photochip { display: inline-flex; align-items: center; gap: 6px; margin: 4px 8px 0 0; }
.photochip img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.photochip form { display: inline; }
@media (max-width: 560px) {
  table.log, table.log tbody, table.log tr, table.log td { display: block; width: 100%; }
  table.log td { padding: 2px 4px; border: 0; }
  table.log tr { border-top: 1px solid var(--line); padding: 6px 0; }
  table.log td:nth-child(2) { display: none; }
  header.top nav { font-size: 13px; }
  .req-head { flex-wrap: wrap; }
}

footer .disclaimer { display: block; max-width: 640px; margin: 0 auto 8px; }

.stepped { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 8px 12px; font-size: 15px; }
.thankline { font-size: 16px; margin: 10px 0 0; }

.hubcard { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.hubcard .hubicon { font-size: 34px; line-height: 1; flex: none; width: 44px; text-align: center; }
.hubcard .name { font-size: 20px; margin-bottom: 2px; }
.hubcard .meta { margin-bottom: 8px; }
.hubcard.soon { opacity: .75; }
a.hubcard { color: inherit; text-decoration: none; }

/* one intake form: kinds of help */
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .kinds { grid-template-columns: 1fr; } }
label.kind { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
label.kind:has(input:checked) { border-color: var(--red); outline: 2px solid var(--red); }
label.kind .hint { font-size: 13px; }
/* resources page */
.card.res .name { font-size: 17px; }
.card.res .actions { margin-top: 8px; }
.card.res.urgent { border-color: var(--red); }
.pill.wrap { white-space: normal; }

/* meal train */
.mealrow { grid-template-columns: 112px 1fr; }
.cal.compact .mealrow { grid-template-columns: 1fr auto; }
.mealrow .dish { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 4px; text-align: right; }
.mealrow .dish .chip { white-space: normal; }
.mealrow .dow { white-space: nowrap; }
.mealrow .pick { min-width: 120px; }
.dayrow.st-skip { opacity: .65; border-style: dashed; }
.dayrow.st-skip .state { color: var(--muted); }
.half.open:has(input:checked)::after { content: "picked ✓"; font-size: 12px; font-weight: 500; }
.half.open:has(input:checked) span { display: none; }
.foodnotes div { font-weight: 500; margin-top: 6px; }
.foodnotes div:first-child { margin-top: 0; }
.foodnotes div b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.card.private { border: 2px dashed var(--gold); background: var(--half-bg); }
.card.private h3 { margin-top: 0; }
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice label { flex: 1; min-width: 140px; flex-direction: row; align-items: center; gap: 8px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--red); outline: 2px solid var(--red); }
.choice input { width: 18px; height: 18px; }
.legend-note.plain::before { content: ""; }
.dayactions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.dayactions .noteform { display: flex; gap: 4px; width: 100%; justify-content: flex-end; }
.dayactions .noteform input { padding: 6px 8px; font-size: 13px; flex: 1; max-width: 220px; }
@media (max-width: 560px) { .cal.compact .mealrow { grid-template-columns: 1fr; } .dayactions { justify-content: flex-start; } }

/* special projects */
.card.job { border-left: 6px solid var(--need); }
.card.job.full { border-left-color: var(--ok); }
.card.job .req-head { align-items: center; }
.pickjob { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--need); background: var(--need-bg); color: var(--need); font-weight: 700; cursor: pointer; }
.pickjob input { width: 18px; height: 18px; }
.pickjob:has(input:checked) { background: var(--red); color: #fff; border-color: var(--red-dark); }
.supply { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.supply:first-child { border-top: 0; }
.supply .item { font-weight: 600; }
.supply .meta { font-size: 13px; }
.bring { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--need); border: 1.5px solid var(--need); background: var(--need-bg); border-radius: 999px; padding: 4px 10px; cursor: pointer; white-space: nowrap; }
.bring input { width: 16px; height: 16px; }
.bring:has(input:checked) { background: var(--red); color: #fff; border-color: var(--red-dark); }
.card.outside { border-color: var(--gold); }
.card.outside .hint { margin: 6px 0 0; }
.photocard.update img { margin-bottom: 6px; }
form.kv input { flex: 1; min-width: 200px; }

span.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 4px; }
span.check input { width: 16px; height: 16px; }
a.smslink { font-weight: 700; background: var(--ok-bg); color: var(--ok); padding: 1px 8px; border-radius: 999px; text-decoration: none; }

.pill2.backup { cursor: pointer; border-color: var(--ok); }
.pill2.backup:has(input:checked), .pill2.backup-on { background: var(--ok); color: #fff; border-color: var(--ok); }
.pill2.backup:has(input:checked)::after { content: " ★"; }

.calpick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.calpick .meta { width: 100%; }

ol.steps, ul.why { padding-left: 22px; } ol.steps li, ul.why li { margin: 6px 0; }
/* tap-to-enlarge photos */
a.zoom { display: inline-block; line-height: 0; cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: grid; place-items: center; z-index: 1000; cursor: zoom-out; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.6); }
.sibs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }
.herocard { border-color: var(--gold); }

/* helper names on the organizer calendar */
.pill2 .who { display: block; font-size: 10px; font-weight: 600; line-height: 1.15; margin-top: 1px; padding: 0 2px; white-space: normal; overflow-wrap: anywhere; }
.cal.compact .half small { white-space: normal; text-align: center; line-height: 1.15; max-width: 86px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .pill2 .who { font-size: 9px; } .cal.compact .half small { font-size: 11px; } }

.mealscard { border-color: #4caf50; }

button.gold { background: var(--gold); border-color: var(--gold); color: #1b1d22; }
button.gold:hover { filter: brightness(1.08); }

.herolink { display: block; margin: -6px 0 14px; padding: 9px 14px; border: 1px solid var(--gold); border-radius: 10px; color: var(--gold); font-weight: 600; text-decoration: none; background: var(--card); }
.herolink:hover { filter: brightness(1.1); }

.herobtn { margin-top: 10px; }

.btn.gold, a.btn.gold { background: var(--gold); border-color: var(--gold); color: #1b1d22; display: inline-block; margin: 4px 0 10px; }

.stepbar { display: flex; gap: 10px; align-items: center; margin: -6px 0 12px; }
.review div { padding: 6px 0; border-bottom: 1px solid var(--line); }
.review div:last-child { border-bottom: 0; }
.editlink { font-size: 13px; margin-left: 6px; }

.viewswitch { display: flex; gap: 0; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.viewswitch a, .viewswitch span { flex: 1; text-align: center; padding: 10px; font-weight: 600; text-decoration: none; color: var(--red); }
.viewswitch .on { background: var(--red); color: #fff; }
.memberblock .withphoto { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.itemlist { display: flex; flex-direction: column; gap: 8px; }
.itemlist .item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.itemlist .item:hover { border-color: var(--red); }
.itemlist .icon { font-size: 22px; flex: none; width: 30px; text-align: center; }
.itemlist .lbl { flex: 1; font-weight: 600; }
.itemlist .item.outside { border-color: var(--gold); }

.contactrow { position: relative; margin-bottom: 6px; }
.contactrow .removerow { margin-top: 6px; color: var(--muted); }
.addrow { margin: 2px 0 12px; }
