/* MADvision SPA — Dark + Light Theme */
:root {
  --bg: #0a0a0a; --surface: #141414; --surface-2: #1c1c1e; --border: #2c2c2e;
  --text: #e5e5e7; --text-2: #8e8e93; --text-3: #636366;
  --accent: #0a84ff; --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --purple: #bf5af2; --pink: #ff375f;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --mono: "SF Mono", "Fira Code", monospace;
  --sidebar-w: 200px;
  --sidebar-collapsed-w: 48px;
}

/* Light theme — Apple HIG light palette */
[data-theme="light"] {
  --bg: #f2f2f7; --surface: #ffffff; --surface-2: #e5e5ea; --border: #c6c6c8;
  --text: #1c1c1e; --text-2: #636366; --text-3: #aeaeb2;
  --accent: #007aff; --green: #34c759; --orange: #ff9500; --red: #ff3b30; --purple: #af52de; --pink: #ff2d55;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; display: flex; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Brand typography — shared with MADphotos */
.brand-mad { font-weight: 900; letter-spacing: -0.06em; }
.brand-sub { font-weight: 400; }

/* ═══ SIDEBAR ═══ */
.sidebar-rail {
  width: calc(var(--sidebar-w) + 24px); min-width: calc(var(--sidebar-w) + 24px);
  padding: 12px; position: sticky; top: 24px; left: 24px; height: auto; max-height: calc(100vh - 48px); flex-shrink: 0;
}
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 0;
  height: auto;
  max-height: calc(100vh - 24px);
  overflow-y: auto; display: flex; flex-direction: column;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.03) inset;
  position: relative;
}
.sidebar::after {
  content: ''; position: absolute; top: 12px; right: -1px; width: 2px; height: calc(100% - 24px);
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.1) 100%);
  opacity: 0.4; border-radius: 1px;
  background-size: 100% 200%; animation: sidebarGlow 8s ease infinite;
}
@keyframes sidebarGlow {
  0% { background-position: 0% 0%; } 50% { background-position: 0% 100%; } 100% { background-position: 0% 0%; }
}
.sidebar .sb-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.3px; color: var(--text);
  padding: 12px 16px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
  display: flex; align-items: center; justify-content: space-between;
}

.sidebar .sb-title > span {
  margin-left: 12px;
}
.sb-collapse-btn {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 14px;
  border-radius: 6px; transition: background 0.15s, color 0.15s, transform 0.3s; flex-shrink: 0;
}
.sb-collapse-btn:hover { background: rgba(128,128,128,0.15); color: var(--text); }

.sidebar-rail.collapsed .sb-collapse-btn {
  transform: rotate(-90deg);
}
.sidebar a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; margin: 1px 8px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; font-size: 13px; line-height: 1.2;
  transition: background 0.15s, color 0.15s;
}
.sidebar a:hover { background: rgba(128,128,128,0.08); color: var(--text); text-decoration: none; }
.sidebar a.active {
  color: var(--accent); font-weight: 600;
  background: rgba(10,132,255,0.12);
}
.sidebar .sb-sep { height: 1px; background: var(--border); margin: 6px 14px; }
.sidebar .sb-group {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); padding: 10px 16px 4px;
}

/* Collapsible group toggle - Apple style */
.sb-group-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; margin: 1px 8px; border-radius: 6px;
  color: var(--text-2); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background 0.12s ease, color 0.12s ease;
  user-select: none;
}

.sb-group-toggle:hover {
  background: rgba(128,128,128,0.12);
  color: var(--text);
}

.sb-group-toggle:active {
  background: rgba(128,128,128,0.18);
}

.sb-group-toggle .sb-chevron {
  font-size: 9px;
  color: var(--text-3);
  transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
  display: inline-block;
  width: 12px;
  text-align: center;
  flex-shrink: 0;
}

.sb-expandable {
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.2s ease;
  max-height: 500px;
  opacity: 1;
}

.sb-expandable.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.sb-expandable a {
  padding-left: 34px;
}
.sidebar .sb-bottom {
  margin-top: auto; padding: 10px 16px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-3);
}
.sb-hamburger {
  display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; background: none; border: none; cursor: pointer;
  color: var(--text); font-size: 18px; border-radius: 6px;
}
.sb-hamburger:hover { background: rgba(128,128,128,0.15); }

/* Collapsed sidebar (accordion - hides items, keeps width) */
.sidebar-rail.collapsed .sidebar a,
.sidebar-rail.collapsed .sb-sep,
.sidebar-rail.collapsed .sb-group,
.sidebar-rail.collapsed .sb-bottom {
  display: none;
}

.sidebar-rail.collapsed .sb-title {
  border-bottom: none;
  margin-bottom: 0;
}
body.sb-collapsed .refresh-bar { left: calc(var(--sidebar-collapsed-w) + 24px); }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.theme-switch {
  width: 34px; height: 20px; border-radius: 10px; position: relative;
  background: var(--surface-2); border: 1px solid var(--border); transition: background 0.2s;
  flex-shrink: 0;
}
.theme-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--text-3); transition: transform 0.2s, background 0.2s;
}
[data-theme="light"] .theme-switch { background: var(--accent); border-color: var(--accent); }
[data-theme="light"] .theme-switch::after { transform: translateX(14px); background: #fff; }
.theme-label { font-size: 11px; color: var(--text-3); }

@media (max-width: 860px) {
  body { flex-direction: column; }
  .sidebar-rail {
    width: 100%; min-width: unset; height: auto; position: sticky; top: 0; z-index: 100;
    padding: 6px;
  }
  .sidebar {
    width: 100%; height: auto; border-radius: 10px;
    flex-direction: row; flex-wrap: wrap; gap: 0; padding: 8px 10px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    background: rgba(20,20,20,0.9);
  }
  .sidebar::after { display: none; }
  .sidebar .sb-title { width: auto; border-bottom: none; padding: 0 8px 0 0; margin-bottom: 0; font-size: 15px; }
  .sidebar > a, .sidebar .sb-group, .sidebar .sb-sep, .sidebar .sb-bottom { display: none; }
  .sidebar.open > a { display: flex; width: 100%; margin: 1px 0; }
  .sidebar.open .sb-group { display: block; width: 100%; }
  .sidebar.open .sb-sep { display: block; width: 100%; }
  .sb-hamburger { display: flex; margin-left: auto; }
}

/* ═══ CONTENT AREA ═══ */
#content { flex: 1; min-width: 0; padding: 0 32px; }

/* ═══ STATE VIEW — Container & Header ═══ */
.sv-container { max-width: 1200px; margin: 0 auto; padding: 44px 0 80px; }
.header { margin-bottom: 40px; }
.header h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; color: #fff; margin-bottom: 6px; }
.header p { font-size: 14px; color: var(--text-2); }
.header .db-stat {
  display: inline-block; font-family: var(--mono); font-size: 13px; color: var(--text);
  background: var(--surface-2); padding: 4px 10px; border-radius: 6px; margin-top: 10px;
}

/* Section */
.section { margin-bottom: 36px; }
.section-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-3); margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

/* Stat badges - wrapping flat layout */
.stat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
}

.stat-badge:hover {
  border-color: var(--badge-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.stat-badge-icon {
  font-size: 16px;
  line-height: 1;
  opacity: 0.9;
}

.stat-badge-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.stat-badge-value {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--badge-color);
  font-variant-numeric: tabular-nums;
}

.stat-badge-pct {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: #3a3a3c;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.card .num { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.card .detail { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.pill { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 10px; margin: 1px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; margin-right: 4px; }
.tag.mps { background: rgba(191,90,242,0.12); color: var(--purple); }
.tag.cpu { background: rgba(142,142,147,0.12); color: var(--text-2); }

/* Pipeline Steps */
.pipeline { display: flex; flex-direction: column; gap: 8px; }
.step {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px; background: var(--surface); border-radius: 12px; border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.step:hover {
  border-color: #3a3a3c;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.step.active {
  border-color: var(--accent);
  background: rgba(10,132,255,0.04);
  box-shadow: 0 2px 8px rgba(10,132,255,0.15);
}
.step.done {
  border-color: rgba(48,209,88,0.3);
  background: rgba(48,209,88,0.02);
}
.step-icon {
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; font-family: var(--mono);
}
.step.done .step-icon { background: rgba(48,209,88,0.15); color: var(--green); }
.step.active .step-icon { background: rgba(10,132,255,0.15); color: var(--accent); }
.step.pending .step-icon { background: var(--surface-2); color: var(--text-3); }
.step.queued .step-icon { background: rgba(255,159,10,0.1); color: var(--orange); }
.step-info h3 { font-size: 14px; font-weight: 600; }
.step-info p { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.step-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.step-status {
  font-size: 11px; font-weight: 600; font-family: var(--mono);
  padding: 3px 8px; border-radius: 5px; white-space: nowrap;
}
.step.done .step-status { background: rgba(48,209,88,0.1); color: var(--green); }
.step.active .step-status { background: rgba(10,132,255,0.1); color: var(--accent); }
.step.pending .step-status { background: var(--surface-2); color: var(--text-3); }
.step.queued .step-status { background: rgba(255,159,10,0.08); color: var(--orange); }
.step-progress { width: 130px; height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.step-progress-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; background: var(--accent); }
.step.done .step-progress-fill { background: var(--green); }
.step-count { font-size: 10px; font-family: var(--mono); color: var(--text-2); white-space: nowrap; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 13px; height: 13px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.pulse { animation: pulse 2s ease-in-out infinite; }

/* Training Charts */
.chart-container {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-top: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.chart-row { display: grid; grid-template-columns: 50px 1fr 50px; align-items: center; gap: 10px; padding: 4px 0; }
.chart-label { font-size: 11px; font-family: var(--mono); color: var(--text-2); text-align: right; }
.chart-bar-bg { height: 18px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.chart-bar { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.chart-bar.acc { background: var(--text); opacity: 0.7; }
.chart-bar.c0 { background: var(--green); opacity: 0.8; }
.chart-bar.c1 { background: var(--orange); opacity: 0.8; }
.chart-bar.c2 { background: var(--pink); opacity: 0.8; }
.chart-bar.best { box-shadow: 0 0 8px rgba(255,255,255,0.15); }
.chart-value { font-size: 12px; font-family: var(--mono); font-weight: 600; color: var(--text); text-align: left; }
.legend { display: flex; gap: 16px; margin-top: 10px; font-size: 11px; color: var(--text-2); }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: middle; }

/* Signal / Model Cards */
.signal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.signal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  position: relative; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.signal-card:hover {
  border-color: #3a3a3c;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.signal-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.signal-card .model { font-size: 11px; font-family: var(--mono); color: var(--text-3); margin-bottom: 8px; }
.signal-card .detail {
  font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between;
  padding: 3px 0; border-top: 1px solid var(--border);
}
.signal-card .detail span:last-child { font-family: var(--mono); color: var(--text); }
.card-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--surface-2); }
.card-progress-fill { height: 100%; background: var(--text); opacity: 0.6; transition: width 0.8s ease; }

/* Bar charts */
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.bar-label { font-size: 12px; color: var(--text-2); min-width: 100px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-bg { flex: 1; height: 18px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; min-width: 1px; }
.bar-val { font-size: 11px; font-family: var(--mono); color: var(--text-2); min-width: 60px; text-align: right; }

/* Signal coverage grid */
.sig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.sig-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.sig-card .sig-name { font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }
.sig-card .sig-num { font-size: 20px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.sig-card .sig-pct { font-size: 11px; color: var(--text-2); }
.sig-card .sig-bar { height: 3px; background: var(--surface-2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.sig-card .sig-bar-fill { height: 100%; border-radius: 2px; background: var(--text); opacity: 0.6; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 6px 10px; border-bottom: 1px solid rgba(44,44,46,0.5); font-variant-numeric: tabular-nums; }
.tbl .num-col { text-align: right; font-family: var(--mono); font-size: 12px; }

/* Refresh bar */
.refresh-bar {
  position: fixed; bottom: 0; left: calc(var(--sidebar-w) + 24px); right: 0; padding: 8px 24px;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-3); z-index: 50;
}
@media (max-width: 860px) {
  .refresh-bar { left: 0; }
}
.refresh-bar button {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 5px 12px; border-radius: 6px; font-size: 11px; cursor: pointer; font-family: var(--font);
}
.refresh-bar button:hover { background: #2c2c2e; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.35s ease both; }
.fade-up:nth-child(2) { animation-delay: 0.04s; }
.fade-up:nth-child(3) { animation-delay: 0.08s; }
.fade-up:nth-child(4) { animation-delay: 0.12s; }

/* ═══ LOADING — centered pulsing loader ═══ */
.loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; gap: 20px;
}
.loading-orb {
  width: 48px; height: 48px; position: relative;
}
.loading-orb::before, .loading-orb::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid transparent;
}
.loading-orb::before {
  border-top-color: var(--text); border-right-color: var(--text-2);
  animation: loaderSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.loading-orb::after {
  inset: 6px;
  border-bottom-color: var(--text-2); border-left-color: var(--text-3);
  animation: loaderSpin 1.8s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
}
.loading-orb-core {
  position: absolute; inset: 14px; border-radius: 50%;
  background: radial-gradient(circle, var(--text) 0%, transparent 70%);
  animation: loaderPulse 2s ease-in-out infinite;
}
.loading-text-label {
  font-size: 12px; color: var(--text-3); letter-spacing: 1px; text-transform: uppercase;
  font-weight: 600; animation: loaderPulse 2s ease-in-out infinite;
}
@keyframes loaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes loaderPulse {
  0%, 100% { opacity: 0.4; } 50% { opacity: 1; }
}

/* ═══ CLEANING VIEW ═══ */
.cl-topbar { padding: 10px 20px; background: #111; border-bottom: 1px solid #222; display: flex; align-items: center; justify-content: space-between; }
.cl-topbar h2 { font-size: 16px; font-weight: 600; color: #fff; }
.cl-topbar .info { font-size: 12px; color: #666; }
.cl-topbar .info kbd { background: #222; border: 1px solid #333; border-radius: 3px; padding: 1px 5px; }

.cl-dashboard { display: grid; grid-template-columns: 1fr 1fr 1fr; height: calc(100vh - 44px); gap: 1px; background: #222; }

.col { display: flex; flex-direction: column; background: #0a0a0a; overflow: hidden; }
.col-head { padding: 10px 12px; background: #111; border-bottom: 1px solid #222; text-align: center; flex-shrink: 0; }
.col-head .col-title { font-size: 15px; font-weight: 700; }
.col-head .col-title.c0 { color: #4a4; }
.col-head .col-title.c1 { color: #fa0; }
.col-head .col-title.c2 { color: #f44; }
.col-head .col-sub { font-size: 11px; color: #555; margin-top: 2px; }

.col-body { flex: 1; overflow-y: auto; padding: 3px; }
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 3px; }

.thumb { position: relative; cursor: pointer; border-radius: 3px; overflow: hidden; }
.thumb:hover { outline: 2px solid #555; outline-offset: -2px; }
.thumb.tagged { outline: 2px solid #f44; outline-offset: -2px; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.thumb .badge { position: absolute; bottom: 3px; left: 3px; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; line-height: 16px; }
.thumb .badge-xx { background: rgba(255,50,50,0.9); color: #fff; }
.thumb .badge-x { background: rgba(255,170,0,0.9); color: #000; }
.thumb .badge-safe { background: rgba(74,170,74,0.9); color: #fff; }
.thumb .tag-mark { position: absolute; top: 3px; right: 3px; width: 10px; height: 10px; border-radius: 50%; background: #f44; }

.col-more { padding: 8px; text-align: center; flex-shrink: 0; }
.col-more button { background: #1a1a1a; border: 1px solid #333; color: #aaa; padding: 6px 20px; border-radius: 6px; font-size: 12px; cursor: pointer; width: 100%; }
.col-more button:hover { background: #252525; color: #fff; }
.col-more button:disabled { opacity: 0.3; }

.loading-text { color: #555; font-size: 12px; text-align: center; padding: 20px; }

/* ═══ DISAGREE VIEW ═══ */
.dg-topbar { padding: 10px 20px; background: #111; border-bottom: 1px solid #222; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.dg-topbar h2 { font-size: 16px; font-weight: 600; color: #fff; }
.dg-topbar .controls { display: flex; gap: 6px; align-items: center; }
.dg-topbar .info { font-size: 12px; color: #666; }
.dg-topbar .info kbd { background: #222; border: 1px solid #333; border-radius: 3px; padding: 1px 5px; }

/* New disagreement header */
.dg-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); padding: 32px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.dg-header-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.dg-header-top h1 {
  font-size: 36px; font-weight: 700; letter-spacing: -0.8px;
  color: var(--text); margin: 0;
}

.dg-header-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.dg-tabs { display: flex; gap: 6px; }

.dg-tab {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); padding: 6px 14px; border-radius: 6px;
  font-size: 13px; cursor: pointer; font-weight: 500;
  transition: all 0.15s; font-family: var(--font);
}

.dg-tab:hover { background: rgba(128,128,128,0.08); color: var(--text); }

.dg-tab.active {
  border-color: var(--tab-color, var(--accent));
  color: var(--tab-color, var(--accent));
  background: rgba(10,132,255,0.08);
  font-weight: 600;
}

.dg-shortcuts {
  font-size: 12px; color: var(--text-3);
  display: flex; align-items: center; gap: 12px;
}

.dg-shortcuts kbd {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px; font-size: 11px;
  color: var(--text-2); font-family: var(--mono);
}

.filter-btn { background: #1a1a1a; border: 1px solid #333; color: #888; padding: 5px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; font-weight: 600; }
.filter-btn:hover { background: #222; color: #ccc; }
.filter-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(10,132,255,0.08); }

.dg-grid-wrap { padding: 8px; }
.dg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px; }

.dg-card { position: relative; cursor: pointer; border-radius: 4px; overflow: hidden; background: #111; }
.dg-card:hover { outline: 2px solid #555; outline-offset: -2px; }
.dg-card.tagged { outline: 2px solid #f44; outline-offset: -2px; }
.dg-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }

.dg-card .label-badge { position: absolute; top: 4px; left: 4px; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; line-height: 16px; }
.dg-card .score-badge { position: absolute; top: 4px; right: 4px; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,0.7); color: #fff; font-variant-numeric: tabular-nums; }
.dg-card .tag-mark { position: absolute; top: 22px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #f44; }

.dg-card .votes { position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 0; }
.dg-card .vote { flex: 1; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 800; letter-spacing: 0.3px; }
.vote.v0 { background: rgba(74,170,74,0.85); color: #fff; }
.vote.v1 { background: rgba(255,170,0,0.85); color: #000; }
.vote.v2 { background: rgba(255,50,50,0.85); color: #fff; }
.vote.vn { background: rgba(50,50,50,0.7); color: #555; }

.load-more { padding: 16px; text-align: center; }
.load-more button { background: #1a1a1a; border: 1px solid #333; color: #aaa; padding: 8px 30px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.load-more button:hover { background: #222; color: #fff; }

/* ═══ LIGHTBOX (shared: cleaning + disagree) ═══ */
.lb { position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lb img.lb-img { max-width: 85vw; max-height: 55vh; object-fit: contain; border-radius: 4px; }
.lb-panel { position: fixed; bottom: 0; left: 0; right: 0; background: #111; padding: 14px 20px; border-top: 1px solid #333; }
.lb-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lb-file { color: #fff; font-size: 14px; font-weight: 600; }
.lb-file .lb-sub { color: #666; font-weight: 400; margin-left: 8px; }
.lb-actions { display: flex; align-items: center; gap: 6px; }
.lb-actions button { border: none; border-radius: 6px; padding: 8px 20px; font-size: 13px; font-weight: 600; cursor: pointer; }
.lb-close { background: #222; color: #888; }

.lb-labels { display: flex; gap: 4px; align-items: center; }
.lb-labels .lbl-title { font-size: 11px; color: #555; margin-right: 4px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.lb-lbl { border: 2px solid transparent; border-radius: 8px; padding: 6px 16px; font-size: 13px; font-weight: 700; cursor: pointer; background: #1a1a1a; transition: all 0.15s; }
.lb-lbl:hover { border-color: #555; }
.lb-lbl.c0 { color: #4a4; }
.lb-lbl.c1 { color: #fa0; }
.lb-lbl.c2 { color: #f44; }
.lb-lbl.current { border-color: #555; opacity: 0.4; cursor: default; }
.lb-lbl.selected { border-color: currentColor; background: rgba(255,255,255,0.08); box-shadow: 0 0 8px rgba(255,255,255,0.1); }
.lb-undo { background: #333; color: #fff; font-size: 12px; padding: 6px 14px; border: none; border-radius: 6px; cursor: pointer; }

.lb-signals { display: flex; gap: 10px; flex-wrap: wrap; }
.lb-sig { background: #1a1a1a; border-radius: 6px; padding: 8px 12px; min-width: 130px; }
.lb-sig .sig-name { font-size: 10px; color: #666; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.lb-sig .sig-val { font-size: 16px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.lb-sig .sig-detail { font-size: 10px; color: #555; margin-top: 2px; }
.lb-sig .sig-tags { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.lb-sig .sig-tag { font-size: 9px; padding: 1px 5px; border-radius: 3px; background: #222; color: #888; }
.lb-sig .sig-tag.hot { background: rgba(255,50,50,0.25); color: #f88; }
.lb-sig .sig-tag.warm { background: rgba(255,170,0,0.2); color: #fa0; }

/* ═══ TAXONOMY VIEW ═══ */
.tx-layout { display: flex; min-height: 100%; }

.tx-menu {
  width: 220px; min-width: 220px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 0; height: fit-content; align-self: flex-start;
  position: sticky; top: 0;
}
.tx-menu-section { margin-bottom: 24px; }
.tx-menu-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); padding: 0 16px 8px; margin-bottom: 4px;
}
.tx-menu-btn {
  width: 100%; text-align: left; border: none; background: none;
  padding: 8px 16px; font-size: 13px; color: var(--text-2);
  cursor: pointer; transition: all 0.15s; font-family: var(--font);
  border-left: 2px solid transparent;
}
.tx-menu-btn:hover { background: rgba(128,128,128,0.08); color: var(--text); }
.tx-menu-btn.active {
  color: var(--accent); background: rgba(10,132,255,0.08);
  border-left-color: var(--accent); font-weight: 600;
}

.tx-search {
  width: calc(100% - 32px); margin: 0 16px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: 8px 12px; border-radius: 6px;
  font-size: 13px; font-family: var(--font); outline: none;
}
.tx-search:focus { border-color: var(--accent); }
.tx-search::placeholder { color: var(--text-3); }

.tx-main { flex: 1; min-width: 0; overflow-y: auto; }

.tx-sticky-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); padding: 32px 32px 20px;
  border-bottom: 1px solid var(--border);
}
.tx-sticky-header h1 {
  font-size: 36px; font-weight: 700; letter-spacing: -0.8px;
  color: var(--text); margin: 0;
}
.tx-subtitle { font-size: 14px; color: var(--text-3); margin-top: 4px; }

.tx-controls {
  display: flex; align-items: center; gap: 16px; margin-top: 16px;
}

.tx-tabs {
  display: flex; gap: 6px;
}

.tx-tab {
  border: none; background: var(--surface-2); color: var(--text-2);
  padding: 6px 14px; border-radius: 6px; font-size: 13px;
  font-weight: 500; cursor: pointer; font-family: var(--font);
  transition: all 0.15s; white-space: nowrap;
}

.tx-tab:hover { background: rgba(128,128,128,0.15); color: var(--text); }

.tx-tab.active {
  background: var(--accent); color: #fff; font-weight: 600;
}

.tx-controls .tx-search {
  margin: 0; width: 250px; margin-left: auto;
}

.tx-content { padding: 24px 32px 80px; max-width: 960px; margin: 0 auto; }

.tree { margin-top: 8px; }
.node { border-bottom: 1px solid rgba(44,44,46,0.3); }
.node-row { display: flex; align-items: center; padding: 5px 0; cursor: pointer; }
.node-row:hover { background: rgba(255,255,255,0.02); }

.node-indent { flex-shrink: 0; }
.node-toggle { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--text-3); flex-shrink: 0; cursor: pointer; }
.node-toggle.leaf { visibility: hidden; }

.node-name { font-size: 13px; font-weight: 500; flex: 1; }
.node-name .cls-tag { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-right: 6px; }

.node-count { font-size: 12px; font-family: var(--mono); color: var(--text-2); min-width: 70px; text-align: right; }
.node-bar { width: 120px; height: 12px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin-left: 10px; flex-shrink: 0; }
.node-bar-fill { height: 100%; border-radius: 2px; }

.depth-0 .node-name { font-weight: 700; font-size: 14px; }
.depth-1 .node-name { font-weight: 600; }

.collapsed .children { display: none; }
.expanded .node-toggle::after { content: '\25BE'; }
.collapsed .node-toggle::after { content: '\25B8'; }

.totals { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; display: flex; gap: 24px; align-items: center; }
.totals .t-num { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.totals .t-label { font-size: 12px; color: var(--text-3); }

.info { font-size: 12px; color: var(--text-3); }

/* ═══ LIGHT THEME OVERRIDES for hardcoded colors ═══ */
[data-theme="light"] .sidebar { background: var(--surface); box-shadow: 0 2px 20px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04) inset; }
[data-theme="light"] .sidebar::after { opacity: 0.35; }
[data-theme="light"] .sidebar a:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .sidebar a.active { background: rgba(0,122,255,0.1); color: var(--accent); }
[data-theme="light"] .header h1 { color: var(--text); }
[data-theme="light"] .step:hover { border-color: #d1d1d6; }
[data-theme="light"] .step.active { background: rgba(0,122,255,0.04); }
[data-theme="light"] .cl-topbar, [data-theme="light"] .dg-topbar, [data-theme="light"] .tx-topbar { background: var(--surface); border-bottom-color: var(--border); }
[data-theme="light"] .cl-topbar h2, [data-theme="light"] .dg-topbar h2, [data-theme="light"] .tx-topbar h2 { color: var(--text); }
[data-theme="light"] .cl-topbar .info, [data-theme="light"] .dg-topbar .info { color: var(--text-3); }
[data-theme="light"] .cl-topbar .info kbd, [data-theme="light"] .dg-topbar .info kbd { background: var(--surface-2); border-color: var(--border); }
[data-theme="light"] .col { background: var(--bg); }
[data-theme="light"] .col-head { background: var(--surface); border-bottom-color: var(--border); }
[data-theme="light"] .col-head .col-sub { color: var(--text-3); }
[data-theme="light"] .cl-dashboard { gap: 1px; background: var(--border); }
[data-theme="light"] .col-more button { background: var(--surface); border-color: var(--border); color: var(--text-2); }
[data-theme="light"] .col-more button:hover { background: var(--surface-2); color: var(--text); }
[data-theme="light"] .filter-btn { background: var(--surface); border-color: var(--border); color: var(--text-2); }
[data-theme="light"] .filter-btn:hover { background: var(--surface-2); color: var(--text); }
[data-theme="light"] .filter-btn.active { background: rgba(0,122,255,0.08); border-color: var(--accent); color: var(--accent); }
[data-theme="light"] .dg-card { background: var(--surface); }
[data-theme="light"] .lb { background: rgba(0,0,0,0.7); }
[data-theme="light"] .lb-panel { background: var(--surface); border-top-color: var(--border); }
[data-theme="light"] .lb-file { color: var(--text); }
[data-theme="light"] .lb-file .lb-sub { color: var(--text-3); }
[data-theme="light"] .lb-close { background: var(--surface-2); color: var(--text-2); }
[data-theme="light"] .lb-lbl { background: var(--bg); }
[data-theme="light"] .lb-lbl:hover { border-color: var(--border); }
[data-theme="light"] .lb-undo { background: var(--surface-2); color: var(--text); }
[data-theme="light"] .lb-sig { background: var(--bg); }
[data-theme="light"] .lb-sig .sig-name { color: var(--text-3); }
[data-theme="light"] .lb-sig .sig-detail { color: var(--text-3); }
[data-theme="light"] .lb-sig .sig-tag { background: var(--surface-2); color: var(--text-2); }
[data-theme="light"] .refresh-bar { background: var(--surface); border-top-color: var(--border); }
[data-theme="light"] .refresh-bar button { background: var(--surface-2); border-color: var(--border); color: var(--text); }
[data-theme="light"] .refresh-bar button:hover { background: var(--border); }
[data-theme="light"] .load-more button { background: var(--surface); border-color: var(--border); color: var(--text-2); }
[data-theme="light"] .load-more button:hover { background: var(--surface-2); color: var(--text); }
[data-theme="light"] .loading-text { color: var(--text-3); }

/* DB view — collapsible sections */
.db-section-toggle { display: flex; align-items: center; gap: 6px; }
.db-section-toggle:hover { color: var(--text-2); }
.db-chevron { font-size: 10px; color: var(--text-3); transition: transform 0.15s; }

/* Taxonomy class cards */
.tx-class-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.tx-class-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; transition: background 0.15s; }
.tx-class-header:hover { background: rgba(128,128,128,0.06); }
.tx-cls-chevron { font-size: 10px; color: var(--text-3); width: 14px; text-align: center; flex-shrink: 0; }
.tx-class-body { border-top: 1px solid var(--border); }
.tx-sub-row { display: flex; align-items: center; gap: 8px; padding: 7px 14px; cursor: default; transition: background 0.15s; }
.tx-has-children .tx-sub-row { cursor: pointer; }
.tx-sub-row:hover { background: rgba(128,128,128,0.04); }

/* ═══ 10cby CLEANING VIEW ═══ */
.c10-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); padding: 32px 24px 20px;
  border-bottom: 1px solid var(--border);
  max-width: 100%; margin: 0 auto;
}

.c10-header-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.c10-header-top h1 {
  font-size: 36px; font-weight: 700; letter-spacing: -0.8px;
  color: var(--text); margin: 0;
}

.c10-header-actions {
  display: flex; align-items: center; gap: 12px;
}

.c10-batch-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); padding: 6px 14px; border-radius: 6px;
  font-size: 13px; cursor: pointer; font-weight: 500;
  transition: all 0.15s; font-family: var(--font);
}

.c10-batch-btn:hover { background: rgba(128,128,128,0.15); color: var(--text); }
.c10-batch-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.c10-count {
  font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums;
}

.c10-header-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.c10-tabs { display: flex; gap: 6px; }

.c10-tab {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); padding: 6px 14px; border-radius: 6px;
  font-size: 13px; cursor: pointer; font-weight: 500;
  transition: all 0.15s; font-family: var(--font);
}

.c10-tab:hover { background: rgba(128,128,128,0.08); color: var(--text); }

.c10-tab.active {
  border-color: var(--tab-color, var(--accent));
  color: var(--tab-color, var(--accent));
  background: rgba(10,132,255,0.08);
  font-weight: 600;
}

.c10-shortcuts {
  font-size: 12px; color: var(--text-3);
  display: flex; align-items: center; gap: 12px;
}

.c10-shortcuts kbd {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px; font-size: 11px;
  color: var(--text-2); font-family: var(--mono);
}

.c10-body { padding: 8px; overflow-y: auto; height: calc(100vh - 150px); }
.c10-body .col-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

.thumb-badges { position: absolute; bottom: 3px; left: 3px; display: flex; gap: 2px; align-items: flex-end; }
.mini-badge { font-size: 8px; font-weight: 800; padding: 1px 3px; border-radius: 2px; line-height: 12px; background: rgba(0,0,0,0.7); }
.mini-badge.mb-xx { color: #f88; }
.mini-badge.mb-x { color: #fa0; }
.mini-badge.mb-safe { color: #8c8; }
.susp-score { position: absolute; top: 3px; right: 3px; font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 3px; background: rgba(0,0,0,0.7); color: #fff; font-variant-numeric: tabular-nums; }

.thumb.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.sel-check { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,0.6); border: 1.5px solid #888; color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.thumb.selected .sel-check { background: var(--accent); border-color: var(--accent); }

.c10-batch-bar { position: fixed; bottom: 0; left: 0; right: 0; background: #111; border-top: 1px solid #333; padding: 10px 20px; display: flex; align-items: center; gap: 8px; z-index: 90; }
.batch-count { font-size: 13px; font-weight: 600; color: var(--accent); margin-right: 8px; }
.batch-btn { background: #1a1a1a; border: 1px solid #333; color: #aaa; padding: 6px 14px; border-radius: 6px; font-size: 12px; cursor: pointer; font-weight: 600; }
.batch-btn:hover { background: #252525; color: #fff; }
.batch-btn.c0 { color: var(--green); }
.batch-btn.c1 { color: var(--orange); }
.batch-btn.c2 { color: var(--pink); }
.batch-cancel { color: var(--text-3); }

[data-theme="light"] .c10-tab { background: var(--surface); border-color: var(--border); color: var(--text-2); }
[data-theme="light"] .c10-tab:hover { background: var(--surface-2); color: var(--text); }
[data-theme="light"] .c10-btn { background: var(--surface); border-color: var(--border); color: var(--text-2); }
[data-theme="light"] .c10-btn:hover { background: var(--surface-2); color: var(--text); }
[data-theme="light"] .c10-batch-bar { background: var(--surface); border-top-color: var(--border); }
[data-theme="light"] .batch-btn { background: var(--bg); border-color: var(--border); color: var(--text-2); }

/* ═══ RESPONSIVE ADJUSTMENTS ═══ */
@media (max-width: 1400px) {
  #content { padding: 0 24px; }
  .sv-container { max-width: 1000px; }
}

@media (max-width: 1200px) {
  #content { padding: 0 20px; }
  .sv-container { max-width: 900px; }
  .signal-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
}

@media (max-width: 960px) {
  #content { padding: 0 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .signal-grid { grid-template-columns: 1fr; }
  .sv-container { padding: 32px 0 60px; }
}

@media (max-width: 640px) {
  #content { padding: 0 12px; }
  .grid-3 { grid-template-columns: 1fr; }
  .header h1 { font-size: 28px; }
  .sv-container { padding: 24px 0 50px; }
  .step { grid-template-columns: 24px 1fr auto; padding: 12px; }
  .step-icon { width: 24px; height: 24px; font-size: 11px; }
  .card { padding: 14px; }
}

/* ═══ CLEANING VIEW - ELEVATED CARDS ═══ */
.cleaning-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.cleaning-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.cleaning-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.16), 0 4px 8px rgba(0,0,0,0.12);
}

.cleaning-card-header {
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.cleaning-icon {
  font-size: 48px;
  margin-bottom: 12px;
  font-weight: 300;
  line-height: 1;
}

.cleaning-card-header h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0;
}

.cleaning-card-body {
  padding: 24px 20px;
}

.cleaning-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: center;
}

.cleaning-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.cleaning-stat {
  text-align: center;
}

.cleaning-stat-num {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin-bottom: 4px;
}

.cleaning-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
}

.cleaning-card-footer {
  padding: 16px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

.cleaning-action {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  font-style: italic;
}

@media (max-width: 1200px) {
  .cleaning-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ═══ CLEANING COLUMNS - CARD LAYOUT ═══ */
.cleaning-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.cleaning-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cleaning-column:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.16), 0 4px 8px rgba(0,0,0,0.12);
}

.cleaning-column-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.cleaning-column-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px 0;
  letter-spacing: -0.3px;
}

.cleaning-column-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
}

.cleaning-column-body {
  flex: 1;
  overflow-y: auto;
  max-height: 600px;
}

.cleaning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
  padding: 12px;
}

.cleaning-grid .thumb {
  aspect-ratio: 1;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cleaning-grid .thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10;
}

.cleaning-grid .thumb.fallback {
  opacity: 0.6;
  cursor: default;
}

.cleaning-grid .thumb.fallback:hover {
  transform: none;
  box-shadow: none;
}

.cleaning-grid .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cleaning-column-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.load-more-btn {
  width: 100%;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.load-more-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

@media (max-width: 1200px) {
  .cleaning-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cleaning-column-body {
    max-height: 400px;
  }
}

/* ═══ DESIGN SYSTEM VIEW ═══ */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.ds-grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.ds-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.ds-color-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ds-color-card:hover {
  border-color: #3a3a3c;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ds-color-swatch {
  width: 100%;
  height: 60px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}

.ds-color-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.ds-color-var {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-3);
  margin-bottom: 2px;
}

.ds-color-hex {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text-2);
}

.ds-type-sample {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.ds-type-sample:last-child {
  border-bottom: none;
}

.ds-type-spec {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-3);
  margin-top: 4px;
}

.ds-component-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.ds-component-row:last-child {
  border-bottom: none;
}

.ds-spec {
  flex: 1;
}

.ds-code {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
  display: inline-block;
}

.ds-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.ds-badge-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.ds-spacing-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}

.ds-spacing-row:last-child {
  border-bottom: none;
}

.ds-spacing-box {
  height: 24px;
  background: var(--surface-2);
  border-radius: 3px;
  border: 1px solid var(--border);
}

.ds-radius-demo {
  width: 100%;
  height: 80px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--orange) 100%);
  opacity: 0.7;
  margin-bottom: 8px;
}

/* Button component styles (for design system docs) */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #0077ed;
  box-shadow: 0 4px 12px rgba(10,132,255,0.3);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: #3a3a3c;
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: rgba(128,128,128,0.08);
  color: var(--text);
}

.btn-danger {
  background: var(--pink);
  color: #fff;
}

.btn-danger:hover {
  background: #ff2050;
  box-shadow: 0 4px 12px rgba(255,55,95,0.3);
}
