/* 換気どき：見た目係
   見た目は全アプリ共通の「あいだ」（案内の アプリの決まり.md 7章、見本帳の C）。
   白に近い地・黒に近い文字・細い線・差し色は朱色1色だけ（意味のあるところだけ）。影・ぼかし・グラデーション・絵文字は使わない。
   文字：日本語はヒラギノ角ゴ、英語・数字は Futura。明朝体と丸ゴシックは使わない。
   並び：タイトル → まとめ → 外 → グラフ → 部屋 → 家の前 → 記録 → 控えなど */
:root {
  --bg: #fafaf8;          /* 地 */
  --ink: #141414;         /* 文字 */
  --muted: #777774;       /* 補足 */
  --faint: #a9a9a4;       /* さらに薄い補足 */
  --line: #e3e3df;        /* 区切りの細い線 */
  --field: #f1f1ee;       /* 入力欄の地 */
  --accent: #ff3b14;      /* 朱色（開けどき・大事・押せる） */
  --on-accent: #ffffff;
  /* グラフの線：外（予報）と家の前は朱。部屋は黒〜灰の濃さに加えて、線の種類（実線・破線・点線）と点の形で分ける */
  --s1: #ff3b14;
  --s2: #5e5e5a;   /* キッチン：破線・○ */
  --s3: #141414;   /* リビング：実線・● */
  --s4: #8c8c87;   /* 防音室：点線・■ */
  --s5: #ff3b14;
  --s6: #5c5c58;
  --num: Futura, "Futura PT", "Hiragino Sans", -apple-system, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --ink: #eeeeea;
    --muted: #9c9c97;
    --faint: #6f6f6b;
    --line: #2c2c2a;
    --field: #1c1c1b;
    --accent: #ff5a36;
    --on-accent: #ffffff;
    --s1: #ff5a36;
    --s2: #b9b9b4;
    --s3: #f2f2ee;
    --s4: #8e8e89;
    --s5: #ff5a36;
    --s6: #c4c4bf;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.7 var(--font);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
main { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding-block: 24px; }
main > *, .card > * { min-width: 0; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* タイトル：KAN K I（1文字だけ朱）、日本語の名前、朱の短い線 */
.top { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 8px; padding-bottom: 18px; }
.title { margin: 0; font-family: var(--num); font-weight: 500; font-size: 30px; letter-spacing: .3em; line-height: 1; }
.title b { color: var(--accent); font-weight: 500; }
.title-ja { margin: 6px 0 0; font-size: 11px; letter-spacing: .3em; color: var(--muted); font-weight: 400; }
.title-line { width: 40px; height: 2px; background: var(--accent); margin-top: 14px; }
.top small { color: var(--muted); font-size: 12px; font-family: var(--num); letter-spacing: .06em; padding-top: 6px; }

/* まとめ：飾らず、文字だけ */
.summary { margin: 0 0 8px; font-size: 14px; font-weight: 600; line-height: 1.7; }

/* 区切りは細い線。カードで包まない */
.card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-block: 18px; border-top: 1px solid var(--line); }
h2 { font-size: 11px; margin: 0; color: var(--muted); font-weight: 400; letter-spacing: .3em; }

/* 外 */
.out-grid { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 18px; }
.stat { display: flex; align-items: baseline; gap: 6px; }
.stat b { font-size: 18px; font-weight: 400; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.ah { order: -1; width: 100%; }
.stat.ah b { font-size: 44px; line-height: 1; }
.wx { font-size: 13px; color: var(--muted); }
.wx b { color: var(--ink); font-weight: 600; }
.hours { display: flex; gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hour { flex: 0 0 auto; min-width: 54px; text-align: center; padding: 6px 4px; font-size: 11px; color: var(--muted); border-right: 1px solid var(--line); }
.hour:last-child { border-right: 0; }
.hour b { display: block; font-size: 15px; font-weight: 400; color: var(--ink); }
.hour.wet .p { color: var(--accent); font-weight: 600; }
.err { color: var(--accent); font-size: 14px; }

/* 部屋 */
.room-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.room-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.pill { font-size: 14px; white-space: nowrap; font-weight: 600; }
.v-open { color: var(--accent); }          /* 開けた方がいい（開けどき） */
.v-no { color: var(--accent); }            /* 防音室の「除湿機をつけて」など大事なとき */
.v-warn { color: var(--accent); font-weight: 400; }
.v-either { color: var(--muted); font-weight: 400; }
.v-none { color: var(--faint); font-weight: 400; }
.reason { margin: 0; font-size: 14px; }
.when { margin: 0; font-size: 14px; font-weight: 600; }
.notes { margin: 0; padding-left: 1.1em; font-size: 13px; color: var(--muted); }
.bars { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.bar { display: grid; grid-template-columns: 4.6em 1fr 5.4em; align-items: center; gap: 10px; }
.track { height: 2px; background: var(--line); overflow: hidden; }
.fill { height: 100%; background: var(--ink); }
.fill.out { background: var(--faint); }
.bar .num { text-align: right; color: var(--ink); }
.inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); min-width: 0; }
.field { display: flex; align-items: center; border-bottom: 1px solid var(--line); background: transparent; padding: 0 2px; }
.field input { flex: 1; width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 400 24px/1 var(--num); padding: 8px 0; font-variant-numeric: tabular-nums; outline: none; }
.field:focus-within { border-bottom-color: var(--accent); }
.field i { font-style: normal; color: var(--muted); font-size: 14px; }
.prev { font-size: 12px; color: var(--muted); padding-top: 14px; }

/* ボタン：押せるものは朱 */
button { font: inherit; cursor: pointer; }
.primary { width: 100%; border: 0; border-radius: 4px; background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 600; letter-spacing: .1em; padding: 14px; margin-top: 12px; }
.primary:focus-visible, .ghost:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ghost { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 4px; padding: 9px 14px; font-size: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.toast { text-align: center; font-size: 13px; min-height: 1.4em; margin: 8px 0 0; }
.remind { font-size: 13px; color: var(--ink); border-left: 2px solid var(--accent); padding: 2px 0 2px 10px; margin: 8px 0 0; }
details { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; letter-spacing: .1em; }
details .card { margin-top: 12px; }
.rename { display: grid; gap: 8px; }
.rename input { font: inherit; padding: 8px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 0; }
.rename input:focus { outline: none; border-bottom-color: var(--accent); }
.help { font-size: 12px; color: var(--muted); margin: 0; }

/* 切り替え：選んでいるものは黒い文字＋朱の下線 */
.g-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.seg { display: inline-flex; gap: 14px; }
.seg button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 4px 0; font-size: 13px; }
.seg button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.seg.wide { display: flex; gap: 0; border-bottom: 1px solid var(--line); }
.seg.wide button { flex: 1; padding: 8px 0; margin-bottom: -1px; }
.seg button:focus-visible, .chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
main > .seg.wide { margin-top: 4px; }

/* グラフ */
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--ink); padding: 2px 0; font-size: 12px; }
.chip svg { display: block; }
.chip.off { color: var(--faint); }
.chip.off svg { opacity: .25; }
.chart { width: 100%; min-height: 210px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .c-grid { stroke: var(--line); stroke-width: 1; }
.chart .c-axis { fill: var(--muted); font-size: 11px; font-family: var(--num); font-variant-numeric: tabular-nums; }
.chart .c-muted { fill: var(--muted); font-size: 13px; font-family: var(--font); }
.chart .c-now { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .c-guide { stroke: var(--ink); stroke-width: 1; opacity: .4; }
.chart .c-ref { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 5 4; opacity: .7; }
.chart .c-reflabel { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .c-ring { stroke: var(--bg); stroke-width: 2; }
.chart .c-endlabel { fill: var(--muted); font-size: 10px; font-family: var(--font); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.readout { margin: 0; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 12px; min-height: 1.6em; font-variant-numeric: tabular-nums; }
.readout b { color: var(--ink); font-weight: 600; }
.readout i { display: inline-block; width: 10px; height: 2px; margin-right: 5px; vertical-align: middle; }
@media (prefers-reduced-motion: no-preference) { .fill { transition: width .3s ease; } }
