/* ============================================================
   南山城学園 AIプロジェクト管理室
   トンマナ: 生成りの背景 / 黒の細罫線 / 黄マーカー / 明朝見出し
   アクセント: ピンク #e47f9d・青 #68b2cf・緑 #4da568・茶 #b5a383
   ============================================================ */
:root {
  --bg: #f8f2e8;            /* 生成り */
  --card: #ffffff;
  --ink: #1c1c1c;
  --muted: #666666;
  --line: #e4dbc8;          /* 生成りに馴染む薄い線 */
  --line-dark: #1c1c1c;
  --yellow: #fff210;        /* 強調マーカー */
  --yellow-soft: #fffbd6;
  --pink: #e47f9d;
  --pink-soft: #fbeef3;
  --pink-deep: #b0526f;
  --blue: #68b2cf;
  --blue-soft: #eaf4f8;
  --blue-deep: #3d7f9c;
  --green: #4da568;
  --green-soft: #e9f4ec;
  --green-deep: #35804e;
  --brown: #b5a383;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(60, 50, 30, .06), 0 3px 10px rgba(60, 50, 30, .05);
  /* べた塗りオフセット影（レトロポップ） */
  --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: 15px; line-height: 1.8;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
.muted { color: var(--muted); }

/* ---------- 共通パーツ ---------- */
.eyebrow {
  display: block; font-family: Montserrat, var(--sans);
  font-size: 10.5px; letter-spacing: .22em; color: var(--muted);
  text-transform: uppercase; font-weight: 600;
}
.marker { background: linear-gradient(transparent 62%, var(--yellow) 62%); padding: 0 2px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.view-note { font-size: 12.5px; color: var(--muted); margin: 6px 0 16px; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; font-size: 13.5px; }

.btn {
  border: 1.5px solid var(--ink); background: var(--yellow); border-radius: 8px;
  padding: 8px 16px; font-size: 13.5px; color: var(--ink); font-weight: 600;
  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: #fff75d; transform: translate(-1px, -1px); box-shadow: var(--pop-card); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled {
  opacity: .48; cursor: not-allowed; transform: none;
  box-shadow: 1px 1px 0 var(--ink);
}
.btn:disabled:hover { background: var(--yellow); transform: none; box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--yellow); border-color: var(--ink); color: var(--ink); font-weight: 700; }
.btn-primary:hover { background: #fff75d; }
.consult-expand { box-shadow: none !important; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-xs {
  padding: 1px 8px; font-size: 11px; border-color: var(--ink); color: var(--ink);
  border-radius: 4px; box-shadow: 1px 1px 0 var(--ink);
}
.btn-xs:hover { transform: translate(-1px, -1px); box-shadow: var(--pop-mini); }
.btn-xs:active { transform: translate(1px, 1px); box-shadow: none; }
.btn-danger { background: var(--pink-deep); color: #fff; border-color: var(--pink-deep); }
.btn-danger:hover { background: #8e4058; color: #fff; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }

.badge {
  display: inline-block; padding: 2px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap; vertical-align: middle;
}
.b-アイデア { background: var(--yellow); color: var(--ink); }
.b-進行中 { background: var(--blue-soft); color: var(--blue-deep); border: 1px solid var(--blue); }
.b-完成 { background: var(--green-soft); color: var(--green-deep); border: 1px solid var(--green); }
.b-未着手 { background: #efece4; color: var(--muted); }
.b-完了 { background: var(--green-soft); color: var(--green-deep); }
.b-未回答 { background: var(--pink); color: #fff; }
.b-対応中 { background: var(--yellow); color: var(--ink); }
.b-解決 { background: var(--green-soft); color: var(--green-deep); }
.page-head{max-width:900px;margin:26px auto 18px;padding:0 20px}.page-head h1{font-family:var(--serif);font-size:30px;line-height:1.35}.page-head p{color:var(--muted);margin-top:5px}#main{max-width:1180px;margin:0 auto;padding:0 20px 50px}.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:18px 0}.kpi{background:var(--yellow);border:2px solid var(--ink);box-shadow:var(--pop-tile);padding:15px;display:flex;flex-direction:column}.kpi b{font-size:27px}.kpi.blue{background:var(--blue-soft)}.kpi.pink{background:var(--pink-soft)}.kpi.green{background:var(--green-soft)}.schedule{border:2px solid var(--ink);background:#fff;box-shadow:var(--pop-tile);padding:12px;display:flex;flex-wrap:wrap;gap:9px;align-items:center;margin:20px 0}.schedule span{font-size:12px;background:var(--yellow-soft);padding:3px 8px;border-radius:999px}.people-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(245px,1fr));gap:18px}.person-card,.focus-card,.timeline,.consult-card,.resource,.notice{background:#fff;border:2px solid var(--ink);box-shadow:var(--pop-card);padding:17px;border-radius:10px}.person-card h3{font-family:var(--serif);font-size:20px}.card-top{display:flex;justify-content:space-between}.person-card strong{display:block;margin:6px 0}.bar{height:9px;border:1px solid var(--ink);background:#fff;margin:12px 0}.bar i{display:block;height:100%;background:var(--blue)}.next{font-size:13px}.action-row{display:flex;gap:12px;margin:18px 0}.section-title{font-family:var(--serif);font-size:21px;margin:25px 0 12px}.timeline{margin:12px 0;box-shadow:var(--pop-mini)}.timeline small,.notice small,.consult-card small{color:var(--muted);font-size:11px}.status-dot{float:right;font-size:12px;font-weight:bold}.status-dot.要支援{color:var(--pink-deep)}.status-dot.相談したい{color:var(--blue-deep)}.consult-card{margin:14px 0}.reply{background:var(--blue-soft);border-left:4px solid var(--blue);margin:13px 0 0;padding:9px}.list{display:grid;gap:15px;margin-top:18px}.resource a{color:var(--blue-deep)}.stack-form{display:grid;gap:12px}.stack-form label{font-size:13px;font-weight:700}.stack-form input,.stack-form select,.stack-form textarea{display:block;width:100%;border:1.5px solid var(--ink);border-radius:6px;padding:7px;margin-top:3px}.stack-form textarea{min-height:90px}.modal-close{float:right;border:0;background:transparent;font-size:27px}.modal h2{font-family:var(--serif);margin-bottom:15px}.modal{max-width:620px!important}.login-box label{display:block;text-align:left;font-size:13px;font-weight:700;margin:12px 0}.login-box input{width:100%;border:1.5px solid var(--ink);border-radius:6px;padding:10px;margin-top:3px}.login-error{color:var(--pink-deep);margin-top:8px}@media(max-width:700px){.kpis{grid-template-columns:repeat(2,1fr)}.header-inner{align-items:flex-start}.tabs{overflow-x:auto;justify-content:flex-start}.page-head{padding:0}.schedule{display:block}.schedule span{display:inline-block;margin:4px}.people-grid{grid-template-columns:1fr}}
.updates-panel{background:var(--yellow-soft);border:2px solid var(--ink);box-shadow:var(--pop-card);padding:16px;margin:20px 0}.section-head{display:flex;justify-content:space-between;align-items:center}.section-head h2{font-family:var(--serif);font-size:20px}.update-row{width:100%;display:grid;grid-template-columns:auto minmax(130px,1fr) minmax(180px,2fr) auto;gap:10px;align-items:center;text-align:left;background:#fff;border:1px solid var(--line-dark);padding:9px;margin-top:8px;border-radius:5px}.update-row:hover{background:var(--yellow);transform:translate(-1px,-1px)}.update-row small{color:var(--muted);font-size:10px}.link-btn,.person-link{border:0;background:transparent;color:var(--blue-deep);font:inherit;text-decoration:underline}.person-card-button{font:inherit;text-align:left;cursor:pointer;transition:transform .12s var(--bounce),box-shadow .12s var(--bounce)}.person-card-button:hover{transform:translate(-2px,-2px);box-shadow:7px 7px 0 var(--ink);background:var(--yellow-soft)}.card-open{display:block;font-size:12px;color:var(--blue-deep);font-weight:700;margin-top:9px}.detail-theme{background:var(--yellow-soft);border:1px solid var(--ink);padding:14px;border-radius:7px}.detail-theme h3{font-family:var(--serif);font-size:21px;margin:6px 0}@media(max-width:700px){.update-row{display:block}.update-row>*{display:inline-block;margin-right:6px}.update-row span:nth-of-type(2){display:block;margin-top:4px}}
.issue-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}.issue-card{font:inherit;text-align:left;background:#fff;border:2px solid var(--ink);border-radius:8px;box-shadow:var(--pop-tile);padding:14px;transition:transform .12s var(--bounce),box-shadow .12s var(--bounce)}.issue-card:hover{transform:translate(-2px,-2px);box-shadow:5px 5px 0 var(--ink)}.issue-card h3{font-family:var(--serif);font-size:17px;line-height:1.5;margin:8px 0}.issue-card p{font-size:13px;color:var(--muted);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.issue-card small{display:block;margin-top:10px;color:var(--blue-deep)}.status-相談したい{background:var(--pink-soft)}.status-決まった{background:var(--green-soft)}
.w-導入したい { background: var(--blue-soft); color: var(--blue-deep); border: 1px solid var(--blue); }
.w-導入した！ { background: var(--green); color: #fff; border: 1px solid var(--green-deep); }
.wish-done { color: var(--green-deep); font-weight: 700; }
.w-検討中 { background: var(--yellow); color: var(--ink); }
.w-見送り { background: #efece4; color: var(--muted); }
.w-コメントのみ { background: #fff; color: var(--muted); border: 1px dashed var(--line); }
.wish-count { color: var(--blue-deep); font-weight: 700; }
.pnum {
  font-family: Montserrat, var(--sans); font-size: .82em; font-weight: 700;
  color: var(--brown); margin-right: 7px; letter-spacing: .02em;
}
.i-成功事例・良い点 { background: var(--green); color: #fff; }
.i-失敗事例・改善点 { background: var(--pink-soft); color: var(--pink-deep); border: 1px solid var(--pink); }
.i-知見・コツ { background: var(--yellow); color: var(--ink); }
.to-tag {
  font-size: 11px; color: var(--blue-deep); background: var(--blue-soft);
  border-radius: 4px; padding: 1px 7px; margin-left: 7px; font-weight: 700; vertical-align: middle;
}

/* ---------- ログイン ---------- */
.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: 48px 40px; width: min(420px, 92vw); text-align: center;
  box-shadow: 8px 8px 0 var(--ink);
}
.login-box .eyebrow { margin-bottom: 10px; }
.login-box h1 {
  font-family: var(--serif); font-size: 26px; 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[type="password"], .login-box input[type="text"] {
  width: 100%; padding: 13px 14px; border: 1px solid var(--ink); border-radius: 6px;
  margin-bottom: 12px; font-size: 16px; background: #fff;
}
.login-error { color: var(--pink-deep); margin-top: 12px; font-size: 13px; }
.show-pw {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  font-size: 12px; color: var(--muted); margin-bottom: 14px; cursor: pointer;
}
.show-pw input { width: auto; margin: 0; }

/* ---------- ヘッダー ---------- */
.app-header {
  background: #fff; border-bottom: 1px solid var(--line-dark);
  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: 1240px; 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; }
.author-btn {
  border: 1px solid var(--ink); background: #fff; border-radius: 999px;
  padding: 6px 16px; font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.author-btn:hover { background: var(--yellow-soft); }
.author-btn.unset { background: var(--yellow); animation: attention 1.8s ease-in-out infinite; }
@keyframes attention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(228, 127, 157, .55); }
  55% { box-shadow: 0 0 0 8px rgba(228, 127, 157, 0); }
}
.author-search {
  background: var(--yellow-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-top: 14px;
}
.author-search > label {
  display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px;
}
.author-search-row { display: flex; gap: 8px; }
.author-search-row input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--ink);
  border-radius: 7px; background: #fff;
}
.member-quick {
  border-top: 1px dashed var(--line); margin-top: 18px; padding-top: 14px;
}
.member-quick-head {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  color: var(--muted); font-size: 11.5px;
}
.member-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.member-chip {
  border: 1.5px solid var(--ink); background: #fff; border-radius: 999px;
  padding: 8px 16px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--pop-mini); transition: background .12s, transform .12s var(--bounce);
}
.member-chip:hover { background: var(--yellow-soft); transform: translate(-1px, -1px); }
.member-chip.selected { background: var(--yellow); border-color: var(--ink); font-weight: 700; }
.tabs {
  display: flex; gap: 6px; padding: 0 24px; overflow-x: auto;
  max-width: 1240px; margin: 0 auto;
}
.tab {
  border: none; background: none; padding: 10px 14px 12px; font-size: 14px;
  color: var(--muted); white-space: nowrap; letter-spacing: .02em;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink); font-weight: 700;
  background: linear-gradient(transparent 68%, var(--yellow) 68%, var(--yellow) 92%, transparent 92%);
}

main { max-width: 1240px; 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-width: 6px;
  border-top-color: var(--brown); border-top-style: solid;
}
.kpi.k-blue { border-top-color: var(--blue); }
.kpi.k-yellow { border-top-color: var(--yellow); }
.kpi.k-green { border-top-color: var(--green); }
.kpi.k-pink { border-top-color: var(--pink); }
.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-sub { font-size: 11.5px; color: var(--muted); margin-top: -3px; }
.kpi.alert .kpi-value { color: var(--pink-deep); }

.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; scroll-margin-top: 120px; }
.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(--line-dark); 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;
}
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; flex-wrap: wrap; gap: 8px; }
.section-head h2 { font-family: var(--serif); font-size: 18px; letter-spacing: .06em; }

/* ---------- 進行中カード ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px 22px; }
.card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  padding: 18px 20px; box-shadow: var(--pop-card); cursor: pointer;
  transition: transform .16s var(--bounce), box-shadow .16s var(--bounce);
}
.card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.card.has-issue { box-shadow: 5px 5px 0 var(--pink); }
.card.has-issue:hover { box-shadow: 7px 7px 0 var(--pink); }
.card-head { margin-bottom: 6px; }
.card-title { font-weight: 700; font-size: 15.5px; line-height: 1.55; }
.card-meta {
  font-size: 12.5px; color: var(--muted); margin-bottom: 10px;
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center;
}
/* 状況ストリップ（いま / 課題 / 次） */
.card-status {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.st-row {
  display: flex; gap: 8px; padding: 7px 10px; font-size: 12.5px; line-height: 1.65;
  align-items: flex-start; border-bottom: 1px dashed var(--line);
}
.st-row:last-child { border-bottom: none; }
.st-label {
  flex-shrink: 0; font-size: 10.5px; font-weight: 700; border-radius: 4px;
  padding: 1px 8px; margin-top: 2px; letter-spacing: .08em;
}
.st-now .st-label { background: var(--yellow); color: var(--ink); }
.st-issue .st-label { background: var(--pink-soft); color: var(--pink-deep); border: 1px solid var(--pink); }
.st-next .st-label { background: var(--blue-soft); color: var(--blue-deep); border: 1px solid var(--blue); }
.st-issue .st-text { color: var(--pink-deep); }
.st-text { flex: 1; }
.st-meta { flex-shrink: 0; font-size: 10.5px; color: var(--muted); margin-top: 3px; font-family: Montserrat, var(--sans); }

/* 詳細パネルの課題・次の一歩インライン編集 */
.inline-field { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.inline-field .st-label { margin-top: 10px; }
.inline-field textarea {
  flex: 1; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 6px; resize: vertical; line-height: 1.7; background: #fff;
}
.inline-field textarea:focus { outline: none; border-color: var(--ink); }
.inline-actions { text-align: right; }
.card-updated {
  font-size: 11px; color: var(--muted); text-align: right; margin-top: 10px;
  font-family: Montserrat, var(--sans);
}

/* ---------- アイデア ---------- */
.idea-quick {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 2px dashed var(--ink); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 18px; box-shadow: 3px 3px 0 var(--yellow);
}
.idea-quick-icon { font-size: 20px; }
.idea-quick input {
  flex: 1; border: none; outline: none; font-size: 15px; padding: 6px 2px; background: transparent;
}
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.idea-card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  padding: 16px 18px; cursor: pointer; box-shadow: 4px 4px 0 var(--yellow);
  display: flex; flex-direction: column; gap: 6px;
  transition: transform .16s var(--bounce), box-shadow .16s var(--bounce);
}
.idea-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--yellow); }
.idea-name { font-weight: 700; font-size: 14.5px; line-height: 1.7; }
.idea-meta {
  display: flex; flex-wrap: wrap; gap: 3px 14px;
  font-size: 12px; color: var(--muted);
}
.idea-meta span { white-space: nowrap; }
.idea-note { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.idea-card .promote {
  align-self: flex-end; margin-top: auto;
  border-color: var(--blue); color: var(--blue-deep);
}
.idea-card .promote:hover { background: var(--blue-soft); }

/* ---------- 完成リスト ---------- */
.done-list {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: 4px 4px 0 var(--green);
}
.done-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px;
  border-bottom: 1px dashed var(--line); cursor: pointer; flex-wrap: wrap;
}
.done-item:last-child { border-bottom: none; }
.done-item:hover { background: var(--green-soft); }
.done-check {
  width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0;
}
.done-name { font-weight: 700; }
.done-meta { font-size: 12.5px; color: var(--muted); }

/* ---------- テーブル ---------- */
.table-wrap {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: var(--pop-tile); overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  background: #fbf8f1; color: var(--muted); font-size: 12px; white-space: nowrap;
  position: sticky; top: 0; letter-spacing: .04em;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fdfbf6; }
.overdue { color: var(--pink-deep); font-weight: 700; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  padding: 5px 16px; font-size: 12.5px; color: var(--muted);
}
.chip.active {
  background: var(--blue-soft); border-color: var(--blue);
  color: var(--ink); font-weight: 700; box-shadow: 1px 1px 0 var(--blue-deep);
}

/* ---------- 定例会の議題 ---------- */
.agenda-list { display: grid; gap: 16px; }
.agenda-card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  padding: 17px 20px; box-shadow: 5px 5px 0 var(--yellow);
}
.agenda-card.discussed { box-shadow: 5px 5px 0 var(--green); }
.agenda-card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
}
.agenda-card-head h3 {
  display: inline; margin-left: 8px; font-family: var(--serif); font-size: 17px;
  line-height: 1.6; letter-spacing: .04em;
}
.agenda-pending { background: var(--yellow); color: var(--ink); }
.agenda-done { background: var(--green); color: #fff; }
.agenda-themes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.agenda-meta { margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.agenda-details { margin-top: 12px; white-space: pre-wrap; line-height: 1.8; }
.agenda-record {
  margin-top: 14px; padding: 12px 14px; border: 1px solid var(--green);
  border-radius: 8px; background: var(--green-soft);
}
.agenda-record-head { font-size: 12.5px; color: var(--green-deep); }
.agenda-record dl { display: grid; grid-template-columns: 88px 1fr; gap: 8px; margin-top: 10px; }
.agenda-record dt { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.agenda-record dd { white-space: pre-wrap; line-height: 1.75; }
.agenda-conclusion dd { font-weight: 700; }
.agenda-discussed-section { margin-top: 34px; }
.agenda-empty {
  padding: 24px; border: 1px dashed var(--line); border-radius: 10px; background: rgba(255,255,255,.5);
}

/* ---------- 施設×テーマ マトリクス ---------- */
.matrix-wrap {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: var(--pop-tile); overflow: auto; max-height: 76vh;
  /* マトリクスだけ本文幅を超えて画面幅いっぱいまで使う（右に隠れにくくする） */
  width: min(calc(100vw - 48px), 1760px);
  margin-left: calc((100% - min(calc(100vw - 48px), 1760px)) / 2);
}
.matrix-wrap th, .matrix-wrap td { padding: 9px 7px; }
.matrix-wrap td { vertical-align: middle; }
.matrix-wrap td:first-child { padding: 9px 12px; }
.matrix-wrap th:first-child, .matrix-wrap td:first-child {
  position: sticky; left: 0; background: #fbf8f1; z-index: 2;
  min-width: 220px; max-width: 300px;
}
.matrix-wrap th.vert {
  writing-mode: vertical-rl; text-orientation: mixed; white-space: nowrap;
  height: 130px; padding: 12px 7px; font-size: 12px; vertical-align: bottom; font-weight: 600;
  cursor: pointer;
}
.matrix-wrap th.vert:hover { color: var(--blue-deep); }
.proj-name { cursor: pointer; font-weight: 600; line-height: 1.6; }
.proj-name:hover .proj-name-text { background: linear-gradient(transparent 64%, var(--yellow) 64%); }
.proj-name .badge { margin-right: 6px; }
.matrix-cell {
  cursor: pointer; text-align: center; font-size: 11px;
  color: #cfc7b4; white-space: nowrap; letter-spacing: 0;
  /* 最大3文字表記に統一し、入力の有無にかかわらず列幅を固定する */
  width: 52px; min-width: 52px; max-width: 52px;
}
.matrix-wrap th.vert { width: 52px; min-width: 52px; max-width: 52px; }
.matrix-cell:hover { outline: 2px solid var(--blue); outline-offset: -2px; }
.m-検討中 { background: #f6f2e4; color: #8a7635; font-weight: 700; }
.m-導入したい { background: var(--blue-soft); color: var(--blue-deep); font-weight: 700; }
.m-準備中 { background: #f2efe7; color: var(--muted); font-weight: 700; }
.m-試用中 { background: var(--yellow-soft); color: #8a7635; font-weight: 700; }
.m-本導入 { background: var(--green-soft); color: var(--green-deep); font-weight: 700; }
.m-見送り { background: #eceae5; color: #a9a294; font-weight: 700; }
.m-停止 { background: var(--pink-soft); color: var(--pink-deep); font-weight: 700; }

/* ---------- 相談 ---------- */
.consult-item {
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
  padding: 16px 18px; box-shadow: var(--pop-tile); margin-bottom: 18px;
}
.consult-item.has-interactions { border-left: 7px solid var(--blue); }
.consult-head {
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  align-items: center; margin-bottom: 10px;
}
.consult-who { display: flex; align-items: center; gap: 10px; }
.who-avatar {
  width: 36px; height: 36px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.who-name { display: block; font-weight: 700; font-size: 15px; line-height: 1.4; }
.who-date { display: block; font-size: 11px; color: var(--muted); }
.consult-head-right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.proj-tag {
  display: inline-block; background: var(--blue-soft); color: var(--blue-deep);
  border: 1px solid var(--blue); border-radius: 6px; padding: 2px 10px;
  font-size: 12px; font-weight: 700;
}
.consult-content { white-space: pre-wrap; line-height: 1.85; }
.consult-reply {
  margin-top: 10px; background: var(--green-soft); border-left: 3px solid var(--green);
  padding: 8px 14px 10px; border-radius: 0 6px 6px 0; font-size: 13.5px;
}
.reply-content { white-space: pre-wrap; line-height: 1.75; }
.consult-expand {
  display: block; width: 100%; border: none; background: none;
  border-top: 1px dashed var(--line); margin-top: 12px; padding: 9px 0 2px;
  font-size: 12.5px; color: var(--muted); text-align: center; cursor: pointer;
  letter-spacing: .03em;
}
.consult-expand:hover { color: var(--ink); }
.consult-expand.has-replies {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
  color: var(--ink); font-weight: 700;
}
.interaction-badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border: 1px solid var(--ink); border-radius: 999px; background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink); color: var(--ink); font-size: 11.5px; font-weight: 800;
}
.consult-reply .reply-label { font-size: 11px; color: var(--green-deep); font-weight: 700; letter-spacing: .06em; }
.consult-reply .reply-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 2px; }
.consult-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.consult-actions .resolve { background: var(--green); border-color: var(--green-deep); color: var(--ink); }
.consult-actions .resolve:hover { background: var(--green-deep); color: #fff; }
.consult-item.solved { opacity: .85; box-shadow: 3px 3px 0 var(--green); }
.solved-toggle { text-align: center; margin: 26px 0 18px; }
.solved-head { margin-top: 8px; }

/* ---------- 詳細パネル・モーダル ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(30, 25, 15, .45); z-index: 50;
  display: flex; justify-content: flex-end;
}
#modal-overlay { justify-content: center; align-items: center; }
.detail-panel {
  background: var(--bg); width: min(700px, 100vw); height: 100%; overflow-y: auto;
  padding: 24px; animation: slideIn .18s ease; border-left: 1px solid var(--line-dark);
}
@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: 16px; }
.detail-head h2 { font-family: var(--serif); font-size: 20px; letter-spacing: .04em; line-height: 1.5; }
.detail-section {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.detail-section h3 {
  font-size: 13.5px; margin-bottom: 10px; letter-spacing: .04em;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px dotted var(--line); padding-bottom: 8px;
}
.field-grid { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13.5px; }
.field-grid dt { color: var(--muted); }
.field-grid dd { white-space: pre-wrap; line-height: 1.75; }
.issue-text { color: var(--pink-deep); }
.log-input { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.log-input textarea {
  flex: 1; min-height: 56px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 6px; resize: vertical; line-height: 1.7;
}
.log-item { border-bottom: 1px dashed var(--line); padding: 10px 0; font-size: 13.5px; }
.log-item:last-child { border-bottom: none; }
.log-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.log-content { white-space: pre-wrap; line-height: 1.75; }
.rollout-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.modal {
  background: #fff; border: 2px solid var(--ink); border-radius: 14px;
  width: min(580px, 94vw); max-height: 90vh; overflow-y: auto; padding: 26px;
  box-shadow: 8px 8px 0 var(--ink);
}
.modal h2 { font-family: var(--serif); font-size: 18px; margin-bottom: 18px; letter-spacing: .06em; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; letter-spacing: .03em; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--ink);
}
.form-row textarea { min-height: 76px; resize: vertical; line-height: 1.7; }
.fixed-field {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--blue-soft); color: var(--blue-deep); font-weight: 700;
}
.multi-box { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.multi-chip {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px;
  font-size: 12.5px; cursor: pointer; user-select: none; background: #fff;
  transition: background .1s;
}
.multi-chip:hover { border-color: var(--ink); }
.multi-chip:has(input:checked) { background: var(--yellow); border-color: var(--ink); font-weight: 700; }
.multi-chip:has(input:checked) span::before { content: '✓ '; }
.multi-chip input { display: none; }
.projects-multi-box {
  max-height: 250px; overflow-y: auto; padding: 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fdfbf6;
}
.projects-multi-group + .projects-multi-group { margin-top: 10px; }
.projects-multi-label {
  margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: .06em;
}
.project-chip { padding: 5px 11px; text-align: left; line-height: 1.5; }
.field-hint { margin-top: 6px; color: var(--muted); font-size: 11px; }
.form-advanced {
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 2px 14px; margin: 4px 0 16px; background: #fdfbf6;
}
.form-advanced summary {
  cursor: pointer; font-size: 12.5px; color: var(--muted); padding: 8px 0;
  user-select: none; letter-spacing: .02em;
}
.form-advanced summary:hover { color: var(--ink); }
.form-advanced .form-row { margin-top: 6px; }
.form-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 20px; }
.form-actions .right { display: flex; gap: 8px; margin-left: auto; }
.admin-menu { display: grid; gap: 12px; }
.admin-menu .btn {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  text-align: left;
}
.admin-menu .btn small { color: var(--muted); font-weight: 500; }
.admin-menu .admin-logout { background: var(--pink-soft); }
.admin-menu .admin-logout:hover { background: #f7dce6; }

/* ---------- ノート・ナレッジ ---------- */
.insight-section { border-left: 5px solid var(--yellow); }
.insight-input { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; flex-wrap: wrap; }
.insight-input select {
  width: auto; max-width: 240px; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; font-size: 13px;
  text-overflow: ellipsis; overflow: hidden;
}
.insight-input textarea {
  flex: 1 1 100%; min-height: 96px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 6px; resize: vertical; line-height: 1.75;
}
.insight-input .btn { margin-left: auto; }
.notes-theme-filter {
  margin-left: auto; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 12.5px; background: #fff; color: var(--muted); width: auto;
}
.note-item { padding: 14px 16px; margin-bottom: 14px; }
.note-item .consult-who { flex: 1 1 420px; min-width: 0; }
.note-byline { min-width: 0; }
.note-byline-main {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.note-theme-tag {
  appearance: none; font-family: inherit; font-size: 14px; line-height: 1.4;
  padding: 3px 10px; text-align: left;
}
button.note-theme-tag {
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
button.note-theme-tag:hover {
  background: #d8edf5; border-color: var(--blue-deep); color: var(--blue-deep);
}
button.note-theme-tag:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 2px; }
.note-item .log-content { margin-top: 4px; }
.note-actions {
  display: flex; gap: 10px; margin-top: 12px;
  border-top: 1px dashed var(--line); padding-top: 10px;
}
.like-btn, .cmt-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 14px; font-size: 12.5px; cursor: pointer; color: var(--muted);
  transition: background .1s;
}
.like-btn:hover, .cmt-btn:hover { border-color: var(--ink); color: var(--ink); }
.cmt-btn.has-comments {
  background: var(--yellow-soft); border-color: var(--ink); color: var(--ink); font-weight: 700;
}
.cmt-btn .interaction-badge { margin-right: 3px; }
.like-btn.liked {
  background: var(--pink-soft); border-color: var(--pink); color: var(--pink-deep); font-weight: 700;
}
.icmt-area { margin-top: 12px; background: #fbf8f1; border-radius: 8px; padding: 10px 14px; }
.icmt-item { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.icmt-item:last-of-type { border-bottom: none; }
.icmt-author { font-weight: 700; }
.icmt-content { white-space: pre-wrap; line-height: 1.7; }
.collapsible-block { min-width: 0; }
.collapsible-text {
  white-space: pre-wrap; overflow: hidden; line-height: 1.8;
  overflow-wrap: anywhere;
}
.collapsible-text.is-collapsed { max-height: 18em; }
.collapsible-toggle {
  display: block; margin: 5px auto 0; padding: 3px 14px;
  border: 1px solid var(--ink); border-radius: 999px; background: var(--yellow-soft);
  box-shadow: 2px 2px 0 var(--ink); color: var(--ink); cursor: pointer;
  font-size: 11.5px; font-weight: 700;
}
.collapsible-toggle[hidden] { display: none; }
.collapsible-toggle:hover {
  background: var(--yellow); transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink);
}

/* ---------- Markdown入力・表示 ---------- */
.markdown-body {
  white-space: normal; line-height: 1.8; overflow-wrap: anywhere;
}
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p { margin: .45em 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  display: block; margin: 1em 0 .4em; color: var(--ink); font-family: var(--serif); line-height: 1.5;
  letter-spacing: .03em;
}
.markdown-body h1 { font-size: 1.45em; border-bottom: 2px solid var(--yellow); padding-bottom: .18em; }
.markdown-body h2 { font-size: 1.28em; border-left: 5px solid var(--yellow); padding-left: .55em; }
.markdown-body h3 { padding: 0; border: 0; font-size: 1.14em; }
.markdown-body h4 { padding: 0; border: 0; font-size: 1.05em; }
.markdown-body ul, .markdown-body ol { margin: .45em 0; padding-left: 1.7em; }
.markdown-body li { margin: .16em 0; }
.markdown-body blockquote {
  margin: .65em 0; padding: .55em .85em; border-left: 4px solid var(--blue);
  border-radius: 0 6px 6px 0; background: var(--blue-soft); color: var(--muted);
}
.markdown-body code {
  padding: .08em .35em; border-radius: 4px; background: #f1eee7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em;
}
.markdown-body pre {
  max-width: 100%; margin: .65em 0; padding: .8em 1em; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 7px; background: #27251f; color: #fff;
  white-space: pre;
}
.markdown-body pre code { padding: 0; background: transparent; color: inherit; }
.markdown-body a { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 2px; }
.markdown-body hr { margin: .9em 0; border: 0; border-top: 1px dashed var(--line-dark); }
.markdown-compact { font-size: 12.5px; color: var(--muted); }
.markdown-compact h1, .markdown-compact h2, .markdown-compact h3, .markdown-compact h4 {
  font-family: var(--sans); font-size: 1em; margin: .45em 0 .2em;
}
.task-note { margin-top: 4px; }

.markdown-editor { width: 100%; min-width: 0; }
.markdown-editor > textarea { display: block; width: 100%; }
.markdown-editor > textarea[hidden], .markdown-preview[hidden] { display: none !important; }
.markdown-toolbar {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  margin-bottom: 5px; font-size: 11px;
}
.markdown-enabled {
  margin-right: 2px; padding: 2px 7px; border: 1px solid var(--blue);
  border-radius: 999px; background: var(--blue-soft); color: var(--blue-deep); font-weight: 700;
}
.markdown-toolbar button {
  min-height: 25px; padding: 2px 8px; border: 1px solid var(--line-dark);
  border-radius: 5px; background: #fff; color: var(--ink); font: inherit;
  font-weight: 700; cursor: pointer;
}
.markdown-toolbar button:hover { border-color: var(--ink); background: var(--yellow-soft); }
.markdown-toolbar .markdown-preview-toggle {
  margin-left: auto; border-color: var(--ink); background: var(--yellow-soft);
}
.markdown-help {
  margin: -1px 0 5px; color: var(--muted); font-size: 10.5px; line-height: 1.6;
}
.markdown-help summary { display: inline-block; cursor: pointer; text-decoration: underline; }
.markdown-help div { margin-top: 3px; }
.markdown-help code {
  padding: 1px 4px; border-radius: 3px; background: #f1eee7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.markdown-preview {
  min-height: 76px; padding: 10px 12px; border: 1px solid var(--ink);
  border-radius: 6px; background: #fffef8;
}
.markdown-preview-empty { color: var(--muted); }
.inline-field > .markdown-editor, .log-input > .markdown-editor, .icmt-input > .markdown-editor { flex: 1; }
.insight-input > .markdown-editor { flex: 1 1 100%; }
.inline-field > .markdown-editor textarea { min-height: 52px; }
.log-input > .markdown-editor textarea { min-height: 56px; }
.icmt-input { align-items: flex-end; }
.icmt-input textarea {
  min-height: 58px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; resize: vertical; line-height: 1.65;
}
.update-focus {
  animation: updateFocus 2.4s ease both;
  scroll-margin-top: 150px;
}
@keyframes updateFocus {
  0%, 100% { outline: 0 solid transparent; }
  18%, 68% { outline: 5px solid var(--yellow); outline-offset: 5px; background-color: var(--yellow-soft); }
}
.icmt-input { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- 画像添付 ---------- */
.attachment-composer {
  flex: 1 1 100%; padding: 10px 12px;
  border: 1px dashed var(--line-dark); border-radius: 8px; background: #fdfbf6;
}
.attachment-composer-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap;
}
.attachment-composer-note { color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.attachment-pending, .attachment-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 9px; margin-top: 10px;
}
.attachment-thumb {
  position: relative; min-width: 0; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.attachment-thumb-link {
  display: block; color: inherit; text-decoration: none;
}
.attachment-thumb img {
  display: block; width: 100%; height: 96px; object-fit: cover; background: #eee9dd;
}
.attachment-thumb-name {
  display: block; padding: 5px 7px; font-size: 10.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attachment-download {
  display: block; margin: 0 6px 7px; padding: 4px 6px;
  border: 1px solid var(--ink); border-radius: 6px; background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink); color: var(--ink); text-decoration: none;
  font-size: 10.5px; font-weight: 700; text-align: center;
}
.attachment-download:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.attachment-remove {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  width: 26px; height: 26px; padding: 0; border: 1px solid var(--ink);
  border-radius: 50%; background: var(--pink); color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink); cursor: pointer; font-weight: 800;
}
.attachment-remove:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.attachment-gallery { max-width: 520px; margin: 10px 0 2px; }
.consult-reply .attachment-gallery, .icmt-item .attachment-gallery {
  grid-template-columns: repeat(auto-fill, minmax(92px, 130px));
}
.consult-reply .attachment-thumb img, .icmt-item .attachment-thumb img { height: 82px; }
.attachment-add-inline { margin-top: 8px; }
.icmt-input-wrap { margin-top: 10px; }
.icmt-input-wrap .icmt-input { margin-top: 0; }
.icmt-input-wrap .attachment-composer { margin-top: 8px; }

/* ---------- 更新情報 ---------- */
.updates-block { margin-top: -4px; }
.update-view-tabs {
  display: inline-flex; gap: 5px; margin-top: 12px; padding: 4px;
  border: 2px solid var(--ink); border-radius: 999px; background: #fff;
  box-shadow: var(--pop-mini);
}
.update-view-tab {
  min-height: 36px; padding: 6px 18px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 12px; font-weight: 800;
}
.update-view-tab:hover { background: var(--yellow-soft); color: var(--ink); }
.update-view-tab.active { background: var(--yellow); color: var(--ink); }
.update-person-filter {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line-dark);
  border-radius: 10px; background: var(--blue-soft);
}
.update-person-filter label { color: var(--blue-deep); font-size: 12px; font-weight: 800; }
.update-person-filter select {
  min-width: 220px; padding: 8px 34px 8px 12px; border: 2px solid var(--ink);
  border-radius: 8px; background: #fff; color: var(--ink); font-weight: 700;
}
.update-view-note { margin-top: 13px; }
.update-person-status {
  border: 2px solid var(--ink); border-radius: 14px; background: var(--card);
  box-shadow: var(--pop-mini); overflow: hidden;
}
.update-person-status > summary {
  display: flex; align-items: center; gap: 10px; padding: 13px 15px;
  cursor: pointer; list-style: none; font-family: var(--serif); font-weight: 800;
}
.update-person-status > summary::-webkit-details-marker { display: none; }
.update-person-status > summary::before { content: '＋'; font-family: var(--sans); }
.update-person-status[open] > summary::before { content: '−'; }
.update-person-status > summary .update-day-count { margin-left: auto; }
.status-unconfirmed { border-left: 8px solid var(--pink); }
.status-unconfirmed > summary { background: var(--yellow-soft); }
.status-confirmed { border-left: 8px solid var(--green); }
.status-confirmed > summary { background: var(--green-soft); }
.update-person-status-body { padding: 12px; border-top: 1px solid var(--line-dark); }
.update-confirm-all { margin-bottom: 12px; }
.update-person-dates { display: grid; gap: 10px; }
.update-person-entry {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  border-bottom: 1px dashed var(--line-dark);
}
.update-person-entry:last-child { border-bottom: 0; }
.update-person-entry .update-row { border-bottom: 0; }
.update-person-entry.is-unconfirmed { background: #fffdf2; }
.update-confirm-button {
  margin-right: 12px; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); cursor: pointer;
  color: var(--ink); font-size: 11px; font-weight: 800; white-space: nowrap;
}
.update-confirm-button:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.update-confirm-button:disabled { opacity: .55; cursor: wait; }
.update-confirmed-mark {
  display: grid; gap: 1px; margin-right: 12px; color: var(--green-deep);
  font-size: 11px; font-weight: 800; white-space: nowrap; text-align: right;
}
.update-confirmed-mark small { color: var(--muted); font-size: 9px; font-weight: 500; }
.update-list {
  overflow: hidden; border: 2px solid var(--ink); border-radius: 12px;
  background: var(--card); box-shadow: var(--pop-mini);
}
.update-row {
  width: 100%; display: grid;
  grid-template-columns: 26px 84px minmax(0, 1fr) minmax(110px, 220px) 14px;
  gap: 8px; align-items: center; padding: 7px 12px;
  border: 0; border-bottom: 1px dashed var(--line-dark); background: transparent;
  color: var(--ink); text-align: left; cursor: pointer; min-height: 38px;
}
.update-row:last-child { border-bottom: 0; }
.update-row:hover { background: var(--yellow-soft); }
.update-icon {
  display: grid; place-items: center; width: 24px; height: 24px;
  border: 1px solid var(--ink); border-radius: 50%; background: #fff; font-size: 11px;
}
.update-time {
  color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.update-text {
  min-width: 0; font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.update-text b { font-weight: 800; }
.update-theme {
  min-width: 0; color: var(--muted); font-size: 10.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right;
}
.update-arrow { font-family: var(--serif); font-size: 20px; line-height: 1; }
.update-list-all { margin-top: 14px; }
.update-day-list { display: grid; gap: 12px; margin-top: 14px; }
.update-day {
  border: 2px solid var(--ink); border-radius: 12px; background: var(--card);
  box-shadow: var(--pop-mini); overflow: hidden;
}
.update-day > summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 14px; background: #fbf8f1; cursor: pointer;
  font-family: var(--serif); font-size: 14px; font-weight: 700; letter-spacing: .03em;
  list-style: none;
}
.update-day > summary::-webkit-details-marker { display: none; }
.update-day > summary::before { content: '＋'; font-family: var(--sans); }
.update-day[open] > summary::before { content: '−'; }
.update-day[open] > summary { border-bottom: 1px solid var(--line-dark); background: var(--yellow-soft); }
.update-day-count {
  margin-left: auto; padding: 2px 9px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue-deep); font-family: var(--sans); font-size: 11px;
}
.update-day .update-list { border: 0; border-radius: 0; box-shadow: none; }
.update-theme-category {
  padding: 14px; border: 2px solid var(--ink); border-radius: 14px;
  background: var(--card); box-shadow: var(--pop-mini);
}
.update-theme-category-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px; padding-bottom: 9px; border-bottom: 2px solid var(--ink);
}
.update-theme-category-head h3 {
  margin: 0; font-family: var(--serif); font-size: 16px; letter-spacing: .04em;
}
.update-theme-category-count {
  flex: 0 0 auto; padding: 3px 10px; border: 1px solid var(--ink); border-radius: 999px;
  background: #fff; font-size: 10.5px; font-weight: 800;
}
.update-theme-category-groups { display: grid; gap: 9px; }
.category-general { border-left: 8px solid var(--brown); }
.category-completed { border-left: 8px solid var(--green); }
.category-active { border-left: 8px solid var(--blue); }
.category-ideas { border-left: 8px solid var(--yellow); }
.category-other { border-left: 8px solid var(--muted); }
.update-theme-section > summary { background: var(--blue-soft); }
.update-theme-section[open] > summary { background: var(--yellow-soft); }

.daily-digest-card {
  padding: 18px; border: 2px solid var(--ink); border-left: 8px solid var(--blue);
  border-radius: 14px; background: var(--card); box-shadow: var(--pop-mini);
}
.daily-digest-card.is-cybozu-sent { border-left-color: var(--green); }
.daily-digest-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 12px;
}
.daily-digest-head h3 {
  margin: 3px 0 4px; font-family: var(--serif); font-size: 18px; letter-spacing: .04em;
}
.daily-digest-head p { margin: 0; color: var(--muted); font-size: 11px; }
.daily-digest-statuses {
  display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap;
}
.digest-status {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px;
  border: 1px solid var(--ink); border-radius: 999px; background: #fff;
  font-size: 10.5px; font-weight: 800; white-space: nowrap;
}
.digest-status small { font-size: 9px; font-weight: 500; opacity: .8; }
.digest-status.is-sent { background: var(--green-soft); color: var(--green-deep); }
.digest-status.is-error { background: var(--pink-soft); color: var(--pink-deep); }
.digest-status.is-pending { background: #f3f0e8; color: var(--muted); }
.daily-digest-error {
  margin: 0 0 10px; padding: 8px 10px; border-left: 5px solid var(--pink);
  background: var(--pink-soft); color: var(--pink-deep); font-size: 11px; font-weight: 700;
}
.daily-digest-body {
  display: block; width: 100%; min-height: 300px; padding: 14px;
  border: 1px solid var(--line-dark); border-radius: 10px; background: #fff;
  color: var(--ink); resize: vertical; font: 12.5px/1.75 var(--sans);
}
.daily-digest-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px;
}
.daily-digest-tip { margin: 10px 0 0; color: var(--muted); font-size: 10.5px; }

@media (max-width: 640px) {
  .update-view-tabs { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
  .update-view-tab { padding-inline: 8px; }
  .update-person-filter { align-items: stretch; }
  .update-person-filter select { width: 100%; min-width: 0; }
  .daily-digest-card { padding: 14px; }
  .daily-digest-head { display: grid; }
  .daily-digest-statuses { justify-content: flex-start; }
  .daily-digest-body { min-height: 360px; font-size: 11.5px; }
  .daily-digest-actions .btn { flex: 1 1 140px; }
}

.effect-saving {
  display: inline-block; margin-left: 8px; padding: 2px 7px;
  border-radius: 999px; background: var(--green-soft); color: var(--green-deep);
  font-size: 11px; font-weight: 700;
}

.admin-status {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff;
}
.admin-status b { padding: 3px 9px; border-radius: 999px; font-size: 11px; }
.admin-status .enabled { background: var(--green-soft); color: var(--green-deep); }
.admin-status .disabled { background: var(--pink-soft); color: var(--pink-deep); }

.privacy-check-overlay {
  z-index: 220; justify-content: center; align-items: center; padding: 18px;
  background: rgba(30, 25, 15, .66);
}
.privacy-check-card {
  width: min(540px, 94vw); background: #fff; border: 2px solid var(--ink);
  border-radius: 14px; padding: 28px; box-shadow: 8px 8px 0 var(--ink); text-align: center;
}
.privacy-check-card h2 {
  font-family: var(--serif); font-size: 21px; line-height: 1.55;
  letter-spacing: .04em; margin: 8px 0 12px;
}
.privacy-check-card p { color: var(--muted); line-height: 1.8; }
.privacy-check-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 12px;
}
.privacy-check-actions .btn { min-height: 48px; }
.privacy-check-cancel {
  border: none; background: transparent; color: var(--muted);
  text-decoration: underline; cursor: pointer; padding: 8px;
}
.privacy-warning-icon {
  display: inline-grid; place-items: center; width: 58px; height: 58px;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--pink);
  box-shadow: 4px 4px 0 var(--ink); font-size: 28px; font-weight: 800;
}
#privacy-check-rejected strong { color: var(--pink-deep); font-size: 17px; }

@media (max-width: 560px) {
  .privacy-check-actions { grid-template-columns: 1fr; }
  .attachment-gallery, .attachment-pending { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .update-row { grid-template-columns: 24px 72px minmax(0, 1fr) 12px; gap: 6px; padding: 7px 8px; }
  .update-theme { display: none; }
  .update-time { font-size: 9.5px; }
  .update-text { font-size: 11.5px; }
  .update-person-entry { grid-template-columns: 1fr; padding-bottom: 8px; }
  .update-confirm-button, .update-confirmed-mark { justify-self: end; margin-right: 8px; }
}

.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: var(--shadow); letter-spacing: .03em;
}

/* ---------- 使い方チュートリアル ---------- */
.tour-layer {
  position: fixed; inset: 0; z-index: 300;
  background: transparent; cursor: default;
}
.tour-spotlight {
  position: fixed; z-index: 301; pointer-events: none;
  border: 3px solid var(--yellow); border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(28, 28, 28, .68), var(--pop-card);
}
.tour-action-cue {
  position: fixed; z-index: 303;
  display: grid; place-items: center;
  border: none; padding: 0; background: transparent; color: var(--ink);
  pointer-events: auto; cursor: pointer;
}
.tour-action-visual {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.tour-action-cue[data-placement="tab"] .tour-action-visual {
  position: absolute; top: calc(100% + 8px); left: 50%;
  gap: 3px; transform: translateX(-50%);
}
.tour-action-pointer {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 2px solid var(--ink); border-radius: 50%;
  background: var(--yellow); box-shadow: var(--pop-mini);
  font-size: 21px; line-height: 1;
}
.tour-action-cue.playing .tour-action-pointer {
  animation: tourPointerTap .62s var(--bounce) both, tourPointerWait 1.5s .8s ease-in-out infinite;
}
.tour-action-cue:hover .tour-action-pointer { background: #fff75d; }
.tour-action-cue:focus-visible { outline: none; }
.tour-action-cue:focus-visible .tour-action-pointer { outline: 3px solid var(--blue); outline-offset: 3px; }
.tour-action-cue strong {
  padding: 3px 10px; border: 1.5px solid var(--ink); border-radius: 999px;
  background: #fff; box-shadow: var(--pop-mini);
  font-size: 11.5px; line-height: 1.5; white-space: nowrap;
}
@keyframes tourPointerTap {
  0% { opacity: 0; transform: translateY(8px) scale(.8) rotate(-8deg); }
  35% { opacity: 1; transform: translateY(-3px) scale(1.08) rotate(0); }
  65% { transform: translateY(2px) scale(.92); box-shadow: 0 0 0 7px rgba(255, 242, 16, .28), 1px 1px 0 var(--ink); }
  100% { opacity: 1; transform: none; box-shadow: var(--pop-mini); }
}
@keyframes tourPointerWait {
  0%, 65%, 100% { transform: none; }
  78% { transform: translateY(2px) scale(.94); box-shadow: 0 0 0 7px rgba(255, 242, 16, .24), 1px 1px 0 var(--ink); }
}
.tour-arrival { animation: tourArrival .65s ease both; }
.detail-panel.tour-arrival { animation: tourDetailArrival .72s var(--bounce) both; }
.detail-head.tour-arrival-focus { animation: tourDetailFocus .85s ease both; }
.tab.tour-arrival { animation: tourTabArrival .8s var(--bounce) both; }
@keyframes tourArrival {
  from { opacity: .45; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes tourDetailArrival {
  0% { opacity: .25; transform: translateX(76px); }
  70% { opacity: 1; transform: translateX(-4px); }
  100% { opacity: 1; transform: none; }
}
@keyframes tourDetailFocus {
  0%, 100% { background: transparent; box-shadow: none; }
  35%, 65% { background: var(--yellow-soft); box-shadow: 0 0 0 6px var(--yellow); }
}
@keyframes tourTabArrival {
  0%, 100% { transform: none; }
  45% {
    transform: translateY(-3px) scale(1.05);
    background: var(--yellow);
    box-shadow: 0 0 0 4px rgba(255, 242, 16, .3);
  }
}
.tour-card {
  position: fixed; z-index: 302; top: 12px; left: 12px;
  width: min(380px, calc(100vw - 24px));
  background: #fff; border: 2px solid var(--ink); border-radius: 14px;
  padding: 20px; box-shadow: 7px 7px 0 var(--ink);
}
.tour-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.tour-progress {
  font-family: Montserrat, var(--sans); font-size: 12px; font-weight: 700;
  letter-spacing: .14em; color: var(--blue-deep);
}
.tour-location {
  display: inline-block; max-width: 100%; margin: 0 0 9px;
  padding: 3px 10px; border-radius: 999px;
  color: var(--blue-deep); background: var(--blue-soft);
  border: 1px solid var(--blue); font-size: 11.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tour-close {
  border: none; background: none; color: var(--muted);
  font-size: 12.5px; text-decoration: underline; padding: 2px 4px;
}
.tour-close:hover { color: var(--ink); }
.tour-card h2 {
  font-family: var(--serif); font-size: 19px; letter-spacing: .04em;
  margin-bottom: 8px; line-height: 1.5;
}
.tour-card p { color: var(--muted); font-size: 13.5px; line-height: 1.8; }
.tour-actions {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 18px;
}
.tour-actions .btn:disabled {
  opacity: .35; cursor: default; transform: none; box-shadow: 1px 1px 0 var(--ink);
}

@media (max-width: 640px) {
  main { padding: 20px 14px 80px; }
  .field-grid { grid-template-columns: 92px 1fr; }
  .detail-panel { width: 100vw; }
  .kpi-value { font-size: 23px; }
  .block-head h2 { font-size: 17px; }
  .matrix-wrap th:first-child, .matrix-wrap td:first-child { min-width: 150px; }
  .tour-card { padding: 17px; }
  .tour-card h2 { font-size: 17px; }
  .author-search-row { align-items: stretch; }
  .author-search-row .btn { padding-inline: 12px; }
  .member-quick-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .agenda-card { padding: 15px; }
  .agenda-card-head h3 { display: block; margin: 7px 0 0; font-size: 16px; }
  .agenda-record dl { grid-template-columns: 1fr; gap: 3px; }
}
