:root{
  --bg:#14161a;
  --panel:#181b20;
  --panel-2:#1b2026;
  --border:#2a2f37;
  --ink:#eaf0f6;
  --ink-2:#c7d0db;
  --ink-3:#9aa4b5;
  --muted:#7f8a99;
  --primary:#650223;
  --primary-ink:#ffffff;
  --focus: 0 0 0 2px rgba(101,2,35,.55), 0 0 0 1px #650223 inset;
  --radius:14px;
  --btn-radius:12px;
  --chip-radius:999px;
  --container-max-width:1200px;
  --container-padding:20px;

  /* Approach colors */
  --dom-text:#8ab4f8;     /* blue */
  --dom-company:#c58af9;  /* purple */
  --dom-unspsc:#34d399;   /* green */
  --dom-sic:#f472b6;      /* pink */
  --dom-composite:#22d3ee;/* cyan */
  --dom-bm25:#fb923c;     /* orange */
  --dom-dense:#a78bfa;    /* violet */
  --dom-phrase:#fbbf24;   /* amber/gold */
}

*{ box-sizing:border-box }
html,body{ height:100% }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink-2);
  font:15px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
a{ color:#cbd5ff; text-decoration:none }
a:hover{ text-decoration:underline }
.hidden{ display:none !important; }

/* Hide placeholder option in dropdowns (shown as default but not selectable) */
#asset-type-select option.placeholder-option { display: none; }

/* Containers */
.container{
  max-width:var(--container-max-width);
  margin:0 auto;
  padding:var(--container-padding);
}
.container-wide{
  max-width:1400px;
  margin:0 auto;
  padding:20px;
}
@media (min-width:1680px){
  .container-wide{ max-width:1560px; }
}

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:0 1px 0 rgba(255,255,255,0.02) inset;
  padding:14px;
}
.muted{ color:var(--muted) }
.title{ color:var(--ink); font-weight:800 }

input[type="text"], input[type="number"], input[type="email"],
input[type="password"], input[type="search"], input[type="tel"],
input[type="url"], select{
  width:100%;
  padding:10px 12px;
  background:var(--panel-2);
  color:var(--ink);
  border:1px solid var(--border);
  border-radius:12px;
  outline:none;
  font-size:16px; /* ≥16px prevents auto-zoom on mobile (iOS + Android) */
}
input:focus, select:focus{ box-shadow:var(--focus) }

/* Custom dropdown styling */
.custom-select-wrapper{
  position:relative;
  width:100%;
}
.custom-select-button{
  width:100%;
  padding:10px 12px;
  background:var(--panel-2);
  color:var(--ink);
  border:1px solid var(--border);
  border-radius:12px;
  outline:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.custom-select-button:focus{ box-shadow:var(--focus) }
.custom-select-button::after{
  content:'▼';
  font-size:10px;
  color:var(--muted);
  transition:transform 0.2s;
}
.custom-select-wrapper.open .custom-select-button::after{
  transform:rotate(180deg);
}
.custom-select-dropdown{
  position:absolute;
  top:100%;
  left:0;
  right:0;
  z-index:100;
  margin-top:6px;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:0 8px 24px rgba(0,0,0,.35);
  max-height:240px;
  overflow:auto;
  display:none;
}
.custom-select-wrapper.open .custom-select-dropdown{
  display:block;
}
.custom-select-option{
  padding:10px 12px;
  cursor:pointer;
  color:var(--ink);
  transition:background 0.15s, color 0.15s;
}
.custom-select-option:hover,
.custom-select-option.highlighted{
  background:var(--primary);
  color:var(--primary-ink);
}
.custom-select-option.selected{
  background:var(--panel-2);
  color:var(--ink);
  font-weight:600;
}

button, a.btn{
  display:inline-block;
  padding:10px 14px;
  border:0;
  border-radius:var(--btn-radius);
  background:var(--primary);
  color:var(--primary-ink) !important;
  cursor:pointer;
  font-weight:700;
}
button:hover, a.btn:hover{ filter:brightness(1.05) }
button:focus, a.btn:focus{ outline:none; box-shadow:var(--focus) }
.btn-outline{
  background:transparent;
  color:var(--ink) !important;
  border:1px solid var(--primary);
}

/* Disabled buttons/links */
.btn[disabled], .btn-outline.disabled{
  opacity:.55;
  cursor:not-allowed;
  pointer-events:none;
}

.row{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:10px;
}
.col-12{ grid-column: span 12 }

/* ===== Top Bar ===== */
/* ===== Top Bar ===== */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:linear-gradient(180deg, rgba(20,22,26,0.96), rgba(20,22,26,0.90));
  backdrop-filter: blur(6px);
  border-bottom:1px solid var(--border);
}

/* 3 columns: [left side] [centered content] [right side] */
.topbar-shell{
  display:grid;
  /* Use symmetric columns to center the search bar on all screen sizes */
  grid-template-columns: 1fr minmax(0, var(--container-max-width)) 1fr;
  align-items:flex-start;
  column-gap:16px;
  padding:8px 18px;
}

.topbar-left{
  grid-column:1;
  justify-self:start;
  align-self:flex-start;
  min-width:0;
  flex-shrink:0;
  display:flex;
  gap:8px;
  flex-wrap:nowrap;
}

.top-nav-btn{
  border-radius: 8px;
}

.top-nav-btn-current{
  display: inline-block;
  background: var(--bg) !important;
  color: var(--ink-2) !important;
  border: 2px solid var(--primary) !important;
  border-radius: 8px;
  cursor: default;
}

.topbar-center{
  grid-column:2;
  min-width:0;
  position:static; /* override previous relative if needed */
}

/* Center content stays centered inside the middle track */
.topbar-center-inner{
  max-width:100%;
  width:100%;
  padding-left:var(--container-padding);
  padding-right:var(--container-padding);
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:0 auto;        /* keep it centered by default */
  position:static;
  left:auto;
}
/* Center block is now properly centered via symmetric grid columns */
@media (min-width: 900px){
  .topbar-center-inner{
    margin-left: auto;
    margin-right: auto;
  }
}

.topbar-right{
  grid-column:3;
  justify-self:flex-end;
  align-self:flex-start;
}

/* For 1080p and similar resolutions (900px-1600px), constrain center to prevent overlap */
@media (min-width: 901px) and (max-width: 1600px){
  .topbar-shell{
    /* Reduce center max-width to give more room to left/right columns */
    grid-template-columns: minmax(160px, 1fr) minmax(0, 900px) minmax(160px, 1fr);
  }
}

/* For very wide screens (4K etc), ensure proper centering with full width center */
@media (min-width: 1601px){
  .topbar-shell{
    grid-template-columns: 1fr minmax(0, var(--container-max-width)) 1fr;
  }
}

/* ===== Laptop resolution adjustments (1366–1720px) ===== */
/* Use content-sized side columns so they never overflow */

/* ~1680x1050 and similar */
@media (min-width: 901px) and (max-width: 1720px) {
  .topbar-shell {
    grid-template-columns: auto 1fr auto;
    column-gap: 10px;
    padding: 6px 14px;
  }
  .top-nav-btn {
    padding: 8px 14px !important;
    font-size: 13px !important;
  }
  .top-nav-btn-current {
    padding: 8px 14px !important;
    font-size: 13px !important;
  }
  .top-project-card {
    min-width: 290px;
    padding: 6px 8px;
  }
  .top-account-link {
    font-size: 12px;
    max-width: 16ch;
  }
  .top-budget {
    font-size: 12px;
  }
  .top-logout-btn {
    padding: 5px 8px;
    font-size: 12px;
  }
}

/* ~1440x900 and similar */
@media (min-width: 901px) and (max-width: 1480px) {
  .topbar-shell {
    column-gap: 8px;
    padding: 5px 10px;
  }
  .top-nav-btn {
    padding: 7px 10px !important;
    font-size: 12px !important;
  }
  .top-nav-btn-current {
    padding: 7px 10px !important;
    font-size: 12px !important;
  }
  .top-project-card {
    min-width: 240px;
  }
  .top-account-link {
    max-width: 14ch;
  }
  .search-buttons-left button {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* ~1366x768 and similar */
@media (min-width: 901px) and (max-width: 1400px) {
  .topbar-shell {
    column-gap: 6px;
    padding: 4px 8px;
  }
  .top-nav-btn {
    padding: 6px 8px !important;
    font-size: 11px !important;
  }
  .top-nav-btn-current {
    padding: 6px 8px !important;
    font-size: 11px !important;
  }
  .top-project-card {
    min-width: 210px;
  }
  .top-account-link {
    max-width: 12ch;
    font-size: 11px;
  }
  .top-budget {
    font-size: 11px;
  }
  .top-logout-btn {
    padding: 4px 6px;
    font-size: 11px;
  }
  .search-input {
    min-width: 180px;
  }
  .search-buttons-left button {
    padding: 6px 8px;
    font-size: 11px;
  }
}

/* Responsive stacking unchanged, just make sure it doesn't fight the grid */
@media (max-width: 900px){
  .topbar-shell{
    grid-template-columns:1fr;
    row-gap:8px;
  }
  .topbar-left{
    order:1;
    justify-self:flex-start;
  }
  .topbar-center{
    order:2;
    justify-self:stretch;
  }
  .topbar-right{
    order:3;
    justify-self:flex-end;
  }
  /* Prevent mobile browsers from zooming on input focus (requires font-size >= 16px) */
  .negative-search-input{ font-size:16px !important; }
}
.job-card .right{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.job-card .right-top{
  display: flex;
  flex-direction: row;
  gap: 6px;       /* spacing between PDF / XLSX / CSV */
}

.results-count{
  font-size: 11px;
  color: var(--muted);
}

/* Search form in the center */
.topbar-center-inner form{
  display:flex;
  flex-direction:column;
  gap:6px;
  width:100%;
}
.search-form-row{
  display:flex;
  flex-direction:column;
  gap:8px;
  width:100%;
}
.search-input-group{
  display:flex;
  gap:8px;
  align-items:center;
  width:100%;
}
.search-input{
  flex:1;
  min-width:260px;
}
.search-buttons-group{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  width:100%;
  justify-content:space-between;
}
.search-buttons-left{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
/* Negative search input (smaller, in filters group) */
.negative-search-wrapper{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:200px;
  max-width:320px;
}
.negative-search-label{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}
.negative-search-input{
  flex:1;
  padding:6px 10px !important;
  font-size:13px !important;
  min-width:120px;
}

/* Negative chip styling */
.chip.chip-negative{
  background:rgba(239, 68, 68, 0.15);
  border-color:rgba(239, 68, 68, 0.4);
  color:#fca5a5;
}
.chip.chip-negative .x{
  color:#f87171;
}
.chip.chip-negative .x:hover{
  color:#ef4444;
}

/* Filters + chips */
.filters-group{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  width:100%;
}
.filters-group .control{ min-width:160px; }
.filters-group .control.narrow{
  min-width:120px;
  max-width:150px;
}
.filters-actions{
  display:flex;
  gap:8px;
  align-items:center;
  margin-left:auto;
}
.filters-actions button{
  min-width:130px;
}

/* Chips live under the search in the topbar */
.chips{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  padding-top:4px;
}
.chip{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding:6px 10px;
  background:var(--panel-2);
  border:1px solid var(--border);
  border-radius:var(--chip-radius);
  font-size:13px;
  color:var(--ink);
}
.chip .x{
  cursor:pointer;
  color:var(--muted);
}

/* Project card (top right) */
.top-project-card{
  padding:8px 10px;
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:340px; /* slightly wider to avoid 4-line stacking */
}
.top-project-row{
  display:flex;
  align-items:center;
  gap:8px;
}
.top-project-row-1{
  justify-content:space-between;
}
.top-project-row-2{
  justify-content:flex-end;
  gap:10px;
  flex-wrap:nowrap;
  display:flex;
  align-items:center;
}
#project-pill{
  flex:1;
  min-width:0;
  display:flex;
  align-items:center;
  gap:6px;
}
#project-pill select{
  flex:1;
  min-width:0;
}
.top-account-link,
.top-imprint-link{
  font-size:13px;
  color:var(--ink-2);
  text-decoration:none;
}
.top-account-link{
  max-width:20ch; /* Limit to 20 characters */
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.top-account-link:hover,
.top-imprint-link:hover{
  color:var(--ink);
  text-decoration:none;
}
.top-budget{
  font-size:13px;
  color:var(--ink-2);
}
.top-logout-form{
  margin:0;
}
.top-logout-btn{
  padding:6px 10px;
  font-size:13px;
}

/* Responsive stacking */
@media (max-width: 900px){
  .topbar-shell{
    grid-template-columns:1fr;
    row-gap:8px;
  }
  .topbar-left{
    order:1;
  }
  .topbar-center{
    order:2;
  }
  .topbar-right{
    order:3;
    justify-self:flex-end;
  }
}

@media (max-width: 600px){
  .top-project-card{
    min-width:0;
  }
  .top-project-row-2{
    flex-wrap:wrap;
  }
}

/* Landing (unchanged) */
.landing-wrap{
  min-height:calc(100vh - 120px);
  display:grid;
  place-items:center;
  padding:28px;
}
.landing{
  width:min(820px, 96vw);
  display:flex;
  flex-direction:column;
  gap:14px;
}
.landing .big-input{
  height:64px;
  font-size:18px;
  padding:0 16px;
}
.landing .row-btns{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

/* Results list */
.result{
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.score{
  min-width:74px;
  text-align:center;
  background:var(--panel-2);
  border:1px solid var(--border);
  border-radius:12px;
  padding:8px 6px;
  color:var(--ink);
  font-weight:700;
}
.pill{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  background:var(--panel-2);
  border:1px solid var(--border);
  color:var(--ink-2);
  font-size:12px;
  margin-right:6px;
  /* Allow UNSPSC codes to break at natural boundaries (like dots) after 150 characters */
  max-width:150ch;
  overflow-wrap:break-word;
  word-break:normal;
}
.pill-royalty{
  padding:10px 18px;
  font-size:22px;
  font-weight:700;
  background:var(--panel-2);
  color:var(--ink);
  border:2px solid var(--border);
}
.pill-sic,
.pill-unspsc{
  cursor:help;
  position:relative;
}
.result-metadata{
  min-width:240px;
  flex-shrink:0;
}
.snippet{
  color:var(--ink-2);
  font-size:13px;
}

.details-empty{
  width:100%;
  display:block;
  padding:8px 0;
  min-height:84px;
}
.details-empty .reveal-row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  width:100%;
}

/* Autocomplete */
.ac-wrap{ position: relative; }
.ac-menu{
  position:absolute;
  z-index:10;
  top:100%; left:0; right:0;
  border:1px solid var(--border);
  background:var(--panel);
  border-radius:10px;
  margin-top:6px;
  max-height:230px;
  overflow:auto;
  box-shadow:0 8px 24px rgba(0,0,0,.35);
  display:none;
}
.ac-item{
  padding:10px;
  cursor:pointer;
}
.ac-item:hover,
.ac-item.active{
  background:var(--panel-2);
}

/* Unified taxonomy modal */
.tax-modal{
  position:fixed;
  inset:0;
  z-index:100;
  display:none;
}
.tax-modal.show{
  display:grid;
  place-items:center;
}
.tax-modal .backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
}
.tax-modal .panel{
  position:relative;
  z-index:1;
  width:min(980px, 96vw);
  max-height:86vh;
  overflow:hidden;
  background:var(--panel);
  color:var(--ink);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 24px 80px rgba(0,0,0,.45);
  padding:16px 18px;
  display:flex;
  flex-direction:column;
  animation: modal-in 240ms cubic-bezier(.16,.84,.44,1);
}
@keyframes modal-in{
  from{ transform:scale(.97); opacity:0 }
  to{ transform:scale(1); opacity:1 }
}
.tax-modal .head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.tax-modal .title{
  font-weight:800;
  font-size:18px;
}
.tax-modal .crumbs{
  color:var(--muted);
  font-size:13px;
  margin-top:4px;
}
.tax-modal .crumbs .pill{ margin-right:6px; }
.tax-modal .close{
  background:transparent;
  border:1px solid var(--border);
  color:var(--ink-2) !important;
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
}
.tax-modal .controls{
  margin:10px 0 6px;
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.tax-modal .list{
  border:1px solid var(--border);
  border-radius:12px;
  padding:8px;
  background:var(--panel-2);
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap:8px;
  overflow:auto;
  min-height:260px;
  max-height:50vh;
}
.tax-modal .opt{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.tax-modal .opt:hover{ background:#1b2026; }
.tax-modal .code{
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:12px;
  color:var(--muted);
}
.tax-modal .opt .title{
  font-weight:600;
  font-size:14px;
  color:var(--ink);
}
.tax-modal .foot{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  margin-top:10px;
  flex-wrap:wrap;
}
.seg{
  display:inline-flex;
  background:var(--panel-2);
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
}
.seg button{
  background:transparent;
  color:var(--ink-2);
  border:0;
  padding:8px 12px;
  cursor:pointer;
}
.seg button.active{
  background:var(--primary);
  color:var(--primary-ink);
}
#load-indicator{
  text-align:center;
  padding:12px 0;
}

/* Taxonomy circle packing */
.tax-modal .circle-wrap{
  border:1px solid var(--border);
  border-radius:12px;
  padding:0;
  background:var(--panel-2);
  min-height:260px;
  max-height:50vh;
  overflow:hidden;
}
.tax-modal .circle-wrap svg{
  width:100%;
  height:100%;
  display:block;
}
.tax-circle-node{
  fill:var(--panel);
  stroke:var(--border);
  stroke-width:1.2;
  transition: stroke 0.15s ease, transform 0.15s ease;
}
.tax-circle-node:hover{ stroke:#cbd5ff; }
.tax-circle-label{
  font-size:11px;
  fill:var(--ink-2);
  pointer-events:none;
}
.tax-circle-label.small{ font-size:10px; }

/* Fullscreen circle explorer */
.tax-modal.fullscreen .panel{
  width: min(1600px, 98vw);
  max-height: 96vh;
}
.tax-modal.fullscreen .circle-wrap{
  flex: 1;
  min-height: 480px;
  max-height: none;
}

/* Results & approaches styling */
.result[data-dominant]{
  border-left:4px solid var(--border);
  padding-left:10px;
}
.result[data-dominant="text"]      { border-left-color: var(--dom-text); }
.result[data-dominant="company"]   { border-left-color: var(--dom-company); }
.result[data-dominant="unspsc"]    { border-left-color: var(--dom-unspsc); }
.result[data-dominant="sic"]       { border-left-color: var(--dom-sic); }
.result[data-dominant="composite"] { border-left-color: var(--dom-composite); }
.result[data-dominant="bm25"]      { border-left-color: var(--dom-bm25); }
.result[data-dominant="dense"]     { border-left-color: var(--dom-dense); }
.result[data-dominant="phrase"]    { border-left-color: var(--dom-phrase); }

.result[data-dominant="text"] .score{
  border-color: rgba(138,180,248,.45);
  box-shadow: inset 0 0 0 1px rgba(138,180,248,.25);
}
.result[data-dominant="company"] .score{
  border-color: rgba(197,138,249,.45);
  box-shadow: inset 0 0 0 1px rgba(197,138,249,.25);
}
.result[data-dominant="unspsc"] .score{
  border-color: rgba(52,211,153,.45);
  box-shadow: inset 0 0 0 1px rgba(52,211,153,.25);
}
.result[data-dominant="sic"] .score{
  border-color: rgba(244,114,182,.45);
  box-shadow: inset 0 0 0 1px rgba(244,114,182,.25);
}
.result[data-dominant="composite"] .score{
  border-color: rgba(34,211,238,.45);
  box-shadow: inset 0 0 0 1px rgba(34,211,238,.25);
}
.result[data-dominant="bm25"] .score{
  border-color: rgba(251,146,60,.45);
  box-shadow: inset 0 0 0 1px rgba(251,146,60,.25);
}
.result[data-dominant="dense"] .score{
  border-color: rgba(167,139,250,.45);
  box-shadow: inset 0 0 0 1px rgba(167,139,250,.25);
}

.approach-row{
  display:flex;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
  margin:6px 0 2px;
}
.approach-label{
  font-size:12px;
  color:var(--muted);
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--panel-2);
  color:var(--ink-2);
}
.badge .dot{
  width:8px;
  height:8px;
  border-radius:50%;
  display:inline-block;
}
.badge.text      { border-color: rgba(138,180,248,.45); }
.badge.company   { border-color: rgba(197,138,249,.45); }
.badge.unspsc    { border-color: rgba(52,211,153,.45); }
.badge.sic       { border-color: rgba(244,114,182,.45); }
.badge.composite { border-color: rgba(34,211,238,.45); }
.badge.bm25      { border-color: rgba(251,146,60,.45); }
.badge.dense     { border-color: rgba(167,139,250,.45); }
.badge.phrase    { border-color: rgba(251,191,36,.45); }
.badge.text .dot      { background: var(--dom-text); }
.badge.company .dot   { background: var(--dom-company); }
.badge.unspsc .dot    { background: var(--dom-unspsc); }
.badge.sic .dot       { background: var(--dom-sic); }
.badge.composite .dot { background: var(--dom-composite); }
.badge.bm25 .dot      { background: var(--dom-bm25); }
.badge.dense .dot     { background: var(--dom-dense); }
.badge.phrase .dot    { background: var(--dom-phrase); }
.badge.dominant{
  background: transparent;
  box-shadow: 0 0 0 1px currentColor inset;
}
.clickable-badge{
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.clickable-badge:hover{ opacity: 0.8; }

.legend-item.unused{ opacity: 0.3; }

.legend{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin:6px 0 10px;
}
.legend-item{
  display:inline-flex;
  gap:6px;
  align-items:center;
  font-size:12px;
  color:var(--muted);
  cursor: help;
  position: relative;
}
.legend-item:hover{
  color:var(--ink);
}
.legend-item .warning-icon{
  font-size:14px;
  margin-left:2px;
  color:#f59e0b;
}
.legend-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
}
.color-text      { background: var(--dom-text); }
.color-company   { background: var(--dom-company); }
.color-unspsc    { background: var(--dom-unspsc); }
.color-sic       { background: var(--dom-sic); }
.color-composite { background: var(--dom-composite); }
.color-bm25      { background: var(--dom-bm25); }
.color-dense     { background: var(--dom-dense); }
.color-phrase    { background: var(--dom-phrase); }

.more-row{
  margin-top:8px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

/* AI runs / report stuff */
.job-strip{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap:12px;
}
@media (max-width: 520px){
  .job-strip{ grid-template-columns: 1fr; }
}
.job-card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  cursor:pointer;
  transition: transform .15s ease, border-color .2s;
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.job-card:hover{
  transform: translateY(-1px);
  border-color:#39414d;
}
.job-card .dot{
  width:8px;
  height:8px;
  border-radius:50%;
  margin-top:6px;
}
.job-card .meta{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}
.job-card .query{
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  display: box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.job-card .right{
  margin-left:auto;
  display:flex;
  gap:6px;
  align-items:center;
}
.icon-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  font-size:11px;
  background:var(--panel-2);
  border:1px solid var(--border);
  border-radius:999px;
  text-decoration:none;
  color:var(--ink-2);
}
.icon-pill.dim{ opacity:.5 }
.icon-pill.clickable{
  cursor:pointer;
  transition:all 0.15s ease;
}
.icon-pill.clickable:hover{
  background:var(--panel);
  border-color:var(--primary);
  color:var(--ink);
  transform:translateY(-1px);
}
.status-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 8px;
  font-size:11px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--panel-2);
  color:var(--ink-2);
}
.status-queued{ border-color:#4b5563; }
.status-running{ border-color:#2563eb; }
.status-ok{ border-color:#10b981; }
.status-error{ border-color:#ef4444; }
.job-card.disabled{
  pointer-events:none;
  cursor:default;
  opacity:.65;
}

/* Report modal */
.report-modal{
  position:fixed;
  inset:0;
  z-index:120;
  display:none;
}
.report-modal.show{ display:block; }
.report-modal .modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
}
.report-modal .modal-card{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(1200px, 92vw);
  height:min(88vh, 940px);
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:16px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  box-shadow:0 24px 80px rgba(0,0,0,.45);
}
.report-modal .modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#171a1f,#16191e);
}
.report-modal .modal-title{
  display:flex;
  gap:8px;
  align-items:center;
  min-width:0;
}
.report-modal .truncate{
  max-width:56vw;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--ink);
  font-weight:800;
}
.report-modal .actions{
  display:flex;
  gap:8px;
  align-items:center;
}
.icon-btn{
  background:transparent;
  border:1px solid var(--border);
  color:var(--ink-2) !important;
  padding:6px 10px;
  border-radius:10px;
  cursor:pointer;
}
.icon-btn:hover{ background:var(--panel-2); }

.tabs{
  display:flex;
  gap:8px;
  padding:8px 12px;
  border-bottom:1px solid var(--border);
}
.tab{
  background:transparent;
  color:var(--ink-2)!important;
  border:1px solid var(--border);
  padding:6px 10px;
  border-radius:10px;
  cursor:pointer;
}
.tab.active{
  background:#1e2230;
  color:var(--ink)!important;
}
.tab-panels{
  position:relative;
  flex:1;
  min-height:0;
}
.panel{
  display:none;
  height:100%;
}
.panel.active{ display:block; }
#pdf-frame{
  width:100%;
  height: calc(100% - 6px);
  border:0;
}
#pdf-fallback{ padding:10px; }

.table-wrap{
  overflow:auto;
  height:100%;
}
.data-table{
  width:100%;
  border-collapse: separate;
  border-spacing:0;
  min-width:800px;
}
.data-table thead th{
  position:sticky;
  top:0;
  background:#1a1d22;
  z-index:1;
  text-align:left;
  font-weight:700;
  color:var(--ink);
  border-bottom:1px solid var(--border);
  padding:8px 10px;
}
.data-table td{
  padding:8px 10px;
  vertical-align:top;
  border-bottom:1px solid #232832;
}
.data-table td:nth-child(2),
.data-table td:nth-child(3),
.data-table td:nth-child(4){
  word-break: break-word;
  max-width: 36ch;
}

/* Toast & spinner */
.toast{
  position:fixed;
  bottom:20px;
  right:20px;
  background:var(--panel);
  border:1px solid var(--border);
  padding:12px 16px;
  border-radius:12px;
  z-index:200;
  box-shadow:0 8px 24px rgba(0,0,0,.35);
}
.spinner{
  width:14px;
  height:14px;
  border-radius:50%;
  border:2px solid var(--border);
  border-top-color: var(--ink-2);
  animation: spin .9s linear infinite;
}
@keyframes spin{
  to{ transform: rotate(360deg); }
}

/* Scrollbars */
.scroll-region{
  scrollbar-width: thin;
  scrollbar-color: #2f3743 #1a1f27;
}
.scroll-region::-webkit-scrollbar{
  width: 10px; height: 10px;
}
.scroll-region::-webkit-scrollbar-track{
  background: #1a1f27;
  border-radius: 12px;
}
.scroll-region::-webkit-scrollbar-thumb{
  background: #2f3743;
  border-radius: 12px;
  border: 2px solid #1a1f27;
}
.scroll-region::-webkit-scrollbar-thumb:hover{
  background: #3b4554;
}

/* Textarea matching inputs */
textarea.big-input{
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  padding: 10px 16px;
  outline: none;
  font-size: 16px;
}
textarea.big-input:focus{ box-shadow: var(--focus); }
.landing .big-input{
  height: 64px;
  font-size: 18px;
}

/* Circle explorer layout */
.tax2-layout {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 70vh;
}
.tax2-circles {
  flex: 1;
  width: 100%;
  min-height: 60vh;
  position: relative;
}
.tax2-side{
  display:flex;
  flex-direction:column;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--panel-2);
  padding:8px 10px;
}
.tax2-side-head{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  margin-bottom:4px;
}
.tax2-items{
  flex:1;
  overflow:auto;
}
.tax2-item-list{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.tax2-item-row{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:6px 8px;
  background:transparent;
  border-radius:10px;
  border:0;
  text-align:left;
  color:var(--ink-2);
  font-size:13px;
  cursor:pointer;
}
.tax2-item-row:hover{ background:var(--panel); }
.tax2-item-name{
  flex:1;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.tax2-item-count{
  font-weight:700;
  font-size:12px;
  opacity:0.9;
  margin-left:8px;
}
.tax2-actions{
  margin-left:auto;
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.tax2-actions #tax2-back{
  padding:6px 10px;
  font-size:13px;
}
.tax2-actions #tax2-use-level{
  padding:6px 12px;
  font-size:13px;
}

.job-card-disabled {
  opacity: 0.6;
  cursor: default;
}

/* ===== Delete Confirmation Modal ===== */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  align-items: center;
  justify-content: center;
}

.confirm-modal.show {
  display: flex;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.confirm-modal-card {
  position: relative;
  z-index: 131;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(440px, 90vw);
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.confirm-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.confirm-modal-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.confirm-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.confirm-modal-body {
  padding: 20px 24px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  padding: 16px 24px 24px;
  justify-content: center;
}

.confirm-modal-actions .btn,
.confirm-modal-actions .btn-outline {
  padding: 10px 24px;
  font-size: 14px;
  min-width: 100px;
}

/* ===== Asset Type Tabs ===== */
.results-container-with-tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tabs-legend-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: -1px;
  z-index: 2;
}

.tabs-legend-row .legend {
  margin: 0 0 8px 0;
}

.asset-type-tabs {
  display: flex;
  flex-direction: row;
  gap: 0;
  flex-shrink: 0;
}

.asset-type-tab {
  padding: 12px 24px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px 10px 0 0;
  position: relative;
}

.asset-type-tab:not(:first-child) {
  margin-left: -1px;
}

.asset-type-tab:hover:not(.active) {
  background: var(--panel);
  color: var(--ink);
}

.asset-type-tab.active {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
  z-index: 3;
}

/* Cover the gap between active tab and results area */
.asset-type-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.asset-type-tab:nth-child(1) { z-index: 3; }
.asset-type-tab:nth-child(2) { z-index: 2; }
.asset-type-tab:nth-child(3) { z-index: 1; }

.asset-type-tab .tab-text {
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.asset-type-tab .tab-count {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 6px;
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
}

.asset-type-tab.active .tab-count {
  background: rgba(0,0,0,0.25);
  color: var(--primary-ink);
}

.results-area {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 0 10px 10px 10px;
  padding: 14px;
  background: var(--panel);
  position: relative;
  z-index: 1;
}

.results-list-panel {
  min-height: 200px;
}

.results-list-panel.hidden {
  display: none;
}

/* Responsive: stack legend below tabs for smaller screens */
@media (max-width: 900px) {
  .tabs-legend-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .tabs-legend-row .legend {
    order: 2;
    margin: 8px 0;
  }

  .asset-type-tabs {
    order: 1;
    flex-wrap: wrap;
  }

  .asset-type-tab {
    padding: 10px 16px;
    font-size: 14px;
  }

  .results-area {
    border-radius: 0 10px 10px 10px;
  }
}

/* ========== Asset Type Picker Modal ========== */
.asset-type-picker-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.asset-type-picker-modal[aria-hidden="false"] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-type-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.asset-type-picker-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 56px;
  max-width: 680px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: assetPickerSlideIn 0.25s ease-out;
}

@keyframes assetPickerSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.asset-type-picker-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.asset-type-picker-close:hover {
  background: var(--border);
  border-color: var(--ink-3);
}

.asset-type-picker-header {
  text-align: center;
  margin-bottom: 36px;
}

.asset-type-picker-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.asset-type-picker-subtitle {
  font-size: 15px;
  color: var(--muted);
}

.asset-type-picker-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.asset-type-picker-btn {
  flex: 1;
  max-width: 180px;
  background: var(--panel-2);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.asset-type-picker-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(101, 2, 35, 0.3);
}

.asset-type-picker-btn:active {
  transform: translateY(-2px);
}

.asset-type-picker-btn-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.asset-type-picker-btn-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 600px) {
  .asset-type-picker-card {
    padding: 32px 24px;
  }

  .asset-type-picker-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .asset-type-picker-btn {
    max-width: none;
    padding: 20px 16px;
  }

  .asset-type-picker-title {
    font-size: 22px;
  }
}

/* History Visualization Modal */
.history-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-modal[aria-hidden="true"] {
  display: none;
}

.history-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.history-modal-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.history-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.history-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.history-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s ease;
}

.history-modal-close:hover {
  color: var(--ink);
}

.history-modal-body {
  padding: 20px;
  overflow-y: auto;
}

#history-chart-container {
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
}

#history-chart {
  display: block;
  width: 100%;
}

#history-table-container {
  overflow-x: auto;
}

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

#history-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--panel-2);
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

#history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-2);
}

#history-table tr:last-child td {
  border-bottom: none;
}

#history-table tr:hover td {
  background: var(--panel-2);
}

.history-source-link {
  color: var(--ink-3);
  font-weight: 500;
  padding: 4px 10px;
  background: rgba(127, 138, 153, 0.15);
  border-radius: 4px;
  transition: all 0.15s ease;
}

.history-source-link:hover {
  background: rgba(127, 138, 153, 0.3);
  text-decoration: none;
}

/* History Badge */
.history-badge {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.15s ease;
}

.history-badge:hover {
  background: var(--panel);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* ===== High-resolution & ultra-wide monitor adjustments ===== */

/* ~2560px wide (2560x1080 ultrawide, QHD, 4K at ~150% scaling) */
@media (min-width: 2500px) {
  :root {
    --container-max-width: 1360px;
  }
  .attribute-filter-panel {
    width: 255px;
    padding: 16px 16px 16px 18px;
  }
  .attribute-filter-title {
    font-size: 13px;
  }
  .attribute-filter-checkboxes label {
    font-size: 13px;
  }
  .attribute-filter-checkboxes.compact label {
    font-size: 12px;
  }
  .range-filter-labels {
    font-size: 11px;
  }
  .range-filter-values {
    font-size: 13px;
  }
}

/* ~3440px wide (3440x1440 ultrawide) */
@media (min-width: 3200px) {
  :root {
    --container-max-width: 1800px;
  }
  .attribute-filter-panel {
    width: 380px;
    padding: 24px 24px 24px 28px;
  }
  .attribute-filter-title {
    font-size: 17px;
    margin-bottom: 12px;
  }
  .attribute-filter-checkboxes label {
    font-size: 16px;
    gap: 10px;
    padding: 5px 0;
  }
  .attribute-filter-checkboxes.compact label {
    font-size: 14px;
    gap: 5px;
  }
  .attribute-filter-section {
    margin-bottom: 24px;
  }
  .range-filter-labels {
    font-size: 13px;
  }
  .range-filter-values {
    font-size: 16px;
  }
  .slider-thumb::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }
  .slider-thumb::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
}

/* ~3840px wide (3840x1600 ultrawide, 4K at 100% scaling) */
@media (min-width: 3700px) {
  :root {
    --container-max-width: 2100px;
  }
  .attribute-filter-panel {
    width: 440px;
    padding: 28px 28px 28px 32px;
  }
  .attribute-filter-title {
    font-size: 19px;
    margin-bottom: 14px;
  }
  .attribute-filter-checkboxes label {
    font-size: 18px;
    gap: 12px;
    padding: 6px 0;
  }
  .attribute-filter-checkboxes.compact label {
    font-size: 15px;
    gap: 6px;
  }
  .attribute-filter-section {
    margin-bottom: 28px;
  }
  .range-filter-labels {
    font-size: 14px;
  }
  .range-filter-values {
    font-size: 18px;
  }
  .slider-thumb::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
  }
  .slider-thumb::-moz-range-thumb {
    width: 22px;
    height: 22px;
  }
}

/* ===================================================================
   LIGHT MODE
   =================================================================== */

body.light {
  --bg: #eef0f4;
  --panel: #ffffff;
  --panel-2: #dfe2e8;
  --border: #c2c8d2;
  --ink: #161922;
  --ink-2: #333a48;
  --ink-3: #555e70;
  --muted: #6e7888;
  --primary: #7a0a30;
  --primary-ink: #ffffff;
  --focus: 0 0 0 2px rgba(122,10,48,.3), 0 0 0 1px #7a0a30 inset;

  /* Approach colors — deeper for white-bg contrast */
  --dom-text: #2e6bc4;
  --dom-company: #8647c4;
  --dom-unspsc: #138a3e;
  --dom-sic: #c4389a;
  --dom-composite: #077a9b;
  --dom-bm25: #d4601a;
  --dom-dense: #6a4daa;
  --dom-phrase: #b07b04;
}

/* Links */
body.light a { color: #4a5cc5; }

/* Cards & panels */
body.light .card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Top bar */
body.light .topbar {
  background: linear-gradient(180deg, rgba(238,240,244,0.97), rgba(238,240,244,0.92));
}

/* Taxonomy hover */
body.light .tax-modal .opt:hover { background: var(--panel-2); }
body.light .tax-circle-node:hover { stroke: #4a5cc5; }

/* Job cards */
body.light .job-card:hover { border-color: #c0c6d0; }

/* Report modal header */
body.light .report-modal .modal-header {
  background: linear-gradient(180deg, #e4e7ec, #dfe2e8);
}

/* Tabs */
body.light .tab.active { background: #d5d9e1; }

/* Data tables */
body.light .data-table thead th { background: #e4e7ec; }
body.light .data-table td { border-bottom: 1px solid #d2d7df; }

/* Scrollbars */
body.light .scroll-region {
  scrollbar-color: #b0b7c3 #e4e7ec;
}
body.light .scroll-region::-webkit-scrollbar-track { background: #e4e7ec; }
body.light .scroll-region::-webkit-scrollbar-thumb {
  background: #b0b7c3;
  border-color: #e4e7ec;
}
body.light .scroll-region::-webkit-scrollbar-thumb:hover { background: #959dab; }

/* Toast & dropdown shadows */
body.light .toast { box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
body.light .custom-select-dropdown { box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
body.light .ac-menu { box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

/* Negative chips */
body.light .chip.chip-negative {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}
body.light .chip.chip-negative .x { color: #dc2626; }
body.light .chip.chip-negative .x:hover { color: #b91c1c; }

/* Modal backdrops — keep dark overlays */
body.light .tax-modal .panel { box-shadow: 0 24px 80px rgba(0,0,0,0.18); }
body.light .report-modal .modal-card { box-shadow: 0 24px 80px rgba(0,0,0,0.18); }
body.light .confirm-modal-card { box-shadow: 0 20px 60px rgba(0,0,0,0.18); }
body.light .asset-type-picker-card { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.18); }
body.light .history-modal-panel { box-shadow: 0 20px 50px rgba(0,0,0,0.18); }

/* Asset type picker hover */
body.light .asset-type-picker-btn:hover {
  box-shadow: 0 8px 20px rgba(122, 10, 48, 0.15);
}

/* Status chips */
body.light .status-queued { border-color: #9ca3af; }
body.light .status-running { border-color: #3b82f6; }
body.light .status-ok { border-color: #16a34a; }
body.light .status-error { border-color: #dc2626; }

/* Warning icon */
body.light .legend-item .warning-icon { color: #d97706; }

/* Approach score borders — slightly deeper for light bg */
body.light .result[data-dominant="text"] .score {
  border-color: rgba(59,125,219,.5);
  box-shadow: inset 0 0 0 1px rgba(59,125,219,.2);
}
body.light .result[data-dominant="company"] .score {
  border-color: rgba(155,92,214,.5);
  box-shadow: inset 0 0 0 1px rgba(155,92,214,.2);
}
body.light .result[data-dominant="unspsc"] .score {
  border-color: rgba(22,163,74,.5);
  box-shadow: inset 0 0 0 1px rgba(22,163,74,.2);
}
body.light .result[data-dominant="sic"] .score {
  border-color: rgba(217,70,168,.5);
  box-shadow: inset 0 0 0 1px rgba(217,70,168,.2);
}
body.light .result[data-dominant="composite"] .score {
  border-color: rgba(8,145,178,.5);
  box-shadow: inset 0 0 0 1px rgba(8,145,178,.2);
}
body.light .result[data-dominant="bm25"] .score {
  border-color: rgba(234,112,32,.5);
  box-shadow: inset 0 0 0 1px rgba(234,112,32,.2);
}
body.light .result[data-dominant="dense"] .score {
  border-color: rgba(124,92,191,.5);
  box-shadow: inset 0 0 0 1px rgba(124,92,191,.2);
}

/* Badge borders for light mode */
body.light .badge.text      { border-color: rgba(59,125,219,.5); }
body.light .badge.company   { border-color: rgba(155,92,214,.5); }
body.light .badge.unspsc    { border-color: rgba(22,163,74,.5); }
body.light .badge.sic       { border-color: rgba(217,70,168,.5); }
body.light .badge.composite { border-color: rgba(8,145,178,.5); }
body.light .badge.bm25      { border-color: rgba(234,112,32,.5); }
body.light .badge.dense     { border-color: rgba(124,92,191,.5); }
body.light .badge.phrase     { border-color: rgba(202,138,4,.5); }
