:root {
  --paper: #ffffff;
  --paper-2: #f5f5f5;
  --ink: #0a0a0a;
  --ink-2: #525252;
  --ink-3: #a3a3a3;
  --line: #e5e5e5;
  --bar-line: #d4d4d4;
  --accent: #0a0a0a;
  --on-accent: #ffffff;
  --void: #000000;
  --void-ink: #fafafa;
  --ok: #15803d;
  --danger: #b91c1c;
  --radius: 12px;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Roboto Mono", monospace;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 12px 40px rgba(0, 0, 0, 0.12);
  color-scheme: light;
}
/* Dark: follows the system unless the toggle forced light; or forced dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a0a0a; --paper-2: #171717; --ink: #fafafa; --ink-2: #a3a3a3; --ink-3: #5c5c5c;
    --line: #262626; --bar-line: rgba(255, 255, 255, 0.28); --accent: #fafafa; --on-accent: #0a0a0a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 48px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0a0a0a; --paper-2: #171717; --ink: #fafafa; --ink-2: #a3a3a3; --ink-3: #5c5c5c;
  --line: #262626; --bar-line: rgba(255, 255, 255, 0.28); --accent: #fafafa; --on-accent: #0a0a0a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 48px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- chrome ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px;
  background: var(--paper); border-bottom: 1px solid var(--bar-line);
  transition: opacity 0.4s ease;
}
.bar.quiet { opacity: 0.12; }
.bar.quiet:hover, .bar.quiet:focus-within { opacity: 1; }
.brand {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 600; letter-spacing: -0.01em; text-decoration: none; margin-right: auto;
}
.brand-word {
  font-family: "Playwrite FR Moderne", var(--serif);
  font-weight: 400; font-size: 24px; line-height: 1; letter-spacing: 0;
  /* Trim the script font's built-in spacing so the word spans the icon's height. */
  text-box: trim-both cap alphabetic;
}
/* logo: /icon.svg used as a mask, so it takes the text colour in both themes */
.brand .logo {
  flex: none; width: 26px; height: 26px; background: currentColor;
  -webkit-mask: url(/icon.svg) center / contain no-repeat;
  mask: url(/icon.svg) center / contain no-repeat;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  font-weight: 500; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--paper-2); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { opacity: 0.88; }
.btn.ember { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.ember:hover { opacity: 0.85; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--paper-2); }
.btn.block { width: 100%; height: 46px; font-size: 16px; }
.btn[disabled] { opacity: 0.5; cursor: progress; }
.icon-btn { width: 36px; padding: 0; }

/* ---------- page tabs ---------- */
.tabs {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px;
  margin: 0 8px 0 16px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: flex; align-items: center; height: 32px;
  border-radius: 999px; border: 1px solid transparent; color: var(--ink-3);
}
.tab:hover { background: var(--paper-2); color: var(--ink-2); }
.tab.active { background: var(--paper-2); border-color: var(--line); color: var(--ink); }
.tab [role="tab"] {
  display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 4px 0 12px;
  border: 0; background: none; color: inherit; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.tab .live { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.tab .x {
  width: 24px; height: 24px; margin-right: 4px; border: 0; border-radius: 50%;
  background: none; color: var(--ink-3); font-size: 16px; line-height: 1; opacity: 0;
}
.tab:hover .x, .tab.active .x, .tab .x:focus-visible { opacity: 1; }
.tab .x:hover { background: var(--line); color: var(--ink); }
.tab-add {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1px dashed var(--line); background: none; color: var(--ink-2); font-size: 18px; line-height: 1;
}
.tab-add:hover { border-style: solid; background: var(--paper-2); color: var(--ink); }

/* ---------- editor ---------- */
.editor-wrap { min-height: 100%; display: flex; justify-content: center; padding: 96px 24px 120px; }
#editor {
  width: 100%; max-width: 680px; min-height: calc(100vh - 216px); min-height: calc(100dvh - 216px);
  border: 0; outline: 0; resize: none; background: transparent;
  font: 21px/1.65 var(--serif); color: var(--ink);
  caret-color: var(--ink); position: relative;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
#editor.is-empty::before { content: attr(data-placeholder); color: var(--ink-3); font-style: italic; pointer-events: none; position: absolute; }

/* note body font (editor + viewer); pasted inline fonts still win */
#editor.font-serif, .note.font-serif { font-family: var(--serif); }
#editor.font-sans, .note.font-sans { font-family: var(--sans); font-size: 19px; }
#editor.font-mono, .note.font-mono { font-family: var(--mono); font-size: 17px; line-height: 1.7; }
.rich p { margin: 0 0 0.6em; }
.rich h1, .rich h2, .rich h3, .rich h4 { line-height: 1.25; margin: 0.8em 0 0.4em; }
.rich ul, .rich ol { margin: 0 0 0.6em; padding-left: 1.4em; }
.rich blockquote { margin: 0 0 0.6em; padding-left: 1em; border-left: 3px solid var(--line); color: var(--ink-2); }
.rich aside {
  display: block; margin: 0.4em 0 0.8em; padding: 14px 18px;
  border: 1px solid var(--bar-line); border-radius: 12px; background: var(--paper-2);
}
.rich aside > :last-child { margin-bottom: 0; }
.rich pre, .rich code, .rich kbd { font-family: var(--mono); font-size: 0.88em; }
.rich pre { margin: 0 0 0.6em; padding: 12px 14px; border-radius: 10px; background: var(--paper-2); overflow-x: auto; white-space: pre; }
.rich a { color: inherit; text-underline-offset: 3px; }
.rich table { border-collapse: collapse; margin: 0 0 0.6em; font-size: 0.85em; }
.rich td, .rich th { border: 1px solid var(--line); padding: 4px 8px; vertical-align: top; }
.rich hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.rich > :last-child { margin-bottom: 0; }

.status-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.font-pick { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 2px; background: var(--paper); }
.font-pick button { border: 0; background: none; color: var(--ink-3); font-size: 12px; padding: 3px 10px; border-radius: 99px; }
.font-pick button:hover { color: var(--ink); }
.font-pick button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.font-pick [data-font="serif"] { font-family: var(--serif); font-size: 13px; }
.font-pick [data-font="mono"] { font-family: var(--mono); }
.status {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 20px; font-size: 13px; color: var(--ink-3);
  pointer-events: none;
}
.status > * { pointer-events: auto; }
.quota-pill { border: 0; background: none; color: inherit; padding: 0; }
.quota-pill:hover { color: var(--ink); }
.quota-pill b { color: var(--ink); font-weight: 600; }

/* ---------- formatting toolbar ---------- */
.fmt-bar {
  position: fixed; left: 50%; bottom: 56px; z-index: 11; transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 6px 10px;
}
.fmt-row { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.fmt-row::-webkit-scrollbar { display: none; }
.fmt-row button {
  flex: none; width: 36px; height: 34px; border: 0; border-radius: 8px; background: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); font: 500 14px/1 var(--sans);
}
.fmt-row button:hover { background: var(--paper-2); color: var(--ink); }
.fmt-row button[aria-pressed="true"] { background: var(--paper-2); color: var(--ink); }
.fmt-row button b { font-weight: 700; }
.fmt-row sub { font-size: 9px; vertical-align: -2px; margin-left: 1px; }
.fmt-row svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fmt-row button.listening { color: var(--danger); animation: fizz 1.2s ease-in-out infinite; }
.fmt-sep { flex: none; width: 1px; height: 20px; background: var(--line); margin: 0 10px; }
.fmt-link { display: flex; gap: 6px; padding: 2px 0 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.fmt-link .field { height: 36px; }
.fmt-link .btn { height: 36px; flex: none; }
body.has-fmt .editor-wrap { padding-bottom: 180px; }
.mini-switch { margin-left: auto; flex: none; width: 28px; height: 16px; border-radius: 99px; background: var(--line); position: relative; transition: background 0.2s; }
.mini-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
[aria-checked="true"] > .mini-switch { background: var(--ink); }
[aria-checked="true"] > .mini-switch::after { transform: translateX(12px); background: var(--paper); }
@media (max-width: 520px) {
  .fmt-bar { left: 12px; right: 12px; transform: none; max-width: none; bottom: calc(58px + env(safe-area-inset-bottom)); padding: 4px 6px; }
  .fmt-row button { width: 40px; height: 40px; }
  .fmt-sep { margin: 0 4px; }
}

/* ---------- popover / menu ---------- */
.pop {
  position: fixed; top: 58px; right: 20px; z-index: 20;
  width: min(340px, calc(100vw - 32px));
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px;
  animation: rise 0.18s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(-6px); } }
.pop h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.chip {
  position: relative; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper); font-weight: 500;
}
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chip .lock, .row .lock { font-size: 10px; margin-left: 3px; color: var(--ink); }
.chip[aria-pressed="true"] .lock { color: var(--paper); }
.custom-expiry { margin: -6px 0 14px; }
.custom-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; }
.custom-row select { appearance: auto; }
.hint { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }
.hint.warn { color: var(--ink); font-weight: 500; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.row label { display: flex; align-items: center; gap: 4px; }
.row small { display: block; color: var(--ink-3); font-size: 12px; }
.switch { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background 0.2s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.switch:checked { background: var(--ink); }
.switch:checked::after { transform: translateX(16px); }
.field {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper-2); outline: none;
}
.field:focus { border-color: var(--ink-2); }
.pop .btn.block { margin-top: 12px; }
.menu { padding: 6px; width: 220px; }
.menu a, .menu button {
  display: flex; width: 100%; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; border: 0; background: none; text-align: left; text-decoration: none;
}
.menu a:hover, .menu button:hover { background: var(--paper-2); }
.menu-font { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px 6px 10px; }
.menu .font-pick button { display: inline-block; width: auto; padding: 4px 10px; border-radius: 99px; }
.menu .font-pick button:hover { background: none; }
.menu .font-pick button[aria-pressed="true"] { background: var(--ink); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu .who { padding: 8px 10px 4px; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }

/* ---------- dialog ---------- */
dialog {
  width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  border: 1px solid var(--line); border-radius: 20px; padding: 0;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(18, 14, 11, 0.45); backdrop-filter: blur(2px); }
dialog[open] { animation: rise 0.2s ease-out; }
.dlg { padding: 28px 24px 24px; position: relative; }
.dlg h2 { margin: 0 0 6px; font: 600 26px/1.2 var(--serif); letter-spacing: -0.01em; }
.dlg p { margin: 0 0 16px; color: var(--ink-2); }
.dlg .close { position: absolute; top: 12px; right: 12px; }
.dlg .stack { display: grid; gap: 10px; }
.dlg .fine { font-size: 12px; color: var(--ink-3); margin: 12px 0 0; text-align: center; }
.dlg .err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 0; }
.price { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 16px; }
.price b { font: 600 40px/1 var(--serif); }
.price span { color: var(--ink-2); }
.perks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.perks li { display: flex; gap: 10px; align-items: flex-start; }
.perks li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; margin-top: 8px; background: var(--ink); }
.linkbox { display: flex; gap: 6px; align-items: center; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.linkbox input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 500 15px var(--sans); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 18px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.tag.hot { color: var(--ink); border-color: var(--ink-3); }
.otp { letter-spacing: 0.5em; text-align: center; font: 600 24px var(--sans); height: 54px; }
.success-mark {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(47, 125, 79, 0.12); color: var(--ok); font-size: 22px;
}
.mock-sheet { border: 1px dashed var(--ink-3); border-radius: 12px; padding: 12px; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
.empty { color: var(--ink-3); text-align: center; padding: 20px 0; }

.toast {
  position: fixed; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--paper); padding: 9px 16px; border-radius: 99px; font-size: 14px;
  box-shadow: var(--shadow); animation: rise 0.2s ease-out;
}

/* ---------- viewer ---------- */
.viewer-bar { justify-content: space-between; }
.countdown {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 13px var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-2);
  padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper);
}
.countdown.soon { color: var(--ink); border-color: var(--ink); font-weight: 600; }

/* fuse: the top bar's bottom line burns down like a cracker wick */
.bar.lit { border-bottom-color: transparent; }
.nav-fuse {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--line) 0 2px, transparent 2px 6px); /* burnt ash */
}
.nav-fuse-wire { position: absolute; left: 0; top: -0.5px; height: 2px; width: 100%; background: var(--ink-2); border-radius: 2px; }
.spark {
  position: absolute; left: 0; top: 0.5px; width: 0; height: 0; pointer-events: none; z-index: 1;
}
.spark::before { /* glowing tip */
  content: ""; position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: #fff3c4;
  box-shadow: 0 0 4px 2px #ffb238, 0 0 10px 4px rgba(255, 106, 0, 0.55), 0 0 18px 6px rgba(255, 60, 0, 0.25);
  animation: sparkle 0.12s steps(2) infinite alternate;
}
.spark::after { /* flying sparks */
  content: ""; position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 0%, #ffd27a 0 1px, transparent 1.5px),
    radial-gradient(circle at 100% 40%, #ffb238 0 1px, transparent 1.5px),
    radial-gradient(circle at 85% 95%, #ffe9a8 0 0.8px, transparent 1.3px),
    radial-gradient(circle at 10% 80%, #ff9a1f 0 1px, transparent 1.5px),
    radial-gradient(circle at 0% 25%, #fff3c4 0 0.8px, transparent 1.3px);
  animation: fizz 0.35s linear infinite;
}
@keyframes sparkle { from { transform: scale(0.85); opacity: 0.85; } to { transform: scale(1.2); opacity: 1; } }
@keyframes fizz {
  0% { transform: rotate(0deg) scale(0.4); opacity: 1; }
  100% { transform: rotate(140deg) scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .spark::before, .spark::after { animation: none; } }
.countdown .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); animation: flicker 1.6s infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: 0.55; } 60% { opacity: 0.9; } }
.note {
  max-width: 680px; margin: 0 auto; padding: 104px 24px 140px;
  font: 21px/1.65 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere;
}
.viewer-foot {
  max-width: 680px; margin: -100px auto 0; padding: 0 24px 40px;
  display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-3);
}
.viewer-foot a, .viewer-foot button { color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.write-own { white-space: nowrap; }
@media (max-width: 520px) { .write-own { font-size: 13px; padding: 0 10px; } }
/* keep the footer clear of the fixed Burn now button when scrolled to the end */
.burn-fab + .viewer-foot { padding-bottom: 112px; }
/* Burn now: fixed bottom-right, always in reach while reading */
.burn-fab {
  position: fixed; right: 28px; bottom: 28px; z-index: 20;
  height: 60px; padding: 0 30px; gap: 10px; border-radius: 99px;
  font-size: 18px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.burn-fab:hover { transform: translateY(-2px); }
.burn-fab:active { transform: translateY(0) scale(0.98); }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .card { width: min(380px, 100%); text-align: center; }
.gate h1 { font: 600 28px/1.2 var(--serif); margin: 0 0 8px; }
.gate p { color: var(--ink-2); margin: 0 0 20px; }
.gate .stack { display: grid; gap: 10px; text-align: left; }
.banner {
  max-width: 680px; margin: 0 auto; position: relative; top: 88px; padding: 0 24px;
}
.banner div { padding: 10px 14px; border-radius: 12px; font-size: 14px; background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); }

/* burned placeholder */
body.burned { background: var(--void); color: var(--void-ink); }
.ash { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; animation: fadein 1.2s ease; }
@keyframes fadein { from { opacity: 0; } }
.ash h1 { font: 500 34px/1.2 var(--serif); margin: 0 0 10px; letter-spacing: -0.01em; }
.ash p { color: #8a8a8a; margin: 0 auto 28px; max-width: 340px; }
.ash .btn { background: transparent; color: var(--void-ink); border-color: #333; }
.ash .btn:hover { background: #141414; }
.ash .foot { margin-top: 40px; font-size: 12px; color: #5c5c5c; }
.ash .foot a { color: inherit; }
#burn-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 100; pointer-events: none; }
.fade-out { transition: opacity 0.8s ease; opacity: 0; }

/* ---------- legal pages ---------- */
.legal { max-width: 680px; margin: 0 auto; padding: 96px 24px 80px; }
.legal h1 { font: 600 34px/1.2 var(--serif); margin: 0 0 6px; }
.legal h2 { font: 600 20px/1.3 var(--serif); margin: 32px 0 8px; }
.legal p, .legal li { color: var(--ink-2); }
.legal .updated { color: var(--ink-3); font-size: 13px; margin-bottom: 28px; }

/* Touch screens never fire mousemove, so the faded bar would stay faded. */
@media (hover: none) {
  .bar.quiet { opacity: 1; }
}

@media (max-width: 520px) {
  /* Solid top and bottom bars so scrolled text doesn't run under the buttons. */
  .bar {
    padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  }
  .bar .brand-word { display: none; }  /* logo only, leaves room for tabs */
  .bar .btn { height: 38px; }
  .bar .icon-btn { width: 38px; }
  .tab { height: 36px; }
  .tab .x { width: 30px; height: 30px; }
  .tab-add { width: 36px; height: 36px; }
  #ed-cd { padding: 6px 10px; gap: 6px; font-size: 12px; }
  #ed-cd .dot { display: none; }

  .status {
    flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 8px 12px; padding-bottom: max(8px, env(safe-area-inset-bottom));
    background: var(--paper); border-top: 1px solid var(--line);
  }
  .status-left { flex: 1; min-width: 0; }
  #save-state { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .quota-pill { white-space: nowrap; }
  .font-pick { flex: none; }
  .font-pick button { padding: 6px 12px; font-size: 13px; }
  .toast { bottom: calc(64px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); text-align: center; }

  /* Popovers and dialogs fit the phone and scroll if tall. */
  .pop { left: 12px; right: 12px; width: auto; top: calc(62px + env(safe-area-inset-top)); max-height: calc(100dvh - 80px); overflow-y: auto; }
  .menu { left: auto; width: 240px; }
  .chip { height: 42px; }
  .row { padding: 12px 0; }
  dialog { max-height: calc(100dvh - 24px); overflow-y: auto; }
  .dlg { padding: 24px 18px 18px; }
  .dlg h2 { font-size: 23px; }
  /* 16px+ stops iOS zooming into inputs on focus */
  .field, .linkbox input, select { font-size: 16px; }

  .viewer-bar .countdown { padding: 6px 10px; font-size: 12px; }
  .tabs { margin: 0 4px 0 8px; }
  .tab .x { opacity: 1; }
  .editor-wrap { padding: 76px 16px 100px; }
  #editor, .note { font-size: 19px; }
  .note { padding: 84px 16px 140px; }
  .viewer-foot { padding: 0 16px 32px; }
  .burn-fab + .viewer-foot { padding-bottom: 96px; }
  .burn-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); height: 56px; padding: 0 24px; font-size: 17px; }
  .status { padding: 10px 12px; }
}
