*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--size-base); line-height: var(--line); font-variant-numeric: tabular-nums; }
body { margin: 0; }
a { color: inherit; text-decoration-color: var(--hairline); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, p { margin: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.masthead { border-bottom: 1px solid var(--hairline); }
.masthead-in { max-width: var(--page); margin: 0 auto; padding: var(--s3) var(--s4) 0; }
.masthead-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.brand { font-weight: 600; letter-spacing: 0.01em; }
.who { display: flex; align-items: center; gap: var(--s3); }
.who form { margin: 0; }
.nav { display: flex; gap: var(--s4); overflow-x: auto; white-space: nowrap; margin-top: var(--s3); -webkit-overflow-scrolling: touch; }
.nav a { display: inline-block; padding: var(--s2) 0; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

.page { max-width: var(--page); margin: 0 auto; padding: var(--s5) var(--s4) var(--s6); }
.page > * + * { margin-top: var(--s5); }
h1 { font-size: var(--size-h1); font-weight: 600; line-height: 1.2; }
.section-head { font-size: var(--size-h2); font-weight: 600; margin-bottom: var(--s3); }
.stack > * + * { margin-top: var(--s3); }
.meta { font-size: var(--size-small); color: var(--muted); }
.draft { font-size: var(--size-draft); }
.quote { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.draft, .row-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.flash { border-bottom: 1px solid var(--hairline); }
.flash-in { max-width: var(--page); margin: 0 auto; padding: var(--s3) var(--s4); }

.row { display: grid; grid-template-columns: 9rem 1fr auto; gap: var(--s3); align-items: baseline; padding: var(--s3) 0; border-top: 1px solid var(--hairline); }
.row:last-child { border-bottom: 1px solid var(--hairline); }
.row-wide { grid-template-columns: 1fr auto; }
.cardrow { padding: var(--s4) 0; border-top: 1px solid var(--hairline); }
.cardrow > * + * { margin-top: var(--s2); }
.cardrow form { margin-top: var(--s3); }

.table { display: block; }
.table .row { grid-template-columns: 2fr 3fr 1.2fr 1.2fr 1fr; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s5) var(--s4); }
.tile { display: block; text-decoration: none; }
.tile .big { display: block; font-size: var(--size-big); font-weight: 600; line-height: 1.1; }
.tile .big.soon { color: var(--muted); font-weight: 400; }
.tile .label { display: block; margin-top: var(--s1); }
.tile .title { display: block; color: var(--muted); font-size: var(--size-small); margin-bottom: var(--s2); }
.tile .meta { display: block; margin-top: var(--s1); }
.tile:hover .label { text-decoration: underline; }

.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s5) var(--s4); align-items: start; }
.group-name { font-weight: 600; padding-bottom: var(--s2); border-bottom: 1px solid var(--hairline); margin-bottom: var(--s3); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); margin-bottom: var(--s4); }
.counts .big { display: block; font-size: var(--size-big); font-weight: 600; line-height: 1.1; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control); padding: 0 var(--s4); border-radius: var(--radius); border: 1px solid var(--text); background: var(--text); color: var(--bg); font: inherit; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--hairline); }
.btn-outline:hover { border-color: var(--text); }
.btn-small { padding: 0 var(--s3); font-size: var(--size-small); }
.btn-link { background: none; border: 0; color: var(--muted); padding: 0 var(--s2); min-height: var(--control); font: inherit; cursor: pointer; text-decoration: underline; }
.actions { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }

label { display: block; font-size: var(--size-small); color: var(--muted); margin-bottom: var(--s1); }
input[type=text], input[type=password], input[type=datetime-local], textarea { width: 100%; min-height: var(--input); padding: var(--s2) var(--s3); font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--hairline); border-radius: var(--radius); }
input[type=datetime-local] { max-width: 20rem; }
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }

details { margin: var(--s1) 0; }
summary { cursor: pointer; color: var(--muted); font-size: var(--size-small); }
details[open] > summary { margin-bottom: var(--s2); }

.narrow { max-width: 28rem; }

@media (max-width: 760px) {
  .page { padding: var(--s4) var(--s3) var(--s5); }
  .masthead-in, .flash-in { padding-left: var(--s3); padding-right: var(--s3); }
  .row, .row-wide, .table .row, .tiles, .groups, .counts { grid-template-columns: 1fr; }
  .row, .table .row { gap: var(--s1); }
  .btn { min-height: var(--control); }
  .actions .btn, .chips .btn { flex: 1 1 auto; }
}
