:root {
  /* Clean SaaS palette. Semantic status colors stay distinct from the blue accent. */
  --page-bg: #f5f8fb;
  --card-bg: #ffffff;
  --text-primary: #172b3a;
  --text-secondary: #61788b;
  --text-muted: #94a6b5;
  --border: #dce7ef;
  --border-soft: #e9f0f5;
  --accent: #69b6df;
  --accent-strong: #3b86b2;
  --accent-soft: #e7f4fb;
  --accent-hover: #d9eef9;
  --success: #39c99b;
  --warning: #efaa55;
  --danger: #ec776b;
  --ink: var(--text-primary);
  --ink-soft: var(--text-secondary);
  --muted: var(--text-muted);
  --line: var(--border);
  --line-soft: var(--border-soft);
  --surface: var(--card-bg);
  --page: var(--page-bg);
  --teal: var(--accent);
  --teal-deep: var(--accent-strong);
  --teal-soft: var(--accent-soft);
  --coral: var(--danger);
  --coral-soft: #fff0ee;
  --amber: var(--warning);
  --amber-soft: #fff6e8;
  --blue: #5e8fca;
  --shadow: 0 1px 2px rgba(31, 54, 72, .03), 0 8px 24px rgba(51, 78, 98, .07);
  --radius: 14px;
  --surface-rgb: 255, 255, 255;
  --ui-zoom: 1;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--page);
  background-image: linear-gradient(rgba(92, 131, 151, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(92, 131, 151, .055) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(7, 155, 132, .24); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 18px; height: 18px; display: block; }
.sr-only { width: 1px; height: 1px; padding: 0; margin: -1px; position: absolute; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.topbar { height: 72px; padding: 0 clamp(18px, 4vw, 56px); background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 38px; position: sticky; z-index: 20; top: 0; backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 228px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: #102f40; color: #daf8ef; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); position: relative; overflow: hidden; }
.brand-mark::after { content: ""; position: absolute; width: 28px; height: 2px; background: #28c8a8; bottom: 7px; left: 5px; transform: rotate(-13deg); border-radius: 2px; }
.brand-mark span { font-size: 13px; font-weight: 800; letter-spacing: .4px; position: relative; z-index: 1; }
.brand-copy { display: grid; gap: 1px; line-height: 1.1; }
.brand-copy strong { font-size: 16px; letter-spacing: .3px; }
.brand-copy small { color: var(--muted); font-size: 10px; letter-spacing: .2px; }
.primary-nav { align-self: stretch; display: flex; align-items: center; gap: 4px; }
.nav-link { height: 100%; padding: 0 15px; display: flex; align-items: center; gap: 8px; color: #607382; font-size: 13px; font-weight: 600; position: relative; white-space: nowrap; }
.nav-link svg { width: 16px; height: 16px; }
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--teal-deep); }
.nav-link.is-active::after { content: ""; height: 2px; position: absolute; left: 12px; right: 12px; bottom: 0; background: var(--teal); }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--coral-soft); color: var(--coral); font-size: 10px; font-weight: 800; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.service-state { display: inline-flex; align-items: center; gap: 7px; color: #5d7180; font-size: 12px; white-space: nowrap; }
.service-state i, .rule-state i { width: 7px; height: 7px; border-radius: 50%; background: #20b88c; box-shadow: 0 0 0 3px rgba(32,184,140,.14); }
.service-state i.is-offline, .rule-state.is-paused i { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.icon-button { width: 34px; height: 34px; border: 1px solid transparent; background: transparent; color: #617582; display: inline-grid; place-items: center; border-radius: 6px; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.icon-button:hover { background: #eef5f5; border-color: var(--line); color: var(--teal-deep); }
.icon-button.subtle { width: 30px; height: 30px; }
.avatar { width: 32px; height: 32px; border: 0; border-radius: 50%; color: #fff; background: #46778a; font-size: 13px; font-weight: 700; }

.main-content { max-width: 1500px; margin: 0 auto; padding: 38px clamp(18px, 4vw, 56px) 50px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 8px; color: var(--teal-deep); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.6px; line-height: 1.16; font-weight: 760; }
.heading-note { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 12px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.live-dot.offline { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.button { min-height: 38px; padding: 0 14px; border-radius: 6px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 700; transition: all .2s ease; white-space: nowrap; }
.button svg { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--teal); border-color: var(--teal); box-shadow: 0 4px 10px rgba(7,155,132,.17); }
.button-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); transform: translateY(-1px); }
.button-secondary { color: #4e6370; background: var(--surface); border-color: var(--line); }
.button-secondary:hover { color: var(--teal-deep); border-color: #a9d6cb; background: #f7fcfb; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric-card { min-height: 132px; padding: 18px 20px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.metric-card::before { content: ""; width: 3px; position: absolute; inset: 0 auto 0 0; background: #b9c7cf; }
.metric-card.metric-primary::before { background: var(--teal); }
.metric-card.metric-stock::before { background: #2eb890; }
.metric-card.metric-alert::before { background: var(--coral); }
.metric-card.metric-mail::before { background: #708cb7; }
.metric-head { display: flex; justify-content: space-between; align-items: center; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.metric-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; color: var(--teal); background: var(--teal-soft); }
.metric-icon svg { width: 15px; height: 15px; }
.metric-stock .metric-icon { color: #159d77; background: #e4f7f0; }
.metric-alert .metric-icon { color: var(--coral); background: var(--coral-soft); }
.metric-mail .metric-icon { color: #5c79a7; background: #eaf0f9; }
.metric-card > strong { display: block; margin-top: 9px; font-size: 31px; line-height: 1; letter-spacing: -.7px; }
.metric-foot { min-height: 18px; margin-top: 13px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.metric-up, .metric-down { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; }
.metric-up { color: var(--teal); }
.metric-down { color: var(--coral); }
.metric-up svg, .metric-down svg { width: 12px; height: 12px; }
.status-key { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.status-key.green { background: #2abf90; }
.status-key.amber { background: #e2a832; }
.status-key.gray { background: #b7c2c8; }
.mail-state { color: var(--teal); font-weight: 700; margin-left: auto; }

.analytics-section { margin-bottom: 22px; }
.section-heading { min-height: 58px; margin-bottom: 13px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: 21px; line-height: 1.2; letter-spacing: -.25px; }
.section-note { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.analytics-status { display: inline-flex; align-items: center; gap: 8px; color: var(--teal-deep); font-size: 11px; font-weight: 700; white-space: nowrap; }
.analytics-status > i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.analytics-status.is-offline { color: var(--amber); }
.analytics-status.is-offline > i { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.new-channel-count { padding: 4px 7px; border: 1px solid #d7e6f0; border-radius: 5px; color: #587a9e; background: #f4f8fc; font-size: 10px; font-weight: 800; }
.market-layout { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 14px; align-items: start; }
.market-main { min-width: 0; }
.category-rail { min-height: 100%; padding: 16px 10px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.category-title { margin: 1px 9px 10px; color: #8496a1; font-size: 11px; font-weight: 800; }
.category-item { width: 100%; min-height: 40px; padding: 0 8px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 7px; color: #617785; background: transparent; text-align: left; font-size: 11px; font-weight: 700; }
.category-item:hover { color: var(--teal-deep); background: #f4faf8; }
.category-item.is-active { color: var(--teal-deep); border-color: #cde9e2; background: #e6f6f2; }
.category-icon { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 6px; color: #60788b; background: #edf2f5; font-size: 10px; font-weight: 850; }
.category-icon.teal { color: #087765; background: #d7f2eb; }
.category-icon.amber { color: #a36a0c; background: #fff0cc; }
.category-icon.blue { color: #466fa9; background: #e5edf9; }
.category-item b { color: #9aabb4; font-size: 10px; font-variant-numeric: tabular-nums; }
.category-divider { height: 1px; margin: 14px 7px 12px; background: var(--line-soft); }
.category-foot { margin: 0 8px; color: #718691; font-size: 10px; line-height: 1.7; }
.category-foot .status-key { margin-right: 5px; vertical-align: middle; }
.category-foot span { padding-left: 14px; color: #a0adb4; }
.market-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.market-metric { min-height: 96px; padding: 14px 15px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.market-metric > span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.market-metric > strong { display: block; margin-top: 8px; color: var(--ink); font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.market-metric > small { display: block; min-height: 16px; margin-top: 8px; overflow: hidden; color: #93a2aa; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.market-metric-price { border-color: #c6e4dd; background: #f7fcfb; }
.market-metric-price > strong { color: var(--teal-deep); }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(420px, .86fr); gap: 14px; align-items: stretch; }
.analytics-grid .panel { min-width: 0; }
.panel-heading h3 { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.25; }
.trend-window { padding: 4px 7px; border: 1px solid var(--line-soft); border-radius: 5px; color: #82939c; background: #fbfcfd; font-size: 10px; white-space: nowrap; }
.market-chart-wrap { padding: 4px 18px 0; }
.market-chart-wrap svg { width: 100%; height: 185px; overflow: visible; }
.market-grid-lines line { stroke: #e8eff1; stroke-width: 1; stroke-dasharray: 3 4; }
.market-chart-area { fill: url(#marketChartFill); }
.market-chart-line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.market-chart-line.lowest { stroke: var(--teal); }
.market-chart-line.average { stroke: var(--blue); stroke-dasharray: 5 4; }
.market-chart-point { fill: #fff; stroke: var(--teal); stroke-width: 2; }
.market-chart-axis { display: flex; justify-content: space-between; padding: 0 7px; color: #9aa8ae; font-size: 9px; }
.market-chart-legend { min-height: 45px; padding: 12px 19px 14px; display: flex; align-items: center; gap: 17px; border-top: 1px solid var(--line-soft); color: #8798a0; font-size: 10px; }
.market-chart-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.market-chart-legend span:last-child { margin-left: auto; }
.market-chart-legend b { color: #536d78; font-variant-numeric: tabular-nums; }
.legend-line { width: 17px; height: 2px; display: inline-block; border-radius: 2px; }
.legend-line.lowest { background: var(--teal); }
.legend-line.average { background: var(--blue); background-image: linear-gradient(to right, var(--blue) 55%, transparent 55%); background-size: 6px 2px; }
.channel-table-wrap { max-height: 276px; overflow: auto; }
.channel-table { width: 100%; min-width: 580px; border-collapse: collapse; table-layout: fixed; }
.channel-table th { height: 34px; padding: 0 8px; color: #93a1aa; background: #fafcfd; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font-size: 9px; font-weight: 800; text-align: left; white-space: nowrap; }
.channel-table th:first-child, .channel-table td:first-child { padding-left: 18px; }
.channel-table th:last-child, .channel-table td:last-child { padding-right: 18px; }
.channel-table th:nth-child(1) { width: 33%; }
.channel-table th:nth-child(2) { width: 11%; }
.channel-table th:nth-child(3) { width: 15%; }
.channel-table th:nth-child(4) { width: 15%; }
.channel-table th:nth-child(5) { width: 16%; }
.channel-table th:nth-child(6) { width: 10%; }
.channel-table td { height: 49px; padding: 8px; border-bottom: 1px solid var(--line-soft); color: #647985; font-size: 10px; vertical-align: middle; }
.channel-table tbody tr:hover { background: #fbfefd; }
.channel-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.channel-name strong { min-width: 0; overflow: hidden; color: #3d5664; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.channel-name small { display: block; overflow: hidden; color: #a0adb4; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.channel-avatar { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; color: #fff; background: #537a8e; font-size: 10px; font-weight: 800; }
.channel-avatar.avatar-0 { background: #277a70; }
.channel-avatar.avatar-1 { background: #5d7db6; }
.channel-avatar.avatar-2 { background: #b26c45; }
.channel-avatar.avatar-3 { background: #7960a8; }
.channel-avatar.avatar-4 { background: #536977; }
.channel-avatar.avatar-5 { background: #bf6682; }
.channel-link { display: block; overflow: hidden; color: #3d5664; font-size: 11px; font-weight: 800; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.channel-link:hover { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 2px; }
.channel-price { color: var(--ink); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.channel-available { color: #3d756b; font-weight: 700; white-space: nowrap; }
.channel-quote-count { display: block; margin-top: 2px; color: #a0adb4; font-size: 8px; font-weight: 600; white-space: nowrap; }
.channel-status { display: inline-flex; align-items: center; gap: 4px; color: var(--teal-deep); font-size: 9px; font-weight: 800; white-space: nowrap; }
.channel-status.stale { color: #9ca9ae; }
.channel-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.channel-status.stale i { background: #b9c3c7; }
.channel-empty { min-height: 170px; display: grid; place-items: center; color: #9aa8ae; font-size: 11px; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.84fr) minmax(320px, .86fr); align-items: start; gap: 18px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; }
.panel-heading h2 { margin: 0; font-size: 16px; line-height: 1.25; letter-spacing: -.1px; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.inventory-heading { min-height: 74px; }
.title-with-count { display: flex; align-items: center; gap: 9px; }
.count-chip { padding: 3px 7px; border: 1px solid #cfe7e1; border-radius: 4px; color: var(--teal-deep); background: #f0faf7; font-size: 10px; font-weight: 800; }
.panel-heading-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.source-chip { display: inline-flex; align-items: center; gap: 6px; color: #435c6c; font-weight: 700; }
.source-logo { width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 5px; color: #fff; background: #147d72; font-size: 11px; font-weight: 800; }
.source-logo.large { width: 34px; height: 34px; border-radius: 8px; font-size: 15px; }
.updated-label b { color: var(--teal-deep); font-variant-numeric: tabular-nums; }

.filters { padding: 0 22px 14px; display: grid; grid-template-columns: minmax(190px, 1fr) 142px 158px auto; gap: 9px; border-bottom: 1px solid var(--line-soft); }
.search-field, .select-field { height: 36px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; color: #82929d; background: #fbfcfd; }
.search-field { padding: 0 10px; gap: 8px; }
.search-field:focus-within, .select-field:focus-within { background: #fff; border-color: #8bcabd; box-shadow: 0 0 0 3px rgba(7,155,132,.09); }
.search-field svg { width: 15px; height: 15px; flex: 0 0 auto; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-field input::placeholder { color: #97a5ae; }
.select-field { padding: 0 8px 0 10px; position: relative; gap: 7px; }
.select-field span { color: #8596a1; font-size: 11px; white-space: nowrap; }
.select-field select { width: 100%; min-width: 0; color: #415868; border: 0; outline: 0; background: transparent; appearance: none; font-size: 12px; font-weight: 600; cursor: pointer; }
.select-field > svg { width: 13px; height: 13px; pointer-events: none; }
.filter-button { height: 36px; min-width: 66px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: #586e7b; background: #fbfcfd; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 600; }
.filter-button:hover, .filter-button.is-active { color: var(--teal-deep); border-color: #a7d6cc; background: #f0faf7; }
.filter-button svg { width: 15px; height: 15px; }
.filter-button b { min-width: 16px; height: 16px; border-radius: 8px; display: inline-grid; place-items: center; color: #fff; background: var(--teal); font-size: 10px; }
.status-tabs { min-height: 47px; padding: 0 22px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.status-tab { height: 47px; padding: 0 1px; border: 0; color: #71828e; background: transparent; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; position: relative; }
.status-tab span { color: #a0adb5; font-variant-numeric: tabular-nums; }
.status-tab:hover { color: var(--ink); }
.status-tab.is-active { color: var(--teal-deep); }
.status-tab.is-active span { color: var(--teal-deep); }
.status-tab.is-active::after { content: ""; height: 2px; position: absolute; left: 0; right: 0; bottom: -1px; background: var(--teal); }

.table-wrap { overflow-x: auto; }
.product-table { width: 100%; min-width: 725px; border-collapse: collapse; table-layout: fixed; }
.product-table th { height: 38px; padding: 0 10px; color: #93a1aa; background: #fafcfd; border-bottom: 1px solid var(--line-soft); font-size: 10px; font-weight: 700; text-align: left; white-space: nowrap; }
.product-table th:first-child, .product-table td:first-child { padding-left: 22px; }
.product-table th:last-child, .product-table td:last-child { padding-right: 22px; }
.product-table th.col-product { width: 42%; }
.product-table th:nth-child(2) { width: 12%; }
.product-table th:nth-child(3) { width: 14%; }
.product-table th:nth-child(4) { width: 13%; }
.product-table th:nth-child(5) { width: 12%; }
.product-table th:nth-child(6) { width: 7%; }
.product-table td { height: 72px; padding: 11px 10px; border-bottom: 1px solid var(--line-soft); color: #526873; font-size: 11px; vertical-align: middle; }
.product-table tbody tr { transition: background .16s ease; }
.product-table tbody tr:hover { background: #fbfefd; }
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.shop-avatar { width: 32px; height: 32px; border-radius: 7px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; }
.shop-avatar.orange { background: #f47a2b; }
.shop-avatar.mint { color: #2b6b57; background: #c8e8b1; }
.shop-avatar.blue { background: #527bb4; }
.shop-avatar.violet { background: #7d68a8; }
.shop-avatar.dark { background: #314e61; }
.shop-avatar.pink { background: #dc8392; }
.product-copy { min-width: 0; display: grid; gap: 3px; }
.shop-name { color: #294354; font-size: 12px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-name { max-width: 320px; color: #81919b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-cell { display: inline-flex; align-items: center; gap: 6px; color: #526b78; font-weight: 700; white-space: nowrap; }
.stock-cell.low { color: var(--amber); }
.stock-cell.out { color: #a6b0b6; font-weight: 600; }
.price-cell { color: var(--ink); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-cell small { margin-left: 2px; color: #94a3aa; font-size: 10px; font-weight: 600; }
.change-cell { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.change-cell.down { color: var(--teal); }
.change-cell.up { color: var(--coral); }
.change-cell.flat { color: #9ba8ae; }
.change-cell svg { width: 12px; height: 12px; }
.time-cell { color: #8c9ba4; white-space: nowrap; }
.link-button { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: #6e8390; background: transparent; }
.link-button:hover { color: var(--teal-deep); border-color: #a7d6cc; background: var(--teal-soft); }
.link-button svg { width: 14px; height: 14px; }
.empty-state { min-height: 280px; padding: 52px 20px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-icon { width: 45px; height: 45px; margin-bottom: 12px; display: grid; place-items: center; color: #9aaab2; border-radius: 50%; background: #f1f5f6; }
.empty-state strong { color: #526571; font-size: 14px; }
.empty-state p { margin: 5px 0 15px; font-size: 12px; }
.table-footer { min-height: 57px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; color: #8a9aa3; font-size: 11px; }
.pagination { display: flex; align-items: center; gap: 3px; }
.page-button { width: 27px; height: 27px; padding: 0; border: 1px solid transparent; border-radius: 5px; color: #7e919c; background: transparent; font-size: 11px; }
.page-button:hover, .page-button.is-current { color: var(--teal-deep); border-color: #b9dfd6; background: #effaf7; font-weight: 800; }
.page-button.next { font-size: 19px; line-height: 1; }

.side-stack { display: grid; gap: 18px; }
.compact-heading { padding: 18px 19px 10px; }
.trend-value { padding: 2px 19px 12px; display: flex; align-items: baseline; gap: 10px; }
.trend-value strong { font-size: 27px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.trend-change { display: inline-flex; align-items: baseline; gap: 4px; font-size: 11px; font-weight: 800; }
.trend-change.positive { color: var(--teal); }
.trend-change.negative { color: var(--coral); }
.trend-change small { color: var(--muted); font-size: 10px; font-weight: 600; }
.chart-range { display: flex; gap: 3px; padding: 0 19px 9px; }
.range-button { padding: 5px 8px; border: 0; border-radius: 4px; color: #8698a2; background: transparent; font-size: 10px; font-weight: 700; }
.range-button:hover, .range-button.is-active { color: var(--teal-deep); background: #eaf7f3; }
.chart-area { padding: 2px 16px 0; }
.chart-area svg { width: 100%; height: 168px; overflow: visible; }
.grid-lines line { stroke: #e8eff1; stroke-width: 1; stroke-dasharray: 3 4; }
.chart-area-fill { fill: url(#chartFill); }
.chart-line { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: #fff; stroke: var(--teal); stroke-width: 2; }
.chart-point.current { fill: var(--teal); stroke: #fff; stroke-width: 2.5; }
.chart-axis { display: flex; justify-content: space-between; padding: 0 6px; color: #a1adb3; font-size: 9px; }
.trend-legend { padding: 13px 19px 17px; display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line-soft); color: #8a9aa2; font-size: 10px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.trend-legend b { color: #546a76; font-variant-numeric: tabular-nums; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-dot.current { background: var(--teal); }
.legend-dot.average { background: #a9b9bf; }

.rule-state { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-deep); font-size: 10px; font-weight: 800; }
.rule-list { padding: 2px 19px 8px; }
.rule-row { min-height: 54px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line-soft); }
.rule-row:last-child { border-bottom: 0; }
.rule-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; flex: 0 0 auto; }
.rule-icon svg { width: 15px; height: 15px; }
.rule-icon.coral { color: var(--coral); background: var(--coral-soft); }
.rule-icon.teal { color: var(--teal); background: var(--teal-soft); }
.rule-icon.amber { color: var(--amber); background: var(--amber-soft); }
.rule-copy { min-width: 0; display: grid; gap: 1px; }
.rule-copy strong { color: #3c5563; font-size: 11px; }
.rule-copy span { color: #95a3aa; font-size: 10px; }
.rule-copy b { color: #687c86; }
.switch { margin-left: auto; width: 31px; height: 18px; display: inline-block; flex: 0 0 auto; position: relative; }
.switch input { width: 1px; height: 1px; opacity: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 10px; background: #d4dde1; transition: background .2s ease; }
.switch span::after { content: ""; width: 14px; height: 14px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.14); transition: transform .2s ease; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(13px); }
.mail-destination { margin: 7px 19px 17px; padding: 10px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line-soft); border-radius: 6px; background: #fbfcfd; }
.mail-avatar { width: 27px; height: 27px; display: grid; place-items: center; color: #587caa; border-radius: 6px; background: #eaf0fa; }
.mail-avatar svg { width: 14px; height: 14px; }
.mail-destination div { min-width: 0; display: grid; gap: 1px; }
.mail-destination small { color: #9aa8af; font-size: 9px; }
.mail-destination strong { max-width: 150px; color: #526977; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 3px 0; border: 0; color: var(--teal-deep); background: transparent; font-size: 10px; font-weight: 800; white-space: nowrap; }
.text-button:hover { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.mail-destination .text-button { margin-left: auto; }

.activity-panel .panel-heading { align-items: center; }
.activity-list { padding: 1px 19px 15px; }
.activity-item { min-height: 51px; padding: 8px 0; display: flex; gap: 9px; border-bottom: 1px solid var(--line-soft); }
.activity-item:last-child { border-bottom: 0; }
.activity-mark { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; flex: 0 0 auto; }
.activity-mark svg { width: 13px; height: 13px; }
.activity-mark.down { color: var(--teal); background: var(--teal-soft); }
.activity-mark.up { color: var(--coral); background: var(--coral-soft); }
.activity-mark.stock { color: var(--amber); background: var(--amber-soft); }
.activity-copy { min-width: 0; display: grid; gap: 1px; }
.activity-copy strong { color: #4a626e; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy span { color: #9aa8ae; font-size: 9px; }
.activity-time { margin-left: auto; color: #a5b0b5; font-size: 9px; white-space: nowrap; }

.source-strip { min-height: 68px; margin-top: 18px; padding: 13px 17px; display: flex; align-items: center; gap: 14px; border: 1px solid #cfe4e0; border-radius: var(--radius); background: #f4fbfa; }
.source-strip-main { min-width: 225px; display: flex; align-items: center; gap: 10px; }
.source-strip-main > div { display: grid; gap: 2px; }
.source-strip-main strong { color: #33565d; font-size: 12px; }
.source-strip-main span:not(.source-logo) { color: #84a0a0; font-size: 10px; }
.source-strip-stats { margin-left: auto; display: flex; align-items: center; gap: 19px; color: #78918f; font-size: 10px; }
.source-strip-stats span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.source-strip-stats b { color: #4f6e6c; font-variant-numeric: tabular-nums; }
.source-strip > .icon-button { margin-left: 3px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; padding: 24px; display: grid; place-items: center; background: rgba(20, 38, 49, .43); backdrop-filter: blur(4px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(500px, 100%); max-height: calc(100vh / var(--ui-zoom) - 48px); overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 22px 70px rgba(13, 34, 46, .22); animation: modal-in .2s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.modal-heading { padding: 22px 23px 17px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.modal-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.2px; }
#monitorForm { padding: 20px 23px 23px; display: grid; gap: 16px; }
.form-field { display: grid; gap: 6px; color: #526a77; font-size: 11px; font-weight: 700; }
.form-field input, .form-field select { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); outline: 0; background: #fbfcfd; font-size: 12px; }
.form-field input:focus, .form-field select:focus { border-color: #8bcabd; box-shadow: 0 0 0 3px rgba(7,155,132,.09); background: #fff; }
.form-field small { color: #9aa8ae; font-size: 10px; font-weight: 500; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }

.toast-region { width: min(340px, calc(100vw / var(--ui-zoom) - 30px)); position: fixed; z-index: 80; right: 15px; bottom: 17px; display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 12px 13px; display: flex; align-items: start; gap: 9px; border: 1px solid #cfe5df; border-radius: 7px; color: #355a60; background: #f7fffc; box-shadow: 0 10px 28px rgba(22, 58, 66, .14); font-size: 12px; animation: toast-in .2s ease-out; pointer-events: auto; }
.toast svg { width: 16px; height: 16px; color: var(--teal); flex: 0 0 auto; }
.toast.error { color: #7a4f49; border-color: #f2d6d1; background: #fffaf9; }
.toast.error svg { color: var(--coral); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
  .topbar { gap: 20px; }
  .brand { min-width: 190px; }
  .workspace-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .95fr); }
  .filters { grid-template-columns: minmax(160px, 1fr) 130px 143px auto; }
  .service-state span { display: none; }
  .market-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .topbar { height: 64px; padding: 0 18px; }
  .brand { min-width: auto; }
  .brand-copy small { display: none; }
  .primary-nav { margin-left: auto; gap: 0; }
  .nav-link { padding: 0 9px; font-size: 0; gap: 0; }
  .nav-link svg { width: 18px; height: 18px; }
  .nav-link.is-active::after { left: 7px; right: 7px; }
  .nav-badge { position: absolute; top: 12px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px; font-size: 9px; }
  .main-content { padding-top: 29px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .market-layout { grid-template-columns: 142px minmax(0, 1fr); gap: 10px; }
  .category-item { grid-template-columns: 22px minmax(0, 1fr); padding-left: 6px; padding-right: 6px; }
  .category-item b { display: none; }
  .workspace-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .activity-panel { grid-column: 1 / -1; }
  .source-strip-stats { gap: 12px; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-copy strong { font-size: 14px; }
  .topbar-tools { gap: 4px; }
  .service-state { display: none; }
  .main-content { padding: 24px 13px 38px; }
  .page-heading { display: block; margin-bottom: 21px; }
  h1 { font-size: 25px; }
  .heading-actions { margin-top: 17px; }
  .heading-actions .button { flex: 1; }
  .metrics-grid { gap: 9px; margin-bottom: 13px; }
  .section-heading { display: block; min-height: 0; }
  .analytics-status { margin-top: 10px; }
  .market-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .market-layout { display: block; }
  .category-rail { min-height: 0; margin-bottom: 10px; padding: 8px; display: flex; align-items: center; gap: 5px; overflow-x: auto; }
  .category-title, .category-divider, .category-foot { display: none; }
  .category-item { width: auto; min-width: max-content; grid-template-columns: 22px auto auto; min-height: 35px; padding: 0 7px; }
  .category-item b { display: block; }
  .market-metric { min-height: 88px; padding: 12px; }
  .market-metric > strong { font-size: 21px; }
  .market-chart-wrap { padding-left: 12px; padding-right: 12px; }
  .market-chart-wrap svg { height: 150px; }
  .market-chart-legend { flex-wrap: wrap; gap: 8px 13px; padding-left: 14px; padding-right: 14px; }
  .market-chart-legend span:last-child { margin-left: 0; width: 100%; }
  .channel-table { min-width: 560px; }
  .metric-card { min-height: 114px; padding: 14px 14px 12px; }
  .metric-card > strong { margin-top: 8px; font-size: 27px; }
  .metric-foot { margin-top: 10px; font-size: 10px; }
  .panel-heading { padding-left: 15px; padding-right: 15px; }
  .inventory-heading { display: block; }
  .panel-heading-meta { margin-top: 10px; justify-content: space-between; }
  .filters { padding: 0 13px 11px; grid-template-columns: 1fr 1fr; gap: 8px; }
  .search-field { grid-column: 1 / -1; }
  .select-field { min-width: 0; }
  .compact-select { grid-column: 1; }
  .filter-button { grid-column: 2; }
  .status-tabs { overflow-x: auto; gap: 17px; padding: 0 13px; scrollbar-width: none; }
  .status-tabs::-webkit-scrollbar { display: none; }
  .status-tab { flex: 0 0 auto; }
  .product-table { min-width: 680px; }
  .product-table th:first-child, .product-table td:first-child { padding-left: 14px; }
  .product-table th:last-child, .product-table td:last-child { padding-right: 14px; }
  .table-footer { padding: 0 13px; }
  .table-footer > span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-stack { grid-template-columns: 1fr; gap: 13px; }
  .activity-panel { grid-column: auto; }
  .source-strip { align-items: start; flex-wrap: wrap; padding: 13px; gap: 10px; }
  .source-strip-main { min-width: 100%; }
  .source-strip-stats { width: 100%; margin-left: 0; justify-content: space-between; }
  .source-strip > .icon-button { position: absolute; right: 22px; margin-top: -35px; }
  .form-row { grid-template-columns: 1fr; gap: 16px; }
  .modal-backdrop { padding: 14px; }
  .modal-heading, #monitorForm { padding-left: 17px; padding-right: 17px; }
}

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

/* --------------------------------------------------------------------------
   Compact SaaS surface
   The original selectors remain above for compatibility; this layer brings
   every section onto one restrained visual system without changing behavior.
   -------------------------------------------------------------------------- */
html { background: var(--page-bg); overflow-x: hidden; }
body {
  color: var(--text-primary);
  overflow-x: hidden;
  background-color: var(--page-bg);
  background-image:
    linear-gradient(rgba(80, 110, 140, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 110, 140, .045) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(105, 182, 223, .24);
  outline-offset: 2px;
}

/* Header */
.topbar {
  height: 60px;
  padding: 0 max(16px, calc((100% - 1400px) / 2));
  gap: 24px;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(31, 54, 72, .02);
  backdrop-filter: blur(10px);
}
.brand { min-width: 210px; gap: 9px; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: transparent;
  background: transparent;
  box-shadow: none;
}
.brand-mark::after { display: none; }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.brand-mark span { font-size: 0; }
.brand-copy { gap: 2px; }
.brand-copy strong { color: var(--text-primary); font-size: 15px; letter-spacing: 0; }
.brand-copy small { color: var(--text-muted); font-size: 9px; }
.primary-nav { gap: 4px; }
.nav-link {
  height: 36px;
  padding: 0 12px;
  gap: 7px;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 13px;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.nav-link:hover { color: var(--text-primary); background: #f2f8fc; }
.nav-link.is-active {
  color: #23415a;
  background: var(--accent-soft);
}
.nav-link.is-active::after { display: none; }
.nav-badge { background: #fff0ee; color: var(--danger); }
.topbar-tools { gap: 8px; }
.service-state { color: var(--text-secondary); font-size: 11px; }
.service-state i, .rule-state i {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(57, 201, 155, .14);
}
.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.icon-button:hover { color: var(--accent-strong); border-color: var(--border); background: var(--accent-soft); }
.avatar { width: auto; min-width: 38px; height: 32px; padding: 0 8px; border-radius: 999px; background: #477c94; font-size: 10px; }

/* Page rhythm and heading */
.main-content {
  max-width: 1400px;
  padding: 24px 24px 40px;
}
.page-heading { margin-bottom: 16px; gap: 18px; }
.eyebrow { margin-bottom: 6px; color: var(--accent-strong); font-size: 10px; letter-spacing: .06em; }
h1 {
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: clamp(28px, 2.35vw, 32px);
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 700;
}
.heading-note { gap: 7px; color: var(--text-muted); font-size: 11px; }
.live-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(57, 201, 155, .14); }
.heading-actions { gap: 8px; }
.button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.button-primary {
  color: #fff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 3px 8px rgba(59, 134, 178, .15);
}
.button-primary:hover { background: #2f708f; border-color: #2f708f; transform: translateY(-1px); }
.button-secondary { color: var(--text-secondary); background: var(--card-bg); border-color: var(--border); }
.button-secondary:hover { color: #23415a; border-color: #b7d7e8; background: var(--accent-soft); }

/* Summary cards */
.metrics-grid { gap: 12px; margin-bottom: 18px; }
.metric-card {
  min-height: 104px;
  padding: 14px 16px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.metric-card:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(31, 54, 72, .04), 0 10px 26px rgba(51, 78, 98, .08); }
.metric-card::before { width: 2px; background: #c7d5df; }
.metric-card.metric-primary::before { background: var(--accent); }
.metric-card.metric-stock::before { background: var(--success); }
.metric-card.metric-alert::before { background: var(--danger); }
.metric-card.metric-mail::before { background: #86a7ce; }
.metric-head { color: var(--text-secondary); font-size: 12px; }
.metric-icon { width: 26px; height: 26px; border-radius: 8px; color: var(--accent-strong); background: var(--accent-soft); }
.metric-stock .metric-icon { color: #2caa83; background: #e9f8f3; }
.metric-alert .metric-icon { color: var(--danger); background: #fff0ee; }
.metric-mail .metric-icon { color: #6587b5; background: #edf3fb; }
.metric-card > strong { margin-top: 8px; color: var(--text-primary); font-size: 29px; letter-spacing: 0; }
.metric-foot { min-height: 16px; margin-top: 10px; color: var(--text-muted); font-size: 10px; }
.metric-up { color: var(--success); }
.metric-down { color: var(--danger); }
.mail-state { color: var(--success); }

/* Quote panorama */
.analytics-section { margin-bottom: 18px; }
.section-heading { min-height: 0; margin-bottom: 10px; align-items: center; }
.section-heading .eyebrow { margin-bottom: 4px; }
.section-heading h2 { font-size: 19px; letter-spacing: 0; }
.section-note { margin-top: 4px; color: var(--text-muted); font-size: 11px; }
.analytics-status { color: var(--accent-strong); font-size: 10px; }
.analytics-status > i { background: var(--success); box-shadow: 0 0 0 3px rgba(57, 201, 155, .14); }
.new-channel-count { padding: 4px 8px; border: 1px solid #d6e7f1; border-radius: 999px; color: #5d829a; background: #f3f8fc; font-size: 10px; }
.market-layout { grid-template-columns: 158px minmax(0, 1fr); gap: 12px; }
.category-rail {
  padding: 14px 9px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow);
}
.category-title { margin: 1px 9px 8px; color: var(--text-muted); font-size: 11px; }
.category-item {
  min-height: 38px;
  padding: 0 8px;
  gap: 7px;
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 11px;
  transition: background-color 160ms ease, color 160ms ease;
}
.category-item:hover { color: #23415a; background: #f2f8fc; }
.category-item.is-active { color: #23415a; border-color: transparent; background: #e6f3fb; }
.category-icon { width: 23px; height: 23px; border-radius: 7px; color: #5f8298; background: #eef4f8; }
.category-icon.teal { color: #3d84a9; background: #e3f3fa; }
.category-icon.amber { color: #b87931; background: #fff2dc; }
.category-icon.blue { color: #5e83bb; background: #eaf0fa; }
.category-item b { color: var(--text-muted); }
.category-divider { margin: 12px 7px 10px; background: var(--border-soft); }
.category-foot { margin: 0 8px; color: var(--text-secondary); font-size: 10px; }
.category-foot span { color: var(--text-muted); }
.market-metrics { gap: 9px; margin-bottom: 12px; }
.market-metric {
  min-height: 86px;
  padding: 12px 13px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(31, 54, 72, .025), 0 5px 16px rgba(51, 78, 98, .045);
}
.market-metric > span { color: var(--text-muted); font-size: 10px; }
.market-metric > strong { margin-top: 7px; color: var(--text-primary); font-size: 23px; }
.market-metric > small { margin-top: 7px; color: var(--text-muted); font-size: 10px; }
.market-metric-price { border-color: #c9e5f0; background: #f4fbfe; }
.market-metric-price > strong { color: #277496; }
.analytics-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow);
}
.panel-heading { padding: 16px 18px 11px; }
.panel-heading h2, .panel-heading h3 { color: var(--text-primary); }
.panel-heading h2 { font-size: 15px; }
.panel-heading h3 { font-size: 14px; }
.panel-heading p { margin-top: 4px; color: var(--text-muted); font-size: 10px; }
.compact-heading { padding: 15px 17px 10px; }
.trend-window { padding: 4px 8px; border-color: var(--border-soft); border-radius: 999px; color: var(--text-muted); background: #fbfdfe; }
.market-chart-wrap { padding: 2px 16px 0; }
.market-chart-wrap svg { height: 178px; }
.market-grid-lines line, .grid-lines line { stroke: #e8eff5; }
.market-chart-area { opacity: .45; }
.market-chart-line { stroke-width: 2; }
.market-chart-line.lowest { stroke: var(--success); }
.market-chart-line.average { stroke: #5d8fce; }
.market-chart-axis, .chart-axis { color: var(--text-muted); }
.market-chart-legend { min-height: 40px; padding: 10px 17px 12px; border-top-color: var(--border-soft); color: var(--text-muted); }
.market-chart-legend b { color: var(--text-secondary); }
.legend-line.lowest { background: var(--success); }
.legend-line.average { background: #5d8fce; background-image: linear-gradient(to right, #5d8fce 55%, transparent 55%); }

/* Dense quote tables */
.channel-table-wrap { max-height: 296px; scrollbar-width: thin; scrollbar-color: #9baab5 transparent; }
.channel-table { min-width: 560px; }
.channel-table th {
  height: 40px;
  padding: 0 8px;
  color: #70889a;
  background: #f4f9fc;
  border-top-color: transparent;
  border-bottom-color: var(--border-soft);
  font-size: 10px;
}
.channel-table td { height: 52px; padding: 7px 8px; color: var(--text-secondary); font-size: 10px; }
.channel-table tbody tr:hover, .product-table tbody tr:hover { background: #f7fbfd; }
.channel-name strong, .channel-link { color: var(--text-primary); font-size: 11px; }
.channel-name > div { min-width: 0; overflow: hidden; }
.channel-name small, .channel-quote-count { max-width: 100%; overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.channel-avatar { width: 24px; height: 24px; border-radius: 7px; background: #668aa0; }
.channel-avatar.avatar-0 { background: #4c8fa5; }
.channel-avatar.avatar-1 { background: #698bc0; }
.channel-avatar.avatar-2 { background: #b47b58; }
.channel-avatar.avatar-3 { background: #7e78af; }
.channel-avatar.avatar-4 { background: #607888; }
.channel-avatar.avatar-5 { background: #b7778b; }
.shop-avatar.has-image, .channel-avatar.has-image { overflow: hidden; }
.shop-avatar img, .channel-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.avatar-fallback { width: 100%; height: 100%; display: grid; place-items: center; }
.channel-link:hover { color: var(--accent-strong); }
.channel-price { color: var(--text-primary); font-size: 13px; }
.channel-available { color: #348d75; }
.channel-status { color: #368e78; }

/* Inventory and secondary cards */
.workspace-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, .85fr); gap: 14px; }
.inventory-panel, .channel-compare-panel { overflow: hidden; }
.table-wrap, .channel-table-wrap { contain: inline-size; }
.inventory-heading { min-height: 68px; }
.title-with-count { gap: 8px; }
.count-chip { padding: 3px 7px; border-color: #cfe3ee; border-radius: 999px; color: #4c82a0; background: #f1f8fc; }
.panel-heading-meta { gap: 12px; color: var(--text-muted); font-size: 10px; }
.source-chip { color: var(--text-secondary); }
.source-logo { width: 20px; height: 20px; border-radius: 6px; background: #4c8ea4; }
.source-logo.large { width: 32px; height: 32px; border-radius: 9px; }
.updated-label b { color: var(--accent-strong); }
.filters { padding: 0 18px 12px; grid-template-columns: minmax(170px, 1fr) 136px 150px auto; gap: 8px; border-bottom-color: var(--border-soft); }
.search-field, .select-field { height: 34px; border-color: var(--border); border-radius: 8px; background: #fbfdfe; }
.search-field:focus-within, .select-field:focus-within { border-color: #a9d6e9; box-shadow: 0 0 0 3px rgba(105, 182, 223, .12); }
.search-field input { font-size: 11px; }
.select-field select { font-size: 11px; }
.filter-button { height: 34px; border-color: var(--border); border-radius: 8px; color: var(--text-secondary); background: #fbfdfe; font-size: 11px; }
.filter-button:hover, .filter-button.is-active { color: #23415a; border-color: #b7d7e8; background: var(--accent-soft); }
.filter-button b { background: var(--accent-strong); }
.status-tabs { min-height: 43px; padding: 0 18px; gap: 18px; border-bottom-color: var(--border); }
.status-tab { height: 43px; color: var(--text-secondary); font-size: 11px; }
.status-tab.is-active { color: #23415a; }
.status-tab.is-active::after { height: 2px; background: var(--accent); }
.status-tab span { color: var(--text-muted); }
.status-tab.is-active span { color: var(--accent-strong); }
.product-table { min-width: 710px; }
.product-table th { height: 38px; padding: 0 9px; color: #70889a; background: #f4f9fc; border-bottom-color: var(--border-soft); font-size: 10px; }
.product-table td { height: 58px; padding: 8px 9px; color: var(--text-secondary); font-size: 11px; }
.product-table th:first-child, .product-table td:first-child { padding-left: 18px; }
.product-table th:last-child, .product-table td:last-child { padding-right: 18px; }
.product-table tbody tr.is-selected { background: #e6f3fb; }
.product-table tbody tr.is-selected:hover { background: #e1f1fa; }
.shop-avatar { width: 30px; height: 30px; border-radius: 8px; }
.shop-name { color: var(--text-primary); font-size: 11px; }
.product-name { color: var(--text-muted); font-size: 10px; }
.stock-cell { color: #348d75; font-size: 11px; }
.stock-cell.low { color: var(--warning); }
.stock-cell.out { color: var(--text-muted); }
.price-cell { color: var(--text-primary); font-size: 14px; }
.change-cell.down { color: #348d75; }
.change-cell.up { color: var(--danger); }
.time-cell { color: var(--text-muted); font-size: 10px; }
.link-button { width: 28px; height: 28px; border-color: var(--border); border-radius: 8px; color: var(--text-secondary); }
.link-button:hover { color: var(--accent-strong); border-color: #b7d7e8; background: var(--accent-soft); }
.table-footer { min-height: 48px; padding: 0 18px; color: var(--text-muted); }
.page-button { width: 27px; height: 27px; border-radius: 8px; color: var(--text-secondary); }
.page-button:hover, .page-button.is-current { color: #23415a; border-color: #b7d7e8; background: var(--accent-soft); }
.side-stack { gap: 12px; }
.trend-value { padding: 1px 17px 10px; }
.trend-value strong { color: var(--text-primary); font-size: 26px; }
.trend-change.positive { color: #348d75; }
.chart-range { padding: 0 17px 8px; }
.range-button { padding: 5px 8px; border-radius: 7px; color: var(--text-muted); }
.range-button:hover, .range-button.is-active { color: #23415a; background: var(--accent-soft); }
.chart-area { padding: 2px 14px 0; }
.chart-area svg { height: 154px; }
.chart-area-fill { opacity: .45; }
.chart-line { stroke: var(--accent-strong); stroke-width: 2; }
.chart-point { stroke: var(--accent-strong); }
.chart-point.current { fill: var(--accent-strong); }
.trend-legend { padding: 11px 17px 14px; color: var(--text-muted); }
.legend-dot.current { background: var(--accent-strong); }
.rule-state { color: #348d75; }
.rule-list { padding: 1px 17px 7px; }
.rule-row { min-height: 50px; gap: 9px; }
.rule-icon { width: 27px; height: 27px; border-radius: 8px; }
.rule-icon.teal { color: #348d75; background: #e9f8f3; }
.rule-copy strong { color: var(--text-primary); font-size: 11px; }
.rule-copy span { color: var(--text-muted); font-size: 10px; }
.switch input:checked + span { background: var(--accent-strong); }
.mail-destination { margin: 7px 17px 15px; padding: 9px; border-color: var(--border-soft); border-radius: 9px; background: #f8fbfd; }
.mail-avatar { background: #eaf3fb; color: #5c83b2; }
.mail-destination small { color: var(--text-muted); }
.mail-destination strong { color: var(--text-secondary); }
.text-button { color: var(--accent-strong); }
.activity-list { padding: 1px 17px 13px; }
.activity-item { min-height: 47px; padding: 7px 0; }
.activity-mark.down { color: #348d75; background: #e9f8f3; }
.activity-mark.up { color: var(--danger); background: #fff0ee; }
.activity-copy strong { color: var(--text-secondary); }
.activity-copy span, .activity-time { color: var(--text-muted); }
.source-strip {
  min-height: 62px;
  margin-top: 14px;
  padding: 11px 15px;
  border-color: #cfe4ef;
  border-radius: 12px;
  background: #f3f9fc;
}
.source-strip-main strong { color: var(--text-primary); }
.source-strip-main span:not(.source-logo) { color: var(--text-muted); }
.source-strip-stats { color: var(--text-secondary); }
.source-strip-stats b { color: var(--accent-strong); }

/* Full PickAI public catalog, presented in the monitor's own visual system. */
.catalog-section { margin-bottom: 18px; }
.catalog-section-heading { margin-bottom: 10px; }
.catalog-heading-tools { display: flex; align-items: center; gap: 8px; }
.catalog-search {
  width: min(300px, 27vw);
  height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .96);
}
.catalog-search:focus-within { border-color: #a9d6e9; box-shadow: 0 0 0 3px rgba(105, 182, 223, .12); }
.catalog-search svg { width: 15px; height: 15px; flex: 0 0 auto; }
.catalog-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text-primary); background: transparent; font-size: 11px; }
.catalog-search input::placeholder { color: var(--text-muted); }
.catalog-layout {
  display: grid;
  grid-template-columns: 156px minmax(260px, .72fr) minmax(0, 1.55fr);
  gap: 12px;
  align-items: stretch;
}
.catalog-category-panel, .catalog-product-panel, .catalog-quote-panel { min-width: 0; height: 510px; overflow: hidden; }
.catalog-panel-title {
  height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}
.catalog-panel-title b {
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #5c829a;
  background: #eef6fb;
  font-size: 9px;
}
.catalog-category-list { height: calc(100% - 111px); padding: 8px; overflow-y: auto; }
.catalog-category-button {
  width: 100%;
  min-height: 42px;
  padding: 0 8px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 9px;
  color: var(--text-secondary);
  background: transparent;
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  transition: background-color 160ms ease, color 160ms ease;
}
.catalog-category-button:hover { color: #23415a; background: #f2f8fc; }
.catalog-category-button.is-active { color: #23415a; background: #e6f3fb; }
.catalog-category-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #4b7f9d;
  background: #edf5fa;
  font-size: 9px;
  font-weight: 800;
}
.catalog-category-icon.has-logo, .catalog-product-icon.has-logo { background: transparent; }
.catalog-category-icon img, .catalog-product-icon img { width: 18px; height: 18px; display: block; object-fit: contain; }
.catalog-product-icon.has-logo { width: 24px; height: 24px; }
.catalog-icon-fallback { width: 100%; height: 100%; display: grid; place-items: center; }
.catalog-icon-fallback[hidden] { display: none; }
.catalog-category-button b { color: var(--text-muted); font-size: 9px; }
.catalog-panel-foot {
  min-height: 63px;
  padding: 11px 13px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 9px;
  line-height: 1.55;
}
.catalog-panel-foot .status-key { margin-top: 4px; }
.catalog-panel-foot small { color: var(--text-muted); font-size: 9px; }
.catalog-product-list { height: calc(100% - 48px); padding: 8px; overflow-y: auto; }
.catalog-product-button {
  width: 100%;
  min-height: 53px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  color: var(--text-secondary);
  background: transparent;
  text-align: left;
  transition: background-color 160ms ease, color 160ms ease;
}
.catalog-product-button:hover { background: #f2f8fc; }
.catalog-product-button.is-active { background: #e6f3fb; }
.catalog-product-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #376d89;
  background: #eaf4f9;
  font-size: 9px;
  font-weight: 800;
}
.category-icon img { width: 16px; height: 16px; display: block; object-fit: contain; }
.category-icon-fallback { font-size: 9px; font-weight: 800; }
.category-icon-fallback[hidden] { display: none; }
.link-button.is-disabled { opacity: .38; pointer-events: none; }
.catalog-product-copy { min-width: 0; display: grid; gap: 3px; }
.catalog-product-copy strong { overflow: hidden; color: var(--text-primary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-product-copy small { color: var(--text-muted); font-size: 9px; }
.catalog-product-price { color: var(--text-primary); font-size: 11px; font-weight: 800; white-space: nowrap; }
.catalog-product-price.is-empty { color: var(--text-muted); font-weight: 600; }
.catalog-quote-heading {
  min-height: 64px;
  padding: 13px 16px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.catalog-quote-heading h3 { margin: 0; color: var(--text-primary); font-size: 15px; }
.catalog-quote-heading p { max-width: 460px; margin: 4px 0 0; overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-quote-meta { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 9px; white-space: nowrap; }
.catalog-quote-meta span:first-child { padding: 4px 7px; border-radius: 999px; color: #4c819e; background: #edf6fb; font-weight: 700; }
.catalog-quote-table-wrap { height: calc(100% - 64px); overflow: auto; contain: inline-size; }
.catalog-quote-table { width: 100%; min-width: 620px; border-collapse: collapse; table-layout: fixed; }
.catalog-quote-table th {
  height: 38px;
  padding: 0 10px;
  position: sticky;
  z-index: 1;
  top: 0;
  color: #70889a;
  background: #f4f9fc;
  border-bottom: 1px solid var(--border-soft);
  font-size: 10px;
  font-weight: 650;
  text-align: left;
}
.catalog-quote-table th:first-child { width: 62%; padding-left: 16px; }
.catalog-quote-table th:nth-child(2) { width: 14%; }
.catalog-quote-table th:nth-child(3) { width: 14%; }
.catalog-quote-table th:nth-child(4) { width: 10%; }
.catalog-quote-table td { height: 58px; padding: 7px 10px; border-bottom: 1px solid var(--border-soft); color: var(--text-secondary); font-size: 10px; vertical-align: middle; }
.catalog-quote-table td:first-child { padding-left: 16px; }
.catalog-quote-table tbody tr:hover { background: #f7fbfd; }
.catalog-shop-cell { min-width: 0; display: flex; align-items: center; gap: 9px; }
.catalog-shop-avatar { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 9px; color: #fff; background: #4c8fa5; font-size: 10px; font-weight: 800; }
.catalog-shop-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.catalog-shop-copy { min-width: 0; display: grid; gap: 2px; }
.catalog-shop-copy strong { overflow: hidden; color: var(--text-primary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-shop-copy small { overflow: hidden; color: var(--text-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-stock { display: inline-flex; align-items: center; gap: 5px; color: #348d75; font-weight: 700; white-space: nowrap; }
.catalog-stock.is-empty { color: var(--text-muted); }
.catalog-price { color: var(--text-primary); font-size: 14px; font-weight: 800; white-space: nowrap; }
.catalog-buy-button {
  height: 28px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  background: #173748;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
  transition: background-color 160ms ease, transform 160ms ease;
}
.catalog-buy-button:hover { background: #24556e; transform: translateY(-1px); }
.catalog-loading-line, .catalog-quote-empty { color: var(--text-muted); font-size: 10px; }
.catalog-loading-line { padding: 14px 10px; }
.catalog-quote-empty { min-height: 300px; display: grid; place-items: center; }
.catalog-quote-empty[hidden] { display: none; }
.catalog-category-list, .catalog-product-list, .catalog-quote-table-wrap { scrollbar-width: thin; scrollbar-color: #9baab5 transparent; }
.catalog-category-list::-webkit-scrollbar, .catalog-product-list::-webkit-scrollbar, .catalog-quote-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.catalog-category-list::-webkit-scrollbar-track, .catalog-product-list::-webkit-scrollbar-track, .catalog-quote-table-wrap::-webkit-scrollbar-track { background: transparent; }
.catalog-category-list::-webkit-scrollbar-thumb, .catalog-product-list::-webkit-scrollbar-thumb, .catalog-quote-table-wrap::-webkit-scrollbar-thumb { background: #9baab5; border-radius: 999px; }

/* Empty/loading/overlay surfaces */
.empty-state { min-height: 220px; padding: 42px 18px; }
.empty-icon { width: 42px; height: 42px; margin-bottom: 10px; background: #eef4f8; }
.empty-state strong { color: var(--text-secondary); }
.empty-state p { color: var(--text-muted); }
.modal-backdrop { background: rgba(23, 43, 58, .34); }
.modal { border-radius: 15px; box-shadow: 0 18px 50px rgba(31, 54, 72, .18); }
.modal-heading { padding: 18px 20px 14px; }
.modal-heading h2 { font-size: 18px; }
#monitorForm { padding: 17px 20px 20px; gap: 14px; }
.form-field input, .form-field select { height: 36px; border-radius: 8px; background: #fbfdfe; }
.form-field input:focus, .form-field select:focus { border-color: #a9d6e9; box-shadow: 0 0 0 3px rgba(105, 182, 223, .12); }
.toast { border-color: #cfe4ef; border-radius: 10px; color: #31566c; background: #f6fbfe; box-shadow: 0 8px 24px rgba(51, 78, 98, .12); }
.toast svg { color: var(--accent-strong); }

/* Slim internal scrollbars */
.channel-table-wrap, .table-wrap, .status-tabs, .category-rail { scrollbar-width: thin; scrollbar-color: #9baab5 transparent; }
.channel-table-wrap::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .status-tabs::-webkit-scrollbar, .category-rail::-webkit-scrollbar { width: 6px; height: 6px; }
.channel-table-wrap::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track, .status-tabs::-webkit-scrollbar-track, .category-rail::-webkit-scrollbar-track { background: transparent; }
.channel-table-wrap::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb, .status-tabs::-webkit-scrollbar-thumb, .category-rail::-webkit-scrollbar-thumb { background: #9baab5; border-radius: 999px; }

@media (max-width: 1180px) {
  .topbar { gap: 16px; }
  .brand { min-width: 190px; }
  .nav-link { padding-left: 10px; padding-right: 10px; }
  .main-content { padding-left: 20px; padding-right: 20px; }
  .catalog-layout { grid-template-columns: 142px minmax(230px, .72fr) minmax(0, 1.4fr); gap: 10px; }
  .catalog-category-panel, .catalog-product-panel, .catalog-quote-panel { height: 500px; }
  .workspace-grid { grid-template-columns: minmax(0, 1.55fr) minmax(290px, .9fr); }
  .filters { grid-template-columns: minmax(150px, 1fr) 128px 140px auto; }
  .analytics-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .topbar { height: 58px; padding: 0 16px; }
  .brand { min-width: auto; }
  .brand-copy small { display: none; }
  .primary-nav { margin-left: auto; gap: 2px; }
  .nav-link { width: 36px; padding: 0; justify-content: center; font-size: 0; }
  .nav-link svg { width: 17px; height: 17px; }
  .nav-badge { top: 7px; right: 1px; }
  .main-content { padding-top: 20px; }
  .catalog-layout { grid-template-columns: 150px minmax(0, 1fr); }
  .catalog-category-panel, .catalog-product-panel { height: 380px; }
  .catalog-quote-panel { grid-column: 1 / -1; height: 500px; }
  .market-layout { grid-template-columns: 142px minmax(0, 1fr); gap: 10px; }
  .analytics-grid { grid-template-columns: 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .activity-panel { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-copy strong { font-size: 14px; }
  .topbar-tools { gap: 3px; }
  .service-state { display: none; }
  .main-content { padding: 18px 12px 32px; }
  .page-heading { display: block; margin-bottom: 14px; }
  h1 { font-size: 27px; }
  .heading-actions { margin-top: 13px; }
  .heading-actions .button { flex: 1; }
  .metrics-grid { gap: 8px; margin-bottom: 14px; }
  .metric-card { min-height: 98px; padding: 12px 13px 10px; }
  .metric-card > strong { font-size: 26px; }
  .metric-foot { margin-top: 8px; font-size: 9px; }
  .section-heading { display: block; }
  .analytics-status { margin-top: 8px; }
  .catalog-heading-tools { width: 100%; margin-top: 10px; }
  .catalog-search { width: min(100%, 360px); flex: 1 1 auto; }
  .catalog-layout { display: block; }
  .catalog-category-panel { height: 102px; margin-bottom: 9px; }
  .catalog-category-panel .catalog-panel-title { height: 39px; padding: 0 11px; }
  .catalog-category-list { height: 63px; padding: 7px; display: flex; gap: 5px; overflow-x: auto; overflow-y: hidden; }
  .catalog-category-button { width: auto; min-width: max-content; min-height: 48px; padding: 0 9px; grid-template-columns: 24px auto auto; }
  .catalog-category-icon { width: 24px; height: 24px; }
  .catalog-panel-foot { display: none; }
  .catalog-product-panel { height: 304px; margin-bottom: 9px; }
  .catalog-product-list { padding: 7px; }
  .catalog-product-button { min-height: 49px; }
  .catalog-quote-panel { height: 510px; }
  .catalog-quote-heading { min-height: 78px; padding: 11px 13px; display: block; }
  .catalog-quote-heading p { max-width: 100%; }
  .catalog-quote-meta { margin-top: 7px; justify-content: space-between; }
  .catalog-quote-table-wrap { height: calc(100% - 78px); }
  .catalog-quote-table { min-width: 570px; }
  .catalog-quote-table th:first-child { width: 60%; padding-left: 13px; }
  .catalog-quote-table td:first-child { padding-left: 13px; }
  .market-layout { display: block; }
  .category-rail { min-height: 0; margin-bottom: 9px; padding: 7px; display: flex; gap: 4px; overflow-x: auto; }
  .category-title, .category-divider, .category-foot { display: none; }
  .category-item { width: auto; min-width: max-content; grid-template-columns: 22px auto auto; min-height: 34px; padding: 0 7px; }
  .category-item b { display: block; }
  .market-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .market-metric { min-height: 82px; padding: 11px; }
  .market-metric > strong { font-size: 21px; }
  .market-chart-wrap { padding-left: 11px; padding-right: 11px; }
  .market-chart-wrap svg { height: 150px; }
  .market-chart-legend { flex-wrap: wrap; gap: 7px 12px; padding-left: 13px; padding-right: 13px; }
  .market-chart-legend span:last-child { width: 100%; margin-left: 0; }
  .channel-table { min-width: 0; width: 100%; table-layout: fixed; }
  .channel-table th:nth-child(5), .channel-table td:nth-child(5),
  .channel-table th:nth-child(6), .channel-table td:nth-child(6) { display: none; }
  .channel-table th:nth-child(1) { width: 46%; }
  .channel-table th:nth-child(2), .channel-table th:nth-child(3), .channel-table th:nth-child(4) { width: 18%; }
  .inventory-heading { display: block; }
  .panel-heading-meta { margin-top: 8px; justify-content: space-between; }
  .filters { padding: 0 13px 10px; grid-template-columns: 1fr 1fr; gap: 7px; }
  .search-field { grid-column: 1 / -1; }
  .compact-select { grid-column: 1; }
  .filter-button { grid-column: 2; }
  .status-tabs { overflow-x: auto; gap: 15px; padding: 0 13px; scrollbar-width: none; }
  .status-tabs::-webkit-scrollbar { display: none; }
  .status-tab { flex: 0 0 auto; }
  .product-table { min-width: 0; width: 100%; table-layout: fixed; }
  .product-table th:nth-child(4), .product-table td:nth-child(4),
  .product-table th:nth-child(5), .product-table td:nth-child(5) { display: none; }
  .product-table th.col-product { width: 55%; }
  .product-table th:nth-child(2) { width: 18%; }
  .product-table th:nth-child(3) { width: 18%; }
  .product-table th:nth-child(6) { width: 9%; }
  .product-table th:first-child, .product-table td:first-child { padding-left: 13px; }
  .product-table th:last-child, .product-table td:last-child { padding-right: 13px; }
  .table-footer { padding: 0 13px; }
  .side-stack { grid-template-columns: 1fr; }
  .activity-panel { grid-column: auto; }
  .source-strip { align-items: start; flex-wrap: wrap; padding: 12px; gap: 9px; }
  .source-strip-main { min-width: 100%; }
  .source-strip-stats { width: 100%; margin-left: 0; justify-content: space-between; gap: 8px; }
  .source-strip > .icon-button { position: absolute; right: 19px; margin-top: -33px; }
}

/*
 * Comfortable desktop reading scale.
 * This mirrors a 120% browser zoom for the desktop tool while keeping the
 * compact mobile breakpoint untouched.
 */
@media (min-width: 1200px) {
  :root { --ui-zoom: 1.2; }
  body { zoom: 1.2; }
}

@media (max-width: 1199px) {
  :root { --ui-zoom: 1; }
  body { zoom: 1; }
}
