@font-face {
  font-family: "Inter";
  src: url("./fonts/inter-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #e9ecef;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-hover: #f1f5f9;
  --line: #dde3e8;
  --line-strong: #c7d0d9;
  --text: #0f172a;
  --muted: #526175;
  --quiet: #5f6f83;
  --accent: #047857;
  --accent-dark: #047857;
  --accent-button: #047857;
  --accent-button-hover: #065f46;
  --on-accent: #ffffff;
  --accent-soft: rgba(16, 185, 129, 0.09);
  --accent-glow: rgba(16, 185, 129, 0.2);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.09);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.09);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, 0.09);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.09);
  --success-text: #166534;
  --warning-text: #92400e;
  --info-text: #1d4ed8;
  --danger-text: #b91c1c;
  --featured-bg: #0f172a;
  --featured-border: #0f172a;
  --featured-text: #ffffff;
  --featured-muted: #cbd5e1;
  --featured-accent: #6ee7b7;
  --featured-button: rgba(255, 255, 255, 0.12);
  --featured-button-hover: rgba(255, 255, 255, 0.2);
  --featured-button-line: rgba(255, 255, 255, 0.24);
  
  /* Harmonious Soft Radius Scale (Nested Proportions: App 22px > Panel 16px > Card 12px > Control 8px > Micro 6px) */
  --radius-app: 22px;
  --radius-panel: 16px;
  --radius-card: 12px;
  --radius-control: 8px;
  --radius-sm: 6px;
  --radius-pill: 9999px;

  /* Product type and spacing scale */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --space-5: 20px;
  --control-h: 36px;
  --control-h-sm: 32px;
  
  /* Elevation Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.04), 0 2px 4px rgba(15, 23, 42, 0.02);
  --shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.06);
  --shadow-app: 0 16px 44px rgba(15, 23, 42, 0.06);
  --shadow-floating: 0 14px 32px rgba(15, 23, 42, 0.12);
  
  --sidebar: 252px;
  --public-width: min(1200px, calc(100% - 64px));
  --public-section-y: clamp(72px, 8vw, 112px);
  --public-head-gap: clamp(40px, 5vw, 56px);
  --public-copy-width: 36rem;
  --public-surface: var(--surface);
  --public-title-1: clamp(2rem, 3.4vw, 2.75rem);
  --public-title-2: clamp(1.5rem, 2.4vw, 2rem);
  --public-title-3: 1.125rem;
  --public-body: 0.9375rem;
  --public-body-sm: 0.8125rem;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #090d16;
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-muted: #182234;
  --surface-hover: #273549;
  --line: #334155;
  --line-strong: #475569;
  --text: #f8fafc;
  --muted: #b0bed0;
  --quiet: #9aa9bd;
  --accent: #10b981;
  --accent-dark: #6ee7b7;
  --accent-soft: rgba(16, 185, 129, 0.16);
  --accent-glow: rgba(16, 185, 129, 0.3);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.16);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.16);
  --success-text: #86efac;
  --warning-text: #fcd34d;
  --info-text: #93c5fd;
  --danger-text: #fca5a5;
  --featured-bg: #243044;
  --featured-border: #43536a;
  --featured-text: #f8fafc;
  --featured-muted: #cbd5e1;
  --featured-accent: #6ee7b7;
  --featured-button: #334155;
  --featured-button-hover: #40516a;
  --featured-button-line: #52637a;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-app: 0 16px 44px rgba(0, 0, 0, 0.45);
  --shadow-floating: 0 14px 32px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.block { display: block; }
.text-muted { color: var(--muted); }
.card-header-spaced { margin-bottom: 12px; }
.actions-tight { margin-top: 4px; }
.actions-detail { margin-top: 12px; }
.actions-spaced { margin-top: 16px; }
html { min-width: 320px; background: var(--canvas); transition: background-color 0.2s ease, color 0.2s ease; }
body {
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.nav-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 3px var(--accent-glow); }

/* Global Icon Baseline & Alignment Normalization */
i[class*="bi-"],
.bi,
[class^="icon-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.125em;
  line-height: 1;
  flex-shrink: 0;
}

/* Ensure All Interactive Elements & Titles with Icons have Pixel-Perfect Centering */
.button,
.preset-button,
.preset-url-pill,
summary,
.badge,
.card-title,
.box-title,
.toast-content {
  display: inline-flex;
  align-items: center;
}

/* Strict Anti-Overflow Boundaries */
.card, .grid, .section-stack, .page, .metric, .field, .main, .sidebar, .app-shell {
  min-width: 0;
}

/* Typographic Scale Hierarchy */
h1, .topbar h1, .hero-copy h1, .auth-card h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

h2, .card-title, .section-head h2, .closer-copy h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.012em;
  color: var(--text);
  margin: 0;
}

h3 {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

/* App Shell Structure */
.app-shell {
  width: min(1560px, calc(100% - 64px));
  min-height: calc(100vh - 64px);
  margin: 32px auto;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-app);
  background: var(--surface-muted);
  box-shadow: var(--shadow-app);
  transition: width 200ms ease, margin 200ms ease, border-radius 200ms ease, box-shadow 200ms ease;
}
:root[data-layout="fluid"] .app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--bg);
}
:root[data-layout="fluid"],
:root[data-layout="fluid"] body {
  background: var(--bg);
}
:root[data-layout="fluid"] .main {
  max-width: none;
}

/* Sidebar Styling */
.sidebar {
  min-height: 100%;
  height: auto;
  padding: 28px 18px 24px;
  display: flex;
  flex-direction: column;
  background: var(--surface-muted);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 24px;
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-control);
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--surface);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--text-base);
}
.brand-copy strong {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

.nav {
  display: grid;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 2px;
}
.nav-section-label {
  padding: 12px 10px 6px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.nav-section-label-spaced { margin-top: 8px; }
.nav-link {
  appearance: none;
  border: 0;
  width: 100%;
  min-height: 36px;
  color: var(--muted);
  text-align: left;
  text-decoration: none;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  font-weight: 400;
  cursor: default;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav-link:hover {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text);
}
.nav-link[aria-current="page"], .nav-link.is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
}
.nav-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-control);
  color: var(--muted);
  font-size: 14px;
  transition: color 0.14s ease;
}
.nav-link:hover .nav-icon { color: var(--text); }
.nav-link[aria-current="page"] .nav-icon, .nav-link.is-active .nav-icon {
  color: var(--accent);
}
.sidebar-footer {
  margin-top: auto;
  padding: 16px 6px 0;
  color: var(--quiet);
  font-size: var(--text-xs);
  line-height: 1.55;
  border-top: 1px dashed var(--line);
}
.sidebar-footer a { color: var(--muted); font-weight: 500; }
.sidebar-footer a:hover { color: var(--text); }

/* Main Workspace Area */
.main {
  min-width: 0;
  min-height: 100%;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px clamp(20px, 2.2vw, 32px) 40px;
  overflow-x: hidden;
  background: var(--bg);
}
.topbar {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.topbar-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.topbar h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
  color: var(--text);
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.button.menu-button { display: none; }

/* Buttons & Controls */
.button {
  min-height: var(--control-h);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-control);
  padding: 0 14px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease, opacity 0.14s ease;
  box-shadow: var(--shadow-sm);
}
.button > i[class*="bi-"],
.button > .bi {
  font-size: 1.1em;
  margin-top: -1px;
  vertical-align: middle;
}
.button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.button:active {
  background: var(--surface-muted);
  transform: translateY(0);
}
.button.primary {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
  box-shadow: var(--shadow-sm);
}
.button.primary:hover {
  opacity: 0.92;
}
.button.accent {
  background: var(--accent-button);
  color: var(--on-accent);
  border-color: var(--accent-button);
  box-shadow: 0 2px 8px var(--accent-soft);
}
.button.accent:hover {
  background: var(--accent-button-hover);
  border-color: var(--accent-button-hover);
}
.button.danger {
  color: var(--danger-text);
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
  background: var(--surface);
}
.button.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.button.danger-filled { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.danger-filled:hover { background: #b91c1c; border-color: #b91c1c; }
.button.small {
  min-height: var(--control-h-sm);
  padding: 0 12px;
  font-size: var(--text-xs);
  gap: 5px;
  border-radius: var(--radius-control);
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none !important;
}
.icon-button {
  width: var(--control-h);
  height: var(--control-h);
  flex: 0 0 var(--control-h);
  padding: 0;
  border-radius: var(--radius-control);
}

/* Card & Grid Layouts with Generous Spacing & Zero Overflow */
.grid { display: grid; gap: var(--space-5); min-width: 0; }
.grid.two { grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr); }
.grid.metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  min-width: 0;
  /* Do NOT set overflow:hidden globally — it clips paper stack pseudo-layers */
  overflow: visible;
}
/* Variants must follow the base card rule so their compact/reset intent wins. */
.card.card-reset { padding: 0; border: 0; box-shadow: none; background: transparent; }
.card.card-compact { padding: 16px 18px; }
.card .card-title-subsection { font-size: var(--text-sm); font-weight: 600; margin-bottom: 12px; }
/* Only clip overflow where genuinely needed (e.g. tables, images) */
.card.clip { overflow: hidden; }
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-description {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

/* Overview Hero Banner & Module Enhancements */
.overview-dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-sm);
}
.overview-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.overview-hero-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.hero-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.overview-hero-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-lg), 1.6vw, var(--text-xl));
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
  margin: 0;
}
.overview-hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.overview-quick-input-wrap {
  width: 100%;
  margin-top: 2px;
}
.overview-metrics-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0 2px;
}
.overview-quick-input-wrap .url-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  padding: 4px 6px 4px 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}
.overview-quick-input-wrap .url-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-md);
}
.overview-quick-input-wrap .url-icon {
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}
.overview-quick-input-wrap input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  height: var(--control-h);
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  box-shadow: none !important;
  outline: none !important;
}
.overview-quick-input-wrap .url-input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.overview-quick-input-wrap button {
  height: var(--control-h);
  padding: 0 14px;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-control);
  white-space: nowrap;
  flex-shrink: 0;
}

.favicon-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
  vertical-align: middle;
}
.favicon-label:hover { color: inherit; }
.site-favicon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.site-favicon-sm { width: 18px; height: 18px; }
.site-favicon img,
.site-favicon-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.site-favicon img {
  object-fit: cover;
  background: var(--surface);
}
.site-favicon-fallback {
  font-size: 11px;
  color: var(--accent);
  background: var(--surface-muted);
}
.site-label-stack {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.site-primary-label {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.45;
}
.site-secondary-link {
  font-size: var(--text-xs);
  line-height: 1.45;
}
.site-primary-label,
.site-secondary-link,
.target-link,
.snapshot-title-link,
.snapshot-card-link,
.snapshot-detail-link,
.site-detail-title,
.site-detail-link,
.timeline-domain-label {
  max-width: 100%;
}
.site-primary-label .truncate,
.site-secondary-link .truncate,
.target-link .truncate,
.snapshot-title-link .truncate,
.snapshot-card-link .truncate,
.snapshot-detail-link .truncate,
.site-detail-title .truncate,
.site-detail-link .truncate,
.timeline-domain-label .truncate {
  min-width: 0;
}
.target-link .mono,
.site-secondary-link .mono,
.site-detail-link .mono {
  font-size: inherit;
}
/* Snapshot Visual Card Grid for Overview */
.snapshot-card-grid {
  display: grid;
  gap: 10px;
}
.snapshot-mini-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  transition: all 0.14s ease;
  min-width: 0;
  max-width: 100%;
}
.snapshot-mini-card:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.snapshot-thumb-wrap {
  width: 52px;
  height: 38px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.snapshot-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.snapshot-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--quiet);
  font-size: 16px;
  background: var(--surface-muted);
}
.snapshot-card-info {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.snapshot-card-url {
  font-weight: 650;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text);
}
.snapshot-card-date {
  font-size: 11px;
  color: var(--muted);
}
.snapshot-card-btn {
  flex: 0 0 auto;
  max-width: 100%;
}
.site-detail-card .snapshot-card-link,
.site-detail-card .snapshot-card-url {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Snapshot gallery — rotated paper stack lives on the thumbnail only */
.snapshot-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 20px 16px 28px;
}
.snapshot-gallery-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow: visible;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 6px 18px -4px rgba(15, 23, 42, 0.08);
  z-index: 1;
  cursor: pointer;
}
.snapshot-gallery-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 32px -6px rgba(15, 23, 42, 0.14);
  z-index: 10;
}
.snapshot-gallery-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  border-top-left-radius: calc(var(--radius-card) - 1px);
  border-top-right-radius: calc(var(--radius-card) - 1px);
  overflow: hidden;
}
.snapshot-gallery-frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: stretch;
}
.snapshot-gallery-stack {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 10px;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
}
.snapshot-gallery-sheet {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-control) + 2px);
  background: var(--surface-muted);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  transform-origin: 50% 100%;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}
.snapshot-gallery-sheet--near {
  transform: rotate(2deg);
  opacity: 0.95;
}
.snapshot-gallery-sheet--far {
  transform: rotate(4deg);
  opacity: 0.82;
}
.snapshot-gallery-card:hover .snapshot-gallery-sheet--near {
  transform: rotate(3deg);
}
.snapshot-gallery-card:hover .snapshot-gallery-sheet--far {
  transform: rotate(5.5deg);
  opacity: 0.9;
}
.snapshot-gallery-frame img,
.snapshot-gallery-frame .snapshot-gallery-fallback {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
}
.snapshot-gallery-frame img {
  object-fit: cover;
  object-position: top center;
  border-radius: calc(var(--radius-control) + 2px);
  box-shadow: 0 0 0 1px var(--line);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.snapshot-gallery-card:hover .snapshot-gallery-frame img {
  transform: scale(1.02);
}
.snapshot-gallery-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--quiet);
  font-size: 22px;
}
.snapshot-gallery-fallback span { font-size: 11px; font-weight: 500; }
.snapshot-gallery-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 5px;
  letter-spacing: 0.04em;
  z-index: 5;
}
.snapshot-stack-count-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  background: linear-gradient(135deg, var(--accent-button) 0%, var(--accent-button-hover) 100%);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 10px rgba(4, 120, 87, 0.35);
  z-index: 5;
  letter-spacing: 0.02em;
}

/* Timeline View Styles */
.timeline-view-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 6px 0;
}
.timeline-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.timeline-header-bar h3 {
  margin: 0;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.timeline-track {
  position: relative;
  padding-left: 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.timeline-track::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 15px;
  width: 2px;
  background: var(--line-strong);
  z-index: 0;
}
.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
}
.timeline-dot {
  position: absolute;
  left: -36px;
  top: 18px;
  margin-left: 9px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
  z-index: 2;
}
.timeline-item.is-latest .timeline-dot {
  background: var(--accent);
  border-color: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.timeline-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.timeline-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.timeline-time {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.timeline-status { margin-left: 6px; }
.timeline-format { font-size: 12px; color: var(--muted); }
.snapshot-detail-stack { display: flex; flex-direction: column; gap: 14px; }
.snapshot-detail-heading-row { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.snapshot-detail-heading-row > div:first-child { flex: 1 1 auto; min-width: 0; }
.snapshot-detail-heading-row > div:last-child { flex: 0 0 auto; }
.snapshot-detail-title { margin: 0; font-size: 15px; font-weight: 700; }
.snapshot-detail-url { margin: 4px 0 0; font-size: 12px; color: var(--muted); min-width: 0; }
.snapshot-detail-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.snapshot-image-wrap {
  appearance: none;
  position: relative;
  display: block;
  width: 100%;
  max-height: 380px;
  padding: 0;
  overflow: auto;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: var(--surface-muted);
  cursor: zoom-in;
  text-align: initial;
}
.snapshot-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.snapshot-tool-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}
.snapshot-tool-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.snapshot-tool-heading h4 { margin: 0; font-size: 14px; }
.snapshot-tool-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.snapshot-tool-form {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 0.8fr));
  gap: 12px;
  align-items: end;
}
.snapshot-tool-field-wide { min-width: 0; }
.snapshot-tool-form label,
.snapshot-share-form label { display: grid; gap: 7px; font-size: 12px; font-weight: 600; }
.snapshot-opacity { padding: 0; min-height: var(--control-h); }
.snapshot-tool-actions { grid-column: 1 / -1; margin-top: 2px; }
.snapshot-share-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.snapshot-share-form .field { min-width: 180px; }
.snapshot-share-secret {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: var(--radius-control);
  background: var(--surface);
}
.snapshot-share-secret[hidden] { display: none; }
.snapshot-share-secret > div:first-child { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.snapshot-share-secret span { color: var(--muted); }
.snapshot-share-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.snapshot-share-list { margin-top: 14px; }
.snapshot-share-empty { margin: 0; color: var(--muted); font-size: 12px; }
.snapshot-share-records { display: grid; gap: 8px; }
.snapshot-share-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}
.snapshot-share-record > div { display: grid; gap: 3px; font-size: 12px; }
.snapshot-share-record span { color: var(--muted); }
.timeline-preview-wrap {
  position: relative;
  width: 100%;
  max-height: 560px;
  overflow-y: auto;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: var(--surface-muted);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}
.timeline-preview-wrap img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.snapshot-domain-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 4px;
  align-self: flex-start;
}
.snapshot-gallery-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}
.snapshot-gallery-title {
  margin: 0;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
}
.snapshot-gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.snapshot-gallery-meta span { display: inline-flex; align-items: center; gap: 4px; }
.snapshot-gallery-actions {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grid.two.workspace-overview-grid,
.workspace-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.78fr);
  gap: 20px;
}
.workspace-overview-grid > .section-stack {
  gap: 24px;
}

/* KPI / Metric Cards (Integrated 5-Column Dashboard Strip) */
.overview-dashboard-card .grid.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.overview-dashboard-card .grid.metrics .metric {
  flex: 1 1 160px;
}
.overview-dashboard-card .metric {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
  transition: all 0.18s ease;
  position: relative;
}
.overview-dashboard-card .metric:hover {
  border-color: var(--line-strong);
}
.metric-label {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.metric-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(16, 185, 129, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 13px;
  flex-shrink: 0;
  transition: all 0.14s ease;
}
.metric:hover .metric-icon-wrap {
  background: var(--accent-soft);
}
.metric-value {
  margin-top: 8px;
  margin-bottom: 3px;
  font-family: var(--font-display);
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.metric-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
/* Form Layouts & Anti-Overflow Controls */
.orientation-button {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 16px;
  border-radius: var(--radius-control);
}
.preset-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.preset-button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  color: var(--text);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.14s ease;
  min-width: 0;
}
.preset-icon {
  font-size: 16px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  flex-shrink: 0;
  transition: all 0.14s ease;
}
.preset-button.is-active .preset-icon {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Quick URL Presets & Aspect Ratio Badge */
.field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.url-preset-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.preset-url-pill {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: var(--text-xs);
  min-height: 28px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.14s ease;
}
.preset-url-pill:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ==========================================================================
   Capture Page Clean Overhaul (/app/capture)
   ========================================================================== */
.capture-main-card {
  margin-bottom: 28px;
}

.capture-form-clean {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label-main {
  font-size: var(--text-base);
  font-weight: 650;
  color: var(--text);
}

.url-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.url-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  vertical-align: baseline;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
  margin: 0;
  padding: 0;
}

.url-control-clean {
  flex: 1;
  height: 48px;
  padding-left: 40px !important;
  font-size: var(--text-base);
  border-radius: var(--radius-control);
}

.submit-clean-btn {
  height: 48px;
  padding: 0 24px;
  font-size: var(--text-base);
  font-weight: 650;
  border-radius: var(--radius-control);
  white-space: nowrap;
}

/* Viewport Box Clean */
.viewport-box-clean {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px;
  gap: 16px;
}

.box-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.box-title {
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.preset-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dimensions-row-clean {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.dimensions-row-clean .inline-field {
  flex: 1;
  min-width: 0;
}

.advanced-panel-clean {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 0;
  background: var(--surface-muted);
  overflow: hidden;
}

.advanced-panel-clean summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--control-h);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--text);
  user-select: none;
  list-style: none;
}

.advanced-panel-clean summary::-webkit-details-marker { display: none; }

.advanced-panel-clean[open] summary {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.checkbox-row-clean {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-top: 4px;
}

/* Full-Width Result View & Mockup Frame */
.job-focus-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.browser-mockup-frame-clean {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: var(--surface-muted);
  margin-top: 14px;
}

.browser-mockup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}

.window-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.window-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.window-dots .dot.red { background: #ef4444; }
.window-dots .dot.yellow { background: #f59e0b; }
.window-dots .dot.green { background: #22c55e; }

.browser-mockup-address-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.mockup-address-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Clean Studio Preview Viewport Stage */
.preview {
  width: 100%;
  min-height: 360px;
  max-height: 720px;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: var(--surface-muted);
  position: relative;
  border: 0;
}

.mockup-viewport-img,
.preview img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: width 0.15s ease;
}

/* Loading & Progress Stage */
.preview-loading-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  max-width: 380px;
}

.empty-preview-placeholder {
  text-align: center;
  max-width: 380px;
  padding: 32px 16px;
  margin: auto;
}

.placeholder-main-icon {
  font-size: 32px;
  color: var(--quiet);
  margin-bottom: 12px;
  display: inline-block;
}

.loading-spinner {
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 12px;
}

.preview-loading-stage h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.preview-loading-stage p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* Empty Preview Placeholder Graphic */
.empty-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  max-width: 420px;
}

.empty-preview-placeholder h3 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.empty-preview-placeholder p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* Unified Result Bar & Zoom Pill Controls */
.unified-result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

/* Bottom Collapsible Diagnostic Meta Panel */
.job-meta-details-clean {
  margin-top: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: all 0.2s ease;
}

.job-meta-summary-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

.job-meta-summary-clean .summary-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.job-meta-summary-clean .summary-left i {
  color: var(--accent);
  font-size: 15px;
}

.job-meta-summary-clean .toggle-arrow {
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.2s ease;
}

.job-meta-details-clean[open] .toggle-arrow {
  transform: rotate(180deg);
}

.job-meta-body {
  padding: 0 16px 16px 16px;
  border-top: 1px dashed var(--line);
  margin-top: 4px;
  padding-top: 12px;
}

.zoom-controls-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}

.zoom-controls-pill .tool-btn {
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  box-shadow: none;
  padding: 4px 10px;
  min-height: 28px;
  font-size: 12px;
}

.zoom-controls-pill .tool-btn:hover {
  background: var(--surface);
  color: var(--text);
}
.aspect-ratio-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--quiet);
  font-weight: 600;
}

.summary-badge {
  margin-left: auto;
  font-weight: 500;
}

/* Capture Workstation Console (Ultra-Sleek 310px Sidebar Left, Sprawling Canvas Right) */
.capture-console-layout {
  display: grid;
  grid-template-columns: minmax(280px, 310px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.format-scale-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.format-scale-grid .field-full {
  grid-column: 1 / -1;
}
.capture-submit-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.capture-submit-bar .button {
  height: var(--control-h);
  min-height: var(--control-h);
}
.capture-submit-bar .full-submit-btn {
  flex: 1;
  height: var(--control-h);
  font-size: var(--text-sm);
  font-weight: 500;
  justify-content: center;
}

/* Compact Capture Form Sidebar Adjustments */
.capture-main-card {
  padding: 16px 14px;
}
.capture-main-card .card-header {
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.capture-main-card .card-title {
  font-size: 15px;
}
.capture-main-card .field-label-main {
  font-size: 12px;
}
.capture-main-card .preset-url-pill {
  padding: 2px 6px;
  font-size: 10.5px;
}
.capture-main-card .url-control-clean {
  height: 35px;
  font-size: 12.5px;
}
.capture-main-card .preset-button {
  padding: 7px 9px;
  gap: 8px;
}
.capture-main-card .preset-icon {
  font-size: 14px;
}
.capture-main-card .preset-info strong {
  font-size: 12px;
}
.capture-main-card .preset-info span {
  font-size: 10.5px;
}
.capture-main-card .dimensions-row-clean input.control {
  height: 33px;
  font-size: 12px;
  padding: 4px 8px;
}
.capture-main-card .orientation-button {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 12px;
}
.capture-main-card .checkbox-row-clean {
  gap: 8px;
}
.capture-main-card .check {
  font-size: 12px;
}
.capture-main-card .option-hint {
  font-size: 11px;
  margin-top: 4px;
  margin-bottom: 6px;
}

/* Sites Page Layout & Add Site Form Styling */
.add-site-form-clean {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(148px, 0.75fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.add-site-form-clean .field.grow {
  min-width: 0;
}
.add-site-form-clean:focus-within {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.add-site-form-clean .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.add-site-form-clean .field label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}
.add-site-form-clean .control {
  height: var(--control-h);
  font-size: var(--text-sm);
}
.add-site-form-clean .add-site-btn {
  height: var(--control-h);
  padding: 0 14px;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
}

.card.site-detail-card,
.card.site-detail-card #site-detail,
.card.site-detail-card .site-detail-wrap {
  min-width: 0;
  max-width: 100%;
}
.card.site-detail-card {
  overflow: hidden;
}

/* Site Detail Un-nested Clean Styling */
.site-detail-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.site-detail-wrap > * {
  min-width: 0;
  max-width: 100%;
}
.site-detail-header-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.site-detail-header-info {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.site-detail-header-block > :last-child { flex: 0 0 auto; }
.site-detail-main-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
  color: var(--text);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.site-detail-main-title .favicon-label.site-detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.site-detail-main-title .favicon-label.site-detail-title > .truncate {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-detail-link-line {
  margin: 0;
  font-size: var(--text-sm);
}
.site-detail-link-line,
.site-detail-link,
.site-detail-link .truncate {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-detail-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.site-detail-actions .button {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-content: center;
  box-sizing: border-box;
}
.site-detail-subsection {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.capture-preview-card {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.preset-button strong { font-size: 12.5px; font-weight: 650; }
.preset-button span { color: var(--muted); font-size: 11px; }
.preset-button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}
.preset-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}
.preset-button.is-active strong { color: var(--accent-dark); }
.preset-button.is-active span { color: var(--accent); }
.preset-check-badge {
  display: none;
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.preset-button.is-active .preset-check-badge {
  display: inline-flex;
}

.advanced-grid {
  padding: 14px 12px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
/* Fields & Form Controls */
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 500; font-size: var(--text-sm); color: var(--text); }
.field-hint { color: var(--muted); font-size: var(--text-xs); line-height: 1.45; }
.control {
  width: 100%;
  height: var(--control-h);
  border: 1px solid var(--line);
  background: var(--surface-muted);
  border-radius: var(--radius-control);
  color: var(--text);
  padding: 0 11px;
  font-size: var(--text-sm);
  transition: border-color 0.14s ease, background 0.14s ease;
}
.control:hover { border-color: var(--line-strong); background: var(--surface); }
.control:focus {
  background: var(--surface);
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
}
.url-control {
  font-family: var(--mono);
  font-size: var(--text-base);
}
.check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  min-height: 32px;
}
.check input {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  accent-color: var(--accent);
  cursor: pointer;
}
.option-hint { flex-basis: 100%; margin-top: 2px; color: var(--muted); }
.form-message { min-height: 20px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.form-message.success { color: var(--green); font-weight: 600; }
.form-message.warning { color: var(--warning); font-weight: 600; }
.form-message.error { color: var(--danger); font-weight: 600; }
.credentials-grid { grid-template-columns: minmax(0, 1fr); }

/* Job Results & Preview Area */
.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--muted);
  font-family: var(--mono);
}
.preview-copy {
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  max-width: 400px;
  margin: auto;
  line-height: 1.5;
  font-size: 12.5px;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.zoom-value { min-width: 56px; text-align: center; font-family: var(--mono); font-size: 12px; }
.progress {
  height: 4px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--line);
}
.progress > span {
  display: block;
  height: 100%;
  width: 36%;
  background: var(--accent);
  border-radius: inherit;
  animation: indeterminate 1.2s ease-in-out infinite alternate;
}
@keyframes indeterminate {
  0% { transform: translateX(-40%); width: 30%; }
  100% { transform: translateX(250%); width: 50%; }
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-muted);
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid var(--line);
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge:has(> i)::before,
.badge:has(> .bi)::before {
  display: none;
}
.badge.success { color: var(--success-text); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 28%, transparent); }
.badge.error { color: var(--danger-text); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.badge.warning { color: var(--warning-text); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 28%, transparent); }
.badge.info { color: var(--info-text); background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 28%, transparent); }

/* Tables & Table Wrap Overflow Protection */
.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 600px;
}
.table th, .table td {
  display: table-cell !important;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
  vertical-align: middle;
  box-sizing: border-box;
}
.table th {
  color: var(--muted);
  background: var(--surface-muted);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  text-transform: none;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 0.12s ease; }
.table tbody tr:hover { background: var(--surface-hover); }
.truncate {
  max-width: 100%;
  display: inline-block;
  min-width: 0;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table td .truncate {
  max-width: 100%;
}
.mono { font-family: var(--mono); font-size: 0.88em; letter-spacing: -0.01em; }
.admin-subsection { display: grid; gap: 10px; margin-top: 20px; }
.admin-subsection .card-title { font-size: 14px; margin: 0; }

/* Empty & Loading States */
.state {
  padding: 44px 20px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
}
.state-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 18px;
  border: 1px solid var(--line);
}
.state h3 { margin: 0; color: var(--text); font-size: 15px; font-weight: 650; }
.state p { margin: 0; max-width: 420px; line-height: 1.6; font-size: var(--text-sm); }
.state.error .state-icon { background: var(--danger-soft); color: var(--danger); border-color: rgba(220, 38, 38, 0.2); }
.skeleton {
  background: linear-gradient(90deg, var(--surface-muted) 25%, var(--surface-hover) 45%, var(--surface-muted) 65%);
  background-size: 300% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-pill);
  height: 14px;
}
.skeleton-inline { width: 160px; }
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -200% 0; }
}

/* Page Stacks & Details List Anti-Overflow */
.page { display: none; min-width: 0; }
.page.is-active {
  display: block;
  min-width: 0;
  overflow-x: hidden;
  animation: pageFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.section-stack { display: grid; gap: var(--space-5); min-width: 0; }
.section-stack.site-detail-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.wide-left { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); }
.grid.two.sites-page-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  align-items: start;
}
.sites-page-layout > .card {
  min-width: 0;
  max-width: 100%;
}
.sites-page-layout > .site-detail-card {
  max-width: min(22rem, 100%);
}
.sites-page-layout .table-wrap { margin-top: 4px; }
.sites-page-layout .table { min-width: 540px; }
.sites-page-layout .table td:first-child { min-width: 0; width: 46%; }
.sites-page-layout .table td .site-label-stack,
.sites-page-layout .table td .truncate {
  max-width: 100%;
}
@media (max-width: 960px) {
  .add-site-form-clean {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }
  .add-site-form-clean .add-site-btn {
    width: 100%;
    justify-content: center;
  }
}
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 6px; }
.inline-form .grow { flex: 1 1 220px; }
.detail-rich { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.detail-rich strong { color: var(--text); }
.bullet-list { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.api-docs { display: grid; gap: 16px; }
.api-docs-points {
  margin: 0;
  padding-left: 1.15em;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}
.api-docs-points code,
.api-docs-example .field-hint code {
  font-family: var(--mono);
  font-size: 0.92em;
}
.api-docs-group-head {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.api-docs-group-head h3 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
}
.api-docs-group-head p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}
.api-endpoint-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.api-endpoint {
  display: grid;
  grid-template-columns: 4.6em minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.api-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.4em;
  height: 22px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.api-method-get { color: var(--info-text); background: var(--info-soft); }
.api-method-post { color: var(--success-text); background: var(--green-soft); }
.api-method-patch { color: var(--warning-text); background: var(--warning-soft); }
.api-method-delete { color: var(--danger-text); background: var(--danger-soft); }
.api-path {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.api-endpoint-note {
  color: var(--quiet);
  font-size: var(--text-xs);
  line-height: 1.45;
}
.api-docs-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.api-docs-example-head h3 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
}
.api-example-block {
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  overflow-x: auto;
}
.api-example-block code {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre;
}
@media (max-width: 720px) {
  .api-endpoint {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .api-endpoint-note { grid-column: 1 / -1; }
}
.split-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 20px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .control { width: auto; min-width: 130px; height: var(--control-h-sm); border-radius: var(--radius-control); font-size: var(--text-xs); }
.search-input {
  width: auto;
  min-width: 190px;
  height: var(--control-h-sm);
  border-radius: var(--radius-control);
  font-size: var(--text-xs);
}
.view-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.view-toggle-group .button.small {
  border: 0;
  border-radius: calc(var(--radius-pill) - 2px);
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  /* tighter horizontal for compact toggle group */
  padding: 4px 10px;
  font-size: 12px;
}
.view-toggle-group .button.small.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}
.detail-list { display: grid; gap: 0; margin: 0; min-width: 0; }
.detail-list div {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  gap: 8px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  min-width: 0;
}
.detail-list div:last-child { border: 0; }
.detail-list dt {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.5;
  word-break: keep-all;
}
.detail-list dd {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text);
}
.detail-list dd > * {
  min-width: 0;
  max-width: 100%;
}
.clip-text,
.detail-list dd .mono {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

/* Dialogs & Toasts (Bulletproof Modal Engine) */
.dialog {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  width: min(600px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 64px) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-panel) !important;
  padding: 0 !important;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  overflow: hidden !important;
  z-index: 1000 !important;
}
.dialog[open] {
  display: flex !important;
  flex-direction: column !important;
}
.dialog::backdrop {
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(5px) !important;
}
.dialog-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 64px);
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.dialog-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  margin: 0;
}
.dialog-header h2 { margin: 0; font-size: 17px; font-weight: 700; }
.dialog-close {
  border: 0;
  background: var(--surface-muted);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.14s ease;
}
.dialog-close:hover { background: var(--surface-hover); color: var(--text); }
.confirm-dialog { width: min(480px, calc(100vw - 32px)) !important; }
.confirm-warning { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px 14px; border: 1px solid rgba(220, 38, 38, 0.18); border-radius: var(--radius-control); background: var(--danger-soft); color: var(--text); font-size: 13px; line-height: 1.6; }
.confirm-warning i { margin-top: 2px; color: var(--danger); }
.dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  box-sizing: border-box;
}

/* Preview Modal Specialization */
.preview-dialog {
  width: min(1200px, calc(100vw - 32px)) !important;
  height: min(850px, calc(100vh - 64px)) !important;
}
.preview-dialog-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.fullscreen-preview {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
  overflow: auto;
  min-height: 0;
  flex: 1;
}
.fullscreen-preview img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
}
.toast {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: var(--shadow-floating);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.error { border-color: rgba(220, 38, 38, 0.3); }
.toast.error i { color: var(--danger); font-size: 16px; }
.toast.warning { border-color: rgba(217, 119, 6, 0.3); }
.toast.warning i { color: var(--warning); font-size: 16px; }
.toast i { color: var(--accent); font-size: 16px; }

.spin-icon {
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  100% { transform: rotate(360deg); }
}
.sidebar-backdrop { display: none; }

/* Public Visitor Landing Page */
.public-page {
  min-height: 100vh;
  background: var(--bg);
  overflow-x: clip;
  /* Subtle noise texture overlay */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}
.public-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: var(--public-width);
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.public-brand { padding: 0; }
.public-nav { display: flex; align-items: center; gap: 24px; }
.public-nav > a:not(.button) { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 400; line-height: 20px; padding: 8px 0; transition: color 0.14s ease; }
.public-nav > a:not(.button):hover,
.public-nav > a[aria-current="page"] { color: var(--text); }

.public-main { width: 100%; padding-bottom: 0; }
.public-hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  overflow: clip;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, var(--bg)), var(--bg) 72%);
}
.public-hero::after { content: none; }
.public-hero-inner {
  width: var(--public-width);
  margin: 0 auto;
  padding: clamp(48px, 6vw, 88px) 0 clamp(56px, 7vw, 96px);
  position: relative;
  z-index: 1;
}
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(40px, 5vw, 56px);
  align-items: center;
}
.hero-copy {
  position: relative;
  z-index: 1;
  width: min(34rem, 100%);
  margin: 0 auto;
  text-align: center;
}
.hero-copy h1 {
  font-size: var(--public-title-1);
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin: 0 0 16px;
  color: var(--text);
  font-weight: 600;
  text-wrap: balance;
}
.hero-description {
  font-size: var(--public-body);
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
  max-width: 28em;
  margin-inline: auto;
  text-wrap: pretty;
}
.hero-shot-shell {
  position: relative;
  width: min(100%, 760px);
  margin: 0 auto;
}
@keyframes hero-rise {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
.hero-copy { animation: hero-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero-shot-shell { animation: hero-rise 0.55s 0.06s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero-copy .hero-launch-band {
  margin-top: 24px;
  animation: none;
  width: 100%;
  display: grid;
  gap: 12px;
}
.hero-launch-band-inner {
  max-width: none;
  margin: 0;
  display: grid;
  gap: 14px;
}
.hero-launch-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
.hero-launch-row {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-control) + 6px);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.hero-launch-row:focus-within {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line-strong));
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm);
}
.hero-launch-row input[type="url"] {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}
.hero-launch-row input[type="url"]:focus { outline: none; }
.hero-launch-row .button { flex-shrink: 0; min-height: 44px; }
.hero-launch-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hero-launch-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  margin: 0;
  border: 0;
  padding: 0;
}
.hero-launch-presets-label {
  font-size: 12px;
  color: var(--quiet);
  font-weight: 500;
}
.hero-launch-presets button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 12.5px;
  font-family: var(--mono);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 40%, transparent);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.16s ease;
}
.hero-launch-presets button:hover,
.hero-launch-presets button.is-active {
  color: var(--text);
  text-decoration-color: currentColor;
}
.hero-note {
  font-size: 12px;
  color: var(--quiet);
  margin: 0;
  line-height: 1.5;
  text-align: center;
}
.hero-shot {
  display: block;
  scroll-margin-top: 88px;
  color: inherit;
  position: relative;
  z-index: 1;
  text-decoration: none;
}
.hero-shot-frame {
  position: relative;
  margin: 0;
  background: var(--surface);
}
.hero-shot-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1440 / 900;
  object-fit: cover;
  object-position: top center;
}
.hero-shot-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 14px 0 0;
  padding: 0;
  font-size: 12px;
  color: var(--quiet);
}
.hero-shot-caption span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-shot-caption span:not(:last-child)::after {
  content: "·";
  margin-left: 16px;
  color: var(--line-strong);
}
.hero-shot-caption span:last-child {
  font-family: var(--mono);
}

/* Hero browser window */
.public-login-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 450;
  line-height: 20px;
  padding: 8px 0;
  transition: color 0.14s ease;
}
.public-login-link:hover { color: var(--text); }
.try-page { min-height: 100vh; background: var(--bg); }
.try-main {
  width: var(--public-width);
  margin: 0 auto;
  padding: clamp(32px, 4vw, 48px) 0 64px;
  display: grid;
  gap: clamp(32px, 4vw, 40px);
}
.try-intro {
  display: grid;
  gap: 12px;
  max-width: var(--public-copy-width);
}
.try-intro h1 {
  margin: 0;
  font-size: var(--public-title-2);
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.try-intro-lede {
  margin: 0;
  color: var(--muted);
  font-size: var(--public-body);
  line-height: 1.65;
  max-width: 32em;
}
[data-capture-mode="playground"] [data-workspace-only] { display: none; }
.try-page .preview-container-clean {
  max-height: min(70vh, 640px);
  overflow: auto;
}
.hero-window {
  border: 1px solid var(--line);
  border-radius: var(--radius-app);
  background: var(--public-surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.hero-shot:hover .hero-window,
.hero-shot:focus-visible .hero-window {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-app);
}
.hero-shot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: calc(var(--radius-app) + 4px);
}
.window-bar {
  padding: 11px 14px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 7px;
}
/* Colored macOS-style traffic lights */
.window-bar span:nth-child(1) { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; display: inline-block; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.08); }
.window-bar span:nth-child(2) { width: 10px; height: 10px; border-radius: 50%; background: #ffbd2e; display: inline-block; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.08); }
.window-bar span:nth-child(3) { width: 10px; height: 10px; border-radius: 50%; background: #28c840; display: inline-block; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.08); }
.window-bar small { margin-left: auto; color: var(--quiet); font-size: 10.5px; font-family: var(--mono); }

.public-section {
  width: var(--public-width);
  margin: 0 auto;
  padding: var(--public-section-y) 0;
  scroll-margin-top: 88px;
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.public-section.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.public-hero + .public-section {
  border-top: 0;
  padding-top: calc(var(--public-section-y) + 8px);
}

@keyframes section-rise {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Shared section header */
.section-head {
  display: grid;
  gap: 16px;
  max-width: var(--public-copy-width);
  margin: 0 auto var(--public-head-gap);
  text-align: center;
}
.section-head .eyebrow {
  margin: 0;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.section-head .eyebrow::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 55%, transparent);
}
.section-head h2 {
  margin: 0;
  font-size: var(--public-title-2);
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.section-lede {
  margin: 0 auto;
  max-width: 32em;
  color: var(--muted);
  font-size: var(--public-body);
  line-height: 1.65;
  text-wrap: pretty;
}
.section-note {
  margin: clamp(32px, 4vw, 44px) auto 0;
  max-width: var(--public-copy-width);
  color: var(--quiet);
  font-size: var(--public-body-sm);
  line-height: 1.65;
  text-align: center;
}

.public-section:not(.is-visible) .section-head,
.public-section:not(.is-visible) .story-item,
.public-section:not(.is-visible) .capability-item,
.public-section:not(.is-visible) .process-step,
.public-section:not(.is-visible) .plan-card,
.public-section:not(.is-visible) .faq-rail,
.public-section:not(.is-visible) .section-note,
.public-section:not(.is-visible) .closer-panel {
  opacity: 0;
}
.public-section.is-visible .section-head { animation: section-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .story-item:nth-child(1) { animation: section-rise 0.55s 0.06s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .story-item:nth-child(2) { animation: section-rise 0.55s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .story-item:nth-child(3) { animation: section-rise 0.55s 0.14s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .story-item:nth-child(4) { animation: section-rise 0.55s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .capability-item:nth-child(1) { animation: section-rise 0.55s 0.06s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .capability-item:nth-child(2) { animation: section-rise 0.55s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .capability-item:nth-child(3) { animation: section-rise 0.55s 0.14s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .capability-item:nth-child(4) { animation: section-rise 0.55s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .process-step:nth-child(1) { animation: section-rise 0.55s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .process-step:nth-child(2) { animation: section-rise 0.55s 0.14s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .process-step:nth-child(3) { animation: section-rise 0.55s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .plan-card:nth-child(1) { animation: section-rise 0.55s 0.06s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .plan-card:nth-child(2) { animation: section-rise 0.55s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .plan-card:nth-child(3) { animation: section-rise 0.55s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .faq-rail { animation: section-rise 0.55s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .section-note { animation: section-rise 0.55s 0.22s cubic-bezier(0.22, 1, 0.36, 1) both; }
.public-section.is-visible .closer-panel { animation: section-rise 0.55s 0.06s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Use cases — editorial grid */
.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(48px, 6vw, 72px) clamp(56px, 7vw, 96px);
}
.story-item {
  display: grid;
  gap: 16px;
  padding: 24px 4px 0;
  border-top: 1px solid var(--line);
  transition: border-color 0.2s ease;
}
.story-item:hover {
  border-top-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.story-index {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  opacity: 0.88;
}
.story-item h3 {
  margin: 0;
  font-size: var(--public-title-3);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.story-item p {
  margin: 0;
  color: var(--muted);
  font-size: var(--public-body);
  line-height: 1.65;
}

/* Capabilities band */
.public-band {
  width: 100%;
  max-width: none;
  padding: 0;
}
.public-band-inner {
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: var(--public-section-y) 0;
  background: var(--surface-muted);
  border-block: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.public-band-inner > .section-head,
.public-band-inner > .capability-grid {
  width: var(--public-width);
  margin-inline: auto;
}
.public-band-inner > .section-head {
  margin-bottom: var(--public-head-gap);
}
.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(28px, 3.5vw, 48px);
}
.capability-item {
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 8px 4px;
  border-radius: var(--radius-card);
  transition: background 0.2s ease;
}
.capability-item:hover {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.capability-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
}
.capability-item h3 {
  margin: 0;
  font-size: var(--public-title-3);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.capability-item p {
  margin: 0;
  color: var(--muted);
  font-size: var(--public-body-sm);
  line-height: 1.65;
}

/* Workflow process rail */
.process-rail {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3.5vw, 48px);
  position: relative;
}
.process-rail::before {
  content: "";
  position: absolute;
  top: 23px;
  left: calc(16.666% + 14px);
  right: calc(16.666% + 14px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 18%, color-mix(in srgb, var(--accent) 35%, var(--line-strong)) 50%, var(--line-strong) 82%, transparent);
  pointer-events: none;
}
.process-step {
  display: grid;
  gap: 28px;
  justify-items: center;
  text-align: center;
  padding: 0 clamp(10px, 1.5vw, 24px);
}
.process-marker {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 38%, var(--line-strong));
  background: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--bg) 94%, transparent);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.process-step:hover .process-marker {
  transform: scale(1.08);
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line-strong));
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--bg) 94%, transparent), 0 0 0 12px var(--accent-glow);
}
.process-copy { display: grid; gap: 12px; max-width: 19rem; }
.process-copy h3 { margin: 0; font-size: var(--public-title-3); font-weight: 600; letter-spacing: -0.01em; }
.process-copy p { margin: 0; color: var(--muted); font-size: var(--public-body-sm); line-height: 1.65; }

/* Plans */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 2.8vw, 32px);
  align-items: stretch;
}
.plan-card {
  padding: clamp(32px, 3.5vw, 40px) clamp(26px, 2.8vw, 32px);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: var(--radius-panel);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.plan-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.plan-card.featured {
  background: linear-gradient(165deg, var(--featured-bg), color-mix(in srgb, var(--featured-bg) 88%, #1e293b));
  border-color: var(--featured-border);
  color: var(--featured-text);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--featured-accent) 18%, transparent),
    var(--shadow-lg);
}
.plan-card.featured:hover {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--featured-accent) 28%, transparent),
    var(--shadow-floating);
}
.plan-card.featured .plan-label { color: var(--featured-accent); }
.plan-card.featured p,
.plan-card.featured li { color: var(--featured-muted); }
.plan-card.featured li::before { color: var(--featured-accent); }
.plan-card.featured h3 { color: var(--featured-text); }
.plan-card.featured .button {
  background: var(--featured-button);
  border-color: var(--featured-button-line);
  color: var(--featured-text);
}
.plan-card.featured .button:hover {
  background: var(--featured-button-hover);
  border-color: var(--featured-accent);
}
.plan-label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin: 0 0 12px; }
.plan-card h3 { margin: 0 0 10px; font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.018em; }
.plan-card > p { margin: 0 0 26px; color: var(--muted); font-size: var(--public-body-sm); line-height: 1.65; }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 10px; font-size: var(--public-body-sm); color: var(--text); }
.plan-card li::before { content: "– "; color: var(--muted); font-weight: 500; }
.plan-card .button { margin-top: auto; width: 100%; justify-content: center; }

/* FAQ */
.faq-rail {
  max-width: var(--public-copy-width);
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.faq-rail details {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  padding: 0;
  background: transparent;
}
.faq-rail details[open] { border-bottom-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.faq-rail details[open] summary { color: var(--text); }
.faq-rail summary {
  font-weight: 600;
  font-size: var(--public-body);
  cursor: pointer;
  color: var(--text);
  user-select: none;
  line-height: 1.55;
  list-style: none;
  padding: 20px 0;
  transition: color 0.22s ease;
}
.faq-rail summary:hover { color: color-mix(in srgb, var(--accent) 75%, var(--text)); }
.faq-rail summary::-webkit-details-marker { display: none; }
.faq-rail summary::after {
  content: "+";
  float: right;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 400;
  color: var(--quiet);
  transition: color 0.22s ease, transform 0.22s ease;
}
.faq-rail details[open] summary::after { content: "−"; color: var(--accent); }
.faq-rail p {
  margin: 0 0 20px;
  padding-right: 2.5rem;
  color: var(--muted);
  font-size: var(--public-body-sm);
  line-height: 1.65;
}

/* API closer */
.public-closer {
  padding-bottom: clamp(56px, 7vw, 88px);
}
.closer-panel {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(36px, 4vw, 56px);
  padding: clamp(36px, 4vw, 56px);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line-strong) 85%, transparent);
  border-radius: calc(var(--radius-panel) + 4px);
  box-shadow: var(--shadow-lg);
  align-items: center;
  overflow: clip;
}
.closer-copy {
  display: grid;
  gap: 20px;
  max-width: 28rem;
}
.closer-copy .section-lede { text-align: left; }
.closer-copy .button { justify-self: start; margin-top: 6px; }
.closer-terminal {
  border: 1px solid var(--line);
  border-radius: var(--radius-app);
  background: var(--public-surface);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.terminal-bar {
  padding: 12px 16px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 7px;
}
.terminal-bar span:nth-child(1) { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; display: inline-block; }
.terminal-bar span:nth-child(2) { width: 10px; height: 10px; border-radius: 50%; background: #ffbd2e; display: inline-block; }
.terminal-bar span:nth-child(3) { width: 10px; height: 10px; border-radius: 50%; background: #28c840; display: inline-block; }
.terminal-bar small { margin-left: auto; color: var(--quiet); font-size: 10.5px; font-family: var(--mono); }
.closer-terminal pre {
  margin: 0;
  padding: 28px 32px;
  overflow-x: auto;
}
.closer-terminal code {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--accent-dark);
  white-space: pre;
}

@media (min-width: 1024px) {
  .closer-panel {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(48px, 5vw, 72px);
    padding: clamp(44px, 4.5vw, 60px) clamp(44px, 4.5vw, 60px) clamp(44px, 4.5vw, 60px) clamp(52px, 5vw, 68px);
  }
  .hero-split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(72px, 7vw, 96px);
    align-items: center;
  }
  .hero-copy {
    width: auto;
    max-width: none;
    margin: 0;
    text-align: left;
  }
  .hero-description { margin-inline: 0; max-width: none; }
  .hero-shot-shell {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .hero-copy .hero-launch-band { margin-top: 22px; }
  .hero-launch-label { text-align: left; }
  .hero-launch-foot { align-items: flex-start; }
  .hero-launch-presets { justify-content: flex-start; }
  .hero-note { text-align: left; }
}

.public-footer {
  width: 100%;
  margin: 0;
  padding: 0;
}
.footer-shell {
  width: 100%;
  border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background:
    radial-gradient(ellipse 70% 50% at 10% 100%, color-mix(in srgb, var(--accent) 4%, transparent), transparent 56%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 42%, transparent), transparent 88%);
}
.footer-inner {
  width: var(--public-width);
  margin: 0 auto;
  padding: clamp(44px, 5vw, 60px) 0 clamp(22px, 2.5vw, 28px);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr);
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
  padding-bottom: clamp(24px, 3vw, 32px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}
.footer-brand {
  display: grid;
  gap: 14px;
  max-width: 20rem;
}
.footer-brand .brand { padding: 0; }
.footer-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}
.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.5vw, 32px);
  padding-top: 4px;
}
.footer-nav-col { min-width: 0; }
.footer-nav-title {
  margin: 0 0 12px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-nav-title::after {
  content: "";
  display: block;
  width: 18px;
  height: 1px;
  margin-top: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 45%, transparent);
}
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.footer-nav a,
.footer-nav span {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  transition: color 0.18s ease;
}
.footer-nav a:hover {
  color: var(--text);
}
.footer-nav span { color: var(--quiet); }
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  padding-top: clamp(16px, 2vw, 22px);
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.5;
}
.footer-meta-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.footer-copy,
.footer-owner { color: var(--quiet); }
.footer-owner {
  font-size: 11.5px;
  padding-left: 16px;
  border-left: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
}
.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  color: var(--quiet);
  font-size: 11px;
}
.footer-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--quiet) 70%, var(--muted));
  box-shadow: none;
  flex-shrink: 0;
}

/* Auth / Login Surface Refinement */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: var(--canvas);
}
.auth-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: min(420px, 100%);
}
.auth-brand {
  padding: 0;
}
.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-app);
  padding: 36px 32px;
  display: grid;
  gap: 16px;
}
.auth-card h1 { font-size: 22px; margin: 4px 0 0; }
.auth-description { margin: 0; color: var(--muted); font-size: var(--text-base); line-height: 1.55; }
.auth-action { width: 100%; justify-content: center; }
.auth-note {
  margin: 6px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--quiet);
  font-size: 11.5px;
  line-height: 1.5;
}
.auth-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  min-height: 32px;
  transition: color 0.16s ease;
}
.back-link:hover { color: var(--text); }

/* ==========================================================================
   Account & Access Management Redesign (/app/account)
   ========================================================================== */
.account-page-layout {
  width: 100%;
}
.account-section-stack {
  gap: 20px;
}
.account-hero-card {
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-muted) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-sm);
}
.account-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.account-avatar-block {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.account-avatar-mark {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.account-identity-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.account-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.account-title-row h2 {
  font-size: 20px;
  font-weight: 750;
  color: var(--text);
  margin: 0;
}
.account-meta-line {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.account-meta-line span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.account-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.account-metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.account-quota-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  transition: all 0.16s ease;
}
.account-quota-card:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.account-quota-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.account-quota-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.account-quota-value {
  margin-top: 10px;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: clamp(20px, 1.6vw, 26px);
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.2;
}
.account-quota-note {
  font-size: 11.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Responsive Media Queries & Overflow Guards */
@media (max-width: 1180px) {
  .overview-dashboard-card .grid.metrics { display: flex; }
  .account-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .grid.two, .grid.two.sites-page-layout, .grid.two.workspace-overview-grid, .workspace-overview-grid, .wide-left, .capture-console-layout { grid-template-columns: minmax(0, 1fr); }
  .sites-page-layout > .site-detail-card { max-width: 100%; }
  .capture-preview-card { position: static; }
  .capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border: 0;
    background: var(--bg);
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    width: min(300px, 88vw);
    height: 100vh;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-floating);
    overflow-y: auto;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border: 0;
    padding: 0;
  }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; display: block; }
  .button.menu-button { display: inline-flex; width: 40px; flex-basis: 40px; padding: 0; }
  .hide-mobile { display: none !important; }
  .overview-hero-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .overview-hero-actions { width: 100%; display: flex; gap: 8px; }
  .overview-hero-actions .button { flex: 1; text-align: center; justify-content: center; }
  .public-hero-inner { padding: 48px 0 56px; }
  .hero-shot-shell { margin-top: 36px; }
  .try-page .preview-container-clean { max-height: 50vh; }
  .public-header { flex-wrap: wrap; height: auto; padding: 14px 0; }
  .public-nav { gap: 14px; flex-wrap: wrap; }
  .story-grid,
  .capability-grid,
  .process-rail,
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .process-rail::before { display: none; }
  .process-step { justify-items: start; text-align: left; padding: 0; }
  .process-marker { box-shadow: none; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preset-group { grid-template-columns: minmax(0, 1fr); }
  .snapshot-tool-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .main { padding: 16px 14px 32px; }
  .topbar { min-height: 46px; margin-bottom: 16px; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
  .topbar h1 { font-size: 20px; }
  .topbar .subtitle { font-size: 11.5px; line-height: 1.35; margin-top: 2px; }
  .card { padding: 16px 14px; border-radius: var(--radius-card); }
  .card-header { margin-bottom: 12px; gap: 8px; }
  .card-description { display: none; }
  .overview-dashboard-card { padding: 18px 16px; border-radius: var(--radius-panel); gap: 12px; }
  .overview-quick-input-wrap { margin-top: 2px; }
  .overview-quick-input-wrap .url-input-wrap {
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 8px;
  }
  .overview-quick-input-wrap .url-icon { display: none; }
  .overview-quick-input-wrap input {
    flex: 1 1 100%;
    width: 100%;
    font-size: 14px;
    height: var(--control-h);
  }
  .overview-quick-input-wrap .url-input-actions { width: 100%; }
  .overview-quick-input-wrap .url-input-actions .button { flex: 1; height: var(--control-h); }
  
  /* Mobile 2-Column Metrics Dashboard */
  .overview-dashboard-card .grid.metrics { display: flex; gap: 10px; }
  .account-metrics-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; }
  .account-hero-card { padding: 18px 16px; }
  .account-hero-actions { width: 100%; }
  .account-hero-actions .button { flex: 1; }
  .metric { padding: 12px 14px; border-radius: var(--radius-control); }
  .metric-label { font-size: 11.5px; }
  .metric-icon-wrap { width: 28px; height: 28px; font-size: 13px; border-radius: var(--radius-sm); }
  .metric-value { font-size: 19px; margin-top: 6px; margin-bottom: 2px; }
  .metric-note { font-size: 10.5px; }
  .table th, .table td { padding: 10px 12px; font-size: 12px; }
  .table td.actions .button.small { padding: 3px 8px; font-size: 11px; }

  .dimensions-row-clean {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
    align-items: end;
    gap: 10px;
  }
  .dialog {
    width: min(100vw - 16px, 600px) !important;
    max-height: calc(100vh - 16px) !important;
  }
  .dialog-inner { max-height: calc(100vh - 16px); }
  .dialog-header { padding: 14px 16px; }
  .dialog-body { padding: 16px 14px; }
  .public-header { width: calc(100% - 24px); flex-wrap: nowrap; padding: 10px 0; min-height: 56px; }
  .public-nav > a:not(.button) { display: none; }
  .public-nav > a.public-login-link { display: inline-flex; margin-right: 8px; }
  .try-page .public-nav > a.try-home-link { display: inline-flex; }
  .public-nav { gap: 0; }
  .public-nav .button { min-height: 34px; padding-inline: 11px; font-size: 11px; }
  .public-main { padding-bottom: 48px; }
  .public-hero-inner,
  .public-section { width: calc(100% - 24px); }
  .public-hero-inner { padding: 36px 0 48px; }
  .try-main { width: calc(100% - 24px); padding: 16px 0 40px; }
  .hero-copy h1 { font-size: clamp(28px, 8.5vw, 36px); }
  .hero-description { font-size: 13.5px; }
  .hero-launch-row { flex-wrap: wrap; }
  .hero-launch-row .button { flex: 1 1 100%; }
  .hero-shot-frame img { max-height: 42vh; }
  .hero-copy .hero-launch-band { margin-top: 20px; }
  .public-section { padding: 56px 0; scroll-margin-top: 60px; }
  .section-head h2 { font-size: var(--public-title-2); }
  .section-head { gap: 12px; margin-bottom: 36px; }
  .story-grid { gap: 32px; }
  .closer-panel { padding: 24px; }
  .closer-terminal pre { padding: 18px 20px; }
  .public-footer .footer-inner { width: calc(100% - 24px); }
  .footer-nav { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .footer-actions .button { flex: 1 1 calc(50% - 4px); justify-content: center; }
  .footer-meta { flex-direction: column; align-items: flex-start; }
  .footer-owner {
    padding-left: 0;
    border-left: 0;
  }
  .snapshot-tool-form { grid-template-columns: minmax(0, 1fr); }
  .snapshot-tool-actions { grid-column: auto; }
  .snapshot-share-link-row { grid-template-columns: minmax(0, 1fr) auto; }
  .snapshot-share-link-row a { grid-column: 1 / -1; }
  .snapshot-share-secret > div:first-child,
  .snapshot-share-record { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .public-section {
    opacity: 1;
    transform: none;
  }
  .public-section:not(.is-visible) .section-head,
  .public-section:not(.is-visible) .story-item,
  .public-section:not(.is-visible) .capability-item,
  .public-section:not(.is-visible) .process-step,
  .public-section:not(.is-visible) .plan-card,
  .public-section:not(.is-visible) .faq-rail,
  .public-section:not(.is-visible) .section-note,
  .public-section:not(.is-visible) .closer-panel {
    opacity: 1;
  }
  .hero-window {
    transform: none !important;
  }
}
