:root {
  /* 共有CSS（shared.css）が使う色。画面ごとの呼び名をここで割り当てる。 */
  --ui-panel: var(--panel);
  --ui-line: var(--line);
  --ui-line-strong: var(--line-strong);
  --ui-muted: var(--muted);
  --ui-subtle: var(--subtle);
  --ui-accent: var(--brand);
  --ui-accent-strong: var(--focus);
  --ui-accent-soft: var(--brand-soft);
  --ui-danger: var(--blocked);
  --ui-sidebar: #282828;
  --canvas: #f6f6f6;
  --panel: #ffffff;
  --ink: #222222;
  --muted: #686868;
  --subtle: #8e8e8e;
  --line: #e4e4e4;
  --line-strong: #d3d3d3;
  --brand: #111111;
  --brand-soft: #eeeeee;
  --focus: #282828;
  --today: #282828;
  --review: #a65a00;
  --review-soft: #fff7e8;
  --progress: #27647a;
  --progress-soft: #ebf4f7;
  --waiting: #7c6218;
  --waiting-soft: #faf5e6;
  --blocked: #a23b3b;
  --blocked-soft: #fff0ef;
  --complete: #386b55;
  --complete-soft: #edf6f1;
  --client: #5a4b8c;
  --client-soft: #f0edfa;
  --client-tint: #fbfaff;
  --prospect: #696969;
  --prospect-soft: #f7f5fc;
  --internal: #686868;
  --internal-soft: #f0f0f0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.035);
  font-family: Inter, "Avenir Next", "Hiragino Sans", "Yu Gothic", YuGothic, system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); line-height: 1.55; }
button, input, select { font: inherit; }
a { color: inherit; }
button, a, input, select { touch-action: manipulation; }
:focus-visible { outline: 3px solid rgba(40, 40, 40, 0.32); outline-offset: 3px; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 9px 14px; color: white; background: var(--focus); border-radius: 6px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; padding: 28px 20px 22px; color: #e4e4e4; background: #282828; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 0 8px 26px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
/* ロゴは枠つきの版（leap-logo.svg）。白い枠が暗いサイドバーの上で締まって見える。 */
.brand-logo { display: block; width: 132px; height: auto; }
.brand-sub { color: #acacac; font-size: 12px; letter-spacing: 0.05em; }
.nav-list { display: grid; gap: 4px; margin-top: 24px; }
.nav-heading { margin: 15px 12px 3px; color: #8e8e8e; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.nav-heading:first-child { margin-top: 0; }
.nav-list a { display: flex; min-height: 44px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); color: #c8c8c8; font-size: 14px; text-decoration: none; transition: color 160ms ease, background 160ms ease, opacity 160ms ease; }
.nav-list a:hover, .nav-list a.active { color: white; background: rgba(255, 255, 255, 0.09); }
.nav-list .business-nav-link { color: #e6e6e6; }
.nav-list a:active, .metric:active, .refresh-button:active { opacity: 0.76; }
.source-rail { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.source-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #79c6a3; box-shadow: 0 0 0 4px rgba(121, 198, 163, 0.12); }
.source-rail div { display: flex; flex-direction: column; }
.source-rail strong { color: #e3e3e3; font-size: 12px; font-weight: 600; }
.source-rail div span { color: #9f9f9f; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; letter-spacing: 0.11em; }

.main-content { width: 100%; max-width: 1560px; padding: 34px clamp(24px, 3.5vw, 56px) 56px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow, .section-index { margin: 0 0 4px; color: var(--focus); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.13em; }
h1 { margin: 0; font-family: "Avenir Next", "Hiragino Sans", sans-serif; font-size: clamp(30px, 3vw, 42px); line-height: 1.15; letter-spacing: -0.035em; }
.date-label { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.refresh-button { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); background: var(--panel); cursor: pointer; transition: border-color 160ms ease, background 160ms ease; }
.refresh-button:hover { border-color: #aaaaaa; background: #fafdFC; }
.refresh-button:disabled { cursor: wait; opacity: 0.64; }
.refresh-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.refresh-button.loading svg { animation: spin 800ms linear infinite; }
.global-message { min-height: 0; margin: 0 0 16px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted); background: rgba(255, 255, 255, 0.64); font-size: 13px; }
.global-message:empty { display: none; }
.global-message.error { border-color: #e4b7b3; color: #812c2c; background: #fff3f2; }

.section { scroll-margin-top: 20px; margin-top: 18px; padding: clamp(18px, 2vw, 26px); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading.compact { align-items: end; }
h2, h3 { margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 21px; }
h3 { font-size: 15px; }
/* 一覧からメモを開くボタン。行の中に置くので、押せることが分かる最小限の見た目にする。 */
.memo-open { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--focus); background: var(--panel); font-size: 11px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.memo-open:hover { border-color: var(--focus); background: var(--brand-soft); }
.memo-open-count { min-width: 16px; padding: 0 4px; border-radius: 999px; color: var(--panel); background: var(--focus); font-size: 10px; text-align: center; }

/* 経営状況の月ごとの推移。棒の長さでその年の山と谷が分かるようにする。 */
.fiscal-months { display: grid; gap: 4px; }
.fiscal-month { display: grid; grid-template-columns: 42px minmax(0, 1fr) 110px 120px; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.fiscal-month:last-child { border-bottom: 0; }
.fiscal-month.is-empty { color: var(--subtle); }
.fiscal-month-label { color: var(--muted); font-variant-numeric: tabular-nums; }
/* 実績と見込みを横に継ぎ足す。重ねると、どこまでが請求済みか分からなくなる。 */
.fiscal-month-bar { display: flex; height: 10px; border-radius: 999px; background: #f1f1f1; overflow: hidden; }
.fiscal-month-bar span { display: block; height: 100%; background: var(--focus); }
.fiscal-month-bar span.is-forecast { background: repeating-linear-gradient(135deg, #dcdcdc 0 4px, #ececec 4px 8px); }
/* 見込みから漏れているものの注意書き。数字の下に小さく置く。 */
.fiscal-attention-list { margin: 12px 0 0; padding: 10px 12px 10px 28px; border: 1px solid var(--line); border-left: 3px solid var(--waiting); border-radius: var(--radius-sm); background: #fffdf5; color: var(--muted); font-size: 12px; }
.fiscal-attention-list li + li { margin-top: 4px; }
.fiscal-month-sales { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.fiscal-month-profit { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.metric-note { display: block; margin-top: 3px; color: var(--subtle); font-size: 10px; }
@media (max-width: 720px) {
  .fiscal-month { grid-template-columns: 34px minmax(0, 1fr) 92px; }
  .fiscal-month-profit { grid-column: 2 / -1; text-align: left; }
}

.updated-at, .section-note { color: var(--muted); font-size: 12px; }
.updated-at { margin: 0; text-align: right; }
.section-note { margin: -10px 0 16px; }
/* 絞り込みの下に置く並び順の説明。見出し直下ではないので上へ詰めない。 */
.task-tools + .section-note { margin: -6px 0 14px; }
.count-badge { min-width: 28px; padding: 3px 9px; border-radius: 999px; color: white; background: var(--today); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; text-align: center; }
.count-badge.review { background: var(--review); }
.count-badge.neutral { color: var(--muted); background: #f0f0f0; }

.overview-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.metric { position: relative; display: block; min-width: 0; padding: 16px; border-right: 1px solid var(--line); color: inherit; text-decoration: none; transition: background 160ms ease; }
.metric:last-child { border-right: 0; }
.metric:hover { background: #f9f9f9; }
.metric::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--metric-color, var(--line-strong)); content: ""; }
.metric strong { display: block; margin-top: 6px; font-family: "Avenir Next", sans-serif; font-size: 29px; line-height: 1; letter-spacing: -0.04em; white-space: nowrap; }
.metric span { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.metric.today { --metric-color: var(--today); background: #f6f6f6; }
.metric.review { --metric-color: var(--review); background: var(--review-soft); }
.metric.progress { --metric-color: var(--progress); }
.metric.waiting { --metric-color: var(--waiting); }
.metric.blocked { --metric-color: var(--blocked); }
.metric.completed { --metric-color: var(--complete); }

.management-section { border-top: 3px solid var(--brand); }
.management-actions { display: flex; align-items: center; gap: 8px; }
.business-open-link { display: inline-flex; min-height: 34px; align-items: center; padding: 5px 10px; border-radius: 5px; color: white; background: var(--brand); font-size: 10px; font-weight: 700; text-decoration: none; transition: background 160ms ease; }
.business-open-link:hover { background: var(--focus); }
.connection-state { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.connection-state.foundation { color: #6d5511; background: var(--waiting-soft); }
.connection-state.connected { color: #2e5f4a; background: var(--complete-soft); }
.foundation-notice { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 14px 16px; border-left: 3px solid var(--focus); color: var(--ink); background: #f5f5f5; }
.foundation-notice strong { font-size: 13px; }
.foundation-notice p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.foundation-notice > span { flex: 0 0 auto; padding: 5px 9px; border: 1px solid #cdcdcd; border-radius: 5px; color: #2f5953; background: white; font-size: 10px; font-weight: 700; }
.finance-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.finance-metric { min-width: 0; padding: 15px 12px; border-right: 1px solid var(--line); }
.finance-metric:first-child { padding-left: 0; }
.finance-metric:last-child { padding-right: 0; border-right: 0; }
.finance-metric > span, .finance-metric > strong { display: block; }
.finance-metric > span { color: var(--muted); font-size: 10px; }
.finance-metric > strong { margin-top: 6px; font-size: clamp(14px, 1.5vw, 20px); line-height: 1.2; white-space: nowrap; }
.unavailable { color: var(--subtle); font-size: 12px; font-weight: 500; }
/* Obsidianの写しから来ている節の注記。古ければ色で気づけるようにする。 */
.snapshot-note.is-stale { color: #8a6100; font-weight: 700; }

/* 帳票と支払の状況。トップに3枚ずつ並べる。 */
.business-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.business-card { position: relative; min-width: 0; padding: 16px 14px; border-right: 1px solid var(--line); }
.business-card:first-child { padding-left: 0; }
.business-card:last-child { padding-right: 0; border-right: 0; }
/* 今期の成績は4枚（売上・粗利・達成率・見込み）。幅があるうちは横一列に並べる。 */
#fiscal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.business-card > span, .business-card > strong, .business-card > small, .business-card > em { display: block; }
.business-card > span { color: var(--muted); font-size: 10px; }
.business-card > strong { margin-top: 6px; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.1; }
.business-card > small { margin-top: 4px; color: var(--ink); font-size: 12px; }
.business-card > em { margin-top: 4px; color: var(--muted); font-size: 10px; font-style: normal; }
.business-card .card-note { color: var(--muted); font-size: 11px; }
/* 数の意味づけは色で添える。金額の大小ではなく、放っておけるかどうかで分ける。 */
.business-card.accent-green > strong { color: var(--focus); }
.business-card.accent-amber > strong { color: #8a6100; }
.business-card.accent-danger > strong { color: var(--blocked, #a23b3b); }

.priority-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.priority-section { min-width: 0; }
.today-section { border-top: 3px solid var(--today); }
.review-section { border-color: #ead2a8; border-top: 3px solid var(--review); background: linear-gradient(180deg, #fffaf0 0, white 130px); }
.workflow-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.workflow-grid > div { min-width: 0; padding: 0 20px; border-right: 1px solid var(--line); }
.workflow-grid > div:first-child { padding-left: 0; }
.workflow-grid > div:last-child { padding-right: 0; border-right: 0; }
.subheading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.subheading span { color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

.task-list { display: grid; gap: 8px; }
.task-item { padding: 13px 14px; border: 1px solid var(--line); border-left: 3px solid var(--status-color, var(--line-strong)); border-radius: var(--radius-sm); background: white; }
.task-item.status-in_progress { --status-color: var(--progress); }
.task-item.status-needs_review { --status-color: var(--review); }
.task-item.status-waiting { --status-color: var(--waiting); }
.task-item.status-blocked { --status-color: var(--blocked); }
.task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-headline { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
/* 今日やることの完了チェック。指でも押せる大きさにする。 */
.task-done { display: flex; align-items: center; min-height: 24px; }
.task-done-check { width: 20px; height: 20px; margin: 0; accent-color: var(--focus); cursor: pointer; }
/* 終わった仕事。消さずに、終わったと分かる形で今日のうちは残す。 */
.task-item.is-done { border-color: var(--line); background: #f7f7f7; }
.task-item.is-done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.task-item.is-done .task-meta, .task-item.is-done .task-id { color: var(--subtle); }
.task-title { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.45; }
.task-id { margin-top: 3px; color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.task-meta span::before { color: var(--subtle); content: attr(data-label) "："; }
.task-reason { margin: 10px 0 0; padding-top: 9px; border-top: 1px solid var(--line); color: var(--ink); font-size: 12px; }
.task-reason strong { margin-right: 6px; color: var(--muted); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; }
.status-chip, .priority-chip { display: inline-flex; width: fit-content; align-items: center; padding: 3px 8px; border-radius: 999px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 650; white-space: nowrap; }
.status-chip { color: #585858; background: #f0f0f0; }
.status-chip.in_progress { color: #21576b; background: var(--progress-soft); }
.status-chip.needs_review { color: #824800; background: #ffedc9; }
.status-chip.waiting { color: #66500f; background: var(--waiting-soft); }
.status-chip.blocked { color: #8d3030; background: var(--blocked-soft); }
.status-chip.completed { color: #2e5f4a; background: var(--complete-soft); }
.priority-chip.high { color: #8d3030; background: var(--blocked-soft); }
.priority-chip.medium { color: #66500f; background: var(--waiting-soft); }
.priority-chip.low { color: #585858; background: #f0f0f0; }

/* 区分（顧客案件・案件候補・社内・未分類）の色分け。
   Taskカードの左罫線はstatus用なので、区分はチップと地色で表す。 */
.category-chip { display: inline-flex; width: fit-content; align-items: center; padding: 3px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.category-chip.category-client { color: var(--client); background: var(--client-soft); border-color: #ddd5f2; }
.category-chip.category-prospect { color: var(--prospect); background: var(--prospect-soft); border-color: #e4dff4; }
.category-chip.category-internal { color: var(--internal); background: var(--internal-soft); }
/* 考えていること。仕事の区分とは別の色にして、一目で「まだ仕事ではない」と分かるようにする。 */
.category-chip.category-idea { color: #7a5a12; background: #fdf4dd; border-color: #ecdcb0; }
.category-chip.category-strategy { color: #1f5b62; background: #e9f3f4; border-color: #c9e0e2; }
.category-chip.category-unset, .category-chip.category-unknown { color: #848484; background: transparent; border-style: dashed; border-color: var(--line-strong); }
/* 案件カテゴリの札。区分（顧客案件など）の札と並ぶので、形は揃えて色で分ける。 */
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.work-chip { display: inline-flex; width: fit-content; align-items: center; padding: 3px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.work-chip.work-site { color: #1f5b62; background: #e9f3f4; border-color: #c9e0e2; }
.work-chip.work-app { color: #27647a; background: var(--progress-soft); border-color: #cde2ea; }
.work-chip.work-ai { color: #54459a; background: #f0eefb; border-color: #d9d2f1; }
.work-chip.work-design { color: #8a3f63; background: #fbeef4; border-color: #eed2e0; }
.work-chip.work-ad { color: var(--review); background: var(--review-soft); border-color: #f0dcbc; }
.work-chip.work-video { color: #8a4633; background: #fbeeea; border-color: #eed6cf; }
.work-chip.work-sns { color: #3f6b2f; background: #eef6e9; border-color: #d3e5c8; }
.work-chip.work-contract { color: #585858; background: #f2f2f2; border-color: #dcdcdc; }
.work-chip.work-maintenance { color: #3f5f8a; background: #edf2f9; border-color: #d1dced; }
.work-chip.work-other { color: #636363; background: #f2f2f2; border-color: #d9d9d9; }
/* 未選択は色を付けない。選んでいないことが分かるようにする。 */
.work-chip.work-unset { color: #848484; background: transparent; border-style: dashed; border-color: var(--line-strong); }

.task-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; align-items: center; }

/* 状態を変えるプルダウン。札の見た目のまま選べるようにする。
   タスクのカードと、進行中案件の「段階」で同じ形を使う。 */
.task-status-editor, .status-editor { padding: 0; }
.task-status-editor select, .status-editor select { min-height: 26px; padding: 3px 8px; border: 0; border-radius: 999px; color: inherit; background: transparent; font: inherit; cursor: pointer; }
.task-status-editor select:disabled, .status-editor select:disabled { opacity: .6; cursor: progress; }

/* 案件の状態。帳票の段階とは別の軸で、ボールがどちらにあるかを出す。
   「いつから待っているか」は下に小さく添える。列が狭いので横には並べない。 */
.state-cell { display: grid; gap: 3px; justify-items: start; }
.state-cell .cell-sub { white-space: nowrap; }
/* 色は意味で分ける。タスクの札と同じ使い方にして、画面ごとに意味が変わらないようにする。
   自分の番（手つかず＝橙／動いている＝青）、相手の番（黄）、寝かせているもの（色なし）。
   未設定と保留に色を付けないのは、全部に色があるとどれも同じ重さに見えるため。
   未設定は並びのいちばん上に来るので、色が無くても目に入る。 */
.status-chip.state-ours { color: #824800; background: #ffedc9; }
.status-chip.state-doing { color: #21576b; background: var(--progress-soft); }
.status-chip.state-theirs { color: #66500f; background: var(--waiting-soft); }
.status-chip.state-done { color: #2e5f4a; background: var(--complete-soft); }

/* 次の一手。これからやることを、その場で書き換える。
   長い文で行が伸びないよう2行で切る。押すと全部見える。
   経緯のメモは別物なので、右端に小さく入口を置くだけにする。 */
.move-cell { display: flex; align-items: flex-start; gap: 8px; }
.move-cell.is-editing { display: block; }
.next-move-input { width: 100%; min-width: 160px; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: white; color: var(--ink); font: inherit; font-size: 12px; line-height: 1.6; resize: vertical; }
.next-move-input:disabled { opacity: .6; cursor: progress; }
.next-move { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 0; border: 0; background: transparent; text-align: left; cursor: text; }
.next-move-body { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--ink); font-size: 12px; line-height: 1.6; }
.next-move:hover .next-move-body { text-decoration: underline; }
.next-move-empty { color: var(--muted); font-size: 12px; }
.next-move:hover .next-move-empty { text-decoration: underline; }

/* タスクの編集。一覧の行を押すと開く。 */
.task-heading-actions { display: flex; align-items: center; gap: 12px; }
.task-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
/* 帳票から来た案件は、営業・請求管理の編集画面へのリンクになる。見た目はボタンと同じにする。 */
a.task-open { color: inherit; text-decoration: none; }
.task-open:hover .cell-title { text-decoration: underline; }
.task-form { margin-bottom: 20px; padding: 20px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fcfcfc; }
.task-form-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.task-form-heading h3 { margin: 0; font-size: 15px; }
.task-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.task-form-grid .field-wide { grid-column: 1 / -1; }
.task-form-grid label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.task-form-grid input[type="text"], .task-form-grid input[type="date"], .task-form-grid select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: white; font: inherit; }
.task-form-check { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 40px; }
.task-form-check span { margin: 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.task-form-check input { width: 18px; height: 18px; }
.task-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.task-form-message { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.primary-button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 6px; color: white; background: var(--brand); font-size: 13px; font-weight: 700; }
.primary-button:hover { background: var(--focus); }
.task-item.category-edge-client { background: var(--client-tint); }
.task-item.category-edge-prospect { background: #fdfcff; }

.category-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-top: 10px; }
.legend-note { margin: 0; color: var(--muted); font-size: 11px; }
.legend-note code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: white; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.category-breakdown { display: flex; flex-wrap: wrap; gap: 6px; }
.category-tally { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 11px; text-decoration: none; transition: border-color 160ms ease, background 160ms ease; }
.category-tally:hover { border-color: var(--line-strong); background: #f9f9f9; }
.category-tally strong { color: var(--ink); font-size: 12px; }
.category-swatch { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 2px; background: var(--tally-color, var(--line-strong)); }
.category-tally.category-client { --tally-color: var(--client); }
.category-tally.category-prospect { --tally-color: var(--prospect); }
.category-tally.category-internal { --tally-color: var(--internal); }
/* 考えていることの棚。仕事の表と違う形にして、一目で見分けられるようにする。 */
/* 学ぶこと。考えていることと同じ並びにして、ページの中で浮かないようにする。 */
.learning-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.learning-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-left: 3px solid var(--status-color, var(--line-strong)); border-radius: 8px; background: var(--panel); }
.learning-card.status-learning { --status-color: var(--progress); }
/* 学習済みは色を抜く。残してあるが、今見るものではないと分かるように。 */
.learning-card.status-done { --status-color: var(--line-strong); background: #f7f7f7; }
.learning-card.status-done .learning-open strong { color: var(--muted); }
.learning-open { width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.learning-open strong { display: block; color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.45; }
.learning-note { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
/* 状態は指でも押せる大きさにする。いちばん多い操作なので、開かずに変えられるようにしてある。 */
.learning-status select { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--panel); font-size: 12px; }
.learning-status select:focus { border-color: var(--focus); outline: 3px solid rgba(40, 40, 40, 0.12); }
.learning-archive { margin-top: 14px; }

.thinking-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.thinking-card { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 96px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: white; transition: border-color .16s ease; }
.thinking-card:hover { border-color: var(--line-strong); }
.thinking-open { display: grid; gap: 5px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.thinking-open strong { font-size: 14px; line-height: 1.4; }
.thinking-open:hover strong { text-decoration: underline; }
.thinking-card .next-move { margin: -2px 0 2px; }
.thinking-card .state-cell { justify-items: start; }
.thinking-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.thinking-due, .thinking-tasks { color: var(--muted); font-size: 10px; }
.category-tally.category-idea { --tally-color: #b4881f; }
.category-tally.category-strategy { --tally-color: #1f5b62; }
.category-tally.category-unset, .category-tally.category-unknown { --tally-color: transparent; }
.category-tally.category-unset .category-swatch, .category-tally.category-unknown .category-swatch { border: 1px dashed var(--line-strong); }

tr.category-row-client td:first-child { box-shadow: inset 3px 0 0 var(--client); }
tr.category-row-prospect td:first-child { box-shadow: inset 3px 0 0 var(--prospect); }
tr.category-row-idea td:first-child { box-shadow: inset 3px 0 0 #b4881f; }
tr.category-row-strategy td:first-child { box-shadow: inset 3px 0 0 #1f5b62; }

.empty-state { min-height: 98px; display: grid; align-content: center; justify-items: start; padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); background: #fcfcfc; }
.empty-state strong { color: var(--ink); font-size: 13px; }
.empty-state span { margin-top: 3px; font-size: 11px; }
.review-section .empty-state { border-color: #e5c891; background: #fffaf1; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 9px 10px; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 0.05em; text-align: left; text-transform: uppercase; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.cell-title { display: block; color: var(--ink); font-size: 13px; font-weight: 650; }
.cell-sub { display: block; margin-top: 3px; color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.cell-muted { color: var(--muted); }
.project-stats { display: flex; flex-wrap: wrap; gap: 6px; white-space: nowrap; }
.project-stats span { padding: 2px 6px; border-radius: 4px; color: var(--muted); background: #f2f2f2; }
.project-stats .danger-stat { color: var(--blocked); background: var(--blocked-soft); }

.support-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: 18px; }
.open-loop-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: loop; }
.open-loop-list li { position: relative; padding: 12px 8px 12px 36px; border-bottom: 1px solid var(--line); counter-increment: loop; font-size: 13px; }
.open-loop-list li:last-child { border-bottom: 0; }
.open-loop-list li::before { position: absolute; top: 13px; left: 4px; color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; content: counter(loop, decimal-leading-zero); }
.source-path { display: block; margin-top: 4px; overflow: hidden; color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.staff-list { display: grid; gap: 10px; }
.staff-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.staff-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.staff-card h3 { font-size: 14px; }
.staff-card p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.staff-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; }
.staff-stats div { padding: 7px; border-right: 1px solid var(--line); text-align: center; }
.staff-stats div:last-child { border-right: 0; }
.staff-stats strong, .staff-stats span { display: block; }
.staff-stats strong { font-size: 15px; }
.staff-stats span { color: var(--subtle); font-size: 8px; letter-spacing: 0.02em; }

.task-tools { display: flex; align-items: end; gap: 12px; margin-bottom: 14px; padding: 12px; border-radius: var(--radius-sm); background: #f6f6f6; }
.task-tools label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.task-tools label:first-child { flex: 1; }
.task-tools input, .task-tools select { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: white; font-size: 13px; }
.task-tools input:focus, .task-tools select:focus { border-color: var(--focus); outline: 3px solid rgba(40, 40, 40, 0.12); }

.source-footer { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px 30px; margin-top: 18px; padding: 22px 4px; border-top: 1px solid var(--line-strong); color: var(--muted); }
.source-footer h2 { color: var(--ink); font-size: 17px; }
.source-footer > p { grid-column: 2; margin: -8px 0 0; font-size: 11px; }
.source-folders { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.source-folders code { padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; color: #595959; background: white; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

@media (max-width: 1120px) {
  .overview-grid { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(3) { border-right: 0; }
  .metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .support-grid { grid-template-columns: 1fr; }
  .finance-grid { grid-template-columns: repeat(4, 1fr); }
  .business-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* 4枚を横に並べると数字が潰れるので、2枚ずつ折り返す。段の境目に線を入れる。 */
  #fiscal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #fiscal-grid .business-card:nth-child(2n) { padding-right: 0; border-right: 0; }
  #fiscal-grid .business-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .finance-metric:nth-child(4) { border-right: 0; }
  .finance-metric:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .finance-metric:first-child, .finance-metric { padding: 13px 10px; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: auto; height: auto; padding: 14px 16px 10px; }
  .brand { padding: 0 0 12px; }
  .brand-logo { width: 108px; }
  /* 19項目を横に並べると端が切れて探せない。畳んでおいて、ボタンで開く。 */
  /* 帯は置かず、丸いボタンだけを浮かせる。画面を広く使うため。
     右上は「再読み込み」、右下はメモが居るので左下に置く。 */
  .sidebar { position: static; padding: 0; background: transparent; }
  .sidebar .brand, .source-rail { display: none; }
  .nav-toggle { display: grid; }
  /* 現在地の文字はボタンから外す。アイコンだけにするため。開いたメニューで今いる項目が目立つ。 */
  .nav-list { display: none; }
  .sidebar.is-open .nav-list { position: fixed; left: 14px; bottom: 70px; z-index: 39; display: grid; width: min(260px, calc(100vw - 28px)); max-height: 62vh; max-height: 62dvh; overflow-y: auto; padding: 10px; border-radius: 12px; background: #282828; box-shadow: 0 10px 32px rgba(0, 0, 0, 0.38); }
  .nav-heading { margin: 10px 10px 2px; }
  .nav-heading:first-child { margin-top: 2px; }
  .nav-list a { min-height: 44px; padding: 9px 10px; font-size: 13px; }
  .source-rail { display: none; }
  .main-content { padding: 24px 18px 44px; }
  .priority-grid { grid-template-columns: 1fr; }
  .workflow-grid { grid-template-columns: 1fr; gap: 20px; }
  .workflow-grid > div, .workflow-grid > div:first-child, .workflow-grid > div:last-child { padding: 0 0 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .workflow-grid > div:last-child { padding-bottom: 0; border-bottom: 0; }
}

@media (max-width: 620px) {
  .main-content { padding-right: 12px; padding-left: 12px; }
  .topbar { align-items: center; }
  .refresh-button { padding: 9px 11px; font-size: 12px; }
  .section { padding: 17px 14px; }
  .foundation-notice { display: grid; gap: 10px; }
  .management-actions { display: grid; justify-items: end; }
  .foundation-notice > span { width: fit-content; }
  .finance-grid { grid-template-columns: repeat(2, 1fr); }
  /* 狭い画面では3枚を横に並べると数字が潰れるので、縦に積む。 */
  .business-cards, #fiscal-grid { grid-template-columns: 1fr; }
  #fiscal-grid .business-card:nth-child(-n+2) { border-bottom: 0; }
  .business-card { padding: 14px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .business-card:last-child { border-bottom: 0; }
  .finance-metric, .finance-metric:nth-child(4) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .finance-metric:nth-child(2n) { border-right: 0; }
  .finance-metric:last-child { border-bottom: 0; }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .metric { border-bottom: 1px solid var(--line); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-last-child(-n+2) { border-bottom: 0; }
  .metric:nth-child(3) { border-right: 1px solid var(--line); }
  .metric strong { font-size: 26px; }
  .task-head { display: grid; }
  .table-wrap { overflow: visible; }
  table, tbody { display: block; }
  thead { display: none; }
  tr { display: block; margin-bottom: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
  td { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
  td::before { color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; content: attr(data-label); }
  td:last-child { border-bottom: 0; }
  .task-tools { display: grid; }
  .category-legend { flex-direction: column; align-items: flex-start; }
  .source-footer { grid-template-columns: 1fr; }
  .source-footer > p { grid-column: auto; margin: 0; }
}

/* 同期された業務状況が古いときの注意表示。Macが止まっている場合に出る。 */
.updated-at.is-stale { color: var(--review); font-weight: 650; }
.global-message.stale { border-color: #e5c891; background: var(--review-soft); color: #7a4300; }

/* 案件をクライアントと社内で分けて出す。 */
.project-group { margin-top: 20px; }
.project-group:first-child { margin-top: 0; }
.project-group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.project-group-heading h3 { margin: 0; font-size: 15px; }
.project-group-heading span { color: var(--muted); font-size: 12px; }
.group-note { margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.group-note code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: #fcfcfc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
details.project-group > summary { cursor: pointer; list-style: revert; }
details.project-group > summary::-webkit-details-marker { display: revert; }
details.project-group[open] > summary { margin-bottom: 10px; }


@media (max-width: 620px) {
}

/* メモ帳。題名を付けて残す文章の一覧。
   1件を1行にして、題名と書き出しだけを出す。全文を並べると、探す場所にならない。 */
.note-search { display: block; margin: 0 0 12px; }
.note-search input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); font: inherit; }
.note-list { display: grid; gap: 8px; }
.note-card { display: flex; gap: 12px; align-items: baseline; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.note-open { flex: 1; min-width: 0; display: grid; gap: 3px; border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; }
.note-open strong { color: var(--focus); font-size: 14px; }
.note-open:hover strong { color: var(--ink); }
/* 書き出しは1行で止める。何行も出すと、一覧が全文の集まりになる。 */
.note-open small { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.note-date { flex: none; color: var(--muted); font-size: 11px; white-space: nowrap; }
/* 本文は長く書く。狭い入力欄だと、書くたびに窮屈になる。 */
#note-form textarea { width: 100%; min-height: 220px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); font: inherit; line-height: 1.7; resize: vertical; }

@media (max-width: 620px) {
  /* 携帯では日付を題名の下へ回す。横に並べると題名が潰れる。 */
  .note-card { flex-direction: column; gap: 4px; }
  .note-open small { white-space: normal; }
}

/* 出どころの札。同じ表に帳票由来と手入力が並ぶので、どちらか分かるようにする。 */
.source-chip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.source-chip.source-document { color: #1f5b62; background: #e9f3f4; }
.source-chip.source-manual { color: #636363; background: #f2f2f2; }

/* 作業場所。案件の続きに戻るための入口。 */
.link-button { min-height: 30px; display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel); font-size: 11px; cursor: pointer; }
.link-button.has-links { color: var(--focus); border-color: #d1d1d1; }
.link-button[aria-expanded="true"] { color: white; background: var(--focus); border-color: var(--focus); }
.link-count { font-variant-numeric: tabular-nums; font-weight: 700; }
.link-panel { padding: 12px 14px; border-left: 3px solid var(--focus); background: #f9f9f9; }
.link-list { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
/* 1行に1つ。種類・中身・操作・最後に開いた日を横に並べる。 */
.link-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.link-kind { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 650; white-space: nowrap; }
/* 道具ごとの札。作り手ごとに色をまとめる。
   1つずつ違う色にすると8色が並んで、どれも同じに見えて区別の役に立たない。 */
.link-kind.kind-claude-code, .link-kind.kind-claude { color: #8a4b2a; background: #fbf0e8; }
.link-kind.kind-chatgpt, .link-kind.kind-codex { color: #1f5f4a; background: #e9f5f0; }
.link-kind.kind-gemini, .link-kind.kind-antigravity { color: #21576b; background: var(--progress-soft); }
.link-kind.kind-folder { color: #66500f; background: var(--waiting-soft); }
.link-kind.kind-other { color: #636363; background: #f2f2f2; }
.link-body { min-width: 0; display: grid; gap: 2px; }
.link-body strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.link-body small { color: var(--muted); font-size: 11px; }
.link-actions { display: flex; gap: 10px; white-space: nowrap; }
.link-opened { color: var(--muted); font-size: 11px; white-space: nowrap; }
/* 足す欄。種類・名前・場所・ここまでを1行に。 */
.link-form { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.2fr) auto auto; gap: 8px; align-items: center; }
.link-form select, .link-form input { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); font: inherit; font-size: 12px; }

@media (max-width: 820px) {
  /* 狭い画面では縦に積む。横に6つ並べると、どの欄も読めない幅になる。 */
  .link-row { grid-template-columns: auto minmax(0, 1fr); }
  .link-actions, .link-opened { grid-column: 1 / -1; }
  .link-form { grid-template-columns: 1fr; }
}

/* ---- LINEの受信箱（line-inbox.js） ----
   トップの「LINE新着」と、受信箱のページ（line.html）で同じ行を使う。
   LINEらしさは緑を少しだけ（未読の印）にとどめ、画面全体の黒・白・灰色を崩さない。 */
:root { --line-green: #06c755; }
.nav-badge { min-width: 20px; margin-left: auto; padding: 1px 6px; border-radius: 999px; color: white; background: var(--line-green); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.line-friend-list { display: grid; gap: 6px; }
.line-friend { display: flex; gap: 12px; align-items: center; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: inherit; background: var(--panel); text-decoration: none; transition: border-color 160ms ease, background 160ms ease; }
.line-friend:hover { border-color: var(--line-strong); background: #fafafa; }
.line-friend.is-selected { border-color: var(--focus); background: #f4f4f4; }
.line-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; object-fit: cover; background: var(--brand-soft); }
.line-avatar.large { width: 44px; height: 44px; }
.line-avatar-initial { display: grid; place-items: center; color: var(--muted); font-size: 15px; font-weight: 700; }
.line-friend-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.line-friend-top { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.line-friend-top strong { font-size: 14px; }
.line-friend.has-unread .line-friend-top strong { font-weight: 800; }
.line-customer { color: var(--muted); font-size: 11px; }
.line-friend-body small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.line-friend.has-unread .line-friend-body small { color: var(--ink); }
.line-friend-side { flex: none; display: grid; justify-items: end; gap: 4px; color: var(--subtle); font-size: 11px; }
.line-unread { min-width: 20px; padding: 0 6px; border-radius: 999px; color: white; background: var(--line-green); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.line-tag { padding: 0 6px; border-radius: 4px; font-size: 10px; font-weight: 700; line-height: 17px; }
.line-tag.status-new { color: var(--review); background: var(--review-soft); }
.line-tag.status-active { color: var(--progress); background: var(--progress-soft); }
.line-tag.status-done { color: var(--complete); background: var(--complete-soft); }
.line-tag.blocked { color: var(--blocked); background: var(--blocked-soft); }
.line-more { display: inline-block; margin-top: 10px; color: var(--muted); font-size: 12px; }

.line-layout { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.line-list-pane { max-height: calc(100vh - 220px); overflow-y: auto; }
.line-thread-pane { display: flex; flex-direction: column; min-height: 420px; max-height: calc(100vh - 220px); border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafafa; }
.line-thread-pane > .empty-state { margin: 16px; }
.line-thread-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.line-thread-name { flex: 1; min-width: 0; display: grid; }
.line-thread-name strong { font-size: 15px; }
.line-thread-name small { color: var(--muted); font-size: 11px; }
.line-status select, .line-filter select { min-height: 34px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--panel); font-size: 12px; }
.line-back { display: none; }
.line-messages { flex: 1; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 16px; overflow-y: auto; list-style: none; }
.line-message { display: flex; align-items: flex-end; gap: 6px; max-width: 78%; }
.line-message.in { align-self: flex-start; }
.line-message.out { align-self: flex-end; flex-direction: row-reverse; }
.line-bubble { margin: 0; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.line-message.in .line-bubble { border: 1px solid var(--line); border-bottom-left-radius: 4px; background: var(--panel); }
.line-message.out .line-bubble { border-bottom-right-radius: 4px; color: white; background: var(--focus); }
.line-bubble.is-media { color: var(--muted); font-size: 12px; }
.line-message time, .line-event time { flex: none; color: var(--subtle); font-size: 10px; }
.line-event { display: flex; gap: 6px; align-self: center; align-items: baseline; padding: 2px 10px; border-radius: 999px; color: var(--muted); background: #eeeeee; font-size: 11px; }
.line-reply-note { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

/* 狭い画面では一覧とやりとりを切り替える。2列にすると、どちらも読めない幅になる。 */
@media (max-width: 820px) {
  .line-layout { grid-template-columns: 1fr; }
  .line-list-pane, .line-thread-pane { max-height: none; }
  .line-layout.is-thread-open .line-list-pane { display: none; }
  .line-layout:not(.is-thread-open) .line-thread-pane { display: none; }
  .line-back { display: inline-flex; }
  .line-thread-pane { min-height: 60vh; }
  .line-messages { max-height: 65vh; }
  .line-message { max-width: 88%; }
}

/* 受信箱の「設定を確認」の結果。 */
.line-setup { margin: -6px 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafafa; font-size: 12px; }
.line-setup p { margin: 0; color: var(--muted); }
.line-setup ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.line-setup li { display: grid; gap: 1px; }
.line-setup li.ok strong { color: var(--complete); }
.line-setup li.ng strong { color: var(--blocked); }
.line-setup li span { color: var(--muted); }

/* 問い合わせフォームの回答。受信箱のやりとりの中に、カードとして出す。 */
.line-tag.inquiry { color: var(--ink); background: var(--brand-soft); }
.line-tag.chat { color: var(--progress); background: var(--progress-soft); }
.line-tag.chat.stalled { color: var(--review); background: var(--review-soft); }
.line-inquiry { align-self: stretch; padding: 12px 14px; border: 1px solid var(--line-strong); border-left: 3px solid var(--line-green); border-radius: var(--radius-sm); background: var(--panel); }
.line-inquiry-title { margin: 0 0 8px; font-size: 14px; font-weight: 800; }
.line-inquiry dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 13px; }
.line-inquiry dl div { display: contents; }
.line-inquiry dt { color: var(--muted); }
.line-inquiry dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.line-inquiry time { display: block; margin-top: 8px; color: var(--subtle); font-size: 10px; }
@media (max-width: 620px) {
  .line-inquiry dl { grid-template-columns: 1fr; gap: 0; }
  .line-inquiry dd { margin-bottom: 6px; }
}

/* 会話の上の操作（顧客登録・結び付け・案件化）。 */
.line-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.line-action { display: inline-flex; min-height: 34px; align-items: center; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: var(--panel); font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; }
.line-action.primary { border-color: var(--brand); color: white; background: var(--brand); }
.line-action:disabled { opacity: .5; }
.line-link { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 5px; background: var(--brand-soft); font-size: 12px; }
.line-link a { font-weight: 700; }
.line-picker { padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fcfcfc; }
.line-picker p { margin: 0; color: var(--muted); font-size: 12px; }
.line-picker input { width: 100%; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 5px; font-size: 14px; }
.line-picker ul { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.line-picker li button { display: grid; width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); text-align: left; cursor: pointer; }
.line-picker li button:hover { border-color: var(--focus); }
.line-picker li small { color: var(--muted); font-size: 11px; }
.line-picker-empty { color: var(--muted); font-size: 12px; }

/* 手入力の案件の［見積を作る］。帳票の列に、帳票の札と同じ大きさで出す。 */
.quote-from-project { display: inline-flex; min-height: 28px; align-items: center; padding: 3px 10px; border: 1px solid var(--focus); border-radius: 5px; color: var(--focus); background: var(--panel); font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.quote-from-project:hover { color: white; background: var(--focus); }
