:root {
  color-scheme: light;
  --mj-bg: #f4f1eb;
  --mj-bg-top: #f8f6f1;
  --mj-surface: rgba(255, 255, 255, .76);
  --mj-surface-solid: #fbfaf7;
  --mj-text: #171815;
  --mj-muted: #696b65;
  --mj-placeholder: #93958e;
  --mj-line: rgba(23, 24, 21, .13);
  --mj-line-strong: rgba(23, 24, 21, .22);
  --mj-accent: #2f4a3c;
  --mj-accent-hover: #3d5d4d;
  --mj-accent-soft: rgba(47, 74, 60, .09);
  --mj-danger: #9b3f36;
  --mj-warning: #8a621f;
  --mj-radius-control: 6px;
  --mj-radius-panel: 8px;
  --mj-shadow-panel: 0 20px 60px rgba(30, 31, 28, .07);
  --mj-shadow-menu: 0 18px 45px rgba(30, 31, 28, .13);
  --mj-width-product: 1120px;
  --mj-fast: 160ms;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--mj-bg); color: var(--mj-text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { color: inherit; font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { width: 20px; height: 20px; stroke-width: 1.8; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid rgba(47, 74, 60, .22); outline-offset: 2px; }

.brand-lockup { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--mj-text); text-decoration: none; }
.brand-mark { position: relative; display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; }
.brand-mark span { position: absolute; border: 1px solid var(--mj-accent); border-radius: 50%; }
.brand-mark span:nth-child(1) { width: 31px; height: 31px; opacity: .35; }
.brand-mark span:nth-child(2) { width: 21px; height: 21px; opacity: .65; }
.brand-mark span:nth-child(3) { width: 9px; height: 9px; background: var(--mj-accent); }
.brand-name { font-size: 18px; font-weight: 680; }
.brand-by { color: var(--mj-muted); font-size: 13px; }

.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid transparent; border-radius: var(--mj-radius-control); background: transparent; cursor: pointer; font-size: 14px; font-weight: 650; text-decoration: none; transition: background var(--mj-fast), border-color var(--mj-fast), color var(--mj-fast), transform var(--mj-fast); }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .62; }
.button-primary { background: var(--mj-accent); color: #fff; }
.button-primary:hover { background: var(--mj-accent-hover); }
.button-secondary { border-color: var(--mj-line-strong); background: rgba(255,255,255,.28); }
.button-secondary:hover { border-color: var(--mj-accent); background: rgba(255,255,255,.7); }
.button-danger { border-color: rgba(155,63,54,.3); color: var(--mj-danger); }
.button-danger:hover { background: rgba(155,63,54,.07); }
.button-icon-text { gap: 9px; }
.button-icon-text svg { width: 18px; height: 18px; }
.icon-button { display: inline-grid; width: 48px; height: 48px; flex: 0 0 48px; padding: 0; place-items: center; border: 1px solid var(--mj-line); border-radius: var(--mj-radius-control); background: rgba(255,255,255,.42); cursor: pointer; transition: background var(--mj-fast), border-color var(--mj-fast), color var(--mj-fast); }
.icon-button:hover { border-color: var(--mj-line-strong); background: #fff; color: var(--mj-accent); }
.icon-button-small { width: 36px; height: 36px; flex-basis: 36px; }
.icon-button-small svg { width: 17px; height: 17px; }
.eyebrow { margin: 0 0 7px; color: var(--mj-accent); font-size: 12px; font-weight: 720; line-height: 1.2; text-transform: uppercase; }

.app-header { position: sticky; z-index: 20; top: 0; height: 82px; border-bottom: 1px solid var(--mj-line); background: rgba(248,246,241,.9); backdrop-filter: blur(16px); }
.header-inner { display: grid; grid-template-columns: 220px minmax(260px, 520px) 1fr; align-items: center; gap: 28px; width: min(100% - 40px, 1400px); height: 100%; margin: 0 auto; }
.header-actions { display: flex; justify-content: flex-end; gap: 8px; }
.mobile-menu-button { display: none; }
.search-control { position: relative; display: flex; align-items: center; width: 100%; }
.search-control > svg { position: absolute; left: 15px; width: 18px; color: var(--mj-muted); pointer-events: none; }
.search-control input { width: 100%; height: 48px; padding: 0 48px 0 44px; border: 1px solid var(--mj-line); border-radius: var(--mj-radius-control); background: rgba(255,255,255,.62); outline: 0; transition: border-color var(--mj-fast), box-shadow var(--mj-fast), background var(--mj-fast); }
.search-control input::placeholder { color: var(--mj-placeholder); }
.search-control input:focus { border-color: var(--mj-accent); background: #fff; box-shadow: 0 0 0 3px rgba(47,74,60,.12); }
.search-clear { position: absolute; right: 5px; display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 0; background: transparent; color: var(--mj-muted); cursor: pointer; }
.search-clear svg { width: 17px; }

.workspace { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 42px; width: min(100% - 40px, 1400px); min-height: calc(100vh - 82px); margin: 0 auto; }
.sidebar { position: sticky; top: 82px; display: flex; height: calc(100vh - 82px); min-height: 520px; flex-direction: column; padding: 34px 0 20px; border-right: 1px solid var(--mj-line); }
.sidebar-mobile-head, .sidebar-backdrop { display: none; }
.primary-nav { display: grid; gap: 4px; padding-right: 20px; }
.nav-item { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--mj-radius-control); background: transparent; text-align: left; cursor: pointer; transition: background var(--mj-fast), color var(--mj-fast), border-color var(--mj-fast); }
.nav-item:hover { background: rgba(255,255,255,.48); }
.nav-item.is-active { background: var(--mj-accent-soft); color: var(--mj-accent); font-weight: 650; }
.nav-item svg { width: 18px; height: 18px; }
.nav-count { color: var(--mj-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sidebar-section { display: grid; gap: 4px; margin-top: 30px; padding-right: 20px; }
.sidebar-label { margin: 0 0 6px; padding: 0 10px; color: var(--mj-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.sidebar-bottom { display: grid; gap: 16px; margin-top: auto; padding-right: 20px; }
.account-row { display: grid; grid-template-columns: 36px minmax(0,1fr) 36px; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid var(--mj-line); }
.account-avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--mj-accent); color: #fff; font-size: 13px; font-weight: 750; }
.account-copy { min-width: 0; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 13px; }
.account-copy small { margin-top: 2px; color: var(--mj-muted); font-size: 11px; }

.main-content { min-width: 0; padding: 52px 0 88px; }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.view-heading h1 { margin: 0; font-size: 28px; font-weight: 620; line-height: 1.15; }
.view-summary { margin: 0 0 3px; color: var(--mj-muted); font-size: 13px; }
.metrics-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 30px; border-block: 1px solid var(--mj-line); }
.metric { min-width: 0; padding: 20px 22px; border-right: 1px solid var(--mj-line); }
.metric:first-child { padding-left: 0; }
.metric:last-child { border-right: 0; }
.metric span, .metric strong { display: block; }
.metric span { color: var(--mj-muted); font-size: 12px; font-weight: 650; }
.metric strong { margin-top: 7px; overflow: hidden; font-size: 23px; font-variant-numeric: tabular-nums; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.metric strong.is-positive { color: var(--mj-accent); }
.metric strong.is-negative { color: var(--mj-danger); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; }
.segmented-control { display: inline-flex; height: 40px; padding: 3px; border: 1px solid var(--mj-line); border-radius: var(--mj-radius-control); background: rgba(255,255,255,.36); }
.segmented-control button { display: grid; width: 38px; height: 32px; padding: 0; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--mj-muted); cursor: pointer; }
.segmented-control button.is-active { background: var(--mj-surface-solid); color: var(--mj-accent); box-shadow: 0 1px 4px rgba(30,31,28,.08); }
.segmented-control svg { width: 17px; height: 17px; }
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap select { height: 40px; min-width: 168px; padding: 0 38px 0 12px; border: 1px solid var(--mj-line); border-radius: var(--mj-radius-control); appearance: none; background: rgba(255,255,255,.42); font-size: 13px; }
.select-wrap svg { position: absolute; right: 11px; width: 15px; pointer-events: none; }
.cards-region { margin-top: 18px; }
.loading-state, .empty-state { display: grid; min-height: 320px; place-items: center; align-content: center; gap: 13px; border-block: 1px solid var(--mj-line); color: var(--mj-muted); font-size: 14px; text-align: center; }
.empty-state svg { width: 28px; height: 28px; color: var(--mj-accent); }
.empty-state strong { color: var(--mj-text); font-size: 18px; font-weight: 610; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--mj-line-strong); border-top-color: var(--mj-accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card-list { display: grid; border-top: 1px solid var(--mj-line); }
.card-row { display: grid; grid-template-columns: 58px minmax(180px, 1.4fr) minmax(100px, .7fr) minmax(120px, .7fr) 112px 116px 36px; align-items: center; gap: 16px; min-height: 88px; padding: 12px 8px 12px 0; border: 0; border-bottom: 1px solid var(--mj-line); background: transparent; text-align: left; cursor: pointer; transition: background var(--mj-fast); }
.card-row:hover { background: rgba(255,255,255,.36); }
.card-thumb { position: relative; display: grid; width: 48px; height: 64px; overflow: hidden; place-items: center; border: 1px solid var(--mj-line); border-radius: 5px; background: #e6e2d9; color: var(--mj-muted); font-size: 11px; font-weight: 750; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-copy, .card-meta-cell { min-width: 0; }
.card-copy strong { display: block; overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.card-copy span, .card-meta-cell span { display: block; margin-top: 5px; overflow: hidden; color: var(--mj-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.status-line { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--mj-muted); }
.status-current .status-dot, .status-manual .status-dot { background: var(--mj-accent); }
.status-stale .status-dot { background: var(--mj-warning); }
.status-error .status-dot { background: var(--mj-danger); }
.status-age-warning { color: var(--mj-warning); }
.status-age-critical { color: var(--mj-danger); }
.status-age-warning svg, .status-age-critical svg { width: 15px; height: 15px; flex: 0 0 15px; }
.age-badge { position: absolute; z-index: 2; top: 3px; right: 3px; display: grid; width: 21px; height: 21px; place-items: center; border: 1px solid rgba(255,255,255,.78); border-radius: 50%; color: #fff; box-shadow: 0 1px 4px rgba(23,24,21,.22); }
.age-badge.warning { background: var(--mj-warning); }
.age-badge.critical { background: var(--mj-danger); }
.age-badge svg { width: 13px; height: 13px; stroke-width: 2.2; }
.monitoring-badge { position: absolute; z-index: 2; top: 3px; left: 3px; display: grid; width: 19px; height: 19px; place-items: center; border: 1px solid rgba(255,255,255,.78); border-radius: 50%; background: rgba(55,57,52,.78); color: #fff; box-shadow: 0 1px 4px rgba(23,24,21,.18); }
.monitoring-badge svg { width: 11px; height: 11px; fill: currentColor; stroke-width: 2; }
.price-cell { min-width: 0; text-align: right; }
.price-cell strong { display: block; font-size: 15px; font-variant-numeric: tabular-nums; font-weight: 680; white-space: nowrap; }
.price-cell span { display: block; margin-top: 4px; color: var(--mj-muted); font-size: 11px; white-space: nowrap; }
.trend-cell { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.sparkline { width: 72px; height: 30px; }
.change { font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 680; }
.change.up { color: var(--mj-accent); }
.change.down { color: var(--mj-danger); }
.row-chevron { color: var(--mj-muted); }
.row-chevron svg { width: 17px; }
.target-hit { color: var(--mj-accent); font-weight: 650; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.card-tile { position: relative; display: grid; grid-template-rows: 190px auto; min-width: 0; overflow: hidden; padding: 0; border: 1px solid var(--mj-line); border-radius: var(--mj-radius-panel); background: rgba(255,255,255,.45); text-align: left; cursor: pointer; transition: border-color var(--mj-fast), background var(--mj-fast); }
.card-tile:hover { border-color: var(--mj-line-strong); background: rgba(255,255,255,.72); }
.tile-image { position: relative; display: grid; overflow: hidden; place-items: center; border-bottom: 1px solid var(--mj-line); background: #e6e2d9; color: var(--mj-muted); font-size: 22px; font-weight: 720; }
.tile-image img { width: 100%; height: 100%; object-fit: contain; }
.tile-body { min-width: 0; padding: 16px; }
.tile-body strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { min-height: 18px; margin: 5px 0 18px; overflow: hidden; color: var(--mj-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tile-bottom { display: flex; align-items: end; justify-content: space-between; gap: 10px; }

.dialog { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; }
.dialog::backdrop { background: rgba(23,24,21,.42); backdrop-filter: blur(3px); }
.dialog[open] { display: grid; place-items: center; padding: 20px; }
.dialog-panel { display: flex; width: min(100%, 760px); max-height: min(90vh, 900px); flex-direction: column; overflow: hidden; border: 1px solid var(--mj-line-strong); border-radius: var(--mj-radius-panel); background: var(--mj-surface-solid); box-shadow: var(--mj-shadow-menu); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 20px; border-bottom: 1px solid var(--mj-line); }
.dialog-header h2 { margin: 0; font-size: 21px; font-weight: 620; line-height: 1.2; }
.dialog-body { overflow-y: auto; padding: 24px 26px; }
.dialog-footer { display: flex; align-items: center; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--mj-line); background: rgba(244,241,235,.55); }
.footer-spacer { flex: 1; }
.form-sections { display: grid; gap: 26px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset + fieldset { padding-top: 25px; border-top: 1px solid var(--mj-line); }
legend { margin-bottom: 16px; padding: 0; font-size: 13px; font-weight: 730; }
.field-grid { display: grid; gap: 16px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field.wide { grid-column: 1 / -1; }
.monitoring-row { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--mj-line); }
.monitoring-row strong { font-size: 13px; font-weight: 680; }
.field { display: grid; min-width: 0; gap: 8px; }
.field > span:first-child, .field-label { font-size: 12px; font-weight: 670; }
.field input, .field select, .field textarea, .text-input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--mj-line-strong); border-radius: var(--mj-radius-control); background: rgba(255,255,255,.72); outline: 0; transition: border-color var(--mj-fast), box-shadow var(--mj-fast), background var(--mj-fast); }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .text-input:focus { border-color: var(--mj-accent); background: #fff; box-shadow: 0 0 0 3px rgba(47,74,60,.12); }
.money-input { display: grid; grid-template-columns: minmax(0,1fr) 82px; }
.money-input input { border-radius: var(--mj-radius-control) 0 0 var(--mj-radius-control); }
.money-input select { border-left: 0; border-radius: 0 var(--mj-radius-control) var(--mj-radius-control) 0; }
.compact-dialog .dialog-panel { width: min(100%, 430px); }
.settings-dialog .dialog-panel { width: min(100%, 650px); }
.detail-dialog .dialog-panel { width: min(100%, 820px); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.settings-row strong, .settings-row span { display: block; }
.settings-row strong { font-size: 14px; }
.settings-row span { margin-top: 4px; color: var(--mj-muted); font-size: 12px; }
.switch { position: relative; display: inline-flex; width: 46px; height: 26px; flex: 0 0 46px; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 100%; height: 100%; border: 1px solid var(--mj-line-strong); border-radius: 13px; background: #d9d6cf; cursor: pointer; transition: background var(--mj-fast); }
.switch span::after { display: block; width: 20px; height: 20px; margin: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); content: ""; transition: transform var(--mj-fast); }
.switch input:checked + span { background: var(--mj-accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.key-status { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; color: var(--mj-muted); font-size: 13px; }
.key-status.is-connected .status-dot { background: var(--mj-accent); }
.export-actions { display: flex; gap: 10px; }
.usage-line { margin: 14px 0 0; color: var(--mj-muted); font-size: 12px; }

.detail-body { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 26px; overflow-y: auto; padding: 24px 26px 28px; }
.detail-visual { display: grid; align-content: start; gap: 12px; }
.detail-image { display: grid; width: 100%; aspect-ratio: 5 / 7; overflow: hidden; place-items: center; border: 1px solid var(--mj-line); border-radius: 6px; background: #e6e2d9; color: var(--mj-muted); font-size: 36px; font-weight: 720; }
.detail-image img { width: 100%; height: 100%; object-fit: contain; }
.detail-source { display: flex; align-items: center; gap: 7px; overflow: hidden; color: var(--mj-accent); font-size: 12px; text-decoration: none; }
.detail-source span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-source svg { width: 15px; flex: 0 0 15px; }
.detail-main { min-width: 0; }
.detail-price { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.detail-price strong { display: block; font-size: 29px; font-variant-numeric: tabular-nums; font-weight: 620; }
.detail-price span { display: block; margin-top: 5px; color: var(--mj-muted); font-size: 12px; }
.confidence { padding: 5px 8px; border: 1px solid var(--mj-line); border-radius: 4px; color: var(--mj-muted); font-size: 11px; font-weight: 650; }
.chart-wrap { height: 210px; margin-top: 24px; border-block: 1px solid var(--mj-line); padding: 16px 0; }
.history-chart { width: 100%; height: 100%; }
.detail-facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 20px; }
.detail-fact { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--mj-line); }
.detail-fact span, .detail-fact strong { display: block; }
.detail-fact span { color: var(--mj-muted); font-size: 11px; }
.detail-fact strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 13px; font-weight: 620; }
.error-note { margin-top: 16px; padding: 12px; border-left: 3px solid var(--mj-warning); background: rgba(138,98,31,.06); color: #664916; font-size: 12px; line-height: 1.5; }
.price-age-note { display: flex; align-items: center; gap: 9px; margin-top: 16px; padding: 11px 12px; border-left: 3px solid var(--mj-warning); background: rgba(138,98,31,.07); color: #664916; font-size: 12px; line-height: 1.45; }
.price-age-note.critical { border-left-color: var(--mj-danger); background: rgba(155,63,54,.07); color: var(--mj-danger); }
.price-age-note svg { width: 16px; height: 16px; flex: 0 0 16px; }

.auth-shell { display: grid; min-height: 100vh; padding: 34px 20px; place-items: center; }
.auth-panel { width: min(100%, 440px); padding: 34px; border: 1px solid var(--mj-line); border-radius: var(--mj-radius-panel); background: var(--mj-surface); box-shadow: var(--mj-shadow-panel); }
.auth-heading { margin: 54px 0 28px; }
.auth-heading h1 { margin: 0; font-size: 28px; font-weight: 590; }
.form-stack { display: grid; gap: 10px; }
.form-stack .button { margin-top: 12px; }
.auth-note { margin: 22px 0 0; color: var(--mj-muted); font-size: 13px; text-align: center; }
.alert { margin-bottom: 20px; padding: 12px 14px; border-radius: var(--mj-radius-control); font-size: 13px; line-height: 1.45; }
.alert-error { border: 1px solid rgba(155,63,54,.25); background: rgba(155,63,54,.07); color: var(--mj-danger); }
.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; width: min(360px, calc(100vw - 36px)); gap: 8px; }
.toast { padding: 13px 15px; border: 1px solid var(--mj-line-strong); border-radius: var(--mj-radius-control); background: var(--mj-surface-solid); box-shadow: var(--mj-shadow-menu); font-size: 13px; animation: toast-in .2s ease; }
.toast.error { border-color: rgba(155,63,54,.35); color: var(--mj-danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 980px) {
  .header-inner { grid-template-columns: 180px minmax(220px,1fr) auto; }
  .workspace { grid-template-columns: 205px minmax(0,1fr); gap: 28px; }
  .card-row { grid-template-columns: 52px minmax(170px,1fr) 110px 100px 36px; }
  .card-meta-cell.set-cell, .trend-cell { display: none; }
  .field-grid.four { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .app-header { height: 70px; }
  .header-inner { grid-template-columns: auto minmax(0,1fr) auto; width: calc(100% - 28px); gap: 10px; }
  .brand-by { display: none; }
  .brand-name { font-size: 16px; }
  .header-actions .button span { display: none; }
  .header-actions .button { width: 48px; padding: 0; }
  .mobile-menu-button { display: inline-grid; }
  .workspace { display: block; width: calc(100% - 28px); min-height: calc(100vh - 70px); }
  .sidebar { position: fixed; z-index: 50; top: 0; left: 0; width: min(310px, calc(100vw - 48px)); height: 100vh; padding: 18px 14px; border-right: 1px solid var(--mj-line-strong); background: var(--mj-surface-solid); box-shadow: var(--mj-shadow-menu); transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-mobile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; padding: 0 5px 12px 10px; border-bottom: 1px solid var(--mj-line); font-size: 13px; font-weight: 700; }
  .sidebar-backdrop { position: fixed; z-index: 49; inset: 0; border: 0; background: rgba(23,24,21,.35); }
  .sidebar-backdrop.is-open { display: block; }
  .primary-nav, .sidebar-section, .sidebar-bottom { padding-right: 0; }
  .main-content { padding: 34px 0 70px; }
  .view-heading { align-items: start; flex-direction: column; gap: 8px; }
  .view-heading h1 { font-size: 25px; }
  .metrics-band { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { padding: 16px 14px; border-bottom: 1px solid var(--mj-line); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(3), .metric:nth-child(4) { border-bottom: 0; }
  .metric:nth-child(3) { padding-left: 0; }
  .metric strong { font-size: 20px; }
  .card-row { grid-template-columns: 52px minmax(0,1fr) auto 24px; gap: 11px; min-height: 82px; padding-right: 0; }
  .card-meta-cell, .status-cell { display: none; }
  .price-cell strong { font-size: 14px; }
  .price-cell span { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
  .dialog[open] { align-items: end; padding: 0; }
  .dialog-panel { width: 100% !important; max-height: 94vh; border-width: 1px 0 0; border-radius: 8px 8px 0 0; }
  .dialog-header { padding: 20px 18px 16px; }
  .dialog-body, .detail-body { padding: 20px 18px; }
  .dialog-footer { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
  .field-grid.two, .field-grid.four { grid-template-columns: 1fr; }
  .detail-body { grid-template-columns: 112px minmax(0,1fr); gap: 18px; }
  .detail-price { display: block; }
  .confidence { display: inline-block; margin-top: 10px; }
  .chart-wrap { grid-column: 1 / -1; height: 190px; }
  .detail-facts { grid-column: 1 / -1; }
  .detail-dialog .dialog-footer { flex-wrap: wrap; }
  .detail-dialog .footer-spacer { display: none; }
  .detail-dialog .button { min-width: calc(50% - 5px); flex: 1; padding-inline: 12px; }
}

@media (max-width: 480px) {
  .header-inner .brand-name { display: none; }
  .search-control input { padding-left: 40px; font-size: 13px; }
  .toolbar { align-items: stretch; }
  .select-wrap { flex: 1; }
  .select-wrap select { width: 100%; min-width: 0; }
  .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .card-tile { grid-template-rows: 140px auto; }
  .tile-body { padding: 12px; }
  .tile-bottom { display: block; }
  .tile-bottom .status-line { margin-top: 9px; }
  .dialog-footer .button { padding-inline: 13px; }
  .detail-body { grid-template-columns: 90px minmax(0,1fr); gap: 14px; }
  .detail-price strong { font-size: 23px; }
}

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