/* NEKO TASKS — 見た目 */

:root {
  --bg: #F7F5F0;
  --sub: #E6E2DA;
  --card: #FDFCF9;
  --ink: #343434;
  --ink2: #6B6B6B;
  --muted: #929292;
  --accent: #8FA995;
  --accent-ink: #5F7D67;
  --accent-soft: #E3EAE3;
  --line: #ECE8E0;
  --danger: #B0463B;
  --hi-bg: #F4DEDA; --hi-fg: #A3443A;
  --mid-bg: #F3EAD2; --mid-fg: #85641F;
  --lo-bg: #ECE9E3; --lo-fg: #666;
  --shadow: 0 1px 2px rgba(52, 52, 52, .04), 0 4px 16px rgba(52, 52, 52, .05);
  --radius: 14px;
  --tabbar-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1D1E1B;
  --sub: #2B2C28;
  --card: #262723;
  --ink: #ECEAE4;
  --ink2: #B6B3AC;
  --muted: #8F8C86;
  --accent: #8FA995;
  --accent-ink: #AFC7B5;
  --accent-soft: #2F3A32;
  --line: #34352F;
  --danger: #E58C80;
  --hi-bg: #4A2C28; --hi-fg: #F2B8AF;
  --mid-bg: #443A22; --mid-fg: #E6CC88;
  --lo-bg: #34352F; --lo-fg: #C2BFB7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.view { padding: 0 16px calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom)); outline: none; }

/* ---------- 見出し ---------- */
.head { display: flex; align-items: center; gap: 8px; padding: calc(18px + env(safe-area-inset-top)) 0 14px; }
.head h1 { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: .02em; flex: 1; }
.icon-btn {
  width: 44px; height: 44px; border: 0; background: none; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink);
}
.icon-btn svg, .tabbar svg, .row-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { background: var(--sub); }

/* ---------- 切りかえ（月／週 など） ---------- */
.seg { display: inline-flex; background: var(--sub); border-radius: 999px; padding: 3px; }
.seg button {
  border: 0; background: none; padding: 6px 16px; border-radius: 999px; font-size: .875rem;
  color: var(--ink2); min-height: 34px;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { color: #1D1E1B; }

/* ---------- カード ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card-title { margin: 0 0 10px; font-size: 1rem; font-weight: 700; }

/* ---------- 猫エリア（ホーム） ---------- */
.cat-stage {
  position: relative; margin: 0 -16px 14px; padding: 6px 16px 0;
  display: flex; align-items: flex-end; justify-content: space-between; min-height: 150px;
  background: linear-gradient(to bottom, transparent 78%, var(--sub) 78%);
}
.bubble {
  align-self: flex-start; margin-top: 10px; background: var(--card); border-radius: 14px;
  padding: 12px 16px; font-size: .9375rem; line-height: 1.6; box-shadow: var(--shadow);
  max-width: 58%; position: relative;
}
.bubble::after {
  content: ""; position: absolute; right: -7px; top: 22px; border: 7px solid transparent;
  border-left-color: var(--card); border-right: 0;
}
.cat-img { width: 150px; height: auto; display: block; }
.cat-stage .cat-img { margin-bottom: -2px; }
/* ナイトのとき、黒猫が背景にまぎれないよう、ふちをうっすら明るくする */
:root[data-theme="dark"] .cat-img, :root[data-theme="dark"] .empty img, :root[data-theme="dark"] .profile img {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, .45)) drop-shadow(0 0 8px rgba(255, 255, 255, .08));
}
.cat-stage .cat-img.pop { animation: pop .5s ease; }
@keyframes pop { 40% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .cat-stage .cat-img.pop { animation: none; } }

/* ---------- 進捗 ---------- */
.progress { display: flex; align-items: center; gap: 12px; }
.progress-main { flex: 1; min-width: 0; }
.progress-label { font-size: .875rem; color: var(--ink2); margin: 0; }
.progress-num { margin: 2px 0 10px; font-size: .9375rem; }
.progress-num b { font-size: 1.75rem; font-weight: 700; margin-right: 2px; }
.bar { height: 10px; background: var(--sub); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.ring { width: 76px; height: 76px; position: relative; flex: none; }
.ring svg { width: 76px; height: 76px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: var(--sub); }
.ring .val { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 1.0625rem; }

/* ---------- タスク行 ---------- */
.task-list { list-style: none; margin: 0; padding: 0; }
.task {
  display: flex; align-items: center; gap: 10px; min-height: 52px;
  border-top: 1px solid var(--line);
}
.task:first-child { border-top: 0; }
.check {
  flex: none; width: 44px; height: 44px; margin-left: -10px; border: 0; background: none;
  display: grid; place-items: center;
}
.check i {
  width: 24px; height: 24px; border: 1.5px solid var(--muted); border-radius: 7px;
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.check svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.check[aria-checked="true"] i { background: var(--accent); border-color: var(--accent); }
.check[aria-checked="true"] svg { opacity: 1; }
.task-body {
  flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 8px 0;
  display: flex; align-items: center; gap: 8px; min-height: 44px;
}
.task-text { flex: 1; min-width: 0; }
.task-title { display: block; overflow-wrap: anywhere; }
.task-due { display: block; font-size: .75rem; color: var(--ink2); margin-top: 1px; }
.task-due.late { color: var(--danger); font-weight: 700; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; }
.task.done .task-due { color: var(--muted); }
.tags { display: flex; gap: 6px; flex: none; align-items: center; }
.tag {
  font-size: .75rem; padding: 2px 9px; border-radius: 999px; background: var(--sub); color: var(--ink2);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.tag .dot { width: 7px; height: 7px; border-radius: 50%; }
.tag.p-high { background: var(--hi-bg); color: var(--hi-fg); font-weight: 700; }
.tag.p-medium { background: var(--mid-bg); color: var(--mid-fg); }
.tag.p-low { background: var(--lo-bg); color: var(--lo-fg); }
.task.done .tag { opacity: .6; }

.empty { text-align: center; padding: 18px 8px 8px; color: var(--ink2); }
.empty img { width: 110px; margin: 0 auto 8px; display: block; }
.empty p { margin: 0 0 4px; }
.empty small { color: var(--muted); }

.add-line {
  width: 100%; border: 1px dashed var(--muted); background: none; border-radius: 12px;
  min-height: 48px; color: var(--ink2); display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 10px;
}

/* ---------- 追加ボタン ---------- */
.fab {
  position: fixed; z-index: 20; width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(80, 110, 88, .35);
  display: grid; place-items: center;
  right: max(18px, calc(50% - 240px + 18px));
  bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom));
}
.fab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fab:active { transform: scale(.96); }

/* ---------- 下のメニュー ---------- */
.tabbar {
  position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; min-height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none; color: var(--muted); font-size: .6875rem;
}
.tabbar a[aria-current="page"] { color: var(--accent-ink); font-weight: 700; }
.tabbar a[aria-current="page"] svg { stroke-width: 2; }

/* ---------- カレンダー ---------- */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-nav h2 { margin: 0; font-size: 1.0625rem; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.cal-wd { font-size: .75rem; color: var(--ink2); padding: 6px 0; }
.cal-wd.sun { color: #B5574C; } .cal-wd.sat { color: #4F7AA6; }
:root[data-theme="dark"] .cal-wd.sun { color: #E59A90; }
:root[data-theme="dark"] .cal-wd.sat { color: #93B6DA; }
.cal-day {
  border: 0; background: none; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 4px; gap: 3px;
}
.cal-day .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .9375rem; }
.cal-day.today .n { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 700; }
.cal-day[aria-pressed="true"] .n { background: var(--accent); color: #fff; font-weight: 700; box-shadow: none; }
:root[data-theme="dark"] .cal-day[aria-pressed="true"] .n { color: #1D1E1B; }
.cal-day .mark { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cal-day .mark.late { background: var(--danger); border-radius: 1px; transform: rotate(45deg); }
.cal-day .mark.none { background: transparent; }
.cal-legend { display: flex; gap: 14px; justify-content: flex-end; font-size: .75rem; color: var(--ink2); margin-top: 6px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
.cal-legend i.late { background: var(--danger); border-radius: 1px; transform: rotate(45deg); }
.day-title { font-size: 1rem; font-weight: 700; margin: 6px 0 8px; }

/* ---------- タスク一覧 ---------- */
.search {
  display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 12px; min-height: 46px; margin-bottom: 10px;
}
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; flex: none; }
.search input { flex: 1; border: 0; background: none; outline: none; min-height: 44px; min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink2);
  border-radius: 999px; padding: 6px 14px; font-size: .8125rem; min-height: 36px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-label { font-size: .75rem; color: var(--muted); align-self: center; flex: none; }
.list-meta { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 8px; font-size: .8125rem; color: var(--ink2); }
.list-meta select {
  border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 8px; min-height: 36px; font-size: .8125rem;
}

/* ---------- 記録 ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; overflow: hidden; padding: 16px 8px 0 18px; background: var(--sub); }
.hero .cat-img { width: 150px; margin-right: -10px; }
.hero-label { font-size: .875rem; color: var(--ink2); margin: 0; }
.hero-num { margin: 0 0 4px; font-size: .9375rem; }
.hero-num b { font-size: 2.25rem; font-weight: 700; margin-right: 2px; }
.hero-sub { font-size: .8125rem; color: var(--ink2); margin: 0 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; min-width: 0; }
.tile p { margin: 0; font-size: .75rem; color: var(--ink2); }
.tile b { display: block; font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.tile b small { font-size: .8125rem; font-weight: 400; margin-left: 2px; }
.tile .na { font-size: 1rem; color: var(--muted); }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--ink2); font-size: 11px; }
.chart .bar-mark { fill: var(--accent); }
.chart .bar-mark.today { fill: var(--accent-ink); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar-mark, .chart .hit:focus + .bar-mark { opacity: .8; }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .75rem;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -6px;
}
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 120px; height: 120px; flex: none; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: .875rem; padding: 4px 0; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .nm { flex: 1; }
.legend .ct { font-variant-numeric: tabular-nums; }
.legend .pc { color: var(--muted); font-size: .75rem; width: 3em; text-align: right; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .875rem; }
.history li:first-child { border-top: 0; }
.history .d { width: 6.5em; flex: none; color: var(--ink2); }
.history .b { flex: 1; height: 8px; background: var(--sub); border-radius: 999px; overflow: hidden; }
.history .b i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.history .c { width: 3.5em; text-align: right; flex: none; }
.note { font-size: .75rem; color: var(--muted); margin: 8px 0 0; }

/* ---------- マイページ ---------- */
.profile { display: flex; align-items: center; gap: 14px; }
.profile img { width: 76px; }
.profile h2 { margin: 0; font-size: 1.375rem; letter-spacing: .06em; }
.profile p { margin: 2px 0 0; font-size: .8125rem; color: var(--ink2); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row > span { font-size: .9375rem; }
.set-row small { display: block; color: var(--muted); font-size: .75rem; }
.link-row {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 52px; border: 0; background: none; text-align: left;
  border-top: 1px solid var(--line); text-decoration: none; padding: 0; font-size: .9375rem;
}
.link-row:first-of-type { border-top: 0; }
.link-row .row-ico { color: var(--ink2); }
.link-row .grow { flex: 1; }
.link-row .chev { color: var(--muted); }
.link-row.danger { color: var(--danger); }
.link-row.danger .row-ico { color: var(--danger); }
.sns-box { text-align: center; margin: 26px 0 8px; line-height: 1.4; }
.sns-cat { display: inline-block; }
.sns-cat img { display: block; height: auto; }
.sns-link { font-size: .85rem; color: var(--ink); text-decoration: none; }
.sns-link:hover { text-decoration: underline; }
.sns-link.tip-link { display: inline-block; margin-top: 10px; padding: 8px 16px; border: 1.5px solid currentColor; border-radius: 4px; }
.app-info { text-align: center; color: var(--muted); font-size: .75rem; margin: 18px 0 0; }

/* ---------- 追加・編集画面 ---------- */
.editor {
  position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto;
  padding: 0 16px calc(40px + env(safe-area-inset-bottom));
  animation: up .2s ease;
}
@keyframes up { from { transform: translateY(16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .editor { animation: none; } }
.editor-inner { max-width: 480px; margin: 0 auto; }
.editor .head h1 { text-align: center; font-size: 1.125rem; }
.btn-save {
  border: 0; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 20px; min-height: 40px; font-weight: 700;
}
:root[data-theme="dark"] .btn-save { color: #1D1E1B; }
.field { margin-bottom: 18px; }
.field label, .field .lbl { display: block; font-weight: 700; font-size: .9375rem; margin-bottom: 8px; }
.req { color: var(--danger); margin-left: 3px; }
.input, .textarea {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 14px; min-height: 48px;
  font-size: 1rem;
}
.textarea { min-height: 80px; resize: vertical; }
.input:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.input.err { border-color: var(--danger); }
.err-msg { color: var(--danger); font-size: .8125rem; margin: 6px 0 0; }
.opt-group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.opt { border-top: 1px solid var(--line); }
.opt:first-child { border-top: 0; }
.opt-head {
  width: 100%; border: 0; background: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 54px; text-align: left;
}
.opt-head .row-ico { color: var(--ink2); }
.opt-head .grow { flex: 1; font-weight: 700; font-size: .9375rem; }
.opt-head .val { color: var(--ink2); font-size: .875rem; }
.opt-head .chev svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; transition: transform .2s; }
.opt-head[aria-expanded="true"] .chev svg { transform: rotate(90deg); }
.opt-body { padding: 0 16px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.opt-body .input { width: auto; flex: 1 1 140px; min-height: 44px; padding: 8px 12px; }
.pick { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 14px; min-height: 38px; font-size: .875rem; display: inline-flex; align-items: center; gap: 6px; }
.pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.pick .dot { width: 8px; height: 8px; border-radius: 50%; }
.btn-del {
  width: 100%; border: 1px solid var(--line); background: var(--card); color: var(--danger); border-radius: 12px; min-height: 50px;
  font-weight: 700; margin-top: 8px;
}
.done-switch { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--ink2); font-size: .9375rem; }

/* ---------- 確認ダイアログ・お知らせ ---------- */
.dialog-back { position: fixed; inset: 0; z-index: 80; background: rgba(30, 30, 28, .45); display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--card); border-radius: 16px; padding: 22px 20px 16px; width: 100%; max-width: 340px; }
.dialog h2 { margin: 0 0 6px; font-size: 1.0625rem; }
.dialog p { margin: 0 0 18px; color: var(--ink2); font-size: .9375rem; white-space: pre-line; }
.dialog-btns { display: flex; gap: 10px; }
.dialog-btns button { flex: 1; min-height: 46px; border-radius: 12px; font-weight: 700; }
.btn-ghost { border: 1px solid var(--line); background: var(--bg); }
.btn-danger { border: 0; background: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #1D1E1B; }
.btn-main { border: 0; background: var(--accent); color: #fff; }
.toast {
  position: fixed; z-index: 90; left: 50%; transform: translate(-50%, 20px);
  bottom: calc(var(--tabbar-h) + 90px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--bg); border-radius: 999px; padding: 10px 18px; font-size: .875rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); color: #fff; }
.banner { background: var(--hi-bg); color: var(--hi-fg); border-radius: 12px; padding: 10px 14px; font-size: .8125rem; margin-bottom: 12px; }

/* ---------- ホーム：日めくり＋いまの線 ---------- */
body.on-home { background: var(--sub); }
body.on-home .view { padding-bottom: 0; }
.pad-wrap { position: relative; padding: calc(100px + env(safe-area-inset-top)) 0 0; }
.pad {
  position: relative; margin: 0 28px; background: var(--card); border-radius: 6px 6px 4px 4px;
  box-shadow: 0 2px 0 var(--bg), 0 4px 0 var(--pad-edge), 0 6px 0 var(--bg), 0 8px 0 var(--pad-edge), 0 14px 24px rgba(52, 52, 52, .10);
}
:root { --pad-edge: #D9D4CA; --font-num: "Outfit", -apple-system, "Segoe UI", sans-serif; }
:root[data-theme="dark"] { --pad-edge: #3C3D37; }
.pad-cat { position: absolute; right: -12px; top: -84px; width: 94px; }
.pad-bubble {
  position: absolute; left: 28px; top: calc(28px + env(safe-area-inset-top)); margin: 0; max-width: calc(100% - 160px);
  background: var(--card); border-radius: 14px; padding: 9px 14px; font-size: .875rem; line-height: 1.55; box-shadow: var(--shadow);
}
.pad-bubble::after {
  content: ""; position: absolute; right: -7px; top: 50%; margin-top: -7px; border: 7px solid transparent;
  border-left-color: var(--card); border-right: 0;
}
.pad-band {
  height: 32px; background: var(--ink); border-radius: 6px 6px 0 0; color: var(--bg);
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
  font-family: var(--font-num); font-weight: 500; font-size: .75rem; letter-spacing: .25em;
}
.pad-rings { display: flex; gap: 6px; }
.pad-rings i { width: 8px; height: 8px; border-radius: 50%; background: var(--bg); }
.pad-day { margin: 0; text-align: center; font-family: var(--font-num); font-weight: 200; font-size: 6.5rem; line-height: 1.05; padding-top: 4px; }
.pad-wd { margin: 0 0 12px; text-align: center; font-weight: 700; letter-spacing: .3em; padding-left: .3em; }
.pad-foot { border-top: 1.5px dashed var(--pad-edge); padding: 10px 16px 12px; display: flex; align-items: center; gap: 12px; }
.pad-foot-label { font-size: .75rem; color: var(--ink2); flex: none; }
.pad-foot .bar { flex: 1; height: 6px; }
.pad-num { font-family: var(--font-num); font-size: .875rem; font-weight: 500; flex: none; }

.sheet {
  margin: 30px -16px 0; background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 18px 20px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
  min-height: calc(100vh - 360px); min-height: calc(100dvh - 360px);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.pill-add {
  border: 0; background: var(--ink); color: var(--bg); border-radius: 999px; min-height: 40px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 700;
}
.pill-add svg { width: 15px !important; height: 15px !important; stroke-width: 2.6 !important; }
.pill-add:active { transform: scale(.97); }
.sheet-sub { margin: 14px 0 0; padding-top: 10px; border-top: 1px dashed var(--pad-edge); font-size: .75rem; font-weight: 700; color: var(--ink2); }
.sheet-sub.late { color: var(--danger); border-top: 0; padding-top: 0; margin-top: 6px; }
.sheet .empty { padding-top: 26px; }

/* タイムライン */
.tl { list-style: none; margin: 4px 0 0; padding: 0; }
.tl > li { position: relative; display: grid; grid-template-columns: 44px 36px minmax(0, 1fr); align-items: center; min-height: 52px; border: 0; gap: 0; }
.tl > li::before { content: ""; position: absolute; left: 61px; top: 0; bottom: 0; width: 2px; background: var(--sub); }
.tl > li.past::before, .tl > li.tl-now::before { background: var(--accent); }
.tl > li.tl-now::before { bottom: 50%; }
.tl > li:first-child::before { top: 50%; }
.tl > li:last-child::before { bottom: 50%; }
.tl > li:only-child::before { display: none; }
.tl-time { font-family: var(--font-num); font-size: .75rem; color: var(--ink); }
.tl-time.late { color: var(--danger); font-weight: 700; }
.tl-row.done .tl-time, .tl-row.past:not(.done) .tl-time:not(.late) { color: var(--muted); }
.check.tl-node { width: 36px; height: 44px; margin: 0; position: relative; z-index: 1; }
.check.tl-node i { width: 22px; height: 22px; border-radius: 50%; border-color: var(--ink); background: var(--bg); }
.check.tl-node[aria-checked="true"] i { background: var(--accent); border-color: var(--accent); }
.check.tl-node svg { width: 13px; height: 13px; stroke-width: 3; }
.tl-body { padding: 6px 4px 6px 6px; }
.tl-row.next .tl-body { background: var(--card); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); margin: 4px 0; }
.tl-row.next .task-title { font-weight: 700; }
.tl-row .tags .tag:not(.p-high) { background: none; padding: 0; }
.tl-now { min-height: 44px !important; }
.tl-now .tl-time { color: var(--accent-ink); font-weight: 500; }
.tl-now .tl-node { display: grid; place-items: center; position: relative; z-index: 1; }
.tl-now .tl-node i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent-ink); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-now-line { display: flex; align-items: center; gap: 8px; padding-left: 6px; }
.tl-now-line b { flex: 1; height: 1.5px; background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 10px); }
.tl-now-line span { font-family: var(--font-num); font-size: .75rem; font-weight: 500; color: var(--accent-ink); }

@media (max-width: 340px) {
  .pad { margin: 0 18px; }
  .pad-day { font-size: 5.5rem; }
  .pad-bubble { left: 18px; max-width: calc(100% - 130px); }
}
