/* Layout: wordmark bar → health strip → grid of live site cards; a site's "Infos" replaces the grid with a tabbed monitor sheet */
:root {
  --bg: #f5f7f7;
  --surface: #ffffff;
  --ink: #0e1414;
  --muted: #6a7574;
  --line: #e2e7e6;
  --hover: #eef2f1;
  --accent: #0a7d74;
  --up: #12955a;
  --warn: #c27a0e;
  --down: #d1352b;
  --idle: #9aa5a4;
  --danger: #c2412d;
  --shadow: 0 1px 2px rgba(14,20,20,.04), 0 10px 28px -14px rgba(14,20,20,.18);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f0f; --surface: #121818; --ink: #edf2f1; --muted: #8a9796;
    --line: #222b2a; --hover: #182020; --accent: #3cc4b6;
    --up: #3ddc84; --warn: #f2b84b; --down: #ff6b5e; --idle: #5d6968; --danger: #ef7a66;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f0f; --surface: #121818; --ink: #edf2f1; --muted: #8a9796;
  --line: #222b2a; --hover: #182020; --accent: #3cc4b6;
  --up: #3ddc84; --warn: #f2b84b; --down: #ff6b5e; --idle: #5d6968; --danger: #ef7a66;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-block: 28px 64px;
}
.wrap { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.stack { display: flex; flex-direction: column; width: 100%; min-width: 0; }
.stack > * { min-width: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Mark ---------- */
.mark { width: 34px; height: 34px; flex: none; }
.mark rect { fill: var(--ink); }
.mark .helm { fill: var(--bg); }
.mark .eye { fill: var(--ink); }
.mark .crest { fill: var(--accent); }
.word { font-weight: 600; font-size: 17px; letter-spacing: .24em; text-transform: uppercase; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 15px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--ink);
}
.btn:hover { background: var(--hover); }
.btn.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.solid:hover { opacity: .88; background: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn.icon { width: 38px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: default; }
.spin svg { animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Dashboard ---------- */
.bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.bar h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.tools { display: flex; gap: 8px; align-items: center; flex: 1 1 280px; justify-content: flex-end; min-width: 0; }
.search { position: relative; flex: 1 1 200px; max-width: 280px; min-width: 0; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 38px; padding: 0 12px 0 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.search input::placeholder { color: var(--muted); }
@media (max-width: 600px) { .tools { flex-basis: 100%; } .search { max-width: none; } }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .l { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.stat .v { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 420px) { .stat { padding: 12px; } .stat .v { font-size: 19px; } }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 13px; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--surface); border-color: var(--line); color: var(--ink); }

.notice { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--muted); }
.notice b { color: var(--ink); font-weight: 600; }

/* ---------- Status ---------- */
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); flex: none; display: inline-block; }
.s-up .dot, .dot.up { background: var(--up); }
.s-warn .dot, .dot.warn { background: var(--warn); }
.s-down .dot, .dot.down { background: var(--down); }
.s-up .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--up); animation: ping 2s cubic-bezier(0,0,.2,1) infinite; }
.s-check .dot { animation: blink 1s ease-in-out infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes blink { 50% { opacity: .3; } }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); border: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-up .pill, .pill.s-up { color: var(--up); border-color: color-mix(in srgb, var(--up) 35%, var(--line)); }
.s-warn .pill, .pill.s-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.s-down .pill, .pill.s-down { color: var(--down); border-color: color-mix(in srgb, var(--down) 45%, var(--line)); }
.pill .ms { color: var(--muted); font-family: var(--mono); font-size: 11px; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; min-width: 0; transition: border-color .2s, box-shadow .2s, transform .2s; }
.card.s-up { border-color: color-mix(in srgb, var(--up) 38%, var(--line)); }
.card.s-warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.card.s-down { border-color: color-mix(in srgb, var(--down) 55%, var(--line)); }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .cover { position: absolute; inset: 0; border-radius: 18px; z-index: 1; }
.shot { position: relative; aspect-ratio: 16 / 10; max-width: 100%; border-radius: 17px 17px 0 0; overflow: hidden; background: var(--hover); border-bottom: 1px solid var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: filter .3s, transform .5s; }
.card:hover .shot img { transform: scale(1.02); }
.s-down .shot img { filter: grayscale(1) contrast(.9); opacity: .55; }
.shot .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; font-weight: 700; letter-spacing: -0.04em; color: color-mix(in srgb, var(--ink) 14%, transparent); }
.ph.loading { background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--surface) 70%, transparent) 50%, transparent 70%) var(--hover); background-size: 220% 100%; animation: sheen 1.4s linear infinite; }
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.shot .pill { position: absolute; z-index: 2; left: 12px; top: 12px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.shot .age { position: absolute; z-index: 2; right: 12px; bottom: 10px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.meta { display: flex; align-items: center; gap: 12px; padding: 14px 12px 10px 14px; min-width: 0; }
.ico { width: 40px; height: 40px; border-radius: 10px; flex: none; overflow: hidden; display: grid; place-items: center; background: var(--hover); border: 1px solid var(--line); font-weight: 600; font-size: 14px; letter-spacing: -0.02em; color: var(--ink); }
.ico img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.idc { min-width: 0; flex: 1; }
.name { font-weight: 600; font-size: 15.5px; letter-spacing: -0.015em; display: flex; align-items: center; gap: 6px; }
.name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name .arrow { width: 14px; height: 14px; color: var(--muted); flex: none; opacity: 0; transform: translate(-3px, 3px); transition: opacity .15s, transform .15s; }
.card:hover .arrow { opacity: 1; transform: none; }
.sub { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type { font-family: var(--font); font-size: 11px; font-weight: 500; letter-spacing: .02em; color: var(--muted); }
.beats { display: flex; align-items: center; gap: 10px; padding: 0 14px 14px; }
.beat { display: flex; gap: 2px; flex: 1; height: 18px; align-items: stretch; min-width: 0; }
.beat i { flex: 1; border-radius: 2px; background: var(--line); min-width: 2px; }
.beat i.up { background: var(--up); } .beat i.degraded, .beat i.pending { background: var(--warn); } .beat i.down { background: var(--down); }
.beats .pct { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.beats .pct small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); }
.more { position: relative; z-index: 2; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); flex: none; }
.more:hover, .more[aria-expanded="true"] { background: var(--hover); color: var(--ink); }
.more svg { width: 16px; height: 16px; }
.menu { position: absolute; z-index: 5; right: 10px; bottom: 60px; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 5px; display: flex; flex-direction: column; }
.menu button { text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 7px; font-size: 14px; display: flex; gap: 9px; align-items: center; }
.menu button:hover { background: var(--hover); }
.menu button svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.menu .strong { font-weight: 600; }
.menu .strong svg { color: var(--accent); }
.menu .del, .menu .del svg { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.confirm { position: relative; z-index: 2; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 0 14px 14px; }
.sk { pointer-events: none; }
.sk .l1, .sk .l2, .sk .ico { background: var(--hover); border-color: transparent; animation: blink 1.4s ease-in-out infinite; }
.sk .l1 { height: 13px; width: 50%; border-radius: 6px; }
.sk .l2 { height: 10px; width: 70%; border-radius: 6px; margin-top: 8px; }
.empty { border: 1px dashed var(--line); border-radius: 18px; padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.empty b { display: block; color: var(--ink); font-weight: 600; font-size: 16px; margin-bottom: 4px; }

/* ---------- Detail ---------- */
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-size: 14px; padding: 4px 0; }
.back:hover { color: var(--ink); }
.back svg { width: 16px; height: 16px; }
.dhead { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.dhead .ico { width: 56px; height: 56px; border-radius: 14px; font-size: 18px; }
.dhead .t { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dhead h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; overflow-wrap: anywhere; }
.dhead .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.dhead .row a { color: var(--accent); font-family: var(--mono); font-size: 12.5px; text-decoration: none; overflow-wrap: anywhere; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); border: 1px solid var(--line); }
.dacts { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding-inline: 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 12px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tab .cnt { font-size: 11px; background: var(--down); color: #fff; border-radius: 999px; padding: 0 6px; line-height: 17px; }
.panel { display: flex; flex-direction: column; gap: 16px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.box h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.box .hint, .hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi .v.good { color: var(--up); } .kpi .v.bad { color: var(--down); } .kpi .v.mid { color: var(--warn); }
.kpi .s { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.seg { display: inline-flex; background: var(--hover); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; height: 28px; padding: 0 12px; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--mono); }
.chart .area { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.chart .end { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.strip { display: flex; gap: 2px; height: 10px; }
.strip i { flex: 1; border-radius: 2px; background: var(--line); }
.strip i.up { background: var(--up); } .strip i.mid { background: var(--warn); } .strip i.down { background: var(--down); }
.strip-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.shot-d { aspect-ratio: 16 / 10; max-width: 100%; border-radius: 12px; overflow: hidden; background: var(--hover); border: 1px solid var(--line); }
.shot-d img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tbl-wrap { overflow-x: auto; margin-inline: -16px; padding-inline: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 560px; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
td.m { font-family: var(--mono); font-size: 12px; }
td.err { color: var(--muted); max-width: 320px; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.st.ok { color: var(--up); } .st.ko { color: var(--down); } .st.mid { color: var(--warn); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.inc { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.inc.open { border-color: color-mix(in srgb, var(--down) 45%, var(--line)); }
.inc .top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.inc .top b { font-weight: 600; }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.open { color: var(--down); border-color: color-mix(in srgb, var(--down) 45%, var(--line)); }
.badge.res { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, var(--line)); }
.badge.mid { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.tl { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.tl li { position: relative; }
.tl li::before { content: ""; position: absolute; left: -19px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.tl li.down::before { background: var(--down); } .tl li.up::before { background: var(--up); } .tl li.comment::before { background: var(--accent); }
.tl time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-right: 6px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); min-width: 0; }
.field input, .field textarea, .field select { font: inherit; font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0; }
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field input.mono { font-family: var(--mono); font-size: 14px; }
.field textarea { resize: vertical; min-height: 64px; }
.field small { font-weight: 400; color: var(--muted); font-size: 12px; }
.field input[type="checkbox"], .toggle input[type="checkbox"] { width: 16px; height: 16px; padding: 0; flex: none; }
.field .toggle { font-weight: 400; color: var(--ink); }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; align-items: center; }
.err { margin: 0; color: var(--danger); font-size: 13px; }
.ok-msg { margin: 0; color: var(--up); font-size: 13px; }
.list { display: flex; flex-direction: column; }
.li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1 1 200px; min-width: 0; }
.li .grow b { font-weight: 600; font-size: 14px; }
.li .grow div { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.loading-box { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: color-mix(in srgb, var(--ink) 30%, transparent); display: flex; align-items: center; justify-content: center; padding: 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.sheet { width: 100%; max-width: 460px; max-height: 100%; overflow: auto; background: var(--surface); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.35); animation: rise .22s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
@media (max-width: 560px) {
  .scrim { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 20px 20px 0 0; max-width: none; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
}
.sheet h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.logo-pick { display: flex; align-items: center; gap: 14px; }
.logo-pick .ico { width: 56px; height: 56px; border-radius: 14px; font-size: 18px; }
.logo-pick .acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Splash ---------- */
.splash { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-items: center; transition: opacity .45s ease, visibility .45s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash-in { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.splash .mark { width: 72px; height: 72px; }
.splash .mark rect { transform-origin: center; animation: pop .5s cubic-bezier(.2,.9,.3,1.2) both; }
.splash .mark .helm { transform-box: fill-box; transform-origin: 50% 100%; animation: helm .55s .2s cubic-bezier(.2,.8,.2,1) both; }
.splash .mark .eye { transform-box: fill-box; transform-origin: 100% 50%; animation: eye .35s .7s cubic-bezier(.2,.8,.2,1) both; }
.splash .mark .crest { transform-box: view-box; transform-origin: 30px 34px; animation: crest .6s .75s cubic-bezier(.2,.9,.3,1.25) both; }
.splash .word { font-size: 20px; opacity: 0; animation: track .7s 1.1s cubic-bezier(.2,.8,.2,1) forwards; margin-right: -.24em; }
.loader { width: 72px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; opacity: 0; animation: fade .3s 1.3s forwards; }
.loader::after { content: ""; display: block; width: 40%; height: 100%; background: var(--ink); border-radius: 2px; animation: slide 1s ease-in-out infinite; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes helm { from { transform: translateY(10px); opacity: 0; } }
@keyframes eye { from { transform: scaleX(0); } }
@keyframes crest { from { transform: rotate(-60deg) scale(.7); opacity: 0; } }
@keyframes track { from { opacity: 0; letter-spacing: .9em; } to { opacity: 1; letter-spacing: .24em; } }
@keyframes fade { to { opacity: 1; } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.grid.reveal .card { animation: cardIn .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 55ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } }
.fadein { animation: cardIn .3s cubic-bezier(.2,.8,.2,1) both; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 8px); background: var(--ink); color: var(--bg); font-size: 14px; max-width: calc(100% - 40px); padding: 9px 16px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; overflow-wrap: anywhere; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Auth (standalone) ---------- */
html, body { min-height: 100%; }
.auth { min-height: calc(100vh - 120px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.auth-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.auth-card h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.auth-card p { margin: 0; }
.auth-card .btn { width: 100%; height: 42px; }
.linkbtn { border: 0; background: none; color: var(--accent); font-size: 13px; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.auth-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
@media (max-width: 520px) { .who span { display: none; } }
#headR { flex-wrap: nowrap; align-items: center; gap: 8px; }
@media (max-width: 420px) { header .word { letter-spacing: .16em; font-size: 15px; } #headR .btn { padding: 0 11px; } }

.why { margin: -6px 14px 12px; font-size: 12.5px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
.s-down .why { color: var(--down); }
.beat i.maintenance { background: var(--warn); opacity: .5; }
.beat i.blocked { background: var(--idle); opacity: .7; }
.st.idle { color: var(--muted); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.steps li { padding-left: 2px; }
code.expr { display: block; font-family: var(--mono); font-size: 12px; background: var(--hover); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; margin: 6px 0 8px; user-select: all; }
