/* ANHAAR Creators: one stylesheet for the owner's admin, the creator page and the join page.
   The look follows Grade (usegrade.com): stone neutrals and a deep green in the app; cream, ink and hairline
   frames on public pages; EB Garamond for titles and figures, Plus Jakarta Sans for the interface,
   Geist Mono for small status pills. The ANHAAR arch stays as the logo. */

@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/PlusJakartaSans-latin.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/PlusJakartaSans-latin-ext.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/EBGaramond-latin.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/EBGaramond-latin-ext.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* app */
  --bg: #ffffff;
  --fg: #1c1917;
  --fg-2: #44403c;
  --muted-fg: #78716c;
  --faint: #a8a29e;
  --border: #e7e5e4;
  --border-2: #d6d3d1;
  --muted: #f5f5f4;
  --sidebar: #fafaf9;
  --primary: #1d6146;
  --primary-hover: #174f39;
  --accent: #ecfdf5;
  --accent-line: #a7f3d0;
  --accent-fg: #1d6146;
  --ring: rgba(29, 97, 70, .22);
  --teal: #2d898b;
  --teal-ink: #1f6f71;
  --teal-tint: rgba(84, 192, 184, .08);
  --teal-line: rgba(45, 137, 139, .25);
  --red: #dc2626;
  --red-ink: #b91c1c;
  --red-tint: #fef2f2;
  --red-line: #fecaca;
  --amber: #d97706;
  --amber-ink: #92400e;
  --amber-tint: #fffbeb;
  --amber-line: #fde68a;
  --brand: #135027;
  /* public pages */
  --cream: #f5efe3;
  --card: #fffcf6;
  --ink: #1c1612;
  --ink-2: #2e2520;
  --ink-muted: #6b5e4d;
  --ink-soft: #8a7b66;
  --hair: rgba(28, 22, 18, .12);
  --hair-2: rgba(28, 22, 18, .22);
  --beige: #e9dfcd;
  --orange: #d55b23;
  /* type and shape */
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "EB Garamond", "Iowan Old Style", Garamond, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-sm: 6px;
  --r-md: 8px;
  --r: 10px;
  --r-lg: 12px;
  --r-xl: 14px;
  --shadow-xs: 0 1px 2px rgba(28, 25, 23, .05);
  --shadow-sm: 0 1px 3px rgba(28, 25, 23, .07), 0 1px 2px rgba(28, 25, 23, .04);
  --shadow-md: 0 10px 30px -12px rgba(28, 22, 18, .18), 0 2px 6px rgba(28, 22, 18, .05);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; }
p { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }
a { color: var(--primary); text-decoration: underline; text-decoration-color: rgba(29, 97, 70, .35); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); text-decoration-color: currentColor; }
img, svg { max-width: 100%; }
code { font-family: var(--mono); font-size: .86em; background: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
strong, .strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted-fg); }
.pre { white-space: pre-wrap; }
.break { word-break: break-all; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Jumping to a section (#terms and so on) stops below the sticky top bar. */
.admin [id], .site [id] { scroll-margin-top: 76px; }
[hidden] { display: none !important; }
.i { width: 16px; height: 16px; flex: none; display: block; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 60; background: var(--fg); color: #fff; padding: 10px 14px; border-radius: var(--r-md); font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; color: #fff; }

.arch-mark { display: block; flex: none; color: var(--brand); }
.brand-tile { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--brand); color: #f8f5ee; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.brand-tile .arch-mark { color: #f8f5ee; }
.brand-tile .arch-stitch { stroke: var(--brand); }

.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; font: 600 12.5px/1 var(--sans); letter-spacing: .02em; color: #3f3a36; background: #eeeae6; box-shadow: inset 0 0 0 1px rgba(28, 25, 23, .06); }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.tone-0 { background: #e3f1ea; color: #1d6146; }
.tone-1 { background: #e2f0f0; color: #1f6f71; }
.tone-2 { background: #f6eadf; color: #8a4b1f; }
.tone-3 { background: #ece8f5; color: #4c3f7a; }
.tone-4 { background: #f5e6e8; color: #8b2f3d; }
.tone-5 { background: #f1eee0; color: #5f5a2a; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  font: 500 14px/1 var(--sans);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--muted); color: var(--fg); text-decoration: none; }
.btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.btn:active { transform: translateY(.5px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.btn-dark:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--cream); }
.btn-quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--fg-2); }
.btn-quiet:hover { background: var(--muted); border-color: transparent; color: var(--fg); }
.btn-danger { color: var(--red-ink); border-color: var(--red-line); background: var(--bg); }
.btn-danger:hover { background: var(--red-tint); border-color: #fca5a5; color: var(--red-ink); }
.btn-small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.btn-large { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 9px; }
.btn-block { width: 100%; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--primary-hover); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: var(--r-md); border: 1px solid transparent; background: transparent; color: var(--fg-2);
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--muted); color: var(--fg); }
.icon-btn .i { width: 18px; height: 18px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .filter > label, .label { font-weight: 500; font-size: 13.5px; color: var(--fg); }
.label { display: block; color: var(--muted-fg); font-size: 13px; margin: 0 0 6px; }
.optional { font-weight: 400; color: var(--muted-fg); font-size: 12.5px; }
input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  height: 36px;
  font: 400 14px/1.4 var(--sans);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 12px;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
textarea { height: auto; resize: vertical; min-height: 88px; padding: 8px 12px; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2378716c' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--border-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
input[readonly] { background: var(--sidebar); color: var(--fg-2); }
.hint { font-size: 12.5px; color: var(--muted-fg); margin: 0; }
.hint-after { margin-top: 10px; }
.error { font-size: 12.5px; color: var(--red-ink); font-weight: 500; margin: 0; }
.field-error input, .field-error select, .field-error textarea { border-color: #f87171; }
.field-error input:focus, .field-error select:focus, .field-error textarea:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); border-color: var(--red); }
.form-error { background: var(--red-tint); border: 1px solid var(--red-line); color: var(--red-ink); border-radius: var(--r-lg); padding: 10px 14px; font-weight: 500; margin: 0 0 16px; }
.form .form-error { margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 72%, rgba(255, 255, 255, 0)); padding: 18px 0 16px; margin-top: 2px; z-index: 2; }

.affix { display: flex; align-items: stretch; min-width: 0; }
.affix input { border-radius: 0; min-width: 0; flex: 1; box-shadow: none; }
.affix-part {
  display: flex; align-items: center; padding: 0 11px;
  background: var(--sidebar); border: 1px solid var(--border); color: var(--muted-fg);
  font-size: 13.5px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis;
}
.affix > :first-child { border-top-left-radius: var(--r-md); border-bottom-left-radius: var(--r-md); }
.affix > :last-child { border-top-right-radius: var(--r-md); border-bottom-right-radius: var(--r-md); }
.affix-part:first-child { border-right: 0; }
.affix-part:last-child { border-left: 0; }

.check { display: flex; align-items: flex-start; gap: 10px; }
.check input, .radio input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.check label, .radio label { font-weight: 500; cursor: pointer; }
.check-hint { margin-top: -10px; padding-left: 26px; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
.fieldset > legend { font-weight: 500; font-size: 13.5px; padding: 0; margin-bottom: 8px; }
.radios { gap: 8px; }
.radio { display: flex; align-items: flex-start; gap: 10px; }
.grid-2, .grid-3 { display: grid; gap: 16px; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.copy { display: flex; min-width: 0; }
.copy-input { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; min-width: 0; flex: 1; font-size: 13.5px !important; text-overflow: ellipsis; box-shadow: none !important; }
.copy .copy-btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; padding: 0 14px; height: 36px; box-shadow: none; }
.copy-btn.copied { background: var(--accent); border-color: var(--accent-line); color: var(--accent-fg); }

/* ---------- status pills (Grade's mono pills), chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 22px; padding: 3px 9px 3px 8px;
  border-radius: 999px; border: 1px solid var(--border);
  font: 500 10.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; vertical-align: middle;
  background: var(--sidebar); color: var(--fg-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; background: currentColor; }
.badge-sub { letter-spacing: .04em; opacity: .8; }
.b-ready { background: var(--bg); border-color: var(--teal-line); color: var(--teal-ink); }
.b-ready::before { width: 7px; height: 7px; background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.b-paid { background: var(--teal); border-color: var(--teal); color: #fff; }
.b-paid::before { background: #fff; }
.b-pending { background: var(--bg); color: var(--muted-fg); border-color: var(--border); }
.b-pending::before { width: 7px; height: 7px; background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.b-reversed, .b-none { background: var(--muted); border-color: transparent; color: var(--muted-fg); }
.b-reversed::before, .b-none::before { background: var(--faint); }
.b-rejected, .b-clawback { background: var(--red-tint); border-color: var(--red-line); color: var(--red-ink); }
.b-test { background: transparent; border-style: dashed; border-color: var(--border-2); color: var(--muted-fg); }
.b-test::before { background: var(--faint); }
.b-flag {
  font: 500 12px/1.35 var(--sans); letter-spacing: 0; text-transform: none; white-space: normal;
  border-radius: var(--r-sm); padding: 3px 8px; color: var(--amber-ink); background: var(--amber-tint); border-color: var(--amber-line);
}
.b-flag::before { background: var(--amber); }
.code-chip {
  display: inline-block; font: 500 12px/1.2 var(--mono); letter-spacing: .06em;
  background: var(--sidebar); border: 1px solid var(--border); color: var(--fg);
  padding: 3px 7px; border-radius: var(--r-sm); vertical-align: middle;
}
.code-chip-lg { font-size: 15px; padding: 6px 10px; }
.tab-count { font: 500 11px/1 var(--mono); color: var(--muted-fg); background: rgba(28, 25, 23, .06); padding: 3px 5px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.kbd { font: 500 11px/1 var(--mono); color: var(--muted-fg); border: 1px solid var(--border); background: var(--bg); border-radius: 5px; padding: 3px 5px; }

.plat {
  display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none;
  border-radius: 6px; font: 700 10px/1 var(--sans); letter-spacing: 0;
  background: var(--muted); color: var(--fg-2);
}
.plat-tiktok, .plat-x { background: #111; color: #fff; }
.plat-instagram { background: #d62976; color: #fff; }
.plat-youtube { background: #e62117; color: #fff; }
.plat-facebook { background: #1877f2; color: #fff; }
.plat-snapchat { background: #fffc00; color: #111; }

.method {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 4px; flex: none;
  border-radius: 999px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  font-size: 12px; font-weight: 500; color: var(--fg-2); white-space: nowrap;
}
.method-mark { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 700 9.5px/1 var(--sans); color: #fff; background: var(--fg); }
.method-paypal .method-mark { background: #003087; }
.method-wise .method-mark { background: #9fe870; color: #163300; }
.method-bank .method-mark { background: var(--fg); }
.method-other .method-mark { background: var(--muted-fg); }
.method-none { color: var(--muted-fg); border-style: dashed; box-shadow: none; background: transparent; }
.method-none .method-mark { background: var(--muted); color: var(--muted-fg); }

/* ---------- flash ---------- */
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 10px 12px 14px; border-radius: var(--r-lg); margin: 0 0 20px;
  border: 1px solid var(--border); background: var(--bg); box-shadow: var(--shadow-sm);
  font-weight: 500; animation: flash-in .22s ease-out;
}
.flash p { margin: 0; flex: 1; min-width: 0; }
.flash-icon { width: 18px; height: 18px; margin-top: 1px; }
.flash-ok { border-color: var(--accent-line); background: #f3fcf7; }
.flash-ok .flash-icon { color: var(--primary); }
.flash-error { border-color: var(--red-line); background: var(--red-tint); color: var(--red-ink); }
.flash-close { background: none; border: 0; font-size: 20px; line-height: 1; color: inherit; cursor: pointer; padding: 0 4px; opacity: .55; border-radius: 4px; }
.flash-close:hover { opacity: 1; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- empty ---------- */
.empty { border: 1px dashed var(--border-2); border-radius: var(--r-xl); padding: 36px 20px; text-align: center; color: var(--muted-fg); background: var(--sidebar); }
.empty-title { font-family: var(--serif); font-weight: 500; font-size: 22px; letter-spacing: -.01em; color: var(--fg); margin-bottom: 4px; }
.empty-action { margin-top: 16px; }

/* ================= ADMIN ================= */
body.admin { background: var(--bg); }
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
/* Paint the sidebar column all the way down, also below the sticky sidebar on long pages. */
@media (min-width: 900px) {
  .shell { background: linear-gradient(90deg, var(--sidebar) 0 247px, var(--border) 247px 248px, var(--bg) 248px); }
}
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 8px 12px; background: var(--sidebar); border-right: 1px solid var(--border);
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); text-decoration: none; color: var(--fg); }
.side-brand:hover { background: var(--muted); color: var(--fg); }
.side-brand-text { display: grid; line-height: 1.25; min-width: 0; }
.side-brand-text strong { font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.side-brand-text span { font-size: 12px; color: var(--muted-fg); }
.side-nav { display: grid; gap: 12px; }
.side-group { display: grid; gap: 1px; }
.side-label { margin: 0; height: 28px; display: flex; align-items: center; padding: 0 8px; font-size: 12px; font-weight: 500; color: var(--muted-fg); }
.side-nav a {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px;
  border-radius: var(--r-sm); text-decoration: none; color: var(--fg-2); font-size: 14px; font-weight: 500;
}
.side-nav a .i { color: var(--muted-fg); }
.side-nav a:hover { background: var(--muted); color: var(--fg); }
.side-nav a:hover .i { color: var(--fg-2); }
.side-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.side-nav a[aria-current="page"] .i { color: var(--accent-fg); }
.side-text { flex: 1; min-width: 0; }
.nav-count { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; font: 500 11px/1 var(--mono); background: var(--primary); color: #fff; }
.nav-count-warn { background: var(--amber-tint); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-line); }
.side-foot { margin-top: auto; display: grid; gap: 1px; padding-top: 10px; border-top: 1px solid var(--border); }
.side-foot form { margin: 0; }
.side-foot a, .side-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px;
  border: 0; border-radius: var(--r-sm); background: none; cursor: pointer; text-align: left;
  font: 500 13.5px/1 var(--sans); color: var(--muted-fg); text-decoration: none;
}
.side-foot a:hover, .side-btn:hover { background: var(--muted); color: var(--fg); }

.main-wrap { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 28px;
  background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px);
}
.nav-toggle, .topbar-brand, .topbar-search { display: none; }
.topsearch { position: relative; flex: 0 1 400px; display: flex; align-items: center; min-width: 0; }
.topsearch-icon { position: absolute; left: 11px; color: var(--muted-fg); pointer-events: none; }
.topsearch input { padding-left: 34px; padding-right: 64px; background: var(--sidebar); box-shadow: none; }
.topsearch input:focus { background: var(--bg); border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.topsearch .kbd { position: absolute; right: 8px; pointer-events: none; }
.topsearch input:not(:placeholder-shown) ~ .kbd, .topsearch input:focus ~ .kbd { display: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 30px 32px 80px; outline: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-title-text { min-width: 0; }
.page-head h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; }
.lede { color: var(--muted-fg); margin: 6px 0 0; max-width: 64ch; overflow-wrap: anywhere; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-actions form { margin: 0; }
.crumbs { margin: 0 0 6px; font-size: 13px; }
.crumbs a { color: var(--muted-fg); text-decoration: none; }
.crumbs a::before { content: "← "; }
.crumbs a:hover { color: var(--fg); }

/* Grade's two-tone sentence: the fact in ink, the follow-up softer. */
.summary {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; letter-spacing: -.015em;
  color: var(--fg); max-width: 32em; margin: -6px 0 28px; text-wrap: balance;
}
.summary .num { font-variant-numeric: lining-nums tabular-nums; }
.summary-2 { color: var(--muted-fg); }

.panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 20px; margin: 0 0 20px; min-width: 0; box-shadow: var(--shadow-xs); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.panel-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--muted-fg); text-decoration: none; }
.panel-link:hover { color: var(--fg); text-decoration: underline; }
.panel-warn { border-color: var(--amber-line); background: #fffdf6; }
.h3 { font-size: 13px; font-weight: 600; margin: 20px 0 8px; color: var(--fg-2); }
.cols { display: grid; gap: 0 20px; }
@media (min-width: 1040px) { .cols { grid-template-columns: 1fr 1fr; } }
.detail-grid { display: grid; gap: 0 20px; }
@media (min-width: 1040px) { .detail-grid { grid-template-columns: 1.15fr 1fr; } }
.stack { display: grid; gap: 12px; margin-bottom: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: -.015em; }

/* figures: one card split in four, numbers in serif like Grade's "745k views" row */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 20px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg); box-shadow: var(--shadow-xs); overflow: hidden; }
.facts > div { padding: 16px 20px 18px; min-width: 0; }
.facts > div + div { border-left: 1px solid var(--border); }
.facts dt { font-size: 13px; color: var(--muted-fg); font-weight: 500; }
.facts dd { margin: 0; }
.facts .fact-value { font-family: var(--serif); font-weight: 500; font-size: 32px; line-height: 1.1; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.facts .fact-sub { font-size: 12px; color: var(--muted-fg); margin-top: 4px; }

/* Get started checklist */
.setup { padding: 0; overflow: hidden; }
.setup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 18px 20px 14px; }
.setup-head h2 { font-size: 15px; }
.setup-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted-fg); }
.setup-progress { display: flex; align-items: center; gap: 10px; font: 500 12px/1 var(--mono); color: var(--muted-fg); letter-spacing: .04em; }
.meter { -webkit-appearance: none; appearance: none; width: 120px; height: 6px; border: 0; border-radius: 999px; background: var(--muted); overflow: hidden; }
.meter::-webkit-progress-bar { background: var(--muted); border-radius: 999px; }
.meter::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
.meter::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.setup-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.setup-steps li { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.setup-steps li:not(.done):hover { background: var(--sidebar); }
/* The whole row is the link. */
.setup-steps a::after { content: ""; position: absolute; inset: 0; }
.setup-steps li:first-child { border-top: 0; }
.step-mark { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px dashed var(--border-2); color: var(--muted-fg); font: 500 10.5px/1 var(--mono); }
.step-mark .i { width: 12px; height: 12px; stroke-width: 3; }
.setup-steps li.done .step-mark { border: 0; background: var(--primary); color: #fff; }
.setup-steps a { flex: 1; min-width: 0; color: var(--fg); font-weight: 500; text-decoration: none; }
.setup-steps a:hover { text-decoration: underline; }
.setup-steps li.done a { color: var(--muted-fg); font-weight: 400; text-decoration: line-through; text-decoration-color: var(--faint); }
.setup-steps .chev { color: var(--faint); }
.setup-steps li.done .chev { visibility: hidden; }

.needs { margin: 0; padding: 0; list-style: none; display: grid; }
.needs li { position: relative; padding: 10px 0 10px 17px; border-top: 1px solid var(--border); }
.needs li:first-child { border-top: 0; padding-top: 2px; }
.needs li::before { content: ""; position: absolute; left: 0; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.needs li:first-child::before { top: 9px; }

.feed { margin: 0; padding: 0; list-style: none; }
.feed li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--border); }
.feed li:first-child { border-top: 0; padding-top: 2px; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); transform: translateY(-1px); }
.dot-order { background: var(--teal); }
.dot-app { background: var(--orange); }
.dot-post { background: #8b7cc8; }
.dot-pay { background: var(--primary); }
.feed-time { font-size: 12px; color: var(--muted-fg); white-space: nowrap; }

.seg, .tabs { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--muted); min-width: 0; }
.seg a, .tabs a {
  height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
  border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted-fg); text-decoration: none; white-space: nowrap;
}
.seg a:hover, .tabs a:hover { color: var(--fg); }
.seg a[aria-current="true"], .tabs a[aria-current="true"] { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm); }
.tabs a[aria-current="true"] .tab-count { background: var(--muted); }

.chart { margin: 0; }
.chart svg { display: block; width: 100%; height: 160px; }
.chart .bar { fill: var(--primary); }
.chart g:hover .bar { fill: var(--teal); }
.chart .bar-zero { fill: var(--border); }
.chart figcaption { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted-fg); margin-top: 10px; }

/* tables */
/* position: relative keeps hidden labels (.sr-only) inside the scroll area, so they can't widen the page. */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg); box-shadow: var(--shadow-xs); }
.panel .table-wrap { border: 0; border-radius: 0; box-shadow: none; margin: 0 -20px; padding: 0 20px; background: transparent; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted-fg); height: 40px; padding: 0 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--sidebar); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-wrap > .table th:first-child, .table-wrap > .table td:first-child { padding-left: 16px; }
.table-wrap > .table th:last-child, .table-wrap > .table td:last-child { padding-right: 16px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(245, 245, 244, .55); }
.table .r { text-align: right; }
.table td .sub { font-size: 12px; color: var(--muted-fg); margin-top: 1px; }
.table a { font-weight: 600; color: var(--fg); text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table td > div + div { margin-top: 4px; }
.panel .table th { background: transparent; }
.panel .table-wrap > .table th:first-child, .panel .table-wrap > .table td:first-child,
.panel .table th:first-child, .panel .table td:first-child { padding-left: 0; }
.panel .table-wrap > .table th:last-child, .panel .table-wrap > .table td:last-child,
.panel .table th:last-child, .panel .table td:last-child { padding-right: 0; }
.table-compact th { height: 34px; }
.table-compact td { padding: 8px 10px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > :last-child { min-width: 0; }
a.who:hover > :last-child { text-decoration: underline; }
a.who:hover { text-decoration: none; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.search { display: flex; gap: 8px; min-width: 0; flex: 0 1 380px; }
.search input { min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 16px; }
.filter { display: grid; gap: 6px; min-width: 160px; }
.filter-grow { flex: 1 1 200px; }
.filter-btn { min-width: 0; }
.result-line { color: var(--muted-fg); font-size: 13.5px; margin: 0 0 12px; }
.result-line .num { color: var(--fg); font-weight: 600; }
.result-line a { margin-left: 6px; font-weight: 500; }

.kv { margin: 0; display: grid; }
.kv > div { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.kv > div:first-child { border-top: 0; padding-top: 0; }
.kv dt { color: var(--muted-fg); font-size: 13px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv dd.big { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums; }
.kv-quiet { margin-top: 14px; padding-top: 4px; border-top: 1px dashed var(--border-2); }
.kv-quiet > div:first-child { padding-top: 9px; }
.kv-tight > div { padding: 6px 0; }
.dd-sub { display: block; font-size: 12px; color: var(--muted-fg); }
.explain { font-size: 15px; max-width: 62ch; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.plain-list li:first-child { border-top: 0; padding-top: 0; }
.li-date { color: var(--muted-fg); font-size: 12.5px; margin-right: 10px; white-space: nowrap; }
.li-sub { display: block; color: var(--muted-fg); font-size: 12px; }
.li-end { display: inline-flex; align-items: center; gap: 8px; }
.li-end form { margin: 0; }
.plain-bullets { margin: 0 0 12px; padding-left: 20px; }
.plain-bullets li { margin: 4px 0; }
.link-list { margin: 0; padding-left: 18px; }
.link-list li { margin: 5px 0; }

.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.row-actions form { margin: 0; }
.row-actions-end { justify-content: flex-end; margin-top: 0; flex-wrap: nowrap; }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border-2); }
.notice-inline { background: var(--amber-tint); border: 1px solid var(--amber-line); border-radius: var(--r-lg); padding: 10px 14px; color: var(--amber-ink); margin: 0 0 16px; }
.notice-inline a { color: inherit; }
.status-ok { display: block; color: var(--primary); font-weight: 600; margin-top: 6px; }
.status-warn { display: block; color: var(--amber-ink); font-weight: 600; margin-top: 6px; }

details > summary { cursor: pointer; }
.inline-form { margin-top: 14px; }
.inline-form > summary { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-2); font-weight: 500; font-size: 13.5px; list-style: none; padding: 6px 10px 6px 8px; margin-left: -8px; border-radius: var(--r-md); }
.inline-form > summary::-webkit-details-marker { display: none; }
.inline-form > summary::before { content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--border); background: var(--bg); font-weight: 600; font-size: 13px; line-height: 1; }
.inline-form[open] > summary::before { content: "−"; }
.inline-form > summary:hover { background: var(--muted); color: var(--fg); }
.inline-form > form { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.panel.inline-form { margin-top: 0; }

.code-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.code-line form { margin: 0; }
.panel .label { margin-top: 18px; }
.panel .label:first-of-type { margin-top: 0; }
.welcome { margin-top: 18px; }
.welcome > summary { font-weight: 500; color: var(--fg-2); font-size: 13.5px; }
.welcome textarea { margin: 10px 0 8px; font-size: 13.5px; min-height: 220px; background: var(--sidebar); }

.form-admin { max-width: 880px; }
.form-section { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 20px; display: grid; gap: 16px; box-shadow: var(--shadow-xs); }
.form-section h2 { font-size: 15px; }
.rate-value { max-width: 280px; }

/* ---------- payouts: Grade's payout run ---------- */
.run { border: 1px solid var(--border); border-radius: 16px; background: var(--bg); box-shadow: var(--shadow-sm); padding: 18px; margin: 0 0 28px; }
.run-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.mono-label, .run-label { margin: 0; font: 500 11px/1.2 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted-fg); }
.run-rows { display: grid; gap: 10px; }
.pay-card { border: 1px solid var(--teal-line); background: var(--teal-tint); border-radius: var(--r-lg); padding: 10px 14px 12px 10px; scroll-margin-top: 72px; min-width: 0; }
.pay-card:target { box-shadow: 0 0 0 3px rgba(45, 137, 139, .2); }
.pay-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pay-who { flex: 1; min-width: 0; }
.pay-who h3 { font-size: 15px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.pay-who h3 a { color: var(--fg); text-decoration: none; }
.pay-who h3 a:hover { text-decoration: underline; }
.pay-sub { color: var(--muted-fg); font-size: 12px; margin: 1px 0 0; }
.pay-sum { text-align: right; flex: none; }
.pay-amount { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.1; color: var(--teal); margin: 0; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.pay-amount-sub { font-size: 11px; color: var(--muted-fg); margin: 1px 0 0; white-space: nowrap; }
.pay-body { margin: 10px 0 0 48px; padding-top: 10px; border-top: 1px dashed var(--teal-line); display: grid; gap: 12px; }
.pay-to { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.pay-to .label { margin: 0; color: var(--fg-2); }
.pay-to .copy { flex: 1 1 260px; max-width: 440px; }
.pay-to .copy-input { background: #fff; }
.pay-to .notice-inline { margin: 0; flex: 1; }
.pay-to .notice-warn { flex: 1 1 100%; padding: 8px 12px; font-size: 13px; }
.dd-warn { color: var(--amber-ink); font-weight: 500; margin-top: 4px; }
.pay-items > summary { font-size: 13px; font-weight: 500; color: var(--teal-ink); width: fit-content; }
.items { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13.5px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); }
.items li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--border); }
.items li:first-child { border-top: 0; }
.items a { font-weight: 600; color: var(--fg); text-decoration: none; }
.items a:hover { text-decoration: underline; }
.items-total { display: flex; justify-content: space-between; font-weight: 600; padding: 8px 12px 0; margin: 0; font-size: 13.5px; }
.pay-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.pay-form .copy-input, .pay-form input, .pay-form select { background-color: #fff; }
.field-compact { min-width: 140px; }
.field-compact label { font-size: 12.5px; color: var(--fg-2); }
.field-grow { flex: 1 1 180px; }
.run-foot { display: flex; align-items: flex-end; gap: 14px 20px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-2); }
.run-sum { flex: 1 1 220px; min-width: 0; }
.run-meta { margin: 0 0 6px; font-size: 13px; color: var(--muted-fg); }
.run-total { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.pay-all { margin-left: auto; justify-content: flex-end; }
.pay-all .field-compact { min-width: 150px; }
.run-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted-fg); text-align: right; }
.below-list { display: grid; gap: 8px; }
.pay-below { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); }
.pay-below > summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; list-style: none; }
.pay-below > summary::-webkit-details-marker { display: none; }
.pay-below > summary .pay-who { font-weight: 500; }
.pay-below > summary .num { font-family: var(--serif); font-size: 19px; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }
.pay-below > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--muted-fg); border-bottom: 1.5px solid var(--muted-fg); transform: rotate(45deg) translateY(-2px); margin: 0 4px 0 2px; }
.pay-below[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.pay-below .pay-card { border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--sidebar); }
.pay-below .pay-card .pay-row { display: none; }
.pay-below .pay-card .pay-body { margin-left: 0; border-top: 0; padding-top: 0; }
.amount-serif { font-family: var(--serif); font-weight: 500; font-size: 16px; font-variant-numeric: lining-nums tabular-nums; }

/* applications */
.app-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 18px 20px; box-shadow: var(--shadow-xs); }
.app-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.app-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-who > div { min-width: 0; }
.app-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.app-sub { margin: 1px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.app-card .kv dd, .app-card .pre { overflow-wrap: anywhere; }
.app-when { color: var(--muted-fg); font-size: 12.5px; white-space: nowrap; margin: 0; }
.join-share { display: flex; gap: 8px; align-items: center; max-width: 560px; margin: 0 0 20px; flex-wrap: wrap; }
.join-share .copy { flex: 1 1 320px; }

.post-cell { display: inline-flex; align-items: center; gap: 8px; }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; }
.post-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--border); }
.post-list li:first-child { border-top: 0; padding-top: 0; }

/* settings: section list on the left, sections on the right */
.settings-layout { display: grid; gap: 20px; }
@media (min-width: 1040px) {
  .settings-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 32px; align-items: start; }
  .settings-layout .jump { position: sticky; top: 80px; display: grid; gap: 1px; margin: 0; }
  .settings-layout .jump a { display: flex; align-items: center; height: 32px; padding: 0 10px; border-radius: var(--r-sm); color: var(--fg-2); font-weight: 500; }
  .settings-layout .jump a:hover { background: var(--muted); color: var(--fg); text-decoration: none; }
}
.jump { display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 13.5px; }
.jump a { font-weight: 500; text-decoration: none; color: var(--fg-2); }
.jump a:hover { text-decoration: underline; }
.settings-section { scroll-margin-top: 72px; max-width: 860px; }
.settings-section .form { margin-top: 8px; }
.setup-list { margin: 0; padding-left: 22px; display: grid; gap: 12px; }
.setup-list .copy { margin-top: 8px; max-width: 520px; }
.terms-preview { background: var(--sidebar); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; }
.terms-preview .terms-list { margin: 0; }

/* search results */
.search-big { display: flex; gap: 8px; max-width: 640px; margin: 0 0 24px; }
.search-big input { height: 42px; font-size: 15px; }
.search-big .btn { height: 42px; }
.results { display: grid; gap: 16px; }
.results > .panel { margin: 0; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { border-top: 1px solid var(--border); }
.result-list li:first-child { border-top: 0; }
.result-list a { display: flex; align-items: center; gap: 12px; padding: 10px 4px; color: var(--fg); text-decoration: none; border-radius: var(--r-md); }
.result-list a:hover { background: var(--sidebar); }
.result-list .r-main { flex: 1; min-width: 0; }
.result-list .r-title { font-weight: 600; display: block; overflow-wrap: anywhere; }
.result-list .r-sub { display: block; font-size: 12.5px; color: var(--muted-fg); overflow-wrap: anywhere; }
.result-list .r-end { flex: none; display: inline-flex; align-items: center; gap: 8px; color: var(--muted-fg); }

/* error page inside the admin */
.notice-admin { max-width: 520px; margin: 48px auto; text-align: center; }
.notice-admin h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; letter-spacing: -.02em; margin-bottom: 10px; }
.notice-admin p { color: var(--muted-fg); }
.notice-code { font: 500 11px/1 var(--mono); letter-spacing: .18em; color: var(--muted-fg); margin-bottom: 14px; }

/* sign-in */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--sidebar); }
.auth-box { width: 100%; max-width: 380px; background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow-md); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-brand div { display: grid; line-height: 1.25; }
.auth-brand strong { letter-spacing: .02em; }
.auth-brand span { color: var(--muted-fg); font-size: 12.5px; }
.auth-box h1 { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-box .lede { margin: 0 0 20px; }
.auth-box .btn-block { height: 40px; }

@media (max-width: 1100px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > div:nth-child(3) { border-left: 0; }
  .facts > div:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 899px) {
  .shell { display: block; }
  .topbar { padding: 0 10px 0 8px; gap: 6px; }
  .nav-toggle, .topbar-search { display: inline-grid; }
  .topbar-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-size: 14px; letter-spacing: .02em; }
  .topbar-brand .brand-tile { width: 26px; height: 26px; border-radius: 7px; }
  .topsearch { display: none; }
  /* Off screen the menu is also hidden, so Tab never walks through links nobody can see. */
  .side {
    position: fixed; inset: 0 auto 0 0; width: min(288px, 86vw); height: 100%; z-index: 40;
    transform: translateX(-102%); visibility: hidden; box-shadow: none;
    transition: transform .2s ease-out, visibility 0s linear .2s;
  }
  body.nav-open .side { transform: none; visibility: visible; box-shadow: 0 0 0 100vmax rgba(28, 25, 23, .32); transition: transform .2s ease-out, visibility 0s; }
  .main { padding: 20px 16px 64px; }
  .page-head h1 { font-size: 28px; }
  .row-actions-end { flex-wrap: wrap; justify-content: flex-start; }
}
@media (max-width: 560px) {
  .topbar-add .btn-text { display: none; }
  .topbar-add { width: 36px; padding: 0; }
  .facts .fact-value { font-size: 26px; }
  .facts > div { padding: 14px 14px 16px; }
  .pay-row { flex-wrap: wrap; }
  .pay-who { flex-basis: calc(100% - 52px); }
  .pay-row .method { margin-left: 48px; }
  .pay-sum { margin-left: auto; }
  .pay-body { margin-left: 0; }
  .pay-form > .btn { width: 100%; }
  .field-compact { flex: 1 1 140px; }
  .run { padding: 12px; }
  .run-total { font-size: 28px; }
  .kv > div { grid-template-columns: 1fr; gap: 2px; }
  .search { flex: 1 1 100%; }
  .filter { flex: 1 1 140px; min-width: 0; }
  .app-head { flex-direction: column; gap: 6px; }
  input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], input[type="date"], input[type="number"], select, textarea { font-size: 16px; }
}

/* ================= SITE: join page and creator page (Grade's public look) ================= */
body.site { font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--cream); }
.site a { color: var(--ink); text-decoration-color: var(--hair-2); }
.site a:hover { color: var(--ink); text-decoration-color: currentColor; }
.site :focus-visible { outline-color: var(--ink); }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 56px; border-left: 1px solid var(--hair); border-right: 1px solid var(--hair); }
.site-top { position: sticky; top: 0; z-index: 20; background: rgba(245, 239, 227, .9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hair); }
.site-top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; }
.site-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 500; font-size: 21px; letter-spacing: .04em; }
.site-brand:hover { color: var(--ink); }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-main { outline: none; }
.wrap-flash { padding-top: 20px; }
.wrap-flash .flash { margin: 0; }
.sec { border-bottom: 1px solid var(--hair); }
.sec > .wrap { padding-top: 80px; padding-bottom: 80px; }
.sec-band { background-color: var(--beige); background-image: radial-gradient(rgba(28, 22, 18, .14) 1px, transparent 1.4px); background-size: 18px 18px; }
.site-foot { color: var(--ink-muted); font-size: 14px; }
.site-foot-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 72px; padding-top: 20px; padding-bottom: 20px; }
.site-foot-brand { display: inline-flex; align-items: center; gap: 8px; }
.site-foot a { color: var(--ink-muted); }

.site .btn { background: transparent; border-color: var(--hair-2); color: var(--ink); box-shadow: none; }
.site .btn:hover { background: rgba(28, 22, 18, .05); }
.site .btn-primary { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.site .btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--cream); }
.site .btn:focus-visible { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(28, 22, 18, .15); }
.site input[type="text"], .site input[type="email"], .site input[type="url"], .site select, .site textarea {
  background-color: #fffdf9; border-color: var(--hair-2); box-shadow: none; color: var(--ink);
}
.site input:hover, .site select:hover, .site textarea:hover { border-color: rgba(28, 22, 18, .34); }
.site input:focus, .site select:focus, .site textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(28, 22, 18, .1); }
.site input[readonly] { background: #fbf7ef; color: var(--ink); }
.site .affix-part { background: #f1e9da; border-color: var(--hair-2); color: var(--ink-muted); }
.site .hint, .site .optional, .site .muted { color: var(--ink-muted); }
.site .label { color: var(--ink-muted); }
.site .check input, .site .radio input { accent-color: var(--ink); }
.site .copy-btn.copied { background: #e3efe9; border-color: #b9d6c7; color: #1d6146; }
.site .empty { background: rgba(255, 252, 246, .6); border-color: var(--hair-2); color: var(--ink-muted); }
.site .empty-title { color: var(--ink); }

/* Grade's headline: the claim in ink, the follow-up softer, in the same serif sentence. */
.display { font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 5vw, 60px); line-height: 1.03; letter-spacing: -.03em; color: var(--ink); text-wrap: balance; overflow-wrap: anywhere; }
.display-muted { color: var(--ink-soft); }
.h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.06; letter-spacing: -.025em; text-wrap: balance; }
.site .lede { font-size: 18px; line-height: 1.55; color: var(--ink-muted); max-width: 34em; margin: 0; }
.pill-note { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border: 1px solid var(--hair-2); border-radius: 999px; background: rgba(255, 252, 246, .7); font-size: 13px; font-weight: 500; margin: 0 0 24px; }
.pill-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

/* join page */
.hero { display: grid; gap: 40px; align-items: stretch; }
.hero-copy { align-self: center; padding: 8px 0; }
.hero-copy .display { margin-bottom: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-art {
  position: relative; display: grid; place-items: center; padding: 48px 28px; min-height: 360px; overflow: hidden;
  background-color: var(--brand);
  background-image: radial-gradient(rgba(248, 245, 238, .16) 1px, transparent 1.4px);
  background-size: 18px 18px;
}
.hero-art::before {
  content: ""; position: absolute; left: 50%; bottom: -12%; width: 78%; aspect-ratio: 3 / 4; transform: translateX(-50%);
  border: 1.5px dashed rgba(248, 245, 238, .28); border-radius: 999px 999px 0 0;
}
@media (min-width: 960px) {
  .sec-hero > .wrap { padding-top: 0; padding-bottom: 0; }
  .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; }
  .hero-copy { padding: 88px 0; }
  .hero-art { margin-right: -56px; border-left: 1px solid var(--hair); }
}
@media (max-width: 959px) {
  .hero-art { margin: 0 -56px -80px; }
}
.kit { position: relative; width: 100%; max-width: 400px; background: var(--card); border-radius: var(--r-xl); padding: 18px; box-shadow: 0 24px 48px -18px rgba(0, 0, 0, .45), 0 0 0 1px rgba(28, 22, 18, .06); }
.kit .mono-label { color: var(--ink-muted); margin-bottom: 14px; }
.kit-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kit-rows li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--hair); border-radius: var(--r-lg); }
.kit-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: #e8f1ec; color: var(--primary); }
.kit-icon .i { width: 18px; height: 18px; }
.kit-text { min-width: 0; flex: 1; }
.kit-title { display: block; font-size: 14px; font-weight: 500; color: var(--ink); }
.kit-sub { display: block; font-size: 12px; color: var(--ink-muted); overflow-wrap: anywhere; }
.kit-value { font-family: var(--serif); font-weight: 500; font-size: 19px; color: var(--teal); white-space: nowrap; font-variant-numeric: lining-nums; }
.kit-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--hair-2); font-size: 12.5px; color: var(--ink-muted); }

.split { display: grid; gap: 32px; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 64px; align-items: start; } .split > :first-child { position: sticky; top: 96px; } }
.split .h2 { margin-bottom: 14px; }

.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair-2); }
.steps li { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 12px; padding: 20px 0 22px; border-bottom: 1px solid var(--hair-2); }
.step-num { font: 500 11.5px/1.9 var(--mono); color: var(--ink-muted); letter-spacing: .06em; }
.step-title { font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; margin: 0; }
.step-text { grid-column: 2; color: var(--ink-muted); font-size: 15px; margin: 0; }

.terms-card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-xl); padding: 8px 22px; box-shadow: var(--shadow-md); }
.terms-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 44em; }
.terms-card .terms-list { gap: 0; }
.terms-card .terms-list li { padding: 14px 0 14px 30px; border-top: 1px solid var(--hair); }
.terms-card .terms-list li:first-child { border-top: 0; }
.terms-list li { position: relative; padding-left: 24px; }
.terms-list li::before {
  content: ""; position: absolute; left: 2px; top: .5em; width: 14px; height: 14px; border-radius: 50%; background: var(--teal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 9px 9px; background-repeat: no-repeat; background-position: center;
}
.terms-card .terms-list li::before { top: 1.2em; left: 2px; }
.extra-terms { margin-top: 16px; max-width: 44em; color: var(--ink-muted); }
.terms-card .extra-terms { margin: 0; padding: 14px 0; border-top: 1px dashed var(--hair-2); font-size: 15px; }

.form-card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow-md); }
.form-site input:not([type="checkbox"]):not([type="radio"]), .form-site select { height: 44px; font-size: 16px; padding: 0 13px; }
.form-site .check input { margin-top: 4px; }
.form-site textarea { font-size: 16px; padding: 10px 13px; }
.form-site .affix-part { font-size: 15px; }
.form-site .fieldset > legend { font-size: 15px; }
.form-site .field > label { font-size: 14px; }
.form-site .btn-large { min-width: 220px; }
.form-closed { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-xl); padding: 22px; color: var(--ink-muted); }

.notice { max-width: 560px; margin: 0 auto; text-align: center; padding: 24px 0; }
.notice h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 5vw, 48px); line-height: 1.05; letter-spacing: -.025em; margin-bottom: 14px; }
.notice p { color: var(--ink-muted); }
.notice .btn { margin-top: 10px; }
.notice .brand-tile { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 22px; }
.notice .brand-tile .arch-mark { width: 26px; height: 33px; }

/* creator page */
.portal-col { max-width: 760px; margin: 0 auto; }
.sec-portal > .wrap { padding-top: 56px; padding-bottom: 64px; }
.portal-hello { margin-bottom: 28px; }
.portal-hello .display { font-size: clamp(34px, 6vw, 50px); }
.card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-xl); padding: 20px 22px; margin: 0 0 20px; box-shadow: 0 1px 2px rgba(28, 22, 18, .04); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: -.015em; line-height: 1.15; }
.card-head .mono-label { color: var(--ink-muted); }
.card > .muted:first-child { margin-top: 0; }
.count-quiet { font: 500 12px/1 var(--mono); color: var(--ink-muted); margin-left: 6px; letter-spacing: .04em; vertical-align: middle; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; background: #fff; border: 1px solid var(--hair); border-radius: var(--r-lg); }
.checklist .step-mark { border-color: rgba(28, 22, 18, .25); }
.checklist li.done .step-mark { border: 0; background: var(--teal); color: #fff; }
.checklist .cl-text { flex: 1; min-width: 0; }
.checklist .cl-title { display: block; font-weight: 500; font-size: 15px; }
.checklist .cl-sub { display: block; font-size: 12.5px; color: var(--ink-muted); }
.checklist li.done .cl-title { color: var(--ink-muted); }
.checklist a.btn { flex: none; }

.share-card { background: #fff; }
.share-card .label { margin: 16px 0 6px; }
.share-card .label:first-of-type { margin-top: 0; }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-radius: var(--r-lg); background: #fbf7ef; border: 1px solid var(--hair-2); }
.code-text { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: .06em; line-height: 1.1; overflow-wrap: anywhere; font-variant-numeric: lining-nums; }
.share-notes { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px dashed var(--hair-2); display: grid; gap: 6px; font-size: 14px; color: var(--ink-muted); }
.share-notes li { display: flex; align-items: baseline; gap: 8px; }
.share-notes li::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--teal); transform: translateY(-2px); }
.share-pending { margin: 0; padding: 12px 14px; border-radius: var(--r-lg); background: #fbf7ef; border: 1px dashed var(--hair-2); color: var(--ink-muted); }

.earn-sentence { font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 16px; }
.earn-sentence strong { font-weight: 500; color: var(--teal); }
.earn-grid { display: grid; gap: 0; margin: 0; border: 1px solid var(--hair); border-radius: var(--r-lg); background: #fff; overflow: hidden; }
@media (min-width: 600px) { .earn-grid { grid-template-columns: 1.2fr 1fr 1fr; } .earn-cell + .earn-cell { border-left: 1px solid var(--hair); } }
@media (max-width: 599px) { .earn-cell + .earn-cell { border-top: 1px solid var(--hair); } }
.earn-cell { padding: 14px 16px 16px; min-width: 0; }
.earn-cell dt { font-size: 13px; color: var(--ink-muted); font-weight: 500; }
.earn-cell dd { margin: 6px 0 0; font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.1; letter-spacing: -.015em; font-variant-numeric: lining-nums tabular-nums; }
.earn-ready dd { color: var(--teal); font-size: 32px; }
.earn-note { font-size: 12.5px; color: var(--ink-muted); margin: 4px 0 0; }
.earn .hint { margin-top: 12px; font-size: 14px; }

/* rows: Grade's tracked-result rows (icon, title and detail, amount, status) */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; background: #fff; border: 1px solid var(--hair); border-radius: var(--r-lg); min-width: 0; }
.row-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: #eef3ef; color: var(--primary); }
.row-icon .i { width: 18px; height: 18px; }
.row-icon-pay { background: #e6f2f2; color: var(--teal-ink); }
.row-icon-adj { background: #f6ecdf; color: #8a4b1f; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.row-sub { display: block; font-size: 12.5px; color: var(--ink-muted); }
.row-end { display: flex; align-items: center; gap: 10px; flex: none; }
.row-amount { font-family: var(--serif); font-weight: 500; font-size: 20px; color: var(--teal); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.row-amount.neg { color: var(--red-ink); }
.row-amount.zero { color: var(--ink-soft); }
@media (max-width: 560px) {
  .rows li { flex-wrap: wrap; }
  .row-main { flex-basis: calc(100% - 50px); }
  .row-end { width: 100%; justify-content: space-between; padding-left: 50px; }
  .code-text { font-size: 24px; }
}
.form-inline { margin-top: 14px; }
.card .post-list { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--hair-2); }
.site .post-list li { border-top-color: var(--hair); }
.private-note { text-align: center; color: var(--ink-muted); font-size: 14px; margin: 28px auto 0; max-width: 32em; }
.site .table-wrap { background: #fff; border-color: var(--hair); }

@media (max-width: 760px) {
  .wrap { padding: 0 20px; border-left: 0; border-right: 0; }
  .sec > .wrap { padding-top: 48px; padding-bottom: 52px; }
  .sec-portal > .wrap { padding-top: 32px; }
  .hero-art { margin: 0 -20px -52px; padding: 36px 18px; min-height: 0; }
  .form-card { padding: 20px 16px; }
  .card { padding: 16px; }
  .terms-card { padding: 4px 16px; }
  .site-top-in { min-height: 54px; }
  .site-nav .btn { height: 34px; padding: 0 12px; font-size: 13.5px; }
}

/* Wide tables become one small card per row on phones: the title cell first, then "label  value" lines. */
@media (max-width: 640px) {
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-stack, .table-stack tbody { display: block; width: 100%; }
  .table-stack tr { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .panel .table-stack tr { padding: 12px 0; }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { display: block; position: relative; border: 0; padding: 3px 0 3px 44% !important; text-align: right; min-height: 26px; overflow-wrap: anywhere; }
  .table-stack td::before { content: attr(data-label); position: absolute; left: 0; top: 3px; width: 42%; color: var(--muted-fg); font-size: 13px; text-align: left; }
  .table-stack td:not([data-label]) { padding-left: 0 !important; }
  .table-stack td.cell-title { order: -1; text-align: left; padding-bottom: 6px !important; }
  .table-stack td.cell-title a { font-size: 15px; }
  .table-stack td .who { justify-content: flex-end; }
  .table-stack td.cell-title .who { justify-content: flex-start; }
  .table-stack td > div + div { margin-top: 4px; }
  .table-stack .row-actions-end { justify-content: flex-end; }
  .table-stack tbody tr:hover td { background: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .side, .topbar, .page-actions, .row-actions, .inline-form, .flash, form, .site-top { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .panel, .table-wrap, .card { border-color: #ccc; box-shadow: none; }
}
