/*
 * Tack — a networked community bulletin board. "pin it up. pass it on."
 * Hand-written CSS (Propshaft serves this file directly).
 *
 * Look: "Premium Analog / Dark Gallery" — a matte, near-black room with the
 * warm cork board and paper flyers lit up inside it. Chrome is quiet and
 * technical (Inter + a mono for labels); the content is analog and warm
 * (Fraunces serif headlines, real paper). One confident accent: tack red.
 */

/* ---- self-hosted type (Propshaft resolves these by logical name) ---- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/Inter-400-1e94a563.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/Inter-600-a957bd0d.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/Inter-700-cbc762c0.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/Fraunces-400-bb969d82.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/Fraunces-600-3c9b1a99.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/SpaceMono-400-6d6f4004.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/SpaceMono-700-47df4379.woff2") format("woff2"); }

:root {
  /* type */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 0.72rem;
  --fs-sm: 0.84rem;
  --fs-base: 1rem;
  --fs-md: 1.15rem;
  --fs-lg: 1.4rem;
  --fs-xl: 1.95rem;
  --fs-2xl: 2.7rem;

  /* the dark room (chrome) */
  --room: #15120e;
  --room-2: #1d1812;
  --topbar: #100d0a;
  --line: #2c2620;
  --on-dark: #ece3d4;
  --on-dark-dim: #9d9484;

  /* warm materials (the lit objects) */
  --cork: #c8a06a;
  --cork-dark: #a87f48;
  --cork-edge: #5f4022;
  --paper: #fbf7ee;
  --paper-2: #f1e7d3;
  --ink: #221f1a;
  --muted: #6f675b;
  --frame: #5c3e21;

  /* one accent: tack red */
  --accent: #db3b2b;
  --accent-dark: #b32d20;
  --accent-soft: rgba(219, 59, 43, 0.14);
  --pin: #d23a2c;
  --ok: #3a8f5c;
  --ok-soft: rgba(58, 143, 92, 0.16);

  /* elevation (on dark) + warm shadow (paper on cork) */
  --shadow: rgba(0, 0, 0, 0.5);
  --shadow-warm: rgba(38, 22, 6, 0.42);
  --e1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --e2: 0 6px 18px rgba(0, 0, 0, 0.42);
  --e3: 0 16px 40px rgba(0, 0, 0, 0.5);
  --card: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 14px 34px rgba(0, 0, 0, 0.45);

  /* shape + space */
  --radius: 14px;
  --radius-sm: 9px;
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;

  color-scheme: dark;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--on-dark);
  background: var(--room);
  background-image: radial-gradient(1100px 620px at 50% -8%, #211a12, var(--room) 70%);
  background-attachment: fixed;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.12; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: #ef6c52; }

/* small technical labels, MKBHD-style */
.kicker, .breadcrumbs, .board-head__meta, .board-toolbar__level, .board-toolbar__hint,
.floor__label, .flyer__hint, .floor__flyer-hint, .compose-panel__sub, .compose__or {
  font-family: var(--font-mono);
}

/* line-icons */
.ico { display: inline-block; vertical-align: -0.18em; flex: none; }

/* ---- the app bar: ONE row — brand/home · board context+management · account ---- */
.appbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 1.1rem;
  background: var(--topbar); color: var(--on-dark);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1000;
  -webkit-backdrop-filter: saturate(1.1); backdrop-filter: saturate(1.1);
}
.appbar__lead { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.appbar__home { display: inline-flex; align-items: center; color: var(--accent); text-decoration: none; flex: none; }
.appbar__home:hover { filter: brightness(1.12); }
.appbar__home .ico { width: 1.55rem; height: 1.55rem; }
/* a hairline between the mark and the board context */
.appbar__context { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.appbar__context:not(:empty)::before { content: ""; width: 1px; height: 1.4rem; background: var(--line); margin-right: 0.25rem; flex: none; }
.appbar__crumbs { font-family: var(--font-mono); font-size: 0.72rem; color: var(--on-dark-dim); white-space: nowrap; flex: none; }
.appbar__crumbs a { color: var(--on-dark-dim); text-decoration: none; }
.appbar__crumbs a:hover { color: var(--on-dark); }
.appbar__name { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; letter-spacing: 0; line-height: 1.2; color: var(--on-dark); margin: 0; max-width: 38ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.appbar__trail { display: flex; align-items: center; gap: 0.45rem; flex: none; }
.appbar__actions { display: flex; align-items: center; gap: 0.3rem; }
.appbar__actions:not(:empty) { padding-right: 0.6rem; border-right: 1px solid var(--line); margin-right: 0.15rem; }
.appbar__account { display: flex; align-items: center; gap: 0.3rem; }

/* account avatar + dropdown (no JS — a <details>) */
.usermenu { position: relative; display: inline-flex; }
.usermenu__btn { list-style: none; cursor: pointer; display: inline-flex; }
.usermenu__btn::-webkit-details-marker { display: none; }
.usermenu__btn::marker { content: ""; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: linear-gradient(180deg, #2c2218, #19130c); border: 1px solid var(--line); color: var(--on-dark); font-family: var(--font-ui); font-weight: 700; font-size: 0.82rem; }
.usermenu__btn:hover .avatar { border-color: #46402f; }
.usermenu[open] .avatar { border-color: var(--accent); }
.usermenu__pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 1200; min-width: 188px; background: var(--paper); color: var(--ink); border-radius: var(--radius-sm); border: 1px solid rgba(0, 0, 0, 0.08); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55); padding: 0.35rem; }
.usermenu__name { display: block; padding: 0.45rem 0.55rem; font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 1px solid #ead9bb; margin-bottom: 0.25rem; }
.usermenu__name:hover { color: var(--accent-dark); }
.usermenu__item { display: flex; align-items: center; gap: 0.55rem; width: 100%; text-align: left; padding: 0.45rem 0.55rem; border-radius: 7px; color: var(--ink); text-decoration: none; font: inherit; font-weight: 500; background: none; border: none; cursor: pointer; }
.usermenu__item:hover { background: var(--accent-soft); color: var(--accent-dark); }
.usermenu__item .ico { width: 1em; height: 1em; opacity: 0.8; }
.usermenu form.button_to { display: block; width: 100%; }

/* ---- flashes ---- */
.flashes { padding: 0.6rem 1.1rem 0; display: grid; gap: 0.4rem; }
.flash {
  padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 0.92rem; display: flex; align-items: center; gap: 0.5rem;
  box-shadow: var(--e1);
}
.flash--notice { background: var(--ok-soft); color: #bfe9cf; border: 1px solid rgba(58, 143, 92, 0.5); }
.flash--alert { background: var(--accent-soft); color: #f4b7ab; border: 1px solid rgba(219, 59, 43, 0.5); }

/* One slim keep-your-board line for guest curators — app chrome, never on the cork. */
.guest-nudge {
  margin: 0 0 0.6rem; padding: 0.45rem 0.9rem;
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--on-dark-dim);
  background: var(--room-2); border: 1px dashed var(--line); border-radius: var(--radius-sm);
}
.guest-nudge .ico { width: 1em; height: 1em; color: var(--pin); flex: none; }
.guest-nudge a { color: var(--on-dark); }

.main { padding: 1.2rem; max-width: 1180px; margin: 0 auto; }

/* ---- buttons: kraft-paper chips that read on dark OR on paper ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #ede1c6, #e3d4b2);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--e1);
  transition: transform 0.08s ease, filter 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { filter: brightness(1.04); box-shadow: var(--e2); }
.btn:active { transform: translateY(1px); box-shadow: var(--e1); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn .ico { width: 1.05em; height: 1.05em; }
.btn--primary { background: linear-gradient(180deg, #e6493a, var(--accent)); color: #fff; border-color: transparent; box-shadow: 0 2px 10px rgba(219, 59, 43, 0.4), var(--e1); }
.btn--primary:hover { background: linear-gradient(180deg, var(--accent), var(--accent-dark)); }
.btn--ghost { background: transparent; color: var(--on-dark); box-shadow: none; border: 1px solid var(--line); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.06); filter: none; border-color: #3c352b; }
/* the join CTA — subtle on the dark chrome, warms toward the accent on hover */
.btn--join { background: rgba(255, 255, 255, 0.05); color: var(--on-dark); border: 1px solid var(--line); box-shadow: none; font-weight: 600; }
.btn--join:hover { background: var(--accent-soft); border-color: rgba(219, 59, 43, 0.45); color: #fff; filter: none; box-shadow: none; }
.btn--danger { background: linear-gradient(180deg, #c2392a, var(--accent-dark)); color: #fff; border-color: transparent; }
.btn--tiny { padding: 0.28rem 0.55rem; font-size: 0.78rem; border-radius: 7px; }
.btn--big { padding: 0.7rem 1.4rem; font-size: 1.05rem; }
form.button_to { display: inline; }

/* Quiet secondary actions on the dark room/topbar — no fill, just text/icon, so
   they recede and let the board be the hero. Used for board admin + topbar nav. */
.btn--quiet {
  background: none; border: 1px solid transparent; box-shadow: none;
  color: var(--on-dark-dim); font-weight: 600;
}
.btn--quiet:hover { background: rgba(255, 255, 255, 0.06); color: var(--on-dark); filter: none; box-shadow: none; }
.btn--quiet:active { transform: translateY(1px); box-shadow: none; }
.btn--quiet .ico { opacity: 0.85; }

/* Icon-only quiet button (gear, share, wallet, bell, sign-out). */
.btn--icon {
  position: relative;
  background: none; border: 1px solid transparent; box-shadow: none;
  color: var(--on-dark-dim);
  padding: 0; width: 2.25rem; height: 2.25rem;
}
.btn--icon:hover { background: rgba(255, 255, 255, 0.07); color: var(--on-dark); filter: none; box-shadow: none; }
.btn--icon:active { transform: translateY(1px); box-shadow: none; }
.btn--icon .ico { width: 1.15rem; height: 1.15rem; }

/* thin divider between the labelled actions and the icon cluster */
.board-head__actions { align-items: center; gap: 0.3rem; }
.board-head__sep { width: 1px; align-self: stretch; min-height: 1.5rem; margin: 0 0.3rem; background: var(--line); }

/* count badge — muted inline (Queue) or a floating dot (bell) */
.count { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700; line-height: 1; padding: 0.12rem 0.34rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: var(--on-dark); }
.count--on { background: var(--accent); color: #fff; }
.count--float { position: absolute; top: 0.2rem; right: 0.1rem; padding: 0.05rem 0.26rem; box-shadow: 0 0 0 2px var(--topbar); }

/* zoom: one segmented capsule instead of four loose pills */
.zoomcap { display: inline-flex; align-items: center; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 999px; padding: 0.12rem; }
.zoomcap__btn { border: none; background: none; color: var(--on-dark-dim); font: inherit; font-weight: 700; cursor: pointer; min-width: 2rem; height: 1.85rem; padding: 0 0.5rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; transition: background 0.12s ease, color 0.12s ease; }
.zoomcap__btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--on-dark); }
.zoomcap__btn--text { font-weight: 600; font-size: 0.85rem; }
.zoomcap__level { font-family: var(--font-mono); font-size: 0.78rem; color: var(--on-dark-dim); min-width: 3.1rem; text-align: center; }
.zoomcap__sep { width: 1px; height: 1.1rem; background: var(--line); margin: 0 0.15rem; }

/* ---- floating canvas controls: docked onto the board, like a real tool ---- */
.board-stage { position: relative; }
.board-stage .board-viewport { position: relative; z-index: 0; }

/* zoom capsule floats in the board's bottom-left corner */
.zoomcap--float {
  position: absolute; left: 14px; bottom: 14px; z-index: 30;
  background: rgba(18, 14, 9, 0.62); border-color: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

/* the primary action — a pin "pen" docked to the board's top-right corner */
.compose-dock { position: absolute; top: 14px; right: 14px; z-index: 31; }
.compose-dock__pill {
  display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; list-style: none;
  padding: 0.55rem 0.95rem; border-radius: 999px;
  background: linear-gradient(180deg, #e6493a, var(--accent)); color: #fff; font-weight: 600;
  box-shadow: 0 8px 20px rgba(150, 34, 18, 0.5), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  transition: transform 0.1s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.compose-dock__pill::-webkit-details-marker { display: none; }
.compose-dock__pill::marker { content: ""; }
.compose-dock__pill:hover { filter: brightness(1.05); box-shadow: 0 12px 26px rgba(150, 34, 18, 0.55); }
.compose-dock__pill:active { transform: translateY(1px); }
.compose-dock__pill .ico { width: 1.05rem; height: 1.05rem; }
.compose-dock[open] .compose-dock__pill { box-shadow: 0 4px 12px rgba(150, 34, 18, 0.45); }

.compose-dock__panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; max-width: 86vw; max-height: 68vh; overflow: auto;
  background: var(--paper); color: var(--ink); border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.58);
}
.compose-dock__panel .compose__form { padding: 1rem; }

@media (max-width: 640px) {
  .compose-dock { top: 10px; right: 10px; left: 10px; }
  .compose-dock__pill { width: max-content; margin-left: auto; }
  .compose-dock__panel { width: auto; left: 0; right: 0; max-width: none; }
  .zoomcap--float { left: 10px; bottom: 10px; }
}

/* ---- board page ---- */
.board-page { max-width: 100%; }
.board-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.board-head h1 { margin: 0.2rem 0; font-size: var(--fs-xl); color: var(--on-dark); }
.board-head__meta { margin: 0.2rem 0 0; color: var(--on-dark-dim); font-size: 0.8rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.board-head__meta .ico { width: 0.95em; height: 0.95em; opacity: 0.85; }
.board-head__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.breadcrumbs { font-size: 0.74rem; color: var(--on-dark-dim); letter-spacing: 0.01em; }
.breadcrumbs a { color: var(--on-dark-dim); text-decoration: none; }
.breadcrumbs a:hover { color: var(--on-dark); }
.breadcrumbs__sep { margin: 0 0.35rem; opacity: 0.5; }
/* board title row: the name as a clean (non-serif) title + status/scope chips */
.board-head__titles { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.board-head__title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.board-head .board-head__name { font-family: var(--font-mono); font-weight: 700; font-size: 1.18rem; letter-spacing: 0; line-height: 1.2; color: var(--on-dark); margin: 0; }

/* a small, learnable property chip (board status / scope); hover for the why */
.chip {
  display: inline-flex; align-items: center; gap: 0.34rem; white-space: nowrap;
  font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em;
  padding: 0.2rem 0.58rem 0.2rem 0.46rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.055); border: 1px solid var(--line); color: var(--on-dark-dim);
  cursor: pointer;
}
.chip:hover { color: var(--on-dark); border-color: #3c352b; }
.chip .ico { width: 0.92em; height: 0.92em; opacity: 0.9; }

/* click-to-open explanation popover on a chip (no JS — a <details>) */
.chip-pop { position: relative; display: inline-flex; }
.chip-pop > summary { list-style: none; }
.chip-pop > summary::-webkit-details-marker { display: none; }
.chip-pop > summary::marker { content: ""; }
.chip-pop[open] > summary.chip { color: var(--on-dark); border-color: #46402f; background: rgba(255, 255, 255, 0.09); }
.chip-pop__body {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 120;
  width: max-content; max-width: 264px;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: 0.78rem; font-weight: 400; letter-spacing: 0; line-height: 1.45;
  padding: 0.55rem 0.7rem; border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.08); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

/* the board-mode note at the top of the compose dock (paper context) */
.compose__mode { display: flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; color: var(--muted); background: var(--paper-2); border-radius: var(--radius-sm); padding: 0.5rem 0.7rem; margin: 0 0 0.2rem; }
.compose__mode .ico { width: 1em; height: 1em; flex: none; }

/* ---- the room: zoom toolbar, the scrollable board viewport, then the floor ---- */
.room { position: relative; width: 100%; }
.board-toolbar { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.board-toolbar__level { min-width: 3.4rem; text-align: center; font-weight: 700; color: var(--on-dark-dim); font-size: 0.8rem; }
.board-toolbar__hint { color: var(--on-dark-dim); font-size: 0.72rem; margin-left: 0.4rem; opacity: 0.8; }
/* the window onto the board; scrolls/pans, and its scrollbars match the scaled
   board exactly because .board-scaler is sized to the scaled footprint. */
.board-viewport { overflow: auto; max-width: 100%; -webkit-overflow-scrolling: touch; cursor: grab; border-radius: var(--radius); }
.board-viewport.is-panning { cursor: grabbing; }
/* clip to the scaled footprint — the board's transform shrinks it visually but
   not in layout, so without this the viewport keeps scrollbars for 1400×900. */
.board-scaler { position: relative; overflow: hidden; }

/* ---- the corkboard: a fixed-size world, scaled by board_controller, glowing
   in the dark room. Cork is procedural noise + speckle + a soft inner vignette. */
.board {
  position: relative;
  transform-origin: top left; /* board_controller sets transform: scale(...) */
  overflow: visible;
  z-index: 1; /* a flyer dragged down over the floor paints above it, not behind */
  border-radius: var(--radius);
  border: 12px solid var(--frame);
  background-color: var(--cork);
  background-image:
    /* soft vignette so the centre glows and the edges recede */
    radial-gradient(120% 120% at 50% 35%, rgba(255, 240, 210, 0.10), transparent 55%),
    /* fine cork fibre via fractal noise */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E"),
    /* scattered cork granules */
    radial-gradient(circle at 18% 28%, rgba(255, 250, 235, 0.16) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 68% 62%, rgba(86, 56, 20, 0.22) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 42% 82%, rgba(255, 248, 230, 0.12) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 86% 22%, rgba(86, 56, 20, 0.20) 0 1.5px, transparent 2.5px);
  background-size: auto, 180px 180px, 46px 46px, 58px 58px, 38px 38px, 52px 52px;
  background-blend-mode: overlay, multiply, normal, normal, normal, normal;
  box-shadow:
    inset 0 0 90px rgba(60, 36, 8, 0.45),
    inset 0 2px 0 rgba(255, 235, 200, 0.18),
    0 30px 70px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 0, 0, 0.4);
}
.board__wall { position: relative; width: 100%; height: 100%; }
/* dragging a poster file over the board to plaster it up */
.board.board--drop { outline: 4px dashed var(--accent); outline-offset: -10px; }

/* ---- a flyer: real paper, lit from above ---- */
/* --tilt is the flyer's resting angle (set inline); --sway is the live breeze. */
@property --sway { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.flyer {
  position: absolute;
  background-color: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(241, 231, 211, 0.5)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.04'/%3E%3C/svg%3E");
  color: var(--ink);
  padding: 0.75rem 0.75rem 0.55rem;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 10px 22px var(--shadow-warm), 0 2px 4px rgba(38, 22, 6, 0.3);
  cursor: grab;
  transition: box-shadow 0.14s ease, transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: rotate(calc(var(--tilt, 0deg) + var(--sway, 0deg)));
  /* pivot from the top-centre, as if a pin holds it there — the bottom waves */
  transform-origin: 50% 6px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.flyer:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 16px 30px var(--shadow-warm), 0 3px 6px rgba(38, 22, 6, 0.34); }
.flyer.is-dragging { cursor: grabbing; box-shadow: 0 26px 48px rgba(20, 12, 2, 0.55); transition: none; }
.flyer.is-resizing { box-shadow: 0 26px 48px rgba(20, 12, 2, 0.55); transition: none; }
/* corner handle to resize the flyer (owner/admin only) */
.flyer__resize {
  position: absolute; right: -7px; bottom: -7px; width: 18px; height: 18px;
  background: var(--accent); border: 2px solid #fff; border-radius: 50%;
  cursor: nwse-resize; z-index: 4; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  touch-action: none; opacity: 0; transition: opacity 0.12s ease;
}
.flyer:hover .flyer__resize, .flyer.is-resizing .flyer__resize { opacity: 1; }

/* featured listing — the paid "pin to the top" badge / buy button */
.flyer__featured, .flyer__feature {
  position: absolute; top: -10px; left: -6px; z-index: 5;
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-family: var(--font-ui); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 0.16rem 0.42rem; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.flyer__featured { background: linear-gradient(180deg, #f2c14e, #d99a23); color: #3a2a06; }
.flyer__feature { border: none; cursor: pointer; background: linear-gradient(180deg, #e6493a, var(--accent)); color: #fff; opacity: 0; transition: opacity 0.12s ease; }
.flyer:hover .flyer__feature { opacity: 1; }
.flyer__feature:hover { filter: brightness(1.06); }
.flyer__featured .ico, .flyer__feature .ico { width: 0.85em; height: 0.85em; }
.flyer form.button_to { display: inline; }

/* ---- the breeze: a faint, ceaseless sway on wild (un-glassed) boards only ---- */
@media (prefers-reduced-motion: no-preference) {
  .board--breezy .flyer { animation: flyer-sway 4.5s ease-in-out infinite alternate; }
  .board--breezy .flyer:nth-child(3n)   { animation-duration: 5.9s; animation-delay: -2.3s; }
  .board--breezy .flyer:nth-child(3n+1) { animation-duration: 3.8s; animation-delay: -1.1s; }
  .board--breezy .flyer:nth-child(4n)   { animation-duration: 6.4s; animation-delay: -3.0s; }
  .board--breezy .flyer.is-dragging,
  .board--breezy .flyer.is-resizing     { animation: none; }
}
@keyframes flyer-sway {
  from { --sway: -1.2deg; }
  to   { --sway: 1.5deg; }
}
.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
  cursor: pointer;
  z-index: 3;
  transition: transform 0.1s ease;
}
.pin:hover { transform: translate(-50%, -50%) scale(1.12); }
.flyer--held { outline: 2px dashed var(--accent); outline-offset: 2px; }
.flyer__hint { position: absolute; top: 4px; right: 6px; font-size: 0.58rem; color: #fff; background: var(--accent); padding: 0.05rem 0.3rem; border-radius: 4px; pointer-events: none; letter-spacing: 0.02em; }
.flyer.off-board { box-shadow: 0 28px 50px rgba(180, 40, 20, 0.5); opacity: 0.78; }
.hand-hint { background: linear-gradient(180deg, #fff6da, #ffedbe); border: 1px solid #e9d49a; color: #6b4f16; border-radius: var(--radius-sm); padding: 0.5rem 0.8rem; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 0.45rem; margin-bottom: 0.6rem; box-shadow: var(--e1); }
.flyer__image { display: block; max-width: 100%; border-radius: 2px; pointer-events: none; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.flyer__title { margin: 0.45rem 0 0.2rem; font-size: 1.12rem; font-family: var(--font-display); font-weight: 600; line-height: 1.15; }
.flyer__body { font-size: 0.86rem; color: #3a352c; max-height: 160px; overflow: hidden; line-height: 1.5; }

/* ---- portal flyers (doorways into sub-boards) ---- */
.flyer--portal { background: linear-gradient(160deg, #fff7e8, #ffe7c2); cursor: pointer; }
.portal { text-align: center; padding: 0.45rem 0; display: grid; gap: 0.15rem; justify-items: center; }
.portal__icon { color: var(--accent-dark); }
.portal__icon .ico { width: 1.6rem; height: 1.6rem; }
.portal strong { font-family: var(--font-display); }
.portal__go { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.72rem; color: var(--accent-dark); font-weight: 700; font-family: var(--font-mono); }

/* ---- lightbox (double-tap to read) ---- */
.lightbox { position: fixed; inset: 0; background: rgba(8, 5, 2, 0.86); display: flex; align-items: center; justify-content: center; z-index: 5000; padding: 1rem; overflow: auto; backdrop-filter: blur(3px); }
.lightbox__content { background: var(--paper); color: var(--ink); border-radius: 6px; padding: 1.6rem; max-width: 90vw; max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.lightbox__content img { max-width: 100%; height: auto; }

/* ---- event flyers ---- */
.flyer__event { margin: 0.2rem 0; font-size: 0.78rem; font-weight: 700; color: var(--accent-dark); font-family: var(--font-mono); }
.flyer--event { outline: 2px solid rgba(219, 59, 43, 0.25); }

/* ====================================================================== *
 * Poster Studio — designed "paper" printed in one accent, + the studio UI *
 * ====================================================================== */

/* the accent each designed poster prints in (one CSS var drives everything) */
.accent--tomato { --tmpl-accent: #db3b2b; }
.accent--ink    { --tmpl-accent: #2a2620; }
.accent--forest { --tmpl-accent: #2f7d4f; }
.accent--cobalt { --tmpl-accent: #2f5ed1; }
.accent--plum   { --tmpl-accent: #7d4a9e; }

/* shared designed-poster elements (empties collapse so blanks leave no gap) */
.flyer__photo { margin: -0.75rem -0.75rem 0.55rem; overflow: hidden; border-radius: 3px 3px 0 0; }
.flyer__photo-img { display: block; width: 100%; height: auto; }
.flyer__headline { margin: 0.1rem 0 0.15rem; font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; line-height: 1.12; color: var(--tmpl-accent, var(--ink)); }
.flyer__subtitle { margin: 0 0 0.3rem; font-size: 0.82rem; color: var(--muted); line-height: 1.3; }
.flyer__message { font-size: 0.85rem; color: #3a352c; line-height: 1.5; max-height: 220px; overflow: hidden; }
.flyer__meta { display: flex; flex-direction: column; gap: 0.05rem; }
.flyer__headline:empty, .flyer__subtitle:empty, .flyer__message:empty,
.flyer__when:empty, .flyer__where:empty { display: none; }
.flyer__meta:not(:has(.flyer__when:not(:empty), .flyer__where:not(:empty))) { display: none; }

/* Event / gig poster: a bold accent meta-band over a big headline. */
.flyer--tmpl-event .flyer__meta { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; color: #fff; background: var(--tmpl-accent); border-radius: 4px; padding: 0.35rem 0.5rem; margin-bottom: 0.45rem; }
.flyer--tmpl-event .flyer__headline { font-size: 1.4rem; }

/* Notice / note: a clean card with an accent rule across the top. */
.flyer--tmpl-note { border-top: 4px solid var(--tmpl-accent); }
.flyer--tmpl-note .flyer__photo, .flyer--tmpl-note .flyer__meta { display: none; }
.flyer--tmpl-note .flyer__message { font-family: var(--font-display); font-size: 0.9rem; }

/* Photo card: a polaroid — white frame, photo, handwritten-feel caption. */
.flyer--tmpl-photo { background-color: #fff; padding-bottom: 1.1rem; }
.flyer--tmpl-photo .flyer__meta { display: none; }
.flyer--tmpl-photo .flyer__photo { margin: 0 0 0.6rem; border-radius: 2px; }
.flyer--tmpl-photo .flyer__headline { font-style: italic; font-size: 1.1rem; text-align: center; color: var(--ink); }
.flyer--tmpl-photo .flyer__subtitle, .flyer--tmpl-photo .flyer__message { text-align: center; }

/* Video card: the same polaroid, but the print is a still of a video. A printed
   play "sticker" sits on it; the actual player only ever exists in the lightbox. */
.flyer--tmpl-video { background-color: #fff; padding-bottom: 1.1rem; }
.flyer--tmpl-video .flyer__meta { display: none; }
.flyer--tmpl-video .flyer__photo { margin: 0 0 0.6rem; border-radius: 2px; }
.flyer--tmpl-video .flyer__headline { font-style: italic; font-size: 1.1rem; text-align: center; color: var(--ink); }
.flyer--tmpl-video .flyer__subtitle, .flyer--tmpl-video .flyer__message { text-align: center; }
.flyer__photo--video { position: relative; }
.flyer__photo--video::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 50px; height: 50px;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: rgba(20, 14, 8, 0.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fbf7ee'%3E%3Cpolygon points='9.5 6.5 18 12 9.5 17.5'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
  border: 2px solid rgba(251, 247, 238, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
/* the print is still at the shop (the thumbnail job hasn't delivered it yet) */
.flyer__photo--developing { aspect-ratio: 16 / 9; background: repeating-linear-gradient(-45deg, var(--paper-2), var(--paper-2) 10px, #e6d9bf 10px, #e6d9bf 20px); }

/* behind the glass: the actual player */
.lightbox__content--video { padding: 0.5rem; background: #0d0a07; }
.lightbox__player { display: block; width: min(88vw, 960px); aspect-ratio: 16 / 9; border: 0; border-radius: 4px; }

/* the Management's word on plan-gated studio features */
.studio__notice { border: 1px dashed rgba(0, 0, 0, 0.25); border-radius: var(--radius-sm); background: var(--paper-2); padding: 0.6rem 0.8rem; font-size: 0.85rem; }
.studio__notice strong { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.2rem; }
.studio__notice p { margin: 0; }

/* ---- the studio: a roomy two-pane page (controls | live preview) ---- */
.studio-page { max-width: 940px; margin: 1.2rem auto; background: var(--paper); color: var(--ink); border-radius: var(--radius); box-shadow: var(--card); padding: 1.5rem; }
.studio-page__head { margin-bottom: 1.1rem; }
.studio-page__head h1 { margin: 0.6rem 0 0.2rem; color: var(--ink); }
.studio-page__head .form-hint { margin: 0; }

.studio { display: grid; gap: 1.3rem; align-items: start; }
.studio__controls { display: grid; gap: 0.7rem; min-width: 0; }
.studio__form { display: grid; gap: 0.7rem; }
.studio__preview-pane { min-width: 0; }
/* desktop: controls on the left, a sticky preview on the right */
@media (min-width: 760px) {
  .studio { grid-template-columns: minmax(0, 1fr) 320px; }
  .studio__preview-pane { position: sticky; top: 1rem; }
}
/* mobile: single column with the preview floated up top so you always see it */
@media (max-width: 759px) {
  .studio-page { padding: 1rem; margin: 0.6rem auto; }
  .studio__preview-pane { order: -1; }
  .studio__preview { padding: 1.1rem 0.5rem 0.7rem; }
}

.studio__templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.studio__tmpl { display: block; cursor: pointer; }
.studio__tmpl-chip { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.55rem 0.3rem; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: var(--radius-sm); background: var(--paper-2); font-size: 0.72rem; font-weight: 700; color: var(--muted); transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease; }
.studio__tmpl-chip .ico { width: 1.15rem; height: 1.15rem; }
.studio__tmpl input:checked + .studio__tmpl-chip { background: #fff; color: var(--accent-dark); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.studio__tmpl input:focus-visible + .studio__tmpl-chip { outline: 2px solid var(--accent); outline-offset: 2px; }
.studio__fields { display: grid; gap: 0.5rem; }
.studio input[type="text"], .studio input[type="datetime-local"], .studio textarea { width: 100%; font: inherit; padding: 0.5rem 0.6rem; border: 1px solid rgba(0, 0, 0, 0.14); border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.studio textarea { resize: vertical; }
.studio__headline-input { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.studio__event { display: grid; gap: 0.4rem; padding: 0.55rem; border: 1px dashed rgba(0, 0, 0, 0.18); border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.02); }
.studio__video { display: grid; gap: 0.4rem; padding: 0.55rem; border: 1px dashed rgba(0, 0, 0, 0.18); border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.02); }
.studio__field-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 0.3rem; }
.studio__field-label .ico { width: 0.9em; height: 0.9em; }
.studio__accents { display: flex; gap: 0.45rem; align-items: center; }
.studio__swatch { cursor: pointer; line-height: 0; }
.studio__swatch-dot { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--tmpl-accent); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18); }
.studio__swatch input:checked + .studio__swatch-dot { box-shadow: 0 0 0 2px var(--ink); }
.studio__swatch input:focus-visible + .studio__swatch-dot { outline: 2px solid var(--ink); outline-offset: 2px; }
.studio__submit { width: 100%; justify-content: center; }

/* the live preview, pinned on a little corkboard so the paper pops */
.studio__preview { position: relative; padding: 1.5rem 0.6rem 0.9rem; border-radius: var(--radius-sm); display: flex; justify-content: center; background: linear-gradient(160deg, var(--cork), var(--cork-dark)); box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.28); }
.studio__preview-cap { position: absolute; top: 0.35rem; left: 0.55rem; font-family: var(--font-mono); font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.75); }
.flyer--preview { position: static; width: 228px; cursor: default; transform: rotate(-1.2deg); animation: none !important; transition: none; }
.flyer--preview .flyer__message { white-space: pre-line; }
.flyer__placeholder { color: var(--muted); font-size: 0.82rem; text-align: center; padding: 1.4rem 0.5rem; }

/* escape hatch: upload your own image */
.studio__fallback { border-top: 1px solid rgba(0, 0, 0, 0.08); padding-top: 0.6rem; }
.studio__fallback summary { cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.studio__fallback summary:hover { color: var(--ink); }
.studio__fallback .compose__form { padding: 0.6rem 0 0; }

/* the dock's "design a poster" link, sitting under the quick image dropzone */
.studio-link { display: flex; align-items: center; gap: 0.45rem; padding: 0.75rem 1rem; border-top: 1px solid rgba(0, 0, 0, 0.08); background: var(--paper-2); color: var(--ink); text-decoration: none; font-size: 0.86rem; border-radius: 0 0 var(--radius) var(--radius); }
.studio-link:hover { background: #fff; color: var(--ink); }
.studio-link .ico { color: var(--accent); flex: none; }
.studio-link strong { color: var(--accent-dark); }

/* ---- the floor beneath the board: warm wooden planks where flyers land ---- */
.floor {
  margin-top: 16px;
  padding: 0.65rem 0.95rem 1rem;
  border-radius: 5px 5px var(--radius) var(--radius);
  border-top: 3px solid #4a3014;
  background-color: #7f5a2c;
  background-image:
    /* grain noise */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.9' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)' opacity='0.5'/%3E%3C/svg%3E"),
    /* plank seams, every ~108px */
    repeating-linear-gradient(90deg, transparent 0 106px, rgba(0, 0, 0, 0.3) 106px 108px),
    /* light/shade across the boards */
    linear-gradient(180deg, #9a7038, #6a4a22);
  background-blend-mode: overlay, normal, normal;
  box-shadow: inset 0 12px 22px rgba(35, 18, 4, 0.6), 0 8px 18px var(--shadow);
}
.floor__label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 248, 236, 0.66); margin-bottom: 0.55rem; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); }
.floor__label .ico { width: 0.95em; height: 0.95em; }
.floor__pile { display: flex; flex-wrap: wrap; gap: 0.6rem 0.5rem; min-height: 36px; align-items: flex-start; padding: 0 0.2rem; }
.floor.floor--active { box-shadow: inset 0 0 0 3px var(--accent), inset 0 12px 22px rgba(35, 18, 4, 0.6); }
/* fallen flyers — crumpled paper tossed on the floor */
.floor__flyer {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: linear-gradient(155deg, #fffdf6, #ede2c8); color: var(--ink);
  padding: 0.45rem 0.7rem; border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 6px 13px rgba(20, 11, 2, 0.55);
  font-size: 0.8rem; transform: rotate(-4deg);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.floor__flyer:nth-child(2n) { transform: rotate(3deg) translateY(-1px); }
.floor__flyer:nth-child(3n) { transform: rotate(-1.5deg) translateY(2px); }
.floor__flyer:nth-child(5n) { transform: rotate(5deg); }
.floor__flyer.is-pickable { cursor: grab; }
.floor__flyer.is-pickable:hover { outline: 2px solid var(--accent); transform: rotate(0deg) scale(1.05); transition: transform 0.12s ease; }
.floor__flyer-ico { color: var(--muted); display: inline-flex; }
.floor__flyer-ico .ico { width: 1em; height: 1em; }
.floor__flyer-title { font-weight: 600; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.floor__flyer-hint { font-size: 0.6rem; color: var(--accent-dark); opacity: 0.8; }

/* ---- forms: warm paper cards floating in the dark room ---- */
.form-page, .auth-card, .invite-landing {
  max-width: 540px; margin: 2rem auto; background: var(--paper); color: var(--ink);
  padding: 1.6rem; border-radius: var(--radius); box-shadow: var(--card);
}
.form-page h1, .auth-card h1, .invite-landing h1 { margin-top: 0; }

/* "back to the board" link at the top of admin sub-pages (paper context) */
.page-back { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.02em; color: var(--muted); text-decoration: none; margin-bottom: 1rem; transition: color 0.12s ease, gap 0.12s ease; }
.page-back:hover { color: var(--accent-dark); gap: 0.55rem; }
.page-back .ico { width: 1em; height: 1em; }
.form-page a, .auth-card a, .invite-landing a, .compose a, .lightbox a, .flyer a { color: var(--accent-dark); }
.stack-form { display: grid; gap: 0.9rem; }
.stack-form label { display: grid; gap: 0.3rem; font-weight: 600; }
.stack-form input[type=text], .stack-form input[type=email], .stack-form input[type=number],
.stack-form select, .auth-form input, .stack-form trix-editor {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #d6c6a6; border-radius: var(--radius-sm); font: inherit; background: #fffef9; color: var(--ink);
}
.stack-form input:focus, .auth-form input:focus, .stack-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row { display: flex; gap: 0.6rem; }
.form-row label { flex: 1; }
.checkbox, .radio { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.kind-picker { border: 1px solid #e2d6bd; border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; display: grid; gap: 0.4rem; }
.form-errors { background: var(--accent-soft); color: var(--accent-dark); padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); border: 1px solid rgba(219, 59, 43, 0.3); }
.form-hint, .auth-hint { color: var(--muted); font-size: 0.9rem; }

.auth-form { display: grid; gap: 0.7rem; }
.auth-alts { display: grid; gap: 0.5rem; margin-top: 1rem; }
.auth-password { margin-top: 1rem; }
.auth-password summary { cursor: pointer; color: var(--muted); }

/* ---- compose a flyer ---- */
.compose { max-width: 640px; margin: 2rem auto; background: var(--paper); color: var(--ink); padding: 1.6rem; border-radius: var(--radius); box-shadow: var(--card); }
.compose__form { display: grid; gap: 1rem; }
.compose__tabs-field { display: grid; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.compose__tabs-field input { width: 120px; padding: 0.4rem 0.5rem; border: 1px solid #d6c6a6; border-radius: var(--radius-sm); font: inherit; }

/* ---- inline "new flyer" panel — a tidy collapsible card on the board page ---- */
.compose-panel { background: var(--paper); color: var(--ink); border-radius: var(--radius); box-shadow: var(--card); margin-bottom: 1.2rem; max-width: 560px; overflow: hidden; border: 1px solid rgba(0, 0, 0, 0.06); }
.compose-panel > summary { cursor: pointer; font-weight: 700; padding: 0.75rem 1rem; list-style: none; display: flex; align-items: center; gap: 0.5rem; color: var(--ink); background: linear-gradient(180deg, #fffdf6, #f4ead4); }
.compose-panel > summary::-webkit-details-marker { display: none; }
.compose-panel > summary .ico { color: var(--accent); }
.compose-panel > summary::after { content: ""; margin-left: auto; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--chevron) center/16px no-repeat; mask: var(--chevron) center/16px no-repeat; color: var(--accent); transition: transform 0.18s ease; }
.compose-panel[open] > summary::after { transform: rotate(90deg); }
.compose-panel[open] > summary { border-bottom: 1px solid #ead9bb; }
.compose-panel__sub { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.compose-panel .compose__form { padding: 1rem; }
:root { --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); }

/* a full-screen overlay; the dimmed area is the backdrop, the box holds the form */
.modal { position: fixed; inset: 0; z-index: 6000; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 1rem; overflow: auto; background: rgba(8, 5, 2, 0.6); backdrop-filter: blur(2px); }
.modal[hidden] { display: none; }
.modal__box { width: 92vw; max-width: 680px; background: var(--paper); color: var(--ink); border-radius: var(--radius); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); padding: 1.6rem; position: relative; }
.modal__title { margin: 0 0 1rem; }
.modal__close { position: absolute; top: 0.7rem; right: 0.9rem; border: none; background: transparent; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); }
.modal__close:hover { color: var(--ink); }
.compose__title { font-size: 1.3rem; font-weight: 700; padding: 0.6rem 0.4rem; border: none; border-bottom: 2px solid #e7dcc4; background: transparent; width: 100%; }
.compose__title:focus { outline: none; border-bottom-color: var(--accent); }

.dropzone { position: relative; display: flex; align-items: center; justify-content: center; min-height: 160px; border: 2px dashed var(--cork-dark); border-radius: var(--radius-sm); background: repeating-linear-gradient(45deg, #fffdf6 0 14px, #fbf3e2 14px 28px); cursor: pointer; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; text-align: center; padding: 1rem; }
.dropzone:hover, .dropzone--over { border-color: var(--accent); background: #fff5ea; box-shadow: inset 0 0 0 3px var(--accent-soft); }
.dropzone--busy { opacity: 0.6; pointer-events: none; }
.compose__or { text-align: center; color: var(--muted); font-size: 0.8rem; margin: 0.8rem 0 0.4rem; text-transform: uppercase; letter-spacing: 0.1em; }
.upload__pick { display: block; padding: 0.85rem 1rem; border: 2px dashed #d6c6a6; border-radius: var(--radius-sm); background: #fffdf6; cursor: pointer; }
.upload__pick:hover { border-color: var(--accent); }
.upload__input { display: block; margin-top: 0.5rem; }
.upload__preview { display: block; max-width: 100%; max-height: 240px; margin-top: 0.6rem; border-radius: 6px; box-shadow: var(--e2); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.compose__title, .compose__body { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #d6c6a6; border-radius: var(--radius-sm); font: inherit; background: #fffef9; }
.compose__title { margin-bottom: 0.5rem; }
.compose__body { min-height: 90px; resize: vertical; }
/* Hidden, but the wrapping <label> still opens it on click. It is NOT an overlay
   so the label (a non-file-input element) is the drop target — Safari refuses to
   accept files dropped onto a file input, so JS handles the drop instead. */
.dropzone__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone__placeholder { display: grid; gap: 0.4rem; color: var(--muted); pointer-events: none; justify-items: center; }
.dropzone__placeholder strong { color: var(--ink); font-size: 1.05rem; font-family: var(--font-display); }
.dropzone__icon { color: var(--cork-dark); }
.dropzone__icon .ico { width: 2.2rem; height: 2.2rem; }
.dropzone__preview { max-width: 100%; max-height: 320px; border-radius: 8px; }

.tabbar { display: flex; gap: 0.3rem; border-bottom: 2px solid #e7dcc4; margin-bottom: 0.9rem; }
.tab-btn { border: none; background: transparent; padding: 0.5rem 0.9rem; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; display: inline-flex; align-items: center; gap: 0.35rem; }
.tab-btn--active { color: var(--ink); border-bottom-color: var(--accent); }
/* Only the visible panel shows — must not override the [hidden] attribute. */
.tab-panel:not([hidden]) { display: grid; gap: 0.8rem; }

.compose__editor trix-editor { min-height: 150px; border: 1px solid #d8c7a4; border-radius: var(--radius-sm); background: #fffdf6; padding: 0.6rem 0.7rem; }

.compose__more summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.compose__more-grid { display: grid; gap: 0.7rem; margin-top: 0.6rem; }
.compose__more-grid label { display: grid; gap: 0.2rem; font-size: 0.9rem; font-weight: 600; }
.compose__more-grid input { padding: 0.5rem 0.6rem; border: 1px solid #d6c6a6; border-radius: var(--radius-sm); font: inherit; }

.compose__actions { display: flex; gap: 0.6rem; align-items: center; }

/* ---- moderation queue ---- */
.queue { list-style: none; padding: 0; display: grid; gap: 0.8rem; }
.queue__item { display: flex; justify-content: space-between; gap: 1rem; background: var(--paper); color: var(--ink); padding: 0.9rem; border-radius: var(--radius-sm); box-shadow: var(--card); }
.queue__thumb { max-width: 120px; border-radius: 4px; display: block; margin-top: 0.4rem; }
.queue__actions { display: flex; flex-direction: column; gap: 0.4rem; }

.home { max-width: 600px; margin: 4rem auto; text-align: center; }
.home h1 { font-size: var(--fs-2xl); }
.meta-actions { display: flex; gap: 0.4rem; margin: 0.6rem 0; }
.report-line { margin-top: 1rem; opacity: 0.7; }
.profile-link { color: var(--accent-dark); text-decoration: none; }

/* ---- notifications feed ---- */
.digest-form { margin: 0.5rem 0 1rem; color: var(--on-dark-dim); font-size: 0.9rem; }
.feed { list-style: none; padding: 0; display: grid; gap: 0.4rem; }
.feed__item { background: var(--paper); color: var(--ink); padding: 0.7rem 0.85rem; border-radius: var(--radius-sm); box-shadow: var(--e2); }
.feed__item small { color: var(--muted); margin-left: 0.4rem; }
.feed__item--unread { border-left: 4px solid var(--accent); }

/* ---- wallet + plans ---- */
.balance { font-size: var(--fs-2xl); font-weight: 600; font-family: var(--font-display); margin: 0.3rem 0; color: var(--on-dark); }
.topups { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0; }
.plans { display: flex; gap: 1rem; flex-wrap: wrap; }
.plan-card { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 1.1rem 1.3rem; box-shadow: var(--card); flex: 1; min-width: 200px; }
.plan-card--current { outline: 2px solid var(--accent); }
.plan-card__price { font-size: var(--fs-lg); font-weight: 600; font-family: var(--font-display); }
.plan-card ul { list-style: none; padding: 0; font-size: 0.85rem; color: var(--muted); }

/* ---- curator dashboard ---- */
.stats { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
.stat { background: var(--paper); color: var(--muted); border-radius: var(--radius-sm); padding: 0.7rem 0.95rem; box-shadow: var(--e2); font-size: 0.78rem; font-family: var(--font-mono); letter-spacing: 0.02em; }
.stat__n { display: block; font-size: 1.5rem; font-weight: 600; font-family: var(--font-display); color: var(--ink); letter-spacing: 0; }
.members { width: 100%; border-collapse: collapse; margin-top: 0.5rem; background: var(--paper); color: var(--ink); border-radius: var(--radius-sm); overflow: hidden; }
.members th, .members td { text-align: left; padding: 0.6rem; border-bottom: 1px solid #e6dcc6; }
.members th { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 0.05rem 0.45rem; font-size: 0.66rem; font-family: var(--font-mono); margin-left: 0.3rem; }

/* ---- discovery directory ---- */
.directory { display: grid; gap: 0.8rem; max-width: 760px; }
.board-card { display: flex; justify-content: space-between; gap: 1rem; background: var(--paper); padding: 1rem 1.1rem; border-radius: var(--radius); box-shadow: var(--card); text-decoration: none; color: var(--ink); transition: transform 0.1s ease, box-shadow 0.12s ease; }
.board-card:hover { transform: translateY(-2px); box-shadow: var(--e3); }
.board-card strong { font-family: var(--font-display); font-size: 1.1rem; }
.board-card__meta { color: var(--muted); font-size: 0.82rem; display: flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); }
.board-card__meta .ico { width: 0.95em; height: 0.95em; }

/* ---- site admin (plans) ---- */
.admin-page { max-width: 880px; }
.admin-plans { display: grid; gap: 1rem; margin-top: 1.2rem; }
.admin-plan { border: 1px solid #e6dcc6; border-radius: var(--radius-sm); padding: 1rem 1.1rem; background: #fffefa; }
.admin-plan--new { border-style: dashed; background: #fbf5e8; }
.admin-plan__head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.admin-plan__head strong { font-family: var(--font-display); font-size: 1.15rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.admin-plan__head .chip { color: var(--muted); background: #f1e7d3; border-color: #e2d6bd; cursor: default; }
.admin-plan__slug { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); background: #efe6d2; padding: 0.1rem 0.4rem; border-radius: 5px; }
.admin-plan__count { font-size: 0.78rem; color: var(--muted); margin-left: auto; }
.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem 0.9rem; }
.admin-field { display: grid; gap: 0.25rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.admin-field--wide { grid-column: 1 / -1; }
.admin-field input { padding: 0.5rem 0.6rem; border: 1px solid #d6c6a6; border-radius: var(--radius-sm); font: inherit; font-weight: 400; color: var(--ink); background: #fffef9; }
.admin-field input:disabled { background: #f1e7d3; color: var(--muted); }
.admin-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.admin-flags { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin: 0.9rem 0 0.2rem; font-size: 0.85rem; }
.admin-plan__actions { display: flex; justify-content: flex-end; margin-top: 0.6rem; }
@media (max-width: 640px) { .admin-grid { grid-template-columns: 1fr; } }

/* ---- Trix editor — pulled out of the stock blue defaults into the warm theme ---- */
trix-toolbar .trix-button-group { border-color: #d8c7a4; background: #fffdf6; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--e1); }
trix-toolbar .trix-button { color: var(--muted); border-bottom: none; }
trix-toolbar .trix-button:not(:first-child) { border-left: 1px solid #ead9bb; }
trix-toolbar .trix-button.trix-active { background: var(--accent-soft); color: var(--accent-dark); }
trix-toolbar .trix-button--icon::before { opacity: 0.5; }
trix-toolbar .trix-button--icon.trix-active::before { opacity: 1; }
.compose__editor trix-editor:focus, .stack-form trix-editor:focus, .compose trix-editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.trix-content { line-height: 1.55; }
.trix-content h1 { font-family: var(--font-display); font-weight: 600; }
.trix-content a { color: var(--accent-dark); }
.trix-content pre { background: var(--paper-2); border-radius: 6px; }
.trix-content blockquote { border-left-color: var(--cork-dark); color: var(--muted); }

/* ====================================================================== *
 * Landing — the front door (/ for strangers, /welcome for anyone)         *
 * ====================================================================== */
.landing { display: grid; gap: 4.2rem; padding: 2.4rem 0 3rem; }

/* hero: the pitch, then a slip of paper to write your board's name on */
.landing-hero { text-align: center; max-width: 780px; margin: 0 auto; }
.landing-hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 0.9rem; color: var(--on-dark); }
.landing-hero__sub { color: var(--on-dark-dim); font-size: var(--fs-md); line-height: 1.6; max-width: 58ch; margin: 0 auto 1.8rem; }
.landing-create { display: flex; gap: 0.6rem; max-width: 780px; margin: 0 auto; }
.landing-create input[type="text"] {
  flex: 1; min-width: 0; font: inherit; padding: 0.75rem 1rem;
  border: 1px solid #d6c6a6; border-radius: var(--radius-sm);
  background: #fffef9; color: var(--ink); box-shadow: var(--e2);
}
.landing-create input[type="text"]::placeholder { color: var(--muted); }
.landing-create input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--e2); }
/* the one button that IS the product — raised off the page so it begs a press */
.landing-create__go {
  white-space: nowrap; padding: 0.75rem 1.5rem; font-size: 1.05rem;
  box-shadow: 0 6px 18px rgba(219, 59, 43, 0.45), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
.landing-create__go:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(219, 59, 43, 0.55), 0 1px 0 rgba(255, 255, 255, 0.25) inset; }
.landing-create__go:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(219, 59, 43, 0.4); }
.landing-hero__micro { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--on-dark-dim); margin: 0.7rem 0 0; }

/* every section: a serif heading over quiet dim prose. min-width:0 matters —
   grid items default to min-width:auto, and without it the 1080px demo board
   sets the whole page's minimum width, ballooning a phone's layout viewport. */
.landing-section { min-width: 0; }
.landing-section h2 { font-size: var(--fs-xl); color: var(--on-dark); margin: 0 0 0.5rem; }
.landing-lede { color: var(--on-dark-dim); max-width: 68ch; margin: 0 0 1.4rem; }

/* the embedded demo board — a real board, scaled into the page by embed_controller;
   below half size it stops shrinking and pans sideways instead */
.landing-demo__stage { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.landing-demo__stage .board-scaler { margin: 0 auto; }

/* how it works: three numbered cards */
.landing-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.2rem; }
.landing-step { background: var(--room-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.landing-step h3 { margin: 0 0 0.45rem; font-size: var(--fs-md); color: var(--on-dark); }
.landing-step p { margin: 0; color: var(--on-dark-dim); font-size: 0.95rem; }

/* use cases: four short cards, mono nameplates */
.landing-uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.landing-use { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; background: linear-gradient(180deg, var(--room-2), rgba(29, 24, 18, 0.35)); }
.landing-use h3 { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.09em; color: var(--accent); margin: 0 0 0.5rem; }
.landing-use p { margin: 0; color: var(--on-dark-dim); font-size: 0.95rem; }

/* the promise, the curator's deal, and the closing wander */
.landing-promise, .landing-earn, .landing-wander { text-align: center; max-width: 660px; margin: 0 auto; }
.landing-promise p, .landing-earn p, .landing-wander p { color: var(--on-dark-dim); }
.landing-earn a { font-family: var(--font-mono); font-size: var(--fs-sm); }
.landing-wander__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.3rem; }

/* the money, in one honest line */
.landing-cost { text-align: center; max-width: 640px; margin: 0 auto; }
.landing-cost p { color: var(--on-dark-dim); margin: 0 0 0.6rem; }
.landing-cost a { font-family: var(--font-mono); font-size: var(--fs-sm); }

/* the shelf: real public boards, plain and honest — app chrome, never cork */
.landing-shelf__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0.9rem; margin-top: 1.2rem; }
.shelf-card { display: block; background: var(--room-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; color: var(--on-dark); text-decoration: none; transition: transform 0.1s ease, border-color 0.12s ease; }
.shelf-card:hover { transform: translateY(-2px); border-color: rgba(219, 59, 43, 0.5); color: var(--on-dark); }
.shelf-card__name { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.shelf-card__place { display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--on-dark-dim); margin-top: 0.2rem; }
.shelf-card__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.8rem; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--on-dark-dim); margin-top: 0.6rem; }
.landing-shelf__more { margin: 1rem 0 0; font-family: var(--font-mono); font-size: var(--fs-sm); }

@media (max-width: 760px) {
  .landing { gap: 3rem; padding-top: 1.4rem; }
  .landing-create { flex-direction: column; }
  .landing-steps { grid-template-columns: 1fr; }
}

/* ====================================================================== *
 * Pricing — one paper notice from The Management, pinned to cork.        *
 * If this page ever grows a comparison grid, it has failed.              *
 * ====================================================================== */
.pricing-page { max-width: 720px; margin: 2rem auto 3rem; }
.pricing-board {
  background: linear-gradient(160deg, var(--cork), var(--cork-dark));
  border: 10px solid var(--frame); border-radius: var(--radius);
  padding: clamp(1.2rem, 5vw, 2.6rem); box-shadow: var(--e3);
}
.pricing-notice {
  position: relative; background: var(--paper); color: var(--ink);
  padding: 1.6rem 1.7rem 1.2rem; border-top: 4px solid var(--accent);
  box-shadow: 0 12px 26px var(--shadow-warm); transform: rotate(-0.6deg);
}
/* the one pin holding the notice up */
.pricing-notice::before {
  content: ""; position: absolute; top: -7px; left: 50%; margin-left: -7px;
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a74, var(--pin) 55%, #8f1d12);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}
.pricing-notice h1 {
  font-family: var(--font-mono); font-size: 0.9rem; letter-spacing: 0.05em;
  line-height: 1.5; margin: 0 0 1.1rem; color: var(--accent-dark);
}
.pricing-notice p { font-family: var(--font-display); font-size: 1.02rem; line-height: 1.62; margin: 0 0 0.95rem; }
.pricing-notice__soon {
  font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); border: 1px dashed rgba(0, 0, 0, 0.25); border-radius: 3px;
  padding: 0.1rem 0.35rem; white-space: nowrap; vertical-align: 0.12em;
}
.pricing-notice__sig { text-align: right; font-style: italic; margin-top: 1.1rem; }
.pricing-notice__ps {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); line-height: 1.6;
  border-top: 1px dashed rgba(0, 0, 0, 0.16); padding-top: 0.8rem; margin-bottom: 0;
}
.pricing-page__cta { text-align: center; margin: 1.6rem 0 0; }

/* ---- mobile ---- */
@media (max-width: 640px) {
  .board { border-width: 7px; }
  .main { padding: 0.7rem; }
  .appbar { padding: 0.45rem 0.7rem; gap: 0.5rem; }
  .appbar__crumbs { display: none; }
  .appbar__name { max-width: 9rem; font-size: 0.96rem; }
  .appbar__actions:not(:empty) { padding-right: 0.35rem; }
}
