:root {
  --ink: #111111;
  --ink-2: #444444;
  --ink-3: #737373;
  --rule: #e8e6e1;
  --rule-2: #f0eeea;
  --surface: #f5f4f0;
  --surface-raised: #fafaf8;
  --surface-archived: #f3f2ef;
  --surface-excluded: #f6f3ef;
  --white: #ffffff;
  --accent: #2563eb;
  --accent-bg: #eff6ff;
  --accent-mid: #2563eb;
  --accent-hover: #1d4ed8;
  --score-good: #059669;
  --score-good-bg: #ecfdf5;
  --score-good-ring: #a7f3d0;
  --score-mid: #d97706;
  --score-mid-bg: #fffbeb;
  --score-mid-ring: #fde68a;
  --score-low: #dc2626;
  --score-low-bg: #fef2f2;
  --score-low-ring: #fecaca;
  --source-promising: #2563eb;
  --source-promising-bg: #eff6ff;
  --viz-violet: #7c3aed;
  --source-watch: #64748b;
  --source-watch-bg: #f1f5f9;
  --source-low: #9ca3af;
  --source-low-bg: #f9fafb;
  --pending: #b45309;
  --pending-bg: #fffbeb;
  --skipped: #92400e;
  --skipped-bg: #fff7ed;
  --skipped-ring: #fed7aa;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --serif: "Plus Jakarta Sans", system-ui, sans-serif;
  --sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", monospace;
  --bs-body-bg: var(--surface);
  --bs-body-color: var(--ink);
  --bs-body-font-family: var(--sans);
  --bs-border-color: var(--rule);
  --bs-link-color: var(--ink);
  --bs-link-hover-color: var(--accent);
}

[x-cloak] { display: none !important; }

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f6f8;
  --ink-2: #d2d8e2;
  --ink-3: #8c95a5;
  --rule: #2a2a2a;
  --rule-2: #1c1c1c;
  --surface: #000000;
  --surface-raised: #0d0d0d;
  --surface-archived: #101010;
  --surface-excluded: #101010;
  --white: #111111;
  --accent: #60a5fa;
  --accent-bg: rgba(96, 165, 250, 0.14);
  --accent-mid: #93c5fd;
  --accent-hover: #3b82f6;
  --score-good: #34d399;
  --score-good-bg: rgba(52, 211, 153, 0.12);
  --score-good-ring: rgba(52, 211, 153, 0.38);
  --score-mid: #fbbf24;
  --score-mid-bg: rgba(251, 191, 36, 0.14);
  --score-mid-ring: rgba(251, 191, 36, 0.38);
  --score-low: #fb7185;
  --score-low-bg: rgba(251, 113, 133, 0.13);
  --score-low-ring: rgba(251, 113, 133, 0.38);
  --viz-violet: #a78bfa;
  --pending: #fbbf24;
  --pending-bg: rgba(251, 191, 36, 0.13);
  --skipped: #fbbf24;
  --skipped-bg: rgba(251, 191, 36, 0.12);
  --skipped-ring: rgba(251, 191, 36, 0.32);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
  --shadow-md: 0 14px 30px rgba(0, 0, 0, 0.25);
  --bs-body-bg: var(--surface);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--rule);
  --bs-link-color: var(--ink);
  --bs-link-hover-color: var(--accent);
}

body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

/* Reserve the same box before and after Lucide turns placeholders into inline SVG. */
i[data-lucide],
svg.lucide {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex: none;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.topbar a {
  color: var(--ink);
}

.topbar a:hover {
  color: var(--ink);
}

.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 160px);
  padding: 2rem 0;
}

.auth-panel {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  max-width: 420px;
  padding: 2rem;
  width: 100%;
}

.auth-kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.auth-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 0.6rem;
}

.auth-copy {
  color: var(--ink-2);
  line-height: 1.55;
  margin-bottom: 1.3rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
}

.brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

.nav-pill {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s;
}

.nav-pill:hover {
  background: var(--rule-2);
  border-color: var(--rule);
  color: var(--ink);
}

.page-heading {
  border-bottom: 1px solid var(--rule);
}

.page-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.page-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}

.page-meta {
  font-size: 0.85rem;
  color: var(--ink-3);
  font-weight: 500;
}

.panel,
.filter-panel,
.table-panel {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
}

.table-panel {
  overflow: hidden;
}

.metric {
  min-height: 92px;
}

.metric-label {
  color: var(--ink-3);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-value {
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 500;
}

.muted {
  color: var(--ink-3);
  font-weight: 500;
}

.form-label {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.form-control,
.form-select {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  border-color: var(--rule);
  background-color: var(--surface);
  color: var(--ink);
  border-radius: 6px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px rgba(46, 158, 130, 0.12);
  background-color: var(--white);
}

.form-text {
  color: var(--ink-3);
  font-size: 0.78rem;
  font-weight: 500;
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.btn-apply {
  background: var(--accent);
  border: none;
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.45rem 1.25rem;
  letter-spacing: 0.02em;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-apply:hover,
.btn-apply:focus {
  background: var(--accent-hover);
  color: var(--white);
}

#run-scan-button {
  min-width: 9.5rem;
}

.btn-json,
.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
  text-decoration: none;
  background: var(--white);
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-json:hover,
.btn-secondary-action:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.alert {
  border-radius: 8px;
  font-size: 0.85rem;
}

.jobs-table {
  min-width: 900px;
}

.jobs-table thead th {
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 700;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.jobs-table tbody td {
  padding: 1rem;
  vertical-align: top;
  font-size: 0.85rem;
  font-weight: 500;
  border-bottom: 1px solid var(--rule-2);
}

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

.jobs-table tbody tr:hover td {
  background: var(--surface);
}

.jobs-table tbody tr.is-archived td {
  background: #f3f1ec;
}

.jobs-table tbody tr.is-archived .job-link,
.jobs-table tbody tr.is-archived .job-summary,
.jobs-table tbody tr.is-archived .client-text,
.jobs-table tbody tr.is-archived .posted-primary,
.jobs-table tbody tr.is-archived .budget-val {
  opacity: 0.62;
}

.col-job {
  width: 34%;
  min-width: 220px;
}

.col-score {
  width: 80px;
}

.col-posted {
  width: 140px;
}

.col-budget {
  width: 130px;
}

.col-client {
  width: 210px;
}

.col-meta {
  width: 112px;
  text-align: center;
}

.job-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.005em;
  line-height: 1.35;
  display: block;
  transition: color 0.12s;
}

.job-link:hover {
  color: var(--accent);
}

.job-summary {
  font-size: 0.78rem;
  color: var(--ink-2);
  font-weight: 500;
  margin-top: 0.3rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

details.desc {
  margin-top: 0.5rem;
}

details.desc summary,
details.score-detail summary {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  letter-spacing: 0.02em;
  user-select: none;
}

details.desc summary::-webkit-details-marker,
details.score-detail summary::-webkit-details-marker {
  display: none;
}

details.desc summary::before,
details.score-detail summary::before {
  content: "+ ";
}

details.desc[open] summary::before,
details.score-detail[open] summary::before {
  content: "- ";
}

details.score-detail {
  margin-top: 0.5rem;
}

.score-detail-body {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.5;
  margin-top: 0.45rem;
  max-height: 280px;
  overflow-y: auto;
  border-left: 2px solid var(--accent-bg);
  padding-left: 0.75rem;
  padding-right: 0.25rem;
}

.score-detail-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.34fr) minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.26rem 0;
  border-bottom: 1px solid var(--rule-2);
}

.score-detail-row:last-child {
  border-bottom: none;
}

.score-detail-label {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
}

.score-detail-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.desc-body {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.55;
  margin-top: 0.4rem;
  max-height: 200px;
  overflow-y: auto;
  border-left: 2px solid var(--rule);
  padding-left: 0.75rem;
  padding-right: 0.25rem;
}

.badge-pending,
.score-badge {
  background: var(--pending-bg);
  color: var(--pending);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 100px;
  padding: 0.25rem 0.6rem;
}

.score-badge.is-score-good {
  background: var(--score-good-bg);
  color: var(--score-good);
}

.score-badge.is-score-mid {
  background: var(--score-mid-bg);
  color: var(--score-mid);
}

.score-badge.is-score-low {
  background: var(--score-low-bg);
  color: var(--score-low);
}

.score-badge[data-tooltip] {
  cursor: help;
  display: inline-flex;
  position: relative;
}

.score-badge[data-tooltip]::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  background: var(--ink);
  color: var(--white);
  font-size: 0.7rem;
  font-family: var(--mono);
  line-height: 1.45;
  white-space: pre-line;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  width: max-content;
  max-width: 220px;
  pointer-events: none;
  text-align: left;
  z-index: 60;
  overflow-wrap: anywhere;
}

.score-badge[data-tooltip]:hover::after,
.score-badge[data-tooltip]:focus::after {
  display: block;
}

.posted-primary {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

.posted-ago {
  font-size: 0.74rem;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 0.1rem;
}

.budget-val {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.client-text {
  font-size: 0.78rem;
  color: var(--ink-2);
  line-height: 1.5;
  font-weight: 500;
}

.client-country-flag {
  font-size: 0.95rem;
  line-height: 1;
  vertical-align: -0.05em;
}

.job-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.job-actions form {
  margin: 0;
}

.meta-btn,
.metadata-button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.meta-btn:hover,
.meta-btn:focus,
.metadata-button:hover,
.metadata-button:focus {
  border-color: var(--accent-mid);
  color: var(--accent);
}

.archive-btn:hover,
.archive-btn:focus {
  border-color: var(--pending);
  color: var(--pending);
  background: var(--pending-bg);
}

.archive-btn.is-restore:hover,
.archive-btn.is-restore:focus {
  border-color: var(--accent-mid);
  color: var(--accent);
  background: var(--accent-bg);
}

.meta-btn::after,
.metadata-button::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--ink);
  color: var(--white);
  font-size: 0.7rem;
  font-family: var(--mono);
  white-space: pre-line;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  width: max-content;
  max-width: 220px;
  pointer-events: none;
  z-index: 50;
}

.meta-btn:hover::after,
.meta-btn:focus::after,
.meta-btn.tooltip-open::after,
.metadata-button:hover::after,
.metadata-button:focus::after,
.metadata-button.tooltip-open::after {
  display: block;
}

.digest-end {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--ink-3);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
}

.digest-end::before,
.digest-end::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.settings-section-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.settings-section-head {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-icon {
  color: var(--accent);
}

.preset-dot {
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.preset-dirty-note {
  color: var(--skipped);
}

.preset-menu .dropdown-menu {
  --bs-dropdown-bg: var(--white);
  --bs-dropdown-border-color: var(--rule-2);
  --bs-dropdown-color: var(--ink-2);
  --bs-dropdown-link-color: var(--ink-2);
  --bs-dropdown-link-hover-bg: var(--accent-bg);
  --bs-dropdown-link-hover-color: var(--accent);
  --bs-dropdown-link-active-bg: var(--accent-bg);
  --bs-dropdown-link-active-color: var(--accent);
  --bs-dropdown-link-disabled-color: var(--ink-3);
  --bs-dropdown-divider-bg: var(--rule-2);
  --bs-dropdown-box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  left: auto;
  max-height: 22rem;
  min-width: 15rem;
  overflow: auto;
  right: 0;
}

.setting-switch-row.preset-row {
  cursor: default;
}

.preset-menu-check {
  display: inline-flex;
  justify-content: center;
  width: 1rem;
}

.preset-menu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-new .form-control {
  width: 14rem;
}

.run-mode-pill {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: right;
}

.run-mode-pill span {
  background: var(--accent-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

.run-mode-pill small {
  color: var(--ink-3);
  font-size: 0.74rem;
  font-weight: 500;
}

.settings-switch-list {
  display: grid;
  gap: 0.55rem;
}

.setting-switch-row {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 58px;
  padding: 0.7rem 0.85rem;
}

.setting-switch-row-compact {
  background: transparent;
  min-height: 48px;
}

.setting-switch-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.setting-switch-title {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 0.88rem;
  flex-wrap: wrap;
  font-weight: 700;
  gap: 0.45rem;
  line-height: 1.25;
}

.setting-switch-title i {
  color: var(--accent);
  font-size: 0.95rem;
}

.setting-switch-help {
  color: var(--ink-3);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
}

.setting-switch-row-dependent.is-covered-by-scan-pause {
  background: color-mix(in srgb, var(--surface) 72%, var(--rule-2));
  border-style: dashed;
}

.setting-switch-row-dependent.is-covered-by-scan-pause .setting-switch-title,
.setting-switch-row-dependent.is-covered-by-scan-pause .setting-switch-title i,
.setting-switch-row-dependent.is-covered-by-scan-pause .setting-switch-help {
  color: var(--ink-3);
}

.setting-switch-row-dependent.is-covered-by-scan-pause .form-check-input {
  opacity: 0.7;
}

.scan-covered-badge {
  background: var(--skipped-bg);
  border: 1px solid color-mix(in srgb, var(--skipped) 24%, transparent);
  border-radius: 999px;
  color: var(--skipped);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.23rem 0.45rem;
  white-space: nowrap;
}

.setting-switch-row .form-switch {
  flex: 0 0 auto;
  min-height: 0;
  padding-left: 0;
}

.setting-switch-row .form-check-input {
  cursor: pointer;
  height: 1.1rem;
  margin: 0;
  width: 2.1rem;
}

.settings-input-group .input-group-text {
  background: var(--surface);
  border-color: var(--rule);
  color: var(--ink-3);
  font-size: 0.76rem;
  font-weight: 700;
}

.generated-url-box {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}

.generated-url-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  list-style: none;
  padding: 0.65rem 0.75rem;
}

.generated-url-summary::-webkit-details-marker {
  display: none;
}

.generated-url-count {
  background: var(--accent-bg);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
}

.generated-url-list {
  border-top: 1px solid var(--rule);
  max-height: 190px;
  overflow: auto;
  padding: 0.35rem 0.75rem 0.55rem;
}

.generated-url-item {
  align-items: center;
  border-bottom: 1px solid var(--rule-2);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr);
  padding: 0.35rem 0;
}

.generated-url-item:last-child {
  border-bottom: 0;
}

.generated-url-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

textarea {
  min-height: 92px;
}

textarea.auto-expand {
  overflow: hidden;
  resize: none;
}

.sticky-actions {
  background: linear-gradient(180deg, rgba(250, 249, 246, 0), var(--surface) 35%);
}

@media (max-width: 575.98px) {
  .settings-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .run-mode-pill {
    align-items: flex-start;
    text-align: left;
  }

  .setting-switch-row {
    align-items: flex-start;
  }

  .sticky-actions.sticky-bottom {
    position: static !important;
  }

  .generated-url-item {
    align-items: start;
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

/* Jobs v2 layout */
body {
  font-weight: 400;
}

.topbar {
  background: color-mix(in srgb, var(--white) 92%, transparent);
  backdrop-filter: blur(8px);
}

.brand-mark {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.brand-name {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.nav-pill {
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.38rem 0.72rem;
}

.nav-pill:hover {
  background: var(--surface);
}

.theme-toggle {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink-3);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  margin-left: 0.15rem;
  padding: 0;
  transition: all 0.15s;
  width: 32px;
}

.theme-toggle:hover,
.theme-toggle:focus {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.page-heading {
  border-bottom-color: var(--rule);
}

.page-title {
  font-family: var(--sans);
  font-size: clamp(1.75rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-meta {
  color: var(--ink-3);
  font-size: 0.82rem;
}

.filter-panel,
.filters-panel {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.jobs-filter-form {
  display: grid;
  gap: 0.8rem;
}

.jobs-filter-primary,
.advanced-filter-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 0.95fr) minmax(82px, 0.42fr) minmax(82px, 0.42fr) minmax(145px, 0.8fr) minmax(84px, 0.42fr) auto;
}

.filter-field {
  min-width: 0;
}

.filter-field-search {
  min-width: min(100%, 240px);
}

.filter-field-compact {
  min-width: 78px;
}

.filter-actions {
  align-items: end;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: auto auto;
}

.btn-apply,
.btn-reset-filters {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  justify-content: center;
}

.btn-reset-filters {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  min-height: 36px;
  padding: 0.45rem 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn-reset-filters:hover,
.btn-reset-filters:focus {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.active-filter-row {
  align-items: flex-start;
  border-top: 1px solid var(--rule-2);
  display: flex;
  gap: 0.65rem;
  padding-top: 0.75rem;
}

.active-filter-label {
  color: var(--ink-3);
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.85;
  text-transform: uppercase;
}

.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
}

.active-filter-chip,
.active-filter-empty,
.advanced-count {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.2;
  min-height: 26px;
}

.active-filter-chip {
  background: var(--accent-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--rule));
  color: var(--accent-hover);
  max-width: min(360px, 100%);
  overflow: hidden;
  padding: 0.25rem 0.58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-filter-empty {
  color: var(--ink-3);
}

.advanced-filters {
  border-top: 1px solid var(--rule-2);
  padding-top: 0.25rem;
}

.advanced-filters summary {
  align-items: center;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  gap: 0.5rem;
  list-style: none;
  padding: 0.35rem 0;
}

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

.advanced-filters summary span:first-child {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
}

.advanced-count {
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  justify-content: center;
  min-width: 26px;
  padding: 0.1rem 0.45rem;
}

.advanced-filter-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr)) repeat(4, minmax(86px, 0.55fr));
  padding-top: 0.4rem;
}

.form-label-sm {
  color: var(--ink-3);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.form-control,
.form-select {
  background-color: var(--surface);
  border-color: var(--rule);
  color: var(--ink);
  min-height: 36px;
}

.form-control::placeholder {
  color: color-mix(in srgb, var(--ink-3) 75%, transparent);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--white);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--ink);
}

.btn-apply {
  background: var(--accent);
  border-radius: 6px;
  min-height: 36px;
  padding: 0.45rem 1rem;
}

.btn-apply:hover,
.btn-apply:focus {
  background: var(--accent-hover);
}

.btn-json,
.btn-secondary-action {
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-size: 0.75rem;
}

.page-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.btn-secondary-action.is-enabled {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.live-indicator {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: var(--ink-3);
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  gap: 0.4rem;
  min-height: 32px;
  min-width: 5.75rem;
  padding: 0.36rem 0.78rem;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.live-dot {
  background: var(--score-good);
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--score-good) 15%, transparent);
  height: 0.48rem;
  width: 0.48rem;
  animation: liveDotPulse 2s ease-in-out infinite;
}

.live-indicator[data-state="error"] .live-dot {
  animation: none;
}

.live-indicator[data-state="error"] {
  background: var(--pending-bg);
  border-color: var(--pending);
  color: var(--pending);
}

.live-indicator[data-state="error"] .live-dot {
  background: var(--pending);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pending) 18%, transparent);
}

.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 1179.98px) {
  .jobs-filter-primary {
    grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.9fr) repeat(3, minmax(86px, 0.55fr));
  }

  .filter-actions {
    grid-column: 1 / -1;
    justify-content: start;
  }

  .advanced-filter-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 767.98px) {
  .jobs-filter-primary,
  .advanced-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-field-search,
  .filter-actions,
  .advanced-filter-grid .filter-field:nth-child(-n + 2) {
    grid-column: 1 / -1;
  }

  .filter-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .active-filter-row {
    display: grid;
    gap: 0.35rem;
  }
}

@media (max-width: 420px) {
  .jobs-filter-primary,
  .advanced-filter-grid,
  .filter-actions {
    grid-template-columns: 1fr;
  }

  .filter-field-search,
  .filter-actions,
  .advanced-filter-grid .filter-field:nth-child(-n + 2) {
    grid-column: auto;
  }

  .active-filter-chip {
    white-space: normal;
  }
}

.job-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: visible;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}

.job-card:hover {
  border-color: color-mix(in srgb, var(--accent) 25%, var(--rule));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.job-card.is-archived {
  background: var(--surface-archived);
  opacity: 0.86;
}

.job-card.is-excluded {
  background: var(--surface-excluded);
}

.job-card.is-archived .job-title,
.job-card.is-archived .job-summary,
.job-card.is-archived .chip,
.job-card.is-archived .posted-primary {
  opacity: 0.68;
}

.job-card.is-live-new {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--rule));
  animation: jobCardIn 0.28s ease-out;
}

.job-card.is-live-fresh {
  animation: jobCardNewGlow 22s ease-out forwards;
}

.job-card-main {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) minmax(190px, 230px);
  min-height: 150px;
}

.job-score-col {
  align-items: center;
  border-right: 1px solid var(--rule-2);
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  justify-content: center;
  min-width: 0;
  padding: 1.1rem 0.9rem;
  text-align: center;
}

.score-ring {
  align-items: center;
  border-radius: 50%;
  display: inline-flex;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  height: 58px;
  justify-content: center;
  line-height: 1;
  min-width: 0;
  position: relative;
  width: 58px;
}

.score-ring.is-score-good {
  background: var(--score-good-bg);
  box-shadow: inset 0 0 0 2px var(--score-good-ring);
  color: var(--score-good);
}

.score-ring.is-score-mid {
  background: var(--score-mid-bg);
  box-shadow: inset 0 0 0 2px var(--score-mid-ring);
  color: var(--score-mid);
}

.score-ring.is-score-low {
  background: var(--score-low-bg);
  box-shadow: inset 0 0 0 2px var(--score-low-ring);
  color: var(--score-low);
}

.score-ring[data-tooltip] {
  cursor: help;
}

.score-ring[data-tooltip]::after {
  background: var(--ink);
  border-radius: 6px;
  color: var(--white);
  content: attr(data-tooltip);
  display: none;
  font-family: var(--mono);
  font-size: 0.68rem;
  left: 50%;
  line-height: 1.45;
  max-width: 280px;
  min-width: 220px;
  padding: 0.55rem 0.65rem;
  pointer-events: none;
  position: absolute;
  text-align: left;
  top: calc(100% + 10px);
  transform: translateX(-50%);
  white-space: pre-line;
  z-index: 70;
}

.score-ring[data-tooltip]:hover::after,
.score-ring[data-tooltip]:focus::after,
.score-ring.tooltip-open::after {
  display: block;
}

.score-label {
  color: var(--ink-3);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-decision {
  background: var(--accent-bg);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  max-width: 112px;
  overflow-wrap: anywhere;
  padding: 0.16rem 0.48rem;
}

.job-content {
  min-width: 0;
  padding: 1.25rem 1rem;
}

.job-title-row {
  align-items: flex-start;
  display: flex;
  gap: 0.55rem;
  min-width: 0;
}

.job-title {
  color: var(--ink);
  display: block;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.12s;
}

.job-title-row .job-title {
  min-width: 0;
}

.job-title:hover {
  color: var(--accent);
}

.job-new-badge {
  background: var(--accent-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 999px;
  color: var(--accent);
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  margin-top: 0.14rem;
  padding: 0.22rem 0.48rem;
  text-transform: uppercase;
}

.job-skip-badge {
  background: var(--skipped-bg);
  border: 1px solid var(--skipped-ring);
  border-radius: 999px;
  color: var(--skipped);
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  margin-top: 0.14rem;
  padding: 0.22rem 0.48rem;
  text-transform: uppercase;
}

.job-summary {
  color: var(--ink-2);
  display: -webkit-box;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
  margin-top: 0.3rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.job-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.chip {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  color: var(--ink-2);
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 500;
  gap: 0.28rem;
  line-height: 1.2;
  max-width: 100%;
  min-height: 24px;
  padding: 0.2rem 0.6rem;
}

.chip i {
  color: var(--ink-3);
  font-size: 0.74rem;
}

.budget-chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
}

.proposal-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.skipped-chip {
  background: var(--skipped-bg);
  border-color: var(--skipped-ring);
  color: var(--skipped);
}

.secret-label {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.secret-chip {
  font-size: 0.68rem;
  min-height: 20px;
  padding: 0.1rem 0.5rem;
}

.secret-chip-set {
  background: var(--accent-bg);
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  color: var(--accent);
}

.secret-chip-set i {
  color: inherit;
}

.secret-clear {
  margin-top: 0.4rem;
}

.secret-clear .form-check-label {
  color: var(--ink-3);
  font-size: 0.78rem;
  font-weight: 500;
}

.code-input {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.skipped-chip i {
  color: var(--skipped);
}

.duration-chip i,
.category-chip i {
  color: var(--accent);
}

.job-signals .score-key {
  white-space: nowrap;
}

.client-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-meta-col {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  border-left: 1px solid var(--rule-2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 1.15rem 1rem;
  text-align: right;
}

.job-posted {
  min-width: 0;
}

.posted-primary {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  white-space: normal;
}

.posted-ago {
  color: var(--ink-3);
  font-size: 0.72rem;
}

.job-actions {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
  justify-content: flex-end;
}

.job-actions form {
  margin: 0;
}

.action-btn,
.meta-btn,
.metadata-button {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink-3);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.84rem;
  height: 32px;
  justify-content: center;
  padding: 0;
  position: relative;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
  width: 32px;
}

.action-btn:hover,
.action-btn:focus,
.meta-btn:hover,
.meta-btn:focus,
.metadata-button:hover,
.metadata-button:focus {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.action-btn:active,
.meta-btn:active,
.metadata-button:active { transform: scale(0.92); }

.archive-btn:hover,
.archive-btn:focus,
.action-btn.archive-btn:hover,
.action-btn.archive-btn:focus {
  background: var(--pending-bg);
  border-color: var(--pending);
  color: var(--pending);
}

.archive-btn.is-restore:hover,
.archive-btn.is-restore:focus,
.action-btn.is-restore:hover,
.action-btn.is-restore:focus {
  background: var(--score-good-bg);
  border-color: var(--score-good);
  color: var(--score-good);
}

/* Saved (bookmarked) jobs: persistent accent fill so the shortlist reads at a glance */
.save-btn.is-saved {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.save-btn.is-saved svg {
  fill: var(--accent);
  transition: fill 0.18s ease;
}

.save-btn:not(.is-saved) svg {
  transition: fill 0.18s ease;
}

.save-btn.is-just-saved svg {
  animation: savePop 0.32s ease-out;
}

.action-btn[data-tooltip]::after {
  background: var(--ink);
  border-radius: 6px;
  color: var(--white);
  content: attr(data-tooltip);
  display: none;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.4;
  max-width: 260px;
  padding: 0.5rem 0.62rem;
  pointer-events: none;
  position: absolute;
  right: calc(100% + 8px);
  text-align: left;
  top: 50%;
  transform: translateY(-50%);
  white-space: pre-line;
  width: max-content;
  z-index: 50;
}

.action-btn[data-tooltip]:hover::after,
.action-btn[data-tooltip]:focus::after,
.action-btn.tooltip-open::after {
  display: block;
}

.meta-btn::after,
.metadata-button::after {
  background: var(--ink);
  color: var(--white);
  max-width: 260px;
}

.job-details {
  border-top: 1px solid var(--rule-2);
}

.details-toggle {
  align-items: center;
  background: var(--surface-raised);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 0.35rem;
  list-style: none;
  padding: 0.72rem 1.25rem;
  user-select: none;
}

.details-toggle::before {
  content: "+";
  font-family: var(--mono);
  font-size: 0.9rem;
  text-align: center;
  width: 1rem;
}

details[open] > .details-toggle::before {
  content: "-";
}

.details-toggle::-webkit-details-marker {
  display: none;
}

.details-body {
  background: var(--surface-raised);
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  padding: 0 1.25rem 1.25rem;
}

@media (min-width: 1180px) {
  .details-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .details-body.has-two-panes {
    grid-auto-rows: clamp(30rem, 58vh, 42rem);
  }
}

/* Match the card's rounded bottom so the raised footer doesn't show square corners.
   Card is 10px radius over a 1px border -> 9px inner radius. Round whichever element
   sits last: the toggle when collapsed, the body when expanded. */
details:not([open]) > .details-toggle,
.details-body {
  border-bottom-left-radius: 9px;
  border-bottom-right-radius: 9px;
}

.detail-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.detail-section-title {
  align-items: center;
  color: var(--ink-3);
  display: flex;
  font-size: 0.68rem;
  font-weight: 700;
  gap: 0.4rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.7rem;
  text-transform: uppercase;
}

.detail-section-title i {
  color: var(--accent);
}

.score-grid {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  min-height: 0;
  overflow: hidden;
}

.details-body.has-two-panes .score-grid {
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.score-row {
  border-bottom: 1px solid var(--rule-2);
  display: grid;
  font-size: 0.76rem;
  gap: 0.6rem;
  grid-template-columns: minmax(92px, 0.3fr) minmax(0, 1fr);
  line-height: 1.5;
  padding: 0.55rem 0.7rem;
}

.score-row:last-child {
  border-bottom: 0;
}

.score-row.is-wide {
  grid-template-columns: 1fr;
  gap: 0.25rem;
}

.score-key {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.score-val {
  color: var(--ink-2);
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
}

.score-row.is-wide .score-val {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.6;
}

.desc-box {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  min-height: 0;
  overflow-y: auto;
  overflow-wrap: anywhere;
  padding: 0.85rem;
  scrollbar-gutter: stable;
  tab-size: 2;
  white-space: pre-wrap;
}

@media (max-width: 1179.98px) {
  .details-body.has-two-panes .score-grid,
  .details-body.has-two-panes .desc-box {
    max-height: min(34rem, 70vh);
  }
}

.empty-state-panel {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 3rem 1rem;
  text-align: center;
}

.empty-state-title {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.sticky-actions {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 0%, transparent), var(--surface) 35%);
}

@keyframes jobCardIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes jobCardNewGlow {
  0% {
    background: color-mix(in srgb, var(--accent-bg) 75%, var(--white));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent), var(--shadow-md);
  }

  18% {
    background: color-mix(in srgb, var(--accent-bg) 52%, var(--white));
  }

  100% {
    background: var(--white);
    box-shadow: var(--shadow);
  }
}

@keyframes modalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalCardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes detailsReveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes refreshPulse {
  0% { opacity: 0.8; transform: scale(0.82); }
  100% { opacity: 0; transform: scale(1.22); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes liveDotPulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--score-good) 15%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--score-good) 8%, transparent); }
}

@keyframes insightsPollBar {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  51% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

@keyframes savePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

@keyframes repeatHirePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

details[open] > .details-body { animation: detailsReveal 0.18s ease-out; }

@media (max-width: 991.98px) {
  .job-card-main {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .job-meta-col {
    border-left: 0;
    border-top: 1px solid var(--rule-2);
    grid-column: 1 / -1;
    min-height: 72px;
    text-align: left;
  }

  .job-meta-col {
    align-items: center;
    flex-direction: row;
  }
}

@media (max-width: 575.98px) {
  main.container-xl {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .topbar .container-xl {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .nav-pill {
    padding: 0.35rem 0.48rem;
  }

  .job-card-main {
    grid-template-columns: 1fr;
  }

  .job-score-col {
    align-items: center;
    border-bottom: 1px solid var(--rule-2);
    border-right: 0;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.85rem 1rem;
    text-align: left;
  }

  .score-ring {
    height: 52px;
    width: 52px;
  }

  .score-ring[data-tooltip]::after {
    left: 0;
    min-width: min(260px, 80vw);
    transform: none;
  }

  .job-content {
    padding: 1rem;
  }

  .job-meta-col {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
  }

  .job-actions {
    justify-content: flex-start;
  }

  .details-body {
    grid-template-columns: 1fr;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .score-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   Job card — Hybrid layout: Teleforge anatomy on Radar's teal tokens.
   (mono-eyebrow · ring score block w/ decision label · foot meta)
   ───────────────────────────────────────────────────────────── */
.job-main {
  padding: 1.15rem 1.25rem;
}

.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.job-headline {
  min-width: 0;
}

.job-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-head .job-title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
}

.job-main .job-summary {
  font-size: 0.92rem;
  line-height: 1.55;
  margin-top: 0.5rem;
}

.job-main .job-chips {
  margin-top: 0.85rem;
}

.jobscore {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  text-align: center;
}

.jobscore-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.jobscore-ring {
  width: 46px;
  height: 46px;
  flex: none;
}

.jobscore-ring svg {
  display: block;
  transform: rotate(-90deg);
}

.ring-track {
  stroke: var(--rule-2);
}

.jobscore.is-good .ring-fill { stroke: var(--score-good); }
.jobscore.is-mid .ring-fill { stroke: var(--score-mid); }
.jobscore.is-low .ring-fill { stroke: var(--score-low); }
.jobscore.is-pending .ring-fill { stroke: var(--ink-3); }

.jobscore-num {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--mono);
  line-height: 1;
}

.jobscore-num b {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.jobscore-num small {
  font-size: 0.62rem;
  color: var(--ink-3);
  margin-top: 2px;
}

.jobscore.is-pending .jobscore-num b {
  font-size: 1rem;
  color: var(--ink-3);
}

.jobscore-label {
  max-width: 132px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
}

.jobscore.is-good .jobscore-label { color: var(--score-good); }
.jobscore.is-mid .jobscore-label { color: var(--score-mid); }
.jobscore.is-low .jobscore-label { color: var(--score-low); }
.jobscore.is-pending .jobscore-label { color: var(--ink-3); }

.jobscore[data-tooltip] {
  cursor: help;
}

.jobscore[data-tooltip]::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: max-content;
  max-width: 260px;
  padding: 0.55rem 0.65rem;
  background: var(--ink);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.45;
  text-align: left;
  white-space: pre-line;
  pointer-events: none;
}

.jobscore[data-tooltip]:hover::after,
.jobscore[data-tooltip]:focus::after,
.jobscore.tooltip-open::after {
  display: block;
}

.job-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule-2);
}

.job-foot-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-2);
}

.job-foot-item {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  min-width: 0;
}

.job-foot-item > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-foot-sep {
  width: 3px;
  height: 3px;
  flex: none;
  border-radius: 50%;
  background: var(--rule);
}

.job-card.is-archived .job-eyebrow,
.job-card.is-archived .job-foot-meta {
  opacity: 0.68;
}

@media (max-width: 575.98px) {
  .job-head {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.85rem;
  }

  .jobscore {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.8rem;
  }

  .jobscore-label {
    max-width: none;
  }

  .jobscore[data-tooltip]::after {
    right: auto;
    left: 0;
  }

  .job-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }
}

/* ============================================================ */
/* Job card — triage spec-sheet (score spine + spec strip)      */
/* ============================================================ */
/* --- header: headline + compact score tile --- */
/* ── card body ─────────────────────────────────────────────────────────── */
.job-body { padding: 0.95rem 1.15rem 0.8rem; }

/* top row: client byline (left) + score beacon (right) */
.job-head-row { display: flex; align-items: center; justify-content: space-between; gap: 0.85rem; }

/* --- client byline (avatar + name → profile; identity, not the headline) --- */
.job-byline { display: flex; align-items: center; gap: 0.5rem; min-width: 0; max-width: calc(100% - 78px); border-radius: 999px; margin: -0.2rem 0 0 -0.2rem; padding: 0.2rem; text-decoration: none; transition: background 0.15s; }
a.job-byline:hover { background: var(--surface-raised); }
a.job-byline:hover .byline-name { color: var(--accent); }
.job-ava { flex: none; width: 30px; height: 30px; border-radius: 9px; overflow: hidden; background: var(--surface-raised); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05); }
.job-ava svg { display: block; }
.byline-meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.byline-name-row { min-width: 0; display: flex; align-items: center; gap: 0.3rem; }
.byline-name { font-weight: 700; font-size: 0.84rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s; }
.byline-name.is-codename { font-family: var(--mono); font-weight: 600; letter-spacing: -0.01em; }
.byline-name.byline-muted { color: var(--ink-3); font-weight: 600; }
.byline-country { display: inline-flex; align-items: center; gap: 0.3rem; }
.byline-sub { font-size: 0.68rem; color: var(--ink-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 0.3rem; }
.byline-sub.byline-muted { opacity: 0.85; }
.byline-flag { font-size: 0.82rem; line-height: 1; }
.repeat-hire-mark {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  transition: color 0.16s ease, transform 0.16s ease;
}
.repeat-hire-mark .lucide { width: 0.9rem; height: 0.9rem; animation: repeatHirePulse 2.4s ease-in-out infinite; }
.repeat-hire-mark:hover,
.repeat-hire-mark:focus { color: var(--accent-hover); transform: scale(1.12); }
.repeat-hire-mark:hover .lucide,
.repeat-hire-mark:focus .lucide { animation: none; }
.repeat-hire-count {
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  background: var(--accent-bg);
  border-radius: 999px;
  padding: 0.1rem 0.3rem;
  margin-left: 0.15rem;
  transition: background 0.16s ease, color 0.16s ease;
}
.repeat-hire-mark:hover .repeat-hire-count,
.repeat-hire-mark:focus .repeat-hire-count { background: var(--accent); color: #fff; }
.repeat-hire-mark[data-tooltip]::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100% + 7px);
  z-index: 80;
  width: max-content;
  max-width: 220px;
  padding: 0.42rem 0.55rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.66rem;
  transform: translateX(-50%);
  pointer-events: none;
}
.repeat-hire-mark[data-tooltip]:hover::after,
.repeat-hire-mark.tooltip-open::after { display: block; }

/* --- score beacon --- */
.job-score { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; gap: 0.06rem; min-width: 62px; max-width: 112px; padding: 0.32rem 0.55rem 0.42rem; border-radius: 11px; border: 1.5px solid transparent; text-align: center; }
.job-score-num { font-family: var(--mono); font-size: 1.45rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.job-score-den { font-family: var(--mono); font-size: 0.52rem; font-weight: 600; color: var(--ink-3); margin-left: 1px; }
.job-score-verdict { font-size: 0.62rem; font-weight: 800; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.01em; margin-top: 0.16rem; }
.job-score.is-good { background: var(--score-good-bg); border-color: var(--score-good-ring); }
.job-score.is-good .job-score-num, .job-score.is-good .job-score-verdict { color: var(--score-good); }
.job-score.is-mid { background: var(--score-mid-bg); border-color: var(--score-mid-ring); }
.job-score.is-mid .job-score-num, .job-score.is-mid .job-score-verdict { color: var(--score-mid); }
.job-score.is-low { background: transparent; border-color: var(--rule); }
.job-score.is-low .job-score-num, .job-score.is-low .job-score-verdict { color: var(--ink-3); }
.job-score.is-pending { background: var(--pending-bg); border-color: var(--pending-ring); }
.job-score.is-pending .job-score-num { font-size: 1rem; letter-spacing: 0.01em; color: var(--pending); padding: 0.22rem 0; }
.job-score.is-pending .job-score-verdict { color: var(--pending); }
.job-score.is-unscored { background: transparent; border-color: var(--rule); }
.job-score.is-unscored .job-score-num { font-size: 1rem; letter-spacing: 0.01em; color: var(--ink-3); padding: 0.22rem 0; }
.job-score.is-unscored .job-score-verdict { color: var(--ink-3); }

/* score tooltip (anchored below-right of the tile) */
.job-score[data-tooltip] { cursor: help; }
.job-score[data-tooltip]::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 70;
  width: max-content;
  max-width: 260px;
  padding: 0.55rem 0.65rem;
  background: var(--ink);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.45;
  text-align: left;
  white-space: pre-line;
  pointer-events: none;
}
.job-score[data-tooltip]:hover::after,
.job-score[data-tooltip]:focus::after,
.job-score.tooltip-open::after { display: block; }

/* --- headline --- */
.job-eyebrow-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.7rem 0 0.3rem; }
.job-body .job-eyebrow {
  margin: 0; min-width: 0;
  font-family: var(--mono); font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.job-body .job-title { display: block; font-size: 1.1rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; color: var(--ink); text-decoration: none; }
.job-body .job-title:hover { color: var(--accent); }
.job-body .job-summary { font-size: 0.875rem; line-height: 1.55; color: var(--ink-2); margin-top: 0.4rem; }

/* --- spec strip — explicit Hourly vs Fixed --- */
.job-spec {
  display: flex; flex-wrap: wrap; margin-top: 0.85rem;
  border: 1px solid var(--rule-2); border-radius: 10px; overflow: hidden;
  background: var(--surface-raised);
}
.spec-cell { flex: 1 1 auto; min-width: 84px; padding: 0.46rem 0.72rem; border-left: 1px solid var(--rule-2); }
.spec-cell:first-child { border-left: 0; }
.spec-k { display: flex; align-items: center; gap: 0.32rem; font-family: var(--mono); font-size: 0.58rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.22rem; }
.spec-k .lucide { font-size: 0.72rem; }
.spec-v { font-family: var(--mono); font-size: 0.84rem; font-weight: 600; color: var(--ink); line-height: 1.15; }
.spec-cell.is-budget { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.spec-cell.is-budget .spec-k .lucide { color: var(--accent); }
.spec-cell.is-budget .spec-v { color: var(--accent); font-weight: 700; }
.type-pill { display: inline-flex; align-items: center; gap: 0.26rem; font-family: var(--mono); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.06rem 0.4rem; border-radius: 5px; }
.type-pill .lucide { font-size: 0.78rem; }
.type-pill.hourly { color: var(--accent); background: var(--accent-bg); }
.type-pill.fixed { color: var(--ink-2); background: var(--surface); border: 1px solid var(--rule-2); }

/* --- live activity strip (proposals / hiring / invites) --- */
.job-activity {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.12rem 0.5rem;
  margin-top: 0.8rem; font-family: var(--mono); font-size: 0.74rem; color: var(--ink);
}
.job-activity > .lucide { color: var(--accent); margin-right: 0.1rem; }
.job-activity > span { font-weight: 600; }
.job-activity > span:not(:first-of-type)::before { content: "·"; color: var(--ink-3); font-weight: 400; margin-right: 0.5rem; }

/* --- client trust band (stats; identity lives in the byline) --- */
.job-client { margin-top: 0.8rem; }
.client-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.12rem 0.5rem; font-size: 0.8rem; color: var(--ink-2); }
.client-line + .client-line { margin-top: 0.38rem; }
.client-line > span:not(:first-child)::before { content: "·"; color: var(--ink-3); margin-right: 0.5rem; }
.client-strong { color: var(--ink); font-weight: 700; }
.client-muted { color: var(--ink-3); }
.client-verified { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--score-good); font-weight: 700; }
.client-verified .lucide { font-size: 0.85rem; }
.client-unverified { color: var(--score-low); }
.client-rating { display: inline-flex; align-items: center; gap: 0.25rem; font-family: var(--mono); font-weight: 600; color: var(--ink); }
.client-rating .lucide { color: var(--score-mid); fill: var(--score-mid); font-size: 0.85rem; }
.client-needs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.55rem; }
.needs-lab { font-family: var(--mono); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--pending); }
.req { background: var(--pending-bg); color: var(--pending); border-radius: 6px; padding: 0.05rem 0.42rem; font-family: var(--mono); font-size: 0.72rem; font-weight: 600; }

/* --- skills --- */
.job-skills { display: flex; flex-wrap: wrap; gap: 0.34rem; margin-top: 0.75rem; }
.job-skills .skill { font-size: 0.73rem; color: var(--ink-2); background: var(--surface); border: 1px solid var(--rule-2); border-radius: 7px; padding: 0.12rem 0.52rem; }
.job-skills .skill.is-more { color: var(--ink-3); font-family: var(--mono); font-size: 0.69rem; }

/* --- foot --- */
.job-body .job-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-top: 0.85rem; padding-top: 0.7rem; border-top: 1px solid var(--rule-2); }
.job-posted { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--mono); font-size: 0.73rem; color: var(--ink-3); min-width: 0; }
.job-posted .lucide { font-size: 0.85rem; }
.job-posted .posted-rel { color: var(--accent); font-weight: 600; }
.job-body .job-actions { display: flex; gap: 0.4rem; flex: none; }
.job-card.is-archived .job-body .job-title,
.job-card.is-archived .job-body .job-summary { opacity: 0.68; }

@media (max-width: 575.98px) {
  .job-body { padding: 0.9rem 1rem 0.8rem; }
  .job-head-row { gap: 0.6rem; }
  .job-byline { max-width: calc(100% - 70px); }
  .job-score { min-width: 52px; padding: 0.26rem 0.42rem 0.36rem; }
  .job-score-num { font-size: 1.28rem; }
  .spec-cell { min-width: 72px; }
}

/* ============================================================ */
/* Proposal-prompt modal                                        */
/* ============================================================ */
body.modal-open { overflow: hidden; }
.prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.prompt-modal-state {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.5rem;
  color: var(--ink-2);
  font-weight: 650;
  text-align: center;
}
.prompt-modal-state.is-error { color: var(--score-low); }
.prompt-modal-state .lucide { width: 18px; height: 18px; }
.prompt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  animation: modalBackdropIn 0.18s ease-out;
}
.prompt-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: modalCardIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.prompt-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem 0.85rem;
  border-bottom: 1px solid var(--rule-2);
}
.prompt-modal-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.prompt-modal-eyebrow i { font-size: 0.8rem; }
.prompt-modal-title { font-size: 1rem; font-weight: 700; line-height: 1.35; color: var(--ink); }
.prompt-modal-x {
  flex: none;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-2);
  cursor: pointer;
}
.prompt-modal-x:hover { border-color: var(--accent); color: var(--accent); }
.prompt-modal-text-wrap {
  flex: 1 1 320px;
  min-height: 200px;
  margin: 1rem 1.2rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule-2);
  border-radius: 9px;
  background: var(--surface-raised);
}
.prompt-modal-text {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  box-sizing: border-box;
  overflow: auto;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 3.6rem 0.85rem 0.85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}
.prompt-modal-text:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.prompt-modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0 1.2rem 1.15rem;
}
.prompt-copy-icon {
  position: absolute;
  z-index: 2;
  top: 0.65rem;
  right: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 7px;
  cursor: pointer;
  background: color-mix(in srgb, var(--white) 90%, transparent);
  color: var(--ink-2);
  box-shadow: var(--shadow);
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.prompt-copy-icon:hover,
.prompt-copy-icon:focus-visible { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.prompt-copy-icon:active { transform: scale(0.9); }
.prompt-copy-icon .lucide { width: 15px; height: 15px; }
.prompt-copy-icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: none;
  width: max-content;
  padding: 0.38rem 0.5rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.65rem;
  pointer-events: none;
}
.prompt-copy-icon[data-tooltip]:hover::after,
.prompt-copy-icon[data-tooltip]:focus-visible::after { display: block; }
.prompt-providers { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.prompt-providers-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.prompt-providers-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.prompt-provider {
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: 7px;
  padding: 0.28rem 0.6rem;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.prompt-provider:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.prompt-provider:active { transform: scale(0.96); }
.prompt-provider.is-prefilled { border-color: var(--accent-mid); color: var(--accent); }

/* --- HTMX refresh: button spinner + toast (reuses the shared `spin` keyframe) --- */
/* lucide replaces the <i data-lucide> with an <svg> on load, so the spinner must
   target the rendered svg (the i is only there pre-lucide). */
i[data-lucide][data-loading],
svg.lucide[data-loading],
[data-loading] { display: none; }
.btn-apply.htmx-request [data-idle],
.add-go.htmx-request [data-idle] { display: none; }
.btn-apply.htmx-request [data-loading],
.add-go.htmx-request [data-loading] { display: inline-flex; }
.is-spinning,
.btn-apply.htmx-request [data-loading].lucide,
.add-go.htmx-request [data-loading].lucide { animation: spin 0.7s linear infinite; transform-origin: center; }
.btn-apply.htmx-request,
.add-go.htmx-request,
.action-btn.htmx-request { cursor: progress; opacity: 0.68; }
.insights-range.htmx-request,
.insights-search-filter.htmx-request { cursor: progress; opacity: 0.72; }
.btn-apply:disabled,
.add-go:disabled,
.action-btn:disabled { opacity: 0.58; }
.refresh-btn.htmx-request { cursor: progress; color: var(--accent); opacity: 1; }
.refresh-btn.htmx-request::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 50%;
  animation: refreshPulse 0.9s ease-out infinite;
  pointer-events: none;
}
.refresh-btn.htmx-request svg,
.refresh-btn.htmx-request i { animation: spin 0.7s linear infinite; transform-origin: center; }

.btn-apply,
.btn-json,
.btn-secondary-action,
.add-go,
.theme-toggle,
.insights-range-option,
.insights-nav-link {
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}
.btn-apply:hover,
.btn-json:hover,
.btn-secondary-action:hover,
.add-go:hover,
.theme-toggle:hover,
.insights-nav-link:hover { transform: translateY(-1px); }
.btn-apply:active,
.btn-json:active,
.btn-secondary-action:active,
.add-go:active,
.theme-toggle:active,
.insights-range-option:active,
.insights-nav-link:active { transform: scale(0.96); }

.toast-host {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 1000;
  display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none; max-width: min(92vw, 26rem);
}
.toast {
  pointer-events: auto;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600; line-height: 1.35;
  color: var(--ink); background: var(--surface-raised);
  border: 1px solid var(--rule-2); border-left: 3px solid var(--ink-3);
  border-radius: 9px; padding: 0.6rem 0.8rem; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(8px); transition: opacity 0.24s ease, transform 0.24s ease;
}
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast-success { border-left-color: var(--score-good); }
.toast-info { border-left-color: var(--accent); }
.toast-warn { border-left-color: var(--score-mid); }
.toast-error { border-left-color: var(--score-low); }
.toast-neutral { border-left-color: var(--ink-3); }

/* --- Add-by-URL: modal form + result banner ----------------------------------- */
.add-modal-card { max-width: 520px; }
.add-modal-body { display: flex; flex-direction: column; padding: 1.15rem 1.2rem 1.2rem; }
.add-field-label {
  font-family: var(--mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 0.45rem;
}
.add-input {
  width: 100%; box-sizing: border-box;
  font-family: var(--mono); font-size: 0.82rem; color: var(--ink);
  background: var(--surface-raised); border: 1px solid var(--rule);
  border-radius: 9px; padding: 0.72rem 0.8rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.add-input::placeholder { color: color-mix(in srgb, var(--ink-3) 65%, transparent); }
.add-input:focus {
  outline: none; background: var(--white); border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.add-hint { font-size: 0.76rem; line-height: 1.55; color: var(--ink-3); margin: 0.6rem 0 0; }
.add-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-top: 1.15rem; }
.add-cancel {
  border: 0; background: transparent; color: var(--ink-3);
  font-family: var(--sans); font-size: 0.82rem; font-weight: 600;
  padding: 0.5rem 0.7rem; border-radius: 8px; cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.add-cancel:hover { color: var(--ink); background: var(--surface); }
.add-go {
  display: inline-flex; align-items: center; gap: 0.42rem;
  border: 0; background: var(--accent); color: #fff;
  font-family: var(--sans); font-size: 0.82rem; font-weight: 700;
  padding: 0.58rem 0.95rem; border-radius: 8px; cursor: pointer;
  box-shadow: var(--shadow); transition: background 0.15s, transform 0.05s;
}
.add-go .lucide { font-size: 0.95rem; }
.add-go:hover { background: var(--accent-hover); }
.add-go:active { transform: translateY(1px); }
.add-go:disabled { opacity: 0.6; cursor: default; }

.add-flash {
  display: flex; align-items: center; gap: 0.6rem;
  margin: 0 0 1.15rem; padding: 0.72rem 0.9rem;
  font-size: 0.85rem; font-weight: 600; color: var(--ink); line-height: 1.4;
  background: var(--surface-raised); border: 1px solid var(--rule-2);
  border-left: 3px solid var(--ink-3); border-radius: 9px; box-shadow: var(--shadow);
}
.add-flash .lucide { flex: none; font-size: 1.02rem; }
.add-flash-msg { flex: 1 1 auto; min-width: 0; }
.add-flash-msg strong { font-weight: 700; }
.add-flash--ok { border-left-color: var(--accent); }
.add-flash--ok .lucide { color: var(--accent); }
.add-flash--error { border-left-color: var(--score-low); }
.add-flash--error .lucide { color: var(--score-low); }
.add-flash-x { flex: none; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 0.2rem; line-height: 0; border-radius: 6px; }
.add-flash-x:hover { color: var(--ink); }

/* Insights workspace --------------------------------------------------------- */
.settings-diagnostics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.settings-diagnostics a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 0.76rem;
  font-weight: 650;
  text-decoration: none;
}

.settings-diagnostics a:hover { color: var(--accent); border-color: var(--accent); }
.settings-diagnostics .lucide { width: 16px; height: 16px; color: var(--ink-3); }

.insights-workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.insights-sidebar {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  padding: 0.25rem 0.9rem 1rem 0;
  border-right: 1px solid var(--rule);
}

.insights-sidebar-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  padding: 0 0.65rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
}

.insights-sidebar-title .lucide { width: 17px; height: 17px; color: var(--accent); }
.insights-nav-group { margin-top: 1.05rem; }
.insights-nav-label {
  padding: 0 0.65rem 0.4rem;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.insights-nav-link {
  display: flex;
  align-items: center;
  gap: 0.58rem;
  min-height: 38px;
  margin: 2px 0;
  padding: 0.45rem 0.65rem;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.insights-nav-link .lucide { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.insights-nav-link:hover { color: var(--ink); background: var(--surface); }
.insights-nav-link.is-active { color: var(--accent); background: var(--accent-bg); }
.insights-nav-link.is-active .lucide { color: var(--accent); }

.insights-mobile-nav { display: none; }
.insights-main { min-width: 0; }
.insights-live-content { min-width: 0; position: relative; }
.insights-live-content.htmx-request::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  animation: insightsPollBar 1.2s ease-in-out infinite;
  z-index: 1;
}
.insights-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0 1.15rem;
  border-bottom: 1px solid var(--rule);
}

.insights-heading { min-width: 0; }
.insights-kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.insights-heading h1 {
  margin: 0.2rem 0 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 780;
  line-height: 1.15;
  letter-spacing: 0;
}

.insights-heading p {
  max-width: 62ch;
  margin: 0.35rem 0 0;
  color: var(--ink-3);
  font-size: 0.82rem;
  line-height: 1.5;
}

.insights-live-state {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.36rem;
  flex: none;
}

.insights-status,
.insights-freshness {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  max-width: 260px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: right;
}

.insights-freshness {
  min-width: 9.75rem;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}

.insights-status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--ink-3);
}

.insights-status.is-healthy .insights-status-dot,
.insights-status.is-fresh .insights-status-dot { background: var(--score-good); animation: liveDotPulse 2s ease-in-out infinite; }
.insights-status.is-warning .insights-status-dot { background: var(--score-mid); }
.insights-status.is-critical .insights-status-dot { background: var(--score-low); }
.insights-status.is-healthy,
.insights-freshness.is-healthy,
.insights-freshness.is-fresh { color: var(--score-good); }
.insights-status.is-warning,
.insights-freshness.is-warning { color: var(--score-mid); }
.insights-status.is-critical,
.insights-freshness.is-critical { color: var(--score-low); }

.insights-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.7rem 0;
}

.insights-range-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}

.insights-range {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--surface);
}

.insights-range-option {
  min-width: 42px;
  height: 29px;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
}

.insights-range-option:hover { color: var(--ink); }
.insights-range-option.is-active { color: #fff; background: var(--accent); }
html[data-theme="dark"] .insights-range-option.is-active { color: #06261d; }

.insights-custom-range {
  display: inline-flex;
  align-items: center;
  height: 37px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.insights-custom-range:focus-within,
.insights-custom-range.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent);
}
.insights-custom-range label {
  padding-left: 0.55rem;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.insights-custom-range input {
  width: 82px;
  height: 100%;
  min-width: 0;
  padding: 0 0.42rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
}
.insights-custom-range input::placeholder { color: color-mix(in srgb, var(--ink-3) 68%, transparent); }
.insights-custom-range button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.insights-custom-range button:hover,
.insights-custom-range button:focus-visible { background: var(--accent-bg); color: var(--accent); }
.insights-custom-range button:active { transform: scale(0.9); }
.insights-custom-range button .lucide { width: 14px; height: 14px; }
.insights-custom-range.htmx-request { cursor: progress; opacity: 0.72; }

.insights-search-filter {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.insights-search-filter label {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
}

.insights-search-filter select,
.insights-mobile-select-wrap select {
  min-width: 170px;
  max-width: 260px;
  height: 36px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.76rem;
  padding: 0 2rem 0 0.65rem;
}

.insights-coverage {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0 0 0.75rem;
  color: var(--ink-3);
  font-size: 0.72rem;
  line-height: 1.4;
}

.insights-coverage[hidden] { display: none; }
.insights-coverage .lucide { width: 14px; height: 14px; flex: none; }

.insights-range-notice {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0 0 0.75rem;
  color: var(--score-mid);
  font-size: 0.72rem;
  line-height: 1.4;
}
.insights-range-notice .lucide { width: 14px; height: 14px; flex: none; }

.insights-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.insights-summary-card {
  min-width: 0;
  min-height: 104px;
  padding: 0.85rem;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--ink-3);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.insights-summary-card.is-healthy,
.insights-summary-card.is-fresh { border-top-color: var(--score-good); }
.insights-summary-card.is-warning { border-top-color: var(--score-mid); }
.insights-summary-card.is-critical { border-top-color: var(--score-low); }
.insights-summary-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: var(--ink-3);
}

.insights-summary-head .lucide { width: 14px; height: 14px; flex: none; }
.insights-summary-label {
  min-width: 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.insights-summary-value {
  margin-top: 0.48rem;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 780;
  line-height: 1.1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.insights-summary-detail {
  margin-top: 0.25rem;
  color: var(--ink-3);
  font-size: 0.68rem;
  line-height: 1.35;
}

.insights-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.insights-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.insights-panel.is-wide,
.insights-panel.is-full { grid-column: 1 / -1; }
.insights-panel-head {
  min-height: 67px;
  padding: 0.9rem 1rem 0.72rem;
  border-bottom: 1px solid var(--rule);
}

.insights-panel-title {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 720;
  line-height: 1.3;
  letter-spacing: 0;
}

.insights-panel-note {
  max-width: 76ch;
  margin: 0.22rem 0 0;
  color: var(--ink-3);
  font-size: 0.7rem;
  line-height: 1.4;
}

.insights-panel-body { min-height: 150px; padding: 0.9rem 1rem 1rem; }
.insights-chart { width: 100%; height: 280px; }
.insights-chart-tooltip {
  max-width: min(360px, calc(100vw - 24px));
  white-space: normal !important;
}

.insights-chart-tooltip .insights-tooltip-title {
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-weight: 700;
}

.insights-chart-tooltip .insights-tooltip-row {
  display: grid;
  grid-template-columns: 10px minmax(90px, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  min-width: 160px;
  color: var(--ink-2);
}

.insights-chart-tooltip .insights-tooltip-row + .insights-tooltip-row { margin-top: 0.2rem; }
.insights-chart-tooltip .insights-tooltip-marker { display: inline-flex; width: 10px; }
.insights-chart-tooltip .insights-tooltip-label { overflow-wrap: anywhere; }
.insights-chart-tooltip .insights-tooltip-row strong {
  margin-left: 0.75rem;
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.insights-status-list { display: grid; }
.insights-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 48px;
  padding: 0.48rem 0;
  border-bottom: 1px solid var(--rule);
}

.insights-status-row:last-child { border-bottom: 0; }
.insights-status-copy { display: flex; flex-direction: column; min-width: 0; }
.insights-status-name { color: var(--ink-2); font-size: 0.76rem; font-weight: 650; }
.insights-status-detail {
  margin-top: 0.1rem;
  overflow-wrap: anywhere;
  color: var(--ink-3);
  font-size: 0.66rem;
  line-height: 1.35;
}

.insights-status-value {
  max-width: 55%;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-align: right;
}

.insights-status-value.is-healthy { color: var(--score-good); }
.insights-status-value.is-warning { color: var(--score-mid); }
.insights-status-value.is-critical { color: var(--score-low); }
.insights-funnel { display: grid; gap: 0.72rem; }
.insights-funnel-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.28rem;
}

.insights-funnel-label { color: var(--ink-2); font-size: 0.75rem; font-weight: 650; }
.insights-funnel-count { color: var(--ink); font-family: var(--mono); font-size: 0.8rem; }
.insights-funnel-track { height: 12px; overflow: hidden; border-radius: 4px; background: var(--surface); }
.insights-funnel-fill { height: 100%; min-width: 2px; border-radius: 4px; background: var(--funnel-color); }
.insights-funnel-row:nth-child(1) .insights-funnel-fill { --funnel-color: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.insights-funnel-row:nth-child(2) .insights-funnel-fill { --funnel-color: color-mix(in srgb, var(--accent) 60%, var(--surface)); }
.insights-funnel-row:nth-child(3) .insights-funnel-fill { --funnel-color: color-mix(in srgb, var(--accent) 75%, var(--surface)); }
.insights-funnel-row:nth-child(4) .insights-funnel-fill { --funnel-color: color-mix(in srgb, var(--accent) 88%, var(--surface)); }
.insights-funnel-row:nth-child(5) .insights-funnel-fill { --funnel-color: var(--accent); }
.insights-funnel-row:nth-child(n+6) .insights-funnel-fill { --funnel-color: color-mix(in srgb, var(--accent) 90%, var(--ink)); }

.insights-table-wrap { max-width: 100%; overflow-x: auto; }
.insights-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.insights-table th {
  padding: 0.35rem 0.55rem 0.55rem;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.insights-table td {
  max-width: 280px;
  padding: 0.62rem 0.55rem;
  border-top: 1px solid var(--rule);
  overflow-wrap: anywhere;
  color: var(--ink-2);
  font-size: 0.72rem;
  line-height: 1.35;
  vertical-align: middle;
}

.insights-table td:not(:first-child) { font-family: var(--mono); font-size: 0.68rem; }
.insights-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.18rem 0.42rem;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: capitalize;
}

.insights-state-pill.is-healthy { color: var(--score-good); background: var(--score-good-bg); }
.insights-state-pill.is-warning { color: var(--score-mid); background: var(--score-mid-bg); }
.insights-state-pill.is-critical { color: var(--score-low); background: var(--score-low-bg); }

.insights-table tr.is-critical { background: color-mix(in srgb, var(--score-low) 7%, transparent); }
.insights-table tr.is-warning { background: color-mix(in srgb, var(--score-mid) 7%, transparent); }
.insights-table tr.is-healthy { background: color-mix(in srgb, var(--score-good) 4%, transparent); }
.insights-table tr.is-critical td:first-child { box-shadow: inset 3px 0 0 var(--score-low); }
.insights-table tr.is-warning td:first-child { box-shadow: inset 3px 0 0 var(--score-mid); }

.insights-timeline { max-height: 360px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.insights-timeline li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.45rem 0;
}

.insights-timeline-marker {
  width: 8px;
  height: 8px;
  margin-top: 0.28rem;
  border: 2px solid var(--ink-3);
  border-radius: 50%;
  background: var(--white);
}

.insights-timeline li.is-healthy .insights-timeline-marker { border-color: var(--score-good); }
.insights-timeline li.is-warning .insights-timeline-marker { border-color: var(--score-mid); }
.insights-timeline li.is-critical .insights-timeline-marker { border-color: var(--score-low); }
.insights-timeline-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.18rem 0.6rem; }
.insights-timeline-copy strong { color: var(--ink-2); font-size: 0.72rem; font-weight: 650; }
.insights-timeline-copy time { color: var(--ink-3); font-family: var(--mono); font-size: 0.61rem; }
.insights-timeline-copy > span { grid-column: 1 / -1; color: var(--ink-3); font-size: 0.66rem; }

.insights-timeline-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.insights-timeline-filters { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.insights-timeline-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 26px;
  padding: 0 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 700;
  cursor: pointer;
}
.insights-timeline-filter:hover { color: var(--ink); border-color: var(--ink-3); }
.insights-timeline-filter.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }
html[data-theme="dark"] .insights-timeline-filter.is-active { color: #06261d; }
.insights-timeline-filter-count { opacity: 0.8; }
.insights-timeline-count { color: var(--ink-3); font-weight: 700; font-size: 0.62rem; }
.insights-timeline-note { margin: 0; color: var(--ink-3); font-size: 0.63rem; }

.insights-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 128px;
  padding: 1rem;
  color: var(--ink-3);
  font-size: 0.75rem;
  text-align: center;
}

.insights-empty .lucide { width: 16px; height: 16px; flex: none; }
.insights-empty.is-no-data .lucide { color: var(--score-mid); }
.insights-empty.is-unavailable .lucide { color: var(--ink-3); opacity: 0.7; }

@media (max-width: 1100px) {
  .insights-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 899.98px) {
  .insights-workspace { display: block; }
  .insights-sidebar { display: none; }
  .insights-mobile-nav { display: block; margin-bottom: 0.9rem; }
  .insights-mobile-nav > label {
    display: block;
    margin-bottom: 0.32rem;
    color: var(--ink-3);
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .insights-mobile-select-wrap { position: relative; display: flex; align-items: center; }
  .insights-mobile-select-wrap select { width: 100%; max-width: none; padding-left: 2.15rem; appearance: none; }
  .insights-mobile-select-wrap .lucide { position: absolute; width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
  .insights-mobile-select-wrap .lucide:first-child { left: 0.65rem; }
  .insights-mobile-select-wrap .lucide:last-child { right: 0.65rem; }
}

@media (max-width: 639.98px) {
  .settings-diagnostics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insights-header { flex-direction: column; }
  .insights-live-state { align-items: flex-start; }
  .insights-status,
  .insights-freshness { max-width: none; text-align: left; }
  .insights-filters { align-items: stretch; flex-direction: column; }
  .insights-range-controls { align-items: stretch; }
  .insights-range { max-width: 100%; overflow-x: auto; }
  .insights-custom-range { flex: 1 1 190px; }
  .insights-custom-range input { flex: 1 1 auto; width: 64px; }
  .insights-search-filter { justify-content: space-between; }
  .insights-search-filter select { min-width: 0; width: min(72vw, 240px); }
  .insights-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
  .insights-summary-card { min-height: 94px; padding: 0.72rem; }
  .insights-summary-value { font-size: 1.2rem; }
  .insights-panels { grid-template-columns: 1fr; }
  .insights-panel.is-wide,
  .insights-panel.is-full { grid-column: auto; }
  .insights-panel-head { min-height: 62px; padding: 0.78rem 0.82rem 0.65rem; }
  .insights-panel-body { padding: 0.75rem 0.82rem 0.85rem; }
  .insights-chart { height: 250px; }
  .insights-status-value { max-width: 48%; }
}

@media (prefers-reduced-motion: reduce) {
  .prompt-modal-backdrop,
  .prompt-modal-card,
  details[open] > .details-body,
  .refresh-btn.htmx-request::before,
  .refresh-btn.htmx-request svg,
  .refresh-btn.htmx-request i,
  .is-spinning,
  .btn-apply.htmx-request [data-loading].lucide,
  .add-go.htmx-request [data-loading].lucide,
  .live-dot,
  .insights-status-dot,
  .insights-live-content.htmx-request::before,
  .job-card.is-live-new,
  .job-card.is-live-fresh,
  .save-btn.is-just-saved svg,
  .repeat-hire-mark .lucide {
    animation: none !important;
  }
  .action-btn,
  .meta-btn,
  .metadata-button,
  .prompt-copy-icon,
  .prompt-provider,
  .repeat-hire-mark,
  .btn-apply,
  .btn-json,
  .btn-secondary-action,
  .add-go,
  .theme-toggle,
  .insights-range-option,
  .insights-nav-link,
  .insights-custom-range,
  .insights-custom-range button {
    transition: none !important;
  }
}
