:root {
  /* The cutting mat on the home page sets the palette for the whole site. */
  --mat: #1e5b4b;
  --mark: #f2d14b;
  --ink: #14211d;
  --bg: #f5f6f2;
  --surface: #ffffff;
  --text: #14211d;
  --muted: #5c6a64;
  --line: #d9ded8;
  --accent: #1e5b4b;
  --accent-text: #ffffff;
  --danger: #a32222;
  --ok: #1e6b3c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101815;
    --surface: #18231f;
    --text: #e9eeea;
    --muted: #9aa8a1;
    --line: #2b3a34;
    --accent: #f2d14b;
    --accent-text: #14211d;
    --danger: #ef8080;
    --ok: #7fc793;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 .6rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 0 0 .3rem; }
p { margin: 0 0 .8rem; }

header, main, footer { max-width: 780px; margin: 0 auto; padding: 0 16px; }
header {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem;
  padding-top: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a.on { color: var(--text); }
nav a.on { text-decoration: underline; text-underline-offset: 5px; }
main { padding-top: 28px; padding-bottom: 48px; min-height: 60vh; }
footer {
  display: flex; flex-wrap: wrap; gap: .4rem 1.2rem;
  padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: .9rem;
}
footer a { color: var(--muted); }

.lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.spread { justify-content: space-between; }
.spread > h1 { margin-bottom: 0; }
main > .row { margin-bottom: 1rem; }
.stack > * + * { margin-top: .8rem; }

.card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; color: inherit; text-decoration: none;
}
a.card:hover { border-color: var(--accent); }
.card p:last-child { margin-bottom: 0; }
.tag {
  display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
a.tag { text-decoration: none; }
a.tag:hover { color: var(--accent); border-color: var(--accent); }
.tag.ok { color: var(--ok); border-color: currentColor; }
.tag.no { color: var(--danger); border-color: currentColor; }

table { width: 100%; border-collapse: collapse; margin: .4rem 0 1rem; }
th, td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); }
th { font-size: .85rem; font-weight: 400; color: var(--muted); }
th:not(:first-child), td:not(:first-child) { text-align: right; padding-right: 0; white-space: nowrap; }
details { margin: 1rem 0; }
summary { cursor: pointer; color: var(--accent); margin-bottom: .8rem; }
ul { margin: 0 0 .8rem; padding-left: 1.2rem; }

dl { margin: 0; }
dt { font-size: .85rem; color: var(--muted); margin-top: .9rem; }
dd { margin: 0; }

form { display: grid; gap: .9rem; max-width: 560px; }
label { display: grid; gap: .25rem; font-size: .92rem; color: var(--muted); }
label.check { display: flex; gap: .5rem; align-items: flex-start; color: var(--text); }
label.check input { margin-top: .3rem; }
input, textarea, select, button { font: inherit; color: inherit; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=datetime-local], input[type=file], textarea, select {
  width: 100%; padding: 9px 11px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
button, .btn {
  display: inline-block; padding: 8px 16px; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent);
  text-decoration: none; font-weight: 600; justify-self: start;
}
button.ghost, .btn.ghost { background: transparent; color: var(--text); border-color: var(--line); font-weight: 400; }
button.danger { background: transparent; color: var(--danger); border-color: currentColor; font-weight: 400; }
button:disabled { opacity: .55; cursor: default; }
.error { color: var(--danger); margin: 0; }
.notice { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; color: var(--muted); }

.rules h1 { margin-bottom: .3rem; }
.rules h2 { margin-top: 2.2rem; }
.rules li { margin-bottom: .3rem; }

/* ---------------------------------------------------------------- home */

body.home header {
  max-width: none; border-bottom: 0; background: var(--mat);
  padding-inline: max(20px, calc((100% - 1080px) / 2));
}
body.home header .brand { color: #fff; }
body.home nav a { color: rgba(255, 255, 255, .75); }
body.home nav a:hover { color: #fff; }
body.home main { max-width: none; padding: 0; }
body.home footer { max-width: none; padding-inline: max(20px, calc((100% - 1080px) / 2)); border-top: 0; }

.home-wrap { padding-inline: max(20px, calc((100% - 1080px) / 2)); }

/* The mat: fine grid every 20px, heavier line every 100px, like the print
   on a self-healing cutting mat. */
.home-mat {
  position: relative; overflow: hidden; color: #fff;
  background-color: var(--mat);
  background-image:
    linear-gradient(rgba(255, 255, 255, .17) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .17) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}
.home-mat :focus-visible { outline-color: var(--mark); }
.home-ruler {
  position: relative; height: 30px;
  background:
    linear-gradient(90deg, var(--mark) 1px, transparent 1px) 0 0 / 100px 13px repeat-x,
    linear-gradient(90deg, var(--mark) 1px, transparent 1px) 0 0 / 10px 6px repeat-x;
}
.home-ruler span {
  position: absolute; top: 12px; padding-left: 4px;
  font-size: .72rem; font-weight: 600; color: var(--mark);
}
/* The 45 and 60 degree guide lines every cutting mat has in one corner. */
.home-angles { position: absolute; inset: 0; pointer-events: none; }
.home-angles::before, .home-angles::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 300vmax; height: 1px;
  background: rgba(242, 209, 75, .24); transform-origin: 0 100%;
}
.home-angles::before { transform: rotate(-45deg); }
.home-angles::after { transform: rotate(-30deg); }

.home-mat-grid {
  position: relative; display: grid; gap: 40px;
  padding-top: 56px; padding-bottom: 36px;
}
@media (min-width: 900px) {
  .home-mat-grid { grid-template-columns: 7fr 5fr; align-items: center; column-gap: 56px; padding-top: 84px; }
  .home-print { grid-column: 1 / -1; }
}
.home-pitch h1 {
  margin: 0 0 1.4rem; color: #fff;
  font-size: clamp(2.5rem, 7.2vw, 5rem); line-height: .95;
  font-weight: 800; font-stretch: 78%; letter-spacing: -.02em;
}
.home-pitch p { max-width: 34em; margin-bottom: 1.6rem; font-size: 1.25rem; line-height: 1.45; color: rgba(255, 255, 255, .88); }
.home-pitch .btn { background: var(--mark); border-color: var(--mark); color: var(--ink); padding: 11px 22px; font-size: 1.05rem; }
.home-pitch .home-quiet { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; font-weight: 400; }

/* Pieces of paper lying on the mat. Cut with a knife: square corners, each a
   different size, none of them quite straight. */
.home-slips { display: grid; justify-items: start; max-width: 440px; padding-right: 6px; }
.home-slip {
  --tilt: 0deg;
  margin: 0; background: #fdfdfb; color: var(--ink);
  padding: 18px 22px 20px; border-radius: 1px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .28), 0 14px 22px -12px rgba(0, 0, 0, .55);
  transform: rotate(var(--tilt));
  animation: home-place .5s cubic-bezier(.2, .8, .3, 1) backwards;
}
.home-slip h2 { margin: 0 0 .3rem; font-size: 1.95rem; line-height: 1.05; font-weight: 800; font-stretch: 80%; }
.home-slip p { margin: 0; line-height: 1.4; }
.home-slip-a { --tilt: -1.8deg; width: 86%; animation-delay: .15s; }
.home-slip-b { --tilt: 1.3deg; width: 80%; margin: -6px 0 0 20%; animation-delay: .3s; }
.home-slip-c {
  --tilt: -2.4deg; margin: 14px 0 0 38%; padding: 10px 16px;
  background: var(--mark); font-weight: 600; animation-delay: .5s;
}
@keyframes home-place {
  from { opacity: 0; transform: translateY(-18px) rotate(calc(var(--tilt) * 3)); }
}
@media (prefers-reduced-motion: reduce) {
  .home-slip { animation: none; }
}
/* Printed on the mat itself, the way a manufacturer prints its small text. */
.home-print { margin: 12px 0 0; font-size: .9rem; font-weight: 500; color: var(--mark); }

.home-band { padding-top: 64px; }
.home-band > h2, .home-terms h2 {
  margin: 0 0 1.6rem; font-size: 1.95rem; line-height: 1.1; font-weight: 800; font-stretch: 80%;
}
.home-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: step; }
@media (min-width: 800px) {
  .home-steps { grid-template-columns: repeat(3, 1fr); gap: 40px; }
}
.home-steps li { counter-increment: step; border-top: 3px solid var(--text); padding-top: 10px; }
.home-steps li::before {
  content: counter(step); display: block; color: var(--accent);
  font-size: 3.05rem; line-height: 1; font-weight: 800; font-stretch: 78%; margin-bottom: .5rem;
}
.home-steps h3 { font-size: 1.25rem; margin: 0 0 .3rem; }
.home-steps p { margin: 0; color: var(--muted); }

.home-parts { display: grid; column-gap: 40px; margin-bottom: 72px; }
@media (min-width: 700px) {
  .home-parts { grid-template-columns: 1fr 1fr; }
}
.home-parts > div { border-top: 1px solid var(--line); padding: 14px 0 16px; }
.home-parts dt { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.home-parts dd { color: var(--muted); max-width: 30em; }

/* The uncomfortable part, in marking yellow so nobody can say they missed it. */
.home-terms { background: var(--mark); color: var(--ink); padding: 60px 0 64px; }
.home-terms :focus-visible { outline-color: var(--ink); }
.home-terms-lead { max-width: 26em; margin-bottom: 1.4rem; font-size: 1.56rem; line-height: 1.25; font-weight: 600; }
.home-terms ul { max-width: 40em; margin-bottom: 1.8rem; padding-left: 1.1rem; }
.home-terms li { margin-bottom: .45rem; }
.home-terms .btn { background: var(--ink); border-color: var(--ink); color: #fff; }
.home-terms .home-ink { background: transparent; color: var(--ink); font-weight: 400; }
/* The argument for the site, set as the sum it is. */
.home-sum { margin: 0 0 2.2rem; }
.home-sum span { display: block; font-size: 1.25rem; font-weight: 600; color: var(--muted); }
.home-sum strong {
  display: block; margin-top: .2rem; color: var(--text);
  font-size: clamp(2.2rem, 6.4vw, 4.4rem); line-height: 1; font-weight: 800; font-stretch: 78%; letter-spacing: -.015em;
}
.home-why { display: grid; gap: 28px; }
@media (min-width: 800px) {
  .home-why { grid-template-columns: 1fr 1fr; gap: 56px; }
}
.home-why h3 { font-size: 1.25rem; margin: 0 0 .5rem; }
.home-why p { max-width: 32em; }
.home-sources { margin: 1.4rem 0 0; font-size: .85rem; color: var(--muted); max-width: 60em; }
.home-sources a { color: inherit; }.home-so {
  max-width: 31em; margin: 2.2rem 0 0; padding-top: 1.4rem; border-top: 3px solid var(--text);
  font-size: 1.56rem; line-height: 1.3; font-weight: 600;
}.home-so-more { max-width: 36em; margin: 1rem 0 0; font-size: 1.1rem; }
/* ------------------------------------------------------------ rules menu */

header { position: relative; }
.menu { position: relative; margin: 0; }
.menu summary { margin: 0; list-style: none; color: var(--muted); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; display: inline-block; margin-left: 6px; vertical-align: middle;
  border: 4px solid transparent; border-top-color: currentColor; border-bottom-width: 0; }
.menu summary:hover, .menu summary.on, .menu[open] summary { color: var(--text); }
.menu summary.on { text-decoration: underline; text-underline-offset: 5px; }
.menu-list {
  position: absolute; z-index: 20; top: calc(100% + 10px); left: -10px; width: max-content; max-width: min(340px, calc(100vw - 32px));
  display: grid; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 16px 28px -16px rgba(0, 0, 0, .45);
}
nav .menu-list a { padding: 7px 10px; border-radius: 6px; color: var(--text); }
nav .menu-list a:hover { background: var(--bg); }
nav .menu-list a:first-child { color: var(--muted); }
body.home .menu summary { color: rgba(255, 255, 255, .75); }
body.home .menu summary:hover, body.home .menu[open] summary { color: #fff; }
body.home nav .menu-list a { color: var(--text); }
body.home nav .menu-list a:first-child { color: var(--muted); }
/* On a phone the menu spans the header instead of hanging off the word. */
@media (max-width: 600px) {
  .menu { position: static; }
  .menu-list { left: 16px; right: 16px; top: 100%; width: auto; max-width: none; }
}

/* A planned feature: hatched and switched off, so nobody takes it for working. */
.wip {
  margin: 2rem 0; padding: 16px 18px; border: 1px dashed var(--muted); border-radius: 10px; color: var(--muted);
  background-image: repeating-linear-gradient(135deg, transparent 0 9px, var(--line) 9px 10px);
}
.wip h2 { margin: 0 0 .4rem; font-size: 1.2rem; color: var(--muted); }
.wip p { max-width: 44em; }
input[type=search] {
  width: 100%; max-width: 560px; padding: 9px 11px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; color: var(--text);
}
main > input[type=search] { display: block; margin-bottom: 1rem; }[hidden] { display: none !important; }

/* ============================================================ inner pages
   The home page is the cutting mat. Every other page is what lies on the
   bench: paper cut with a knife (square corners, a hard shadow), under the
   same green edge and ruler. Each kind of thing has its own form: a project
   is a work ticket, people are a roster, events tear off a calendar, and the
   ledger is ruled like a ledger. */

:root { --page: 820px; }
body.home { --page: 1080px; }

header {
  max-width: none; margin: 0; background: var(--mat); border-bottom: 0;
  padding: 16px max(20px, calc((100% - var(--page)) / 2)) 24px;
}
/* The ruler from the mat, as the bottom edge of the header. */
header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9px;
  background:
    linear-gradient(90deg, var(--mark) 1px, transparent 1px) 0 100% / 100px 9px repeat-x,
    linear-gradient(90deg, var(--mark) 1px, transparent 1px) 0 100% / 10px 4px repeat-x;
}
body.home header { padding-bottom: 14px; }
body.home header::after { display: none; }
header .brand { color: #fff; font-weight: 800; font-stretch: 85%; font-size: 1.25rem; }
nav a, .menu summary { color: rgba(255, 255, 255, .78); }
nav a:hover, nav a.on, .menu summary:hover, .menu summary.on, .menu[open] summary { color: #fff; }
nav .menu-list a { color: var(--text); }
nav .menu-list a:first-child { color: var(--muted); }
header :focus-visible { outline-color: var(--mark); }

main { max-width: var(--page); padding: 36px 20px 72px; }
footer { max-width: var(--page); padding: 18px 20px 36px; }

h1 {
  margin: 0 0 1rem; font-size: clamp(2rem, 5.4vw, 2.9rem); line-height: 1;
  font-weight: 800; font-stretch: 78%; letter-spacing: -.015em;
}
h2 { margin: 2.6rem 0 .9rem; font-size: 1.56rem; line-height: 1.1; font-weight: 800; font-stretch: 80%; }
h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.spread > h1 { margin-bottom: 0; }
main > .row { margin-bottom: 1.4rem; }
.muted { max-width: 46em; }

/* Paper. */
.card {
  border: 0; border-radius: 2px; padding: 16px 18px;
  box-shadow: 0 1px 0 rgba(20, 33, 29, .16), 0 12px 18px -15px rgba(20, 33, 29, .5);
}
a.card { transition: box-shadow .15s; }
a.card:hover { box-shadow: 0 1px 0 rgba(20, 33, 29, .22), 0 16px 22px -13px rgba(20, 33, 29, .6); }
@media (prefers-color-scheme: dark) {
  .card, a.card:hover { box-shadow: none; outline: 1px solid var(--line); }
  a.card:hover { outline-color: var(--muted); }
}

/* Work tickets. The edge shows the state: open, waiting for review, quiet. */
.ticket { border-left: 6px solid var(--accent); }
.ticket-waiting { border-left-color: var(--mark); }
.ticket-quiet { border-left-color: var(--line); }
.ticket h3 { font-size: 1.45rem; line-height: 1.1; font-weight: 800; font-stretch: 80%; }
.ticket-foot { margin-top: .7rem; }

/* Stamps. */
.tag { border-radius: 2px; padding: 1px 7px; font-weight: 600; border-color: currentColor; opacity: .9; }
a.tag { opacity: 1; }

/* The roster. */
.card.person {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto; gap: 2px 22px; align-items: baseline;
  padding: 13px 0; background: none; box-shadow: none; outline: 0; border-radius: 0;
  border-bottom: 1px solid var(--line);
}
.stack > .person + .person { margin-top: 0; }
.stack > .person:first-child { border-top: 3px solid var(--text); }
.person p { margin: 0; }
a.card.person:hover { box-shadow: none; outline: 0; }
.person:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .card.person { grid-template-columns: 1fr; }
}

/* A page from a tear-off calendar. */
.event { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 16px; align-items: start; }
.event-date { padding: 8px 4px 7px; background: var(--mat); color: #fff; text-align: center; line-height: 1; border-radius: 2px; }
.event-date strong { display: block; font-size: 1.95rem; font-weight: 800; font-stretch: 78%; }
.event-date span { display: block; margin-top: 3px; font-size: .8rem; font-weight: 600; color: var(--mark); }
.event p { margin-bottom: .2rem; }

/* The ledger: a date column and ruled lines. */
.entry {
  display: grid; grid-template-columns: 7.4rem minmax(0, 1fr); gap: 2px 18px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.stack > .entry + .entry { margin-top: 0; }
.stack > .entry:first-child { border-top: 3px solid var(--text); }
.entry-date { font-variant-numeric: tabular-nums; padding-top: 2px; }
.entry p { margin: .2rem 0 .3rem; }
.entry-cancelled strong { text-decoration: line-through; color: var(--muted); }
@media (max-width: 640px) {
  .entry { grid-template-columns: 1fr; }
}

/* Tables share the ledger's rules. */
table { border-top: 3px solid var(--text); }
td { font-variant-numeric: tabular-nums; }

/* Forms and buttons: cut square, like everything else on the bench. */
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=datetime-local], input[type=file], input[type=search], textarea, select { border-radius: 3px; }
label { color: var(--text); font-weight: 600; }
label .small, label.check { font-weight: 400; }
label .small { color: var(--muted); }
button, .btn { border-radius: 3px; padding: 9px 18px; }
button.ghost, .btn.ghost { border-color: var(--muted); }

.notice {
  padding: 12px 16px; border-left: 5px solid var(--mark); border-radius: 2px; color: var(--text);
  background: color-mix(in srgb, var(--mark) 16%, transparent);
}
.notice p:last-child { margin-bottom: 0; }
.notice .row { margin-top: .7rem; }

dt { margin-top: 1.1rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
dd { max-width: 46em; }

.rules p, .rules li { max-width: 44em; line-height: 1.65; }
/* The argument behind the number is there for whoever wants it. */
.home-sum { margin-bottom: 1.2rem; }
.home-more { margin: 0 0 8px; }
.home-more summary {
  display: inline-block; margin: 0; padding: 9px 18px; list-style: none; cursor: pointer;
  border: 1px solid var(--muted); border-radius: 3px; color: var(--text); font-weight: 600;
}
.home-more summary::-webkit-details-marker { display: none; }
.home-more summary::after { content: "+"; margin-left: 10px; font-weight: 800; }
.home-more[open] summary::after { content: "\2212"; }
.home-more[open] summary { margin-bottom: 2rem; }
/* ------------------------------------------------------------------ bell */
.bell summary { display: inline-flex; align-items: center; gap: 4px; }
.bell summary::after { display: none; }
.bell-icon {
  width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--bell) center / contain no-repeat; mask: var(--bell) center / contain no-repeat;
  --bell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7v4.3l-1.8 3.2A1 1 0 0 0 4 18h16a1 1 0 0 0 .8-1.5L19 13.300V9a7 7 0 0 0-7-7Zm0 20a3 3 0 0 0 2.8-2H9.200A3 3 0 0 0 12 22Z'/%3E%3C/svg%3E");
}
.bell-count {
  min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--mark); color: var(--ink);
  font-size: .75rem; font-weight: 800; line-height: 18px; text-align: center;
}
.bell .menu-list { left: auto; right: -10px; width: min(360px, calc(100vw - 32px)); }
.bell .menu-list a { white-space: normal; line-height: 1.35; }
nav .bell .menu-list a:first-child { color: var(--text); }
nav .bell .menu-list a.bell-todo { border-left: 4px solid var(--mark); border-radius: 0 6px 6px 0; }
.bell-empty { padding: 7px 10px; color: var(--muted); }
@media (max-width: 600px) {
  .bell .menu-list { left: 16px; right: 16px; width: auto; }
}
header .brand { display: inline-flex; align-items: center; gap: 9px; }
header .brand img { display: block; border-radius: 5px; }

/* --------------------------------------------------------------- messages */
.thread { display: grid; gap: 10px; margin: 1rem 0 1.6rem; }
.bubble { max-width: min(34em, 86%); padding: 10px 14px 8px; border-radius: 2px; }
.bubble p { margin: 0 0 2px; }
.bubble span { opacity: .7; }
.bubble-theirs { justify-self: start; background: var(--surface); box-shadow: 0 1px 0 rgba(20, 33, 29, .16); }
.bubble-mine { justify-self: end; background: var(--mat); color: #fff; }
@media (prefers-color-scheme: dark) {
  .bubble-theirs { box-shadow: none; outline: 1px solid var(--line); }
}

/* The number on the left, a large button on the right that opens the reasoning. */
.home-top { display: grid; gap: 22px; align-items: center; margin-bottom: 8px; }
@media (min-width: 900px) {
  .home-top { grid-template-columns: minmax(0, 1fr) auto; column-gap: 40px; }
}
.home-top .home-sum { margin: 0; }
.home-why-btn {
  display: inline-flex; align-items: center; gap: 18px; justify-self: start;
  padding: 20px 28px; border-radius: 3px; border: 0; cursor: pointer;
  background: var(--mat); color: #fff;
  font-size: 1.56rem; line-height: 1; font-weight: 800; font-stretch: 80%;
  box-shadow: 0 1px 0 rgba(20, 33, 29, .3), 0 14px 22px -14px rgba(20, 33, 29, .6);
  transition: transform .15s, box-shadow .15s;
}
.home-why-btn:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(20, 33, 29, .3), 0 18px 26px -14px rgba(20, 33, 29, .7); }
.home-why-btn:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
/* A plus that turns into a minus. */
.home-why-icon { position: relative; width: 22px; height: 22px; flex: none; }
.home-why-icon::before, .home-why-icon::after {
  content: ""; position: absolute; left: 0; top: 9px; width: 22px; height: 4px; background: var(--mark);
  transition: transform .35s ease;
}
.home-why-icon::after { transform: rotate(90deg); }
.home-why-btn[aria-expanded="true"] .home-why-icon::after { transform: rotate(0deg); }

/* Sliding open: the row grows from nothing to the height of its content. */
.home-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s cubic-bezier(.3, .7, .2, 1); }
.home-panel.open { grid-template-rows: 1fr; }
.home-panel-in {
  min-height: 0; overflow: hidden; visibility: hidden; opacity: 0;
  transition: opacity .35s ease, visibility 0s linear .5s;
}
.home-panel.open .home-panel-in { visibility: visible; opacity: 1; transition: opacity .45s ease .1s, visibility 0s; }
.home-panel-in > :first-child { margin-top: 2.2rem; }
@media (prefers-reduced-motion: reduce) {
  .home-panel, .home-panel-in, .home-why-icon::before, .home-why-icon::after, .home-why-btn { transition: none; }
}
/* ------------------------------------------------------------ auth dialog */

/* Logged out, the two ways in sit at the right end of the header. */
nav { flex: 1; align-items: center; }
.nav-auth { margin-left: auto; display: inline-flex; align-items: center; gap: 1rem; }
nav a.nav-cta {
  padding: 5px 14px; border-radius: 3px; background: var(--mark); color: var(--ink); font-weight: 700;
}
nav a.nav-cta:hover { color: var(--ink); filter: brightness(1.06); }

/* A sheet of paper laid on the bench, with the ruler along its top edge. */
.auth {
  width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto;
  border: 0; border-radius: 2px; background: var(--surface); color: var(--text);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 30px 50px -20px rgba(0, 0, 0, .7);
}
.auth::backdrop { background: rgba(20, 33, 29, .62); backdrop-filter: blur(2px); }
.auth[open] { animation: auth-place .28s cubic-bezier(.2, .8, .3, 1); }
@keyframes auth-place {
  from { opacity: 0; transform: translateY(-14px) rotate(-1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .auth[open] { animation: none; }
}
@media (prefers-color-scheme: dark) {
  .auth { outline: 1px solid var(--line); }
}
.auth-in { position: relative; padding: 34px 28px 28px; }
.auth-in::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px;
  background:
    linear-gradient(90deg, var(--mark) 1px, transparent 1px) 0 0 / 100px 9px repeat-x,
    linear-gradient(90deg, var(--mark) 1px, transparent 1px) 0 0 / 10px 4px repeat-x,
    var(--mat);
}
.auth-close {
  position: absolute; top: 20px; right: 14px; width: 36px; height: 36px; padding: 0;
  background: none; border: 0; color: var(--muted); font-size: 1.7rem; line-height: 1; font-weight: 400;
}
.auth-close:hover { color: var(--text); }

.auth-tabs { display: flex; gap: 1.4rem; margin: 0 40px 1.4rem 0; }
.auth-tab {
  padding: 0 0 6px; background: none; border: 0; border-bottom: 4px solid transparent; border-radius: 0;
  color: var(--muted); font-size: 1.56rem; line-height: 1.1; font-weight: 800; font-stretch: 80%;
}
.auth-tab:hover { color: var(--text); }
.auth-tab[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--mark); }

.auth form { max-width: none; }
.auth form > button, .auth-google button { justify-self: stretch; width: 100%; padding: 11px 18px; }
.auth h2 { margin: 0 40px .8rem 0; }

.auth-google button {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: .7rem; font-weight: 600;
}
.auth-google button::before {
  content: ""; width: 18px; height: 18px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.850-6.850C35.9 2.380 30.470 0 24 0 14.620 0 6.510 5.380 2.560 13.220l7.980 6.190C12.430 13.720 17.740 9.500 24 9.500z'/%3E%3Cpath fill='%234285F4' d='M46.980 24.550c0-1.570-.150-3.090-.380-4.550H24v9.020h12.940c-.580 2.960-2.260 5.480-4.780 7.180l7.730 6c4.510-4.180 7.090-10.360 7.090-17.650z'/%3E%3Cpath fill='%23FBBC05' d='M10.530 28.590c-.480-1.450-.760-2.990-.760-4.590s.270-3.140.760-4.590l-7.980-6.190C.920 16.460 0 20.120 0 24c0 3.880.920 7.540 2.560 10.780l7.970-6.190z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.480 0 11.930-2.130 15.890-5.810l-7.730-6c-2.150 1.450-4.920 2.300-8.160 2.300-6.260 0-11.570-4.220-13.470-9.910l-7.980 6.190C6.510 42.620 14.620 48 24 48z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* "or with email", with a rule on either side. */
.auth-or { display: flex; align-items: center; gap: 12px; margin: 1.1rem 0; color: var(--muted); font-size: .9rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-help { margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.auth-help details { margin: 0; }
.auth-help details + details { margin-top: .4rem; }
.auth-help summary { margin-bottom: 0; }
.auth-help details[open] summary { margin-bottom: .8rem; }
.auth-help .notice { margin: .9rem 0 0; }
.auth-help form > button { width: auto; justify-self: start; padding: 9px 18px; }

/* ------------------------------------------------------- rules contents */

/* In the header the rules are a short slip: the rulebook and the legal pages. */
.menu-sheet {
  position: absolute; z-index: 20; top: calc(100% + 10px); left: -18px;
  display: grid; width: max-content; min-width: 210px; max-width: calc(100vw - 32px);
  padding: 4px 18px; background: var(--surface); border-radius: 2px;
  box-shadow: 0 1px 0 rgba(20, 33, 29, .2), 0 22px 30px -18px rgba(20, 33, 29, .65);
}
@media (prefers-color-scheme: dark) {
  .menu-sheet { outline: 1px solid var(--line); }
}
.menu[open] > .menu-sheet, .menu[open] > .menu-list { animation: menu-drop .18s cubic-bezier(.2, .8, .3, 1); }
@keyframes menu-drop {
  from { opacity: 0; transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .menu[open] > .menu-sheet, .menu[open] > .menu-list { animation: none; }
}
header nav .menu-sheet a { padding: 10px 0; color: var(--text); text-decoration: none; }
header nav .menu-sheet a + a { border-top: 1px solid var(--line); }
header nav .menu-sheet a:hover { color: var(--muted); }
header nav .menu-sheet a.here { font-weight: 700; }
@media (max-width: 600px) {
  .menu-sheet { left: 16px; right: 16px; top: 100%; width: auto; }
}

/* The rules are one long page read with the contents beside it: section
   numbers in the heavy condensed face, ruled lines, the section being read
   under the highlighter. */
body.docs { --page: 1080px; }
.rules-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; align-items: start; }
.rules-side {
  position: sticky; top: 20px; max-height: calc(100dvh - 40px); overflow: auto;
  border-top: 3px solid var(--text);
}
.rules-side a {
  display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); gap: 8px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; line-height: 1.3;
}
.rules-side-head {
  margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .85rem; font-weight: 600;
}
.rules-side b {
  justify-self: start; min-width: 1.5rem; padding: 0 4px; border-radius: 2px; text-align: center;
  color: var(--accent); font-size: 1.2rem; line-height: 1.15; font-weight: 800; font-stretch: 78%;
}
.rules-side b:empty { visibility: hidden; }
.rules-side a:hover { color: var(--accent); }
.rules-side a.here { font-weight: 700; }
.rules-side a.here b { background: var(--mark); color: var(--ink); }

/* Each section starts under a heavy rule, like a new sheet. */
.rules-text .rules[id] { margin-top: 3.2rem; padding-top: 1.1rem; border-top: 3px solid var(--text); scroll-margin-top: 16px; }
.rules-text .rules[id] > h2:first-child { margin: 0 0 1rem; font-size: clamp(1.7rem, 4.4vw, 2.3rem); line-height: 1.05; }

/* Too narrow for two columns: the contents open the page instead. */
@media (max-width: 860px) {
  .rules-layout { display: block; }
  .rules-side { position: static; max-height: none; margin-bottom: 2.4rem; }
}
