:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --border: #e3e3df;
  --text: #16161a;
  --muted: #6b6b73;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --accent-text: #ffffff;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0f;
    --surface: #15151a;
    --surface-2: #1c1c22;
    --border: #2a2a32;
    --text: #ececf1;
    --muted: #9a9aa6;
    --accent: #8b85ff;
    --accent-soft: #23224a;
    --accent-text: #0c0c0f;
    --ok: #4ade80;
    --warn: #fbbf24;
    --danger: #f87171;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* top bar */
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 17px; }
.brand:hover { text-decoration: none; }
.logo { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--text), var(--muted)); position: relative; }
.logo::after { content: ""; position: absolute; inset: 7px; border-radius: 3px; background: var(--bg); transform: rotate(45deg); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.sm { padding: 6px 12px; font-size: 13px; }

/* landing */
.hero { padding-top: 72px; padding-bottom: 56px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); margin: 18px 0 16px; max-width: 820px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0 0 28px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.section { padding: 48px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: 26px; margin-bottom: 8px; }
.section > .wrap > p.sub { color: var(--muted); margin: 0 0 28px; max-width: 640px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h3 { font-size: 16px; margin-bottom: 6px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.two { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.list { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.list li { margin: 4px 0; }
.phases { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.phase .when { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 6px; }
.banner { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.banner p { margin: 6px 0 0; color: var(--muted); }
footer { padding: 32px 0 48px; color: var(--muted); font-size: 13px; }

/* board */
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px 0 18px; }
.board-head h1 { font-size: 28px; }
.board-head p { margin: 6px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search, select, input[type=text], input[type=password], textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; outline: none;
}
.search { flex: 1 1 220px; min-width: 0; }
.search:focus, select:focus, input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .c { opacity: .6; margin-left: 4px; font-weight: 500; }

.items { display: flex; flex-direction: column; gap: 10px; padding-bottom: 60px; }
.item { display: grid; grid-template-columns: 64px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.vote {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 64px; height: 68px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); cursor: pointer; font: inherit; transition: all .15s;
}
.vote:hover { border-color: var(--accent); }
.vote svg { width: 16px; height: 16px; }
.vote b { font-size: 18px; line-height: 1; }
.vote.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.item h3 { font-size: 16px; margin-bottom: 4px; }
.item .desc { color: var(--muted); font-size: 14px; margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.tag { border-radius: 6px; padding: 2px 8px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); }
.tag.src-Meeting { color: var(--accent); }
.tag.src-Proposed { color: var(--warn); }
.tag.src-Team { color: var(--ok); }
.status { border-radius: 6px; padding: 2px 8px; font-weight: 600; border: 1px solid var(--border); }
.status.planned { color: var(--accent); }
.status.in_progress { color: var(--warn); }
.status.done { color: var(--ok); }
.status.declined { color: var(--danger); text-decoration: line-through; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; font-weight: 600; }
.link:hover { color: var(--text); }
.voters { font-size: 12px; color: var(--muted); margin-top: 8px; }
.thread { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.cmt { font-size: 14px; }
.cmt .who { font-weight: 600; font-size: 13px; }
.cmt .when { color: var(--muted); font-size: 12px; margin-left: 6px; }
.cmt p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt-form { display: flex; gap: 8px; }
.cmt-form input { flex: 1; min-width: 0; }
.admin-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.admin-row select { padding: 4px 8px; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }
.me { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }

/* modal */
dialog { border: 1px solid var(--border); border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); width: min(480px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10,10,14,.55); backdrop-filter: blur(2px); }
dialog form { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
dialog h2 { font-size: 20px; }
dialog p { margin: 0; color: var(--muted); font-size: 14px; }
dialog label { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
dialog textarea { min-height: 100px; resize: vertical; }
.row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.err { color: var(--danger); font-size: 13px; min-height: 1em; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

@media (max-width: 560px) {
  .item { grid-template-columns: 52px 1fr; gap: 12px; padding: 14px; }
  .vote { width: 52px; height: 60px; }
  .hero { padding-top: 48px; padding-bottom: 40px; }
}
