[hidden] { display: none !important; }
:root {
  color-scheme: light dark;
  --bg: #fbfbf8; --ink: #161616; --dim: #6b6b66; --line: #e3e2dc; --soft: #f2f1ec; --on-ink: #fbfbf8;
  --accent: #c8391a; --good: #2f7d4f; --warn: #946400; --bad: #b3261e;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #131312; --ink: #ecebe5; --dim: #98978e; --line: #2b2b28; --soft: #1b1b19; --on-ink: #131312;
    --accent: #ff7a52; --good: #6fcf97; --warn: #e0b252; --bad: #f08a84; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font: 600 24px/1.2 system-ui, sans-serif; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin: 0 0 14px; }
h3 { font-size: 15px; margin: 0 0 4px; }
a { color: inherit; text-decoration-color: var(--dim); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
code, .mono { font: 12.5px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
p { margin: 0 0 12px; }

/* layout */
.shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 100vh; }
.side { display: flex; flex-direction: column; padding: 22px 16px; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; }
.brand { font: 600 19px var(--serif); letter-spacing: -.01em; text-decoration: none; margin-bottom: 26px; display: inline-block; }
.brand b { color: var(--accent); font-weight: 600; }
.links { display: flex; flex-direction: column; gap: 2px; }
.links .divider { display: block; height: 1px; background: var(--line); margin: 10px 0; }
.links a { text-decoration: none; padding: 7px 10px; margin-left: -10px; border-left: 2px solid transparent; color: var(--dim); }
.links a:hover { color: var(--ink); }
.links a.on { color: var(--ink); font-weight: 600; border-left-color: var(--accent); }
.grow { flex: 1; }
.me { color: var(--dim); font-size: 13px; border-top: 1px solid var(--line); padding-top: 12px; }
.me span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { padding: 28px clamp(16px, 4vw, 44px) 80px; max-width: 980px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 16px; margin-bottom: 26px; flex-wrap: wrap; }
.sub { color: var(--dim); margin: 4px 0 0; }
.crumb { display: inline-block; color: var(--dim); font-size: 13px; text-decoration: none; margin-bottom: 10px; }
.crumb:hover { color: var(--ink); }

/* sections instead of cards */
.panel { border-top: 1px solid var(--line); padding: 20px 0 8px; margin-bottom: 14px; }
.panel.boxed { border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); margin-bottom: 24px; }
.tile { padding: 16px 16px 14px 0; }
.tile span { display: block; color: var(--dim); font-size: 13px; }
.tile b { display: block; font: 500 30px/1.2 var(--serif); font-variant-numeric: tabular-nums; margin-top: 2px; }
.delta { color: var(--dim); font-size: 12.5px; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--dim); font-weight: 500; font-size: 13px; padding: 6px 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; padding-left: 12px; }
td a { font-weight: 600; }

/* controls */
button, .btn { font: inherit; font-weight: 500; font-size: 14px; color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 6px; padding: 8px 14px; min-height: 38px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .btn:hover { background: var(--soft); }
button.primary { background: var(--ink); color: var(--on-ink); }
button.primary:hover { opacity: .88; }
button.danger { color: var(--bad); border-color: var(--line); }
button.small { padding: 4px 10px; min-height: 30px; font-size: 13px; border-color: var(--line); }
button:disabled { opacity: .5; cursor: default; }
.linkish { background: none; border: 0; padding: 0; min-height: 0; text-decoration: underline; text-underline-offset: 3px; display: inline; }
.linkish:hover { background: none; }
form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
form.grid .wide, .wide { grid-column: 1 / -1; }
label { display: block; font-size: 13.5px; font-weight: 500; }
label small { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 400; color: var(--dim); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; min-height: 40px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
textarea { resize: vertical; min-height: 76px; }
input[type=checkbox] { display: inline-block; width: 17px; height: 17px; min-height: 0; margin: 0 10px 0 0; accent-color: var(--ink); }
input[type=file] { padding: 8px; }
.check { display: flex; align-items: center; font-size: 15px; font-weight: 400; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; align-items: end; margin-bottom: 20px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; color: var(--dim); }
.seg button.on { background: var(--ink); color: var(--on-ink); }

.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--dim); white-space: nowrap; }
.tag.good { color: var(--good); border-color: currentColor; }
.tag.warn { color: var(--warn); border-color: currentColor; }
.tag.bad { color: var(--bad); border-color: currentColor; }
.tag.plain { border-style: dashed; }

.empty { color: var(--dim); padding: 22px 0 18px; }
.empty h3 { color: var(--ink); }
.empty .actions { margin-top: 12px; }
.note { color: var(--dim); font-size: 13.5px; margin: 0 0 12px; }
.alert { border: 1px solid var(--ink); border-left-width: 4px; border-radius: 6px; padding: 12px 14px; margin-bottom: 18px; }
.alert.info { border-color: var(--line); border-left-color: var(--accent); }
.code { position: relative; background: var(--soft); border-radius: 6px; padding: 12px 82px 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 14px; }
.code button { position: absolute; top: 8px; right: 8px; background: var(--bg); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; background: var(--ink); color: var(--on-ink); border-radius: 6px; padding: 11px 16px; max-width: min(420px, calc(100vw - 32px)); z-index: 50; }
.toast.err { background: var(--bad); color: #fff; }

.steps { list-style: none; margin: 0 0 8px; padding: 0; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps .t { flex: 1; }
.steps li.done .t { color: var(--dim); text-decoration: line-through; }
.steps .dot { width: 16px; height: 16px; border: 1.5px solid var(--dim); border-radius: 50%; flex: none; }
.steps li.done .dot { background: var(--ink); border-color: var(--ink); }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--dim); font-size: 11px; }
.chart .bar { fill: var(--ink); }
.chart .hit { fill: transparent; }
.chart .bar.on { fill: var(--accent); }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--on-ink); border-radius: 4px; padding: 5px 9px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -115%); z-index: 5; }
.tip b { display: block; }

.creative { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; border-top: 1px solid var(--line); padding: 16px 0; }
.creative:first-of-type { border-top: 0; padding-top: 0; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.editor .pv { position: sticky; top: 20px; }
.pv h3 { color: var(--dim); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.preview { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; gap: 12px; align-items: center; background: var(--bg); }
.preview.col { flex-direction: column; align-items: stretch; padding: 0 0 12px; overflow: hidden; gap: 0; }
.preview .ph { background: var(--soft); }
.preview:not(.col) .ph, .preview:not(.col) img { width: 48px; height: 48px; flex: none; object-fit: cover; border-radius: 4px; }
.preview.col .ph, .preview.col img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.preview .txt { min-width: 0; flex: 1; }
.preview.col .txt { padding: 10px 14px 0; }
.preview .txt b { display: block; font-size: 14px; }
.preview .txt span { display: block; color: var(--dim); font-size: 13px; }
.preview .btnp { background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 500; padding: 5px 11px; border-radius: 5px; white-space: nowrap; }
.preview.col .btnp { margin: 10px 14px 0; text-align: center; }
.preview .lab { font-size: 11px; color: var(--dim); padding: 6px 14px 0; }
.preview:not(.col) .lab { display: none; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .box { width: min(380px, 100%); }
.auth .brand { margin-bottom: 30px; font-size: 24px; }
.auth h1 { margin-bottom: 6px; }
.auth form { display: grid; gap: 16px; margin-top: 22px; }
.auth button.primary { width: 100%; }
.auth .switch { color: var(--dim); font-size: 14px; margin-top: 20px; }
.auth .back { display: block; margin-top: 26px; color: var(--dim); font-size: 13.5px; }

.skel { background: var(--soft); border-radius: 6px; height: 80px; margin-bottom: 12px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

.doc { max-width: 640px; margin: 0 auto; padding: 36px 20px 80px; }
.doc h1 { font: 500 34px/1.15 var(--serif); margin-bottom: 14px; }
.doc h2 { margin-top: 30px; }
.doc li { margin-bottom: 6px; }


/* motion */
.chart .bar { transform-box: fill-box; transform-origin: 50% 100%; }
.auth { position: relative; overflow: hidden; }
.auth .box { position: relative; z-index: 1; }
.auth-bg { position: absolute; inset: 0; opacity: .2; -webkit-mask-image: radial-gradient(70% 80% at 50% 45%, #000 20%, transparent 80%); mask-image: radial-gradient(70% 80% at 50% 45%, #000 20%, transparent 80%); pointer-events: none; }
.auth-bg canvas { pointer-events: none; }
button, .btn { transition: background .15s, transform .15s; }
button:active:not(:disabled) { transform: scale(.97); }
.toast { animation: toast-in .25s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@media (prefers-reduced-motion: reduce) { button, .btn, .toast { transition: none; animation: none; } }

/* legal documents */
.doc .docnav { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.doc .docnav span { display: flex; gap: 20px; font-size: 14.5px; }
.doc .docnav span a { color: var(--dim); text-decoration: none; }
.doc .docnav span a:hover, .doc .docnav span a[aria-current] { color: var(--ink); }
.doc .docnav span a[aria-current] { text-decoration: underline; text-underline-offset: 6px; }
.doc .meta { color: var(--dim); font-size: 14px; margin: -4px 0 22px; }
.doc h2 { text-transform: none; letter-spacing: 0; font: 600 17px/1.3 system-ui, sans-serif; color: var(--ink); margin: 32px 0 10px; }
.doc ul { padding-left: 20px; margin: 0 0 14px; }
.doc .docfoot { color: var(--dim); font-size: 13.5px; border-top: 1px solid var(--line); margin-top: 48px; padding-top: 18px; }

.me .legal { display: block; margin-top: 6px; font-size: 12.5px; }
.me .legal a { color: var(--dim); }
.auth form .note { margin: -4px 0 0; }
.auth form .note a { text-decoration: underline; }

/* ---- lists, folds, next step ---- */
.rows { border-top: 1px solid var(--line); margin-bottom: 8px; }
.rowlink { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--line); text-decoration: none; min-height: 60px; }
a.rowlink:hover { background: var(--soft); }
.rl-main { display: grid; gap: 2px; min-width: 0; }
.rl-main b { font-weight: 600; overflow-wrap: anywhere; }
.rl-meta { color: var(--dim); font-size: 13.5px; overflow-wrap: anywhere; }
.rl-end { flex: none; display: flex; gap: 8px; align-items: center; }
a.rowlink .rl-end::after { content: "\203A"; color: var(--dim); font-size: 22px; line-height: 1; margin-left: 2px; }
.more { margin: 14px 0 4px; font-size: 14px; }

.fold { border-top: 1px solid var(--line); margin-bottom: 14px; }
.fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 54px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "+"; font-size: 22px; font-weight: 400; line-height: 1; }
.fold[open] > summary { color: var(--ink); }
.fold[open] > summary::after { content: "\2013"; }
.fold > summary:hover { color: var(--ink); }
.foldbody { padding: 2px 0 14px; }
.fold .fold { border-top: 0; margin: 12px 0 0; }

.next { border: 1px solid var(--ink); border-radius: 10px; padding: 18px; margin-bottom: 24px; }
.next-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.next h2 { margin: 0; }
.count { color: var(--dim); font-size: 13px; }
.dots { display: flex; gap: 6px; margin: 12px 0 16px; }
.dots i { height: 4px; flex: 1; border-radius: 2px; background: var(--line); }
.dots i.on { background: var(--ink); }
.next-t { font: 500 24px/1.25 var(--serif); margin: 0 0 16px; }
.delta .long { display: inline; }

/* ---- navigation: desktop shows the sidebar, phones show a top bar + tab bar ---- */
.mtop, .tabbar { display: none; }
dialog.sheet { border: 0; padding: 0; background: var(--bg); color: var(--ink); width: 100%; max-width: 560px; margin: auto auto 0; border-radius: 16px 16px 0 0; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .45); }
.sheet-head { display: grid; gap: 2px; padding: 20px 20px 12px; }
.sheet-head span { color: var(--dim); font-size: 13.5px; overflow-wrap: anywhere; }
.sheet-list a { display: flex; align-items: center; min-height: 54px; padding: 0 20px; border-top: 1px solid var(--line); text-decoration: none; font-size: 16px; }
dialog.sheet > .actions { padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); justify-content: space-between; }

footer.legal { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13.5px; }
footer.legal a { color: var(--dim); }
footer.legal a:hover { color: var(--ink); }

@media (max-width: 800px) {
  .shell { display: block; }
  .side { display: none; }
  .mtop { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .mtop .brand { margin: 0; font-size: 21px; }
  .acct { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; font-weight: 600; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { flex: 1; min-width: 0; display: grid; place-items: center; min-height: 58px; padding: 0 2px; border: 0; border-top: 2px solid transparent; border-radius: 0; background: none; font-size: 12.5px; font-weight: 500; color: var(--dim); text-decoration: none; }
  .tabbar a.on, .tabbar button.on { color: var(--ink); font-weight: 600; border-top-color: var(--accent); }
  main { padding: 18px 16px calc(92px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  h1 { font-size: 22px; }
  .head { align-items: flex-start; margin-bottom: 20px; }
  .head .actions { width: 100%; }
  .head .actions > button, .head .actions > .btn { flex: 1; }
  .head .actions > .seg { width: 100%; }
  .seg button { flex: 1; }
  .filters .seg { width: 100%; }
  .tiles { margin-bottom: 18px; }
  .tile { padding: 12px 8px 10px 0; }
  .tile b { font-size: 22px; }
  .tile .delta .long { display: none; }
  .next { padding: 16px; }
  .next .btn { width: 100%; }
  .creative, .editor { grid-template-columns: 1fr; }
  .editor .pv { position: static; order: -1; }
  input, select, textarea { font-size: 16px; }
  .rowlink { min-height: 64px; }
  .code { padding-right: 14px; padding-bottom: 46px; }
  .code button { top: auto; bottom: 8px; }
  .auth { padding: 20px 16px; }
  form.grid { grid-template-columns: 1fr; }
  /* tables become stacked rows */
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  tr:last-child { border-bottom: 0; }
  td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  td::before { content: attr(data-label); color: var(--dim); text-align: left; flex: none; }
  td:first-child { font-weight: 600; justify-content: flex-start; text-align: left; padding-bottom: 6px; }
  td:first-child::before, td[data-label=""]::before { content: none; }
  td[data-label=""] { justify-content: flex-start; padding-top: 8px; }
  td.n { padding-left: 0; }
}

.creative.one { display: block; padding: 14px 0; }
.creative.one .note { margin: 4px 0 10px; }
.creative.one .peek { margin-top: 12px; max-width: 380px; }
