/* ==========================================================================
   AOS V2.3 Practical Operations Cockpit (Mobile-First 375/390/430 + Desktop)
   ========================================================================== */

:root {
  --bg-canvas: #F7F8FA;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F3F6;
  --bg-hover: #F9FAFB;
  --border-default: #E5E7EB;
  --border-subtle: #F0F2F5;
  --border-strong: #D1D5DB;

  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;

  --accent: #1D4ED8;
  --accent-soft: #EFF6FF;
  --accent-border: #BFDBFE;
  --orange: #EA580C;

  --ok-bg: #ECFDF5;
  --ok-text: #047857;
  --ok-border: #A7F3D0;
  --ok-dot: #10B981;

  --warn-bg: #FFFBEB;
  --warn-text: #B45309;
  --warn-border: #FDE68A;
  --warn-dot: #F59E0B;

  --risk-bg: #FEF2F2;
  --risk-text: #B91C1C;
  --risk-border: #FECACA;
  --risk-dot: #EF4444;

  --est-light-color: #4B5563;

  --radius-card: 12px;
  --radius-control: 8px;
  --radius-sm: 6px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-drawer: -12px 0 36px rgba(15, 23, 42, 0.14);

  --sidebar-width: 224px;
  --topbar-height: 60px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

button { cursor: pointer; }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* Unified estimated-share > 0.5 lighter style across Desktop & Mobile */
.is-est-light,
.v22-kpi-val.is-est-light,
.v22-kpi-main-num.is-est-light {
  font-weight: 500 !important;
  color: var(--est-light-color) !important;
}

/* Shell */
.v22-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.v22-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.v22-brand {
  height: var(--topbar-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v22-brand-left { display: flex; align-items: center; gap: 9px; }
.v22-brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--text-primary); color: #FFF;
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.v22-brand-name { font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; }
.v22-version {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  padding: 2px 7px; border-radius: var(--radius-pill);
}

.v22-nav { flex: 1 1 auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.v22-nav-group { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 8px 10px 4px; }
.v22-nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px;
  padding: 8px 10px; border: 0; border-radius: var(--radius-control);
  background: transparent; color: var(--text-secondary); font-size: 13.5px; font-weight: 500; text-align: left;
}
.v22-nav-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.v22-nav-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.v22-nav-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.v22-sidebar-footer { padding: 12px; border-top: 1px solid var(--border-default); }
.v22-legacy-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 8px 10px; border-radius: var(--radius-control);
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 12.5px; font-weight: 500;
}

/* Main Frame & Unified Topbar (2-row safe on mobile) */
.v22-main { min-width: 0; display: flex; flex-direction: column; }

.v22-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  padding: 10px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v22-topbar-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.v22-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.v22-title-row h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.v22-site-pill {
  font-size: 11px; font-weight: 600; padding: 1px 7px;
  border-radius: var(--radius-pill); background: var(--bg-subtle);
  border: 1px solid var(--border-default); color: var(--text-secondary);
  white-space: nowrap;
}

.v22-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.v22-topbar-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.v22-health-trigger {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border-radius: var(--radius-pill); background: var(--bg-surface);
  border: 1px solid var(--border-default); font-size: 12px; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap;
}

.v22-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.v22-dot.ok { background: var(--ok-dot); }
.v22-dot.warn { background: var(--warn-dot); }
.v22-dot.risk { background: var(--risk-dot); }

.v22-more-header-btn {
  display: none; align-items: center; height: 30px; padding: 0 10px;
  border-radius: var(--radius-control); background: var(--bg-subtle);
  border: 1px solid var(--border-default); font-size: 12px; font-weight: 600; color: var(--text-secondary);
  white-space: nowrap;
}

/* Segmented Controls & Date Picker */
.v22-period-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.v22-segmented {
  display: inline-flex; align-items: center;
  background: var(--bg-subtle); padding: 2px;
  border-radius: var(--radius-control); border: 1px solid var(--border-subtle);
  gap: 2px;
}

.v22-seg-btn {
  height: 26px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary); font-size: 12px; font-weight: 500;
  white-space: nowrap;
}

.v22-seg-btn.active {
  background: var(--bg-surface); color: var(--text-primary); font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.v22-date-input {
  height: 30px; padding: 0 8px; border-radius: var(--radius-control);
  border: 1px solid var(--border-default); background: var(--bg-surface);
  font-size: 12px; color: var(--text-secondary);
}

.v22-updated-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Early Morning Hint Pill */
.v22-hint-strip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-control);
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  font-size: 12px; color: var(--accent); font-weight: 500;
}

/* Content Canvas */
.v22-content {
  max-width: 1400px;
  width: 100%;
  padding: 16px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Compact 2x2 (Mobile) / 4-col (Desktop) KPI Grid with 今/昨 Dual-Row */
.v22-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.v22-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.v22-kpi-card.is-clickable { cursor: pointer; }
.v22-kpi-card.is-clickable:hover { border-color: var(--accent-border); }

.v22-kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.v22-kpi-row-main {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.v22-tag-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 4px; font-size: 10.5px; font-weight: 600; flex-shrink: 0;
}
.v22-tag-chip.primary { background: var(--accent-soft); color: var(--accent); }
.v22-tag-chip.compare { background: var(--bg-subtle); color: var(--text-muted); }

.v22-kpi-main-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v22-kpi-main-num.is-accent { color: var(--accent); }

.v22-kpi-row-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.v22-kpi-val {
  font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; line-height: 1.2;
}
.v22-kpi-val.is-accent { color: var(--accent); }
.v22-kpi-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11.5px; color: var(--text-muted); }

.v22-delta {
  font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 4px;
}
.v22-delta.up { background: var(--ok-bg); color: var(--ok-text); }
.v22-delta.down { background: var(--risk-bg); color: var(--risk-text); }
.v22-delta.neutral { background: var(--bg-subtle); color: var(--text-secondary); }

/* Home Desktop 2-col Grid */
.v22-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

/* Surface Cards */
.v22-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  min-width: 0;
}

.v22-card-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.v22-card-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--text-primary); }
.v22-card-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.v22-card-meta { font-size: 11.5px; color: var(--text-muted); }
.v22-card-body { padding: 14px 16px; }

.v22-select-sm {
  height: 28px; padding: 0 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-default); background: var(--bg-surface);
  font-size: 12px; font-weight: 500; color: var(--text-primary);
}

/* Charts & 3-Column Summary Strip */
.v22-chart-svg { width: 100%; height: 196px; display: block; }
.v22-chart-legend {
  display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--text-secondary); margin-bottom: 6px;
}
.v22-legend-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle;
}

.v22-summary-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.v22-summary-cell {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; background: var(--bg-subtle); border-radius: var(--radius-control);
}
.v22-summary-cell span { font-size: 11px; color: var(--text-muted); }
.v22-summary-cell strong { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }

/* 3x2 Ads 6-Grid */
.v22-ads-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.v22-ads-cell {
  padding: 8px 10px;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.v22-ads-cell-label { font-size: 11px; color: var(--text-muted); }
.v22-ads-cell-val { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.v22-ads-cell-delta { font-size: 11px; color: var(--text-secondary); }

/* Profit Brief Strip on Home */
.v22-profit-brief-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

/* Soft Pills */
.v22-pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.v22-pill.ok { background: var(--ok-bg); color: var(--ok-text); border: 1px solid var(--ok-border); }
.v22-pill.warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }
.v22-pill.risk { background: var(--risk-bg); color: var(--risk-text); border: 1px solid var(--risk-border); }
.v22-pill.neutral { background: var(--bg-subtle); color: var(--text-secondary); border: 1px solid var(--border-default); }

/* Ranking Product Row (Products Page + Home Top 3) */
.v22-rank-list { display: flex; flex-direction: column; }

.v22-rank-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.1s ease;
}
.v22-rank-row:last-child { border-bottom: 0; }
.v22-rank-row:hover { background: var(--bg-hover); }

.v22-rank-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v22-rank-badge {
  width: 20px; height: 20px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  background: var(--bg-subtle); color: var(--text-secondary);
}
.v22-rank-badge.r1 { background: #1D4ED8; color: #FFFFFF; }
.v22-rank-badge.r2 { background: #3B82F6; color: #FFFFFF; }
.v22-rank-badge.r3 { background: #64748B; color: #FFFFFF; }

.v22-thumb {
  width: 44px; height: 44px; border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-subtle);
  object-fit: cover;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
}

.v22-rank-mid { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.v22-sku-name {
  display: block;
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v22-sku-sub { display: block; font-size: 11.5px; color: var(--text-muted); }
.v22-inv-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 11.5px; color: var(--text-secondary);
}

.v22-rank-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.v22-rank-primary { font-size: 15.5px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.v22-rank-compare { font-size: 11.5px; color: var(--text-muted); }

/* Sticky Bottom Totals Bar (Products Page) */
.v22-sticky-totals {
  position: sticky;
  bottom: 0;
  z-index: 25;
  background: #0F172A;
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.16);
}
.v22-sticky-totals-vals {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.v22-sticky-totals strong { font-size: 14px; color: #FFFFFF; }
.v22-sticky-totals small { color: #CBD5E1; font-size: 11.5px; }

/* Toolbar */
.v22-toolbar {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v22-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.v22-search-input {
  height: 34px; min-width: 220px; flex: 1 1 200px;
  padding: 0 12px; border-radius: var(--radius-control);
  border: 1px solid var(--border-default); background: var(--bg-surface);
  font-size: 13px; outline: none;
}
.v22-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Tables & Mobile Cards (Ads & Profit) */
.v22-table-wrap { width: 100%; overflow-x: auto; }
.v22-table { width: 100%; border-collapse: collapse; }
.v22-table th {
  padding: 10px 14px; font-size: 11.5px; font-weight: 600; color: var(--text-secondary);
  background: #FAFBFD; border-bottom: 1px solid var(--border-default); text-align: left; white-space: nowrap;
}
.v22-table th.num, .v22-table td.num { text-align: right; }
.v22-table td { padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.v22-table tr.is-residual-row td { background: var(--bg-subtle); color: var(--text-secondary); font-size: 12.5px; }

.v22-mobile-list { display: none; flex-direction: column; gap: 10px; padding: 12px; }
.v22-m-card {
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-card); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
}
.v22-m-card.is-residual-card { background: var(--bg-subtle); border-style: dashed; }
.v22-m-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.v22-m-metrics-3 {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  padding: 8px 10px; background: var(--bg-subtle); border-radius: var(--radius-control);
}
.v22-m-metric { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v22-m-metric span { font-size: 11px; color: var(--text-muted); }
.v22-m-metric strong { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }

/* Waterfall */
.v22-waterfall { display: flex; flex-direction: column; gap: 10px; }
.v22-wf-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 118px; align-items: center; gap: 10px; font-size: 13px; }
.v22-wf-track { height: 15px; background: var(--bg-subtle); border-radius: 4px; overflow: hidden; }
.v22-wf-bar { height: 100%; border-radius: 4px; }
.v22-wf-bar.positive { background: var(--accent); }
.v22-wf-bar.cost { background: #64748B; }
.v22-wf-bar.net { background: var(--ok-dot); }
.v22-wf-val { text-align: right; font-weight: 600; }

/* Review & Action Links */
.v22-rec-list { display: flex; flex-direction: column; }
.v22-rec-item { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 6px; }
.v22-rec-item:last-child { border-bottom: 0; }
.v22-rec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v22-rec-title { font-size: 13.5px; font-weight: 600; }
.v22-rec-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.v22-link-btn { border: 0; background: transparent; padding: 0; color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.v22-review-actions { display: inline-flex; gap: 6px; }
.v22-mini-btn {
  height: 28px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-default); background: var(--bg-surface); font-size: 12px; color: var(--text-secondary);
}
.v22-mini-btn.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); font-weight: 600; }

/* Drawers */
.v22-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.28); backdrop-filter: blur(1px); z-index: 90; }
.v22-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw);
  background: var(--bg-surface); border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-drawer); z-index: 100; display: flex; flex-direction: column; overflow-y: auto;
}
.v22-drawer-head {
  position: sticky; top: 0; background: var(--bg-surface); padding: 16px 20px;
  border-bottom: 1px solid var(--border-default); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; z-index: 2;
}
.v22-drawer-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.v22-drawer-close {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-default);
  background: var(--bg-surface); font-size: 16px; display: inline-flex; align-items: center; justify-content: center;
}
.v22-drawer-body { padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 14px; }
.v22-kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.v22-kv-box { padding: 10px 12px; background: var(--bg-subtle); border-radius: var(--radius-control); display: flex; flex-direction: column; gap: 2px; }
.v22-kv-box span { font-size: 11px; color: var(--text-muted); }
.v22-kv-box strong { font-size: 14.5px; font-weight: 700; }
.v22-health-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-default); border-radius: var(--radius-control); }
.v22-legacy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.v22-legacy-link { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius-card); background: var(--bg-subtle); border: 1px solid var(--border-default); text-decoration: none; color: var(--text-primary); }
.v22-legacy-link small { font-size: 11.5px; color: var(--text-secondary); }

/* Ads Decision List Context Bar & Product 360 Timeline */
.v22-decision-filters {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 10px 16px; border-bottom: 1px solid var(--border-subtle); background: #FAFBFD;
}
.v22-filter-pill {
  height: 28px; padding: 0 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-default); background: var(--bg-surface);
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
}
.v22-filter-pill.active {
  background: var(--accent-soft); border-color: var(--accent-border);
  color: var(--accent); font-weight: 600;
}
.v22-sku-context-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  background: #FAFBFD; border: 1px solid var(--border-subtle);
  font-size: 11.5px; color: var(--text-secondary);
}
.v22-timeline {
  display: flex; flex-direction: column; gap: 0;
  border-left: 2px solid var(--border-default); margin-left: 6px; padding-left: 14px;
}
.v22-timeline-item {
  position: relative; padding-bottom: 12px; display: flex; flex-direction: column; gap: 3px;
}
.v22-timeline-item:last-child { padding-bottom: 0; }
.v22-timeline-dot {
  position: absolute; left: -20px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; border: 2px solid var(--bg-surface); background: var(--accent);
}
.v22-timeline-dot.ok { background: var(--ok-dot); }
.v22-timeline-dot.warn { background: var(--warn-dot); }
.v22-timeline-dot.risk { background: var(--risk-dot); }
.v22-timeline-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.v22-timeline-empty {
  padding: 12px 14px; border-radius: var(--radius-control);
  background: var(--bg-subtle); border: 1px dashed var(--border-strong);
  font-size: 12px; color: var(--text-secondary); line-height: 1.5;
}

/* Mobile Fixed 4-Tab Bottom Navigation */
.v22-bottom-nav { display: none; }

@media (max-width: 1100px) {
  .v22-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .v22-home-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
  .v22-shell { display: block; }
  .v22-sidebar { display: none; }
  .v22-topbar { padding: 10px 14px; gap: 8px; }
  .v22-more-header-btn { display: inline-flex; }
  .v22-content { padding: 12px 12px calc(76px + env(safe-area-inset-bottom)); gap: 12px; }
  .v22-content.has-sticky-totals { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }
  .v22-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .v22-kpi-card { padding: 10px 12px; }
  .v22-kpi-main-num { font-size: 17.5px; }
  .v22-profit-brief-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v22-desktop-table { display: none; }
  .v22-mobile-list { display: flex; }
  .v22-search-input { min-width: 0; width: 100%; }
  .v22-wf-row { grid-template-columns: 96px minmax(0, 1fr) 92px; gap: 8px; font-size: 12px; }
  .v22-sticky-totals {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(66px + env(safe-area-inset-bottom));
    padding: 9px 12px;
    font-size: 12px;
  }
  .v22-drawer {
    top: 8vh; left: 0; right: 0; bottom: 0; width: 100vw;
    border-left: 0; border-top: 1px solid var(--border-default); border-radius: 18px 18px 0 0;
  }
  .v22-kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v22-bottom-nav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(58px + env(safe-area-inset-bottom));
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: var(--bg-surface); border-top: 1px solid var(--border-default);
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05); z-index: 80;
  }
  .v22-bottom-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; border: 0; background: transparent; color: var(--text-muted);
    font-size: 11px; font-weight: 500; min-height: 46px;
  }
  .v22-bottom-btn.active { color: var(--accent); font-weight: 600; }
  .v22-bottom-btn svg { width: 19px; height: 19px; }
}
