/* ox control plane theme
   All colors are tokens; light is the default, [data-theme="dark"] overrides. */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;

  /* light canvas: bone; surfaces: white */
  --bg: #F7F6F3;
  --card: #FFFFFF;
  --surface-alt: #FAFAF9;
  --border: #EAEAEA;
  --border-subtle: #F2F1ED;
  --border-hover: #D6D6D6;

  --text: #111111;
  --text-muted: #333333;
  --text-subtle: #777777;
  --text-dim: #9BA0A6;
  --strong: #111111;

  --accent: #0077E6;
  --nav-active: #EFEEEB;
  --kbd-bg: #F0EFEB;
  --code-bg: #101318;
  --code-text: #E6E8EC;

  --btn-dark-bg: #111111;
  --btn-dark-bg-hover: #2A2A2A;
  --btn-dark-text: #FFFFFF;

  --ok: #16A34A;
  --ok-bg: #E7F6EC;
  --ok-border: #C7EAD0;
  --ok-text: #15803D;

  --danger: #a52230;
  --danger-bg: #FBEEEF;

  --warn: #D97706;
  --warn-bg: #FDF3DC;
  --warn-border: #F5E4B3;
  --warn-text: #B45309;

  --stopped-bg: #F3F2EF;
  --stopped-dot: #9BA0A6;

  --radius-card: 14px;
  --radius-control: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --radius-pill: 999px;

  --shadow-sm: none;
  --shadow-card: none;
  --shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-popover: 0 10px 24px -6px rgba(0, 0, 0, 0.10), 0 4px 8px -4px rgba(0, 0, 0, 0.05);

  /* Motion: durations and easing live in tokens so every interaction
     shares one vocabulary. */
  --dur-fast: 120ms;
  --dur-normal: 200ms;
  --dur-slow: 300ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  --focus-ring: 0 0 0 2.5px rgba(0, 119, 230, 0.22);
}

* { box-sizing: border-box; }

/* One consistent focus ring for keyboard users across every control. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* A tapped element gets no gray flash; press feedback styles live on
   :active instead. */
html { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========= shell & sidebar ========= */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--strong);
  text-decoration: none;
  padding: 4px 6px 18px;
}
.brand-logo {
  display: block;
  height: 26px;
  width: auto;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.side-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-subtle);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.side-nav-item .nav-icon {
  flex-shrink: 0;
  color: inherit;
  opacity: 0.85;
}
.side-nav-item:hover {
  background: var(--surface-alt);
  color: var(--text);
}
.side-nav-item.active {
  background: var(--nav-active);
  color: var(--strong);
  font-weight: 600;
}
.side-nav-item.active .nav-icon {
  opacity: 1;
}
.side-nav-item .nav-icon-external {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.55;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sidebar-tagline-block {
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tagline-brand {
  font-size: 13px;
  font-weight: 800;
  color: var(--strong);
  letter-spacing: -0.02em;
}
.tagline-text {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.35;
}

/* ========= public pages header (landing, auth, docs, 404) ========= */
.topbar {
  height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}
.topbar-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--strong);
  letter-spacing: -0.02em;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar-left a { text-decoration: none; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* docs layout: sticky contents rail next to a bounded reading column */
.docs-layout {
  display: flex;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 36px;
}
.docs-toc {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
}
.docs-toc-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.docs-toc a {
  display: block;
  padding: 5px 0;
  color: var(--text-subtle);
  font-size: 13px;
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.docs-toc a:hover {
  color: var(--text);
  border-left-color: var(--border-hover);
}
.docs-content {
  flex: 1;
  min-width: 0;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (max-width: 960px) {
  .docs-toc { display: none; }
  .docs-layout { padding: 24px 20px; gap: 0; }
}
@media (max-width: 720px) {
  .topbar-left .user-email {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 26vw;
  }
}
/* The docs header carries the skill button too; on a phone its Features
   link gives way (the footer still has it). */
@media (max-width: 480px) { .topbar-actions .topbar-wide { display: none; } }

/* ========= main column ========= */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.mobile-nav-toggle {
  display: none;
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 40;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-popover);
  cursor: pointer;
  color: var(--text);
}

/* Theme toggle */
.theme-toggle-form { margin: 0; display: flex; }
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.theme-toggle-btn:hover {
  border-color: var(--border-hover);
  color: var(--strong);
}
.theme-toggle-btn svg { color: var(--text-subtle); }
.theme-toggle-btn:hover svg { color: var(--strong); }

/* Container */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 36px;
  width: 100%;
  box-sizing: border-box;
}

.skip-link { position: absolute; left: -999px; }
.skip-link:focus {
  left: 8px;
  top: 8px;
  z-index: 10;
  background: var(--card);
  padding: 8px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ========= page header ========= */
.dashboard-root {
  display: flex;
  flex-direction: column;
  gap: 20px;           /* vertical rhythm: cards breathe more */
}
.dashboard-header-area {
  margin-bottom: 24px;
}
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--strong);
  margin: 0;
  line-height: 1.2;
}
.page-title.project-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.page-title.project-title-with-icon span {
  display: inline-block;
}
.page-subtitle {
  font-size: 14px;
  color: var(--text-subtle);
  margin: 6px 0 0;
}
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-subtle);
  text-decoration: none;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.icon-link-btn:hover {
  color: var(--strong);
  border-color: var(--accent);
  background: var(--surface-alt);
}

/* ========= cards ========= */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.card h1, .card h2, .card h3 {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--strong);
}
.card-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.card-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--strong);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card-title-icon {
  color: var(--text-subtle);
  flex-shrink: 0;
}
.card-section-subtitle {
  font-size: 13px;
  color: var(--text-subtle);
  margin: 4px 0 0;
}

/* Status cards: saved / error notices render as a bordered card variant
   instead of inline hex styles. */
.card.notice-ok { border-color: var(--ok); }
.card.notice-err { border-color: var(--danger); }
.form-error {
  color: var(--danger);
}

/* Drawer panel fragments wrap their content in this shell (the dock
   fetches each panel into the shared drawer body). */
.accordion-body-inner {
  overflow: hidden;
  min-height: 0;
}

/* ========= interface scale slider ========= */
.ui-scale {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.ui-scale input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}
.ui-scale-label {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-dim);
}
.ui-scale-label.ui-scale-max {
  font-size: 18px;
  color: var(--text-subtle);
}
.ui-scale-value {
  min-width: 3ch;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

/* ========= service console: breadcrumbs, hero, duo ========= */
.svc-crumb {
  display: flex;
  gap: 6px;
  font-size: 13px;
  color: var(--text-subtle);
  margin-bottom: 4px;
}
.svc-crumb a { color: var(--text-subtle); text-decoration: none; }
.svc-crumb a:hover { color: var(--strong); }
.svc-crumb-sep { color: var(--border-hover); }

.svc-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 16px;
}
.svc-hero-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.svc-hero-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.svc-hero-unit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--ok-bg);
  color: var(--ok-text);
}
.svc-hero-unit[data-state="stopped"] {
  background: var(--kbd-bg);
  color: var(--text-subtle);
}
.svc-hero-value code { font-family: var(--font-mono); }
.svc-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
@media (max-width: 1100px) {
  .svc-duo { grid-template-columns: 1fr; }
}

/* ========= buttons ========= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    border-color var(--dur-fast) ease,
    background var(--dur-fast) ease,
    color var(--dur-fast) ease,
    filter var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out);
}
/* Press feedback: subtle scale so clicking feels responsive. */
.btn:active {
  transform: scale(0.97);
}
@media (prefers-reduced-motion: reduce) {
  .btn:active {
    transform: none;
  }
}
.btn-dark {
  background: var(--btn-dark-bg);
  border-color: var(--btn-dark-bg);
  color: var(--btn-dark-text);
}
.btn-dark:hover {
  background: var(--btn-dark-bg-hover);
  border-color: var(--btn-dark-bg-hover);
  color: var(--btn-dark-text);
}
.btn[disabled],
.btn[disabled]:hover {
  opacity: 0.55;
  cursor: default;
}
.btn-primary {
  background: var(--btn-dark-bg);
  border-color: var(--btn-dark-bg);
  color: var(--btn-dark-text);
}
.btn-primary:hover {
  background: var(--btn-dark-bg-hover);
  border-color: var(--btn-dark-bg-hover);
}
/* A primary link-button keeps its text color inside a card, whose links
   are accent-colored (the cloud login's Continue with GitHub). */
.card a.btn-primary { color: var(--btn-dark-text); }
.btn-secondary {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--surface-alt);
  border-color: var(--border-hover);
}
/* Toggles (autoscroll, wrap) express ON/OFF through aria-pressed. */
.btn[aria-pressed="false"] {
  color: var(--text-dim);
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-subtle);
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-alt);
}
.btn-danger {
  background: var(--danger-bg);
  border-color: transparent;
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
  filter: brightness(0.94);
}
.btn-sm {
  height: 31px;
  padding: 0 12px;
  font-size: 12.5px;
}
.btn.copied {
  color: var(--ok-text);
  background: var(--ok-bg);
  border-color: var(--ok-border);
}
.btn .copy-check path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  animation: copy-check-draw 0.25s var(--ease-out) forwards;
}
@keyframes copy-check-draw {
  to { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .btn .copy-check path {
    animation: none;
    stroke-dashoffset: 0;
  }
}
/* Completed get-started steps reuse the draw-in tick: rare, first-run
   page, so it earns a small delight budget. */
.step-check-icon polyline,
.step-check-icon path {
  fill: none;
  stroke: currentColor;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: copy-check-draw 0.25s var(--ease-out) forwards;
}
@media (prefers-reduced-motion: reduce) {
  .step-check-icon polyline,
  .step-check-icon path {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* ========= badges & status pills ========= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  background: var(--kbd-bg);
  color: var(--text-subtle);
  border: 1px solid var(--border-subtle);
}
.badge-green { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.badge-red { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge-amber { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.badge-blue { background: rgba(81, 157, 250, 0.14); color: var(--accent); border-color: transparent; }

/* Deploy run chip (git-node style) */
.deploy-run-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.deploy-run-chip.succeeded {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: none;
}
.deploy-run-chip.failed {
  background: var(--danger-bg);
  color: var(--danger);
  border: none;
}
.deploy-run-chip.pending {
  background: var(--warn-bg);
  color: var(--warn-text);
  border: none;
}

.status-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  border: 1px solid transparent;
}
.status-indicator-pill .status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.status-indicator-pill.running {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: var(--ok-border);
}
.status-indicator-pill.running .status-indicator-dot { background: var(--ok); }
.status-indicator-pill.stopped {
  background: var(--stopped-bg);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}
.status-indicator-pill.stopped .status-indicator-dot { background: var(--stopped-dot); }
.status-indicator-pill.deploying {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-border);
}
.status-indicator-pill.deploying .status-indicator-dot { background: var(--warn); }

/* ========= run state: spinner, green check, red cross ========= */
/* One spinning ring marks a run in flight, in the same dark yellow the
   deploying pill uses; it turns into a green check when the run succeeds. */
.spinner {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
  border-radius: 50%;
  border: 3px solid var(--warn);
  border-top-color: transparent;
  animation: ox-spin 0.8s linear infinite;
  display: block;
}
@keyframes ox-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
.run-state-icon { flex: none; }
.run-state-icon.ok { color: var(--ok); }
.run-state-icon.bad { color: var(--danger); }
.deploy-run-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-subtle);
}
.deploy-run-state[data-state="succeeded"] { color: var(--ok-text); }
.deploy-run-state[data-state="failed"] { color: var(--danger); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online { background: var(--ok); }
.status-dot.offline { background: var(--stopped-dot); }

/* ========= labels, text utils ========= */
.metric {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: -0.1px;
}
.label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text-subtle);
}
.dim { color: var(--text-subtle); }
.text-right { text-align: right; }
.run-time {
  font-size: 12px;
  color: var(--text-subtle);
}

/* ========= htmx error toast ========= */
#htmx-error.htmx-error-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: var(--btn-dark-text);
  padding: 10px 14px;
  border-radius: var(--radius-control);
  font-size: 13px;
  z-index: 9999;
  max-width: 80vw;
}

/* ========= forms ========= */
input[type="text"], input[type="email"], input[type="password"] {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-size: 13px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
}
input:focus-visible, select:focus-visible, .btn:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--strong);
  outline-offset: 1px;
}
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-size: 13px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  width: 100%;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.form-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.repo-feedback {
  font-size: 11px;
  color: var(--accent);
}
.input-action-group {
  display: flex;
  gap: 6px;
}
.input-with-leading-icon {
  position: relative;
  flex: 1;
}
.input-with-leading-icon .leading-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}
.input-with-leading-icon input {
  padding-left: 32px;
}
.select-wrapper select { width: 100%; }

/* ========= table toolbar (filters, search, sort) ========= */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition:
    border-color var(--dur-fast) ease,
    background var(--dur-fast) ease,
    color var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out);
}
.filter-pill:hover {
  border-color: var(--border-hover);
  background: var(--surface-alt);
}
.filter-pill.active {
  background: var(--btn-dark-bg);
  border-color: var(--btn-dark-bg);
  color: var(--btn-dark-text);
}
.filter-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--kbd-bg);
  color: var(--text-subtle);
}
.filter-pill.active .filter-count {
  background: rgba(255, 255, 255, 0.22);
  color: var(--btn-dark-text);
}
[data-theme="dark"] .filter-pill.active .filter-count {
  background: rgba(11, 12, 14, 0.16);
  color: var(--btn-dark-text);
}

.toolbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 0 10px;
  transition: border-color var(--dur-fast) ease;
}
.search-input-wrapper:focus-within {
  border-color: var(--strong);
}
.search-icon {
  color: var(--text-subtle);
  flex-shrink: 0;
}
.search-input-wrapper input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  width: 170px;
  padding: 0;
  height: 100%;
}
.shortcut-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-subtle);
  background: var(--kbd-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  user-select: none;
}
.sort-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 0 10px;
}
.sort-prefix {
  font-size: 12px;
  color: var(--text-subtle);
}
.sort-dropdown {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  height: 100%;
  width: auto;
}

/* ========= data table ========= */
.table-container-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 24px;
}
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
}
.ox-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.ox-table th {
  padding: 11px 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.ox-table td {
  padding: 14px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.ox-table tr:last-child td { border-bottom: none; }
.ox-table tbody tr:hover td { background: var(--surface-alt); }

/* table cells */
.col-project-info { display: flex; align-items: center; gap: 12px; }
.project-avatar-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--kbd-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.project-name-group { display: flex; flex-direction: column; gap: 2px; }
.project-name-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--strong);
  text-decoration: none;
}
.project-name-link:hover { text-decoration: underline; }
.project-domain-sub {
  font-size: 11.5px;
  color: var(--text-subtle);
}

.col-repo-info { display: flex; flex-direction: column; gap: 2px; }
.repo-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.repo-icon { color: var(--text-subtle); flex-shrink: 0; }
.repo-branch-line {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-subtle);
}
.git-branch-icon { color: var(--text-dim); }

.col-server-info { display: flex; flex-direction: column; gap: 2px; }
.server-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.server-role-sub {
  font-size: 11.5px;
  color: var(--text-subtle);
}


.col-deploy-time { display: flex; flex-direction: column; gap: 2px; }
.time-ago-text { font-size: 13px; color: var(--text); }
.duration-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-subtle);
}

/* empty states */
.empty-table-state { padding: 48px 24px; text-align: center; }
/* The no-filter-match state toggles via style.display; @starting-style
   turns the display jump into a quick fade-in. */
#no-filter-match-state {
  transition: opacity var(--dur-normal) ease;
  @starting-style {
    opacity: 0;
  }
}
.empty-state-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--kbd-bg);
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--strong);
  margin: 0 0 4px;
}
.empty-state-sub {
  font-size: 13px;
  color: var(--text-subtle);
  margin: 0;
}

/* ========= create project drawer ========= */
.project-drawer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 24px;
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.drawer-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--strong);
}
.drawer-subtitle {
  font-size: 13px;
  color: var(--text-subtle);
  margin: 4px 0 0;
}
.btn-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}
.btn-drawer-close:hover {
  background: var(--kbd-bg);
  color: var(--text);
}
.drawer-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.drawer-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

/* ========= servers grid ========= */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.server-card-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur-normal) ease, box-shadow var(--dur-normal) ease;
}
a.server-card-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}
.server-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.server-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.server-box-icon { color: var(--text-subtle); }
.server-name-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.server-card-body { font-size: 12px; }
.server-meta-item { display: flex; align-items: center; gap: 6px; }
.server-meta-label { color: var(--text-subtle); }
.server-meta-val {
  font-family: var(--font-mono);
  color: var(--text);
}
.add-server-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}
.add-server-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--kbd-bg);
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.add-server-sub {
  font-size: 12px;
  color: var(--text-subtle);
}
.empty-server-hint {
  padding: 24px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
}
.empty-server-hint a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

/* ========= onboarding stepper ========= */
.stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stepper li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
}
.stepper li.done { border-color: var(--ok-border); }
.step-num {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--kbd-bg);
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 600;
}
.step-num svg { color: var(--ok); }
li.done .step-num {
  background: var(--ok-bg);
  color: var(--ok);
  border: none;
}
.stepper h3 { margin: 0 0 4px; font-size: 14px; }
.stepper p { margin: 0; font-size: 13px; color: var(--text-subtle); }
.stepper p a, .card a { color: var(--accent); text-decoration: none; }
.stepper p a:hover, .card a:hover { text-decoration: underline; }

/* ========= project detail utilities ========= */
.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.project-row:last-child { border-bottom: none; }
.project-row a { color: var(--text); text-decoration: none; font-weight: 600; }
.deploy-commit {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-subtle);
}
.danger-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.power-form {
  margin: 0;
  display: inline-flex;
}
.project-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.deploy-row-main code { overflow-wrap: anywhere; }
.deploy-row-main {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.deploy-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.deploy-branch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--text);
  flex: none;
}
.deploy-branch-icon { flex: none; }
a.commit-link {
  color: inherit;
  text-decoration: none;
}
a.commit-link:hover { text-decoration: underline; }
.deploy-subject {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.deploy-op {
  text-transform: lowercase;
  flex: none;
}
.deploy-log-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}
.deploy-ctl-card {
  padding: 16px 20px;
}
.deploy-ctl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.deploy-ctl-brief {
  flex: 1;
  min-width: 0;
}
.deploy-brief-text {
  font-size: 13px;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deploy-ctl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.deploy-ctl-actions .deploy-form {
  margin: 0;
  display: inline-flex;
}
.deploy-ctl-actions .deploy-btn {
  white-space: nowrap;
  height: 34px;
}
.release-pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.release-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  cursor: pointer;
  font-size: 13px;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.release-pick-row:hover { background: var(--surface-alt); }
.release-pick-row:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-alt);
}
.release-pick-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  flex: 1;
}
.release-pick-subject {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
}
.release-pick-hash {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-subtle);
  flex-shrink: 0;
}

/* ========= commits drawer (§2.18) & environments panel (§2.19) ========= */
.commit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.commit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.commit-row:hover { background: var(--surface-alt); }
.commit-row.is-live { border-color: var(--ok-border); }
.commit-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.commit-subject {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.commit-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.commit-hash {
  font-family: var(--font-mono);
  color: var(--text-subtle);
}
.commit-branch {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--kbd-bg);
  color: var(--text-subtle);
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  flex-shrink: 0;
}
.commit-branch.commit-live {
  background: var(--ok-bg);
  color: var(--ok-text);
}
.commit-deploy-form { flex-shrink: 0; }
.commit-sync-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-control);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-word;
}
.commit-sync-error svg { flex-shrink: 0; margin-top: 2px; }
.commit-target-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.commit-target-select { width: auto; min-width: 160px; height: 28px; padding: 0 8px; }
.env-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}
.env-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.env-row-name { font-size: 13px; color: var(--text); }
.env-row-meta { font-size: 12px; color: var(--text-subtle); }
.env-create-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.env-create-form .commit-target-label { flex-direction: column; align-items: stretch; gap: 4px; margin-bottom: 0; width: 100%; }
.env-domain-input { height: 32px; }

.deploy-detail {
  padding: 0 0 14px;
  color: var(--text-subtle);
  font-size: 13px;
  line-height: 1.5;
  border-bottom: 1px solid var(--border-subtle);
  word-break: break-word;
}
.deploy-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
}
.deploy-pager a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.deploy-pager a:hover {
  background: var(--surface-alt);
  border-color: var(--border-hover);
}

/* ========= code snippets & env editor ========= */
.snippet {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-control);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  white-space: pre;
}
.sq-log {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-control);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  min-height: 120px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
}
.sq-log.nowrap {
  white-space: pre;
  word-break: normal;
}
/* ========= live logs card & filter toolbar ========= */
.log-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.log-header-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.log-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.log-header-actions .btn {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-control);
  white-space: nowrap;
}
.log-header-actions .btn-icon {
  width: 28px;
  padding: 0;
}

.log-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.log-filter-group-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.log-search-toggle-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
}
.log-quick-presets {
  display: flex;
  align-items: center;
  gap: 4px;
}
.log-preset-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-right: 2px;
  letter-spacing: 0.04em;
}
.log-preset-btn {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
}
.log-preset-btn.active {
  background: var(--btn-dark-bg);
  color: var(--btn-dark-text);
  border-color: var(--btn-dark-bg);
}
.log-filter-group-query {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.log-unit-select {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 6px;
  width: auto;
  min-width: 110px;
  max-width: 130px;
  cursor: pointer;
  background-color: var(--card);
  flex-shrink: 0;
}
.log-time-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}
.log-filter-field {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.log-filter-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
input[type="text"].log-time-input,
.log-time-input {
  height: 28px;
  width: 120px;
  flex: none;
  box-sizing: border-box;
  padding: 0 8px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
}
input[type="text"].log-time-input:focus,
.log-time-input:focus {
  outline: 2px solid var(--strong);
  outline-offset: 1px;
}
input[type="text"].log-time-input::placeholder,
.log-time-input::placeholder {
  color: var(--text-muted);
}
.log-filter-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.log-filter-actions .btn {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.project-live-log-viewer {
  min-height: 300px;
  max-height: 520px;
  overflow-y: auto;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-control);
  white-space: pre-wrap;
  word-break: break-all;
}
/* log syntax tokens on the fixed dark log surface */
.log-time { color: #8A9098; }
.log-unit { color: #7DD3FC; }
.log-warn { color: #FBBF24; font-weight: 600; }
.log-info { color: #4ADE80; font-weight: 600; }
.log-debug { color: #C4B5FD; font-weight: 600; }
.log-url { color: #93C5FD; }
.log-jkey { color: #93C5FD; }
.log-jstr { color: #FDBA74; }
.log-jbool { color: #C4B5FD; }
.log-jnull { color: #C4B5FD; }
.env-editor {
  width: 100%;
  box-sizing: border-box;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  resize: none;
  overflow-y: auto;
  /* Root-size-fix (no JS): modern browsers size fields intrinsically
     from their content; fallback JS below still handles empty files. */
  field-sizing: content;
}

/* ========= log search ========= */
.log-search {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.log-search[hidden] { display: none; }
.log-search-input {
  width: 170px;
  height: 28px;
  box-sizing: border-box;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 12px;
}
.log-search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.log-search-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 4ch;
  text-align: center;
  white-space: nowrap;
}
.log-search-fuzzy[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}
/* Matched text on the fixed dark log surface: the accent-blue tint must
   stay readable in both themes and never fight the token colors. */
mark.log-hit {
  background: rgba(81, 157, 250, 0.35);
  color: inherit;
  padding: 0;
  border-radius: 2px;
}
mark.log-hit.is-current { background: rgba(81, 157, 250, 0.65); }
.log-line.log-hit-line { background: rgba(81, 157, 250, 0.06); }

/* Wheel scroll dies at the viewer's edge instead of chaining to the page
   behind it (the modal has no backdrop element); scrolling stays native. */
#live-logs-stream {
  overscroll-behavior: contain;
}

/* ========= log jump-to-edge buttons ========= */
.log-jump-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}
.log-jump-group {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-jump-btn {
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--dur-fast) ease, visibility var(--dur-fast) ease;
  box-shadow: var(--shadow-popover);
}
.log-jump-btn.visible {
  visibility: visible;
  opacity: 1;
}

/* ========= offline-server modal ========= */
.offline-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
}
.offline-modal-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 24px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-popover);
}
.offline-modal-box h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--danger);
}
.offline-modal-box p {
  margin: 0 0 12px;
  color: var(--text-muted);
}
.offline-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: none;
  color: var(--text-subtle);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.offline-modal-close:hover { color: var(--text); }

/* ========= gate + dns hint modals ========= */
.gate-modal,
.dns-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
}
.gate-modal[hidden],
.dns-modal[hidden] { display: none; }
.gate-modal-box,
.dns-modal-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 24px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-popover);
}
.gate-modal-box h2,
.dns-modal-box h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.gate-modal-box h2 { color: var(--danger); }
.gate-modal-box p,
.dns-modal-box p {
  margin: 0 0 12px;
  color: var(--text-muted);
}
.gate-modal-error {
  max-height: 200px;
  overflow: auto;
  margin: 0 0 12px;
  white-space: pre-wrap;
}
.gate-modal-hint { color: var(--text); }
.gate-modal-docs {
  font-size: 13px;
  color: var(--accent);
}

/* ========= delete confirmation modal ========= */
.delete-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
}
.delete-modal[hidden] { display: none; }
.delete-modal-backdrop {
  position: absolute;
  inset: 0;
}
.delete-modal-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 24px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-popover);
}
/* Every confirm/hint modal box enters the same way: quick scale+fade.
   The summary modal keeps its own slide-in the full-width variant needs. */
.delete-modal-box,
.gate-modal-box,
.dns-modal-box,
.offline-modal-box {
  animation: ox-box-in var(--dur-normal) var(--ease-out);
}
@keyframes ox-box-in {
  from { opacity: 0; transform: scale(0.97); }
}
@media (prefers-reduced-motion: reduce) {
  .delete-modal-box,
  .gate-modal-box,
  .dns-modal-box,
  .offline-modal-box {
    animation: none;
  }
}
.delete-modal-box h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--danger);
}
.delete-modal-box p {
  margin: 0 0 14px;
  color: var(--text-muted);
}
.delete-keep-heading {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-subtle);
}
.delete-keep-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.delete-keep-row:hover { border-color: var(--border-hover); }
.delete-keep-row input[type="checkbox"] {
  flex: none;
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}
.delete-keep-title {
  display: block;
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text);
}
.delete-keep-note {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-subtle);
}
.delete-keep-note code { font-size: 11.5px; }
.delete-keep-row.is-empty {
  cursor: default;
  border-style: dashed;
}
.delete-keep-row.is-empty .delete-keep-title { color: var(--text-subtle); }
.delete-complete h2 { color: var(--text); }
.delete-warnings {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.delete-warnings li {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: 10px;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ========= landing page ========= */
.hero { padding: 96px 24px 48px; text-align: center; }
.hero h1 { font-size: 40px; letter-spacing: -0.5px; margin: 0 0 12px; }
.hero .hero-sub { max-width: 560px; margin: 0 auto 24px; color: var(--text-subtle); }
.hero-cta { display: flex; gap: 10px; justify-content: center; }
.section { max-width: 900px; margin: 0 auto; padding: 48px 24px; }
.section h2 { margin: 0 0 6px; }
.section-sub { color: var(--text-subtle); margin: 0 0 24px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ========= dark theme ========= */
[data-theme="dark"] {
  --bg: #0B0C0E;
  --card: #15161A;
  --surface-alt: #17191E;
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-hover: rgba(255, 255, 255, 0.16);

  --text: #EDEDED;
  --text-muted: #B4B7BC;
  --text-subtle: #999999;
  --text-dim: #6B7280;
  --strong: #EDEDED;

  --nav-active: rgba(255, 255, 255, 0.07);
  --kbd-bg: rgba(255, 255, 255, 0.07);
  --code-bg: #08090B;
  --code-text: #C9CDD3;

  --btn-dark-bg: #EDEDED;
  --btn-dark-bg-hover: #FFFFFF;
  --btn-dark-text: #0B0C0E;

  --ok: #34D399;
  --ok-bg: rgba(52, 211, 153, 0.12);
  --ok-border: rgba(52, 211, 153, 0.28);
  --ok-text: #34D399;

  --danger: #ef8d97;
  --danger-bg: color-mix(in srgb, #701a23 30%, transparent);

  --warn: #FBBF24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --warn-border: rgba(251, 191, 36, 0.28);
  --warn-text: #FBBF24;

  --stopped-bg: rgba(255, 255, 255, 0.07);
  --stopped-dot: #6B7280;

  --shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-popover: 0 10px 24px -6px rgba(0, 0, 0, 0.5), 0 4px 8px -4px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] img,
[data-theme="dark"] video {
  filter: brightness(0.95);
}

/* ========= database restore ========= */
.rollback-db-warning {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-control);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.rollback-warning-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.restore-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.restore-drop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  width: 100%;
  padding: 8px 14px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-control);
  background: var(--surface-alt);
  color: var(--text-subtle);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.restore-drop:hover,
.restore-drop:focus-within {
  border-color: var(--accent);
  color: var(--text-muted);
}
.restore-drop input[type="file"] {
  max-width: 220px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-subtle);
}
.restore-dump {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.restore-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-control);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
}
.restore-running {
  display: flex;
  align-items: center;
  gap: 10px;
}
.restore-uploading {
  font-size: 12.5px;
  color: var(--text-subtle);
}
.restore-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.restore-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* htmx request feedback: htmx toggles .htmx-request on the issuing
   element, revealing any .htmx-indicator inside it (the restore upload's
   spinner). */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-flex;
}

/* ========= responsive ========= */
@media (max-width: 1120px) {
  .log-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .log-filter-group-presets {
    width: 100%;
    flex: none;
  }
  .log-filter-group-query {
    margin-left: 0;
    width: 100%;
    flex: none;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 960px) {
  .log-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .log-header-title-group {
    justify-content: space-between;
    width: 100%;
  }
  .log-header-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .log-header-actions::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 768px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    display: none;
  }
  .sidebar.mobile-open { display: flex; }
  .mobile-nav-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .container { padding: 20px 16px; }
  .page-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-tools { justify-content: space-between; }
}

@media (max-width: 680px) {
  .deploy-ctl-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .deploy-ctl-brief {
    width: 100%;
  }
  .deploy-ctl-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .deploy-ctl-actions .deploy-form {
    width: 100%;
  }
  .deploy-ctl-actions .deploy-btn {
    width: 100%;
    height: 38px;
    justify-content: center;
    font-size: 13px;
  }
  .log-filter-toolbar {
    gap: 8px;
  }
  .log-filter-group-presets {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .log-filter-group-presets::-webkit-scrollbar {
    display: none;
  }
  .log-quick-presets {
    flex-shrink: 0;
  }
  .log-filter-group-query {
    width: 100%;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-left: 0;
  }
  .log-unit-select {
    width: 100%;
    max-width: none;
  }
  .log-time-inputs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .log-filter-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }
  input[type="text"].log-time-input,
  .log-time-input {
    width: 100%;
    height: 32px;
    font-size: 12px;
  }
  .log-filter-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .log-filter-actions .btn {
    width: 100%;
    height: 32px;
    justify-content: center;
  }
  .project-live-log-viewer {
    min-height: 240px;
    max-height: 380px;
    font-size: 11.5px;
    padding: 10px;
  }
  .project-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .project-meta {
    width: 100%;
    justify-content: flex-start;
  }
  .restore-form {
    flex-direction: column;
    align-items: stretch;
  }
  .restore-drop {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ---------- service console (PRD §2.17) ---------- */

.svc-console-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.svc-console-back { color: var(--text-subtle); text-decoration: none; font-weight: 600; }
.svc-console-back:hover { color: var(--text); }
.svc-console-sep { color: var(--text-subtle); font-weight: 400; }

.svc-conn-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.svc-conn-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border-subtle);
}
.svc-conn-row:last-child { border-bottom: none; }
.svc-conn-key { font-size: 12px; font-weight: 600; color: var(--text-subtle); min-width: 130px; }
.svc-conn-value {
  font-family: var(--font-mono); font-size: 12px; flex: 1; min-width: 0;
  overflow-wrap: anywhere; color: var(--text);
}
.svc-args-table { margin-top: 8px; }

.svc-op-output { margin: 10px 0 0; max-height: 220px; overflow: auto; }

.svc-action-list { display: flex; flex-direction: column; }
.svc-action-list form { border-bottom: 1px solid var(--border-subtle); }
.svc-action-list form:last-child { border-bottom: none; }
.svc-action-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 0;
}
.svc-action-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.svc-action-label { font-size: 13px; font-weight: 600; color: var(--text); }
.svc-action-desc { font-size: 12px; color: var(--text-subtle); }

.svc-inline-form { display: inline-block; }
.ox-table-actions-col { text-align: right; white-space: nowrap; }
.ox-table-actions-col .btn, .ox-table-actions-col a.btn { margin-left: 6px; }

.svc-manage-link { color: var(--text); text-decoration: none; font-weight: 600; }
.svc-manage-link:hover { text-decoration: underline; }

.redis-search-form { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.redis-search-input {
  flex: 1; min-width: 0; height: 32px; padding: 0 12px;
  border: 1px solid var(--border-subtle); border-radius: 6px;
  background: var(--bg); color: var(--text); font-size: 13px;
  font-family: var(--font-mono);
}
.redis-key-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  text-align: left; overflow-wrap: anywhere;
}
.redis-key-link:hover { color: var(--accent); text-decoration: underline; }

.redis-value-box { margin-top: 14px; border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.redis-value-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.redis-value-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.redis-value-key { font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.redis-value-pre { margin: 0; max-height: 320px; overflow: auto; }

.s3-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.s3-settings-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-subtle); }
.s3-settings-field input {
  height: 32px; padding: 0 10px; border: 1px solid var(--border-subtle);
  border-radius: 6px; background: var(--bg); color: var(--text); font-size: 13px;
  font-weight: 400;
}
.s3-settings-wide { grid-column: 1 / -1; }

.upload-btn {
  margin-top: 0.5rem;
}

@media (max-width: 720px) {
  .svc-conn-row { flex-wrap: wrap; }
  .s3-settings-grid { grid-template-columns: 1fr; }
  .ox-table-actions-col .btn, .ox-table-actions-col a.btn { margin-left: 0; margin-right: 6px; }
}

/* History rows open their run log on click (the log button stays for
   keyboards); the commit link inside keeps its own navigation. */
.deploy-history-row[data-job] { cursor: pointer; }
.deploy-history-row[data-job]:hover .deploy-row-main { opacity: 0.85; }

/* ---------- host strip (dashboard) ---------- */

.host-strip {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.host-stat { display: flex; flex-direction: column; gap: 2px; }
.host-stat + .host-stat { padding-left: 28px; border-left: 1px solid var(--border-subtle); }
.host-stat-value { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.1px; white-space: nowrap; }
.host-stat-label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-subtle); }

@media (max-width: 560px) {
  .host-strip { gap: 12px; }
  .host-stat + .host-stat { padding-left: 12px; }
  .host-stat-value { font-size: 15px; line-height: 20px; }
}
.host-stat-icon { display: flex; align-items: center; gap: 8px; color: var(--text-subtle); }
.host-stat-bar {
  width: 140px; height: 4px; border-radius: 2px; overflow: hidden;
  background: color-mix(in srgb, var(--border-subtle) 60%, var(--bg));
}
.host-stat-bar-fill { height: 100%; border-radius: 2px; background: var(--accent); }
.host-stat-bar.warm .host-stat-bar-fill { background: #D9772C; }

/* ========= legal pages and the public footer ========= */
.legal h2 { margin: 28px 0 8px; font-size: 18px; line-height: 24px; }
.legal h3 { margin: 18px 0 6px; font-size: 15px; line-height: 20px; }
.legal p, .legal li { font-size: 14px; line-height: 22px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal .updated { margin: 0 0 12px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-subtle); }
.legal-table { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 13px; line-height: 20px; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--border); }
.site-foot { text-align: center; margin-top: 48px; padding-bottom: 32px; font-size: 12px; line-height: 16px; color: var(--text-subtle); }
.site-foot a { color: inherit; text-decoration: underline; }
.site-foot .sep { margin: 0 6px; }

/* ===== C illustrations (editorial line art) =====
   The console's drawings. The console loads app.css, not the site
   stylesheet, so this repeats the line-art core from site/styles.css on
   app.css's tokens. Keep the two copies in step. */
@font-face { font-family: "Caveat"; src: url("site/fonts/caveat-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
.ln-svg { --ln-ink: var(--text); --ln-paper: var(--card); --ln-pen: var(--accent); --ln-ok: var(--ok); --ln-bad: var(--danger);
  --ln-hand: "Caveat", "Bradley Hand", cursive; --ln-mono: var(--font-mono); --ln-sans: var(--font-sans); --ln-ease: cubic-bezier(.2, .7, .2, 1); }
.ln-svg { display: block; max-width: 100%; height: auto; overflow: visible; color: var(--ln-ink); --ln-ink2: color-mix(in srgb, var(--ln-ink) 60%, var(--ln-paper)); --ln-shade: color-mix(in srgb, var(--ln-pen) 45%, var(--ln-ink)); }
.ln-svg path, .ln-svg circle, .ln-svg ellipse { stroke-linecap: round; stroke-linejoin: round; }
.ln-ft, .ln-fl, .ln-fr { stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; }
.ln-ft { fill: var(--ln-paper); }
.ln-fl { fill: color-mix(in srgb, currentColor 5%, var(--ln-paper)); }
.ln-fr { fill: color-mix(in srgb, currentColor 12%, var(--ln-paper)); }
.ln-ft.ln--pen { fill: color-mix(in srgb, var(--ln-pen) 16%, var(--ln-paper)); }
.ln-ft.ln--ok { fill: color-mix(in srgb, var(--ln-ok) 20%, var(--ln-paper)); }
.ln-h { fill: none; stroke: currentColor; stroke-width: .8; opacity: .34; }
.ln-sh { fill: none; stroke: var(--ln-shade); stroke-width: .7; opacity: .45; }
.ln-l { fill: none; stroke: currentColor; stroke-width: 1.5; }
.ln-thin { fill: none; stroke: currentColor; stroke-width: 1; opacity: .55; }
.ln-led { stroke: currentColor; stroke-width: 1; fill: var(--ln-paper); }
.ln-led.ln--ok { fill: var(--ln-ok); }
.ln-led.ln--pen { fill: var(--ln-pen); }
.ln-ox { fill: var(--ln-paper); stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.ln-snow { fill: var(--ln-paper); stroke: currentColor; stroke-width: 1.5; }
.ln-paper { fill: var(--ln-paper); stroke: currentColor; stroke-width: 1.5; }
.ln-note { font: 500 21px/1 var(--ln-hand); fill: var(--ln-pen); }
.ln-note.ln--ok { fill: var(--ln-ok); }
.ln-note.ln--s { font-size: 18px; }
.ln-mono { font: 400 11.5px/1 var(--ln-mono); fill: currentColor; }
.ln-mono.ln--dim, .ln-dim { fill: var(--ln-ink2); }
.ln-mono.ln--pen { fill: var(--ln-pen); }
.ln-mono.ln--ok { fill: var(--ln-ok); }
.ln-mono.bad { fill: var(--ln-bad); }
.ln-mono.ln--s { font-size: 10px; }
.ln-mono.ln--l { font-size: 13px; }
.ln-strike { fill: none; stroke: var(--ln-bad); stroke-width: 1.5; }
.ln-fig { font: 400 10px/1 var(--ln-mono); letter-spacing: .14em; fill: var(--ln-ink2); }
.ln-pen { fill: none; stroke: var(--ln-pen); stroke-width: 1.75; }
.ln-pen.ln--ok { stroke: var(--ln-ok); }
.ln-pen.ln--dim { stroke: var(--ln-ink2); }
.ln-ghost { fill: none; stroke: var(--ln-pen); stroke-width: 1.5; stroke-dasharray: 5 5; }
.ln-rail { fill: none; stroke: var(--ln-ink2); stroke-width: 6; opacity: .28; }
.ln-flow { fill: none; stroke: var(--ln-pen); stroke-width: 1.8; stroke-dasharray: 2 7; }
.ln-tag path { fill: var(--ln-paper); stroke: var(--ln-pen); stroke-width: 1.5; }
.ln-tag circle { fill: none; stroke: var(--ln-pen); stroke-width: 1.2; }
.ln-tag text { font: 400 11px/1 var(--ln-mono); fill: var(--ln-pen); }
.ln-chk circle { fill: var(--ln-paper); stroke: var(--ln-ok); stroke-width: 1.5; }
.ln-chk path { fill: none; stroke: var(--ln-ok); stroke-width: 2; }
.ln-chk.ln-no circle, .ln-chk.ln-no path { stroke: var(--ln-bad); }
.ln-seal circle { fill: var(--ln-paper); stroke: currentColor; stroke-width: 1.5; }
.ln-seal .ln--in { stroke-width: 1; stroke-dasharray: 1.5 2.5; }
.ln-stamp rect { fill: none; stroke: var(--ln-ok); stroke-width: 2; }
.ln-stamp rect + rect { stroke-width: 1; }
.ln-stamp text { font: 400 14px/1 var(--ln-mono); letter-spacing: .04em; fill: var(--ln-ok); }
/* Motion. The resting styles above are the final frame; reduced motion and
   paused figures keep or start from them. */
.ln-draw { stroke-dasharray: 1; }
.ln-svg .ln-draw, .ln-svg .ln-chk path { animation: ln-draw 1s var(--ln-ease) backwards; animation-delay: var(--d, 0s); }
.ln-svg .ln-chk path { stroke-dasharray: 1; }
.ln-svg .ln-note { animation: ln-write 1.3s steps(14, end) backwards; animation-delay: var(--d, 0s); }
.ln-svg .ln-pop, .ln-svg .ln-tag, .ln-svg .ln-stamp, .ln-svg .ln-seal { animation: ln-pop .7s var(--ln-ease) backwards; animation-delay: var(--d, 0s); }
.ln-svg .ln-flow { animation: ln-flow 1.1s linear infinite; }
.ln-svg .ln-float { animation: ln-float 6s ease-in-out infinite; }
.ln-svg .ln-ghost { animation: ln-ghost 2.8s ease-in-out infinite; }
@keyframes ln-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ln-write { from { clip-path: inset(-40% 100% -40% -4%); } to { clip-path: inset(-40% -4% -40% -4%); } }
@keyframes ln-pop { from { opacity: 0; translate: 0 6px; } }
@keyframes ln-flow { to { stroke-dashoffset: -18; } }
@keyframes ln-float { 50% { translate: 0 -5px; } }
@keyframes ln-ghost { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ln-svg, .ln-svg * { animation: none !important; } }
.ln-ttl { font: 600 12.5px/1 var(--ln-sans); fill: currentColor; }
.ln-svg .ln--t-pen { fill: var(--ln-pen); }
.ln-svg .ln--t-ok { fill: var(--ln-ok); }
.ln-svg .ln--t-bad { fill: var(--ln-bad); }
.ln-svg .ln--t-dim, .ln-svg .ln-old { fill: var(--ln-ink2); }
.ln-btn { fill: color-mix(in srgb, var(--ln-pen) 12%, var(--ln-paper)); stroke: var(--ln-pen); stroke-width: 1.5; }
.ln-svg .ln-sweep { animation: ln-sweep 6s linear infinite; }
@keyframes ln-sweep { from { translate: 0 0; } to { translate: var(--ln-span, 0) 0; } }

/* ===== Legal pages on a phone (privacy, terms) =====
   The Mobile system in site/styles.css, for the pages that load only this
   file: 44px targets 8px apart, :active states, safe areas, 14px text. */
.topbar { padding-top: env(safe-area-inset-top); height: calc(54px + env(safe-area-inset-top)); }
.topbar a, .site-foot a { touch-action: manipulation; }
@media (hover: none), (pointer: coarse), (max-width: 880px) {
  .topbar { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .topbar .btn-sm { height: 44px; padding: 0 14px; font-size: 14px; }
  .topbar-title { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .topbar .btn:active { filter: brightness(0.94); }
  .site-foot { padding-bottom: calc(24px + env(safe-area-inset-bottom)); font-size: 14px; }
  .site-foot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }
  .site-foot .sep { margin: 0 2px; }
  .legal p, .legal li { font-size: 15px; line-height: 24px; }
  .legal-table { font-size: 14px; }
  .legal .updated { font-size: 13px; }
}
