:root {
  color-scheme: dark;
  --bg: #0b0c0d;
  --panel: #111315;
  --line: #25282b;
  --text: #f1f3f4;
  --muted: #7f858a;
  --soft: #aeb3b7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.shell { width: min(100%, 560px); margin: 0 auto; padding: 28px 22px 48px; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.brand { font-size: 18px; font-weight: 620; letter-spacing: .16em; }
.status-pill { font-size: 10px; letter-spacing: .12em; }
.hidden { display: none !important; }
.muted { color: var(--muted) !important; }
.login-panel { padding-top: 72px; }
.eyebrow, .section-head, .micro { color: var(--muted); font-size: 11px; letter-spacing: .14em; }
h1 { margin: 14px 0 38px; max-width: 360px; font-size: 30px; line-height: 1.08; font-weight: 530; letter-spacing: -.035em; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
input {
  width: 100%; min-height: 48px; padding: 0 13px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; outline: none;
  font-size: 16px;
}
input:focus { border-color: #5f656a; }
.primary, .secondary {
  min-height: 48px; border: 0; border-radius: 9px;
  background: var(--text); color: var(--bg); font-weight: 650; letter-spacing: .08em;
}
.secondary { grid-column: 1 / -1; margin-top: 4px; }
.section-head { margin-top: 52px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; min-height: 30px; }
.mode-head { margin-top: 44px; }
.text-button { min-height: 42px; color: var(--muted); background: transparent; border: 0; padding: 8px 0 8px 12px; font-size: 10px; letter-spacing: .12em; }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mode-switch button { min-height: 48px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.mode-switch button:last-child { border-right: 0; }
.mode-switch button.active { background: var(--text); color: var(--bg); }
.presence-summary { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.presence-summary > div { padding: 16px 0; }
.presence-summary > div:last-child { text-align: right; }
.presence-summary strong { display: block; margin-top: 5px; font-size: 14px; font-weight: 520; }
.device-row { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 96px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.device-main { min-width: 0; }
.device-title { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.device-sub { margin-top: 7px; color: var(--muted); font-size: 12px; }
.state-dot { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.power-switch { width: 54px; height: 32px; padding: 3px; border: 1px solid #3b3f43; border-radius: 999px; background: #181a1c; transition: .18s ease; flex: 0 0 auto; }
.power-switch span { display: block; width: 24px; height: 24px; border-radius: 50%; background: #6f7478; transition: .18s ease; }
.power-switch.on { background: #e7e9ea; border-color: #e7e9ea; }
.power-switch.on span { transform: translateX(22px); background: #101214; }
.power-switch:disabled { opacity: .42; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 18px; background: var(--line); border: 1px solid var(--line); }
.metrics div { min-width: 0; background: var(--bg); padding: 18px 14px; }
.metrics strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 21px; font-weight: 520; }
.metrics span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.notice { margin-top: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--soft); font-size: 12px; }
.rows { border-top: 1px solid var(--line); }
.row { min-height: 50px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 13px; }
.row span:last-child { text-align: right; color: var(--soft); overflow-wrap: anywhere; }
.plan-row span:first-child { font-variant-numeric: tabular-nums; }
.presence-settings, .advanced { margin-top: 38px; border-top: 1px solid var(--line); }
.presence-settings summary, .advanced summary { cursor: pointer; list-style: none; padding: 18px 0; color: var(--muted); font-size: 11px; letter-spacing: .14em; }
.presence-settings summary::-webkit-details-marker, .advanced summary::-webkit-details-marker { display: none; }
.settings-grid { grid-template-columns: 1fr 1fr; gap: 14px 12px; padding-bottom: 10px; }
.event-list { border-top: 1px solid var(--line); }
.event { padding: 13px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 78px 1fr; gap: 14px; }
.event time { color: var(--muted); font-size: 11px; }
.event span { font-size: 12px; line-height: 1.35; }
.empty { color: var(--muted); padding: 14px 0; font-size: 12px; border-top: 1px solid var(--line); }
.error { min-height: 20px; margin: 18px 0 0; color: #c6a8a8; font-size: 12px; line-height: 1.45; }
footer { margin-top: 54px; color: #555b60; font-size: 10px; letter-spacing: .12em; }
@media (max-width: 360px) {
  .shell { padding-left: 16px; padding-right: 16px; }
  .metrics div { padding-left: 10px; padding-right: 10px; }
  .metrics strong { font-size: 18px; }
  .settings-grid { grid-template-columns: 1fr; }
  .secondary { grid-column: auto; }
}
