/* NZ Election Live V5 / BU1ST Technologies Sydney
   Focus mode: fit the decision-making overview to one desktop viewport.
   On small screens show one selected dashboard panel at a time.
   No changes to poll or election-result source logic. */
:root { --focus-gap: 12px; }
.overview-panel-switcher { display:none; }
/* Keep evidence links visible and keyboard controls accessible. */
[data-focus] { border:1px solid rgba(255,255,255,.9); cursor:pointer; }

@media (min-width:1151px) and (min-height:680px) {
  html, body { height:100%; overflow:hidden; }
  .app-root { height:100dvh; min-height:0; overflow:hidden; display:flex; flex-direction:column; }
  .topbar {
    flex:0 0 auto; min-height:55px; height:55px; margin:7px auto 0;
    padding:6px 14px; border-radius:16px; gap:10px;
  }
  .identity { gap:8px; }
  .fern { height:33px; width:35px; flex-basis:35px; }
  .identity-title { font-size:15px; }
  .identity-by { display:none; }
  .topnav { gap:1px; }
  .topnav button { padding:8px 10px; font-size:10px; }
  .nav-edition { padding:6px 8px; font-size:8px; }
  .icon-button { width:32px; height:32px; border-radius:10px; }
  .hero { flex:0 0 auto; height:clamp(86px,11.3vh,116px); min-height:0; margin-top:0; }
  .hero-inner { padding:9px clamp(26px,4.3vw,72px); }
  .hero-copy { padding:0; }
  .hero-kicker { font-size:8px; letter-spacing:1.3px; }
  .hero h1 { font-size:clamp(28px,2.6vw,41px); margin:5px 0 2px; letter-spacing:-1.8px; }
  .hero p { font-size:11px; line-height:1.3; }
  .hero p br { display:none; }
  .hero-cta { display:none; }
  .hero-info { min-width:0; padding:8px 16px; width:206px; gap:0; border-radius:16px; }
  .hero-info-label { font-size:8px; }
  .hero-info-top { display:none; }
  .hero-date { font-size:30px; line-height:1.15; margin:0; letter-spacing:-1px; }
  .hero-date span { font-size:12px; }
  .hero-info strong { font-size:11px; }
  .hero-info > span:last-of-type { font-size:9px; margin:0; }
  .hero-info-bottom { display:none; }
  body[data-page]:not([data-page="overview"]) .hero { display:none; }
  .content-shell {
    width:100%; max-width:1800px; flex:1 1 auto; min-height:0;
    display:flex; flex-direction:column;
    padding:0 clamp(12px,2vw,31px) 10px;
  }
  .state-strip { flex:0 0 auto; min-height:34px; height:34px; padding:2px 4px; }
  .data-pill { padding:4px 10px; font-size:9px; }
  .strip-sub, .source-led { font-size:10px; }
  .state-left,.state-right { gap:9px; }
  .content-shell > main { flex:1; min-height:0; overflow:hidden; }
  .page.page-active[data-page="overview"] {
    display:grid; height:100%; min-height:0;
    grid-template-rows:auto minmax(0,1.38fr) minmax(0,.9fr);
    gap:var(--focus-gap); animation:none;
  }
  .editorial-intro { padding:9px 17px; min-height:0; margin:0; border-radius:17px; gap:10px; }
  .editorial-intro h2 { font-size:clamp(16px,1.55vw,23px); margin:3px 0 3px; letter-spacing:-.7px; }
  .editorial-intro p { font-size:10px; line-height:1.35; }
  .section-eyebrow { font-size:8px; }
  .editorial-figures { gap:2px; }
  .editorial-figure { padding:3px 10px; min-width:116px; }
  .editorial-figure strong { font-size:18px; line-height:1.35; }
  .editorial-figure span,.editorial-figure small { font-size:8px; }
  .editorial-action { width:30px; height:30px; border-radius:9px; }
  .section-row { display:none; }
  .overview-top, .overview-bottom { min-height:0; height:100%; margin:0; gap:var(--focus-gap); }
  .overview-top { grid-template-columns:1.12fr 1fr .82fr; }
  .overview-bottom { grid-template-columns:1.2fr 1fr .78fr; }
  .overview-top >.panel,.overview-bottom >.panel { min-height:0!important; height:100%; padding:clamp(11px,1.15vw,18px); border-radius:20px; }
  .overview-top >.panel:hover,.overview-bottom >.panel:hover { transform:none; }
  .panel-head { margin-bottom:8px; gap:6px; }
  .panel-head h2 { font-size:clamp(12px,1vw,15px); gap:6px; }
  .panel-head h2 .icon { width:17px; height:17px; padding:2px; border-radius:6px; }
  .panel-head p { font-size:9px; margin-top:3px; line-height:1.3; }
  .small-stamp { font-size:8px; padding:5px 7px; }
  .poll-selector-row { margin:0 0 7px; }
  .small-select { min-height:27px; padding:4px 8px; font-size:10px; }
  .poll-overview-bars { gap:clamp(3px,.6vh,7px); }
  .poll-bar-row { grid-template-columns:clamp(78px,8.5vw,117px) minmax(22px,1fr) 44px; height:clamp(21px,2.7vh,26px); gap:7px; }
  .party-chip { height:21px; width:23px; font-size:9px; }
  .party-name-line { font-size:10px; gap:5px; }
  .poll-number { font-size:12px; }
  .poll-track { height:9px; }
  .poll-overview .micro-disclaimer { margin-top:7px; font-size:9px; line-height:1.2; }
  .majority-tape { padding:6px 2px; border-radius:11px; }
  .majority-tape strong { font-size:18px; }
  .majority-tape span { font-size:8px; margin-top:0; }
  .coalition-overview { display:flex; flex-direction:column; }
  .coalition-overview .panel-head { flex:0 0 auto; }
  .coalition-overview .majority-tape { flex:0 0 auto; }
  .overview-seat-arc { min-height:0; flex:1 1 auto; align-items:center; }
  .overview-seat-arc svg { height:clamp(88px,13.5vh,137px); max-height:100%; }
  .arc-legend { margin:0 0 5px; gap:2px 7px; }
  .arc-legend span { font-size:8px; }
  .glass-notice { padding:6px 8px; font-size:9px; line-height:1.25; }
  .result-overview .panel-head { margin-bottom:5px; }
  .result-overview-centre { min-height:0; padding:4px; gap:3px; }
  .ballot-illustration { transform:scale(.62); transform-origin:center; margin:-13px 0; }
  .result-overview-centre h3 { font-size:clamp(14px,1.2vw,18px); line-height:1.22; }
  .result-overview-centre p { font-size:9px; line-height:1.3; }
  .glass-button { padding:7px; font-size:10px; }
  .chart-box svg { height:clamp(117px,17vh,164px); }
  .trends-overview .chart-flex { margin-top:0; }
  .chart-small-key { font-size:8px; }
  .news-snippet { padding:5px 0; grid-template-columns:34px 1fr; gap:9px; }
  .story-thumb { width:34px; height:34px; border-radius:9px; }
  .news-snippet a { font-size:10px; line-height:1.28; }
  .news-snippet span { font-size:9px; margin-top:2px; }
  .countdown-body { margin-top:8px; }
  .countdown-body strong { font-size:clamp(28px,2.6vw,40px); }
  .countdown-boxes { gap:5px; margin-top:6px; }
  .countdown-boxes > div { padding:6px 2px; border-radius:8px; }
  .countdown-boxes strong { font-size:16px; }
  .countdown-footer { margin-top:6px; font-size:9px; }
  .sources-overview { display:none!important; }
  .footer { display:none; }
  .page.page-active:not([data-page="overview"]) { height:100%; overflow-y:auto; padding:0 5px 20px; animation:none; overscroll-behavior:contain; }
  .page-heading { margin:10px 4px 13px; }
  .page-heading h2 { font-size:clamp(25px,2.5vw,35px); margin:4px 0; }
  .page-heading p { font-size:11px; }
}
/* Medium desktop: keep the overview single-screen, but simplify secondary content. */
@media (min-width:1151px) and (min-height:680px) and (max-height:800px) {
  .hero-info { display:none; }
  .panel-head p { display:none; }
  .overview-seat-arc svg { height:clamp(84px,11.3vh,105px); }
  .poll-overview .micro-disclaimer { display:none; }
  .result-overview-centre .ballot-illustration { display:none; }
  .result-overview-centre { padding:6px; }
  .chart-box svg { height:clamp(96px,14vh,115px); }
}
/* Tablets/phones: one dashboard module at a time instead of a long card stack. */
@media (max-width:1150px) {
  .app-root { min-height:100dvh; }
  .topbar { min-height:55px; height:55px; margin:6px auto 0; padding:7px 11px; }
  .hero { min-height:112px; height:112px; margin-top:0; }
  .hero-inner { padding:10px 23px; }
  .hero h1 { font-size:clamp(25px,3.7vw,33px); letter-spacing:-1.5px; margin:7px 0 3px; }
  .hero p { font-size:11px; }
  .hero-kicker { font-size:8px; }
  .hero-cta,.hero-info { display:none; }
  body[data-page]:not([data-page="overview"]) .hero { display:none; }
  .content-shell { padding:0 13px 24px; }
  .state-strip { min-height:35px; padding:7px 2px 4px; }
  .state-left { flex-direction:row; gap:7px; align-items:center; }
  .data-pill { padding:5px 8px; font-size:8px; }
  .strip-sub { font-size:9px; }
  .editorial-intro { padding:12px 15px; margin-bottom:10px; gap:8px; }
  .editorial-intro h2 { font-size:clamp(18px,2.5vw,22px); margin:4px 0; }
  .editorial-intro p { font-size:10px; }
  .editorial-figure { padding:5px 8px; min-width:0; }
  .editorial-figure strong { font-size:17px; }
  .section-row { display:none; }
  .overview-panel-switcher { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:6px; margin:0 0 10px; }
  .overview-panel-switcher button {
    padding:9px 8px; min-height:41px; display:flex; justify-content:center; align-items:center; gap:6px;
    border-radius:12px; color:#38627c; font-size:11px; font-weight:800;
    background:linear-gradient(145deg,rgba(255,255,255,.86),rgba(229,246,255,.7));
    box-shadow:inset 0 1px rgba(255,255,255,.9),0 3px 8px rgba(32,104,150,.06);
  }
  .overview-panel-switcher .icon { width:14px; height:14px; }
  .overview-panel-switcher button.focus-active { background:linear-gradient(130deg,#0a9ba9,#1268a6); color:white; border-color:#0e8db0; box-shadow:0 6px 17px rgba(20,114,161,.20); }
  .overview-top,.overview-bottom { display:contents; }
  .page.page-active[data-page="overview"] { display:flex; flex-direction:column; }
  .overview-top>.panel,.overview-bottom>.panel { display:none!important; height:auto; min-height:0!important; }
  .overview-top>.panel.panel-focus,.overview-bottom>.panel.panel-focus { display:block!important; }
  .overview-top>.result-overview.panel-focus,.overview-top>.coalition-overview.panel-focus { display:flex!important; }
  .overview-top>.panel.panel-focus,.overview-bottom>.panel.panel-focus { padding:clamp(15px,2.7vw,23px); margin:0; border-radius:20px; }
  .poll-overview-bars { gap:10px; }
  .poll-bar-row { grid-template-columns:clamp(92px,18vw,120px) minmax(20px,1fr) 52px; gap:10px; }
  .overview-seat-arc svg { height:clamp(150px,24vw,205px); }
  .result-overview-centre { min-height:190px; }
  .chart-box svg { height:clamp(165px,27vw,230px); }
  .news-overview .news-snippet { padding:12px 0; }
  .sources-overview { display:none!important; }
  .footer { display:none; }
  .page-heading { margin:12px 4px; }
}
@media (max-width:580px) {
  .topbar { width:calc(100% - 12px); border-radius:14px; padding:7px 9px; }
  .identity-title { font-size:13px; }
  .hero { height:96px; min-height:96px; }
  .hero-inner { padding:9px 16px; }
  .hero-kicker { font-size:7px; letter-spacing:.7px; }
  .hero h1 { font-size:clamp(23px,6.2vw,29px); letter-spacing:-1px; margin:4px 0 3px; }
  .hero p { font-size:10px; line-height:1.2; }
  .hero p br { display:none; }
  .content-shell { padding:0 10px 24px; }
  .state-strip { min-height:35px; height:auto; padding:6px 0; }
  .state-left { flex-direction:row; flex-wrap:wrap; gap:4px 8px; }
  .state-left .strip-sub { font-size:9px; }
  .editorial-intro { flex-direction:row; align-items:center; gap:8px; padding:11px 12px; margin:0 0 9px; }
  .editorial-intro h2 { font-size:17px; letter-spacing:-.5px; line-height:1.23; }
  .editorial-intro p { display:none; }
  .editorial-figures { width:auto; flex-shrink:0; gap:0; padding:0; border:0; }
  .editorial-figure { min-width:73px; padding:3px 6px; }
  .editorial-figure strong { font-size:15px; line-height:1.45; }
  .editorial-figure span,.editorial-figure small { font-size:7px; }
  .editorial-figure:last-of-type, .editorial-action { display:none; }
  .section-eyebrow { font-size:7px; letter-spacing:.7px; }
  .overview-panel-switcher { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-bottom:9px; }
  .overview-panel-switcher button { min-height:34px; padding:6px 7px; font-size:10px; border-radius:9px; }
  .overview-panel-switcher .icon { width:13px; height:13px; }
  .overview-top>.panel.panel-focus,.overview-bottom>.panel.panel-focus { padding:14px; border-radius:16px; }
  .poll-overview-bars { gap:7px; }
  .poll-bar-row { grid-template-columns:105px 1fr 48px; }
  .panel-head { margin-bottom:9px; }
  .panel-head h2 { font-size:15px; }
  .poll-overview .micro-disclaimer { margin-top:10px; }
  .coalition-overview { min-height:0!important; }
  .result-overview { min-height:0!important; }
  .trends-overview { min-height:0!important; }
  .news-overview { min-height:0!important; }
  .countdown-overview { min-height:0!important; }
  .chart-box svg { height:185px; }
  .page-heading h2 { font-size:25px; }
}

/* Ensure secondary cards never cut off critical labels at standard laptop heights. */
@media (min-width:1151px) and (min-height:680px) {
  .countdown-body { min-height:0; margin-top:4px; }
  .countdown-boxes { margin:5px 0; }
  .countdown-footer { margin-top:3px; }
  .trends-overview .chart-flex { min-height:0; }
  .trends-overview .chart-box svg { height:clamp(88px,14vh,138px); }
}
@media (min-width:1151px) and (min-height:680px) and (max-height:820px) {
  .news-overview .news-snippet:nth-child(n+3) { display:none; }
  .news-overview .news-snippet { padding:4px 0; }
  .countdown-body strong { font-size:29px; }
  .countdown-overview .panel-head { margin-bottom:0; }
  .countdown-footer { margin-top:0; }
}
@media (min-width:1151px) and (min-height:680px) and (max-height:740px) {
  .poll-overview-bars { gap:2px; }
  .poll-bar-row { height:20px; }
  .poll-overview .panel-head { margin-bottom:4px; }
  .trends-overview .chart-box svg { height:86px; }
  .trends-overview .panel-head { margin-bottom:3px; }
  .news-overview .news-snippet:nth-child(n+2) { display:none; }
  .countdown-boxes > div { padding:3px 2px; }
  .countdown-body { margin-top:1px; }
  .countdown-footer { display:none; }
  .trends-overview .chart-box svg { height:82px; }
}

@media (prefers-reduced-motion:reduce) { .page{animation:none;} }

/* Broadcast link: compact, independent of the seven-page navigation. */
.broadcast-access{display:inline-flex;align-items:center;text-decoration:none;white-space:nowrap;border:1px solid rgba(37,130,157,.27);background:rgba(255,255,255,.66);border-radius:999px;padding:7px 12px;color:#14556b;font-weight:750;font-size:.77rem;box-shadow:0 3px 16px rgba(16,69,98,.06)}
.broadcast-access:hover{background:rgba(226,248,255,.96)}
@media(max-width:960px){.broadcast-access{display:none}}
