/* Componentes de interação do portal ZBN. */
.product-dialog{position:fixed;inset:0;margin:auto;max-width:min(640px,calc(100vw - 32px));max-height:calc(100dvh - 40px);box-shadow:0 24px 80px #0005;overscroll-behavior:contain}
.product-dialog[open]{animation:productEnter .18s ease-out}
@keyframes productEnter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.chart-tooltip{position:fixed;inset:auto;left:0;top:0;right:auto;bottom:auto;z-index:1100;max-width:min(290px,calc(100vw - 24px));width:max-content;white-space:normal;pointer-events:none;box-shadow:0 6px 24px #0002;transition:transform 80ms ease-out;will-change:transform}
.chart-tooltip strong{display:block;font-size:11px;color:var(--frappe-text-muted);margin-bottom:8px;font-weight:500}
.chart-tooltip .tip-row{display:flex;align-items:center;gap:8px;justify-content:space-between;font-size:12px;margin-top:6px}
.chart-tooltip .tip-row b{margin-left:12px;white-space:nowrap}.tip-swatch{width:7px;height:7px;border-radius:50%;display:inline-block;flex:none;background:var(--frappe-blue)}
.heatmap-scroll{overflow:visible;min-width:0}.heatmap-grid{min-width:0;width:100%;grid-template-columns:var(--heat-label,98px) repeat(var(--heat-hours,24),minmax(0,1fr)) var(--heat-total,50px);gap:6px 2px;padding:0;align-items:center}
.heatmap-cell{min-width:0;width:100%;height:auto;aspect-ratio:1;max-height:36px;cursor:pointer;outline-offset:0}
.heatmap-cell i{width:var(--dot-scale,65%);height:auto;aspect-ratio:1;max-width:24px;max-height:24px;transition:transform .18s ease,background .18s ease;background:var(--dot-color)}
.heatmap-cell:hover i,.heatmap-cell:focus-visible i{transform:scale(1.12);outline:2px solid var(--frappe-blue);outline-offset:2px}
.heatmap-label{min-width:0;font-size:10px;line-height:1.25}.heatmap-caption{font-size:11px;font-weight:600;color:var(--frappe-text-secondary);margin:18px 0 8px}.heatmap-grid+.heatmap-caption{margin-top:24px}
.heatmap-legend{gap:18px;margin-top:20px}.distribution-content{min-width:0}.distribution-stat{min-width:0}.distribution-stats{gap:18px}
.ring-chart{position:relative;width:126px;height:126px;flex:0 0 126px;display:grid;place-items:center}
.ring-chart svg{width:100%;height:100%;overflow:visible}.ring-segment{stroke:var(--frappe-bg-card);stroke-width:2;stroke-linejoin:round;cursor:pointer;transform-origin:60px 60px;transition:transform .2s ease,filter .2s ease;outline:none}
.ring-segment:hover,.ring-segment:focus-visible{transform:translate(var(--shift-x),var(--shift-y));filter:brightness(1.08)}
.ring-center{position:absolute;inset:35%;display:flex;align-items:center;justify-content:center;flex-direction:column;font-size:9px;color:var(--frappe-text-muted);pointer-events:none}.ring-center b{font-size:15px;color:var(--frappe-text-primary)}
.brand-mix .ring-chart{width:150px;height:150px;flex-basis:150px}.buyer-legend i{background:var(--frappe-blue)}
@media(max-width:760px){.distribution-content{padding:18px 14px}.distribution-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.distribution-stat{border:0;padding:0}.distribution-stat strong{font-size:16px}.buyer-layout{gap:20px}.buyer-layout .distribution-stats{flex:1;min-width:210px}.heatmap-grid{--heat-label:58px;--heat-total:38px}.heatmap-label{font-size:9px}.heatmap-legend{gap:12px}}
@media(prefers-reduced-motion:reduce){.ring-segment,.chart-tooltip{transition:none}.product-dialog[open]{animation:none}}

/* Proporções compactas, como a referência fornecida; identidade ZBN. */
.brand-logo-img{width:58px!important;height:58px!important;max-width:none!important;flex:none}
.logo-light{display:none}body.frappe-light .logo-light{display:block}body.frappe-light .logo-dark{display:none}
.ring-chart,.brand-mix .ring-chart{width:114px;height:114px;flex-basis:114px}
.ring-segment{stroke:none;stroke-width:0}.ring-center{display:none}
.buyer-layout{gap:32px;flex-wrap:nowrap}.buyer-layout .distribution-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;min-width:0}.buyer-layout .distribution-stat{padding:0 22px;min-width:0}.buyer-layout .distribution-stat:first-child{padding-left:0}.buyer-layout .distribution-stat:last-child{padding-right:0}.buyer-layout .distribution-stat label{line-height:1.5;white-space:normal;display:flex;gap:5px;align-items:center;flex-wrap:wrap}.buyer-layout .distribution-stat strong{display:inline-block;font-size:19px}.buyer-layout .metric-change{display:inline-flex;gap:3px;margin-left:7px;white-space:nowrap}.buyer-stat-dot{width:7px;height:7px;border-radius:50%;display:inline-block;flex:none}.buyer-legend{display:none}.buyer-layout .ring-chart{margin:2px 0}
.heatmap-grid{gap:2px 2px;grid-template-columns:var(--heat-label,98px) repeat(var(--heat-hours,24),minmax(0,1fr)) var(--heat-total,50px);position:relative}
.heatmap-cell{height:36px;aspect-ratio:auto;position:relative}.heatmap-cell:before{content:'';position:absolute;left:0;right:0;top:50%;height:1px;background:var(--frappe-border-light);z-index:0}.heatmap-cell i{position:relative;z-index:1;width:min(var(--dot-size),85%);max-width:24px;height:auto;aspect-ratio:1;max-height:24px;flex:none}
.heatmap-label{text-align:left}.heatmap-cell:hover i,.heatmap-cell:focus-visible i{outline-offset:2px}
.brand-mix{gap:24px}.brand-legend button{min-width:0}
@media(max-width:1000px){.buyer-layout{gap:20px}.buyer-layout .distribution-stat{padding:0 12px}.buyer-layout .distribution-stat strong{font-size:17px}.buyer-layout .metric-change{display:flex;margin:5px 0 0}.buyer-layout .distribution-stat label{font-size:10px}}
@media(max-width:650px){.buyer-layout{flex-wrap:wrap;gap:18px}.buyer-layout .distribution-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;flex-basis:100%;min-width:0}.buyer-layout .distribution-stat{border:0;padding:0}.buyer-layout .ring-chart{margin:0 auto}.brand-mix{flex-wrap:wrap}.heatmap-cell{height:28px}.heatmap-label{font-size:9px}}

.brand-filter-controls{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}.brand-filter-controls button{font-size:11px;padding:6px 10px}.brand-filter-controls button:disabled{opacity:.45;cursor:default}.brand-legend button[aria-pressed=true]{background:var(--frappe-bg-hover);border-radius:5px}.brand-mix .ring-segment:focus-visible{filter:brightness(1.18);outline:1px solid var(--frappe-blue)}
@media(max-width:650px){.brand-filter-controls{justify-content:flex-start;width:100%;gap:8px}.brand-filter-controls .hint{flex:1}}

/* Fixed chart geometry: the number of visible brands never resizes the plot. */
.analysis-bottom>.frappe-panel{min-width:0}
.stable-brand-panel>.frappe-panel-head{height:54px;min-height:54px;box-sizing:border-box;flex-wrap:nowrap;gap:12px}
.stable-brand-panel .brand-mix{display:grid;grid-template-columns:114px minmax(0,1fr);grid-template-rows:190px;align-items:center;gap:24px;padding:22px;height:234px;min-height:234px;box-sizing:border-box}
.stable-brand-panel .ring-chart{width:114px;height:114px;margin:0;justify-self:start;align-self:center}
.stable-brand-panel .brand-legend{max-height:190px;min-width:0;overflow-x:hidden;overflow-y:auto;scrollbar-gutter:stable;align-self:center}
.stable-brand-panel .brand-legend button span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stable-brand-panel .brand-filter-controls{min-width:0;flex-wrap:nowrap}
.stable-brand-panel .brand-filter-status{max-width:175px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stable-brand-panel .brand-filter-controls button{flex:none}
@media(max-width:650px){.stable-brand-panel>.frappe-panel-head{height:88px;min-height:88px;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px}.stable-brand-panel .brand-mix{grid-template-columns:114px minmax(0,1fr);gap:14px;padding:15px;height:220px;min-height:220px}.stable-brand-panel .brand-filter-controls{width:100%}.stable-brand-panel .brand-filter-status{max-width:none;flex:1}.stable-brand-panel .brand-legend button{font-size:11px}}
