/* Wide-screen presentation. Plain selectors also work on older TV engines. */
@media(min-width:701px){
  html body.ui-refined .app{padding:28px 32px 40px !important;}
  html body.ui-refined .shell{width:100% !important;max-width:1440px !important;}
  html body.ui-refined .topbar{position:static !important;margin-bottom:16px !important;}
  html body.ui-refined .premium-hero{grid-template-columns:minmax(0,1fr) 240px !important;min-height:104px !important;margin-bottom:24px !important;align-items:center !important;}
  html body.ui-refined .hero-copy{transform:none !important;}
  html body.ui-refined .hero-copy h1{font-size:40px !important;}
  html body.ui-refined .hero-copy p{font-size:13px !important;margin:8px 0 0 !important;}
  html body.ui-refined .premium-hero .hero-weather-card{
    display:grid !important;grid-template-columns:64px minmax(0,1fr) !important;
    width:240px !important;min-width:0 !important;height:auto !important;min-height:96px !important;
    padding:12px 16px !important;margin:0 !important;gap:14px !important;
    border:1px solid rgba(135,191,216,.3) !important;border-radius:8px !important;
    background:rgba(13,46,66,.82) !important;box-shadow:none !important;
  }
  html body.ui-refined .hero-weather-card .weather-divider{display:none !important;}
  html body.ui-refined .hero-weather-card .moon-visual{width:64px !important;height:64px !important;filter:none !important;}
  html body.ui-refined .hero-weather-card .hero-weather-temp{font-size:32px !important;line-height:1.5 !important;}
  html body.ui-refined .hero-weather-card .hero-weather-text{font-size:13px !important;margin:0 !important;}
  html body.ui-refined .hero-weather-card .hero-weather-sub{font-size:12px !important;white-space:nowrap !important;}

  html body.ui-refined .battery-current-card,
  html body.ui-refined .battery-runtime-card,
  html body.ui-refined .battery-flow,
  html body.ui-refined [data-energy="battery"]{--energy-accent:#82eab6;--energy-surface:#123b32;--energy-border:#357c61;}
  html body.ui-refined .solar-today-card,
  html body.ui-refined .solar-flow,
  html body.ui-refined [data-energy="solar"]{--energy-accent:#ffdb70;--energy-surface:#38321c;--energy-border:#8b7638;}
  html body.ui-refined .bill-cycle-card,
  html body.ui-refined .grid-flow,
  html body.ui-refined [data-energy="grid"]{--energy-accent:#d0adff;--energy-surface:#302343;--energy-border:#755799;}
  html body.ui-refined .consumption-card,
  html body.ui-refined .home-flow-card,
  html body.ui-refined [data-energy="home"]{--energy-accent:#8fd8ff;--energy-surface:#143650;--energy-border:#416f95;}
  html body.ui-refined [data-energy="time"]{--energy-accent:#d8e5ef;--energy-surface:#102633;--energy-border:#3b5362;}

  html body.ui-refined .overview-card{padding:0 !important;background:none !important;border:0 !important;box-shadow:none !important;overflow:visible !important;}
  html body.ui-refined .overview-card::before,
  html body.ui-refined .overview-card::after{content:none !important;}
  html body.ui-refined .overview-head{margin-bottom:14px !important;}
  html body.ui-refined .overview-head .section-title{font-size:20px !important;}
  html body.ui-refined .overview-subtitle{display:none !important;}
  html body.ui-refined .overview-main-4{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:16px !important;}
  html body.ui-refined .shell .overview-card .overview-main-4 > .overview-battery,
  html body.ui-refined .shell .overview-card .overview-main-4 > .overview-runtime{
    display:flex !important;flex-direction:column !important;align-items:flex-start !important;gap:0 !important;
    position:relative !important;grid-column:auto !important;min-width:0 !important;min-height:196px !important;
    padding:18px !important;border:1px solid var(--energy-border) !important;border-radius:8px !important;
    background:var(--energy-surface) !important;box-shadow:none !important;overflow:hidden !important;
  }
  html body.ui-refined .shell .overview-card .overview-main-4 > .overview-battery::before,
  html body.ui-refined .shell .overview-card .overview-main-4 > .overview-battery::after,
  html body.ui-refined .shell .overview-card .overview-main-4 > .overview-runtime::before,
  html body.ui-refined .shell .overview-card .overview-main-4 > .overview-runtime::after,
  html body.ui-refined .overview-main-4 .overview-sub::before,
  html body.ui-refined .overview-main-4 .overview-sub::after{content:none !important;}
  html body.ui-refined .shell .overview-card .overview-main-4 > .overview-battery > *,
  html body.ui-refined .shell .overview-card .overview-main-4 > .overview-runtime > *{
    position:static !important;grid-area:auto !important;transform:none !important;
    width:100% !important;min-width:0 !important;margin:0 !important;text-align:left !important;
  }
  html body.ui-refined .shell .overview-card .overview-main-4 .overview-icon{
    position:absolute !important;inset:16px 16px auto auto !important;width:28px !important;height:28px !important;
    border:0 !important;background:none !important;box-shadow:none !important;
  }
  html body.ui-refined .overview-main-4 .overview-icon::before,
  html body.ui-refined .overview-main-4 .overview-icon::after{content:none !important;}
  html body.ui-refined .shell .overview-card .overview-main-4 .overview-label{
    padding-right:32px !important;font-size:14px !important;line-height:24px !important;color:var(--energy-accent) !important;
  }
  html body.ui-refined .shell .overview-card #heroSoc,
  html body.ui-refined .shell .overview-card #heroRuntime,
  html body.ui-refined .shell .overview-card #todaySolar,
  html body.ui-refined .shell .overview-card #billCycleCost{
    display:flex !important;flex-wrap:wrap !important;align-items:baseline !important;justify-content:flex-start !important;
    width:100% !important;max-width:none !important;
    font-size:40px !important;line-height:1.25 !important;font-weight:750 !important;padding:4px 0 !important;
    white-space:normal !important;text-shadow:none !important;
  }
  html body.ui-refined .shell .overview-card .overview-main-4 .metric-number{width:auto !important;}
  html body.ui-refined .shell .overview-card #todaySolar .metric-unit,
  html body.ui-refined .shell .overview-card #billCycleCost .metric-unit{width:auto !important;font-size:16px !important;line-height:1.5 !important;margin-left:6px !important;color:var(--energy-accent) !important;}
  html body.ui-refined .shell .overview-card .overview-main-4 .solar-today-card .overview-soc,
  html body.ui-refined .shell .overview-card .overview-main-4 .bill-cycle-card .overview-soc{color:var(--energy-accent) !important;}
  html body.ui-refined .shell .overview-card .overview-main-4 .battery-runtime-card .overview-runtime-value{color:#c2f4db !important;}
  html body.ui-refined .shell .overview-card .overview-main-4 .overview-sub,
  html body.ui-refined .shell .overview-card .overview-main-4 .bill-cycle-detail{
    padding:0 !important;font-size:12px !important;line-height:1.7 !important;color:#c0cfd8 !important;white-space:normal !important;
  }
  html body.ui-refined .shell .overview-card .overview-main-4 .mobile-stat-bar{
    display:block !important;position:relative !important;height:6px !important;min-height:6px;
    margin-top:auto !important;border-radius:3px;background:rgba(0,12,14,.45);
  }
  html body.ui-refined .mobile-stat-bar > span{display:block;height:100%;border-radius:inherit;}
  html body.ui-refined .battery-stat-bar > span{width:var(--battery-fill,0%);background:var(--battery-status-color,#82eab6);}
  html body.ui-refined .runtime-stat-bar > span{width:var(--runtime-fill,0%);background:#c2f4db;}
  html body.ui-refined .battery-stat-bar::after{content:"";position:absolute;left:var(--battery-reserve,20%);top:-2px;width:2px;height:10px;background:#e1eee7;}

  html body.ui-refined .live-flow-new{
    display:grid !important;grid-template-columns:minmax(0,30fr) minmax(0,40fr) minmax(0,30fr) !important;
    width:100% !important;max-width:1180px !important;margin:24px auto 0 !important;padding:0 !important;min-height:306px !important;
    border:0 !important;border-radius:0 !important;background:none !important;box-shadow:none !important;
  }
  html body.ui-refined .flow-left{display:grid !important;grid-template-rows:repeat(3,88px) !important;gap:14px !important;}
  html body.ui-refined .flow-center-new{height:306px !important;}
  html body.ui-refined .flow-card-mini,
  html body.ui-refined .home-flow-card{
    display:flex !important;align-items:center !important;gap:14px !important;min-width:0 !important;min-height:0 !important;
    padding:8px 18px !important;border:1px solid var(--energy-border) !important;border-radius:8px !important;
    background:var(--energy-surface) !important;box-shadow:none !important;transform:none !important;
  }
  html body.ui-refined .home-flow-card{min-height:140px !important;}
  html body.ui-refined .flow-card-mini::before,
  html body.ui-refined .flow-card-mini::after,
  html body.ui-refined .home-flow-card::before,
  html body.ui-refined .home-flow-card::after{content:none !important;}
  html body.ui-refined .flow-card-mini > div:last-child,
  html body.ui-refined .home-flow-card > div:last-child{min-width:0 !important;}
  html body.ui-refined .flow-icon,
  html body.ui-refined .home-icon-big{width:40px !important;height:40px !important;flex:0 0 40px !important;border:0 !important;background:none !important;box-shadow:none !important;}
  html body.ui-refined .flow-name{font-size:14px !important;line-height:1.3 !important;color:var(--energy-accent) !important;font-weight:600 !important;}
  html body.ui-refined .flow-value{font-size:30px !important;line-height:1.15 !important;font-weight:750 !important;margin:0 !important;white-space:nowrap !important;}
  html body.ui-refined .flow-sub{font-size:12px !important;line-height:1.4 !important;font-weight:500 !important;margin:0 !important;color:#c0cfd8 !important;}
  html body.ui-refined .home-flow-card .flow-value{font-size:36px !important;}
  html body.ui-refined .flow-line-new{stroke-width:2.5px !important;filter:none !important;}
  html body.ui-refined .desktop-flow-dot{r:4px !important;filter:none !important;}

  html body.ui-refined .ai-card{grid-template-columns:minmax(0,2fr) minmax(240px,1fr) !important;min-height:0 !important;}
  html body.ui-refined .ai-text{max-width:76ch !important;font-size:16px !important;line-height:1.7 !important;}
  html body.ui-refined .ai-action,
  html body.ui-refined .key-row strong{font-size:14px !important;}
  html body.ui-refined .ai-kicker,
  html body.ui-refined .insight-label{font-size:12px !important;}
  html body.ui-refined .battery-plan-card{grid-template-columns:minmax(0,1fr) minmax(0,1.5fr) !important;grid-template-areas:"plan-head plan-recommend" "plan-solar plan-metrics" !important;gap:20px 32px !important;align-items:start !important;}
  html body.ui-refined .battery-plan-header{padding:0 !important;gap:12px !important;}
  html body.ui-refined .battery-plan-title{font-size:28px !important;}
  html body.ui-refined .battery-plan-card #recommendCard{display:flex !important;flex-direction:column !important;gap:10px !important;padding:0 !important;background:none !important;backdrop-filter:none !important;-webkit-backdrop-filter:none !important;}
  html body.ui-refined .battery-plan-recommend::before,
  html body.ui-refined .battery-plan-recommend::after{content:none !important;}
  html body.ui-refined .battery-plan-recommend p{font-size:15px !important;margin:0 !important;}
  html body.ui-refined .battery-plan-progress{width:100% !important;padding:0 !important;background:none !important;border:0 !important;border-radius:0 !important;}
  html body.ui-refined .battery-plan-solar-row{padding:16px 0 0 !important;font-size:18px !important;}
  html body.ui-refined .battery-plan-metrics strong{font-size:24px !important;}
  html body.ui-refined .battery-plan-metrics > div{padding-bottom:6px !important;}
  html body.ui-refined .consumption-head{padding-bottom:6px !important;}
  html body.ui-refined .consumption-card .insight-sub{font-size:14px !important;}
  html body.ui-refined .consumption-card .consumption-value-grid div{font-size:16px !important;text-align:center !important;border-radius:8px !important;}
  html body.ui-refined .consumption-stat-grid{background:none !important;border:0 !important;border-radius:0 !important;box-shadow:none !important;}
  html body.ui-refined .consumption-stat-grid strong{font-size:24px !important;}
  html body.ui-refined .consumption-stat-grid span,
  html body.ui-refined .bill-forecast-card p{font-size:14px !important;}
  html body.ui-refined .bill-forecast-mini span{font-size:12px !important;}
  html body.ui-refined .power-profile-plot{width:100% !important;max-width:1200px !important;margin:0 auto !important;}
  html body.ui-refined .power-profile-head,
  html body.ui-refined .power-profile-legend{width:100% !important;max-width:1200px !important;margin:0 auto !important;}
  html body.ui-refined .profile-axis text{font-size:12px !important;}
  html body.ui-refined .shell > .settings-panel.scheduler-card{display:grid !important;grid-template-columns:minmax(0,1fr) 320px !important;align-items:center !important;gap:24px !important;}
  html body.ui-refined .scheduler-head{text-align:left !important;justify-content:flex-start !important;}
  html body.ui-refined .scheduler-card .settings-grid{width:100% !important;margin:0 !important;}
  html body.ui-refined .scheduler-card .scheduler-field{gap:8px !important;}
  html body.ui-refined .scheduler-card .scheduler-field > span{text-align:left !important;}
  html body.ui-refined footer{padding-bottom:36px !important;font-size:12px !important;}

  html body.ui-refined .ai-card,
  html body.ui-refined .battery-plan-card,
  html body.ui-refined .power-profile-card,
  html body.ui-refined .settings-panel.scheduler-card{
    padding:24px 0 !important;border:0 !important;border-top:1px solid var(--ui-border) !important;
    border-radius:0 !important;background:none !important;box-shadow:none !important;
  }
  html body.ui-refined .battery-plan-card .battery-plan-recommend.risk-safe,
  html body.ui-refined .battery-plan-card .battery-plan-recommend.risk-warn,
  html body.ui-refined .battery-plan-card .battery-plan-recommend.risk-danger,
  html body.ui-refined .battery-plan-solar-row,
  html body.ui-refined .battery-plan-metrics{border:0 !important;border-radius:0 !important;background:none !important;box-shadow:none !important;}
  html body.ui-refined .battery-plan-metrics{border-top:1px solid var(--ui-border) !important;padding:16px 0 0 !important;}
  html body.ui-refined .consumption-card{background:var(--energy-surface) !important;border-color:var(--energy-border) !important;border-radius:8px !important;box-shadow:none !important;}
  html body.ui-refined .consumption-card .insight-value{color:var(--energy-accent) !important;display:flex;flex-wrap:wrap;}
  html body.ui-refined .consumption-card .bill-forecast-card{background:rgba(0,12,24,.25) !important;border:0 !important;border-radius:8px !important;box-shadow:none !important;}
  html body.ui-refined .consumption-card .bill-forecast-card strong{color:#d0adff !important;white-space:normal !important;}
  html body.ui-refined .power-profile-legend{grid-template-columns:repeat(6,minmax(0,1fr)) !important;}
  html body.ui-refined .power-profile-legend div{background:var(--energy-surface) !important;border:1px solid var(--energy-border) !important;border-radius:8px !important;box-shadow:none !important;}
  html body.ui-refined .power-profile-legend .power-profile-time-card{display:grid !important;}
  html body.ui-refined .power-profile-time{display:none !important;}
  html body.ui-refined .power-profile-legend strong{color:var(--energy-accent) !important;}
  html body.ui-refined .power-profile-legend .legend-dot{background:var(--energy-accent) !important;}
  html body.ui-refined .power-profile-legend .legend-dot.soc{background:transparent !important;border:2px solid var(--energy-accent);box-sizing:border-box;}
  html body.ui-refined .production-line{stroke:#ffdb70;}
  html body.ui-refined .consumption-line{stroke:#8fd8ff;}
  html body.ui-refined .grid-profile-line{stroke:#d0adff;}
  html body.ui-refined .battery-profile-line{stroke:#82eab6;}
  html body.ui-refined .soc-profile-line{stroke:#c2f4db;stroke-dasharray:5 4;}
  html body.ui-refined #profileConsumptionFill stop:first-child{stop-color:rgba(143,216,255,.2);}
  html body.ui-refined #profileConsumptionFill stop:last-child{stop-color:rgba(143,216,255,0);}
  html body.ui-refined .speech-btn{min-height:44px !important;border-radius:8px !important;}
  html body.ui-refined button:focus,
  html body.ui-refined input:focus{outline:3px solid #d2edff !important;outline-offset:4px !important;}
}
@media(min-width:1101px){
  html body.ui-refined .app{padding-left:72px !important;padding-right:72px !important;}
  html body.ui-refined .overview-main-4{grid-template-columns:repeat(4,minmax(0,1fr)) !important;}
}
@media(min-width:701px) and (max-width:1100px){
  html body.ui-refined .app{padding:24px 72px 24px 24px !important;}
  html body.ui-refined .hero-copy h1{font-size:32px !important;}
  html body.ui-refined .power-profile-legend{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
  html body.ui-refined .flow-card-mini,
  html body.ui-refined .home-flow-card{padding:12px !important;gap:8px !important;}
  html body.ui-refined .flow-card-mini{padding-top:6px !important;padding-bottom:6px !important;}
  html body.ui-refined .ai-card{grid-template-columns:minmax(0,1fr) !important;}
  html body.ui-refined .battery-plan-card{grid-template-columns:minmax(0,1fr) !important;grid-template-areas:"plan-head" "plan-recommend" "plan-solar" "plan-metrics" !important;}
  html body.ui-refined .flow-icon,
  html body.ui-refined .home-icon-big{width:28px !important;height:28px !important;flex-basis:28px !important;}
  html body.ui-refined .flow-value,
  html body.ui-refined .home-flow-card .flow-value{font-size:24px !important;}
}

/* TV changes are additive to the existing slow polling/downsampled chart mode. */
@media(min-width:701px){
  html.tv-browser body.ui-refined .app{padding:32px 80px !important;}
  html.tv-browser body.ui-refined .shell{max-width:1640px !important;}
  html.tv-browser body.ui-refined .shell *{box-shadow:none !important;text-shadow:none !important;}
  html.tv-browser body.ui-refined .hero-copy h1{font-size:48px !important;}
  html.tv-browser body.ui-refined .hero-copy p,
  html.tv-browser body.ui-refined .live-pill{font-size:16px !important;}
  html.tv-browser body.ui-refined .shell .overview-card .overview-main-4 .overview-sub,
  html.tv-browser body.ui-refined .shell .overview-card .overview-main-4 .bill-cycle-detail{font-size:14px !important;}
  html.tv-browser body.ui-refined .shell .overview-card .overview-main-4 .bill-cycle-card #billCycleSub{font-size:14px !important;}
  html.tv-browser body.ui-refined .insight-sub,
  html.tv-browser body.ui-refined .consumption-value-grid div,
  html.tv-browser body.ui-refined .consumption-stat-grid span,
  html.tv-browser body.ui-refined .bill-forecast-card p,
  html.tv-browser body.ui-refined .battery-plan-metrics span,
  html.tv-browser body.ui-refined .battery-plan-subtitle{font-size:16px !important;line-height:1.6 !important;}
  html.tv-browser body.ui-refined .flow-name{font-size:18px !important;}
  html.tv-browser body.ui-refined .flow-sub{font-size:16px !important;}
  html.tv-browser body.ui-refined .flow-left{grid-template-rows:repeat(3,104px) !important;gap:16px !important;}
  html.tv-browser body.ui-refined .flow-center-new{height:360px !important;}
  html.tv-browser body.ui-refined .live-flow-new{max-width:1360px !important;min-height:360px !important;}
  html.tv-browser body.ui-refined .flow-card-mini{padding-top:5px !important;padding-bottom:5px !important;}
  html.tv-browser body.ui-refined .ai-text{font-size:18px !important;}
  html.tv-browser body.ui-refined .page-utility-button{width:56px !important;height:56px !important;}
  html.tv-browser body.ui-refined .speech-btn{min-height:48px !important;font-size:16px !important;}
  html.tv-browser body.ui-refined .power-profile-legend strong{font-size:24px !important;}
  html.tv-browser body.ui-refined .power-profile-legend span:not(.legend-dot){font-size:16px !important;}
  html.tv-browser body.ui-refined .power-profile-plot{max-width:1320px !important;background:#071b28 !important;}
  html.tv-browser body.ui-refined .power-profile-head,
  html.tv-browser body.ui-refined .power-profile-legend{max-width:1320px !important;}
  html.tv-browser body.ui-refined .profile-axis text{font-size:14px !important;}
  html.tv-browser body.ui-refined .consumption-card .insight-sub,
  html.tv-browser body.ui-refined .consumption-card .consumption-value-grid div{font-size:18px !important;}
  html.tv-browser body.ui-refined .key-row strong,
  html.tv-browser body.ui-refined .battery-plan-recommend p,
  html.tv-browser body.ui-refined .battery-plan-progress-labels{font-size:16px !important;}
  html.tv-browser body.ui-refined .scheduler-field input{min-height:64px !important;}
}
@media(min-width:1600px){
  html.tv-browser body.ui-refined .flow-value,
  html.tv-browser body.ui-refined .home-flow-card .flow-value{font-size:40px !important;}
  html.tv-browser body.ui-refined .battery-plan-metrics strong{font-size:34px !important;}
}
