/* 알림허브 — iOS Settings-style PWA. No inline styles anywhere (strict CSP). */

:root {
  color-scheme: light dark;
  --bg: #f2f2f7;             /* systemGroupedBackground */
  --bg2: #ffffff;            /* secondarySystemGroupedBackground (cells) */
  --sheet-bg: #f2f2f7;
  --sheet-cell: #ffffff;
  --fill: rgba(120, 120, 128, 0.12);
  --fill2: rgba(120, 120, 128, 0.2);
  --label: #000000;
  --label2: rgba(60, 60, 67, 0.62);
  --label3: rgba(60, 60, 67, 0.32);
  --sep: rgba(60, 60, 67, 0.22);
  --tint: #007aff;
  --red: #ff3b30;
  --orange: #ff9500;
  --blue: #007aff;
  --green: #34c759;
  --gray: #8e8e93;
  --bar: rgba(249, 249, 249, 0.78);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.7);
  --seg-on: #ffffff;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  --toast-bg: rgba(250, 250, 252, 0.92);
  --r-cell: 16px;
  --r-btn: 14px;
  --inset: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 44px;
  --tab-h: 62px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg2: #1c1c1e;
    --sheet-bg: #1c1c1e;
    --sheet-cell: #2c2c2e;
    --fill: rgba(118, 118, 128, 0.24);
    --fill2: rgba(118, 118, 128, 0.36);
    --label: #ffffff;
    --label2: rgba(235, 235, 245, 0.62);
    --label3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.6);
    --tint: #0a84ff;
    --red: #ff453a;
    --orange: #ff9f0a;
    --blue: #0a84ff;
    --green: #30d158;
    --gray: #98989d;
    --bar: rgba(22, 22, 24, 0.78);
    --glass: rgba(44, 44, 46, 0.66);
    --glass-edge: rgba(255, 255, 255, 0.1);
    --seg-on: #636366;
    --shadow: 0 10px 34px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.4);
    --toast-bg: rgba(44, 44, 46, 0.94);
  }
}

@media (min-width: 430px) { :root { --inset: 20px; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
html.sheet-open, html.sheet-open body { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
body.has-tabbar { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--tint); text-decoration: none; }
img { display: block; }
pre { margin: 0; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--tint); outline-offset: 2px; border-radius: 8px; }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: 0; }
.noscript { padding: 40px 20px; text-align: center; color: var(--label2); }

.ico { width: 22px; height: 22px; flex: none; display: block; }

/* ---------- views & navigation ---------- */
.app-root { min-height: 100vh; min-height: 100dvh; }
.view { animation: view-in 0.24s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.screen { min-height: 100vh; min-height: 100dvh; }
.nav {
  position: sticky; top: 0; z-index: 20;
  padding-top: var(--safe-t);
  background: transparent;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.nav.solid {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.5px 0 var(--sep);
}
.nav-inner {
  height: var(--nav-h); max-width: 760px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 calc(8px + var(--safe-r)) 0 calc(8px + var(--safe-l));
}
.nav-left { display: flex; align-items: center; min-width: 0; }
.nav-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.nav-title {
  font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 60vw; opacity: 0; transform: translateY(4px); transition: opacity 0.18s, transform 0.18s;
}
.nav.titled .nav-title, .nav.compact .nav-title { opacity: 1; transform: none; }
.nav-back {
  display: inline-flex; align-items: center; gap: 0; border: 0; background: none; color: var(--tint);
  font-size: 17px; padding: 8px 6px 8px 0; margin-left: -2px; min-height: 44px;
}
.nav-back .ico { width: 26px; height: 26px; stroke-width: 2.4; }
.nav-back .ico path { stroke-width: 2.4; }
.nav-text {
  border: 0; background: none; color: var(--tint); font-size: 17px; padding: 8px 8px; min-height: 44px; white-space: nowrap;
}
.nav-text:disabled { color: var(--label3); cursor: default; }
.nav-icon {
  border: 0; background: none; color: var(--tint); width: 40px; height: 40px; border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-icon .ico { width: 21px; height: 21px; }
.nav-icon.spinning .ico { animation: spin 0.9s linear infinite; }
.pointer-only { display: none !important; }
@media (hover: hover) and (pointer: fine) {
  .pointer-only { display: inline-flex !important; }
  .nav-icon:hover, .nav-text:hover:not(:disabled), .nav-back:hover { opacity: 0.7; }
}

.main { max-width: 760px; margin: 0 auto; padding: 0 var(--safe-r) 8px var(--safe-l); }
.large-title {
  margin: 2px 0 10px; padding: 0 calc(var(--inset) + 4px);
  font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.01em;
}
.content { padding-bottom: 8px; }
.page-lead { margin: 0 calc(var(--inset) + 16px) 14px; color: var(--label2); font-size: 14px; }

/* ---------- grouped inset lists ---------- */
.group { margin: 0 var(--inset) 26px; }
.group-head {
  margin: 0 16px 7px; font-size: 13px; font-weight: 400; color: var(--label2); letter-spacing: 0;
}
.group-foot { margin: 7px 16px 0; font-size: 13px; color: var(--label2); line-height: 1.4; }
.group-foot b { color: var(--label); }
.warn-text { color: var(--orange); }
.list { background: var(--bg2); border-radius: var(--r-cell); overflow: hidden; }
.sheet .list { background: var(--sheet-cell); }

.row {
  --sep-inset: 16px;
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 10px 16px; width: 100%;
  background: transparent; border: 0; text-align: left; color: var(--label); font-size: 17px;
}
a.row { color: var(--label); }
.row + .row::before, .row + label.row::before, label.row + .row::before {
  content: ""; position: absolute; top: 0; left: var(--sep-inset); right: 0;
  height: 1px; background: var(--sep); transform: scaleY(0.5); transform-origin: top;
}
.row:has(.row-left) { --sep-inset: 58px; }
.row.tappable { cursor: pointer; transition: background-color 0.15s; }
.row.tappable:active { background: var(--fill); }
@media (hover: hover) and (pointer: fine) { .row.tappable:hover { background: var(--fill); } }
.row.multiline { align-items: flex-start; }
.row.multiline .row-left { margin-top: 1px; }
.row.multiline .chev { align-self: center; }
.row-left { flex: none; width: 30px; display: flex; align-items: center; justify-content: center; }
.row-emoji { font-size: 22px; line-height: 1; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 17px; line-height: 1.3; }
.row-sub { font-size: 14px; color: var(--label2); margin-top: 2px; line-height: 1.38; white-space: pre-line; }
.row-value { flex: none; max-width: 55%; color: var(--label2); font-size: 16px; text-align: right; }
.row .chev { width: 16px; height: 16px; color: var(--label3); flex: none; }
.row .chev path { stroke-width: 2.6; }
.row.destructive .row-title { color: var(--red); }
.row.tint-row .row-title { color: var(--tint); }
.row.warn-row .row-title { color: var(--orange); }
.row.disabled-row .row-title, .row.expired .row-title { color: var(--label2); }

.row.kv { align-items: baseline; gap: 16px; min-height: 44px; }
.kv-k { flex: none; color: var(--label2); font-size: 15px; min-width: 64px; }
.kv-v { flex: 1; text-align: right; font-size: 16px; overflow-wrap: anywhere; word-break: keep-all; }
.kv-v.small { font-size: 13px; }
.kv-note { color: var(--label2); font-size: 14px; }
.row.body-row { padding: 12px 16px; }
.body-text {
  font-family: var(--mono); font-size: 13.5px; line-height: 1.5; letter-spacing: 0;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: keep-all; width: 100%;
  user-select: text; -webkit-user-select: text;
}
.row.field-row { padding: 4px 16px; min-height: 50px; }
.field-label { flex: none; color: var(--label); font-size: 17px; min-width: 44px; }
.row.button-row { padding: 12px 16px; }
.row.seg-row { padding: 10px 12px; }
.row.seg-row .segmented { width: 100%; }

/* ---------- inputs ---------- */
.field {
  width: 100%; min-width: 0; border: 0; background: transparent; color: var(--label);
  font-size: 17px; /* ≥16px: no zoom on iOS */ padding: 10px 0; border-radius: 0;
}
.field::placeholder { color: var(--label3); }
.field.inline { text-align: right; }
.field:focus-visible { outline: none; }
.row.field-row:focus-within { box-shadow: inset 0 0 0 2px var(--tint); border-radius: var(--r-cell); }
.code-field {
  font-family: var(--mono); font-size: 26px; letter-spacing: 0.18em; font-variant-numeric: tabular-nums; text-align: center;
  padding: 12px 0;
}
.code-row { gap: 10px; }
.hint-tag {
  flex: none; font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--tint);
  background: color-mix(in srgb, var(--tint) 14%, transparent); padding: 5px 10px; border-radius: 999px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-btn); font-weight: 600; letter-spacing: -0.01em;
  transition: transform 0.12s var(--ease), opacity 0.15s, background-color 0.15s;
  text-align: center; line-height: 1.2; user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.975); opacity: 0.82; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn .ico { width: 22px; height: 22px; }
.btn-large { min-height: 52px; padding: 14px 20px; font-size: 17px; }
.btn-medium { min-height: 42px; padding: 10px 16px; font-size: 16px; border-radius: 12px; }
.btn-small { min-height: 32px; padding: 6px 14px; font-size: 15px; border-radius: 999px; }
.btn-block { width: 100%; }
.btn-filled { background: var(--tint); color: #fff; }
.btn-tinted { background: color-mix(in srgb, var(--tint) 15%, transparent); color: var(--tint); }
.btn-gray { background: var(--fill); color: var(--label); }
.btn-plain { background: transparent; color: var(--tint); }
.btn-destructive { background: var(--red); color: #fff; }
.btn-destructive-tinted { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.btn.busy .btn-label::after {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite;
}
.btn-row { display: flex; gap: 10px; width: 100%; }
.btn-row > .btn { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.pad { padding: 4px var(--inset) 20px; }
.text-btn {
  display: block; margin: 14px auto 0; border: 0; background: none; color: var(--tint); font-size: 16px; padding: 8px 12px;
  text-align: center;
}

/* segmented control */
.segmented {
  display: flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; position: relative;
}
.seg {
  flex: 1; min-height: 32px; border: 0; background: transparent; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--label); padding: 4px 6px; white-space: nowrap; transition: background-color 0.18s, box-shadow 0.18s;
}
.seg[aria-checked="true"] { background: var(--seg-on); font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.1); }
.inbox-seg { margin: 0 var(--inset) 14px; }
.content > .segmented:first-child { margin: 0 var(--inset) 18px; }

/* switch */
.switch { position: relative; display: inline-flex; flex: none; width: 51px; height: 31px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track {
  width: 51px; height: 31px; border-radius: 16px; background: var(--fill2); position: relative; transition: background-color 0.2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform 0.22s var(--ease);
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2.5px solid var(--tint); outline-offset: 2px; }

/* checkbox row */
.check-row { cursor: pointer; }
.check-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.check-ui {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--label3); position: relative;
  transition: background-color 0.15s, border-color 0.15s;
}
.check-input:checked + .check-ui { background: var(--tint); border-color: var(--tint); }
.check-input:checked + .check-ui::after {
  content: ""; position: absolute; left: 7.5px; top: 3.5px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(45deg);
}
.check-input:focus-visible + .check-ui { outline: 2.5px solid var(--tint); outline-offset: 2px; }
.check-row:has(.check-ui) { --sep-inset: 52px; }

/* radio list (checkmark on the right) */
.radio-row { cursor: pointer; }
.radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.radio-row .ico.check { width: 20px; height: 20px; color: var(--tint); visibility: hidden; }
.radio-row .ico.check path { stroke-width: 2.6; }
.radio:checked ~ .ico.check { visibility: visible; }
.radio:focus-visible ~ .row-main .row-title { text-decoration: underline; }

/* pills */
.pill {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap;
}
.pill.sev-crit { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.pill.sev-warn { color: var(--orange); background: color-mix(in srgb, var(--orange) 16%, transparent); }
.pill.sev-info { color: var(--blue); background: color-mix(in srgb, var(--blue) 13%, transparent); }
.pill.muted { color: var(--gray); background: var(--fill); }
.pill.plain { color: var(--label2); background: var(--fill); font-weight: 500; }

/* spinner / empty */
.spinner {
  display: inline-block; width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--fill2); border-top-color: var(--label2); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: flex; justify-content: center; padding: 48px 0; }
.empty { text-align: center; padding: 48px 32px 40px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-emoji { font-size: 44px; margin-bottom: 6px; }
.empty-title { font-size: 19px; font-weight: 600; }
.empty-text { margin: 0 0 10px; color: var(--label2); font-size: 15px; max-width: 320px; }

/* callouts & banners */
.callout {
  margin: 0 var(--inset) 18px; padding: 12px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--tint) 10%, var(--bg2)); font-size: 15px; line-height: 1.45;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 4px; }
.callout.ok { background: color-mix(in srgb, var(--green) 14%, var(--bg2)); }
.callout.warn { background: color-mix(in srgb, var(--orange) 16%, var(--bg2)); }
.callout.muted { background: var(--bg2); box-shadow: inset 0 0 0 1px var(--sep); }
.callout-title { font-weight: 600; }
.callout-sub { color: var(--label2); font-size: 13px; }
.callout-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.callout.done { animation: pop 0.35s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.form .callout, .sheet .callout { margin-left: 0; margin-right: 0; }

.banners:empty { display: none; }
.banner {
  margin: 0 var(--inset) 14px; padding: 12px 14px; border-radius: var(--r-cell); background: var(--bg2);
  display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 0 var(--sep);
}
.banner.warn { background: color-mix(in srgb, var(--orange) 14%, var(--bg2)); }
.banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--label2); }
.banner-text b { color: var(--label); font-size: 15px; font-weight: 600; }
.banner-actions { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
.banner-x { border: 0; background: none; color: var(--label2); font-size: 13px; padding: 4px; }

/* ---------- inbox ---------- */
.ptr {
  position: absolute; left: 50%; top: calc(var(--safe-t) + var(--nav-h) + 4px); margin-left: -14px; z-index: 5;
  width: 28px; height: 28px; color: var(--label2); opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.ptr .ico { width: 28px; height: 28px; }
.ptr.pulling { opacity: 0.8; transition: none; }
.ptr.armed { color: var(--tint); opacity: 1; }
.ptr.refreshing { opacity: 1; transform: translateY(56px); }
.ptr.refreshing .ico { animation: spin 0.8s linear infinite; }
.screen { position: relative; }

.glist { margin: 0 var(--inset); background: var(--bg2); border-radius: var(--r-cell); overflow: hidden; }
.glist:has(> .empty), .glist:has(> .loading-block) { background: transparent; }
.glist-foot { margin: 10px var(--inset) 0; }
.grow {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px 12px 20px;
  color: var(--label); transition: background-color 0.15s;
}
.grow + .grow::before {
  content: ""; position: absolute; top: 0; left: 68px; right: 0; height: 1px; background: var(--sep);
  transform: scaleY(0.5); transform-origin: top;
}
.grow:active { background: var(--fill); }
@media (hover: hover) and (pointer: fine) { .grow:hover { background: var(--fill); } }
.g-bar { display: none; }
.grow.sev-crit .g-bar { display: block; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.g-icon {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1; margin-top: 2px;
  background: color-mix(in srgb, var(--blue) 13%, transparent);
}
.grow.sev-crit .g-icon { background: color-mix(in srgb, var(--red) 14%, transparent); }
.grow.sev-warn .g-icon { background: color-mix(in srgb, var(--orange) 16%, transparent); }
.grow.muted .g-icon { background: var(--fill); filter: grayscale(0.85); opacity: 0.8; }
.g-main { flex: 1; min-width: 0; }
.g-top { display: flex; align-items: baseline; gap: 8px; }
.g-where { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); letter-spacing: 0; }
.g-time { flex: none; font-size: 13px; color: var(--label2); font-variant-numeric: tabular-nums; }
.g-title {
  font-size: 16px; font-weight: 500; line-height: 1.3; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.grow.unread .g-title { font-weight: 700; }
.grow.muted .g-title { color: var(--label2); }
.g-kind { font-size: 13px; color: var(--label2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-body {
  font-size: 14px; color: var(--label2); margin-top: 3px; line-height: 1.35; font-variant-numeric: tabular-nums;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line;
}
.g-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; font-size: 12px; color: var(--label2); }
.g-src { font-family: var(--mono); letter-spacing: 0; }
.g-count { font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; }
.g-cat::before { content: "#"; opacity: 0.6; }
.g-dot {
  position: absolute; left: 6px; top: 26px; width: 9px; height: 9px; border-radius: 50%; background: var(--tint);
  animation: pop 0.3s var(--ease) both;
}

/* ---------- detail ---------- */
.detail { padding-top: 6px; }
.hero {
  margin: 0 var(--inset) 16px; padding: 18px 18px 16px; background: var(--bg2); border-radius: 20px; position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--blue);
}
.hero.sev-crit::before { background: var(--red); }
.hero.sev-warn::before { background: var(--orange); }
.hero-icon {
  width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: color-mix(in srgb, var(--blue) 13%, transparent); margin-bottom: 12px;
}
.hero.sev-crit .hero-icon { background: color-mix(in srgb, var(--red) 14%, transparent); }
.hero.sev-warn .hero-icon { background: color-mix(in srgb, var(--orange) 16%, transparent); }
.hero-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.hero-title { margin: 0; font-size: 22px; line-height: 1.28; font-weight: 700; letter-spacing: -0.01em; }
.hero-kind { margin: 6px 0 0; color: var(--label2); font-size: 15px; }
.hero-where { margin: 8px 0 0; color: var(--label2); font-size: 14px; font-family: var(--mono); letter-spacing: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dotsep { opacity: 0.5; }
.actions { margin: 0 var(--inset) 22px; display: flex; flex-direction: column; gap: 10px; }
.me-btn { font-size: 18px; min-height: 56px; box-shadow: 0 6px 18px color-mix(in srgb, var(--tint) 30%, transparent); }
.ext-link { align-items: center; }
.ext-host { font-weight: 600; color: var(--tint); }
.ext-url { font-family: var(--mono); font-size: 12px; letter-spacing: 0; word-break: break-all; }
.ext-link .ico { color: var(--tint); width: 20px; height: 20px; }
.dl-status { font-size: 14px; font-variant-numeric: tabular-nums; }
.dl-sent { color: var(--green); }
.dl-pending { color: var(--orange); }
.dl-failed { color: var(--red); }
.dl-dropped { color: var(--gray); }
.row.escalated .row-sub { color: var(--orange); }
.sev-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); display: inline-block; }
.sev-dot.sev-crit { background: var(--red); }
.sev-dot.sev-warn { background: var(--orange); }
.row.hist .row-title { font-size: 15px; font-variant-numeric: tabular-nums; }
.row.hist .row-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.row.hist .row-value { font-size: 14px; }
.row.hist.current { background: color-mix(in srgb, var(--tint) 7%, transparent); }
.ip-compare {
  margin: 0 0 16px; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45;
}
.ip-compare.same { background: color-mix(in srgb, var(--green) 15%, transparent); }
.ip-compare.diff { background: color-mix(in srgb, var(--orange) 17%, transparent); }

/* ---------- kinds / rules / settings ---------- */
.kind-state { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.kind-count { font-size: 15px; color: var(--label); font-variant-numeric: tabular-nums; }
.kind-mode { font-size: 12px; color: var(--green); font-weight: 600; }
.kind-state.muted .kind-mode { color: var(--gray); }
.rule-badge { font-size: 22px; }
.presence-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--label3); }
.presence-dot.on { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 22%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--green) 6%, transparent); } }
.codebox {
  font-family: var(--mono); font-size: 13px; line-height: 1.45; letter-spacing: 0; background: var(--fill);
  border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; white-space: pre-wrap; word-break: break-all;
  user-select: all; -webkit-user-select: all;
}
.link-out { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.qr-wrap {
  align-self: center; width: min(250px, 66vw); background: #fff; border-radius: 18px; padding: 10px;
  box-shadow: 0 0 0 1px var(--sep);
}
.qr { display: block; width: 100%; height: auto; }

/* ---------- sheets ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.32); opacity: 0; transition: opacity 0.28s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--sheet-bg); border-radius: 26px 26px 0 0;
  padding: 0 calc(16px + var(--safe-r)) calc(18px + var(--safe-b)) calc(16px + var(--safe-l));
  transform: translateY(100%); transition: transform 0.34s var(--ease); box-shadow: var(--shadow);
}
.sheet.dragging { transition: none; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet-root.open .sheet { transform: none; }
.sheet:focus { outline: none; }
.sheet-grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--fill2); margin: 7px auto 2px; }
.sheet-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 8px 0 12px;
  background: var(--sheet-bg);
}
.sheet-title { flex: 1; margin: 0; font-size: 20px; font-weight: 700; line-height: 1.25; }
.sheet-x { border: 0; background: var(--fill); color: var(--label2); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.sheet-body { display: flex; flex-direction: column; }
.sheet-lead { margin: 0 0 10px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.sheet-text { margin: 0 0 14px; font-size: 15px; color: var(--label2); line-height: 1.5; }
.sheet-note { margin: 0 0 12px; font-size: 13px; color: var(--label2); line-height: 1.45; }
.sheet-note.center { text-align: center; }
.sheet-group { margin-bottom: 16px; }
.sheet-group > .btn, .sheet-group > .btn-row { margin-top: 10px; }
.sheet-text.steps-text { padding-left: 22px; }
.steps-text li + li { margin-top: 4px; }
.sheet-label { margin: 0 4px 7px; font-size: 13px; font-weight: 400; color: var(--label2); }
.sheet-actions { margin-top: 6px; }
.sheet-actions + .sheet-actions { margin-top: 10px; }
.sheet .list + .sheet-actions, .sheet .list + .btn-row { margin-top: 14px; }
.sheet .list + .list { margin-top: 14px; }
.sheet-body > .list { margin-bottom: 12px; }
.sheet-error {
  order: 99; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; color: var(--red);
  background: color-mix(in srgb, var(--red) 11%, transparent);
}
.sheet-body > .sheet-actions:not(.stack):last-of-type { position: sticky; bottom: calc(-18px - var(--safe-b)); padding: 10px 0 0; background: var(--sheet-bg); }
.stepup-hero { display: flex; justify-content: center; margin: 4px 0 14px; color: var(--tint); }
.stepup-hero .ico { width: 64px; height: 64px; }
.stepup-hero .ico path { stroke-width: 1.4; }
.action-sheet .sheet-title { text-align: left; }

@media (min-width: 640px) {
  .sheet {
    left: 50%; right: auto; width: 520px; bottom: 24px; border-radius: 26px; transform: translate(-50%, 24px); opacity: 0;
    transition: transform 0.3s var(--ease), opacity 0.22s; padding-bottom: 20px;
  }
  .sheet-root.open .sheet { transform: translate(-50%, 0); opacity: 1; }
  .sheet-grabber { visibility: hidden; height: 2px; }
  .sheet-body > .sheet-actions:not(.stack):last-of-type { bottom: -20px; }
}

/* ---------- toast ---------- */
.toast-root {
  position: fixed; top: calc(var(--safe-t) + 10px); left: 0; right: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 480px; padding: 12px 16px; border-radius: 18px;
  background: var(--toast-bg); color: var(--label); box-shadow: var(--shadow); font-size: 15px; line-height: 1.4;
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  transform: translateY(-16px) scale(0.98); opacity: 0; transition: transform 0.3s var(--ease), opacity 0.25s;
}
.toast.in { transform: none; opacity: 1; }
.toast-ok .toast-icon { color: var(--green); font-weight: 700; }

/* ---------- tab bar (iOS 26 floating glass) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 0 calc(14px + var(--safe-r)) calc(max(var(--safe-b), 10px)) calc(14px + var(--safe-l));
  pointer-events: none;
}
.tabbar-inner {
  pointer-events: auto; max-width: 460px; margin: 0 auto; height: var(--tab-h); display: flex; align-items: stretch;
  padding: 4px; border-radius: 32px; background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow: var(--shadow), inset 0 0 0 0.5px var(--glass-edge);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--label); border-radius: 28px; position: relative; transition: color 0.18s, background-color 0.18s;
}
.tab .ico { width: 25px; height: 25px; }
.tab-ico { position: relative; }
.tab-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0; }
.tab.active { color: var(--tint); background: var(--fill); }
.tab:active { transform: scale(0.96); }
.tab-badge {
  position: absolute; top: -5px; left: 15px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg2);
}

/* ---------- lock & onboarding ---------- */
.lock-screen, .onboard, .splash {
  min-height: 100vh; min-height: 100dvh; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 40px) calc(24px + var(--safe-r)) calc(var(--safe-b) + 28px) calc(24px + var(--safe-l));
}
.lock-screen { justify-content: space-between; }
.lock-top { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding-bottom: 24px; }
.app-icon {
  width: 88px; height: 88px; border-radius: 22.4%; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px; animation: icon-in 0.5s var(--ease) both;
}
.app-icon.small { width: 64px; height: 64px; margin-bottom: 12px; }
@keyframes icon-in { from { opacity: 0; transform: scale(0.88); } to { opacity: 1; transform: none; } }
.lock-title { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.lock-sub { margin: 6px 0 0; color: var(--label2); font-size: 16px; }
.lock-bottom { display: flex; flex-direction: column; gap: 12px; }
.lock-bottom .btn-large { min-height: 56px; font-size: 18px; border-radius: 16px; }
.lock-error, .form-error {
  margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; color: var(--red); text-align: center;
  background: color-mix(in srgb, var(--red) 11%, transparent);
}
.lock-note { margin: 4px 0 0; font-size: 12.5px; color: var(--label2); text-align: center; line-height: 1.45; }
.lock-link { text-align: center; font-size: 15px; padding: 6px; }

.onboard-root { min-height: 100vh; }
.onboard-top { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 22px; }
.onboard-title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.onboard-lead { margin: 8px 0 0; color: var(--label2); font-size: 15px; line-height: 1.5; max-width: 360px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form .group { margin: 0 0 4px; }
.form .group-head, .form .group-foot { margin-left: 16px; margin-right: 16px; }
.form-meta { margin: -4px 16px 0; font-size: 13px; color: var(--label2); }
.countdown { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--label); }
.steps { list-style: none; display: flex; justify-content: center; gap: 10px; padding: 0; margin: 0 0 10px; }
.steps li {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; background: var(--fill); color: var(--label2); transition: background-color 0.2s;
}
.steps li.cur { background: var(--tint); color: #fff; }
.steps li.done { background: color-mix(in srgb, var(--tint) 22%, transparent); color: var(--tint); }

.splash { align-items: center; justify-content: center; gap: 16px; text-align: center; }
.splash-text { color: var(--label2); margin: 0; max-width: 320px; }

/* setup guide */
.guide-step .row-title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--tint); color: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.inline-ico { display: inline-flex; color: var(--tint); }
.inline-ico .ico { width: 20px; height: 20px; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}
