/* Hosting · cristiancode.dev — dashboard styles */

:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --bg-elev: #ffffff;
  --bg-subtle: #f3f4f6;
  --bg-muted: #e9eaee;
  --bg-inverse: #0b0d10;
  --fg: #0b0d10;
  --fg-muted: #4b5262;
  --fg-subtle: #6b7280;
  --fg-inverse: #f8fafc;
  --border: #e3e5ea;
  --border-strong: #cfd3db;
  --accent: #0d8f84;
  --accent-strong: #0b766d;
  --accent-fg: #ffffff;
  --accent-soft: #e0f5f2;
  --brand-a: #14b8a6;
  --brand-b: #6366f1;
  --ok: #15803d;
  --ok-dot: #22c55e;
  --ok-soft: #e7f7ec;
  --warn: #a15c07;
  --warn-dot: #f59e0b;
  --warn-soft: #fdf4e3;
  --err: #c81e1e;
  --err-dot: #ef4444;
  --err-soft: #fdecec;
  --info: #1d4ed8;
  --info-dot: #3b82f6;
  --info-soft: #e8f0fe;
  --idle-dot: #9ca3af;
  --violet: #6d28d9;
  --violet-soft: #f1ebfd;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 24px 48px -16px rgba(15, 23, 42, 0.28), 0 2px 8px rgba(15, 23, 42, 0.08);
  --ring: 0 0 0 3px rgba(13, 143, 132, 0.28);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --topbar: 60px;
  --tabs: 42px;
  --gutter: 24px;
  --log-bg: #0c0e12;
  --log-fg: #d6dae2;
  --log-muted: #6b7385;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0b0d;
    --bg-elev: #111317;
    --bg-subtle: #171a1f;
    --bg-muted: #1f232a;
    --bg-inverse: #f5f6f8;
    --fg: #eef0f3;
    --fg-muted: #a7aebb;
    --fg-subtle: #8a91a0;
    --fg-inverse: #0b0d10;
    --border: #23272f;
    --border-strong: #323843;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-fg: #04201d;
    --accent-soft: #0e2a28;
    --ok: #4ade80;
    --ok-soft: #10261a;
    --warn: #fbbf24;
    --warn-soft: #2b2110;
    --err: #f87171;
    --err-soft: #2c1414;
    --info: #93b4fd;
    --info-soft: #121d33;
    --violet: #c4b5fd;
    --violet-soft: #1f1834;
    --shadow-sm: none;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
    --ring: 0 0 0 3px rgba(45, 212, 191, 0.3);
    --log-bg: #07080a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0b0d;
  --bg-elev: #111317;
  --bg-subtle: #171a1f;
  --bg-muted: #1f232a;
  --bg-inverse: #f5f6f8;
  --fg: #eef0f3;
  --fg-muted: #a7aebb;
  --fg-subtle: #8a91a0;
  --fg-inverse: #0b0d10;
  --border: #23272f;
  --border-strong: #323843;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-fg: #04201d;
  --accent-soft: #0e2a28;
  --ok: #4ade80;
  --ok-soft: #10261a;
  --warn: #fbbf24;
  --warn-soft: #2b2110;
  --err: #f87171;
  --err-soft: #2c1414;
  --info: #93b4fd;
  --info-soft: #121d33;
  --violet: #c4b5fd;
  --violet-soft: #1f1834;
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
  --ring: 0 0 0 3px rgba(45, 212, 191, 0.3);
  --log-bg: #07080a;
}

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

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, kbd, pre, .mono { font-family: var(--mono); }
code { font-size: 0.92em; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.icon { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar);
  display: flex; align-items: center; gap: 18px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg-elev) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 650; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, 0.55);
}
.brand-mark svg { width: 15px; height: 15px; }
.brand-zone { color: var(--fg-subtle); font-weight: 500; }
.crumb-sep { color: var(--border-strong); font-size: 20px; font-weight: 300; margin: 0 -4px; }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--fg); font-weight: 550; }
.crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.nav a {
  color: var(--fg-muted); padding: 6px 10px; border-radius: 8px; font-weight: 500; white-space: nowrap;
}
.nav a:hover { color: var(--fg); background: var(--bg-subtle); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--fg); background: var(--bg-subtle); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px;
  min-width: 220px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-subtle);
  color: var(--fg-subtle); cursor: pointer;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--fg-muted); }
.search-trigger .kbd { margin-left: auto; }

.kbd {
  display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 6px;
  font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--fg-subtle);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--bg-elev);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--fg); font-weight: 550; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--border-strong); background: var(--bg-subtle); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--fg); border-color: var(--fg); color: var(--fg-inverse); }
.btn-primary:hover { background: color-mix(in srgb, var(--fg) 86%, var(--bg)); border-color: transparent; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-accent:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--fg-muted); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--fg); border-color: transparent; }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, var(--border)); }
.btn-danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn-danger-solid { background: var(--err-dot); border-color: var(--err-dot); color: #fff; }
.btn-danger-solid:hover { background: var(--err); border-color: var(--err); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--fg-subtle); border-right-color: transparent; animation: spin 0.7s linear infinite;
}
.btn-primary.is-busy::after, .btn-accent.is-busy::after { border-color: currentColor; border-color: var(--fg-inverse); border-right-color: transparent; }

.btn-group { display: inline-flex; }
.btn-group .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.btn-group .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* ---------- Layout ---------- */

.app-main { min-height: calc(100vh - var(--topbar)); }
.container { max-width: 1240px; margin: 0 auto; padding: 28px var(--gutter) 72px; }
.container-narrow { max-width: 860px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; font-weight: 650; line-height: 1.2; }
.page-head .lede { color: var(--fg-muted); margin-top: 6px; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.project-head { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; flex-wrap: wrap; }
.project-head h1 { font-size: 26px; font-weight: 650; overflow-wrap: anywhere; }
.project-head .page-head-actions { margin-left: auto; }
.project-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--fg-muted); margin: 6px 0 0 62px; }
.project-sub a { color: var(--fg-muted); }
.project-sub a:hover { color: var(--fg); }

/* The project tabs stay under the top bar while the page scrolls. The bar
   reaches into the container's side padding so the content slides under a
   full-width strip. It is opaque: text showing through would sit right behind
   the tab labels. */
.tabs-bar {
  position: sticky; top: var(--topbar); z-index: 30;
  margin: 18px calc(-1 * var(--gutter)) 24px; padding: 0 var(--gutter);
  background: var(--bg);
}
.tabs-bar:empty { display: none; }

/* The bar scrolls sideways only. The line under it is drawn inside the box,
   so the active tab's underline never makes it taller than itself; a
   horizontal scroller with any vertical overflow scrolls vertically on a phone. */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
  box-shadow: inset 0 -1px 0 var(--border); margin: 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; padding: 10px 12px; color: var(--fg-muted); font-weight: 500; white-space: nowrap;
}
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--fg); }
.tabs a[aria-current="page"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; border-radius: 2px; background: var(--fg);
}
.tab-count { margin-left: 6px; font-size: 11px; color: var(--fg-subtle); background: var(--bg-muted); border-radius: 999px; padding: 1px 6px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }
/* One column that may shrink: a line cut with an ellipsis inside must not
   widen the column past the screen. */
.vstack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ellipsis-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Cards ---------- */

.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head.card-head-center { align-items: center; }
.domain-form .input-group { max-width: 520px; }
.card-head .hint { color: var(--fg-subtle); font-size: 12.5px; }
.card-body { padding: 18px 20px; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-subtle);
  border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg);
}
.card + .card { margin-top: 16px; }
.section-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.section-lede { color: var(--fg-muted); margin: -4px 0 14px; }

.stat-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
@media (max-width: 1240px) {
  .stat-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* A card is a button for its filter (or a link, for Deploys today). */
.stat {
  display: block; width: 100%; min-width: 0; text-align: left; font: inherit; color: var(--fg); cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-sm); transition: border-color 0.12s, box-shadow 0.12s;
}
.stat:hover { border-color: var(--border-strong); text-decoration: none; }
.stat:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.stat.is-on { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.stat-label { color: var(--fg-subtle); font-size: 12px; font-weight: 550; text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.stat-label .icon { flex: none; }
.stat-value { display: block; font-size: 26px; font-weight: 650; margin-top: 4px; letter-spacing: -0.02em; }
.stat[data-tone="err"] .stat-value { color: var(--err); }
.stat[data-tone="warn"] .stat-value { color: var(--warn); }

/* ---------- Status ---------- */

.status {
  display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 9px 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--bg-subtle); color: var(--fg-muted); border: 1px solid transparent;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--idle-dot); flex: none; }
.status-ready, .status-live { background: var(--ok-soft); color: var(--ok); }
.status-ready::before, .status-live::before { background: var(--ok-dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok-dot) 22%, transparent); }
.status-failed, .status-crashed { background: var(--err-soft); color: var(--err); }
.status-failed::before, .status-crashed::before { background: var(--err-dot); }
.status-queued, .status-cloning, .status-preparing, .status-installing, .status-building, .status-starting, .status-publishing, .status-restarting {
  background: var(--warn-soft); color: var(--warn);
}
.status-queued::before, .status-cloning::before, .status-preparing::before, .status-installing::before,
.status-building::before, .status-starting::before, .status-publishing::before, .status-restarting::before {
  background: var(--warn-dot); animation: pulse 1.4s ease-in-out infinite;
}
.status-canceled, .status-skipped, .status-idle, .status-off { background: var(--bg-subtle); color: var(--fg-muted); }
.status-running { background: var(--ok-soft); color: var(--ok); }
.status-running::before { background: var(--ok-dot); }
.status.is-busy::before { animation: pulse 1.4s ease-in-out infinite; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--idle-dot); flex: none; }
.dot-ok { background: var(--ok-dot); }
.dot-warn { background: var(--warn-dot); }
.dot-err { background: var(--err-dot); }

@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--bg-subtle); color: var(--fg-muted);
  border: 1px solid var(--border);
}
.badge-accent { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.stack-badge { font-family: var(--font); }
span.stack { font-weight: 600; color: var(--accent-strong); }

.avatar {
  --hue: 180;
  width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 16px; color: hsl(var(--hue) 70% 22%);
  background: linear-gradient(135deg, hsl(var(--hue) 85% 86%), hsl(calc(var(--hue) + 40) 80% 78%));
  border: 1px solid hsl(var(--hue) 50% 80% / 0.6);
}
:root[data-theme="dark"] .avatar { color: hsl(var(--hue) 90% 88%); background: linear-gradient(135deg, hsl(var(--hue) 45% 26%), hsl(calc(var(--hue) + 40) 45% 20%)); border-color: hsl(var(--hue) 40% 30%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar { color: hsl(var(--hue) 90% 88%); background: linear-gradient(135deg, hsl(var(--hue) 45% 26%), hsl(calc(var(--hue) + 40) 45% 20%)); border-color: hsl(var(--hue) 40% 30%); }
}
.avatar-lg { width: 46px; height: 46px; font-size: 19px; border-radius: 13px; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
/* A project's own favicon in place of its initial, on a plain tile in both themes. */
:root .avatar.avatar-icon { display: block; background: var(--bg-elev); border-color: var(--border); padding: 5px; overflow: hidden; }
:root .avatar-lg.avatar-icon { padding: 6px; }
:root .avatar-sm.avatar-icon { padding: 3px; }
.avatar-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* ---------- Git accounts and the repository picker ---------- */

.account-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.account-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 6px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--fg); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
}
.account-chip:hover { border-color: var(--border-strong); }
.account-chip.is-on { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.account-chip img, .account-chip .account-mark { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.account-mark { display: grid; place-items: center; background: var(--bg-muted); color: var(--fg-muted); font-size: 11px; font-weight: 700; }
.account-chip .subtle { font-weight: 500; }
.repo-search { display: flex; gap: 8px; align-items: center; }
.repo-search .search { max-width: none; }
.repo-list { border: 1px solid var(--border); border-radius: var(--radius); max-height: 420px; overflow-y: auto; background: var(--bg-elev); }
.repo-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); min-width: 0; }
.repo-row:last-child { border-bottom: 0; }
.repo-row .grow { flex: 1; min-width: 0; }
.repo-name { font-weight: 600; overflow-wrap: anywhere; }
.repo-name .icon { color: var(--fg-subtle); vertical-align: -2px; margin-right: 4px; }
.repo-meta { color: var(--fg-subtle); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-row .btn { flex: none; }
.picked-repo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.picked-repo .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.connect-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.connect-option { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; background: var(--bg-elev); }
.connect-option.is-easy { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.connect-option h3 { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.connect-option p { color: var(--fg-muted); font-size: 13px; }
.connect-option .row { gap: 8px; }
.connect-option ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--fg-muted); font-size: 13px; }
.connect-option code { overflow-wrap: anywhere; }
.connect-step { font-size: 11px; font-weight: 700; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.06em; }
.key-box { font-family: var(--mono); font-size: 12px; padding: 8px 10px; border-radius: 8px; background: var(--bg-subtle); border: 1px solid var(--border); overflow-wrap: anywhere; user-select: all; }

/* ---------- Sign-in page (the dashboard from the internet) ---------- */

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px var(--gutter); background: var(--bg); }
.login-card { width: 100%; max-width: 380px; padding: 28px; display: grid; gap: 12px; }
.login-card h1 { font-size: 22px; font-weight: 650; }
.login-card .brand { margin-bottom: 4px; }

/* ---------- Toolbar ---------- */

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search {
  position: relative; flex: 1; min-width: 220px; max-width: 460px;
}
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--fg-subtle); }
.search input[type="search"], .search input { padding-left: 34px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
/* The filters in a toolbar stay on one line. When they do not fit, the line
   scrolls sideways instead of dropping a chip onto a second row. */
.toolbar .chips { flex-wrap: nowrap; min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
.toolbar .chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; white-space: nowrap;
  height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev);
  color: var(--fg-muted); font-weight: 550; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip:focus-visible { outline: none; box-shadow: var(--ring); }
.chip:hover { color: var(--fg); border-color: var(--border-strong); }
.chip.is-on { background: var(--fg); border-color: var(--fg); color: var(--fg-inverse); }
.chip-count { font-size: 11px; opacity: 0.7; }
.segmented { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--bg-muted); gap: 2px; }
.segmented button {
  height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--fg-subtle); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; font-weight: 550; font-size: 12.5px;
}
.segmented button[aria-pressed="true"] { background: var(--bg-elev); color: var(--fg); box-shadow: var(--shadow); }

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

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.project-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }

.project-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; animation: rise 0.2s ease-out;
  min-width: 0;
}
.project-card:hover { border-color: var(--border-strong); box-shadow: 0 8px 24px -14px rgba(15, 23, 42, 0.35); }
.card-head-row, .card-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.project-card .card-head { padding: 0; border: 0; justify-content: flex-start; }
.card-title { min-width: 0; flex: 1; }
.card-title h2 { font-size: 15.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.card-title h2 a { color: var(--fg); }
.card-title h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-domain { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 4px; color: var(--fg-muted); font-size: 13px; overflow-wrap: anywhere; }
.card-domain:hover { color: var(--accent-strong); }
.card-line { color: var(--fg-muted); font-size: 13px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-line.warn { color: var(--err); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--fg-subtle); font-size: 12.5px; }
.card-meta .item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.card-actions { position: relative; z-index: 1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.project-card .meta { color: var(--fg-subtle); font-size: 12.5px; overflow-wrap: anywhere; }
.project-card details.history { font-size: 12.5px; color: var(--fg-muted); position: relative; z-index: 1; }
.project-card details.history ol { margin: 6px 0 0; padding-left: 18px; }
.deploy-error { color: var(--err); }
.is-list .project-card { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 14px 16px; }
.is-list .project-card .card-line { -webkit-line-clamp: 1; flex: 1; min-width: 200px; }

.empty {
  display: grid; place-items: center; gap: 12px; text-align: center; padding: 56px 24px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--fg-muted); background: var(--bg-elev);
}
.empty h2, .empty h3 { color: var(--fg); font-size: 17px; }
.empty .icon-lg { width: 28px; height: 28px; color: var(--fg-subtle); }
.empty-inline { padding: 22px; text-align: center; color: var(--fg-subtle); }

/* ---------- Forms ---------- */

.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 13px; font-weight: 550; color: var(--fg); }
.field-hint { font-size: 12.5px; color: var(--fg-subtle); }
.field-error { font-size: 12.5px; color: var(--err); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

input[type="text"], input[type="search"], input[type="url"], input:not([type]), input[type="password"], select, textarea {
  width: 100%; min-width: 0; height: 36px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--fg);
  font-size: 14px; transition: border-color 0.12s, box-shadow 0.12s;
}
textarea { height: auto; min-height: 110px; padding: 10px 11px; line-height: 1.5; resize: vertical; font-family: var(--mono); font-size: 13px; }
input::placeholder, textarea::placeholder { color: var(--fg-subtle); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238a91a0' stroke-width='1.6'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 16px;
}
input.mono, textarea.mono { font-family: var(--mono); font-size: 13px; }
.input-group { display: flex; align-items: stretch; min-width: 0; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon {
  display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--border-strong); border-left: 0;
  border-radius: 0 8px 8px 0; background: var(--bg-subtle); color: var(--fg-subtle); white-space: nowrap; font-size: 13.5px;
}
.input-prefix { display: flex; align-items: stretch; }
.input-prefix .addon {
  display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--border-strong); border-right: 0;
  border-radius: 8px 0 0 8px; background: var(--bg-subtle); color: var(--fg-subtle); white-space: nowrap; font-family: var(--mono); font-size: 12.5px;
}
.input-prefix input { border-top-left-radius: 0; border-bottom-left-radius: 0; }

.choice-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice {
  position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--bg-elev); cursor: pointer;
}
.choice:hover { border-color: var(--fg-subtle); }
.choice input { margin: 3px 0 0; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: var(--ring); }
.choice strong { display: block; font-size: 13.5px; }
.choice span { color: var(--fg-subtle); font-size: 12.5px; }

.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13.5px; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; width: 36px; height: 21px; border-radius: 999px; background: var(--bg-muted); border: 1px solid var(--border-strong);
  transition: background 0.15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(15px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

details.disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); }
details.disclosure > summary {
  list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 550; display: flex; align-items: center; gap: 8px;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .icon { transition: transform 0.15s; color: var(--fg-subtle); }
details.disclosure[open] > summary .icon { transform: rotate(90deg); }
details.disclosure > .disclosure-body { padding: 4px 14px 16px; }

.note { color: var(--fg-muted); font-size: 13px; min-height: 1em; }
.note:empty { display: none; }
.dns-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-subtle); border: 1px solid var(--border); font-size: 12.5px; color: var(--fg-muted); }
.dns-note code { color: var(--fg); }

/* ---------- Callouts ---------- */

.callout {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-elev); margin-bottom: 16px; font-size: 13.5px;
}
.callout .icon { margin-top: 2px; }
.callout-body { flex: 1; min-width: 0; }
.callout-body strong { display: block; margin-bottom: 2px; }
.callout .btn { flex: none; }
.callout-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }
.callout-info .callout-body { color: var(--fg); }
.callout-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.callout-warn .icon { color: var(--warn); }
.callout-err { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.callout-err .icon { color: var(--err); }
.callout-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.callout-ok .icon { color: var(--ok); }
.callout-violet { background: var(--violet-soft); border-color: color-mix(in srgb, var(--violet) 25%, transparent); }
.callout-violet .icon { color: var(--violet); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; overflow-y: hidden; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 550; font-size: 12px; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.05em;
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--bg-subtle) 60%, transparent); }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table .mono { font-size: 12.5px; }

.list { display: grid; }
.list-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--border); min-width: 0;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: color-mix(in srgb, var(--bg-subtle) 55%, transparent); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 550; display: flex; align-items: center; gap: 8px; min-width: 0; }
.list-row .title a { color: var(--fg); }
.list-row .sub { color: var(--fg-subtle); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }

.deploy-row .sha { font-family: var(--mono); font-size: 12.5px; color: var(--fg); }
.deploy-row .status { min-width: 92px; justify-content: flex-start; }
.deploy-tags { display: flex; gap: 6px; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 18px; font-size: 13.5px; }
.kv dt { color: var(--fg-subtle); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.copy-field {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 6px 6px 11px; border-radius: 8px;
  background: var(--bg-subtle); border: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px;
}
.copy-field span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Production deployment hero ---------- */

.hero { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; overflow: hidden; }
.hero-shot {
  position: relative; min-height: 210px; border-right: 1px solid var(--border);
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--brand-a) 28%, transparent), transparent 60%),
    radial-gradient(120% 80% at 100% 100%, color-mix(in srgb, var(--brand-b) 26%, transparent), transparent 60%),
    var(--bg-subtle);
  display: grid; place-items: center; padding: 20px;
}
.hero-window {
  width: 100%; max-width: 250px; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-window-bar { display: flex; align-items: center; gap: 5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.hero-window-bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); display: block; }
.hero-window-body { padding: 14px 12px 16px; display: grid; gap: 7px; }
.hero-window-body b { display: block; height: 7px; border-radius: 4px; background: var(--bg-muted); }
.hero-window-body b:first-child { width: 55%; height: 10px; background: color-mix(in srgb, var(--accent) 35%, var(--bg-muted)); }
.hero-window-body b:nth-child(2) { width: 90%; }
.hero-window-body b:nth-child(3) { width: 75%; }
.hero-window-host { font-family: var(--mono); font-size: 11px; color: var(--fg-subtle); padding: 0 12px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The screenshot of the deploy being served, framed like a browser window. */
.hero.has-shot { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
.hero.has-shot .hero-shot { padding: 18px; }
.hero-window-shot { width: 100%; max-width: none; }
.hero-window-url { min-width: 0; flex: 1; margin-left: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--fg-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-window-url:hover { color: var(--fg); text-decoration: none; }
.hero-window-image { display: block; }
.hero-window-image img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; background: var(--bg-subtle); transition: opacity 0.15s; }
.hero-window-image:hover img { opacity: 0.92; }
.hero-retake {
  flex: none; margin-left: auto; width: 22px; height: 22px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--fg-subtle); cursor: pointer;
}
.hero-retake:hover { background: var(--bg-subtle); color: var(--fg); }
.hero-retake:focus-visible { outline: none; box-shadow: var(--ring); }
.hero-retake.is-busy { pointer-events: none; }
.hero-retake.is-busy .icon { animation: spin 0.9s linear infinite; }
.hero-shot-note { position: absolute; left: 0; right: 0; bottom: 12px; margin: 0; text-align: center; font-size: 12px; color: var(--fg-subtle); }

/* A deploy's page puts its screenshot beside its details. */
.deploy-info.has-shot { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 22px; align-items: start; }
.deploy-info-body { min-width: 0; }
.deploy-shot { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.deploy-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; background: var(--bg-subtle); }
.hero-body { padding: 20px 22px; display: grid; gap: 14px; min-width: 0; }
.hero-body .kv { grid-template-columns: 110px minmax(0, 1fr); }

.phase-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--bg-muted); }
.phase-bar span { display: block; height: 100%; }
.phase-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--fg-subtle); margin-top: 8px; }
.phase-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.ph-preparing { background: #94a3b8; }
.ph-installing { background: #6366f1; }
.ph-building { background: #14b8a6; }
.ph-starting { background: #f59e0b; }
.ph-publishing { background: #ec4899; }

.spark { display: block; width: 100%; height: 44px; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.spark path.area { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: none; }
.uptime-bars { display: flex; gap: 2px; height: 28px; align-items: stretch; }
.uptime-bars span { flex: 1; border-radius: 2px; background: var(--ok-dot); opacity: 0.85; }
.uptime-bars span.down { background: var(--err-dot); }
.uptime-bars span.none { background: var(--bg-muted); }
.metric { display: grid; gap: 2px; }
.metric b { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.metric span { font-size: 12px; color: var(--fg-subtle); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* ---------- Logs ---------- */

.log-shell { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid #1d2129; background: var(--log-bg); box-shadow: var(--shadow); }
.log-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #1d2129; background: #10131a; flex-wrap: wrap;
}
.log-toolbar .btn { background: transparent; border-color: #2a303b; color: #c9cfda; box-shadow: none; }
.log-toolbar .btn:hover { background: #1a1f28; border-color: #3a4250; color: #fff; }
.log-toolbar input { height: 28px; background: #0b0d12; border-color: #2a303b; color: #e6e9ef; font-size: 12.5px; max-width: 240px; }
.log-toolbar .log-title { color: #c9cfda; font-weight: 600; font-size: 12.5px; display: flex; gap: 8px; align-items: center; }
.log {
  margin: 0; max-height: 64vh; min-height: 220px; overflow: auto; padding: 10px 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  color: var(--log-fg); counter-reset: line;
}
.log.log-short { max-height: 260px; min-height: 80px; }
.log-line { display: grid; grid-template-columns: 46px 74px minmax(0, 1fr); gap: 0 10px; padding: 0 14px 0 0; white-space: pre-wrap; word-break: break-word; }
.log-line:hover { background: #151922; }
.log-line .n { color: #475063; text-align: right; user-select: none; }
.log-line .t { color: var(--log-muted); user-select: none; }
.log-line.k-step .m { color: #fff; font-weight: 600; }
.log-line.k-step .m::before { content: "▸ "; color: #2dd4bf; }
.log-line.k-info .m { color: #9fb2cc; }
.log-line.k-warn .m, .log-line.k-out .m.w { color: #fcd34d; }
.log-line.k-error .m, .log-line.k-out .m.e, .log-line.k-err .m { color: #fca5a5; }
.log-line.k-done .m { color: #86efac; }
.log-line.k-done .m::before { content: "✓ "; }
.log-line.k-system .m { color: #93c5fd; font-style: italic; }
.log-line.is-hidden { display: none; }
.log-empty { padding: 26px; color: var(--log-muted); font-family: var(--font); text-align: center; }
.log-foot { padding: 7px 14px; border-top: 1px solid #1d2129; color: var(--log-muted); font-size: 12px; display: flex; gap: 10px; align-items: center; background: #0e1117; }
.build-log {
  margin: 0; max-height: 160px; overflow: auto; background: var(--log-bg); color: var(--log-fg); border-radius: var(--radius);
  padding: 10px 12px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; position: relative; z-index: 1;
}

/* ---------- Menus, modals, toasts, palette ---------- */

.menu-anchor { position: relative; display: inline-flex; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 220px; padding: 5px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-lg);
  animation: rise 0.12s ease-out;
}
.menu button, .menu a {
  display: flex; width: 100%; align-items: center; gap: 9px; height: 34px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--fg); font-size: 13.5px; text-align: left; cursor: pointer; white-space: nowrap;
}
.menu button:hover, .menu a:hover, .menu button:focus-visible { background: var(--bg-subtle); text-decoration: none; box-shadow: none; }
.menu .danger { color: var(--err); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 2px; }

.overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: start center; padding: 12vh 16px 24px;
  background: rgba(8, 10, 14, 0.42); backdrop-filter: blur(3px); animation: fade 0.12s ease-out; overflow-y: auto;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 520px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); animation: rise 0.16s ease-out; overflow: hidden;
}
.modal-wide { max-width: 680px; }
.modal-head { padding: 18px 20px 6px; }
.modal-head h2 { font-size: 17px; font-weight: 650; }
.modal-head p { color: var(--fg-muted); margin-top: 6px; }
.modal-body { padding: 14px 20px 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-subtle); flex-wrap: wrap; }

.palette { max-width: 620px; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.palette-input input { border: 0; box-shadow: none !important; height: 32px; padding: 0; font-size: 15px; background: transparent; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-group { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.06em; }
.palette-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--fg); text-align: left; cursor: pointer; font-size: 14px;
}
.palette-item .hint { margin-left: auto; color: var(--fg-subtle); font-size: 12px; }
.palette-item.is-active { background: var(--bg-subtle); }
.palette-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--border); color: var(--fg-subtle); font-size: 12px; background: var(--bg-subtle); }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; width: min(380px, calc(100vw - 36px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--bg-elev); color: var(--fg);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: rise 0.18s ease-out; font-size: 13.5px;
}
.toast .icon { margin-top: 1px; }
.toast-ok .icon { color: var(--ok); }
.toast-err .icon { color: var(--err); }
.toast-info .icon { color: var(--info); }
.toast-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast button { border: 0; background: transparent; color: var(--fg-subtle); cursor: pointer; padding: 0; }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--bg-subtle) 0px, var(--bg-muted) 120px, var(--bg-subtle) 240px); background-size: 800px 100%; animation: shimmer 1.4s linear infinite; }

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

.settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar) + var(--tabs) + 20px); display: grid; gap: 2px; }
.settings-nav a { padding: 7px 10px; border-radius: 8px; color: var(--fg-muted); font-weight: 500; }
.settings-nav a:hover { color: var(--fg); background: var(--bg-subtle); text-decoration: none; }
.settings-nav a[aria-current="true"] { color: var(--fg); background: var(--bg-subtle); }
.settings-section { scroll-margin-top: calc(var(--topbar) + var(--tabs) + 16px); }

.rule-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 110px 70px 34px; gap: 8px; align-items: center; }
.rule-row.headers { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) 34px; }
.rule-head { font-size: 12px; color: var(--fg-subtle); font-weight: 550; }
.rules { display: grid; gap: 8px; }

.env-value { font-family: var(--mono); font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.env-value .masked { letter-spacing: 2px; color: var(--fg-subtle); }
.env-key { font-family: var(--mono); font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }

.timeline { display: grid; }
.timeline-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); align-items: start; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-subtle); color: var(--fg-muted); }
.timeline-icon.t-ok { background: var(--ok-soft); color: var(--ok); }
.timeline-icon.t-err { background: var(--err-soft); color: var(--err); }
.timeline-icon.t-warn { background: var(--warn-soft); color: var(--warn); }
.timeline-icon.t-info { background: var(--info-soft); color: var(--info); }
.timeline-icon.t-violet { background: var(--violet-soft); color: var(--violet); }
.timeline-time { color: var(--fg-subtle); font-size: 12.5px; white-space: nowrap; }

.connection { display: flex; gap: 14px; align-items: flex-start; }
.connection-logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; font-weight: 800; color: #fff; }
.logo-netlify { background: linear-gradient(135deg, #20c6b7, #0e8a7f); }
.logo-cloudflare { background: linear-gradient(135deg, #f6821f, #fbad41); }
.logo-node { background: linear-gradient(135deg, #3f873f, #5fa04e); }
.logo-git { background: linear-gradient(135deg, #f05133, #c73a20); }

.foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--fg-subtle); font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .search-trigger { min-width: 0; }
  .search-trigger .label { display: none; }
}

@media (max-width: 860px) {
  .topbar { gap: 10px; padding: 0 16px; }
  .nav { display: none; }
  .brand-zone, .crumb-sep, .crumb { display: none; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; display: flex; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; gap: 4px; padding-bottom: 4px; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav a { white-space: nowrap; }
  .hero, .hero.has-shot { grid-template-columns: minmax(0, 1fr); }
  .hero-shot { border-right: 0; border-bottom: 1px solid var(--border); min-height: 150px; }
  .deploy-info.has-shot { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-3, .form-grid, .choice-cards { grid-template-columns: minmax(0, 1fr); }
  .rule-row, .rule-row.headers { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rule-row > :nth-child(5), .rule-row.headers > :nth-child(4) { justify-self: start; }
  .project-sub { margin-left: 0; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .container { padding: 20px var(--gutter) 56px; }
  .page-head h1 { font-size: 24px; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-label { letter-spacing: 0.04em; }
  /* The chip line reaches the screen edges, like the tab bar, so a chip that
     does not fit scrolls under the edge instead of stopping at the margin. */
  .toolbar .chips { flex: none; width: calc(100% + 2 * var(--gutter)); max-width: none; gap: 5px; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
  .toolbar .chip { padding: 0 10px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar-actions .btn-label { display: none; }
  .search-trigger { width: 34px; justify-content: center; padding: 0; }
  .search-trigger .kbd { display: none; }
  .log-line { grid-template-columns: 34px minmax(0, 1fr); }
  .log-line .t { display: none; }
  .kv, .hero-body .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .list-row { padding: 12px 14px; flex-wrap: wrap; }
  .deploy-row .grow { flex: 1 1 100%; order: 3; }
  .deploy-row .deploy-tags { margin-left: auto; }
  .deploy-row .status { min-width: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table th, .table td { padding: 10px 12px; }
}

/* Small phones: the card labels drop their icons before they would run past
   the card, and wrap only on the narrowest screens. The chips tighten so the
   five filters still fit on one line at 360 px. */
@media (max-width: 380px) {
  .stat-label .icon { display: none; }
  .toolbar .chips { gap: 4px; }
  .toolbar .chip { padding: 0 8px; font-size: 12px; }
}

@media (max-width: 340px) {
  .stat-label { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
