/* ==========================================================================
   Getaround Collector Console — design system
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #09090b;
  --panel: #101014;
  --panel-2: #17171c;
  --panel-3: #1f2027;
  --panel-4: #26272f;
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --quiet: #71717a;
  --line: #232329;
  --line-strong: #3a3a44;

  --accent: #2dd4bf;
  --accent-deep: #14b8a6;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-line: rgba(45, 212, 191, 0.35);

  --good: #34d399;
  --good-soft: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.12);
  --info: #818cf8;
  --info-soft: rgba(129, 140, 248, 0.12);

  --sans: "Aptos", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", "Consolas", ui-monospace, monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 24px 64px rgba(0, 0, 0, 0.5);

  --speed: 160ms;
  --ease: cubic-bezier(0.25, 0.6, 0.35, 1);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 12% -8%, rgba(20, 184, 166, 0.07), transparent 60%),
    radial-gradient(900px 480px at 95% 0%, rgba(99, 102, 241, 0.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  color: var(--ink);
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

h4 {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

::selection {
  background: var(--accent-soft);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--panel-3);
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--panel-4);
}

.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.eyebrow {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.empty-state {
  padding: 28px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--quiet);
  text-align: center;
  font-size: 13px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-top: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="checkbox"] {
  accent-color: var(--accent-deep);
}

input.invalid {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px var(--bad-soft);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 55%,
    calc(100% - 11px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

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

.primary,
.secondary,
.icon-button,
.tab,
.link-button {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background var(--speed) var(--ease),
    border-color var(--speed) var(--ease),
    color var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease),
    filter var(--speed) var(--ease);
}

.primary:active,
.secondary:active,
.icon-button:active,
.tab:active,
.link-button:active {
  transform: translateY(1px);
}

.primary:disabled,
.secondary:disabled,
.icon-button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.primary {
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  border-color: var(--accent-deep);
  color: #04211d;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), var(--shadow-1);
}

.primary:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 18px rgba(45, 212, 191, 0.25);
}

.primary span {
  font-family: var(--mono);
  font-weight: 600;
  margin-left: 6px;
  opacity: 0.75;
}

.secondary,
.link-button {
  background: var(--panel-3);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
}

.secondary:hover,
.icon-button:hover,
.tab:hover {
  border-color: var(--accent-line);
  background: var(--panel-4);
}

.link-button {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}

.link-button:hover {
  color: var(--ink);
}

.icon-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--panel-3);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-panel {
  width: min(400px, 100%);
  border: 1px solid var(--accent-line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow-3);
  border-radius: var(--radius-lg);
  padding: 28px;
  animation: rise-in 0.4s var(--ease);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.login-panel h1 {
  margin-top: 10px;
  font-size: 26px;
}

.login-copy {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 12px;
  font-size: 13px;
}

.auth-error {
  min-height: 18px;
  color: var(--bad);
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   Shell + topbar
   -------------------------------------------------------------------------- */

.shell {
  max-width: 1640px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow-1);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--quiet);
  transition: background var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.status-pill.online {
  color: var(--good);
  border-color: rgba(52, 211, 153, 0.35);
}

.status-pill.online::before {
  background: var(--good);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

/* --------------------------------------------------------------------------
   Sidebar / controls
   -------------------------------------------------------------------------- */

.controls {
  padding: 16px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.panel-header,
.dialog-head,
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.compact-title {
  align-items: end;
  border: 0;
  padding: 0;
}

.compact-title p,
.section-title p {
  color: var(--muted);
  font-size: 12px;
}

.run-settings {
  margin-top: 14px;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.strategy-note,
.cache-note {
  color: var(--quiet);
  font-size: 11.5px;
  line-height: 1.4;
  margin-top: 10px;
}

.dynamic-window-picker {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--panel);
}

.dynamic-window-picker__title {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.dynamic-window-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.window-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
}

.window-option input {
  width: auto;
  margin: 0;
}

.dynamic-window-picker__hint {
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.4;
  margin-top: 8px;
}

.cache-settings {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--panel);
}

.toggle-row {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.toggle-label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}

.toggle-label:hover {
  border-color: var(--line-strong);
  background: var(--panel-3);
}

.toggle-label input {
  width: auto;
}

.toggle-label span {
  font-size: 12.5px;
}

.grid-1,
.grid-2,
.grid-3 {
  display: grid;
  gap: 8px;
}

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

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

/* Areas */

.area-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 72px;
  gap: 6px;
  margin-top: 10px;
}

.area-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
  margin-top: 12px;
  padding-right: 4px;
}

.area-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}

.area-option:hover {
  border-color: var(--accent-line);
  background: var(--panel-3);
}

.area-option input {
  width: auto;
  margin-top: 2px;
}

.area-option strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

.area-option small,
.area-more {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
}

.status-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--warn);
}

.status-dot.matched {
  background: var(--good);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
}

.status-dot.pending {
  background: var(--warn);
}

/* Jobs list */

.job-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.job-card {
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 10px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition:
    border-color var(--speed) var(--ease),
    background var(--speed) var(--ease),
    transform var(--speed) var(--ease);
}

.job-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.job-card.active {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft), var(--panel-2) 70%);
  box-shadow: inset 2px 0 0 var(--accent);
}

.job-card strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.job-card small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.batch-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.batch-card-head span {
  flex: 0 0 auto;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.batch-mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, auto 1fr);
  gap: 4px 6px;
  align-items: baseline;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.batch-mini-metrics b {
  color: var(--ink);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Main panel + hero
   -------------------------------------------------------------------------- */

.main-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.hero-panel {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title metrics"
    "progress progress";
  gap: 14px 18px;
  align-items: center;
}

.hero-panel .panel-header {
  grid-area: title;
}

.hero-panel .metrics {
  grid-area: metrics;
}

.hero-panel .progress-wrap {
  grid-area: progress;
}

.metrics {
  display: flex;
  gap: 8px;
}

.metrics > div {
  min-width: 92px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

.metrics span {
  display: block;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.metrics small {
  color: var(--quiet);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metrics span[data-status="running"] {
  color: var(--accent);
}

.metrics span[data-status="queued"] {
  color: var(--info);
}

.metrics span[data-status="completed"] {
  color: var(--good);
}

.metrics span[data-status="failed"] {
  color: var(--bad);
}

.metrics span[data-status="stopped"] {
  color: var(--warn);
}

/* Progress (behavioral invariants: span width %, .indeterminate) */

.progress-bar {
  height: 8px;
  background: var(--panel-3);
  overflow: hidden;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
  transition: width 0.5s var(--ease);
}

.progress-bar span.indeterminate {
  width: 40%;
  animation: progress-indeterminate 1.4s linear infinite;
}

@keyframes progress-indeterminate {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

#progressText {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  margin-top: 7px;
}

/* --------------------------------------------------------------------------
   Tabs + table panel
   -------------------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.tab:hover {
  color: var(--ink);
  background: var(--panel-3);
  border-color: transparent;
}

.tab.active {
  background: var(--panel-4);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.table-panel {
  min-height: 320px;
  overflow-x: auto;
}

.tab-view {
  overflow: auto;
  max-height: calc(100vh - 300px);
  animation: fade-in 0.25s var(--ease);
}

@keyframes fade-in {
  from { opacity: 0; }
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

td {
  font-variant-numeric: tabular-nums;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel-2);
  z-index: 1;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--quiet);
}

tbody tr:hover {
  background: var(--panel-2);
}

.json-cell,
pre {
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-cell {
  max-width: 380px;
  max-height: 130px;
  overflow: auto;
  display: block;
}

.level-error,
.level-info {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
}

.level-error {
  color: var(--bad);
  background: var(--bad-soft);
}

.level-info {
  color: var(--accent);
  background: var(--accent-soft);
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */

.dashboard,
.listing-grid {
  padding: 16px;
}

.dashboard {
  display: grid;
  gap: 18px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--accent-line);
  background:
    radial-gradient(600px 200px at 0% 0%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border-radius: var(--radius-lg);
}

.dashboard-hero h2 {
  margin-top: 6px;
  font-size: 21px;
}

.dashboard-hero p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}

.hero-price {
  text-align: right;
  padding: 14px 18px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--panel-2);
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.08);
}

.hero-price span {
  display: block;
  font-size: 24px;
  font-weight: 750;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.hero-price small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.analysis-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.analysis-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.analysis-card span {
  display: block;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.analysis-card strong {
  display: block;
  margin-top: 7px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.analysis-card small {
  display: block;
  margin-top: 3px;
  color: var(--quiet);
  font-size: 11px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.insight-card {
  background: linear-gradient(180deg, var(--info-soft), var(--panel-2) 75%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
}

.insight-card span {
  display: block;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.insight-card strong {
  display: block;
  margin-top: 7px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--info);
}

.insight-card small {
  display: block;
  margin-top: 3px;
  color: var(--quiet);
  font-size: 11px;
}

/* Batch telemetry strip */

.telemetry-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.telemetry-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}

.telemetry-card span {
  display: block;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.telemetry-card strong {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Price histogram */

.histogram-panel {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.histogram-panel > p {
  color: var(--quiet);
  font-size: 11.5px;
  margin: 4px 0 14px;
}

.histogram {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 130px;
}

.histogram-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  text-align: center;
}

.histogram-col i {
  display: block;
  width: 100%;
  min-height: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  border-radius: 4px 4px 2px 2px;
  opacity: 0.85;
  transition: filter var(--speed) var(--ease), opacity var(--speed) var(--ease);
}

.histogram-col:hover i {
  filter: brightness(1.15);
  opacity: 1;
}

.histogram-col b {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.histogram-col small {
  color: var(--quiet);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Per-area breakdown table */

.area-table-wrap {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
}

.area-table-wrap > p {
  color: var(--quiet);
  font-size: 11.5px;
  margin: 4px 0 12px;
}

.area-table-wrap th {
  background: var(--panel-3);
}

.cell-bar {
  display: grid;
  grid-template-columns: 64px auto;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.cell-bar i {
  display: block;
  height: 6px;
  min-width: 2px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 999px;
  opacity: 0.85;
  transition: width 0.5s var(--ease);
}

.cell-bar span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.status-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--panel-3);
}

.status-badge[data-status="running"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.status-badge[data-status="queued"] {
  color: var(--info);
  background: var(--info-soft);
}

.status-badge[data-status="completed"] {
  color: var(--good);
  background: var(--good-soft);
}

.status-badge[data-status="failed"] {
  color: var(--bad);
  background: var(--bad-soft);
}

.status-badge[data-status="stopped"] {
  color: var(--warn);
  background: var(--warn-soft);
}

/* Decision / recommendation cards */

.decision-section {
  display: grid;
  gap: 12px;
}

.section-title {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.car-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 200px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 14px;
  border-radius: var(--radius);
}

.clickable-card {
  cursor: pointer;
  transition:
    transform var(--speed) var(--ease),
    border-color var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease);
}

.clickable-card:hover,
.clickable-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-2);
  outline: none;
}

.decision-card {
  border-color: var(--line-strong);
}

.card-rank {
  position: absolute;
  right: 12px;
  top: 12px;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}

.car-card h4 {
  max-width: calc(100% - 44px);
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}

.car-card p {
  color: var(--muted);
}

.card-price strong {
  display: block;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.card-price small {
  color: var(--muted);
  font-size: 11px;
}

.card-facts,
.equipment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.card-facts span {
  border: 1px solid var(--line);
  background: var(--panel-3);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
}

.equipment-list span {
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10.5px;
}

.card-description,
.card-condition,
.card-parking {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-size: 12.5px;
  line-height: 1.4;
}

.card-condition {
  border: 1px solid rgba(251, 191, 36, 0.25);
  background: var(--warn-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.card-parking {
  font-style: italic;
  color: var(--muted);
}

.card-actions {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  font-size: 12.5px;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

summary:hover {
  color: var(--ink);
}

/* Distribution panels */

.dashboard-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.group-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-2);
}

.group-panel h3 {
  padding: 11px 14px;
  background: var(--panel-3);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.group-list,
.bar-list {
  display: grid;
}

.bar-list {
  gap: 10px;
  padding: 12px 14px;
}

.group-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, auto);
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

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

.group-row span {
  color: var(--muted);
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.bar-row span {
  color: var(--muted);
}

.bar-row i {
  display: block;
  height: 6px;
  min-width: 2px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 999px;
  opacity: 0.85;
  transition: width 0.5s var(--ease), opacity var(--speed) var(--ease);
}

.bar-row:hover i {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Dialogs
   -------------------------------------------------------------------------- */

dialog {
  width: min(860px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow-3);
}

dialog[open] {
  animation: rise-in 0.22s var(--ease);
}

dialog::backdrop {
  background: rgba(5, 5, 8, 0.7);
  backdrop-filter: blur(3px);
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

dialog pre {
  font-family: var(--mono);
}

#artifactBody,
#vehicleDialogBody {
  max-height: calc(100vh - 160px);
  overflow: auto;
  padding: 16px 18px;
}

#vehicleDialog {
  width: min(1100px, calc(100vw - 32px));
}

.vehicle-detail {
  display: grid;
  gap: 14px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background:
    radial-gradient(400px 140px at 0% 0%, var(--accent-soft), transparent 70%),
    var(--panel-2);
}

.detail-hero h2 {
  font-size: 18px;
  line-height: 1.2;
  margin-top: 4px;
}

.detail-hero p,
.detail-price small {
  color: var(--muted);
  margin-top: 6px;
}

.detail-price {
  text-align: right;
  min-width: 130px;
}

.detail-price strong {
  display: block;
  font-size: 24px;
  font-weight: 750;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.detail-block,
.detail-section {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: var(--radius);
  padding: 13px 14px;
}

.detail-block h3,
.detail-section h3 {
  margin-bottom: 10px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.detail-row span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.detail-row strong {
  font-size: 12.5px;
  text-align: right;
  overflow-wrap: anywhere;
}

.detail-section p,
.detail-section li {
  line-height: 1.5;
  font-size: 13px;
}

.detail-section p {
  white-space: pre-line;
}

.detail-section ul {
  margin: 0;
  padding-left: 18px;
}

.detail-equipment {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.review-list {
  display: grid;
  gap: 8px;
}

.review-list article {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.review-list span {
  color: var(--muted);
  display: block;
  font-size: 11.5px;
}

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

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .hero-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "metrics"
      "progress";
  }

  .metrics {
    flex-wrap: wrap;
  }
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .controls {
    position: static;
    max-height: none;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .dashboard-hero,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .hero-price,
  .detail-price {
    text-align: left;
  }

  .histogram {
    height: 100px;
  }

  .group-row {
    grid-template-columns: 1fr auto;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

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

  .progress-bar span.indeterminate {
    animation: none;
    width: 100%;
    opacity: 0.5;
  }
}
