/* ============================================================
   Auxilium X — ONE-SCREEN DASHBOARD
   Liquid Glass × Apple.com × Legal Monochrome
   ============================================================ */

/* -------- 1. TOKENS -------- */
:root {
  --ink-0:   #000000;
  --ink-1:   #1C1C1E;
  --ink-2:   #3A3A3C;
  --ink-3:   #8E8E93;
  --ink-4:   #C7C7CC;
  --ink-5:   #E5E5EA;
  --ink-6:   #F2F2F7;
  --paper:   #FBFBFD;
  --white:   #FFFFFF;

  --status-open:  #5856D6;
  --status-liq:   #FF9500;
  --status-none:  #8E8E93;
  --status-err:   #1C1C1E;

  --glass-bg:         rgba(255, 255, 255, 0.58);
  --glass-bg-strong:  rgba(255, 255, 255, 0.72);
  --glass-bg-subtle:  rgba(255, 255, 255, 0.38);
  --glass-border:     rgba(0, 0, 0, 0.08);
  --glass-shadow:     0 1px 0 rgba(255,255,255,.9) inset,
                      0 0 0 1px rgba(0,0,0,.04) inset,
                      0 10px 30px rgba(0, 0, 0, 0.08),
                      0 30px 80px rgba(0, 0, 0, 0.06);
  --blur-sm: 14px;
  --blur-md: 24px;
  --blur-lg: 40px;

  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-text:    "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono:    "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --r-pill: 999px;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 28px; --sp-7: 40px;

  --ease-spring: cubic-bezier(.2, .9, .25, 1.05);
  --ease-out:    cubic-bezier(.16, 1, .3, 1);
  --dur-fast: 180ms;
  --dur-med:  320ms;
  --dur-slow: 560ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:           #0A0A0B;
    --glass-bg:        rgba(28, 28, 30, 0.55);
    --glass-bg-strong: rgba(28, 28, 30, 0.72);
    --glass-bg-subtle: rgba(28, 28, 30, 0.38);
    --glass-border:    rgba(255, 255, 255, 0.08);
    --glass-shadow:    0 1px 0 rgba(255,255,255,.08) inset,
                       0 0 0 1px rgba(255,255,255,.04) inset,
                       0 10px 30px rgba(0, 0, 0, 0.5),
                       0 30px 80px rgba(0, 0, 0, 0.4);
    --ink-0: #F2F2F7;
    --ink-1: #E5E5EA;
    --ink-2: #C7C7CC;
    --ink-3: #8E8E93;
    --ink-4: #48484A;
    --ink-5: #2C2C2E;
    --ink-6: #1C1C1E;
    --white: #1C1C1E;
  }
}

/* -------- 2. RESET -------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-0);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  letter-spacing: -0.005em;
}
button { font: inherit; color: inherit; border: 0; background: transparent; cursor: pointer; }
input { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
code { font-family: var(--font-mono); font-size: 0.9em; }
.svg-defs { position: absolute; width: 0; height: 0; }

/* -------- 3. BACKDROP -------- */
.backdrop {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.light {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .55;
  animation: drift 28s var(--ease-out) infinite alternate;
}
.light-1 {
  top: -10%; left: -5%;
  width: 55vw; height: 55vw;
  background: radial-gradient(circle at 30% 30%, #D8D8E8 0%, #E8E8F0 50%, transparent 75%);
}
.light-2 {
  top: 20%; right: -10%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle at 50% 50%, #EFEFEF 0%, #F7F7FA 50%, transparent 75%);
  animation-duration: 34s;
  animation-delay: -8s;
}
.light-3 {
  bottom: -15%; left: 25%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle at 50% 50%, #E6E6F0 0%, #F0F0F5 55%, transparent 80%);
  animation-duration: 40s;
  animation-delay: -14s;
}
@media (prefers-color-scheme: dark) {
  .light { opacity: .35; }
  .light-1 { background: radial-gradient(circle at 30% 30%, #1C1C2E 0%, #0A0A12 55%, transparent 80%); }
  .light-2 { background: radial-gradient(circle at 50% 50%, #15151F 0%, #09090F 60%, transparent 80%); }
  .light-3 { background: radial-gradient(circle at 50% 50%, #1A1A28 0%, #0A0A10 60%, transparent 80%); }
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(-4vw, 3vh, 0) scale(1.08); }
  100% { transform: translate3d(3vw, -3vh, 0) scale(0.96); }
}
.grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
  opacity: .035;
  mix-blend-mode: multiply;
}

/* -------- 4. GLASS MIXIN -------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(180%);
          backdrop-filter: blur(var(--blur-md)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  isolation: isolate;
}
.glass::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.55) 0%,
    rgba(255,255,255,0)   40%,
    rgba(255,255,255,0)   70%,
    rgba(255,255,255,0.2) 100%
  );
  mix-blend-mode: overlay;
}
@media (prefers-color-scheme: dark) {
  .glass::before {
    background: linear-gradient(
      135deg,
      rgba(255,255,255,0.08) 0%,
      rgba(255,255,255,0)    40%,
      rgba(255,255,255,0)    70%,
      rgba(255,255,255,0.04) 100%
    );
  }
}

/* -------- 5. TITLEBAR -------- */
.titlebar {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 14px calc(84px + 16px);
  height: 74px;
  background: linear-gradient(to bottom, rgba(251,251,253,.75), rgba(251,251,253,0));
  -webkit-backdrop-filter: blur(18px) saturate(180%);
          backdrop-filter: blur(18px) saturate(180%);
  -webkit-app-region: drag;
  flex-shrink: 0;
}
.titlebar button { -webkit-app-region: no-drag; }
@media (prefers-color-scheme: dark) {
  .titlebar { background: linear-gradient(to bottom, rgba(10,10,11,.75), rgba(10,10,11,0)); }
}
.titlebar__brand { display: flex; align-items: center; gap: 14px; }
.mark { display: inline-flex; width: 30px; height: 30px; color: var(--ink-0); }
.mark svg { width: 100%; height: 100%; }
.mark--auxilium {
  width: 46px; height: 46px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(255, 149, 0, 0.18));
}
.titlebar__titles { line-height: 1.15; }
.titlebar__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.titlebar__subtitle { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.titlebar__history-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--glass-bg-subtle);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
          backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--glass-border);
  font-size: 12px;
  font-weight: 500;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast);
}
.titlebar__history-toggle:hover { background: var(--glass-bg); }
.titlebar__history-toggle:active { transform: scale(0.97); }
.titlebar__history-toggle svg { width: 14px; height: 14px; }

/* -------- 6. DASHBOARD GRID (ONE SCREEN) -------- */
.dash {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  padding: 0 24px 24px;
  height: calc(100vh - 74px);
  max-width: 1400px;
  margin: 0 auto;
}

.dash__left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.dash__right {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  min-height: 0;
  min-width: 0;
}

/* -------- 7. FILECARD — dual state (empty / loaded) -------- */
.filecard {
  padding: 24px 20px;
  cursor: pointer;
  transition: transform var(--dur-med) var(--ease-spring),
              box-shadow var(--dur-med) var(--ease-out),
              border-color var(--dur-fast);
}
.filecard[data-empty="true"] {
  border-style: dashed;
  border-width: 1.5px;
  border-color: var(--ink-4);
}
.filecard[data-empty="false"] {
  border-style: solid;
  cursor: default;
}
.filecard:hover { transform: translateY(-1px); }
.filecard[data-empty="false"]:hover { transform: none; }
.filecard.is-dragover {
  border-color: var(--status-open);
  transform: scale(1.01);
  background: var(--glass-bg-strong);
}

.filecard__empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.filecard[data-empty="false"] .filecard__empty { display: none; }

.filecard__full { display: none; }
.filecard[data-empty="false"] .filecard__full { display: block; }

.filecard__icon { width: 40px; height: 40px; color: var(--ink-2); }
.filecard__title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 500;
  letter-spacing: -0.01em;
  margin-top: 4px;
}
.filecard__or { color: var(--ink-3); font-size: 11px; }
.filecard__hint { font-size: 11px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }

.filecard__head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 14px;
}
.filecard__filename {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
/* Column mapper */
.mapper {
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  background: var(--glass-bg-subtle);
  border: 1px solid var(--glass-border);
}
.mapper__label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.select-wrap {
  position: relative;
}
.select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 9px 32px 9px 12px;
  border-radius: var(--r-md);
  background: var(--white);
  border: 1px solid var(--glass-border);
  color: var(--ink-0);
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: 0;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  text-overflow: ellipsis;
}
.select:hover { border-color: var(--ink-3); }
.select:focus {
  border-color: var(--status-open);
  box-shadow: 0 0 0 3px rgba(88,86,214,.12);
}
.select__chevron {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  pointer-events: none;
  color: var(--ink-3);
}
.mapper__sample {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin-top: 10px;
  font-size: 10px;
  overflow: hidden;
}
.mapper__sample__label {
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  flex-shrink: 0;
}
.mapper__sample__value {
  font-family: var(--font-mono);
  color: var(--ink-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.mapper__auto {
  margin-top: 6px;
  font-size: 10px;
  color: var(--status-open);
  font-weight: 500;
  opacity: 0.85;
}
.mapper__auto.is-hidden { display: none; }

.filecard__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.tinystat {
  text-align: center;
  padding: 8px 4px;
  background: var(--glass-bg-subtle);
  border-radius: var(--r-sm);
}
.tinystat__value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--ink-0);
  line-height: 1;
}
.tinystat__label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-top: 4px;
  font-weight: 600;
}

/* -------- 8. PANELS -------- */
.panel { padding: 18px 20px; }
.panel__head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.panel--options { padding: 16px 20px; }

.switch {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
}
.switch:last-child { border-bottom: 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  position: relative;
  width: 38px; height: 22px;
  background: var(--ink-5);
  border-radius: var(--r-pill);
  transition: background var(--dur-med) var(--ease-out);
  flex-shrink: 0;
}
.switch__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform var(--dur-med) var(--ease-spring);
}
.switch input:checked ~ .switch__track { background: var(--status-open); }
.switch input:checked ~ .switch__track .switch__thumb { transform: translateX(16px); }
.switch input:disabled ~ .switch__track { opacity: 0.4; }
.switch__text b {
  display: block;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-0);
  margin-bottom: 2px;
}
.switch__text em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.4;
}

/* -------- 9. ACTIONBAR (Start/Stop/Open) + CREDIT -------- */
.actionbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 12px 4px;
  border-top: 1px solid var(--glass-border);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  opacity: 0.9;
  transition: opacity var(--dur-fast);
}
.credit:hover { opacity: 1; }
.credit__label {
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.credit__logo {
  width: auto;
  height: 28px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
  .credit__logo { filter: invert(1); }
}
.credit__name {
  font-weight: 600;
  color: var(--ink-0);
  letter-spacing: 0.01em;
  text-transform: none;
  font-size: 13px;
  font-family: var(--font-display);
}

/* -------- 10. BUTTONS -------- */
.btn[hidden] { display: none !important; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.005em;
  transition:
    transform var(--dur-fast) var(--ease-spring),
    background var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    opacity var(--dur-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}
.btn--primary {
  background: var(--ink-0);
  color: var(--white);
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 6px 20px rgba(0,0,0,.18);
}
.btn--primary:hover:not(:disabled) { background: var(--ink-1); }
@media (prefers-color-scheme: dark) {
  .btn--primary { background: var(--white); color: var(--ink-0);}
  .btn--primary:hover:not(:disabled) { background: var(--ink-1); color: var(--white);}
}
.btn--ghost {
  background: var(--glass-bg-subtle);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  color: var(--ink-0);
  border-color: var(--glass-border);
}
.btn--ghost:hover:not(:disabled) { background: var(--glass-bg); }
.btn--large { padding: 14px 24px; font-size: 14px; }
.btn--small { padding: 7px 14px; font-size: 12px; }
.btn__arrow {
  display: inline-block;
  transition: transform var(--dur-med) var(--ease-spring);
}
.btn:hover:not(:disabled) .btn__arrow { transform: translateX(3px); }

.linkbtn {
  font-size: 11px;
  color: var(--ink-3);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.linkbtn:hover { color: var(--ink-0); background: var(--glass-bg-subtle); }

.iconbtn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  font-size: 18px;
  color: var(--ink-2);
  transition: background var(--dur-fast);
}
.iconbtn:hover { background: var(--glass-bg-subtle); color: var(--ink-0); }

/* -------- 11. PROGRESS PANEL -------- */
.panel--progress {
  padding: 20px 24px;
}
.progress-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
}
.ring-wrap { position: relative; width: 160px; height: 160px; flex-shrink: 0; }
.ring { width: 100%; height: 100%; }
.ring__track {
  fill: none;
  stroke: var(--ink-5);
  stroke-width: 6;
}
.ring__fill {
  fill: none;
  stroke: var(--status-open);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 603.19;
  stroke-dashoffset: 603.19;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset var(--dur-slow) var(--ease-out);
  filter: drop-shadow(0 0 12px rgba(88,86,214,.35));
}
.ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}
.ring__pct {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 200;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink-0);
}
.ring__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 6px;
}

.progress-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.progress-current { display: flex; flex-direction: column; gap: 2px; }
.progress-current__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.progress-current__code {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  background: var(--glass-bg-subtle);
  -webkit-backdrop-filter: blur(var(--blur-sm));
          backdrop-filter: blur(var(--blur-sm));
  font-size: 11px;
  color: var(--ink-2);
  border: 1px solid var(--glass-border);
}
.summary-chip b { font-weight: 600; color: var(--ink-0); }

/* Status dots */
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-4);
  flex-shrink: 0;
}
.dot--open { background: var(--status-open); box-shadow: 0 0 0 3px rgba(88,86,214,.15); }
.dot--liq  { background: var(--status-liq);  box-shadow: 0 0 0 3px rgba(255,149,0,.15); }
.dot--none { background: var(--status-none); box-shadow: 0 0 0 3px rgba(142,142,147,.15); }
.dot--err  { background: var(--status-err); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }

/* -------- 12. RESULTS TABLE -------- */
.panel--table {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.results-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.searchbox {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--glass-bg-subtle);
  border: 1px solid var(--glass-border);
  color: var(--ink-0);
  font-size: 12px;
  outline: 0;
  transition: border-color var(--dur-fast);
  min-width: 0;
}
.searchbox:focus { border-color: var(--status-open); }
.searchbox::placeholder { color: var(--ink-3); }

.filter-groups {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-divider {
  width: 1px;
  height: 18px;
  background: var(--glass-border);
  flex-shrink: 0;
}
.pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  background: var(--glass-bg-subtle);
  font-size: 11px;
  color: var(--ink-2);
  border: 1px solid var(--glass-border);
  transition: all var(--dur-fast);
  white-space: nowrap;
}
.pill b { font-weight: 600; color: var(--ink-3); }
.pill:hover { background: var(--glass-bg); }
.pill.is-active {
  background: var(--ink-0);
  color: var(--white);
  border-color: var(--ink-0);
}
.pill.is-active b { color: var(--white); }
@media (prefers-color-scheme: dark) {
  .pill.is-active { background: var(--white); color: var(--ink-0); }
  .pill.is-active b { color: var(--ink-0); }
}

.table-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.table-scroll::-webkit-scrollbar { width: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 4px; }

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.results-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--blur-sm));
  backdrop-filter: blur(var(--blur-sm));
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
  user-select: none;
}
.results-table thead th.num { text-align: right; }
.results-table thead th:hover { color: var(--ink-0); }
.results-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--ink-1);
  vertical-align: top;
}
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table tbody tr.is-new {
  animation: rowIn var(--dur-med) var(--ease-spring);
}
.results-table tbody tr.is-latest td { background: rgba(88,86,214,.05); }
.results-table tbody tr:hover td { background: var(--glass-bg-subtle); }
.results-table .code-cell { font-family: var(--font-mono); color: var(--ink-0); }
.results-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.results-table .status-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.results-table .status-cell--open { color: var(--status-open); }
.results-table .status-cell--liq  { color: var(--status-liq); }
.results-table .status-cell--none { color: var(--ink-3); }
.results-table .status-cell--err  { color: var(--ink-0); font-weight: 600; }
.results-table .type-cell { color: var(--ink-3); font-size: 11px; max-width: 340px; }

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

/* Empty state */
.empty-row td { padding: 0 !important; border: 0 !important; }
.empty-row:hover td { background: transparent !important; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--ink-3);
}
.empty-state svg { width: 56px; height: 56px; opacity: .5; }
.empty-state p { font-size: 12px; }

/* -------- 13. HISTORY DRAWER -------- */
.history {
  position: fixed;
  top: 70px; right: 20px; bottom: 20px;
  width: 320px;
  z-index: 80;
  padding: 20px;
  transform: translateX(calc(100% + 40px));
  transition: transform var(--dur-med) var(--ease-spring);
  overflow-y: auto;
}
.history.is-open { transform: translateX(0); }
.history__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.history__head h3 {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 500;
  letter-spacing: -0.01em;
}
.history__list { display: flex; flex-direction: column; gap: 8px; }
.history__item {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--glass-bg-subtle);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.history__item:hover { background: var(--glass-bg); }
.history__item__date {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.history__item__file {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-1);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history__item__meta {
  display: flex; gap: 10px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--ink-3);
}
.history__item__meta b { color: var(--ink-0); font-weight: 600; }
.history__empty {
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  padding: 30px 0;
}

/* -------- 14. TOAST -------- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: rgba(0,0,0,0.85);
  color: var(--white);
  font-size: 12px;
  -webkit-backdrop-filter: blur(var(--blur-md));
          backdrop-filter: blur(var(--blur-md));
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out),
              transform var(--dur-med) var(--ease-spring);
  z-index: 100;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* -------- 15. RESPONSIVE -------- */
@media (max-width: 1024px) {
  .dash {
    grid-template-columns: 300px 1fr;
  }
}
@media (max-width: 860px) {
  .dash {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
  }
  body { overflow: auto; }
  .history { left: 16px; right: 16px; width: auto; }
}

/* -------- 16. REDUCED MOTION -------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
