/* Staplegun — app pages: /new, editor, public board + event pages, billing.
   Builds on base.css tokens (paper, ink, safety orange). */

/* ================= shared app chrome ================= */
[hidden] { display: none !important; }
.app-body { background: var(--paper); min-height: 100vh; }
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--rule);
}
.appbar-in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.appbar .brand { font-size: 23px; }
.appbar .brand svg { width: 28px; height: 28px; }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }

.steps { display: flex; align-items: center; gap: 10px; }
.steps-label { display: none; }
.steps-ticks { display: inline-flex; gap: 4px; }
.steps-ticks i { width: 22px; height: 5px; background: var(--paper-3); border-radius: 1px; transition: background-color 200ms ease; }
.steps-ticks i.on { background: var(--signal); }

.linkish {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit;
  text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 0.2em;
  font-weight: 600;
}
.linkish:hover { color: var(--signal); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--signal); flex: none; }
.fine { font-size: 13.5px; color: var(--ink-3); margin: 0; }
.hint { font-size: 13.5px; color: var(--ink-3); margin: 8px 0 0; }
.muted { color: var(--ink-3); }
.input-lg { font-size: 20px; min-height: 54px; font-weight: 600; }
.mono-input { font-family: var(--font-mono); font-size: 15px; }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row .input { flex: 1; min-width: 0; }
.input-row .btn { flex: none; }

.spinner {
  display: inline-block; width: 14px; height: 14px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: sg-spin 700ms linear infinite; vertical-align: -2px;
}
@keyframes sg-spin { to { transform: rotate(360deg); } }
.loading-line { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 15px; margin: 12px 0; }

.notice {
  border: 1px solid var(--rule); border-left: 4px solid var(--ink-3);
  background: var(--card); padding: 12px 14px; border-radius: var(--radius);
  font-size: 15px; line-height: 1.45; margin: 12px 0;
}
.notice b { display: block; margin-bottom: 2px; }
.notice-ok { border-left-color: var(--ok); }
.notice-warn { border-left-color: var(--warn); }
.notice-err { border-left-color: var(--danger); }
.notice-err b { color: var(--danger); }
.notice-signal { border-left-color: var(--signal); }

/* parse chips: how a title was read */
.pc {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; line-height: 1.3; padding: 2px 7px;
  border: 1px solid var(--rule); border-radius: 3px; background: var(--paper);
  font-family: var(--font-mono); letter-spacing: 0.01em; white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.pc-head {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 19px; letter-spacing: 0.01em;
  border: 0; background: none; padding: 0 4px 0 0; white-space: normal;
}
.pc-sup { font-family: var(--font-body); font-style: italic; font-size: 13.5px; border: 0; background: none; padding: 0 4px 0 0; white-space: normal; }
.pc-kind { background: var(--ink); color: var(--paper); border-color: var(--ink); text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
.pc-price, .pc-age { border-color: var(--rule-strong); }
.pc-flag { background: var(--signal); border-color: var(--signal); color: #fff; text-transform: uppercase; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; }

/* preview lists (new page + editor) */
.pv-list { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.pv-row {
  display: grid; grid-template-columns: 92px 58px minmax(0, 1fr); gap: 4px 10px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule);
}
.pv-date { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }
.pv-date b { color: var(--signal); font-weight: 600; }
.pv-time { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; min-width: 0; }
@media (max-width: 520px) {
  .pv-row { grid-template-columns: auto 1fr; }
  .pv-chips { grid-column: 1 / -1; }
}
.found-h { font-size: 17px; margin: 14px 0 0; display: flex; gap: 8px; align-items: center; }
.ok-dot {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ok); color: #fff; font-size: 13px; font-weight: 700; flex: none;
}
.skipped { margin-top: 12px; font-size: 14px; }
.skipped-h { margin: 0 0 4px; font-weight: 600; color: var(--warn); }
.skipped ul { margin: 0; padding-left: 18px; }
.skipped li { margin: 3px 0; overflow-wrap: anywhere; }

/* ================= /new ================= */
.new-shell {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px;
  padding-top: clamp(20px, 5vw, 48px); padding-bottom: 96px;
}
@media (min-width: 960px) {
  .new-shell { grid-template-columns: minmax(0, 620px) minmax(0, 400px); justify-content: space-between; }
}
.step { animation: sg-in 260ms ease both; }
@keyframes sg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.step-kicker { margin: 0 0 10px; color: var(--signal); }
.new-h {
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(46px, 12vw, 88px); line-height: 0.86; letter-spacing: -0.005em; margin: 0 0 12px;
}
.new-h:focus { outline: none; }
.new-sub { font-size: 18px; color: var(--ink-2); margin: 0 0 24px; max-width: 34em; }
.back {
  background: none; border: 0; padding: 6px 0; margin: 0 0 14px; cursor: pointer;
  font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3);
}
.back:hover { color: var(--ink); }

.choice-list { display: grid; gap: 12px; }
.choice {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; cursor: pointer;
  padding: 14px 16px; background: var(--card); color: var(--ink);
  border: 2px solid var(--rule-strong); border-radius: var(--radius);
  transition: transform 80ms ease, box-shadow 80ms ease, border-color 120ms ease;
}
.choice:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--signal); }
.choice:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--signal); }
.choice[aria-pressed='true'] { border-color: var(--signal); box-shadow: 4px 4px 0 var(--signal); }
.choice-ico {
  flex: none; display: grid; place-items: center; width: 54px; height: 54px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink);
}
.choice:hover .choice-ico, .choice[aria-pressed='true'] .choice-ico { color: var(--signal); }
.choice-text { display: grid; gap: 2px; min-width: 0; }
.choice-t { font-family: var(--font-display); font-weight: 800; font-size: 25px; line-height: 1; text-transform: uppercase; letter-spacing: 0.01em; }
.choice-s { font-size: 14.5px; color: var(--ink-2); line-height: 1.35; }
.choice-go { margin-left: auto; font-size: 22px; color: var(--ink-3); flex: none; }
.choice:hover .choice-go { color: var(--signal); }

.src-list { display: grid; gap: 12px; }
.src { border: 2px solid var(--rule-strong); border-radius: var(--radius); background: var(--card); transition: border-color 120ms ease, box-shadow 120ms ease; }
.src.is-open { border-color: var(--signal); box-shadow: 4px 4px 0 var(--signal); }
.src-btn {
  display: grid; gap: 2px; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 0; color: inherit; padding: 16px 48px 16px 18px; position: relative;
}
.src-btn::after {
  content: '＋'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--ink-3); transition: transform 150ms ease;
}
.src-btn[aria-expanded='true']::after { content: '－'; color: var(--signal); }
#src-empty::after { content: '→'; }
.src-btn:hover .src-t { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; }
.src-t { font-family: var(--font-display); font-weight: 800; font-size: 24px; text-transform: uppercase; line-height: 1.05; }
.src-s { font-size: 14.5px; color: var(--ink-2); }
.src-panel { padding: 4px 18px 18px; border-top: 1px dashed var(--rule); }
.src-panel .field { margin-top: 14px; }
.src-panel .check { margin: 12px 0; }
.sample-line { margin: 12px 0 0; font-size: 15px; }
.result:empty { display: none; }
.help { margin-top: 16px; border-top: 1px solid var(--rule); padding-top: 12px; }
.help summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help summary::before { content: '▸ '; color: var(--signal); }
.help[open] summary::before { content: '▾ '; }
.help-list { margin: 10px 0 0; font-size: 14.5px; line-height: 1.5; }
.help-list dt { font-weight: 700; margin-top: 10px; }
.help-list dd { margin: 2px 0 0; color: var(--ink-2); }
.step-foot { margin-top: 18px; }
.recap { font-size: 16px; }
#recap b { font-weight: 700; }
#recap .linkish { font-size: 15px; margin-left: 4px; }
@media (max-width: 560px) {
  .banner h2 { font-size: 24px; }
  .banner p { font-size: 14.5px; }
}
@media (max-width: 560px) {
  .btn-block-sm, .step-foot .btn { width: 100%; }
  .choice-t { font-size: 22px; }
  .choice-ico { width: 46px; height: 46px; }
  .choice { padding: 12px; gap: 12px; }
  .input-row { flex-wrap: wrap; }
  .input-row .btn { width: 100%; }
}

.new-side { display: none; }
@media (min-width: 960px) {
  .new-side { display: block; position: sticky; top: 96px; align-self: start; padding-top: 24px; }
  .new-side-poster { max-width: 360px; margin: 0 auto; }
  .new-side-cap { text-align: center; margin-top: 22px; }
}

/* ================= editor ================= */
.ed-top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--rule);
}
.ed-top-in { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.ed-top .brand span { display: none; }
.ed-top .brand svg { width: 28px; height: 28px; }
.ed-title { display: grid; min-width: 0; line-height: 1.1; }
.ed-title .label { font-size: 10.5px; }
.ed-title strong {
  font-family: var(--font-display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ed-top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.save-status {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.save-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-status[data-state='saving']::before { background: var(--warn); animation: sg-pulse 900ms ease infinite; }
.save-status[data-state='error'] { color: var(--danger); }
.save-status[data-state='error']::before { background: var(--danger); }
@keyframes sg-pulse { 50% { opacity: 0.3; } }
.pro-pill {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); padding: 3px 7px; border-radius: 2px;
}
@media (max-width: 640px) {
  .ed-top-actions .hide-sm { display: none; }
  .save-status .save-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

.boards-menu { position: relative; }
.boards-menu > summary { list-style: none; cursor: pointer; }
.boards-menu > summary::-webkit-details-marker { display: none; }
.boards-menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: min(300px, 86vw);
  background: var(--card); border: 2px solid var(--rule-strong); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px; display: grid; gap: 2px;
}
.boards-menu-pop a { display: block; padding: 9px 10px; border-radius: 3px; text-decoration: none; font-weight: 600; font-size: 15px; }
.boards-menu-pop a:hover { background: var(--paper-2); }
.boards-menu-pop a small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.boards-menu-pop hr { border: 0; border-top: 1px solid var(--rule); margin: 4px 0; }

.ed-jump {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 10px var(--gutter);
  border-bottom: 1px solid var(--rule); background: var(--paper);
}
.ed-jump::-webkit-scrollbar { display: none; }
.ed-jump a {
  flex: none; text-decoration: none; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 6px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-2); background: var(--card);
}
.ed-jump a:hover { border-color: var(--rule-strong); color: var(--ink); }
@media (min-width: 1000px) { .ed-jump { display: none; } }

.banner {
  margin: 18px 0 0; padding: 16px 18px; border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--highlight); color: #15130f; box-shadow: 4px 4px 0 var(--ink);
  display: grid; gap: 10px;
}
.banner h2 { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: 28px; line-height: 0.95; }
.banner p { margin: 0; font-size: 15.5px; }
.banner .row { gap: 8px; }
.banner .btn { --b-bg: #15130f; --b-fg: #fff; box-shadow: none; }
.banner .btn-ghost { --b-fg: #15130f; border-color: #15130f; background: transparent; }
.banner .btn-ghost:hover { background: rgba(0, 0, 0, 0.06); }
.banner-key { font-family: var(--font-mono); font-size: 12.5px; background: rgba(255, 255, 255, 0.55); padding: 6px 8px; border-radius: 3px; overflow-wrap: anywhere; }
.banner-ok { background: var(--card); color: var(--ink); border-color: var(--ok); box-shadow: 4px 4px 0 var(--ok); }
.banner-ok .btn { --b-bg: var(--ink); --b-fg: var(--paper); }

.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; padding-bottom: 80px; }
@media (min-width: 1000px) {
  .ed-grid { grid-template-columns: minmax(0, 1fr) minmax(400px, 490px); gap: 32px; align-items: start; padding-top: 28px; }
  .ed-preview { grid-column: 2; grid-row: 1; position: sticky; top: 76px; }
  .ed-main { grid-column: 1; grid-row: 1; }
}
.ed-main { display: grid; gap: 20px; min-width: 0; }

.panel {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: clamp(16px, 3.4vw, 28px); box-shadow: 0 1px 0 rgba(21, 19, 15, 0.04); scroll-margin-top: 80px; min-width: 0;
}
.panel-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 6px; }
.panel-h .num { font-family: var(--font-mono); font-size: 13px; color: var(--signal); font-weight: 600; }
.panel-h h2 { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: clamp(30px, 5vw, 40px); line-height: 0.9; }
.panel-lede { color: var(--ink-2); font-size: 15.5px; margin: 0 0 18px; }
.sub-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin: 0 0 8px; }
.sub-h .tag { font-size: 10.5px; padding: 1px 6px; }
.subsection { border-top: 1px solid var(--rule); padding-top: 18px; margin-top: 22px; }

/* preview column */
.ed-preview {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 14px; min-width: 0;
  scroll-margin-top: 70px;
}
.pv-controls { display: grid; gap: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 5px 4px; }
.tab {
  flex: none; cursor: pointer; border: 1px solid var(--rule); background: var(--paper); color: var(--ink-2);
  padding: 7px 10px; border-radius: 999px; font-size: 13.5px; font-weight: 600; line-height: 1.1; white-space: nowrap;
}
.tab:hover { border-color: var(--rule-strong); color: var(--ink); }
.tab[aria-selected='true'], .tab[aria-pressed='true'] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tabs-sm .tab { font-size: 12.5px; padding: 5px 9px; font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.02em; }
.pv-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 30px; }
.pv-sub .select { min-height: 32px; padding: 3px 8px; font-size: 14px; width: auto; border-width: 1px; }
.pv-sub .check { font-size: 13.5px; align-items: center; }
.pv-sub .check input { width: 17px; height: 17px; margin: 0; }

.pv-stage {
  position: relative; display: grid; place-items: center; margin: 12px -14px 0; padding: 26px 14px 22px;
  background:
    radial-gradient(circle at 20% 10%, rgba(0,0,0,0.035) 0 1px, transparent 1.5px) 0 0 / 14px 14px,
    var(--paper-2);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-height: 280px;
}
.pv-figure { margin: 0; width: fit-content; max-width: 100%; transition: opacity 160ms ease; }
.pv-figure img { max-height: min(62vh, 640px); width: auto; max-width: 100%; background: #111; }
@media (min-width: 1000px) { .pv-figure img { max-height: calc(100vh - 330px); min-height: 220px; } }
.pv-stage.is-loading .pv-figure { opacity: 0.45; }
.pv-loading {
  position: absolute; top: 12px; right: 14px; display: none; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); background: var(--card); padding: 4px 8px; border-radius: 3px; border: 1px solid var(--rule);
}
.pv-stage.is-loading .pv-loading { display: inline-flex; }
.pv-error { text-align: center; max-width: 30em; }
.pv-pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-family: var(--font-mono); font-size: 13px; }
.pv-pager button {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--rule-strong); background: var(--card); cursor: pointer; font-size: 16px; line-height: 1;
}
.pv-pager button:disabled { opacity: 0.35; cursor: default; }
.pv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pv-actions .btn { flex: 1 1 auto; }
.pv-note { font-size: 13.5px; color: var(--ink-2); margin: 10px 0 0; line-height: 1.45; }
.pv-note code { font-size: 12px; }
.pv-caption { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 12px; }
.pv-caption summary { cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 8px; }
.pv-caption summary::-webkit-details-marker { display: none; }
.pv-caption summary::before { content: '▸'; color: var(--signal); }
.pv-caption[open] summary::before { content: '▾'; }
.pv-caption textarea { margin-top: 10px; min-height: 150px; font-size: 13px; }
.pv-caption .row { margin-top: 8px; }
.pv-imprint { font-size: 13px; color: var(--ink-3); margin: 12px 0 0; }

/* look */
.tpl-grid {
  display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding: 4px 4px 10px; margin: 0 -4px;
}
@media (min-width: 700px) { .tpl-grid { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; } }
.tpl {
  scroll-snap-align: start; display: grid; gap: 6px; align-content: start; text-align: left; cursor: pointer; padding: 0;
  background: none; border: 0; color: inherit; min-width: 0;
}
.tpl-thumb {
  position: relative; aspect-ratio: 4 / 5; background: #1b1916; border-radius: 3px; overflow: hidden;
  outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 120ms ease, transform 120ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tpl:hover .tpl-thumb { transform: translateY(-2px); }
.tpl[aria-pressed='true'] .tpl-thumb { outline-color: var(--signal); outline-width: 3px; }
.tpl[aria-pressed='true'] .tpl-thumb::after {
  content: '✓'; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--signal); color: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.tpl-name { font-weight: 700; font-size: 14.5px; line-height: 1.15; }
.tpl-for { font-size: 12px; color: var(--ink-3); line-height: 1.3; max-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.pal-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pal {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 12px 5px 5px;
  border: 2px solid var(--rule); border-radius: 999px; background: var(--paper); font-size: 14px; font-weight: 600; color: var(--ink);
}
.pal:hover { border-color: var(--rule-strong); }
.pal[aria-pressed='true'] { border-color: var(--signal); background: var(--signal-soft); }
.pal-sw { width: 28px; height: 28px; border-radius: 50%; position: relative; overflow: hidden; border: 1px solid rgba(0,0,0,.25); flex: none; }
.pal-sw i { position: absolute; inset: 0; }
.pal-sw i:nth-child(2) { inset: 50% 0 0 50%; }
.pal-sw i:nth-child(3) { inset: 0 50% 50% 0; }

.pro-note { font-size: 13.5px; color: var(--ink-2); background: var(--paper); border: 1px dashed var(--rule-strong); border-radius: var(--radius); padding: 8px 10px; margin: 10px 0 0; }
.pro-note a { font-weight: 600; }
.colors { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.color-field { display: grid; gap: 4px; font-size: 13.5px; font-weight: 600; }
.color-field input[type='color'] { width: 64px; height: 44px; padding: 3px; border: 2px solid var(--rule-strong); border-radius: var(--radius); background: var(--card); cursor: pointer; }
.logo-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-box {
  width: 120px; height: 72px; border: 2px dashed var(--rule-strong); border-radius: var(--radius); display: grid; place-items: center;
  background: repeating-conic-gradient(var(--paper-2) 0 25%, var(--card) 0 50%) 0 0 / 14px 14px; overflow: hidden; flex: none;
}
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-box span { font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* details form */
.form-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.seg { display: inline-flex; border: 2px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; background: var(--card); width: fit-content; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 9px 14px; font-weight: 600; font-size: 15px; min-width: 56px; text-align: center; }
.seg label + label span { border-left: 1px solid var(--rule); }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: -4px; }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.field .check { font-weight: 500; }
.field-err { color: var(--danger); font-size: 13.5px; }
.field-err:empty { display: none; }

/* dates */
.cal-card { border: 2px solid var(--rule-strong); border-radius: var(--radius); padding: 14px 16px; background: var(--paper); }
.cal-url { font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; margin: 4px 0 8px; color: var(--ink-2); }
.cal-status { display: flex; gap: 8px; align-items: baseline; font-size: 14.5px; margin: 0 0 12px; }
.cal-status.ok::before { content: '●'; color: var(--ok); font-size: 12px; }
.cal-status.err { color: var(--danger); }
.cal-status.err::before { content: '●'; font-size: 12px; }
.syntax {
  margin: 16px 0; padding: 12px 14px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--rule); font-size: 14px;
}
.syntax summary { cursor: pointer; font-weight: 700; list-style: none; }
.syntax summary::-webkit-details-marker { display: none; }
.syntax summary::before { content: '▸ '; color: var(--signal); }
.syntax[open] summary::before { content: '▾ '; }
.syntax ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.syntax code { font-size: 12.5px; }
.syntax li span { color: var(--ink-3); }

.ev-list { list-style: none; margin: 0; padding: 0; }
.ev-night { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.ev-night:first-child { border-top: 2px solid var(--rule-strong); }
.ev-date { font-family: var(--font-mono); font-size: 12px; line-height: 1.15; text-transform: uppercase; }
.ev-date b { display: block; font-family: var(--font-display); font-weight: 900; font-size: 30px; line-height: 0.95; }
.ev-date .dow { color: var(--signal); font-weight: 600; }
.ev-items { display: grid; gap: 10px; min-width: 0; }
.ev-item { min-width: 0; }
.ev-item .pv-chips { margin-top: 2px; }
.ev-raw { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-top: 3px; overflow-wrap: anywhere; }
.ev-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.ev-item.is-cancelled .pc-head { text-decoration: line-through; text-decoration-color: var(--signal); }
.ev-empty { padding: 22px 16px; text-align: center; color: var(--ink-2); border: 2px dashed var(--rule); border-radius: var(--radius); }
.ev-more { margin-top: 10px; }

.mrows { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.mrow {
  border: 1px solid var(--rule); border-left: 4px solid var(--ink); border-radius: var(--radius); padding: 10px 12px; background: var(--paper);
  display: grid; gap: 8px; animation: sg-in 220ms ease both;
}
.mrow.is-past { opacity: 0.6; border-left-color: var(--ink-3); }
.mrow-top { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 130px) 1fr 40px; gap: 8px; align-items: center; }
.mrow-top .input { width: 100%; min-width: 0; min-height: 40px; padding: 6px 8px; font-size: 15px; }
.mrow-del {
  grid-column: 4; width: 40px; height: 40px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--card);
  cursor: pointer; font-size: 18px; color: var(--ink-3);
}
@media (max-width: 560px) {
  .mrow { padding: 10px; }
  .mrow-top { grid-template-columns: minmax(0, 1fr) minmax(0, 112px) 38px; gap: 6px; }
  .mrow-top .input { padding: 6px 6px; font-size: 14.5px; }
  .mrow-del { grid-column: 3; width: 38px; }
  .tabs-sm .tab { font-size: 12px; padding: 5px 8px; }
}
.mrow-del:hover { color: var(--danger); border-color: var(--danger); }
.mrow .input-title { font-weight: 600; }
.mrow .input-url { font-family: var(--font-mono); font-size: 13.5px; min-height: 38px; padding: 6px 8px; }
.mrow-parse { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; min-height: 22px; font-size: 13px; }
.mrow-foot { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.mrow-foot .mrow-parse { flex: 1; min-width: 0; }
.mrow-addurl { flex: none; background: none; border: 0; padding: 2px 0; cursor: pointer; font-size: 13px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--signal); text-underline-offset: 3px; }
.mrow-addurl:hover { color: var(--ink); }
.mrow-parse .label { font-size: 10.5px; margin-right: 2px; }
.dates-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.paste-box { margin-top: 14px; padding: 14px; border: 2px solid var(--signal); border-radius: var(--radius); background: var(--paper); }
.past-box { margin-top: 14px; font-size: 14.5px; }
.past-box summary { cursor: pointer; color: var(--ink-2); }

/* share */
.share-hero { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 16px; border: 2px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); }
.share-hero a.url { font-family: var(--font-mono); font-size: 14px; overflow-wrap: anywhere; font-weight: 500; }
.copy-list { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.copy-row .k { font-weight: 600; font-size: 14.5px; }
.copy-row .k small { font-weight: 400; color: var(--ink-3); }
.copy-row .v { grid-column: 1; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-row .btn { grid-column: 2; grid-row: 1 / span 2; }
.code { font-family: var(--font-mono); font-size: 12.5px; min-height: 84px; }
.embed-opts { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; margin: 12px 0; }
.embed-opts .field > label, .embed-opts .field > span { font-size: 13px; }
.embed-opts .select { min-height: 40px; padding: 6px 8px; width: auto; }
.embed-opts input[type='color'] { width: 52px; height: 40px; padding: 2px; border: 2px solid var(--rule-strong); border-radius: var(--radius); background: var(--card); }
.embed-preview { margin-top: 14px; border: 1px dashed var(--rule-strong); border-radius: var(--radius); padding: 16px; background: var(--paper); }
.embed-preview.dark-bg { background: #17150f; color: #efe8da; }
.embed-preview .label { display: block; margin-bottom: 8px; }
.stuff-grid { display: grid; gap: 22px; }

/* pro */
.pro-card {
  border: 2px solid var(--ink); border-radius: var(--radius); padding: 20px; background: var(--paper);
  box-shadow: 6px 6px 0 var(--signal); display: grid; gap: 12px;
}
.pro-card h3 { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: clamp(30px, 5vw, 42px); line-height: 0.9; }
.pro-card p { margin: 0; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15.5px; }
.checks li { display: flex; gap: 10px; }
.checks li::before { content: '✓'; color: var(--signal); font-weight: 800; }
.price-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.price-row .btn { flex: 1 1 180px; flex-direction: column; gap: 2px; min-height: 64px; }
.price-row .btn small { font-weight: 500; font-size: 12.5px; opacity: 0.85; }
.pro-card.is-pro { box-shadow: 6px 6px 0 var(--ok); }
.pro-badge { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 900; font-size: 34px; text-transform: uppercase; line-height: 1; }
.pro-badge i { font-style: normal; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 17px; }

/* danger */
.panel-danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.panel-danger .panel-h .num { color: var(--danger); }
.danger-item { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--rule); }
.danger-item:first-of-type { border-top: 0; padding-top: 4px; }
.danger-item h3 { font-size: 17px; font-weight: 700; }
.danger-item p { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.btn-danger { --b-bg: var(--danger); --b-fg: #fff; box-shadow: 3px 3px 0 var(--ink); }
.btn-danger-ghost { --b-bg: transparent; --b-fg: var(--danger); border-color: var(--danger); box-shadow: none; }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); box-shadow: none; transform: none; }
.confirm-box { display: grid; gap: 8px; margin-top: 8px; padding: 12px; border: 2px solid var(--danger); border-radius: var(--radius); background: var(--paper); }
.danger-item details > summary { list-style: none; width: fit-content; }
.danger-item details > summary::-webkit-details-marker { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); z-index: 90; opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius); font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow); transition: opacity 180ms ease, transform 180ms ease; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); color: #fff; }

/* ================= error / small centered pages ================= */
.center-page { padding-top: clamp(40px, 10vw, 110px); padding-bottom: 80px; }
.center-card { max-width: 620px; }
.center-card .h2 { margin-bottom: 18px; }
.center-card ul { padding-left: 20px; color: var(--ink-2); }
.center-card li { margin: 4px 0; }
.big-check {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff;
  font-size: 34px; font-weight: 800; margin-bottom: 20px; box-shadow: 4px 4px 0 var(--ink);
}

/* ================= public board + event pages ================= */
.pb-body {
  background: var(--pg-bg); color: var(--pg-ink);
  --paper: var(--pg-bg); --ink: var(--pg-ink); --card: var(--pg-card); --rule: var(--pg-rule); --rule-strong: var(--pg-ink);
  --ink-2: var(--pg-ink2); --ink-3: var(--pg-muted); --signal: var(--pg-accent);
  color-scheme: var(--pg-scheme, light);
}
.pb-body ::selection { background: var(--pg-accent); color: var(--pg-on-accent); }
.pb-display {
  font-family: var(--pg-font, var(--font-display)); font-weight: var(--pg-weight, 900); font-style: var(--pg-style, normal);
  text-transform: var(--pg-case, uppercase); letter-spacing: var(--pg-track, -0.005em);
}
.pb-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.pb-head { padding: clamp(28px, 7vw, 72px) 0 clamp(18px, 3vw, 28px); }
.pb-logo { max-height: 84px; max-width: 220px; width: auto; margin-bottom: 18px; }
.pb-kicker { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pg-accent-text); margin: 0 0 10px; }
.pb-name { font-size: clamp(54px, 14vw, 140px); line-height: 0.84; margin: 0; overflow-wrap: anywhere; }
.pb-tagline { font-size: clamp(18px, 2.4vw, 22px); margin: 16px 0 0; color: var(--pg-ink2); max-width: 36em; }
.pb-foot-line { font-family: var(--font-mono); font-size: 13px; color: var(--pg-muted); margin: 10px 0 0; overflow-wrap: anywhere; }
.pb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.pb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0.6em 1.1em;
  border-radius: var(--radius); font-weight: 700; font-size: 15.5px; text-decoration: none; cursor: pointer; line-height: 1.1;
  background: var(--pg-accent); color: var(--pg-on-accent); border: 2px solid var(--pg-accent);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.pb-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--pg-ink); }
.pb-btn:active { transform: translate(1px, 1px); box-shadow: none; }
.pb-btn-ghost { background: transparent; color: var(--pg-ink); border-color: var(--pg-rule-strong); }
.pb-btn-ghost:hover { box-shadow: 3px 3px 0 var(--pg-accent); }
.pb-btn-sm { min-height: 36px; font-size: 14px; padding: 0.4em 0.8em; }
.pb-btn svg { width: 18px; height: 18px; flex: none; }

.pb-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-bottom: 60px; }
@media (min-width: 900px) {
  .pb-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 56px; align-items: start; }
  .pb-poster-col { position: sticky; top: 28px; }
}
.pb-rule { border: 0; border-top: 3px solid var(--pg-ink); margin: 0; }
.pb-section-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 4px; }
.pb-section-h h2 { font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pg-muted); }
.pb-list { list-style: none; margin: 0; padding: 0; }
.pb-night { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--pg-rule); }
.pb-date { text-align: left; line-height: 1; padding-top: 3px; }
.pb-date .dow { display: block; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pg-accent-text); }
.pb-date .d { display: block; font-family: var(--font-display); font-weight: 900; font-size: 46px; line-height: 0.9; margin: 3px 0 2px; }
.pb-date .m { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pg-muted); }
.pb-date .rel { display: inline-block; margin-top: 7px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; background: var(--pg-accent); color: var(--pg-on-accent); padding: 2px 5px; border-radius: 2px; }
.pb-evs { display: grid; gap: 18px; min-width: 0; }
.pb-ev { display: grid; gap: 4px; min-width: 0; }
.pb-kick { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pg-accent-text); }
.pb-head-line { font-size: clamp(28px, 6vw, 40px); line-height: 0.92; margin: 0; overflow-wrap: anywhere; }
.pb-head-line a { text-decoration: none; }
.pb-head-line a:hover { text-decoration: underline; text-decoration-color: var(--pg-accent); text-decoration-thickness: 3px; }
.pb-sup { font-size: 16.5px; color: var(--pg-ink2); margin: 2px 0 0; }
.pb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-family: var(--font-mono); font-size: 13.5px; color: var(--pg-ink2); margin-top: 4px; }
.pb-meta .dot { color: var(--pg-muted); }
.pb-stamp {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  border: 2px solid currentColor; padding: 1px 6px; border-radius: 2px; transform: rotate(-2deg); display: inline-block;
}
.pb-stamp-sold { color: var(--pg-accent-text); }
.pb-ev.is-cancelled .pb-head-line { text-decoration: line-through; text-decoration-color: var(--pg-accent); text-decoration-thickness: 3px; opacity: 0.6; }
.pb-ev-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pb-empty { padding: 36px 0; font-size: 18px; color: var(--pg-ink2); }
.pb-empty strong { display: block; font-family: var(--font-display); font-size: 34px; text-transform: uppercase; color: var(--pg-ink); margin-bottom: 6px; line-height: 1; }
.pb-poster { max-width: 400px; margin: 0 auto; }
.pb-poster-cap { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pg-muted); text-align: center; margin: 20px 0 0; }
.pb-poster-cap a { color: inherit; }
.pb-attrib { border-top: 1px solid var(--pg-rule); padding: 22px 0 40px; font-size: 14px; color: var(--pg-muted); display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; }
.pb-attrib a { color: var(--pg-ink); font-weight: 600; text-decoration-color: var(--pg-accent); }
.pb-attrib .staple-mini { display: inline-flex; align-items: center; gap: 8px; }
.pb-owner {
  position: fixed; right: 16px; bottom: 16px; z-index: 30; display: none;
  background: #15130f; color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 999px;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.6);
}
.pb-owner.show { display: inline-flex; align-items: center; gap: 8px; }
.pb-owner::before { content: '✎'; }

/* single event */
.ev-back { display: inline-block; margin-top: 22px; font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none; color: var(--pg-ink2); }
.ev-back:hover { color: var(--pg-accent-text); }
.ev-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'main' 'poster' 'more'; gap: 36px; padding: 18px 0 60px; }
.ev-main { grid-area: main; min-width: 0; }
.ev-grid .pb-poster-col { grid-area: poster; }
.ev-more-area { grid-area: more; min-width: 0; }
@media (min-width: 900px) {
  .ev-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); grid-template-areas: 'main poster' 'more poster'; grid-template-rows: auto 1fr; gap: 0 56px; align-items: start; }
  .ev-grid .pb-poster-col { position: sticky; top: 28px; }
}
.ev-when { font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pg-accent-text); margin: 0 0 12px; }
.ev-title { font-size: clamp(52px, 12vw, 120px); line-height: 0.86; margin: 0; overflow-wrap: anywhere; }
.ev-sub { font-size: clamp(19px, 2.6vw, 24px); color: var(--pg-ink2); margin: 14px 0 0; }
.ev-flags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.ev-facts { display: grid; grid-template-columns: minmax(0, 1fr); margin: 26px 0 0; border-top: 3px solid var(--pg-ink); }
@media (min-width: 560px) { .ev-facts { grid-template-columns: 1fr 1fr; } }
.ev-fact { padding: 12px 0; border-bottom: 1px solid var(--pg-rule); }
@media (min-width: 560px) { .ev-fact:nth-child(odd) { padding-right: 16px; } }
.ev-fact dt { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pg-muted); }
.ev-fact dd { margin: 3px 0 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.ev-desc { margin-top: 24px; white-space: pre-line; font-size: 16.5px; color: var(--pg-ink2); max-width: 40em; }
.ev-cal { position: relative; }
.ev-cal > summary { list-style: none; }
.ev-cal > summary::-webkit-details-marker { display: none; }
.ev-cal-pop {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; min-width: 250px; white-space: nowrap; display: grid;
  background: var(--pg-card); border: 2px solid var(--pg-ink); border-radius: var(--radius); padding: 6px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.45);
}
.ev-cal-pop a { padding: 9px 10px; text-decoration: none; font-weight: 600; border-radius: 3px; }
.ev-cal-pop a:hover { background: var(--pg-rule); }
.ev-past { margin-top: 18px; }
.ev-more { margin-top: 8px; }
@media (min-width: 900px) { .ev-more { margin-top: 44px; } }
.ev-more h2 { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pg-muted); margin-bottom: 4px; }

/* ================= billing pages ================= */
.bill-card { max-width: 560px; }
.bill-card .lede { margin: 12px 0 24px; }
.bill-status { min-height: 24px; }

/* brighter danger red on dark paper (contrast) */
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --danger: #ff6b5b; } }
:root[data-theme='dark'] { --danger: #ff6b5b; }
.bill-status:empty { display: none; }
