/* ============================================================
   ミルーペ ver2 議論室
   デザイン: nanzan-ai-phase2（minamiyamashiro）のテイストに準拠
   —— 黒の太罫線カード / べた塗りオフセット影 / 明朝見出し / 黄マーカー
   カラーはミルーペのトンマナ（Main Blue #2451EE / Yellow #FBC837 / Cyan #24D7D7）
   ============================================================ */
:root {
  /* MeLupe カラー */
  --blue: #2451EE;
  --blue-mid: #586BFF;
  --blue-soft: #D6E6FF;
  --blue-deep: #1B3BB8;
  --grad: linear-gradient(135deg, #2341E9, #1B77F9);
  --yellow: #FBC837;
  --yellow-marker: #FFE93B;
  --yellow-soft: #FFF7DC;
  --yellow-deep: #B28900;
  --red: #F74932;
  --red-soft: #FFEBE1;
  --red-deep: #992010;
  --cyan: #24D7D7;
  --cyan-soft: #E7F7F7;
  --cyan-deep: #336666;
  --ink: #151518;
  --ink-80: #2F3236;
  --muted: #777782;
  --muted-80: #959CAA;
  --line: #D6DEEC;
  --line-soft: #F1F4FA;
  --bg: #F4F6F9;
  --bg-soft: #F9FBFF;
  --card: #ffffff;
  /* 状態色 */
  --st-open: #959CAA;
  --st-discussing: #FBC837;
  --st-tentative: #586BFF;
  --st-decided: #24D7D7;
  --st-parked: #D6DEEC;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  /* べた塗りオフセット影（nanzan流） */
  --pop-card: 5px 5px 0 var(--ink);
  --pop-tile: 3px 3px 0 var(--ink);
  --pop-mini: 2px 2px 0 var(--ink);
  --bounce: cubic-bezier(.5, 1.6, .4, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg); color: var(--ink);
  font-size: 14.5px; line-height: 1.8;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
.muted { color: var(--muted); }

/* ---------- 共通パーツ ---------- */
.eyebrow {
  display: block; font-family: Montserrat, var(--sans);
  font-size: 10.5px; letter-spacing: .22em; color: var(--blue);
  text-transform: uppercase; font-weight: 700;
}
.marker { background: linear-gradient(transparent 62%, var(--yellow-marker) 62%); padding: 0 2px; }

.btn {
  border: 1.5px solid var(--ink); background: var(--yellow); border-radius: 8px;
  padding: 8px 16px; font-size: 13px; color: var(--ink); font-weight: 700;
  box-shadow: var(--pop-tile); white-space: nowrap; flex-shrink: 0;
  transition: transform .12s var(--bounce), box-shadow .12s var(--bounce), background .12s;
}
.btn:hover { background: #ffd95e; transform: translate(-1px, -1px); box-shadow: var(--pop-card); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { font-weight: 800; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-xs {
  padding: 1px 8px; font-size: 11px; border-radius: 5px;
  background: #fff; box-shadow: 1px 1px 0 var(--ink);
}
.btn-xs:hover { background: var(--yellow-soft); transform: translate(-1px, -1px); box-shadow: var(--pop-mini); }
.btn-xs:active { transform: translate(1px, 1px); box-shadow: none; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-danger-link {
  border: none; background: none; color: var(--red-deep); font-size: 12px;
  text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; box-shadow: none;
}
.btn-danger-link:hover { color: var(--red); }

.badge {
  display: inline-block; padding: 1px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap; vertical-align: middle;
}
.b-open { background: var(--line-soft); color: var(--muted); border: 1px solid var(--line); }
.b-discussing { background: var(--yellow-soft); color: var(--yellow-deep); border: 1px solid var(--yellow); }
.b-tentative { background: var(--blue-soft); color: var(--blue-deep); border: 1px solid var(--blue-mid); }
.b-decided { background: var(--cyan-soft); color: var(--cyan-deep); border: 1px solid var(--cyan); }
.b-parked { background: #fff; color: var(--muted-80); border: 1px dashed var(--muted-80); }

.topic-tag {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--muted);
  background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 8px; white-space: nowrap; vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; max-width: 180px;
}

.empty { color: var(--muted); text-align: center; padding: 24px 12px; font-size: 13px; }
.view-note { font-size: 12.5px; color: var(--muted); margin: 6px 0 16px; }

.pnum {
  font-family: Montserrat, var(--sans); font-size: .84em; font-weight: 700;
  color: var(--blue-deep); margin-right: 6px; letter-spacing: .02em;
}

/* ---------- ログイン ---------- */
.login-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.login-box {
  background: #fff; border: 2.5px solid var(--ink); border-radius: 14px;
  padding: 46px 40px; width: min(420px, 92vw); text-align: center;
  box-shadow: 8px 8px 0 var(--ink);
}
.login-box .login-logo { font-size: 36px; margin-bottom: 4px; }
.login-box .eyebrow { margin-bottom: 10px; }
.login-box h1 {
  font-family: var(--serif); font-size: 25px; letter-spacing: .08em;
  margin-bottom: 14px; font-weight: 700;
}
.login-note { color: var(--muted); font-size: 13px; margin-bottom: 24px; line-height: 1.9; }
.login-box input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--ink); border-radius: 6px;
  margin-bottom: 12px; font-size: 16px; background: #fff;
}
.login-box input:focus { outline: none; border-color: var(--blue); }
.login-error { color: var(--red-deep); margin-top: 12px; font-size: 13px; min-height: 1em; }

/* ---------- ヘッダー ---------- */
.app-header {
  background: #fff; border-bottom: 1px solid var(--ink);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 14px 24px 10px; gap: 12px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto;
}
.app-title .eyebrow { margin-bottom: 2px; }
.app-title .title-text {
  font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: .1em;
}
.header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.header-right input {
  border: 1px solid var(--ink); border-radius: 999px; padding: 6px 15px;
  width: 132px; font-size: 13px; font-weight: 700;
}
.header-right input:focus { outline: none; background: var(--yellow-soft); }
.header-right input:placeholder-shown { font-weight: 400; }
.ghost-btn {
  border: 1px solid var(--ink); background: #fff; border-radius: 999px;
  padding: 6px 12px; color: var(--ink); font-size: 13px;
}
.ghost-btn:hover { background: var(--yellow-soft); }
.tabs {
  display: flex; gap: 6px; padding: 0 24px; overflow-x: auto;
  max-width: 1180px; margin: 0 auto;
}
.tabs button {
  border: none; background: none; padding: 10px 14px 12px; font-size: 14px;
  color: var(--muted); white-space: nowrap; letter-spacing: .02em;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active {
  color: var(--ink); font-weight: 700;
  background: linear-gradient(transparent 68%, var(--yellow-marker) 68%, var(--yellow-marker) 92%, transparent 92%);
}

main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 90px; }

/* ---------- KPI ---------- */
.kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 34px;
}
.kpi {
  background: var(--card); border: 2px solid var(--ink); border-radius: 10px;
  padding: 14px 18px 12px; box-shadow: var(--pop-tile);
  border-top: 6px solid var(--blue);
}
.kpi.k-cyan { border-top-color: var(--cyan); }
.kpi.k-yellow { border-top-color: var(--yellow); }
.kpi.k-grey { border-top-color: var(--muted-80); }
.kpi-label { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.kpi-value {
  font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.4;
}
.kpi-value small { font-size: 12.5px; font-weight: 600; color: var(--muted); font-family: var(--sans); }
.kpi-go { font-size: 10.5px; color: var(--muted); font-family: Montserrat, var(--sans); font-weight: 700; }
.kpi[data-kpi] {
  cursor: pointer;
  transition: transform .14s var(--bounce), box-shadow .14s var(--bounce);
}
.kpi[data-kpi]:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }

/* ---------- セクション見出し ---------- */
.block { margin-bottom: 44px; }
.block-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
  border-bottom: 1px solid var(--ink); padding-bottom: 10px;
}
.block-head h2 {
  font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: .08em;
}
.block-head .count {
  font-family: Montserrat, var(--sans); font-size: 13px; color: var(--muted);
  margin-left: 10px; font-weight: 600;
}

/* ---------- 論点行 ---------- */
.issue-list {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: 4px 4px 0 var(--blue-soft); overflow: hidden;
}
.issue-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-bottom: 1px dashed var(--line); cursor: pointer; min-width: 0;
}
.issue-row:last-child { border-bottom: none; }
.issue-row:hover { background: var(--yellow-soft); }
.issue-row .issue-title { flex: 1; min-width: 0; font-weight: 700; line-height: 1.6; }
.issue-row.is-decided .issue-title { color: var(--muted); font-weight: 500; }
.issue-row .issue-meta {
  color: var(--muted); font-size: 11.5px; white-space: nowrap;
  display: flex; gap: 10px; align-items: center; font-family: Montserrat, var(--sans);
}
.lock { font-size: 12px; cursor: help; }
.due-soon { color: var(--red-deep); font-weight: 700; }

/* ---------- ホーム: 論点カード（nanzanテーマカード流） ---------- */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 16px 18px;
}
.icard {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  padding: 13px 16px 11px; box-shadow: var(--pop-card); cursor: pointer;
  display: flex; flex-direction: column; gap: 7px;
  transition: transform .16s var(--bounce), box-shadow .16s var(--bounce);
}
.icard:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.icard-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.icard-head .lock { margin-left: auto; }
.icard-title { font-weight: 700; font-size: 14.5px; line-height: 1.55; }
.icard-status { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.icard-status .st-row {
  display: flex; gap: 8px; padding: 6px 9px; font-size: 12px; line-height: 1.65;
  align-items: flex-start; border-bottom: 1px dashed var(--line);
}
.icard-status .st-row:last-child { border-bottom: none; }
.st-label {
  flex-shrink: 0; font-size: 10px; font-weight: 700; border-radius: 4px;
  padding: 1px 7px; margin-top: 2px; letter-spacing: .08em;
}
.st-now .st-label { background: var(--yellow); color: var(--ink); }
.st-wait .st-label { background: var(--red-soft); color: var(--red-deep); border: 1px solid var(--red); }
.st-wait .st-text { color: var(--red-deep); }
.st-dec .st-label { background: var(--cyan-soft); color: var(--cyan-deep); border: 1px solid var(--cyan); }
.st-text { flex: 1; min-width: 0; }
.icard-foot {
  display: flex; gap: 12px; align-items: center; margin-top: auto;
  font-size: 11px; color: var(--muted); font-family: Montserrat, var(--sans); font-weight: 600;
}
.icard-foot .due-soon { color: var(--red-deep); }
.icard.is-resolved { background: var(--bg-soft); }
.st-date { color: var(--muted-80); font-size: 10.5px; margin-left: 6px; font-family: Montserrat, var(--sans); }

/* カード上のクイック操作（メモ・結論） */
.card-actions { margin-left: auto; display: flex; gap: 5px; }
.card-act {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 2px 10px; font-size: 11px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.card-act:hover { border-color: var(--ink); color: var(--ink); background: var(--yellow-soft); }
.card-quick { display: flex; gap: 6px; margin-top: 2px; align-items: flex-end; }
.card-quick textarea {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 9px; min-height: 46px; resize: vertical; line-height: 1.6; font-size: 12.5px;
}
.card-quick textarea:focus { outline: none; border-color: var(--ink); }
.card-quick.dec { background: var(--cyan-soft); border: 1px solid var(--cyan); border-radius: 8px; padding: 6px; }
.card-quick.dec textarea { border-color: var(--cyan); }
.card-quick .conclusion-btns { display: flex; flex-direction: column; gap: 4px; }

/* カードのその場展開（論点全文・メモ全件・入力欄） */
.icard.expanded { grid-column: 1 / -1; cursor: default; }
.icard.expanded .card-actions { visibility: visible; }
.fold-mark { margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.icard-expand {
  border-top: 1.5px dashed var(--line); margin-top: 6px; padding-top: 10px;
  display: flex; flex-direction: column; gap: 10px; font-size: 13px; cursor: auto;
}
.ex-sec { min-width: 0; }
.ex-label {
  font-size: 10px; font-weight: 800; color: var(--muted); letter-spacing: .08em; margin-bottom: 3px;
}
.ex-sec.dec {
  background: var(--cyan-soft); border: 1px solid var(--cyan); border-radius: 8px; padding: 7px 11px;
}
.ex-sec.dec .ex-label { color: var(--cyan-deep); }
.ex-date { font-family: Montserrat, var(--sans); font-weight: 700; letter-spacing: 0; }
.ex-note { border-bottom: 1px dashed var(--line); padding: 5px 0; }
.ex-note:last-of-type { border-bottom: none; }
.ex-note-meta {
  display: block; font-size: 10.5px; color: var(--muted);
  font-family: Montserrat, var(--sans); font-weight: 600;
}

/* いま議論している論点（ステージ枠）とドラッグ&ドロップ */
.stage-zone {
  min-height: 130px; border: 2.5px dashed var(--ink); border-radius: 14px;
  padding: 16px; background: var(--yellow-soft);
  align-content: start;
}
.stage-zone .icard { box-shadow: 5px 5px 0 var(--yellow); }
.stage-zone .icard:hover { box-shadow: 7px 7px 0 var(--yellow); }
.stage-empty {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center;
  min-height: 96px; color: var(--muted); font-size: 13px; font-weight: 700;
}
.card-act.stage-act { border-color: var(--ink); background: var(--yellow-soft); color: var(--ink); }
.card-act.stage-act:hover { background: var(--yellow); }
.icard.dragging { opacity: .35; }
[data-dropzone].drop-hint { outline: 3px solid var(--blue-mid); outline-offset: 4px; border-radius: 14px; }

/* トピックセクション見出し */
.tdot {
  display: inline-block; width: 13px; height: 13px; border-radius: 4px;
  border: 1.5px solid var(--ink); margin-right: 9px; background: var(--tc, var(--blue));
  vertical-align: 1px;
}
.topic-block-head { border-bottom-color: var(--tc, var(--ink)); border-bottom-width: 2px; }
.progress-wrap {
  display: flex; align-items: center; gap: 8px;
  font-family: Montserrat, var(--sans); font-size: 11.5px; color: var(--muted); font-weight: 700;
}
.progress {
  width: 110px; height: 10px; background: #fff; border: 1.5px solid var(--ink);
  border-radius: 999px; overflow: hidden;
}
.progress > i { display: block; height: 100%; background: var(--tc, var(--blue)); }
.topic-desc-note { font-size: 12px; color: var(--muted); margin: -8px 0 14px; }
.topic-head-actions { display: flex; gap: 6px; }
.resolved-fold { margin-top: 14px; }
.resolved-fold summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--cyan-deep);
  user-select: none; display: inline-block; padding: 3px 14px;
  background: var(--cyan-soft); border: 1.5px solid var(--cyan); border-radius: 999px;
}
.resolved-fold summary:hover { background: #d5f2f2; }
.resolved-fold .issue-list { margin-top: 10px; box-shadow: 3px 3px 0 var(--cyan-soft); }
.subtopic-label {
  padding: 8px 18px 2px; font-size: 12.5px; font-weight: 700; color: var(--muted);
  border-top: 1px dashed var(--line);
}

/* ---------- 依存マップ ---------- */
.map-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.map-toolbar .chip {
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  padding: 5px 16px; font-size: 12.5px; color: var(--muted);
}
.map-toolbar .chip.active {
  background: var(--blue-soft); border-color: var(--blue-mid);
  color: var(--ink); font-weight: 700; box-shadow: 1px 1px 0 var(--blue-deep);
}
.map-legend {
  display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted);
  margin: 0 0 10px 2px; align-items: center;
}
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: middle; border: 1px solid rgba(21,21,24,.25); }
.map-wrap {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: var(--pop-tile); overflow: hidden; position: relative;
  height: calc(100vh - 260px); min-height: 420px;
}
.map-wrap svg { display: block; width: 100%; height: 100%; cursor: grab; }
.map-wrap svg.panning { cursor: grabbing; }
.map-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.map-zoom button {
  width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--ink);
  background: #fff; font-size: 14px; color: var(--ink); font-weight: 700;
  box-shadow: var(--pop-mini);
}
.map-zoom button:hover { background: var(--yellow-soft); transform: translate(-1px, -1px); }
.map-node { cursor: pointer; }
.map-node rect.node-body { fill: #fff; stroke: var(--ink); stroke-width: 1.3; }
.map-node:hover rect.node-body { stroke-width: 2.2; }
.map-node text { font-size: 11px; fill: var(--ink); pointer-events: none; font-weight: 600; }
.map-node .node-topic { font-size: 9px; fill: var(--muted); font-weight: 700; }
.map-node.st-decided rect.node-body { fill: var(--cyan-soft); }
.map-node.st-tentative rect.node-body { fill: var(--blue-soft); }
.map-node.blocked rect.node-body { fill: var(--line-soft); }

/* ---------- 会議 ---------- */
.meetings-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
@media (max-width: 800px) { .meetings-layout { grid-template-columns: 1fr; } }
.side-card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: var(--pop-tile); padding: 15px 16px;
}
.side-card h2 { font-family: var(--serif); font-size: 15.5px; font-weight: 700; margin-bottom: 8px; letter-spacing: .05em; }
.meeting-list-item {
  padding: 9px 12px; border-radius: 8px; cursor: pointer; border: 1.5px solid transparent;
}
.meeting-list-item:hover { background: var(--yellow-soft); }
.meeting-list-item.active { background: var(--blue-soft); border-color: var(--ink); box-shadow: var(--pop-mini); }
.meeting-list-item .m-date { font-family: Montserrat, var(--sans); font-size: 10.5px; color: var(--muted); font-weight: 700; }
.meeting-list-item .m-title { font-weight: 700; font-size: 13px; line-height: 1.5; }
.meeting-create { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 14px; }
.meeting-create input { border: 1px solid var(--ink); border-radius: 8px; padding: 8px 12px; }
.meeting-create input:focus { outline: none; background: var(--yellow-soft); }

.panel-card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: var(--pop-card); padding: 17px 20px; margin-bottom: 18px;
}
.panel-card h2 { font-family: var(--serif); font-size: 17px; font-weight: 700; margin-bottom: 10px; letter-spacing: .05em; }
.meeting-head-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.meeting-head-row .field { flex: 1; min-width: 150px; }

/* ---------- 議論モード ---------- */
.meeting-topbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; }
.meeting-topbar select, .meeting-topbar input {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff;
}
.meeting-topbar select { min-width: 220px; font-weight: 700; }
.meeting-topbar input[type="text"] { flex: 1; min-width: 140px; }
.meeting-topbar select:focus, .meeting-topbar input:focus { outline: none; border-color: var(--ink); }
.meeting-work-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .meeting-work-layout { grid-template-columns: 1fr; } }
.side-sticky { position: sticky; top: 96px; }
.side-sticky .panel-card { padding: 14px 16px; }
.side-sticky h2 { font-size: 15px; }
.side-sticky select, .side-sticky input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff;
}
.decided-panel { box-shadow: 5px 5px 0 var(--cyan); }
.decided-line {
  display: flex; gap: 8px; align-items: flex-start; padding: 8px 0;
  border-bottom: 1px dashed var(--line); cursor: pointer;
}
.decided-line:last-child { border-bottom: none; }
.decided-line:hover .decided-title { background: linear-gradient(transparent 64%, var(--yellow-marker) 64%); }
.decided-title { font-weight: 700; font-size: 12.5px; line-height: 1.5; }
.decided-body { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.quick-new { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.quick-new label { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.agenda-bg { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.agenda-conclusion {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 10px;
  background: var(--cyan-soft); border: 1px solid var(--cyan); border-radius: 8px; padding: 8px 10px;
}
.agenda-conclusion .conclusion-label {
  flex-shrink: 0; font-size: 10.5px; font-weight: 700; color: var(--cyan-deep);
  border: 1px solid var(--cyan); background: #fff; border-radius: 4px; padding: 1px 8px; margin-top: 6px;
}
.agenda-conclusion textarea {
  flex: 1; border: 1px solid var(--cyan); border-radius: 6px; padding: 6px 10px;
  min-height: 40px; resize: vertical; background: #fff; line-height: 1.6;
}
.agenda-conclusion textarea:focus { outline: none; border-color: var(--cyan-deep); }
.conclusion-btns { display: flex; flex-direction: column; gap: 5px; }
.past-note-hint {
  margin-top: 8px; font-size: 11.5px; color: var(--muted); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.past-note-hint:hover { color: var(--ink); }
.agenda-item.is-done { background: var(--bg-soft); }

.agenda-item {
  border: 1.5px solid var(--ink); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px;
  background: #fff; box-shadow: var(--pop-mini);
}
.agenda-note-form textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 11px; min-height: 46px;
  resize: vertical; line-height: 1.6;
}
.agenda-note-form textarea:focus { outline: none; border-color: var(--ink); }
.agenda-item .agenda-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agenda-item .agenda-title { font-weight: 700; cursor: pointer; flex: 1; min-width: 0; }
.agenda-item .agenda-title:hover { background: linear-gradient(transparent 64%, var(--yellow-marker) 64%); }
.agenda-note-form { display: flex; gap: 8px; margin-top: 8px; }
.agenda-note-form textarea { flex: 1; }
.agenda-add-row { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.agenda-add-row select {
  flex: 1; min-width: 200px; max-width: 440px;
  border: 1px solid var(--ink); border-radius: 8px; padding: 8px 10px; background: #fff;
}

.status-select { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.status-select button {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 700;
}
.status-select button:hover { border-color: var(--ink); color: var(--ink); }
.status-select button.active { border-color: var(--ink); box-shadow: var(--pop-mini); }
.status-select button.active.st-open { background: var(--line-soft); color: var(--ink-80); }
.status-select button.active.st-discussing { background: var(--yellow-soft); color: var(--yellow-deep); }
.status-select button.active.st-tentative { background: var(--blue-soft); color: var(--blue-deep); }
.status-select button.active.st-decided { background: var(--cyan-soft); color: var(--cyan-deep); }
.status-select button.active.st-parked { background: #fff; color: var(--muted); border-style: dashed; }

/* ---------- 記録（日別・論点別） ---------- */
.log-tabs {
  display: inline-flex; gap: 5px; margin-bottom: 16px; padding: 4px;
  border: 2px solid var(--ink); border-radius: 999px; background: #fff; box-shadow: var(--pop-mini);
}
.log-tab {
  border: 0; border-radius: 999px; padding: 5px 18px; font-size: 12px; font-weight: 800;
  background: transparent; color: var(--muted); cursor: pointer;
}
.log-tab:hover { background: var(--yellow-soft); color: var(--ink); }
.log-tab.active { background: var(--yellow); color: var(--ink); }
.log-day {
  border: 2px solid var(--ink); border-radius: 12px; background: #fff;
  box-shadow: var(--pop-mini); margin-bottom: 12px; overflow: hidden;
}
.log-day > summary {
  display: flex; align-items: center; gap: 10px; padding: 10px 15px;
  background: var(--bg-soft); cursor: pointer; list-style: none;
  font-family: var(--serif); font-size: 14.5px; font-weight: 700; letter-spacing: .04em;
}
.log-day > summary::-webkit-details-marker { display: none; }
.log-day > summary::before { content: '＋'; font-family: var(--sans); }
.log-day[open] > summary::before { content: '−'; }
.log-day[open] > summary { border-bottom: 1px solid var(--ink); background: var(--yellow-soft); }
.day-count {
  margin-left: auto; padding: 1px 10px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue-deep);
  font-family: Montserrat, var(--sans); font-size: 11px; font-weight: 700;
}
.log-row {
  display: grid; grid-template-columns: 52px 24px minmax(0, 1fr); gap: 8px;
  padding: 8px 15px; border-bottom: 1px dashed var(--line); cursor: pointer; align-items: baseline;
  font-size: 12.5px;
}
.log-row:last-child { border-bottom: none; }
.log-row:hover { background: var(--yellow-soft); }
.log-time { color: var(--muted); font-family: Montserrat, var(--sans); font-size: 10.5px; white-space: nowrap; }
.log-main { min-width: 0; }
.log-issue { font-weight: 700; line-height: 1.5; }
.log-text { color: var(--ink-80); line-height: 1.6; }
.log-author { color: var(--muted); font-size: 11px; margin-left: 6px; }
.log-issue-block {
  border: 2px solid var(--ink); border-radius: 12px; background: #fff;
  box-shadow: var(--pop-mini); margin-bottom: 12px; overflow: hidden;
}
.log-issue-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 15px;
  background: var(--bg-soft); border-bottom: 1px solid var(--ink); cursor: pointer;
}
.log-issue-head:hover .log-issue-title { background: linear-gradient(transparent 64%, var(--yellow-marker) 64%); }
.log-issue-title { font-weight: 700; }
.log-issue-block .log-row { grid-template-columns: 84px 24px minmax(0, 1fr); }

/* ---------- 決定ログ ---------- */
.decision-item {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  border-left: 8px solid var(--cyan);
  padding: 10px 18px; margin-bottom: 14px; box-shadow: var(--pop-tile);
}
.decision-item.tentative { border-left-color: var(--blue-mid); }
.decision-item .d-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-family: Montserrat, var(--sans); }
.decision-item .d-title { font-weight: 700; cursor: pointer; margin-top: 2px; font-size: 15px; }
.decision-item .d-title:hover { background: linear-gradient(transparent 64%, var(--yellow-marker) 64%); }
.decision-item .d-body { font-size: 13px; margin-top: 2px; color: var(--ink-80); }

/* ---------- 右スライド詳細パネル ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(21, 21, 24, .45); z-index: 50;
  display: flex; justify-content: flex-end;
}
.detail-panel {
  background: var(--bg); width: min(620px, 100vw); height: 100%; overflow-y: auto;
  padding: 24px; animation: slideIn .18s ease; border-left: 1px solid var(--ink);
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.detail-head .detail-title-input {
  flex: 1; font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: 1.5;
  border: 1.5px solid transparent; border-radius: 8px; padding: 4px 8px; background: transparent;
  letter-spacing: .03em;
}
.detail-head .detail-title-input:hover { border-color: var(--line); background: #fff; }
.detail-head .detail-title-input:focus { outline: none; border-color: var(--ink); background: #fff; }
.close-btn { border: none; background: none; font-size: 20px; color: var(--muted); padding: 2px 8px; }
.close-btn:hover { color: var(--ink); }
.detail-sub { margin: 0 0 14px 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.detail-section {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 15px 17px; box-shadow: 0 1px 2px rgba(40, 50, 80, .06), 0 3px 10px rgba(40, 50, 80, .05);
  margin-bottom: 15px;
}
.detail-section h3 {
  font-size: 13px; font-weight: 700; letter-spacing: .04em; margin-bottom: 9px;
  border-bottom: 1px dotted var(--line); padding-bottom: 8px; color: var(--ink-80);
}
.banner {
  border-radius: 8px; padding: 8px 13px; font-size: 12.5px; margin-bottom: 14px; font-weight: 700;
  border: 1.5px solid var(--ink);
}
.banner.blocked { background: var(--yellow-soft); color: var(--yellow-deep); box-shadow: 3px 3px 0 var(--yellow); }
.banner.ready { background: var(--cyan-soft); color: var(--cyan-deep); box-shadow: 3px 3px 0 var(--cyan); }

.field { min-width: 0; }
.field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; letter-spacing: .03em; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; background: #fff;
  line-height: 1.7;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ink); }
.field textarea { min-height: 70px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.section-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.section-actions .right { margin-left: auto; }

.dep-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-dep {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--ink); background: #fff; border-radius: 999px;
  padding: 3px 12px; cursor: pointer; max-width: 100%; box-shadow: var(--pop-mini);
  transition: transform .12s var(--bounce), background .12s;
}
.chip-dep:hover { background: var(--yellow-soft); transform: translate(-1px, -1px); }
.chip-dep.relates { border-style: dashed; box-shadow: none; }
.chip-dep .chip-x { border: none; background: none; color: var(--muted-80); font-size: 13px; padding: 0 0 0 2px; cursor: pointer; }
.chip-dep .chip-x:hover { color: var(--red); }
.dep-add-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.dep-add-row select { border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: #fff; }
.dep-add-row select:first-child { flex: 1; min-width: 180px; }
.dep-add-row select:focus { outline: none; border-color: var(--ink); }
.dep-hint { font-size: 11px; color: var(--muted); margin-top: 8px; font-weight: 700; }

.note-item { border-bottom: 1px dashed var(--line); padding: 9px 0; }
.note-item:last-of-type { border-bottom: none; }
.note-meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note-meta .del-note { border: none; background: none; color: var(--muted-80); cursor: pointer; font-size: 12px; }
.note-meta .del-note:hover { color: var(--red); }
.note-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.note-form textarea { flex: 1; min-height: 54px; }

.advanced {
  border: 1px dashed var(--ink); border-radius: 10px;
  padding: 2px 15px; margin-bottom: 14px; background: rgba(255, 255, 255, .6);
}
.advanced summary {
  cursor: pointer; font-size: 12.5px; color: var(--muted); padding: 9px 0;
  user-select: none; font-weight: 700;
}
.advanced summary:hover { color: var(--ink); }
.advanced .field { margin: 10px 0; }
.advanced .adv-footer { display: flex; align-items: center; gap: 8px; margin: 12px 0 14px; }
.advanced .adv-footer .btn-danger-link { margin-left: auto; }

/* ---------- モーダル（新規作成用） ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(21, 21, 24, .45); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: #fff; border: 2px solid var(--ink); border-radius: 14px;
  width: min(520px, 94vw); max-height: 90vh; overflow-y: auto; padding: 26px;
  box-shadow: 8px 8px 0 var(--ink);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.modal-head h3 { font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: .06em; }
.modal .field { margin-bottom: 13px; }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.modal-actions .btn-danger-link { margin-left: auto; }

/* ---------- Markdown表示 ---------- */
.md { line-height: 1.8; overflow-wrap: anywhere; }
.md p { margin: 0 0 5px; }
.md p:last-child { margin-bottom: 0; }
.md ul { margin: 4px 0; padding-left: 20px; }
.md h2, .md h3, .md h4 { font-size: 14px; margin: 8px 0 4px; font-weight: 700; }
.md a { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 2px; }
.md code { background: var(--line-soft); border-radius: 4px; padding: 0 4px; font-size: 12px; }

/* ---------- トースト ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 24px; border-radius: 999px;
  font-size: 13px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.3); letter-spacing: .03em;
}
.toast.error { background: var(--red-deep); }

@media (max-width: 640px) {
  main { padding: 20px 14px 80px; }
  .detail-panel { width: 100vw; }
  .field-row { grid-template-columns: 1fr; }
  .kpi-value { font-size: 23px; }
  .block-head h2 { font-size: 17px; }
  .header-right input { width: 100px; }
}

/* ---------- コンパクト表示（一覧性優先。デフォルト） ---------- */
.density-toggle {
  display: inline-flex; gap: 4px; padding: 3px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; box-shadow: var(--pop-mini);
}
.density-toggle button {
  border: 0; border-radius: 999px; padding: 3px 13px; font-size: 11.5px; font-weight: 800;
  background: transparent; color: var(--muted); cursor: pointer;
}
.density-toggle button.active { background: var(--yellow); color: var(--ink); }
.home-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }

body.compact main { max-width: 1760px; }
body.compact .kpi-row { gap: 10px; margin-bottom: 20px; }
body.compact .kpi { padding: 8px 14px 6px; border-top-width: 4px; border-width: 1.5px; box-shadow: var(--pop-mini); }
body.compact .kpi-value { font-size: 19px; }
body.compact .kpi-go { display: none; }
body.compact .block { margin-bottom: 26px; }
body.compact .block-head { margin-bottom: 10px; padding-bottom: 6px; }
body.compact .block-head h2 { font-size: 15px; }
body.compact .view-note { display: none; }
body.compact .topic-desc-note { display: none; }
body.compact .cards { grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 10px 12px; }
body.compact .icard {
  padding: 8px 11px 7px; gap: 4px; border-radius: 10px; border-width: 1.5px;
  box-shadow: var(--pop-mini);
}
body.compact .icard:hover { box-shadow: var(--pop-tile); }
body.compact .icard-title { font-size: 12.5px; line-height: 1.5; }
body.compact .badge { font-size: 10px; padding: 0 8px; }
body.compact .topic-tag { font-size: 10px; padding: 0 6px; max-width: 110px; }
body.compact .pnum { font-size: .78em; margin-right: 4px; }
body.compact .icard-status .st-row { padding: 3px 7px; font-size: 10.5px; line-height: 1.5; gap: 6px; }
body.compact .icard-status .st-label { font-size: 9px; padding: 0 5px; margin-top: 1px; }
body.compact .st-text {
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
body.compact .st-date { display: none; }
body.compact .icard-foot { font-size: 10px; gap: 8px; }
body.compact .card-actions { visibility: hidden; }
body.compact .icard:hover .card-actions, body.compact .icard:focus-within .card-actions { visibility: visible; }
body.compact .card-act { padding: 1px 8px; font-size: 10px; }
/* 展開したカードはコンパクト時も読みやすいサイズに戻す */
body.compact .icard.expanded { padding: 12px 15px 11px; }
body.compact .icard.expanded .icard-title { font-size: 14px; }
body.compact .icard.expanded .card-actions { visibility: visible; }
body.compact .stage-zone { min-height: 84px; padding: 10px; }
body.compact .stage-empty { min-height: 56px; font-size: 12px; }
body.compact .progress { width: 80px; height: 8px; }
