/* Life Hub — 閲覧用ページのスタイル（外部フォント・フレームワークなし） */
:root {
  color-scheme: light; /* OS がダークモードでも明るい配色で表示する */
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --text: #1b2140;
  --muted: #5c6382;
  --line: #e3e6f1;
  --primary: #3b4cca;
  --primary-2: #6247d6;
  --accent: #12a4b4;
  --shadow: 0 1px 2px rgba(27, 33, 64, .05), 0 8px 24px rgba(27, 33, 64, .07);
  --shadow-lg: 0 2px 4px rgba(27, 33, 64, .06), 0 18px 40px rgba(27, 33, 64, .12);
  --radius: 18px;
  --radius-s: 12px;
  --hero: linear-gradient(135deg, #3343c4 0%, #5d3fd3 48%, #1597b0 100%);

  --b-green-bg: #e2f5eb; --b-green: #136c43;
  --b-teal-bg: #dcf4f2; --b-teal: #0e6b66;
  --b-blue-bg: #e3ebff; --b-blue: #2449b8;
  --b-violet-bg: #eee8ff; --b-violet: #5b35b8;
  --b-amber-bg: #fff1d9; --b-amber: #8a5200;
  --b-rose-bg: #fde7ec; --b-rose: #a3213f;
  --b-sky-bg: #e3f3fa; --b-sky: #1b6687;
  --b-gray-bg: #eef0f5; --b-gray: #4d5574;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 16px; line-height: 1.75; letter-spacing: .01em;
  overflow-wrap: anywhere;
}
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; letter-spacing: .01em; }
p { margin: 0 0 .8em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .05em .4em; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.ic { width: 22px; height: 22px; flex: none; }
.ic-s { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.flip { transform: rotate(180deg); }

/* ---- ヘッダー ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.08rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: var(--hero); box-shadow: 0 6px 14px rgba(59, 76, 202, .35); }
.logo .ic { width: 18px; height: 18px; }
.topnav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { white-space: nowrap; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 600; padding: 8px 12px; border-radius: 999px; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }

/* ---- ヒーロー ---- */
.hero { position: relative; overflow: hidden; background: var(--hero); color: #fff; padding: 56px 0 64px; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .35; pointer-events: none; }
.hero::before { width: 420px; height: 420px; right: -120px; top: -160px; background: radial-gradient(circle, rgba(255, 255, 255, .55), transparent 65%); }
.hero::after { width: 360px; height: 360px; left: -140px; bottom: -200px; background: radial-gradient(circle, rgba(120, 240, 255, .6), transparent 65%); }
.hero .wrap { position: relative; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); font-weight: 800; margin: 14px 0 10px; }
.lead { max-width: 40rem; font-size: 1.02rem; opacity: .92; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius-s); background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.stat-k { font-size: .78rem; opacity: .85; }
.stat-v { font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; }
.stat-s { font-size: .8rem; opacity: .85; min-height: 1.2em; }

/* ---- セクション ---- */
.main { padding: 28px 16px 48px; }
.block { margin: 0 0 36px; }
.block-head h2 { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; font-weight: 800; margin-bottom: 4px; }
.block-head h2 .ic { color: var(--primary); }
.block-sub { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.panel h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin-bottom: 10px; }
.panel h3 a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.panel h3 a:hover { color: var(--primary); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- 次にやること ---- */
.next-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.next-card { position: relative; display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.next-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; border-radius: var(--radius) var(--radius) 0 0; background: var(--hero); }
.next-no { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: #fff; font-weight: 800; background: var(--hero); box-shadow: 0 6px 14px rgba(59, 76, 202, .3); }
.next-card h3 { font-size: 1.05rem; font-weight: 800; margin: 8px 0 8px; }
.reason { font-size: .9rem; color: var(--muted); }
.reason span { display: inline-block; font-size: .72rem; font-weight: 800; color: var(--primary); background: var(--b-blue-bg); border-radius: 6px; padding: 0 6px; margin-right: 6px; }
.btn-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.btn-link:hover { background: var(--b-blue-bg); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }

/* ---- バッジ ---- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge { display: inline-flex; align-items: center; white-space: nowrap; font-size: .74rem; font-weight: 700; line-height: 1.5; padding: 1px 9px; border-radius: 999px; border: 1px solid transparent; vertical-align: 1px; margin-right: 4px; }
.st-done { background: var(--b-green-bg); color: var(--b-green); }
.st-booked { background: var(--b-teal-bg); color: var(--b-teal); }
.st-progress { background: var(--b-blue-bg); color: var(--b-blue); }
.st-wait { background: var(--b-violet-bg); color: var(--b-violet); }
.st-todo { background: var(--b-gray-bg); color: var(--b-gray); }
.st-unknown { background: transparent; color: var(--muted); border: 1px dashed var(--muted); }
.st-muted { background: var(--surface-2); color: var(--muted); }
.st-plan { background: var(--b-blue-bg); color: var(--b-blue); }
.ty-deadline { background: var(--b-rose-bg); color: var(--b-rose); }
.ty-target { background: var(--b-amber-bg); color: var(--b-amber); }
.ty-plan { background: var(--b-teal-bg); color: var(--b-teal); }
.ty-approx { background: var(--b-sky-bg); color: var(--b-sky); }
.ty-end { background: var(--b-violet-bg); color: var(--b-violet); }
.ty-undated, .ty-past { background: var(--b-gray-bg); color: var(--b-gray); }
.ac-self { background: transparent; color: var(--b-blue); border-color: currentColor; }
.ac-wait { background: transparent; color: var(--b-violet); border-color: currentColor; }
.ac-decide { background: transparent; color: var(--b-amber); border-color: currentColor; }
.ac-asneeded { background: transparent; color: var(--muted); border-color: currentColor; }

/* ---- 予定 ---- */
.controls { display: none; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.js .controls { display: flex; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.seg-btn { font: inherit; font-size: .88rem; font-weight: 700; color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.seg-btn.is-on { color: #fff; background: var(--hero); }
.sel { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 700; color: var(--muted); }
.sel select { font: inherit; font-size: .9rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 40px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.timeline { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 20px 16px; box-shadow: var(--shadow); }
.tl-month { position: sticky; top: 60px; z-index: 2; font-size: .9rem; font-weight: 800; color: var(--primary); background: var(--surface); margin: 0; padding: 14px 0 8px; border-bottom: 1px solid var(--line); }
.tl-list { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 6.6rem 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-item.is-today { background: linear-gradient(90deg, var(--b-blue-bg), transparent 70%); border-radius: 10px; }
.tl-date { display: flex; flex-direction: column; }
.d-num { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.d-approx { color: var(--b-sky); }
.d-none { color: var(--muted); }
.d-wd { font-size: .78rem; color: var(--muted); }
.d-sub { font-size: .76rem; color: var(--muted); line-height: 1.4; }
.tl-title { font-weight: 700; margin-bottom: 6px; }
.tl-note { font-size: .86rem; color: var(--muted); margin: 6px 0 0; }
.tl-flag { font-size: .76rem; font-weight: 700; color: var(--b-amber); background: var(--b-amber-bg); border-radius: 6px; padding: 1px 8px; }
.tl-theme { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .8rem; font-weight: 700; text-decoration: none; color: var(--muted); }
.tl-theme:hover { color: var(--primary); }
.tl-empty { color: var(--muted); padding: 16px 0; margin: 0; }

/* ---- 手配済み・確認事項 ---- */
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { display: grid; grid-template-columns: 3.4rem 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.mini li:last-child { border-bottom: 0; }
.mini-d { font-weight: 800; color: var(--muted); }
.mini-p { display: block; font-size: .78rem; color: var(--muted); text-decoration: none; }
.mini-p:hover { color: var(--primary); }
.confirm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.clist { margin: 0; padding-left: 1.1em; font-size: .92rem; }
.clist li { margin-bottom: 6px; }

/* ---- テーマカード ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-top { display: flex; align-items: center; gap: 12px; }
.card-top h3 { margin: 0; font-size: 1.08rem; font-weight: 800; }
.card-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--primary); background: var(--b-blue-bg); flex: none; }
.card-ic.lg { width: 52px; height: 52px; border-radius: 16px; color: #fff; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); }
.card-state { font-size: .92rem; margin: 0; }
.card-next { font-size: .88rem; color: var(--muted); margin: 0; }
.card-next span, .sum-next span { display: inline-block; font-size: .72rem; font-weight: 800; color: var(--b-teal); background: var(--b-teal-bg); border-radius: 6px; padding: 0 6px; margin-right: 6px; }
.card-meta { font-size: .76rem; color: var(--muted); margin: auto 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.card-go { position: absolute; top: 20px; right: 18px; color: var(--muted); }
.card:hover .card-go { color: var(--primary); }

/* ---- 詳細ページ ---- */
.page-hero { background: var(--hero); color: #fff; padding: 22px 0 28px; }
.crumbs { font-size: .84rem; opacity: .92; margin-bottom: 14px; }
.crumbs a { color: #fff; }
.crumbs span { opacity: .7; margin: 0 4px; }
.page-title { display: flex; align-items: center; gap: 14px; }
.page-title h1 { font-size: clamp(1.5rem, 4.5vw, 2.2rem); font-weight: 800; margin: 0; }
.summary { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-s); background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); }
.summary p { margin: 0 0 4px; }
.sum-next { opacity: .95; font-size: .92rem; }
.sum-next span { color: #0b4d49; background: #c8f3ee; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: .82rem; }
.meta div { display: flex; gap: 6px; }
.meta dt { opacity: .78; }
.meta dd { margin: 0; font-weight: 700; }
.related { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; font-size: .84rem; }
.related > span { opacity: .8; margin-right: 4px; }
.related a { color: #fff; text-decoration: none; padding: 3px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26); }
.related a:hover { background: rgba(255, 255, 255, .24); }
.intro { color: var(--muted); font-size: .92rem; margin-bottom: 8px; }
.toc { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 12px; scrollbar-width: thin; }
.toc a { flex: none; font-size: .84rem; font-weight: 700; text-decoration: none; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.toc a:hover { color: var(--primary); border-color: var(--primary); }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 14px; box-shadow: var(--shadow); margin-bottom: 18px; }
.sec > h2 { font-size: 1.22rem; font-weight: 800; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.sec h3 { font-size: 1.02rem; font-weight: 800; margin-top: 18px; }
.sec h4 { font-size: .95rem; }
.sec ul, .sec ol { padding-left: 1.3em; margin: 0 0 1em; }
.sec li { margin-bottom: 4px; }
.sec li > ul { margin: 4px 0 0; }
.task { list-style: none; display: flex; gap: 10px; margin-left: -1.3em; }
.task .box { flex: none; width: 18px; height: 18px; margin-top: 5px; border: 2px solid var(--muted); border-radius: 5px; }
.task.done .box { background: var(--b-green); border-color: var(--b-green); }
.src, .ref { color: var(--muted); }
.url { word-break: break-all; }
.back { margin-top: 24px; }
.back a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; }

/* 確認事項の重み */
.weights { display: grid; gap: 12px; }
.weight { border-radius: var(--radius-s); padding: 14px 16px 6px; border: 1px solid var(--line); border-left-width: 5px; background: var(--surface-2); }
.weight h3 { margin: 0 0 8px !important; font-size: .98rem; }
.w-now { border-left-color: var(--primary); background: var(--b-blue-bg); }
.w-later { border-left-color: var(--accent); }
.w-record { border-left-color: var(--line); }

/* 折りたたみ */
.fold { border: 1px solid var(--line); border-radius: var(--radius-s); margin: 12px 0; background: var(--surface-2); }
.fold > summary { cursor: pointer; font-weight: 800; padding: 12px 16px; list-style: none; display: flex; align-items: center; gap: 10px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.fold[open] > summary::before { transform: rotate(45deg); }
.fold > :not(summary) { margin-left: 16px; margin-right: 16px; }
.fold > :last-child { margin-bottom: 14px; }

/* 表 */
.table-wrap { overflow-x: auto; margin: 0 0 1.1em; border: 1px solid var(--line); border-radius: var(--radius-s); -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl th { background: var(--surface-2); font-size: .8rem; color: var(--muted); font-weight: 800; white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--b-blue-bg) 40%, transparent); }
.tbl td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.legend-list { list-style: none; padding: 0 !important; display: grid; gap: 8px; }

/* ---- フッター ---- */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0 36px; font-size: .86rem; }
.footer p { margin: 0 0 6px; }

/* ---- レスポンシブ ---- */
@media (max-width: 900px) {
  .next-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .two { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 40px; }
  .hero-stats { grid-template-columns: 1fr; }
  .stat { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
  .stat-v { font-size: 1.1rem; }
  .topbar-in { gap: 8px; }
  .brand { font-size: 1rem; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .main { padding-top: 20px; }
  .timeline { padding: 4px 14px 12px; }
  .tl-item { grid-template-columns: 4.8rem 1fr; gap: 10px; }
  .d-num { font-size: 1.12rem; }
  .sec { padding: 18px 14px 10px; border-radius: var(--radius-s); }
  .panel { padding: 16px; }
  /* 列の多い表はカード表示 */
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .tbl.stack tbody tr:last-child { border-bottom: 0; }
  .tbl.stack td { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px; padding: 4px 0; border: 0; }
  .tbl.stack td::before { content: attr(data-label); font-size: .76rem; font-weight: 800; color: var(--muted); }
  .tbl.stack td > .c { min-width: 0; }
  .tbl.stack td.num { text-align: left; }
  .table-wrap:has(.stack) { overflow-x: visible; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}
@media print {
  .topbar, .controls, .toc { display: none; }
  .hero, .page-hero { background: none; color: inherit; }
  .fold { border: 0; }
}
