.login-page { margin: 0; min-height: 100dvh; display: grid; place-items: center; background: #10151e; color: #e8edf5; font: 16px/1.5 system-ui, sans-serif; }
.login-card { width: min(420px, calc(100% - 40px)); box-sizing: border-box; padding: 32px; background: #19212e; border: 1px solid #354155; border-radius: 16px; }
.login-card .login-brand { font-size: 30px; font-weight: 800; }.login-brand span { color: #6ee7b7; }
.login-card h1 { font-size: 23px; }.login-card p { color: #b2bfd1; }
.login-card form { display: grid; gap: 12px; }.login-card label { margin-top: 8px; }
.login-card input, .login-card button { box-sizing: border-box; width: 100%; min-width: 0; padding: 12px; border-radius: 8px; font: inherit; }
.login-card input { border: 1px solid #52637c; background: #10151e; color: inherit; }
.login-card button { margin-top: 12px; border: 0; background: #6ee7b7; color: #10251c; cursor: pointer; font-weight: 700; }
.login-card button:disabled { opacity: .6; }.login-card #login-error { color: #ffacac; margin: 0; }
.auth-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; font-size: 14px; color: #b2bfd1; }
.auth-account button { width: auto; padding: 6px 12px; }

/* Shared workspace shell. Loaded after page styles on every working page. */
:root {
  --muted: #a0afc2;
  --line: #2c3b4e;
  --panel: #131e2d;
  --accent: #6ee7bd;
  --chrome-height: 72px;
}
html { scroll-padding-top: calc(var(--chrome-height) + 24px); }
body:not(.login-page) { padding-top: var(--chrome-height); line-height: 1.5; }
body:not(.login-page) main { min-width: 0; padding: 26px 28px 48px; }
body:not(.login-page) a { color: #a5d3ff; text-underline-offset: 3px; }
body:not(.login-page) button { min-height: 40px; min-width: 0; width: auto; font: inherit; font-weight: 650; border-radius: 8px; padding: 9px 15px; }
body:not(.login-page) button.secondary { background: #203044; color: #e6eef8; border: 1px solid #3a4d65; }
body:not(.login-page) button:enabled:hover { filter: brightness(1.12); }
body:not(.login-page) button:disabled { cursor: not-allowed; }
body:not(.login-page) input:not([type=checkbox]), body:not(.login-page) select, body:not(.login-page) textarea {
  font: inherit; min-height: 42px; border-radius: 8px;
}
body:not(.login-page) input::placeholder, body:not(.login-page) textarea::placeholder { color: #94a5bc; opacity: 1; }
input[type=checkbox] { accent-color: var(--accent); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid #94d7ff; outline-offset: 3px; }
body:not(.login-page) :is(button, input, select, summary, [tabindex]) { scroll-margin-block: calc(var(--chrome-height) + 24px) 100px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 200; background: #203044; padding: 12px 18px; border: 2px solid var(--accent); border-radius: 8px; }
.skip-link:focus { top: 10px; }
.workspace-bar { position: fixed; inset: 0 0 auto; height: var(--chrome-height); z-index: 30; display: flex; align-items: center; gap: 32px; padding: 12px 28px; background: #0e1723; border-bottom: 1px solid var(--line); }
.workspace-bar .brand { color: #f3f8ff; font-size: 25px; flex-shrink: 0; text-decoration: none; }
.workspace-nav { display: flex; gap: 6px; min-width: 0; }
.workspace-nav a { padding: 10px 16px; color: #b9c8d9 !important; text-decoration: none; border: 1px solid transparent; border-radius: 8px; white-space: nowrap; font-weight: 600; }
.workspace-nav a:hover { background: #1a283a; }
.workspace-nav a[aria-current=page] { background: #203b36; border-color: #3e7363; color: #b8f9dd !important; }
.workspace-bar .auth-account { margin: 0 0 0 auto; gap: 14px; font-size: 12px; }
.workspace-bar #logout-button { font-size: 13px; padding: 8px 13px; }
main > header { margin-bottom: 20px; }
main > header > div { min-width: 0; }
main > header h1 { font-size: 30px; line-height: 1.25; }
.eyebrow, .section-label { font-size: 11px; letter-spacing: 1.1px; }
.panel, .metric { border-color: var(--line); }
.notice { line-height: 1.6; overflow-wrap: anywhere; }
.context-help { margin: 12px 0 20px; color: var(--muted); }
.context-help summary, .table-note summary { cursor: pointer; color: #b5c9de; font-size: 13px; }
.context-help p { max-width: 950px; }
.inline-feedback { color: var(--accent); font-size: 13px; margin: 10px 0; }
.empty-state { padding: 24px 16px; color: var(--muted); text-align: center; white-space: normal; }
.empty-state strong { color: #dce6f0; display: block; margin-bottom: 6px; }
.empty-state button { margin-top: 12px; }
.scroll-hint { font-size: 12px; color: var(--muted); }
.table-scroll { scrollbar-color: #627b96 #0d1623; scrollbar-width: auto; }
.table-scroll:focus-visible { outline-offset: -2px; }
table { font-variant-numeric: tabular-nums; }
thead th { color: #b9c8d9; line-height: 1.4; }
tbody tr:hover td { background-color: #1c2d40; }

/* Cats: persistent navigation, compact overview, and reachable editor actions. */
.cats-page aside { top: var(--chrome-height); width: 240px; padding: 20px 14px; }
.cats-page main { margin-left: 240px; width: calc(100% - 240px); }
.cats-page .section-label { margin: 0 0 12px; color: #dce6f0; }
.cats-page #cat-search { font-size: 13px; }
#cat-filter { margin-top: 8px; font-size: 12px; }
.cats-page .cat-count { font-size: 12px; }
.cats-page .cat-entry { padding: 10px; min-height: 62px; background: transparent; border: 1px solid transparent; }
.cats-page .cat-entry:hover { background: #1b2d3d; }
.cats-page .cat-entry.selected { background: #1b3835; border-color: #4c8a73; box-shadow: inset 3px 0 var(--accent); }
.cats-page .cat-entry small { font-size: 12px; }
.cat-entry-status { font-size: 10px; color: var(--muted); font-weight: 400; }
.cat-entry-status[data-fresh=true] { color: var(--accent); }
.cats-page .aside-footer p { font-size: 11px; }
.cats-page .global-panel { padding: 12px 16px; margin-bottom: 18px; border: 1px solid var(--line); background: #101a28; }
.cats-page .global-panel-head { gap: 12px; }
.cats-page .global-panel-head h2 { font-size: 14px; margin: 0; }
.cats-page #processes-button { display: flex; flex-direction: row; align-items: center; gap: 14px; }
.cats-page #processes-count { margin: 0; font-size: 11px; }
.cats-page .metrics { gap: 12px; margin-bottom: 18px; }
.cats-page .metric { padding: 16px; min-height: 112px; }
.cats-page .metric strong { font-size: clamp(18px, 1.7vw, 25px); margin: 8px 0; }
.cats-page .metric small { font-size: 11px; }
.cats-page #coordinates { font-size: 18px; }
.cats-page .control { padding: 20px; gap: 16px; margin-bottom: 18px; }
.cats-page .control > .control-buttons { flex-basis: 100%; }
.cats-page .cat-control-status { padding: 10px 14px; }
.cats-page .panel-head { padding: 18px 20px; }
.cats-page .inventory { overflow: visible; }
.inventory-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 20px 12px; }
.inventory-tools label { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.inventory-tools select { width: auto; max-width: 100%; font-size: 12px; }
.cats-page .totals { padding: 0 20px 14px; }
.cats-page .edit-toolbar { position: sticky; top: var(--chrome-height); z-index: 8; background: #19352f; border: 1px solid #4c8a73; padding: 12px 20px; margin: 0; box-shadow: 0 4px 14px #0005; }
.cats-page .edit-toolbar p { margin: 0; font-size: 12px; }
.cats-page .edit-toolbar .control-buttons { flex-shrink: 0; }
.cats-page .inventory .table-scroll { max-height: 640px; }
.cats-page .inventory th { white-space: normal; min-width: 95px; }
.cats-page .inventory td, .cats-page .inventory th { padding: 12px; }
.cats-page .inventory td:first-child, .cats-page .inventory th:first-child { min-width: 220px; max-width: 320px; white-space: normal; }
.cats-page .inventory th.trade-sell { border-top: 3px solid #6ee7bd; }
.cats-page .inventory th.trade-buy { border-top: 3px solid #88b9ff; }
.cats-page .trade-checkbox { width: 19px; height: 19px; }
.cats-page .table-note { margin: 0; padding: 14px 20px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.cats-page .bottom-grid { gap: 18px; }
.cats-page .events { font-size: 12px; }

/* Product lists and the manual price workflow. */
.products-page main { max-width: 1900px; }
.products-page .product-tools { gap: 12px; }
.products-page #product-search { width: 300px; max-width: 100%; }
.products-page #product-list-sort { width: 220px; }
.products-page #product-count { margin: 14px 0; font-size: 13px; }
.products-page .product-item-link { color: #e4effb; text-decoration: none; }
.products-page .product-item-link:hover { color: var(--accent); text-decoration: underline; }
.products-page #product-list th { white-space: normal; max-width: 180px; font-size: 12px; }
.products-page #product-list td:first-child { min-width: 235px; white-space: normal; }
.products-page .product-facts { padding: 16px 20px; gap: 12px; }
.products-page .product-facts p { font-size: 12px; margin: 0; }
.workflow-steps { display: flex; flex-wrap: wrap; gap: 12px 24px; list-style: none; counter-reset: step; padding: 0; margin: 20px 0 12px; }
.workflow-steps li { counter-increment: step; display: flex; align-items: center; gap: 9px; font-size: 13px; }
.workflow-steps li::before { content: counter(step); border: 1px solid #497766; background: #1b3835; color: var(--accent); border-radius: 50%; width: 27px; height: 27px; display: grid; place-items: center; font-weight: 700; }
.products-page .bulk-prices { padding: 14px; background: #0f1926; border: 1px solid var(--line); border-radius: 8px; align-items: end; }
.products-page .bulk-prices input { width: 160px; }
.products-page .product-cat summary { background: #182638; border-radius: 8px; }
.products-page .product-cat summary small { flex-basis: 100%; padding-left: 28px; font-size: 11px; }
.products-page .product-cat[open] summary { border-radius: 8px 8px 0 0; }
.products-page .product-save-bar { position: sticky; bottom: 12px; z-index: 4; background: #182b38; padding: 12px; border: 1px solid #42687a; border-radius: 10px; margin: 16px 0 10px; box-shadow: 0 6px 20px #0005; }
.products-page .product-save-bar p { color: #d2e5f4; font-size: 13px; margin: 0 0 8px; }
.product-columns > .panel { overflow: visible; }
.products-page #price-preview .product-tools { position: sticky; bottom: -22px; background: #142130; padding: 12px 0; }

/* Auto-pricing: clear steps, distinct tabs and a short always-visible save summary. */
.auto-prices-page .auto-chrome { position: sticky; top: var(--chrome-height); padding: 10px 0; z-index: 9; }
.auto-prices-page #auto-agent-state { display: inline-block; padding: 6px 12px; background: #1b3835; border: 1px solid #395e53; border-radius: 20px; color: #b7eed8; font-size: 12px; }
.auto-prices-page .auto-tabs { gap: 6px; }
.auto-prices-page .auto-tabs button { background: #172536; color: #bacbdd; border: 1px solid var(--line); min-width: 130px; }
.auto-prices-page .auto-tabs button[aria-selected=true] { background: #6ee7bd; color: #0b211b; border-color: #6ee7bd; }
.auto-prices-page .auto-workspace-card { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 18px; }
.auto-prices-page .auto-workspace-heading { display: inline; }
.auto-prices-page h3.auto-workspace-heading { display: block; }
.auto-prices-page .auto-workspace-card > h3 { margin: 0 0 16px; font-size: 16px; }
.auto-prices-page #auto-dialog label { font-size: 13px; }
.auto-prices-page #auto-dialog p { font-size: 13px; }
.auto-prices-page #auto-dialog input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; }
.auto-prices-page #auto-dialog details > label { margin-top: 12px; }
.auto-prices-page #auto-targets { background: #101a28; }
.auto-prices-page .auto-target:has(input:checked) { background: #1b3835; }
.auto-prices-page .auto-workspace-save { grid-column: 1 / -1; background: #182b38; border: 1px solid #42687a; padding: 12px 16px; border-radius: 10px; }
.auto-prices-page .auto-workspace-save .auto-actions { justify-content: flex-start; }
.auto-prices-page .auto-workspace-save > h3 { margin: 0 0 12px; font-size: 16px; }
.auto-prices-page .auto-workspace-save p { text-align: left; margin: 8px 0 0; }
#auto-save-summary { flex: 1 1 220px; font-size: 13px; color: #d2e5f4; }
.auto-prices-page #auto-feedback { font-size: 13px; padding: 9px 12px; }
.auto-prices-page #auto-save-feedback { padding: 10px; border-left: 3px solid var(--accent); color: #d2e5f4; }
.auto-prices-page #auto-save-feedback[data-state=error] { border-color: #ff9e9e; color: #ffd1d1; }
.auto-prices-page #auto-context { font-size: 12px; }
.auto-prices-page #auto-profile-editor { background: #101a28; }
.auto-prices-page #auto-profile-editor[open] summary { color: #dce6f0; }
.auto-prices-page #auto-dialog select, .cats-page #cat-filter, .products-page .product-tools select { float: none; width: 100%; }
.auto-prices-page #auto-dialog input[type=checkbox] { float: none; }
#competitors-panel { z-index: 35; }
#competitors-panel .competitors-table-scroll { outline-offset: -2px; }
#screen-heading button { min-height: 32px; padding: 0; }
#processes-tasks .process-more { min-height: 20px; padding: 0 3px; }

/* Login uses the same control sizes and focus treatment. */
.password-field { position: relative; }
.login-card .password-field input { padding-right: 105px; }
.login-card #password-toggle { position: absolute; inset: 4px 4px 4px auto; width: auto; margin: 0; padding: 7px 10px; color: #bcebd9; background: #243b3b; font-size: 13px; }
.login-card #login-submit { min-height: 48px; }
.login-card #caps-lock { font-size: 13px; color: #efbc68; margin: 0; }

@media (max-width: 1100px) {
  .workspace-bar { gap: 20px; }
  .cats-page .metric { padding: 14px; }
  .cats-page .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 979px) {
  .auto-prices-page #auto-settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .auto-prices-page .auto-workspace-save { grid-column: 1; }
  .auto-prices-page #auto-profile-editor:not([open]) { border-color: #497766; }
}
@media (max-width: 900px) {
  .cats-page aside { position: static; width: 100%; padding: 16px 20px; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
  .cats-page .section-label { grid-column: 1; margin: 0; align-self: center; }
  .cats-page #cat-search { grid-column: 1; grid-row: 2; }
  .cats-page #cat-filter { grid-column: 2; grid-row: 2; }
  .cats-page .cat-count { grid-column: 2; grid-row: 1; text-align: right; padding: 0; }
  .cats-page #cat-filter { margin: 0; font-size: 12px; }
  .cats-page .cat-list { grid-column: 1 / -1; max-height: 146px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .cats-page .cat-entry { min-height: 62px; }
  .cats-page main { margin: 0; width: 100%; }
  .cats-page .aside-footer { display: none; }
}
@media (max-width: 600px) {
  :root { --chrome-height: 112px; }
  body:not(.login-page) { font-size: 14px; }
  body:not(.login-page) main { padding: 20px 14px 32px; }
  .workspace-bar { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 8px 14px; }
  .workspace-bar .brand { font-size: 23px; }
  .workspace-bar .auth-account { grid-column: 2; grid-row: 1; }
  .workspace-bar .auth-account > span { display: none; }
  .workspace-bar #logout-button { min-height: 36px; }
  .workspace-nav { grid-column: 1 / -1; width: 100%; gap: 4px; }
  .workspace-nav a { flex: 1; text-align: center; padding: 9px 5px; font-size: 12px; }
  body:not(.login-page) input:not([type=checkbox]), body:not(.login-page) select, body:not(.login-page) textarea { font-size: 16px; }
  body:not(.login-page) button { min-height: 44px; padding: 10px 12px; }
  main > header { flex-direction: column; align-items: stretch; gap: 10px; }
  main > header h1 { font-size: 27px; }
  .cats-page .sync { align-self: flex-start; text-align: left; }
  .cats-page aside { padding: 12px 14px; }
  .cats-page #cat-search, .cats-page #cat-filter { font-size: 14px; }
  .cats-page .section-label { display: block; }
  .cats-page .global-panel-head { flex-wrap: nowrap; }
  .cats-page .global-panel-head p { display: none; }
  .cats-page #processes-button { display: block; padding: 8px 10px; }
  .cats-page #processes-count { display: block; }
  .cats-page .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cats-page .metric { min-height: 100px; padding: 12px; }
  .cats-page .metric:last-child { grid-column: 1 / -1; min-height: 0; }
  .cats-page .metric strong { font-size: 21px; }
  .cats-page .control { display: flex; flex-direction: column; align-items: stretch; padding: 16px; gap: 14px; }
  .cats-page .control > div:first-child, .cats-page .cat-control-status, .cats-page .control > .control-buttons { flex: 0 1 auto; }
  .cats-page .control .control-buttons { gap: 8px; }
  .cats-page .control .control-buttons > button { flex: 1 1 130px; }
  .cats-page .exchange-control { flex: 1 1 100%; }
  .cats-page .exchange-control > button { width: 100%; }
  .cats-page .panel-head { padding: 16px; gap: 12px; }
  .cats-page .inventory .panel-head { flex-direction: column; align-items: stretch; }
  .cats-page .search { width: 100%; }
  .cats-page .search input { width: 100%; }
  .inventory-tools { padding: 0 16px 12px; }
  .inventory-tools label { width: 100%; flex-wrap: wrap; }
  .inventory-tools select { width: 100%; }
  .cats-page .totals { padding: 0 16px 12px; }
  .cats-page .inventory td:first-child, .cats-page .inventory th:first-child { min-width: 155px; max-width: 180px; }
  .cats-page .inventory td:first-child:has(.catalog-choice) { min-width: 220px; }
  .cats-page .inventory td, .cats-page .inventory th { padding: 10px; }
  .cats-page .edit-toolbar { padding: 10px 12px; gap: 8px; }
  .cats-page .edit-toolbar .control-buttons { width: 100%; }
  .cats-page .edit-toolbar p { font-size: 11px; }
  .cats-page .table-note { padding: 14px 16px; }
  .cats-page footer { flex-direction: column; gap: 8px; }
  .products-page .product-tools { align-items: stretch; }
  .products-page .product-tools > label { flex: 1 1 120px; }
  .products-page #product-search, .products-page #product-list-sort, .products-page .bulk-prices input { width: 100%; }
  .products-page .product-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
  .products-page .product-facts strong { font-size: 19px; }
  .products-page .product-facts small { font-size: 11px; }
  .products-page .product-cat table { min-width: 0; table-layout: fixed; }
  .products-page .product-cat th, .products-page .product-cat td { padding: 8px 4px; white-space: normal; font-size: 11px; }
  .products-page .product-cat th:nth-child(-n+2) { width: 16%; }
  .products-page .product-cat td input[type=number] { width: 100%; min-width: 0; font-size: 14px; padding: 8px 3px; }
  .products-page .product-cat td label { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .products-page .product-cat td:first-child { min-width: 0; }
  .products-page .product-save-bar { position: static; margin-inline: -4px; padding: 10px; }
  .products-page .product-save-bar button { width: 100%; }
  .products-page #price-preview { width: calc(100% - 20px); padding: 14px; }
  .products-page #price-preview .product-tools { bottom: -14px; }
  .auto-prices-page .auto-chrome { position: static; }
  .auto-prices-page #auto-feedback { position: static; }
  .auto-prices-page .auto-workspace-card { padding: 14px; }
  .auto-prices-page .auto-workspace-save { position: static; padding: 10px; }
  .auto-prices-page .auto-workspace-save .auto-actions { gap: 8px; }
  .auto-prices-page .auto-workspace-save #auto-save-summary { flex-basis: 100%; font-size: 12px; }
  .auto-prices-page .auto-workspace-save > p { display: none; }
  .auto-prices-page .auto-workspace-save > #auto-save-feedback:not([hidden]) { display: block; }
  .auto-prices-page #auto-context { flex: 0 1 100%; min-height: 36px; }
  .auto-prices-page #auto-targets { max-height: 320px; }
  .auto-prices-page #auto-prompt { min-height: 170px; }
  #screen-heading button { min-height: 36px; padding: 0; }
  #screen-panel[data-minimized=true] { height: 56px !important; }
  #competitors-panel { overflow-y: auto; }
  #competitors-panel > :not(.competitors-table-scroll) { flex-shrink: 0; }
  #competitors-panel .competitors-table-scroll { min-height: 180px; }
  .login-card { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
