/* おうちパネル — スマートホーム管理（ui: iOS / Liquid Glass）
   ガラスは機能層（タブバー・縮んだナビバー・シート・バナー・丸ボタン）だけ。中身は白い面と写真 */
:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --fill: #f2f5f9;
  --ink: #0d1626;
  --ink-2: #4b5a6e;
  --ink-3: #5c6a7e;
  --blue: #0a66e8;
  --blue-ink: #0a58c9;
  --blue-soft: #e3eefd;
  --warm: #f2701d;
  --warm-ink: #b4500e;
  --cool: #2a8cf0;
  --green: #0f7353;
  --red: #c0302f;
  --hair: rgba(13, 22, 38, .1);
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(250, 252, 255, .78);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-shadow: 0 10px 34px rgba(18, 38, 74, .18), 0 1px 0 rgba(255, 255, 255, .9) inset, 0 -1px 0 rgba(13, 22, 38, .04) inset;
  --blur: blur(22px) saturate(185%);

  --ff: "M PLUS 2", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --ff-num: "Sora", "M PLUS 2", system-ui, sans-serif;

  --r-card: 24px;
  --r-ctl: 14px;
  --r-sheet: 34px;
  --sh-card: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --spring: cubic-bezier(.32, 1.42, .55, 1);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --t-push: 420ms;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --bar-h: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: #dde4ee;
  color: var(--ink);
  font-family: var(--ff);
  font-size: 15px;
  line-height: 1.65;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
p, h1, h2, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
[hidden] { display: none !important; }
.num { font-family: var(--ff-num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.nw { white-space: nowrap; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid rgba(10, 102, 232, .45); outline-offset: 2px; }

.app {
  position: relative;
  height: 100vh; height: 100dvh;
  max-width: 430px; margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}
@media (min-width: 600px) {
  body { background: radial-gradient(1200px 600px at 50% -10%, #f7faff, #d3dce8); }
  .app { box-shadow: 0 30px 80px rgba(18, 38, 74, .22); }
}
.stage { position: absolute; inset: 0; }
.boot-fallback { padding: 45% 28px 0; text-align: center; }
.boot-fallback p:first-child { font-size: 26px; font-weight: 800; }

.scr { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  padding: calc(var(--bar-h) + var(--safe-t)) 0 calc(112px + var(--safe-b));
}
.scr--room .scroll, .scr--rule .scroll, .scr--settings .scroll, .scr--about .scroll { padding-bottom: calc(40px + var(--safe-b)); }
.scr--room .scroll { padding-top: 0; }

/* 遷移：プッシュは右から、背面は 30% だけ左へ（iOS） */
.in-push { animation: pIn var(--t-push) var(--ease) both; z-index: 3; box-shadow: -10px 0 40px rgba(18, 38, 74, .16); }
.out-push { animation: pOut var(--t-push) var(--ease) both; }
.in-pop { animation: bIn var(--t-push) var(--ease) both; }
.out-pop { animation: bOut var(--t-push) var(--ease) both; z-index: 3; box-shadow: -10px 0 40px rgba(18, 38, 74, .16); }
.in-fade { animation: fIn .24s ease both; z-index: 3; }
.out-fade { animation: fOut .24s ease both; }
@keyframes pIn { from { transform: translateX(100%); } }
@keyframes pOut { to { transform: translateX(-30%); filter: brightness(.92); } }
@keyframes bIn { from { transform: translateX(-30%); filter: brightness(.92); } }
@keyframes bOut { to { transform: translateX(100%); } }
@keyframes fIn { from { opacity: 0; transform: scale(.985); } }
@keyframes fOut { to { opacity: 0; } }

/* ---------- ナビゲーションバー（縮んだ状態はガラス） ---------- */
.cbar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 10;
  display: grid; grid-template-columns: minmax(88px, 1fr) auto minmax(88px, 1fr); align-items: center;
  height: calc(var(--bar-h) + var(--safe-t)); padding: var(--safe-t) 8px 0;
  transition: background-color .25s, box-shadow .25s, backdrop-filter .25s;
}
.cbar.is-on { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 1px 0 var(--hair); }
.cbar__t { font-weight: 700; font-size: 17px; text-align: center; white-space: nowrap; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .25s var(--ease); }
.cbar.is-on .cbar__t { opacity: 1; transform: none; }
.cbar__sp { display: block; }
.cbar__back {
  justify-self: start; display: inline-flex; align-items: center; gap: 2px;
  min-height: 44px; padding: 0 14px 0 6px; border-radius: 999px;
  color: var(--blue-ink); font-weight: 500; font-size: 16px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow);
  transition: transform .15s var(--spring);
}
.cbar__back:active { transform: scale(.94); }
.cbar__back .ic { width: 24px; height: 24px; stroke-width: 2.4; }
.cbar__save { justify-self: end; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 700; box-shadow: 0 6px 16px rgba(10, 102, 232, .3); transition: transform .15s var(--spring); }
.cbar__save:active { transform: scale(.94); }
.scr--rule .cbar { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 1px 0 var(--hair); }
.scr--rule .cbar__t { opacity: 1; transform: none; }

.large { padding: 6px 20px 14px; }
.large__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.large__t { font-size: 34px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; font-feature-settings: "palt"; word-break: keep-all; }
.large__sub { margin-top: 2px; font-size: 15px; color: var(--ink-2); }
.large--room { padding-top: 16px; }

.glassbtn {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--ink);
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow);
  transition: transform .18s var(--spring);
}
.glassbtn:active { transform: scale(.9); }
.glassbtn--lg { width: 46px; height: 46px; color: var(--blue-ink); }
.glassbtn--lg .ic { width: 24px; height: 24px; stroke-width: 2.1; }

/* ---------- 部品 ---------- */
.card { position: relative; display: block; margin: 0 16px 14px; padding: 16px; background: var(--card); border-radius: var(--r-card); box-shadow: var(--sh-card); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 32px; }
.card__t { font-size: 17px; font-weight: 800; word-break: keep-all; }
.card__hint { margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.sec { padding: 12px 22px 8px; font-size: 20px; font-weight: 800; word-break: keep-all; }
.lbl { margin: 14px 2px 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 999px;
  font-weight: 700; font-size: 16px; word-break: keep-all; text-align: center;
  transition: transform .16s var(--spring), filter .15s;
}
.btn:active { transform: scale(.96); }
.btn .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.btn--blue { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(10, 102, 232, .28); }
.btn--tint { background: var(--blue-soft); color: var(--blue-ink); }
.btn--danger { background: #fdeceb; color: var(--red); }
.btn--wide { display: flex; margin: 18px 16px 0; }
.btn:disabled { background: #dfe5ee; color: #4b5a6e; box-shadow: none; }

.seg { position: relative; display: flex; padding: 3px; border-radius: 13px; background: rgba(118, 128, 148, .14); }
.seg__pill { position: absolute; left: 3px; top: 3px; bottom: 3px; width: 0; border-radius: 10px; background: #fff; box-shadow: 0 3px 8px rgba(13, 22, 38, .12), 0 1px 1px rgba(13, 22, 38, .06); transition: transform .38s var(--spring), width .3s var(--ease); }
.seg__b { position: relative; flex: 1; min-height: 40px; padding: 0 8px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: color .2s; }
.seg__b[aria-checked="true"] { color: var(--ink); font-weight: 700; }
.card__head .seg { flex: none; }
.card__head .seg__b { min-height: 34px; padding: 0 12px; }

.sw { position: relative; flex: none; width: 52px; height: 32px; border-radius: 999px; background: #d4dbe5; transition: background-color .25s; }
.sw::before { content: ""; position: absolute; inset: -6px -2px; }
.sw i { position: absolute; left: 2px; top: 2px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(13, 22, 38, .2); transition: transform .32s var(--spring), width .2s; }
.sw:active i { width: 33px; }
.sw[aria-checked="true"] { background: var(--blue); }
.sw[aria-checked="true"] i { transform: translateX(20px); }
.sw[aria-checked="true"]:active i { transform: translateX(15px); }

.step { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: var(--fill); }
.step__b { width: 44px; height: 40px; display: grid; place-items: center; border-radius: 999px; color: var(--blue-ink); transition: transform .14s var(--spring), background-color .15s; }
.step__b:active { transform: scale(.88); background: #fff; }
.step__b .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.step__v { min-width: 64px; text-align: center; font-family: var(--ff-num); font-weight: 600; font-size: 16px; }

/* ---------- ホーム ---------- */
.hero { position: relative; margin: 0 16px 14px; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--sh-card); background: #c9d6e6; }
.hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero__cap { position: absolute; left: 12px; bottom: 12px; }
.hero__chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 6px 16px rgba(13, 22, 38, .16); white-space: nowrap; }
.hero__sep { color: var(--ink-3); font-weight: 400; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa6b6; }
.dot.is-home { background: var(--green); box-shadow: 0 0 0 4px rgba(18, 128, 92, .16); }

.plan-box { margin: 0 -4px; }
.plan { width: 100%; height: auto; display: block; overflow: visible; }
.plan__room { cursor: pointer; outline: none; }
.plan__fill { transition: fill .6s ease; }
.plan__room:active .plan__fill, .plan__room:focus-visible .plan__fill { filter: brightness(.94); }
.plan__name { font-size: 12px; font-weight: 700; fill: var(--ink); }
.plan__val { font-family: var(--ff-num); font-size: 18px; font-weight: 700; fill: var(--ink); }
.plan__sub { font-size: 12px; fill: var(--ink-2); }
.plan__wall { fill: none; stroke: var(--ink); stroke-width: 4; }
.plan__inner { fill: none; stroke: var(--ink); stroke-width: 2.4; }
.plan__door { stroke: #fff; stroke-width: 5; }
.plan__win { stroke: #8fc0fb; stroke-width: 5; stroke-linecap: butt; }
.plan__glow { pointer-events: none; animation: glow 3s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .7; } }
.plan__air { fill: none; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 4 4; animation: air 1s linear infinite; }
.plan__air--2 { opacity: .55; }
@keyframes air { to { stroke-dashoffset: -16; } }
.plan__lock circle { fill: var(--green); stroke: #fff; stroke-width: 2.5; }
.plan__lock.is-open circle { fill: var(--red); }
.plan__lock path { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.plan__who { stroke: #fff; stroke-width: 2.5; }
.legend { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.legend__bar { flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #5d9cf5, #bcd7fb 30%, #eef4fb 50%, #ffe3c4 63%, #ffb37a 80%, #ff7f45); }
.legend.is-hum .legend__bar { background: linear-gradient(90deg, #ffe0b0, #f6f1e6 25%, #d3e7fd 50%, #8fc0fb 75%, #5d9cf5); }

.lock { display: flex; align-items: center; gap: 16px; }
.lock__btn { position: relative; flex: none; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: #e6f4ee; color: var(--green); transition: transform .2s var(--spring), background-color .2s; touch-action: none; user-select: none; -webkit-user-select: none; }
.lock__btn .ic { width: 30px; height: 30px; stroke-width: 2; }
.lock__btn:not(.is-locked) { background: #fdeceb; color: var(--red); }
.lock__btn.is-holding { transform: scale(.92); }
.lock__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.lock__track { fill: none; stroke: transparent; stroke-width: 4; }
.lock__prog { fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 182.2; stroke-dashoffset: 182.2; }
.lock__tx { flex: 1; min-width: 0; }
.lock__k { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.lock__v { font-size: 22px; font-weight: 800; color: var(--green); line-height: 1.3; }
.lock__v.is-open { color: var(--red); }
.lock__d { font-size: 13px; color: var(--ink-3); }
.lock__bat { display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--ff-num); font-size: 12px; color: var(--ink-2); }
.lock__bat i { width: 22px; height: 11px; border-radius: 3px; border: 1.5px solid var(--ink-2); background: linear-gradient(90deg, var(--green) 82%, transparent 82%) content-box; padding: 1px; }

.scenes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 16px 14px; }
.scene { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px 12px; border-radius: 22px; background: var(--card); box-shadow: var(--sh-card); transition: transform .18s var(--spring); }
.scene:active { transform: scale(.93); }
.scene__ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue-ink); }
.scene__t { font-size: 13px; font-weight: 700; white-space: nowrap; }
.scene.is-pulse .scene__ic { animation: pulse .6s var(--spring); background: var(--blue); color: #fff; }
@keyframes pulse { 30% { transform: scale(1.18); } }

.people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px 14px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border-radius: 22px; background: var(--card); box-shadow: var(--sh-card); }
.person__av { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; font-size: 16px; flex: none; }
.person__n { font-weight: 700; font-size: 14px; }
.person__s { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.person__s.is-home { color: var(--green); font-weight: 700; }

.card--energy { display: flex; align-items: center; gap: 12px; transition: transform .18s var(--spring); }
.card--energy:active { transform: scale(.98); }
.en__l { flex: 1; min-width: 0; }
.en__k { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.en__v .num { font-size: 32px; font-weight: 600; }
.en__v small { margin-left: 3px; font-size: 14px; color: var(--ink-2); }
.en__d { font-size: 13px; color: var(--ink-2); }
.en__r { width: 120px; flex: none; }
.en__chev { color: #8a96a8; }
.line { display: block; width: 100%; height: auto; overflow: visible; }

/* ---------- 部屋 ---------- */
.rooms { display: flex; flex-direction: column; gap: 14px; padding: 0 16px; }
.room { display: block; border-radius: var(--r-card); overflow: hidden; background: var(--card); box-shadow: var(--sh-card); transition: transform .18s var(--spring); }
.room:active { transform: scale(.985); }
.room__ph { position: relative; }
.room__ph img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.room__sw { position: absolute; right: 12px; top: 12px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.room__body { display: flex; align-items: center; gap: 12px; padding: 12px 14px 14px 16px; }
.room__tx { flex: 1; min-width: 0; }
.room__n { font-weight: 800; font-size: 17px; }
.room__v { display: flex; align-items: baseline; gap: 2px; }
.room__v .num { font-size: 26px; font-weight: 600; line-height: 1.2; }
.room__v small { font-size: 14px; color: var(--ink-2); }
.room__h { margin-left: 10px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.room__q { display: flex; gap: 8px; }
.qbtn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--fill); color: var(--ink-2); transition: transform .18s var(--spring), background-color .2s, color .2s; }
.qbtn:active { transform: scale(.88); }
.qbtn.is-on { background: #fff4d6; color: #8a5a00; box-shadow: inset 0 0 0 1.5px #f2c14e; }
.qbtn.is-on .ic { fill: rgba(242, 193, 78, .35); }
.room__q .qbtn + .qbtn.is-on { background: #fff0e6; color: var(--warm-ink); box-shadow: inset 0 0 0 1.5px #ffb37a; }
.room__q .qbtn + .qbtn.is-on.is-cool { background: var(--blue-soft); color: var(--blue-ink); box-shadow: inset 0 0 0 1.5px #8fc0fb; }

.rhead { position: relative; height: calc(280px + var(--safe-t)); overflow: hidden; background: #c9d6e6; }
.rhead img { width: 100%; height: 100%; object-fit: cover; }
.rhead::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, var(--bg)); }
.large--room { margin-top: -22px; position: relative; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px 14px; }
.stat { padding: 12px 14px; border-radius: 20px; background: var(--card); box-shadow: var(--sh-card); }
.stat__k { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.stat__v .num { font-size: 24px; font-weight: 600; }
.stat__v small { font-size: 13px; color: var(--ink-2); margin-left: 2px; }

.pwr { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--fill); color: var(--ink-2); transition: transform .18s var(--spring), background-color .2s; }
.pwr:active { transform: scale(.9); }
.pwr.is-on { background: var(--warm); color: #fff; box-shadow: 0 6px 16px rgba(242, 112, 29, .35); }
.card--ac .pwr .ic { stroke-width: 2.4; }
.dial { position: relative; width: min(280px, 100%); margin: 0 auto; aspect-ratio: 1; }
.dial__svg { width: 100%; height: 100%; touch-action: none; cursor: grab; }
.dial.is-drag .dial__svg { cursor: grabbing; }
.dial__track { fill: none; stroke: #e7ecf3; stroke-width: 18; stroke-linecap: round; }
.dial__val { fill: none; stroke-width: 18; stroke-linecap: round; transition: stroke .3s; }
.dial__ticks line { stroke: #c3ccd8; stroke-width: 1.6; stroke-linecap: round; }
.dial__knob { fill: #fff; stroke: rgba(13, 22, 38, .08); stroke-width: 1; filter: drop-shadow(0 3px 6px rgba(13, 22, 38, .25)); transition: r .2s var(--spring); }
.dial.is-drag .dial__knob { r: 20; }
.dial__cur { fill: var(--ink); stroke: #fff; stroke-width: 2.5; }
.dial__c { position: absolute; inset: 22%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.dial__k { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.dial__tgt { display: flex; align-items: flex-start; line-height: 1; color: var(--warm-ink); }
.dial__tgt .num { font-size: 56px; font-weight: 300; letter-spacing: -.04em; }
.dial__tgt small { margin-top: 8px; font-size: 18px; font-weight: 600; }
.dial.is-cool .dial__tgt { color: var(--blue-ink); }
.dial.is-off .dial__tgt { color: var(--ink-2); }
.dial__st { margin-top: 6px; font-size: 13px; font-weight: 700; }
.dial__eta { font-size: 13px; color: var(--ink-2); }
.dial__btns { display: flex; align-items: center; justify-content: space-between; margin-top: -10px; }
.dial__btns .glassbtn { background: var(--fill); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--blue-ink); }
.dial__btns .glassbtn .ic { stroke-width: 2.4; }
.dial__hint { font-size: 13px; color: var(--ink-3); }

.lrow { display: flex; align-items: center; gap: 12px; }
.lrow__ic { color: var(--ink-3); }
.card--light.is-on .lrow__ic { color: #c99a06; fill: rgba(242, 193, 78, .4); }
.lv { min-width: 46px; text-align: right; font-size: 16px; font-weight: 600; }
.range { --p: 50%; flex: 1; height: 44px; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 30px; border-radius: 15px; background: linear-gradient(90deg, #f2c14e var(--p), #e7ecf3 var(--p)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(13, 22, 38, .28); }
.range::-moz-range-track { height: 30px; border-radius: 15px; background: linear-gradient(90deg, #f2c14e var(--p), #e7ecf3 var(--p)); }
.range::-moz-range-thumb { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(13, 22, 38, .28); }
.card--light:not(.is-on) .range::-webkit-slider-runnable-track { background: linear-gradient(90deg, #c3ccd8 var(--p), #e7ecf3 var(--p)); }

.curt { --o: 1; position: relative; height: 92px; margin-bottom: 12px; border-radius: 14px; overflow: hidden; background: linear-gradient(#bcdcff, #eaf4ff); box-shadow: inset 0 0 0 6px #fff, inset 0 0 0 7px var(--hair); }
.curt i { position: absolute; top: 0; bottom: 0; width: calc(50% - 46% * var(--o)); background: repeating-linear-gradient(90deg, #e9e2d6 0 8px, #d9d0c1 8px 12px); transition: width .6s var(--ease); }
.curt__l { left: 0; }
.curt__r { right: 0; }
.chart { margin: 0 -2px; }
.chart__ax { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; color: var(--ink-3); }

/* ---------- 電力 ---------- */
.livebadge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: #e6f4ee; color: var(--green); font-size: 12px; font-weight: 700; }
.livebadge i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.big { display: flex; align-items: baseline; gap: 4px; line-height: 1.1; }
.big .num { font-size: 48px; font-weight: 300; letter-spacing: -.03em; }
.big small { font-size: 18px; font-weight: 600; color: var(--ink-2); }
.live-chart { margin-top: 8px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-bottom: 14px; }
.kpi:last-child { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--hair); }
.kpi__k { font-size: 12px; font-weight: 700; color: var(--ink-2); word-break: keep-all; }
.kpi__v { display: flex; align-items: baseline; gap: 2px; }
.kpi__v .num { font-size: 28px; font-weight: 600; }
.kpi__v small { font-size: 14px; color: var(--ink-2); }
.kpi__v.is-down .num, .kpi__v.is-down small { color: var(--green); }
.kpi__v.is-up .num, .kpi__v.is-up small { color: var(--warm-ink); }
.month { display: block; width: 100%; height: auto; }
.month__grid { stroke: #edf1f6; stroke-width: 1; }
.month__bar { fill: #8fc0fb; cursor: pointer; transition: fill .2s; }
.month__bar.is-today { fill: url(#mo-stripe); }
.month__bar.is-sel { fill: var(--blue); }
.month__prev { fill: none; stroke: #4b5a6e; stroke-width: 1.6; stroke-dasharray: 3 3; }
.month__ax { font-size: 11px; fill: var(--ink-2); }
.month__tip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin-top: 8px; padding: 10px 12px; border-radius: 14px; background: var(--fill); font-size: 14px; }
.month__tip b { font-size: 20px; font-weight: 600; }
.month__vs { width: 100%; font-size: 13px; color: var(--ink-2); }
.mlegend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.mlegend span { display: inline-flex; align-items: center; gap: 6px; }
.mlegend__bar { width: 10px; height: 12px; border-radius: 3px; background: #8fc0fb; }
.mlegend__line { width: 18px; border-top: 2px dashed #4b5a6e; }
.brk { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: baseline; padding: 6px 0 10px; }
.brk__n { font-size: 14px; font-weight: 500; }
.brk__v { font-family: var(--ff-num); font-size: 14px; color: var(--ink-2); }
.brk__bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.brk__bar i { display: block; height: 100%; border-radius: 4px; }
.foot { margin: 4px 22px 0; font-size: 13px; color: var(--ink-3); }

/* ---------- オートメーション ---------- */
.sim { background: #0f1b33; color: #f3f7ff; box-shadow: 0 14px 34px rgba(15, 27, 51, .28); }
.sim__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sim__k { font-size: 12px; font-weight: 700; color: #b9c8e6; letter-spacing: .04em; }
.sim__clock { font-size: 52px; font-weight: 300; line-height: 1.05; letter-spacing: -.03em; }
.sim__day { font-size: 13px; color: #c9d6ee; }
.sim__play { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 18px 0 14px; border-radius: 999px; background: #fff; color: #0f1b33; font-weight: 800; transition: transform .18s var(--spring); }
.sim__play:active { transform: scale(.93); }
.sim__play .ic { fill: currentColor; stroke: none; }
.sim__play.is-on { background: #ffcf6b; }
.sim__sky { position: relative; height: 26px; margin-top: 14px; border-radius: 13px; background: linear-gradient(90deg, #16233d 0%, #2a3d63 18%, #f7b59a 26%, #9cc8ff 36%, #e3f0ff 55%, #ffb37a 68%, #3a4f80 76%, #16233d 100%); }
.sim__now { position: absolute; top: -5px; bottom: -5px; width: 4px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px #0f1b33, 0 0 12px #fff; transition: left .1s linear; }
.sim__sunset { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #ff8a4c; box-shadow: 0 0 0 2px #0f1b33; }
.sim__axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: #b9c8e6; }
.sim__btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sim__k2 { margin-top: 14px; font-size: 12px; font-weight: 700; color: #b9c8e6; }
.sim__k2 + .sim__btns { margin-top: 6px; }
.chipbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 12px; border-radius: 999px; background: #22314f; color: #f3f7ff; font-size: 14px; font-weight: 700; white-space: nowrap; transition: transform .16s var(--spring), background-color .2s; }
.chipbtn:active { transform: scale(.94); background: #2d3f63; }
.chipbtn .ic { width: 18px; height: 18px; color: #9cc8ff; }
.chipbtn--ev { background: #1b3a6b; }
.chipbtn--ev .ic { color: #ffcf6b; }
.sim__who { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; font-size: 13px; color: #dbe5f7; }
.sim__p { display: inline-flex; align-items: center; gap: 6px; }
.sim__p i { width: 8px; height: 8px; border-radius: 50%; }

.rules { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 14px; }
.rule { position: relative; border-radius: 22px; overflow: hidden; background: transparent; transition: opacity .25s, transform .25s; }
.rule.is-gone { opacity: 0; transform: scale(.96); }
.rule__del { position: absolute; right: 0; top: 0; bottom: 0; width: 120px; padding-left: 24px; border-radius: 0 22px 22px 0; background: var(--red); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff; font-size: 13px; font-weight: 700; }
.rule__face { position: relative; display: block; padding: 14px 16px; background: var(--card); box-shadow: var(--sh-card); transition: transform .32s var(--ease); touch-action: pan-y; }
.rule.is-open .rule__face { transform: translateX(-96px); }
.rule__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.rule__n { font-size: 17px; font-weight: 800; word-break: keep-all; }
.rule.is-off .rule__n, .rule.is-off .rule__line { color: var(--ink-3); }
.rule__line { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-size: 14px; line-height: 1.6; }
.rule__tag { flex: none; display: inline-block; padding: 1px 8px; border-radius: 7px; background: var(--blue-soft); color: var(--blue-ink); font-size: 12px; font-weight: 800; white-space: nowrap; }
.rule__tag--c { background: #fff0e6; color: var(--warm-ink); }
.rule__tag--a { background: #e6f4ee; color: var(--green); }

.log { position: relative; margin: 0 16px; padding: 6px 14px 6px 12px; background: var(--card); border-radius: var(--r-card); box-shadow: var(--sh-card); }
.log__i { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 0; }
.log__i + .log__i { border-top: 1px solid var(--hair); }
.log__t { font-size: 15px; font-weight: 600; color: var(--blue-ink); }
.log__i.is-skip .log__t { color: var(--ink-3); }
.log__r { font-weight: 700; font-size: 14px; }
.log__badge { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--fill); font-size: 11px; color: var(--ink-2); }
.log__d { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.log__i.is-new { animation: newlog .8s ease; }
@keyframes newlog { from { background: var(--blue-soft); } }
.log__empty { padding: 14px 0; color: var(--ink-2); font-size: 14px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px; text-align: center; background: var(--card); border-radius: var(--r-card); box-shadow: var(--sh-card); }
.empty__ic { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue-ink); }
.empty__t { font-weight: 800; font-size: 17px; }
.empty__d { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }

/* ---------- ルール編集 ---------- */
.form { padding: 10px 16px 0; display: flex; flex-direction: column; gap: 14px; }
.fsec { padding: 14px; background: var(--card); border-radius: var(--r-card); box-shadow: var(--sh-card); }
.fsec__h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 800; font-size: 15px; }
.inp { width: 100%; height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--fill); font-size: 16px; }
.inp::placeholder { color: #6d7a8c; }
.inp:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); background: #fff; }
.trig { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 12px 0 14px; border-radius: 14px; background: var(--fill); text-align: left; transition: transform .15s var(--spring); }
.trig:active { transform: scale(.98); }
.trig__t { flex: 1; font-weight: 700; }
.trig__c { font-size: 14px; color: var(--blue-ink); font-weight: 700; }
.trig .ic { width: 18px; height: 18px; color: var(--ink-3); }
.fsec .seg { margin-top: 10px; }
.frow { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; margin-top: 8px; font-weight: 500; }
.frow > span { white-space: nowrap; }
.sel { min-width: 0; max-width: 62%; height: 44px; padding: 0 34px 0 12px; border: 0; border-radius: 12px; background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%230a58c9' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") right 10px center / 18px no-repeat; -webkit-appearance: none; appearance: none; font-weight: 700; color: var(--ink); }
.time { height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--fill); font-family: var(--ff-num); font-size: 17px; font-weight: 600; }
.blk { margin-bottom: 10px; padding: 12px; border-radius: 16px; background: #f6f8fb; box-shadow: inset 0 0 0 1px var(--hair); }
.blk__head { display: flex; align-items: center; justify-content: space-between; }
.blk__t { font-weight: 800; }
.blk__rm { width: 44px; height: 44px; display: grid; place-items: center; margin: -8px -8px -8px 0; border-radius: 50%; color: #fff; }
.blk__rm .ic { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--red); stroke-width: 3; }
.addrow { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 4px; color: var(--blue-ink); font-weight: 700; }
.addrow .ic { width: 24px; height: 24px; padding: 3px; border-radius: 50%; background: var(--blue); color: #fff; stroke-width: 3; }
.preview { padding: 14px 16px; border-radius: var(--r-card); background: var(--blue-soft); }
.preview__k { font-size: 12px; font-weight: 800; color: var(--blue-ink); }
.preview__s { margin-top: 4px; font-size: 15px; line-height: 1.8; }
.preview__s b { color: var(--blue-ink); margin: 0 2px; }
.form__err { min-height: 0; color: var(--red); font-weight: 700; font-size: 14px; }
.form__err:empty { display: none; }

/* ---------- 設定 ---------- */
.ghead { padding: 18px 32px 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.gfoot { padding: 6px 32px 0; font-size: 13px; color: var(--ink-3); }
.group { margin: 0 16px; border-radius: 20px; background: var(--card); overflow: hidden; box-shadow: var(--sh-card); }
.grow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 16px; text-align: left; }
.grow + .grow { box-shadow: 0 -1px 0 var(--hair); }
.grow .person__av { width: 32px; height: 32px; font-size: 14px; }
.grow__t { flex: 1; font-weight: 500; }
.grow__v { font-size: 14px; color: var(--ink-2); }
.grow--col { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 16px; }
.grow__d { font-size: 13px; color: var(--ink-2); }
.grow--link { transition: background-color .15s; }
.grow--link:active { background: var(--fill); }
.grow--link .ic { width: 18px; height: 18px; color: #8a96a8; }
.grow--danger .grow__t { color: var(--red); font-weight: 700; }
.group + .group { margin-top: 18px; }
.gfoot + .group { margin-top: 18px; }
.ver { margin-top: 22px; text-align: center; font-size: 13px; color: var(--ink-3); }
.about { display: flex; flex-direction: column; align-items: center; padding: 18px 20px 6px; text-align: center; }
.about__ic { width: 108px; height: 108px; border-radius: 26px; box-shadow: 0 14px 34px rgba(18, 38, 74, .2); }
.about__n { margin-top: 14px; font-size: 24px; font-weight: 800; }
.about__d { font-size: 15px; color: var(--ink-2); }
.disc { margin: 16px 16px 0; padding: 14px 16px; border-radius: 18px; background: var(--card); font-size: 14px; line-height: 1.8; box-shadow: var(--sh-card); }
.disc--sub { margin-top: 10px; color: var(--ink-2); }
.confirm { display: flex; flex-direction: column; gap: 14px; padding-bottom: 6px; }
.confirm__d { font-size: 15px; color: var(--ink-2); }

/* ---------- タブバー（Liquid Glass・下へスクロールで縮む） ---------- */
.tabbar { position: absolute; left: 14px; right: 14px; bottom: calc(10px + var(--safe-b)); z-index: 30; transition: transform .35s var(--ease); }
.tabs {
  --x: 0px;
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr);
  height: 64px; padding: 4px; border-radius: 32px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow), 0 0 0 .5px rgba(255, 255, 255, .7);
  transition: height .3s var(--ease), padding .3s var(--ease);
}
.tabs__lens { position: absolute; top: 4px; bottom: 4px; left: 0; width: calc((100% - 8px) / 4); border-radius: 28px; background: rgba(255, 255, 255, .78); box-shadow: 0 2px 10px rgba(18, 38, 74, .12), inset 0 0 0 .5px rgba(255, 255, 255, .9); transform: translateX(var(--x)); transition: transform .45s var(--spring); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 28px; color: #3d4a5c; font-size: 11px; font-weight: 700; transition: color .2s; }
.tab .ic { width: 26px; height: 26px; stroke-width: 1.7; transition: transform .25s var(--spring); }
.tab:active .ic { transform: scale(.85); }
.tab.is-on { color: var(--blue-ink); }
.tab.is-on .ic { stroke-width: 2.1; }
.tabbar.is-min { transform: translateY(6px) scale(.9); }
.tabbar.is-min .tabs { height: 54px; }
.tabbar.is-min .tab span { opacity: 0; height: 0; overflow: hidden; }

.live { position: absolute; top: calc(8px + var(--safe-t)); left: 50%; z-index: 35; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(15, 27, 51, .86); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #fff; font-family: var(--ff-num); font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(15, 27, 51, .3); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ffcf6b; animation: blink 1s ease-in-out infinite; }
.live__k { font-family: var(--ff); font-size: 12px; color: #c9d6ee; }

.banner {
  position: absolute; left: 10px; right: 10px; top: calc(8px + var(--safe-t)); z-index: 60;
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border-radius: 26px;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow);
  transform: translateY(calc(-100% - 30px)); transition: transform .5s var(--spring);
}
.banner.is-on { transform: none; }
.banner__ic { width: 38px; height: 38px; border-radius: 9px; flex: none; }
.banner__tx { flex: 1; min-width: 0; }
.banner__app { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.banner__t { font-weight: 800; font-size: 15px; line-height: 1.4; }
.banner__d { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.toast { position: absolute; left: 16px; right: 16px; bottom: calc(92px + var(--safe-b)); z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 10px 12px 18px; border-radius: 18px; background: #1c2638; color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 12px 30px rgba(13, 22, 38, .3); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .2s, transform .3s var(--spring); }
.toast.is-on { opacity: 1; transform: none; pointer-events: auto; }
.toast__b { flex: none; white-space: nowrap; min-height: 36px; padding: 0 12px; border-radius: 10px; color: #9cc8ff; font-weight: 800; }

.sheet { position: absolute; inset: 0; z-index: 70; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(13, 22, 38, .28); opacity: 0; transition: opacity .3s; }
.sheet__panel {
  position: absolute; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); max-height: 78%; overflow: auto;
  padding: 8px 16px 18px; border-radius: var(--r-sheet);
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: 0 20px 60px rgba(13, 22, 38, .3), inset 0 1px 0 rgba(255, 255, 255, .9);
  transform: translateY(110%); transition: transform .42s var(--spring);
}
.sheet.is-open .sheet__scrim { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; }
.sheet__grip { width: 38px; height: 5px; margin: 0 auto 6px; border-radius: 3px; background: rgba(13, 22, 38, .2); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sheet__t { font-size: 18px; font-weight: 800; }
.sheet__x { width: 40px; height: 40px; }
.picks { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: #fff; }
.pick { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 0 16px; font-weight: 700; text-align: left; transition: background-color .12s; }
.pick + .pick { box-shadow: 0 -1px 0 var(--hair); }
.pick:active { background: var(--fill); }
.pick .ic { width: 18px; height: 18px; color: #8a96a8; }

.splash { position: absolute; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: linear-gradient(#f7faff, #e3eefd); transition: opacity .3s; }
.splash img { width: 108px; height: 108px; border-radius: 26px; box-shadow: 0 18px 44px rgba(10, 102, 232, .25); animation: rise .6s var(--spring) both; }
.splash p { font-size: 22px; font-weight: 800; animation: rise .6s .08s var(--spring) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.splash.is-gone { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
.kw { word-break: keep-all; overflow-wrap: anywhere; }
.rule__face { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
