/* 請求書の画面(機能22)。色・角丸・影は設計(デザイン設計 l18)の値。色の札には必ず言葉を添える */
/* 隠す指定は、部品の display より必ず強くする(.btnrow や .why の flex が隠す指定を上書きし、写すボタンが確かめる前から出ていた) */
[hidden] { display: none !important; }
:root {
  --navy: #1e2b47;
  --ink: #1f2636;
  --ink2: #4a5364;
  --ink3: #646b78;
  --paper: #ffffff;
  --canvas: #f3f5f8;
  --red: #b42318;
  --amber: #8f5a0a;
  --green: #1a6e46;
  --blue: #2457a6;
  --ai: #4a4f9c;
  --ai-bg: #e9eaf8;
  --field: #828894;
  --line: #e1e5eb;
  --edge: #cbd2dc;
  --amber-bg: #fdf2de;
  --green-bg: #e5f3eb;
  --red-bg: #fdecea;
  --neutral: #aeb6c4;
  --press: #e6ebf4;
  --r1: 8px;
  --r2: 14px;
  --sh1: 0 1px 2px rgba(20, 24, 40, 0.08);
  --tap: 44px;
  --gold: #b3925a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --chip: #eef0f3;
  --k1: #2e3d63;
  --k2: #4e6290;
  --k3: #7a8aad;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
main { max-width: 760px; margin: 0 auto; padding: 10px max(14px, var(--safe-right)) calc(20px + var(--safe-bottom)) max(14px, var(--safe-left)); }
main.wide { max-width: 1240px; }
h1, h2 { margin: 0; color: var(--navy); }
h2 { font-size: 16px; margin-bottom: 2px; }
.demo { margin: 0; padding: 6px 18px; background: var(--press); color: var(--navy); font-size: 13px; font-weight: 700; }
.notice { margin: 0; padding: 8px 18px; color: var(--red); background: var(--red-bg); font-weight: 700; }
.muted { color: var(--ink2); font-size: 14px; }

.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 16px; height: 16px; stroke-width: 2.2; }

/* 見出し */
.shd { display: flex; align-items: baseline; gap: 8px; padding: 2px 2px 6px; }
.shd h1 { min-width: 0; font-size: 22px; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.shd .sub { font-size: 14px; color: var(--ink2); min-width: 5em; overflow-wrap: anywhere; }
.shd.has-back { align-items: center; }
/* 詳しい画面: 件名は戻るの横いっぱい、相手の名前は下の行。件名は2行まで(字を小さくして収め、無理なら「…」) */
.shd.stack { flex-wrap: wrap; row-gap: 0; }
.shd.stack h1 { flex: 1 1 0; }
.shd.stack .sub { flex: 1 0 100%; box-sizing: border-box; padding-left: calc(var(--tap) - 8px + 8px); }
.hbtn { flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin: -6px 0 -6px -8px; border: 0; border-radius: 12px; background: transparent; color: var(--navy); cursor: pointer; }

/* 札(色には言葉を添える) */
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 9px; border-radius: 6px; font-family: inherit; font-weight: 700; font-size: 13px; line-height: 1.2; background: #eef0f3; color: var(--ink2); white-space: nowrap; }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.dim { color: var(--ink3); }
.chip.ai { background: var(--ai-bg); color: var(--ai); }
.chip.red { background: var(--red-bg); color: var(--red); }

/* 切り替え(支払い・稼働・入金) */
.tab small { font-size: 12px; font-weight: 600; color: var(--ink3); }

/* 期限ごとの棒 */
.cap { margin: 10px 4px 0; font-size: 14px; font-weight: 700; color: var(--ink2); }
.caprow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 4px 0; }
.caprow .cap { margin: 0; }
.spans { flex: none; display: inline-flex; padding: 2px; border-radius: 10px; background: var(--chip); }
.spans button { min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink2); font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.spans button[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: var(--sh1); }
.spans.wide { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; margin: 4px 0 2px; }
.spans.wide button { min-height: var(--tap); font-size: 14px; }
.strip { display: flex; gap: 0; overflow-x: auto; padding: 6px 0 2px; }
.strip .col { cursor: pointer; border: 2px solid transparent; border-radius: 10px; background: transparent; padding: 2px 0; font-family: inherit; flex: 1 0 60px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-size: 12px; color: var(--ink2); font-weight: 600; }
.strip .stack { display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-start; width: 100%; height: 72px; border-bottom: 2px solid var(--ink3); background: linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 0 / 100% 24px; }
.strip .stack i { display: block; width: 26px; border-radius: 3px 3px 0 0; margin-top: 1px; }
.strip .x { font-size: 12px; color: var(--ink2); }
.undated { margin: 4px 4px 0; font-size: 13px; color: var(--ink2); }
.strip .v { color: var(--ink2); font-weight: 700; }
.strip .col { white-space: nowrap; }
.strip .late { color: var(--red); }
.strip .col[aria-pressed="true"] { border-color: var(--navy); background: var(--press); }
.legdef { list-style: none; margin: 6px 4px 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--ink2); }
.legdef li { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 3px; }
.sw.sw-open { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink3); }
.chartcard h2 { margin: 0; font-size: 15px; }
.chartcard .caprow { margin: 0 0 2px; }
.legdef span { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 4px 0 8px; }
.tile { display: grid; gap: 0; justify-items: start; min-height: 64px; padding: 6px 10px; background: #fff; border: 2px solid transparent; border-radius: var(--r2); box-shadow: var(--sh1); font-family: inherit; text-align: left; font-size: 12px; font-weight: 700; color: var(--ink2); cursor: pointer; }
.tile b { font-size: 20px; line-height: 1.25; color: var(--navy); font-variant-numeric: tabular-nums; }
.tile small { font-size: 13px; font-weight: 600; color: var(--ink2); }
.tile[aria-pressed="true"] { border-color: var(--navy); background: var(--press); }
.tile.late b { color: var(--red); }
.tile.soon b { color: var(--amber); }
.tile.done b { color: var(--green); }
.prog { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 8px; margin: 2px 4px; font-size: 13px; color: var(--ink2); }
.prog b { color: var(--navy); font-size: 15px; font-variant-numeric: tabular-nums; }
.prog i { display: block; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); }
.prog i span { display: block; height: 100%; border-radius: 4px; background: var(--green); }
.kline { display: flex; flex-wrap: wrap; gap: 0 10px; margin: 2px 4px 6px; font-size: 13px; color: var(--ink2); }
.kline span + span { padding-left: 10px; border-left: 1px solid var(--neutral); }
.scopeoff { width: 100%; margin: 4px 0; }
.pay > ul, .pay > .mix { margin-bottom: 8px; }
.cobars { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.cobars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; font-size: 14px; }
.coname { min-width: 0; overflow-wrap: anywhere; }
.cobars b { color: var(--navy); font-variant-numeric: tabular-nums; }
.cobar { grid-column: 1 / -1; grid-row: 2; height: 8px; border-radius: 4px; background: var(--canvas); }
.cobar i { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.cobar.split { display: flex; gap: 1px; overflow: hidden; }
.cobar.split i { flex: none; border-radius: 0; }
.cobar.split i.k-in { background: var(--k1); }
.cobar.split i.k-ev { background: var(--k3); }
.cobar.split i.bg-read { background: var(--neutral); }
.tcheck { margin: 8px 4px 0; }
.tdiff { margin: 2px 4px 0; font-weight: 700; color: var(--amber); }
.k-review { color: var(--amber); }
.k-confirmed { color: var(--green); }
.k-read { color: var(--ink3); }
.bg-review { background: var(--amber); }
.bg-confirmed { background: var(--green); }
.bg-read { background: var(--neutral); }

/* 絞り込み */
.flt { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0; }
.flt button { min-height: 40px; padding: 0 12px; border: 1.5px solid var(--ink3); border-radius: 999px; background: #fff; color: var(--ink); font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.flt button[aria-pressed="true"] { border: 2px solid var(--navy); color: var(--navy); background: #fff; }
.flt button[aria-pressed="true"]::before { content: "✓"; margin-right: 4px; }

/* 1行 = 印・取引先名・額の棒・> */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 20px; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 4px 8px; text-align: left; font: inherit; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh1); cursor: pointer; }
.row .who { display: grid; min-width: 0; }
.row .who b { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.row .who span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.row .amt { display: flex; align-items: center; gap: 6px; min-width: 0; font-family: inherit; font-weight: 700; font-size: 14px; color: var(--ink2); white-space: nowrap; }
.row .amt i { display: block; height: 12px; border-radius: 4px; min-width: 4px; }
.row .go { color: var(--ink3); }
.row .who .gist { font-size: 14px; line-height: 1.4; color: var(--ink2); overflow-wrap: anywhere; }
/* 請求書の1行: 取引先・状態・額を1段に */
.row.inv { grid-template-columns: 22px minmax(0, 1fr) auto 14px; min-height: 52px; gap: 8px; padding: 4px 8px 4px 12px; }
.row.inv .who b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; }
.row.inv .mtags > span[class^="k-"] { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--chip); }
.row.inv .yen { text-align: right; font-size: 14px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.row.inv .k-review { background: var(--amber-bg); }
.row.inv .k-confirmed { background: var(--green-bg); }
.row.inv .who small { font-size: 13px; color: var(--ink2); white-space: nowrap; }
.row.inv .who .mtags { flex-wrap: wrap; margin-top: 1px; font-weight: 400; }
.okmark { display: inline-flex; color: var(--ink3); }
/* メールの行は要約が長いので、件名と要約の下に札を置く */
.row.mail { grid-template-columns: minmax(0, 1fr) 20px; padding-block: 8px; }
.row.mail .who { grid-column: 1; }
.row.mail .amt { grid-column: 1; grid-row: 2; flex-wrap: wrap; gap: 2px 10px; white-space: normal; font-size: 14px; }
.row.mail .go { grid-column: 2; grid-row: 1 / 3; }
.pri-高 { color: var(--amber); }
.pri-低, .pri-none { color: var(--ink3); }
.empty { padding: 14px; text-align: center; color: var(--ink2); }

/* ボタン */
.cta { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 2px; }
.cta > * { flex: 1 1 auto; }
.btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: var(--tap); border-radius: 14px; border: 1.5px solid transparent; font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1.2; padding: 2px 12px; cursor: pointer; text-decoration: none; background: #fff; color: var(--navy); border-color: var(--ink3); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
/* 案件の画面の3つの操作。同じ幅・同じ字の大きさで1行に並べる */
.tools3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin: 6px 0; }
.tools3 .btn { min-height: 44px; padding: 0 4px; font-size: 14px; white-space: nowrap; }
.tools3 .btn[aria-pressed="true"] { border-color: var(--navy); background: var(--press); }
.btn small { font-size: 12px; font-weight: 600; }
.btn.pri { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn:disabled { background: #c9cdd5; color: var(--ink2); border-color: var(--field); cursor: not-allowed; }
.btn.link { min-height: var(--tap); width: auto; background: #fff; border-color: var(--ink3); color: var(--blue); }
.why { display: flex; align-items: flex-start; gap: 6px; margin: 4px 2px 0; color: var(--amber); font-size: 13px; font-weight: 700; }
.why.ok { color: var(--ink2); font-weight: 400; }
.why.done { color: var(--green); }
.why ul { margin: 0; padding-left: 18px; }

/* 上の帯の画面の切り替え(プロジェクト・請求書・案件と相手)。2026-11-08 下のタブから移した */
.tabbar { flex: 0 1 auto; display: flex; min-width: 0; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(217, 189, 133, 0.45); }
.tab { position: relative; flex: 0 1 auto; min-width: 0; min-height: 38px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: #dfe5f0; font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1.2; white-space: nowrap; cursor: pointer; }
.tab small { line-height: 1.1; }
.btn small { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--ink3); }
.tab[aria-current="page"] { color: var(--navy); background: #fff; box-shadow: 0 1px 3px rgba(20, 24, 40, 0.25); }
@media (max-width: 400px) { .tab { padding: 0 9px; font-size: 13px; } }
/* 画面には出さず、読み上げにだけ残す */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 1件 */
.stline { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin: 0 2px 4px; }
.steps { display: flex; gap: 12px; margin: 0; padding: 0; list-style: none; }
.steps > * { display: grid; justify-items: center; gap: 1px; font-size: 12px; font-weight: 600; color: var(--ink2); }
.steps i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #aeb6c4; background: #fff; }
.steps .now { color: var(--navy); font-weight: 700; }
.steps .now i { width: 14px; height: 14px; border: 4px solid var(--navy); margin: -1px 0; }
.steps .done i { border-color: var(--navy); background: var(--navy); }
/* 案件の行の中の3段。行の棒の指定(.row .amt i)を丸に戻す */
.row .amt .steps { gap: 12px; }
.row .amt .steps i { display: inline-block; border-radius: 50%; }
.compare { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.compare > * { min-width: 0; }
@media (min-width: 960px) {
  .compare { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .original { position: sticky; top: 8px; max-height: calc(100vh - 150px); overflow-y: auto; }
}
.original { background: #fff; border: 1px solid #c9cfd9; border-radius: 12px; padding: 8px; }
.pages .page { display: block; width: 100%; height: auto; background: #fff; }
.pages p { margin: 8px 0 4px; }
.flds { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--sh1); }
.fl { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 24px; align-items: center; gap: 6px; background: #fff; padding: 1px 8px 1px 10px; min-height: 32px; }
.fl b { font-size: 13px; color: var(--ink2); }
.fl .val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fl .no { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--blue); color: #fff; font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1; }
.fl.miss { background: var(--amber-bg); border: 1px solid var(--amber); }
.fl.na { color: var(--ink3); }
.fl.na .val { color: var(--ink3); }
.sect { margin: 8px 0 0; }
.sect h2 { font-size: 14px; color: var(--ink2); margin: 0 4px 6px; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: var(--sh1); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }

/* 本人確認 */
.appico { display: block; width: 72px; height: 72px; border-radius: 16px; margin: 0 auto 8px; }
main.center { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom)); }
.login { width: min(100%, 400px); margin: 0; padding: 28px 24px; text-align: center; border-top: 3px solid var(--gold); }
.login h1, .login h2 { margin: 4px 0; }
.login label { display: block; margin-top: 16px; text-align: left; font-weight: 700; }
.login input { box-sizing: border-box; width: 100%; max-width: none; }
.login .btn { width: 100%; }
/* 箱の境が分かるよう、影だけでなく細い枠を付ける(2026-11-08 利用者の指示) */
.card { background: #fff; border: 1px solid var(--edge); border-radius: var(--r2); padding: 8px 10px; margin: 4px 0; box-shadow: var(--sh1); }
.card.tight { padding: 8px 10px; }
.rowcard { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rowcard .who { display: grid; min-width: 0; }
.rowcard .who b { font-size: 15px; overflow-wrap: anywhere; font-weight: 700; }
.rowcard .who small { font-size: 13px; color: var(--ink2); overflow-wrap: anywhere; }
.rowcard .btn { flex: none; }
.mailt { margin: 0; font-size: 16px; font-weight: 700; color: var(--navy); line-height: 1.4; }
.facts { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 2px 8px; margin: 6px 0 0; font-size: 14px; }
.facts dt { color: var(--ink3); font-size: 12px; font-weight: 700; padding-top: 2px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.fold { margin: 6px 0; padding: 0 10px; background: #fff; border-radius: var(--r2); box-shadow: var(--sh1); font-size: 14px; }
.fold summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 700; color: var(--navy); cursor: pointer; }
.fold summary::after { content: '開く'; margin-left: auto; font-size: 12px; font-weight: 400; color: var(--ink2); }
.fold[open] > summary::after { content: '閉じる'; }
.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; padding-bottom: 8px; }
.card .inline { padding-bottom: 0; }
.inline label { flex: 1 1 130px; min-width: 0; margin: 0; font-size: 12px; font-weight: 700; color: var(--ink2); }
.inline input, .inline select { display: block; width: 100%; max-width: none; min-height: var(--tap); padding: 4px 6px; font-size: 16px; }
/* 色の帯は枠で付ける(左だけの太い線は、丸い角で曲がって見えた) */
.urgent { border: 1.5px solid var(--amber); background: var(--amber-bg); }
.urgent h2 { color: var(--amber); }
.cand { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; }
.cand .who { display: grid; min-width: 0; }
.cand small { font-size: 12px; color: var(--ai); font-weight: 700; }
.cand b { font-size: 14px; font-weight: 400; overflow-wrap: anywhere; }
.keepbox { display: grid; gap: 4px; }
.keepbox > .btn { width: 100%; }
.keepbox p { margin: 0; font-size: 13px; }
.cand.keep { grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); }
.cand.keep .who { grid-column: 1 / -1; gap: 4px; justify-items: start; }
.cand.keep .who b { font-size: 15px; font-weight: 600; }
.cand.keep .who small { color: var(--ink3); font-weight: 400; }
label { display: block; margin: 8px 0 2px; }
input { font: inherit; font-size: 16px; min-height: var(--tap); padding: 8px; width: 100%; max-width: 280px; border: 1.5px solid var(--field); border-radius: var(--r1); }
.card p { margin: 4px 0 0; }
.card > :first-child { margin-top: 0; }

/* 今日の一覧・元の文 */
select { font: inherit; font-size: 16px; min-height: var(--tap); padding: 8px; width: 100%; max-width: 280px; border: 1.5px solid var(--field); border-radius: var(--r1); background: #fff; }
.list > li > .why { margin: 2px 8px 6px; }
.btn[aria-pressed="true"] { border: 2px solid var(--navy); background: var(--press); }
.open { display: inline-block; margin: 0 8px; padding: 10px 4px; color: var(--blue); font-size: 14px; font-weight: 700; }
.evlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
/* 今日の見出しの行。右の「急がない n件」は押すと開く(設計 02) */
.sh2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 2px 0; }
.sh2 h2 { margin: 0; font-size: 14px; color: var(--ink2); }
.seclabel { margin: 6px 2px 2px; font-size: 14px; color: var(--ink2); }
/* プロジェクトの画面のフェーズの見出し。左の太い線と札の色をカードの札とそろえ、4段のどこかと件数、段階の説明を出す */
.phasehead { display: grid; gap: 2px; margin: 18px 0 6px; padding: 6px 10px; border-left: 4px solid var(--k3); border-radius: 0 8px 8px 0; background: #fff; font-size: 14px; }
.phasehead .phtop { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.phasehead .phtag { padding: 0 8px; border-radius: 6px; font-size: 15px; font-weight: 700; line-height: 1.7; background: var(--chip); color: var(--ink2); }
.phasehead .phstep { font-size: 12px; font-weight: 400; color: var(--ink2); }
.phasehead .phn { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--ink); }
.phasehead small { font-size: 13px; font-weight: 400; color: var(--ink2); }
.phasehead.ph-2 { border-left-color: var(--k2); }
.phasehead.ph-2 .phtag { background: var(--press); color: var(--k1); }
.phasehead.ph-2 .pbar i.now { border-color: var(--k2); }
.phasehead.ph-3 { border-left-color: var(--k1); }
.phasehead.ph-3 .phtag { background: var(--k2); color: #fff; }
.phasehead.ph-4 { border-left-color: var(--green); }
.phasehead.ph-4 .phtag { background: var(--green-bg); color: var(--green); }
.phasehead.ph-4 .pbar i.done, .phasehead.ph-4 .pbar i.now { border-color: var(--green); }
.phasehead.ph-4 .pbar i.done { background: var(--green); }
.phasehead.ph-4 .pbar i.done::before, .phasehead.ph-4 .pbar i.now::before { background: var(--green); }
.phasehead.ph-1 .pbar i.now { border-color: var(--k3); }
.phasehead.ph-hold { border-left: 4px dashed var(--neutral); }
.phasehead.ph-none { border-left-color: var(--neutral); }
.sh2 h2::before, .seclabel::before { content: ""; display: inline-block; width: 3px; height: 12px; margin-right: 6px; border-radius: 2px; background: var(--gold); vertical-align: -1px; }
.sha { flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 8px; border: 1.5px solid var(--ink3); border-radius: 12px; background: #fff; color: var(--blue); font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.lead { margin: 0 2px 4px; }

/* 上の帯: いまの場所と、動いている処理 */
.where { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: calc(56px + var(--safe-top)); padding: calc(10px + var(--safe-top)) max(16px, var(--safe-right)) 10px max(16px, var(--safe-left)); background: linear-gradient(180deg, #2a3b62 0%, var(--navy) 70%); border-bottom: 1px solid var(--gold); box-shadow: inset 0 -3px 0 rgba(179, 146, 90, 0.25), 0 2px 6px rgba(20, 24, 40, 0.18); font-size: 13px; color: #c9d2e3; }
/* いまの場所はバントウAI の下の段に出す。長い語は1つずつ「…」で略し、最後の語を優先して残す */
.where { flex-wrap: wrap; row-gap: 4px; }
/* 帯は切り替えで埋まるので、読み込み中は回る印だけを出す(文字は読み上げ用に残す) */
.where-busy { flex: none; display: inline-flex; align-items: center; gap: 0; overflow: hidden; white-space: nowrap; color: #e8d5ab; font-size: 0; }
.where-busy::before, .is-busy::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
.where-busy::before { flex: none; }
body.loading .where::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent) no-repeat; background-size: 40% 100%; animation: sweep 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sweep { from { background-position: -60% 0; } to { background-position: 160% 0; } }

/* 押した手応え */
button, a.btn { -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background-color 0.08s, transform 0.08s, box-shadow 0.08s; }
.btn:active:not(:disabled), .flt button:active, .strip .col:active, .hbtn:active, .sha:active { transform: scale(0.97); }
.btn:active:not(:disabled), .flt button:active, .strip .col:active, .hbtn:active, .sha:active, .tab:not([aria-current]):active { background: rgba(255, 255, 255, 0.2); }
.btn:active:not(:disabled), .flt button:active, .strip .col:active, .hbtn:active, .sha:active { background: var(--press); }
.btn.pri:active:not(:disabled) { background: #0f1a30; }
.row:active, .row.is-busy { background: var(--press); box-shadow: inset 0 0 0 2px var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media (hover: hover) {
  .row:hover { box-shadow: inset 0 0 0 1.5px var(--neutral); }
  .btn:hover:not(:disabled):not(.pri), .flt button:hover, .strip .col:hover, .hbtn:hover { background: #f0f3f8; }
  .tab:not([aria-current]):hover { background: rgba(255, 255, 255, 0.14); }
}
.is-busy { position: relative; pointer-events: none; }
.is-busy::after { position: absolute; top: calc(50% - 7px); right: 10px; color: var(--blue); }
.btn.is-busy, .flt button.is-busy { background: var(--press); }
.btn.pri.is-busy { background: #38476a; }
.btn.pri.is-busy::after { left: calc(50% - 7px); right: auto; color: #fff; }
.btn.pri.is-busy { color: transparent; }
.btn.pri.is-busy > * { visibility: hidden; }
.tab.is-busy::after { top: 12px; right: 4px; width: 10px; height: 10px; }
.hbtn.is-busy .ic { visibility: hidden; }
.hbtn.is-busy::after { right: calc(50% - 7px); }
.toast { position: fixed; left: 50%; bottom: calc(16px + var(--safe-bottom)); z-index: 7; transform: translateX(-50%); max-width: calc(100% - 32px); margin: 0; padding: 10px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 15px; font-weight: 700; box-shadow: 0 4px 12px rgba(20, 24, 40, 0.25); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 予定: その日の時間割と、7日の帯 */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin: 6px 0 0; }
.wk { display: grid; justify-items: center; gap: 0; min-height: 46px; padding: 3px 0; border: 0; border-radius: 10px; background: var(--canvas); color: var(--ink2); font: inherit; cursor: pointer; }
.wk small { font-size: 12px; font-weight: 700; }
.wk b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.wk-dot { width: 6px; height: 6px; border-radius: 50%; }
.wk.has .wk-dot { background: var(--blue); }
.wk[aria-pressed="true"] { background: var(--navy); color: #fff; }
.wk[aria-pressed="true"] b { color: #fff; }
.wk[aria-pressed="true"].has .wk-dot { background: #fff; }
.wk:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tl-allday { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.tl-allday li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-allday .chip { flex: none; }
.tl-list { list-style: none; margin: 8px 0 0; padding: 0; }
.tl { display: grid; grid-template-columns: 44px 14px minmax(0, 1fr); gap: 6px; min-height: 40px; }
.tl-time { display: grid; align-content: start; justify-items: end; padding-top: 2px; font-variant-numeric: tabular-nums; }
.tl-time b { font-size: 14px; }
.tl-time small { font-size: 12px; color: var(--ink3); }
.tl-dot { position: relative; justify-self: center; width: 2px; background: var(--line); }
.tl:last-child .tl-dot { background: transparent; }
.tl-dot::before { content: ""; position: absolute; top: 7px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--neutral); }
.tl.now .tl-dot::before, .tl.next .tl-dot::before { background: var(--blue); border-color: var(--blue); }
/* 印と題は同じ行に並べ、題が長い時だけ次の行へ回す */
.tl-body { display: flex; flex-wrap: wrap; align-items: baseline; align-content: start; gap: 1px 6px; min-width: 0; padding-bottom: 6px; }
.tl-body > * { min-width: 0; }
.tl-link { min-width: 0; font-size: 14px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
a.tl-link { text-decoration: underline; text-decoration-color: var(--neutral); text-underline-offset: 3px; }
.tl-mark { flex: none; padding: 1px 8px; border-radius: 6px; background: var(--press); color: var(--blue); font-size: 13px; font-weight: 700; }
.tl.now .tl-mark { background: var(--blue); color: #fff; }
.tl.past .tl-time b, .tl.past .tl-link { color: var(--ink3); font-weight: 400; }
.tl-none { margin: 10px 4px 2px; color: var(--ink2); line-height: 1.6; }
/* メールから拾った日程の候補。本物の予定と見誤らないよう、点線の枠・中抜きの点・札・薄い文字で分ける */
.tl.cand .tl-body { margin: 0 0 6px; padding: 4px 8px; border: 1.5px dashed var(--neutral); border-radius: 8px; color: var(--ink2); font-size: 14px; }
.tl.cand .tl-time b { color: var(--ink3); font-weight: 400; }
.tl.cand .tl-dot::before { border-style: dashed; background: transparent; }
.tl-cand { flex: none; padding: 0 6px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--neutral); color: var(--ink2); font-size: 12px; font-weight: 700; }
.tl-note { margin: 6px 4px 0; font-size: 12px; color: var(--ink3); }
.wk.hascand .wk-dot { box-shadow: inset 0 0 0 1.5px var(--neutral); }
.wk[aria-pressed="true"].hascand .wk-dot { box-shadow: inset 0 0 0 1.5px #fff; }

/* メールの1行: どんな案件か・誰から・札だけ */
.row.mline { grid-template-columns: minmax(0, 1fr) auto 16px; min-height: 44px; padding: 3px 8px 3px 12px; }
/* 琥珀の帯は、未返信の行と要確認の請求書だけ。言葉(.waitw)を必ず添える */
/* 帯は丸い角にかからない、まっすぐな縦の線で描く(内側の影で描くと角で曲がった) */
.row.wait, .row.inv.is-review { background: linear-gradient(var(--amber), var(--amber)) 0 50% / 4px calc(100% - 24px) no-repeat, #fff; }
.waitw { margin-right: 6px; color: var(--amber); font-weight: 700; }
.h2note { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--ink3); }
.shd-end { margin-left: auto; }
.row.inv.is-confirmed { background: linear-gradient(var(--green), var(--green)) 0 50% / 4px calc(100% - 24px) no-repeat, #fff; }
h2.attn { color: var(--amber); }
.sh2 h2.attn::before { background: var(--amber); }
.row.lead { grid-template-columns: 22px minmax(0, 1fr) auto 16px; gap: 10px; }
.row .ic.lead { color: var(--navy); }
.mtags { display: inline-flex; align-items: center; gap: 4px; }
.row.mline .who { gap: 1px; }
.row.mline .who b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; }
.row.mline .who small { display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; color: var(--ink2); }
.row.mline .who small .ic { flex: none; color: var(--amber); }
/* 案件の行の印(長く動いていない=琥珀、保留の戻る日=薄い色) */
.row.mline .who small .mk { flex: none; color: var(--amber); }
.row.mline .who small .mk.dim { color: var(--ink3); }
.mtag { padding: 2px 7px; border-radius: 6px; background: var(--chip); color: var(--ink2); font-size: 13px; font-weight: 700; white-space: nowrap; }
.mtag.pri-高 { background: var(--amber-bg); color: var(--amber); }
/* 種類の札は紺の濃淡で分ける。読まない物は枠だけにして下げる */
.mtag.kind-お知らせ { background: var(--press); color: var(--k1); }
.mtag.kind-読まない, .mtag.kind-隠した物 { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink3); }
.mtag.hold { background: transparent; box-shadow: inset 0 0 0 1.5px var(--neutral); color: var(--ink2); }

/* 返信と取引先に聞く */
/* 返し方の4つは、どの幅でも1行に並べ、字は1行に収める(幅に合わせて字を小さくする) */
.kinds { display: flex; flex-wrap: nowrap; gap: 4px; margin: 6px 0; }
.kinds .btn { flex: 1 1 auto; min-width: 0; padding: 2px clamp(4px, 1.6vw, 12px); font-size: clamp(11px, 3.5vw, 14px); white-space: nowrap; }
.aiask { white-space: nowrap; font-size: clamp(12px, 3.9vw, 15px); }
.kinds .btn[aria-pressed="true"] { border: 2px solid var(--navy); color: var(--navy); background: var(--press); }
.card .cap { margin: 0 0 6px; }
.draft { box-sizing: border-box; display: block; width: 100%; max-width: none; padding: 10px; border: 1.5px solid var(--field); border-radius: var(--r1); font: inherit; line-height: 1.6; resize: vertical; font-size: 16px; }

/* 記録: 会社カードと1社の図 */
.stats { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0; padding: 0; }
.stats li { display: grid; justify-items: center; padding: 4px; border-radius: var(--r2); background: #fff; box-shadow: var(--sh1); }
.stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.stats small { font-size: 12px; color: var(--ink2); }
.tl-btn { padding: 0; border: 0; background: transparent; font-family: inherit; text-align: left; cursor: pointer; }
.tl-tag { justify-self: start; }

.addbox { margin-left: auto; }
.addpdf { width: auto; padding: 0 12px; font-size: 14px; font-weight: 700; color: var(--blue); }

/* 記録の検索 */
.search { display: flex; align-items: center; gap: 6px; min-height: var(--tap); margin-top: 4px; padding: 0 10px; border: 1.5px solid var(--field); border-radius: 12px; background: #fff; }
.search:focus-within { outline: 2px solid var(--blue); outline-offset: 1px; }
.search input { flex: 1; min-width: 0; max-width: none; min-height: 36px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; }

/* 内訳の帯 */
.mix { margin: 2px 0 6px; }
.mix .cap { margin: 4px 4px 4px; }
.mixbar { display: flex; gap: 2px; height: 8px; margin: 0 4px; }
.mixbar i { flex: 1 1 0; min-width: 4px; border-radius: 3px; }
.mixleg { display: flex; flex-wrap: wrap; gap: 0 10px; margin: 2px 4px; font-size: 12px; color: var(--ink2); }
.mixleg span { display: inline-flex; align-items: center; gap: 5px; }
.mixleg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }

/* 出どころの札(Gmail・Slack・LINE・Messenger)。件名の前に小さく置く */
.srcb { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink2); font-size: 11px; font-weight: 700; line-height: 18px; vertical-align: 1px; }

/* フェーズの印: 要件 → 日程調整中 → 提案待ち → 確定済み */
.segs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 2px 0 6px; padding: 6px 0 8px; background: #fff; border-radius: var(--r2); box-shadow: var(--sh1); }
.segs button { position: relative; display: grid; justify-items: center; align-content: end; gap: 4px; min-height: var(--tap); padding: 0 2px; border: 0; background: transparent; color: var(--ink2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.segs i { position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--neutral); background: #fff; }
.segs button + button::before { content: ""; position: absolute; left: -50%; right: 50%; bottom: 6px; height: 2px; background: var(--neutral); }
.segs button.done, .segs button.now { color: var(--navy); }
.segs button.done i { border-color: var(--navy); background: var(--navy); }
.segs button.now i { width: 20px; height: 20px; margin: -3px 0; border: 5px solid var(--navy); }
.segs button.done::before, .segs button.now::before { background: var(--navy); }
.phase { display: inline-grid; justify-items: end; gap: 1px; }
.phase small { font-size: 13px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.tags .phase { grid-auto-flow: column; align-items: center; gap: 6px; }
.pbar { display: inline-flex; align-items: center; gap: 8px; height: 12px; }
.pbar i { position: relative; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--neutral); background: #fff; }
.pbar i + i::before { content: ""; position: absolute; right: calc(100% + 1.5px); top: 50%; width: 8px; height: 1.5px; margin-top: -0.75px; background: var(--neutral); }
.pbar i.done { border-color: var(--navy); background: var(--navy); }
.pbar i.now { width: 11px; height: 11px; border: 3px solid var(--navy); }
.pbar i.done::before, .pbar i.now::before { background: var(--navy); }
/* 段階ごとに札の地と点の色を変える(要件 → 確定済みで濃く、確定済みは緑) */
.phase small { padding: 0 7px; border-radius: 6px; line-height: 1.6; }
.phase.ph-1 small { background: var(--chip); color: var(--ink2); }
.phase.ph-1 .pbar i.now { border-color: var(--k3); }
.phase.ph-2 small { background: var(--press); color: var(--k1); }
.phase.ph-2 .pbar i.now { border-color: var(--k2); }
.phase.ph-3 small { background: var(--k2); color: #fff; }
.phase.ph-4 small { background: var(--green-bg); color: var(--green); }
.phase.ph-4 .pbar i.done, .phase.ph-4 .pbar i.now { border-color: var(--green); }
.phase.ph-4 .pbar i.done { background: var(--green); }
.phase.ph-4 .pbar i.done::before, .phase.ph-4 .pbar i.now::before { background: var(--green); }

/* 人の1枚: 月の積み上げと年表 */
.mchart { list-style: none; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; margin: 4px 0 2px; padding: 0; }
.mchart li { display: grid; justify-items: center; gap: 1px; }
.mchart small { font-size: 11px; color: var(--ink3); }
.mstack { display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; width: 100%; max-width: 20px; height: 56px; border-bottom: 1px solid var(--line); }
.mstack i { display: block; border-radius: 2px; min-height: 2px; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pev { display: grid; grid-template-columns: 44px 42px minmax(0, 1fr); align-items: start; gap: 6px; padding: 3px 0; border-top: 1px solid var(--line); }
.pev:first-child { border-top: 0; }
.pev time { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink2); }
.pkind { justify-self: start; padding: 1px 5px; border-radius: 4px; font-size: 12px; font-weight: 700; color: var(--ink2); white-space: nowrap; background: var(--chip); }
.pbody { display: grid; min-width: 0; padding: 0; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; }
button.pbody { cursor: pointer; }
.pbody b { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.pbody small { font-size: 13px; color: var(--ink2); overflow-wrap: anywhere; }
.sublink { padding: 0; border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--blue); cursor: pointer; }
.k-in { background: var(--k1); }
.k-out { background: var(--k2); }
.k-ev { background: var(--k3); }
.k-case { background: var(--neutral); }

/* 請求書の いまやる事 */
.guide { border: 1.5px solid var(--navy); padding: 6px 10px; }
.guide.stop { border-color: var(--amber); }
.guide .cap { margin: 0; }
.guide h2 { margin: 0; font-size: 15px; }
.card.guide p.muted { margin: 0; }

/* AI の予想 */
.aipick { border: 1.5px solid var(--ai); }
.aipick .btnrow { margin: 0; }

.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13px; font-weight: 700; }
.tags .muted { font-weight: 400; }

/* プロジェクトの画面。案件ごとの箱。見出しを押すと案件の画面を開く */
.proj { position: relative; margin: 10px 0; padding-top: 4px; }
.proj-head::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.proj:active { background: var(--press); }
.row.plain { cursor: inherit; box-shadow: none; background: var(--canvas); grid-template-columns: 22px minmax(0, 1fr) auto; }
.setlead { margin: 0 4px 10px; padding-left: 1.2em; font-size: 14px; line-height: 1.5; color: var(--ink2); }
.setlead li { margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand.slim { padding: 6px 0; border-top: 1px solid var(--line); }
.cand.slim .who small { color: var(--ai); }
.cand.slim .who b { font-size: 15px; font-weight: 600; }
.devfold summary { padding: 6px 0; font-size: 13px; }
.wordchips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; padding: 0; }
.wordchips li { padding: 3px 10px; border-radius: 999px; background: var(--canvas); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink); }
.quiet { margin: 6px 0 0; text-align: right; }
.quiet .btn.link { min-height: 36px; border-color: transparent; background: transparent; color: var(--ink2); font-weight: 600; text-decoration: underline; }
.stamp { margin: 14px 0 4px; text-align: center; font-size: 12px; color: var(--ink3); }
.proj-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--tap); padding: 6px 4px; border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.proj-head b { flex: 1 1 auto; min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
.proj-n { flex: none; font-size: 12px; color: var(--ink3); }
.proj .list { margin-top: 0; }
.proj-top { display: flex; align-items: center; gap: 4px; }
.proj.handled { padding-bottom: 4px; background: var(--bg, #f6f7fa); box-shadow: none; }
/* 案件のカードを払う時の外枠。カードの余白と影は外枠が持つ */
.projsw { margin: 10px 0; border-radius: var(--r2); box-shadow: var(--sh1); }
.projsw > .proj { margin: 0; box-shadow: none; }
/* 急がない連絡の行と「重要へ戻す」 */
.actline { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.actline > .btn { white-space: nowrap; }
/* 狭い幅は件名を削らないよう、ボタンを行の下の右へ回す */
@media (max-width: 560px) {
  .actline { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .actline > .btn { justify-self: end; }
}
details.donefold { margin-top: 12px; }
/* 左に払うとボタンが出る行(人の一覧・案件)。ボタンは行の後ろに置き、行をずらして見せる。
   大きく払うと、ボタンを押さずにそのまま操作する(Gmail と同じ)。後ろの帯はボタンと同じ色で、行の幅いっぱいに敷く */
.swline { position: relative; overflow: hidden; border-radius: 12px; }
.swline > .swrow { position: relative; z-index: 1; touch-action: pan-y; transition: transform 0.18s ease; }
.swline > .row.swrow { box-shadow: none; }
.swline.drag > .swrow { transition: none; }
.swline.gone > .swrow { transition: transform 0.22s ease-in; }
.swacts { position: absolute; inset: 0; display: flex; justify-content: flex-end; background: var(--navy); }
.swacts.is-hide { background: var(--ink2); }
.swact { min-width: 84px; padding: 0 16px; border: 0; font: inherit; font-size: 14px; font-weight: 700; color: #fff; background: var(--navy); cursor: pointer; }
.swact.is-hide { background: var(--ink2); }
/* 離せばそのまま操作する所まで来た印。文字を大きくし、帯を濃くする */
.swline.full .swacts { filter: brightness(0.8); }
.swline.full .swact { font-size: 16px; }
.swline:not(.is-open):not(.drag):not(.peeking):not(.gone) .swacts { visibility: hidden; }
/* 初めての人への案内(払う操作を覚えるまで) */
.swhint { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); font-size: 13px; line-height: 1.6; color: var(--ink2); }
.swhint p { margin: 0; }
.swhint b { color: var(--ink); font-size: 14px; }
.swhint .ic { flex: none; margin-top: 3px; color: var(--navy); }
/* プロジェクトの画面の案内は畳んだ形。見出しの行だけ見え、押すと説明が開く */
.swhint.swcurtain { display: block; }
.swcurtain > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.swcurtain > summary::-webkit-details-marker { display: none; }
.swcurtain > summary::after { content: '開く'; margin-left: auto; font-size: 12px; color: var(--ink2); }
.swcurtain[open] > summary::after { content: '閉じる'; }
.swcurtain > summary .ic { margin-top: 0; }
.swcurtain > p { margin: 6px 0 0 24px; }
/* 完了の一言の「元に戻す」 */
.toast-undo { margin-left: 14px; padding: 4px 6px; border: 0; background: transparent; color: #f2d79a; font: inherit; font-size: 15px; font-weight: 700; text-decoration: underline; cursor: pointer; }
/* 案件の中の「対応した」の行 */
.donerow { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink2); }
.donerow .btn { flex: none; }
.proj.handled .proj-head b { color: var(--ink2); font-weight: 600; }

/* 未読の行。中身を出さず、押すと Gmail を開く(リンクの下線は付けない) */
a.row { text-decoration: none; }
.row.unread .who b { font-weight: 700; }
.mtag.unread { background: var(--amber-bg); color: var(--amber); }

/* メールの画面: 本文と、説明つきの操作 */
.mailbody .bodytext { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; }
.mailbody .bodytext.folded { max-height: 12.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.acts .act { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 12px; padding: 6px 0; border-top: 1px solid var(--line, #e5e7ee); }
.acts .act .btn { min-width: 9.5em; }
.acts .act p { margin: 0; font-size: 13px; }
.acts .fold { border-top: 1px solid var(--line, #e5e7ee); margin-top: 0; }
@media (max-width: 480px) { .acts .act { grid-template-columns: minmax(0, 1fr); } .acts .act .btn { justify-self: start; } }

/* 案件と相手: 誰の番かの見出し、案件の画面の「いま」と経緯、設定のボタン */
.casegrp { margin: 0 0 2px; }
details.casegrp > summary { cursor: pointer; }
.row.mline .who small .late { color: var(--red); font-weight: 700; }
.cohead { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 16px; align-items: center; gap: 10px; width: 100%; min-height: 40px; margin: 6px 0 2px; padding: 0 8px 0 12px; border: 0; border-radius: var(--r2); background: var(--press); color: var(--navy); font: inherit; text-align: left; cursor: pointer; }
.cohead b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; }
.cohead small { font-size: 13px; color: var(--ink2); }
.cohead .ic { color: var(--navy); }
.nowcard.mine { border: 1.5px solid var(--amber); background: var(--amber-bg); }
.nowwho { display: block; font-size: 13px; font-weight: 700; color: var(--ink2); }
.nowcard.mine .nowwho { color: var(--amber); }
.nowtext { margin: 2px 0 0; font-size: 18px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.nowcard .muted { font-size: 13px; overflow-wrap: anywhere; }
.tl.ctl { grid-template-columns: 14px minmax(0, 1fr); }
.ctl-body { display: grid; gap: 2px; align-content: start; }
.ctl-head { font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.tl.dec .tl-dot::before { background: var(--green); border-color: var(--green); }
.where-set { position: relative; flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin: -4px calc(-1 * var(--tap) / 4) -4px 0; padding: 0; border: 0; background: transparent; color: #fff; cursor: pointer; }
.gear-dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px #fff; }

/* 画面の直し(2026-11-07 夕方) */
.devrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0; border-top: 1px solid var(--line); font-size: 13px; }
.devrow > span { min-width: 0; overflow-wrap: anywhere; }
.row.dim { opacity: 0.6; }
.row.mline .who small.rel { white-space: normal; overflow: visible; font-size: 12px; color: var(--ink3); }
.row.mline .who b .kt { margin-right: 6px; vertical-align: 1px; }
/* 案件の種類の札。紺の濃淡と、種類の名前の文字。色は意味の表(お金 > 決める > 会う > その他)と同じ */
.kt { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 18px; }
.kt-money { background: var(--navy); color: #fff; }
.kt-decide { background: rgba(30, 43, 71, 0.7); color: #fff; }
.kt-meet { background: rgba(30, 43, 71, 0.4); color: var(--navy); }
.kt-other { background: transparent; box-shadow: inset 0 0 0 1px var(--ink3); color: var(--ink2); }
.stnote { display: block; margin: 0 8px 4px; font-size: 12px; color: var(--ink3); }
.cta.pair { display: grid; grid-template-columns: 1fr 1fr; flex-wrap: nowrap; }
.cta.pair .btn { min-height: 48px; }
.note1 { margin: 2px 0 0; text-align: center; font-size: 12px; font-weight: 400; color: var(--ink3); }
.toolpanel { margin-top: 0; }
/* 取引先ごとの横棒: 棒の長さが額、中の緑が内容を確定した額 */
.coname small { margin-left: 6px; font-size: 12px; color: var(--ink3); }
.cobar.water { height: 14px; overflow: hidden; border-radius: 0 4px 4px 0; border: 1.5px solid var(--ink3); background: #fff; }
.hbars { padding-left: 2px; border-left: 2px solid var(--ink3); }
.cobar.water i { height: 100%; border-radius: 0; background: var(--green); }
/* 上の帯の右: 声で頼むマイクと設定の歯車を並べる */
.where-btns { flex: none; display: flex; align-items: center; gap: 2px; margin-left: auto; }
.where-set.where-mic { margin-right: 0; }

/* 声で頼む板。下から出る(PC では真ん中) */
.vsheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.vback { position: absolute; inset: 0; background: rgba(20, 24, 40, 0.45); }
.vpanel { position: relative; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; padding: 12px 16px calc(16px + var(--safe-bottom)); background: #fff; border-radius: var(--r2) var(--r2) 0 0; box-shadow: 0 -4px 16px rgba(20, 24, 40, 0.2); }
@media (min-width: 768px) { .vsheet { align-items: center; } .vpanel { border-radius: var(--r2); } }
.vhead { display: flex; align-items: center; justify-content: space-between; }
.vhead h2 { margin: 0; font-size: 17px; color: var(--navy); }
.vclose { width: var(--tap); height: var(--tap); margin-right: -8px; border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--ink2); cursor: pointer; }
.vhere { margin: 2px 0 0; font-size: 13px; color: var(--ink2); }
.vmic { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 12px 0 4px; }
.vrec { display: grid; place-items: center; width: 72px; height: 72px; border: 0; border-radius: 50%; background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(20, 24, 40, 0.25); cursor: pointer; }
.vrec svg { width: 32px; height: 32px; }
.vrec:disabled { opacity: 0.5; cursor: default; }
.vrec.on { background: #b3261e; animation: vpulse 1.2s ease-in-out infinite; }
@keyframes vpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0.45); } 50% { box-shadow: 0 0 0 12px rgba(179, 38, 30, 0); } }
.vmeter { display: block; width: 160px; height: 6px; overflow: hidden; border-radius: 3px; background: var(--chip); }
.vmeter i { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.08s linear; }
.vstat { min-height: 1.5em; margin: 4px 0; text-align: center; font-size: 14px; color: var(--ink2); }
.vheard { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--r1); background: var(--canvas); }
.vheard small { display: block; font-size: 12px; color: var(--ink3); }
.vplan { margin: 8px 0 4px; font-weight: 700; color: var(--ink); }
.vmemo, .noteadd-in { display: block; width: 100%; box-sizing: border-box; margin: 4px 0; padding: 8px; font: inherit; font-size: 16px; border: 1.5px solid var(--field); border-radius: var(--r1); resize: vertical; }
.vtext { display: flex; gap: 8px; margin-top: 12px; }
.vtext input { flex: 1; max-width: none; }
.vex { margin-top: 10px; font-size: 14px; }
.vex summary { min-height: var(--tap); display: flex; align-items: center; color: var(--navy); font-weight: 700; cursor: pointer; }
.vex ul { margin: 0; padding-left: 1.2em; }
.vex p { margin: 6px 0 0; color: var(--ink2); font-size: 13px; }

/* 案件と人のメモの欄 */
.notes { margin: 4px 0; padding: 0; list-style: none; }
.notes li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.notes li:last-child { border-bottom: 0; }
.notes li p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.nmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nmeta small { font-size: 12px; color: var(--ink3); }
.noteadd { margin-top: 6px; }
.noteadd .btn { flex-direction: row; gap: 4px; }
@media (prefers-reduced-motion: reduce) { .vrec.on { animation: none; } .vmeter i { transition: none; } }
