/* Shared look for the standalone utility pages — the Cabinet Room (/commish) and the sealed-change page (/secret/…).
   Tokens match index.html / week.html (Jess's paper + night palette). Mobile-first: 16px inputs (no iOS zoom),
   44px touch targets, one column until there's room for two. */
:root {
  --paper: #f5efdd; --paper-raised: #ece3c9; --card: #fbf6e8;
  --ink: #2d3a2c; --ink-soft: #5f6b58;
  --gold: #93691f; --gold-strong: #7a5613; --gold-soft: #b98f42;
  --sage: #52705f; --sage-soft: #7c9483;
  --chaos: #90492b; --chaos-soft: #b06b45;
  --line: #d9cca4; --shadow: rgba(45, 58, 44, 0.16);
  --night-bg: #1b2417; --night-bg-raised: #232f1d; --night-ink: #f1ead4; --night-ink-soft: #b9c1a8; --night-gold: #dcae57; --night-line: #3a4632;
}
:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --paper: #171f16; --paper-raised: #1f291d; --card: #202a1e;
    --ink: #eee6d1; --ink-soft: #b7bfa9;
    --gold: #d9a94f; --gold-strong: #e9c171; --gold-soft: #c9a15c;
    --sage: #8fb09c; --sage-soft: #6c8a77;
    --chaos: #dd8a63; --chaos-soft: #c26f48;
    --line: #37402f; --shadow: rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --paper: #171f16; --paper-raised: #1f291d; --card: #202a1e;
  --ink: #eee6d1; --ink-soft: #b7bfa9;
  --gold: #d9a94f; --gold-strong: #e9c171; --gold-soft: #c9a15c;
  --sage: #8fb09c; --sage-soft: #6c8a77;
  --chaos: #dd8a63; --chaos-soft: #c26f48;
  --line: #37402f; --shadow: rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--night-bg); }
html, body { overflow-x: hidden; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font-family: 'Barlow', system-ui, sans-serif; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Night header ---------- */
.cab-head {
  background-color: var(--night-bg); color: var(--night-ink);
  background-image:
    radial-gradient(1.4px 1.4px at 12% 30%, rgba(241,234,212,0.5), transparent),
    radial-gradient(1.2px 1.2px at 46% 72%, rgba(220,174,87,0.45), transparent),
    radial-gradient(1.4px 1.4px at 78% 22%, rgba(241,234,212,0.4), transparent),
    radial-gradient(1.2px 1.2px at 92% 70%, rgba(220,174,87,0.4), transparent);
  background-repeat: no-repeat;
  padding: 1rem 16px 1.4rem;
}
.cab-head .bar { max-width: 760px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cab-head .home { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--night-ink); text-decoration: none; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; min-height: 44px; }
.cab-head .home img { width: 40px; height: 40px; border-radius: 6px; }
.cab-head .title { max-width: 760px; margin: 1rem auto 0; }
.cab-head .eyebrow { font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.68rem; color: var(--night-gold); margin: 0; }
.cab-head h1 {
  font-family: 'Bebas Neue', Impact, sans-serif; font-weight: 900; font-size: clamp(1.9rem, 7vw, 2.6rem); line-height: 1.1; margin: 0.2rem 0 0;
  background: linear-gradient(180deg, #f8ecc9 0%, #e7c476 38%, #b6873a 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.cab-head .link-btn { color: var(--night-gold); }

/* ---------- Tabs: a sticky strip you can swipe ---------- */
.cab-tabs {
  position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 14px -12px var(--shadow);
}
.cab-tabs .strip {
  max-width: 760px; margin: 0 auto; display: flex; gap: 0.4rem; padding: 0.6rem 16px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
.cab-tabs .strip::-webkit-scrollbar { display: none; }
.cab-tabs button {
  flex: 0 0 auto; scroll-snap-align: start; min-height: 40px;
  font: inherit; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); padding: 0.45rem 1rem; border-radius: 99px; cursor: pointer;
}
.cab-tabs button[aria-selected="true"] { border-color: var(--gold); color: var(--gold-strong); background: var(--paper-raised); }
.cab-tabs .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--chaos); margin-left: 0.35rem; vertical-align: 1px; }

/* ---------- Content ---------- */
.cab-main { max-width: 760px; margin: 0 auto; padding: 1.4rem 16px 4rem; }
.cab-main h2 { font-family: 'Bebas Neue', Impact, sans-serif; font-weight: 800; font-size: 1.35rem; margin: 0 0 0.3rem; }
.cab-main h3 { font-family: 'Bebas Neue', Impact, sans-serif; font-weight: 700; font-size: 1.05rem; margin: 1.8rem 0 0.6rem; }
.lead { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 1.2rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.card.gold { border-color: var(--gold-soft); box-shadow: inset 0 2px 0 var(--gold-soft); }

.field { display: grid; gap: 0.3rem; margin-bottom: 0.9rem; font-size: 0.82rem; color: var(--ink-soft); min-width: 0; }
.field input, .field select, .field textarea, .inline-input {
  font: inherit; font-size: 16px; min-height: 44px; width: 100%; padding: 0.55rem 0.7rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
}
.field textarea { min-height: 7.5rem; resize: vertical; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 420px) { .field-row.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } .field-row.three > :last-child { grid-column: 1 / -1; } }

.btn {
  font: inherit; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem; min-height: 44px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); padding: 0.6rem 1.3rem; border-radius: 99px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; text-decoration: none;
}
.btn.ghost { background: none; color: var(--ink); border-color: var(--line); }
.btn.gold { background: linear-gradient(180deg, #f3dc9a 0%, #dcae57 55%, #b6873a 100%); color: #2a1f08; border-color: #b6873a; }
.btn.danger { background: none; color: var(--chaos); border-color: var(--chaos-soft); }
.btn.small { min-height: 36px; padding: 0.35rem 0.9rem; font-size: 0.68rem; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
@media (max-width: 480px) { .btn-row.stack > .btn { flex: 1 1 100%; } }
.link-btn { font: inherit; font-size: 0.82rem; color: var(--gold-strong); background: none; border: none; padding: 0.4rem 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-btn[disabled] { opacity: 0.5; cursor: default; }
.msg { font-size: 0.85rem; color: var(--chaos); min-height: 1.3em; margin-top: 0.5rem; }
.msg.ok { color: var(--sage); }
.muted { color: var(--ink-soft); }
.small { font-size: 0.8rem; }
.mono { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; }
.tag { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-weight: 700; color: var(--chaos); }
.chip { display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 99px; padding: 0.18rem 0.6rem; color: var(--ink-soft); white-space: nowrap; }
.chip.open { color: var(--gold-strong); border-color: var(--gold-soft); }
.chip.sealed, .chip.locked { color: var(--sage); border-color: var(--sage-soft); }
.chip.ready { color: var(--gold-strong); border-color: var(--gold); background: var(--paper-raised); }
.chip.revealed { color: var(--chaos); border-color: var(--chaos-soft); }
.chip.forfeit { opacity: 0.7; }
.skeleton { color: var(--ink-soft); font-style: italic; font-size: 0.9rem; padding: 1rem 0; }

/* ---------- Ledger entries (cards at every width) ---------- */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.entry { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 0.9rem; display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; align-items: start; }
.entry .wk { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 0.72rem; font-weight: 700; color: var(--gold-strong); line-height: 1.5; text-align: center; }
.entry .wk .tag { display: block; font-size: 0.95rem; }
.entry .txt { font-weight: 600; font-size: 0.95rem; overflow-wrap: anywhere; }
.entry .who { font-style: italic; color: var(--ink-soft); font-size: 0.84rem; }
.entry .acts { grid-column: 2; display: flex; gap: 1rem; }
.entry.editing { border-color: var(--gold); }
/* Cabinet rulings on an entry: what's in force, the note, and the form that files one */
.entry .was { color: var(--ink-soft); font-size: 0.84rem; }
.entry .rules { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.25rem; font-size: 0.84rem; }
.entry .rules li { border-left: 2px solid var(--gold-soft); padding-left: 0.6rem; }
.entry .rules .rtag { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-strong); margin-right: 0.35rem; }
.entry .rules .link-btn { padding: 0; margin-left: 0.4rem; color: var(--chaos); }
.entry .ruleform { grid-column: 1 / -1; border-top: 1px dashed var(--line); margin-top: 0.5rem; padding-top: 0.7rem; }
.entry .ruleform .field { margin-bottom: 0.6rem; }
.envelope .amended { margin: 0.2rem 0 0.6rem; font-size: 0.92rem; }
.envelope .amended b { color: var(--gold-strong); }

.hint-list { margin: 0.2rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; }
.hint-list li { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.86rem; }
.hint-list .link-btn { text-align: left; padding: 0.2rem 0; }

/* ---------- Leagues ---------- */
.wk-group { margin-top: 1.4rem; }
.wk-group > .head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.wk-group > .head h3 { margin: 0; }
.wk-group > .wk-report { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 0.7rem; }
.wk-group > .head label { font-size: 0.8rem; color: var(--ink-soft); display: inline-flex; gap: 0.4rem; align-items: center; min-height: 44px; }
.lg { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 0.9rem; margin-bottom: 0.6rem; }
.lg.off { opacity: 0.6; }
.lg .inc { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 600; font-size: 0.95rem; min-height: 32px; overflow-wrap: anywhere; }
.lg .sub { font-size: 0.78rem; color: var(--ink-soft); margin: 0.15rem 0 0.6rem 1.9rem; }
.lg .fields { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.6rem; margin-left: 1.9rem; }
.lg .fields label { display: grid; gap: 0.2rem; font-size: 0.72rem; color: var(--ink-soft); min-width: 0; }
input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--gold); flex: 0 0 auto; margin: 0.1rem 0 0; }
@media (max-width: 420px) { .lg .fields { grid-template-columns: 1fr; margin-left: 0; } .lg .sub { margin-left: 0; } }

/* ---------- League copy ---------- */
.copy-box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.copy-box pre { margin: 0; white-space: pre-wrap; font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 0.8rem; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.btn[data-copied="true"]::after { content: " \2713"; }

/* ---------- Sealed change ---------- */
.envelope { text-align: center; }
.envelope .seal { font-size: 2.6rem; line-height: 1; margin: 0.3rem 0 0.6rem; }
.envelope .big { font-family: 'Bebas Neue', Impact, sans-serif; font-weight: 800; font-size: 1.25rem; margin: 0 0 0.4rem; }
.envelope .reveal { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--chaos); margin: 0.6rem 0; overflow-wrap: anywhere; }
.facts { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.35rem; font-size: 0.86rem; color: var(--ink-soft); }
.facts li { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px dashed var(--line); padding-top: 0.35rem; }
.facts li b { color: var(--ink); font-weight: 600; text-align: right; }
.facts li > span:first-child { white-space: nowrap; }
.linkbox { display: flex; gap: 0.5rem; margin: 0.8rem 0; }
.linkbox input { flex: 1; min-width: 0; font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 13px; }
@media (max-width: 480px) { .linkbox { flex-direction: column; } }
.env-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.env-list li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 0.9rem; font-size: 0.9rem; }
.env-list .top { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; }
.pay-row .top { align-items: center; }
.pay-row .form { margin-top: 0.8rem; }
.chip.paid { color: var(--sage); border-color: var(--sage-soft); }
.chip.unpaid { color: var(--chaos); border-color: var(--chaos-soft); }
.env-list .txt { margin-top: 0.3rem; font-weight: 600; overflow-wrap: anywhere; }
/* An envelope's full log inside its list card (10/20/26). */
.env-list .env-log li { background: none; border: 0; border-top: 1px dashed var(--line); border-radius: 0; padding: 0.35rem 0 0; font-size: inherit; }
.env-log li b { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; overflow-wrap: anywhere; }
.env-log li b i { font-style: normal; font-weight: 400; font-size: 0.78rem; color: var(--ink-soft); }
.env-log li.bad > span, .env-log li.bad b { color: var(--chaos); }

footer.cab-foot { text-align: center; font-style: italic; font-size: 0.82rem; color: var(--night-ink-soft); background: var(--night-bg); padding: 1.6rem 16px 2rem; }
footer.cab-foot a { color: var(--night-gold); }
.env-list .sub { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.25rem; }
