:root {
  --bg: #eef2f6;
  --paper: #ffffff;
  --ink: #102033;
  --ink-2: #3d5168;
  --muted: #7a8b9e;
  --line: #e4ebf2;
  --line-2: #cfd9e4;
  --rail: #07151c;
  --rail-2: #0d242c;
  --rail-ink: #d7e6e2;
  --rail-mute: #8aa39c;
  --gold: #c9a44a;
  --gold-ink: #1a1408;
  --teal: #0f766e;
  --teal-2: #14b8a6;
  --win: #0f9f6e;
  --win-bg: #e7f8f0;
  --lose: #e11d48;
  --lose-bg: #fdecef;
  --can: #d97706;
  --can-bg: #fff6e8;
  --mute-bg: #f1f5f9;
  --shadow: 0 1px 2px rgba(16, 32, 51, .05), 0 10px 28px rgba(16, 32, 51, .06);
  --radius: 16px;
  --radius-sm: 10px;
  --dock-h: 64px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; width: 100%; }
body {
  font-family: Vazirmatn, Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.65;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--ink); }
button, input, select { font: inherit; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--teal-2); outline-offset: 2px; }

.shell { display: flex; min-height: 100vh; }
.topbar, .dock { display: none; }
.scrim { display: none; }

.rail {
  width: 248px;
  background: linear-gradient(180deg, var(--rail) 0%, #0a1c22 100%);
  color: var(--rail-ink);
  padding: 1.25rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.brand { display: flex; gap: .75rem; align-items: center; padding: .15rem .2rem; min-width: 0; }
.rail-head { display: flex; align-items: flex-start; gap: .45rem; }
.rail-head .brand { flex: 1; }
.rail-close {
  display: none;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: #e7efe9;
  border-radius: 999px;
  padding: .38rem .7rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
}
.brand span, .rail-cover span { display: block; color: var(--rail-mute); font-size: 12px; }
.brand strong, .topbar-brand strong { display: block; font-weight: 700; letter-spacing: -.01em; }
.mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: #07151c;
  display: block;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(201, 164, 74, .28), 0 6px 16px rgba(201, 164, 74, .22);
  flex-shrink: 0;
}
.mark.sm { width: 30px; height: 30px; border-radius: 9px; }
.mark.big { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 1rem; }

.rail-cover {
  display: flex; gap: .7rem; align-items: center;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  padding: .7rem .8rem;
}
.rail-cover b { display: block; font-size: 13px; }
.mini-gauge { width: 44px; height: 44px; transform: rotate(-90deg); flex-shrink: 0; }
.mini-gauge circle { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 4; }
.mini-gauge .val { stroke: var(--gold); stroke-linecap: round; }

.rail-nav { display: flex; flex-direction: column; gap: .25rem; }
.rail-nav a {
  color: #c5d8d3; padding: .62rem .75rem; border-radius: 11px;
  display: flex; align-items: center; gap: .55rem;
}
.rail-nav a svg { opacity: .75; flex-shrink: 0; }
.rail-nav a em {
  margin-right: auto; background: rgba(255,255,255,.08);
  font-style: normal; font-size: 11px; padding: .05rem .45rem; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.rail-nav a.on, .rail-nav a:hover {
  background: rgba(201, 164, 74, .14); color: #fff; text-decoration: none;
}
.rail-nav a.on svg { opacity: 1; color: var(--gold); }

.rail-crawl { margin-top: auto; display: grid; gap: .45rem; }
.rail-crawl label { display: grid; gap: .35rem; font-size: 12px; color: var(--rail-mute); }
.rail-crawl select, .rail-crawl button, .logout button, .btn, .toolbar button, .login-card button {
  border: 0; border-radius: 11px; padding: .62rem .85rem; cursor: pointer;
}
.rail-crawl select {
  background: var(--rail-2); color: #e7efe9; border: 1px solid rgba(255,255,255,.08);
}
.rail-crawl button, .btn, .toolbar button, .login-card button {
  background: linear-gradient(180deg, #e0c36a, var(--gold));
  color: var(--gold-ink); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.btn:hover, .toolbar button:hover, .login-card button:hover, .rail-crawl button:hover {
  filter: brightness(1.05);
}
.logout button, .btn.ghost {
  background: transparent; color: var(--rail-mute); border: 1px solid rgba(255,255,255,.12);
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.btn.ghost {
  color: var(--ink); border-color: var(--line-2); width: auto;
  background: var(--paper);
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }

.main {
  flex: 1; min-width: 0; width: 100%; max-width: 100%;
  padding: 1.4rem 1.6rem 2.4rem;
}
.panel, .dash-list, .dash-flow, .prod-card, .toolbar, .kpis, .kpi-hero, .kpi-side, .price-strip {
  min-width: 0; max-width: 100%;
}
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1.15rem;
}
.page-head h1 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.eyebrow {
  margin: 0 0 .2rem; color: var(--gold); font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; gap: .35rem;
}
.sub { color: var(--muted); margin: .3rem 0 0; }
.head-actions { display: flex; gap: .5rem; flex-shrink: 0; }

.kpis {
  display: grid;
  gap: .75rem;
  margin-bottom: 1rem;
}
.kpi-hero { grid-template-columns: minmax(240px, .9fr) 1.4fr; align-items: stretch; }
.kpi-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; min-width: 0; }
.kpi-hero, .kpi-cover, .kpis article { min-width: 0; }
.kpi-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpis article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.kpis span { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: 12px; font-weight: 500; }
.kpis strong {
  display: block; font-size: 1.55rem; font-weight: 800;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em; margin-top: .15rem;
}
.kpis em { color: var(--muted); font-style: normal; font-size: 12px; }
.kpis .win strong { color: var(--win); }
.kpis .lose strong { color: var(--lose); }
.kpis .can strong { color: var(--can); }

.kpi-cover {
  display: flex; align-items: center; gap: 1rem;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(201,164,74,.16), transparent 55%),
    var(--paper) !important;
}
.gauge { width: 88px; height: 88px; transform: rotate(-90deg); flex-shrink: 0; }
.gauge circle { fill: none; stroke-width: 9; }
.gauge .track { stroke: var(--line); }
.gauge .val { stroke: var(--win); stroke-linecap: round; }

.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.chart-wide { grid-column: 1 / -1; }
.chart-card h2 { margin: 0; font-size: .98rem; }
.chart-card .sub { margin: .15rem 0 .4rem; }
.chart-box { position: relative; height: 220px; width: 100%; overflow: hidden; }
.chart-box.tall { height: 260px; }

.brand-strip { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.brand-strip a {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: .55rem .85rem .7rem; color: inherit;
  display: grid; gap: .15rem; min-width: 8.5rem;
  box-shadow: var(--shadow);
}
.brand-strip a:hover { border-color: var(--teal-2); }
.brand-strip span { color: var(--muted); font-size: 12px; }
.brand-strip i {
  display: block; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden;
}
.brand-strip i::after {
  content: ""; display: block; height: 100%; width: calc(var(--p) * 1%);
  background: var(--teal); border-radius: inherit;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  width: 100%;
}
.dash-flow { display: contents; }
.tabs-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-wrap::-webkit-scrollbar { display: none; }
.tabs, .local-tabs {
  display: flex; gap: .35rem;
  padding: .7rem .75rem 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  width: max-content;
  min-width: 100%;
}
.tabs::-webkit-scrollbar, .local-tabs::-webkit-scrollbar { display: none; }
.local-tabs { display: none; }
.local-tabs a, .tabs a {
  flex: 0 0 auto; color: var(--ink-2); padding: .55rem .7rem .65rem;
  border-bottom: 2px solid transparent; display: flex; gap: .35rem; align-items: center;
  justify-content: center; font-weight: 600; font-size: 13.5px; white-space: nowrap;
}
.tab-short { display: none; }
.tabs a em {
  font-style: normal; background: var(--mute-bg); color: var(--muted);
  border-radius: 999px; padding: 0 .45rem; font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.tabs a.on, .local-tabs a:hover { color: var(--ink); border-bottom-color: var(--gold); }
.tabs a.on em { background: #f6edd0; color: #8a6a1a; }
.tabs a:hover { color: var(--ink); }

.toolbar {
  display: flex; gap: .5rem; padding: .85rem .9rem; margin: 0;
  background: #f8fafc; border-bottom: 1px solid var(--line);
}
.toolbar input, .toolbar select, .login-card input {
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 11px; padding: .55rem .75rem;
}
.toolbar input { flex: 1; min-width: 0; }
.list-meta {
  margin: 0; padding: .55rem .95rem; color: var(--muted); font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.price-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem;
  margin-bottom: 1rem;
}
.price-strip div {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: .7rem .8rem; min-width: 0; box-shadow: var(--shadow);
}
.price-strip span { display: block; color: var(--muted); font-size: 12px; }
.price-strip strong {
  display: block; font-size: 1.15rem; font-weight: 800;
  font-variant-numeric: tabular-nums; margin-top: .1rem;
}
.price-strip .win strong { color: var(--win); }
.price-strip .lose strong { color: var(--lose); }
.price-strip .can strong { color: var(--can); }
.chart-box canvas { max-width: 100% !important; }

.table-wrap { overflow: auto; }
.panel .table-wrap.desk { border: 0; border-radius: 0; }
.desk { display: block; }
.prod-cards, .seller-cards { display: none; }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td {
  padding: .7rem .85rem; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle;
}
table.grid th {
  font-size: 11.5px; color: var(--muted); font-weight: 600;
  position: sticky; top: 0; background: #f7fafc; white-space: nowrap;
}
table.grid tbody tr:hover { background: #f8fbfd; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.suggest { font-weight: 700; color: var(--teal); }
.prod a { display: flex; gap: .7rem; color: inherit; align-items: center; }
.prod a:hover { color: var(--teal); }
.prod img, .prod-card img, .hero-img {
  width: 42px; height: 42px; object-fit: cover; border-radius: 10px; background: #eef2f6; flex-shrink: 0;
}
.prod b, .prod-card b { display: block; font-weight: 650; }
.prod small, .block { display: block; color: var(--muted); font-size: 12px; }
tr.win td:first-child { box-shadow: inset -3px 0 0 var(--win); }
tr.lose td:first-child { box-shadow: inset -3px 0 0 var(--lose); }
tr.can td:first-child { box-shadow: inset -3px 0 0 var(--can); }

.pill {
  display: inline-flex; align-items: center;
  padding: .18rem .6rem; border-radius: 999px; font-size: 12px; white-space: nowrap; font-weight: 600;
}
.pill.win { background: var(--win-bg); color: var(--win); }
.pill.lose { background: var(--lose-bg); color: var(--lose); }
.pill.can { background: var(--can-bg); color: var(--can); }
.pill.mute { background: var(--mute-bg); color: var(--muted); }
.pill.lg { padding: .45rem .85rem; font-size: 13px; }

.flash {
  padding: .75rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 500;
}
.flash.bad { background: var(--lose-bg); color: var(--lose); }
.flash.run {
  background: #e8f4fb; color: #1d4e6e;
  display: flex; align-items: center; gap: .5rem;
}
.flash.run::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2b8aeb;
  box-shadow: 0 0 0 0 rgba(43,138,235,.6); animation: pulse 1.4s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(43,138,235,0); }
}

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.05rem 1.15rem; margin: 0 0 1rem; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 .7rem; font-size: 1rem; }
.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: .75rem; margin-bottom: 1rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem 1rem; margin: .8rem 0 0; }
.facts div { margin: 0; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.lead { margin: 0; font-size: 1.02rem; font-weight: 650; }
.action-card.win { box-shadow: var(--shadow), inset -4px 0 0 var(--win); }
.action-card.lose { box-shadow: var(--shadow), inset -4px 0 0 var(--lose); }
.action-card.can { box-shadow: var(--shadow), inset -4px 0 0 var(--can); }
.why { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.why h3 { margin: 0 0 .4rem; font-size: .95rem; }
.why ul { margin: 0; padding-inline-start: 1.1rem; }
.why li { margin: .3rem 0; color: var(--ink-2); }

.mini-hist { display: grid; gap: .3rem; margin-top: .75rem; font-size: 12px; }
.mini-hist div {
  display: grid; grid-template-columns: 6.2rem 1fr auto; gap: .5rem;
  padding: .35rem .5rem; border-radius: 8px; background: #f8fafc;
}
.mini-hist .win { background: var(--win-bg); }
.mini-hist em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.product-hero { display: flex; gap: .85rem; align-items: flex-start; }
.hero-img { width: 72px; height: 72px; border-radius: 16px; }
.back { font-size: 12px; color: var(--muted); }

.file-list, .timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.file-list a, .timeline li {
  display: grid; gap: .1rem; padding: .7rem .8rem; border-radius: 12px; background: #f8fafc;
  border: 1px solid var(--line); color: inherit;
}
.file-list a:hover { border-color: var(--teal-2); }
.file-list span, .timeline span, .timeline em {
  color: var(--muted); font-size: 12px; font-style: normal;
}
.timeline { border-right: 2px solid var(--line); margin-right: .55rem; }
.timeline li { position: relative; margin-right: .85rem; }
.timeline li::before {
  content: ""; position: absolute; right: -1.45rem; top: 1rem;
  width: 9px; height: 9px; border-radius: 50%; background: var(--line-2);
}
.timeline .ok::before { background: var(--win); }
.timeline .bad::before { background: var(--lose); }

.empty { color: var(--muted); text-align: center; padding: 1.6rem 1rem; margin: 0; }
.live {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--mute-bg); padding: .2rem .55rem; border-radius: 999px;
}
.live.on { background: #e8f4fb; color: #1d4e6e; }

.login-body {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(80% 50% at 10% 10%, rgba(201,164,74,.18), transparent 50%),
    radial-gradient(70% 50% at 90% 90%, rgba(20,184,166,.12), transparent 50%),
    var(--rail);
}
.login-card {
  width: min(420px, 92vw); background: var(--paper); padding: 2.1rem 1.7rem;
  border-radius: 20px; text-align: center; display: grid; gap: .85rem;
  box-shadow: 0 30px 60px rgba(0,0,0,.28);
}
.login-card h1 { margin: 0; font-weight: 800; }
.login-card p { color: var(--muted); margin: 0; }
.login-card label { text-align: right; display: grid; gap: .35rem; font-size: 13px; color: var(--ink-2); }
.login-card button, .login-card .btn { width: 100%; }
.login-card input { width: 100%; }

.icon-btn {
  border: 0; background: transparent; color: inherit; padding: .35rem;
  display: grid; place-items: center; border-radius: 10px; cursor: pointer;
}
.topbar-brand { display: flex; align-items: center; gap: .5rem; color: inherit; }

@media (max-width: 1180px) {
  .kpi-hero { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  .col-web { display: none; }
}
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .col-seller { display: none; }
}

@media (max-width: 820px) {
  html, body { overflow-x: hidden !important; max-width: 100% !important; }
  .shell { display: block; padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom)); }
  .topbar {
    display: flex; align-items: center; gap: .55rem;
    position: sticky; top: 0; z-index: 50;
    height: var(--topbar-h); padding: 0 .7rem;
    background: var(--rail); color: #e7efe9;
    max-width: 100%; overflow: hidden;
  }
  .topbar .live { margin-inline-start: auto; flex-shrink: 0; }
  .topbar-brand strong { font-size: 13.5px; }
  .icon-btn {
    width: 40px; height: 40px; flex-shrink: 0;
    background: rgba(255,255,255,.1); color: #e7efe9;
  }
  .dock {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; bottom: 0; right: 0; left: 0; z-index: 50;
    height: calc(var(--dock-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid var(--line);
  }
  .dock a {
    display: grid; place-items: center; align-content: center; gap: .15rem;
    color: var(--muted); font-size: 11px; font-weight: 600;
  }
  .dock a.on { color: var(--teal); }
  .scrim {
    display: block; position: fixed; inset: 0; background: rgba(7,21,28,.46);
    z-index: 60;
  }
  .scrim[hidden] { display: none; }
  .shell { overflow-x: hidden; max-width: 100%; width: 100%; }
  .main { max-width: 100%; width: auto; overflow-x: hidden; }
  .rail {
    position: fixed; top: 0; bottom: 0; right: 0;
    height: 100%; width: min(300px, 86vw);
    display: none;
    transform: none;
    z-index: 70;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-top: calc(1.25rem + env(safe-area-inset-top));
  }
  body.rail-open .rail { display: flex; }
  html.rail-open,
  html.rail-open body {
    overflow: hidden !important;
    overscroll-behavior: none;
    height: 100%;
  }
  body.rail-open {
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
  }
  .rail-close { display: inline-flex; }
  .main { padding: 1rem .85rem calc(1.2rem + var(--dock-h)); }
  .page-head { flex-direction: column; align-items: stretch; gap: .65rem; }
  .page-head h1 { font-size: 1.28rem; }
  .head-actions .btn { width: auto; align-self: flex-start; padding: .45rem .75rem; font-size: 13px; }
  .kpis, .kpi-hero, .kpi-4 { grid-template-columns: 1fr; }
  .kpi-cover { grid-column: auto; }
  .kpi-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis article { padding: .8rem .7rem; }
  .kpis strong { font-size: 1.22rem; }
  .dash-flow { display: flex; flex-direction: column; }
  .dash-list { order: 1; }
  .dash-charts { order: 2; }
  .dash-brands { order: 3; }
  .panel .tabs, .local-tabs {
    position: sticky; top: var(--topbar-h); z-index: 15;
  }
  .local-tabs {
    display: flex; margin: -0.2rem 0 1rem; padding: 0;
    border: 1px solid var(--line); border-radius: 14px;
    background: var(--paper); box-shadow: var(--shadow);
  }
  .desk { display: none; }
  .prod-cards, .seller-cards {
    display: grid; gap: .65rem; padding: .75rem;
  }
  .panel .prod-cards { padding: .75rem; }
  .prod-card, .seller-card {
    display: grid; gap: .65rem; color: inherit;
    background: var(--paper); border: 1px solid var(--line);
    border-radius: 14px; padding: .8rem;
    box-shadow: inset -3px 0 0 var(--line-2);
  }
  .prod-card.win, .seller-card.win { box-shadow: inset -3px 0 0 var(--win); }
  .prod-card.lose { box-shadow: inset -3px 0 0 var(--lose); }
  .prod-card.can { box-shadow: inset -3px 0 0 var(--can); }
  .prod-card-h, .seller-card header {
    display: grid; grid-template-columns: auto 1fr auto; gap: .65rem; align-items: start;
  }
  .prod-card img { width: 48px; height: 48px; }
  .prod-card .pill { font-size: 11px; }
  .prod-metrics {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem;
  }
  .prod-metrics div {
    background: #f8fafc; border-radius: 10px; padding: .4rem .45rem; min-width: 0;
  }
  .prod-metrics span { display: block; color: var(--muted); font-size: 11px; }
  .prod-metrics strong {
    display: block; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  .price-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab-full { display: none; }
  .tab-short { display: inline; }
  .prod-foot { margin: 0; color: var(--muted); font-size: 12px; }
  .toolbar { display: grid; grid-template-columns: 1fr auto; }
  .toolbar input { grid-column: 1 / -1; }
  .toolbar button { width: auto; }
  .chart-box, .chart-box.tall { height: 210px; }
  .facts { grid-template-columns: 1fr; }
  .product-head { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .product-hero { align-items: center; flex: 1; min-width: 0; }
  .product-hero h1 { font-size: 1.12rem; }
  .dock a { min-width: 0; overflow: hidden; }
}

@media (max-width: 420px) {
  .kpi-4 { grid-template-columns: 1fr 1fr; }
  .kpi-side em { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rail, .flash.run::before { transition: none; animation: none; }
}

.ico { flex-shrink: 0; display: block; }
.h-ico { display: flex; align-items: center; gap: .45rem; }
.h-ico .ico { color: var(--teal); }
.lead-copy {
  max-width: 72ch;
  color: var(--ink-2);
  margin: 0 0 1rem;
  font-size: 14.5px;
}
.tabs-wrap.cardish {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: .75rem;
  overflow: auto;
  box-shadow: var(--shadow);
}
.toolbar-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.prod-link {
  display: flex; gap: .7rem; color: inherit; align-items: center;
}
.is-openable { cursor: pointer; }
.is-openable:focus-visible { outline: 2px solid var(--teal-2); outline-offset: -2px; }
tr.is-openable:hover { background: #f4fbf8; }
.action-group { margin-bottom: 1.25rem; }
.action-group-h { margin: 0 0 .55rem; }
.action-group-h h2 { margin: 0; font-size: 1.05rem; }
.action-group-h h2 em {
  font-style: normal; font-size: 12px; color: var(--muted);
  background: var(--mute-bg); border-radius: 999px; padding: .05rem .5rem; margin-right: .35rem;
}
.action-group-h p { margin: .25rem 0 0; color: var(--muted); font-size: 13px; }
.back-row { display: flex; flex-wrap: wrap; gap: .65rem .9rem; margin: 0 0 .35rem; }
.price-strip span { display: flex; align-items: center; gap: .3rem; }

.prose-card, .col-legend {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.2rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
}
.prose-card p { margin: 0 0 .85rem; color: var(--ink-2); }
.prose-card p:last-child { margin-bottom: 0; }
.col-legend h2 { margin: 0 0 .7rem; font-size: 1rem; }
.col-legend dl { margin: 0; display: grid; gap: .7rem; }
.col-legend div { display: grid; gap: .15rem; }
.col-legend dt {
  display: flex; align-items: center; gap: .4rem;
  font-weight: 700; font-size: 13.5px;
}
.col-legend dd { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.report-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.report-meta article {
  display: flex; align-items: center; gap: .75rem;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow);
}
.report-meta article .ico { color: var(--teal); }
.report-meta span { display: block; color: var(--muted); font-size: 12px; }
.report-meta strong { display: block; font-size: 14px; }
.file-list a {
  display: flex; align-items: center; gap: .7rem; grid-template-columns: none;
}
.file-list a .ico { color: var(--teal); }
.file-list small { display: flex; align-items: center; gap: .3rem; }

.source-pills {
  display: flex; flex-wrap: wrap; gap: .45rem;
  margin: 0 0 1rem;
}
.source-pills span {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: .35rem .7rem;
  font-size: 12.5px; color: var(--ink-2); box-shadow: var(--shadow);
}
.prod-card[data-open-product], .prod-card[role="button"] { cursor: pointer; }
.torob-list { display: grid; gap: .75rem; }
.torob-card.is-openable { cursor: pointer; }
.torob-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
}
.torob-card.can { box-shadow: var(--shadow), inset -4px 0 0 var(--can); }
.torob-card.win { box-shadow: var(--shadow), inset -4px 0 0 var(--win); }
.torob-card.mute { box-shadow: var(--shadow), inset -4px 0 0 var(--line-2); }
.torob-main { display: flex; gap: .75rem; align-items: flex-start; }
.torob-main img { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; background: #eef2f6; flex-shrink: 0; }
.torob-title { display: grid; gap: .25rem; min-width: 0; }
.torob-title b { font-size: 15px; }
.torob-title .pill { justify-self: start; white-space: normal; }
.torob-metrics, .prod-metrics.always {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .45rem;
  margin-top: .85rem;
}
.torob-metrics div, .prod-metrics.always div, .modal-body .prod-metrics div {
  background: #f8fafc; border-radius: 10px; padding: .5rem .6rem; min-width: 0;
}
.torob-metrics span, .prod-metrics.always span, .modal-body .prod-metrics span {
  display: block; color: var(--muted); font-size: 11.5px;
}
.torob-metrics strong, .prod-metrics.always strong, .modal-body .prod-metrics strong {
  display: block; font-size: 13.5px; font-variant-numeric: tabular-nums;
}
.torob-card .prod-foot {
  margin: .7rem 0 0;
  color: var(--muted);
  font-size: 12.5px;
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem;
}
.shop-details { margin-top: .7rem; }
.shop-details summary {
  cursor: pointer; font-weight: 600; color: var(--teal);
  display: inline-flex; align-items: center; gap: .35rem;
}
.shop-details .table-wrap { margin-top: .5rem; }
table.grid.compact th, table.grid.compact td { padding: .45rem .55rem; font-size: 13px; }

body.modal-open { overflow: hidden; }
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 90;
}
.modal-scrim {
  position: absolute; inset: 0;
  background: rgba(7, 21, 28, .55);
}
.modal-sheet {
  position: absolute;
  top: 4vh; bottom: 4vh; right: 50%;
  transform: translateX(50%);
  width: min(760px, 94vw);
  background: var(--bg);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(7, 21, 28, .28);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-close {
  position: sticky; top: 0; z-index: 2;
  display: inline-flex; align-items: center; gap: .4rem;
  align-self: flex-start;
  margin: .7rem .85rem 0;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: .4rem .85rem;
  cursor: pointer;
  font-weight: 600;
}
.modal-body {
  overflow: auto;
  padding: .5rem .9rem 1.2rem;
  flex: 1;
}
.modal-hero {
  display: flex; gap: .75rem; align-items: flex-start;
  margin-bottom: .85rem;
}
.modal-hero h2 { margin: .25rem 0 0; font-size: 1.15rem; }
.modal-strip { margin-bottom: .75rem; }
.modal-links {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: .2rem 0 0;
}
.modal-links .btn { width: auto; }
.flash { display: flex; align-items: center; gap: .45rem; }

@media (max-width: 820px) {
  .modal-sheet {
    top: auto; bottom: 0; right: 0; left: 0;
    transform: none;
    width: 100%;
    height: min(92vh, 100%);
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .torob-metrics { grid-template-columns: 1fr 1fr; }
  .report-meta { grid-template-columns: 1fr; }
  .col-legend, .prose-card { padding: .9rem .85rem; }
}

.a2hs {
  position: fixed;
  right: .75rem; left: .75rem;
  bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + .7rem);
  z-index: 55;
  display: flex; align-items: center; gap: .7rem;
  background: var(--rail); color: #e7efe9;
  border: 1px solid rgba(201, 164, 74, .28);
  border-radius: 16px;
  padding: .7rem .75rem;
  box-shadow: 0 16px 40px rgba(7, 21, 28, .28);
}
.a2hs[hidden] { display: none; }
.a2hs .mark { width: 36px; height: 36px; }
.a2hs div { flex: 1; min-width: 0; }
.a2hs b { display: block; font-size: 13.5px; }
.a2hs span { display: block; font-size: 12px; color: var(--rail-mute); }
.a2hs .btn { width: auto; padding: .4rem .7rem; font-size: 12.5px; flex-shrink: 0; }
.a2hs .icon-btn { color: #e7efe9; background: rgba(255,255,255,.08); width: 34px; height: 34px; }

@media (min-width: 821px) {
  .a2hs { display: none !important; }
}
.login-body .a2hs {
  bottom: calc(.9rem + env(safe-area-inset-bottom));
}

@media (display-mode: standalone) {
  .a2hs { display: none !important; }
  .topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
  }
  html.is-standalone body { overscroll-behavior: none; }
}
