/*
  メッセンジャー＋（#13・2026-10-26 に人が選んだ案 7）の一覧・トーク・頭・右の書類。部品は src/web/room.tsx。
  浮く物（.pop）・ボタン（.btn）・カレンダー・トーストは app.css のものを使う。

  決まり（試作 https://claude.ai/artifact/8cFU8irK9skB6g4XYQNACu の案 1・7 と同じ値）
  - 字：22（一覧の頭）・17（トークの題）・15.5（吹き出し・本文）・13（補い）・12（札の名前）・11（時刻）。太さは 400・500・700
  - 吹き出し：角 18／続けたときの内側 6・内側 8/12・最大 72%。自分は紺（アイコンの地の色）、相手は白に 1px
  - 一覧の行：組織の印 44（角 12）・4 段。頭の事実：小さな名前と値・押すとその場で変える
  - 色：地は緑みの灰・強い色は自分の吹き出しの紺と「あなたの対応」の橙だけ。状態は点と字
  - 書類の欄：PC は右に 440（影で浮かせて「開いている」と分かるように）。スマホは下から 92% のシート
  - 明るい地だけ。すりガラス（backdrop-filter）は使わない（浮く物の基準が帯に取られる不具合のもと）
*/
body.app {
  --ground: #f2f3f0;
  --paper: #ffffff;
  --l1: #e4e6e1;
  --l2: #d3d7d0;
  --ink: #1b1f1d;
  --sub: #5c645f;
  --faint: #8b928d;
  --acc: #2f64e6;
  --acc-soft: #eaf0fd;
  --need: #a5560a;
  --need-soft: #fdf1df;
  --me: #15213b;
  --ok: #2a7a51;
  --ok-soft: #e9f4ee;
  background: var(--paper);
  height: 100dvh;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0;
}
body.app #main { padding: 0; margin: 0; max-width: none; height: 100dvh; }
body.app .num, body.app time { font-variant-numeric: tabular-nums; }
body.app svg { flex: none; }
.app-grid { display: grid; height: 100dvh; grid-template-columns: 340px minmax(0, 1fr); }
.room-page.with-doc { grid-template-columns: 320px minmax(0, 1fr) 440px; }
.room-page.with-doc.doc-auto { grid-template-columns: 320px minmax(0, 1fr) 440px; }
@media (max-width: 1199px) {
  .room-page.with-doc { grid-template-columns: minmax(0, 1fr) 420px; }
  .room-page.with-doc .side { display: none; }
}
.ibtn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 0; background: none; color: var(--ink); flex: none; }
.ibtn:hover, .ibtn[aria-pressed="true"] { background: var(--ground); }
.ibtn svg { width: 22px; height: 22px; }
.faint { color: var(--faint); }
.none { color: var(--faint); font-size: 14px; padding: 24px 16px; text-align: center; }
.pc-only-inline { margin-left: 6px; font-size: 13px; }

/* ---- 顔・状態 ---- */
.face { --s: 32px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: #6b7280; color: #fff; font-size: calc(var(--s) * 0.42); font-weight: 700; line-height: 1; }
.face.h0 { background: hsl(0 22% 46%); }
.face.h1 { background: hsl(30 22% 46%); }
.face.h2 { background: hsl(60 22% 46%); }
.face.h3 { background: hsl(95 22% 46%); }
.face.h4 { background: hsl(140 22% 46%); }
.face.h5 { background: hsl(170 22% 46%); }
.face.h6 { background: hsl(195 22% 46%); }
.face.h7 { background: hsl(215 22% 46%); }
.face.h8 { background: hsl(240 22% 46%); }
.face.h9 { background: hsl(265 22% 46%); }
.face.h10 { background: hsl(295 22% 46%); }
.face.h11 { background: hsl(330 22% 46%); }
.face.s { --s: 22px; }
.faces { display: inline-flex; }
.faces .face + .face { margin-left: -6px; box-shadow: 0 0 0 2px var(--paper); }
.stt { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; white-space: nowrap; color: var(--ink); }
.stt i { width: 7px; height: 7px; border-radius: 50%; background: #a2a7a3; }
.stt.yellow i { background: #c99400; } .stt.blue i { background: #2f64e6; } .stt.orange i { background: #e07b12; }
.stt.green i { background: #2f9461; } .stt.gray i { background: #a2a7a3; } .stt.red i { background: #d64545; }

/* ---- 一覧の列 ---- */
.side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--l1); background: var(--paper); }
.side-top { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 8px 16px; }
.side-top .mark svg { width: 28px; height: 28px; display: block; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 12px; background: var(--ground); color: var(--faint); min-width: 0; }
.search svg { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; min-height: 0; height: 36px; padding: 0; border: 0; box-shadow: none !important; background: none; outline: none; font-size: 15px; color: var(--ink); }
.side-top .menu { position: relative; }
.side-top .menu > summary { list-style: none; }
.side-top .menu > summary::-webkit-details-marker { display: none; }
.views { display: flex; gap: 18px; margin: 0 16px 4px; border-bottom: 1px solid var(--l1); }
.views a { display: inline-flex; align-items: center; gap: 6px; height: 36px; font-size: 13px; color: var(--sub); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.views a svg { width: 16px; height: 16px; }
.views a[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.side-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 24px; }
.sec { display: flex; align-items: baseline; gap: 6px; padding: 16px 16px 4px; font-size: 13px; font-weight: 700; color: var(--sub); }
.sec small { font-weight: 500; color: var(--faint); }
.sec.me { color: var(--need); }
.li { display: flex; gap: 12px; padding: 10px 16px; position: relative; line-height: 1.45; }
.li::after { content: ""; position: absolute; left: 72px; right: 0; bottom: 0; border-bottom: 1px solid var(--l1); }
.li:hover { background: #f8f9f7; }
.li.on { background: var(--acc-soft); }
.li.closed { opacity: 0.7; }
.li-org { width: 44px; height: 44px; border-radius: 12px; background: #e9ebe7; color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 17px; flex: none; margin-top: 2px; }
.li-main { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.li-1, .li-2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.li-1 b { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-1 time { font-size: 12px; color: var(--faint); }
.li-prev { flex: 1; min-width: 0; font-size: 14px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-todo { height: 20px; padding: 0 7px; border-radius: 10px; background: var(--need-soft); color: var(--need); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; white-space: nowrap; margin-left: 8px; }
.li-3, .li-4 { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; min-height: 20px; }
.li-3 { margin-top: 2px; }
.li-4 .faces { margin-left: auto; }

/* 依頼者：お願いしていること */
.asks { padding: 6px 16px 14px; border-bottom: 8px solid var(--ground); display: grid; gap: 12px; }
.asks-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--need); padding-top: 6px; }
.asks-h b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--need); color: #fff; display: grid; place-items: center; font-size: 11.5px; }
.ask { display: grid; gap: 6px; }
.ask-p { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--sub); }
.ask-p svg { width: 14px; height: 14px; }
.ask .card { width: 100%; }
.board-asks { padding: 16px 24px; max-width: 560px; }

/* PC の表 */
.board { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--paper); }
.board-h { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px; border-bottom: 1px solid var(--l1); flex: none; }
.board-h h1 { font-size: 17px; font-weight: 700; }
.board-h .btn { margin-left: auto; }
.tbl-wrap { flex: 1; overflow: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; background: var(--paper); text-align: left; font-weight: 500; font-size: 12px; color: var(--faint); height: 36px; padding: 0 12px; border-bottom: 1px solid var(--l1); white-space: nowrap; z-index: 1; }
.tbl td { height: 52px; padding: 0 12px; border-bottom: 1px solid var(--l1); white-space: nowrap; position: relative; }
.tbl .r { text-align: right; }
.tbl th:first-child, .tbl td:first-child { padding-left: 24px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 24px; }
.tbl td:first-child a { font-weight: 700; }
.tbl td .stretch::after { content: ""; position: absolute; inset: 0; }
.tbl .grp td { height: 34px; background: #f7f8f6; font-size: 12px; font-weight: 700; color: var(--sub); }
.tbl .grp.me td { color: var(--need); }
.tbl .grp small { color: var(--faint); font-weight: 400; margin-left: 8px; }
.tbl .tr:hover td { background: #fafbf9; }
.tbl td.hot { color: var(--need); font-weight: 700; }
.tbl td.sub { color: var(--sub); font-size: 12.5px; }

/* ---- トーク ---- */
.talk { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); position: relative; }
.rh { display: flex; align-items: center; gap: 6px; min-height: 60px; padding: env(safe-area-inset-top, 0px) 12px 0 20px; border-bottom: 1px solid var(--l1); flex: none; }
.rh .back { display: none; }
.rh-t { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.rh-t h1 { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-t span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.und { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--need-soft); color: var(--need); font-size: 13px; font-weight: 700; white-space: nowrap; }
.und b { font-size: 15px; }
.und:hover { background: #fbe6cc; }
.rh .docs { width: auto; padding: 0 10px; gap: 2px; display: inline-flex; align-items: center; }
.rh .docs[aria-pressed="true"] { background: var(--acc-soft); color: var(--acc); }

/* 頭の事実 */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 2px 8px; padding: 6px 12px 8px; border-bottom: 1px solid var(--l1); background: var(--paper); flex: none; transition: padding 0.2s; }
.fact { position: relative; min-width: 0; }
.fact > summary, .fact:not(details) { display: grid; gap: 0; padding: 6px 8px; border-radius: 10px; list-style: none; min-width: 0; }
.fact > summary::-webkit-details-marker { display: none; }
.fact.can > summary { cursor: pointer; }
.fact.can > summary:hover, .fact.can[open] > summary { background: var(--ground); }
.fact small { font-size: 11px; color: var(--faint); line-height: 1.4; }
.fact .v { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.fact.hot .v { color: var(--need); font-weight: 700; }
.fact-pop { min-width: 240px; }
.fact-pop.wide { width: 340px; max-width: calc(100vw - 24px); }
.fact-form { display: grid; gap: 10px; padding: 4px 6px 6px; }
.fact-form input[type="time"] { width: 100%; min-height: 44px; border: 0; border-radius: 10px; padding: 0 12px; font-size: 16px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--l2); }
.fact-form .dt { display: grid; grid-template-columns: 1fr 108px; gap: 8px; }
.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.ppl { display: grid; gap: 2px; padding: 0 4px 6px; }
.ppl li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.ppl-n { flex: 1; display: grid; font-size: 14px; line-height: 1.35; }
.ppl-n small { font-size: 12px; color: var(--faint); }
.invite { display: grid; gap: 8px; padding: 6px 6px 4px; border-top: 1px solid var(--l1); margin-top: 4px; }
.invite .row-end select { width: auto; flex: 1; }
.pad { padding: 4px 8px 8px; }
/* 会話を遡っているあいだは 1 行に縮める */
.facts.compact { grid-template-columns: repeat(4, auto) minmax(0, 1fr); padding: 2px 12px; }
.facts.compact .more, .facts.compact small { display: none; }
.facts.compact .fact > summary, .facts.compact .fact:not(details) { padding: 4px 8px; }

.todo { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--need-soft); color: var(--need); font-size: 14px; flex: none; }
.todo span { flex: 1; }
.todo svg { width: 18px; height: 18px; }

.chat { flex: 1; overflow-y: auto; background: var(--ground); padding: 4px max(20px, calc((100% - 760px) / 2)) 20px; overscroll-behavior: contain; }
.day { display: flex; justify-content: center; margin: 16px 0 6px; }
.day span { height: 24px; padding: 0 12px; border-radius: 12px; background: rgb(27 31 29 / 7%); color: var(--sub); font-size: 12px; display: grid; place-items: center; }
.event { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--sub); margin: 14px 0 0; text-align: center; }
.event svg { width: 14px; height: 14px; color: var(--ok); }
.event time { color: var(--faint); font-size: 11px; }
.g { display: flex; gap: 8px; margin-top: 14px; align-items: flex-start; }
.g.me { justify-content: flex-end; }
.gcol { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; max-width: min(72%, 560px); min-width: 0; }
.g.them .gcol { justify-items: start; }
.g.me .gcol { justify-items: end; }
.who { font-size: 12px; font-weight: 700; color: var(--ink); padding-left: 2px; display: flex; gap: 6px; align-items: baseline; }
.who small { font-weight: 400; color: var(--faint); font-size: 11px; }
.m { display: flex; flex-direction: column; gap: 3px; position: relative; max-width: 100%; }
.g.them .m { align-items: flex-start; }
.g.me .m { align-items: flex-end; }
.b { padding: 8px 12px; border-radius: 18px; background: var(--paper); border: 1px solid var(--l1); font-size: 15.5px; line-height: 1.6; overflow-wrap: anywhere; max-width: 100%; }
.g.me .b { background: var(--me); color: #fff; border-color: var(--me); }
.g.them .m + .m .b { border-top-left-radius: 6px; }
.g.them .m:not(:last-child) .b { border-bottom-left-radius: 6px; }
.g.me .m + .m .b { border-top-right-radius: 6px; }
.g.me .m:not(:last-child) .b { border-bottom-right-radius: 6px; }
.b .md p { margin: 0; }
.b .md p + p, .b .md p + ul, .b .md p + ol, .b .md ul + p, .b .md ol + p { margin-top: 6px; }
.b .md ul, .b .md ol { padding-left: 1.3em; list-style: revert; }
.b .md a { color: inherit; }
.g.me .b .md a { color: #fff; }
.m .t { position: absolute; bottom: 0; font-size: 11px; color: var(--faint); white-space: nowrap; line-height: 1.3; }
.g.them .m .t { left: calc(100% + 6px); }
.g.me .m .t { right: calc(100% + 6px); }

/* 札（書類・ページ・質問・回答・成果物） */
.card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; width: 290px; max-width: 100%; box-sizing: border-box; padding: 12px 14px; background: var(--paper); border: 1px solid var(--l1); border-radius: 14px; text-align: left; color: var(--ink); }
a.card:hover, .card-open:hover { border-color: var(--l2); }
.card-open { display: grid; gap: 6px; }
.card-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card-row > svg { width: 16px; height: 16px; color: var(--faint); }
.card-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--ground); display: grid; place-items: center; color: var(--sub); flex: none; }
.card-ic svg { width: 17px; height: 17px; }
.card-ic.need { background: var(--need-soft); color: var(--need); }
.card-k { flex: 1; min-width: 0; font-size: 12px; color: var(--sub); display: flex; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-k .num { color: var(--faint); }
.card-st { font-size: 11.5px; font-weight: 700; color: var(--sub); white-space: nowrap; }
.card-st.ok { color: var(--ok); }
.card-amt { display: flex; align-items: baseline; gap: 6px; }
.card-amt .num { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.card-amt small { font-size: 12px; color: var(--sub); }
.card-foot, .card-t { font-size: 12.5px; color: var(--sub); }
.card-t { color: var(--ink); font-weight: 700; font-size: 14.5px; }
.card-lines { display: grid; gap: 1px; font-size: 13px; }
.card-lines span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-act { display: flex; gap: 8px; flex-wrap: wrap; }
.card-act form { margin: 0; }
.card.doc.mine { border: 1.5px solid var(--need); box-shadow: 0 0 0 4px var(--need-soft); }
.card.ans { width: 260px; background: var(--me); color: #fff; border-color: var(--me); border-radius: 18px; gap: 2px; padding: 10px 14px 12px; }
.g.them .card.ans { background: var(--paper); color: var(--ink); border-color: var(--l1); }
.ans-k { display: flex; align-items: center; gap: 5px; font-size: 12px; opacity: 0.85; }
.ans-k svg { width: 14px; height: 14px; }
.ans-q { font-size: 13px; opacity: 0.85; }
.ans-v { font-size: 16px; }
.ans-link { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; margin-top: 4px; opacity: 0.9; }
.ans-link svg { width: 14px; height: 14px; }
.g.them .ans-link { color: var(--acc); opacity: 1; }
.qc { gap: 8px; }
.qc.mine { border: 1.5px solid var(--need); box-shadow: 0 0 0 4px var(--need-soft); }
.qc-top { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); }
.qc-top svg { width: 16px; height: 16px; }
.qc-due { margin-left: auto; color: var(--faint); }
.qc.mine .qc-due { color: var(--need); font-weight: 700; }
.qc-t { font-size: 15.5px; line-height: 1.5; }
.qc-opts { display: grid; gap: 8px; margin: 0; }
.qc-opt { min-height: 44px; padding: 8px 14px; border: 1px solid var(--l2); border-radius: 12px; background: var(--paper); font-size: 15px; text-align: left; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.qc-opt:hover { border-color: var(--acc); background: var(--acc-soft); }
.qc-opt:active { transform: scale(0.98); }
.qc-opt.chk { display: flex; align-items: center; gap: 8px; }
.qc-opts textarea { min-height: 64px; resize: none; }
.qc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qc-chips span { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: rgb(0 0 0 / 5%); color: var(--sub); }
.qc-wait { font-size: 12px; color: var(--sub); }
.qc-wait b { color: var(--ink); }
.qc-ans { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--ok-soft); }
.qc-ans svg { width: 18px; height: 18px; color: var(--ok); margin-top: 2px; }
.qc-ans span { display: grid; }
.qc-ans em { font-style: normal; font-size: 13px; color: var(--sub); }
.qc-ans small { font-size: 12px; color: var(--faint); }
:target.qc, .flash { animation: hl 1.6s ease-out; }
@keyframes hl { 0%, 40% { box-shadow: 0 0 0 4px #fde7b0; } }

/* 入力欄 */
.compose { flex: none; background: var(--paper); border-top: 1px solid var(--l1); padding: 10px max(16px, calc((100% - 800px) / 2)) calc(10px + env(safe-area-inset-bottom, 0px)); }
.cbar { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
.chips:not(:empty) { padding-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 12px; border-radius: 16px; background: var(--acc-soft); color: var(--acc); font-size: 13px; font-weight: 500; }
.chip button { width: 24px; height: 24px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; color: inherit; }
.crow { display: flex; align-items: flex-end; gap: 6px; }
.attach { position: relative; }
.attach > summary { list-style: none; }
.attach > summary::-webkit-details-marker { display: none; }
.attach[open] .plus { color: var(--acc); }
.attach[open] .plus svg { transform: rotate(45deg); }
.plus svg { transition: transform 0.2s; }
.attach-pop { width: 320px; max-height: 60vh; overflow-y: auto; }
.attach-pop .opt { gap: 10px; }
.crow textarea { box-shadow: none !important; flex: 1; min-height: 40px; max-height: 160px; resize: none; border: 1px solid var(--l1); background: var(--ground); border-radius: 20px; padding: 8px 14px; font-size: 16px; line-height: 1.5; color: var(--ink); outline: none; box-sizing: border-box; }
.crow textarea:focus { border-color: var(--l2); background: var(--paper); }
.send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--me); color: #fff; display: grid; place-items: center; flex: none; }
.send svg { width: 20px; height: 20px; }

/* 質問を作る */
dialog.sheet { border: 0; padding: 0; border-radius: 20px; width: min(460px, calc(100vw - 24px)); max-height: 86vh; box-shadow: 0 20px 60px rgb(15 23 41 / 24%); color: var(--ink); }
dialog.sheet::backdrop { background: rgb(15 23 41 / 30%); }
.ask-form { display: grid; gap: 14px; padding: 20px 20px 18px; }
.ask-form h2 { font-size: 17px; font-weight: 700; }
.fld { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; }
.fld > span, .fld > legend { font-size: 13px; color: var(--sub); padding: 0; }

.who-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-pick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border: 1px solid var(--l2); border-radius: 20px; font-size: 14px; cursor: pointer; }
.chip-pick:has(input:checked) { border-color: var(--acc); background: var(--acc-soft); }
.chip-pick input { position: absolute; opacity: 0; pointer-events: none; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--acc); font-size: 13px; justify-self: start; cursor: pointer; }
.linkbtn.mute { color: var(--faint); }

/* ---- 右の書類 ---- */
.docp { display: flex; min-height: 0; min-width: 0; position: relative; z-index: 5; }
.docp-veil { display: none; }
.docp-in { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--paper); border-left: 1px solid var(--l1); box-shadow: -16px 0 40px -12px rgb(20 30 25 / 18%); animation: doc-in 0.4s cubic-bezier(0.05, 0.7, 0.1, 1); }
.docp .grab { display: none; }
.docp-h { display: flex; align-items: center; gap: 8px; padding: 14px 10px 4px 22px; flex: none; }
.docp-h h2 { flex: 1; font-size: 19px; font-weight: 700; letter-spacing: 0.02em; }
.docp-tabs { display: flex; gap: 18px; padding: 0 22px; border-bottom: 1px solid var(--l1); flex: none; overflow-x: auto; scrollbar-width: none; }
.docp-tabs a { display: inline-flex; align-items: center; gap: 5px; height: 38px; font-size: 13.5px; color: var(--sub); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.docp-tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.docp-tabs small { font-size: 11px; font-weight: 700; color: var(--need); }
.docp-body { flex: 1; overflow-y: auto; padding: 6px 22px 32px; }
@keyframes doc-in { from { opacity: 0; transform: translateX(28px); } }
.dsec { padding: 18px 0 6px; }
.dsec + .dsec { border-top: 1px solid var(--l1); }
.dsec h3 { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--sub); margin-bottom: 8px; letter-spacing: 0.04em; }
.dsec h3 small { color: var(--need); }
.dsec ul { display: grid; gap: 2px; }
.rq { display: grid; gap: 1px; padding: 8px 0; }
.rq + .rq { border-top: 1px dashed var(--l1); }
.rq-t { font-size: 15px; line-height: 1.6; }
.rq small { font-size: 12px; color: var(--faint); }
.rq.open a { display: grid; gap: 1px; }
.rq.open .rq-t { color: var(--ink); }
.rq.open small b { color: var(--need); }
#undecided h3 { color: var(--need); }
.rq:target { animation: hl-row 2.2s ease-out; border-radius: 6px; }
@keyframes hl-row { 0% { background: rgb(253 230 138 / 70%); } 100% { background: transparent; } }
.kv { display: grid; gap: 6px; margin-bottom: 8px; }
.kv div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; font-size: 14px; }
.kv dt { color: var(--faint); font-size: 12.5px; }
.files li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.files li svg { width: 16px; height: 16px; color: var(--faint); }
.files a { color: var(--acc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add { margin-top: 8px; }
.add > summary { font-size: 13px; color: var(--acc); cursor: pointer; list-style: none; }
.add > summary::-webkit-details-marker { display: none; }
.row-form { display: flex; gap: 8px; margin-top: 8px; }
.row-form input { flex: 1; min-width: 0; }
.doc-bill { display: grid; gap: 14px; padding-top: 14px; }
.doc-bill .card { width: 100%; }
.doc-bill .linkbtn { margin-top: 2px; }
.pays li { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--l1); }
.pays-l { flex: 1; }
.pays small { color: var(--faint); font-size: 12px; }
.pays li.done { color: var(--faint); }
.doc-deliv { display: grid; gap: 8px; padding-top: 14px; }
.dl { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--l1); border-radius: 14px; }
.dl:hover { border-color: var(--l2); }
.dl-t { flex: 1; display: grid; font-weight: 700; font-size: 15px; }
.dl-t small { font-weight: 400; font-size: 12.5px; color: var(--sub); }
.dl svg { width: 18px; height: 18px; color: var(--faint); }
.ql { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--l1); }
.ql-no { width: 26px; height: 26px; border-radius: 50%; background: var(--ground); display: grid; place-items: center; font-size: 12.5px; flex: none; }
.ql.mine .ql-no { background: var(--need-soft); color: var(--need); font-weight: 700; }
.ql-b { flex: 1; min-width: 0; display: grid; }
.ql-t { font-size: 15px; font-weight: 500; }
.ql-b small { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--sub); }
.ql-b small b { color: var(--need); }
.ql-b small svg { width: 13px; height: 13px; color: var(--ok); }
.ql > svg { width: 18px; height: 18px; color: var(--faint); }

/* ---- スマホ ---- */
.pc-only { }
@media (max-width: 899px) {
  .app-grid, .room-page.with-doc, .room-page.with-doc.doc-auto { display: block; }
  .pc-only { display: none !important; }
  .pc-only-inline { display: none; }
  .list-page .side { height: 100dvh; border: 0; }
  .room-page .side { display: none; }
  .talk { height: 100dvh; }
  .rh { padding: env(safe-area-inset-top, 0px) 6px 0 4px; min-height: 56px; }
  .rh .back { display: inline-grid; }
  .rh-t { text-align: center; }
  .rh-t h1 { font-size: 16.5px; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 4px; padding: 4px 8px 6px; }
  .facts.compact { grid-template-columns: auto auto auto minmax(0, 1fr); }
  .facts.compact .people { display: none; }
  .fact .v { font-size: 13px; }
  .todo { padding: 10px 16px; }
  .chat { padding: 4px 16px 16px; }
  .gcol { max-width: 76%; }
  .compose { padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .attach-pop { width: auto; }
  /* 書類：明示して開いたときだけ、下から重ねる */
  .docp.auto { display: none; }
  .docp { position: fixed; inset: 0; z-index: 50; display: block; }
  .docp-veil { display: block; position: absolute; inset: 0; background: rgb(15 23 41 / 30%); animation: fade 0.2s; }
  .docp-in { position: absolute; left: 0; right: 0; bottom: 0; top: 8%; border-radius: 20px 20px 0 0; border: 0; box-shadow: 0 -10px 30px rgb(20 30 25 / 16%); animation: sheet-up 0.4s cubic-bezier(0.05, 0.7, 0.1, 1); }
  .docp .grab { display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--l2); margin: 8px auto 0; }
  .docp-h { padding: 6px 8px 0 18px; }
  .docp-tabs { padding: 0 18px; gap: 16px; }
  .docp-body { padding: 4px 18px calc(28px + env(safe-area-inset-bottom, 0px)); }
  dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 20px 20px 0 0; }
  .kv div { grid-template-columns: 96px 1fr; }
}
@media (prefers-reduced-motion: reduce) { body.app *, body.app *::before, body.app *::after { animation: none !important; transition: none !important; } }
