/* Minimal responsive base; real design comes with the roster UI. */
:root {
  --ink: #1a2330;
  --paper: #f6f7f9;
  --card: #ffffff;
  --brand: #123a5f;
  --line: #d8dde4;
  --error: #a4243b;
  --muted: #5c6773;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--brand);
  color: #fff;
}
header.site .brand { color: #fff; font-weight: 700; text-decoration: none; }
header.site nav { display: flex; align-items: center; gap: 0.75rem; }
header.site nav a { color: #fff; }
.muted-inverse { color: #b9c6d4; font-size: 0.9rem; }
main { max-width: 60rem; margin: 1.5rem auto; padding: 0 1rem; }
main > * + * { margin-top: 1rem; } /* stacked cards / breach strip */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem; }
.card.narrow { max-width: 24rem; margin: 3rem auto; }
label { display: block; margin: 0.75rem 0; }
input { display: block; width: 100%; padding: 0.5rem; margin-top: 0.25rem;
        border: 1px solid var(--line); border-radius: 4px; font: inherit; }
button { padding: 0.5rem 1rem; border: 0; border-radius: 4px; font: inherit;
         background: var(--brand); color: #fff; cursor: pointer; }
button.link { background: none; color: #fff; text-decoration: underline; padding: 0; }
.error { color: var(--error); }
.muted { color: var(--muted); font-size: 0.9rem; }
#offline-banner {
  background: #8a5a00; color: #fff; text-align: center; padding: 0.4rem;
  font-size: 0.9rem;
}
form[inert] { opacity: 0.5; }

table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.85rem; color: var(--muted); }
/* Fixed 3-column rows so related fields sit together (date/phase/kind,
   locations, times, split rest, extension); stacks on narrow screens. */
.duty-form .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
@media (max-width: 44rem) { .duty-form .grid { grid-template-columns: 1fr; } }
.duty-form .full { grid-column: 1 / -1; }
/* Progressive disclosure: label/div display rules above would otherwise
   beat the hidden attribute the form's sync script sets. */
.duty-form [hidden] { display: none; }
/* Tick boxes for the rarely-used facts: inline row, box beside its text. */
.duty-form .toggles { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.duty-form .toggle { display: flex; align-items: center; gap: 0.4rem; }
.duty-form .toggle input { display: inline-block; width: auto; margin: 0; }
.duty-form select { display: block; width: 100%; padding: 0.5rem; margin-top: 0.25rem;
                    border: 1px solid var(--line); border-radius: 4px; font: inherit; }
.duty-form textarea { display: block; width: 100%; padding: 0.5rem; margin-top: 0.25rem;
                      border: 1px solid var(--line); border-radius: 4px; font: inherit;
                      resize: vertical; min-height: 3.2rem; }
.actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
button.secondary { background: var(--muted); }

.badge { padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.8rem; color: #fff; white-space: nowrap; }
.badge.ok { background: #2e7d32; }
.badge.conditional { background: #8a5a00; }
.badge.breach { background: var(--error); }
.badge.noteval { background: var(--muted); }
.badge.rostered { background: #4a6a8a; }
.badge.actual { background: #2e5d7d; outline: 2px solid #1d4059; }
tr.superseded { opacity: 0.45; }

/* Clause citations open the instrument text in a dialog. */
a.clause { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
#clause-dialog { max-width: 36rem; border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem; }
#clause-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
#clause-dialog h3 { margin-top: 0; }
#clause-text { white-space: pre-wrap; margin: 0.5rem 0; }
.results .ref { white-space: nowrap; font-variant-numeric: tabular-nums; }
.results .detail { font-size: 0.85rem; color: var(--muted); }
.results { display: block; overflow-x: auto; }
.breach-box {
  margin-top: 1rem;
  border: 1px solid var(--error);
  border-left-width: 5px;
  border-radius: 6px;
  background: #fdeef1;
  padding: 0.6rem 0.9rem;
}
.breach-box h3 { margin: 0 0 0.4rem; color: var(--error); font-size: 1rem; }
.breach-box ul { margin: 0; padding-left: 1.1rem; }
.breach-box li { margin: 0.35rem 0; color: var(--error); }
.breach-box .remedy { color: var(--ink); font-weight: 500; }

.zones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.zone h3 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
}
.zone .tile { margin-bottom: 0.6rem; }
.zone .tiles { display: flex; flex-direction: column; gap: 0.6rem; }

.flag { margin: 0.4rem 0; padding: 0.4rem 0.6rem; border-radius: 4px;
        font-size: 0.85rem; background: var(--paper); border-left: 3px solid var(--line); }
.flag.warn { border-left-color: #d98e04; background: #fff8ec; }

.reductions { margin: 0.6rem 0; font-size: 0.85rem; }
.reductions summary { cursor: pointer; color: var(--brand); }
.reduction { margin: 0.5rem 0; }
.reduction ul { list-style: none; margin: 0.25rem 0; padding-left: 0.5rem; }
.reduction li.met { color: #2e7d32; }
.reduction li.notmet { color: var(--error); }
.reduction li.future { color: var(--muted); }
.tile {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--card);
}
.tile .k { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tile .v { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 0.85rem; color: var(--muted); }
.tile .sub { font-size: 0.78rem; color: var(--muted); }
.tile.ok { border-left-color: #2e7d32; }
.tile.warn { border-left-color: #d98e04; background: #fff8ec; }
.tile.over { border-left-color: var(--error); background: #fdeef1; }
.tile.info { border-left-color: var(--line); }

.check-summary { margin-top: 1rem; padding: 0.5rem 0.75rem; border-radius: 4px; background: var(--paper); }
.check-summary.Breach { border-left: 4px solid var(--error); }
.check-summary.OK { border-left: 4px solid #2e7d32; }
.check-summary.Conditional, .check-summary.NotEvaluated { border-left: 4px solid #8a5a00; }
@media (max-width: 40rem) {
  main { margin-top: 0.75rem; }
  .card.narrow { margin-top: 1rem; }
}
