/* A compact timeline contains only its heading and the usable annual slider. */
.history-panel.is-compact .history-histogram{display:none}
#history-details{min-height:0;overflow:auto;overscroll-behavior:contain}
#history-details:not([hidden]){padding-top:9px}
.demo-trigger,.mobile-layers-open{display:none}

@media(max-width:700px),(max-width:1000px) and (max-height:500px){
  html{height:100%;overflow:hidden}
  body{height:100dvh;min-height:0;overflow:hidden;display:flex;flex-direction:column}
  .demo-banner,.demo-watermark{display:none!important}
  body .masthead{height:56px;min-height:56px;padding:0 10px;gap:8px;flex:none}
  body .masthead .brand{font-size:11px;letter-spacing:.45px;gap:5px;align-self:flex-start;margin-top:8px;min-width:0}
  body .masthead .brand svg{width:24px;height:24px;flex:none}
  body .masthead .brand span{padding-top:3px;white-space:nowrap}
  body .masthead .brand small{display:none}
  .header-center{display:none!important}
  .header-actions{gap:4px;margin-left:auto}
  .header-actions .text-button{min-height:44px;padding:0 5px;font-size:11px}
  .header-actions .icon-button{width:38px;height:44px;line-height:42px}
  .demo-trigger{display:flex;position:absolute;left:39px;top:29px;align-items:center;gap:5px;min-height:24px;padding:2px 0;background:none;color:#8e3437;font-size:9px;font-weight:650;letter-spacing:.55px;text-transform:uppercase}
  .demo-trigger:before{content:"";width:4px;height:4px;border-radius:50%;background:#a52d32}
  body .workspace{height:auto;min-height:0;flex:1;display:flex;overflow:hidden}
  body .workspace #viewport{height:100%;min-height:0;max-height:none;flex:1;order:initial;width:100%}
  .workspace>.sidebar{display:none}
  #viewport>.viewport-top{display:none}
  #viewport .vision-toggle{top:12px;right:12px;width:48px;height:48px;min-width:48px;font-size:24px;border-radius:50%;padding:0}
  .vision-toggle span{display:none}
  .mobile-layers-open{display:flex;align-items:center;gap:7px;position:absolute;z-index:6;left:12px;top:12px;min-height:44px;padding:0 13px;background:#fcfff4ee;color:#2e4739;border:1px solid #fff;border-radius:8px;box-shadow:0 3px 12px #132f2526;font-size:12px;font-weight:600}
  .mobile-layers-open span{font-size:21px;line-height:1}
  body .workspace #viewport .view-tools{top:78px;right:12px;gap:8px}
  .view-tools #north,.view-tools #fullscreen{display:none}
  .view-tools .tool-stack>button,.view-tools .tool-button{width:44px;height:44px}
  .view-tools .tool-stack{border-radius:8px;width:44px}
  body .workspace #viewport .history-panel{left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));width:auto;max-height:calc(100% - 84px);padding:8px 12px;display:flex;flex-direction:column;border-radius:12px;overflow:hidden;box-shadow:0 6px 24px #12281e33}
  body .workspace #viewport .history-panel.is-compact{max-height:none;overflow:visible}
  #history-panel .history-heading,#history-range{flex:none}
  #history-panel .history-heading{min-height:40px;align-items:center;gap:4px}
  #history-panel .history-heading .eyebrow{display:none}
  #history-panel .history-heading h2{font-size:12px;line-height:1.2;letter-spacing:.1px;margin:0;white-space:nowrap}
  #history-panel .history-heading h2 span{font-size:27px;padding-left:7px}
  #history-panel .history-heading-actions{gap:0;margin-left:auto}
  #history-panel .history-heading-actions #history-size{min-height:44px;min-width:82px;padding:7px 9px;border-color:#8fa875;font-size:11px;border-radius:7px;touch-action:manipulation}
  #history-panel #history-market,#history-panel #history-close{display:none}
  #history-panel .history-range{margin:0}
  #history-panel #history-year{display:block;height:36px;margin:0;width:100%;touch-action:pan-x}
  #history-panel #history-year::-webkit-slider-thumb{width:23px;height:23px}
  #history-panel #history-year::-moz-range-thumb{width:23px;height:23px}
  #history-panel .history-ticks{font-size:9px;margin:0;line-height:12px}
  #history-panel .history-histogram{height:23px;margin-top:4px}
  #history-panel.is-compact .history-histogram{display:none}
  #history-details{overflow:auto;max-height:38dvh;scrollbar-width:thin;padding-right:2px}
  #history-details .history-actions{display:flex;gap:6px;flex-wrap:wrap}
  #history-details .history-actions button{min-height:44px;min-width:44px}
  #history-details .history-period{font-size:8px;margin:3px 0 8px}
  #history-details .history-infra-summary #history-infra-change{min-height:0}
  #history-details .history-caveat{font-size:10px}
  body .workspace #viewport .selection-card{top:72px;bottom:auto;left:12px;right:66px;width:auto;max-height:min(34dvh,280px);z-index:7;overscroll-behavior:contain}
  #viewport .selection-card .icon-button{min-width:36px;min-height:36px}
  .info-dialog{width:calc(100% - 24px);max-height:calc(100dvh - 24px);padding:0}
  .info-dialog .dialog-head{padding:15px 16px;gap:12px}
  .info-dialog .dialog-head h2{font-size:19px}
  .info-dialog .dialog-head .icon-button{width:44px;height:44px;line-height:42px;flex:none}
  .mobile-layers-dialog[open]{display:flex;flex-direction:column;height:calc(100dvh - 24px)}
  .mobile-layers-dialog .dialog-head{flex:none}
  .mobile-layers-content{overflow:auto;overscroll-behavior:contain;min-height:0;scrollbar-width:thin}
  #mobile-view-options{padding:0 16px 16px;border-bottom:1px solid #dce3d2}
  #mobile-view-options h3{font-size:11px;margin:5px 0 10px;color:#687a61}
  #mobile-view-options .viewport-top{position:static;display:block;pointer-events:auto}
  #mobile-view-options .scene-caption{display:none}
  #mobile-view-options .view-presets{display:flex;flex-wrap:wrap;justify-content:flex-start;box-shadow:none;background:#eef3e5;border-color:#d6dec9;gap:4px}
  #mobile-view-options .view-presets button{min-height:44px;flex:1;font-size:11px;padding:7px 8px}
  #mobile-layers-dialog .sidebar{display:block;position:static;width:auto;max-width:none;height:auto;overflow:visible;padding:0 16px 24px;border:0;background:var(--paper)}
  #mobile-layers-dialog .history-sidebar-intro,#mobile-layers-dialog .history-era-shortcuts,#mobile-layers-dialog .history-research-link{display:none}
  #mobile-layers-dialog .history-research-link.history-city-study{display:block;margin:10px 0;font-size:12px}
  #mobile-layers-dialog #history-exit{margin-top:15px;min-height:44px}
  #mobile-layers-dialog .history-controls{margin-top:16px}
  #mobile-layers-dialog .history-check{min-height:36px;align-items:center}
  #mobile-layers-dialog .history-check input{width:18px;height:18px;flex:none}
  #mobile-layers-dialog .parks-browser summary,#mobile-layers-dialog .history-controls>summary,#mobile-layers-dialog .history-research>summary{min-height:44px;align-content:center}
  #mobile-layers-dialog .park-show{min-height:44px}
  #mobile-layers-dialog .history-filter-actions button{min-height:40px}
  #viewport:fullscreen{height:100dvh!important;min-height:0!important}
}
@media(max-width:1000px) and (max-height:500px){
  body .masthead{height:48px;min-height:48px}
  .demo-trigger{top:24px;font-size:7px;min-height:20px}
  body .masthead .brand{margin-top:4px}
  body .workspace #viewport .history-panel{left:64px;right:64px;bottom:6px;padding:4px 10px;max-height:calc(100% - 16px)}
  #history-panel .history-heading{min-height:34px}
  #history-panel #history-year{height:28px}
  #history-panel .history-heading-actions #history-size{min-height:34px}
  #history-panel .history-heading h2 span{font-size:23px}
  #history-details{max-height:32dvh}
}
