/* Task ボード: 落ち着いたカレンダー風の業務ツール。スマホ優先（最小幅 360px）
   ルール: 文字は 400 と 600 だけ / 余白は 4 の倍数 / 区切りは 1px の薄い線 / 色だけに頼らず頭文字・形でも区別する */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #1b2330;
  --muted: #5b6575;
  --line: #e5e7eb;
  --line-strong: #c9ced6;
  --primary: #1e3a5f;
  --primary-ink: #ffffff;
  --primary-soft: #e8eef6;
  --late: #c0392b;
  --blue-dot: #2f6feb;
  --work: #0f7a56;
  --work-soft: #e3f5ed;
  --wait: #6b7280;
  --wait-soft: #f1f2f5;
  --mine: #b45309;
  --green: #0f7a56;
  --yellow: #8a5a00;
  --red: #b3261e;
  --green-soft: #e3f5ed;
  --yellow-soft: #fff4d6;
  --red-soft: #fdecea;
  --danger: #b3261e;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .04);
  --top-h: calc(52px + env(safe-area-inset-top));
  --tab-total: calc(49px + env(safe-area-inset-bottom));
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131a;
    --surface: #171c25;
    --surface-2: #1f2630;
    --text: #e8ecf2;
    --muted: #9aa5b5;
    --line: #2a3340;
    --line-strong: #3d4757;
    --primary: #8db4f0;
    --primary-ink: #0c1424;
    --primary-soft: #1c2a44;
    --late: #ff8f87;
    --blue-dot: #6f9bff;
    --work: #4fd1a0;
    --work-soft: #17302a;
    --wait: #9aa5b5;
    --wait-soft: #1f2630;
    --mine: #f5b25b;
    --green: #4fd1a0;
    --yellow: #f0c05a;
    --red: #ff8f87;
    --green-soft: #17302a;
    --yellow-soft: #3a3014;
    --red-soft: #3d1f1d;
    --danger: #ff8f87;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: normal;
  line-break: strict;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
body.has-tabs { padding-bottom: calc(var(--tab-total) + 16px); }
body.has-fab { padding-bottom: calc(var(--tab-total) + 96px); }
a { color: var(--primary); }
h1, h2, h3, b, strong, th { font-weight: 600; }
h1, h2, h3 { line-height: 1.4; margin: 0; }
p { margin: 0 0 8px; text-wrap: pretty; }
h1, h2, .tile-title { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- 担当の色（色に加えて必ず頭文字を出す。明るい色の上は濃い文字） ---- */
.o-takatori { --oc: #1e3a5f; --oc-ink: #ffffff; }
.o-matsumoto { --oc: #2ba6a0; --oc-ink: #0b2a29; }
.o-miyamoto { --oc: #e07b39; --oc-ink: #2a1403; }
.o-none { --oc: #7b8494; --oc-ink: #ffffff; }
@media (prefers-color-scheme: dark) { .o-takatori { --oc: #5b86bd; --oc-ink: #08111f; } }
.dot { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--oc); color: var(--oc-ink); font-style: normal; font-size: 9px; font-weight: 600; line-height: 1; flex: none; }
@media (prefers-color-scheme: dark) { .dot { box-shadow: 0 0 0 1px rgba(255, 255, 255, .3); } }
.oi { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--oc); color: var(--oc-ink); font-weight: 600; font-size: 14px; line-height: 1; }
.oi-sm { width: 24px; height: 24px; font-size: 12px; }

/* ---- ヘッダー・下タブ・追加ボタン ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: var(--top-h); padding: env(safe-area-inset-top) 12px 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; font-size: 17px; letter-spacing: .02em; color: var(--primary); text-decoration: none; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 4px; min-width: 0; }
.who form { margin: 0; }
.who-name { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 5.5em; text-decoration: none; }
.who .btn-sm { padding: 0 8px; color: var(--muted); font-weight: 400; font-size: 12px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: var(--tab-total); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar-in { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 560px; margin: 0 auto; height: 49px; }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 11px; line-height: 1.2; font-weight: 400;
  -webkit-tap-highlight-color: transparent;
}
.tabbar a[aria-current="page"] { color: var(--primary); font-weight: 600; }
.tabbar a[aria-current="page"] svg { stroke-width: 2.25; }

.fab {
  position: fixed; z-index: 32;
  right: calc(16px + env(safe-area-inset-right)); bottom: calc(var(--tab-total) + 16px);
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px 0 16px; border-radius: 24px;
  background: var(--primary); color: var(--primary-ink); font-size: 15px; font-weight: 600; text-decoration: none;
  box-shadow: 0 4px 16px rgba(20, 30, 50, .28); -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: translateY(1px); }
/* 狭い画面: 文字を隠して丸ボタンにし（aria-label で読み上げは残す）、一覧の右端（日付・遅れ日数・日付チップ）にかぶらないよう行の右に余白をとる */
@media (max-width: 719px) {
  .fab { width: 48px; padding: 0; justify-content: center; border-radius: 50%; }
  .fab span { display: none; }
  body.has-fab .row-main { padding-right: 68px; }
  body.has-fab .resched { padding-right: 68px; }
}

/* ---- ページ枠 ---- */
.page { max-width: 720px; margin: 0 auto; padding: 12px 16px 16px; }
.page-wide { max-width: 1480px; }
.page:has(.home) { max-width: 1040px; }
.page-title { font-size: 20px; margin: 8px 0 4px; }
.lead { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.back { margin: 0 0 8px; }
.back a { display: inline-block; min-height: 44px; line-height: 44px; text-decoration: none; font-weight: 600; }
.center { text-align: center; }
.help { color: var(--muted); font-size: 12px; margin: 4px 0 0; }

.notice { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; }
.notice p { margin: 4px 0 0; }
.notice ul { margin: 8px 0 0; padding-left: 20px; }
.ok-box { background: var(--green-soft); border-color: var(--green); }
.warn-box { background: var(--yellow-soft); border-color: var(--yellow); }
.err-box { background: var(--red-soft); border-color: var(--red); }

/* ---- ボタン・フォーム ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--primary);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.danger-zone .btn-quiet { font-weight: 400; }
.danger-zone { box-shadow: none; background: transparent; margin-top: 24px; }
.danger-zone h2 { font-size: 14px; }
.btn-quiet { background: transparent; border-color: transparent; }
.btn-sm { min-height: 44px; padding: 0 12px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }

.field { margin: 0 0 16px; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; padding: 0; }
.req { display: inline-block; margin-left: 4px; padding: 0 4px; border: 1px solid var(--late); border-radius: 4px; color: var(--late); font-size: 12px; font-weight: 600; line-height: 1.4; vertical-align: 1px; }
.req[hidden] { display: none; }
.inp {
  display: block; width: 100%; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; /* 16px 未満だと iPhone が入力時に拡大する */
}
textarea.inp { min-height: 96px; resize: vertical; }
.inp:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.has-err .inp { border-color: var(--red); }
.err { color: var(--red); font-weight: 600; font-size: 14px; margin: 4px 0 0; }
.latest { background: var(--yellow-soft); border-left: 4px solid var(--yellow); padding: 4px 8px; border-radius: 4px; font-size: 14px; margin: 8px 0 0; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 4px 0 16px; font-size: 15px; }
.check input { width: 24px; height: 24px; flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 520px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* 日付の候補ボタン・過去日の注意 */
.date-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.chip-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 8px; border-radius: 22px; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--primary);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.chip-btn[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); }
.note-past { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--yellow); }
.note-past::before { content: "⚠ "; }
.note-past[hidden] { display: none; }

/* 担当（3人のボタン型ラジオ） */
.owner-field { border: 0; padding: 0; margin: 0 0 16px; }
.owner-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.op { position: relative; display: block; min-width: 0; }
.op input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.op-face { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 48px; padding: 0 2px; white-space: nowrap; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 15px; }
.op-name { white-space: nowrap; }
.op input:checked + .op-face { border-color: var(--oc); box-shadow: inset 0 0 0 1px var(--oc); background: color-mix(in srgb, var(--oc) 12%, var(--surface)); font-weight: 600; }
.op input:checked + .op-face .op-name::after { content: " ✓"; }
.op input:focus-visible + .op-face { outline: 2px solid var(--primary); outline-offset: 2px; }
.has-err .op-face { border-color: var(--red); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; box-shadow: var(--shadow); }
.panel h2 { font-size: 15px; margin-bottom: 12px; color: var(--muted); }
.savebar { position: sticky; bottom: calc(var(--tab-total) + 8px); z-index: 10; margin: 0 0 16px; padding-top: 8px; }
.savebar .btn { box-shadow: 0 4px 16px rgba(20, 30, 50, .25); }

/* ---- ログイン・パスワード ---- */
body.bare { display: flex; min-height: 100vh; }
body.bare .page { width: 100%; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px 20px; box-shadow: var(--shadow); }
.auth-title { font-size: 24px; text-align: center; letter-spacing: .02em; }
.auth-sub { color: var(--muted); text-align: center; margin: 4px 0 20px; font-size: 14px; }

/* ---- 売上・キャパ（カンバン画面） ---- */
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-width: 0; }
.stat-main { grid-column: 1 / -1; background: var(--primary-soft); border-color: var(--primary); }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 20px; font-weight: 600; line-height: 1.4; font-variant-numeric: tabular-nums; }
.stat-main .stat-value { font-size: 24px; }
.stat-sub { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; min-height: 16px; }
.plus { color: var(--text); font-weight: 600; }
.miss { color: var(--mine); font-weight: 600; }
@media (min-width: 720px) {
  .summary { grid-template-columns: 1.4fr 1fr 1fr; }
  .stat-main { grid-column: auto; }
}
.capacity { display: flex; flex-wrap: nowrap; gap: 8px; margin-bottom: 12px; align-items: stretch; }
.cap {
  display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 4px 12px; line-height: 1.4;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600;
}
.cap-green { border-color: var(--green); background: var(--green-soft); }
.cap-yellow { border-color: var(--yellow); background: var(--yellow-soft); }
.cap-red { border-color: var(--red); background: var(--red-soft); }
.cap-name { font-size: 12px; color: var(--muted); font-weight: 400; }
.cap-sig { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cap-go { margin-left: auto; flex: 1 1 auto; min-width: 0; padding: 4px 8px; min-height: 52px; }

/* ---- カンバン ---- */
.board-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; }
.legend { margin: 0; font-size: 12px; color: var(--muted); }
.toggle { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 14px; }
.swipe-hint { margin: 0 0 8px; text-align: center; font-size: 12px; color: var(--muted); }
@media (min-width: 1100px) { .swipe-hint { display: none; } }

.board {
  display: flex; gap: 12px; align-items: flex-start;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  padding: 4px 4px 16px; margin: 0 -4px;
}
.col { flex: 0 0 min(84vw, 320px); scroll-snap-align: start; scroll-margin-left: 4px; min-width: 0; background: var(--surface-2); border-radius: var(--radius); padding: 8px; }
@media (min-width: 1100px) { .col { flex: 1 1 0; min-width: 210px; } }
.col-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; padding: 8px 8px; }
.count { color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.col-head .count { min-width: 28px; text-align: center; padding: 0 8px; border-radius: 99px; background: var(--surface); }
.col-body { display: flex; flex-direction: column; gap: 8px; }
.col-empty { color: var(--muted); text-align: center; font-size: 14px; margin: 8px 0; }

.tile {
  display: block; color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-left-width: 4px;
  border-radius: 12px; padding: 12px; -webkit-tap-highlight-color: transparent;
}
.tile:active { transform: translateY(1px); }
.tile.work { border-left-color: var(--work); }
.tile.wait { border-left-color: var(--wait); background: var(--wait-soft); }
.tile.mine { box-shadow: 0 0 0 2px var(--mine); }
.tile.excluded { opacity: .65; }
.tile-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.tile-id { font-weight: 600; font-variant-numeric: tabular-nums; }
.chip { padding: 0 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; line-height: 20px; }
.chip-gray { background: var(--wait-soft); border: 1px solid var(--line); }
.tile-title { font-weight: 600; line-height: 1.4; margin: 4px 0 0; }
.tile-client { font-size: 12px; color: var(--muted); }
.tile-state { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 0; }
.state { display: inline-block; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 600; line-height: 24px; }
.state-work { background: var(--work-soft); color: var(--work); border: 1px solid var(--work); }
.state-wait { background: var(--wait-soft); color: var(--wait); border: 1px dashed var(--wait); }
.badge-mine { display: inline-block; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 600; line-height: 24px; background: var(--mine); color: #fff; }
@media (prefers-color-scheme: dark) { .badge-mine { color: #1a1204; } }
.tile-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.tile-meta .amount { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.late { color: var(--late); font-weight: 600; }

/* ---- カード詳細 ---- */
.card-head { margin-bottom: 12px; }
.card-title { font-size: 20px; margin: 8px 0; }
.kv { display: grid; grid-template-columns: 8em 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; font-size: 14px; }
.kv dd { margin: 0; }
.kv.big dd { font-size: 17px; font-weight: 600; }
.actions { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
details.confirm > summary { list-style: none; width: 100%; }
details.confirm > summary::-webkit-details-marker { display: none; }
.confirm-body { margin-top: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.confirm-body form { margin: 12px 0; }
.confirm-body > form > .btn, .confirm-body > .btn { width: 100%; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 6.5em 3.2em 1fr; gap: 0 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.history li:first-child { border-top: 0; }
.h-at { color: var(--muted); font-variant-numeric: tabular-nums; }
.h-who { font-weight: 600; }

/* ---- 受けられる？ ---- */
.type-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.type-btn { min-height: 64px; font-size: 16px; padding: 4px; }
.type-btn.is-on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.verdict { display: flex; align-items: center; gap: 16px; border-radius: 20px; padding: 16px; margin-bottom: 16px; border: 1px solid var(--line); }
.verdict-green { background: var(--green-soft); border-color: var(--green); }
.verdict-yellow { background: var(--yellow-soft); border-color: var(--yellow); }
.verdict-red { background: var(--red-soft); border-color: var(--red); }
.verdict-emoji { font-size: 48px; line-height: 1; }
.verdict-kind { font-size: 12px; color: var(--muted); font-weight: 600; }
.verdict-word { font-size: 20px; font-weight: 600; line-height: 1.4; }
.verdict-note { margin: 4px 0 0; font-size: 15px; }
.cap-list { list-style: none; margin: 0; padding: 0; }
.cap-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.cap-list li:first-child { border-top: 0; }

/* ---- ホーム画面追加の案内 ---- */
.guide { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; margin: 8px 0 16px; }
.guide summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; font-size: 14px; cursor: pointer; }
.guide ol { margin: 0 0 12px; padding-left: 20px; font-size: 15px; }
.guide li { margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.nw { white-space: nowrap; }

/* ---- デザイン素材（ログイン背景・空の状態） ---- */
.auth-bg { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: -1; pointer-events: none; }
body.bare { background: linear-gradient(180deg, #3f6fa6 0%, #dcecf5 55%, #1e3a5f 100%); }
body.bare .auth-card { background: rgba(255, 255, 255, .93); border-color: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 8px 28px rgba(30, 58, 95, .28); }
@media (prefers-color-scheme: dark) {
  body.bare { background: linear-gradient(180deg, #14263f 0%, #1e3a5f 100%); }
  .auth-bg { filter: brightness(.45) saturate(.9); }
  body.bare .auth-card { background: rgba(23, 28, 37, .94); border-color: var(--line); box-shadow: 0 8px 28px rgba(0, 0, 0, .45); }
}
.empty-state { text-align: center; margin: 4px 0 16px; padding: 8px 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.empty-state img { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; border-radius: 12px; }
.empty-title { font-weight: 600; margin: 8px 0 0; }
.empty-sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
@media (prefers-color-scheme: dark) { .empty-state img { filter: brightness(.8); } }

/* ================= 通知 ================= */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--text); text-decoration: none; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.bell[aria-expanded="true"] { background: var(--primary-soft); }
.bell-n { position: absolute; top: 4px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #c0392b; color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.notif { position: fixed; z-index: 38; left: 0; right: 0; top: var(--top-h); max-height: calc(100dvh - var(--top-h) - var(--tab-total)); overflow-y: auto; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 8px 24px rgba(20, 30, 50, .16); }
.notif[hidden] { display: none; }
.notif-inner { max-width: 720px; margin: 0 auto; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; min-height: 48px; position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.notif-head strong { flex: 1; font-size: 16px; }
.notif-head form { margin: 0; }
.notif-close { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-weight: 600; font-size: 14px; text-decoration: none; }
.notif-list ul { list-style: none; margin: 0; padding: 0; }
.notif-group { margin: 0; padding: 12px 16px 4px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.notif-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 12px; align-items: center; min-height: 56px; padding: 8px 16px; border-bottom: 1px solid var(--line); color: var(--muted); text-decoration: none; position: relative; }
.n-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.notif-row.unread { color: var(--text); }
.notif-row.unread .n-dot { background: var(--blue-dot); }
.notif-row.unread .n-text { font-weight: 600; }
.n-text { font-size: 15px; line-height: 1.4; }
.n-at { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* スマホ通知（🔔パネル内。ボタン・案内は push.js が出し分ける） */
.push-box { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.push-box [hidden] { display: none; }
.push-btn { width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.push-hint, .push-msg { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.push-btn + .push-msg { margin-top: 6px; }
.notif-empty { margin: 0; padding: 24px 16px; color: var(--muted); text-align: center; }

/* ================= ホーム（カレンダー） ================= */
/* 売上・キャパの薄い帯（タップで開く） */
.strip { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.strip > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 16px; list-style: none; cursor: pointer; font-size: 14px; -webkit-tap-highlight-color: transparent; }
.strip > summary::-webkit-details-marker { display: none; }
.strip > summary::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 0 0 4px; }
.strip[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.strip-main { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-sig { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.strip-body { padding: 0 16px 12px; border-top: 1px solid var(--line); }
.strip-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 12px 0; font-size: 14px; }
.strip-kv dt { color: var(--muted); }
.strip-kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.strip-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; font-size: 14px; }
.strip-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }

/* 全員 / 自分だけ（凡例をかねる） */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.chip-who { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--surface); color: var(--muted); font-size: 15px; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.chip-who[aria-current="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.chip-legend { display: inline-flex; gap: 4px; }

@media (min-width: 900px) { .home-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; } .home-cal { position: sticky; top: calc(var(--top-h) + 8px); } }

/* 月カレンダー（7列・横スクロールなし） */
.home-cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px 8px; margin: 0 0 16px; touch-action: pan-y; }
/* スマホではカレンダーを固定しない（2026-11-05 髙取さん: 予定一覧の表示域が狭すぎるため）。PC 幅の横並びのときだけ固定 */
.cal-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; height: 44px; }
.cal-title { position: relative; font-size: 17px; text-align: center; }
.cal-arrow { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; font-size: 28px; line-height: 1; text-decoration: none; color: var(--primary); -webkit-tap-highlight-color: transparent; }
.cal-today { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 14px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--primary); background: var(--surface); }
.cal-today::before { content: ""; position: absolute; inset: -8px -4px; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-bottom: 2px; }
.cal-head span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-head .sun { color: #d14b4b; }
.cal-head .sat { color: #3b73b9; }
.day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; padding: 4px 0 4px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text); text-decoration: none; -webkit-tap-highlight-color: transparent; overflow: hidden; }
.day.out { opacity: .4; }
.dn { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; border-radius: 12px; font-size: 15px; line-height: 1; font-variant-numeric: tabular-nums; }
.day.red .dn { color: #d14b4b; }
.day.blue .dn { color: #3b73b9; }
.more { position: absolute; top: 4px; right: 4px; font-size: 11px; color: var(--muted); line-height: 1.2; }
.dots { display: flex; justify-content: center; gap: 2px; min-height: 14px; }
.day.today .dn, .day.today.red .dn, .day.today.blue .dn { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.day.sel { background: var(--primary-soft); border-color: var(--primary); }
@media (prefers-color-scheme: dark) {
  .cal-head .sun, .day.red .dn { color: #ff8f87; }
  .cal-head .sat, .day.blue .dn { color: #7db0ec; }
}

/* 予定のリスト */
.block { margin: 0 0 16px; }
.block-head { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 8px; }
.block-help { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.block-empty { padding: 16px; text-align: center; color: var(--muted); }
.block-empty p { margin: 0 0 4px; }
.link-add { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 15px; text-decoration: none; }
.block-late .block-head { color: var(--late); }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { border-left: 4px solid var(--oc); border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-main { display: flex; gap: 12px; align-items: center; min-height: 56px; padding: 8px 12px; color: var(--text); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.row-main:active { background: var(--surface-2); }
.row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.row-next { font-size: 15px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-next em { color: var(--muted); font-style: normal; font-weight: 400; }
.row-sub { display: flex; align-items: baseline; min-width: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.row-title { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-chip { flex: none; white-space: nowrap; }
.who-chip::before { content: "・"; }
.row .late { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; line-height: 1.4; }
.row .late-date { font-weight: 600; }
.resched { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 12px 12px 12px; margin: 0; }
.resched-label { flex: 1 1 100%; font-size: 12px; color: var(--muted); }

.fold > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; list-style: none; color: var(--muted); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "▸"; }
.fold[open] > summary::before { content: "▾"; }

/* ================= 下タブが4つのとき ================= */
.tabbar-in.tabs-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tabbar a span { white-space: nowrap; }

/* ---- 1e: 3メニューのカンバン・ボールのアイコン・詳細画面・過去のメモ ---- */
.o-client { --oc: #9aa1ab; --oc-ink: #15191f; }
.o-ai { --oc: #7c4dcc; --oc-ink: #ffffff; }
@media (prefers-color-scheme: dark) { .o-ai { --oc: #a98bea; --oc-ink: #160b2b; } }
.oi.o-ai { font-size: 11px; letter-spacing: -.02em; }
.menu-tabs { position: sticky; top: var(--top-h); z-index: 5; background: var(--bg); padding: 8px 0; margin: 0 0 4px; flex-wrap: nowrap; }
.menu-tabs .chip-who { flex: 1 1 0; justify-content: center; padding: 0 8px; gap: 6px; white-space: nowrap; }
.menu-tabs .count { min-width: 22px; text-align: center; padding: 0 6px; border-radius: 99px; background: var(--surface-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.tile-list { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 16px; }
@media (min-width: 760px) { .tile-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tile-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile-row { display: flex; align-items: flex-start; gap: 12px; }
.tile-row .oi { margin-top: 2px; }
.tile-main { min-width: 0; flex: 1; }
.tile.done { border-left-color: var(--line-strong); }
.chip-stage { background: var(--primary-soft); color: var(--primary); }
.list-sub { font-size: 14px; color: var(--muted); margin: 16px 0 8px; }
.card-head .tile-state .oi { margin-right: 4px; }
.kv-strong { font-weight: 600; }
.memo-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.card-actions { margin: 0 0 16px; }
.memo-log { list-style: none; margin: 0; padding: 0; }
.memo-log li { padding: 12px 0; border-top: 1px solid var(--line); }
.memo-log li:first-child { border-top: 0; padding-top: 0; }
.memo-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
@media (max-width: 420px) { .kv { grid-template-columns: 7.5em 1fr; } }

/* ---- 1f: 変更要請の色（通常＝グレー／要請中＝レッド／承認済み＝ブルー）。色に加えて必ず文字の印を出す ---- */
:root { --req-gray: #9aa1ab; --req-gray-soft: #f3f4f6; --req-red: #c62828; --req-red-soft: #fdecec; --req-blue: #1f5fbf; --req-blue-soft: #e8f0fc; }
@media (prefers-color-scheme: dark) { :root { --req-gray: #6b7482; --req-gray-soft: #1c222b; --req-red: #ff8a80; --req-red-soft: #3a1c1c; --req-blue: #8ab4ff; --req-blue-soft: #18263d; } }
.tile.req-normal, .tile.req-normal.work, .tile.req-normal.wait { border-left-color: var(--req-gray); background: var(--req-gray-soft); }
.tile.req-pending, .tile.req-pending.work, .tile.req-pending.wait { border-left-color: var(--req-red); background: var(--req-red-soft); border-color: var(--req-red); border-left-width: 6px; }
.tile.req-approved, .tile.req-approved.work, .tile.req-approved.wait { border-left-color: var(--req-blue); background: var(--req-blue-soft); border-left-width: 6px; }
.req-badge { display: inline-block; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 600; line-height: 24px; }
.req-badge-pending { background: var(--req-red); color: #fff; }
.req-badge-approved { background: var(--req-blue); color: #fff; }
.req-badge-me { background: var(--surface); color: var(--req-red); border: 1px solid var(--req-red); }
@media (prefers-color-scheme: dark) { .req-badge-pending, .req-badge-approved { color: #10141a; } }
.lg { white-space: nowrap; font-weight: 600; }
.lg-pending { color: var(--req-red); }
.lg-approved { color: var(--req-blue); }
.req-banner { border: 2px solid var(--req-red); background: var(--req-red-soft); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 12px; }
.req-banner-head { margin: 0 0 4px; font-weight: 600; color: var(--req-red); }
.req-banner ul { margin: 0; padding-left: 1.2em; }
.req-banner li { padding: 4px 0; }
.req-banner a { font-weight: 600; }
.req-panel { border: 2px solid var(--req-red); }
.req-panel h2 { color: var(--req-red); }
.req-meta { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; }
.req-diff { list-style: none; margin: 0 0 12px; padding: 0; }
.req-diff li { display: grid; grid-template-columns: 1fr auto 1fr; gap: 4px 8px; padding: 8px 0; border-top: 1px solid var(--line); align-items: start; }
.req-diff li:first-child { border-top: 0; }
.req-f { grid-column: 1 / -1; font-weight: 600; font-size: 13px; color: var(--muted); }
.req-from { color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.req-to { font-weight: 600; overflow-wrap: anywhere; }
.req-arrow { color: var(--muted); }
.chip-warn { background: var(--yellow-soft); color: var(--yellow); }
.req-approvals { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.req-approvals li { display: flex; align-items: center; gap: 8px; }
.req-ok { color: var(--req-blue); font-weight: 600; }
.req-wait { color: var(--muted); }
.btn-disabled { opacity: .6; cursor: default; color: var(--req-red); border-color: var(--req-red); }
.savebar-help { margin: 0 0 8px; }
.card-head .req-badge { margin-left: 4px; }
.tile.req-pending.mine { box-shadow: 0 0 0 2px var(--req-red); }

/* ---------- 1g 香盤表（横＝1週間、縦＝担当） ---------- */
.sched-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.sched-week { flex: 1; margin: 0; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.sched-nav, .sched-now { min-height: 44px; padding: 0 12px; white-space: nowrap; }
@media (max-width: 420px) { .sched-nav-t { display: none; } .sched-nav { min-width: 44px; justify-content: center; } }
.sched-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sfc { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: 14px; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.sfc.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.sched-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.sched-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sched { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px; table-layout: fixed; font-size: 12px; }
.sched.has-late { min-width: 880px; }
.sched th, .sched td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; padding: 4px; }
.sched tr:last-child > * { border-bottom: 0; }
.sched tr > *:last-child { border-right: 0; }
.sched thead th { background: var(--surface-2, var(--bg)); font-weight: 600; text-align: center; padding: 6px 4px; color: var(--text); }
.sched-who { position: sticky; left: 0; z-index: 2; width: 64px; background: var(--surface); text-align: left; }
.sched thead .sched-who { z-index: 3; background: var(--surface-2, var(--bg)); color: var(--muted); font-weight: 500; }
.sched tbody .sched-who { border-left: 4px solid var(--oc); }
.sched-who .oi { margin: 0 0 4px; }
.sw-name { display: block; font-size: 13px; font-weight: 600; }
.sched-late-h, .sched-late { width: 116px; background: var(--red-soft); }
.sched-late-h { color: var(--late) !important; font-size: 11px; line-height: 1.3; }
.sched-day .sd-dow { display: block; font-size: 11px; color: var(--muted); }
.sched-day .sd-md { font-size: 14px; font-variant-numeric: tabular-nums; }
.sched-day .sd-hol { display: block; font-size: 10px; font-weight: 500; color: var(--late); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-day.wd-sun .sd-dow, .sched-day.wd-sun .sd-md, .sched-day.holiday .sd-dow, .sched-day.holiday .sd-md { color: var(--late); }
.sched-day.wd-sat .sd-dow, .sched-day.wd-sat .sd-md { color: var(--blue-dot); }
.sched-day.today { background: var(--primary); }
.sched-day.today .sd-dow, .sched-day.today .sd-md, .sched-day.today .sd-hol { color: var(--primary-ink); }
.sched-cell.today { background: var(--primary-soft); }
.sched-row td { height: 72px; }
/* 小さなカード */
.sc { display: block; margin: 0 0 4px; padding: 4px 6px 6px; border: 1px solid var(--line); border-left: 4px solid var(--req-gray); border-radius: 8px; background: var(--req-gray-soft); color: var(--text); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.sc:last-child { margin-bottom: 0; }
.sc:active { transform: translateY(1px); }
.sc.req-pending { border-color: var(--req-red); border-left-color: var(--req-red); background: var(--req-red-soft); }
.sc.req-approved { border-left-color: var(--req-blue); background: var(--req-blue-soft); }
.sc.mine { box-shadow: 0 0 0 2px var(--mine); }
.sc.req-pending.mine { box-shadow: 0 0 0 2px var(--req-red); }
.sc.excluded { opacity: .65; }
.sc.st-done { opacity: .8; }
.sc-top { display: flex; align-items: center; gap: 4px; }
.oi.oi-xs { width: 20px; height: 20px; font-size: 10px; }
.sc-st { font-size: 10px; line-height: 16px; padding: 0 6px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.st-active .sc-st { color: var(--work); border-color: var(--work); }
.st-prospect .sc-st { color: var(--yellow); border-color: var(--yellow); }
.sc-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0 0; font-size: 12px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.sc-date { display: block; font-size: 10px; color: var(--late); font-variant-numeric: tabular-nums; }
.sc-badges { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.sc-badges .req-badge, .sc-badges .badge-mine { font-size: 10px; line-height: 16px; padding: 0 4px; border-radius: 6px; }
.sched-later { margin: -8px 0 16px; font-size: 13px; color: var(--muted); }
.sched-later a { margin-left: 8px; }

/* ---------- カレンダーの色分け（1f のルールをホームにも） ---------- */
.row.req-normal { background: var(--req-gray-soft); }
.row.req-pending { background: var(--req-red-soft); border-left-color: var(--req-red); box-shadow: inset 0 0 0 2px var(--req-red); }
.row.req-approved { background: var(--req-blue-soft); border-left-color: var(--req-blue); }
.row-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.row-badges .req-badge { font-size: 11px; line-height: 20px; padding: 0 6px; }
.dot.dot-pending { box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--req-red); }
.dot.dot-approved { box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--req-blue); }
.dots { gap: 1px; }
.cal-legend { margin: 6px 4px 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cal-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .dot { width: 10px; height: 10px; }

/* ---------- 1h 見やすさの改善 ---------- */
/* 3人の色: カードに使っていない 緑・紫・オレンジ。AI は茶色（紫と重ならないように） */
.o-takatori { --oc: #2e8b57; --oc-ink: #ffffff; }
.o-matsumoto { --oc: #8e44ad; --oc-ink: #ffffff; }
.o-miyamoto { --oc: #e67e22; --oc-ink: #2a1403; }
.o-ai { --oc: #8d6e63; --oc-ink: #ffffff; }
@media (prefers-color-scheme: dark) {
  .o-takatori { --oc: #5cc98a; --oc-ink: #0b2016; }
  .o-matsumoto { --oc: #c39be0; --oc-ink: #1d0b29; }
  .o-miyamoto { --oc: #f0a35e; --oc-ink: #2a1403; }
  .o-ai { --oc: #bfa79e; --oc-ink: #1f1410; }
}
/* カードの色（耳なし・全体を塗る） */
:root { --cd-gray-bg: #e3e6ea; --cd-gray-bd: #a3aab4; --cd-red-bg: #ffd6d2; --cd-red-bd: #d32f2f; --cd-blue-bg: #d3e3ff; --cd-blue-bd: #1f5fbf; }
@media (prefers-color-scheme: dark) { :root { --cd-gray-bg: #2a313c; --cd-gray-bd: #5a6372; --cd-red-bg: #4d1d1d; --cd-red-bd: #ff6b60; --cd-blue-bg: #1a2f55; --cd-blue-bd: #6fa3ff; } }
.sc, .sc.req-normal { border: 2px solid var(--cd-gray-bd); border-left-width: 2px; background: var(--cd-gray-bg); }
.sc.req-pending { border-color: var(--cd-red-bd); background: var(--cd-red-bg); }
.sc.req-approved { border-color: var(--cd-blue-bd); background: var(--cd-blue-bg); }
.sc.mine { box-shadow: none; }
.sc.req-pending.mine { box-shadow: none; }
.rows { background: transparent; border: 0; border-radius: 0; overflow: visible; display: flex; flex-direction: column; gap: 6px; }
.row, .row.req-normal { border: 2px solid var(--cd-gray-bd); border-radius: 12px; background: var(--cd-gray-bg); box-shadow: none; overflow: hidden; }
.row:last-child { border-bottom: 2px solid var(--cd-gray-bd); }
.row.req-pending, .row.req-pending:last-child { border-color: var(--cd-red-bd); background: var(--cd-red-bg); box-shadow: none; }
.row.req-approved, .row.req-approved:last-child { border-color: var(--cd-blue-bd); background: var(--cd-blue-bg); }
/* カレンダーのマス: 太い輪、3件以上は件数、赤・青の帯 */
.dots { gap: 6px; min-height: 18px; align-items: center; }
.dot.dot-pending { box-shadow: 0 0 0 1px var(--surface), 0 0 0 4px var(--cd-red-bd); }
.dot.dot-approved { box-shadow: 0 0 0 1px var(--surface), 0 0 0 4px var(--cd-blue-bd); }
.cnt { display: inline-flex; align-items: center; min-height: 18px; padding: 0 6px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 11px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text); }
.band { align-self: stretch; margin: 0 2px; border-radius: 4px; font-size: 9px; font-weight: 700; line-height: 14px; text-align: center; white-space: nowrap; overflow: hidden; color: #fff; }
.band-req { background: var(--cd-red-bd); }
.band-ok { background: var(--cd-blue-bd); }
@media (prefers-color-scheme: dark) { .band { color: #10141a; } }
.cal-legend .dot { width: 12px; height: 12px; }
/* 上の件数 */
.mcount { margin: 0 0 12px; }
.mcount-head { margin: 0 0 6px; font-weight: 600; font-size: 14px; }
.mcount-note { margin-left: 8px; font-weight: 400; font-size: 11px; color: var(--muted); }
.mcount-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mc { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.mc-label { font-size: 12px; color: var(--muted); }
.mc-num { font-size: 13px; color: var(--muted); }
.mc-num b { font-size: 24px; color: var(--text); font-variant-numeric: tabular-nums; margin-right: 2px; }
.mc-prospect { border-top: 4px solid var(--yellow); }
.mc-active { border-top: 4px solid var(--work); }
.mc-done { border-top: 4px solid var(--line-strong); }

/* ===== 抱えてるタスク（2026-11-05。受けられる？のタブから置き換え） ===== */
.load-list { display: grid; gap: 12px; }
@media (min-width: 900px) { .load-list { grid-template-columns: repeat(3, 1fr); } }
.load-card { background: var(--surface); border: 2px solid var(--line); border-top-width: 6px; border-radius: var(--radius); padding: 12px; }
.load-card.lv-ok { border-top-color: var(--green); }
.load-card.lv-busy { border-top-color: var(--yellow); }
.load-card.lv-over { border-color: var(--red); background: var(--red-soft); }
.load-card.is-me { box-shadow: 0 0 0 3px var(--primary-soft); }
.load-main { display: flex; gap: 14px; align-items: center; }
/* イラストは白い背景で描かれているので、ダークモードでも白い台紙に載せる */
.load-img { flex: none; width: 104px; height: 130px; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.load-body { min-width: 0; flex: 1; }
.load-name { margin: 0; font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.load-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--oc); flex: none; }
.load-me { font-size: 11px; font-weight: 600; color: var(--primary-ink); background: var(--primary); border-radius: 999px; padding: 1px 8px; }
.load-level { margin: 6px 0 0; font-size: 20px; font-weight: 800; }
.lv-ok .load-level { color: var(--green); }
.lv-busy .load-level { color: var(--text); }
.lv-busy .load-level::after { content: ""; display: block; width: 3.2em; height: 4px; border-radius: 2px; background: var(--yellow); margin-top: 2px; }
.lv-over .load-level { color: var(--red); }
.load-num { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.load-num b { font-size: 26px; color: var(--text); font-variant-numeric: tabular-nums; margin-right: 2px; }
.load-balls { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.load-balls .pip { width: 10px; height: 10px; border-radius: 50%; background: #8cc8f0; border: 1.5px solid #1b2733; }
.load-balls .pip-more { font-size: 12px; font-weight: 700; margin-left: 2px; }
.load-more { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.load-more summary { cursor: pointer; font-size: 14px; color: var(--primary); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.load-cards { display: grid; gap: 6px; margin-top: 6px; }
.load-help { margin-top: 14px; line-height: 1.7; }
.load-judge { margin: 16px 0 24px; font-size: 14px; }
.back-link { margin: 4px 0 0; font-size: 14px; }

/* ===== 顔アイコン・関わる人（2026-11-06） ===== */
/* 3人は顔の絵。まわりの輪で人の色（緑・紫・オレンジ）を残す */
.oi.has-face { position: relative; background: #fff; color: transparent; box-shadow: 0 0 0 2px var(--oc); }
.oi-face { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.oi-lg { width: 44px; height: 44px; font-size: 18px; }
/* ボール＝次に動く人。顔の右下に小さい旗 */
.oi.is-ball { position: relative; }
.oi.is-ball::after { content: ""; position: absolute; right: -5px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 2v12' stroke='%231b2733' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M5 2.6h7.2l-2 2.7 2 2.7H5z' fill='%23e53935' stroke='%231b2733' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px 11px no-repeat; box-shadow: 0 0 0 1px var(--line-strong); }
.oi.is-ball.oi-xs::after { width: 10px; height: 10px; right: -4px; bottom: -3px; background-size: 9px 9px; }
.oi.is-ball.oi-lg::after { width: 18px; height: 18px; background-size: 15px 15px; right: -4px; bottom: -2px; }
.oi.o-client.is-ball::after, .oi.o-ai.is-ball::after, .oi.o-none.is-ball::after { display: none; }
/* ボール以外の関わる人を小さく重ねる */
.mfaces { display: inline-flex; align-items: center; margin-left: 6px; vertical-align: middle; }
.mfaces .oi { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--oc); }
.mfaces .oi + .oi { margin-left: -5px; }
.tile-faces { display: inline-flex; align-items: center; flex: none; }


.row-sub .mfaces { margin-left: 4px; }
/* カード画面の「関わる人」 */
.member-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 12px; }
.mp { position: relative; display: block; cursor: pointer; }
.mp input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mp-face { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); min-height: 96px; }
.mp-name { font-weight: 700; font-size: 14px; }
.mp-ball { font-size: 11px; font-weight: 700; color: #b71c1c; background: #ffe3e0; border-radius: 999px; padding: 1px 8px; }
.mp .oi { opacity: .45; filter: grayscale(1); }
.mp input:checked + .mp-face { border-color: var(--oc); background: var(--primary-soft); }
.mp input:checked + .mp-face .oi { opacity: 1; filter: none; }
.mp input:checked + .mp-face .mp-name::before { content: "✓ "; color: var(--oc); }
.mp input:focus-visible + .mp-face { outline: 3px solid var(--primary); outline-offset: 2px; }
.mp input:disabled + .mp-face { cursor: default; }
.members-save { width: 100%; }
.member-list { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 0; }
.mp-view { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.sc-mem { display: block; margin-top: 3px; }
.sc-mem .mfaces { margin-left: 2px; }
.sc-mem .mfaces .oi { width: 20px; height: 20px; }
/* カレンダーの小さい丸も顔に（人の色は輪で） */
.dot.has-face { position: relative; background: #fff; color: transparent; box-shadow: 0 0 0 1.5px var(--oc); }
.dot.has-face.dot-pending { box-shadow: 0 0 0 1.5px var(--oc), 0 0 0 2.5px var(--surface), 0 0 0 5px var(--cd-red-bd); }
.dot.has-face.dot-approved { box-shadow: 0 0 0 1.5px var(--oc), 0 0 0 2.5px var(--surface), 0 0 0 5px var(--cd-blue-bd); }

/* ---------- 社内の作業・何のカードかの札・＋で選ぶ画面（2026-11-06） ---------- */
:root { --internal: #3d5a99; --internal-soft: #ebf0fb; --prospect-ink: #8a5a00; --prospect-soft: #fff4d6; }
@media (prefers-color-scheme: dark) { :root { --internal: #a3bcf5; --internal-soft: #1d2741; --prospect-ink: #f0c05a; --prospect-soft: #3a3014; } }
.kind-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 12px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.kind-pill.kind-prospect { background: var(--prospect-soft); border-color: var(--prospect-ink); color: var(--prospect-ink); }
.kind-pill.kind-project { background: var(--work-soft); border-color: var(--work); color: var(--work); }
.kind-pill.kind-internal { background: var(--internal-soft); border-color: var(--internal); color: var(--internal); }
.kind-pill.kind-excluded { background: var(--wait-soft); color: var(--muted); }
.chip-internal { background: var(--internal-soft); border: 1px solid var(--internal); color: var(--internal); }
.st-internal .sc-st { color: var(--internal); border-color: var(--internal); }
.sc-time { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--internal); font-variant-numeric: tabular-nums; }
.row-time { color: var(--internal); font-variant-numeric: tabular-nums; }
.add-choices { display: grid; gap: 12px; margin: 16px 0; }
@media (min-width: 640px) { .add-choices { grid-template-columns: 1fr 1fr; } }
.add-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow); -webkit-tap-highlight-color: transparent; }
.add-choice:hover, .add-choice:focus-visible { border-color: var(--primary); }
.add-choice.add-internal { border-left: 4px solid var(--internal); }
.add-choice.add-prospect { border-left: 4px solid var(--prospect-ink); }
.add-choice-t { font-size: 17px; font-weight: 600; }
.add-choice-d { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ---------- ノリツグの予定（現地見積・打ち合わせ・納車立ち合い など。2026-11-06） ---------- */
:root { --nori: #0b6e7a; --nori-soft: #e3f4f6; }
@media (prefers-color-scheme: dark) { :root { --nori: #6fd3df; --nori-soft: #12303a; } }
.car-ic { display: inline-block; width: 28px; height: 14px; object-fit: contain; vertical-align: -2px; margin-right: 4px; flex: none; }
.kind-pill.kind-noritsugu { background: var(--nori-soft); border-color: var(--nori); color: var(--nori); }
.chip-nori { display: inline-flex; align-items: center; background: var(--nori-soft); border: 1px solid var(--nori); color: var(--nori); }
.st-noritsugu .sc-st { color: var(--nori); border-color: var(--nori); }
.when-nori { display: flex; align-items: center; gap: 2px; color: var(--nori); font-weight: 600; }
.sc-time.when-nori { flex-direction: column; align-items: flex-start; gap: 1px; margin-top: 4px; padding: 3px 5px; border-radius: 6px; background: var(--nori-soft); font-size: 12px; line-height: 1.3; }
.sc-time.when-nori .car-ic { width: 32px; height: 16px; margin: 0; }
.row-time.when-nori { display: inline-flex; }
.nori-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 12px; border-radius: 12px; background: var(--nori-soft); }
.nori-when-t { font-size: 20px; }
.nori-when-t .car-ic { width: 44px; height: 22px; }
.nori-when-d { color: var(--muted); font-size: 14px; }
.add-choice.add-nori { border-left: 4px solid var(--nori); }
.add-choice-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px; }
.add-car { width: 96px; height: auto; }
.fill-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -8px; margin-bottom: 16px; }
.fill-chips .chip-btn { width: auto; padding-left: 14px; padding-right: 14px; white-space: nowrap; }
