/* Presentation is not governed. Change freely. */
:root {
  --paper: #EEF1F2;
  --sheet: #F8FAFA;
  --ink: #1C2833;
  --ink-soft: #4A5864;
  --rule: #B9C3C9;
  --seal: #2B4C7E;
  --ok: #2E6B4E;
  --alarm: #A3261D;
  --alarm-wash: #F6E3E1;
  --ok-wash: #E1EEE7;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 68ch;
  color-scheme: light dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151C22; --sheet: #1B242B; --ink: #E4E9EC; --ink-soft: #A6B2BA; --rule: #34424C;
    --seal: #8FB0E0; --ok: #7CC4A0; --alarm: #F0948A; --alarm-wash: #3A1F1C; --ok-wash: #1C3328;
  }
}
*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.6 var(--serif); font-variant-numeric: oldstyle-nums proportional-nums;
}
.masthead, main { max-width: calc(var(--measure) + 4rem); margin: 0 auto; padding: 0 2rem; }
.masthead { padding-top: 3.5rem; padding-bottom: 1rem; }
.entity-id { margin: 0; color: var(--ink-soft); font-size: .85rem; letter-spacing: .02em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; font-weight: 400; margin: .2rem 0 0; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; font-weight: 600; margin: 0 0 .8rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin: 0; }
section { padding: 2.2rem 0; border-top: 1px solid var(--rule); }
p { max-width: var(--measure); margin: 0 0 .8rem; }
code, .hash { font-family: var(--mono); font-size: .82em; overflow-wrap: anywhere; }
.hash { color: var(--ink-soft); }
a { color: var(--seal); }

/* The seal: the one statement the page exists to make. */
.seal { border-top: 0; padding-top: 1rem; }
.seal .statement { font-size: clamp(1.35rem, 3.2vw, 1.8rem); line-height: 1.35; max-width: 34ch; margin: 0 0 1rem; }
.seal .statement::before {
  content: ""; display: inline-block; width: .7em; height: .7em; margin-right: .45em; border-radius: 50%;
  background: var(--ok); vertical-align: .05em;
}
.seal.bad .statement::before { background: var(--alarm); }
.seal dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.2rem; margin: 0; font-size: .92rem; }
.seal dt { color: var(--ink-soft); }
.seal dd { margin: 0; }
.alarm { background: var(--alarm-wash); color: var(--ink); border-left: 4px solid var(--alarm); padding: 1rem 1.2rem; margin: 0 0 1.4rem; }
.alarm h2 { color: var(--alarm); margin-bottom: .4rem; }
.notice { border-top: 0; }

/* Lists of things in the record */
.items { list-style: none; margin: 0; padding: 0; }
.items > li { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.items > li:last-child { border-bottom: 0; }
.meta { color: var(--ink-soft); font-size: .9rem; margin: .15rem 0 .5rem; }
.tally { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .95rem; margin: .4rem 0; }
.bar { height: 6px; background: var(--rule); display: flex; max-width: 24rem; margin: .5rem 0; }
.bar i { display: block; height: 100%; }
.bar .f { background: var(--ok); } .bar .a { background: var(--alarm); } .bar .b { background: var(--ink-soft); opacity: .5; }
.state-carried { color: var(--ok); } .state-failed { color: var(--alarm); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.scroll { overflow-x: auto; }
th, td { text-align: left; padding: .4rem .8rem .4rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--ink-soft); }
td code { white-space: nowrap; }
td .fine { max-width: 36ch; }
caption { text-align: left; font-weight: 600; padding: 1.2rem 0 .4rem; }

/* Forms */
label, .label { display: block; font-weight: 600; margin: .8rem 0 .25rem; }
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule); border-radius: 3px; padding: .45rem .6rem; width: 100%; max-width: 32rem;
}
textarea { min-height: 5rem; font-family: var(--mono); font-size: .85rem; }
button {
  font: inherit; font-size: .95rem; cursor: pointer; border-radius: 3px; padding: .45rem .9rem;
  background: var(--seal); color: var(--sheet); border: 1px solid var(--seal);
}
button.quiet { background: transparent; color: var(--seal); }
button.danger { background: transparent; color: var(--alarm); border-color: var(--alarm); }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--seal); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row.end { justify-content: flex-end; }
.row input { flex: 1 1 14rem; }
.row p { flex: 1 1 14rem; margin: 0; font-size: .92rem; color: var(--ink-soft); }
.buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
details { margin-top: 1rem; }
summary { cursor: pointer; color: var(--seal); }
.hint { color: var(--ink-soft); font-size: .9rem; }
.fine { font-size: .88rem; color: var(--ink-soft); }

dialog { border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); max-width: 40rem; width: calc(100% - 2rem); padding: 1.6rem; }
dialog::backdrop { background: rgb(20 28 34 / .45); }
.ways { padding-left: 1.2rem; margin: 1rem 0; }
.ways li { margin-bottom: .6rem; }
#send-result { min-height: 1.6em; }
#send-result.ok { color: var(--ok); } #send-result.bad { color: var(--alarm); }

@media (max-width: 520px) {
  .masthead, main { padding: 0 1.1rem; }
  .masthead { padding-top: 2rem; }
  .seal dl { grid-template-columns: 1fr; }
  .seal dd { margin-bottom: .4rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .seal .statement { animation: settle .5s ease-out both; }
  @keyframes settle { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* Module sections */
#modules > section { padding: 2.2rem 0; border-top: 1px solid var(--rule); }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply { margin: .6rem 0 0 1rem; padding-left: .9rem; border-left: 2px solid var(--rule); }
.removed { color: var(--ink-soft); font-style: italic; }
.score { font-variant-numeric: tabular-nums; min-width: 2ch; display: inline-block; text-align: center; }
.inline-form { display: grid; gap: .3rem; max-width: 32rem; margin-top: .6rem; }

/* Tabs: one row of plain links under the seal; the current one underlined in the seal's colour. */
#tabs { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; padding: .6rem 0 .7rem; border-top: 1px solid var(--rule); position: sticky; top: env(safe-area-inset-top, 0px); background: var(--paper); z-index: 1; }
#tabs a { color: var(--ink-soft); text-decoration: none; padding: .15rem 0; border-bottom: 2px solid transparent; }
#tabs a:hover { color: var(--ink); }
#tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--seal); }
#view > section:first-child { border-top: 0; }
.seal.slim { padding: .6rem 0 .2rem; }
.seal .statement.compact { font-size: .95rem; max-width: none; margin: 0 0 .4rem; color: var(--ink-soft); }
.seal .statement.compact::before { width: .55em; height: .55em; }
.flag { color: var(--alarm); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.2rem; margin: 0 0 1rem; font-size: .93rem; }
dl.facts dt { color: var(--ink-soft); }
dl.facts dd { margin: 0; min-width: 0; }
pre.json, pre.law-text { font-family: var(--mono); font-size: .8rem; background: var(--sheet); border: 1px solid var(--rule); padding: .8rem; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.law-text { font-family: var(--serif); font-size: .95rem; }
.grant { border-left: 3px solid var(--rule); padding-left: .9rem; margin: .8rem 0; }
@media (max-width: 520px) { dl.facts { grid-template-columns: 1fr; } dl.facts dd { margin-bottom: .4rem; } }
.seal .statement.compact { animation: none; }
#view section > h3 { margin: 1.6rem 0 .5rem; }
@media (max-width: 520px) { #tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } #tabs a { white-space: nowrap; } }
.poll-row { display: flex; align-items: center; gap: .6rem; margin: .25rem 0; }
.poll-row input { width: auto; }
.poll-bar { display: inline-block; height: 6px; background: var(--seal); opacity: .6; min-width: 2px; }
.badge { display: inline-block; font-size: .8rem; border: 1px solid var(--seal); color: var(--seal); border-radius: 1em; padding: .05rem .6rem; margin: 0 .4rem .3rem 0; }
.wiki-body { max-width: var(--measure); margin: 1rem 0; }
pre.redline { font-family: var(--mono); font-size: .8rem; background: var(--sheet); border: 1px solid var(--rule); padding: .8rem; overflow-x: auto; white-space: pre-wrap; }
pre.redline ins { text-decoration: none; background: var(--ok-wash); color: var(--ok); display: block; }
pre.redline del { background: var(--alarm-wash); color: var(--alarm); display: block; }
pre.redline span { display: block; color: var(--ink-soft); }
