/* Phase 3.2: compact DESKTOP design at Chrome 100% zoom.
   Accounts for Windows display scaling: a 1280 physical pixel browser can
   expose only ~1024 CSS pixels when the OS is at 125% display scaling.
   No zoom:0.9 hack, no changes to touch/mobile presentation or Django logic. */
@media (min-width: 991px) and (max-width: 1440px) {
  .site-header .header-inner { min-height: 80px; gap: 10px; }
  .site-header .brand-symbol { width:46px; height:46px; flex-basis:46px; }
  .site-header .brand-name { font-size: clamp(22px, 2vw, 27px); }
  .site-header .wordmark { gap: 9px; }
  .site-header .button-nav { min-width: 113px; min-height: 42px; font-size: 12px; padding-inline:12px; }
  .site-header .nav-actions { gap: 7px; }
  .site-header .nav-actions::before { display: none; }
  .site-header .primary-nav.tk-v5-navigation { gap: clamp(7px,1vw,12px); }
  .site-header .tk-v5-rail { height: 44px; flex-basis: 265px; width: 265px; padding:5px; }
  .site-header .tk-v5-rail .tk-v5-link { height:32px; font-size: clamp(9px,.85vw,11px); padding-inline:3px; }
  .site-header .tk-v5-icon { flex-basis:15px; }
  .site-header .tk-v5-icon svg { width:15px; height:15px; }
  .site-header .tk-v5-rail:hover .tk-v5-link,
  .site-header .tk-v5-rail:focus-within .tk-v5-link,
  .site-header .tk-v5-rail.tk5-open .tk-v5-link { flex:1 1 auto; width:auto; }
  .site-header .tk-v5-rail:hover .tk-v5-label,
  .site-header .tk-v5-rail:focus-within .tk-v5-label,
  .site-header .tk-v5-rail.tk5-open .tk-v5-label { margin-left:4px; }

  .v4-hero .container { width:min(calc(100% - 66px), 1500px); }
  .v4-hero-main {
     min-height: 510px;
     grid-template-columns: minmax(0,1.12fr) minmax(310px,.88fr);
     gap: clamp(14px,2.1vw,30px);
     padding-top: 28px; padding-bottom: 10px;
  }
  .v4-hero-copy { padding-top: 0; }
  .v4-eyebrow { margin-bottom:17px; font-size:10px; letter-spacing:.23em; }
  .v4-hero h1 { font-size:clamp(47px,4.65vw,65px); line-height:1.04; margin-bottom:17px; }
  .v4-hero-description { font-size:clamp(14px,1.2vw,17px); line-height:1.6; margin-bottom:18px; }
  .v4-search { min-height:60px; gap:8px; padding:5px; border-radius:12px; }
  .v4-search-icon { margin-left:9px; }
  .v4-search input { height:42px; font-size:14px; }
  .v4-search button { height:48px; padding:0 15px; font-size:12px; border-radius:9px; gap:8px; }
  .v4-search-foot { gap:6px 12px; padding:11px 4px 0; font-size:10px; }
  .v4-prism-scene { min-height:470px; }
  .v4-prism-scene img { max-width:480px; }
  .v4-prism-tag { font-size:9px; }
  .v4-featurebar {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    margin-top:9px; margin-bottom:27px; padding:4px 6px;
  }
  .v4-feature { min-height:91px; gap:8px; padding:10px clamp(5px,.9vw,13px); }
  .v4-feature-icon { flex:0 0 37px; width:37px; height:37px; border-radius:11px; }
  .v4-feature-icon svg { width:21px; height:21px; }
  .v4-feature strong { font-size:clamp(10px,.89vw,12px); }
  .v4-feature small { font-size:clamp(9px,.78vw,10px); }
  .v4-feature:nth-child(-n+2) { border-bottom:0; }
  .v4-feature:nth-child(2) { border-right:1px solid rgba(255,255,255,.13); }
  .v4-hero-scroll { margin-bottom:12px; }
  .king-services { padding-top:70px; }
}
/* Keep the tablet between 761–990px using the existing readable menu.
   Four shortcuts can remain in a row on landscape tablets above 900px. */
@media (min-width:901px) and (max-width:990px) {
  .v4-featurebar { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
/* Legacy king-v2.css still opens its tablet drawer up to 1040px.
   Explicitly restore desktop rail in the newly supported 991-1040 range. */
@media (min-width:991px) and (max-width:1040px) {
  .site-header .menu-toggle { display:none; }
  .site-header .primary-nav.tk-v5-navigation {
    position:static; top:auto; left:auto; right:auto;
    display:flex; flex-direction:row; align-items:center; justify-content:flex-end;
    padding:0; border:0; border-radius:0;
    background:transparent; box-shadow:none;
    width:auto; max-height:none; overflow:visible;
  }
  .site-header .primary-nav.tk-v5-navigation .nav-actions {
    width:auto; margin:0; align-self:center; flex-shrink:0;
    display:flex; justify-content:flex-end;
  }
  .site-header .primary-nav.tk-v5-navigation .nav-actions .button-nav { margin:0; }
}
