body { margin: 0; }
[hidden] { display: none !important; }
/* Layout: single mobile-first column, sticky tab bar, cards only for proposals */
:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --ink: #1b2a26;
  --muted: #5d6f6a;
  --line: #d8e2de;
  --jade: #2f7a63;
  --jade-soft: #e1efe9;
  --ok: #2f7a3a;
  --ok-soft: #e2f1e3;
  --warn: #9a6200;
  --warn-soft: #fbefd9;
  --stop: #a23b32;
  --stop-soft: #f8e3e0;
  --info: #2c5f93;
  --info-soft: #e2ecf7;
  --font-display: "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", serif;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111816; --surface: #19221f; --ink: #e3ece8; --muted: #9db0aa; --line: #2c3a35;
    --jade: #6cc3a4; --jade-soft: #1f3a31;
    --ok: #86d18f; --ok-soft: #1e3322; --warn: #e9b45a; --warn-soft: #3a2d14;
    --stop: #ef8f85; --stop-soft: #3d1f1c; --info: #8ab8ea; --info-soft: #1c2c3f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111816; --surface: #19221f; --ink: #e3ece8; --muted: #9db0aa; --line: #2c3a35;
  --jade: #6cc3a4; --jade-soft: #1f3a31;
  --ok: #86d18f; --ok-soft: #1e3322; --warn: #e9b45a; --warn-soft: #3a2d14;
  --stop: #ef8f85; --stop-soft: #3d1f1c; --info: #8ab8ea; --info-soft: #1c2c3f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.6;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface);
}
.wrap {
  max-width: 680px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.demo-banner {
  background: var(--warn-soft); color: var(--warn);
  font-size: 13px; padding-block: 8px; text-align: center;
}
header.top { background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .wrap { padding-block: 18px 12px; }
h1 {
  font-family: var(--font-display); font-size: 24px; margin: 0; letter-spacing: 0.02em;
  text-wrap: balance;
}
.sub { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.summary span {
  font-size: 13px; padding: 2px 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
nav.tabs {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
nav.tabs .wrap { display: flex; gap: 4px; overflow-x: auto; }
nav.tabs button {
  flex: 0 0 auto; border: 0; background: none; color: var(--muted);
  font: inherit; font-weight: 500; padding: 12px 10px; cursor: pointer;
  border-bottom: 2px solid transparent;
}
nav.tabs button[aria-selected="true"] { color: var(--jade); border-bottom-color: var(--jade); }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--jade); outline-offset: 2px;
}
main .wrap { padding-block: 16px 48px; display: grid; gap: 16px; }
.lead { color: var(--muted); font-size: 14px; margin: 0; }
h2 { font-family: var(--font-display); font-size: 18px; margin: 8px 0 0; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button {
  font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.filters button[aria-pressed="true"] { background: var(--jade); border-color: var(--jade); color: var(--surface); }

.list { display: grid; gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; display: grid; gap: 8px; min-width: 0;
}
.card-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.card h3 { font-size: 16px; margin: 0; line-height: 1.45; min-width: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 12.5px; }
.pill {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  letter-spacing: 0.04em; white-space: nowrap;
}
.s-new { background: var(--info-soft); color: var(--info); }
.s-fwd { background: var(--warn-soft); color: var(--warn); }
.s-stale { background: var(--warn-soft); color: var(--warn); }
.s-meet { background: var(--info-soft); color: var(--info); }
.s-doing { background: var(--jade-soft); color: var(--jade); }
.s-done { background: var(--ok-soft); color: var(--ok); }
.s-no { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

.decision {
  font-size: 14px; background: var(--bg); border-radius: 6px; padding: 8px 10px;
}
.decision b { color: var(--jade); font-weight: 700; margin-right: 4px; }
.alert { font-size: 13px; color: var(--warn); }

details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
ol.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 6px; }
ol.timeline li { font-size: 13px; position: relative; }
ol.timeline li::before {
  content: ""; position: absolute; left: -20px; top: 7px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--jade);
}
ol.timeline time { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 6px; }
ol.timeline .who { color: var(--muted); }

.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.vote {
  font: inherit; font-size: 13px; cursor: pointer; padding: 4px 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.vote[aria-pressed="true"] { border-color: var(--jade); color: var(--jade); background: var(--jade-soft); }

/* progress tab */
.steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; }
.steps li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14px; padding-block: 5px; }
.dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; border: 2px solid var(--line); background: var(--surface); }
.steps .done .dot { background: var(--ok); border-color: var(--ok); }
.steps .now .dot { background: var(--warn); border-color: var(--warn); }
.steps .now span { font-weight: 700; }
.steps .todo span { color: var(--muted); }
.note { font-size: 13px; color: var(--muted); margin: 0; }

/* meeting tab */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0.04em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* form */
form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 13px; font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); }
.primary {
  font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 8px;
  padding: 10px 16px; background: var(--jade); color: var(--surface);
}
.primary:disabled, .vote:disabled { opacity: 0.6; cursor: wait; }
.secondary {
  font: inherit; font-size: 13px; cursor: pointer; padding: 4px 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.notice {
  background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px;
  font-size: 14px; line-height: 1.6;
}
.toast {
  background: var(--ok-soft); color: var(--ok); border-radius: 8px; padding: 10px 12px; font-size: 14px;
}
.toast.bad { background: var(--warn-soft); color: var(--warn); }
.card-actions { display: flex; gap: 8px; align-items: center; }
.vote-error { flex-basis: 100%; text-align: right; font-size: 12.5px; color: var(--warn); }
.card.flash { border-color: var(--jade); box-shadow: 0 0 0 3px var(--jade-soft); }
.similar { margin: 0; padding-left: 20px; }
.similar li { margin: 4px 0; }
.similar a { color: var(--jade); }
.empty { color: var(--muted); font-size: 14px; }
.body-text { font-size: 14px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: no-preference) { .card { transition: border-color .15s; } .card:hover { border-color: var(--jade); } }
