/* AuroraCockpit V2.2 / Cloud Deck embedded mobile repair.
 * Applies *after* cloud-deck.css, layout-v2.css, premium, cloud layout, and
 * the mobile LEAN CSS. Only responsive presentation changes below.
 * The weather-model, map, timeline, and scan engines are unchanged.
 */
@media(max-width:760px), (max-width:900px) and (max-height:450px) {
  /* This is a page, not a fullscreen map overlay or an extra modal. */
  html.layout-v2 #cloudsView {
    display:block;
    min-width:0;
    width:100%;
    margin:0 0 16px;
  }
  html.layout-v2 #cloudsView[hidden] {display:none!important}
  html.layout-v2 #cloudsView #cloudDeckDialog {
    overflow:visible!important;
    width:100%!important;
    height:auto!important;
    max-height:none!important;
    border-radius:15px!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-shell {
    padding:14px 12px 18px!important;
    overflow:visible!important;
    display:block!important;
    height:auto!important;
    max-height:none!important;
  }
  /* One coherent header: title, location subtitle and a real back button. */
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-header {
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    gap:10px!important;
    min-width:0!important;
    padding:0 0 13px!important;
    margin:0!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-heading {
    min-width:0!important;
    width:auto!important;
    max-width:none!important;
    flex:1 1 auto!important;
    overflow:hidden!important;
    padding:0!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-heading p {
    font:600 12px/1.4 var(--mono)!important;
    letter-spacing:.07em!important;
    color:#95bdb1!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-heading h2 {
    margin:2px 0 2px!important;
    font:700 27px/1.05 var(--display)!important;
    letter-spacing:-.015em!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-heading>span {
    display:block!important;
    max-width:100%;
    font:500 12px/1.35 var(--sans)!important;
    color:#c3d8d2!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-header-status {
    display:flex!important;
    flex:0 0 auto!important;
    flex-direction:row!important;
    justify-content:flex-end!important;
    align-items:center!important;
    width:auto!important;
    min-width:0!important;
    margin:0!important;
    gap:0!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-header-status>span,
  html.layout-v2 #cloudsView #cloudDeckDialog #cloudImmersiveToggle {
    display:none!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog #v2CloudsBack {
    display:flex!important;
    width:auto!important;
    min-width:91px!important;
    flex:0 0 auto!important;
    min-height:44px!important;
    height:44px!important;
    padding:8px 10px!important;
    font:700 12px/1.2 var(--display)!important;
    letter-spacing:.01em!important;
    white-space:nowrap!important;
    border-radius:10px!important;
    color:#ddf7fa!important;
  }
  /* Four forecast layers followed by a single Model / Refresh action row. */
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-controls {
    position:relative!important;
    inset:auto!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:auto auto!important;
    gap:8px!important;
    padding:11px 0 12px!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-width:none!important;
    border-bottom:1px solid rgba(147,226,204,.14)!important;
    background:none!important;
    overflow:visible!important;
    transform:none!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-layer-tabs {
    position:relative!important;
    inset:auto!important;
    grid-column:1/-1!important;
    grid-row:1!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    gap:5px!important;
    overflow:visible!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-layer-tabs button {
    width:100%!important;
    min-width:0!important;
    min-height:44px!important;
    height:44px!important;
    margin:0!important;
    padding:5px 3px!important;
    text-align:center!important;
    border-radius:10px!important;
    font:700 12px/1.2 var(--display)!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-layer-tabs span {
    display:block!important;
    font:700 12px/1.2 var(--display)!important;
    letter-spacing:.02em!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-layer-tabs small {display:none!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-model-control {
    position:relative!important;
    inset:auto!important;
    display:flex!important;
    flex-direction:row!important;
    justify-content:flex-start!important;
    align-items:center!important;
    grid-column:1!important;
    grid-row:2!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    height:46px!important;
    min-height:46px!important;
    margin:0!important;
    padding:4px 7px!important;
    overflow:hidden!important;
    border-radius:10px!important;
    background:linear-gradient(150deg,rgba(19,50,52,.74),rgba(5,25,30,.92))!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-model-control label {
    display:block!important;
    flex:0 0 auto!important;
    font:600 12px/1.3 var(--mono)!important;
    color:#afd3ca!important;
    white-space:nowrap!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-model-control select {
    position:static!important;
    display:block!important;
    flex:1 1 auto!important;
    width:100%!important;
    min-width:0!important;
    height:44px!important;
    margin:0 0 0 7px!important;
    padding:3px 18px 3px 5px!important;
    font:600 12px/1.25 var(--sans)!important;
    color:#e3f8f2!important;
    white-space:nowrap!important;
    text-overflow:ellipsis!important;
    background:rgba(3,17,21,.4)!important;
    border:0!important;
    appearance:auto!important;
    border-radius:6px!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-refresh-button {
    position:relative!important;
    inset:auto!important;
    display:flex!important;
    grid-column:2!important;
    grid-row:2!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    width:auto!important;
    min-width:94px!important;
    height:46px!important;
    min-height:46px!important;
    margin:0!important;
    padding:6px 9px!important;
    border-radius:10px!important;
    background:rgba(22,61,58,.76)!important;
    font:700 12px/1.2 var(--sans)!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-refresh-button svg {
    display:block!important;
    width:15px!important;
    height:15px!important;
    flex:0 0 auto!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-refresh-button span {
    display:inline!important;
    white-space:nowrap!important;
    font:700 12px/1.2 var(--sans)!important;
  }
  /* Map, then timeline, then analysis. Never overlap the cards with map. */
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-main {
    position:relative!important;
    inset:auto!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto auto!important;
    align-content:start!important;
    align-items:stretch!important;
    gap:12px!important;
    width:100%!important;
    min-height:0!important;
    height:auto!important;
    padding:12px 0 0!important;
    overflow:visible!important;
    transform:none!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-wrap {
    position:relative!important;
    inset:auto!important;
    grid-row:1!important;
    grid-column:1!important;
    width:100%!important;
    max-width:100%!important;
    height:max(570px,65dvh)!important;
    min-height:570px!important;
    max-height:none!important;
    overflow:hidden!important;
    border-radius:14px!important;
    isolation:isolate!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-topline {
    position:relative!important;
    inset:auto!important;
    z-index:12!important;
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    width:100%!important;
    max-width:none!important;
    min-height:43px!important;
    height:auto!important;
    max-height:none!important;
    gap:5px!important;
    padding:6px 8px!important;
    margin:0!important;
    overflow:visible!important;
    transform:none!important;
    border-bottom:1px solid rgba(156,226,210,.15)!important;
    background:rgba(5,26,31,.94)!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-topline>span {
    display:none!important;
    min-height:27px!important;
    height:auto!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-topline>#cloudMapModel,
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-topline>#cloudMapHour {
    display:flex!important;
    align-items:center!important;
    flex:0 1 auto!important;
    width:auto!important;
    max-width:40%!important;
    min-width:0!important;
    padding:4px 5px!important;
    margin:0!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    font:600 12px/1.2 var(--mono)!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-topline .cloud-overlay-toggle {
    display:none!important;
    width:auto!important;
    min-width:0!important;
    min-height:44px!important;
    padding:5px 7px!important;
    font:600 12px/1.2 var(--sans)!important;
    white-space:normal!important;
    border-radius:8px!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .v2-cloud-map-options {
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:0 0 auto!important;
    min-height:44px!important;
    margin:0 0 0 auto!important;
    padding:5px 8px!important;
    border:1px solid rgba(135,204,231,.30)!important;
    border-radius:8px!important;
    background:rgba(16,53,64,.85)!important;
    color:#cdeaf7!important;
    font:700 12px/1.2 var(--sans)!important;
    letter-spacing:.015em!important;
    cursor:pointer;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog.v2-cloud-options-open .cloud-map-topline .cloud-overlay-toggle {
    display:flex!important;
    flex:1 1 calc(50% - 6px)!important;
    justify-content:center!important;
    white-space:normal!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-immersive-rail {
    position:absolute!important;
    inset:56px 8px auto auto!important;
    z-index:16!important;
    display:flex!important;
    flex-direction:column!important;
    gap:7px!important;
    width:44px!important;
    height:auto!important;
    transform:none!important;
    pointer-events:auto!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-immersive-rail>button {
    display:grid!important;
    place-items:center!important;
    width:44px!important;
    height:44px!important;
    min-height:44px!important;
    padding:0!important;
    border-radius:10px!important;
    background:rgba(5,24,30,.88)!important;
    border:1px solid rgba(167,220,214,.18)!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-immersive-rail>button:nth-child(n+4) {display:none!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-legend {
    position:relative!important;
    inset:auto!important;
    grid-row:3!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    width:100%!important;
    max-width:none!important;
    min-height:45px!important;
    height:auto!important;
    margin:0!important;
    padding:10px 8px!important;
    gap:6px!important;
    background:rgba(5,23,29,.96)!important;
    border-top:1px solid rgba(164,224,215,.12)!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-legend span {
    font:600 12px/1.2 var(--sans)!important;
    white-space:nowrap!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-legend i {min-width:44px!important;flex:1 1 auto!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-timeline-shell {
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    grid-row:2!important;
    grid-column:1!important;
    width:100%!important;
    height:auto!important;
    min-height:145px!important;
    max-height:none!important;
    padding:15px 0 7px!important;
    margin:0!important;
    overflow:visible!important;
    border-top:1px solid rgba(157,223,207,.16)!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-timeline-heading {
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:8px!important;
    flex-wrap:wrap!important;
    margin:0 0 8px!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog #cloudTimeline:empty::after {
    display:block;
    content:"Forecast frames will appear when model data is available.";
    width:100%;
    min-height:38px;
    padding:9px 11px;
    border:1px dashed rgba(172,228,211,.24);
    border-radius:8px;
    background:rgba(12,35,40,.55);
    color:#afcbbf;
    font:500 12px/1.45 var(--sans);
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-side {
    position:relative!important;
    inset:auto!important;
    grid-row:3!important;
    grid-column:1!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    align-content:start!important;
    gap:10px!important;
    width:100%!important;
    max-width:none!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    opacity:1!important;
    visibility:visible!important;
    transform:none!important;
    pointer-events:auto!important;
    background:none!important;
    border:0!important;
    box-shadow:none!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-side-card {
    width:100%;
    min-width:0;
    padding:15px!important;
    border-radius:12px!important;
    background:linear-gradient(155deg,rgba(20,48,53,.72),rgba(6,24,29,.93))!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-safety {
    font:500 12px/1.45 var(--sans)!important;
    color:#cfddcb!important;
    padding:10px!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-loading {pointer-events:none!important}
  /* Only one zoom/recenter rail should be visible. MapLibre adds its own
     built-in +/- buttons: remove those duplicates on phones while keeping
     the three existing Cloud Deck actions and map gestures intact. */
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map .maplibregl-ctrl-top-right {
    display:none!important;
  }
}
@media(max-width:350px) {
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-shell {padding:12px 9px 16px!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-heading h2 {font-size:24px!important}
  html.layout-v2 #cloudsView #cloudDeckDialog #v2CloudsBack {min-width:84px!important;padding:7px!important;font-size:12px!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-refresh-button {min-width:85px!important;padding:5px!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-refresh-button span {font-size:12px!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-model-control label {font-size:12px!important}
}
@media(min-width:761px) and (min-height:451px), (min-width:901px) {
  html.layout-v2 #cloudsView #cloudDeckDialog .v2-cloud-map-options {display:none!important}
}


/* V2.2.1: preserve the complete model name and all overlay actions. */
@media(max-width:760px), (max-width:900px) and (max-height:450px) {
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-heading>span {font-size:14px!important;white-space:normal!important;overflow:visible!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-heading {overflow:visible!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-model-control {height:auto!important;min-height:52px!important;overflow:visible!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-model-control select {font-size:13px!important;margin-left:4px!important;padding-right:20px!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-topline {display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-topline>#cloudMapModel {grid-column:1!important;max-width:none!important;white-space:normal!important;overflow:visible!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-topline>#cloudMapHour {grid-column:1!important;max-width:none!important;white-space:normal!important;overflow:visible!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .v2-cloud-map-options {grid-column:2!important;grid-row:1 / 3!important;max-width:110px!important;white-space:normal!important}
  html.layout-v2 #cloudsView #cloudDeckDialog.v2-cloud-options-open .cloud-map-topline .cloud-overlay-toggle {grid-column:1 / -1!important;min-height:44px!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-immersive-rail {inset:auto 8px 76px auto!important}
  html.layout-v2 #cloudsView #cloudDeckDialog :is(.cloud-timeline-heading,.cloud-timeline-heading span,.cloud-timeline-heading strong,
    .cloud-hour,.cloud-hour b,.cloud-hour small,.cloud-timeline-controls button,.cloud-timeline-controls span,
    .cloud-point-readout span,.cloud-point-readout small,.cloud-side-card-heading span,.cloud-side-card-heading strong,
    .cloud-point-grid span,.cloud-point-grid small,.cloud-observation-compare span,.cloud-observation-compare small,
    .cloud-field-meta span,.cloud-field-meta b,.cloud-deck-credit,.cloud-timeline-legend,.cloud-timeline-legend span,
    .cloud-precip-legend span,.cloud-precip-legend small,.cloud-map-loading strong,.cloud-map-loading small) {font-size:12px!important;line-height:1.4!important;letter-spacing:0!important}
  html.layout-v2 #cloudsView #cloudDeckDialog :is(.cloud-side-card p,.cloud-deck-safety) {font-size:14px!important;line-height:1.5!important}
  html.layout-v2 #cloudsView #cloudDeckDialog :is(.cloud-hour,.cloud-timeline-controls button) {min-height:44px!important;min-width:44px!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-loading {padding:100px 52px 16px 16px!important;text-align:left}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-point-readout {max-width:calc(100% - 72px)!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-map-legend {gap:4px!important;padding:10px 6px!important;flex-wrap:wrap!important}
}
@media(max-width:430px) {
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-deck-controls {grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto auto!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-model-control {grid-column:1!important;grid-row:2!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-refresh-button {grid-column:1!important;grid-row:3!important;width:100%!important}
}
@media(max-width:760px), (max-width:900px) and (max-height:450px) {
  html.layout-v2 #cloudsView #cloudDeckDialog :is(.cloud-hour strong,.cloud-play-button b,.cloud-play-icon,.cloud-play-state,.cloud-timeline-axis,.cloud-timeline-axis span) {font-size:12px!important;line-height:1.4!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-play-button {min-width:44px!important;min-height:44px!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-field-meta span {display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:3px!important;overflow-wrap:anywhere}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-side-card-heading {flex-wrap:wrap;gap:7px}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-observation-compare {grid-template-columns:repeat(2,minmax(0,1fr))}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-observation-compare :is(span,small) {overflow-wrap:anywhere}
}
@media(max-width:760px), (max-width:900px) and (max-height:450px) {
  html.layout-v2 #cloudsView #cloudDeckDialog :is(.maplibregl-marker span,.maplibregl-ctrl-attrib a,
    .cloud-scrubber-labels span,.cloud-scrubber-labels strong,#cloudScrubberTime) {font-size:12px!important;line-height:1.4!important}
}
@media(max-width:760px), (max-width:900px) and (max-height:450px) {
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-scrubber-meta :is(span,strong) {font-size:12px!important;line-height:1.4!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-time-scrubber {min-height:44px!important}
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-immersive-rail svg {width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8}
}
@media(max-width:760px), (max-width:900px) and (max-height:450px) {
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-hour {min-width:5.5em!important;flex:0 0 auto}
}
@media(max-width:760px), (max-width:900px) and (max-height:450px) {
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-model-control select {font-size:16px!important}
}


/* Narrow iPhone accessibility: the cloud model selector is two logical fields,
   and at 200% computed text it must not force the inline deck past the viewport. */
@media (max-width:350px) {
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-model-control {
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:center!important;
    gap:3px!important;
    height:auto!important;
    min-height:58px!important;
    max-width:100%!important;
    padding:4px 6px!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-model-control label {
    min-width:0!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  html.layout-v2 #cloudsView #cloudDeckDialog .cloud-model-control select {
    flex:0 1 auto!important;
    margin:0!important;
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
}
