:root {
  /* split-flap geometry (px, scaled as a whole) */
  --cols: 22;
  --rows: 6;
  --cw: 42px;
  --ch: 58px;
  --gap: 4px;
  --pad: 26px;
  --step: 33ms; /* half-flip duration */

  /* motion system */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);        /* refined expo-out */
  --ease-spring: cubic-bezier(0.34, 1.42, 0.5, 1); /* gentle overshoot */
  --t-fast: 120ms;
  --t: 200ms;
  --t-slow: 400ms;
}

/* ---------- Light theme (default): bone bg, black board ---------- */
:root,
:root[data-theme="light"] {
  --bg: #e8e8e6;
  --ink: #1a1a1a;
  --muted: #8a8a86;
  --line: rgba(0, 0, 0, 0.18);
  --line-soft: rgba(0, 0, 0, 0.05);
  --icon-bg: #f7f7f7;
  --icon-bg-hover: #eeeeec;

  --cell-bg: #0d0d0e;
  --cell-bg-2: #161618;
  --letter: #f5f5f2;
  --seam: #000;
  --board-grad-1: #141416;
  --board-grad-2: #0a0a0b;
  --flap-top-shade: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.25));
  --flap-bottom-shade: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
  --board-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 40px 80px -30px rgba(0, 0, 0, 0.55), 0 8px 24px -12px rgba(0, 0, 0, 0.4);

  --surface: #fff;
  --surface-line: rgba(0, 0, 0, 0.14);
  --overlay-bg: rgba(20, 20, 19, 0.32);
  --btn-bg: #1a1a1a;
  --btn-fg: #fff;

  /* layered elevation + focus */
  --shadow-btn: 0 1px 2px rgba(20, 20, 19, 0.05), 0 3px 8px -4px rgba(20, 20, 19, 0.14);
  --shadow-btn-hover: 0 2px 4px rgba(20, 20, 19, 0.08), 0 12px 26px -8px rgba(20, 20, 19, 0.26);
  --shadow-pay: 0 1px 2px rgba(20, 20, 19, 0.16), 0 8px 20px -8px rgba(20, 20, 19, 0.4);
  --shadow-pay-hover: 0 2px 4px rgba(20, 20, 19, 0.2), 0 16px 34px -10px rgba(20, 20, 19, 0.5);
  --shadow-sheet: 0 2px 6px rgba(20, 20, 19, 0.06), 0 26px 50px -18px rgba(20, 20, 19, 0.26), 0 60px 120px -50px rgba(20, 20, 19, 0.42);
  --focus-ring: rgba(26, 26, 26, 0.55);
}

/* ---------- Dark theme: dark bg, WHITE board ---------- */
:root[data-theme="dark"] {
  --bg: #141415;
  --ink: #ededea;
  --muted: #76766f;
  --line: rgba(255, 255, 255, 0.2);
  --line-soft: rgba(255, 255, 255, 0.07);
  --icon-bg: #1d1d1f;
  --icon-bg-hover: #27272a;

  --cell-bg: #f2f2ee;
  --cell-bg-2: #ffffff;
  --letter: #18181a;
  /* solid light tone: one uniform color the whole width of the seam, so the
     cut reads continuously across both the cell and the dark letters */
  --seam: #e3e3db;
  --board-grad-1: #fbfbf8;
  --board-grad-2: #e2e2dc;
  --flap-top-shade: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.1));
  --flap-bottom-shade: linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0));
  --board-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 40px 80px -30px rgba(0, 0, 0, 0.7), 0 8px 24px -12px rgba(0, 0, 0, 0.55);

  --surface: #202022;
  --surface-line: rgba(255, 255, 255, 0.14);
  --overlay-bg: rgba(0, 0, 0, 0.55);
  --btn-bg: #ededea;
  --btn-fg: #161617;

  /* layered elevation + focus */
  --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.4), 0 3px 8px -4px rgba(0, 0, 0, 0.5);
  --shadow-btn-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 12px 26px -8px rgba(0, 0, 0, 0.62);
  --shadow-pay: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 20px -8px rgba(0, 0, 0, 0.6);
  --shadow-pay-hover: 0 2px 4px rgba(0, 0, 0, 0.55), 0 16px 34px -10px rgba(0, 0, 0, 0.7);
  --shadow-sheet: 0 2px 6px rgba(0, 0, 0, 0.5), 0 26px 50px -18px rgba(0, 0, 0, 0.62), 0 60px 120px -50px rgba(0, 0, 0, 0.8);
  --focus-ring: rgba(237, 237, 234, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
button, a, input, textarea, label { -webkit-tap-highlight-color: transparent; }

/* consistent, visible keyboard focus (outline follows the radius, doesn't fight shadows) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

/* ---------- Header / footer bars ---------- */
.bar {
  flex: 0 0 auto;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  letter-spacing: 0.02em;
  z-index: 5;
}

.brand {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  letter-spacing: 0.32em;
  font-size: 15px;
  color: inherit;
  text-decoration: none;
}

.bar__meta { color: var(--muted); }

.about-link {
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.18s ease;
}
.about-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a.about-link { text-decoration: none; }
a.about-link:hover { text-decoration: underline; }
.about-link[hidden] { display: none; }
.foot-links { display: flex; align-items: center; gap: 18px; }
/* footer: links centred on the page, the action (when there is one) at the right edge */
.bar--foot { display: grid; grid-template-columns: 1fr auto 1fr; }
.bar--foot .foot-links { grid-column: 2; }
.bar--foot .foot-actions { grid-column: 3; justify-self: end; }

/* manifesto dialog — editorial spec sheet */
.manifesto .lead {
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 14px;
}
.manifesto p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 16px;
}
.manifesto ul {
  list-style: none;
  margin: 18px 0;
  padding: 18px 0;
  border-top: 1px solid var(--surface-line);
  border-bottom: 1px solid var(--surface-line);
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.manifesto li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}
.m-key {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-align: center;
  padding: 5px 0;
  border: 1px solid var(--surface-line);
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
}
.manifesto .sign {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}
.manifesto .note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--surface-line);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}
.manifesto .note a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.note-sign { color: var(--ink); font-weight: 500; }
.about .pay { margin-top: 20px; }

.bar__right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- icon tiles: the header buttons are split-flap cells (see tile.js) ---------- */
.tile {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: var(--cell-bg);
  color: var(--letter);
  perspective: 200px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.tile:hover { transform: translateY(-1px); box-shadow: var(--shadow-btn-hover); }
.tile:active { transform: translateY(0) scale(0.94); box-shadow: var(--shadow-btn); }
.tile > svg { display: none; } /* the icon set, until tile.js builds the halves */
/* the seam in the middle */
.tile::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1.5px;
  transform: translateY(-50%);
  background: var(--seam);
  z-index: 6;
  pointer-events: none;
}
.tile__half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  background: linear-gradient(180deg, var(--cell-bg-2), var(--cell-bg));
  backface-visibility: hidden;
}
.tile__half--top { top: 0; border-radius: 5px 5px 0 0; }
.tile__half--bottom { bottom: 0; border-radius: 0 0 5px 5px; }
/* each half shows its half of the full-height icon */
.tile__face {
  position: absolute;
  left: 0;
  width: 100%;
  height: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile__half--top .tile__face { top: 0; }
.tile__half--bottom .tile__face { bottom: 0; }
.tile__face svg { display: block; width: 19px; height: 19px; }
.tile__flap { z-index: 5; visibility: hidden; }
.tile__flap.tile__half--top { transform-origin: 50% 100%; }
.tile__flap.tile__half--bottom { transform-origin: 50% 0%; }
.tile__flap::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.tile__flap.tile__half--top::before { background: var(--flap-top-shade); }
.tile__flap.tile__half--bottom::before { background: var(--flap-bottom-shade); }

.cta {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--icon-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease), color var(--t-slow) ease,
    opacity 0.6s ease;
}
.cta:hover { background: var(--icon-bg-hover); border-color: var(--ink); box-shadow: var(--shadow-btn-hover); transform: translateY(-1px); }
.cta:active { transform: translateY(0) scale(0.98); box-shadow: var(--shadow-btn); transition-duration: var(--t-fast); }
.foot-actions { display: flex; align-items: center; gap: 10px; }
.foot-actions[hidden] { display: none; }
a.cta { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
/* home: the main action lives right under the board, with a quieter one beside it */
.home-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 4px; }
.home-actions[hidden] { display: none; }
.home-actions .cta { padding: 11px 22px; font-size: 14px; }
.cta--primary { background: var(--btn-bg); color: var(--btn-fg); border-color: transparent; font-weight: 500; box-shadow: var(--shadow-pay); }
.cta--primary:hover { background: var(--btn-bg); border-color: transparent; box-shadow: var(--shadow-pay-hover); }
.cta--ghost { background: transparent; box-shadow: none; color: var(--muted); border-color: transparent; }
.cta--ghost:hover { background: transparent; box-shadow: none; color: var(--ink); border-color: var(--line); }
/* held back while a received board is still unrevealed (keeps its space: no layout jump) */
.cta.is-waiting { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- Stage / board ---------- */
.stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

/* the board scales as a whole (same 22×6 proportion at any size); what sits
   around it — pill, reveal button — stays at its natural, readable size */
.scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 100%;
}
.board-box { position: relative; flex: 0 0 auto; } /* sized by fit() to the scaled board */
.stack {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

/* ---------- reveal gate (over a received board) ---------- */
.reveal {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  cursor: pointer;
  transition: opacity var(--t-slow) var(--ease);
}
.reveal[hidden] { display: none; }
.reveal.is-leaving { opacity: 0; pointer-events: none; }
/* colours are the board's own, inverted — readable on the black and the white board */
.reveal__from {
  max-width: 100%;
  font-family: "Oswald", sans-serif;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--letter);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reveal__btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: none;
  border-radius: 999px;
  padding: 12px 22px 12px 18px;
  background: var(--letter);
  color: var(--cell-bg);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.55);
  animation: beckon 2.6s ease-in-out infinite;
  transition: transform var(--t-fast) var(--ease);
}
.reveal:active .reveal__btn { transform: scale(0.96); animation: none; }
.reveal__hint { font-size: 11px; color: var(--letter); opacity: 0.55; }
.reveal__hint[hidden] { display: none; }
@keyframes beckon { 50% { transform: scale(1.045); } }

.board {
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cw));
  grid-auto-rows: var(--ch);
  gap: var(--gap);
  padding: var(--pad);
  background:
    radial-gradient(120% 140% at 50% 0%, var(--board-grad-1) 0%, var(--board-grad-2) 70%);
  border-radius: 16px;
  box-shadow: var(--board-shadow);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

/* ---------- author pill ---------- */
:root {
  --pill-bg: #ffffff;
  --pill-border: #e2e2df;
  --pill-border-hover: #cfcfca;
  --pill-name: #1a1a1a;
  --pill-sep: #c4c4c0;
  --pill-link: #8a8a86;
  --pill-link-hover: #5a5a56;
}
:root[data-theme="dark"] {
  --pill-bg: #1c1c1e;
  --pill-border: #34343a;
  --pill-border-hover: #46464d;
  --pill-name: #f2f2ee;
  --pill-sep: #4a4a50;
  --pill-link: #8f8f8a;
  --pill-link-hover: #b8b8b2;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 4px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background var(--t-slow) ease, border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
  max-width: 100%;
}
.pill[hidden] { display: none; }
.pill:hover {
  border-color: var(--pill-border-hover);
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}
.pill:active { transform: translateY(0); transition-duration: var(--t-fast); }
.pill__avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: #111114;
}
.pill__name {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--pill-name);
  white-space: nowrap;
}
.pill__sep { color: var(--pill-sep); font-size: 11px; }
.pill__link {
  font-size: 11.5px;
  color: var(--pill-link);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill:hover .pill__link { color: var(--pill-link-hover); }

/* ---------- Split-flap cell ---------- */
.cell {
  position: relative;
  width: var(--cw);
  height: var(--ch);
  perspective: 280px;
  border-radius: 5px;
  background: var(--cell-bg);
}

/* the seam in the middle */
.cell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-1px);
  background: var(--seam);
  z-index: 6;
  pointer-events: none;
}

.half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  background: linear-gradient(180deg, var(--cell-bg-2), var(--cell-bg));
  backface-visibility: hidden;
}

.half.top { top: 0; border-radius: 5px 5px 0 0; }
.half.bottom { bottom: 0; border-radius: 0 0 5px 5px; }

/* the glyph fills the whole cell height inside each half */
.glyph {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--ch);
  line-height: var(--ch);
  text-align: center;
  font-family: "Oswald", sans-serif;
  font-weight: 400;
  font-size: 40px;
  color: var(--letter);
  user-select: none;
}
.half.top .glyph { top: 0; }
.half.bottom .glyph { top: calc(var(--ch) / -2); }

/* moving flaps */
.flap {
  z-index: 5;
  visibility: hidden;
}
.flap.top { transform-origin: 50% 100%; }
.flap.bottom { transform-origin: 50% 0%; }

/* light/shadow overlay on the flaps for depth */
.flap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.flap.top::before { background: var(--flap-top-shade); }
.flap.bottom::before { background: var(--flap-bottom-shade); }

/* ---------- Overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fade var(--t) var(--ease);
}
.overlay[hidden] { display: none; }

.sheet {
  width: min(452px, 92vw);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--surface-line);
  border-radius: 20px;
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-sheet);
  animation: rise var(--t-slow) var(--ease);
}

/* dialog header */
.dlg__head {
  position: relative;
  margin-bottom: 20px;
}
.dlg__title {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0;
}
.dlg__x {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--surface-line);
  border-radius: 50%;
  background: none;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease),
    background var(--t) var(--ease), transform var(--t) var(--ease);
}
.dlg__x:hover { color: var(--ink); border-color: var(--ink); background: var(--line-soft); transform: rotate(90deg); }
.dlg__x:active { transform: rotate(90deg) scale(0.9); transition-duration: var(--t-fast); }
.msg {
  width: 100%;
  resize: none;
  background: transparent;
  border: 1px solid var(--surface-line);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: "Oswald", sans-serif;
  font-size: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  outline: none;
}
.msg { transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.msg:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--line-soft); }
/* live mini-board preview inside the compose sheet */
.preview {
  display: grid;
  grid-template-columns: repeat(22, 1fr);
  gap: 1.5px;
  margin-top: 12px;
  padding: 8px;
  background: #0c0c0d;
  border-radius: 8px;
}
.pcell {
  aspect-ratio: 0.72;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1c;
  border-radius: 2px;
  font-family: "Oswald", sans-serif;
  font-size: 9px;
  line-height: 1;
  color: #f5f5f2;
}
.overflow {
  font-size: 11.5px;
  color: #c2562f;
  margin: 8px 2px 0;
}
.hint {
  font-size: 11px;
  color: var(--muted);
  margin: 9px 2px 0;
}
.hint b { color: var(--ink); font-weight: 600; }

/* field labels */
.field-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}
.field-label em { font-style: normal; opacity: 0.7; }
.lbl-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* author: photo picker + name/link */
.author-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}
.avatar-pick {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px dashed var(--surface-line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  color: var(--muted);
  transition: border-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t) var(--ease);
}
.avatar-pick:hover { border-color: var(--ink); color: var(--ink); transform: scale(1.03); }
.avatar-pick:active { transform: scale(0.97); transition-duration: var(--t-fast); }
.avatar-pick.has-photo:hover { transform: scale(1.03); }
.avatar-pick__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.avatar-pick__hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.avatar-pick.has-photo { border-style: solid; border-color: var(--surface-line); }
.avatar-pick.has-photo .avatar-pick__img { display: block; }
.avatar-pick.has-photo .avatar-pick__hint { display: none; }
.author-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.field-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field {
  width: 100%;
  background: transparent;
  border: 1px solid var(--surface-line);
  border-radius: 9px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.field::placeholder { color: var(--muted); }
.field:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--line-soft); }
.formError {
  font-size: 12px;
  color: #c2562f;
  margin: 10px 2px 0;
}

/* sheet footer: the primary action */
.dlg__foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--surface-line);
}
.fineprint { font-size: 11px; line-height: 1.6; color: var(--muted); margin: 12px 2px 0; text-align: center; }
.fineprint a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.fineprint a:hover { color: var(--ink); }

/* ---------- report dialog ---------- */
.report__lead { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0 0 16px; }
.report__lead a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--surface-line);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.opt:hover { background: var(--line-soft); }
.opt:has(input:checked) { border-color: var(--ink); background: var(--line-soft); }
.opt input { accent-color: var(--ink); width: 15px; height: 15px; margin: 0; flex: 0 0 auto; }
.report__details { margin-top: 16px; }
.report__details textarea { resize: none; line-height: 1.5; }
#reportDone .pay { margin-top: 6px; }

/* ---------- document pages (privacy & terms) ---------- */
body.doc-page { overflow: auto; }
.doc {
  width: min(660px, 100%);
  margin: 0 auto;
  padding: 28px 24px 96px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
}
.doc__title {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.doc__meta { font-size: 12.5px; color: var(--muted); margin: 8px 0 26px; }
.doc__lead { font-size: 16.5px; line-height: 1.6; }
.doc h2 {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 21px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 44px 0 4px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 12px;
}
.doc h3 { font-size: 14.5px; font-weight: 500; margin: 24px 0 6px; }
.doc p { margin: 0 0 12px; }
.doc p, .doc li { color: var(--ink); }
.doc ul { margin: 0 0 12px; padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.pay {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-pay);
  transition: box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease), opacity var(--t) ease;
}
.pay:hover { transform: translateY(-1px); box-shadow: var(--shadow-pay-hover); }
.pay:active { transform: translateY(0) scale(0.985); box-shadow: var(--shadow-pay); transition-duration: var(--t-fast); }
.pay:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

/* ---------- share dialog ---------- */
/* the link as it will look once sent (picture + title), message not included */
.share__card {
  border: 1px solid var(--surface-line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line-soft);
  margin-bottom: 14px;
}
.share__img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; background: #e8e8e6; }
.share__cardmeta { display: flex; flex-direction: column; gap: 2px; padding: 10px 13px 11px; }
.share__cardtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.share__carddesc { font-size: 12px; color: var(--muted); }

/* the link is the thing being shared — it leads */
.share__link { display: flex; gap: 10px; }
.share__link .share__url { flex: 1; min-width: 0; text-overflow: ellipsis; }
.share__link .pay { flex: 0 0 auto; width: auto; padding: 0 18px; }
.share__native { display: block; width: 100%; margin-top: 10px; }
.share__native[hidden] { display: none; }
.btn-ghost {
  flex: 1;
  border: 1px solid var(--surface-line);
  border-radius: 12px;
  padding: 13px 16px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease),
    color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.btn-ghost:hover { background: var(--line-soft); border-color: var(--ink); transform: translateY(-1px); }
.btn-ghost:active { transform: translateY(0) scale(0.98); transition-duration: var(--t-fast); }
/* secondary: the board as a picture */
.share__image { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--surface-line); }
.share__image[hidden] { display: none; }
.share__image .share__label { display: block; margin-bottom: 10px; }
.share__copyrow { display: flex; gap: 10px; }
.share__copyrow .btn-ghost[hidden] { display: none; }

.share__social {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--surface-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.share__label { font-size: 12.5px; color: var(--muted); }
.share__icons { display: flex; gap: 8px; }
.soc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--surface-line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease),
    color var(--t) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.soc:hover { transform: translateY(-2px); box-shadow: var(--shadow-btn-hover); border-color: transparent; }
.soc:active { transform: translateY(0) scale(0.94); transition-duration: var(--t-fast); }
/* brand tints on hover — the only color in the monochrome UI */
.soc--x:hover  { background: var(--ink); color: var(--surface); }
.soc--wa:hover { background: #25d366; color: #fff; }
.soc--tg:hover { background: #229ed9; color: #fff; }
.soc--fb:hover { background: #1877f2; color: #fff; }
.soc--li:hover { background: #0a66c2; color: #fff; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.985); } }

/* ---------- phones: the board keeps its proportion; everything around it is
   re-laid for a thumb — bigger pill, comfortable targets, one full-width action ---------- */
@media (max-width: 560px) {
  .bar { padding: 0 16px; height: 54px; }
  .bar__right { gap: 7px; }
  .tile { width: 34px; height: 44px; }
  .tile__face svg { width: 21px; height: 21px; }

  .scene { gap: 14px; }
  .pill { gap: 9px; padding: 5px 15px 5px 5px; }
  .pill__avatar { width: 26px; height: 26px; }
  .pill__name, .pill__link { font-size: 13.5px; }
  .pill__sep { font-size: 13px; }

  .reveal { gap: 7px; }
  .reveal__from { font-size: 11.5px; }
  .reveal__btn { padding: 11px 20px 11px 16px; }

  .bar--foot {
    display: flex;
    height: auto;
    flex-direction: column-reverse;
    gap: 2px;
    padding: 8px 16px 10px;
  }
  .bar--foot .foot-actions { width: 100%; }
  .bar--foot .cta {
    flex: 1.35 1 0;
    padding: 15px 12px;
    border-radius: 14px;
    border-color: transparent;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 15px;
    font-weight: 500;
    box-shadow: var(--shadow-pay);
  }
  .bar--foot .cta:hover { background: var(--btn-bg); border-color: transparent; transform: none; box-shadow: var(--shadow-pay); }
  .scene:has(.home-actions:not([hidden])) { gap: 20px; }
  .home-actions .cta { padding: 13px 22px; font-size: 15px; }
  .home-actions .cta--ghost { padding: 13px 14px; }
  .bar--foot .foot-links { gap: 0; }
  .bar--foot .about-link { padding: 10px 11px; }
  .doc { padding: 16px 18px 72px; }
  .doc__title { font-size: 28px; }
}
