/*! bundled: src/ui/styles/tokens.css */
/* ---------- theme tokens ---------- */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --neutral: #000000;
  --bg: #0e0f12;
  --bg-accent: #121418;
  --bg-elev: #16181d;
  --bg-elev-2: #1d2027;
  --bg-hover: #22262e;
  --bg-active: #2a2f39;
  --bg-warning: #6c5610;
  --fg: #e6e8ec;
  --fg-muted: #8b919c;
  --fg-dim: #5b6068;
  --border: #2a2e36;
  --border-strong: #3a3f49;
  --accent: #729fcf;
  --ok: #4ec9b0;
  --running: #e2c08d;
  --warn: #e1b34a;
  --fail: #f48771;
  --skip: #7587a6;
  --queued: #8b919c;
  --tint: #0000005e;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  /* ECharts tooltips: softer than library default. */
  --echarts-tooltip-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  /* Sidebar job rows: gentler than global --bg-hover (buttons, menus). */
  --bg-row-hover: color-mix(in srgb, var(--bg-hover) 60%, var(--bg));
  /*
   * Custom <select> chevron (`appearance:none` hides the UA menu icon).
   * Stroke matches --fg-muted (encoded for SVG data URL).
   */
  --select-chevron-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%238b919c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
}

:root[data-theme="light"] {
  color-scheme: light;
  --neutral: #ffffff;
  --bg: #f7f8fa;
  --bg-accent: #fafafb;
  --bg-elev: #ffffff;
  --bg-elev-2: #f0f2f5;
  --bg-hover: #e8ebf0;
  --bg-active: #dbe1ea;
  --bg-warning: #fff3cd;
  --fg: #1d2027;
  --fg-muted: #5b6068;
  --fg-dim: #8b919c;
  --border: #d8dce3;
  --border-strong: #b8bec8;
  --accent: #2e6cdf;
  --ok: #2c8c6f;
  --running: #b07d2c;
  --warn: #a16207;
  --fail: #c43c30;
  --skip: #6b7d9c;
  --queued: #6b7280;
  --tint: #ffffff5e;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  --echarts-tooltip-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  --bg-row-hover: color-mix(in srgb, var(--bg-hover) 5%, var(--bg));
  --select-chevron-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%235b6068' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
}


/*! bundled: src/ui/styles/base.css */
/* ---------- base ---------- */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.45 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

/* Headless SSE host: must stay in DOM for hx-sse:connect, but never paint. */
#sse {
  display: contents;
}

code, pre, .mono, .job-id, .job-postid, .detail-id, .meta-postid, .placeholder-err, .webhook-err, .raw pre {
  font-family: ui-monospace, "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
}

button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

a { color: var(--accent); text-decoration: none; }

code {
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--tint);
}


/*! bundled: src/ui/styles/topbar.css */
/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  height: 48px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding-right: 12px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-name { color: var(--fg); line-height: 1; }

/** Job filters: `#filter-bar` in `FilterBarForm`; ≤1279px = icon + popup, ≥1080px = inline (wrapping row). */
.filter-format-inner--empty {
  display: none;
}

#filter-flow-slots-wrap {
  display: block;
  width: 100%;
}

.topbar-fill {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 1px;
}

.filter-toolbar {
  position: relative;
  flex-shrink: 0;
}

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

.filter-menu-toggle-label svg {
  display: block;
  width: 12px;
  height: 12px;
}

/** Narrow-only control; matches theme icon footprint but slightly tighter. */
.filter-menu-toggle-label.btn.btn-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
}

.filter-menu-dropdown {
  box-sizing: border-box;
}

@media (max-width: 1279px) {
  .filter-menu-dropdown {
    display: none;
  }

  .filter-menu-toggle-input:checked ~ .filter-menu-dropdown {
    display: block;
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 250;
    min-width: 160px;
    max-width: min(92vw, 333px);
    max-height: min(72vh, 420px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
  }
}

.filter-menu-dropdown .filters {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin: 0;
  width: 100%;
}

.filter-menu-dropdown .filters .filter-flow-slots {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.filter-menu-dropdown .filter-group {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.filter-menu-dropdown .filter-inline-legend {
  padding-right: 0;
}

.filter-menu-dropdown .filter-radio-stack {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.filter-menu-dropdown .filter-select {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  max-width: none;
}

.filter-menu-dropdown .filter-select select {
  width: 100%;
  max-width: none;
}

@media (min-width: 1080px) {
  .topbar-fill {
    display: none;
  }

  .filter-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    position: static;
  }

  .filter-menu-toggle-input {
    display: none;
  }

  .filter-menu-toggle-label {
    display: none !important;
  }

  .filter-menu-dropdown {
    display: block !important;
    position: static;
    left: auto;
    top: auto;
    z-index: auto;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .filter-menu-dropdown .filters {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .filter-menu-dropdown .filters .filter-flow-slots {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    width: auto;
    flex-shrink: 0;
  }

  #filter-flow-slots-wrap {
    display: contents;
    width: auto;
  }

  .filter-menu-dropdown .filter-group {
    flex-direction: row;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
  }

  .filter-menu-dropdown .filter-inline-legend {
    padding-right: 6px;
  }

  .filter-menu-dropdown .filter-radio-stack {
    width: auto;
    max-width: none;
    overflow-x: visible;
    flex-wrap: nowrap;
    padding-bottom: 0;
  }

  .filter-menu-dropdown .filter-select {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    width: auto;
    max-width: 100%;
    flex: 0 0 auto;
  }

  .filter-menu-dropdown .filter-select select {
    width: auto;
    max-width: 100%;
    min-width: 0;
  }
}

.filter-group {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  flex-shrink: 0;
}
.filter-inline-legend {
  color: var(--fg-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-right: 6px;
  flex: 0 0 auto;
}
.filter-radio-stack {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
}
.filter-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.filter-group label {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  margin: 0;
  border: 1px solid var(--border);
  border-right-width: 0;
  background: var(--bg-elev);
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 12px;
  user-select: none;
  transition: background 80ms, color 80ms;
}
.filter-group label:hover { background: var(--bg-hover); color: var(--fg); }
.filter-group label:first-of-type { border-radius: 4px 0 0 4px; }
.filter-group label:last-of-type {
  border-radius: 0 4px 4px 0;
  border-right-width: 1px;
}
.filter-group input[type="radio"]:checked + label {
  background: var(--bg-active);
  color: var(--fg);
  border-color: var(--border-strong);
}
.filter-group input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.filter-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  max-width: 100%;
}
.filter-select label {
  color: var(--fg-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.filter-select select {
  height: 26px;
  min-width: 0;
  max-width: 100%;
  padding: 0 30px 0 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-elev);
  background-image: var(--select-chevron-svg);
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 10px 6px;
  color: var(--fg);
  border-radius: 4px;
  font-size: 12px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}
.filter-select select:hover { background-color: var(--bg-hover); border-color: var(--border-strong); }
.filter-select select option:disabled {
  opacity: 0.42;
  color: var(--fg-muted);
}
.filter-select select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.topbar-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

#theme-toggle {
  flex-shrink: 0;
}

#alerts-open {
  flex-shrink: 0;
}

#scraper-settings-open {
  flex-shrink: 0;
}

/* Header ADB / device status (HTMX-polled) */
.header-device-slot {
  flex-shrink: 1;
  min-width: 0;
  max-width: 280px;
  display: flex;
  align-items: center;
}

.header-proxy-slot {
  flex-shrink: 1;
  min-width: 0;
  max-width: 280px;
  display: flex;
  align-items: center;
}

#device-badge-live {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

#proxy-badge-live {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.device-menu-dropdown--proxy {
  min-width: 220px;
}

.proxy-badge-dropdown-list {
  max-height: 210px;
  overflow-y: auto;
  margin: 0 0 4px;
  padding: 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.proxy-badge-dropdown-empty {
  margin: 0 0 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--fg-dim);
}

.proxy-badge-proxy-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.proxy-badge-proxy-item {
  margin: 0;
  padding: 0;
}

.proxy-badge-proxy-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
}
.proxy-badge-proxy-row:hover {
  background: var(--bg-hover);
}
.proxy-badge-proxy-dot {
  flex-shrink: 0;
}
.proxy-badge-proxy-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  color: var(--fg-muted);
}
.proxy-badge-proxy-row:hover .proxy-badge-proxy-label {
  color: var(--fg);
}
.proxy-badge-proxy-row .proxy-url-icons {
  flex-shrink: 0;
  color: var(--fg-muted);
}
.proxy-badge-proxy-chevron {
  flex-shrink: 0;
  color: var(--fg-muted);
  margin-left: 2px;
}

.device-menu-dropdown--device {
  min-width: 220px;
}

.device-badge-dropdown-list {
  max-height: 200px;
  overflow-y: auto;
  margin: 0 0 4px;
  padding: 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.device-badge-dropdown-empty {
  margin: 0 0 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--fg-dim);
}

.device-badge-device-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.device-badge-device-item {
  margin: 0;
  padding: 0;
}

.device-badge-device-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
}
.device-badge-device-row:hover {
  background: var(--bg-hover);
}
.device-badge-device-dot {
  flex-shrink: 0;
}
.device-badge-device-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  color: var(--fg-muted);
}
.device-badge-device-row:hover .device-badge-device-label {
  color: var(--fg);
}
.device-badge-device-chevron {
  flex-shrink: 0;
  color: var(--fg-muted);
  margin-left: 2px;
}

.device-badge-metrics {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.device-status-dot {
  display: block;
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg-dim);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.device-status-dot[data-state="connected"] {
  background: var(--ok);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ok) 40%, var(--border));
}
.device-status-dot[data-state="error"] {
  background: var(--fail);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fail) 40%, var(--border));
}
.device-status-dot[data-state="unknown"] {
  background: var(--fg-dim);
}
.device-status-dot[data-state="idle"] {
  background: var(--fg-dim);
  opacity: 0.65;
}
.device-menu {
  position: relative;
  max-width: 100%;
}
.device-menu > summary.device-menu-trigger {
  list-style: none;
  gap: 6px;
  height: 29px;
  min-height: 29px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
}
.device-menu > summary.device-menu-trigger:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}
.device-menu > summary.device-menu-trigger::-webkit-details-marker {
  display: none;
}
.device-menu-trigger-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.device-menu-trigger-label {
  color: var(--fg);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-menu-trigger-sep {
  flex-shrink: 0;
  color: var(--fg-dim);
  font-weight: 400;
  font-size: 11px;
}
.device-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 200;
  min-width: 200px;
  padding: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.device-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--fg);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.device-menu-item:hover {
  background: var(--bg-hover);
}


/*! bundled: src/ui/styles/buttons.css */
/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 80ms, border-color 80ms;
}
.btn:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--border-strong); }
.btn:active:not(:disabled) { background: var(--bg-active); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }

.btn-warning:hover:not(:disabled) {
  background: color-mix(in srgb, var(--warn) 18%, var(--bg-elev));
  border-color: var(--warn);
  color: var(--warn);
}

.btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--fail) 18%, var(--bg-elev));
  border-color: var(--fail);
  color: var(--fail);
}

.btn-icon {
  width: 28px;
  padding: 0;
  font-size: 14px;
  color: var(--fg-muted);
}

.btn-sm {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
}


/*! bundled: src/ui/styles/layout.css */
/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 0;
  overflow: hidden;
  flex: 1 1 auto;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-elev);
  overflow: auto;
  padding: 0;
}

.main {
  overflow: auto;
  padding: 0;
}


/*! bundled: src/lib/job/ui/list.css */

/* ---------- list ---------- */

.list-header {
  position: sticky;
  top: 0;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  box-sizing: border-box;
}
.list-header-title {
  flex-shrink: 0;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.list-header-hint {
  font-size: 10px;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
  white-space: nowrap;
}
.list-loading, .list-empty {
  padding: 16px;
  color: var(--fg-muted);
}
.list-empty-reset {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.list-empty-reset:hover {
  color: var(--fg);
}
.job-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.job-row-slot {
  list-style: none;
  margin: 0;
  padding: 0;
}
.job-row-slot .job-row {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}
.job-row {
  display: grid;
  grid-template-columns: 18px auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 60ms;
}
.job-row:hover { background: var(--bg-row-hover); }
.job-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 13px;
  font-weight: 700;
}
.status-dot[data-status="queued"]    { color: var(--queued); }
.status-dot[data-status="running"]   { color: var(--running); animation: pulse 1.4s ease-in-out infinite; }
.status-dot[data-status="completed"] { color: var(--ok); }
.status-dot[data-status="warning"]   { color: var(--warn); }
.status-dot[data-status="failed"]    { color: var(--fail); }
.status-dot[data-status="corrected"] { color: var(--accent); }
.status-dot[data-status="rejected"]  { color: var(--fail); }

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

.job-id { color: var(--fg); font-weight: 600; }
.job-platform {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-elev-2);
  color: var(--fg-muted);
  border: 1px solid var(--border);
}
.platform-x           { color: #999999; }
.platform-instagram   { color: #d77b9c; }
.platform-facebook    { color: #6e9bd6; }
.platform-youtube     { color: #d76e6e; }
.platform-tiktok      { color: #5cbbcb; }
.platform-bluesky     { color: #1185fe; }
.platform-telegram    { color: #229ed9; }
.platform-threads     { color: #5b6068; }
.platform-truthsocial { color: #8b3a62; }
.platform-gettr       { color: #b8252a; }
.platform-substack    { color: #ff6719; }
.platform-snapchat    { color: #d4b820; }

.job-postid {
  color: var(--fg-muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.job-age {
  color: var(--fg-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* infinite scroll sentinel + row skeleton */
.job-row--skeleton {
  min-height: 32px;
  pointer-events: none;
  opacity: 0.72;
}
.job-skel-dot {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: var(--border-strong);
}
.job-skel-id {
  height: 12px;
  width: 22%;
  min-width: 32px;
  border-radius: 3px;
  background: var(--border-strong);
}
.job-skel-chip {
  height: 12px;
  width: 44px;
  border-radius: 3px;
  background: var(--border-strong);
}
.job-skel-post {
  height: 10px;
  width: auto;
  min-width: 0;
  border-radius: 3px;
  background: var(--border);
}
.job-skel-age {
  height: 10px;
  width: 52px;
  border-radius: 3px;
  background: var(--border);
}

.job-list-sentinel {
  list-style: none;
  padding: 0;
  margin: 0;
  border-bottom: 1px dashed var(--border);
  background: var(--bg-elev);
}
.job-list-sentinel-skel {
  padding: 4px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.job-list-sentinel-skel .job-row--skeleton {
  opacity: 0.55;
  border-bottom: 1px solid var(--border);
}

/*! bundled: src/lib/job/ui/skeleton.css */
@keyframes sk-shimmer {
  0%,
  100% {
    opacity: 0.52;
  }
  50% {
    opacity: 0.92;
  }
}

.skel-pulse {
  animation: sk-shimmer 1.15s ease-in-out infinite;
  background-color: color-mix(in srgb, var(--border-strong) 55%, transparent);
  color: transparent; /* hide text */;
}

/* Job detail skeleton (matches detail.css hierarchy) */

.detail.detail--skeleton {
  gap: 12px;
}

.detail--skeleton .detail-actions--skeleton {
  display: flex;
  gap: 6px;
  align-self: start;
}

.skel-pill {
  display: inline-block;
  width: 99px;
  height: 24px;
  border-radius: 3px;
  vertical-align: middle;
}

.skel-detail-id {
  display: inline-block;
  height: 16px;
  width: 48px;
  border-radius: 3px;
  vertical-align: middle;
}

.skel-btn {
  display: inline-block;
  height: 30px;
  width: 67px;
  border-radius: 4px;
}
.skel-btn.skel-danger {
  width: 55px;
}

.skel-chip {
  display: inline-block;
  height: 18px;
  width: 60px;
  border-radius: 3px;
  vertical-align: middle;
}

.skel-chip-wide {
  width: 100px;
}

.skel-mono {
  display: inline-block;
  height: 16px;
  width: min(220px, 48vw);
  border-radius: 3px;
  vertical-align: middle;
}

.detail--skeleton .detail-times .skel-time-group {
  display: inline-flex;
  width: 90px;
  height: 16px;
  border-radius: 3px;
  margin-right: 4px;
}

.skel-panel-title {
  display: inline-block;
  height: 12px;
  width: 36.56px;
  border-radius: 3px;
  vertical-align: middle;
}

.skel-panel-title-wide {
  width: 76.3px;
}

.skel-panel-dur {
  display: inline-block;
  margin-left: auto;
  height: 12px;
  width: 17px;
  border-radius: 3px;
  vertical-align: middle;
}

.detail--skeleton .panel h3 {
  gap: 8px;
}

.skel-artifact {
  flex: 1 1 0;
  min-height: 180px;
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.raw.raw-skeleton {
  margin: 0;
  opacity: 0.85;
}
.raw.raw-skeleton summary {
  list-style: none;
  cursor: default;
}
.raw.raw-skeleton summary::-webkit-details-marker {
  display: none;
}
.skel-summary {
  display: inline-block;
  height: 13px;
  width: 64px;
  border-radius: 3px;
  font-size: 0;
}


/*! bundled: src/lib/job/ui/detail.css */
/* ---------- detail ---------- */

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--fg-dim);
  gap: 6px;
}
.empty-marker { font-size: 48px; opacity: 0.3; line-height: 1; color: #999 }
.empty-hint { font-size: 11px; }

.detail {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 16px 20px;
  gap: 14px;
}

.detail-header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title actions"
    "meta  actions"
    "times times";
  gap: 6px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.detail-title  { grid-area: title; display: flex; align-items: center; gap: 10px; min-width: 0; }
.detail-meta   { grid-area: meta;  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--fg-muted); font-size: 12px; min-width: 0; }
.detail-actions{ grid-area: actions; display: flex; gap: 6px; align-items: center; align-self: start; }

.detail-times {
  grid-area: times;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  color: var(--fg-dim);
  font-size: 11px;
  font-family: ui-monospace, "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
}
.time-item { display: inline-flex; align-items: baseline; gap: 5px; }
.time-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  opacity: 0.7;
}
.time-rel { color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.time-dur { color: var(--fg-muted); font-variant-numeric: tabular-nums; }

.detail-id { color: var(--fg-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
a.detail-id {
  color: var(--fg-muted);
  text-decoration: none;
}
a.detail-id:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.meta-topic {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--fg-muted);
}
.meta-postid { font-family: ui-monospace, monospace; font-size: 12px; }
a.meta-postid {
  color: inherit;
  text-decoration: none;
}
a.meta-postid:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.device-kv {
  margin: 0;
  font-size: 11px;
}
.device-kv dt {
  color: var(--fg-dim);
  font-weight: 500;
}
.device-kv dd {
  color: var(--fg-muted);
  margin-left: 0;
  margin-bottom: 4px;
  font-family: ui-monospace, monospace;
  word-break: break-all;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}
.status-pill[data-status="queued"]    { color: var(--queued); }
.status-pill[data-status="running"]   { color: var(--running); border-color: color-mix(in srgb, var(--running) 35%, var(--border)); }
.status-pill[data-status="completed"] { color: var(--ok);      border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.status-pill[data-status="warning"]   { color: var(--warn);   border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.status-pill[data-status="failed"]    { color: var(--fail);    border-color: color-mix(in srgb, var(--fail) 45%, var(--border)); }
.status-pill[data-status="corrected"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.status-pill[data-status="rejected"]  { color: var(--fail);    border-color: color-mix(in srgb, var(--fail) 45%, var(--border)); }

.status-pill-hover {
  position: relative;
  display: inline-flex;
  align-self: center;
}

.status-pill-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 260px;
  max-width: min(400px, calc(100vw - 48px));
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  box-shadow: var(--shadow);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, visibility 0.14s ease;
}

/* Invisible bridge over the offset gap so :hover isn’t lost between pill and tooltip. */
.status-pill-tooltip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 12px;
}

.status-pill-hover:hover .status-pill-tooltip,
.status-pill-hover:focus-within .status-pill-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.status-pill-tooltip-hdr {
  margin: 0 0 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  font-weight: 600;
}

.status-pill-tooltip .webhook-kv { margin: 0; }
.status-pill-tooltip .webhook-err {
  max-height: 200px;
}

.status-pill-tooltip .webhook-resend {
  margin-top: 8px;
}

/* Collapse screenshot/video while raw json or scrape device <details> is open */
.detail:has(> details.raw[open]) > .detail-grid {
  display: none;
}


/*! bundled: src/lib/job/ui/artifacts.css */
/* ---------- artifact panels ---------- */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}
.panel-screenshot { grid-column: 1; grid-row: 1; }
.panel-video      { grid-column: 2; grid-row: 1; }

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.panel h3 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  font-weight: 600;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.panel h3.panel-head-with-meta .panel-duration {
  margin-left: 0;
}
.panel-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Completed screenshot host: badges sit top-right inside the image box. */
.artifact-image-host {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  border-radius: 3px;
  overflow: hidden;
}

.artifact-image-host img.artifact {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.artifact-scan-badges-tr {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

/* Radar + badges stack inside `.artifact-scan-wrap.is-scanning` (see overlay rules below). */
/* AI scan badge + flag overlay rules live in lib/scan/ui/styles.css */
/* Artifact + placeholder share the same flex sizing inside the panel so the
 * layout doesn't jump when the image/video swaps in. They fill the remaining
 * vertical space of the panel; max-height keeps things sane on tall viewports.
 */
.artifact,
.panel-screenshot .placeholder,
.panel-video .placeholder {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  background: var(--bg-elev-2);
  border-radius: 3px;
  border: 1px solid var(--border);
}
.artifact { display: block; background: var(--neutral); }
img.artifact { object-fit: contain; height: 100%; }
video.artifact { object-fit: contain; height: 100%; background: black; }

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--fg-muted);
  font-size: 12px;
  padding: 16px;
  text-align: center;
}
.placeholder.skip {
  color: var(--skip);
}
.artifact.placeholder.skip {
  border: none;
}
.placeholder.fail  { color: var(--fail); border-color: color-mix(in srgb, var(--fail) 50%, var(--border)); background: color-mix(in srgb, var(--fail) 10%, var(--bg-elev-2)); }
.placeholder-label { font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 11px; }
.placeholder-err {
  margin: 0;
  padding: 8px;
  font-size: 11px;
  color: var(--fail);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  text-align: left;
  width: 100%;
  background: var(--bg);
  border-radius: 3px;
}

.placeholder-fail-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-shrink: 0;
}

.placeholder.shimmer {
  background:
    repeating-linear-gradient(
      135deg,
      var(--bg-elev-2) 0 12px,
      var(--bg-hover) 12px 24px
    );
  background-size: 200% 200%;
  animation: shimmer 2s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: 0 0; }
  100% { background-position: 200% 0; }
}

/* ---------- AI screenshot scan overlay ---------- */

.panel-ai-scan-pill {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  animation: ai-scan-pill-pulse 1.2s ease-in-out infinite;
}

@keyframes ai-scan-pill-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.4; }
}

/* Radar sweep overlays the screenshot only (Workers AI scan in progress). */
.artifact-scan-wrap.is-scanning {
  isolation: isolate;
}

.artifact-scan-wrap.is-scanning > img.artifact,
.artifact-scan-wrap.is-scanning > video.artifact {
  position: relative;
  z-index: 0;
}

.artifact-scan-wrap.is-blocked {
  isolation: isolate;
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.artifact-scan-wrap.is-blocked > video.artifact {
  position: relative;
  z-index: 0;
}

.panel-ai-scan-radar {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: inherit;
  container-type: size;
}

/* Band height tied to viewport; `--band-h` reused so bottom inset matches subtraction exactly. */
.panel-ai-scan-radar-sweep {
  --bar-h: 3px;
  --band-h: min(160px, 26cqh);

  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--band-h);
  top: 0;
  bottom: auto;
  will-change: top;
  animation:
    panel-ai-radar-move 5.4s ease-in-out infinite,
    panel-ai-radar-pulse 1.45s ease-in-out infinite;
}

.panel-ai-scan-radar-sweep::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--bar-h);
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--accent) 35%, transparent) 12%,
    var(--accent) 42%,
    var(--accent) 58%,
    color-mix(in srgb, var(--accent) 35%, transparent) 88%,
    transparent 100%
  );
  box-shadow:
    0 0 8px 2px color-mix(in srgb, var(--accent) 90%, transparent),
    0 0 22px 7px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 44px 14px color-mix(in srgb, var(--accent) 28%, transparent);
}

.panel-ai-scan-radar-sweep::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: var(--bar-h);
  bottom: 0;
  transform-origin: top center;
  /* Strong edge at TOP of ::after (flush under bar): tail extends downward → “behind” when moving down */
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--accent) 55%, transparent) 0%,
    color-mix(in srgb, var(--accent) 18%, transparent) 42%,
    transparent 100%
  );
  filter: blur(10px);
  opacity: 0.92;
  /* Matches eased translation conceptually; linear spline follows sin(phase) vs time → smooth flip-through-zero at half-cycle. */
  animation: panel-ai-radar-tail-morph 5.4s linear infinite;
}

/* sin(360° × t): short at turnaround, full mid‑stroke; sign crosses 0 at 50% */
@keyframes panel-ai-radar-tail-morph {
  0%,
  50%,
  100% {
    transform: scaleY(0);
  }
  6.25% {
    transform: scaleY(0.382683);
  }
  12.5% {
    transform: scaleY(0.707107);
  }
  18.75% {
    transform: scaleY(0.92388);
  }
  25% {
    transform: scaleY(1);
  }
  31.25% {
    transform: scaleY(0.92388);
  }
  37.5% {
    transform: scaleY(0.707107);
  }
  43.75% {
    transform: scaleY(0.382683);
  }
  56.25% {
    transform: scaleY(-0.382683);
  }
  62.5% {
    transform: scaleY(-0.707107);
  }
  68.75% {
    transform: scaleY(-0.92388);
  }
  75% {
    transform: scaleY(-1);
  }
  81.25% {
    transform: scaleY(-0.92388);
  }
  87.5% {
    transform: scaleY(-0.707107);
  }
  93.75% {
    transform: scaleY(-0.382683);
  }
}

/* `%` resolves against radar (positioning ancestor) height — avoids cqh/transform % mismatch (~short travel). */
@keyframes panel-ai-radar-move {
  0%,
  100% {
    top: 0;
  }
  50% {
    top: calc(100% - var(--bar-h));
  }
}

@keyframes panel-ai-radar-pulse {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}

.artifact-scan-wrap.is-scanning .panel-ai-scan-floating-label {
  position: absolute;
  z-index: 4;
  left: 10px;
  bottom: 8px;
}

.artifact-scan-wrap {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.artifact-scan-wrap.is-flagged {
  border-color: color-mix(in srgb, var(--fail) 52%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fail) 28%, transparent);
}

.artifact-scan-wrap.is-ai-pass {
  border-color: color-mix(in srgb, var(--ok) 52%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ok) 26%, transparent);
}

.artifact-scan-wrap img.artifact,
.artifact-scan-wrap video.artifact {
  display: block;
  width: 100%;
  height: 100%;
}

.artifact-scan-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  pointer-events: none;
}

.artifact-scan-flag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 8px 10px;
  line-height: 1.35;
  color: var(--fg);
  background: color-mix(in srgb, var(--fail) 18%, var(--bg));
  border-top: 2px solid color-mix(in srgb, var(--fail) 55%, var(--border));
  will-change: transform;
}

.artifact-scan-pass-flag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 12px 10px 8px 10px;
  line-height: 1.35;
  color: var(--fg);
  background: color-mix(in srgb, var(--ok) 14%, var(--bg));
  border-top: 2px solid color-mix(in srgb, var(--ok) 48%, var(--border));
  will-change: transform;
}

.artifact-scan-pass-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--ok) 76%, var(--fg));
  line-height: 1.25;
  margin-bottom: 6px;
}

.artifact-scan-pass-check {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: var(--ok);
}

.artifact-scan-pass-title-text {
  min-width: 0;
}

.artifact-scan-pass-reason-label {
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--ok) 62%, var(--fg-dim));
}

.artifact-scan-pass-detail-pre {
  border-color: color-mix(in srgb, var(--ok) 12%, var(--border)) !important;
  background: color-mix(in srgb, var(--ok) 5%, transparent) !important;
  color: color-mix(in srgb, var(--fg-muted) 45%, var(--fg)) !important;
}

.artifact-scan-wrap.is-ai-pass .artifact-scan-pass-flag {
  max-height: calc(100% - 40px);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
}

.artifact-scan-pass-acc {
  flex: 1 1 auto;
  min-height: 0;
}

.artifact-scan-pass-acc > .artifact-scan-pass-disclosure:first-child {
  margin-top: 0;
}

.artifact-scan-pass-disclosure {
  margin-top: 8px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--ok) 22%, var(--border));
  background: color-mix(in srgb, var(--ok) 5%, var(--bg-elev));
}

.artifact-scan-pass-disclosure-summary {
  cursor: pointer;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}

.artifact-scan-pass-disclosure-body {
  padding: 0 10px 10px;
  border-top: 1px solid color-mix(in srgb, var(--ok) 14%, var(--border));
}

.artifact-scan-pass-disclosure-body .artifact-scan-pass-reason-label:first-of-type {
  margin-top: 8px;
}

@media (hover: hover) and (pointer: fine) {
  .artifact-scan-wrap.is-flagged .artifact-scan-flag,
  .artifact-scan-wrap.is-ai-pass .artifact-scan-pass-flag {
    transform: translateY(calc(100% + 3px));
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .artifact-scan-wrap.is-flagged:hover .artifact-scan-flag,
  .artifact-scan-wrap.is-ai-pass:hover .artifact-scan-pass-flag {
    transform: translateY(0);
  }
}

@media (hover: none), (pointer: coarse) {
  .artifact-scan-wrap.is-flagged .artifact-scan-flag,
  .artifact-scan-wrap.is-ai-pass .artifact-scan-pass-flag {
    transform: none;
    transition: none;
  }
}



/*! bundled: src/lib/scan/ui/styles.css */
/* ---------- AI screenshot per-model badges ---------- */

.ai-scan-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-scan-badge {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  font-size: 8px;
  font-weight: 800;
  border: 1px solid transparent;
}

.ai-scan-badge-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.ai-scan-badge-icon-svg svg {
  width: 14px;
  height: 14px;
  display: block;
}

.ai-scan-badge--ok .ai-scan-badge-icon-svg {
  color: color-mix(in srgb, var(--ok) 72%, var(--fg));
}

.ai-scan-badge--fail .ai-scan-badge-icon-svg {
  color: color-mix(in srgb, var(--fail) 78%, var(--fg));
}

.ai-scan-badge--skip .ai-scan-badge-icon-svg {
  color: color-mix(in srgb, var(--fg-muted) 55%, var(--fg));
}

.ai-scan-badge-fallback {
  line-height: 1;
}

.ai-scan-badge--ok {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  border-color: color-mix(in srgb, var(--ok) 42%, transparent);
}

.ai-scan-badge--fail {
  background: color-mix(in srgb, var(--fail) 20%, transparent);
  border-color: color-mix(in srgb, var(--fail) 50%, var(--border));
}

.ai-scan-badge--skip {
  background: color-mix(in srgb, var(--fg-muted) 12%, transparent);
  color: var(--fg-muted);
  border-color: var(--border);
}

/* Flag overlay: section title + optional per-model breakdown inside `.artifact-scan-flag`. */
.artifact-scan-flag .ai-scan-flag-detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.artifact-scan-flag .ai-scan-flag-detail-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--fail) 72%, var(--fg));
  line-height: 1.25;
}

.artifact-scan-flag-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.artifact-scan-flag-actions .btn {
  background: color-mix(in srgb, var(--fail) 22%, var(--bg-elev));
  border-color: color-mix(in srgb, var(--fail) 42%, var(--border));
  color: color-mix(in srgb, var(--fail) 78%, var(--fg));
}

.artifact-scan-flag-actions .btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--fail) 32%, var(--bg-elev));
  border-color: color-mix(in srgb, var(--fail) 55%, var(--border));
  color: color-mix(in srgb, var(--fail) 90%, var(--fg));
}

.artifact-scan-flag-actions .btn:active:not(:disabled) {
  background: color-mix(in srgb, var(--fail) 38%, var(--bg-active));
}

.artifact-scan-flag .ai-scan-flag-detail-model {
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--fail) 14%, transparent);
}

.artifact-scan-flag .ai-scan-flag-detail-title-row + .ai-scan-flag-detail-model {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.artifact-scan-flag .ai-scan-flag-detail-hdr {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
}

.artifact-scan-flag .ai-scan-flag-detail-body {
  margin-top: 4px;
}

.ai-scan-flag-detail-plain {
  font-size: 11px;
  color: color-mix(in srgb, var(--fg) 72%, var(--fg-dim));
}

.ai-scan-flag-detail-pre {
  margin: 4px 0 0;
  padding: 5px 7px;
  max-height: min(240px, 38vh);
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 9.5px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
  color: color-mix(in srgb, var(--fg-muted) 55%, var(--fg));
  background: color-mix(in srgb, var(--fg) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--fail) 8%, var(--border));
  border-radius: 3px;
  box-shadow: none;
}

.artifact-scan-flag .artifact-scan-flag-msg-pre {
  margin: 0;
  max-height: min(280px, 42vh);
}


/*! bundled: src/lib/webhook/ui/styles.css */
/* ---------- webhook + raw ---------- */

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0;
}
.kv dt {
  color: var(--fg-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kv dd { margin: 0; color: var(--fg); font-size: 12px; }

.webhook-err {
  margin: 8px 0 0;
  padding: 8px;
  background: var(--bg);
  color: var(--fail);
  font-size: 11px;
  border-radius: 3px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow: auto;
}

.raw summary {
  cursor: pointer;
  color: var(--fg-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 0;
}
.raw[open] summary { color: var(--fg); }
.raw pre {
  margin: 6px 0 0;
  padding: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--fg);
  overflow: auto;
}

.raw .device-kv {
  margin: 6px 0 0;
  padding: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
}


/*! bundled: src/ui/styles/modal.css */
/* ---------- modal ---------- */

.modal {
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--fg);
  border-radius: 6px;
  padding: 0;
  width: min(440px, calc(100% - 32px));
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(0, 0, 0, 0.45); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}
.modal-body label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.modal-body label.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--fg);
}
.modal-body input[type="text"],
.modal-body input:not([type]),
.modal-body input[type="number"] {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.modal-body select {
  height: 30px;
  padding: 0 30px 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--fg);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg);
  background-image: var(--select-chevron-svg);
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 10px 6px;
  cursor: pointer;
}
.modal-body input:focus,
.modal-body select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.modal-body select option:disabled {
  opacity: 0.42;
  color: var(--fg-muted);
}

.form-error {
  margin: 0;
  min-height: 1.2em;
  color: var(--fail);
  font-size: 11px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev-2);
}

.modal--wide {
  width: min(560px, calc(100% - 32px));
}

.modal--crop {
  width: min(720px, calc(100% - 32px));
}

.crop-offsets-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.crop-offsets-help {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg-muted);
}

/** Topic + platform row (device is fixed in context). */
.crop-offsets-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 24px;
}
.crop-offsets-toolbar--split {
  flex-wrap: nowrap;
  gap: 12px;
}
.crop-offsets-toolbar--split .crop-offsets-field-col--topic,
.crop-offsets-toolbar--split .crop-offsets-field-col--platform {
  flex: 1 1 0;
  min-width: 0;
}
.crop-offsets-toolbar--split .crop-offsets-field-col select {
  width: 100%;
  min-width: 0;
}
.crop-offsets-platform-placeholder {
  font-size: 12px;
  color: var(--fg-muted);
  padding: 5px 0;
}
.crop-offsets-field-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.crop-offsets-field-col label {
  margin-bottom: 0;
}

.modal-body .create-flow-slots label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal-body .create-flow-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Queue form: topic + platform + format on one inline row */
.queue-flow-row {
  display: flex;
  align-items: end;
  gap: 10px;
}
.queue-flow-row > label {
  flex: 1 1 0;
  min-width: 0;
}
/* Make the slots wrapper transparent so #create-flow-slots participates directly */
.queue-flow-row #create-flow-slots-wrap {
  display: contents;
}
/* #create-flow-slots takes 2/3 of the row (platform + format share it equally) */
.queue-flow-row .create-flow-slots {
  flex: 2 1 0;
  min-width: 0;
  flex-direction: row;
}
/* #create-format-inner is transparent so format label is a direct flex sibling */
.queue-flow-row #create-format-inner {
  display: contents;
}
.queue-flow-row .create-flow-slots label {
  flex: 1 1 0;
  min-width: 0;
}
.queue-flow-row label select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .queue-flow-row {
    flex-direction: column;
    align-items: stretch;
  }
  .queue-flow-row #create-flow-slots-wrap {
    display: block;
  }
  .queue-flow-row .create-flow-slots {
    flex-direction: column;
  }
  .queue-flow-row #create-format-inner {
    display: block;
  }
}

/** Crop form: topic + platform + per-format margin table. */
.crop-offsets-flow-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.crop-offsets-table-panel {
  overflow: hidden;
  min-height: 0;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.crop-offsets-empty {
  margin: 0;
  padding: 11px;
  font-size: 11px;
  line-height: 1.45;
  border-radius: 4px;
  color: var(--fg);
  background-color: var(--bg-warning);
}
.crop-offsets-empty code {
  font-size: 11px;
}

/** One header row + data rows per topic (`.switch-device-table`-style). */
.crop-offsets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}
.crop-offsets-table th[scope="row"] {
  text-indent: 4px;
}
.crop-offsets-table th,
.crop-offsets-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.crop-offsets-table thead th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--bg-accent);
  color: var(--fg-dim);
}
.crop-offsets-th-format {
  width: 10rem;
  border-bottom: 1px solid var(--border);
}
.crop-offsets-th-num {
  text-align: left;
  width: auto;
}
.crop-offsets-td-input {
  text-align: left;
}
.crop-offsets-td-input input {
  width: 100%;
  max-width: 5.5rem;
  margin: 0;
  display: block;
}
.crop-format-cell {
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: normal;
}
html[data-theme="dark"] .crop-format-cell {
  color: #fff;
}
html[data-theme="light"] .crop-format-cell {
  color: var(--fg);
}
.crop-offsets-table tbody tr:last-child th,
.crop-offsets-table tbody tr:last-child td {
  border-bottom: 0;
}
.crop-offsets-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  margin-top: 0;
  border-top: 1px solid var(--border);
}
.crop-offsets-saved {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

/* Queue modal toggles structured vs bulk — radiogroup without JS */
.queue-mode-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.queue-shell .queue-panel--structured,
.queue-shell .queue-panel--bulkurls {
  display: none;
}
.queue-shell #queue-mode-structured:checked ~ .queue-panel--structured,
.queue-shell #queue-mode-bulkurls:checked ~ .queue-panel--bulkurls {
  display: block;
}

.modal.modal--queue {
  width: min(520px, calc(100% - 32px));
}
.queue-panel-hidden {
  display: none !important;
}
.modal-footer--queue {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.modal-footer-actions {
  display: flex;
  gap: 6px;
}
.modal-footer-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}
.modal-footer-link:hover {
  color: var(--fg);
}
.modal-queue-error {
  margin: 14px 14px 0;
  min-height: 0;
}
.modal-queue-error:empty {
  display: none;
}
.modal-queue-error.modal-queue-dry-run {
  color: var(--fg);
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-size: 10px;
  line-height: 1.45;
  white-space: pre;
  word-break: normal;
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(48vh, 420px);
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}
.queue-dry-run-check {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.queue-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--fg-muted);
}
.bulk-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.bulk-table thead th {
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
}
.bulk-table thead th:first-child {
  width: 150px
}
.bulk-table thead th:last-child {
  width: 28px;
}
.bulk-cell {
  padding: 6px 6px 0 0;
  vertical-align: middle;
}
.bulk-cell input[type="text"],
.bulk-cell input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.bulk-cell input[type="text"]:focus,
.bulk-cell input[type="number"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.bulk-cell input[type="number"]::-webkit-inner-spin-button,
.bulk-cell input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
.bulk-cell input[type="number"] {
  -moz-appearance: textfield;
}
.bulk-cell-remove {
  width: 28px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}
.bulk-row-remove {
  flex-shrink: 0;
}
.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bulk-row-add {
  flex-shrink: 0;
}
.bulk-row-clone-source {
  display: none !important;
}

.queue-flash {
  margin: 0 16px 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev-2);
  color: var(--fg);
}
.queue-flash[hidden] {
  display: none !important;
}

.device-modal-hint {
  margin: 0;
  color: var(--fg-dim);
  font-size: 12px;
}

.device-panel-empty {
  margin: 0;
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.45;
}

.device-info-card {
  padding: 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.device-info-card-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--fg);
}
.device-stored-kv dt {
  text-transform: none;
  letter-spacing: normal;
}

.device-extra-json {
  margin-top: 10px;
  font-size: 11px;
  color: var(--fg-muted);
}
.device-extra-json summary {
  cursor: pointer;
  user-select: none;
}
.device-extra-json-pre {
  margin: 8px 0 0;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  overflow: auto;
  max-height: 200px;
}

.switch-device-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
}
.switch-device-env {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.switch-device-env-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
}
.switch-device-env-value {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--fg-muted);
  word-break: break-all;
}
.switch-device-help {
  margin: 0;
  color: var(--fg-muted);
  line-height: 1.45;
  font-size: 11px;
}
.switch-device-error {
  margin: 0;
  padding: 10px;
  background: color-mix(in srgb, var(--fail) 12%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--fail) 35%, var(--border));
  border-radius: 4px;
  color: var(--fail);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}
.switch-device-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.switch-device-table th,
.switch-device-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.switch-device-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
}
.switch-device-copy-cell {
  text-align: right;
  width: 1%;
}

/* device list modal (adb devices — mirrors proxy list) */
.device-list-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
}
.device-list-empty {
  margin: 0 0 30px;
  font-size: 12px;
  color: var(--fg-muted);
}
.device-url-list-scroll {
  max-height: 80vh;
  overflow-y: auto;
  min-height: 0;
  margin: 0 0 4px;
  padding-right: 2px;
}
.device-url-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.device-url-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
  transition: background 80ms, border-color 80ms;
  gap: 8px;
}
.device-url-button:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}
.device-url-status-dot {
  flex-shrink: 0;
}
.device-url-text-block {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 1.35em;
}
.device-url-label {
  flex: 0 0 42%;
  max-width: 42%;
  min-width: 0;
  line-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
  font-family: ui-monospace, monospace;
}
.device-url-notes {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.device-url-chevron {
  flex-shrink: 0;
  color: var(--fg-muted);
  margin-left: 4px;
}

.device-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 12px;
}
.device-detail-db-missing-hint {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--fg-muted);
}
.device-info-card--adb-only .device-detail-db-missing-hint {
  margin-top: 8px;
}

/** Crop block matches `.device-info-card` (nested section title + body). */
.device-detail-crop-section .device-info-card-title {
  margin-bottom: 8px;
}
.device-detail-crop-body {
  min-width: 0;
}
.device-detail-crop-body .device-detail-crop-hint {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.device-detail-crop-section .crop-offsets-table-panel {
  background: var(--bg-elev);
}
@media (max-width: 480px) {
  .crop-offsets-toolbar--split {
    flex-wrap: wrap;
  }
}

/* ---------- proxy management ---------- */
.proxy-panel-help {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg-muted);
}
.proxy-panel-help code {
  font-size: 11px;
}
.proxy-panel-section {
  margin-top: 14px;
}
.proxy-panel-heading {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}
.proxy-panel-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.proxy-panel-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--bg);
}
.proxy-panel-card-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.proxy-form-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--fg-muted);
}
.proxy-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.proxy-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.proxy-field-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
}
.proxy-input,
.proxy-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
}
.proxy-textarea {
  resize: vertical;
  min-height: 64px;
}
.proxy-notes-textarea {
  min-height: 56px;
  font-family: inherit;
}
.proxy-platform-fieldset {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.proxy-platform-legend {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  padding: 0 4px;
}
.proxy-platform-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.proxy-platform-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg);
  cursor: pointer;
}
.proxy-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.proxy-delete-form {
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

/* ---- proxy list + form modal ---- */
.proxy-panel-modal-body {
  position: relative;
}
.proxy-list-panel {
  display: flex;
  flex-direction: column;
}
.proxy-list-empty {
  margin: 0 0 30px;
  font-size: 12px;
  color: var(--fg-muted);
}
.proxy-url-list-scroll {
  max-height: 80vh;
  overflow-y: auto;
  min-height: 0;
  margin: 0 0 4px;
  padding-right: 2px;
}
.proxy-url-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.proxy-url-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
  transition: background 80ms, border-color 80ms;
  gap: 8px;
}
.proxy-url-button:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}
.proxy-url-status-dot {
  flex-shrink: 0;
}
.proxy-url-text-block {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 1.35em;
}
.proxy-url-label {
  flex: 0 0 42%;
  max-width: 42%;
  min-width: 0;
  line-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, monospace;
}
.proxy-url-notes {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proxy-url-icons {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  /* Reserve width for two 12px icons + gap so label/notes % line up row-to-row */
  min-width: calc(12px + 6px + 12px);
}
.proxy-url-icon-wrap {
  display: inline-flex;
  align-items: center;
  color: var(--fg-dim);
}
.proxy-url-icon-wrap:hover {
  color: var(--fg);
}
.proxy-row-icon {
  display: block;
}
.proxy-url-chevron {
  flex-shrink: 0;
  color: var(--fg-muted);
  margin-left: 4px;
}
.proxy-list-footer {
  margin-top: 10px;
  align-self: flex-end;
}
.proxy-list-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.proxy-list-footer-actions-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.proxy-remove-offline {
  flex-shrink: 0;
}
.proxy-bulk-open {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--fg);
}
.proxy-bulk-open:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}
.proxy-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.proxy-form-heading {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.proxy-delete-form-standalone {
  margin: 8px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.proxy-bulk-textarea {
  min-height: 140px;
  line-height: 1.4;
}

/* platform × format proxy grid */
.proxy-flow-fieldset {
  overflow: hidden;
}
.proxy-flow-hint {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--fg-muted);
  line-height: 1.35;
}
.proxy-flow-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.proxy-flow-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.proxy-flow-corner {
  width: 1px;
  min-width: 72px;
  max-width: 120px;
}
.proxy-flow-colhead,
.proxy-flow-rowhead {
  padding: 6px 8px;
  text-align: center;
  font-weight: 600;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.proxy-flow-rowhead {
  text-align: right;
  padding-right: 10px;
  border-left: 0;
}
.proxy-flow-colhead {
  vertical-align: bottom;
  max-width: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 0;
}
.proxy-flow-cell,
.proxy-flow-na {
  text-align: center;
  vertical-align: middle;
  padding: 4px 2px;
  border: 1px solid var(--border);
  min-width: 32px;
}
.proxy-flow-na {
  background: var(--bg);
  color: var(--fg-muted);
}
.proxy-flow-na-mark {
  opacity: 0.35;
  font-size: 10px;
}
.proxy-flow-check-label {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.proxy-flow-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Alerts modal */
.alerts-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.alerts-help {
  margin: 0;
  font-size: 12px;
  color: var(--fg-dim);
  line-height: 1.45;
}
.alerts-code {
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-hover);
}
.alerts-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.alerts-section-picker-wrap {
  margin-bottom: 2px;
}
.alerts-section-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.alerts-section-panel {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.alerts-section-intro {
  margin-top: 0;
}
.alerts-fieldset {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.alerts-fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
}
.alerts-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 10px;
  font-size: 12px;
}
.alerts-label span {
  color: var(--fg-muted);
}
.alerts-label input,
.alerts-label select {
  font-size: 13px;
}
.alerts-routing-slots {
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* `.alerts-label { display: flex }` overrides native `[hidden]` suppression */
.alerts-routing-slots .alerts-label[hidden] {
  display: none !important;
}
.alerts-routing-slots .alerts-email-reminders-only[hidden] {
  display: none !important;
}
.alerts-label.alerts-email-reminders-only {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.alerts-label.alerts-email-reminders-only input[type='checkbox'] {
  margin: 0;
}
.alerts-hint {
  margin: 0 0 12px;
  font-size: 11px;
  color: var(--fg-dim);
}
.alerts-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* ---------- scraper settings modal ---------- */

.scraper-settings-fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px 12px;
  margin: 0 0 12px;
}

.scraper-settings-fieldset legend {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
}

/* Accordion sections — layout mirrors artifact scan disclosures, neutral chrome (no --ok tint). */
.scraper-settings-disclosure-acc > .scraper-settings-disclosure:first-child {
  margin-top: 0;
}

.scraper-settings-disclosure {
  margin-top: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--fg-muted) 5%, var(--bg-elev));
}

.scraper-settings-disclosure-summary {
  cursor: pointer;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}

.scraper-settings-disclosure-body {
  padding: 0 10px 10px;
  border-top: 1px solid var(--border);
}

.scraper-settings-form .scraper-settings-disclosure-acc > .scraper-settings-disclosure:last-child {
  margin-bottom: 12px;
}

.scraper-settings-form .scraper-settings-disclosure-body .scraper-settings-fieldset {
  margin: 0;
  border: none;
  padding: 8px 0 0;
}

.scraper-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.scraper-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--fg-muted);
  text-transform: none;
  letter-spacing: 0;
}

.scraper-field.full {
  grid-column: 1 / -1;
}

.scraper-hierarchy-dump-wrap {
  grid-column: 1 / -1;
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.scraper-hierarchy-dump-inline {
  flex-direction: row !important;
  align-items: center;
  cursor: pointer;
}

.scraper-textarea {
  min-height: 64px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
  padding: 8px;
}

/* Shared AI prompts + max_tokens/temp: single grid, consistent gap */
.scraper-ai-prompt-grid.scraper-fields-grid {
  margin-top: 0;
}

.scraper-ai-model-list-wrap {
  margin: 8px 0 12px;
}

.scraper-ai-model-list {
  max-height: 40vh;
  overflow-y: auto;
}

.scraper-ai-model-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
}

.scraper-ai-model-row-line {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.35;
}

.scraper-ai-model-remove {
  flex-shrink: 0;
}

/* Add row: bordered combo only */
.scraper-ai-model-item.scraper-ai-model-add-shell {
  border: none;
  padding: 0;
  background: transparent;
  gap: 0;
}

.scraper-ai-model-add-row {
  margin-top: 8px;
}

.scraper-ai-model-add-shell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.scraper-ai-model-add-combo {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
}

/* Visually hidden select: keeps value / options in sync for Shell list boot */
.scraper-ai-model-add-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.scraper-ai-model-add-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 30px;
  padding: 0 30px 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg);
  background-image: var(--select-chevron-svg);
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 10px 6px;
  cursor: pointer;
  text-align: left;
}

.scraper-ai-model-add-trigger--placeholder .scraper-ai-model-add-trigger-text {
  color: var(--fg-muted);
}

.scraper-ai-model-add-menu {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: min(40vh, 280px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.12);
}

.scraper-ai-model-add-vendor-hdr {
  padding: 6px 10px 2px;
  font-size: 10px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.scraper-ai-model-add-opt {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--fg);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.scraper-ai-model-add-opt:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ok) 32%, var(--border));
}

.scraper-ai-model-add-opt:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.scraper-ai-model-add-opt-label {
  flex: 1 1 auto;
  line-height: 1.5;
  min-width: 0;
}

.scraper-ai-model-add-opt-price {
  flex-shrink: 0;
  color: var(--fg-muted);
  font-style: italic;
  font-size: 11px;
}

.scraper-ai-model-add-trigger:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.scraper-settings-body {
  max-height: min(80vh, 900px);
  overflow: auto;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-muted);
}



/*! bundled: src/ui/styles/htmx.css */
/* ---------- htmx loading hints ---------- */

button.btn.htmx-request {
  opacity: 0.7;
  pointer-events: none;
}

/*
 * Never attach loading ellipsis under job detail — the polling target is
 * `article.detail`, and `.placeholder-label` lives in artifact panels (see Artifact.tsx).
 */
#job-list.htmx-request .placeholder-label::after {
  content: ' …';
}

/* Maestro hierarchy download (hx-download extension) */
.hierarchy-download-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 3px 0 0 -2px;
  gap: 0.35rem;
}

.hierarchy-dl-progress {
  width: 100%;
  max-width: 14rem;
  height: 0.45rem;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.hierarchy-dl-progress--active {
  opacity: 1;
}

.hierarchy-dl-bytes {
  font-size: 0.8rem;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.hierarchy-download-dd {
  margin: 3px 0 0 -2px;
  overflow: visible;
}


/*! bundled: src/ui/styles/responsive.css */
/* ---------- responsive ---------- */

/*
 * Medium: keep the sidebar but stack the artifact panels so screenshot and
 * video stay visible without horizontal squish.
 */
@media (max-width: 1024px) {
  .detail-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    flex: 1 1 auto;
  }
  .panel-screenshot { grid-column: 1; grid-row: 1; }
  .panel-video      { grid-column: 1; grid-row: 2; }
}

/* Small: stack list above detail and let the page scroll naturally. */
@media (max-width: 720px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 35vh) 1fr;
    overflow: auto;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .topbar {
    gap: 8px;
    padding: 0 8px;
  }
  .brand { padding-right: 8px; }
  .brand-name { display: none; }

  .detail { padding: 12px; gap: 10px; }
  .detail-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "actions"
      "meta"
      "times";
  }
  .detail-actions { justify-self: start; }

  /*
   * On small screens the panels can't realistically fill viewport height
   * (they'd be tiny), so let them size to a portrait aspect and the page
   * scroll instead.
   */
  .detail-grid {
    flex: 0 0 auto;
    grid-template-rows: auto auto auto;
  }
  .artifact,
  .panel-screenshot .placeholder,
  .panel-video .placeholder {
    flex: 0 0 auto;
    aspect-ratio: 9 / 16;
    max-height: 65vh;
    height: auto;
  }
  img.artifact, video.artifact { height: auto; }
}

@media (max-width: 480px) {
  .topbar-actions .btn-primary span,
  .topbar-actions .btn:not(.btn-icon) { font-size: 11px; padding: 0 8px; }
}



/*! bundled: src/lib/dashboard/ui/styles.css */
/* ---------- dashboard (main panel / no job selected) ---------- */

.dashboard-wrap {
  min-height: 100%;
}

.dashboard-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 28px;
  box-sizing: border-box;
}

#dashboard-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.dashboard-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: none;
}

.dash-seg-btn {
  display: inline-flex;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  overflow: hidden;
}

.dash-seg-btn input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dash-seg-btn span {
  padding: 6px 10px;
  display: block;
}

.dash-seg-btn:hover {
  background: var(--bg-hover);
  color: var(--fg);
}

.dash-seg-btn.is-selected {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-active);
}

.dashboard-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dashboard-range {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: none;
}

.dash-range-btn {
  display: inline-flex;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  overflow: hidden;
}

.dash-range-btn input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dash-range-btn span {
  padding: 6px 10px;
  display: block;
}

.dash-range-btn:hover {
  background: var(--bg-hover);
  color: var(--fg);
}

.dash-range-btn.is-selected {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-active);
}

.dash-range-btn:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-active);
}

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

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.dash-kpi {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
  box-sizing: border-box;
}

.dash-kpi-value {
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.dash-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

.dash-kpi--ok .dash-kpi-value {
  color: var(--ok);
}

.dash-kpi--warn .dash-kpi-value {
  color: var(--warn);
}

.dash-kpi--fail .dash-kpi-value {
  color: var(--fail);
}

.dash-kpi--running .dash-kpi-value {
  color: var(--running);
}

.dashboard-chart-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg);
}

.dashboard-chartrow--line {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 12px 4px;
  background: var(--bg-elev);
}

.dashboard-line-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.dashboard-chartrow-split .dashboard-line-card-head {
  /* Matches series toggle row in By platform + format so pie title band aligns. */
  min-height: 2rem;
}

.dashboard-line-card-head .dashboard-chart-title {
  margin: 0;
}

.dashboard-line-radio {
  flex-shrink: 0;
  min-width: 0;
}

.dash-chart--line {
  width: 100%;
  height: 280px;
}

.dashboard-chartrow-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 340px);
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .dashboard-chartrow-split {
    grid-template-columns: 1fr;
  }
}

.dashboard-chartcell {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 12px 4px;
  background: var(--bg-elev);
}

.dashboard-chartcell--pie {
  max-width: 364px;
  width: 100%;
  justify-self: start;
  padding-bottom: 14px;
}

@media (max-width: 900px) {
  .dashboard-chartcell--pie {
    max-width: none;
    justify-self: stretch;
  }
}

/** Pie chart + outcome hub overlay; height lives on the shell. */
.dash-chart-pie-shell {
  position: relative;
  width: 100%;
  height: 260px;
  margin: 0 auto;
}

.dash-chart-pie-shell .dash-chart--pie {
  width: 100%;
  height: 100%;
}

.dash-chart-pie-hub {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.dash-chart-pie-hub-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.15;
}

.dash-chart-pie-hub-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.2;
}

@media (max-width: 900px) {
  .dash-chart-pie-shell {
    max-width: none;
    height: 260px;
  }
}

.dash-chart--bar {
  width: 100%;
  height: 260px;
}

.dashboard-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .dashboard-extra {
    grid-template-columns: 1fr;
  }
}

.dash-extra-col {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px 14px;
  background: var(--bg-elev);
}

.dash-stat-line {
  margin: 8px 0 0;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-stat-label {
  color: var(--fg-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-stat-values {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.dash-stat-note {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--fg-dim);
  line-height: 1.4;
}

/* ---------- scrapes with errors table ---------- */

.dashboard-errors {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px 14px;
  background: var(--bg-elev);
}

.dashboard-errors .dashboard-chart-title {
  margin-bottom: 4px;
}

.dash-errors-sub {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--fg-muted);
}

.dash-errors-sub-hint {
  color: var(--fg-dim);
}

.dashboard-errors-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-errors-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

.dashboard-errors-table col.dash-err-col--when {
  width: 12%;
}

.dashboard-errors-table col.dash-err-col--job {
  width: 14%;
}

.dashboard-errors-table col.dash-err-col--label {
  width: 18%;
}

.dashboard-errors-table col.dash-err-col--post {
  width: 33%;
}

.dashboard-errors-table col.dash-err-col--ss {
  width: 13%;
}

.dashboard-errors-table col.dash-err-col--vid {
  width: 10%;
}

.dashboard-errors-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: normal;
  line-height: 1.25;
  vertical-align: bottom;
}

.dashboard-errors-table th.dash-err-th--icon {
  text-align: center;
}

.dashboard-errors-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
}

.dashboard-errors-table tbody td {
  vertical-align: middle;
}

.dashboard-errors-table tbody tr:last-child td {
  border-bottom: none;
}

.dashboard-errors-table tbody tr.dash-err-row {
  cursor: pointer;
}

.dashboard-errors-table tbody tr.dash-err-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.dashboard-errors-table tbody tr.dash-err-row:hover td {
  background: var(--bg-row-hover);
}

.dashboard-errors-table .dash-err-td--post {
  min-width: 0;
}

.dashboard-errors-table .dash-err-td--icon {
  text-align: center;
  white-space: nowrap;
  width: 1%;
}

/* Pill backgrounds so ✓ / ✕ read clearly on row hover */
.dashboard-errors-table .status-dot {
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}

.dashboard-errors-table .status-dot[data-status="queued"] {
  color: var(--queued);
  background: color-mix(in srgb, var(--queued) 14%, var(--bg-elev-2));
  border-color: color-mix(in srgb, var(--queued) 28%, var(--border));
}

.dashboard-errors-table .status-dot[data-status="running"] {
  color: var(--running);
  background: color-mix(in srgb, var(--running) 14%, var(--bg-elev-2));
  border-color: color-mix(in srgb, var(--running) 32%, var(--border));
}

.dashboard-errors-table .status-dot[data-status="completed"] {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 18%, var(--bg-elev-2));
  border-color: color-mix(in srgb, var(--ok) 38%, var(--border));
}

.dashboard-errors-table .status-dot[data-status="failed"] {
  color: var(--fail);
  background: color-mix(in srgb, var(--fail) 18%, var(--bg-elev-2));
  border-color: color-mix(in srgb, var(--fail) 42%, var(--border));
}

.dashboard-errors-table .status-dot[data-status="warning"] {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 16%, var(--bg-elev-2));
  border-color: color-mix(in srgb, var(--warn) 38%, var(--border));
}

.dashboard-errors-table .status-dot[data-status="corrected"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elev-2));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}

.dashboard-errors-table .status-dot[data-status="rejected"] {
  color: var(--fail);
  background: color-mix(in srgb, var(--fail) 18%, var(--bg-elev-2));
  border-color: color-mix(in srgb, var(--fail) 42%, var(--border));
}

.dash-err-postid {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.dash-err-jobid {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#dashboard-live-tail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* AI verification usage (screenshot + video combined) */
.dashboard-ai-screenshot {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.dash-ai-screenshot-note {
  margin: 8px 0 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--fg-muted);
}

/* Job totals row: hug values like AI KPIs, keep at least the legacy grid min column width. */
.dash-kpis-jobs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-kpis-jobs .dash-kpi {
  flex: 0 1 auto;
  width: max-content;
  max-width: 100%;
  min-width: 100px;
  box-sizing: border-box;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.dash-kpis-jobs .dash-kpi-value {
  font-size: clamp(0.95rem, 0.55rem + 1.35vw, 1.5rem);
  white-space: nowrap;
  min-width: 0;
}

/* Flex so each tile can size to its value; grid minmax(100px) was too tight for $ / token counts. */
.dash-kpis-ai {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-kpis-ai .dash-kpi {
  flex: 0 1 auto;
  width: max-content;
  max-width: 100%;
  min-width: 100px;
  box-sizing: border-box;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.dash-kpis-ai .dash-kpi-value {
  font-size: clamp(0.95rem, 0.55rem + 1.35vw, 1.5rem);
  white-space: nowrap;
  min-width: 0;
}

.dashboard-ai-line-chart-card {
  margin-top: 0;
}

.dashboard-ai-line-chart-card .dash-chart-ai-line {
  width: 100%;
  height: 260px;
}

/* Mobile device telemetry (below AI screenshot) */
.dashboard-mobile-telemetry {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.dash-mobile-tel-note {
  margin: 8px 0 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--fg-muted);
}

.dash-device-summary-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.dashboard-mobile-data-wrap {
  display: none;
}

.dash-device-summary-row:has(.dash-device-summary:nth-child(2)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 700px) {
  .dash-device-summary-row:has(.dash-device-summary:nth-child(2)) {
    grid-template-columns: 1fr;
  }
}

.dash-device-summary {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px 14px;
  background: var(--bg-elev);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-device-summary-live {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-device-summary-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dash-device-summary-name {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}

.dash-device-summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-device-summary-stats .dash-kpi {
  flex: 0 1 auto;
  width: max-content;
  max-width: 100%;
  min-width: 88px;
  box-sizing: border-box;
}

.dash-device-summary-stats .dash-kpi-value {
  font-size: clamp(0.95rem, 0.55rem + 1.35vw, 1.5rem);
  white-space: nowrap;
  min-width: 0;
}

.dash-device-summary-charts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Single device (full width): charts side by side */
.dash-device-summary-row:not(:has(.dash-device-summary:nth-child(2)))
  .dash-device-summary-charts {
  flex-direction: row;
  gap: 12px;
}

.dash-device-summary-row:not(:has(.dash-device-summary:nth-child(2)))
  .dash-device-summary-charts
  > div {
  flex: 1 1 0;
  min-width: 0;
}

.dashboard-device-chart-label {
  font-size: 11px;
  color: var(--fg-muted);
  margin: 0 0 3px;
  font-weight: 500;
}

.dash-dev-chart {
  height: 220px;
  width: 100%;
}
