/* MSNBOT 4.3 — painel fluido, velocímetros duplos e rotação responsiva. */
:root{
  --d43-card-pad:clamp(13px,1.05vw,20px);
  --d43-gap:clamp(9px,.8vw,15px);
  --d43-gauge-face:#f8fafc;
  --d43-gauge-line:#172238;
  --d43-gauge-muted:#7d899d;
}

html[data-theme="dark"]{
  --d43-gauge-face:#101721;
  --d43-gauge-line:#f4f7fb;
  --d43-gauge-muted:#9eacc1;
}
html[data-theme="dark"] .d43-dashboard .up{color:#63e0b0}
html[data-theme="dark"] .d43-dashboard .down{color:#ff8d98}

body:has(.d43-dashboard) .page:not(.auth-page){
  width:calc(100% - clamp(20px,2.8vw,72px))!important;
  max-width:none!important;
  margin-inline:auto!important;
}

.d43-dashboard{width:100%;max-width:none;min-width:0}
.d43-dashboard :is(.d42-period,.d42-overview,.d42-kpis,.d42-comparison,.d42-finance,.d42-health){max-width:none}
.d43-dashboard :is(h2,h3){letter-spacing:-.025em}
.d43-dashboard .d42-overview{grid-template-columns:minmax(530px,1.5fr) minmax(230px,.72fr) minmax(280px,.92fr);gap:var(--d43-gap)}
.d43-dashboard .d42-overview article{min-height:276px;padding:var(--d43-card-pad)}
.d43-dashboard .d42-overview h2{font-size:clamp(16px,1.05vw,19px)}
.d43-dashboard .d42-overview header small{font-size:clamp(10px,.7vw,12px)}

.d43-speed{display:flex;flex-direction:column}
.corvette-gauges{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(9px,1.2vw,22px);align-items:end;flex:1;margin-top:8px}
.corvette-unit{min-width:0;display:grid;align-content:end}
.corvette-gauge{
  --gauge-accent:#2f7cf4;
  width:min(100%,330px);
  aspect-ratio:1.78/1;
  margin:auto;
  position:relative;
  overflow:hidden;
  border:1px solid var(--d42-line);
  border-radius:260px 260px 18px 18px;
  background:
    radial-gradient(circle at 50% 100%,transparent 0 21%,var(--d43-gauge-face) 21.5% 44%,transparent 44.5%),
    repeating-conic-gradient(from 244deg at 50% 100%,var(--d43-gauge-line) 0 1.15deg,transparent 1.35deg 7deg),
    radial-gradient(circle at 50% 100%,color-mix(in srgb,var(--gauge-accent),transparent 88%),var(--d43-gauge-face) 70%);
  box-shadow:inset 0 -20px 34px color-mix(in srgb,var(--gauge-accent),transparent 92%),0 8px 24px rgba(19,34,65,.08);
}
.corvette-gauge:before{
  content:"";
  position:absolute;
  inset:8px 8px 0;
  border:clamp(3px,.32vw,5px) solid transparent;
  border-top-color:var(--gauge-accent);
  border-radius:250px 250px 0 0;
  filter:drop-shadow(0 0 7px color-mix(in srgb,var(--gauge-accent),transparent 42%));
}
.corvette-gauge:after{
  content:"";
  position:absolute;
  left:50%;bottom:0;
  width:29%;height:8%;
  translate:-50% 0;
  background:linear-gradient(90deg,transparent,var(--gauge-accent),transparent);
  opacity:.34;
  filter:blur(9px);
}
.gauge-returning{--gauge-accent:#ef4d57}
.corvette-gauge .gauge-scale{position:absolute;inset:18% 13% auto;height:1px;background:linear-gradient(90deg,transparent,var(--d43-gauge-muted),transparent);opacity:.45}
.corvette-gauge .needle{
  position:absolute;
  left:50%;bottom:7%;
  width:39%;height:3px;
  border-radius:999px;
  background:linear-gradient(90deg,#e7edf7 0 7%,var(--gauge-accent) 25% 100%);
  transform-origin:left center;
  transform:rotate(-112deg);
  transition:transform .85s cubic-bezier(.18,.82,.2,1.08);
  box-shadow:0 0 9px color-mix(in srgb,var(--gauge-accent),transparent 24%);
  z-index:3;
}
.corvette-gauge.is-ready .needle{transform:rotate(var(--needle))}
.corvette-gauge>i{position:absolute;left:50%;bottom:7%;width:15px;height:15px;translate:-50% 50%;border:4px solid var(--d43-gauge-face);border-radius:50%;background:var(--gauge-accent);box-shadow:0 0 0 2px var(--d42-line),0 0 12px color-mix(in srgb,var(--gauge-accent),transparent 32%);z-index:4}
.corvette-gauge .gauge-value{position:absolute;inset:auto 10px 15%;text-align:center;z-index:2}
.corvette-gauge .gauge-value strong{font:900 clamp(27px,2.1vw,42px)/.95 Montserrat,system-ui,sans-serif;letter-spacing:-.08em;display:block}
.corvette-gauge .gauge-value small{display:block;margin-top:4px;color:var(--d42-sub);font-size:clamp(9px,.62vw,11px);font-weight:750}
.corvette-unit footer{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:6px;font-size:clamp(9px,.62vw,11px)}
.corvette-unit footer span{font-weight:900}
.corvette-unit footer small{color:var(--d42-sub)}

.d43-dashboard .d42-kpis{gap:var(--d43-gap)}
.d43-dashboard .d42-kpis>a{padding:clamp(12px,.86vw,16px);min-width:0}
.d43-dashboard .d42-kpis small{font-size:clamp(10px,.66vw,12px)}
.d43-dashboard .d42-kpis strong{font-size:clamp(25px,1.8vw,31px)}
.d43-dashboard .d42-kpis em{font-size:clamp(9px,.61vw,11px)}
.d43-dashboard :is(.d42-comparison,.d42-finance){padding:clamp(15px,1.2vw,21px)}
.d43-dashboard .comparison-stage{min-height:230px;padding:clamp(10px,1.1vw,18px)}
.d43-dashboard :is(.comparison-number strong,.comparison-previous strong){font-size:clamp(38px,3vw,52px)}
.d43-dashboard .comparison-bars{height:185px}
.d43-dashboard .finance-stats>div{padding:clamp(10px,.85vw,14px)}
.d43-dashboard .finance-stats strong{font-size:clamp(23px,1.65vw,28px)}
.d43-dashboard .receipt-bars{height:170px}

.auth-card-v41 .trust-device-choice{display:flex!important;align-items:center;gap:9px;margin:13px 0 4px!important;font-size:14px;font-weight:750;line-height:1.25;cursor:pointer}
.auth-card-v41 .trust-device-choice input{appearance:auto!important;width:18px!important;height:18px!important;min-width:18px;margin:0!important;padding:0!important;border-radius:3px!important;accent-color:var(--accent,var(--blue,#2777f5))}
.auth-card-v41 .trust-device-choice span,.auth-card-v41 .trust-device-choice strong{display:block}

@media(min-width:1800px){
  .d43-dashboard .d42-overview{grid-template-columns:minmax(640px,1.65fr) minmax(290px,.72fr) minmax(360px,.94fr)}
  .d43-dashboard .d42-overview article{min-height:290px}
  .d43-dashboard .d42-kpis{grid-template-columns:repeat(5,minmax(180px,1fr))}
  .d43-dashboard .comparison-stage{grid-template-columns:minmax(210px,.7fr) minmax(520px,1.8fr) minmax(210px,.7fr)}
}

@media(min-width:2400px){
  body:has(.d43-dashboard) .page:not(.auth-page){width:calc(100% - 96px)!important}
  .d43-dashboard .d42-overview{grid-template-columns:minmax(760px,1.75fr) minmax(360px,.78fr) minmax(440px,1fr)}
  .corvette-gauge{width:min(100%,390px)}
}

@media(max-width:1180px){
  .d43-dashboard .d42-overview{grid-template-columns:repeat(2,minmax(0,1fr))}
  .d43-dashboard .d42-speed{grid-column:1/-1}
  .d43-dashboard .d42-overview article{min-height:245px}
}

@media(max-width:700px){
  body:has(.d43-dashboard) .page:not(.auth-page){width:100%!important;margin-inline:0!important;padding-inline:clamp(7px,2.4vw,12px)!important}
  .d43-dashboard .d42-overview{display:grid;grid-template-columns:1fr;gap:8px}
  .d43-dashboard .d42-speed{grid-column:auto}
  .d43-dashboard .d42-overview article{display:block;min-height:0;margin:0;padding:12px}
  .d43-dashboard .d42-origin{display:block}
  .corvette-gauges{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:6px}
  .corvette-gauge{border-radius:180px 180px 12px 12px}
  .corvette-gauge .gauge-value strong{font-size:clamp(24px,8vw,32px)}
  .corvette-gauge .gauge-value small{font-size:clamp(8px,2.4vw,10px)}
  .corvette-gauge>i{width:11px;height:11px;border-width:3px}
  .corvette-unit footer{gap:5px;font-size:9px}
  .d43-dashboard .d42-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .d43-dashboard .d42-kpis>a:first-child{grid-column:1/-1}
  .d43-dashboard .d42-kpis>a{min-height:88px;padding:11px}
  .d43-dashboard .d42-kpis strong{font-size:24px}
  .d43-dashboard .comparison-stage{min-height:210px}
  .d43-dashboard .comparison-bars{height:125px}
  .d43-dashboard .finance-stats{grid-template-columns:1fr;gap:6px}
}

@media(max-width:360px){
  .corvette-gauges{grid-template-columns:1fr}
  .corvette-gauge{max-width:255px}
}

@media(orientation:landscape) and (max-height:620px){
  body:has(.d43-dashboard) .page:not(.auth-page){width:100%!important;padding:7px 10px!important}
  .d43-dashboard .d42-period{grid-template-columns:auto minmax(180px,1fr) auto;gap:10px;padding:9px 12px;margin-bottom:8px}
  .d43-dashboard .d42-overview{display:grid;grid-template-columns:minmax(430px,1.45fr) minmax(180px,.65fr) minmax(220px,.82fr);gap:8px}
  .d43-dashboard .d42-speed{grid-column:auto}
  .d43-dashboard .d42-overview article{min-height:218px;padding:10px;margin:0}
  .corvette-gauges{gap:8px;margin-top:2px}
  .corvette-gauge{max-width:245px}
  .corvette-gauge .gauge-value strong{font-size:28px}
  .d43-dashboard .d42-kpis{grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin:8px 0}
  .d43-dashboard .d42-kpis>a:first-child{grid-column:auto}
  .d43-dashboard .d42-kpis>a{min-height:76px;padding:9px}
  .d43-dashboard .d42-kpis strong{font-size:22px;margin:2px 0}
  .d43-dashboard .d42-comparison,.d43-dashboard .d42-finance{margin:8px 0}
}

body.reduce-motion .corvette-gauge .needle{transition:none}
@media(prefers-reduced-motion:reduce){.corvette-gauge .needle{transition:none}}
