/* =====================================================================
   スケジュール手帳 — スタイル
   色はすべて下のトークン（変数）で指定。ダークモードは別の段階の色を使う。
   分野の色 c1〜c8 は色覚多様性に配慮した 8 色（固定順）。
   ===================================================================== */
:root {
  color-scheme: light;
  --page: #f6f4ef;
  --surface: #fffefb;
  --surface-2: #f1efe8;
  --surface-3: #e9e6dd;
  --ink: #1f2328;
  --ink-2: #4f5761;
  --ink-3: #6b727b;
  --line: #e4e1d8;
  --line-2: #d2cec3;
  --grid: #ece9e1;
  --grid-hour: #dedad0;
  --accent: #b8325f;
  --accent-ink: #ffffff;
  --accent-weak: #f8e6ec;
  --sun: #c23a3a;
  --sat: #2a5caa;
  --focus: #2a78d6;
  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --warning-ink: #7a5200;
  --serious: #ec835a;
  --serious-ink: #9c3f12;
  --critical: #d03b3b;
  --critical-ink: #b42323;
  --c0: #8c959f;
  --c1: #2a78d6;
  --c2: #eb6834;
  --c3: #1baf7a;
  --c4: #eda100;
  --c5: #e87ba4;
  --c6: #008300;
  --c7: #6250d6;
  --c8: #e34948;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 35, 40, .05), 0 6px 18px rgba(31, 35, 40, .05);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hour-h: 44px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --surface-3: #2c2c2a;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --ink-3: #a3a198;
    --line: #2c2c2a;
    --line-2: #3a3a37;
    --grid: #242422;
    --grid-hour: #33332f;
    --accent: #e0668f;
    --accent-ink: #1a1a19;
    --accent-weak: #3a2129;
    --sun: #ef7d7d;
    --sat: #7fb0f0;
    --focus: #5598e7;
    --good-ink: #0ca30c;
    --warning-ink: #fab219;
    --serious-ink: #ec835a;
    --critical-ink: #ef6b6b;
    --c1: #3987e5;
    --c2: #d95926;
    --c3: #199e70;
    --c4: #c98500;
    --c5: #d55181;
    --c6: #008300;
    --c7: #9085e9;
    --c8: #e66767;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --surface-3: #2c2c2a;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --ink-3: #a3a198;
  --line: #2c2c2a;
  --line-2: #3a3a37;
  --grid: #242422;
  --grid-hour: #33332f;
  --accent: #e0668f;
  --accent-ink: #1a1a19;
  --accent-weak: #3a2129;
  --sun: #ef7d7d;
  --sat: #7fb0f0;
  --focus: #5598e7;
  --good-ink: #0ca30c;
  --warning-ink: #fab219;
  --serious-ink: #ec835a;
  --critical-ink: #ef6b6b;
  --c1: #3987e5;
  --c2: #d95926;
  --c3: #199e70;
  --c4: #c98500;
  --c5: #d55181;
  --c6: #008300;
  --c7: #9085e9;
  --c8: #e66767;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .3);
}
.c0 { --c: var(--c0); }
.c1 { --c: var(--c1); }
.c2 { --c: var(--c2); }
.c3 { --c: var(--c3); }
.c4 { --c: var(--c4); }
.c5 { --c: var(--c5); }
.c6 { --c: var(--c6); }
.c7 { --c: var(--c7); }
.c8 { --c: var(--c8); }

/* ---------- 基本 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
}
a { color: inherit; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; }
p { margin: .3em 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.skip-link { position: absolute; left: -999px; top: 4px; background: var(--surface); padding: 4px 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------- 上部バー ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 8px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand-mark { width: 18px; height: 22px; border-radius: 3px 5px 5px 3px; background: var(--accent); box-shadow: inset 4px 0 0 rgba(0, 0, 0, .18); }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); white-space: nowrap; font-weight: 600; }
.tabs a:hover { background: var(--surface-2); color: var(--ink); }
.tabs a.active { background: var(--ink); color: var(--page); }
.timer-pill { margin-left: auto; display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 4px 2px 10px; box-shadow: var(--shadow); }
.timer-pill.over { border-color: var(--accent); }
.pill-link { display: flex; align-items: center; gap: 6px; text-decoration: none; }
.pill-clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.timer-pill.over .pill-clock { color: var(--accent); }
.pill-name { color: var(--ink-2); font-size: 12px; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-btn { width: 28px; height: 28px; }

main { max-width: 1480px; margin: 0 auto; padding: 16px 16px 64px; outline: none; }
.view { display: flex; flex-direction: column; gap: 16px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

/* ---------- カード ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h2 { font-size: 15px; display: flex; align-items: center; gap: 6px; }
.card-icon { font-size: 15px; }
.card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card h3 { font-size: 14px; margin: 12px 0 6px; }
.empty { color: var(--ink-3); font-size: 13px; padding: 6px 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-sub { color: var(--ink-2); }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 34px; padding: 5px 12px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; font-weight: 600; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--page); border-color: var(--ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--page)); }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--critical-ink); border-color: color-mix(in srgb, var(--critical) 50%, var(--line-2)); }
.btn.danger:hover { background: color-mix(in srgb, var(--critical) 10%, var(--surface)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.ghost-light { background: transparent; border-color: rgba(255, 255, 255, .4); color: inherit; }
.btn.small { min-height: 28px; padding: 3px 9px; font-size: 12.5px; }
.btn.chip, .chip.btn { min-height: 26px; padding: 2px 9px; font-size: 12px; border-radius: 999px; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.push-left { margin-right: auto; }
.icon-btn { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.linklike { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
.linklike:hover { text-decoration: underline; }

/* ---------- 小物 ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--c0)); flex: none; }
.dot.lg { width: 12px; height: 12px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 999px; font-size: 11.5px; line-height: 20px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; font-weight: 600; }
.badge.warning { background: color-mix(in srgb, var(--warning) 22%, var(--surface)); color: var(--warning-ink); }
.badge.critical { background: color-mix(in srgb, var(--critical) 16%, var(--surface)); color: var(--critical-ink); }
.badge.good { background: color-mix(in srgb, var(--good) 14%, var(--surface)); color: var(--good-ink); }
.badge.accent { background: var(--accent-weak); color: var(--accent); }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.note + .note { margin-top: 6px; }
.note-icon { flex: none; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; background: var(--ink-3); margin-top: 1px; }
.note.good .note-icon { background: var(--good); }
.note.warning .note-icon { background: var(--warning); color: #0b0b0b; }
.note.serious .note-icon { background: var(--serious); }
.note.critical .note-icon { background: var(--critical); }
.note-text { flex: 1; }
.streak { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.pbar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.pbar-fill { display: block; height: 100%; border-radius: 999px; background: var(--c); }

/* メーター（実績＋予定と目標） */
.meter { position: relative; display: flex; gap: 2px; height: 10px; background: var(--surface-3); border-radius: 0 4px 4px 0; }
.meter .seg { height: 100%; background: var(--c); }
.meter .seg.actual { border-radius: 0 4px 4px 0; }
.meter .seg.actual:not(:last-of-type) { border-radius: 0; }
.meter .seg.left { background: color-mix(in srgb, var(--c) 32%, var(--surface)); border-radius: 0 4px 4px 0; }
.meter .target { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }

/* 横棒（今日の記録など） */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(7em, 9em) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.bar-label { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar-track { height: 12px; }
.bar-fill { display: block; height: 100%; background: var(--c); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-value { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; }

/* ---------- フォーム ---------- */
input[type=text], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 6px 9px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); min-height: 34px;
}
textarea { resize: vertical; line-height: 1.55; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--ink); flex: none; margin: 0; cursor: pointer; }
.form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field-hint { font-size: 11.5px; color: var(--ink-3); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.field-slot:empty { display: none; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.inline-add { display: flex; gap: 6px; margin-top: 8px; }
.inline-add input { min-height: 30px; padding: 4px 8px; }
.quad-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quad-opt { text-align: left; border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 6px 9px; cursor: pointer; font-size: 13px; }
.quad-opt.on { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.quad-opt b { display: inline-block; width: 18px; }

/* ---------- モーダル・トースト ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(15, 15, 14, .38); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; overflow-y: auto; }
.modal { width: min(560px, 100%); background: var(--surface); border-radius: 14px; box-shadow: 0 18px 60px rgba(0, 0, 0, .3); border: 1px solid var(--line); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 4px 18px; }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 8px 18px 12px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 18px 16px; flex-wrap: wrap; }
.confirm-text { white-space: pre-wrap; }
.copy-fallback { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
#toast-root { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(560px, calc(100% - 24px)); }
.toast { background: var(--ink); color: var(--page); padding: 9px 14px; border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .25); display: flex; align-items: center; gap: 12px; font-size: 13.5px; transition: opacity .35s, transform .35s; }
.toast.error { background: var(--critical-ink); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- 今日 ---------- */
.today-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; padding: 2px 2px 0; }
.today-date { display: flex; align-items: baseline; gap: 10px; }
.today-date .big { font-size: 28px; font-weight: 700; letter-spacing: .02em; }
.today-date .big.sun { color: var(--sun); }
.today-date .big.sat { color: var(--sat); }
.holiday { color: var(--sun); font-weight: 700; font-size: 13px; }
.today-sub { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.goal-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex-basis: 100%; }
.goal-chip { background: var(--accent-weak); color: var(--ink); padding: 1px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.goal-chip.done { opacity: .6; text-decoration: line-through; }
.hero-actions { margin-left: auto; }
.now-card { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.now-main { display: flex; flex-direction: column; gap: 2px; }
.now-title { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.now-time { color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.now-next { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line-2); color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.timer-panel { text-align: center; }
.timer-meta { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.timer-label { color: var(--ink-2); }
.timer-clock { font-size: 56px; font-weight: 700; line-height: 1.1; margin: 6px 0 2px; }
.timer-panel.paused .timer-clock { color: var(--ink-3); }
.timer-sub { color: var(--ink-3); font-size: 12.5px; }
.timer-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-item.past:not(.done) .tl-body { color: var(--ink-3); }
.tl-item.done .tl-title { text-decoration: line-through; color: var(--ink-3); }
.tl-item.now { background: var(--accent-weak); border-radius: 6px; padding-left: 6px; }
.tl-check.fixed { width: 17px; text-align: center; font-size: 11px; }
.tl-body { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; border: 0; background: none; text-align: left; cursor: pointer; padding: 4px 0; }
.tl-time { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; width: 7.6em; flex: none; }
.tl-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-place { color: var(--ink-3); font-size: 12px; }
.habits, .tasks, .reminders, .suggest, .log-list { display: flex; flex-direction: column; }
.habit { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.habit:last-child { border-bottom: 0; }
.habit-main { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.habit.done .habit-name { color: var(--ink-3); text-decoration: line-through; }
.habit-meta { display: flex; align-items: center; gap: 6px; }
.task { display: flex; align-items: center; gap: 7px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-title { flex: 1; min-width: 0; text-align: left; border: 0; background: none; cursor: pointer; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task.done .task-title { text-decoration: line-through; color: var(--ink-3); }
.qnum { flex: none; width: 18px; height: 18px; border-radius: 4px; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--ink-2); }
.qnum.q1 { background: var(--ink); color: var(--page); }
.qnum.q2 { background: var(--accent-weak); color: var(--accent); }
.reminder { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.reminder:last-child { border-bottom: 0; }
.rem-text { flex: 1; min-width: 12em; }
.reminder.critical .rem-text { color: var(--critical-ink); font-weight: 700; }
.reminder.serious .rem-text { color: var(--serious-ink); font-weight: 700; }
.sg { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.sg:last-child { border-bottom: 0; }
.sg-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sg-name { font-weight: 700; text-decoration: none; }
.sg-step { font-size: 13.5px; }
.log-details { margin-top: 8px; }
.log-details summary, .small-details summary { cursor: pointer; color: var(--ink-2); font-size: 12.5px; }
.log-list li { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 13px; }
.small-details { margin-top: 8px; }
.small-details textarea { margin-top: 6px; }

/* ---------- 週間（手帳の見開き） ---------- */
.week-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week-bar .spacer { flex: 1; }
.planner {
  display: grid; grid-template-columns: minmax(0, 5.15fr) minmax(0, 4.85fr);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px 6px 6px 6px;
  box-shadow: var(--shadow);
}
.planner .pg { padding: 14px 14px 12px; min-width: 0; display: flex; flex-direction: column; }
.planner .pg.left { border-right: 1px solid var(--line-2); box-shadow: inset -14px 0 18px -16px rgba(0, 0, 0, .28); }
.planner .pg.right { box-shadow: inset 14px 0 18px -16px rgba(0, 0, 0, .28); }
.pg-head { display: flex; align-items: flex-end; gap: 12px; min-height: 64px; padding: 0 2px 6px; }
.pg-month { font-size: 50px; font-weight: 300; line-height: .9; letter-spacing: -.02em; }
.pg-title { display: flex; flex-direction: column; line-height: 1.15; }
.pg-year { font-size: 14px; color: var(--ink-2); }
.pg-week { font-size: 21px; font-weight: 400; }
.pg-right-head { display: flex; align-items: flex-start; gap: 12px; min-height: 64px; padding-bottom: 6px; }
.goals-box { flex: 1; min-width: 0; }
.goals-label { display: inline-block; font-size: 12px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); padding: 0 18px 1px 0; margin-bottom: 4px; transform: skewX(-12deg); }
.goals-label > span { display: inline-block; transform: skewX(12deg); }
.goal-list { display: flex; flex-direction: column; gap: 2px; }
.goal { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.goal.done .goal-text { text-decoration: line-through; color: var(--ink-3); }
.goal input.goal-text { flex: 1; min-width: 0; border: 0; background: none; padding: 1px 4px; border-radius: 4px; min-height: 26px; }
.goal input.goal-text:hover, .goal input.goal-text:focus { background: var(--surface-2); }
.goal .icon-btn { width: 22px; height: 22px; font-size: 13px; opacity: .5; }
.goal:hover .icon-btn { opacity: 1; }
.prev-action { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 6px; padding: 3px 8px; margin-bottom: 4px; }
.minicals { display: flex; gap: 14px; flex: none; }
.minical { font-size: 10px; line-height: 1; font-variant-numeric: tabular-nums; }
.minical-head { display: flex; align-items: flex-start; gap: 6px; }
.minical-m { font-size: 22px; font-weight: 300; line-height: .9; }
.minical table { border-collapse: collapse; }
.minical th { font-weight: 600; color: var(--ink-3); padding: 1px 2px; }
.minical td { padding: 0; text-align: center; }
.minical td button { border: 0; background: none; padding: 2px 2px; min-width: 16px; cursor: pointer; border-radius: 3px; font-size: 10px; line-height: 1.2; }
.minical td button:hover { background: var(--surface-3); }
.minical tr.cur td { background: var(--accent-weak); }
.minical .sun, .minical .hol { color: var(--sun); }
.minical .sat { color: var(--sat); }
.minical .today button { outline: 1.5px solid var(--accent); outline-offset: -1px; font-weight: 700; }

.days { display: grid; gap: 0; border-top: 1px solid var(--line-2); }
.days.five { grid-template-columns: repeat(5, minmax(84px, 1fr)); }
.days.right { grid-template-columns: repeat(2, minmax(84px, 1fr)) minmax(170px, 2.25fr); }
.day-col { border-right: 1px solid var(--line-2); min-width: 0; display: flex; flex-direction: column; }
.day-col:first-child { border-left: 0; }
.day-head { display: flex; align-items: flex-end; gap: 3px; padding: 4px 4px 3px; min-height: 40px; position: relative; cursor: default; }
.day-num { font-size: 25px; font-weight: 300; line-height: 1; }
.day-names { display: flex; flex-direction: column; line-height: 1.05; font-size: 9.5px; color: var(--ink-2); }
.day-code { position: absolute; right: 4px; top: 4px; font-size: 8.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.day-hol { position: absolute; right: 4px; bottom: 2px; font-size: 9px; color: var(--sun); font-weight: 700; max-width: 70%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.day-col.sun .day-num, .day-col.hol .day-num { color: var(--sun); }
.day-col.sat .day-num { color: var(--sat); }
.day-col.today .day-head { background: var(--accent-weak); }
.day-col.today .day-num { font-weight: 700; color: var(--accent); }
.day-memo { background: var(--surface-2); min-height: 60px; padding: 2px 3px; display: flex; flex-direction: column; gap: 2px; }
.day-memo textarea { border: 0; background: transparent; padding: 2px; min-height: 38px; font-size: 11px; line-height: 1.35; resize: none; border-radius: 3px; }
.day-memo textarea:focus { background: var(--surface); }
.day-diary { font-size: 10.5px; font-weight: 600; color: var(--ink-2); text-align: left; }
.md-pre { white-space: pre-wrap; font-family: inherit; font-size: 12.5px; background: var(--surface-2); border-radius: 6px; padding: 6px 9px; margin: 4px 0 0; max-height: 200px; overflow-y: auto; }
.import-sec { border-top: 1px solid var(--line); padding-top: 8px; }
.day-due { font-size: 10.5px; line-height: 1.3; color: var(--critical-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-grid {
  position: relative; height: calc(var(--hours) * var(--hour-h)); touch-action: pan-y;
  background-image:
    linear-gradient(to bottom, var(--grid-hour) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px),
    linear-gradient(to right, var(--grid) 1px, transparent 1px);
  background-size: 100% var(--hour-h), 100% calc(var(--hour-h) / 4), calc(var(--hour-h) / 4) 100%;
  cursor: cell;
}
.day-col.past .day-grid { background-color: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.hour-label { position: absolute; left: 2px; font-size: 9.5px; color: var(--ink-3); line-height: 1; transform: translateY(2px); pointer-events: none; font-variant-numeric: tabular-nums; }
.ev {
  position: absolute; z-index: 2; overflow: hidden; cursor: grab; user-select: none; touch-action: none;
  background: color-mix(in srgb, var(--c) 15%, var(--surface));
  border-left: 3px solid var(--c); border-radius: 3px 5px 5px 3px;
  padding: 1px 4px 1px 4px; font-size: 11px; line-height: 1.25; color: var(--ink);
  box-shadow: 0 0 0 1px var(--surface);
}
.ev:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.ev.done { background: color-mix(in srgb, var(--c) 34%, var(--surface)); }
.ev.virtual { cursor: pointer; background: color-mix(in srgb, var(--c) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line)); border-left: 3px solid var(--c); }
.ev.auto:not(.done) { border-left-style: dotted; }
.ev-time { font-size: 9.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ev-title { font-weight: 600; word-break: break-all; }
.ev.done .ev-title::before { content: '✓ '; }
/* 文字が枠に収まらないときの自動調整（views/week.js の V.fitEvents が付ける） */
.ev.fit-s { font-size: 10px; line-height: 1.15; }
.ev.fit-s .ev-time { font-size: 8.5px; }
.ev.fit-xs { font-size: 9px; line-height: 1.1; padding-top: 0; padding-bottom: 0; }
.ev.fit-xs .ev-time { font-size: 8px; }
.ev.fit-clip .ev-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--fit-lines, 1); line-clamp: var(--fit-lines, 1); overflow: hidden; }
.ev .ev-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.ev.dragging { opacity: .85; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); z-index: 10; cursor: grabbing; }
.sel-rect { position: absolute; left: 12px; right: 2px; background: color-mix(in srgb, var(--accent) 18%, transparent); border: 1px solid var(--accent); border-radius: 4px; z-index: 3; pointer-events: none; font-size: 10px; padding: 1px 4px; color: var(--ink); }
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--accent); z-index: 4; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -3px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* 右ページの自由欄（方眼） */
.free-col { display: flex; flex-direction: column; min-width: 0; padding: 0 0 0 8px; gap: 10px; }
.graph-paper {
  background-image:
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px),
    linear-gradient(to right, var(--grid) 1px, transparent 1px);
  background-size: 11px 11px;
}
.free-sec h3 { font-size: 12.5px; margin: 0 0 6px; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.balance { display: flex; flex-direction: column; gap: 7px; }
.bal-row { display: grid; grid-template-columns: 8.2em 1fr; gap: 2px 8px; align-items: center; font-size: 11.5px; }
.bal-name { display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; font-weight: 600; text-decoration: none; min-width: 0; }
.bal-name span:last-child { overflow: hidden; text-overflow: ellipsis; }
.bal-val { grid-column: 2; color: var(--ink-2); font-size: 10.5px; font-variant-numeric: tabular-nums; margin-top: -1px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 10.5px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 4px; }
.legend .sw { display: inline-block; width: 12px; height: 8px; border-radius: 0 3px 3px 0; background: var(--ink-2); }
.legend .sw.light { background: color-mix(in srgb, var(--ink-2) 32%, var(--surface)); }
.legend .tick { display: inline-block; width: 2px; height: 11px; background: var(--ink); }
.memo-area { flex: 1; min-height: 200px; display: flex; }
.memo-area textarea { flex: 1; border: 1px solid var(--line); background: transparent; line-height: 22px; font-size: 13px; padding: 0 6px; border-radius: 4px; }

/* 下段：To Do List（重要度×緊急度）と振り返り */
.todo { flex: 1; margin-top: 10px; border: 1px solid var(--line-2); border-radius: 2px; display: grid; grid-template-columns: 24px 1fr 1fr; grid-template-rows: auto 1fr 1fr auto; min-height: 290px; background: var(--surface); }
.todo-title { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); padding: 3px 8px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.todo-axis-y { grid-row: 2 / 4; writing-mode: vertical-rl; text-orientation: upright; font-size: 10.5px; color: var(--ink-3); display: flex; align-items: center; justify-content: center; letter-spacing: .1em; border-right: 1px solid var(--line); }
.todo-axis-x { grid-column: 2 / 4; text-align: center; font-size: 10.5px; color: var(--ink-3); padding: 2px; border-top: 1px solid var(--line); letter-spacing: .1em; }
.quad { position: relative; padding: 5px 8px 8px; min-height: 120px; min-width: 0; }
.quad.q1 { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.quad.q2 { border-bottom: 1px solid var(--line-2); }
.quad.q3 { border-right: 1px solid var(--line-2); }
.quad.drop { background: var(--accent-weak); }
.quad-num { position: absolute; font-size: 11px; color: var(--ink-3); font-weight: 700; }
.quad.q1 .quad-num { right: 5px; bottom: 3px; }
.quad.q2 .quad-num { left: 5px; bottom: 3px; }
.quad.q3 .quad-num { right: 5px; top: 3px; }
.quad.q4 .quad-num { left: 5px; top: 3px; }
.quad-label { font-size: 10.5px; color: var(--ink-3); margin-bottom: 2px; display: flex; justify-content: space-between; gap: 4px; }
.quad.q3 .quad-label, .quad.q4 .quad-label { padding-top: 12px; }
.qtask { display: flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 1px 0; cursor: grab; }
.qtask .task-title { white-space: normal; }
.qtask.done .task-title { text-decoration: line-through; color: var(--ink-3); }
.qtask input { width: 15px; height: 15px; }
.quad .inline-add { margin-top: 4px; }
.quad .inline-add input { min-height: 26px; font-size: 12px; }
.quad .inline-add .btn { min-height: 26px; }

.review { flex: 1; margin-top: 10px; border: 1px solid var(--line-2); border-radius: 2px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); min-height: 290px; }
.review-check { padding: 6px 10px 10px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.review-right { display: flex; flex-direction: column; }
.review-action { padding: 6px 10px 8px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.review-advice { padding: 6px 10px 10px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.review h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; margin: 0; }
.review textarea { flex: 1; min-height: 90px; border: 1px solid var(--line); background: transparent; line-height: 22px; font-size: 13px; }
.stars { display: inline-flex; gap: 0; }
.star { border: 0; background: none; font-size: 19px; line-height: 1; padding: 0 1px; cursor: pointer; color: var(--ink-3); }
.star.on { color: var(--accent); }
.advice-list .note { font-size: 12.5px; padding: 5px 8px; }
.advice-more summary { cursor: pointer; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.advice-more .note { margin-top: 6px; }
.week-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--ink-3); font-size: 12px; }

/* 自動配置プレビュー */
.plan-list { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.plan-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.plan-item:last-child { border-bottom: 0; }
.plan-item .t { font-variant-numeric: tabular-nums; color: var(--ink-2); width: 11.5em; flex: none; }

/* ---------- 分野 ---------- */
.domain-card { display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--c); }
.domain-card h2 { font-size: 16px; }
.dc-head { display: flex; align-items: center; gap: 8px; }
.dc-icon { font-size: 20px; }
.dc-name { font-weight: 700; font-size: 16px; text-decoration: none; }
.dc-stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.dc-step { font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 6px 9px; }
.domain-hero { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; border-left: 6px solid var(--c); }
.domain-hero h1 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.stat-tiles { display: flex; gap: 22px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-label { font-size: 12px; color: var(--ink-3); }
.stat-value { font-size: 20px; font-weight: 700; }
.min-actions { display: flex; flex-direction: column; gap: 6px; }
.min-action { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.min-action:last-child { border-bottom: 0; }
.checklist { display: flex; flex-direction: column; }
.cl-item { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.cl-item:last-child { border-bottom: 0; }
.cl-item input[type=checkbox] { margin-top: 3px; }
.cl-text { flex: 1; min-width: 0; }
.cl-item.done .cl-text { color: var(--ink-3); text-decoration: line-through; }
.cl-item .icon-btn { width: 24px; height: 24px; font-size: 13px; opacity: .45; }
.cl-item:hover .icon-btn { opacity: 1; }
.cmd { display: flex; align-items: stretch; gap: 0; margin-top: 4px; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; }
.cmd code { flex: 1; min-width: 0; padding: 5px 9px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; background: var(--surface-2); overflow-x: auto; white-space: pre; }
.cmd .btn { border: 0; border-left: 1px solid var(--line-2); border-radius: 0; min-height: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tbl th, .tbl td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--ink-3); font-weight: 600; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }
.chapter-list { display: flex; flex-direction: column; }
.chapter { display: grid; grid-template-columns: 2.4em 1fr auto; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.chapter:last-child { border-bottom: 0; }
.chapter .no { color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }
.chapter.st-done .ch-title { color: var(--ink-3); }
.chapter.st-doing { background: var(--accent-weak); border-radius: 6px; }
.chapter.st-skip .ch-title { color: var(--ink-3); text-decoration: line-through; }
.ch-title { min-width: 0; }
.ch-note { display: block; font-size: 11.5px; color: var(--ink-3); }
.st-btn { min-width: 5.2em; }
.prio { font-size: 10.5px; padding: 0 6px; border-radius: 999px; line-height: 18px; border: 1px solid var(--line-2); color: var(--ink-2); margin-left: 4px; white-space: nowrap; }
.prio.must { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.steps5 { display: flex; gap: 4px; flex-wrap: wrap; }
.step5 { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px 1px 3px; font-size: 12px; background: var(--surface); cursor: pointer; }
.step5 .n { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); font-weight: 800; font-size: 11px; }
.step5.on { background: var(--surface-2); border-color: var(--ink-3); }
.step5.on .n { background: var(--ink); color: var(--page); }
.theme-item { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.theme-item:last-child { border-bottom: 0; }
.theme-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.theme-title { font-weight: 700; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.lang-table td:first-child { font-weight: 700; white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* 縦棒（記録の推移など） */
.colchart { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-top: 14px; border-bottom: 1px solid var(--line-2); position: relative; }
.colchart .col-wrap { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; min-width: 6px; position: relative; }
.colchart .col-seg { width: 100%; max-width: 24px; margin: 0 auto; background: var(--c); }
.colchart .col-seg:last-child { border-radius: 4px 4px 0 0; }
.colchart .col-wrap:hover .col-seg { filter: brightness(1.08); }
.colchart .col-val { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--ink-2); white-space: nowrap; }
.col-axis { display: flex; gap: 2px; font-size: 10px; color: var(--ink-3); }
.col-axis span { flex: 1; text-align: center; min-width: 6px; overflow: hidden; white-space: nowrap; }
.tip { position: fixed; z-index: 70; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); border-radius: 8px; padding: 6px 9px; font-size: 12px; }
.tip b { font-size: 13px; }
.tip .tip-row { display: flex; align-items: center; gap: 6px; }
.tip .key-line { display: inline-block; width: 10px; height: 2px; background: var(--c); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); grid-auto-columns: 13px; justify-content: start; gap: 3px; overflow-x: auto; padding: 2px 2px 4px; }
.cell { display: inline-block; width: 13px; height: 13px; border-radius: 3px; background: var(--surface-3); }
.cell.l1 { background: #b7d3f6; }
.cell.l2 { background: #6da7ec; }
.cell.l3 { background: #2a78d6; }
.cell.l4 { background: #184f95; }
.cell.today { outline: 1.5px solid var(--ink); outline-offset: 1px; }
:root[data-theme="dark"] .cell.l1 { background: #184f95; }
:root[data-theme="dark"] .cell.l2 { background: #1c5cab; }
:root[data-theme="dark"] .cell.l3 { background: #3987e5; }
:root[data-theme="dark"] .cell.l4 { background: #9ec5f4; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cell.l1 { background: #184f95; }
  :root:not([data-theme="light"]) .cell.l2 { background: #1c5cab; }
  :root:not([data-theme="light"]) .cell.l3 { background: #3987e5; }
  :root:not([data-theme="light"]) .cell.l4 { background: #9ec5f4; }
}
.heat-legend { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--ink-3); flex-wrap: wrap; margin-top: 4px; }
.heat-legend .cell { width: 11px; height: 11px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); background: var(--c); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.set-row { display: grid; grid-template-columns: 2.6em minmax(8em, 1.4fr) 6.5em 6.5em auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.days-pick { display: flex; gap: 3px; }
.days-pick button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 11.5px; }
.days-pick button.on { background: var(--ink); color: var(--page); border-color: var(--ink); }
.tt-grid { display: grid; grid-template-columns: 3em repeat(6, minmax(70px, 1fr)); border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; font-size: 12px; }
.tt-grid > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 46px; padding: 3px; }
.tt-h { background: var(--surface-2); font-weight: 700; text-align: center; min-height: 0 !important; }
.tt-p { background: var(--surface-2); text-align: center; font-size: 11px; color: var(--ink-2); display: flex; flex-direction: column; justify-content: center; }
.tt-cell { cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.tt-cell:hover { background: var(--surface-2); }
.tt-item { background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-left: 3px solid var(--c); border-radius: 3px; padding: 1px 4px; font-weight: 600; line-height: 1.3; }
.files { max-height: 360px; overflow-y: auto; }
.kind-sel { width: auto; min-height: 26px; padding: 1px 4px; font-size: 12px; }
.gacha { font-size: 22px; font-weight: 700; padding: 10px 0; }

/* ---------- 画面幅による調整 ---------- */
@media (max-width: 1180px) {
  .planner { grid-template-columns: 1fr; }
  .planner .pg.left { border-right: 0; border-bottom: 1px solid var(--line-2); box-shadow: none; }
  .planner .pg.right { box-shadow: none; }
}
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .brand-name { display: none; }
  /* 今日：1列のときは「いま → お知らせ → 予定 → ルーティン → タスク → 迷ったら → 記録 → 日記」の順 */
  .today-view .cols { display: flex; flex-direction: column; }
  .today-view .col { display: contents; }
  .today-view .o1 { order: 1; } .today-view .o2 { order: 2; } .today-view .o3 { order: 3; } .today-view .o4 { order: 4; }
  .today-view .o5 { order: 5; } .today-view .o6 { order: 6; } .today-view .o7 { order: 7; } .today-view .o8 { order: 8; }
}
@media (max-width: 640px) {
  main { padding: 12px 10px 64px; }
  .topbar { gap: 8px; padding: 6px 10px; }
  .tabs a { padding: 5px 9px; }
  .card { padding: 12px; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 > :first-child { grid-column: 1 / -1; }
  .today-date .big { font-size: 23px; }
  .timer-clock { font-size: 46px; }
  .planner .pg { padding: 10px 8px; }
  .days-scroll { overflow-x: auto; }
  .days.five { min-width: 560px; }
  .days.right { grid-template-columns: 1fr 1fr; }
  .days.right .free-col { grid-column: 1 / -1; padding: 12px 0 0; border-top: 1px solid var(--line-2); }
  .pg-right-head { flex-direction: column; }
  .todo { grid-template-columns: 20px 1fr; grid-template-rows: auto; }
  .todo-axis-y, .todo-axis-x { display: none; }
  .quad { border: 0 !important; border-bottom: 1px solid var(--line) !important; grid-column: 2; }
  .review { grid-template-columns: 1fr; }
  .review-check { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .set-row { grid-template-columns: 2.4em 1fr 5.5em; }
  .set-row > :nth-child(4), .set-row > :nth-child(5) { grid-column: 2 / -1; }
  .hero-actions { margin-left: 0; }
}

/* ---------- 印刷（週間ページを A4 横で） ---------- */
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  :root { --hour-h: 26px; }
  body { background: #fff; font-size: 10px; }
  .topbar, .week-bar, .week-foot, #toast-root, #modal-root, .inline-add, .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  .planner { box-shadow: none; border: 0; grid-template-columns: 1fr 1fr; }
  .planner .pg { break-inside: avoid; }
  .card { box-shadow: none; }
}
