:root {
  --yellow: #FFD42A;
  --dark: #2B2B2B;
  --white: #FFFFFF;
  --black: #0B0B0B;
  --muted: rgba(11, 11, 11, .56);
  --muted-white: rgba(255, 255, 255, .60);
  --line: rgba(11, 11, 11, .12);
  --soft: rgba(11, 11, 11, .045);
  --soft-gray: #F4F4F1;
  --soft-gray-2: #ECECE8;
  --soft-yellow: #FFF8D8;
  --soft-yellow-2: #FFF2B8;
  --radius: 22px;
  --shadow: 0 12px 36px rgba(11, 11, 11, .08);
  --risk-high: #E34F4A;
  --risk-medium: #F29A2E;
  --risk-watch: #F4C63D;
  --risk-stable: #43A66D;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--white); color: var(--black); }
body {
  font-family: "Montserrat", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
button, select, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.loading-screen, .error-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px; text-align: center;
}
.pulse-mark {
  width: 58px; height: 58px; border-radius: 17px; margin-bottom: 15px;
  background: var(--yellow); display: grid; place-items: center; overflow: hidden;
  animation: breathe 1.6s ease-in-out infinite;
}
.pulse-mark img { width: 39px; height: 39px; object-fit: contain; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .75; } }
.loading-brand { display:flex; flex-direction:column; align-items:center; line-height:1; }
.loading-varochnaya { font-size: 13.7px; color: rgba(11,11,11,.62); letter-spacing:.17em; padding-left:.17em; }
.loading-pulse { margin-top:5px; font-size: 23.1px; font-weight:850; letter-spacing:.035em; text-align:center; }
.loading-copy { color: var(--muted); margin-top: 8px; font-size: 12.6px; }
.error-icon {
  width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center;
  background: var(--yellow); color: var(--black); font-size: 29.4px; font-weight: 900;
}
.error-screen h1 { font-size: 23.1px; margin: 18px 0 8px; }
.error-screen p { color: var(--muted); line-height: 1.5; max-width: 360px; }

.shell { max-width: 760px; margin: 0 auto; padding: 14px 16px 104px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 12px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-logo {
  width: 29px; height: 29px; border-radius: 8px; background: var(--yellow);
  display: grid; place-items: center; overflow: hidden; flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(11,11,11,.04);
}
.brand-logo img { width: 20px; height: 20px; object-fit: contain; display: block; }
.brand-word {
  font-family: "Poiret One", "Montserrat", sans-serif;
  font-weight: 400;
  letter-spacing: .13em;
}

.eyebrow, .section-kicker {
  color: var(--muted); text-transform: uppercase; letter-spacing: .13em; font-size: 11.2px; font-weight: 800;
}
.topbar h1 { margin: 0; }
.brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 92px;
  transform: translateY(-1px);
}
.pulse-word {
  font-family: "Montserrat", ui-sans-serif, sans-serif;
  font-size: 18.9px;
  line-height: .92;
  font-weight: 800;
  letter-spacing: .015em;
  margin: 1px 0 0;
  color: var(--black);
}
#month-select, #network-select {
  border: 1px solid var(--black); background: var(--white); color: var(--black); border-radius: 12px;
  padding: 9px 11px; outline: none; font-weight: 700; font-size: 12.6px;
}
.topbar-select { display: flex; gap: 7px; align-items: center; }
#network-select { width: 146px; min-width: 146px; max-width: 146px; }
@media (max-width: 430px) {
  .topbar { align-items: flex-start; }
  .topbar-select { flex-direction: column; align-items: stretch; gap: 4px; }
  #month-select, #network-select { padding: 7px 9px; font-size: 11.5px; }
  #network-select { width: 136px; min-width: 136px; max-width: 136px; }
}

.profile-strip {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 14px;
  border: 1px solid var(--line); background: var(--white); border-radius: 15px; margin-bottom: 12px;
}
.profile-strip strong { display: block; font-size: 13.7px; }
.profile-strip span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 3px; }
.status-chip {
  background: var(--yellow); color: var(--black); font-size: 10.8px; letter-spacing: .12em; font-weight: 900;
  padding: 6px 8px; border-radius: 8px;
}

.hero-card {
  position: relative; overflow: hidden;
  border-radius: 26px; padding: 22px; background: var(--black); color: var(--white); box-shadow: var(--shadow);
}
.hero-content { position: relative; z-index: 2; }
.hero-logo-watermark {
  position: absolute; z-index: 1; width: 148px; height: 148px; object-fit: contain;
  right: -30px; top: -25px; opacity: .075; pointer-events: none;
}
.metric-label { font-size: 10.5px; color: var(--muted-white); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.hero-value { font-size: clamp(25px, 7.4vw, 42px); font-weight: 900; letter-spacing: -.045em; margin: 7px 0 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-row { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted-white); }
.plan-row strong { color: var(--yellow); }

.hero-plan-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  margin-top: 2px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.055);
}
.hero-plan-block span {
  display: block;
  color: rgba(255,255,255,.52);
  font-size: 10.8px;
  line-height: 1.2;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.hero-plan-block strong {
  display: block;
  margin-top: 4px;
  color: var(--white);
  font-size: 16.8px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -.03em;
}
.hero-plan-percent {
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--black);
  font-size: 10.5px;
  font-weight: 900;
}
.progress { height: 7px; border-radius: 20px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; width: 0; background: var(--yellow); border-radius: inherit; transition: width .45s ease; }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 9px 0 24px; }
.annual-plan-mini { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 14px; margin:-10px 0 15px; border:1px solid var(--line); border-radius:14px; background:var(--white); box-shadow:var(--shadow); }
.annual-plan-mini.hidden { display:none; }
.annual-plan-mini span { color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.annual-plan-mini strong { font-size:16px; white-space:nowrap; }
.annual-plan-mini small { color:var(--muted); font-size:11px; }
.metric-card {
  padding: 16px; border-radius: 18px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.metric-card.wide { grid-column: span 2; }
.metric-card span { display: block; color: var(--muted); font-size: 11.2px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.metric-card strong { display: block; font-size: 24.2px; margin-top: 6px; letter-spacing: -.025em; font-variant-numeric:tabular-nums; }
.yellow-card { background: var(--yellow); border-color: var(--yellow); }
.yellow-card span { color: rgba(11,11,11,.58); }
.dark-card { background: var(--dark); color: var(--white); border-color: var(--dark); }
.dark-card span { color: var(--muted-white); }

.section-head, .page-title, .shops-title { margin: 24px 2px 11px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; }
.section-head h2, .page-title h2 { margin: 4px 0 0; font-size: 22.1px; letter-spacing: -.04em; }
.page-title p { margin: 6px 0 0; color: var(--muted); font-size: 11.6px; line-height: 1.5; }
.text-button { border: 0; background: var(--yellow); color: var(--black); font-size: 10.5px; font-weight: 800; padding: 8px 10px; border-radius: 10px; }

.stack { display: grid; gap: 8px; }
.risk-card, .shop-card {
  width: 100%; text-align: left; border: 1px solid var(--line); background: var(--white); color: var(--black);
  border-radius: 17px; padding: 14px 15px; box-shadow: var(--shadow);
}
.risk-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.risk-card:active { transform: scale(.985); }
.risk-badge { width: 10px; height: 42px; border-radius: 20px; border: 0; }
.risk-badge.high { background: var(--risk-high); }
.risk-badge.medium { background: var(--risk-medium); }
.risk-badge.watch { background: var(--risk-watch); }
.risk-badge.stable { background: var(--risk-stable); }
.risk-card.level-high { border-color: rgba(227,79,74,.42); background: rgba(227,79,74,.07); }
.risk-card.level-medium { border-color: rgba(242,154,46,.42); background: rgba(242,154,46,.07); }
.risk-card.level-watch { border-color: rgba(244,198,61,.52); background: rgba(244,198,61,.08); }
.risk-card.level-stable { border-color: rgba(67,166,109,.42); background: rgba(67,166,109,.07); }
.risk-name { font-weight: 800; font-size: 12.6px; }
.risk-reason { color: var(--muted); font-size: 11.2px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.risk-score { font-size: 10.5px; font-weight: 850; padding: 6px 8px; border-radius: 9px; color: var(--black); }
.level-high .risk-score { background: rgba(227,79,74,.18); color: #A72B27; }
.level-medium .risk-score { background: rgba(242,154,46,.22); color: #9B5C12; }
.level-watch .risk-score { background: rgba(244,198,61,.34); color: #7D6408; }
.level-stable .risk-score { background: rgba(67,166,109,.18); color: #267243; }

.rank-preview, .ranking-list { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--white); box-shadow: var(--shadow); }
.rank-row {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px;
  padding: 13px 14px; border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border-bottom: 0; }
.rank-pos { font-weight: 900; color: var(--muted); font-size: 12.6px; }
.rank-name { font-weight: 750; font-size: 11.6px; }
.rank-value { font-weight: 900; font-size: 11.6px; }

.risk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.risk-stat { border-radius: 15px; background: var(--white); border: 1px solid var(--line); padding: 12px; }
.risk-stat:nth-child(1) { background: var(--risk-high); color: var(--white); border-color: var(--risk-high); }
.risk-stat:nth-child(2) { background: var(--risk-medium); color: var(--black); border-color: var(--risk-medium); }
.risk-stat:nth-child(3) { background: var(--risk-watch); color: var(--black); border-color: var(--risk-watch); }
.risk-stat span { display: block; opacity: .62; font-size: 10.8px; text-transform: uppercase; font-weight: 700; }
.risk-stat strong { display: block; margin-top: 4px; font-size: 21px; }

.chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 1px 0 12px;
  width: 100%;
}
.chip {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--black);
  background: var(--white);
  color: var(--black);
  min-height: 48px;
  padding: 10px 7px;
  border-radius: 12px;
  font-size: 10.8px;
  line-height: 1.15;
  font-weight: 800;
  white-space: normal;
  text-align: center;
  box-shadow: 0 4px 10px rgba(11,11,11,.07);
}

/* User-selected palette. The yellow brand accent and risk colors stay unchanged. */
#theme-toggle { width:35px; height:35px; flex:none; padding:0; display:grid; place-items:center; appearance:none; -webkit-appearance:none; border:1px solid var(--line); border-radius:11px; background:var(--white); color:var(--black); font-size:18px; line-height:1; }
#theme-toggle svg { display:block; width:19px; height:19px; }
.metric-help { position:relative; display:inline-grid; place-items:center; vertical-align:middle; box-sizing:border-box; flex-shrink:0; width:12px; height:12px; min-width:12px; min-height:12px; margin-left:3px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--white); color:var(--black); font:700 8px/1 sans-serif; cursor:pointer; }
.metric-help::after { content:""; position:absolute; inset:-7px; border-radius:50%; }
.metric-help:focus-visible { outline:2px solid var(--yellow); outline-offset:2px; }
.additional-sales { margin-top:14px; border-top:1px solid var(--line); padding-top:12px; }
.additional-sales > summary { cursor:pointer; font-size:12px; font-weight:700; color:var(--black); padding:6px 0; }
.additional-sales > summary span { display:block; margin-top:4px; color:var(--muted); font-size:10px; font-weight:400; }
.additional-sales-note { color:var(--muted); font-size:11px; line-height:1.5; margin:8px 0 12px; }
.metric-note-dialog { width:min(420px, calc(100vw - 32px)); max-height:80vh; box-sizing:border-box; overflow:auto; border:1px solid var(--line); border-radius:20px; padding:24px; background:var(--white); color:var(--black); box-shadow:var(--shadow); }
.metric-note-dialog::backdrop { background:rgba(0,0,0,.6); }
.metric-note-dialog h3 { margin:0 0 16px; }
.metric-note-dialog p { white-space:pre-wrap; font-size:14px; line-height:1.6; }
.metric-note-dialog button { min-height:42px; padding:10px 20px; border:0; border-radius:12px; background:var(--yellow); color:#111; font:inherit; font-weight:700; }
.map-fullscreen { position:fixed; inset:0; z-index:2000; margin:0; max-width:none; max-height:none; width:100%; height:100%; border:0; box-sizing:border-box; background:var(--white); color:var(--black); padding:max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.map-fullscreen::backdrop { background:rgba(0,0,0,.65); }
.map-toolbar { display:flex; align-items:center; gap:10px; margin-bottom:15px; flex-wrap:wrap; }
.map-toolbar button { min-width:44px; min-height:44px; border:1px solid var(--line); border-radius:12px; background:var(--soft-gray); color:var(--black); }
.map-viewport { height:calc(100% - 100px); overflow:auto; overscroll-behavior:contain; }
.map-fullscreen .network-map { display:block !important; margin:24px 30px; touch-action:pan-x pan-y pinch-zoom; }
#cohort-apply { min-height:40px; margin-top:12px; padding:8px 20px; border:0; border-radius:11px; background:var(--yellow); color:#111; font:inherit; font-weight:700; }
#cohort-apply:disabled { opacity:.6; }
:root[data-theme="dark"] {
  color-scheme:dark;
  --white:#25272b;
  --black:#f5f5f2;
  --dark:#303238;
  --muted:rgba(245,245,242,.61);
  --muted-white:rgba(255,255,255,.64);
  --line:rgba(255,255,255,.15);
  --soft:rgba(255,255,255,.065);
  --soft-gray:#292b2f;
  --soft-gray-2:#34363b;
  --soft-yellow:#39331d;
  --soft-yellow-2:#474025;
  --shadow:0 12px 36px rgba(0,0,0,.28);
  --v95-gray:#292b2f;
  --v95-gray-deep:#35373b;
  --v95-graphite:#f5f5f2;
  --v95-surface:#24262a;
  --v95-yellow-soft:#39331d;
}
:root[data-theme="dark"] body { background:#1c1e22; }
:root[data-theme="dark"] .hero-card,
:root[data-theme="dark"] .metric-card.dark-card,
:root[data-theme="dark"] .reputation-overall { background:#101114 !important; color:#f5f5f2 !important; }
:root[data-theme="dark"] .hero-plan-block strong,
:root[data-theme="dark"] .metric-card.dark-card strong { color:#f5f5f2 !important; }
:root[data-theme="dark"] .yellow-card,
:root[data-theme="dark"] .status-chip,
:root[data-theme="dark"] .hero-plan-percent,
:root[data-theme="dark"] .cohort-filter-head button { color:#0b0b0b; }
:root[data-theme="dark"] .yellow-card strong { color:#0b0b0b; }
:root[data-theme="dark"] .detail-section,
:root[data-theme="dark"] .detail-section:nth-of-type(odd),
:root[data-theme="dark"] .detail-section:nth-of-type(even),
:root[data-theme="dark"] .profile-section,
:root[data-theme="dark"] .team-section,
:root[data-theme="dark"] .detail-rating-section,
:root[data-theme="dark"] .detail-tasks-section,
:root[data-theme="dark"] .detail-diagnostics-section { background:#292b30 !important; border-color:var(--line) !important; }
:root[data-theme="dark"] .detail-finance-section .detail-metric { background:#303238 !important; color:#f5f5f2 !important; border-color:var(--line) !important; }
:root[data-theme="dark"] .detail-finance-section .detail-metric strong { color:#f5f5f2 !important; }
:root[data-theme="dark"] .detail-finance-section .detail-metric span,
:root[data-theme="dark"] .detail-finance-section .detail-metric em { color:var(--muted) !important; }
:root[data-theme="dark"] .network-map { background:#282a2e; }
:root[data-theme="dark"] .network-map-quadrant,
:root[data-theme="dark"] .network-map-axis { color:rgba(255,255,255,.57); }
:root[data-theme="dark"] .daily-plan-line span { background:#24262a; color:#ffaaa6; }
:root[data-theme="dark"] .daily-revenue-column.below .daily-revenue-track > span { background:#70747a; }
:root[data-theme="dark"] .network-map-mobile button { background:#292b2f; color:#f5f5f2; }
:root[data-theme="dark"] .rocket-map-row select,
:root[data-theme="dark"] .cohort-filter-grid select { color:var(--black); }
:root[data-theme="dark"] .network-announcement { color:#0b0b0b; }
@media (max-width:430px) { #theme-toggle { width:32px; height:32px; } }
.chip.active { background: var(--yellow); }

.shops-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.search {
  width: 126px; border: 1px solid var(--black); background: var(--white); color: var(--black);
  padding: 9px 11px; border-radius: 12px; outline: none; font-size: 11.6px;
}
.shops-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.shop-card strong { display: block; font-size: 12.6px; }
.shop-card .shop-revenue { font-size: 18.9px; margin-top: 10px; letter-spacing: -.04em; font-weight: 850; }
.shop-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pill { font-size: 10.8px; padding: 5px 7px; border-radius: 8px; background: var(--soft); color: var(--black); font-weight: 700; }
.pill.rating-pill { background: var(--yellow); }



.network-average-group {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.network-average-title {
  padding: 11px 13px 9px;
  font-size: 11.2px;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 850;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.network-average-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.network-average-item {
  min-width: 0;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}
.network-average-item:nth-child(odd) { border-right: 1px solid var(--line); }
.network-average-item:nth-last-child(-n+2) { border-bottom: 0; }
.network-average-item span {
  display: block;
  color: var(--muted);
  font-size: 10.8px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .055em;
  font-weight: 700;
}
.network-average-item strong {
  display: block;
  margin-top: 5px;
  font-size: 15.8px;
  letter-spacing: -.025em;
}

/* ---------- compact charts ---------- */
.mini-chart-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px;
  background: var(--white);
  box-shadow: var(--shadow);
  margin: 0 0 22px;
}
.mini-chart-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px;
}
.mini-chart-head strong { display: block; font-size: 12.6px; margin-top: 4px; }
.mini-chart-note { font-size: 11.2px; color: var(--muted); font-weight: 700; }
.risk-mix-track {
  height: 13px; border-radius: 999px; background: var(--soft); overflow: hidden;
  display: flex; border: 1px solid rgba(11,11,11,.05);
}
.risk-mix-segment { height: 100%; min-width: 0; transition: width .4s ease; }
.risk-mix-segment.high { background: var(--risk-high); }
.risk-mix-segment.medium { background: var(--risk-medium); }
.risk-mix-segment.watch { background: var(--risk-watch); }
.risk-mix-segment.stable { background: var(--risk-stable); }
.risk-mix-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 10.8px; color: var(--muted); font-weight: 700; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.high { background: var(--risk-high); }
.legend-dot.medium { background: var(--risk-medium); }
.legend-dot.watch { background: var(--risk-watch); }
.legend-dot.stable { background: var(--risk-stable); }

.rank-row.visual-rank { grid-template-columns: 32px 1fr auto; position: relative; overflow: hidden; }
.rank-main { min-width: 0; }
.rank-bar-track {
  height: 4px; border-radius: 99px; background: var(--soft); margin-top: 7px; overflow: hidden;
}
.rank-bar-fill { height: 100%; background: var(--yellow); border-radius: inherit; }

.chart-panel {
  border: 1px solid var(--line); border-radius: 17px; padding: 13px; background: var(--white);
}
.compare-chart { display: grid; gap: 13px; }
.compare-row { display: grid; gap: 6px; }
.compare-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.compare-label { font-size: 11.2px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.compare-delta { font-size: 11.2px; font-weight: 900; }
.compare-delta.positive { color: var(--risk-stable); }
.compare-delta.negative { color: var(--risk-high); }
.product-target { font-size: 11px; margin-top: 5px; }
.product-target.positive { color: var(--risk-stable); }
.product-target.negative { color: var(--risk-high); }
.compare-bars { display: grid; grid-template-columns: 1fr; gap: 4px; }
.compare-bar-line { display: grid; grid-template-columns: 44px 1fr auto; gap: 7px; align-items: center; }
.compare-bar-label { font-size: 10.8px; color: var(--muted); }
.compare-track { height: 7px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.compare-fill { height: 100%; border-radius: inherit; }
.compare-fill.previous { background: #CFCFCF; }
.compare-fill.current { background: var(--yellow); }
.compare-value { font-size: 10.8px; font-weight: 800; min-width: 48px; text-align: right; }

.stacked-chart { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--soft); }
.stack-segment { min-width: 0; height: 100%; }
.stack-segment.yellow { background: var(--yellow); }
.stack-segment.dark { background: var(--dark); }
.stack-segment.black { background: var(--black); }
.stack-segment.gray { background: #BDBDBD; }
.stack-segment.fast { background: var(--risk-stable); }
.stack-segment.medium { background: var(--risk-medium); }
.stack-segment.long { background: var(--risk-high); }
.stack-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; margin-top: 10px; }
.stack-legend-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.8px; }
.stack-legend-name { display: flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 700; }
.stack-swatch { width: 7px; height: 7px; border-radius: 2px; }
.stack-value { font-weight: 900; }


.metric-bars { display: grid; gap: 11px; }
.metric-bar-row { display: grid; gap: 6px; }
.metric-bar-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.metric-bar-label { font-size: 11.2px; color: var(--muted); font-weight: 750; }
.metric-bar-value { font-size: 11.2px; color: var(--black); font-weight: 900; }
.metric-bar-track { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.metric-bar-fill { height: 100%; border-radius: inherit; min-width: 2px; }
.metric-bar-fill.food { background: var(--yellow); }
.metric-bar-fill.desserts { background: var(--risk-medium); }
.metric-bar-fill.bakery { background: #9A9A9A; }
.metric-bar-fill.drinks { background: var(--black); }

.rating-distribution { display: grid; gap: 4px; margin-top: 9px; }
.rating-dist-row { display: grid; grid-template-columns: 16px 1fr 22px; gap: 6px; align-items: center; }
.rating-dist-star { font-size: 10.8px; color: var(--muted); font-weight: 800; }
.rating-dist-track { height: 4px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.rating-dist-fill { height: 100%; background: var(--yellow); border-radius: inherit; }
.rating-dist-count { font-size: 10.8px; color: var(--muted); text-align: right; }

.diagnosis-item.kind-attention .diagnosis-tag { background: var(--risk-high); }
.diagnosis-item.kind-insight .diagnosis-tag { background: var(--risk-medium); }
.diagnosis-item.kind-positive .diagnosis-tag { background: var(--risk-stable); }

.view { display: none; }
.view.active { display: block; animation: enter .18s ease; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }

.data-source-warning {
  display: grid; gap: 4px; margin: 10px 0 14px; padding: 12px 14px;
  border: 1px solid #e2ad00; border-radius: 14px; background: #fff7d5;
  color: #26220f; font-size: 11px; line-height: 1.45;
}
.data-source-warning strong { font-size: 12px; }
.data-source-warning code { font: inherit; font-weight: 800; user-select: all; word-break: break-all; }

.bottom-nav {
  position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(calc(100% - 24px), 720px); display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 7px; border-radius: 20px; background: var(--black); box-shadow: 0 14px 40px rgba(0,0,0,.20); z-index: 20;
}
.nav-item { border: 0; background: transparent; color: rgba(255,255,255,.55); padding: 7px 4px; border-radius: 14px; }
.nav-item span { display: block; font-size: 17.9px; line-height: 1; }
.nav-item small { display: block; font-size: 10.8px; margin-top: 4px; font-weight: 750; }
.nav-item.active { background: var(--yellow); color: var(--black); }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(11,11,11,.46); z-index: 40; backdrop-filter: blur(3px); }
.detail-sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 91vh; overflow-y: auto;
  background: var(--white); border-radius: 26px 26px 0 0; padding: 12px 17px calc(30px + env(safe-area-inset-bottom));
  box-shadow: 0 -15px 50px rgba(0,0,0,.20);
}
.sheet-handle { width: 40px; height: 5px; border-radius: 10px; background: var(--line); margin: 0 auto 10px; }
.sheet-close {
  position: absolute; right: 16px; top: 15px; width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--black);
  background: var(--white); color: var(--black); font-size: 23.1px;
}
.detail-title { padding-right: 42px; }
.detail-title h2 { margin: 2px 0 4px; font-size: 26.2px; letter-spacing: -.045em; }
.detail-title p { margin: 0; color: var(--muted); font-size: 10.5px; }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin: 0 0 9px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .10em; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-metric { background: var(--white); border: 1px solid var(--line); border-radius: 15px; padding: 12px; }
.detail-metric:nth-child(4n+1) { border-top: 4px solid var(--yellow); }
.detail-metric span { display: block; color: var(--muted); font-size: 10.8px; text-transform: uppercase; font-weight: 700; }
.detail-metric strong { display: block; font-size: 16.8px; margin-top: 5px; }
.detail-metric em { display: block; font-style: normal; font-size: 10.8px; margin-top: 4px; color: var(--muted); line-height: 1.35; }

.rating-grid { display: grid; gap: 8px; }
.rating-card {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 15px; padding: 12px 13px; background: var(--white);
}
.rating-source { font-size: 11.6px; font-weight: 800; }
.rating-sub { font-size: 10.8px; color: var(--muted); margin-top: 4px; }
.rating-score { background: var(--yellow); border-radius: 10px; padding: 8px 9px; font-weight: 900; font-size: 13.7px; }

.reviews-list { display: grid; gap: 8px; }
.review-card { border-radius: 15px; background: var(--soft); border: 1px solid var(--line); padding: 12px; }
.review-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 7px; }
.review-source { font-size: 11.2px; font-weight: 800; }
.review-stars { color: var(--black); background: var(--yellow); border-radius: 8px; padding: 4px 6px; font-size: 10.8px; font-weight: 900; }
.review-text { font-size: 10.5px; line-height: 1.55; }
.review-more {
  margin-top: 9px; width: 100%; border: 1px solid var(--black); background: var(--white); color: var(--black);
  border-radius: 11px; padding: 9px; font-size: 11.2px; font-weight: 800;
}

.diagnosis-box { background: #181b20; color: #f5f5f2; border: 1px solid #363b44; border-radius: 20px; padding: 16px; }
.diagnosis-title { color: var(--yellow); font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .11em; margin-bottom: 11px; }
.diagnosis-item { padding: 11px 0; border-top: 1px solid rgba(255,255,255,.14); }
.diagnosis-item:first-of-type { border-top: 0; padding-top: 0; }
.diagnosis-item strong { display: block; font-size: 11.6px; margin-bottom: 4px; }
.diagnosis-item p { margin: 0; color: #c9cdd4; font-size: 11.2px; line-height: 1.55; }
.diagnosis-tag { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--yellow); margin-right: 7px; vertical-align: 1px; }

.reviews-unavailable { border: 1px dashed var(--line); border-radius: 14px; padding: 12px; color: var(--muted); font-size: 11.2px; line-height: 1.5; }
.reputation-ratings { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:12px 0; }
.reputation-rating { min-width:0; padding:12px; border:1px solid var(--line); border-radius:14px; background:var(--white); }
.reputation-rating span, .reputation-rating small { display:block; color:var(--muted); font-size:10px; overflow-wrap:anywhere; }
.reputation-rating strong { display:block; margin:5px 0 3px; font-size:18px; }
.reputation-caption { margin:16px 0 8px; font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; }
.reputation-review .review-head small { color:var(--muted); font-size:9.5px; }
.reputation-reply { display:grid; gap:5px; margin-top:10px; padding:10px 12px; border-left:3px solid var(--yellow); border-radius:0 10px 10px 0; background:rgba(255,212,42,.09); font-size:10.5px; line-height:1.5; }
.reputation-reply strong { font-size:9.5px; text-transform:uppercase; }
.reputation-reply small { color:var(--muted); font-size:9px; }
@media (max-width:520px) { .reputation-ratings { grid-template-columns:1fr; } }

@media (max-width: 380px) {
  .shops-grid { grid-template-columns: 1fr; }
  .hero-value { font-size: clamp(23px, 7.2vw, 28px); }
}


.topbar .brand-word {
  align-self: flex-start;
  font-size: 11.2px;
  line-height: 1;
  color: rgba(11,11,11,.58);
  text-align: left;
  letter-spacing: .16em;
  margin-bottom: 2px;
  padding-left: 0;
}

.loading-title .brand-word {
  font-size: 1.08em;
}

/* Network average conditional signal for fast orders */
.network-average-item.metric-good {
  background: rgba(67,166,109,.10);
  box-shadow: inset 4px 0 0 var(--risk-stable);
}
.network-average-item.metric-good strong {
  color: #267243;
}

.network-average-item.metric-warning {
  background: rgba(255,212,42,.15);
  box-shadow: inset 4px 0 0 var(--yellow);
}
.network-average-item.metric-warning strong {
  color: #8A6D00;
}

.network-average-item.metric-bad {
  background: rgba(227,79,74,.09);
  box-shadow: inset 4px 0 0 var(--risk-high);
}
.network-average-item.metric-bad strong {
  color: #B12F2B;
}


/* v7.10 brand optical alignment */
.topbar .brand {
  min-height: 32px;
}

@media (max-width: 380px) {
  .brand-copy { min-width: 86px; }
  .pulse-word { font-size: 17.9px; }
  .topbar .brand-word { font-size: 10.8px; }
}


/* =========================================================
   TASKS — v8
   ========================================================= */
.tasks-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.task-add-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 11px;
  background: var(--yellow);
  color: var(--black);
  padding: 9px 11px;
  font-size: 11.2px;
  font-weight: 900;
}
.task-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin: 12px 0 10px;
}
.task-stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px;
  background: var(--white);
}
.task-stat span {
  display: block;
  color: var(--muted);
  font-size: 10.8px;
  text-transform: uppercase;
  font-weight: 750;
}
.task-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 18.9px;
}
.task-stat.overdue {
  background: rgba(227,79,74,.08);
  border-color: rgba(227,79,74,.25);
}
.task-stat.overdue strong { color: var(--risk-high); }

.task-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 11px;
}
.task-filters .search {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.task-filters select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--black);
  border-radius: 11px;
  padding: 9px 8px;
  font-size: 10.8px;
  font-weight: 700;
  outline: none;
}
.tasks-list { display: grid; gap: 8px; }

.task-card {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--white);
  padding: 13px;
  box-shadow: 0 7px 24px rgba(11,11,11,.055);
}
.task-card.overdue {
  border-color: rgba(227,79,74,.38);
  box-shadow: inset 4px 0 0 var(--risk-high), 0 7px 24px rgba(11,11,11,.055);
}
.task-card.done {
  opacity: .72;
  background: rgba(67,166,109,.045);
}
.task-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.task-id {
  color: var(--muted);
  font-size: 10.8px;
  font-weight: 800;
  letter-spacing: .05em;
}
.task-shop {
  font-size: 11.2px;
  font-weight: 850;
}
.task-text {
  margin: 9px 0 10px;
  font-size: 11.6px;
  line-height: 1.48;
  font-weight: 650;
  white-space: pre-wrap;
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 10.8px;
}
.task-deadline {
  padding: 5px 7px;
  border-radius: 8px;
  background: var(--soft);
  font-weight: 750;
}
.task-deadline.overdue {
  background: rgba(227,79,74,.10);
  color: #AF302C;
}
.task-status-select {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  padding: 6px 7px;
  font-size: 10.8px;
  font-weight: 800;
  outline: none;
}
.task-status-select.status-notstarted { border-color: #BFC1C5; }
.task-status-select.status-progress {
  border-color: var(--risk-medium);
  background: rgba(242,154,46,.09);
}
.task-status-select.status-done {
  border-color: var(--risk-stable);
  background: rgba(67,166,109,.09);
}
.task-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.task-action {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--black);
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 10.8px;
  font-weight: 800;
}
.task-action.delete {
  color: var(--risk-high);
  border-color: rgba(227,79,74,.28);
}
.tasks-empty {
  border: 1px dashed var(--line);
  border-radius: 15px;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 11.2px;
  line-height: 1.5;
}

/* Tasks inside coffee card */
.shop-task-summary {
  display: grid;
  gap: 7px;
}
.shop-task-row {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}
.shop-task-row.overdue {
  border-left: 4px solid var(--risk-high);
}
.shop-task-title {
  font-size: 11.2px;
  font-weight: 750;
  line-height: 1.45;
}
.shop-task-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.8px;
}
.shop-task-count {
  display: inline-flex;
  background: var(--yellow);
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 10.8px;
  font-weight: 900;
}

/* Admin task modal */
.task-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(11,11,11,.52);
  backdrop-filter: blur(4px);
}
.task-modal {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 61;
  max-width: 680px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 22px;
  padding: 17px;
  box-shadow: 0 20px 70px rgba(0,0,0,.24);
}
.task-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.task-modal-head h2 {
  margin: 3px 0 0;
  font-size: 19.9px;
}
.task-modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--black);
  border-radius: 10px;
  background: var(--white);
  font-size: 21px;
}
.task-field {
  display: grid;
  gap: 6px;
  margin-bottom: 11px;
}
.task-field > span {
  color: var(--muted);
  font-size: 10.8px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 800;
}
.task-field input,
.task-field select,
.task-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--black);
  padding: 10px;
  font-size: 10.5px;
  outline: none;
}
.task-field textarea { resize: none; }
.task-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.task-save-button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--black);
  color: var(--white);
  padding: 12px;
  font-size: 10.5px;
  font-weight: 850;
}
.task-save-button:disabled { opacity: .45; }

@media (max-width: 380px) {
  .task-form-grid { grid-template-columns: 1fr; }
  .bottom-nav { padding: 6px; }
  .nav-item small { font-size: 10.8px; }
}


/* v9 visual depth — restrained brand accents */
.network-average-group {
  box-shadow: 0 10px 28px rgba(11,11,11,.075);
  overflow: hidden;
}
.network-average-group:nth-child(4n+1) { background: rgba(255,212,42,.085); }
.network-average-group:nth-child(4n+2) { background: rgba(67,166,109,.055); }
.network-average-group:nth-child(4n+3) { background: rgba(242,154,46,.050); }
.network-average-group:nth-child(4n) { background: rgba(11,11,11,.035); }
.network-average-title { background: rgba(11,11,11,.035); }

.detail-section {
  padding: 14px;
  border: 1px solid rgba(11,11,11,.08);
  border-radius: 18px;
  background: rgba(11,11,11,.012);
  box-shadow: 0 8px 24px rgba(11,11,11,.060);
}
.detail-section:nth-of-type(4n+1) { background: rgba(255,212,42,.060); }
.detail-section:nth-of-type(4n+2) { background: rgba(67,166,109,.045); }
.detail-section:nth-of-type(4n+3) { background: rgba(242,154,46,.040); }

.profile-grid { display:grid; gap:0; border:1px solid var(--line); border-radius:15px; overflow:hidden; background:var(--white); }
.profile-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); gap:10px; padding:10px 11px; border-bottom:1px solid var(--line); align-items:center; }
.profile-row:last-child { border-bottom:0; }
.profile-row span { color:var(--muted); font-size: 10.8px; font-weight:700; }
.profile-row strong { text-align:right; font-size: 11.2px; line-height:1.35; }
.profile-section { background:rgba(255,212,42,.045) !important; }
.team-section { background:rgba(67,166,109,.035) !important; }

.task-status-select.status-review { border-color: var(--risk-medium); background: rgba(255,212,42,.16); }
.task-stat.review { background:rgba(255,212,42,.10); border-color:rgba(244,198,61,.32); }
.task-stat.review strong { color:#816700; }

.task-field-row { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.task-field-row > span { color:var(--muted); font-size: 10.8px; text-transform:uppercase; letter-spacing:.07em; font-weight:800; }
.task-field-actions { display:flex; gap:5px; }
.task-field-actions button { border:0; background:var(--soft); border-radius:8px; padding:5px 7px; font-size: 10.8px; font-weight:800; }
.task-shop-picker { max-height:190px; overflow:auto; display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:8px; border:1px solid var(--line); border-radius:12px; background:var(--white); }
.task-shop-option { display:flex; align-items:center; gap:7px; padding:7px 8px; border-radius:9px; background:var(--soft); font-size: 10.8px; font-weight:750; }
.task-shop-option input { width:auto; margin:0; accent-color:#0B0B0B; }

@media (max-width:380px) {
  .task-stats { grid-template-columns:repeat(2,1fr); }
  .task-shop-picker { grid-template-columns:1fr; }
}


/* v9.2 audited UI */
.diagnosis-confidence {
  display:inline-flex; align-items:center; margin:0 0 6px; padding:3px 6px; border-radius:999px;
  background:rgba(255,255,255,.10); color:rgba(255,255,255,.72);
  font-size:10.8px; line-height:1; font-weight:800; letter-spacing:.06em; text-transform:uppercase;
}
.kind-attention .diagnosis-confidence { background:rgba(227,79,74,.22); color:#FFD9D7; }
.kind-insight .diagnosis-confidence { background:rgba(242,154,46,.20); color:#FFE4BC; }
.kind-positive .diagnosis-confidence { background:rgba(67,166,109,.22); color:#D9F5E4; }
.task-shop-search {
  width:100%; margin:7px 0; border:1px solid var(--line); border-radius:10px;
  padding:8px 10px; background:var(--white); color:var(--black); outline:none; font-size:11.2px;
}
.task-shop-search:focus { border-color:rgba(11,11,11,.36); box-shadow:0 0 0 3px rgba(255,212,42,.18); }


/* =========================================================
   v9.4 — brand-minimal UI: white / light gray / light yellow
   ========================================================= */
body { background: #FFFFFF; }

/* Accordions */
.metric-accordion,
.detail-accordion {
  overflow: hidden;
}
.metric-accordion summary,
.detail-accordion summary {
  list-style: none;
}
.metric-accordion summary::-webkit-details-marker,
.detail-accordion summary::-webkit-details-marker { display: none; }
.accordion-summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  cursor: pointer;
  user-select: none;
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(11,11,11,.72);
}
.accordion-chevron {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(11,11,11,.055);
  color: var(--black);
  font-size: 14px;
  line-height: 1;
  transition: transform .18s ease, background .18s ease;
}
details[open] > .accordion-summary .accordion-chevron {
  transform: rotate(180deg);
  background: rgba(255,212,42,.32);
}
.accordion-body { border-top: 1px solid var(--line); }

/* Overview: only gray and yellow surfaces */
.network-average-group {
  margin: 10px 0;
  border: 1px solid rgba(11,11,11,.11);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(11,11,11,.045);
  background: var(--soft-gray) !important;
}
.network-average-group:nth-child(odd) { background: var(--soft-yellow) !important; }
.network-average-title { background: transparent !important; }
.network-average-grid { background: rgba(255,255,255,.56); }
.network-average-item { background: transparent; }
.network-average-item.metric-good { background: rgba(11,11,11,.028); }
.network-average-item.metric-warning { background: rgba(255,212,42,.13); }
.network-average-item.metric-bad { background: rgba(227,79,74,.07); }

/* Shop sections: no green/orange decorative backgrounds */
.detail-section {
  background: var(--soft-gray) !important;
  border: 1px solid rgba(11,11,11,.095);
  box-shadow: 0 7px 22px rgba(11,11,11,.035);
}
.detail-section:nth-of-type(odd) { background: var(--soft-yellow) !important; }
.detail-finance-section,
.detail-rating-section,
.profile-section,
.detail-tasks-section { background: var(--soft-yellow) !important; }
.team-section,
.detail-diagnostics-section { background: var(--soft-gray) !important; }
.detail-section h3 {
  color: rgba(11,11,11,.70);
  font-weight: 850;
}
.detail-accordion { padding: 0 !important; }
.detail-accordion-summary { padding: 0 14px; }
.detail-accordion-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.accordion-chart-gap { height: 10px; }

/* Make the profile/team blocks feel like information cards, not a spreadsheet. */
.profile-section,
.team-section { padding: 15px !important; }
.profile-section h3,
.team-section h3 {
  margin-bottom: 12px;
  color: var(--black);
  font-size: 10.8px;
  letter-spacing: .12em;
  font-weight: 900;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
.profile-row {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid rgba(11,11,11,.10) !important;
  border-radius: 13px;
  background: rgba(255,255,255,.82);
}
.profile-row-wide { grid-column: 1 / -1; min-height: 62px; }
.profile-row span {
  color: rgba(11,11,11,.48);
  font-size: 10.8px;
  line-height: 1.25;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .055em;
}
.profile-row strong {
  width: 100%;
  color: var(--black);
  text-align: left;
  font-size: 10.8px;
  line-height: 1.35;
  font-weight: 850;
  overflow-wrap: anywhere;
}

/* Keep semantic colors only where they communicate status/risk. */
.metric-bar-fill.desserts { background: var(--yellow); opacity: .72; }
.metric-bar-fill.bakery { background: #B8B8B5; }
.metric-bar-fill.drinks { background: var(--black); }

/* A single-shop manager sees the anonymized ranking, but not Reputation. */
.bottom-nav.manager-items { grid-template-columns: repeat(4, 1fr); }
.role-hidden { display: none !important; }
body[data-access-role="single-manager"] #network-map-card,
body[data-access-role="single-manager"] #view-risks,
body[data-access-role="single-manager"] .nav-item[data-view="risks"] {
  display: none !important;
}

.ranking-own {
  border: 1px solid var(--yellow) !important;
  border-radius: 12px;
  background: rgba(255,212,42,.16) !important;
}
.ranking-hero.ranking-own {
  background: linear-gradient(180deg, #2b2819, #171717) !important;
}
.ranking-own-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--yellow);
  color: #171717;
  font-size: 9px;
  font-weight: 900;
  vertical-align: middle;
  white-space: nowrap;
}
.ranking-chart-row:not([data-shop]) { cursor: default; }

/* Slight extra brand polish without adding new colors. */
.page-title h2, .section-head h2 { letter-spacing: -.025em; }
.rank-preview, .ranking-list, .shops-grid > *, .profile-strip {
  box-shadow: 0 8px 24px rgba(11,11,11,.04);
}


/* =========================================================
   v9.5 — COLOR ONLY
   Strict VARKA palette:
   white / soft gray / graphite / yellow accents
   No layout or behavior changes.
   ========================================================= */

:root {
  --v95-graphite: #242424;
  --v95-graphite-soft: #303030;
  --v95-gray: #F4F4F1;
  --v95-gray-deep: #ECECE8;
  --v95-surface: #FAFAF8;
  --v95-yellow-soft: #FFF9E4;
  --v95-yellow: #FFD42A;
}

/* ---------------------------------------------------------
   OVERVIEW
   Color changes only for the dropdown metric groups.
   --------------------------------------------------------- */
.network-average-group,
.network-average-group:nth-child(odd),
.network-average-group:nth-child(even) {
  background: var(--v95-gray) !important;
  border-color: rgba(11,11,11,.10);
}

.network-average-group > .accordion-summary {
  background: var(--v95-gray) !important;
  color: var(--v95-graphite);
}

.network-average-group > .accordion-summary .accordion-chevron {
  background: var(--v95-gray-deep);
  color: var(--v95-graphite);
}

.network-average-group[open] > .accordion-summary {
  background: var(--v95-graphite) !important;
  color: #FFFFFF;
}

.network-average-group[open] > .accordion-summary .accordion-chevron {
  background: var(--v95-yellow);
  color: #0B0B0B;
}

.network-average-group .network-average-grid {
  background: #FFFFFF;
}

.network-average-group .network-average-item {
  background: #FFFFFF;
}

/* Semantic KPI colors remain semantic; yellow warning is softer. */
.network-average-group .network-average-item.metric-warning {
  background: var(--v95-yellow-soft);
}

/* ---------------------------------------------------------
   COFFEE SHOP SHEET
   Large surfaces become neutral. Yellow is an accent only.
   --------------------------------------------------------- */
.detail-section,
.detail-section:nth-of-type(odd),
.detail-section:nth-of-type(even),
.detail-finance-section,
.detail-rating-section,
.profile-section,
.team-section,
.detail-tasks-section,
.detail-diagnostics-section {
  background: var(--v95-surface) !important;
  border-color: rgba(11,11,11,.095);
}

/* Finance gets a barely warm brand tint, not a yellow panel. */
.detail-section.detail-finance-section {
  background: #FFFDF5 !important;
}

/* Profile/team are deliberately neutral and calmer. */
.detail-section.profile-section,
.detail-section.team-section {
  background: var(--v95-gray) !important;
}

.profile-row {
  background: #FFFFFF;
  border-color: rgba(11,11,11,.10) !important;
}

/* Dropdowns on a coffee shop:
   closed = light gray;
   open = graphite;
   yellow only on the chevron/active accent. */
.detail-accordion,
.detail-accordion:nth-of-type(odd),
.detail-accordion:nth-of-type(even) {
  background: var(--v95-gray) !important;
}

.detail-accordion > .accordion-summary {
  background: var(--v95-gray) !important;
  color: var(--v95-graphite);
}

.detail-accordion > .accordion-summary .accordion-chevron {
  background: var(--v95-gray-deep);
  color: var(--v95-graphite);
}

.detail-accordion[open] > .accordion-summary {
  background: var(--v95-graphite) !important;
  color: #FFFFFF;
}

.detail-accordion[open] > .accordion-summary .accordion-chevron {
  background: var(--v95-yellow);
  color: #0B0B0B;
}

.detail-accordion-body {
  background: #FFFFFF;
  border-top-color: rgba(11,11,11,.10);
}

/* Inner metric cards stay clean white. */
.detail-grid > *,
.metric-card {
  background: #FFFFFF;
}

/* Keep yellow only as a deliberate brand accent. */
.detail-section h3,
.profile-section h3,
.team-section h3 {
  color: var(--v95-graphite);
}

/* Rating/tasks/profile surfaces should not become yellow through older rules. */
.detail-rating-section,
.detail-tasks-section,
.detail-diagnostics-section {
  background: var(--v95-surface) !important;
}

/* Existing semantic colors for risk/errors/statuses are intentionally untouched. */


/* =========================================================
   v9.6 — two color fixes only
   1) Overview average check text: black
   2) Coffee shop finance block: dark graphite
   ========================================================= */

/* v9.5 made all metric cards white, while .dark-card still inherited white text.
   Keep the overview average-check card white, but make its text readable. */
.metric-card.dark-card {
  background: #FFFFFF !important;
  color: #0B0B0B !important;
  border-color: rgba(11,11,11,.10) !important;
}
.metric-card.dark-card span {
  color: rgba(11,11,11,.48) !important;
}
.metric-card.dark-card strong {
  color: #0B0B0B !important;
}

/* Coffee sheet finance block: graphite outer surface, clean light cards inside. */
.detail-section.detail-finance-section {
  background: #242424 !important;
  border-color: #242424 !important;
  box-shadow: 0 10px 28px rgba(11,11,11,.10);
}

.detail-finance-section h3 {
  color: #FFFFFF !important;
}

.detail-finance-section .detail-metric {
  background: #F8F8F6 !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #0B0B0B !important;
}

.detail-finance-section .detail-metric span,
.detail-finance-section .detail-metric em {
  color: rgba(11,11,11,.48) !important;
}

.detail-finance-section .detail-metric strong {
  color: #0B0B0B !important;
}

/* Preserve the brand accent on the first finance card. */
.detail-finance-section .detail-metric:nth-child(4n+1) {
  border-top-color: #FFD42A !important;
}


/* =========================================================
   v9.7 — spacing + profile/team color refinement only
   ========================================================= */

/* More breathing room between dropdown header and first metric card.
   Applies to both Overview metric accordions and coffee-sheet accordions. */
.network-average-group[open] .network-average-grid {
  padding-top: 8px !important;
}

.detail-accordion[open] .detail-accordion-body {
  padding-top: 16px !important;
}

/* Ensure the first card never visually collides with the dark summary bar. */
.network-average-group[open] .network-average-grid > :first-child,
.detail-accordion[open] .detail-accordion-body > :first-child {
  margin-top: 0 !important;
}

/* Profile / Team: darker graphite than before, but softer than Finance. */
.detail-section.profile-section,
.detail-section.team-section {
  background: #3A3A3A !important;
  border-color: #3A3A3A !important;
  box-shadow: 0 10px 26px rgba(11,11,11,.08);
}

.profile-section h3,
.team-section h3 {
  color: #FFFFFF !important;
}

/* Keep the information cards light for readability and contrast. */
.profile-section .profile-row,
.team-section .profile-row {
  background: #F7F7F4 !important;
  border-color: rgba(255,255,255,.10) !important;
}

/* Labels and values inside profile/team stay readable. */
.profile-section .profile-label,
.team-section .profile-label,
.profile-section .profile-row span,
.team-section .profile-row span {
  color: rgba(11,11,11,.50) !important;
}

.profile-section .profile-value,
.team-section .profile-value,
.profile-section .profile-row strong,
.team-section .profile-row strong {
  color: #0B0B0B !important;
}

.profile-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; }
.profile-heading h3 { margin:0; }
.profile-edit-button, .profile-edit-actions button { border:1px solid rgba(255,255,255,.35); border-radius:9px; padding:7px 10px; background:transparent; color:#fff; font-size:11px; font-weight:700; }
.profile-edit-form { flex-basis:100%; order:3; display:grid; gap:11px; padding:12px; border:1px solid rgba(255,255,255,.25); border-radius:12px; }
.profile-edit-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.profile-edit-grid label { display:grid; gap:4px; min-width:0; color:#fff; font-size:11px; }
.profile-edit-grid input, .profile-edit-grid select { width:100%; min-height:36px; border:1px solid #aaa; border-radius:8px; padding:6px 8px; background:#f7f7f4; color:#0b0b0b; }
.profile-edit-actions { display:flex; gap:8px; }
.profile-edit-actions button:first-child { background:#ffd42a; color:#0b0b0b; border-color:#ffd42a; }
.profile-edit-form small { color:#fff; }
@media(max-width:520px) { .profile-edit-grid { grid-template-columns:1fr; } }


/* =========================================================
   v9.8 — MOBILE FIX ONLY
   1) Prevent task deadline field overflow on phones
   2) Increase mobile typography by ~10%
   ========================================================= */

/* iOS/Telegram WebView date inputs can keep an intrinsic min-width.
   Force all task form controls to respect the modal width. */
.task-modal {
  overflow-x: hidden;
}

.task-field,
.task-field input,
.task-field select,
.task-field textarea,
.task-shop-search,
#task-form-deadline {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

#task-form-deadline {
  display: block;
  width: 100% !important;
}

/* Mobile-only typography boost.
   text-size-adjust scales text globally without changing layout dimensions
   like zoom/transform would. */
@media (max-width: 600px) {
  html,
  body {
    -webkit-text-size-adjust: 110%;
    text-size-adjust: 110%;
  }
}


/* =========================================================
   v9.9 — MOBILE POLISH
   1) robust symmetric deadline field
   2) clean custom coffee-selection circles
   3) lightweight functional animations
   ========================================================= */

/* ---------------------------------------------------------
   TASK DEADLINE — native iOS/Telegram date input containment
   --------------------------------------------------------- */
#task-form,
.task-date-field {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.task-date-field {
  overflow: hidden;
}

.task-date-control {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
}

/* The wrapper owns the visible border.
   Even if WebKit gives type=date a wider intrinsic box,
   it is clipped inside the symmetric wrapper. */
.task-date-control #task-form-deadline {
  display: block;
  inline-size: 100% !important;
  width: 100% !important;
  min-inline-size: 0 !important;
  min-width: 0 !important;
  max-inline-size: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  overflow: hidden !important;
  padding: 10px !important;
}

/* ---------------------------------------------------------
   COFFEE MULTISELECT — remove native gray/beveled control
   --------------------------------------------------------- */
.task-shop-option input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  flex: 0 0 20px;
  margin: 0 !important;
  padding: 0 !important;
  border: 1.5px solid #242424 !important;
  border-radius: 50%;
  background: #FFFFFF !important;
  box-shadow: none !important;
  outline: none !important;
  transition:
    background-color .14s ease,
    border-color .14s ease,
    transform .14s ease;
}

.task-shop-option input[type="checkbox"]:checked {
  border-color: #0B0B0B !important;
  background:
    radial-gradient(circle at center, #0B0B0B 0 3px, transparent 3.5px),
    #FFD42A !important;
}

.task-shop-option input[type="checkbox"]:active {
  transform: scale(.92);
}

/* ---------------------------------------------------------
   LIGHTWEIGHT ANIMATION SYSTEM
   No JS libraries; transform/opacity only.
   --------------------------------------------------------- */
@keyframes pulse-fill-x {
  from {
    transform: scaleX(0);
    opacity: .72;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes pulse-sheet-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Coffee sheet / task modal appear softly. */
.detail-sheet:not(.hidden) {
  animation: pulse-sheet-in .20s cubic-bezier(.22,.72,.26,1);
}

.task-modal:not(.hidden) {
  animation: pulse-modal-in .18s cubic-bezier(.22,.72,.26,1);
}

.sheet-backdrop:not(.hidden),
.task-modal-backdrop:not(.hidden) {
  animation: pulse-backdrop-in .16s ease-out;
}

/* Metric lines animate when their dropdown is opened.
   Reopening a <details> section replays the animation. */
.detail-accordion[open] .metric-bar-fill,
.detail-accordion[open] .compare-fill,
.detail-accordion[open] .stack-segment {
  transform-origin: left center;
  animation: pulse-fill-x .46s cubic-bezier(.22,.72,.26,1) both;
}

/* Other visible linear indicators animate on screen/view appearance. */
.detail-sheet:not(.hidden) .rating-dist-fill,
.view.active .rank-bar-fill,
.view.active .risk-mix-segment {
  transform-origin: left center;
  animation: pulse-fill-x .46s cubic-bezier(.22,.72,.26,1) both;
}

/* Slight staggering inside product/channel lists, still very subtle. */
.detail-accordion[open] .metric-bar-row:nth-child(2) .metric-bar-fill {
  animation-delay: .035s;
}
.detail-accordion[open] .metric-bar-row:nth-child(3) .metric-bar-fill {
  animation-delay: .07s;
}
.detail-accordion[open] .metric-bar-row:nth-child(4) .metric-bar-fill {
  animation-delay: .105s;
}

/* Respect accessibility / OS motion preferences. */
@media (prefers-reduced-motion: reduce) {
  .detail-sheet,
  .task-modal,
  .sheet-backdrop,
  .task-modal-backdrop,
  .metric-bar-fill,
  .compare-fill,
  .stack-segment,
  .rating-dist-fill,
  .rank-bar-fill,
  .risk-mix-segment,
  .task-shop-option input[type="checkbox"] {
    animation: none !important;
    transition: none !important;
  }
}


/* =========================================================
   v9.12 — ranking page visualized + small-font soft rollback
   ========================================================= */

.ranking-list {
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.ranking-visual-shell {
  display: grid;
  gap: 12px;
}

.ranking-hero {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(30,30,30,.98), rgba(14,14,14,.98));
  color: #fff;
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.ranking-hero::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -42px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,212,42,.22), rgba(255,212,42,0) 68%);
  pointer-events: none;
}

.ranking-kicker {
  font-size: 10.8px;
  text-transform: uppercase;
  letter-spacing: .14em;
  opacity: .72;
  font-weight: 800;
}

.ranking-hero-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

.ranking-leader-copy {
  min-width: 0;
}

.ranking-leader-name {
  font-size: 21px;
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: -.04em;
}

.ranking-leader-sub {
  margin-top: 4px;
  color: rgba(255,255,255,.74);
  font-size: 11.2px;
}

.ranking-leader-value {
  flex: 0 0 auto;
  background: var(--yellow);
  color: var(--black);
  font-weight: 900;
  font-size: 13.2px;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.12);
}

.ranking-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ranking-podium-card {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow);
  position: relative;
}

.ranking-podium-card.first {
  background: rgba(255,212,42,.12);
  border-color: rgba(255,212,42,.95);
}

.ranking-podium-card.second,
.ranking-podium-card.third {
  background: rgba(246,246,242,.95);
}

.ranking-medal {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.8px;
  font-weight: 900;
  color: var(--black);
  margin-bottom: 10px;
  background: var(--yellow);
}

.ranking-podium-card.second .ranking-medal,
.ranking-podium-card.third .ranking-medal {
  background: rgba(30,30,30,.1);
}

.ranking-podium-name {
  font-size: 12.6px;
  font-weight: 850;
  line-height: 1.18;
  min-height: 28px;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.ranking-podium-value {
  margin-top: 8px;
  font-size: 12.6px;
  font-weight: 900;
}

.ranking-chart {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ranking-chart-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,212,42,.10);
}

.ranking-chart-title {
  font-size: 12.6px;
  font-weight: 850;
}

.ranking-chart-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.8px;
}

.ranking-chart-body {
  padding: 8px 10px 10px;
}

.ranking-chart-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid transparent;
}

.ranking-chart-pos {
  font-weight: 900;
  color: var(--muted);
  font-size: 11.2px;
}

.ranking-chart-main {
  min-width: 0;
}

.ranking-chart-name {
  font-size: 11.2px;
  font-weight: 800;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-chart-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(19,19,19,.08);
  position: relative;
  overflow: hidden;
}

.ranking-chart-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), #f1bc00);
  transform-origin: left center;
}

.ranking-chart-fill.low-better {
  background: linear-gradient(90deg, #343434, #121212);
}

.ranking-chart-value {
  font-weight: 900;
  font-size: 11.2px;
  white-space: nowrap;
}

.ranking-empty {
  border: 1px dashed var(--line);
  background: var(--white);
  border-radius: 18px;
  padding: 18px;
  color: var(--muted);
  font-size: 11.2px;
}

.view.active .ranking-chart-fill,
.view.active .ranking-podium-card,
.view.active .ranking-hero {
  animation: pulse-sheet-in .22s cubic-bezier(.22,.72,.26,1);
}

.view.active .ranking-chart-fill {
  animation-name: pulse-fill-x;
  animation-duration: .46s;
  animation-fill-mode: both;
}

.view.active .ranking-chart-row:nth-child(2) .ranking-chart-fill { animation-delay: .03s; }
.view.active .ranking-chart-row:nth-child(3) .ranking-chart-fill { animation-delay: .06s; }
.view.active .ranking-chart-row:nth-child(4) .ranking-chart-fill { animation-delay: .09s; }
.view.active .ranking-chart-row:nth-child(5) .ranking-chart-fill { animation-delay: .12s; }


/* =========================================================
   v9.13 — typography polish
   ========================================================= */

/* 1) Task counters: make labels a bit smaller and cleaner on mobile. */
.task-stat span {
  font-size: 9.6px !important;
  line-height: 1.12 !important;
  letter-spacing: .04em !important;
  font-weight: 800 !important;
  word-break: normal !important;
  overflow-wrap: anywhere;
}
.task-stat strong {
  margin-top: 6px !important;
}
@media (max-width: 430px) {
  .task-stat {
    padding: 10px !important;
  }
  .task-stat span {
    font-size: 9.2px !important;
  }
}

/* =========================================================
   v9.17 — VARKA Pulse hourly checks chart
   ========================================================= */
.hourly-checks-body {
  min-width: 0;
}

.hourly-loading,
.hourly-error {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}

.hourly-loading span {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid rgba(11,11,11,.15);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: hourly-spin .7s linear infinite;
}

.hourly-error {
  flex-direction: column;
  color: #9b3b30;
}

.hourly-error button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--black);
  color: var(--white);
  font: inherit;
}

.hourly-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.hourly-summary > div {
  min-width: 0;
  padding: 10px;
  border-radius: 13px;
  background: var(--soft);
}

.hourly-summary span {
  display: block;
  min-height: 2.5em;
  color: var(--muted);
  font-size: 9.8px;
  font-weight: 700;
  line-height: 1.25;
}

.hourly-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  line-height: 1;
}

.hourly-period,
.hourly-axis-note {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.4;
}

.hourly-period { margin: 0 2px 14px; }
.hourly-axis-note { margin: 9px 2px 0; }
.hourly-readout {
  margin: 0 2px 9px;
  min-height: 18px;
  color: var(--black);
  font-size: 11px;
  font-weight: 850;
}

.hourly-chart {
  display: grid;
  grid-template-columns: repeat(24, minmax(6px, 1fr));
  align-items: end;
  gap: 3px;
  height: 210px;
  padding: 15px 8px 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(to top, rgba(11,11,11,.045) 1px, transparent 1px) 0 0 / 100% 25%,
    var(--white);
}

.hourly-column {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 18px minmax(0, 1fr) 16px;
  gap: 3px;
  align-items: end;
  cursor: pointer;
  outline: none;
}

.hourly-value,
.hourly-hour {
  overflow: visible;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  line-height: 1;
  text-align: center;
}

.hourly-value {
  opacity: 0;
  transition: opacity .18s ease;
}

.hourly-column:hover .hourly-value,
.hourly-column:active .hourly-value,
.hourly-column.selected .hourly-value,
.hourly-column.peak .hourly-value {
  opacity: 1;
}

.hourly-bar-slot {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-radius: 5px 5px 2px 2px;
  background: rgba(11,11,11,.035);
  overflow: hidden;
}

.hourly-bar {
  width: 100%;
  min-height: 0;
  border-radius: 5px 5px 2px 2px;
  background: var(--yellow);
  transform-origin: bottom;
  animation: hourly-rise .5s cubic-bezier(.2,.75,.25,1) both;
}

.hourly-column.peak .hourly-bar {
  background: var(--black);
}
.hourly-column.selected .hourly-bar-slot {
  box-shadow: 0 0 0 2px var(--black);
}

@keyframes hourly-rise {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes hourly-spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 760px) {
  .hourly-chart {
    height: 270px;
    gap: 6px;
    padding: 18px 14px 9px;
  }
  .hourly-value,
  .hourly-hour { font-size: 9.5px; }
  .hourly-summary > div { padding: 13px 14px; }
  .hourly-summary span { min-height: auto; font-size: 11px; }
  .hourly-summary strong { font-size: 20px; }
}

@media (max-width: 430px) {
  .hourly-chart {
    height: 245px;
    gap: 2px;
    padding: 18px 5px 8px;
  }
  .hourly-value { display: block; font-size: 8px; }
  .hourly-column { grid-template-rows: 18px minmax(0, 1fr) 15px; }
  .hourly-summary span { font-size: 9.2px; }
  .hourly-summary strong { font-size: 14px; }
}

@media (min-width: 1000px) {
  body { background: #f5f5f2; }
  .shell {
    width: auto; max-width: none; margin: 0 32px 0 260px;
    padding: 22px 0 48px;
  }
  .topbar { position: sticky; top: 0; z-index: 12; padding: 8px 0 14px; background: #f5f5f2; }
  .bottom-nav {
    left: 22px; top: 78px; bottom: auto; transform: none;
    width: 214px; grid-template-columns: 1fr; gap: 6px;
    padding: 12px; border-radius: 22px;
  }
  .bottom-nav.four-items,
  .bottom-nav.manager-items { grid-template-columns: 1fr; }
  .nav-item {
    display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center;
    min-height: 48px; padding: 9px 12px; text-align: left;
  }
  .nav-item span { text-align: center; }
  .nav-item small { margin: 0; font-size: 12px; }
  .hero-card { min-height: 230px; }
  .view { width: min(100%, 1280px); }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric-grid .metric-card.wide { grid-column: auto; }
  .shops-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .detail-sheet {
    left: auto; right: 24px; top: 72px; bottom: 22px;
    width: min(980px, calc(100% - 310px)); max-height: none;
    transform: none; border-radius: 26px; padding-inline: 28px;
  }
  .sheet-handle { display: none; }
  .detail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1500px) {
  .shell { margin-right: 52px; }
  .shops-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .hourly-bar,
  .hourly-loading span { animation: none; }
}

/* 2) Overview metric labels: reduce only label text, keep big numbers unchanged. */
.network-average-item span {
  font-size: 10px !important;
  line-height: 1.18 !important;
  letter-spacing: .04em !important;
}
.metric-card span {
  font-size: 10px !important;
  line-height: 1.18 !important;
  letter-spacing: .05em !important;
}
.detail-metric span,
.detail-metric em {
  font-size: 10px !important;
  line-height: 1.22 !important;
}

/* 3) Comparison chart: give left labels more room so "Прошлый" never hides under bar. */
.compare-bar-line {
  grid-template-columns: 58px minmax(0, 1fr) 92px !important;
  gap: 8px !important;
}
.compare-bar-label {
  white-space: nowrap !important;
  position: relative;
  z-index: 2;
}
.compare-value { text-align: right; white-space: nowrap; }
.compare-track {
  position: relative;
  z-index: 1;
}
@media (max-width: 430px) {
  .compare-bar-line {
    grid-template-columns: 62px minmax(0, 1fr) 78px !important;
  }
}

.revenue-history-chart {
  padding: 4px 0 0;
}
.revenue-history-summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 0 3px 8px; color: var(--muted); font-size: 10.5px; font-weight: 700;
}
.revenue-history-summary strong { color: var(--black); font-size: 15px; }
.revenue-history-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.revenue-history-chart text { fill: var(--muted); font-size: 10px; font-weight: 700; }
.revenue-grid-line { stroke: rgba(11,11,11,.09); stroke-width: 1; }
.revenue-history-line {
  fill: none; stroke: var(--yellow); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
}
.revenue-history-dot { fill: var(--black); stroke: var(--white); stroke-width: 3; cursor:pointer; transition:r .15s ease, fill .15s ease; }
.revenue-history-dot:hover, .revenue-history-dot:focus, .revenue-history-dot.is-active { r:8px; fill:var(--yellow); outline:none; }

.network-map-card {
  margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--white); box-shadow: var(--shadow);
}
.network-map {
  position: relative; height: 300px; margin: 14px 0 24px 22px; overflow: visible;
  border: 1px solid var(--line); border-radius: 16px;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(11,11,11,.15) 50%, transparent calc(50% + .5px)),
    linear-gradient(0deg, transparent calc(50% - .5px), rgba(11,11,11,.15) 50%, transparent calc(50% + .5px)),
    #fafaf7;
}
.network-map-quadrant {
  position: absolute; width: 50%; height: 50%; padding: 12px; box-sizing: border-box;
  color: rgba(11,11,11,.38); pointer-events: none;
}
.network-map-quadrant strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.network-map-quadrant span { display: block; margin-top: 3px; font-size: 9.5px; }
.q-flow { left: 0; top: 0; background: rgba(255,212,42,.055); }
.q-leaders { right: 0; top: 0; text-align: right; background: rgba(67,166,109,.07); }
.q-growth { left: 0; bottom: 0; display:flex; flex-direction:column; justify-content:flex-end; background: rgba(227,79,74,.035); }
.q-basket { right: 0; bottom: 0; display:flex; flex-direction:column; justify-content:flex-end; text-align:right; background: rgba(242,154,46,.05); }
.network-map-axis { position:absolute; z-index:2; color:rgba(11,11,11,.42); font-size:9px; font-weight:850; text-transform:uppercase; letter-spacing:.08em; pointer-events:none; }
.network-map-axis.axis-y { left:-20px; top:50%; transform:rotate(-90deg) translateX(-50%); transform-origin:left top; }
.network-map-axis.axis-x { left:50%; bottom:-18px; transform:translateX(-50%); }
.network-map-dot {
  position: absolute; z-index: 3; width: 11px; height: 11px; padding: 0; border: 2px solid white;
  border-radius: 50%; transform: translate(-50%, 50%); box-shadow: 0 1px 5px rgba(11,11,11,.25);
  transition: width .15s ease, height .15s ease, z-index .15s ease;
}
.network-map-dot:hover, .network-map-dot:focus { width:18px; height:18px; z-index:5; outline:3px solid rgba(255,212,42,.35); }
.network-map-dot.stable { background:#43A66D; }
.network-map-dot.watch { background:#F4C63D; }
.network-map-dot.medium { background:#F29A2E; }
.network-map-dot.high { background:#E34F4A; }
.network-map-dot.behind-plan { box-shadow: 0 0 0 2px #0B0B0B, 0 2px 6px rgba(11,11,11,.3); }
.network-map-legend { display:flex; flex-wrap:wrap; gap:8px 13px; margin-top:10px; color:var(--muted); font-size:9.5px; font-weight:700; }
.network-map-legend span { display:flex; align-items:center; gap:5px; }
.network-map-legend i { width:8px; height:8px; border-radius:50%; }
.network-map-legend i.stable { background:#43A66D; }
.network-map-legend i.watch { background:#F4C63D; }
.network-map-legend i.medium { background:#F29A2E; }
.network-map-legend i.high { background:#E34F4A; }
.network-map-legend i.behind { background:white; border:2px solid #0B0B0B; box-sizing:border-box; }
.network-map-note { margin:8px 0 0; color:var(--muted); font-size:9.5px; line-height:1.4; }

.cohort-filters {
  margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--white); box-shadow: var(--shadow);
}
.cohort-filter-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.cohort-filter-head strong { display:block; margin-top:3px; font-size:14px; }
.cohort-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
#rocketdata-setup { background:var(--black); color:var(--white); -webkit-text-fill-color:var(--white); }
#cohort-reset { color:var(--black); -webkit-text-fill-color:var(--black); }
.reputation-setup { margin-top:12px; border:0; border-radius:11px; padding:10px 13px; font:800 10px Montserrat,sans-serif; cursor:pointer; }
.cohort-filter-head button {
  border:0; background:var(--yellow); border-radius:10px; padding:8px 10px;
  font:800 10px Montserrat,sans-serif; cursor:pointer;
}
.rocket-map-help { margin:18px 0 10px; padding:12px 14px; border-radius:14px; background:var(--soft-yellow); font-size:12px; line-height:1.45; }
.rocket-map-search { width:100%; margin-bottom:10px; padding:12px 14px; border:1px solid var(--line); border-radius:13px; background:var(--white); font:inherit; }
.rocket-map-list { display:grid; gap:8px; margin-bottom:14px; }
.rocket-map-row { display:grid; grid-template-columns:minmax(150px,.8fr) minmax(220px,1.7fr); align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:13px; background:var(--white); }
.rocket-map-row span, .rocket-map-row small { display:block; }
.rocket-map-row small { margin-top:3px; color:var(--muted); font-size:10px; }
.rocket-map-row select { width:100%; min-width:0; padding:9px 10px; border:1px solid var(--line); border-radius:10px; background:var(--soft-gray); font-size:11px; }
@media (max-width:640px) {
  .cohort-filter-head { align-items:flex-start; }
  .cohort-actions { max-width:170px; }
  .rocket-map-row { grid-template-columns:1fr; }
}
.cohort-filter-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:12px; }
.cohort-filter-grid label span {
  display:block; margin:0 0 5px 2px; color:var(--muted); font-size:9px;
  font-weight:800; text-transform:uppercase;
}
.cohort-filter-grid select {
  width:100%; min-width:0; border:1px solid var(--line); border-radius:11px;
  background:var(--soft); padding:9px 28px 9px 9px; font:750 10px Montserrat,sans-serif;
}
.cohort-filters p { margin:9px 2px 0; color:var(--muted); font-size:9.5px; }
@media (max-width: 520px) {
  .network-map { height:260px; }
  .network-map-quadrant span { display:none; }
  .network-map-dot { width:10px; height:10px; }
}

@media (max-width: 430px) {
  .ranking-podium-card { padding:10px 8px; min-width:0; overflow:hidden; }
  .ranking-podium-name { font-size:10.7px; line-height:1.16; min-height:38px; }
  .ranking-chart-name, .rank-name { font-size:10.5px; }
  .rank-name { white-space:normal; overflow-wrap:anywhere; line-height:1.15; }
  .cohort-filter-grid { grid-template-columns:1fr; }
  .revenue-history-chart svg { height:245px; min-height:245px; }
  .revenue-history-chart text { font-size:13px; font-weight:750; }
  .revenue-history-summary { font-size:11.5px; }
}

/* v9.29: readable mobile map, risk filters and daily revenue. */
.shop-controls { display:flex; gap:8px; align-items:center; }
.shop-controls .search { min-width:0; }
.risk-dot { display:inline-block; align-self:center; width:11px; height:11px; flex:0 0 11px; border-radius:50%; transform:translateY(1px); box-shadow:0 0 0 2px white,0 0 0 3px var(--line); }
.risk-dot.high { background:#E34F4A; }
.risk-dot.medium { background:#F29A2E; }
.risk-dot.watch { background:#F4C63D; }
.risk-dot.stable { background:#43A66D; }
.network-map-mobile { display:none; }
.speed-coverage { margin-top:12px; padding:10px 12px; border-radius:12px; background:var(--soft-yellow); font-size:10.5px; line-height:1.45; }
.daily-revenue-section h3 { margin-bottom:12px; }
.daily-revenue-head { position:relative; z-index:5; display:flex; justify-content:space-between; gap:10px; margin-bottom:7px; padding:5px 7px; border-radius:8px; background:var(--white); color:var(--muted); font-size:10px; }
.daily-revenue-head strong { color:var(--black); }
.daily-revenue-coverage { margin:0 0 7px; color:var(--risk-high); font-size:9px; font-weight:750; }
.daily-revenue-readout { position:relative; z-index:4; min-height:27px; margin:0 42px 6px 0; padding:7px 9px; border-radius:9px; background:var(--soft-yellow); color:var(--black); font-size:9.5px; font-weight:750; }
.daily-revenue-bars { position:relative; display:flex; align-items:stretch; gap:3px; height:210px; padding-top:6px; overflow:hidden; border-bottom:1px solid var(--line); }
.daily-revenue-plot { position:absolute; z-index:3; inset:6px 0 20px; pointer-events:none; }
.daily-plan-line { position:absolute; left:0; right:0; bottom:var(--plan); border-top:2px dashed #e34f4a; pointer-events:none; }
.daily-plan-line span { position:absolute; z-index:8; right:0; bottom:3px; padding:2px 5px; border:1px solid rgba(227,79,74,.25); border-radius:6px; background:#fff; color:#b12d29; font-size:8px; font-weight:850; text-transform:uppercase; }
.network-announcement { margin:10px 0 12px; padding:12px 15px; border:1px solid rgba(255,212,42,.8); border-radius:15px; background:linear-gradient(135deg,#fff6c7,#ffd42a); color:var(--black); box-shadow:var(--shadow); font-family:"Comfortaa",sans-serif; font-size:15px; font-style:normal; font-weight:700; line-height:1.35; }
.daily-revenue-column { position:relative; flex:1; min-width:5px; height:100%; padding:0 0 20px; border:0; background:transparent; cursor:pointer; }
.daily-revenue-track { position:absolute; inset:0 12% 20px; display:block; font-style:normal; }
.daily-revenue-track > span { position:absolute; left:0; right:0; bottom:0; min-height:2px; border-radius:5px 5px 1px 1px; background:var(--yellow); }
.daily-revenue-column.below .daily-revenue-track > span { background:#d9d9d4; }
.daily-revenue-column.incomplete .daily-revenue-track > span { background:repeating-linear-gradient(135deg,#e39b2d 0 4px,#ffe0a4 4px 8px); }
.daily-revenue-column small { position:absolute; left:0; right:0; bottom:3px; font-size:8px; color:var(--muted); }
.daily-revenue-column:hover .daily-revenue-track > span, .daily-revenue-column:focus .daily-revenue-track > span { background:var(--black); }
.daily-revenue-column.selected .daily-revenue-track > span { background:var(--black); }
.detail-plan-card > span { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.plan-edit { display:grid; place-items:center; width:25px; height:25px; padding:0; border:1px solid var(--line); border-radius:8px; background:var(--soft-yellow); color:var(--black); }
.plan-edit svg { display:block; width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.plan-form { display:grid; gap:7px; margin-top:10px; }
.plan-form label { color:var(--black); font-size:10px; font-weight:700; }
.plan-form input { display:block; width:100%; margin-top:5px; padding:8px; border:1px solid var(--line); border-radius:8px; background:var(--white); color:var(--black); font-size:12px; }
.plan-form button[type="submit"] { padding:8px; border:0; border-radius:8px; background:var(--yellow); color:#0B0B0B; font-size:10px; font-weight:800; }
.plan-form-message { color:var(--risk-high); font-size:9px; overflow-wrap:anywhere; }
.comparison-note { margin:12px 0 0; color:var(--muted); font-size:9px; line-height:1.45; }
.reputation-body, .reputation-ratings, .reputation-rating, .reputation-review, .reputation-reply, .reviews-list { min-width:0; max-width:100%; box-sizing:border-box; }
.reputation-review, .reputation-reply { overflow:hidden; overflow-wrap:anywhere; word-break:break-word; }
.reputation-overall { display:grid; grid-template-columns:1fr auto; gap:3px 12px; align-items:center; margin:12px 0; padding:14px; border-radius:15px; background:var(--black); color:var(--white); }
.reputation-overall span { font-size:9px; font-weight:800; text-transform:uppercase; }
.reputation-overall strong { grid-row:1 / 3; grid-column:2; font-size:24px; }
.reputation-overall small { color:#bdbdbd; font-size:9px; }
.review-stars.stars-5 { background:#43A66D; color:white; }
.review-stars.stars-4 { background:#A8D99B; color:#173f26; }
.review-stars.stars-3 { background:#FFD42A; color:#0B0B0B; }
.review-stars.stars-2 { background:#F5A8B8; color:#6f1f32; }
.review-stars.stars-1 { background:#E34F4A; color:white; }
.review-stars[class*="stars-"] { padding:4px 7px; border-radius:8px; white-space:nowrap; }

@media (max-width: 520px) {
  .shop-controls { width:100%; display:grid; grid-template-columns:1fr 1fr; }
  .shop-controls #shop-search { grid-column:1 / -1; }
  .shops-title { align-items:flex-start; flex-wrap:wrap; }
  .network-map { height:230px; }
  .network-map-dot { width:13px; height:13px; }
  .network-map-quadrant strong { font-size:9px; }
  .network-map-axis { font-size:8px; }
  .network-map-mobile { display:grid; gap:7px; margin-top:10px; }
  .network-map-mobile details { border:1px solid var(--line); border-radius:12px; overflow:hidden; }
  .network-map-mobile summary { display:flex; justify-content:space-between; padding:10px 11px; font-size:10px; font-weight:850; text-transform:uppercase; cursor:pointer; }
  .network-map-mobile summary strong { min-width:22px; text-align:center; padding:2px 5px; border-radius:7px; background:var(--yellow); }
  .network-map-mobile details > div { display:grid; max-height:230px; overflow:auto; border-top:1px solid var(--line); }
  .network-map-mobile button { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:10px 11px; border:0; border-bottom:1px solid var(--line); background:white; text-align:left; }
  .network-map-mobile button span { min-width:0; font-size:10.5px; font-weight:800; overflow-wrap:anywhere; }
  .network-map-mobile button small { flex:none; color:var(--muted); font-size:8.5px; }
  .daily-revenue-bars { height:245px; overflow-x:auto; gap:4px; }
  .daily-revenue-column { flex:0 0 18px; }
  .daily-revenue-head { font-size:10.5px; }
  .bottom-nav .nav-item small { font-size:8.5px; }
}


/* =========================================================
   v9.14 — Focus/Risk card mobile overflow fix
   ========================================================= */

/* Base safety: let the text column shrink correctly and keep content inside. */
.risk-card {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  width: 100% !important;
  max-width: 100%;
  overflow: hidden;
}

.risk-card > div:nth-child(2) {
  min-width: 0;
}

.risk-name {
  line-height: 1.2;
  word-break: break-word;
}

.risk-reason {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.35;
  word-break: break-word;
}

/* On phones stack the score below the text so nothing sticks out to the right. */
@media (max-width: 430px) {
  .risk-card {
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 10px !important;
    padding: 13px 14px !important;
  }

  .risk-badge {
    height: 38px;
  }

  .risk-score {
    grid-column: 2;
    justify-self: start;
    margin-top: 6px;
    font-size: 10.2px;
    padding: 5px 8px;
  }

  .risk-name {
    font-size: 12px !important;
  }

  .risk-reason {
    font-size: 10.6px !important;
    margin-top: 5px;
  }
}

/* Dark surfaces that older version-specific rules paint with literal white. */
:root[data-theme="dark"] #cohort-reset { color:#0b0b0b; -webkit-text-fill-color:#0b0b0b; }
:root[data-theme="dark"] .yellow-card { background:#ffd42a !important; }
:root[data-theme="dark"] .risk-stat { color:#0b0b0b; }
:root[data-theme="dark"] .risk-stat:nth-child(1) { color:#fff; }
:root[data-theme="dark"] .risk-stat span { opacity:1; }
:root[data-theme="dark"] .task-stat.review strong { color:#ffd42a; }
:root[data-theme="dark"] .topbar .brand-word { color:#bfc1c7; }
:root[data-theme="dark"] .profile-section .profile-row span,
:root[data-theme="dark"] .team-section .profile-row span { color:#bfc1c7 !important; }
:root[data-theme="dark"] .profile-section .profile-row strong,
:root[data-theme="dark"] .team-section .profile-row strong { color:#f5f5f2 !important; }
:root[data-theme="dark"] { color-scheme:dark; --muted:rgba(245,245,242,.75); }
:root[data-theme="light"] { color-scheme:light; }
:root[data-theme="dark"] .network-average-group .network-average-grid,
:root[data-theme="dark"] .network-average-group .network-average-item,
:root[data-theme="dark"] .network-map-mobile button,
:root[data-theme="dark"] .detail-section.detail-finance-section { background:#292b2f !important; color:#f5f5f2; }
:root[data-theme="dark"] .network-average-group[open] > .accordion-summary { background:#34363b !important; color:#f5f5f2; }
:root[data-theme="dark"] .network-average-item.metric-warning { background:#474025 !important; }
.ranking-leader-value, .ranking-medal, .task-add-button,
.text-button, .network-map-mobile summary strong { color:#0b0b0b; }
:root[data-theme="dark"] .ranking-podium-card.second .ranking-medal,
:root[data-theme="dark"] .ranking-podium-card.third .ranking-medal { background:#47494f; color:#f5f5f2; }
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select { color:#f5f5f2; }
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color:#bfc1c7; opacity:1; }
:root[data-theme="dark"] .reputation-overall { background:#303238; color:#fff; }
.ranking-chart-row { cursor:pointer; }
.ranking-expand { display:block; margin:14px auto 0; min-height:40px; }
button:focus-visible, [role="button"]:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline:2px solid #b88900; outline-offset:3px; }
@media (max-width:600px) {
  .shops-grid { grid-template-columns:minmax(0,1fr); }
  .shop-card { min-width:0; }
  .shop-name { font-size:14px; line-height:1.35; }
  .ranking-leader-name { font-size:18px; line-height:1.2; }
  .ranking-hero-main { flex-wrap:wrap; }
  .ranking-podium-name { font-size:11px; line-height:1.35; }
  .shell { padding-bottom:calc(110px + env(safe-area-inset-bottom)); }
}
:root[data-theme="dark"] .detail-grid > *,
:root[data-theme="dark"] .metric-card:not(.yellow-card),
:root[data-theme="dark"] .profile-row,
:root[data-theme="dark"] .detail-accordion-body,
:root[data-theme="dark"] .ranking-podium-card,
:root[data-theme="dark"] .ranking-chart-row,
:root[data-theme="dark"] .task-card,
:root[data-theme="dark"] .shop-card { background:#292b2f !important; color:#f5f5f2 !important; border-color:rgba(255,255,255,.15) !important; }
:root[data-theme="dark"] .metric-card.dark-card { background:#292b2f !important; color:#f5f5f2 !important; }
:root[data-theme="dark"] .metric-card.dark-card strong { color:#f5f5f2 !important; }
:root[data-theme="dark"] .metric-card.dark-card span { color:rgba(245,245,242,.61) !important; }
:root[data-theme="dark"] .detail-finance-section .detail-metric { background:#303238 !important; color:#f5f5f2 !important; }
:root[data-theme="dark"] .detail-finance-section .detail-metric strong { color:#f5f5f2 !important; }
:root[data-theme="dark"] .detail-finance-section .detail-metric span,
:root[data-theme="dark"] .detail-finance-section .detail-metric em { color:rgba(245,245,242,.61) !important; }
:root[data-theme="dark"] .detail-section h3,
:root[data-theme="dark"] .profile-section h3,
:root[data-theme="dark"] .team-section h3 { color:#f5f5f2 !important; }
:root[data-theme="dark"] .daily-revenue-head,
:root[data-theme="dark"] .daily-plan-line span { background:#303238; color:#f5f5f2; }
:root[data-theme="dark"] .daily-plan-line span { color:#ffaaa6; }
:root[data-theme="dark"] .chip.active,
:root[data-theme="dark"] .yellow-card,
:root[data-theme="dark"] .status-chip { color:#0b0b0b !important; }
:root[data-theme="dark"] .bottom-nav { background:#202226 !important; border-color:rgba(255,255,255,.15) !important; }
:root[data-theme="dark"] .nav-item.active { color:#0b0b0b; }
:root[data-theme="dark"] .detail-accordion[open] > .accordion-summary { background:#34363b !important; color:#f5f5f2 !important; }
:root[data-theme="dark"] .loading-varochnaya { color:var(--muted); }
:root[data-theme="dark"] .error-icon { color:#0b0b0b; }
@media (min-width:1000px) {
  :root[data-theme="dark"] body,
  :root[data-theme="dark"] .topbar { background:#1c1e22; }
}
/* One inset chevron for native selects, including the compact Telegram layout. */
select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px 8px !important;
}
.metric-meter { height: 5px; margin-top: 10px; border-radius: 5px; background: rgba(128,128,128,.18); overflow: hidden; }
.metric-meter i { display: block; height: 100%; border-radius: inherit; background: #e6b900; }
.owner-settings-button { margin-top:8px; padding:7px 12px; border:1px solid var(--line); border-radius:10px; background:var(--white); color:var(--black); font:inherit; font-size:11px; cursor:pointer; }
.dynamics-period { border:1px solid var(--line); border-radius:16px; margin-top:12px; overflow:hidden; }
.dynamics-period > summary { padding:14px 16px; cursor:pointer; font-weight:700; font-size:12px; background:rgba(255,212,42,.09); }
.dynamics-period[open] > summary { background:rgba(255,212,42,.18); }
.dynamics-period .chart-panel { border:0; }
.customer-change { display:block; font-size:12px; font-weight:700; font-style:normal; text-transform:none; }
.customer-change small { display:block; color:var(--muted); font-size:10px; font-weight:400; margin-top:4px; }
.customer-change.unavailable { font-size:10px; font-weight:400; color:var(--muted); }
.owner-settings-group { margin:12px 0; border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.owner-settings-group > summary { padding:16px; font-weight:700; cursor:pointer; background:rgba(255,212,42,.08); }
.owner-settings-group[open] > summary { background:rgba(255,212,42,.18); }
.owner-settings-group .detail-section { border:0; margin:0; }
.owner-search { width:100%; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--white); color:var(--black); margin:8px 0 14px; font:inherit; }
.owner-form { display:grid; gap:14px; }
.owner-form > label { display:grid; gap:7px; font-size:12px; }
.owner-form input:not([type="checkbox"]), .owner-form select { width:100%; min-width:0; box-sizing:border-box; border:1px solid var(--line); border-radius:10px; padding:12px; background:var(--white); color:inherit; font:inherit; }
.owner-coffee-list { max-height:240px; overflow:auto; margin:0; padding:12px; border:1px solid var(--line); border-radius:12px; }
.owner-coffee-list label { display:flex; gap:10px; align-items:center; padding:9px 0; font-size:11px; }
.owner-coffee-list input { flex:none; width:18px; height:18px; accent-color:#d8a900; }
.owner-help, .owner-form-message { font-size:12px; line-height:1.6; color:var(--muted); }
.owner-user-list > div { display:grid; gap:5px; padding:12px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.owner-user-list span { color:var(--muted); font-size:11px; }
.owner-user-card { border:1px solid var(--line); border-radius:14px; margin:8px 0; overflow:hidden; }
.owner-user-card > summary { cursor:pointer; padding:14px; display:grid; gap:5px; grid-template-columns:1fr auto; }
.owner-user-card > summary::after { content:'⌄'; grid-column:2; grid-row:1 / 3; align-self:center; color:var(--muted); }
.owner-user-card[open] > summary { background:rgba(255,215,36,.13); }
.owner-user-card[open] > summary::after { content:'⌃'; }
.owner-user-card > summary span { grid-column:1; overflow-wrap:anywhere; }
.owner-user-editor, .owner-user-card > .owner-help { padding:0 14px 14px; }
.owner-coffee-list { border:1px solid var(--line); border-radius:12px; max-height:260px; overflow:auto; padding:10px; }
.owner-coffee-list label, .owner-all-confirm { display:flex; align-items:center; gap:10px; padding:7px 0; }
.owner-coffee-list input, .owner-all-confirm input { width:auto; flex:0 0 auto; }
.owner-coffee-list span { font-size:12px; }
.owner-chat-list { display:grid; gap:12px; }
.owner-chat-card { display:grid; min-width:0; gap:11px; padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--white); }
.owner-chat-card.pending { border-color:#d8a900; background:var(--soft-yellow); }
.owner-chat-card > div:first-child { display:grid; gap:4px; }
.owner-chat-card > div:first-child span { color:var(--muted); font-size:10px; overflow-wrap:anywhere; }
.owner-chat-card > label { display:grid; min-width:0; gap:6px; color:var(--black); font-size:11px; font-weight:700; }
.owner-chat-card select { width:100%; min-width:0; box-sizing:border-box; padding:11px 34px 11px 11px; border:1px solid var(--line); border-radius:10px; background-color:var(--white); color:var(--black); font:inherit; }
.owner-chat-card .owner-chat-toggle { display:flex; align-items:center; gap:9px; font-weight:650; }
.owner-chat-toggle input { width:18px; height:18px; flex:none; accent-color:#d8a900; }
.owner-chat-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.owner-chat-actions .review-more, .owner-chat-actions .task-action { margin:0; }
:root[data-theme="dark"] .metric-meter i { background: #ffd42a; }
@media (max-width:430px) {
  .shell { padding-inline:12px; }
  .topbar {
    width:100%;
    min-width:0;
    display:grid;
    grid-template-columns:minmax(90px, 1fr) minmax(0, 175px);
    gap:8px;
  }
  .topbar .brand,
  .topbar .brand-copy { min-width:0; }
  .topbar-select {
    width:100%;
    min-width:0;
    display:grid;
    grid-template-columns:32px minmax(0, 1fr);
    grid-template-rows:auto auto;
    align-items:start;
  }
  #theme-toggle { grid-column:1; grid-row:1 / span 2; }
  #network-select,
  #month-select {
    grid-column:2;
    width:100%;
    min-width:0;
    max-width:none;
  }
  #network-select { grid-row:1; }
  #month-select { grid-row:2; }
  .topbar-select.single-network {
    grid-template-rows:auto;
    align-items:center;
  }
  .topbar-select.single-network #theme-toggle,
  .topbar-select.single-network #month-select {
    grid-row:1;
    align-self:center;
  }
}
@media (max-width:350px) {
  .shell { padding-inline:8px; }
  .topbar { grid-template-columns:38px minmax(0, 1fr); }
  .topbar .brand-copy { display:none; }
}

/* Center the help control on the label's text line, not its inline baseline. */
.hero-content > .metric-label,
.metric-card > span {
  display:flex;
  align-items:center;
  gap:4px;
}
.hero-content > .metric-label .metric-help,
.metric-card > span .metric-help {
  margin-left:0;
  vertical-align:initial;
}

/* LTV closes the full row in both the overview and coffee-shop grids. */
.detail-grid > .detail-metric.ltv-wide {
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
  column-gap:16px;
  align-items:end;
  padding:15px 18px;
}
.detail-metric.ltv-wide > span,
.detail-metric.ltv-wide > strong { grid-column:1; }
.detail-metric.ltv-wide > strong {
  font-size:18px;
  line-height:1.15;
  font-variant-numeric:tabular-nums;
}
.detail-metric.ltv-wide > em {
  grid-column:2;
  grid-row:2;
  justify-self:end;
  max-width:290px;
  margin:0;
  text-align:right;
  line-height:1.45 !important;
}
@media (max-width:600px) {
  .detail-grid > .detail-metric.ltv-wide { grid-template-columns:minmax(0, 1fr); }
  .detail-metric.ltv-wide > em {
    grid-column:1;
    grid-row:auto;
    justify-self:start;
    max-width:none;
    margin-top:7px;
    text-align:left;
  }
}

/* Focused interface refresh: preserve exact values and the existing access rules. */
body { font-family:"Montserrat", ui-sans-serif, sans-serif; }
.brand-copy, .loading-brand, .network-announcement { font-family:"Montserrat", ui-sans-serif, sans-serif; }
.metric-label, .metric-card span, .section-kicker { text-transform:none; letter-spacing:.01em; }
.metric-label, .metric-card span, .section-kicker { font-size:12px; }
.hero-value { font-weight:700; letter-spacing:-.025em; white-space:normal; overflow-wrap:anywhere; font-size:clamp(25px,2.7vw,36px); }
.metric-card strong, .detail-metric strong { font-weight:700; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.profile-strip { z-index:35; margin:0; box-shadow:none; }
.profile-toggle { display:none; }
.profile-content { min-width:0; }
.load-status, .data-freshness {
  margin:0 0 12px; padding:9px 12px; border:1px solid var(--line); border-radius:11px;
  color:var(--muted); background:var(--white); font-size:12px; line-height:1.45;
}
.load-status.load-failed { border-color:var(--risk-high); color:var(--black); }
.load-status button, .error-retry { margin-left:8px; padding:7px 11px; border:0; border-radius:9px; background:var(--yellow); color:#111; font-weight:700; }
.data-freshness { background:transparent; border-color:transparent; padding:3px 0; }
.loading-screen:not(.hidden) { position:fixed; inset:0; z-index:120; background:var(--white); }
.error-screen:not(.hidden) { position:fixed; inset:0; z-index:121; background:var(--white); }
.daily-revenue-day-control { display:grid; grid-template-columns:34px minmax(0,1fr) 34px; align-items:stretch; gap:5px; margin-bottom:8px; }
.daily-revenue-day-control > button { border:1px solid var(--line); border-radius:8px; background:var(--white); color:var(--black); font-size:22px; line-height:1; }
.daily-revenue-day-control > button:disabled { opacity:.35; cursor:default; }
.daily-revenue-readout { margin:0; min-height:36px; display:flex; align-items:center; background:var(--soft); color:var(--black); font-size:11px; font-weight:600; }
.daily-revenue-unit { margin:0 0 3px; color:var(--muted); font-size:10px; }
.daily-revenue-bars { height:260px; overflow:hidden; padding-left:38px; }
.daily-revenue-plot { left:38px; }
.daily-revenue-gridline, .daily-gridline { position:absolute; left:0; right:0; border-top:1px solid var(--line); }
.daily-gridline span { position:absolute; left:-37px; bottom:2px; font-size:9px; color:var(--muted); }
.daily-revenue-column { min-width:0; }
.daily-revenue-column.future .daily-revenue-track > span,
.daily-revenue-column.open .daily-revenue-track > span,
.daily-revenue-column.missing .daily-revenue-track > span { display:none; }
.daily-revenue-column.future { opacity:.45; }
.daily-revenue-column.open { background:rgba(255,212,42,.05); }
.daily-revenue-column.missing { background:repeating-linear-gradient(135deg,transparent 0 5px,rgba(227,79,74,.10) 5px 8px); }
.daily-revenue-column.selected { outline:2px solid var(--yellow); outline-offset:-2px; }
.daily-revenue-column:focus-visible { outline:2px solid var(--black); outline-offset:-2px; }
.daily-revenue-column.selected .daily-revenue-track > span { background:var(--yellow); }
.daily-revenue-column[data-revenue="0"] .daily-revenue-track > span { min-height:0; }
.daily-plan-line { border-top-color:var(--muted); }
.daily-plan-line span { border-color:var(--line); color:var(--black); }
@media (min-width:768px) {
  body, .topbar { background:#f5f5f2; }
  :root[data-theme="dark"] body, :root[data-theme="dark"] .topbar { background:#1c1e22; }
  .shell { width:auto; max-width:none; margin:0 24px 0 224px; padding:20px 0 48px; }
  .view { width:min(100%,1600px); margin-inline:auto; }
  .topbar { position:sticky; top:0; z-index:20; }
  .bottom-nav, .bottom-nav.four-items, .bottom-nav.manager-items {
    position:fixed; top:72px; bottom:auto; left:16px; width:190px; transform:none;
    display:grid; grid-template-columns:1fr; gap:5px; padding:10px;
  }
  .bottom-nav .nav-item { display:grid; grid-template-columns:30px minmax(0,1fr); align-items:center; min-height:44px; text-align:left; }
  .bottom-nav .nav-item small { margin:0; font-size:12px; }
  .profile-strip { position:fixed; left:16px; bottom:16px; width:190px; padding:10px; }
  .profile-content strong { overflow-wrap:anywhere; }
}
@media (min-width:1200px) {
  .shell { margin-left:260px; margin-right:32px; }
  .bottom-nav, .bottom-nav.four-items, .bottom-nav.manager-items, .profile-strip { left:22px; width:214px; }
  #view-overview.active { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:14px; align-items:start; }
  #view-overview > * { min-width:0; grid-column:1 / -1; }
  #view-overview > .hero-card { grid-column:span 4; height:100%; }
  #view-overview > .metric-grid { grid-column:span 8; margin:0; grid-template-columns:repeat(2,minmax(0,1fr)); height:100%; }
  #view-overview > .annual-plan-mini { margin:0; }
  #view-overview > #network-daily-overview { grid-column:span 8; align-self:stretch; display:flex; flex-direction:column; }
  #view-overview > #network-map-card { grid-column:span 4; align-self:stretch; }
  #network-daily-overview > #network-daily-revenue { flex:1; display:flex; flex-direction:column; }
  #network-daily-overview .daily-revenue-chart { flex:1; display:flex; flex-direction:column; }
  #network-daily-overview .daily-revenue-bars { flex:1; min-height:260px; }
  #view-overview > #manager-daily-overview { grid-column:1 / -1; }
}
@media (max-width:767px) {
  .hero-value { font-size:clamp(25px,7vw,32px); }
  .shell { padding-top:8px; }
  .topbar { display:grid; grid-template-columns:minmax(0,1fr) 40px; grid-template-areas:"brand profile" "select select"; gap:7px; align-items:center; }
  .topbar .brand { grid-area:brand; }
  .topbar-select, .topbar-select.single-network { grid-area:select; display:grid; grid-template-columns:36px repeat(2,minmax(0,1fr)); grid-template-rows:44px; gap:7px; width:100%; align-items:center; }
  #theme-toggle, .topbar-select.single-network #theme-toggle { grid-column:1; grid-row:1; align-self:center; width:36px; height:36px; }
  #network-select { grid-column:2; grid-row:1; width:100%; min-width:0; max-width:none; }
  #month-select, .topbar-select.single-network #month-select { grid-column:3; grid-row:1; width:100%; min-width:0; max-width:none; align-self:center; }
  .topbar-select.single-network #month-select { grid-column:2 / 4; }
  #network-select, #month-select { height:40px; font-size:12px; }
  .profile-strip { grid-area:profile; position:relative; width:40px; height:40px; padding:0; border:0; background:transparent; }
  .profile-toggle { display:grid; place-items:center; width:40px; height:40px; border:1px solid var(--line); border-radius:12px; background:var(--white); color:var(--black); font-weight:700; }
  .profile-content { display:none; position:absolute; top:46px; right:0; width:min(260px,calc(100vw - 24px)); padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--white); box-shadow:var(--shadow); }
  .profile-strip.open .profile-content { display:block; }
  .daily-revenue-bars { height:200px; gap:1px; overflow:hidden; }
  .daily-revenue-column { flex:1 1 0; min-width:0; padding-bottom:20px; }
  .daily-revenue-column small { font-size:8px; }
  .daily-revenue-track { inset:0 10% 20px; }
}
@media (max-width:350px) {
  .topbar-select, .topbar-select.single-network { grid-template-columns:36px minmax(0,1fr); grid-template-rows:40px 40px; }
  #theme-toggle, .topbar-select.single-network #theme-toggle { grid-column:1; grid-row:2; }
  #network-select { grid-column:2; grid-row:1; }
  #month-select, .topbar-select.single-network #month-select { grid-column:2; grid-row:2; }
}

/* Fullscreen controls stay next to the brand on every screen size. */
.fullscreen-toggle {
  display:grid; place-items:center; flex:0 0 40px; width:40px; height:40px;
  margin-left:auto; margin-right:8px; padding:8px; border:1px solid var(--line);
  border-radius:12px; background:var(--white); color:var(--black); cursor:pointer;
}
.fullscreen-toggle svg { width:22px; height:22px; }
.fullscreen-toggle[aria-pressed="true"] { background:var(--yellow); color:#151515; }
.fullscreen-toggle:focus-visible { outline:2px solid var(--black); outline-offset:3px; }
.fullscreen-toggle:disabled { opacity:.5; cursor:wait; }
.fullscreen-notice { margin:0 0 12px; padding:10px 12px; border-radius:12px; background:var(--soft-yellow); color:var(--black); font-size:12px; }
@media (max-width:767px) {
  .topbar { grid-template-columns:minmax(0,1fr) 40px 40px; grid-template-areas:"brand fullscreen profile" "select select select"; }
  .fullscreen-toggle { grid-area:fullscreen; margin:0; }
}
:root[data-pulse-fullscreen="true"] {
  --pulse-safe-top:calc(max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
  --pulse-safe-bottom:calc(max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)) + var(--tg-content-safe-area-inset-bottom, 0px));
  --pulse-safe-left:calc(max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px)) + var(--tg-content-safe-area-inset-left, 0px));
  --pulse-safe-right:calc(max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px)) + var(--tg-content-safe-area-inset-right, 0px));
}
:root[data-pulse-fullscreen="true"] body {
  padding-top:var(--pulse-safe-top); padding-left:var(--pulse-safe-left);
  padding-right:var(--pulse-safe-right); padding-bottom:var(--pulse-safe-bottom);
}
:root[data-pulse-fullscreen="true"] .topbar { top:var(--pulse-safe-top); }
/* Frost the Telegram safe area while content scrolls behind the header. */
:root[data-pulse-fullscreen="true"] body::before {
  content:""; position:fixed; inset:0 0 auto; height:var(--pulse-safe-top);
  z-index:19; pointer-events:none;
  background:linear-gradient(180deg,rgba(245,245,242,.88),rgba(245,245,242,.62));
  -webkit-backdrop-filter:blur(24px) saturate(120%);
  backdrop-filter:blur(24px) saturate(120%);
}
:root[data-pulse-fullscreen="true"][data-theme="dark"] body::before {
  background:linear-gradient(180deg,rgba(28,30,34,.88),rgba(28,30,34,.62));
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  :root[data-pulse-fullscreen="true"] body::before { background:rgba(245,245,242,.96); }
  :root[data-pulse-fullscreen="true"][data-theme="dark"] body::before { background:rgba(28,30,34,.96); }
}
@media (max-width:767px) {
  :root[data-pulse-fullscreen="true"] .bottom-nav { bottom:calc(12px + var(--pulse-safe-bottom)); }
  :root[data-pulse-fullscreen="true"] .shell { padding-bottom:calc(110px + var(--pulse-safe-bottom)); }
  /* Frost only the gap below mobile navigation, leaving its buttons crisp. */
  body::after {
    content:""; position:fixed; inset:auto 0 0;
    height:max(10px,env(safe-area-inset-bottom,0px)); z-index:19; pointer-events:none;
    background:linear-gradient(0deg,rgba(245,245,242,.88),rgba(245,245,242,.62));
    -webkit-backdrop-filter:blur(24px) saturate(120%);
    backdrop-filter:blur(24px) saturate(120%);
  }
  :root[data-pulse-fullscreen="true"] body::after { height:calc(12px + var(--pulse-safe-bottom)); }
  :root[data-theme="dark"] body::after { background:linear-gradient(0deg,rgba(28,30,34,.88),rgba(28,30,34,.62)); }
  @supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
    body::after { background:rgba(245,245,242,.96); }
    :root[data-theme="dark"] body::after { background:rgba(28,30,34,.96); }
  }
}
@media (min-width:768px) {
  :root[data-pulse-fullscreen="true"] .bottom-nav { top:calc(72px + var(--pulse-safe-top)); left:calc(16px + var(--pulse-safe-left)); }
  :root[data-pulse-fullscreen="true"] .profile-strip { bottom:calc(16px + var(--pulse-safe-bottom)); left:calc(16px + var(--pulse-safe-left)); }
}
@media (min-width:1200px) {
  :root[data-pulse-fullscreen="true"] .bottom-nav,
  :root[data-pulse-fullscreen="true"] .profile-strip { left:calc(22px + var(--pulse-safe-left)); }
}

.ranking-medal { background:transparent !important; font-size:24px; line-height:1; }
.task-created-at { color:var(--muted); font-size:11px; font-weight:700; }

.profile-name-button { display:block; padding:0; border:0; background:transparent; color:var(--black); font:inherit; font-size:13px; font-weight:800; text-align:left; overflow-wrap:anywhere; cursor:pointer; }
.profile-name-button:hover { color:var(--muted); }
.profile-avatar-change { display:none; }
@media (max-width:767px) {
  .profile-avatar-change { display:block; width:100%; text-align:left; }
}
.avatar-picker select { width:100%; margin-top:8px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--white); color:var(--black); font:inherit; font-size:16px; }
.avatar-actions { display:flex; justify-content:flex-end; gap:8px; }
.avatar-status { color:var(--muted); font-size:12px; }
.owner-user-card .owner-avatar { display:inline-grid; place-items:center; width:30px; height:30px; margin-right:8px; border:1px solid var(--line); border-radius:9px; background:var(--white); font-size:20px; }
@media (min-width:768px) {
  .profile-strip { display:flex; gap:10px; align-items:center; }
  .profile-strip .profile-toggle { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; padding:0; border:1px solid var(--line); border-radius:12px; background:var(--white); color:var(--black); font-size:23px; cursor:pointer; }
}

/* Give the persistent controls a defined edge in both themes. */
.topbar {
  padding:10px 14px;
  margin-bottom:16px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:18px;
  background:#fafaf8;
  box-shadow:0 3px 14px rgba(0,0,0,.035);
}
:root[data-theme="dark"] .topbar {
  border-color:rgba(255,255,255,.16);
  background:#25272b;
  box-shadow:0 3px 14px rgba(0,0,0,.12);
}
@media (max-width:767px) {
  .topbar { padding:9px 10px; border-radius:16px; }
}

/* Administrator development pilot. */
.development-section { border-color:rgba(220,178,0,.6); }
.development-section > summary small { display:block; margin-top:5px; color:inherit; opacity:.8; font-size:10px; font-weight:500; text-transform:none; }
.development-body, .innovation-body, .innovation-summary-body { min-width:0; font-size:12px; line-height:1.55; }
.development-body p, .innovation-body p { margin:9px 0; }
.development-muted { color:var(--muted); font-size:11px; line-height:1.5; }
.development-warning { color:var(--black); background:var(--soft-yellow); border-left:3px solid #c48e00; padding:10px; border-radius:8px; }
.development-intro { padding:14px; background:var(--soft); border:1px solid var(--line); border-radius:14px; }
.development-intro-heading { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; }
.development-intro-heading > span { border-radius:999px; padding:5px 9px; background:var(--soft-yellow); font-weight:750; font-size:10px; }
.development-intro > strong { font-size:16px; }
.development-intro > small, .development-effect > small { display:block; margin:6px 0; color:var(--muted); }
.development-methodology { margin-top:10px; border-top:1px solid var(--line); padding-top:9px; }
.development-methodology > summary { cursor:pointer; font-size:11px; font-weight:750; }
.development-methodology > small { display:block; margin-top:6px; color:var(--muted); }
.development-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.development-actions .review-more { margin:0; }
.development-filters, .development-calculator-inputs { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:14px 0; }
.development-filters label, .development-calculator label, .innovation-form label { display:grid; gap:6px; min-width:0; font-size:11px; font-weight:650; }
.development-filters input, .development-filters select, .development-calculator input, .innovation-form input, .innovation-form select {
  width:100%; min-width:0; max-width:100%; box-sizing:border-box; padding:10px; border:1px solid var(--line); border-radius:9px;
  color:var(--black); background-color:var(--white); font:inherit; min-height:40px;
}
.development-calculator, .development-existing { margin:12px 0; padding:12px; border:1px solid var(--line); border-radius:12px; }
.development-calculator > summary, .development-existing > summary, .innovation-history > summary { cursor:pointer; font-weight:750; }
.development-calculator-result { font-weight:750; }
.development-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; align-items:start; }
.development-hypothesis { border:1px solid var(--line); border-left:3px solid var(--line); border-radius:12px; background:var(--white); overflow:hidden; min-width:0; box-shadow:0 2px 8px rgba(0,0,0,.035); }
.development-hypothesis-urgent { border-left-color:var(--yellow); }
.development-hypothesis > summary { cursor:pointer; padding:13px; display:list-item; list-style-position:inside; }
.development-hypothesis > summary > strong { display:block; margin:5px 0; font-size:14px; line-height:1.35; }
.development-hypothesis > summary > span:last-child { display:block; color:var(--muted); font-size:10px; }
.development-hypothesis > summary > .development-summary-evidence { display:block; color:var(--black); font-size:11px; line-height:1.4; margin:0 0 6px; font-weight:500; }
.development-show-more { grid-column:1 / -1; min-height:42px; border:1px dashed var(--line); border-radius:11px; background:var(--soft); color:var(--black); font:inherit; font-weight:700; cursor:pointer; }
.development-priority { color:var(--muted); font-size:10px; font-weight:700; }
.development-hypothesis[open] > summary { border-bottom:1px solid var(--line); background:var(--soft); }
.development-hypothesis-body { padding:0 13px 14px; overflow-wrap:anywhere; }
.development-hypothesis-body h4 { margin:14px 0 5px; font-size:11px; text-transform:uppercase; letter-spacing:.03em; }
.development-hypothesis-body ul { padding-left:18px; margin:7px 0; }
.development-hypothesis-body li { margin:5px 0; }
.development-hypothesis-body blockquote { margin:10px 0; border-left:3px solid var(--yellow); padding:10px; background:var(--soft); font-size:11px; }
.development-hypothesis-body blockquote small { display:block; margin-top:6px; color:var(--muted); }
.development-hypothesis-body a { color:var(--black); text-decoration:underline; }
.development-effect { margin:12px 0; padding:12px; border-radius:10px; background:var(--soft-yellow); }
.development-effect > strong { font-size:14px; }
.innovation-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:10px 0; }
.innovation-chip, .innovation-total { display:flex; flex-direction:column; align-items:flex-start; gap:6px; border:1px solid var(--line); border-radius:12px; padding:12px; background:var(--white); color:var(--black); text-align:left; font:inherit; min-width:0; overflow-wrap:anywhere; }
.innovation-chip { cursor:pointer; }
.innovation-chip:focus-visible { outline:2px solid var(--black); outline-offset:2px; }
.innovation-chip.implemented { border-color:#43a66d; background:rgba(67,166,109,.08); }
.innovation-chip.unknown { border-style:dashed; }
.innovation-chip strong { font-size:11px; line-height:1.35; }
.innovation-chip small { font-size:10px; color:var(--muted); }
.innovation-icon { font-size:19px; line-height:1; display:flex; align-items:center; gap:7px; }
.innovation-icon b { font-size:15px; }
.innovation-chip.implemented .innovation-icon b { color:#328451; }
.innovation-form { display:grid; gap:12px; padding:13px; border:1px solid var(--line); border-radius:12px; background:var(--soft); }
.innovation-form > small { color:var(--muted); }
.innovation-form button:disabled { opacity:.5; cursor:wait; }
.innovation-history { margin-top:12px; font-size:11px; }
.innovation-history p { padding:9px 0; border-bottom:1px solid var(--line); }
.innovation-total > strong { font-size:23px; }
.innovation-total small { color:var(--muted); font-size:10px; }
.innovation-total progress { accent-color:#caa700; width:100%; height:7px; border:0; }
.innovation-history-table { max-width:100%; overflow-x:auto; margin:12px 0; }
.innovation-history-table table { width:100%; border-collapse:collapse; font-size:11px; }
.innovation-history-table caption { text-align:left; font-weight:750; margin-bottom:8px; }
.innovation-history-table td, .innovation-history-table th { padding:8px; border-bottom:1px solid var(--line); text-align:left; }
@media (max-width:650px) {
  .innovation-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .development-filters, .development-calculator-inputs { grid-template-columns:minmax(0,1fr); }
  .development-body, .innovation-body { font-size:11.5px; }
  .development-list { grid-template-columns:minmax(0,1fr); }
}

/* Compact overview, matching the original plan typography. */
#view-overview .hero-value, #view-overview .metric-card strong {
  font-family:"Montserrat", ui-sans-serif, sans-serif;
  font-weight:850; letter-spacing:-.03em; font-variant-numeric:normal;
}
.dynamics-period-body { padding:16px; }
.dynamics-period-body > .comparison-note { margin:0; line-height:1.5; }
.dynamics-period-body > .chart-panel { padding:0; margin:0; }
.unit-revenue-label { white-space:nowrap; letter-spacing:0; }
#summary-revenue-per-shop { white-space:nowrap; }
#view-overview > .data-freshness { margin:20px 0 0; padding-top:12px; border-top:1px solid var(--line); }
.daily-revenue-readout { margin-top:10px; }
#innovation-network-summary {
  margin:16px 0; border:1px solid rgba(220,178,0,.55);
  border-left:4px solid var(--yellow); background:var(--soft-yellow);
}
#innovation-network-summary > summary { background:transparent; color:var(--black); padding:16px; }
#innovation-network-summary > summary .accordion-chevron { background:var(--yellow); color:#111; }
:root[data-theme] #innovation-network-summary {
  background:var(--soft-yellow) !important;
  border-color:rgba(220,178,0,.55) !important;
  border-left-color:var(--yellow) !important;
}
:root[data-theme] #innovation-network-summary > summary { background:transparent !important; color:var(--black) !important; }
@media (max-width:430px) {
  #view-overview .metric-card strong { font-size:clamp(17px,5.3vw,22px); }
  #view-overview .unit-revenue-label { font-size:10px; }
}

/* Let the shop's task panel stand apart from the surrounding neutral sections. */
:root[data-theme="light"] .detail-section.detail-tasks-section {
  border-width:2px !important;
  border-color:rgba(212,160,15,.78) !important;
  box-shadow:0 12px 28px rgba(29,27,18,.13), 0 2px 5px rgba(29,27,18,.05);
}
:root[data-theme="dark"] .detail-section.detail-tasks-section {
  border-width:2px !important;
  border-color:rgba(255,211,59,.72) !important;
  box-shadow:0 12px 28px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.18);
}

/* The monthly review is one compact row until explicitly opened. */
.monthly-review { margin:14px 0; border:1px solid var(--line); border-radius:20px; background:var(--white); overflow:hidden; }
.monthly-review > summary { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:17px 18px; cursor:pointer; list-style:none; background:linear-gradient(110deg,var(--soft-yellow),var(--white) 75%); }
.monthly-review > summary::-webkit-details-marker { display:none; }
.monthly-review > summary strong, .monthly-review > summary small { display:block; }
.monthly-review > summary strong { margin:5px 0; font-size:16px; }
.monthly-review > summary small { color:var(--muted); font-size:11px; }
.monthly-review-arrow { display:grid; place-items:center; flex:0 0 32px; height:32px; border-radius:50%; background:var(--yellow); color:#151515; font-size:20px; transition:transform .2s; }
.monthly-review[open] .monthly-review-arrow { transform:rotate(180deg); }
.monthly-review > summary:focus-visible { outline:2px solid var(--yellow); outline-offset:-3px; }
.monthly-review-body { padding:0 18px 18px; font-size:12px; line-height:1.55; }
.monthly-review-verdict { padding:18px 0 14px; border-top:1px solid var(--line); }
.monthly-review-verdict h3 { font-size:20px; line-height:1.25; margin:6px 0; }
.monthly-review-verdict p { color:var(--muted); margin:8px 0; }
.monthly-review-badge { display:inline-block; border:1px solid var(--line); border-radius:20px; padding:5px 9px; font-size:10px; }
.monthly-review-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:6px 0 20px; }
.monthly-review-metric { min-width:0; padding:12px; border-radius:13px; background:var(--soft); }
.monthly-review-metric span,.monthly-review-metric small { display:block; color:var(--muted); font-size:10px; }
.monthly-review-metric strong { display:block; margin:5px 0; font-size:18px; overflow-wrap:anywhere; }
.monthly-review-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.monthly-review-body h3 { margin:10px 0; }
.monthly-review-cafe { display:flex; align-items:start; justify-content:space-between; gap:10px; width:100%; padding:12px 0; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--black); font:inherit; text-align:left; cursor:pointer; }
.monthly-review-cafe > span { min-width:0; flex:1; }
.monthly-review-cafe > span:last-child { text-align:right; }
.monthly-review-cafe small { display:block; font-size:10px; color:var(--muted); overflow-wrap:anywhere; }
.monthly-review-cafe b { white-space:nowrap; }
.monthly-review-priorities { margin-top:20px; }
.monthly-review-priorities article { display:flex; gap:12px; border-top:1px solid var(--line); padding:14px 0; }
.monthly-review-priorities article > div { min-width:0; }
.monthly-review-number { flex:0 0 32px; font-size:20px; font-weight:800; color:var(--muted); }
.monthly-review-priorities h4 { margin:0; font-size:13px; }
.monthly-review-priorities h4 small { font-weight:500; color:var(--muted); }
.monthly-review-priorities p { margin:7px 0; }
.monthly-review-evidence { color:var(--muted); font-size:11px; }
.monthly-review-method { padding:12px; border-radius:12px; background:var(--soft); color:var(--muted); font-size:11px; }
.monthly-review-method > summary { cursor:pointer; font-weight:600; }
@media (max-width:900px) {
  .monthly-review-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .monthly-review-columns { grid-template-columns:1fr; gap:8px; }
}
@media (max-width:430px) {
  .monthly-review > summary { padding:15px 12px; }
  .monthly-review-body { padding:0 12px 14px; }
  .monthly-review-metric { padding:10px; }
  .monthly-review-metric strong { font-size:16px; }
  .monthly-review-cafe { flex-direction:column; gap:4px; }
  .monthly-review-cafe > span:last-child { text-align:left; }
}


/* October: clearer hierarchy, readable labels and compact comparison. */
:root { --muted: #60615d; --shadow: 0 5px 18px rgba(11,11,11,.055); }
html, body { min-height:100vh; background:var(--soft-gray); }
:root[data-theme="dark"] { --muted:#b9bbc1; --shadow:0 5px 18px rgba(0,0,0,.18); }
.overview-heading { margin:4px 0 18px; }
.overview-heading h2 { margin:0 0 5px; font-size:26px; font-weight:700; letter-spacing:-.03em; }
.overview-heading p { margin:0; color:var(--muted); font-size:11px; line-height:1.4; }
.metric-card span, .section-kicker { font-size:13px; font-weight:600; letter-spacing:.025em; }
.hero-value { font-weight:700; }
.shop-card strong, .risk-name { font-size:14px; font-weight:600; line-height:1.45; }
.shop-card .shop-revenue { font-size:22px; font-weight:700; }
.risk-reason, .data-freshness, .comparison-note, .page-title p { font-size:13px; line-height:1.5; }
.rank-name, .rank-value { font-size:13px; font-weight:600; }
.detail-accordion > summary { min-height:44px; }
.previous-month-total { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; padding:12px 0 16px; margin-bottom:12px; border-bottom:1px solid var(--line); }
.previous-month-total span { font-size:14px; font-weight:600; }
.previous-month-total small { display:block; color:var(--muted); font-size:13px; font-weight:400; margin-top:4px; }
.previous-month-total strong { font-size:20px; font-weight:700; font-variant-numeric:tabular-nums; }
.risk-stat.risk-stat-total { background:var(--white); color:var(--black); border-color:var(--line); }
.risk-stat.risk-stat-attention { background:var(--soft-yellow); color:var(--black); border-color:var(--line); }
.risk-stat.risk-stat-stable { background:color-mix(in srgb,var(--risk-stable) 15%,var(--white)); color:var(--black); border-color:var(--line); }
.risk-stat span { opacity:1; font-size:12px; }
.shop-card .shop-revenue, .detail-metric strong, .metric-card strong, .risk-stat strong,
.hero-value, .hero-plan-block strong, .hero-plan-percent, .metric-bar-value, .compare-value,
.revenue-history-summary strong, .previous-month-total strong, .rank-value,
.customer-change, .shop-meta .pill {
  font-family:"Montserrat", ui-sans-serif, sans-serif;
  font-weight:850; letter-spacing:-.03em; font-variant-numeric:normal;
}
:root[data-theme="dark"] .risk-stat.risk-stat-attention,
:root[data-theme="dark"] .risk-stat.risk-stat-stable { color:#fff; }
@media(max-width:600px) {
  .overview-heading h2 { font-size:23px; }
  .overview-heading { margin-bottom:14px; }
  .previous-month-total strong { font-size:19px; }
}

/* Brand illustrations share the profile card baseline on desktop. */
.sidebar-art { display:none; pointer-events:none; user-select:none; }
@media (min-width:768px) and (min-height:681px) {
  .sidebar-art { display:flex; position:absolute; bottom:100%; left:0; width:100%; padding:0 10px 4px; justify-content:center; align-items:flex-end; }
  .sidebar-art img { display:block; width:100%; height:auto; max-height:176px; object-fit:contain; object-position:center bottom; }
  .sidebar-art[data-art="overview"] img { width:142px; }
}

:root[data-theme="dark"] .ranking-chart-row:not(.ranking-own) { border-color:transparent !important; }
