:root {
  --ink: #1f2328; --muted: #6b7280; --line: #e3e0d8; --bg: #f7f5f0; --card: #fff;
  --accent: #7a1f2b; --accent-soft: #f6e8ea; --ok: #1d7a46; --ok-soft: #e6f4ec;
  --warn: #8a5a00; --warn-soft: #fff4d6; --err: #b42318; --err-soft: #fdeceb; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: .4rem 0 1rem; font-weight: 600; }
h2 { font-size: 1.15rem; margin: 1.2rem 0 .6rem; font-weight: 600; }
.card h2:first-child { margin-top: 0; }
main { max-width: 1200px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
.top { background: var(--accent); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: .6rem 1.25rem; }
.top .brand { font-weight: 600; }
.top nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.top nav a { color: #fff; text-decoration: none; padding: .35rem .7rem; border-radius: 8px; opacity: .9; }
.top nav a.on, .top nav a:hover { background: rgba(255,255,255,.18); opacity: 1; }
.count { background: #fff; color: var(--accent); border-radius: 99px; padding: 0 .45rem; font-size: .8rem; font-weight: 700; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.card.narrow { max-width: 460px; margin: 3rem auto; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
small { display: block; color: var(--muted); margin-top: .15rem; }
.center { text-align: center; }
.break { word-break: break-all; }
label { display: block; margin-bottom: .75rem; font-size: .92rem; }
.label { display: block; font-size: .92rem; margin-bottom: .3rem; }
label.check { display: inline-flex; align-items: center; gap: .4rem; margin-right: 1rem; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .55rem .65rem; font: inherit; border: 1px solid #cfcac0; border-radius: 8px; background: #fff; }
input[type=checkbox] { width: auto; display: inline; margin: 0; }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
button, .button { display: inline-block; font: inherit; padding: .5rem 1rem; border-radius: 8px; border: 1px solid #c9c3b8; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.3; }
button:hover, .button:hover { background: #f1eee8; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .button.primary:hover { background: #5f1621; }
button.danger { color: var(--err); border-color: #e6b4ae; }
button.small, .button.small { padding: .25rem .6rem; font-size: .85rem; }
button.link { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: .25rem 0; }
button.big { width: 100%; padding: .85rem 1rem; font-size: 1.05rem; }
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; background: var(--ok-soft); color: #14532d; border: 1px solid #b7e0c6; }
.flash.err { background: var(--err-soft); color: var(--err); border-color: #f4c7c3; }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: #f3dc9b; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.need-text { color: var(--err); font-weight: 600; }
.draft { color: var(--warn); font-weight: 600; }
.lit { font-weight: 600; font-size: .9rem; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.toolbar h1 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
form.inline, .inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .5rem; }
form.inline input { width: auto; }
.nav-arrow { text-decoration: none; padding: 0 .4rem; }
.grid2, .grid3, .grid4, .grid6 { display: grid; gap: 0 1rem; }
.grid2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.grid3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid6 { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); align-items: end; }
.row-form { border-top: 1px solid var(--line); padding: .8rem 0; }
.row-form.inactive { opacity: .55; }
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr.inactive { opacity: .5; }
.table-wrap { overflow-x: auto; margin-bottom: 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.roster { border-collapse: collapse; font-size: .9rem; min-width: 100%; }
table.roster th, table.roster td { border: 1px solid var(--line); padding: .3rem .5rem; white-space: nowrap; }
table.roster thead th { background: #faf8f4; font-weight: 500; text-align: center; line-height: 1.35; }
table.roster thead th a { text-decoration: none; font-weight: 600; }
table.roster .rowhead { width: 2.5rem; text-align: center; color: var(--muted); background: #faf8f4; }
table.roster td.need { background: var(--err-soft); color: var(--err); font-weight: 600; }
table.roster td.covered { background: #eef5ff; }
table.roster td.confirmed { color: var(--ok); }
table.roster td.empty { color: #c6c1b6; text-align: center; }
table.roster td.na { background: #f4f2ee; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; }
.stat span { display: block; color: var(--muted); font-size: .85rem; }
.stat b { font-size: 1.5rem; font-weight: 600; }
.stat b a { text-decoration: none; }
ol.steps li { margin-bottom: .4rem; }
ol.steps li.done { color: var(--muted); text-decoration: line-through; }
ul.activity { list-style: none; padding: 0; margin: 0; }
ul.activity li { border-bottom: 1px solid var(--line); padding: .45rem 0; }
.msg-body { white-space: pre-wrap; background: #f6fbf7; border: 1px solid #d7ecdd; border-radius: 8px; padding: .6rem .8rem; }

/* Minister page: large, simple, phone-first */
.minister-body { background: #f4f1ea; }
main.minister { max-width: 520px; padding: 1rem 1rem 2rem; font-size: 17px; }
main.minister h1 { font-size: 1.7rem; margin-top: 0; }
.minister .card { padding: 1.1rem 1.1rem; }
.minister .big-text { font-size: 1.35rem; font-weight: 600; margin: 0 0 .15rem; }
.minister .station { font-size: 1.15rem; margin: 0 0 .4rem; }
.minister .two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .8rem; }
.minister .two form { margin: 0; }
.minister .duty { border: 2px solid var(--accent); }
.minister .offer { border: 2px solid #d99a00; background: #fffaf0; }
.minister .consent { border: 2px solid var(--ok); background: #f3fbf6; }
.minister .consent form { margin: .4rem 0 0; }
.minister .later { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.minister .later:last-child { border-bottom: 0; }
.minister .later form { margin: 0; }
.minister .notices-card ol { margin: 0; padding-left: 1.2rem; font-size: .95rem; }
.footer-form { text-align: center; margin-top: 1rem; }
@media (max-width: 600px) {
  .top nav a { padding: .3rem .5rem; font-size: .9rem; }
  main { padding: .75rem .75rem 2rem; }
}
details.danger-zone { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: .75rem; }
details.danger-zone summary { cursor: pointer; color: var(--err); }

/* Duty report */
.stat small { margin-top: .2rem; }
.stat.bad b { color: var(--err); }
table.report th, table.report td { white-space: nowrap; }
table.report td:first-child, table.report td:nth-child(2) { white-space: normal; }
table.report .num { text-align: center; }
table.report thead a { text-decoration: none; color: var(--ink); }
table.report thead a.sorted { text-decoration: underline; color: var(--accent); }
table.report tfoot th { border-top: 2px solid var(--ink); border-bottom: 0; }
.print-only { display: none; }
.attend td, .attend th { vertical-align: middle; }
@media print {
  header.top, .no-print, .flash, button, .button { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; font-size: 11pt; }
  main { padding: 0; max-width: none; }
  .stats { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .stat { padding: 6px 8px; border-color: #999; }
  .stat b { font-size: 16pt; }
  .table-wrap { border: 0; overflow: visible; }
  table.list th, table.list td { padding: 3px 5px; border-color: #bbb; }
  a { color: #000; text-decoration: none; }
  tr { break-inside: avoid; }
  table.report { font-size: 9pt; }
  table.report td:nth-child(2) { white-space: nowrap; font-size: 8.5pt; }
  table.report th, table.report td { padding: 2px 5px; line-height: 1.3; }
  table.report thead a, table.report thead a.sorted { color: #000; text-decoration: none; }
  table.report thead th { font-size: 8.5pt; white-space: normal; }
  .report-head h2 { margin: .2rem 0 .4rem; }
  @page { size: A4 portrait; margin: 10mm; }
}
.minister .attend-row { display: flex; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.minister .attend-row input { width: 1.3rem; height: 1.3rem; }
table.report .net { background: #f6f1e7; }
table.report thead .net a { font-weight: 700; }
.period-pick select { width: auto; display: inline-block; margin: 0 0 0 .3rem; }
.period-pick label.inline { margin-right: .5rem; }
@media print { table.report .net { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
