/* clipハウススタイル（RSVPアプリ・福岡ドライブのしおりと共通）
   白地・ink・青/黄/緑の3色（薄い色は透過で作る）・角丸4px・フラット塗り・ゴシック1種 */
:root {
  color-scheme: light;
  --ink: #202124; --bg: #ffffff; --card: #ffffff; --paper: #f9f9f9;
  --ink-04: rgba(32,33,36,.04); --ink-08: rgba(32,33,36,.08); --ink-20: rgba(32,33,36,.2); --ink-55: rgba(32,33,36,.55);
  --sub: var(--ink-55); --line: var(--ink-08); --border: var(--ink-20);
  --blue: #0098d0; --blue-10: rgba(0,152,208,.10); --blue-16: rgba(0,152,208,.16); --blue-ink: #006d96;
  --yellow: #ffeb00; --yellow-12: rgba(255,235,0,.16); --yellow-20: rgba(255,235,0,.28); --yellow-ink: #8a7c00;
  --green: #00a92e; --green-10: rgba(0,169,46,.10); --green-ink: #007a21;
  --radius: 4px;
  --head: #515151; /* 記録のセクションと考察の枠の「やや黒」（本人の指定） */
  --fill: #f9f9f9; /* ボタン・入力欄の地色（本人の指定） */
  --gothic: "Hiragino Sans", "Noto Sans JP", "Yu Gothic Medium", "YuGothic", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--gothic); font-weight: 500;
  font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
button, input, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
#app { max-width: 760px; margin: 0 auto; padding: 0 16px 96px; }
.view { display: none; }
.view.active { display: block; }
.hidden { display: none !important; }
.muted { color: var(--sub); }
.pad { padding: 16px; }

/* 上部バー */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; margin-bottom: 4px; background: var(--bg); border-bottom: 2px solid var(--ink);
}
.topbar h2 { margin: 0; font-size: 18px; font-weight: 700; }
.nav:disabled { opacity: .3; cursor: default; }
.nav, .today-btn {
  height: 40px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--fill); font-weight: 700; cursor: pointer;
}
.nav { width: 40px; font-size: 22px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0; } /* ☰ ‹ › は SVG。文字だとフォントで上下がずれるため */
.nav svg { display: block; }
.today-btn { padding: 0 12px; font-size: 14px; }
.nav:hover, .today-btn:hover { border-color: var(--ink); }
.date-label { position: relative; flex: 1; text-align: center; font-size: 18px; font-weight: 700; }
.date-label input { position: absolute; inset: 0; opacity: 0; width: 100%; }
#searchBox {
  flex: 1; height: 42px; padding: 0 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--fill);
}

/* ☰メニュー：カレンダーと検索 */
.menu-btn { font-size: 18px; }
.menu-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.menu-panel {
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  padding: 12px; margin: 10px 0; display: grid; gap: 14px;
}
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cal-title { flex: 1; text-align: center; font-weight: 700; font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--sub); padding: 2px 0; }
.cal-wd.sun { color: var(--yellow-ink); }
.cal-wd.sat { color: var(--blue-ink); }
.cal-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--fill);
  font-size: 14px; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums;
}
.cal-day:hover { border-color: var(--ink); }
.cal-day.future { opacity: .3; cursor: default; }
.cal-day.future:hover { border-color: var(--line); }
.cal-day.today { border: 2px solid var(--ink); font-weight: 700; }
.cal-day.sel { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.cal-day .dots { display: flex; gap: 3px; height: 6px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.dot.rec { background: var(--blue); }
.dot.ha { background: var(--green); }
.cal-day.sel .dot { box-shadow: 0 0 0 1px #fff; }
.cal-legend { font-size: 11px; color: var(--sub); margin-top: 6px; }
.cal-legend .dot { margin: 0 4px 0 6px; vertical-align: 0; }
.search #searchBox { width: 100%; }
.search #list { max-height: 50vh; overflow-y: auto; }
@media (max-width: 400px) { .date-label { font-size: 15px; } .topbar { gap: 6px; } .today-btn { padding: 0 10px; } }

/* ナルティーク（数字タイル） */
.nurtec-mini { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 10px 0 16px; }
/* 記録画面の上の3つ：天気・前回のナルティークはグレー、周期はベージュ（2026-11-20、本人の指定） */
.nurtec-mini .box { text-align: center; }
.nurtec-mini .num.pill { font-size: 24px; line-height: 1.35; } /* 💊 */ /* 3つとも中央揃え・ベージュ（2026-11-20、本人の指定） */
.nurtec-mini .num.wx { font-size: 24px; line-height: 1.35; white-space: nowrap; } /* 天気の絵文字（💊と同じ大きさ） */
.nurtec-mini .wx-arrow { font-size: 14px; color: var(--sub); margin: 0 2px; vertical-align: 3px; }
@media (max-width: 400px) { .nurtec-mini { gap: 6px; } .nurtec-mini .box { padding: 8px; } .nurtec-mini .label { font-size: 11px; } }
.nurtec-big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.nurtec-big.three { grid-template-columns: 1fr 1fr 1fr; gap: 8px; } /* 3か月分 */
.nurtec-mini .box, .nurtec-big .box { background: var(--yellow-12); border-radius: var(--radius); padding: 8px 12px; }
.nurtec-mini .label, .nurtec-big .label { font-size: 12px; font-weight: 700; color: var(--yellow-ink); }
.nurtec-mini .num { font-size: 26px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.nurtec-big .box { text-align: center; } /* 集計タブの大きい2つは中央揃え（2026-11-20） */
.nurtec-big .num { font-size: 26px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; } /* 記録画面の上の箱と同じ高さ（本人の指定） */
.nurtec-mini .num small, .nurtec-big .num small { font-size: 14px; font-weight: 700; margin-left: 2px; }
.nurtec-mini .sub, .nurtec-big .sub { font-size: 12px; color: var(--sub); }
.nurtec-title { font-size: 14px; font-weight: 700; margin: 10px 0 6px; }
.nurtec-limit { font-size: 12px; font-weight: 400; color: var(--sub); margin-left: 4px; white-space: nowrap; } /* 月の上限の注意（2026-11-22） */

/* セクション（見出しに番号の丸） */
#sections { counter-reset: sec; }
details.sec { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
details.sec > summary {
  list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; gap: 8px;
}
details.sec > summary::before {
  counter-increment: sec; content: counter(sec);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px;
}
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: '＋'; margin-left: auto; color: var(--sub); }
details.sec[open] > summary::after { content: '－'; }
details.sec.compact[open] > summary::after { content: '＋'; } /* 起床後の様子：準備度だけ／薬・片頭痛：予防薬だけの状態 */
details.sec[open] > summary { border-bottom: 1px solid var(--line); }
/* 見出しは白地のまま、枠だけ「やや黒」（2026-11-20、本人の希望。見出しの地に色を付ける案は、薄い青・緑／やや黒／#e0e0e0 を試して外した）。箱どうしの間は16px */
details.sec { border-color: var(--head); margin-bottom: 16px; }
.sec-badge { font-size: 11px; font-weight: 700; color: var(--green-ink); background: #fff; border-radius: 3px; padding: 1px 6px; }
.sec-badge:empty { display: none; }
.sec-body { padding: 4px 14px 12px; }
.field { padding: 10px 0; border-top: 1px solid var(--line); }
.field:first-child { border-top: none; }
.field-label { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.field-hint { font-size: 11px; font-weight: 500; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-group + .chip-group { margin-top: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--fill); border-radius: var(--radius);
  padding: 8px 12px; min-height: 40px; font-size: 14px; font-weight: 500; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
/* 選択中のボタン：奇数番目のセクションは青、偶数番目は緑（本人の指定） */
details.sec:nth-of-type(even) .chip.on { background: var(--green); border-color: var(--green); }
.chip.legacy { border-style: dashed; }
.chips.scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.chips.scale .chip { padding: 8px 0; min-width: 0; text-align: center; }
textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--fill);
  resize: none; overflow: hidden;
  scroll-margin-top: 80px; scroll-margin-bottom: 80px; /* 上の固定バー・下のタブに隠れないように */
}
.copy-btn {
  margin: 4px 0 8px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--blue); border-radius: var(--radius); background: var(--blue-10); color: var(--blue-ink);
}
.open-btn {
  display: block; width: 100%; margin: 4px 0 2px; padding: 10px 12px; min-height: 44px; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px dashed var(--border); border-radius: var(--radius); background: #fff; color: var(--ink); text-align: left;
}
.close-btn {
  display: block; width: min(240px, 100%); margin: 14px auto 4px; height: 40px; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--fill); color: var(--ink);
}
.cycle { font-size: 13px; padding: 6px 10px; margin: 4px 0 6px; background: var(--ink-04); border-radius: var(--radius); }

/* 考察 */
.card { background: #fff; border: 1px solid var(--head); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.analysis { background: var(--paper); border-color: var(--head); } /* 枠は記録のセクションと同じ「やや黒」 */
.analysis h3 { margin: 0 0 2px; }
.analysis .meta { font-size: 12px; color: var(--sub); margin-bottom: 8px; }
.analysis-text { white-space: pre-wrap; font-size: 14px; line-height: 1.8; }
.analysis-text .ah, .r-comment .ah { font-weight: 700; } /* 行全体が【見出し】の行（考察・カウンセリング用レポートのまとめ） */

/* 一覧 */
.list-note { font-size: 12px; color: var(--sub); margin: 8px 0; }
.item {
  display: block; width: 100%; text-align: left; background: #fff; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px;
}
.item:hover { border-color: var(--border); background: var(--ink-04); }
.item .d { font-weight: 700; font-size: 15px; }
.item .tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 3px; padding: 0 6px; margin-left: 6px; }
.item .tag.prev { background: var(--blue-16); color: var(--blue-ink); }
.item .tag.ana { background: var(--yellow-20); color: var(--yellow-ink); }
.item .h { font-size: 13px; }
.item .t { font-size: 13px; color: var(--sub); }

/* 集計 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: var(--ink-04); font-weight: 700; padding: 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th:first-child, .table td:first-child { text-align: left; }
.table.center td, .table.center th { text-align: center; } /* 期間別・薬ごとの服用日数・直近7日とふだん・頭痛のあった日の表（本人の指定） */
.table.center td:first-child { text-align: left; } /* 1列目（期間・月・項目）だけ左揃え */
/* 眼圧の記録：日付は普通の文字（リンクにしない）、右・左は中央、メモは左揃えで折り返す（本人の指定） */
.table.eye td { text-align: center; }
.table.eye td:first-child { text-align: left; }
.table.eye td.memo { text-align: left; white-space: pre; } /* 折り返さず、表ごと右にスクロール（2026-11-22） */
.table.eye td:not(.memo) { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.table.recent { font-size: 13px; }
.table.recent th, .table.recent td { border-right: 1px solid var(--line); }
.table.recent th:last-child, .table.recent td:last-child { border-right: none; }
.table.recent th { text-align: center; }
.table.recent td:nth-child(1), .table.recent td:nth-child(4), .table.recent td:nth-child(5) { text-align: center; }
.table.recent th, .table.recent td { padding: 6px 3px; }
.table.recent .date-link small { font-size: 11px; margin-left: 2px; }
@media (max-width: 400px) { #stats .card { padding: 12px 10px; } }
.table.recent td.t { text-align: left; white-space: normal; word-break: keep-all; }
.date-link { border: none; background: none; padding: 0; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-20); text-underline-offset: 3px; cursor: pointer; } /* 文字はほかと同じ黒（本人の指定）。押せることは薄い下線で示す */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 18px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart .bar { width: 100%; max-width: 28px; display: flex; flex-direction: column-reverse; }
.chart .seg-a { background: var(--blue); }
.chart .seg-b { background: var(--yellow); }
.chart .v { font-size: 11px; font-weight: 700; line-height: 1.2; }
.chart .m { font-size: 10px; color: var(--sub); margin-top: 2px; }
.legend { font-size: 12px; color: var(--sub); margin-top: 6px; }
.card { position: relative; }
.legend.legend-tr { position: absolute; top: 15px; right: 14px; margin: 0; }
.legend i { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin: 0 4px 0 10px; border-radius: 2px; }
.note { font-size: 12px; color: var(--sub); margin-top: 6px; }
.sec-title { font-size: 16px; font-weight: 700; margin: 22px 0 8px; }
.table.hc th { text-align: center; line-height: 1.3; }
.table.hc th small, .table.hc14 th small { font-size: 11px; font-weight: 500; }
.table.hc14 td { text-align: center; }
/* 月別の平均：列幅をそろえる */
.table.month-avg { table-layout: fixed; min-width: 520px; }
.table.month-avg td { text-align: center; }
.table td.hi { background: var(--yellow-20); font-weight: 700; }
.table.cond td:first-child { white-space: normal; }
.h-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.h-row h3 { margin: 0; }
.range-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.range-btn { border: none; background: var(--fill); padding: 4px 12px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink); }
.range-btn.on { background: var(--blue); color: #fff; }
.tc { margin-top: 12px; }
.tc-note { margin-top: 4px; line-height: 1.6; }
.tc-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.tc-h span { color: var(--sub); font-size: 12px; }
.tc-h span b { color: var(--ink); font-size: 14px; }
.tc svg { display: block; width: 100%; height: auto; margin-top: 2px; }
.tc .t-ax { font-size: 12px; fill: var(--ink-55); }
.tc .t-me { font-size: 11px; fill: var(--ink-55); font-weight: 700; }
.tc-key { font-size: 11px; color: var(--sub); }
.tc-key i, .legend .me-key, .legend .avg-key { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin: 0 4px 0 10px; border-radius: 2px; }
.tc-key i:first-child { margin-left: 0; }
.legend .me-key { width: 0; height: 12px; border-left: 1px dashed var(--ink-55); border-radius: 0; }
.legend .avg-key { width: 14px; height: 0; border-top: 1px dashed var(--ink); border-radius: 0; vertical-align: 3px; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-l { font-size: 13px; margin-bottom: 3px; }
.hbar.base .hbar-l { font-weight: 700; }
.hbar-t { position: relative; height: 14px; background: var(--ink-04); border-radius: 2px; }
.hbar-b { height: 100%; background: var(--blue); border-radius: 2px; }
.hbar.base .hbar-b { background: var(--ink-55); }
.hbar-b.hi { background: var(--yellow); }
.hbar-base { position: absolute; top: -3px; bottom: -3px; border-left: 2px solid var(--ink); }
.hbar-v { font-size: 12px; color: var(--sub); margin-top: 2px; }
.hbar-v b { color: var(--ink); font-size: 14px; }

/* 下部タブ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: #fff; border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; height: 56px; border: none; border-top: 3px solid transparent; background: none;
  font-size: 14px; font-weight: 700; color: var(--sub); cursor: pointer;
}
.tabbar button.active { color: var(--blue-ink); border-top-color: var(--blue); }

/* 保存状態 */
.status {
  position: fixed; left: 50%; bottom: 68px; transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
  padding: 6px 14px; border-radius: var(--radius); opacity: 0; transition: opacity .2s; pointer-events: none;
}
.status.show { opacity: .94; }
.status.error { background: var(--yellow); color: var(--ink); pointer-events: auto; }

/* 通院レポート */
.topbar h2 + .today-btn { margin-left: auto; }
.report { background: #fff; border: 1px solid var(--head); border-radius: var(--radius); padding: 16px; margin-top: 10px; font-size: 13px; line-height: 1.55; }
.r-head { border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.r-title { font-size: 20px; font-weight: 700; letter-spacing: .02em; }
.r-meta { font-size: 12px; font-weight: 700; color: var(--sub); }
.report h4 { font-size: 14px; font-weight: 700; margin: 14px 0 6px; display: flex; align-items: center; gap: 8px; }
.report h4 .n {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px;
}
.r-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.r-sub { font-size: 11px; font-weight: 700; color: var(--sub); }
.rtable { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.45; }
.rtable th { background: var(--ink-04); font-weight: 700; text-align: center; padding: 3px 5px; border-bottom: 1px solid var(--border); }
.rtable td { padding: 3px 5px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; font-variant-numeric: tabular-nums; }
.rtable td:first-child { text-align: left; white-space: nowrap; font-weight: 700; }
.rtable td:not(:first-child) { text-align: center; }
.rtable th, .rtable td { border-right: 1px solid var(--line); }
.rtable th:last-child, .rtable td:last-child { border-right: none; }
.rtable small { color: var(--sub); font-size: 10px; font-weight: 500; }
.rtable.small td, .rtable.small th { font-size: 11px; padding: 2px 5px; }
.rchart { display: flex; align-items: flex-end; gap: 2px; height: 96px; }
.rchart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.rchart .bar { width: 100%; max-width: 18px; display: flex; flex-direction: column-reverse; }
/* レポートは白黒印刷する前提なので、色は使わず黒と灰色だけ（本人の指定） */
.rchart .seg-a { background: var(--ink); }
.rchart .seg-b { background: rgba(32,33,36,.3); border-bottom: 1px solid #fff; } /* 頓服は薄いグレー（2026-11-20、本人の指定。前は ink 55%） */ /* 予防と頓服の境目に白い線 */
.key-a { color: var(--ink); }
.key-b { color: rgba(32,33,36,.3); }
.rchart .v { font-size: 10px; font-weight: 700; line-height: 1.1; }
.rchart .m { font-size: 9px; color: var(--sub); }
.r-note { font-size: 11px; color: var(--sub); margin-top: 3px; }
.r-note b { color: var(--ink); }
.r-comment {
  white-space: pre-wrap; font-size: 12.5px; line-height: 1.7;
}
.r-foot { font-size: 10px; color: var(--sub); border-top: 1px solid var(--line); margin-top: 12px; padding-top: 6px; }
/* 眼圧 */
.eye-row { display: flex; gap: 16px; flex-wrap: wrap; }
.num-field { display: flex; align-items: center; gap: 6px; }
.num-label { font-weight: 700; }
.num-input { width: 5.5em; height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--fill); font-size: 16px; text-align: right; }
.num-unit { font-size: 13px; color: var(--sub); }

/* カウンセリング用レポート */
.report-switch { margin: 8px 0 4px; display: flex; }
.c-days td:not(:first-child) { white-space: nowrap; }
.c-days td:first-child { font-weight: 500; } /* 日付は太字にしない（本人の指定） */
.c-days td.c-left { text-align: left; white-space: normal; min-width: 8em; }
.c-days tr.c-empty td { color: var(--sub); }
.c-counts .rtable { margin-bottom: 8px; }
.c-counts .rtable td:first-child { white-space: normal; }
/* 3（症状）を少し細くして、3と4の間をあける */
.r-two.sym-cycle { grid-template-columns: 0.8fr 1fr; column-gap: 32px; }
@media (max-width: 520px) { .r-two, .r-two.sym-cycle { grid-template-columns: 1fr; } }

@media print {
  @page { size: A4; margin: 12mm; }
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html, body { background: #fff; }
  .no-print, .tabbar, .status, .sync-bar, .view:not(#view-report) { display: none !important; }
  #view-report { display: block !important; }
  #app { max-width: none; padding: 0; }
  .report { border: none; padding: 0; margin: 0; font-size: 11.5px; }
  .report h4 { margin: 8px 0 3px; }
  .rtable th, .rtable td { padding: 2px 4px; }
  .r-comment { font-size: 11.5px; line-height: 1.55; }
  .r-foot { margin-top: 8px; }
  .r-two { grid-template-columns: 1fr 1fr; }
  .r-two.sym-cycle { grid-template-columns: 0.8fr 1fr; }
}

/* ===== オフライン版で追加 ===== */
/* 送信状態の帯（未送信・オフライン・ログイン切れ） */
/* 送信状態のバーは画面の下に重ねて出す。ページの中に置くと、入力のたびに出たり消えたりして下の内容が上下に跳ねる（iPhone の Safari はずれを補正しない） */
.sync-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 15;
  max-width: 696px; margin: 0 auto; box-shadow: 0 1px 4px rgba(0,0,0,.12);
  font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: var(--radius); display: flex; align-items: center; gap: 8px;
}
.sync-bar.pending { background: var(--blue-10); color: var(--blue-ink); }
.sync-bar.offline { background: var(--ink-04); color: var(--ink); }
.sync-bar.auth, .sync-bar.error { background: var(--yellow-20); color: var(--ink); cursor: pointer; }
.sync-bar .act { margin-left: auto; text-decoration: underline; cursor: pointer; }
/* 端末どうしで文章がぶつかったとき */
.conflict { margin-top: 8px; border: 1px solid var(--yellow); background: var(--yellow-12); border-radius: var(--radius); padding: 8px 10px; font-size: 13px; }
.conflict .c-title { font-weight: 700; margin-bottom: 6px; }
.conflict .c-text { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; margin: 4px 0 6px; }
.conflict .c-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.conflict button { font-size: 12px; font-weight: 700; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; cursor: pointer; }
.cached-note { font-size: 12px; color: var(--sub); margin: 8px 0; }

/* 頭痛薬の日の一覧表（周期ごと・月ごと）：アプリと同じ白地・細い線・青の点。今の周期／今月の列は薄い青、今日は青い枠 */
.hmap { border-collapse: separate; border-spacing: 0; font-size: 11px; font-variant-numeric: tabular-nums; }
.hmap th, .hmap td { width: 38px; min-width: 38px; height: 22px; padding: 0; text-align: center; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.hmap thead th { height: auto; padding: 4px 0 6px; border-bottom: 2px solid var(--ink); vertical-align: bottom; line-height: 1.2; }
.hmap thead th b { display: block; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.hmap thead th small { display: block; font-size: 9px; font-weight: 500; color: var(--sub); min-height: 11px; }
.hmap .rn { position: sticky; left: 0; z-index: 1; background: #fff; color: var(--sub); font-weight: 700; width: 26px; min-width: 26px; border-right: 1px solid var(--line); }
.hmap tr.b5 td, .hmap tr.b5 th { border-bottom: 1px solid var(--ink-20); }
.hmap td.off { background: var(--ink-08); }
.hmap .now { background: var(--blue-10); }
.hmap thead th.now { color: var(--blue-ink); }
.hmap thead th.now small { color: var(--blue-ink); }
.hmap td.today { box-shadow: inset 0 0 0 2px var(--blue); }
.hmap .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); vertical-align: middle; }
.hmap tfoot td, .hmap tfoot th { border-top: 2px solid var(--ink); border-bottom: none; height: 24px; font-weight: 700; color: var(--ink); }
.hmap tfoot td { color: var(--blue-ink); } /* 回数は青（本人の指定） */
.hmap tfoot td.zero { color: var(--ink-20); font-weight: 500; } /* 0回は薄い灰色 */
.key-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); margin: 0 2px; vertical-align: -1px; }
/* 右に続きがあることを見せるグラデーション（2026-11-20、本人の指定） */
.hmap-box { position: relative; }
.hmap-box::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 48px; pointer-events: none;
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(32,33,36,.18)); transition: opacity .2s; }
.hmap-box.at-end::after { opacity: 0; }

/* 通院レポートの総評：箇条書き。2行目以降は「・」の後ろにそろえる（2026-11-20、本人の指定） */
.r-comment.r-list { white-space: normal; }
.r-li { padding-left: 1em; text-indent: -1em; }

/* ガジュマル：前回の水やり・葉水（背景なしの箇条書き） */
.care-last { font-size: 13px; margin: 2px 0 8px; line-height: 1.7; }

/* 記録画面の上の箱：スマホの幅では下の行を1行に収める（頭痛の確率 12% が折り返すため） */
@media (max-width: 400px) { .nurtec-mini .sub { font-size: 11px; white-space: nowrap; } }

/* ===== デモ版だけ（demo/demo.css。build.js が style.css の末尾に足す） ===== */
.demo-bar { background: var(--yellow-12, #fffbd6); color: #202124; font-size: 12px; text-align: center; padding: 6px 12px; line-height: 1.5; }
.nav:disabled, .today-btn:disabled { opacity: .35; cursor: default; }
.date-label input[type="date"]:disabled { pointer-events: none; }
@media print { .demo-bar { display: none; } }
