[hidden] { display: none !important; }
:root {
  --bg: #0b0d10; --card: #15191e; --line: #262c33; --text: #eef1f4; --sub: #8f9aa6;
  --blue: #3e8ed0; --red: #e5484d; --green: #30a46c; --amber: #f5a524;
  --r: 14px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; min-height: 100vh; }
a { color: var(--blue); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  background: rgba(11, 13, 16, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { width: 26px; height: 26px; background: url(/icon.svg) center/contain no-repeat; }
.top strong { font-size: 17px; }
.pill { margin-left: auto; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--sub); white-space: nowrap; }
.pill.warn { color: var(--amber); border-color: var(--amber); }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(96px + var(--safe-b)); }
.pad { padding: 16px; } .center { text-align: center; } .muted { color: var(--sub); }
h1 { font-size: 28px; margin: 24px 0 8px; } h2 { font-size: 17px; margin: 0 0 6px; }
p { margin: 6px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.card.alert { border-color: var(--red); } .card.ok { border-color: var(--green); }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row small, .hint { display: block; color: var(--sub); font-size: 13px; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.btn { display: block; width: 100%; margin-top: 10px; min-height: 48px; padding: 12px 16px; border-radius: 12px; border: 0;
  background: var(--blue); color: #fff; font: 600 16px/1.2 inherit; text-align: center; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--red); }
.btn:disabled { opacity: .55; cursor: default; }
.btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.btns .btn { margin-top: 8px; }
/* switch */
.sw { position: relative; width: 52px; height: 32px; flex: none; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw span { position: absolute; inset: 0; border-radius: 999px; background: #3a414a; transition: .15s; }
.sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: .15s; }
.sw input:checked + span { background: var(--green); }
.sw input:checked + span::after { transform: translateX(20px); }
.sw input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: 600 14px inherit; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
label.f { display: block; color: var(--sub); font-size: 13px; }
input[type=time], input[type=text] { width: 100%; margin-top: 4px; min-height: 44px; padding: 10px; border-radius: 10px; border: 1px solid var(--line);
  background: #0f1216; color: var(--text); font: 17px inherit; color-scheme: dark; }
.rule { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.state { font-weight: 600; font-size: 14px; color: var(--sub); }
.state.hot { color: var(--red); } .state.on { color: var(--green); }
.ev { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.ev .t { color: var(--sub); font-size: 13px; white-space: nowrap; }
.ev .d { grid-column: 1 / -1; color: var(--sub); font-size: 13px; overflow-wrap: anywhere; }
.steps { margin: 8px 0 0; padding-left: 20px; color: var(--sub); }
.steps li { margin: 4px 0; }
.plans { display: grid; gap: 8px; }
.savebar { position: fixed; left: 0; right: 0; bottom: calc(64px + var(--safe-b)); z-index: 4; padding: 10px 16px; background: rgba(11, 13, 16, .96); border-top: 1px solid var(--line); }
.savebar > div { max-width: 640px; margin: 0 auto; }
.savebar .btn { margin: 0; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: rgba(11, 13, 16, .96); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; justify-content: center; color: var(--sub); text-decoration: none; font-size: 12px; }
.tabs a span { font-size: 20px; }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 700; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(140px + var(--safe-b)); z-index: 9; max-width: 600px; margin: 0 auto;
  padding: 12px 16px; border-radius: 12px; background: #222a33; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.err { border-color: var(--red); }
.hero { padding: 24px 0 8px; }
.hero ul { padding-left: 20px; color: var(--sub); }
@media (min-width: 700px) { .tabs a { flex-direction: row; gap: 8px; font-size: 14px; } }
.red { color: var(--red) !important; } .mt { margin-top: 12px; } .m0 { margin-top: 0; } .full { grid-column: 1 / -1; } .gap { height: 12px; }
