/* ノーション風パレット：白基調・墨色テキスト・落ち着いたアクセント */
:root {
  --bg: #fbfbfa;
  --bg-soft: #f1f1ef;
  --card: #ffffff;
  --text: #37352f;
  --muted: #787774;
  --line: #e9e9e7;

  --teal: #0f7b6c;
  --teal-soft: #ddedea;
  --pink: #c14c8a;
  --pink-soft: #faf1f5;
  --lav: #9065b0;
  --lav-soft: #f6f3f9;
  --amber: #cb912f;
  --amber-soft: #fbf3db;
  --coral: #d44c47;
  --coral-soft: #fdebec;
  --green: #448361;
  --green-soft: #edf3ec;
  --blue: #337ea9;
  --blue-soft: #e7f3f8;
  --accent: #2383e2;
  --accent-soft: #e7f3f8;

  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 15, 15, 0.06), 0 0 0 1px rgba(15, 15, 15, 0.02);
  --shadow-sm: 0 1px 2px rgba(15, 15, 15, 0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
}

/* App bar */
.appbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.appbar-inner {
  max-width: 920px; margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { font-size: 30px; line-height: 1; }
.brand-text h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .01em; color: var(--text); }
.brand-text p { margin: 0; font-size: 12px; color: var(--muted); }

/* Layout */
.view { max-width: 920px; margin: 18px auto 0; padding: 0 16px; }
.footer { max-width: 920px; margin: 24px auto 0; padding: 0 16px; }
.footer p { font-size: 12px; color: var(--muted); text-align: center; }

/* Cards */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
  border: 1px solid var(--line);
}
.card h2 { margin: 0 0 14px; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card h3 { margin: 18px 0 10px; font-size: 15px; font-weight: 800; color: var(--text); }
.section-accent { width: 6px; height: 22px; border-radius: 6px; display: inline-block; }

/* Buttons */
.btn {
  font-family: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer;
  background: #fff; color: var(--text);
  transition: background .12s ease, box-shadow .12s ease;
}
.btn:hover { background: var(--bg-soft); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1a73c9; }
.btn-solid { background: var(--pink); color: #fff; box-shadow: 0 4px 14px rgba(236,72,153,.35); }
.btn-teal { background: var(--teal); color: #fff; box-shadow: 0 4px 14px rgba(18,181,166,.3); }
.btn-ghost { background: var(--bg-soft); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Empty state */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 46px; margin-bottom: 8px; }

/* User list */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.user-card {
  background: var(--card); border-radius: var(--radius); padding: 16px; cursor: pointer;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .08s ease, box-shadow .15s ease;
}
.user-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.user-card .avatar {
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 18px; margin-bottom: 10px;
}
.user-card .name { font-weight: 800; font-size: 17px; }
.user-card .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--teal-soft); color: #0c7a6f; margin-top: 8px;
}

/* Tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  border: none; background: var(--card); color: var(--muted); font-family: inherit;
  font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.tab { box-shadow: none; }
.tab:hover { background: var(--bg-soft); }
.tab.active { background: var(--text); color: #fff; border-color: var(--text); box-shadow: none; }

.backlink { background: none; border: none; color: var(--muted); font-family: inherit; font-size: 14px; cursor: pointer; padding: 6px 0; margin-bottom: 6px; font-weight: 700; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field input[type=text], .field input[type=date], .field input[type=number], .field textarea, .field select {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--text);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.field textarea { min-height: 80px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 540px) { .grid-2 { grid-template-columns: 1fr; } }

/* Segmented (click assessment) */
.assess-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.assess-row .lab { font-weight: 700; font-size: 14px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
  font-family: inherit; font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  transition: all .1s ease;
}
.seg button:active { transform: scale(.96); }
.seg button.on { color: #fff; border-color: transparent; }
.seg button.on.lvl0 { background: var(--green); }
.seg button.on.lvl1 { background: var(--teal); }
.seg button.on.lvl2 { background: var(--amber); }
.seg button.on.lvl3 { background: var(--coral); }
.seg button.on.neutral { background: var(--lav); }
@media (max-width: 540px) { .assess-row { grid-template-columns: 1fr; gap: 4px; } }

/* method tag */
.mtag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.mtag.future { background: var(--bg-soft); color: var(--muted); }
.mtag.now { background: var(--green-soft); color: #1c7a4d; }

/* Genogram */
.geno-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.geno-wrap svg { display: block; width: 100%; height: auto; background: #fbfbfa; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* family list */
.fam-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; background: #fff; }
.fam-item .fi-icon { width: 34px; height: 34px; border-radius: 8px; display:flex; align-items:center; justify-content:center; font-weight:800; color:#fff; flex: none; }
.fam-item .fi-main { flex: 1; min-width: 0; }
.fam-item .fi-main .n { font-weight: 700; }
.fam-item .fi-main .s { font-size: 12px; color: var(--muted); }
.fam-item .fi-del { background: var(--coral-soft); color: var(--coral); border: none; border-radius: 8px; padding: 6px 10px; font-weight: 800; cursor: pointer; font-family: inherit; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s ease; z-index: 50; }
.toast.show { opacity: 1; }

/* AI処理中オーバーレイ（結果が出るまで表示） */
.busy-overlay { position: fixed; inset: 0; background: rgba(44,39,51,0.45); display: none; align-items: center; justify-content: center; z-index: 200; }
.busy-box { background: #fff; border-radius: 16px; padding: 26px 30px; box-shadow: var(--shadow); text-align: center; min-width: 220px; }
.busy-spin { width: 44px; height: 44px; margin: 0 auto 14px; border: 4px solid var(--teal-soft); border-top-color: var(--teal); border-radius: 50%; animation: busy-rot .8s linear infinite; }
@keyframes busy-rot { to { transform: rotate(360deg); } }
.busy-msg { font-weight: 800; font-size: 15px; color: var(--text); }
.busy-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 登録済み家族の編集カード */
.fam-edit { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; background: #fff; }
.fam-edit .fe-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fam-edit .fe-title { flex: 1; min-width: 0; font-weight: 800; }

/* 課題整理総括表：ニーズのかんたん入力（横スクロール不要の縦並び） */
.need-panel { margin-top: 16px; padding: 14px; border: 1px solid var(--teal-soft); border-radius: 12px; background: var(--bg-soft); }
.need-panel h3 { margin: 0 0 4px; font-size: 15px; }
.need-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; }
.need-row label { flex: 0 0 96px; padding-top: 8px; font-size: 13px; font-weight: 800; color: var(--text); }
.need-row textarea { flex: 1; min-width: 0; width: 100%; font-family: inherit; font-size: 15px; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px; min-height: 40px; resize: vertical; background: #fff; }
.need-row textarea:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }

.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* 居住・チェック行（家族フォーム） */
.checkrow { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.checkrow label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.miniseg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.miniseg button { border: none; background: #fff; color: var(--muted); font-family: inherit; font-weight: 700; font-size: 13px; padding: 7px 14px; cursor: pointer; }
.miniseg button.on { background: var(--teal); color: #fff; }
.miniseg button.on.away { background: var(--coral); }

/* 和暦入力 */
.wareki { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wareki select, .wareki input { width: auto; }
.wareki .y { width: 64px; } .wareki .md { width: 56px; }
.datemode { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.datemode button { border: none; background: #fff; color: var(--muted); font-family: inherit; font-weight: 700; font-size: 13px; padding: 6px 14px; cursor: pointer; }
.datemode button.on { background: var(--lav); color: #fff; }
.calc-age { font-size: 13px; color: var(--teal); font-weight: 700; margin-top: 6px; }

/* 詳細ボタン（細分化トリガ） */
.detail-btn { border: 1.5px solid var(--lav); background: var(--lav-soft); color: #5b3fa8; font-family: inherit; font-weight: 700; font-size: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer; margin-left: 6px; white-space: nowrap; }
.detail-btn .cnt { background: var(--lav); color: #fff; border-radius: 999px; padding: 0 6px; margin-left: 4px; font-size: 11px; }
.assess-row .right { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* モーダル（細分化 別画面） */
.modal-overlay { position: fixed; inset: 0; background: rgba(44,39,51,0.45); display: flex; align-items: flex-end; justify-content: center; z-index: 100; }
@media (min-width: 600px){ .modal-overlay { align-items: center; } }
.modal { background: #fff; width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.2); }
@media (min-width: 600px){ .modal { border-radius: 20px; } }
.modal-head { position: sticky; top: 0; background: #fff; color: var(--text); padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-head .x { background: var(--bg-soft); border: none; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; font-size: 16px; cursor: pointer; font-weight: 700; }
.modal-head .x:hover { background: var(--line); }
.modal-body { padding: 16px 18px 24px; }
.modal-body .src { font-size: 12px; color: var(--muted); background: var(--bg-soft); padding: 8px 12px; border-radius: 10px; margin-bottom: 14px; }
.sub-row { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.sub-row .sl { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.modal-foot { padding: 0 18px 20px; }

/* アラート */
.alert { border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; border-left: 6px solid; }
.alert .at { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.alert .am { font-size: 13px; margin-top: 4px; color: var(--text); }
.alert.sev-減算 { background: var(--coral-soft); border-color: var(--coral); }
.alert.sev-減算 .at { color: #a32d2d; }
.alert.sev-注意 { background: var(--amber-soft); border-color: var(--amber); }
.alert.sev-注意 .at { color: #854f0b; }
.alert.sev-情報 { background: var(--blue-soft); border-color: var(--blue); }
.alert.sev-情報 .at { color: #0c447c; }
.sev-badge { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; color: #fff; }
.sev-badge.減算 { background: var(--coral); } .sev-badge.注意 { background: var(--amber); } .sev-badge.情報 { background: var(--blue); }
.alert details { margin-top: 8px; }
.alert details summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
.alert .prov { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 6px; font-size: 12px; }
.alert .prov .pr { font-weight: 800; color: var(--lav); }
.ok-banner { background: var(--green-soft); border-radius: var(--radius-sm); padding: 14px; color: #1c7a4d; font-weight: 700; text-align: center; }

/* リマインド */
.remind { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; }
.remind .rl { flex: 1; }
.remind .rl .t { font-weight: 700; font-size: 14px; } .remind .rl .s { font-size: 12px; color: var(--muted); }
.remind .badge { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.badge-ok { background: var(--green-soft); color: #1c7a4d; } .badge-warn { background: var(--coral-soft); color: var(--coral); }

/* 計画チェック */
.planchk { display: flex; flex-wrap: wrap; gap: 14px; }
.planchk label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--text); }

/* 記録 */
.rec-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; }
.rec-item .rh { display: flex; align-items: center; gap: 8px; }
.rec-tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--lav-soft); color: #5b3fa8; }
.rec-item .rd { font-size: 12px; color: var(--muted); }
.rec-item .rc { font-size: 14px; margin-top: 4px; white-space: pre-wrap; }
.rec-item .rx { margin-left: auto; background: var(--coral-soft); color: var(--coral); border: none; border-radius: 8px; padding: 4px 10px; font-weight: 800; cursor: pointer; font-family: inherit; font-size: 12px; }

/* 計画書サブナビ */
.plan-subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.plan-subnav button { border: 1.5px solid var(--line); background: #fff; color: var(--muted); font-family: inherit; font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.plan-subnav button.on { background: var(--teal); color: #fff; border-color: transparent; }

/* 帳票 */
.doc-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.doc-title h2 { margin: 0; }
.doc-meta { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.doc-field { margin-bottom: 12px; }
.doc-field label { display: block; font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.doc-field textarea { width: 100%; font-family: inherit; font-size: 15px; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; min-height: 64px; resize: vertical; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.doc { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.doc th, table.doc td { border: 1px solid var(--line); padding: 6px; vertical-align: top; text-align: left; }
table.doc th { background: var(--bg-soft); font-weight: 800; font-size: 12px; white-space: nowrap; }
table.doc td .axis { font-weight: 800; white-space: nowrap; }
table.doc textarea, table.doc input, table.doc select { width: 100%; border: none; background: transparent; font-family: inherit; font-size: 13px; resize: vertical; min-height: 28px; }
table.doc textarea:focus, table.doc input:focus, table.doc select:focus { outline: 2px solid var(--pink-soft); border-radius: 4px; }
.matome dl { margin: 0; } .matome dt { font-weight: 800; font-size: 13px; color: var(--lav); margin-top: 12px; }
.matome dd { margin: 4px 0 0; font-size: 14px; }
.matome .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.matome .chip2 { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--coral-soft); color: var(--coral); font-weight: 700; }
.matome .chip2.ok { background: var(--green-soft); color: #1c7a4d; }

@media print {
  .appbar, .footer, .tabs, .backlink, .plan-subnav, .btn, .no-print, .rx, .fi-del, .mtag,
  .ai-row, .ai-hint, .fp-toolbar, .fp-hint { display: none !important; }
  body { background: #fff; padding: 0; }
  .view { margin: 0; padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; margin-bottom: 10px; }
  table.doc { min-width: 0; font-size: 11px; }
}

/* ヘッダー操作 */
.appbar-actions { display: flex; align-items: center; gap: 8px; }
.btn-icon { background: transparent; border: none; color: var(--text); width: 38px; height: 38px; border-radius: 8px; font-size: 18px; padding: 0; }
.btn-icon:hover { background: var(--bg-soft); }
.know-badge { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }

/* AIボタン */
.ai-btn { border: 1.5px solid var(--lav); background: var(--lav-soft); color: #5b3fa8; font-family: inherit; font-weight: 800; font-size: 12px; padding: 6px 12px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.ai-btn:active { transform: scale(.97); }
.ai-btn[disabled] { opacity: .5; cursor: not-allowed; }
.ai-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; align-items: center; }
.ai-hint { font-size: 11px; color: var(--muted); }
.ai-busy { font-size: 12px; color: var(--lav); font-weight: 700; }

/* 同意ボックス */
.consent { background: var(--amber-soft); border: 1px solid var(--amber); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 14px; }
.consent label { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 700; color: #6b4e0b; cursor: pointer; }
.consent .sub { font-size: 11px; color: #8a6a14; margin-top: 4px; font-weight: 400; }

/* 設定画面 */
.setrow { margin-bottom: 14px; }
.setrow label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.setrow input { width: 100%; font-family: inherit; font-size: 15px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.set-status { font-size: 13px; font-weight: 800; padding: 8px 12px; border-radius: 8px; margin-top: 8px; display: none; }
.set-status.ok { display: block; background: var(--green-soft); color: #1c7a4d; }
.set-status.ng { display: block; background: var(--coral-soft); color: var(--coral); }

/* 録音モーダル */
.dictate { text-align: center; padding: 8px 4px; }
.dictate .mic { width: 84px; height: 84px; border-radius: 50%; background: var(--coral); color: #fff; font-size: 36px; display: flex; align-items: center; justify-content: center; margin: 8px auto 14px; }
.dictate .mic.rec { animation: pulse 1.1s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(243,96,60,.5);} 70%{box-shadow:0 0 0 18px rgba(243,96,60,0);} 100%{box-shadow:0 0 0 0 rgba(243,96,60,0);} }
.dictate .live { min-height: 80px; text-align: left; background: var(--bg-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; margin-bottom: 12px; }
.dictate .live .interim { color: var(--muted); }

/* 間取り・住環境 */
.floorplan { background: #fbfbfa; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.room { border: 2px solid var(--teal); border-radius: 10px; padding: 8px 10px; background: var(--teal-soft); }
.room .rn { font-weight: 800; font-size: 14px; color: #0c7a6f; }
.room .rnote { font-size: 12px; color: var(--text); margin-top: 2px; }
.risk-list { display: flex; flex-wrap: wrap; gap: 6px; }
.risk-list .r { font-size: 12px; background: var(--coral-soft); color: var(--coral); padding: 3px 9px; border-radius: 999px; font-weight: 700; }

/* 間取り図エディタ */
.fp-editor { margin-top: 10px; }
.fp-svg { width: 100%; height: auto; display: block; touch-action: none; border: 1px solid var(--line); border-radius: 12px; background: #fff; user-select: none; -webkit-user-select: none; }
.fp-toolbar { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.fp-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fp-lab { font-size: 12px; font-weight: 800; color: var(--muted); margin-right: 2px; }
.fp-chip { border: 1.5px solid var(--teal); background: var(--teal-soft); color: #0c7a6f; font-family: inherit; font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.fp-chip:active { transform: scale(.96); }
.fp-chip.ghost { border-color: var(--lav); background: var(--lav-soft); color: #5b3fa8; }
.fp-chip.mark { background: #fff; }
.fp-hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* 撮影ガイド（モーダル内） */
.spot { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fbfbfa; }
.spot-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spot-head b { font-size: 14px; flex: 1; min-width: 140px; }
.spot-cnt { font-size: 12px; font-weight: 800; color: #fff; background: var(--pink); border-radius: 999px; padding: 2px 9px; cursor: pointer; }
.spot-tips { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 第3表 週間 */
.wk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; min-width: 560px; }
.wk-col { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.wk-day { background: var(--teal-soft); color: #0c7a6f; font-weight: 800; font-size: 12px; text-align: center; padding: 5px; }
.wk-block { border-top: 1px dashed var(--line); padding: 5px 6px; }
.wk-time { font-size: 10px; color: var(--muted); font-weight: 700; }
.wk-c { font-size: 11px; color: var(--text); }
.wk-empty { color: #ddd; text-align: center; font-size: 11px; padding: 8px; }
.chk { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; margin-right: 10px; }

/* 第4表 出席者 */
.att-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.att-row input { flex: 1; min-width: 0; font-family: inherit; font-size: 14px; border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.att-row .rx { flex: none; }

/* ---------- 📚 知識ノート（ノーション風ブロック） ---------- */
#know-q { width: 100%; font-family: inherit; font-size: 15px; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg-soft); margin: 4px 0 10px; }
#know-q:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.know-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.know-nav-btn { border: none; background: transparent; color: var(--muted); font-family: inherit; font-weight: 600; font-size: 14px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.know-nav-btn:hover { background: var(--bg-soft); }
.know-nav-btn.on { background: var(--bg-soft); color: var(--text); font-weight: 700; }
.mini-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 700; padding: 0 4px; vertical-align: 2px; }
.know-item { border-bottom: 1px solid var(--line); }
.know-item:last-child { border-bottom: none; }
.know-item summary { list-style: none; cursor: pointer; padding: 9px 6px; font-weight: 600; font-size: 14px; border-radius: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.know-item summary::-webkit-details-marker { display: none; }
.know-item summary::before { content: "▸"; color: var(--muted); font-size: 12px; transition: transform .12s ease; }
.know-item[open] summary::before { transform: rotate(90deg); }
.know-item summary:hover { background: var(--bg-soft); }
.know-a { padding: 2px 10px 12px 24px; font-size: 14px; color: var(--text); line-height: 1.7; }
.know-p { margin-bottom: 3px; }
.know-tag { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--bg-soft); border-radius: 4px; padding: 1px 6px; }
.know-basis { font-size: 12px; color: var(--muted); margin-top: 8px; }
.know-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.callout { display: block; background: var(--bg-soft); border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.7; margin: 10px 0; }
.callout.ok { background: var(--green-soft); }
.callout.warn { background: var(--amber-soft); }
.news-item { display: block; padding: 9px 10px; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.news-item:hover { background: var(--bg-soft); }
.news-item.read { color: var(--muted); font-weight: 400; }
.fp-chip.on { background: var(--text); border-color: var(--text); color: #fff; }
