/* dyndns — web interface styles. No build step; edit freely. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-hover: #f7f8fa;
  --border: #e2e5ea;
  --border-strong: #cfd4db;
  --text: #15181e;
  --text-2: #3d434d;
  --muted: #687080;
  --accent: #4b57d6;
  --accent-hover: #3d48c2;
  --accent-soft: #eceefd;
  --accent-text: #ffffff;
  --ok: #13804a;
  --ok-soft: #e2f5ea;
  --warn: #a35a06;
  --warn-soft: #fdf1e1;
  --bad: #c42f2c;
  --bad-soft: #fdeceb;
  --neutral: #59616e;
  --neutral-soft: #eceef2;
  --ring: rgba(75, 87, 214, 0.28);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: 248px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f13;
    --surface: #15181e;
    --surface-2: #1b1f27;
    --surface-hover: #1a1e25;
    --border: #262b35;
    --border-strong: #353b47;
    --text: #e8eaef;
    --text-2: #c4c8d1;
    --muted: #8f97a6;
    --accent: #8790ff;
    --accent-hover: #9da4ff;
    --accent-soft: rgba(135, 144, 255, 0.14);
    --accent-text: #0d0f13;
    --ok: #4cc985;
    --ok-soft: rgba(76, 201, 133, 0.13);
    --warn: #f0a54a;
    --warn-soft: rgba(240, 165, 74, 0.13);
    --bad: #ff6d68;
    --bad-soft: rgba(255, 109, 104, 0.13);
    --neutral: #a2a9b6;
    --neutral-soft: rgba(162, 169, 182, 0.13);
    --ring: rgba(135, 144, 255, 0.35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d0f13;
  --surface: #15181e;
  --surface-2: #1b1f27;
  --surface-hover: #1a1e25;
  --border: #262b35;
  --border-strong: #353b47;
  --text: #e8eaef;
  --text-2: #c4c8d1;
  --muted: #8f97a6;
  --accent: #8790ff;
  --accent-hover: #9da4ff;
  --accent-soft: rgba(135, 144, 255, 0.14);
  --accent-text: #0d0f13;
  --ok: #4cc985;
  --ok-soft: rgba(76, 201, 133, 0.13);
  --warn: #f0a54a;
  --warn-soft: rgba(240, 165, 74, 0.13);
  --bad: #ff6d68;
  --bad-soft: rgba(255, 109, 104, 0.13);
  --neutral: #a2a9b6;
  --neutral-soft: rgba(162, 169, 182, 0.13);
  --ring: rgba(135, 144, 255, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 680; }
h2 { font-size: 1.08rem; font-weight: 640; }
h3 { font-size: 0.98rem; font-weight: 620; }
p { margin: 0; }

code, .mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }

.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 15px; height: 15px; }
.i.lg { width: 22px; height: 22px; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

/* -------------------------------------------------------------- layout */

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
}

.brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 18px; }
.brand-link { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-link:hover { text-decoration: none; }
.logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); }
.logo .i { width: 18px; height: 18px; stroke-width: 2.2; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 540;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav-section { margin: 18px 10px 6px; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }

.sidebar-foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--text); font-weight: 560; }
.user-chip:hover { background: var(--surface-2); text-decoration: none; }
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-toggle { display: none; }
.theme-dark-icon { display: none; }
:root[data-theme="dark"] .theme-dark-icon { display: block; }
:root[data-theme="dark"] .theme-light-icon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-dark-icon { display: block; }
  :root:not([data-theme="light"]) .theme-light-icon { display: none; }
}

.main { padding: 34px 44px 28px; max-width: 1180px; width: 100%; }
.foot { margin-top: 48px; color: var(--muted); font-size: 0.8rem; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 0.86rem; color: var(--muted); margin-bottom: 8px; }
.back:hover { color: var(--text); text-decoration: none; }

.stack { display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-form { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }

/* --------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.card-head p { margin-top: 2px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { padding: 16px 18px; }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.84rem; font-weight: 550; }
.stat-value { font-size: 1.7rem; font-weight: 680; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.2; }
.stat-value.sm { font-size: 1.15rem; padding-top: 7px; padding-bottom: 6px; }
.stat-value.ok { color: var(--ok); }
.stat-value.bad { color: var(--bad); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }

.host-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; transition: border-color .15s, box-shadow .15s; }
.host-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.host-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.host-name { min-width: 0; }
.host-name a { display: block; color: var(--text); font-weight: 620; overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.95rem; }
.host-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); }
.ip-list { display: grid; gap: 6px; margin: 0; }
.ip-list div { display: flex; align-items: baseline; gap: 10px; }
.ip-list dt { width: 38px; flex: none; color: var(--muted); font-size: 0.78rem; font-weight: 650; letter-spacing: 0.04em; }
.ip-list dd { margin: 0; font-family: var(--mono); font-size: 0.9rem; overflow-wrap: anywhere; }

.provider-card { display: flex; flex-direction: column; }
.provider-card .card-body { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.provider-meta { display: flex; gap: 18px; color: var(--muted); font-size: 0.86rem; }

.kind-card { display: block; padding: 20px; color: var(--text); }
.kind-card:hover { border-color: var(--accent); text-decoration: none; }
.kind-card p { color: var(--muted); margin-top: 4px; }

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 580; font-size: 0.92rem; white-space: nowrap;
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 0.85rem; gap: 6px; }
.btn.block { width: 100%; height: 42px; }
.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--muted); border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn.primary[aria-busy="true"]::after { border-color: var(--accent-text); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.inline-form { display: inline; margin: 0; }
.actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }

/* --------------------------------------------------------------- forms */

.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 0.9rem; }
.field .req { color: var(--bad); margin-left: 2px; }
.hint { color: var(--muted); font-size: 0.84rem; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--bad); }

input[type="text"], input[type="password"], input[type="url"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.95rem;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 10px 12px; min-height: 80px; resize: vertical; }
input::placeholder { color: var(--muted); opacity: .75; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
.input-mono { font-family: var(--mono) !important; font-size: 0.9rem !important; }
select {
  appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); flex: none; }

.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 540; user-select: none;
}
.check:hover { background: var(--surface-hover); }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.checks.col { flex-direction: column; }
.checks.col .check { width: 100%; }

.form-actions { display: flex; gap: 8px; align-items: center; padding-top: 4px; }

/* -------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 0.74rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-hover); }
td.primary-cell a { color: var(--text); font-weight: 600; }
td .sub { color: var(--muted); font-size: 0.82rem; margin-top: 1px; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }

/* --------------------------------------------------------------- pills */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 640; white-space: nowrap;
  background: var(--neutral-soft); color: var(--neutral);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.chip {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-2);
}
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* -------------------------------------------------------------- alerts */

.alert {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px; margin-bottom: 20px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 520;
}
.alert .i { margin-top: 2px; }
.alert > div { flex: 1; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--accent-soft); color: var(--accent); }
.alert .icon-btn { width: 24px; height: 24px; color: inherit; margin: -1px -4px 0 0; }
.alert .icon-btn:hover { background: transparent; opacity: .7; }
.alert strong { font-weight: 680; }
.alert p { color: var(--text-2); font-weight: 450; margin-top: 2px; }

.inline-result { display: flex; align-items: flex-start; gap: 8px; font-size: 0.87rem; font-weight: 540; padding: 8px 10px; border-radius: 8px; }
.inline-result.ok { background: var(--ok-soft); color: var(--ok); }
.inline-result.bad { background: var(--bad-soft); color: var(--bad); }
.inline-result:empty { display: none; }

/* --------------------------------------------------------- empty state */

.empty { text-align: center; padding: 52px 24px; }
.empty-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--accent-soft); color: var(--accent); }
.empty h3 { font-size: 1.05rem; }
.empty p { color: var(--muted); margin: 6px auto 18px; max-width: 420px; }

/* ---------------------------------------------------------- onboarding */

.steps { list-style: none; margin: 0; padding: 6px 22px 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: step; }
.step { display: flex; gap: 12px; align-items: flex-start; padding-top: 12px; }
.step-num {
  counter-increment: step; width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
  border: 1.5px solid var(--border-strong); color: var(--muted);
}
.step-num::before { content: counter(step); }
.step.done .step-num { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.step.done .step-num::before { content: "✓"; }
.step.current .step-num { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step h3 { font-size: 0.92rem; }
.step p { color: var(--muted); font-size: 0.84rem; margin-top: 2px; }
.step.done h3 { color: var(--muted); }

/* -------------------------------------------------------------- events */

.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li { display: flex; align-items: center; gap: 12px; padding: 11px 22px; border-bottom: 1px solid var(--border); }
.event-list li:last-child { border-bottom: 0; }
.event-list .ev-main { flex: 1; min-width: 0; }
.event-list .ev-host { font-family: var(--mono); font-size: 0.88rem; font-weight: 560; overflow-wrap: anywhere; }
.event-list .ev-msg { color: var(--muted); font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-list time { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px; border-bottom: 1px solid var(--border); }
.filters input { max-width: 260px; }
.filters select { max-width: 200px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.86rem; }

/* ---------------------------------------------------------- key/values */

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; margin: 0; }
.kv dt, .kv dd { padding: 11px 0; border-bottom: 1px solid var(--border); margin: 0; }
.kv dt { color: var(--muted); font-weight: 560; padding-right: 22px; font-size: 0.9rem; }
.kv dd { font-family: var(--mono); font-size: 0.9rem; overflow-wrap: anywhere; }
.kv dd.copy-cell { padding-left: 8px; }
.kv > :nth-last-child(-n+3) { border-bottom: 0; }
.secret-value { font-size: 1rem !important; font-weight: 600; letter-spacing: 0.02em; }

.code {
  position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 48px 12px 14px; font-family: var(--mono); font-size: 0.85rem; overflow-x: auto; white-space: pre;
}
.code .copy-btn { position: absolute; top: 6px; right: 6px; }

.copy-btn { color: var(--muted); }
.copy-btn.copied { color: var(--ok); }

.steps-text { margin: 0; padding-left: 20px; color: var(--text-2); }
.steps-text li { margin: 4px 0; }

.danger-zone { border-color: var(--bad-soft); }
.danger-zone h3 { color: var(--bad); }

.badge { display: inline-flex; padding: 0 7px; border-radius: 6px; font-size: 0.74rem; font-weight: 650; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; margin-left: 6px; }

/* ---------------------------------------------------------------- auth */

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%),
  radial-gradient(800px 500px at 110% 110%, var(--accent-soft), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; padding: 32px; }
.auth-card .logo { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 18px; }
.auth-card .logo .i { width: 24px; height: 24px; }
.auth-card h1 { font-size: 1.4rem; }
.auth-card .sub { color: var(--muted); margin: 4px 0 24px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 0.8rem; color: var(--muted); }

.error-page { text-align: center; }
.error-code { font-size: 3rem; font-weight: 750; letter-spacing: -0.03em; color: var(--accent); line-height: 1; margin-bottom: 10px; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .grid-form { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar {
    position: sticky; z-index: 20; height: auto; padding: 10px 16px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .brand { padding: 0; }
  .nav-toggle { display: inline-grid; }
  .nav, .sidebar-foot { display: none; }
  :root[data-nav-open] .nav { display: flex; padding-top: 10px; }
  :root[data-nav-open] .sidebar-foot { display: flex; }
  .main { padding: 22px 16px 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 1.35rem; }
  .card-body { padding: 18px; }
  .card-head, .card-foot { padding-left: 18px; padding-right: 18px; }
  th:first-child, td:first-child { padding-left: 18px; }
  .event-list li, .filters, .pager { padding-left: 18px; padding-right: 18px; }
  .filters input, .filters select { max-width: none; flex: 1 1 160px; }
}

@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr auto; }
  .kv dt { grid-column: 1 / -1; border-bottom: 0; padding-bottom: 0; }
  .kv > :nth-last-child(-n+3) { border-bottom: 0; }
  .page-head .btn { width: 100%; }
  .event-list time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.mb { margin-bottom: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.provider-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); margin-right: 4px; }
.card-body-tight { padding-top: 0; }
.grow { flex: 1 1 220px; width: auto !important; }
.shrink { flex: 0 1 180px; width: auto !important; }
.mt { margin-top: 10px; }
.event-list .pill { min-width: 84px; }
h1.mono { font-size: 1.4rem; font-weight: 650; letter-spacing: -0.01em; }
.kv dt, .kv dd { display: flex; align-items: center; min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
.kv dd.copy-cell { justify-content: flex-end; }

/* ======================================================= landing page */

.lp { background: var(--bg); }
.lp-wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.lp h1 { text-wrap: balance; font-size: clamp(2rem, 3.9vw, 2.9rem); font-weight: 760; letter-spacing: -0.035em; line-height: 1.08; }
.lp h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); font-weight: 720; letter-spacing: -0.025em; line-height: 1.2; }
.lp-accent { color: var(--accent); }
.lp-btn-lg { height: 44px; padding: 0 20px; font-size: 0.98rem; }

.lp-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.lp-header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.lp-nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.lp-nav a { color: var(--text-2); font-weight: 540; padding: 6px 12px; border-radius: 8px; }
.lp-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.lp-header-actions { display: flex; align-items: center; gap: 6px; }

.lp-hero {
  padding: 72px 0 64px;
  background:
    radial-gradient(900px 480px at 85% 10%, var(--accent-soft), transparent 65%),
    radial-gradient(700px 420px at -5% 90%, var(--accent-soft), transparent 60%);
}
.lp-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.lp-eyebrow { margin-bottom: 20px; }
.lp-lead { font-size: 1.12rem; line-height: 1.6; color: var(--text-2); margin-top: 20px; max-width: 560px; }
.lp-lead-sm { font-size: 1.02rem; color: var(--text-2); margin-top: 10px; max-width: 420px; }
.lp-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.lp-checks { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 0.9rem; }
.lp-checks li { display: flex; align-items: center; gap: 6px; }
.lp-checks .i { color: var(--ok); stroke-width: 2.4; }

.lp-visual { position: relative; display: flex; flex-direction: column; gap: 14px; }
.lp-flow { padding: 18px; box-shadow: var(--shadow-md); }
.lp-node { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.lp-node > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lp-node strong { font-weight: 640; font-size: 0.95rem; }
.lp-node span:not(.pill):not(.lp-node-icon):not(.dot) { color: var(--muted); font-size: 0.84rem; overflow-wrap: anywhere; }
.lp-node-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.lp-node-main { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lp-node-main .lp-node-icon { background: var(--accent); color: var(--accent-text); }
.lp-wire { position: relative; height: 38px; margin-left: 31px; border-left: 2px dashed var(--border-strong); display: flex; align-items: center; padding-left: 16px; }
.lp-wire code { font-size: 0.76rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 8px; border-radius: 6px; }

.lp-term { border-radius: var(--radius); background: #0f1218; border: 1px solid #232833; box-shadow: var(--shadow-md); overflow: hidden; }
.lp-term-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid #232833; }
.lp-term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2d3340; }
.lp-term pre { margin: 0; padding: 14px 16px 16px; font-family: var(--mono); font-size: 0.8rem; line-height: 1.7; color: #d7dae1; white-space: pre-wrap; overflow-wrap: anywhere; }
.t-dim { color: #7d8595; }
.t-ok { color: #4cc985; font-weight: 600; }
.t-neutral { color: #a2a9b6; font-weight: 600; }

.lp-strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.lp-strip-inner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.lp-strip-label { color: var(--muted); font-size: 0.82rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; margin-right: 6px; }
.lp-strip .chip { font-family: var(--font); font-size: 0.85rem; padding: 3px 10px; }

.lp-section { padding: 88px 0; }
.lp-section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lp-section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.lp-section-head p { color: var(--muted); font-size: 1.05rem; margin-top: 10px; }

.lp-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lp-feature { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.lp-feature p { color: var(--muted); font-size: 0.93rem; }
.lp-feature h3 { font-size: 1.02rem; margin-top: 6px; }
.lp-feature-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.lp-icon-lg { width: 48px; height: 48px; border-radius: 13px; margin-bottom: 18px; }

.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lp-steps li { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.lp-steps p { color: var(--muted); font-size: 0.93rem; }
.lp-step-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font-weight: 720; font-size: 0.92rem; }
.lp-code { font-size: 0.78rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.lp-security { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.lp-security-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lp-security-list li { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.lp-security-list .i { color: var(--ok); margin-top: 3px; }
.lp-security-list div { display: flex; flex-direction: column; gap: 2px; }
.lp-security-list span { color: var(--muted); font-size: 0.9rem; }

.lp-final {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 36px 40px; margin-bottom: 72px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface);
}
.lp-final p { color: var(--muted); margin-top: 6px; max-width: 560px; }

.lp-footer { border-top: 1px solid var(--border); padding: 22px 0; }
.lp-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lp-logo-sm { width: 22px; height: 22px; border-radius: 6px; }
.lp-logo-sm .i { width: 13px; height: 13px; }

@media (max-width: 980px) {
  .lp-hero-grid, .lp-security { grid-template-columns: 1fr; gap: 40px; }
  .lp-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-steps { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .lp-wrap { padding: 0 16px; }
  .lp-nav { display: none; }
  .lp-header-inner { justify-content: space-between; }
  .lp-hero { padding: 44px 0 40px; }
  .lp-section { padding: 56px 0; }
  .lp-features { grid-template-columns: 1fr; }
  .lp-cta .btn { flex: 1 1 auto; }
  .lp-final { padding: 26px 22px; margin-bottom: 48px; }
  .lp-final .btn { width: 100%; }
  .lp-footer-inner { justify-content: center; text-align: center; }
}
