:root {
  --bg: #faf7f3; --surface: #ffffff; --surface-2: #f1ece4; --border: #e3dcd0;
  --text: #1c2b33; --text-dim: #5c6b73; --text-faint: #93a0a6;
  --accent: #ff7b00; --accent-text: #c95f00; --accent-soft: #fff0dd; --on-accent: #052330;
  --secondary: #023047;
  --ok: #1a8a4a; --ok-soft: #e3f5ea; --warn: #a5690a; --warn-soft: #fbf0dd;
  --danger: #c8332a; --danger-soft: #fceeed; --sleep: #6b7684; --sleep-soft: #eceff2;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --radius: 8px; --shadow: 0 1px 2px rgba(2,48,71,0.07), 0 1px 1px rgba(2,48,71,0.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #05141c; --surface: #0d222c; --surface-2: #123040; --border: #1d3c4c;
    --text: #eef3f5; --text-dim: #9fb4bd; --text-faint: #5e7986;
    --accent: #ff8f2e; --accent-text: #ffb066; --accent-soft: #2b1c0d; --on-accent: #052330;
    --secondary: #6fb2cc;
    --ok: #3fb968; --ok-soft: #12291b; --warn: #d6a13a; --warn-soft: #2e2410;
    --danger: #f0665c; --danger-soft: #2e1614; --sleep: #8a97a3; --sleep-soft: #142027;
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
  }
}
:root[data-theme="dark"] {
  --bg: #05141c; --surface: #0d222c; --surface-2: #123040; --border: #1d3c4c;
  --text: #eef3f5; --text-dim: #9fb4bd; --text-faint: #5e7986;
  --accent: #ff8f2e; --accent-text: #ffb066; --accent-soft: #2b1c0d; --on-accent: #052330;
  --secondary: #6fb2cc;
  --ok: #3fb968; --ok-soft: #12291b; --warn: #d6a13a; --warn-soft: #2e2410;
  --danger: #f0665c; --danger-soft: #2e1614; --sleep: #8a97a3; --sleep-soft: #142027;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); }
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 36px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: flex; align-items: center; justify-content: center; color: var(--on-accent); font-weight: 800; font-size: 10.5px; letter-spacing: -0.02em; flex-shrink: 0; }
.brand-title { font-weight: 650; font-size: 15px; letter-spacing: 0.01em; }
.brand-title .brand-accent { color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--secondary); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: 13px; font-weight: 550; }
.user-org { font-size: 11px; color: var(--text-faint); cursor: pointer; }
.body { display: flex; flex: 1; min-height: 0; }
.sidebar { width: 240px; flex-shrink: 0; border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 14px 10px; }
.group-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); padding: 14px 8px 6px; }
.group-label:first-child { padding-top: 4px; }
.group-tag { font-size: 9px; padding: 1px 5px; border-radius: 4px; font-weight: 700; letter-spacing: 0.02em; background: var(--surface-2); color: var(--text-faint); }
.env-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); cursor: pointer; margin-bottom: 2px; border: 1px solid transparent; }
.env-item:hover { background: var(--surface-2); }
.env-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.env-item.active { background: var(--accent-soft); border-color: var(--accent); }
.env-item.active .env-name { color: var(--accent-text); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status-dot.healthy { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.status-dot.unhealthy, .status-dot.initial { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.status-dot.asleep { background: var(--sleep); }
.env-item-text { min-width: 0; flex: 1; }
.env-name { font-weight: 600; font-size: 13.5px; }
.version-tag { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--text-faint); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; }
.env-meta { font-size: 11.5px; color: var(--text-faint); }
.empty-group { padding: 10px 10px 4px; font-size: 12px; color: var(--text-faint); }
.main { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 44px 60px; }
.env-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.env-header h1 { font-size: 22px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.env-header .hostname { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); text-decoration: none; }
.env-header a.hostname:hover { color: var(--accent-text); text-decoration: underline; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.status-pill.healthy { background: var(--ok-soft); color: var(--ok); }
.status-pill.unhealthy, .status-pill.initial { background: var(--warn-soft); color: var(--warn); }
.status-pill.asleep { background: var(--sleep-soft); color: var(--sleep); }
.env-actions { display: flex; gap: 8px; position: relative; }
.btn { font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 6px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: var(--on-accent); }
.actions-trigger { display: inline-flex; align-items: center; gap: 7px; }
.actions-trigger svg { transition: transform .15s ease; }
.actions-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.actions-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 280px; padding: 6px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(2,48,71,0.16), var(--shadow); }
.actions-menu[hidden] { display: none; }
.actions-item { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: none; border-radius: 6px; background: none; color: var(--text); cursor: pointer; }
.actions-item .label { font-size: 13px; font-weight: 600; }
.actions-item .hint { font-size: 11.5px; font-weight: 400; color: var(--text-faint); }
.actions-item:hover, .actions-item:focus-visible { background: var(--surface-2); outline: none; }
.actions-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.actions-item:disabled { opacity: 0.5; cursor: not-allowed; }
.actions-item.danger .label { color: var(--danger); }
.actions-item.danger:hover, .actions-item.danger:focus-visible { background: var(--danger-soft); }
.actions-sep { height: 1px; margin: 4px 2px; background: var(--border); }
@media (max-width: 600px) { .actions-menu { right: auto; left: 0; } }
@media (prefers-reduced-motion: reduce) { .actions-trigger svg { transition: none; } }
.hidden { display: none !important; }
.spinner { width: 18px; height: 18px; flex-shrink: 0; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner.spinner-sm { width: 11px; height: 11px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.8s; } }
.loading-row { display: flex; align-items: center; gap: 10px; padding: 14px; color: var(--text-faint); font-size: 13px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { font: inherit; font-size: 13px; font-weight: 600; color: var(--text-dim); background: none; border: none; cursor: pointer; padding: 9px 4px; margin-right: 20px; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.view { display: none; }
.view.active { display: block; }
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: 1.3fr 1fr; }
@media (max-width: 900px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); font-weight: 650; }
.stat-tile .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-tile .label { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.stat-tile .bar { height: 5px; border-radius: 3px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.stat-tile .bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; gap: 12px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-dim); }
.kv .v { font-weight: 600; text-align: right; }
.kv .v.mono { font-family: var(--mono); font-weight: 500; font-size: 12.5px; word-break: break-all; }
.sha { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--accent-text); }
.ci-step { display: flex; align-items: center; gap: 9px; padding: 5px 2px; font-size: 13px; }
.ci-step .ci-step-icon { width: 16px; text-align: center; flex-shrink: 0; font-weight: 700; }
.ci-step .ci-step-icon.ok { color: var(--ok); }
.ci-step .ci-step-icon.danger { color: var(--danger); }
.ci-step .ci-step-icon.skip { color: var(--text-faint); }
.ci-step.active { color: var(--accent-text); font-weight: 600; }
.ci-link { font-size: 12.5px; font-weight: 600; color: var(--accent-text); text-decoration: none; }
.ci-link:hover { text-decoration: underline; }
/* History tab: a single centered reading column, one card per row --
   deliberately narrower than .main's full width (which stretches wide on
   a real monitor) so a short commit message doesn't sit inside an
   oversized card. */
.history-list { max-width: 760px; margin: 0 auto; }
#history-more-wrap { max-width: 760px; margin: 4px auto 0; text-align: center; }
.day-label { font-size: 12px; font-weight: 650; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; margin: 26px 2px 12px; }
.day-label:first-child { margin-top: 0; }
.commit-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; box-shadow: var(--shadow); transition: border-color .15s ease; }
.commit-card:hover { border-color: var(--accent); }
.commit-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.commit-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.commit-sub { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex-shrink: 0; }
.badge { font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.badge.ok, .badge.live { background: var(--ok-soft); color: var(--ok); }
.badge.live { background: var(--accent-soft); color: var(--accent-text); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.skip { background: var(--surface-2); color: var(--text-faint); }
.commit-count { font: inherit; font-size: 12px; font-weight: 600; color: var(--accent-text); background: none; border: none; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.commit-count:hover { text-decoration: underline; }
.commit-count:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.commit-count svg { transition: transform .15s ease; }
.commit-count[aria-expanded="true"] svg { transform: rotate(180deg); }
.commit-list { margin-top: 10px; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.commit-list-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: baseline; padding: 6px 10px; font-size: 12.5px; }
.commit-list-row + .commit-list-row { border-top: 1px solid var(--border); }
.commit-list-sha { font-family: var(--mono); font-size: 11.5px; color: var(--accent-text); text-decoration: none; }
a.commit-list-sha:hover { text-decoration: underline; }
.commit-list-msg { min-width: 0; overflow-wrap: anywhere; }
.commit-list-meta { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.commit-list-more { padding: 7px 10px; font-size: 12px; color: var(--text-faint); border-top: 1px solid var(--border); }
@media (prefers-reduced-motion: reduce) { .commit-count svg { transition: none; } }
@media (max-width: 700px) { .commit-list-row { grid-template-columns: 1fr; gap: 2px; } .commit-list-meta { white-space: normal; } }
.commit-hash { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
/* Live step-by-step breakdown, shown inline on whichever commit's own run
   is currently in flight -- see loadCiStatus/renderDeploymentSteps in
   static/js/app.js. Hidden and empty on every other commit's card. */
.deploy-steps { margin-top: 10px; padding: 10px 12px; border-radius: 6px; background: var(--surface-2); border: 1px dashed var(--border); }
.deploy-steps-head { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 6px; }
.btn-link { font: inherit; font-size: 12px; font-weight: 600; color: var(--accent-text); background: none; border: none; padding: 8px 0 0; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
/* Deliberately a fixed dark terminal look in both page themes, not the
   --secondary/--surface tokens -- those flip with light/dark mode, and a
   log block reads as a log block by staying dark regardless. */
.command-output { margin-top: 8px; padding: 10px 12px; border-radius: 6px; background: #0d222c; color: #d7e6ec; font-family: var(--mono); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow-y: auto; }
.logs-toolbar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); margin-bottom: 8px; flex-shrink: 0; }
.logs-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: logs-pulse 1.6s ease-in-out infinite; }
@keyframes logs-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .logs-live-dot { animation: none; } }
/* Height is set from JS (sizeLogsView() in app.js), measured against the
   actual remaining viewport space below this box -- a nested flex chain
   through .main (which also needs its own plain overflow-y:auto for
   every other tab) turned out to size indeterminately in practice rather
   than cleanly filling the container. This min-height is just the
   fallback for the brief moment before that JS runs. */
.logs-view { padding: 12px 14px; border-radius: 8px; background: #0d222c; color: #d7e6ec; font-family: var(--mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; min-height: 320px; overflow-y: auto; }
.logs-line { display: flex; gap: 10px; }
.logs-line + .logs-line { margin-top: 1px; }
.logs-ts { flex-shrink: 0; color: #6b8a97; }
.logs-msg { white-space: pre-wrap; word-break: break-word; }
.logs-empty { color: #6b8a97; font-style: italic; }
.logs-earlier-row { text-align: center; margin-bottom: 8px; }
.logs-earlier { font: inherit; font-size: 12px; font-weight: 600; color: #9fd0e3; background: rgba(159, 208, 227, 0.1); border: 1px solid rgba(159, 208, 227, 0.3); border-radius: 6px; padding: 4px 12px; cursor: pointer; }
.logs-earlier:hover:not(:disabled) { background: rgba(159, 208, 227, 0.2); }
.logs-earlier:disabled { opacity: 0.6; cursor: default; }
.logs-earlier-note { color: #6b8a97; font-size: 11px; font-style: italic; }
.instance-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.instance-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.instance-table td { padding: 10px; border-bottom: 1px solid var(--border); }
.instance-table tr:last-child td { border-bottom: none; }
.instance-table .mono { font-family: var(--mono); font-size: 12px; }
.table-wrap { overflow-x: auto; }
.alarm-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.alarm-row:last-child { border-bottom: none; }
.alarm-time { color: var(--text-faint); font-size: 12px; margin-left: auto; }
.backup-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.backup-row:last-child { border-bottom: none; }
.backup-icon { width: 30px; height: 30px; border-radius: 7px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--text-dim); }
.backup-title { font-size: 13.5px; font-weight: 600; }
.backup-sub { font-size: 12px; color: var(--text-faint); }
.backup-size { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-left: auto; }
.backup-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.backup-note { font-size: 11.5px; color: var(--text-faint); font-style: italic; }
#backups-more-wrap { text-align: center; margin-top: 14px; }
.btn-link.danger { color: var(--danger); }
.sleep-panel { text-align: center; padding: 56px 20px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface); }
.sleep-panel .moon { margin-bottom: 10px; color: var(--sleep); }
.sleep-panel h2 { font-size: 16px; margin: 0 0 6px; }
.sleep-panel p { color: var(--text-dim); font-size: 13.5px; max-width: 460px; margin: 0 auto 16px; }
.user-cell { display: flex; align-items: center; gap: 8px; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.role-select-input { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; cursor: pointer; }
.role-select-input:disabled { cursor: not-allowed; opacity: 0.7; }
.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(760px 420px at 85% -10%, var(--accent-soft) 0%, transparent 65%),
    var(--bg);
}
.home-main { flex: 1; }
.home-nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px 44px; background: var(--bg); border-bottom: 1px solid var(--border); }
.home-hero {
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 48px;
  max-width: 1080px; margin: 0 auto; padding: 88px 44px 80px;
}
.home-eyebrow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-text); margin-bottom: 14px; }
.home-hero h1 { font-size: 42px; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 18px; text-wrap: balance; }
.home-hero p { font-size: 15.5px; color: var(--text-dim); line-height: 1.65; margin: 0 0 30px; max-width: 460px; }
.home-cta { font-size: 13.5px; padding: 11px 22px; }

.home-preview { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 50px -20px rgba(2,48,71,0.28), var(--shadow); overflow: hidden; }
.home-preview-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.home-preview-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.home-preview-url { margin-left: 10px; font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.home-preview-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.home-preview-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: var(--surface-2); }
.home-preview-row > div:nth-child(2) { flex: 1; min-width: 0; }
.home-preview-name { font-size: 13px; font-weight: 650; }
.home-preview-meta { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }

.home-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 1080px; margin: 0 auto; padding: 0 44px 80px; }
@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; padding-top: 56px; }
  .home-preview { max-width: 440px; }
  .home-features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .home-features { grid-template-columns: 1fr; }
  .home-nav { padding: 16px 20px; }
  .home-hero { padding: 48px 20px 40px; gap: 32px; }
  .home-hero h1 { font-size: 32px; }
  .home-footer-inner { padding: 22px 20px; }
}
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 18px; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.feature-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.feature-icon-wrap { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feature-icon { width: 18px; height: 18px; color: var(--accent-text); }
.feature-card h3 { font-size: 14px; margin: 0 0 6px; }
.feature-card p { font-size: 12.5px; color: var(--text-faint); line-height: 1.5; margin: 0; }
.home-footer { border-top: 1px solid var(--border); background: var(--surface-2); }
.home-footer-inner { max-width: 1080px; margin: 0 auto; padding: 26px 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.home-footer-mark { width: 22px; height: 22px; font-size: 8.5px; }
.home-footer-brand { font-size: 12.5px; font-weight: 650; color: var(--text-dim); }
.home-footer-note { font-size: 12px; color: var(--text-faint); }
@media (prefers-reduced-motion: reduce) { .feature-card { transition: none; } }
.error-banner { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }

.slot-line { margin-top: 4px; font-size: 12.5px; color: var(--text-dim); }
.slot-line strong { color: var(--text); }
.dialog { overflow: hidden; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 16px 48px rgba(2,48,71,0.28); }
.dialog::backdrop { background: rgba(5, 20, 28, 0.55); }
.dialog-form { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; max-height: calc(100vh - 48px); box-sizing: border-box; }
.dialog-form h2 { margin: 0; font-size: 17px; }
.dialog-sub { margin: 0; font-size: 12.5px; color: var(--text-dim); }
.dialog-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-dim); }
.dialog-field input:not([type="radio"]):not([type="checkbox"]) { font: inherit; font-size: 13.5px; font-weight: 400; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.dialog-field input:not([type="radio"]):not([type="checkbox"]):focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.assign-list { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 2px; }
.assign-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.assign-item:hover:not(.disabled) { border-color: var(--accent); background: var(--surface-2); }
.assign-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.assign-item.disabled { opacity: 0.5; cursor: not-allowed; }
.assign-item input { margin-top: 3px; accent-color: var(--accent); }
.assign-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.assign-title { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.assign-meta { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-warn { margin: 0; padding: 8px 10px; font-size: 12.5px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }
.domain-input { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); overflow: hidden; }
.domain-input:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.domain-input input { flex: 1; min-width: 0; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 10px; border: none; background: transparent; color: var(--text); outline: none; }
.domain-input input[readonly] { color: var(--text-dim); }
.domain-suffix { display: flex; align-items: center; padding: 0 12px; font-family: var(--mono); font-size: 13px; color: var(--text-dim); background: var(--surface-2); border-left: 1px solid var(--border); }
.dns-panel { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 6px; background: var(--surface-2); }
.dns-title { font-size: 12.5px; }
.dns-record { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.dns-record > div { display: flex; align-items: baseline; gap: 10px; }
.dns-k { width: 52px; flex-shrink: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); font-weight: 650; }
.dns-v { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.dns-target { user-select: all; }
.dns-record .btn-link { padding: 0; }
.dns-status { font-size: 12.5px; font-weight: 600; }
.dns-status.ok { color: var(--ok); }
.dns-status.warn { color: var(--accent-text); }
.plain-input { font: inherit; font-size: 13.5px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); width: 100%; box-sizing: border-box; }
.plain-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dialog-field label { font-weight: 500; }
.dialog-field label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.dialog-field label.check input { margin: 0; accent-color: var(--accent); }
#restore-body { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
.dialog-form #restore-log { max-height: 260px; margin-top: 0; }
[hidden] { display: none !important; }
.dialog-field select.plain-input { appearance: auto; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.6s ease; }
.progress.indeterminate .progress-fill { width: 35%; animation: progress-slide 1.4s ease-in-out infinite; transition: none; }
@keyframes progress-slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .progress.indeterminate .progress-fill { animation: none; width: 100%; opacity: 0.4; } }
.progress-text { margin-top: 5px; font-size: 12.5px; color: var(--text-dim); }
.progress-text strong { color: var(--text); }
.error-banner .progress { background: rgba(255, 255, 255, 0.5); }
.error-banner .command-output { margin-top: 8px; }
.dialog-field .dialog-sub { font-weight: 400; }
