:root {
  --bg: #F7F5F1;
  --surface: rgba(255,255,255,0.85);
  --surface-solid: #FFFFFF;
  --text: #1C1B19;
  --muted: #66615B;
  --border: #E4E0DA;
  --blue: #3D5A80;
  --blue2: #4C6E96;
  --purple: #3D5A80;
  --purple2: #4C6E96;
  --green: #376E45;
  --amber: #B08968;
  --red: #B4433A;
  --tan: #7B6049;
  --tan-soft: #F3E9E0;
  --shadow: 0 4px 14px rgba(28,27,25,0.05);
  --shadow-lg: 0 10px 30px rgba(28,27,25,0.08);
  --radius: 8px;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg: #161512;
  --surface: rgba(30,29,26,0.85);
  --surface-solid: #201F1B;
  --text: #F2F0EA;
  --muted: #9C968D;
  --border: #34322C;
  --blue: #6B8CAE;
  --blue2: #7C9BBA;
  --purple: #6B8CAE;
  --purple2: #7C9BBA;
  --tan: #C7A17E;
  --tan-soft: #2B241C;
  --shadow: 0 4px 14px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  transition: background .3s, color .3s;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-heading); }
code, .mono { font-family: var(--font-mono); }

.glass { background: var(--surface); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--border); }

/* Demo mode banner */
.demo-banner { position: sticky; top: 0; z-index: 110; background: var(--tan); color: #fff; font-size: 12.5px; font-weight: 600; padding: 8px 16px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.demo-banner[hidden] { display: none; }

.build-badge { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; background: var(--tan-soft); color: var(--tan); padding: 3px 9px; border-radius: 10px; margin-left: 8px; vertical-align: middle; text-transform: uppercase; letter-spacing: .06em; }

/* ================= App shell: topbar + sidebar + workspace ================= */
.topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--surface-solid); }
.brand { font-family: var(--font-heading); font-weight: 600; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.brand i { color: var(--blue); font-size: 16px; }
.brand .eyebrow { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--tan); font-weight: 600; }
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle { border: 1px solid var(--border); background: var(--surface-solid); color: var(--text); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; transition: border-color .15s; display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle:hover { border-color: var(--blue); }
.sidebar-toggle { display: none; border: 1px solid var(--border); background: var(--surface-solid); color: var(--text); width: 36px; height: 36px; border-radius: var(--radius); cursor: pointer; align-items: center; justify-content: center; }

.app-shell { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 62px); max-width: 1440px; margin: 0 auto; }

.sidebar { border-right: 1px solid var(--border); background: var(--surface-solid); padding: 22px 20px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.sidebar-section .section-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 10px; font-weight: 600; }

.workspace { padding: 24px 28px 60px; overflow-x: hidden; }

/* Tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 22px; }
.tab-btn { font-family: var(--font-body); font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 6px; border: none; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.tab-btn.active { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Size chips (sidebar) */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.size-chip { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; color: var(--text); transition: all .15s ease; }
.size-chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Unit toggle */
.unit-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; width: fit-content; }
.unit-toggle button { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; padding: 7px 14px; border: none; background: var(--bg); color: var(--muted); cursor: pointer; }
.unit-toggle button.active { background: var(--blue); color: #fff; }

/* Measurement rows (sidebar) */
.measure-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.measure-row:last-child { border-bottom: none; }
.measure-row .tag { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }

/* Cards */
.card { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 22px; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { font-size: 16px; margin: 0; font-weight: 600; }
.panel-sub { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.panel-icon { width: 36px; height: 36px; min-width: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: #fff; background: var(--blue); }
.panel-icon.purple { background: var(--tan); }
.tag { margin-left: auto; background: var(--tan-soft); color: var(--tan); font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; font-family: var(--font-mono); }
.tag-purple { background: var(--tan-soft); color: var(--tan); }

label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
input, select { width: 100%; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 13.5px; font-family: inherit; transition: border-color .15s; }
input:focus, select:focus { border-color: var(--blue); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=range] { accent-color: var(--blue); padding: 0; }

/* Keyboard focus rings */
a:focus, button:focus, input:focus, select:focus { outline: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
.theme-toggle:focus-visible, .fab:focus-visible, .tab-btn:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px;
}

/* Field validation */
.field-error { display: block; color: var(--red); font-size: 11.5px; margin-top: 5px; min-height: 14px; }
.field-error:empty { display: none; }
.input-invalid { border-color: var(--red) !important; }

/* Garment image dropzone */
.demo-tag { background: var(--tan-soft); color: var(--tan); font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-left: 4px; text-transform: uppercase; letter-spacing: .06em; vertical-align: middle; font-family: var(--font-mono); }

.dropzone { margin-top: 6px; border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; background: var(--bg); }
.dropzone:hover, .dropzone.dragover { border-color: var(--blue); background: var(--tan-soft); }
.dropzone-empty i { font-size: 24px; color: var(--blue); margin-bottom: 6px; display: block; }
.dropzone-empty p { margin: 4px 0 8px; font-size: 12.5px; color: var(--muted); }
.dropzone-empty small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.browse-btn { background: var(--surface-solid); border: 1px solid var(--border); color: var(--blue); font-weight: 600; font-size: 12px; padding: 7px 14px; border-radius: 20px; cursor: pointer; transition: background .15s; }
.browse-btn:hover { background: var(--bg); }

.dropzone-preview { display: flex; align-items: center; gap: 12px; text-align: left; cursor: default; }
.dropzone-preview img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.preview-meta { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.preview-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-success { font-size: 11px; color: var(--green); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.remove-btn { align-self: flex-start; background: none; border: none; color: var(--red); font-size: 11px; font-weight: 600; cursor: pointer; padding: 2px 0; display: flex; align-items: center; gap: 5px; }
.remove-btn:hover { text-decoration: underline; }

.demo-note { font-size: 11px; color: var(--muted); margin: 8px 0 0; display: flex; align-items: flex-start; gap: 6px; line-height: 1.5; }
.demo-note i { margin-top: 1px; color: var(--blue); }
.demo-note.status-ok { color: var(--green); }
.demo-note.status-error { color: var(--red); }

/* Tech pack dropzone */
.dropzone-compact { padding: 14px; }
.dropzone-compact .dropzone-empty i { font-size: 20px; margin-bottom: 5px; }
.techpack-icon { font-size: 26px; color: var(--red); flex-shrink: 0; }

/* Consent + privacy */
.consent-box { margin-top: 16px; padding: 13px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.consent-label { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: var(--text); cursor: pointer; margin: 0; font-weight: 500; }
.consent-label input { width: auto; margin-top: 2px; accent-color: var(--blue); cursor: pointer; }
.privacy-notice { font-size: 10.5px; color: var(--muted); margin: 9px 0 0; padding-top: 9px; border-top: 1px solid var(--border); display: flex; align-items: flex-start; gap: 6px; line-height: 1.5; }
.privacy-notice i { color: var(--tan); margin-top: 1px; }

/* Buttons */
.btn-gradient {
  position: relative; overflow: hidden;
  width: 100%; margin-top: 20px; padding: 12px; border: 1px solid var(--blue); border-radius: var(--radius);
  background: var(--blue); color: #fff; font-weight: 600; font-size: 13.5px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, transform .1s;
}
.btn-gradient:hover { background: var(--blue2); }
.btn-gradient:active { transform: scale(.99); }
.btn-gradient.btn-purple { background: var(--tan); border-color: var(--tan); }
.btn-gradient.btn-purple:hover { background: #9c7a5c; }
.btn-gradient:disabled { opacity: .6; cursor: not-allowed; }
.btn-gradient .btn-spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.35); transform: scale(0); animation: rippleAnim .5s ease-out; pointer-events: none; }
@keyframes rippleAnim { to { transform: scale(3); opacity: 0; } }

.btn { font-family: var(--font-body); font-size: 12.5px; font-weight: 500; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-solid); color: var(--text); cursor: pointer; transition: border-color .15s; }
.btn:hover { border-color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }

.result-area { margin-top: 18px; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--border) 25%, rgba(150,150,150,.15) 50%, var(--border) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; height: 16px; margin-bottom: 10px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Seller result */
.status-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12.5px; animation: fadeUp .3s ease; font-family: var(--font-mono); }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; font-family: var(--font-mono); }
.badge-green { background: #E4F1E7; color: var(--green); }
.badge-red { background: #F8E5E3; color: var(--red); }
.badge-neutral { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.flag-card { background: var(--tan-soft); border: 1px solid var(--tan); color: #7a5836; padding: 11px 13px; border-radius: var(--radius); margin-bottom: 12px; font-size: 12.5px; animation: fadeUp .3s ease; }

.table-wrap { border-radius: var(--radius); border: 1px solid var(--border); overflow: auto; animation: fadeUp .3s ease; max-height: 320px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--font-mono); }
thead th { position: sticky; top: 0; background: var(--surface-solid); z-index: 1; }
th, td { padding: 10px 9px; text-align: center; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-family: var(--font-body); }
td:first-child, th:first-child { text-align: left; font-family: var(--font-body); font-weight: 600; }
tbody tr:nth-child(even) { background: var(--bg); }
tbody tr:hover td { background: var(--tan-soft); }
th.size-col.active, td.size-col-active { color: var(--blue); background: var(--tan-soft); }
th.size-col:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
table input.chart-cell { width: 100%; min-width: 46px; text-align: center; font-family: var(--font-mono); font-size: 13px; border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 4px 2px; color: var(--text); }
table input.chart-cell:focus { outline: none; border-color: var(--blue); background: var(--tan-soft); }

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

/* Shopper result — AI card with ring */
.rec-hero { text-align: center; padding: 8px 0 4px; animation: fadeUp .3s ease; }
.rec-hero .label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-mono); }
.ring-wrap { position: relative; width: 130px; height: 130px; margin: 12px auto; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 9; }
.ring-fill { fill: none; stroke: var(--blue); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-size { font-family: var(--font-heading); font-size: 30px; font-weight: 700; color: var(--text); line-height: 1; }
.ring-pct { font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.match-badge { display: inline-block; margin-top: 4px; padding: 5px 14px; border-radius: 20px; font-weight: 700; font-size: 11.5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }
.match-excellent { background: #E4F1E7; color: var(--green); }
.match-good { background: #F3EBD8; color: #79601a; }
.match-low { background: #F8E5E3; color: var(--red); }
.latency-pill { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); }

.size-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 12.5px; font-family: var(--font-mono); }
.size-row .sz { width: 24px; font-weight: 700; }
.progress-track { flex: 1; height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--blue); width: 0; transition: width 1s ease; }
.size-row .pct { width: 38px; text-align: right; color: var(--muted); }
.size-row.recommended .sz, .size-row.recommended .pct { color: var(--blue); font-weight: 700; }

.why-title { margin: 20px 0 10px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .why-grid { grid-template-columns: 1fr; } }
.why-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; font-size: 12px; transition: border-color .15s; animation: fadeUp .3s ease; }
.why-card:hover { border-color: var(--blue); }
.why-card i { color: var(--blue); margin-right: 6px; font-size: 13px; }
.why-card b { display: block; margin-bottom: 4px; font-size: 12.5px; font-family: var(--font-body); }
.priv-note { margin-top: 16px; font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* AI pipeline visualization */
.pipeline-run { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.pipeline-progress-track { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.pipeline-progress-fill { height: 100%; width: 0%; background: var(--blue); transition: width .4s ease; }
.pipeline-step { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 7px 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); opacity: .5; transition: opacity .3s, border-color .3s; }
.pipeline-step.running { opacity: 1; border-color: var(--blue); }
.pipeline-step.done { opacity: 1; border-color: var(--green); }
.pipeline-step .step-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; background: var(--border); color: var(--muted); flex-shrink: 0; }
.pipeline-step.running .step-icon { background: var(--blue); color: #fff; }
.pipeline-step.done .step-icon { background: var(--green); color: #fff; }
.pipeline-step .step-name { flex: 1; font-weight: 600; }
.pipeline-step .step-status { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; font-family: var(--font-mono); }

/* Explainability detail list */
.explain-detail { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px; margin-top: 12px; font-size: 12px; }
.explain-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.explain-row:last-child { border-bottom: none; }
.explain-row .k { color: var(--muted); font-weight: 600; }
.explain-row .v { font-weight: 700; text-align: right; font-family: var(--font-mono); }

/* Interactive chart extras */
.chart-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-btn { background: var(--surface-solid); border: 1px solid var(--border); color: var(--text); font-size: 11px; font-weight: 600; padding: 6px 12px; border-radius: 20px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s; font-family: var(--font-body); }
.chip-btn:hover { border-color: var(--blue); }
.chip-btn.report { color: var(--blue); }
.custom-tooltip { position: absolute; background: var(--text); color: var(--bg); font-size: 11px; padding: 7px 10px; border-radius: 6px; max-width: 240px; z-index: 400; pointer-events: none; box-shadow: var(--shadow-lg); line-height: 1.5; opacity: 0; transition: opacity .15s; font-family: var(--font-mono); }
.custom-tooltip.show { opacity: 1; }
tr.row-recommended td { background: var(--tan-soft) !important; font-weight: 700; }
tr.row-recommended td:first-child { position: relative; }

/* Print-friendly export */
@media print {
  .topbar, .sidebar, .tabs, .stats, .workflow, .about, .tech, .footer, .fab, .toast-container,
  .demo-banner, #tabPanelShopper, .btn-gradient, .chart-toolbar, .loading-overlay { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* Stats */
.stats { max-width: 1440px; margin: 40px auto 0; padding: 0 28px; }
.stats-head { text-align: center; margin-bottom: 20px; }
.stats-head h2 { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.stats-note { color: var(--muted); font-size: 12px; max-width: 560px; margin: 0 auto; line-height: 1.6; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
@media (max-width: 880px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
.stat-card { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat-card i { font-size: 18px; color: var(--blue); margin-bottom: 8px; display: block; }
.stat-num { display: block; font-family: var(--font-mono); font-size: 22px; font-weight: 700; }
.stat-num.stat-text { font-size: 14px; }
.stat-card small { color: var(--muted); font-size: 11.5px; }

/* Workflow */
.workflow { max-width: 1440px; margin: 40px auto; padding: 0 28px; text-align: center; }
.workflow h2, .about h2, .tech h2 { font-size: 21px; margin-bottom: 24px; font-weight: 700; }
.pipeline { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.node { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 12px; width: 108px; }
.node i { font-size: 16px; color: var(--blue); }
.node span { font-size: 11px; font-weight: 600; }
.arrow { color: var(--muted); font-size: 12px; }

/* About */
.about { max-width: 1440px; margin: 40px auto; padding: 0 28px; text-align: center; }
.about-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; text-align: left; }
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; } }
.about-card { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.about-card h3 { font-size: 13.5px; margin-top: 0; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.about-card h3 i { color: var(--tan); }
.about-card p { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.about-card ul { list-style: none; padding: 0; margin: 0; }
.about-card li { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.about-card li i { color: var(--green); margin-right: 8px; }

/* Tech */
.tech { max-width: 1440px; margin: 40px auto 50px; padding: 0 28px; text-align: center; }
.tech-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 12px; }
@media (max-width: 880px) { .tech-grid { grid-template-columns: repeat(3,1fr); } }
.tech-card { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 8px; box-shadow: var(--shadow); }
.tech-card i { font-size: 18px; color: var(--blue); display: block; margin-bottom: 8px; }
.tech-card span { font-size: 11px; font-weight: 600; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 32px 24px 26px; margin-top: 10px; }
.footer-inner { max-width: 1440px; margin: 0 auto; text-align: center; }
.footer-inner p { color: var(--muted); font-size: 12px; margin: 8px 0 16px; }
.footer-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; }
.footer-links a:hover { color: var(--blue); }

/* FAB */
.fab { position: fixed; bottom: 24px; right: 24px; width: 42px; height: 42px; border-radius: 50%; background: var(--blue); color: #fff; border: none; box-shadow: var(--shadow-lg); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 90; }
.fab.show { opacity: 1; pointer-events: auto; }

/* Loading overlay */
.loading-overlay { position: fixed; inset: 0; background: rgba(20,19,17,.55); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px; z-index: 200; }
.loading-overlay.show { display: flex; }
.spinner { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { color: #fff; font-weight: 600; font-size: 13px; }

/* Toasts */
.toast-container { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { background: var(--surface-solid); border: 1px solid var(--border); border-left: 3px solid var(--green); box-shadow: var(--shadow-lg); padding: 11px 14px; border-radius: var(--radius); font-size: 12.5px; min-width: 230px; display: flex; align-items: center; gap: 10px; animation: slideIn .25s ease; }
.toast.error { border-left-color: var(--red); }
.toast i { font-size: 14px; }
.toast.success i { color: var(--green); }
.toast.error i { color: var(--red); }
.toast span { flex: 1; }
.toast-close { background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px; font-size: 11px; line-height: 1; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Demo scenarios */
.demo-scenarios { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 16px; }
.demo-scenarios-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; color: var(--muted); margin-right: 2px; text-transform: uppercase; letter-spacing: .05em; }

/* Optional measurements */
.optional-measurements { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); }
.optional-measurements summary { cursor: pointer; font-size: 12px; font-weight: 700; list-style: none; }
.optional-measurements summary::-webkit-details-marker { display: none; }
.optional-measurements summary::before { content: "\25B8"; margin-right: 6px; display: inline-block; transition: transform .15s; }
.optional-measurements[open] summary::before { transform: rotate(90deg); }

.advanced-analysis { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); }
.advanced-analysis summary { cursor: pointer; font-size: 12px; font-weight: 700; list-style: none; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.advanced-analysis summary::-webkit-details-marker { display: none; }
.advanced-analysis summary::before { content: "\25B8"; margin-right: 6px; display: inline-block; transition: transform .15s; }
.advanced-analysis[open] summary::before { transform: rotate(90deg); }
.advanced-analysis[open] summary { margin-bottom: 8px; }
.advanced-analysis .why-title:first-of-type { margin-top: 4px; }

/* V2 result cards */
.risk-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-family: var(--font-mono); }
.risk-low { background: #E4F1E7; color: var(--green); }
.risk-medium { background: #F3EBD8; color: #79601a; }
.risk-high { background: #F8E5E3; color: var(--red); }
.profile-card { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 13px; margin-top: 14px; font-size: 12px; }
.profile-card i { font-size: 16px; color: var(--tan); }
.profile-card b { display: block; font-size: 12.5px; }
.profile-card small { color: var(--muted); }
.source-tag { font-family: var(--font-mono); font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 1px 6px; border-radius: 6px; margin-left: 5px; vertical-align: middle; }
.source-provided { background: #E4F1E7; color: var(--green); }
.source-estimated { background: var(--border); color: var(--muted); }
.no-suitable-banner { background: #F8E5E3; border: 1px solid #E3B3AC; color: #7a2c25; border-radius: var(--radius); padding: 13px; margin-top: 14px; font-size: 12px; }
.no-suitable-banner b { display: block; font-size: 13px; margin-bottom: 6px; }

/* Copy SKU button */
.copy-btn { background: var(--surface-solid); border: 1px solid var(--border); color: var(--text); font-size: 10.5px; font-weight: 600; padding: 5px 10px; border-radius: 20px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); }
.copy-btn:hover { border-color: var(--blue); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* Garment diagram */
.diagram-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.diagram-note { font-size: 11px; color: var(--muted); text-align: center; max-width: 260px; }
.diagram-note b { color: var(--tan); font-weight: 700; }

/* Responsive: mobile sidebar */
@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar.open { display: flex; }
  .sidebar-toggle { display: inline-flex; }
  .workspace { padding: 18px 16px 40px; }
  .content-grid-2 { grid-template-columns: 1fr !important; }
}
