/* v8 — CardFlow • Auto theme • Purple accent
   - Uses prefers-color-scheme for auto light/dark
   - Purple accent: --accent */
:root{
  --bg: #f6f6fb;
  --panel: #ffffff;
  --text: #1b1b22;
  --muted: #6a6a7a;
  --border: rgba(20,20,30,.10);
  --shadow: 0 10px 30px rgba(30, 10, 60, .10);
  --accent: #6d28d9;         /* deep purple */
  --accent2: #a78bfa;        /* lilac */
  --danger: #ef4444;
  --ok: #10b981;
  --warn: #f59e0b;
  --radius: 18px;
  --pad: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

@media (prefers-color-scheme: dark) {
  :root{
    --bg: #0b0b10;
    --panel: #12121a;
    --text: #f2f1ff;
    --muted: #b2b0c9;
    --border: rgba(255,255,255,.09);
    --shadow: 0 18px 38px rgba(0,0,0,.55);
  }
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.topbar{
  position: sticky;
  top:0;
  z-index: 50;
  display:flex;
  gap: 12px;
  align-items:center;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.brand{ display:flex; align-items:center; gap:10px; min-width: 240px; }
.logo-dot{
  width: 14px; height: 14px; border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, var(--accent2), var(--accent));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent);
}
.brand-title{ font-weight:800; letter-spacing:.2px; }
.brand-sub{ font-size:12px; color: var(--muted); margin-top:2px; }

.tabs{ display:flex; gap: 6px; overflow:auto; }
.tab{
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space:nowrap;
}
.tab.active{
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

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

.main{
  padding: 18px 14px 28px;
  max-width: 1280px;
  margin: 0 auto;
}

.panel{ display:none; }
.panel.active{ display:block; }

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

/* Phase D: Dashboard tiles + full-width cards */
.span-3{ grid-column: 1 / -1; }
.dash-tiles{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stat-tile{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  box-shadow: var(--shadow);
  padding: 12px 12px;
  position: relative;
  overflow: hidden;
}
.stat-tile::before{
  content:"";
  position:absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent2) 30%, transparent), transparent 55%),
              radial-gradient(circle at 90% 80%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%);
  pointer-events:none;
}
.st-k{ position:relative; font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 800; }
.st-v{ position:relative; font-size: 22px; font-weight: 900; margin-top: 6px; }
.st-sub{ position:relative; font-size: 12px; color: var(--muted); margin-top: 4px; }

.heat-item{ align-items: stretch; }
.heat-right{ display:flex; flex-direction:column; align-items:flex-end; gap: 6px; min-width: 110px; }
.heat-val{ font-weight: 900; }
.heat-sub{ color: var(--muted); font-size: 12px; }
.heat-bar{
  width: 110px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  overflow: hidden;
}
.heat-fill{
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent2) 60%, transparent), color-mix(in srgb, var(--accent) 70%, transparent));
}

@media (max-width: 1100px){
  .dash-tiles{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .dash-tiles{ grid-template-columns: 1fr; }
  .heat-bar{ width: 90px; }
}
.grid2{
  display:grid;
  grid-template-columns: 1.1fr 1.2fr;
  gap: 14px;
}

@media (max-width: 1100px){
  .grid{ grid-template-columns: 1fr; }
  .grid2{ grid-template-columns: 1fr; }
  .brand{ min-width: unset; }
}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
}
.card-h{
  display:flex;
  justify-content: space-between;
  align-items:flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.card-title{ font-weight: 800; }
.card-sub{ color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.row{ display:flex; gap: 8px; align-items:center; flex-wrap: wrap; }
.grow{ flex:1; }
.divider{ height:1px; background: var(--border); margin: 12px 0; }

.input, .select, .textarea{
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus{
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.textarea{ min-height: 100px; resize: vertical; }

.btn{
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent2) 25%, transparent), color-mix(in srgb, var(--accent) 18%, transparent));
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor:pointer;
  font-weight: 700;
}
.btn:hover{  }
.btn:active{ transform: translateY(1px); }
.btn.ghost{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
}
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.pill{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.pill.purple{
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: color-mix(in srgb, var(--accent2) 80%, var(--text));
}

.kv{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  margin-top: 8px;
}
.k{ color: var(--muted); font-size: 13px; }
.v{ font-weight: 800; }

.list{
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.item{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
}
.item:hover{ border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.item .meta{ color: var(--muted); font-size: 12px; margin-top: 3px; }
.item .left{ min-width: 0; }
.item .title{ font-weight: 800; white-space:nowrap; overflow:hidden; text-overflow: ellipsis; }
.item .right{ display:flex; gap: 8px; align-items:center; }
.badge{ font-size: 12px; padding: 6px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }

.hint{ color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.form label{ display:block; font-size: 12.5px; color: var(--muted); margin: 8px 0; }
.form label b{ color: var(--text); }

.notes-dock{ margin-top: 6px; }
.notes-h{ display:flex; justify-content: space-between; align-items:flex-start; gap: 10px; margin-bottom: 8px; }

.overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 16px;
  z-index: 200;
}
.overlay.hidden{ display:none; }

.overlay-card{
  width: min(740px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  padding: 14px;
}
.overlay-h{ display:flex; justify-content: space-between; align-items:flex-start; gap: 10px; margin-bottom: 10px; }
.overlay-title{ font-weight: 900; }
.overlay-sub{ color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.count-card{
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.count-name{ font-size: 20px; font-weight: 900; margin-bottom: 10px; }
.big{ padding: 12px 14px; font-size: 14px; border-radius: 16px; }

.mini-title{ font-weight: 900; margin-bottom: 6px; }
.details summary{ cursor: pointer; font-weight: 800; }
.chip{
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  cursor:pointer;
  font-weight: 800;
}
.chip.active{
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
}


/* Phase 1: Core Usability */
.save-status{
  position:fixed; bottom:12px; right:12px; z-index:10;
  display:flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius:999px;
  background:var(--card); box-shadow:var(--shadow);
  font-size:12px;
}
.save-status .dot{ width:8px; height:8px; border-radius:50%; background:#6b7280; }
.save-status.saving .dot{ background:#f59e0b; }
.save-status.saving .dot{ animation: nxPulse 900ms ease-in-out infinite; }
.save-status.saved .dot{ background:#22c55e; }
.save-status .label{ opacity:.9; }

.toast{
  position:fixed; bottom:16px; left:50%; transform:translateX(-50%);
  background:var(--card); color:var(--text);
  border:1px solid var(--border); box-shadow:var(--shadow);
  padding:10px 14px; border-radius:12px; z-index:60;
  animation: nxToastIn 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.hidden{ display:none; }

@keyframes nxPulse{ 0%,100%{ transform: scale(1); opacity: 0.95; } 50%{ transform: scale(1.25); opacity: 0.75; } }

.empty{
  border:1px dashed var(--border); border-radius:12px;
  padding:16px; color:var(--muted); text-align:center;
}
.empty b{ color:var(--text); }

/* Phase 2: Invoice Speed */
.invoice-speedbar{display:flex;align-items:center;gap:12px;margin:8px 0;}
.switch{position:relative;display:inline-block;width:44px;height:24px}
.switch input{opacity:0;width:0;height:0}
.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background:#ccc;transition:.2s;border-radius:999px}
.slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background:white;transition:.2s;border-radius:50%}
.switch input:checked + .slider{background:#7c3aed}
.switch input:checked + .slider:before{transform:translateX(20px)}
.qe-label{font-weight:600}
.vendor-chips{display:flex;gap:6px;overflow:auto}
.chip{padding:6px 10px;border-radius:999px;border:1px solid var(--border);cursor:pointer;white-space:nowrap}
.chip:hover{background:rgba(124,58,237,.1)}
.card.quick input{font-size: 14px}

/* Phase 3: Counting Flow */
.count-header{display:flex;justify-content:space-between;align-items:center;margin:8px 0}
.count-header .crumb{font-weight:600;opacity:.9}
.count-header .progress{font-size:12px;opacity:.8}

.notes-dock{position:sticky;bottom:0;background:var(--card);border-top:1px solid var(--border);
  padding:8px;display:flex;gap:8px}
.notes-dock textarea{flex:1;min-height:48px}
.notes-dock button{white-space:nowrap}

.count-card{display:flex;align-items:center;gap:10px}
.count-card .qty{width:110px}
.zero-btn{padding:8px 12px;border-radius:10px;border:1px solid var(--border);cursor:pointer}
.zero-btn:hover{background:rgba(124,58,237,.1)}

/* Phase 4: COGS */
.cogs-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.cogs-card{padding:12px;border:1px solid var(--border);border-radius:12px}
.cogs-card .label{font-weight:600}
.cogs-card .value{font-size:22px;margin:6px 0}
.cogs-card.good .value{color:#22c55e}
.cogs-card.warn .value{color:#f59e0b}
.cogs-card.bad .value{color:#ef4444}
.confidence{margin-top:8px;font-size:12px}
.confidence .flag{margin-right:8px}
.pmix textarea{width:100%;min-height:120px}

/* Phase 5: Reports & Exports */
#managerActions{padding-left:18px}
#managerActions li{margin:6px 0}
.summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
.export-bar{display:flex;gap:8px;margin-top:8px}
.export-bar button{padding:8px 12px}

/* Phase 6: Polish */
button:focus{outline:2px solid rgba(124,58,237,.4); outline-offset:2px}
.card{transition:box-shadow .12s ease}
.card:hover{box-shadow:0 6px 18px rgba(0,0,0,.06)}

/* v8.7 Dropdown Menu */
.menu-btn{font-size:20px;background:none;border:none;cursor:pointer}
.menu-title{font-weight:700}
.dropdown{
  position:absolute; top:48px; left:12px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:var(--shadow);
  padding:8px;
  display:flex; flex-direction:column; gap:6px;
}
.dropdown a{padding:6px 10px;border-radius:8px;text-decoration:none;color:var(--text)}
.dropdown a:hover{background:rgba(124,58,237,.1)}
.hidden{display:none}

/* Phase 7: Formalization */
.row{display:flex;gap:8px;align-items:center;margin-bottom:8px}
.muted{opacity:.7;font-size:12px}
#itemList .item-row{display:flex;gap:8px;align-items:center;margin:6px 0}
.badge{padding:2px 6px;border-radius:999px;font-size:11px;border:1px solid var(--border)}
.badge.warn{background:rgba(245,158,11,.15)}
.badge.lock{background:rgba(124,58,237,.15)}
.modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.35)}
.modal.open{display:flex}
.modal-card{background:var(--card);border-radius:12px;padding:12px;min-width:280px}

/* v8.9 Flow & Ease-of-Use */
.context-bar{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;border-bottom:1px solid var(--border)}
.breadcrumb{font-weight:600}
.progress{opacity:.7}
.btn.primary, .primary{font-weight:700}
button.primary, .btn.primary{background:var(--accent,#7c3aed);color:white}
button:not(.primary){opacity:.85}
details.advanced summary{cursor:pointer;opacity:.8}
details.advanced[open] summary{opacity:1}

/* v9.1 Readability Pass */
:root{
  --text: #111827;
  --muted: rgba(17,24,39,.82);
  --border-strong: rgba(17,24,39,.18);
}

body{
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.muted, small{
  opacity: 1 !important;
  color: var(--muted) !important;
}

.card{
  padding: 14px;
  border-color: var(--border-strong);
}

h1,h2,h3,h4{
  line-height: 1.2;
  letter-spacing: .2px;
}

input, select, textarea, button{
  min-height: 44px;
  font-size: 14px;
}

label{
  font-weight: 650;
}

.value, .qty{
  font-size: 14px;
  font-weight: 700;
}

.context-bar{
  font-size: 14px;
}

.item-row{
  padding: 8px 0;
  border-bottom: 1px solid var(--border-strong);
}
.item-row:last-child{
  border-bottom: none;
}



/* v9.6 DIAGNOSIS: Readability Fixes */

/* Kill opacity inheritance */
.card, section, .panel {
  opacity: 1 !important;
}

/* Solid readable surfaces */
.card, section, .panel {
  background: #0f1117;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: none !important;
}

/* Text hierarchy */
body {
  color: #eaeaf0;
}
h1,h2,h3,h4 {
  color: var(--text);
}
label {
  color: #f4f4fa;
  font-weight: 600;
}
.muted, small {
  color: #b8b8c8;
  opacity: 1;
}

/* Buttons: readable, not ghosted */
button {
  color: var(--text);
  background: linear-gradient(180deg,#7c3aed,#5b21b6);
  opacity: 1;
}

/* Inputs readable */
input, select, textarea {
  color: var(--text);
  background: #12141c;
  border: 1px solid rgba(255,255,255,0.15);
}

/* ---- Dropdown menu styles ---- */
.dropdown-topbar {
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 14px;
  background:#0b0d12;
  border-bottom:1px solid rgba(255,255,255,0.08);
}

.menu-btn {
  font-size:22px;
  background:none;
  border:none;
  color:#ffffff;
}

.menu-title {
  font-weight:700;
}

.dropdown {
  position:absolute;
  top:54px;
  left:12px;
  background:#0f1117;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px;
  padding:8px;
  display:flex;
  flex-direction:column;
  gap:6px;
  z-index:1000;
}

.dropdown a {
  color:#ffffff;
  text-decoration:none;
  padding:6px 10px;
  border-radius:8px;
}
.dropdown a:hover {
  background:rgba(124,58,237,.2);
}
.hidden { display:none; }

/* Hide old pill/tab navigation (defensive) */
.nav, .nav-bar, .tabs, .tablist, .pill-nav, [role="tablist"] {
  display:none !important;
}

/* ===============================
   v9.7 READABILITY HARDENING PASS
   =============================== */

/* ---------- Luminance ladder ---------- */
body {
  background: #080a10; /* darker page */
}

.card, section, .panel {
  background: #121523; /* primary surface */
  border-radius: 16px;
}

.card .card, .card section {
  background: #181c2f; /* nested surface */
}

/* ---------- Section separation ---------- */
section, .card {
  margin-bottom: 22px;
  padding: 18px 18px 20px;
}

/* ---------- Headings hierarchy ---------- */
h1 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 14px;
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

h3, .section-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .2px;
  margin-bottom: 10px;
}

/* ---------- Numbers & KPIs ---------- */
.kpi, .stat, .value, .amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.kpi.muted, .stat.muted {
  color: #d1d3e8;
}

/* ---------- Labels ---------- */
label {
  font-size: .85rem;
  letter-spacing: .3px;
  margin-bottom: 4px;
}

/* ---------- Inputs ---------- */
input, select, textarea {
  padding: 12px 14px;
  font-size: .95rem;
}

/* ---------- Button hierarchy ---------- */
button.primary, .primary-action {
  background: linear-gradient(180deg,#8b5cf6,#6d28d9);
  box-shadow: 0 6px 18px rgba(139,92,246,.35);
  font-weight: 700;
}

button.secondary {
  background: #1b1f36;
  border: 1px solid rgba(255,255,255,.18);
  color: var(--text);
}

button.tertiary {
  background: transparent;
  color: #c7c9e6;
}

/* Make default buttons secondary unless marked */
button:not(.primary):not(.secondary):not(.tertiary) {
  background: #1b1f36;
}

/* ---------- Action grouping ---------- */
.action-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

/* ---------- Scan-first spacing ---------- */
.card > * + * {
  margin-top: 12px;
}

/* ---------- Reduce visual noise ---------- */
hr, .divider {
  opacity: .25;
}

/* ---------- Tablet / kitchen tuning ---------- */
@media (min-width: 768px) {
  body {
    font-size: 16.5px;
  }
  button {
    min-height: 46px;
  }
}

/* ===============================
   v9.8 READABILITY HARDENING II
   =============================== */

/* --- Remove header / hero dark overlay --- */
header, .topbar, .dropdown-topbar {
  background: #0b0e18 !important;
  box-shadow: none !important;
}

/* Prevent header gradient bleed */
header::after,
.topbar::after {
  content: none !important;
}

/* --- Stronger page vs card separation --- */
body {
  background: #05070d;
}

.card, section, .panel {
  background: rgba(15,23,42,0.55); /* brighter than v9.7 */
}

/* --- Inner card boost --- */
.card .card, .card section {
  background: #1c2246;
}

/* --- Force visible disabled buttons --- */
button:disabled,
button[disabled] {
  opacity: 1 !important;
  background: #2a2f55 !important;
  color: #bfc3ff !important;
  border: 1px dashed rgba(255,255,255,.25);
}

/* --- Inputs & placeholders --- */
input::placeholder,
textarea::placeholder {
  color: #9ea3ff;
  opacity: 1;
}

/* --- KPI numbers pop --- */
.kpi, .stat, .value, .amount {
  font-size: 1.15rem;
  letter-spacing: .3px;
}

/* --- Section titles brighter --- */
.section-title, h2 {
  color: var(--text);
}

/* --- Reduce heavy shadows that darken cards --- */
.card {
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
}

/* ===============================
   v9.9 TEXT CONTRAST HOTFIX
   =============================== */

/* --- Kill any dimming effects on content blocks --- */
.card, section, .panel, .kpi-block, .stats, .summary {
  filter: none !important;
  opacity: 1 !important;
}

/* --- KPI labels: force readable contrast --- */
.kpi-label,
.stat-label,
.summary-label,
.metrics label,
.metrics .label {
  color: #e9ebff !important;
  font-weight: 600;
  text-shadow: none !important;
}

/* --- KPI values: force pop --- */
.kpi-value,
.stat-value,
.summary-value,
.metrics .value,
.amount {
  color: #ffffff !important;
  font-weight: 800;
  text-shadow: none !important;
}

/* --- Specific strings block (defensive selectors) --- */
#netSalesFood,
#netSalesTotal,
#ingredientsCogs,
#productsCogs,
#cogsPercent {
  color: #ffffff !important;
}

/* --- Buttons: force text contrast --- */
button,
button * {
  color: #ffffff !important;
  text-shadow: none !important;
}

/* Primary actions */
button.primary,
.primary-action {
  background: linear-gradient(180deg,#8b5cf6,#6d28d9) !important;
}

/* Secondary actions */
button.secondary,
button:not(.primary):not(.tertiary) {
  background: #242a5a !important;
}

/* Disabled buttons: readable but muted */
button:disabled,
button[disabled] {
  background: #2f356b !important;
  color: #e6e7ff !important;
}

/* --- Ensure headers don't dim following text --- */
header, .header, .hero {
  filter: none !important;
  opacity: 1 !important;
}

/* --- Lists / paragraphs inside cards --- */
.card p,
.card li,
.card span {
  color: #eaeaf0;
}

/* --- Remove any global text dimming --- */
* {
  text-rendering: optimizeLegibility;
}

/* =========================================
   v10 HIGH CONTRAST MODE (ALWAYS ON)
   Goal: every piece of text is readable.
   ========================================= */

/* Dark, consistent background */
html, body {
  background: #05070d !important;
  color: #ffffff !important;
}

/* Force all text to inherit white unless explicitly overridden */
body *,
.card *,
section *,
.panel *,
header *,
nav *,
.dropdown * {
  color: inherit !important;
  text-shadow: none !important;
}

/* Make secondary/muted text still bright enough */
.muted, small, .subtext, .hint, .help, .caption {
  color: #f0f2ff !important;
  opacity: 1 !important;
}

/* Labels and headings: pure white */
h1,h2,h3,h4,h5,h6,
label,
.title,
.section-title,
.kpi-label,
.stat-label,
.summary-label {
  color: #ffffff !important;
}

/* Values: pure white + strong weight */
.kpi-value,
.stat-value,
.summary-value,
.value,
.amount,
.total,
.metric,
.number {
  color: #ffffff !important;
  font-weight: 800;
}

/* Links */
a, a:visited {
  color: #ffffff !important;
}

/* Inputs: readable content + placeholder */
input, select, textarea {
  color: #ffffff !important;
  background: #121428 !important;
  border: 1px solid rgba(255,255,255,0.22) !important;
}
input::placeholder, textarea::placeholder {
  color: #e6e7ff !important;
  opacity: 1 !important;
}

/* Buttons: always readable text */
button, button * {
  color: #ffffff !important;
  text-shadow: none !important;
}
button {
  border: 1px solid rgba(255,255,255,0.14) !important;
}

/* Disabled buttons: still readable */
button:disabled,
button[disabled] {
  opacity: 1 !important;
  background: #2f356b !important;
  color: #ffffff !important;
  border: 1px dashed rgba(255,255,255,.28) !important;
}

/* Table / rows / list items */
table, th, td, tr,
li, p, span, div {
  color: inherit !important;
}

/* Ensure card surfaces remain visible */
.card, section, .panel {
  background: #151a33 !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
}

/* Icons (SVG) visibility */
svg, svg * {
  fill: currentColor !important;
  stroke: currentColor !important;
}

/* =========================================
   v10.1 Splash (3s + animation) + Dropdown fix
   ========================================= */

/* Splash overlay */
.splash{
  position: fixed;
  inset: 0;
  background: #05070d; /* overwritten by JS to match body */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity .65s ease;
}

.splash.fade{
  opacity: 0;
  pointer-events: none;
}

.splash-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  transform: translateY(0);
  animation: splashFloat 1.4s ease-in-out infinite alternate;
}

.splash-logo{
  width: min(520px, 72vw);
  max-height: 52vh;
  object-fit: contain;
  animation: splashPop .55s ease;
}

.splash-sub{
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--text);
  opacity: .92;
  font-size: 0.95rem;
}

@keyframes splashPop{
  from{ transform: scale(.96); opacity: 0; }
  to{ transform: scale(1); opacity: 1; }
}

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

/* Ensure dropdown sits above everything and is clickable */
.dropdown{
  z-index: 2000 !important;
}

/* =====================================================
   v10.2 Animation Set: 1D 2A 3A 4A 5B 6A
   -----------------------------------------------------
   1D Splash: mask-reveal (clip-path) + 3s + fade
   2A Dropdown: slide + fade (.open)
   3A Button press feedback
   4A Expand/collapse (generic utility)
   5B KPI update accent flash
   6A Skeleton shimmer
   ===================================================== */

/* --- 1D Splash mask-reveal --- */
.splash{
  clip-path: circle(120% at 50% 50%);
  transition: opacity .65s ease, clip-path .85s ease;
}
.splash.reveal{
  clip-path: circle(0% at 50% 50%);
}

/* Keep splash above everything */
.splash{ z-index: 99999 !important; }

/* --- 2A Dropdown: slide + fade --- */
.dropdown{
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.dropdown.open{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* --- 3A Button press feedback --- */
button{
  transition: transform .08s ease, filter .12s ease;
}
button:active{
  transform: scale(0.98);
}

/* --- 4A Expand / Collapse utility --- */
.collapsible-content{
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .30s ease, opacity .18s ease;
}
.collapsible.open .collapsible-content{
  max-height: 999px;
  opacity: 1;
}

/* --- 5B KPI flash on update --- */
.kpi-flash{
  color: #c4b5fd !important; /* light purple accent */
  transition: color .12s ease;
}

/* --- 6A Skeleton shimmer --- */
.skeleton{
  position: relative;
  color: transparent !important;
}
.skeleton::after{
  content: "";
  position: absolute;
  inset: -2px -6px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.18), rgba(255,255,255,0.06));
  background-size: 200% 100%;
  animation: skeletonShimmer 1.1s ease-in-out infinite;
}
@keyframes skeletonShimmer{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}

/* ===============================
   v10.3 UNSTICKY TOP BAR
   =============================== */
header,
.topbar,
.dropdown-topbar {
  position: static !important;
  top: auto !important;
}

/* ===============================
   v10.4 Dropdown below header
   =============================== */
.dropdown{
  position: absolute; /* position via JS below header */
  left: 12px;
}

/* v10.5 safety css: ensure splash & dropdown classes exist */
.splash{ opacity:1; transition: opacity .65s ease, clip-path .85s ease; clip-path: circle(120% at 50% 50%); }
.splash.fade{ opacity:0; pointer-events:none; }
.splash.reveal{ clip-path: circle(0% at 50% 50%); }
.dropdown{ opacity:0; transform: translateY(-8px); pointer-events:none; transition: opacity .18s ease, transform .18s ease; }
.dropdown.open{ opacity:1; transform: translateY(0); pointer-events:auto; }

/* ===============================
   v10.6 Menu Toggle + Title Layout Fix
   - Unsticky header stays in normal flow
   - Menu button left, title centered
   - Dropdown positioned relative to header
   =============================== */

header.dropdown-topbar,
header.topbar,
.dropdown-topbar{
  position: relative !important; /* anchor dropdown */
  display: grid !important;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

#menuToggle.menu-btn{
  grid-column: 1;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #1b1f36 !important; /* readable */
  border: 1px solid rgba(255,255,255,0.14) !important;
}

.menu-title{
  grid-column: 2;
  text-align: center;
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.1;
  padding: 0 6px;
}

/* Right column reserved for future (status badge / icon) */
.dropdown-topbar::after{
  content: "";
  grid-column: 3;
}

/* Dropdown aligns with left padding (under button area) */
#dropdownMenu.dropdown{
  left: 14px !important;
}

/* Ensure page content doesn't tuck under the header (some browsers) */
main, .app, #app, .container{
  margin-top: 10px;
}

/* v10.7 splash css (defensive) */
.splash{ opacity:1; transition: opacity .65s ease, clip-path .85s ease; clip-path: circle(120% at 50% 50%); }
.splash.fade{ opacity:0; pointer-events:none; }
.splash.reveal{ clip-path: circle(0% at 50% 50%); }

/* ===============================
   v10.9 module header tile (precise)
   Turns the SECOND header (Kitchen Inventory + tabs + actions) into a tile card
   =============================== */

.module-tile{
  max-width: 1200px;
  margin: 14px auto 10px auto;
  padding: 14px 14px 12px 14px;
  background: #151a33 !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.35);
}

.module-tile-inner{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Brand row */
.module-tile .brand{
  display:flex;
  align-items:center;
  gap: 12px;
  margin: 0;
}
.module-tile .brand-title{ color:#fff !important; font-weight:800; }
.module-tile .brand-sub{ color:#f0f2ff !important; opacity:1 !important; }

/* Tabs: wrap neatly */
.module-tile .tabs{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Actions + quick entry: wrap and stay readable */
.module-tile .top-actions{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items:center;
}

.module-tile .invoice-speedbar{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items:center;
}

/* Saved badge floats to the right inside tile */
.module-tile #saveStatus.save-status{
  justify-self: end;
  margin-left: auto;
}

/* On wide screens, keep brand/tabs/actions in a nice flow */
@media (min-width: 980px){
  .module-tile-inner{
    grid-template-columns: 1fr;
  }
}

/* Mobile padding */
@media (max-width: 820px){
  .module-tile{
    margin: 12px 12px 10px 12px;
    padding: 12px 12px 10px 12px;
  }
}


/* ===============================
   v10.10 Tile Spacing Fix
   - Brand + actions share the same top row
   - Tabs span full width under that
   - Quick Entry spans full width under that
   - Save status sits top-right inside the tile (doesn't create layout gaps)
   =============================== */

.module-tile{
  position: relative; /* anchor absolute status */
}

.module-tile-inner{
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  column-gap: 14px !important;
  row-gap: 10px !important;
  align-items: start !important;
}

/* Hide toast from layout (still usable if shown) */
.module-tile #toast.toast{
  grid-column: 1 / -1;
  display: none;
}

/* Top row: brand left */
.module-tile .brand{
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

/* Top row: actions right (Month / Export / Import) */
.module-tile .top-actions{
  grid-column: 2;
  grid-row: 1;
  margin-left: 0 !important;
  justify-content: flex-end;
  align-self: center;
}

/* Tabs go full width below */
.module-tile .tabs{
  grid-column: 1 / -1;
  grid-row: 2;
}

/* Quick Entry row full width below tabs */
.module-tile .invoice-speedbar{
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 0 !important;
  padding-top: 2px;
}

/* Save indicator: absolute top-right, not part of grid flow */
.module-tile #saveStatus.save-status{
  position: absolute !important;
  top: 12px;
  right: 14px;
  margin: 0 !important;
}

/* Give actions a little breathing room on small screens */
@media (max-width: 820px){
  .module-tile-inner{
    grid-template-columns: 1fr !important;
    row-gap: 10px !important;
  }
  .module-tile .top-actions{
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
  }
  .module-tile .tabs{
    grid-row: 3;
  }
  .module-tile .invoice-speedbar{
    grid-row: 4;
  }
  .module-tile #saveStatus.save-status{
    top: 10px;
    right: 12px;
  }
}

/* Ensure the empty month selector doesn’t balloon */
.module-tile .top-actions select,
.module-tile .top-actions input[type="text"],
.module-tile .top-actions .select,
.module-tile .top-actions .input{
  max-width: 320px;
}


/* ===============================
   v10.11 Dropdown Reliability
   - Make dropdown fixed to viewport (prevents "opens offscreen" / "not clickable" issues)
   - JS sets --hdrH so dropdown sits right under header
   =============================== */
:root{ --hdrH: 56px; }

header.dropdown-topbar{ position: relative; z-index: 9999; }

header.dropdown-topbar .dropdown{
  position: fixed !important;
  left: 12px !important;
  top: calc(var(--hdrH) + 10px) !important;
  z-index: 100000 !important;
  min-width: 180px;
  max-width: min(72vw, 320px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.55);
}


/* ===============================
   v10.11 Module Tile Layout Tightening
   - Quick Entry sits directly under the top row (brand + actions)
   - Tabs come after Quick Entry
   - Removes the "giant empty middle" feeling
   =============================== */
.module-tile-inner{
  row-gap: 8px !important;
}

.module-tile .invoice-speedbar{
  grid-column: 1 / -1;
  grid-row: 2 !important;
  margin: 0 !important;
  justify-content: space-between;
}

.module-tile .tabs{
  grid-row: 3 !important;
}

/* Make tabs visible on the tile (higher contrast) */
.module-tile .tab{
  background: rgba(255,255,255,0.06);
  color: #ffffff !important;
  border-color: rgba(255,255,255,0.14);
}
.module-tile .tab[aria-selected="true"]{
  background: rgba(162,108,255,0.22);
  border-color: rgba(162,108,255,0.45);
}

/* ===============================
   v10.12 splash CSS backstop
   If JS fails, splash will still auto-hide after ~3.9s.
   =============================== */
#splash.splash{
  animation: splashAutoHide 3.9s ease forwards;
}
@keyframes splashAutoHide{
  0%{
    opacity: 1;
    clip-path: circle(120% at 50% 50%);
    visibility: visible;
    pointer-events: auto;
  }
  77%{
    opacity: 1;
    clip-path: circle(120% at 50% 50%);
  }
  100%{
    opacity: 0;
    clip-path: circle(0% at 50% 50%);
    visibility: hidden;
    pointer-events: none;
  }
}

/* ===============================
   v10.13 Tile Row Nav (replaces dropdown)
   =============================== */
.tile-row-nav{
  max-width: 1200px;
  margin: 10px auto 0 auto;
  padding: 0 12px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tile-row-nav::-webkit-scrollbar{ height: 6px; }
.tile-row-nav::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.12); border-radius: 999px; }

.tile-nav-btn{
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15,23,42,0.55);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 800;
  letter-spacing: .2px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}
.tile-nav-btn:active{ transform: translateY(1px); }

.tile-nav-btn.active{
  outline: 2px solid rgba(180,140,255,0.55);
  border-color: rgba(180,140,255,0.55);
}

/* ===============================
   v10.14 module tile refactor
   Dedicated 3-row skeleton:
   Row 1: brand (L) + actions (R)
   Row 2: quick entry (full width)
   Row 3: tabs (full width)
   =============================== */

.module-tile{
  position: relative;
}

.module-tile .mt-top{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.module-tile .mt-actions .top-actions{
  margin: 0 !important;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.module-tile .mt-quick{
  margin-top: 10px;
}

.module-tile .mt-quick .invoice-speedbar{
  margin: 0 !important;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.module-tile .mt-tabs{
  margin-top: 10px;
}

.module-tile .mt-tabs .tabs{
  margin: 0 !important;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Save status: float in corner without affecting layout */
.module-tile #saveStatus.save-status{
  position: absolute !important;
  top: 12px;
  right: 14px;
  margin: 0 !important;
}

/* Neutralize old header behaviors that cause spacing weirdness */
.module-tile .brand, .module-tile .top-actions, .module-tile .invoice-speedbar, .module-tile .tabs{
  width: auto !important;
  max-width: 100% !important;
}

@media (max-width: 820px){
  .module-tile .mt-top{
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .module-tile .mt-actions .top-actions{
    justify-content: flex-start;
  }
  .module-tile #saveStatus.save-status{
    top: 10px;
    right: 12px;
  }
}

/* ===============================
   enh1 invoice editor speed + safety
   =============================== */
.input.invalid{
  border-color: rgba(255,90,90,0.85) !important;
  box-shadow: 0 0 0 2px rgba(255,90,90,0.18) !important;
}
.hint{
  font-size: 12px;
  
  line-height: 1.25;
}
.adv-toggle{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-weight: 800;
}
.adv-toggle .dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(180,140,255,0.8);
  box-shadow: 0 0 0 2px rgba(180,140,255,0.18);
}
.line-advanced{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,0.12);
}
.line-advanced[hidden]{ display:none !important; }
.kbd{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);
  font-size: 11px;
  font-weight: 900;
}

/* BUGCHECK1_CONTRAST */
:root{
  --hc-text: #ffffff;
  --hc-muted: rgba(255,255,255,0.85);
  --hc-bg-card: rgba(20,20,30,0.92);
}
.card, .tile, .overlay-card{ background: var(--hc-bg-card); }
.card *, .tile *, .overlay-card *{ color: var(--hc-text); }
.muted, .meta{ color: var(--hc-muted) !important; }

/* ===============================
   PHASE2_PERIODS
   =============================== */
.period-card{
  border:1px solid rgba(255,255,255,0.14);
  border-radius:16px;
  padding:14px;
  margin-bottom:12px;
  background:rgba(20,20,30,0.92);
}
.period-row{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
}
.badge{
  padding:4px 8px; border-radius:999px; font-weight:900; font-size:11px;
  background:rgba(180,140,255,0.25); border:1px solid rgba(180,140,255,0.45);
}
.badge.locked{ background:rgba(255,120,120,0.25); border-color:rgba(255,120,120,0.55); }
.btn-danger{
  background:rgba(255,120,120,0.18);
  border:1px solid rgba(255,120,120,0.55);
}

/* BUGCHECK2_LOCKED_UI */
.locked .primary,
.locked button.primary{
  
  pointer-events:none;
}
.locked-note{
  font-size:12px;
  
  margin-top:6px;
}

/* ===============================
   PHASE3_EXCLUSIONS & ALIASES
   =============================== */
.excluded{
  
  text-decoration: line-through;
}
.alias-chip{
  display:inline-block;
  padding:3px 6px;
  margin:2px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  background:rgba(180,140,255,0.25);
  border:1px solid rgba(180,140,255,0.45);
}

/* BUGCHECK3_EXCLUDED_VIS */
.excluded{
  
  filter: grayscale(0.4);
}
.excluded::after{
  content:" (Excluded)";
  font-size:11px;
  font-weight:800;
  margin-left:4px;
  
}

/* ===============================
   PHASE4_UNDO
   =============================== */
.undo-toast{
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: rgba(30,30,45,0.96);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 10px 12px;
  border-radius: 12px;
  z-index: 9999;
  display: flex;
  gap: 10px;
  align-items: center;
}
.undo-toast button{
  font-weight: 900;
}

/* BUGCHECK4_TOAST_SAFE */
.undo-toast{ pointer-events: auto; }
.undo-toast *{ pointer-events: auto; }

/* PHASE5_CSS */
#reports .grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}

/* BUGCHECK5_CONTRAST */
#reports .btn{color:#fff}
#reports .btn.primary{background:#5b2bbd}



/* === PHASE A VISIBILITY & LAYERING OVERRIDES === */
html, body {
  opacity: 1 !important;
  filter: none !important;
  backdrop-filter: none !important;
  background-blend-mode: normal !important;
}

body::before,
body::after,
main::before,
main::after {
  content: none !important;
  display: none !important;
}

[class*="overlay"],
[class*="scrim"],
[class*="backdrop"],
[id*="overlay"],
[id*="scrim"],
[id*="backdrop"] {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

* {
  text-shadow: none !important;
}

.nxs-pill,
.start-pill,
button,
a.buttonlike {
  opacity: 1 !important;
  filter: none !important;
}

/* Lock content to foreground plane */
main, .content, .page, .container {
  position: relative;
  z-index: 1;
}


/* === PHASE C: Z-INDEX & STACKING CONTEXT SANITY === */

/* Normalize z-index layers */
:root {
  --z-background: 0;
  --z-content: 1;
  --z-ui: 10;
  --z-nav: 100;
  --z-modal: 1000;
  --z-debug: 10000;
}

/* Foreground locking */
main, section, article, .content, .container {
  position: relative;
  z-index: var(--z-content);
}

/* Navigation always above content */
nav, .nexusbar, header {
  position: relative;
  z-index: var(--z-nav) !important;
}

/* Debug UI always topmost */
#eruda, .debug-ui, .debug-panel {
  z-index: var(--z-debug) !important;
}

/* Remove backdrop-filter traps */
[class*="blur"],
[class*="glass"],
[class*="frost"],
[class*="backdrop"] {
  backdrop-filter: none !important;
  filter: none !important;
}

/* Prevent future accidental stacking */
[data-stack] {
  position: relative;
  z-index: var(--z-content);
}

/* === END PHASE C === */


/* === PHASE D: ACCESSIBILITY, CONTRAST & PERCEPTION === */

/* Enforce readable contrast */
:root {
  --min-contrast-bg: #0f172a;
  --min-contrast-text: #e5e7eb;
}

body {
  color: var(--min-contrast-text) !important;
  background-color: var(--min-contrast-bg) !important;
}

/* Focus visibility */
*:focus,
*:focus-visible {
  outline: 3px solid #22d3ee !important;
  outline-offset: 2px !important;
}

/* Remove fake-button links */
a:not(.btn):not(.buttonlike) {
  text-decoration: underline;
}

/* Button semantics */
button, .btn, .buttonlike {
  cursor: pointer;
  text-decoration: none !important;
}

/* Ensure tap targets */
a, button {
  min-height: 44px;
  min-width: 44px;
}

/* Kill misleading hover-only affordances */
@media (hover: none) {
  *:hover {
  }
}

/* Screen reader safety */
[aria-hidden="true"] {
  display: none !important;
}

/* Ensure visible labels */
input, select, textarea {
  color: #0f172a !important;
  background: #fff !important;
}

/* Prevent ultra-dense layouts */
section, article, main {
  line-height: 1.6;
}

/* === END PHASE D === */


/* === Recommended Path Tile (compact) === */
/* === More Tile === */


/* === Hybrid Editorial Tile System (C) === */
.inline-tile{
  position: relative;
  background: linear-gradient(180deg, rgba(18,22,35,0.92) 0%, rgba(12,16,28,0.88) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 18px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: hidden;
}

.inline-tile::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  height:100%;
  width:4px;
  background: linear-gradient(180deg, rgba(168,85,247,0.85) 0%, rgba(59,130,246,0.55) 100%);
  
}

.inline-tile h3{
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px 0;
  
}

.inline-tile p{
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  
  max-width: 70ch;
}

/* Slightly tighter cards for short statements */
.inline-tile--tight{
  padding: 16px 18px;
}

@media (max-width: 520px){
  .inline-tile{
    padding: 16px 16px;
    border-radius: 14px;
  }
  .inline-tile p{
    font-size: 14px;
  }
}



/* === Inline Tiles Full-Width === */
.inline-tile{
  width: 100% !important;
  box-sizing: border-box;
  grid-column: 1 / -1;
}
.inline-tile p{ max-width: none; }


/* === Thumb De-Dimming === */
.thumb img, .tile-thumb img, .app-thumb img, .nxs-thumb img, .thumbs img{
  filter: none !important;
  opacity: 1 !important;
}
.thumb::after, .tile-thumb::after, .app-thumb::after, .nxs-thumb::after, .thumbs::after,
.thumb::before, .tile-thumb::before, .app-thumb::before, .nxs-thumb::before, .thumbs::before{
  display: none !important;
  content: none !important;
}


/* === Force remove thumb dimming (override) === */
img{ filter: none !important; opacity: 1 !important; }
.tile img, .card img, .thumb img, .tile-thumb img, .app-thumb img, .nxs-thumb img, .thumbs img,
.tile picture img, picture img { filter:none !important; opacity:1 !important; mix-blend-mode: normal !important; }
.tile::before, .tile::after,
.card::before, .card::after,
.thumb::before, .thumb::after,
.tile-thumb::before, .tile-thumb::after,
.app-thumb::before, .app-thumb::after,
.nxs-thumb::before, .nxs-thumb::after,
.thumbs::before, .thumbs::after,
.tile img::before, .tile img::after { display:none !important; content:none !important; }


/* === Full-width for Start Here + key tiles === */
.start-here, .startHere, .nxs-start, #start-here, .start-here-tile,
.recommended-path, .scope-tile, .inline-tile, .inline-tile--tight {
  width: 100% !important;
  max-width: none !important;
}
/* If they sit inside a grid, make them span the grid */
.start-here, .startHere, .nxs-start, #start-here, .start-here-tile,
.recommended-path, .scope-tile, .inline-tile, .inline-tile--tight {
  grid-column: 1 / -1 !important;
}

/* === Phase A Skin (deploy120): ALIBI Kitchen Intel polish === */
body{
  background:
    radial-gradient(900px 600px at 15% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 58%),
    radial-gradient(900px 600px at 90% 0%, color-mix(in srgb, var(--accent2) 10%, transparent), transparent 62%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.card{
  box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease;
}
.card:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(30,10,60,.14);
}

.btn{
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease, color .14s ease;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(109,40,217,.14);
}
.btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent), 0 14px 26px rgba(109,40,217,.10);
}

.input, .select, .textarea{
  transition: box-shadow .14s ease, border-color .14s ease, background .14s ease;
}
.input:focus-visible, .select:focus-visible, .textarea:focus-visible{
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

