:root {
  --bg: #0e1014;
  --surface: #161a21;
  --surface-2: #1d222b;
  --line: #2a303b;
  --text: #e8eaee;
  --muted: #9aa3b2;
  --accent: #3b82f6;
  --good: #22c55e;
  --bar-h: 58px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; overflow: hidden; }
button { font: inherit; color: inherit; }

.top { display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.title { flex: 1; min-width: 0; }
.top h1 { margin: 0; font-size: 17px; font-weight: 650; }
.stamp { margin: 1px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); display: grid; place-items: center; cursor: pointer; }
.bell svg { width: 20px; height: 20px; fill: var(--text); }
.bell.on svg { fill: var(--accent); }
.dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }

main { flex: 1; position: relative; min-height: 0; }
main iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); }
main iframe[hidden] { display: none; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }

.tabs { display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; height: var(--bar-h); border: 0; background: none; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--muted); cursor: pointer; }
.tabs svg { width: 22px; height: 22px; fill: currentColor; }
.tabs button[aria-selected="true"] { color: var(--accent); }

.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; z-index: 10; }
.sheet[hidden] { display: none; }
.sheet-card { width: 100%; max-width: 520px; margin: 0 auto; background: var(--surface); border-radius: 16px 16px 0 0;
  border: 1px solid var(--line); padding: 16px 16px calc(env(safe-area-inset-bottom) + 20px); max-height: 85vh; overflow: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { margin: 0; font-size: 18px; }
.x { border: 0; background: none; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.sheet p { color: var(--muted); margin: 10px 0; }
.sheet ol { padding-left: 20px; margin: 10px 0; }
.sheet li { margin: 6px 0; }
.primary { width: 100%; margin-top: 12px; padding: 13px; border-radius: 12px; border: 0; background: var(--accent);
  color: #fff; font-weight: 600; cursor: pointer; }
.secondary { width: 100%; margin-top: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: none; color: var(--muted); cursor: pointer; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-of-type { border-bottom: 0; }
.row small { display: block; color: var(--muted); font-size: 12px; }
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line);
  position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; transition: transform .15s; }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }
.err { color: #f87171; }
