:root {
  color-scheme: light;
  --brand-red: oklch(61% 0.245 28);
  --brand-red-dark: oklch(48% 0.205 28);
  --brand-blue: oklch(49% 0.174 257);
  --brand-blue-dark: oklch(38% 0.145 257);
  --brand-blue-soft: oklch(95% 0.025 257);
  --neutral-0: oklch(99% 0.004 257);
  --neutral-25: oklch(97.5% 0.006 257);
  --neutral-50: oklch(95.5% 0.008 257);
  --neutral-100: oklch(92% 0.009 257);
  --neutral-200: oklch(86% 0.01 257);
  --neutral-400: oklch(62% 0.018 257);
  --neutral-600: oklch(42% 0.024 257);
  --neutral-800: oklch(25% 0.022 257);
  --neutral-900: oklch(18% 0.019 257);
  --success: oklch(49% 0.13 151);
  --success-soft: oklch(94% 0.035 151);
  --warning: oklch(60% 0.145 72);
  --warning-soft: oklch(95% 0.045 82);
  --danger-soft: oklch(95% 0.035 28);
  --surface: var(--neutral-0);
  --canvas: var(--neutral-25);
  --sidebar: oklch(96.5% 0.011 257);
  --text: var(--neutral-900);
  --text-muted: var(--neutral-600);
  --border: var(--neutral-100);
  --border-strong: var(--neutral-200);
  --shadow-sm: 0 1px 2px oklch(25% 0.02 257 / 0.07);
  --shadow-md: 0 14px 34px oklch(25% 0.02 257 / 0.1);
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --z-sticky: 200;
  --z-toast: 500;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, label:has(input:focus-visible) {
  outline: 3px solid oklch(66% 0.15 257 / 0.55);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--brand-blue-dark); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; transform: translateY(-150%); background: var(--neutral-900); color: var(--neutral-0); padding: 8px 12px; z-index: 999; }
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 16px 16px;
  display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--border);
}
.brand-lockup { display: grid; gap: 8px; padding: 0 8px 28px; }
.brand-lockup img { width: 178px; height: auto; object-fit: contain; }
.brand-lockup span { color: var(--text-muted); font-size: .75rem; letter-spacing: .03em; }
.primary-nav { display: grid; gap: 4px; }
.nav-item {
  min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--text-muted); text-align: left;
}
.nav-item:hover { background: var(--neutral-50); color: var(--text); }
.nav-item.is-active { background: var(--neutral-0); color: var(--brand-blue-dark); border-color: var(--border); box-shadow: var(--shadow-sm); font-weight: 650; }
.nav-icon { width: 22px; text-align: center; color: currentColor; font-size: 1.15rem; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 12px; color: var(--text-muted); font-size: .8125rem; border-top: 1px solid var(--border); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

main { min-width: 0; }
.route-view { min-height: 100vh; }
.topbar { min-height: 96px; padding: 20px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar h1 { margin: 0; font-size: 1.75rem; line-height: 1.15; letter-spacing: -.025em; }
.eyebrow, .section-kicker { margin: 0 0 4px; color: var(--brand-red-dark); font-size: .75rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.primary-button, .secondary-button, .view-switcher button, .pagination button {
  min-height: 44px; border-radius: var(--radius-sm); border: 1px solid transparent; padding: 9px 14px; font-weight: 650;
}
.primary-button { background: var(--brand-blue); color: var(--neutral-0); box-shadow: 0 1px 2px oklch(25% 0.02 257 / .12); }
.primary-button:hover { background: var(--brand-blue-dark); }
.primary-button:active { transform: translateY(1px); }
.secondary-button { background: var(--neutral-0); border-color: var(--border-strong); color: var(--text); }
.secondary-button:hover { background: var(--neutral-50); }
.view-switcher { display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--neutral-50); border: 1px solid var(--border); border-radius: var(--radius-md); }
.view-switcher button { min-height: 36px; padding: 6px 10px; background: transparent; color: var(--text-muted); }
.view-switcher button.is-active { background: var(--neutral-0); color: var(--brand-blue-dark); box-shadow: var(--shadow-sm); }

.import-banner { margin: 16px 28px 0; padding: 12px 16px; background: var(--brand-blue-soft); border: 1px solid oklch(85% .04 257); border-radius: var(--radius-md); color: var(--brand-blue-dark); }
.import-banner.is-error { background: var(--danger-soft); border-color: oklch(85% .06 28); color: var(--brand-red-dark); }
.summary-strip { display: flex; align-items: stretch; min-height: 78px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; }
.summary-strip > div { min-width: 145px; padding: 14px 20px; display: grid; align-content: center; gap: 2px; border-right: 1px solid var(--border); }
.summary-strip span { color: var(--text-muted); font-size: .75rem; }
.summary-strip strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.summary-strip .last-update { min-width: 230px; }
.summary-strip .delta { margin-left: auto; min-width: 260px; display: flex; align-items: center; gap: 16px; border-right: 0; }
.delta b { color: var(--text); margin-left: 3px; }
.delta-new { color: var(--success) !important; }
.delta-changed { color: var(--brand-blue-dark) !important; }
.delta-eol { color: var(--brand-red-dark) !important; }

.catalog-workspace { padding: 20px 28px 28px; }
.search-toolbar { min-height: 64px; display: grid; grid-template-columns: minmax(260px, 1fr) 190px 160px auto; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.search-field { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px; background: var(--neutral-25); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
input::placeholder { color: var(--neutral-600); opacity: 1; }
select { min-height: 42px; width: 100%; padding: 0 34px 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--neutral-0); color: var(--text); }
.workspace-grid { display: grid; grid-template-columns: minmax(540px, 1.12fr) minmax(390px, .88fr); min-height: calc(100vh - 280px); border: 1px solid var(--border); border-top: 0; background: var(--surface); }
.results-pane { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.pane-heading { min-height: 60px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); }
.pane-heading h2 { margin: 0; font-size: 1rem; }
.pane-heading span { color: var(--text-muted); font-size: .75rem; }
.page-size { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .75rem; }
.page-size select { min-height: 34px; width: 72px; }
.table-scroll { overflow: auto; flex: 1; }
.product-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .8125rem; }
.product-table th { position: sticky; top: 0; z-index: var(--z-sticky); padding: 9px 10px; background: var(--neutral-50); border-bottom: 1px solid var(--border-strong); color: var(--text-muted); text-align: left; font-size: .6875rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.product-table th:nth-child(1) { width: 118px; }
.product-table th:nth-child(3) { width: 130px; }
.product-table th:nth-child(4) { width: 76px; }
.product-table th:nth-child(5) { width: 88px; }
.product-table th:nth-child(6) { width: 106px; }
.product-table td { padding: 10px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.product-row { cursor: pointer; }
.product-row:hover { background: var(--neutral-25); }
.product-row.is-selected { background: var(--brand-blue-soft); box-shadow: inset 3px 0 var(--brand-blue); }
.product-row:focus-visible { outline: 3px solid oklch(66% .15 257 / .55); outline-offset: -3px; }
.product-code { color: var(--brand-blue-dark); font-weight: 700; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 2px 7px; border-radius: 999px; font-size: .6875rem; font-weight: 750; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-active { background: var(--success-soft); color: oklch(39% .12 151); }
.status-eol { background: var(--danger-soft); color: var(--brand-red-dark); }
.pagination { min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .8125rem; }
.pagination div { display: flex; gap: 4px; }
.pagination button { min-width: 40px; padding: 6px; background: var(--surface); border-color: var(--border-strong); color: var(--text); }

.detail-pane { min-width: 0; background: var(--neutral-25); overflow: auto; }
.detail-empty, .analysis-empty { min-height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 40px; text-align: center; color: var(--text-muted); }
.detail-empty > span, .analysis-empty > span { font-size: 2rem; color: var(--brand-blue); }
.detail-empty h2, .analysis-empty h2 { margin: 0; color: var(--text); font-size: 1.125rem; }
.detail-empty p, .analysis-empty p { margin: 0; max-width: 42ch; }
.detail-header { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.detail-header h2 { margin: 2px 0 3px; font-size: 1.15rem; line-height: 1.25; }
.detail-header p { margin: 0; color: var(--text-muted); font-size: .75rem; }
.media-indicators { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.media-indicator { min-height: 25px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); background: var(--neutral-50); font-size: .6875rem; font-weight: 650; opacity: .48; text-decoration: none; }
.media-indicator > span { min-width: 17px; font-size: .625rem; font-weight: 800; text-align: center; }
.media-indicator.is-available { border-color: oklch(79% .08 257); color: var(--brand-blue-dark); background: var(--brand-blue-soft); opacity: 1; cursor: pointer; }
.media-indicator.is-available:hover { border-color: var(--brand-blue); background: oklch(92% .045 257); }
.media-indicator.is-available:focus-visible { outline: 3px solid oklch(66% .15 257 / .45); outline-offset: 2px; }
.close-detail { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.product-hero { display: grid; grid-template-columns: minmax(180px, .75fr) 1fr; border-bottom: 1px solid var(--border); background: var(--surface); }
.product-media { position: relative; z-index: 1; min-width: 0; min-height: 250px; display: grid; align-content: center; gap: 10px; padding: 14px; background: var(--neutral-0); border-right: 1px solid var(--border); }
.gallery-stage { position: relative; min-width: 0; }
.gallery-main-link { display: grid; place-items: center; min-height: 210px; border-radius: var(--radius-sm); background: var(--surface); }
.gallery-main-image { width: 100%; height: 210px; object-fit: contain; transition: transform .2s cubic-bezier(.25, 1, .5, 1); }
.gallery-main-link:hover .gallery-main-image { transform: scale(1.035); }
.gallery-main-link:focus-visible { outline: 3px solid oklch(66% .15 257 / .45); outline-offset: 2px; }
.gallery-count { position: absolute; right: 7px; bottom: 7px; padding: 3px 7px; border-radius: 999px; background: oklch(24% .025 257 / .86); color: var(--neutral-0); font-size: .6875rem; font-weight: 700; }
.gallery-thumbnails { display: grid; grid-auto-flow: column; grid-auto-columns: 48px; gap: 6px; max-width: 100%; padding: 2px; overflow-x: auto; }
.gallery-thumbnail { width: 48px; height: 48px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); opacity: .72; }
.gallery-thumbnail:hover { border-color: var(--brand-blue); opacity: 1; }
.gallery-thumbnail.is-active { border-color: var(--brand-blue); box-shadow: 0 0 0 1px var(--brand-blue); opacity: 1; }
.gallery-thumbnail:focus-visible { outline: 3px solid oklch(66% .15 257 / .45); outline-offset: 2px; }
.gallery-thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.image-placeholder { color: var(--text-muted); text-align: center; }
.identity-list { margin: 0; padding: 18px; display: grid; align-content: start; gap: 10px; }
.identity-list div { display: grid; grid-template-columns: minmax(85px, .8fr) 1.2fr; gap: 8px; }
.identity-list dt { color: var(--text-muted); font-size: .75rem; }
.identity-list dd { margin: 0; font-size: .8125rem; font-weight: 600; overflow-wrap: anywhere; }
.detail-section { padding: 18px; border-bottom: 1px solid var(--border); }
.detail-section h3 { margin: 0 0 12px; font-size: .875rem; }
.detail-section p { margin: 0; color: var(--text-muted); font-size: .875rem; }
.feature-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.feature-table td { padding: 7px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.feature-table td:first-child { width: 48%; color: var(--text); }
.feature-table td strong { font-weight: 600; }
.technical-code { display: block; margin-top: 2px; color: var(--text-muted); font-family: ui-monospace, "Cascadia Mono", monospace; font-size: .65rem; font-weight: 400; }
.feature-table .technical-code { display: inline; margin: 0 0 0 6px; white-space: nowrap; vertical-align: baseline; }
.feature-table .technical-code::before { content: "("; }
.feature-table .technical-code::after { content: ")"; }
.media-list, .history-list { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.media-link { min-height: 46px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); color: var(--text); text-decoration: none; }
.media-link:hover { background: var(--brand-blue-soft); }
.media-link strong { display: block; font-size: .8125rem; }
.media-link small { display: block; color: var(--text-muted); font-size: .6875rem; overflow-wrap: anywhere; }
.media-link > span:last-child { color: var(--brand-blue-dark); }
.description-long { white-space: pre-line; }

.compact-button { min-height: 34px; padding: 5px 9px; font-size: .75rem; }
.wishlist-button { display: inline-flex; align-items: center; gap: 7px; }
.wishlist-button strong { min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--brand-blue-soft); color: var(--brand-blue-dark); font-size: .6875rem; text-align: center; }
.identity-action { align-items: center; }
.account-identity { display: flex; align-items: center; gap: 12px; }
.account-identity > span { display: grid; text-align: right; }
.account-identity strong { font-size: .8125rem; }
.account-identity small { color: var(--text-muted); }
.account-content { min-height: calc(100vh - 96px); padding: 24px 28px 32px; }
.public-account-layout, .private-account-layout { display: grid; gap: 20px; max-width: 1480px; margin: 0 auto; }
.auth-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); align-items: start; gap: 16px; }
.auth-panel, .account-section, .account-welcome { padding: 22px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); }
.auth-panel h2, .account-section h2, .account-welcome h2 { margin: 0; font-size: 1.25rem; }
.auth-panel > p:not(.section-kicker), .account-welcome > p:not(.section-kicker), .account-help { max-width: 70ch; color: var(--text-muted); font-size: .875rem; }
.bootstrap-panel { background: var(--warning-soft); border-color: oklch(83% .07 82); }
.stacked-form { display: grid; gap: 12px; margin-top: 18px; }
.form-grid { grid-template-columns: 1fr 1fr; }
.full-field { grid-column: 1 / -1; }
.stacked-form label, .inline-management-form label, .wishlist-line label, .request-notes, .quote-item label, .quote-terms label { display: grid; align-content: start; gap: 4px; color: var(--text-muted); font-size: .75rem; font-weight: 650; }
.stacked-form input, .inline-form input, .inline-management-form input, .wishlist-line input, .request-notes textarea, .quote-item input, .quote-terms input, .quote-terms textarea {
  min-height: 42px; width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--neutral-0); color: var(--text);
}
.profile-form input, .smtp-settings-form input, .user-editor input { min-height: 42px; width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--neutral-0); color: var(--text); }
.stacked-form input:focus, .inline-form input:focus, .inline-management-form input:focus, .wishlist-line input:focus, .request-notes textarea:focus, .quote-item input:focus, .quote-terms input:focus, .quote-terms textarea:focus, .profile-form input:focus, .smtp-settings-form input:focus, .user-editor input:focus { border-color: var(--brand-blue); outline: 3px solid oklch(66% .15 257 / .3); outline-offset: 0; }
.auth-panel details { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.auth-panel summary { color: var(--brand-blue-dark); font-size: .8125rem; font-weight: 650; cursor: pointer; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.account-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.account-section-heading > span { color: var(--text-muted); font-size: .75rem; }
.wishlist-lines, .people-list, .quote-list, .outbox-list { display: grid; gap: 1px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--border); }
.wishlist-line { display: grid; grid-template-columns: minmax(240px, 1.5fr) 100px minmax(180px, 1fr) auto; align-items: end; gap: 10px; padding: 10px 12px; background: var(--surface); }
.wishlist-line > div, .person-row > span:first-child, .quote-row > span { min-width: 0; }
.wishlist-line strong, .wishlist-line span, .person-row strong, .person-row small { display: block; }
.wishlist-line span, .person-row small { overflow: hidden; color: var(--text-muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.request-notes { margin: 16px 0 12px; }
.request-notes textarea, .quote-terms textarea { resize: vertical; }
.account-empty { min-height: 94px; display: grid; place-content: center; gap: 2px; padding: 18px; background: var(--neutral-25); color: var(--text-muted); text-align: center; }
.account-empty strong { color: var(--text); }
.account-empty span { font-size: .8125rem; }
.person-row { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 12px; background: var(--surface); }
.person-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.danger-button { border-color: oklch(82% .06 28); color: var(--brand-red-dark); }
.danger-button:hover { background: var(--danger-soft); }
.muted { color: var(--text-muted); font-size: .75rem; }
.role-badge, .quote-status { display: inline-flex; align-items: center; min-height: 24px; width: fit-content; padding: 2px 7px; border-radius: 999px; background: var(--neutral-50); color: var(--text-muted); font-size: .6875rem; font-weight: 700; white-space: nowrap; }
.inline-management-form { display: grid; grid-template-columns: 150px 1fr 1fr minmax(210px, 1.2fr) 1fr auto; align-items: end; gap: 8px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.inline-management-form select { min-height: 42px; }
.compact-people { max-height: 340px; overflow: auto; }
.profile-form, .smtp-settings-form { display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); align-items: end; gap: 10px; }
.profile-form label, .smtp-settings-form label, .user-editor label { display: grid; align-content: start; gap: 4px; color: var(--text-muted); font-size: .75rem; font-weight: 650; }
.profile-form button { justify-self: start; }
.account-details { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.account-details summary { width: fit-content; color: var(--brand-blue-dark); font-size: .8125rem; font-weight: 650; cursor: pointer; }
.password-form { max-width: 460px; }
.user-editor { margin-bottom: 16px; padding: 16px; border: 1px solid oklch(82% .055 257); border-radius: var(--radius-sm); background: var(--brand-blue-soft); }
.user-editor h3, .outbox-heading h3 { margin: 0; font-size: 1rem; }
.user-editor .profile-form { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.smtp-settings-form { margin-bottom: 8px; }
.check-field { display: flex !important; grid-template-columns: auto 1fr; align-items: center !important; justify-content: start; gap: 8px !important; min-height: 40px; color: var(--text) !important; }
.check-field input { min-height: 18px; width: 18px; }
.settings-actions { display: flex; align-items: center; gap: 8px; }
.outbox-heading { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.quote-row { min-height: 64px; width: 100%; display: grid; grid-template-columns: minmax(210px, 1fr) minmax(160px, .7fr) auto auto; align-items: center; gap: 14px; padding: 9px 12px; border: 0; background: var(--surface); color: var(--text); text-align: left; }
.quote-row:hover { background: var(--brand-blue-soft); }
.quote-row small { display: block; overflow: hidden; color: var(--text-muted); font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.status-submitted, .status-assigned, .status-in_review { background: var(--warning-soft); color: oklch(42% .11 72); }
.status-quoted { background: var(--brand-blue-soft); color: var(--brand-blue-dark); }
.status-accepted { background: var(--success-soft); color: oklch(39% .12 151); }
.status-rejected, .status-cancelled, .status-expired { background: var(--danger-soft); color: var(--brand-red-dark); }
.quote-detail { border-color: oklch(78% .07 257); box-shadow: var(--shadow-sm); }
.quote-parties { margin: -6px 0 16px; color: var(--text-muted); font-size: .8125rem; }
.quote-items { display: grid; gap: 1px; border: 1px solid var(--border); background: var(--border); }
.quote-item { display: grid; grid-template-columns: minmax(230px, 1.5fr) 90px 130px 100px 90px; align-items: end; gap: 8px; padding: 10px; background: var(--surface); }
.quote-item span strong, .quote-item span small { display: block; }
.quote-item span small { color: var(--text-muted); }
.quote-item input:disabled { background: var(--neutral-50); color: var(--text-muted); }
.quote-terms { display: grid; grid-template-columns: 160px 1fr 1fr; gap: 10px; margin: 14px 0; }
.quote-totals { display: flex; justify-content: flex-end; gap: 20px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.quote-totals span { display: grid; color: var(--text-muted); font-size: .75rem; }
.quote-totals strong { color: var(--text); font-size: 1rem; }
.quote-decisions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.quote-downloads { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.quote-downloads a { display: inline-flex; align-items: center; text-decoration: none; }
.outbox-list details { padding: 10px 12px; background: var(--surface); }
.outbox-list summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.outbox-list summary strong, .outbox-list summary small { display: block; }
.outbox-list summary small { color: var(--text-muted); }
.outbox-list pre { max-width: 100%; overflow: auto; padding: 12px; background: var(--neutral-25); border-radius: var(--radius-sm); white-space: pre-wrap; font: .75rem/1.5 ui-monospace, "Cascadia Mono", monospace; }

body.layout-table .workspace-grid { grid-template-columns: 1fr; }
body.layout-table .results-pane { border-right: 0; }
body.layout-table .detail-pane { position: fixed; left: 252px; right: 20px; bottom: 18px; z-index: 150; max-height: 58vh; border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
body.layout-table .detail-pane:has(.detail-empty) { display: none; }
body.layout-table .product-hero { grid-template-columns: 280px 1fr; }

.simulation-badge { padding: 6px 10px; border-radius: 999px; background: var(--warning-soft); color: oklch(42% .11 72); font-size: .75rem; font-weight: 750; }
.capitolati-layout { display: grid; grid-template-columns: minmax(360px, .72fr) minmax(520px, 1.28fr); min-height: 520px; margin: 24px 28px 0; border: 1px solid var(--border); background: var(--surface); }
.upload-panel { display: flex; flex-direction: column; gap: 20px; padding: 28px; border-right: 1px solid var(--border); }
.upload-panel h2 { margin: 0 0 8px; font-size: 1.35rem; }
.upload-panel p { margin: 0; max-width: 58ch; color: var(--text-muted); }
.drop-zone { min-height: 210px; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 24px; border: 1px dashed var(--neutral-400); border-radius: var(--radius-md); background: var(--neutral-25); text-align: center; cursor: pointer; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--brand-blue); background: var(--brand-blue-soft); }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.drop-zone span { color: var(--text-muted); font-size: .8125rem; }
.upload-icon { color: var(--brand-blue) !important; font-size: 2rem !important; }
.selected-file { padding: 12px; background: var(--success-soft); border: 1px solid oklch(84% .055 151); border-radius: var(--radius-sm); color: oklch(39% .12 151); font-size: .875rem; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: .75rem; }
.privacy-note span { color: var(--success); font-size: .6rem; }
.analysis-panel { min-width: 0; background: var(--neutral-25); overflow: auto; }
.analysis-content { padding: 24px; }
.analysis-content h2 { margin: 0; font-size: 1.35rem; }
.analysis-meta { margin: 4px 0 20px; color: var(--text-muted); font-size: .8125rem; }
.requirements { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 24px; }
.requirement-chip { padding: 5px 8px; border-radius: 999px; background: var(--brand-blue-soft); color: var(--brand-blue-dark); font-size: .75rem; }
.match-list { display: grid; gap: 8px; }
.match-row { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.match-row:hover { border-color: oklch(72% .08 257); }
.match-score { font-size: 1.125rem; font-weight: 750; color: var(--brand-blue-dark); font-variant-numeric: tabular-nums; }
.match-row strong { display: block; font-size: .875rem; }
.match-row small { display: block; color: var(--text-muted); }
.history-section { margin: 20px 28px 28px; background: var(--surface); border: 1px solid var(--border); }
.history-list { margin: 14px; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 12px; background: var(--surface); }
.history-item strong { display: block; font-size: .875rem; }
.history-item span { color: var(--text-muted); font-size: .75rem; }

.empty-state { min-height: 320px; place-content: center; justify-items: center; gap: 8px; padding: 32px; text-align: center; }
.empty-state:not([hidden]) { display: grid; }
.empty-state > span { font-size: 2rem; color: var(--brand-blue); }
.empty-state h3 { margin: 0; }
.empty-state p { margin: 0 0 8px; color: var(--text-muted); }
.skeleton-list { padding: 14px; }
.skeleton-list:not([hidden]) { display: grid; gap: 8px; }
.skeleton-list::before, .skeleton-list::after { content: ""; height: 180px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--neutral-50) 20%, var(--neutral-25) 40%, var(--neutral-50) 60%); background-size: 220% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); display: grid; gap: 8px; }
.toast { max-width: 380px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--neutral-900); color: var(--neutral-0); box-shadow: var(--shadow-md); }
.toast.error { background: var(--brand-red-dark); }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .brand-lockup { padding-inline: 2px; }
  .brand-lockup img { width: 54px; height: 40px; object-fit: cover; object-position: left; }
  .brand-lockup span, .nav-item span:last-child, .sidebar-foot span:last-child { display: none; }
  .nav-item { justify-content: center; }
  .workspace-grid { grid-template-columns: minmax(490px, 1fr) minmax(330px, .72fr); }
  body.layout-table .detail-pane { left: 96px; }
  .search-toolbar { grid-template-columns: 1fr 160px 145px auto; }
  .capitolati-layout { grid-template-columns: minmax(320px, .8fr) minmax(440px, 1.2fr); }
  .inline-management-form { grid-template-columns: repeat(3, 1fr); }
  .quote-item { grid-template-columns: minmax(220px, 1fr) repeat(4, 90px); }
  .profile-form, .smtp-settings-form, .user-editor .profile-form { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}

@media (max-width: 1320px) and (min-width: 821px) {
  .product-table th:nth-child(5), .product-table td:nth-child(5),
  .product-table th:nth-child(6), .product-table td:nth-child(6) { display: none; }
  .product-table th:nth-child(2) { width: auto; }
  .product-table th:nth-child(3) { width: 112px; }
  body.layout-table .product-table th:nth-child(5), body.layout-table .product-table td:nth-child(5),
  body.layout-table .product-table th:nth-child(6), body.layout-table .product-table td:nth-child(6) { display: table-cell; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; z-index: var(--z-sticky); width: 100%; height: auto; padding: 8px 14px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand-lockup { padding: 0; margin-right: auto; }
  .brand-lockup img { width: 118px; height: auto; object-fit: contain; }
  .primary-nav { display: flex; }
  .nav-item { min-width: 46px; padding: 8px; }
  .sidebar-foot { display: none; }
  .topbar { padding: 16px 18px; }
  .topbar-actions { align-items: stretch; }
  .view-switcher span { display: none; }
  .summary-strip > div { min-width: 130px; }
  .catalog-workspace { padding: 14px 18px 20px; }
  .search-toolbar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .workspace-grid { grid-template-columns: 1fr; }
  .results-pane { border-right: 0; }
  .detail-pane { position: fixed !important; inset: 68px 0 0 !important; z-index: 250 !important; max-height: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: var(--shadow-md); }
  .detail-pane:has(.detail-empty) { display: none; }
  .product-hero { grid-template-columns: 220px 1fr !important; }
  .capitolati-layout { grid-template-columns: 1fr; margin: 18px; }
  .upload-panel { border-right: 0; border-bottom: 1px solid var(--border); }
  .analysis-panel { min-height: 440px; }
  .history-section { margin-inline: 18px; }
  .account-content { padding: 18px; }
  .account-identity > span { display: none; }
  .wishlist-line { grid-template-columns: 1fr 90px auto; }
  .wishlist-line > label:nth-of-type(2) { grid-column: 1 / 3; }
  .quote-row { grid-template-columns: 1fr auto; }
  .quote-row > span:nth-child(2) { display: none; }
  .quote-item { grid-template-columns: 1fr 90px 110px; }
  .quote-item label:nth-of-type(4), .quote-item label:nth-of-type(5) { grid-column: auto; }
  .quote-terms { grid-template-columns: 1fr 1fr; }
  .person-row { align-items: flex-start; }
  .person-actions { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-direction: column-reverse; }
  .topbar h1 { font-size: 1.45rem; }
  .primary-button { padding-inline: 11px; }
  .summary-strip .delta { display: none; }
  .search-toolbar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .product-table th:nth-child(3), .product-table td:nth-child(3), .product-table th:nth-child(5), .product-table td:nth-child(5), .product-table th:nth-child(6), .product-table td:nth-child(6) { display: none; }
  .product-table th:nth-child(2) { width: auto; }
  .product-hero { grid-template-columns: 1fr !important; }
  .product-media { border-right: 0; border-bottom: 1px solid var(--border); }
  .capitolati-layout, .history-section { margin-inline: 10px; }
  .upload-panel { padding: 20px; }
  .match-row { grid-template-columns: 62px 1fr; }
  .match-row > span:last-child { display: none; }
  .account-content { padding: 10px; }
  .account-topbar { align-items: center; }
  .auth-panel, .account-section, .account-welcome { padding: 16px; }
  .form-grid, .inline-form, .inline-management-form, .wishlist-line, .quote-item, .quote-terms, .profile-form, .smtp-settings-form, .user-editor .profile-form { grid-template-columns: 1fr; }
  .full-field, .wishlist-line > label:nth-of-type(2) { grid-column: auto; }
  .wishlist-line { align-items: stretch; }
  .wishlist-line .remove-wishlist { justify-self: start; }
  .quote-row { grid-template-columns: 1fr; }
  .quote-status { justify-self: start; }
  .quote-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .quote-decisions { display: grid; }
  .quote-downloads { display: grid; }
  .person-row, .person-actions { display: grid; justify-content: stretch; }
  .person-actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
