:root { color-scheme: dark; --ink: #fff; --line: #3d3d3d; --accent: #b04808; --link: #ff8a3d; --link-hover: #ffb27f; --paper: #121212; --soft: #242424; --field: #1d1d1d; --warn: #5a4300; --bad: #5c1d1d; }
h1, h2, h3, th, label { color: var(--ink); }
h1, h2, h3, th { font-weight: 700; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, sans-serif; color: var(--ink); background: var(--paper); }
header { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; padding: .75rem 1rem; background: #000; color: var(--ink); border-bottom: 1px solid var(--line); }
.brand { flex: none; }
.brand text { font: 900 31px system-ui, sans-serif; fill: url(#brand-fade); stroke: #fff; stroke-width: 2.6px; stroke-linejoin: round; paint-order: stroke fill; }
nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; flex: 1; }
main { max-width: 100rem; margin: 0 auto; padding: 1rem; }
a { color: var(--link); font-weight: 700; text-decoration: underline; }
a:hover { color: var(--link-hover); }
button, .button { font: inherit; padding: .45rem .9rem; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
.button, .button:hover { color: #fff; }
a.button.secondary { color: var(--link); }
button.secondary, .button.secondary { background: var(--paper); color: var(--ink); }
button.danger { background: #a31515; border-color: #e04848; color: #fff; font-weight: 700; }
button[hidden] { display: none; }
button.link { background: none; border: 0; padding: 0; color: var(--link); font-weight: 700; text-decoration: underline; }
input, select, textarea { font: inherit; padding: .35rem; max-width: 100%; border: 1px solid #777; border-radius: 4px; background: var(--field); color: var(--ink); }
::placeholder { color: #b5b5b5; }
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; }
.stack { max-width: 28rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 1rem; }
.grid p { display: flex; flex-direction: column; margin: .4rem 0; }
.grid .wide { grid-column: 1 / -1; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-bottom: .75rem; }
.toolbar.alternatives { margin-top: 1.25rem; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 .75rem; max-width: 40rem; }
fieldset legend { font-weight: 700; padding: 0 .35rem; }
fieldset label { margin-right: 1.25rem; }
dialog.popup { background: var(--soft); color: var(--ink); border: 2px solid var(--link); border-radius: 8px; width: min(32rem, calc(100vw - 2rem)); padding: 1rem 1.25rem; }
dialog.popup::backdrop { background: rgba(0, 0, 0, .75); }
dialog.popup h2 { margin-top: 0; font-size: 1.2rem; }
dialog.popup button { min-width: 5rem; }
table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
th { background: var(--soft); white-space: nowrap; }
/* Label and value tables take only the width they need, so the two stay close together. */
table.details { width: auto; max-width: 100%; }
table.details th { padding-right: 2rem; }
table.details td { padding-left: 1rem; }
@media (min-width: 601px) {
  table.details th[scope=row] { white-space: nowrap; }
  table.details td { min-width: 12rem; }
}
.nowrap { white-space: nowrap; }
.breakable { overflow-wrap: anywhere; }
th[scope=row] { white-space: normal; }
.table-scroll { overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 18rem)); gap: 1.25rem; margin: .5rem 0 2rem; }
.stat { background: var(--soft); border: 3px solid var(--link); border-radius: 10px; padding: .75rem 1rem 1rem; text-align: center; }
.stat strong { display: block; font-size: 3.25rem; line-height: 1.1; }
.stat span { display: block; font-size: 1.05rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat.total { border-color: var(--link); }
.stat.total strong { color: var(--link); }
.stat.inactive { border-color: #ffd400; }
.stat.inactive strong { color: #ffd400; }
.stat.active { border-color: #1f8f47; }
.stat.active strong { color: #3ecf6e; }
.stat.new { border-color: #4d8dff; }
.stat.new strong { color: #4d8dff; }
tr[hidden], table.cards tr[hidden] { display: none !important; }
tr.past-due td { background: var(--bad); }
.message, .notice { padding: .6rem .8rem; border-radius: 4px; background: var(--soft); }
.message.error, .notice.error, .errorlist { background: var(--bad); }
.message.warning, .notice.warning { background: var(--warn); }
.tag { display: inline-block; font-size: .8rem; font-weight: 400; padding: 0 .35rem; border: 1px solid #000; border-radius: 3px; background: var(--warn); color: #fff; white-space: nowrap; vertical-align: middle; }
.tag.new { background: #1d5fd0; color: #fff; }
.tag.passenger { background: #ffd400; color: #000; }
.tag.inactive { background: #c62828; color: #fff; }
/* Veterans: the spreadsheet's red lettering, with a thin white edge so it reads on dark colours. */
.tag.branch { background: #ffffff; color: #ff0000; font-weight: 700; text-shadow: -1px -1px 0 #ffffff, 1px -1px 0 #ffffff, -1px 1px 0 #ffffff, 1px 1px 0 #ffffff; }
.tag.branch-usa { background: #6b8e23; }
.tag.branch-usmc { background: #c5e0b4; }
.tag.branch-usn { background: #bfbfbf; }
.tag.branch-usaf { background: #5b9bd5; }
.tag.branch-ussf { background: #ffe699; }
.tag.branch-uscg { background: #ffffff; }
/* Renewal status colours, most serious first. */
.tag.st-dues_form { background: #c62828; color: #fff; }
.tag.st-dues { background: #ff9a1f; color: #000; }
.tag.st-form { background: #ffd400; color: #000; }
.tag.st-complete { background: #1f8f47; color: #fff; }
.tag.waiting { background: var(--soft); color: #fff; border-color: #ff9a1f; }
.stat .breakdown { list-style: none; margin: .5rem 0 0; padding: 0; font-size: .85rem; font-weight: 700; }
.stat .breakdown .st-dues_form { color: #ff6b6b; }
.stat .breakdown .st-dues { color: #ff9a1f; }
.stat .breakdown .st-form { color: #ffd400; }
/* Inactive rows are outlined in their status colour, not filled. An inset shadow also sits on
   top of the past-due fill. */
tr.inactive-dues_form { --outline: #c62828; }
tr.inactive-dues { --outline: #ff9a1f; }
tr.inactive-form { --outline: #ffd400; }
tr.inactive td { box-shadow: inset 0 2px 0 var(--outline), inset 0 -2px 0 var(--outline); }
tr.inactive td:first-child { box-shadow: inset 2px 2px 0 var(--outline), inset 0 -2px 0 var(--outline); }
tr.inactive td:last-child { box-shadow: inset -2px 2px 0 var(--outline), inset 0 -2px 0 var(--outline); }
.years > span { display: flex; flex-wrap: wrap; gap: .4rem; }
.years a { padding: .25rem .9rem; border: 1px solid #555; border-radius: 4px; }
.years a[aria-current] { background: var(--accent); border-color: var(--link); color: #fff; }
.choices-bar { gap: .75rem 1.25rem; margin: .75rem 0 1rem; }
.choices-bar a.button.secondary[aria-current] { background: var(--accent); color: #fff; }
.stats.four { grid-template-columns: repeat(5, minmax(0, 14rem)); gap: .75rem; margin-bottom: .5rem; }
.stat.renewed { border-color: #4d8dff; }
.stat.renewed strong { color: #4d8dff; }
.stat.renewed small { display: block; font-weight: 700; color: #bbb; }
a.stat { text-decoration: none; color: #fff; }
a.stat[aria-current] { background: #3a2410; box-shadow: 0 0 0 3px #fff inset; }
.stat.st-dues_form { border-color: #c62828; }
.stat.st-dues_form strong { color: #ff6b6b; }
.stat.st-dues { border-color: #ff9a1f; }
.stat.st-dues strong { color: #ff9a1f; }
.stat.st-form { border-color: #ffd400; }
.stat.st-form strong { color: #ffd400; }
.stat.st-complete { border-color: #1f8f47; }
.stat.st-complete strong { color: #3ecf6e; }
.done { color: #3ecf6e; font-weight: 700; }
.muted { color: #bbb; }
.check-note { color: #ffd400; }
table.history strong { font-size: 1.15rem; }
table.history small { display: block; }
tr.nested td:first-child { padding-left: 1.75rem; }
tr[id] { scroll-margin-top: 4rem; }
tr:target td { background: #3a2410; }
.pay { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
td button { padding: .25rem .6rem; }
.panel { border: 2px solid var(--link); border-radius: 8px; padding: .25rem 1rem 1rem; margin: .5rem 0 1.25rem; max-width: 48rem; background: var(--soft); }
.panel .line { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: .75rem 0; }
.panel .line > strong { min-width: 7rem; }
.panel .choices { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.panel label.big { border: 1px solid #777; border-radius: 6px; padding: .55rem .9rem; cursor: pointer; }
.panel label.big:has(input:checked) { border-color: var(--link); background: #3a2410; }
button.big { padding: .65rem 1.4rem; font-size: 1.1rem; font-weight: 700; }
@media (max-width: 600px) {
  nav { order: 3; flex-basis: 100%; }
  header form { margin-left: auto; }
  table.cards thead { display: none; }
  table.details th[scope=row] { min-width: 9.5rem; padding-right: .5rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
  .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.four .renewed { grid-column: 1 / -1; }
  table.cards tr.nested { margin-left: 1rem; }
  table.cards tr.nested td:first-child { padding-left: .6rem; }
  table.cards td > span { text-align: right; }
  .stat { padding: .5rem .2rem; }
  .stat strong { font-size: 2rem; }
  .stat span { font-size: .7rem; letter-spacing: 0; }
  table.cards .nowrap { white-space: normal; }
  table.cards tr { display: block; border: 1px solid var(--line); border-radius: 6px; margin-bottom: .6rem; }
  table.cards td { display: flex; gap: .75rem; justify-content: space-between; border: 0; padding: .2rem .6rem; }
  table.cards tr.inactive { border: 2px solid var(--outline); }
  table.cards tr.inactive td { box-shadow: none; }
  table.cards td::before { content: attr(data-label); font-weight: 700; flex: none; }
}
