/* Dashboard + login (index.html, login.html). The editor has its own styles.css. Light and dark themes. */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eff1f6;
  --line: #e6e8ef;
  --line-2: #d3d7e2;
  --text: #0e1324;
  --muted: #5d6680;
  --faint: #969db3;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef0ff;
  --accent-text: #4338ca;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --nav: #12113a;
  --nav-2: rgba(255, 255, 255, 0.06);
  --nav-line: rgba(255, 255, 255, 0.08);
  --nav-text: #b9b8dc;
  --spark: #6366f1;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(14, 19, 36, 0.05), 0 1px 3px rgba(14, 19, 36, 0.08);
  --shadow-md: 0 8px 24px -8px rgba(14, 19, 36, 0.16), 0 2px 6px rgba(14, 19, 36, 0.05);
  --shadow-lg: 0 30px 60px -18px rgba(14, 19, 36, 0.35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #090c17; --surface: #111527; --surface-2: #151a2e; --surface-3: #1b2138;
    --line: #232a45; --line-2: #2f375a; --text: #eef0f8; --muted: #9aa2bf; --faint: #6b7394;
    --accent: #6366f1; --accent-soft: #1e1f4b; --accent-text: #a5b4fc;
    --ok: #47cd89; --ok-soft: #0f2a1e; --warn: #fdb022; --warn-soft: #2b2110; --danger: #f97066; --danger-soft: #2f1414;
    --spark: #818cf8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6); --shadow-lg: 0 30px 60px -18px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #090c17; --surface: #111527; --surface-2: #151a2e; --surface-3: #1b2138;
  --line: #232a45; --line-2: #2f375a; --text: #eef0f8; --muted: #9aa2bf; --faint: #6b7394;
  --accent: #6366f1; --accent-soft: #1e1f4b; --accent-text: #a5b4fc;
  --ok: #47cd89; --ok-soft: #0f2a1e; --warn: #fdb022; --warn-soft: #2b2110; --danger: #f97066; --danger-soft: #2f1414;
  --spark: #818cf8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6); --shadow-lg: 0 30px 60px -18px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
[hidden] { display: none !important; }
.icon { flex: none; display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ── controls ───────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--surface); color: var(--text); cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.06s;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible, .icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent)); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15); }
.btn.primary:hover { background: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.solid-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 44px; padding: 0 18px; font-size: 15px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--surface); color: var(--text); outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
select.input { appearance: auto; padding-right: 8px; }
.input.sm { height: 32px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > .label { font-weight: 500; font-size: 13px; }
.hint { font-size: 12.5px; color: var(--muted); }
.error-text { font-size: 13px; color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); font: 600 11px/1 ui-sans-serif, system-ui, sans-serif; color: var(--muted); }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-weight: 600; letter-spacing: 0.02em; user-select: none; box-shadow: 0 0 0 2px var(--surface); }
.avatars { display: inline-flex; }
.avatars .avatar { margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.accent { background: var(--accent-soft); color: var(--accent-text); }
.pill.live .dot { box-shadow: 0 0 0 0 currentColor; animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.role { text-transform: capitalize; }

/* ── shell ──────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.nav {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
  display: flex; flex-direction: column; gap: 1px; padding: 12px 10px; background: var(--nav); color: var(--nav-text);
}
.nav::-webkit-scrollbar { display: none; }
.nav-top { display: flex; align-items: center; height: 36px; margin-bottom: 10px; padding: 0 2px 0 8px; }
.logo-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; }
.collapse-btn { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--nav-text); cursor: pointer; opacity: 0; transition: opacity 0.12s; }
.nav:hover .collapse-btn { opacity: 1; }
.collapse-btn:hover { background: var(--nav-2); color: #fff; }
.nav .item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 8px;
  border: 0; border-radius: 6px; background: transparent; color: var(--nav-text); text-decoration: none; text-align: left;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.nav .item .icon { opacity: 0.75; }
.nav .item:hover { background: var(--nav-2); color: #fff; }
.nav .item.active { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav .item.active .icon, .nav .item:hover .icon { opacity: 1; }
.nav .item .n { margin-left: auto; font-size: 12px; font-weight: 400; color: rgba(255, 255, 255, 0.4); }
.nav .item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-search { margin-bottom: 6px; }
.nav-title { display: flex; align-items: center; justify-content: space-between; height: 28px; margin-top: 16px; padding: 0 4px 0 8px; font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, 0.42); }
.nav-add { width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: rgba(255, 255, 255, 0.5); cursor: pointer; }
.nav-add:hover { background: var(--nav-2); color: #fff; }
.nav .site-link { font-weight: 400; }
.nav .site-link .sq { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.18); font-size: 10px; font-weight: 600; color: rgba(255, 255, 255, 0.75); }
.nav .site-link.active .sq { border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.nav .site-link .live { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #4ade80; }
.nav .spin.sm { width: 11px; height: 11px; border-width: 1.5px; opacity: 0.7; }
.nav .spacer { flex: 1; min-height: 12px; }
.nav .me { height: 38px; }
.nav .me .avatar { box-shadow: none; }
.nav .me .more { display: grid; opacity: 0.5; }

/* collapsed: icons only */
.shell.collapsed { grid-template-columns: 60px 1fr; }
.shell.collapsed .nav .lbl, .shell.collapsed .nav .n, .shell.collapsed .nav .spin.sm, .shell.collapsed .nav .live, .shell.collapsed .nav-add { display: none; }
.shell.collapsed .nav-top { flex-direction: column; height: auto; gap: 8px; padding: 4px 0 0; }
.shell.collapsed .logo-row { justify-content: center; }
.shell.collapsed .collapse-btn { transform: rotate(180deg); opacity: 0.6; }
.shell.collapsed .nav .item { justify-content: center; padding: 0; }
.shell.collapsed .nav-title { justify-content: center; padding: 0; }
.shell.collapsed .nav-title::before { content: ''; width: 18px; border-top: 1px solid var(--nav-line); }

.main { min-width: 0; display: flex; flex-direction: column; }
.page-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 14px 32px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; }
.page-head.scrolled { border-bottom-color: var(--line); }
.page-head h1 { font-size: 20px; font-weight: 650; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .crumb { color: var(--muted); text-decoration: none; }
.page-head .crumb:hover { color: var(--text); }
.menu-btn { display: none; }
.content { padding: 8px 32px 56px; max-width: 1360px; width: 100%; animation: rise 0.25s ease-out; }

/* ── cards & stats ──────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-body { padding: 16px 18px 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; }
.stat .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { font-size: 15px; font-weight: 600; }
.section-title .count { color: var(--faint); font-weight: 500; }

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.site-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 0; transition: border-color 0.15s, box-shadow 0.15s; }
.site-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.sc-head { display: flex; align-items: center; gap: 12px; }
.sc-logo { width: 40px; height: 40px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; font-size: 14px; color: var(--muted); }
.sc-logo img { width: 100%; height: 100%; object-fit: contain; }
.sc-title { flex: 1; min-width: 0; }
.sc-title h3 { font-size: 15px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-link { color: inherit; text-decoration: none; }
.sc-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.sc-url { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatches { display: inline-flex; flex: none; }
.swatches i { width: 14px; height: 14px; border-radius: 50%; margin-left: -4px; box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.swatches i:first-child { margin-left: 0; }
.sc-status { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 500; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.ok { color: var(--text); }
.status.ok .dot { background: #12b76a; }
.status.warn .dot { background: #f79009; }
.status.danger { color: var(--danger); }
.status.danger .dot { background: var(--danger); }
.status.accent { color: var(--accent-text); }
.status .spin { width: 12px; height: 12px; border-width: 1.5px; }
.sc-activity { display: flex; flex-direction: column; gap: 6px; }
.sc-activity-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }
.sc-activity-head strong { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.sc-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; margin: 0 -18px; padding: 10px 12px 10px 18px; border-top: 1px solid var(--line); }
.sc-meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; white-space: nowrap; }
.sc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.sc-meta .icon { opacity: 0.7; }
.site-card .avatars { position: relative; z-index: 1; }
.new-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 212px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.new-card:hover { border-color: var(--faint); color: var(--text); background: var(--surface); }
.new-card strong { margin-top: 4px; }

/* sparkline: one series, so no legend; tooltips per bar */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 28px; position: relative; z-index: 2; }
.spark .bar { flex: 1; min-height: 2px; border-radius: 3px 3px 1px 1px; background: var(--spark); opacity: 0.85; position: relative; }
.spark .bar.zero { background: var(--line-2); opacity: 1; }
.spark .bar:hover { opacity: 1; }
.spark-wrap { display: flex; flex-direction: column; gap: 4px; }
.spark-wrap .cap { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); }
.tip { position: fixed; z-index: 500; pointer-events: none; padding: 6px 9px; border-radius: 7px; background: #0e1324; color: #fff; font-size: 12px; box-shadow: var(--shadow-md); white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); }

/* ── lists, tables ──────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable:hover td { background: var(--surface-2); cursor: pointer; }
.table .person { display: flex; align-items: center; gap: 10px; }
.table .person strong { display: block; font-weight: 550; }
.table .person span { font-size: 12.5px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 3px var(--ok-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-3); font-size: 12px; color: var(--muted); }
.chip b { color: var(--text); font-weight: 550; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: flex-start; animation: rise 0.2s ease-out; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); }
.feed-item .ic.ok { background: var(--ok-soft); color: var(--ok); }
.feed-item .ic.danger { background: var(--danger-soft); color: var(--danger); }
.feed-item .ic.accent { background: var(--accent-soft); color: var(--accent-text); }
.feed-item .ic.warn { background: var(--warn-soft); color: var(--warn); }
.feed-item .txt { flex: 1; min-width: 0; }
.feed-item .txt b { font-weight: 600; }
.feed-item .txt .target { color: var(--muted); word-break: break-word; }
.feed-item .when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.feed-day { padding: 14px 18px 6px; font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .icon { color: var(--faint); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .input { width: auto; min-width: 160px; height: 34px; font-size: 13px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 12px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.hero-live { display: flex; align-items: center; gap: 16px; padding: 18px; }
.hero-live .globe { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #f97316, #f59e0b); color: #fff; box-shadow: 0 8px 22px -8px rgba(249, 115, 22, 0.7); }
.hero-live .globe.off { background: var(--surface-3); color: var(--faint); box-shadow: none; }
.hero-live a.big { font-size: 16px; font-weight: 600; text-decoration: none; color: var(--text); word-break: break-all; }
.hero-live a.big:hover { color: var(--accent-text); }

.deploy-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.deploy-row:hover { background: var(--surface-2); }
.deploy-row:last-child { border-bottom: 0; }
.deploy-row .txt { flex: 1; min-width: 0; }
.deploy-row .txt .s { font-size: 12.5px; color: var(--muted); }
pre.log { margin: 0; padding: 14px; background: #070a14; color: #c9d1e8; border-radius: 10px; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 56vh; overflow: auto; white-space: pre-wrap; word-break: break-word; border: 1px solid #161c33; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.steps .step { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: 13px; }
.steps .step .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.steps .step.now { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
.steps .step.done { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.steps .step.failed { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.secret { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 9px; background: var(--surface-3); border: 1px dashed var(--line-2); font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-all; }
.secret span { flex: 1; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 11px; background: var(--accent-soft); color: var(--text); align-items: flex-start; }
.callout .icon { color: var(--accent-text); margin-top: 2px; }
.callout.warn { background: var(--warn-soft); }
.callout.warn .icon { color: var(--warn); }
.callout.danger { background: var(--danger-soft); }
.callout.danger .icon { color: var(--danger); }
.matrix { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.matrix .site { display: flex; align-items: center; gap: 8px; min-width: 0; }
.matrix select { width: 140px; }

/* ── modal, toasts, menus ───────────────── */
.modal-back { position: fixed; inset: 0; z-index: 300; background: rgba(6, 9, 20, 0.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade 0.12s; }
.modal { width: min(540px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.modal.wide { width: min(820px, 100%); }
@keyframes pop { from { transform: scale(0.97) translateY(6px); opacity: 0; } }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 14px 22px; border-bottom: 1px solid var(--line); }
.modal h2 { font-size: 16.5px; font-weight: 600; }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); align-items: center; flex-wrap: wrap; }
.modal footer .grow { color: var(--muted); font-size: 13px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.choice:hover { border-color: var(--line-2); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice .s { font-size: 12.5px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 600; align-items: flex-end; }
.toast { padding: 11px 16px; border-radius: 11px; background: #0e1324; color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px; transition: opacity 0.3s, transform 0.3s; animation: rise 0.2s ease-out; max-width: 420px; border: 1px solid #1f2742; }
.toast.error { background: #b42318; border-color: #b42318; }
.toast.ok { background: #05603a; border-color: #05603a; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast a { color: #fff; font-weight: 600; margin-left: 10px; }
.menu { position: fixed; z-index: 450; min-width: 210px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop 0.12s ease-out; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; text-decoration: none; text-align: left; font-size: 13.5px; }
.menu button:hover, .menu a:hover { background: var(--surface-3); }
.menu .danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 2px; }
.menu .head { padding: 8px 10px 6px; font-size: 12.5px; color: var(--muted); }

/* ── command palette (shared markup with the editor, see palette.js) ── */
.palette-back { position: fixed; inset: 0; z-index: 700; background: rgba(6, 9, 20, 0.5); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade 0.1s; }
.palette { width: min(640px, 100%); max-height: 64vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.14s ease-out; }
.palette-head { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input { flex: 1; height: 54px; border: 0; outline: none; font-size: 16px; background: transparent; color: var(--text); }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; color: var(--text); }
.palette-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .hint { font-size: 12px; color: var(--faint); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .icon { color: var(--faint); }
.palette-item.active { background: var(--accent-soft); }
.palette-item.active .icon, .palette-item.active .hint { color: var(--accent-text); }
.palette-empty { padding: 28px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--surface-2); }

/* ── login ──────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); }
.auth-art { position: relative; overflow: hidden; background: #070a16; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before { content: ''; position: absolute; inset: -20%; background:
  radial-gradient(40% 40% at 20% 25%, rgba(99, 102, 241, 0.55), transparent 70%),
  radial-gradient(35% 35% at 75% 30%, rgba(236, 72, 153, 0.4), transparent 70%),
  radial-gradient(45% 45% at 55% 85%, rgba(14, 165, 233, 0.35), transparent 70%);
  filter: blur(20px); animation: drift 18s ease-in-out infinite alternate; }
.auth-art::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent); }
@keyframes drift { to { transform: translate(4%, -3%) rotate(6deg) scale(1.05); } }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .logo-row { flex: none; align-self: flex-start; padding: 0; }
.auth-art .mark { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 8px; background: #12113a; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.auth-art .logo-row .lbl > span, .auth-art .logo-row > span > span { color: #b4bbd6; }
.auth-art h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; font-weight: 700; letter-spacing: -0.03em; max-width: 560px; }
.auth-art h1 em { font-style: normal; background: linear-gradient(90deg, #a5b4fc, #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: #b4bbd6; max-width: 480px; margin-top: 16px; font-size: 15.5px; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 560px; }
.feature { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); backdrop-filter: blur(6px); font-size: 13px; color: #d0d5e8; }
.feature .icon { color: #a5b4fc; margin-top: 1px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-box { width: min(380px, 100%); display: flex; flex-direction: column; gap: 22px; animation: rise 0.3s ease-out; }
.auth-box h2 { font-size: 24px; font-weight: 650; }
.auth-box .lead { color: var(--muted); margin-top: 6px; }
.code-input { letter-spacing: 0.5em; text-align: center; font-size: 20px; height: 52px; font-variant-numeric: tabular-nums; }
.strength { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; border-radius: 4px; transition: width 0.2s, background 0.2s; }

/* ── responsive ─────────────────────────── */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; z-index: 400; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform 0.2s ease; }
  .shell.collapsed { grid-template-columns: 1fr; }
  .collapse-btn { display: none; }
  .shell.nav-open .nav { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-grid; }
  .page-head { padding: 12px 16px; }
  .content { padding: 8px 16px 40px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .table .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .v { font-size: 22px; }
  .site-grid { grid-template-columns: 1fr; }
  .page-head .actions .lbl { display: none; }
}
