/* Keiji Board — shared web design system (calm Dojominder brand: restraint, no bloat).
   Matches the Compose app's KeijiTheme tokens exactly so web and app feel like one product. */

:root {
  --bg: #F4F1EA;          /* warm washi paper */
  --surface: #FFFFFF;
  --surface-alt: #ECE7DC;
  --ink: #1E2A32;
  --ink-muted: #667079;
  --accent: #2C3E50;      /* sumi slate */
  --accent-ink: #FFFFFF;
  --line: #E2DCCF;
  --ok: #3E7A5E;          /* reachable */
  --warn: #B8863B;        /* uncertain */
  --danger: #A6473C;
  --radius: 12px;
  --gap: 16px;
  --maxw: 34rem;
  --shadow: 0 1px 2px rgba(30,42,50,.06), 0 2px 8px rgba(30,42,50,.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: var(--gap); }

/* App bar */
.appbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.appbar .wrap { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.appbar h1 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: .2px; }
.appbar .spacer { flex: 1; }
.brandmark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-block; }

h1.display { font-size: 22px; font-weight: 600; margin: .2rem 0 .1rem; }
p.lede { color: var(--ink-muted); margin: .2rem 0 1rem; }
.muted { color: var(--ink-muted); }
.small { font-size: 13px; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--gap); margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.card .meta { color: var(--ink-muted); font-size: 13px; }
.post-body { white-space: pre-wrap; margin: 6px 0 0; }
.post img { max-width: 100%; border-radius: 8px; margin-top: 8px; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-alt); color: var(--ink-muted);
}
.badge.urgent { background: #F3E0DC; color: var(--danger); }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
input[type=text], input[type=email], textarea, select {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 6.5rem; resize: vertical; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0;
  border-radius: var(--radius); padding: 12px 18px; width: 100%;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--surface); color: var(--danger); border: 1px solid var(--line); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* Reach — three honest buckets */
.reach { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  padding: 6px 10px; border-radius: 999px; background: var(--surface-alt); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.pill.ok .dot { background: var(--ok); } .pill.ok { color: var(--ok); }
.pill.warn .dot { background: var(--warn); } .pill.warn { color: var(--warn); }
.pill.no .dot { background: var(--ink-muted); }
.reach-note { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

/* Segmented control (age gate, channel, audience) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { font: inherit; border: 0; background: var(--surface); color: var(--ink); padding: 10px 14px; cursor: pointer; }
.seg button.active { background: var(--accent); color: var(--accent-ink); }

/* Bottom nav */
.nav { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); }
.nav .wrap { display: flex; padding: 6px; gap: 4px; }
.nav button { flex: 1; border: 0; background: transparent; color: var(--ink-muted);
  font: inherit; font-size: 12px; padding: 8px 4px; border-radius: 10px; cursor: pointer; }
.nav button.active { color: var(--accent); background: var(--surface-alt); font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px;
  opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90%; }
.toast.show { opacity: .96; }
.hidden { display: none !important; }
.center { text-align: center; }
.stack > * + * { margin-top: 10px; }

/* Dojo profile (read-only render: join preview + board "dojo info"; editor rows in Settings) */
.profile-section { margin-top: 8px; }
.profile-section h4 { margin: 0 0 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-muted); }
details.card summary { cursor: pointer; font-weight: 600; font-size: 16px; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: " ▾"; color: var(--ink-muted); font-weight: 400; }
details.card[open] summary::after { content: " ▴"; }

/* ---- Home / landing (Dojominder cue: quiet, centered, whitespace, kanji motif) ---- */
.serif { font-family: "Hiragino Mincho ProN", "Yu Mincho", "Songti SC", Georgia, "Times New Roman", serif; }
.hero { text-align: center; padding: 12vh 0 6vh; }
.hero .kanji { font-size: clamp(72px, 22vw, 140px); line-height: 1; color: var(--ink); opacity: .9; letter-spacing: .05em; }
.hero .wordmark { font-size: 28px; font-weight: 600; margin: 18px 0 6px; letter-spacing: .3px; }
.hero .coming {
  display: inline-block; margin: 14px 0 0;
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}
.hero .tagline { color: var(--ink-muted); font-size: 17px; margin: 10px auto 0; max-width: 24rem; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.hero .cta .btn { width: auto; padding: 12px 22px; }
.hero .expect { color: var(--ink-muted); font-size: 13px; margin: 12px 0 0; }
.hero .quiet { margin: 22px 0 0; }
.hero .quiet button {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--ink-muted);
  text-decoration: underline; text-underline-offset: 3px;
}

.features { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 4vh 0; }
@media (min-width: 620px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { text-align: center; padding: 8px; }
.feature .glyph { font-size: 34px; color: var(--accent); opacity: .85; }
.feature h4 { margin: 8px 0 4px; font-size: 16px; }
.feature p { margin: 0; color: var(--ink-muted); font-size: 14px; }

.sitefoot { text-align: center; color: var(--ink-muted); font-size: 13px; padding: 6vh 0 4vh; border-top: 1px solid var(--line); margin-top: 4vh; }
.sitefoot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.sitefoot .siblings { margin-top: 6px; }

/* Roster + targeted-send picker */
.roster-row, .checklist label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 400; margin: 0;
}
.roster-row:last-child, .checklist label:last-child { border-bottom: 0; }
.checklist label { justify-content: flex-start; cursor: pointer; }
.checklist input { width: auto; }
.badge.pending { background: #F3E8D0; color: var(--warn); }

/* Privacy policy (static /privacy) */
.prose h2 { font-size: 16px; margin: 1.4rem 0 .4rem; }
.prose ul { padding-left: 1.2rem; color: var(--ink); }
.prose li { margin: .35rem 0; }
.prose a { color: var(--ink); }
.badge.ok { background: #DDEBDD; color: #2F6B3A; }
.preview-msg { border-top: 1px solid rgba(0,0,0,.08); padding-top: 8px; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.preview-msg .post-body { white-space: pre-wrap; }
.desk-row { display: flex; gap: 8px; align-items: flex-start; }
.slot { border-top: 1px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.slot-mine, .cover-plan .slot { background: #E7F2E9; margin: 0 -8px; padding: 10px 8px; border-radius: 8px; border-top: 0; }
.slot.soon, .cover-plan .slot.soon { background: #DDEBDD; outline: 2px solid #2F6B3A; }

/* Landing product tour. Opt-in sheet; frames live in PRODUCT_TOUR in app.js. */
.preview-modal {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.preview-backdrop { position: absolute; inset: 0; background: rgba(30, 42, 50, .45); }
.preview-sheet {
  position: relative; width: min(34rem, 100%);
  max-height: min(92vh, 760px); overflow: auto;
  background: var(--bg); border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 12px 40px rgba(30, 42, 50, .18);
}
.preview-sheet .display { margin-top: 8px; }
.preview-sheet .lede { margin-bottom: 12px; }
.preview-stage .card:last-child { margin-bottom: 0; }
.preview-stage .btn, .preview-stage textarea, .preview-stage input { pointer-events: none; }
.preview-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.preview-nav .btn { width: auto; }
.preview-dots { display: flex; gap: 6px; justify-content: center; flex: 1; }
.preview-dots button {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%;
  background: var(--line); cursor: pointer;
}
.preview-dots button.on { background: var(--accent); }
@media (min-width: 640px) {
  .preview-modal { align-items: center; padding: 16px; }
  .preview-sheet { border-radius: 16px; }
}
