:root { --navy:#0C3F66; --blue:#1f5f8b; --bg:#f4f6f8; --line:#d5dbe1; --ink:#1c2630; --sub:#5b6875; --on:#d9480f; --on-bg:#fff4e6; --ok:#2b8a3e; --warn:#e67700; }
* { box-sizing: border-box; }
html, body { margin:0; padding:0; background:var(--bg); color:var(--ink); font-family:"BIZ UDPGothic","Hiragino Sans","Yu Gothic UI","Meiryo",sans-serif; font-size:18px; -webkit-text-size-adjust:100%; }
button, select { font:inherit; color:inherit; }
button { cursor:pointer; touch-action:manipulation; }
[hidden] { display:none !important; }
.sr { position:absolute; left:-9999px; }
.topbar { position:sticky; top:0; z-index:5; display:flex; align-items:center; justify-content:space-between; gap:8px; background:var(--navy); color:#fff; padding:10px 14px; padding-top:calc(10px + env(safe-area-inset-top)); }
.brand { font-size:22px; font-weight:700; }
.brand-sub { font-size:14px; font-weight:400; margin-left:8px; opacity:.85; }
.topbar-right { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.pill { border:0; border-radius:999px; padding:4px 12px; font-size:14px; background:#e6f4ea; color:#1b5e20; }
.pill.off { background:#ffe3e3; color:#a61e1e; }
.pill.warn { background:#fff3bf; color:#7a4b00; font-weight:700; }
.top-btn { background:transparent; color:#fff; border:1px solid rgba(255,255,255,.6); border-radius:8px; padding:6px 12px; font-size:15px; }
.banner { background:#fff3bf; color:#5c3c00; padding:10px 14px; font-size:16px; border-bottom:1px solid #f0d48a; }
.banner a { color:#0b4f8a; font-weight:700; }
.view { max-width:900px; margin:0 auto; padding:12px 12px 80px; }
.weekbar { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.week-label { flex:1; text-align:center; font-size:18px; font-weight:700; }
.nav-btn, .today-btn { background:#fff; border:1px solid var(--line); border-radius:10px; min-height:48px; min-width:52px; padding:0 14px; }
.tabs { display:grid; grid-template-columns:repeat(5,1fr); gap:6px; margin-bottom:10px; }
.tabs button { background:#fff; border:2px solid var(--line); border-radius:12px; min-height:64px; padding:4px; line-height:1.2; }
.tabs button .wd { display:block; font-size:24px; font-weight:700; }
.tabs button .dt { display:block; font-size:14px; color:var(--sub); }
.tabs button.today .dt::after { content:"（今日）"; }
.tabs button.sel { background:var(--navy); border-color:var(--navy); color:#fff; }
.tabs button.sel .dt { color:#dbe7f1; }
.tabs button.future { opacity:.55; }
.seg { display:grid; grid-template-columns:1fr 1fr; gap:0; margin-bottom:10px; border:2px solid var(--navy); border-radius:12px; overflow:hidden; }
.seg button { background:#fff; border:0; min-height:56px; font-size:22px; font-weight:700; color:var(--navy); }
.seg button.sel { background:var(--navy); color:#fff; }
.summary { font-size:18px; margin:6px 2px 10px; }
.summary b { font-size:24px; color:var(--on); }
.notice { background:#e7f0f7; border:1px solid #b6cde0; border-radius:10px; padding:10px 12px; margin-bottom:10px; font-size:16px; }
.list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.row { display:flex; align-items:stretch; gap:8px; }
.row-main { flex:1; display:flex; align-items:center; gap:14px; background:#fff; border:2px solid var(--line); border-radius:14px; min-height:72px; padding:8px 14px; text-align:left; }
.row-main.on { background:var(--on-bg); border-color:var(--on); }
.row-main:disabled { opacity:.7; cursor:default; }
.maru { flex:none; width:48px; height:48px; border-radius:50%; border:3px dashed #b8c2cc; display:flex; align-items:center; justify-content:center; font-size:30px; color:transparent; }
.on .maru { border:5px solid var(--on); }
.who { flex:1; min-width:0; }
.who .nm { font-size:24px; font-weight:700; }
.who .kn { font-size:13px; color:var(--sub); }
.tags { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; align-items:center; }
.tag { font-size:14px; border-radius:6px; padding:2px 8px; background:#eef1f4; color:#33404d; white-space:nowrap; }
.tag.extra { background:#e5dbff; color:#4a2ea5; font-weight:700; }
.tag.unset { background:#fff3bf; color:#7a4b00; }
.state { font-size:15px; color:var(--sub); white-space:nowrap; min-width:4.5em; text-align:right; }
.on .state { color:var(--on); font-weight:700; }
.row-del { flex:none; background:#fff; border:1px solid var(--line); border-radius:12px; padding:0 12px; font-size:15px; color:#a61e1e; }
.empty { text-align:center; color:var(--sub); padding:24px 0; }
.addbox { margin-top:22px; background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px; }
.addbox h2 { font-size:18px; margin:0 0 4px; }
.hint { font-size:14px; color:var(--sub); margin:0 0 10px; }
.gyou { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.gyou button { background:#fff; border:1px solid var(--line); border-radius:10px; min-width:52px; min-height:48px; font-size:20px; }
.gyou button.sel { background:var(--blue); border-color:var(--blue); color:#fff; }
.addrow { display:flex; gap:8px; }
.addrow select { flex:1; min-height:56px; font-size:20px; border:2px solid var(--line); border-radius:10px; padding:0 10px; background:#fff; min-width:0; }
.primary { background:var(--blue); color:#fff; border:0; border-radius:10px; min-height:56px; padding:0 22px; font-size:20px; font-weight:700; }
.primary:disabled { background:#9fb3c4; }
.table-wrap { overflow-x:auto; background:#fff; border:1px solid var(--line); border-radius:12px; }
.mtable { border-collapse:collapse; width:100%; font-size:16px; }
.mtable th, .mtable td { border-bottom:1px solid var(--line); padding:8px 10px; text-align:left; white-space:nowrap; }
.mtable th { background:#eef1f4; position:sticky; top:0; }
.mtable td.num { text-align:right; }
.mtable td.days { white-space:normal; color:var(--sub); }
.toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); background:#1c2630; color:#fff; padding:12px 18px; border-radius:12px; font-size:16px; max-width:90vw; z-index:10; }
@media (max-width:560px) { .who .nm { font-size:20px; } .state { display:none; } .brand-sub { display:none; } }

/* 日付の表示（いつの記録かが重要なので、大きく・常に見える位置に出す） */
.datebar { position:sticky; top:52px; z-index:4; background:#e6f4ea; border:2px solid var(--ok); border-radius:14px; padding:10px 14px; margin-bottom:10px; }
.datebar.past { background:#fff0e0; border-color:var(--warn); }
.datebar.future { background:#eef1f4; border-color:#9aa6b2; }
.date-line { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.date-big { font-size:34px; font-weight:700; line-height:1.2; }
.date-chip { font-size:18px; font-weight:700; border-radius:999px; padding:4px 16px; background:var(--ok); color:#fff; white-space:nowrap; }
.past .date-chip { background:var(--warn); }
.future .date-chip { background:#6b7785; }
.date-warn { font-size:17px; font-weight:700; color:#8a4500; margin-top:4px; }
.matsu { font-size:18px; font-weight:700; color:#fff; background:#c62828; border-radius:8px; padding:8px 12px; margin-top:6px; line-height:1.5; }
.matsu.sugi { background:#7a1010; }
.datebar .summary { margin:4px 0 0; }
/* 月の一覧（誰が・いつ・何回） */
.mtable th, .mtable td { text-align:center; padding:6px 6px; border-right:1px solid #eef1f4; }
.mtable th.nm, .mtable td.nm { text-align:left; position:sticky; left:0; background:#fff; z-index:1; min-width:9em; border-right:2px solid var(--line); }
.mtable th.nm { background:#eef1f4; z-index:2; }
.mtable th .w { display:block; font-size:12px; font-weight:400; color:var(--sub); }
.mtable td.maru-c { color:var(--on); font-weight:700; font-size:18px; }
.mtable td.maru-c.ex { color:#6741d9; }
.mtable .today-col { background:#e6f4ea; }
.mtable .wk { border-left:2px solid var(--line); }
.mtable tr.total td { background:#f4f6f8; font-weight:700; position:sticky; bottom:0; }
.mtable tr.total td.nm { background:#f4f6f8; }
.mtable td.cnt { font-weight:700; }
@media (max-width:560px) { .date-big { font-size:26px; } }
