@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Libre+Baskerville:wght@400;700&family=Oswald:wght@400;600;700&family=Special+Elite&family=Stardos+Stencil:wght@400;700&display=swap');
:root{
  --paper:#E7D8B8; --paper2:#D6C49B; --shadow:#BDAE8C; --ink:#1C1A17;
  --sea:#8FB0B7; --land:#8D9362; --allied:#1F4E79; --airborne:#4F6F46;
  --german:#8B1E1E; --yellow:#F3D36B; --sand:#C9A96A;
}
*{box-sizing:border-box} html,body{height:100%; margin:0; overflow:hidden; color:var(--ink);}
body{font-family:'Courier Prime',monospace; background:radial-gradient(circle at 20% 10%, rgba(255,255,255,.18), transparent 24%),radial-gradient(circle at 80% 70%, rgba(80,60,30,.08), transparent 28%),linear-gradient(90deg, rgba(0,0,0,.035) 1px, transparent 1px),linear-gradient(0deg, rgba(0,0,0,.025) 1px, transparent 1px),var(--paper); background-size:auto,auto,6px 6px,6px 6px,auto;}
.app-shell{height:100dvh; display:grid; grid-template-columns:172px minmax(0,1fr) 330px; grid-template-rows:148px minmax(0,1fr) 126px; grid-template-areas:'header header header' 'channels map dispatch' 'timeline timeline timeline'; gap:8px; padding:10px;}
.masthead{grid-area:header; border:4px double var(--ink); background:rgba(231,216,184,.9); padding:10px 14px; box-shadow:4px 4px 0 rgba(28,26,23,.18); display:flex; flex-direction:column; justify-content:space-between; overflow:hidden; position:relative; z-index:2;} .paper-kicker{font:700 13px 'Oswald'; letter-spacing:.12em; margin-bottom:8px}.masthead h1{font:400 clamp(34px,4.6vw,62px) 'Special Elite'; margin:8px 0 4px; line-height:.95}.masthead-row{display:flex; justify-content:space-between; align-items:end; gap:16px}.dateline{font:700 16px 'Libre Baskerville'; text-transform:uppercase}.perspective-toggle,.transport{display:flex; gap:5px}.perspective-toggle{position:relative; z-index:3; flex-wrap:wrap; justify-content:flex-end}button{font-family:'Oswald',sans-serif; color:var(--ink); background:var(--paper2); border:2px solid var(--ink); cursor:pointer; text-transform:uppercase; letter-spacing:.03em; box-shadow:2px 2px 0 rgba(28,26,23,.22)}button:hover,button.active{background:var(--yellow)}
.channel-rail{grid-area:channels; display:flex; flex-direction:column; gap:6px; padding:8px; border:3px solid var(--ink); background:rgba(214,196,155,.86); overflow:auto}.channel{padding:8px 6px; text-align:left}.channel[data-channel=utah].active{background:#b9c5d0}.channel[data-channel=omaha].active{background:#c8aa9d}.channel[data-channel=gold].active{background:#d8bf7e}.channel[data-channel=juno].active{background:#bfcd9a}.channel[data-channel=sword].active{background:#d0a09a}.channel[data-channel=german_response].active{background:#c79494;color:#240606}.channel[data-channel=airborne].active{background:#b9c7ae}.channel[data-channel=epilogue].active{background:#cab37e}
.map-wrap{grid-area:map; position:relative; border:4px solid var(--ink); background:var(--sea); overflow:hidden}#map{position:absolute; inset:0}.map-wrap:after{content:''; position:absolute; inset:0; pointer-events:none; background:repeating-linear-gradient(0deg,rgba(28,26,23,.025) 0 1px,transparent 1px 5px),radial-gradient(circle at 50% 50%, transparent 55%, rgba(28,26,23,.18)); mix-blend-mode:multiply}.map-stamp{position:absolute; top:14px; left:16px; z-index:2; font:700 34px 'Stardos Stencil'; color:rgba(139,30,30,.74); border:4px solid rgba(139,30,30,.7); padding:4px 12px; transform:rotate(-2deg); pointer-events:none}.legend{position:absolute; left:14px; bottom:14px; z-index:2; width:245px; background:rgba(231,216,184,.88); border:2px solid var(--ink); padding:9px; display:flex; flex-direction:column; gap:5px; font-size:12px}.dot{display:inline-block;width:10px;height:10px;border-radius:50%;border:1px solid var(--ink);margin-right:6px}.dot.allied{background:var(--allied)}.dot.german{background:var(--german)}.line.route{display:inline-block;position:relative;width:24px;border-top:2px solid var(--allied);margin-right:9px;vertical-align:middle}.line.route:after{content:'';position:absolute;right:-2px;top:-5px;border-left:7px solid var(--allied);border-top:4px solid transparent;border-bottom:4px solid transparent}.box.beach{display:inline-block;width:16px;height:10px;background:var(--sand);border:1px solid var(--ink);margin-right:6px}
.dispatch-panel{grid-area:dispatch; position:relative; z-index:1; border:3px solid var(--ink); background:rgba(231,216,184,.92); padding:14px; overflow:auto; box-shadow:inset 0 0 0 2px rgba(28,26,23,.12)}.dispatch-label{display:inline-block;background:var(--ink);color:var(--paper);font:700 13px 'Oswald';padding:3px 8px;letter-spacing:.1em}.dispatch-panel h2{font:400 30px 'Special Elite'; margin:16px 0 6px; line-height:1.05}.dispatch-panel h3{font:700 18px 'Libre Baskerville'; margin:0 0 14px}.dispatch-panel p{font-size:14px; line-height:1.42}.dispatch-meta{border-top:2px solid var(--ink); padding-top:10px}.dispatch-meta div{margin-bottom:8px}.dispatch-meta dt{font:700 12px 'Oswald'; text-transform:uppercase}.dispatch-meta dd{margin:0; font-size:12px; overflow-wrap:anywhere}.dispatch-meta a{color:var(--allied)}
.timeline-bar{grid-area:timeline; display:grid; grid-template-columns:110px minmax(0,1fr); gap:8px; align-items:center; border:3px solid var(--ink); background:var(--paper2); padding:8px}.transport{flex-direction:column}.transport button{height:30px}.timeline-bins{display:grid; grid-template-columns:repeat(10,1fr); gap:5px; height:100%}.time-bin{position:relative; display:flex; flex-direction:column; justify-content:center; min-width:0; padding:6px; background:rgba(231,216,184,.75); border:2px solid var(--ink); font-family:'Oswald'; text-align:center}.time-bin span{font-size:12px; line-height:1.05}.time-bin small{font-family:'Courier Prime';font-size:10px; opacity:.8}.time-bin.active{background:var(--yellow)}.time-bin:before{content:''; position:absolute; top:-7px; left:50%; width:10px; height:10px; border-radius:50%; background:var(--ink); transform:translateX(-50%)}
.maplibregl-popup-content{background:var(--paper); border:2px solid var(--ink); font-family:'Courier Prime'; box-shadow:4px 4px 0 rgba(28,26,23,.25)}.maplibregl-popup-tip{display:none}.rotate-prompt{display:none}
@media (max-width: 1000px) and (orientation: landscape){.app-shell{grid-template-columns:118px 1fr 270px;grid-template-rows:76px 1fr 94px;padding:6px;gap:5px}.masthead h1{font-size:32px}.paper-kicker{display:none}.channel{font-size:11px;padding:5px}.dispatch-panel{padding:9px}.dispatch-panel h2{font-size:22px}.timeline-bins span{font-size:10px}.timeline-bins small{display:none}}
@media (orientation: portrait) and (max-width: 820px){.app-shell{filter:blur(3px); pointer-events:none}.rotate-prompt{display:grid; place-items:center; position:fixed; inset:0; z-index:99; background:rgba(28,26,23,.62); padding:24px}.rotate-card{background:var(--paper); border:4px double var(--ink); padding:22px; max-width:360px; box-shadow:8px 8px 0 rgba(0,0,0,.25)}.rotate-card h1{font:400 34px 'Special Elite'; margin:0 0 12px}.rotate-card p{line-height:1.4}}

.map-stamp{display:none!important}
.dispatch-panel h3{white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:normal; hyphens:auto; line-height:1.24}
.dispatch-panel p{white-space:normal; overflow:visible; text-overflow:clip; max-height:none}
.transport{display:grid; grid-template-rows:1fr 1fr; gap:6px; align-self:stretch}
.transport button{height:auto; min-height:30px}
.transport .play-button{font-size:17px; letter-spacing:.12em; background:var(--yellow); border-width:3px; font-weight:700}
.step-row{display:grid; grid-template-columns:1fr 1fr; gap:5px}
.step-row button{font-size:14px; padding:0}
.defense-popup .maplibregl-popup-content{background:#4b4b46;color:#f0d7d7;border-color:#8B1E1E;box-shadow:4px 4px 0 rgba(28,26,23,.35)}
.defense-popup b{color:#fff}.defense-popup span{color:#f4c8c8}
.zone-popup .maplibregl-popup-content{background:rgba(231,216,184,.96);border:2px solid var(--ink);color:var(--ink)}
.maplibregl-popup-content{white-space:normal; overflow-wrap:break-word; line-height:1.35; padding:10px 12px}
.maplibregl-popup-content b{font-family:'Special Elite';font-size:15px}.maplibregl-popup-content span{font-size:13px}

/* Patch 2: remove the updating date line from the header and let the perspective control own the row. */
.dateline{display:none!important}
.masthead-row{justify-content:flex-end; align-items:center; margin-top:4px}
.paper-kicker{margin-bottom:12px}
.masthead h1{margin-top:10px}

/* Patch 3: start at first timeline bin, prevent masthead controls from overlapping dispatch, and add unit-symbol legend hints. */
@media (max-width: 1000px) and (orientation: landscape){.app-shell{grid-template-rows:98px 1fr 94px}.masthead h1{font-size:30px}.masthead{padding:6px 10px}.perspective-toggle button{font-size:10px;padding:3px 5px}}
.unit-symbol-note{font-size:11px; line-height:1.25; opacity:.9; border-top:1px solid rgba(28,26,23,.35); padding-top:4px; margin-top:2px}


/* Patch 4: uncertainty halo key for the legend. */
.halo-key{display:inline-block;position:relative;width:22px;height:18px;margin-right:7px;vertical-align:middle}
.halo-key:before{content:'';position:absolute;left:0;top:0;width:18px;height:18px;border-radius:50%;background:rgba(31,78,121,.10);border:1px solid rgba(31,78,121,.24)}
.halo-key b{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:50%;background:var(--allied);border:1px solid var(--ink)}

/* Patch 5: attribution links and information modal. */
.top-links{display:flex;align-items:center;gap:7px;margin-right:auto;min-width:max-content}
.webmapgpt-link{display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:3px 9px;background:var(--paper2);border:2px solid var(--ink);box-shadow:2px 2px 0 rgba(28,26,23,.22);font:700 12px 'Oswald',sans-serif;text-transform:uppercase;letter-spacing:.04em;color:var(--ink);text-decoration:none}
.webmapgpt-link:hover{background:var(--yellow)}
.info-button{width:30px;height:30px;border-radius:50%;padding:0;font:700 18px 'Libre Baskerville',serif;text-transform:none;line-height:1;background:var(--paper);box-shadow:2px 2px 0 rgba(28,26,23,.22)}
.info-button:hover{background:var(--yellow)}
.info-modal{display:none;position:fixed;inset:0;z-index:120;background:rgba(28,26,23,.54);padding:clamp(12px,2vw,28px);place-items:center}
.info-modal.open{display:grid}
.info-card{position:relative;width:min(860px,94vw);max-height:min(82vh,820px);overflow:auto;background:var(--paper);border:4px double var(--ink);box-shadow:10px 10px 0 rgba(0,0,0,.24);padding:24px 28px 26px;font-family:'Courier Prime',monospace;line-height:1.42}
.info-card:before{content:'';position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,rgba(28,26,23,.025) 0 1px,transparent 1px 5px)}
.info-card a{color:var(--allied);font-weight:700}
.info-card h2{font:400 38px 'Special Elite',serif;margin:4px 44px 12px 0;line-height:1.05}
.info-card h3{font:700 16px 'Oswald',sans-serif;letter-spacing:.06em;text-transform:uppercase;border-top:2px solid rgba(28,26,23,.45);padding-top:10px;margin:18px 0 8px}
.info-card p,.info-card li{font-size:14px}
.info-kicker{font:700 12px 'Oswald',sans-serif;letter-spacing:.13em;text-transform:uppercase;margin:0;color:#5b4a32}
.info-close{position:absolute;right:14px;top:12px;width:34px;height:34px;padding:0;font-size:26px;line-height:1;border-radius:50%;background:var(--paper2);z-index:1}
.csv-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 14px;font-size:13px}
.csv-grid a{overflow-wrap:anywhere}
@media (max-width: 1000px) and (orientation: landscape){.top-links{gap:4px}.webmapgpt-link{font-size:10px;padding:2px 5px}.info-button{width:25px;height:25px;font-size:15px}.csv-grid{grid-template-columns:1fr}.info-card{padding:18px 20px}.info-card h2{font-size:29px}}
@media (max-width: 900px){.csv-grid{grid-template-columns:1fr}}


/* Patch 6: keep WebMapGPT and information controls inline with the title, right-aligned. */
.title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;min-width:0;width:100%;}
.title-row h1{flex:1 1 auto;min-width:0;margin-right:12px;}
.title-row .top-links{flex:0 0 auto;margin-left:auto;margin-right:0;padding-top:2px;}
.masthead-row{justify-content:flex-end;align-items:center;width:100%;}
.masthead-row .perspective-toggle{margin-left:auto;}
@media (max-width: 1000px) and (orientation: landscape){
  .app-shell{grid-template-rows:92px 1fr 94px;}
  .title-row{align-items:center;gap:8px;}
  .title-row h1{font-size:clamp(22px,4.2vw,30px);line-height:.92;margin:0;}
  .title-row .top-links{padding-top:0;gap:4px;}
  .webmapgpt-link{min-height:23px;font-size:9px;padding:1px 5px;}
  .info-button{width:24px;height:24px;font-size:14px;}
  .masthead-row{margin-top:4px;}
  .perspective-toggle{gap:3px;flex-wrap:nowrap;}
  .perspective-toggle button{font-size:9px;padding:2px 4px;white-space:nowrap;}
}
@media (max-width: 760px) and (orientation: landscape){
  .title-row h1{font-size:21px;}
  .webmapgpt-link{font-size:8px;padding:1px 4px;}
  .info-button{width:22px;height:22px;font-size:13px;}
  .perspective-toggle button{font-size:8px;padding:2px 3px;}
}
