:root {
  --ink: #18343b;
  --muted: #68787c;
  --gold: #c8a24a;
  --gold-dark: #9a762b;
  --navy: #12323b;
  --paper: rgba(255, 255, 255, .94);
  --line: rgba(24, 52, 59, .12);
  --shadow: 0 10px 35px rgba(15, 35, 42, .12);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans HK", "Microsoft JhengHei", sans-serif; color: var(--ink); background: #d8e4e8; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid rgba(200, 162, 74, .45); outline-offset: 2px; }
#cesiumContainer { position: absolute; inset: 0; transition: filter .35s ease; }
#cesiumContainer canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.cesium-widget-credits { display: none !important; }
.glass { background: var(--paper); border: 1px solid rgba(255,255,255,.75); box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.hidden { display: none !important; }
.topbar { position: absolute; z-index: 20; top: 18px; left: 20px; right: 20px; height: 66px; border-radius: 14px; display: flex; align-items: center; padding: 0 18px; gap: 18px; }
.brand { width: 140px; display: flex; align-items: center; }
.brand img { width: 140px; max-width: none; }
.top-divider { height: 28px; width: 1px; background: var(--line); }
.top-project { display: flex; flex-direction: column; gap: 3px; }
.top-project strong { font-size: 14px; letter-spacing: .08em; }
.top-project span { color: var(--muted); font-size: 11px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.button { min-height: 40px; border: 0; border-radius: 8px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; transition: background .18s, transform .18s; }
.button:hover { transform: translateY(-1px); }
.button-quiet { background: #f3f1eb; border: 1px solid var(--line); }
.button-quiet:hover { background: #ebe6d9; }
.button-primary { background: var(--navy); color: #fff; }
.button-primary:hover { background: #1c4752; }
.button-full { width: 100%; }
.project-card { position: absolute; z-index: 10; left: 20px; top: 102px; width: 258px; padding: 22px; border-radius: 14px; }
.eyebrow, .modal-eyebrow { color: var(--gold-dark); font-size: 10px; letter-spacing: .17em; font-weight: 700; }
.project-card h1 { margin: 13px 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: 32px; font-weight: 500; letter-spacing: .02em; }
.phase { margin: 0; color: #52656b; font-size: 14px; line-height: 1.55; }
.demo-badge { display: inline-block; margin: 17px 0 12px; padding: 5px 8px; border-radius: 4px; background: #f2e9d2; color: #73571f; font-size: 10px; font-weight: 700; }
.project-note { margin: 0 0 9px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--gold-dark); font-size: 12px; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.centered { display: block; margin: 15px auto 0; }
.sun-card { position: absolute; z-index: 10; left: 20px; top: 404px; width: 258px; padding: 18px 20px; border-radius: 14px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 13px; font-weight: 700; }
.card-heading output { color: var(--muted); font-size: 11px; font-weight: 500; }
.field-label { display: flex; justify-content: space-between; margin: 12px 0 6px; color: var(--muted); font-size: 11px; }
input[type="date"], select, .static-field { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.8); color: var(--ink); padding: 0 10px; font-size: 12px; }
.static-field { display: flex; align-items: center; color: #52656b; }
.time-row { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.time-row strong { font-size: 28px; font-weight: 500; letter-spacing: -.03em; }
.time-row span { color: var(--gold-dark); font-size: 9px; letter-spacing: .1em; }
.range { width: 100%; margin: 12px 0 4px; accent-color: var(--navy); }
.range-labels { display: flex; justify-content: space-between; color: #8b9699; font-size: 8px; }
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 14px; }
.quick-row button, .play-button, .aerial-tools button { border: 1px solid var(--line); background: #f5f4f0; border-radius: 6px; min-height: 30px; font-size: 10px; cursor: pointer; }
.quick-row button:hover, .play-button:hover, .aerial-tools button:hover { background: #e9e4d8; }
.play-button { width: 100%; margin-top: 7px; }
.microcopy { margin: 12px 0 0; color: #7d898c; font-size: 10px; line-height: 1.55; }
.control-panel { position: absolute; z-index: 15; top: 102px; right: 20px; bottom: 20px; width: 338px; border-radius: 14px; padding: 20px; overflow-y: auto; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.panel-kicker { color: var(--gold-dark); font-size: 9px; letter-spacing: .15em; font-weight: 700; }
.panel-heading h2 { margin: 4px 0 0; font-size: 19px; font-weight: 650; }
.standard-badge { flex: none; padding: 4px 7px; border: 1px solid #dbc58e; border-radius: 4px; color: #806225; font-size: 9px; }
.panel-intro { margin: 12px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.flat-grid button { height: 38px; border: 1px solid var(--line); border-radius: 7px; background: #f7f6f2; cursor: pointer; font-size: 12px; font-weight: 650; }
.flat-grid button:hover { border-color: var(--gold); }
.flat-grid button.active { border-color: var(--navy); background: var(--navy); color: #fff; }
#flatDirection { color: var(--gold-dark); font-size: 10px; }
.selection-summary { display: flex; align-items: center; justify-content: space-between; margin: 17px 0 12px; padding: 12px; border-radius: 8px; background: #f4f2ec; }
.selection-summary > div { display: flex; flex-direction: column; gap: 4px; }
.selection-summary span { color: var(--muted); font-size: 9px; }
.selection-summary strong { font-size: 12px; }
.view-chip { padding: 4px 7px; border-radius: 4px; background: #e5d6ae; color: #6e5119 !important; }
.panel-links { display: flex; justify-content: space-between; margin-top: 13px; }
.panel-links button, .panel-links a { border: 0; padding: 0; background: transparent; color: var(--gold-dark); font-size: 11px; cursor: pointer; }
.panel-links button:hover, .panel-links a:hover { text-decoration: underline; }
.view-nav { position: absolute; z-index: 16; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; padding: 6px; border-radius: 14px; white-space: nowrap; }
.view-nav button { min-width: 91px; height: 52px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.view-nav button span { font-size: 12px; }
.view-nav button small { color: #849094; font-size: 9px; }
.view-nav button.active { background: var(--navy); color: #fff; }
.view-nav button.active small { color: #cbd8da; }
.selection-bar { position: absolute; z-index: 14; top: 100px; left: 50%; transform: translateX(-50%); border-radius: 10px; padding: 12px 16px; display: flex; align-items: center; gap: 9px; font-size: 12px; }
.selection-bar strong { font-size: 13px; }
.selection-bar #viewSubtitle { color: var(--muted); font-size: 10px; }
.selection-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.aerial-tools { position: absolute; z-index: 16; left: 50%; bottom: 92px; transform: translateX(-50%); border-radius: 9px; padding: 7px 10px; display: flex; align-items: center; gap: 8px; font-size: 10px; }
.aerial-tools select { width: 88px; height: 30px; }
.aerial-tools button { padding: 0 9px; }
.map-attribution { position: absolute; z-index: 8; left: 22px; bottom: 16px; color: rgba(24,52,59,.75); font-size: 8px; line-height: 1.5; text-shadow: 0 1px 2px rgba(255,255,255,.8); pointer-events: none; }
.toast { position: absolute; z-index: 80; left: 50%; bottom: 105px; transform: translate(-50%, 10px); border-radius: 8px; padding: 10px 16px; background: rgba(18,50,59,.94); color: #fff; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading-screen { position: absolute; z-index: 100; inset: 0; display: flex; align-items: center; justify-content: center; background: #e4ecee; transition: opacity .45s; }
.loading-screen.done { opacity: 0; pointer-events: none; }
.loading-card { width: 300px; text-align: center; }
.loading-card img { width: 155px; }
.loading-title { margin-top: 24px; font-size: 16px; font-weight: 650; }
.loading-line { height: 2px; margin: 18px 0; overflow: hidden; background: rgba(18,50,59,.12); }
.loading-line span { display: block; width: 45%; height: 100%; background: var(--gold); animation: loading 1.2s infinite ease-in-out; }
.loading-card p { color: var(--muted); font-size: 11px; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(240%); } }
.modal-backdrop { position: absolute; z-index: 110; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(13,33,39,.52); backdrop-filter: blur(7px); }
.modal { position: relative; width: min(620px, 100%); max-height: 90vh; overflow-y: auto; border-radius: 16px; padding: 30px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.modal h2 { margin: 10px 0 16px; font-size: 25px; line-height: 1.35; }
.modal p, .modal li { color: #5d6d72; font-size: 13px; line-height: 1.8; }
.modal ul { padding-left: 19px; margin-bottom: 23px; }
.intro-modal { width: min(480px, 100%); }
.modal-close { position: absolute; top: 13px; right: 15px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f2f1ec; color: #52656b; font-size: 23px; cursor: pointer; }
.sources-modal { width: min(720px, 100%); }
.source-section { padding: 14px 0; border-top: 1px solid var(--line); }
.source-section h3 { margin: 0 0 4px; font-size: 13px; }
.source-section p { margin: 0; font-size: 12px; }
.source-links { display: flex; flex-wrap: wrap; gap: 10px 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.source-links a, .plan-heading a { color: var(--gold-dark); font-size: 11px; }
.plan-modal { width: min(1080px, 95vw); }
.plan-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.plan-heading h2 { margin-bottom: 12px; }
.plan-modal img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: #fff; }
.plan-modal > p { margin-bottom: 0; font-size: 11px; }
@media (max-width: 1180px) {
  .project-card { width: 230px; }
  .sun-card { width: 230px; top: 404px; }
  .control-panel { width: 310px; }
  .view-nav button { min-width: 79px; }
  .selection-bar { left: 46%; }
}
@media (max-width: 900px) {
  .topbar { top: 8px; left: 8px; right: 8px; height: 56px; padding: 0 11px; gap: 9px; }
  .brand, .brand img { width: 105px; }
  .top-divider, .top-project span { display: none; }
  .top-project strong { font-size: 11px; }
  .top-actions .button { min-height: 34px; padding: 0 9px; font-size: 10px; }
  .top-actions a { display: none; }
  .project-card { top: 74px; left: 8px; width: 164px; padding: 12px; border-radius: 10px; }
  .project-card .eyebrow { font-size: 7px; }
  .project-card h1 { margin-top: 8px; font-size: 21px; }
  .phase { font-size: 10px; }
  .demo-badge { margin: 10px 0 0; font-size: 8px; }
  .project-note, .project-card .text-button { display: none; }
  .sun-card { top: 74px; right: 8px; left: auto; width: 154px; padding: 12px; border-radius: 10px; }
  .sun-card .card-heading { margin-bottom: 5px; font-size: 11px; }
  .sun-card input[type="date"], .sun-card .field-label, .sun-card .microcopy, .sun-card .range-labels { display: none; }
  .time-row { margin-top: 5px; }
  .time-row strong { font-size: 22px; }
  .quick-row { margin-top: 8px; gap: 3px; }
  .quick-row button { min-height: 26px; font-size: 8px; }
  .play-button { min-height: 26px; font-size: 8px; }
  .control-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 41vh; padding: 15px; border-radius: 12px; }
  .panel-heading h2 { font-size: 16px; }
  .panel-intro { margin: 7px 0 10px; }
  .selection-summary { margin-top: 12px; }
  .view-nav { bottom: calc(41vh + 16px); width: calc(100% - 16px); padding: 4px; overflow-x: auto; justify-content: space-between; }
  .view-nav button { min-width: 68px; height: 44px; }
  .view-nav button span { font-size: 10px; }
  .view-nav button small { font-size: 8px; }
  .aerial-tools { bottom: calc(41vh + 72px); }
  .selection-bar { top: 258px; max-width: calc(100% - 16px); padding: 9px 11px; flex-wrap: wrap; justify-content: center; }
  .selection-bar strong { font-size: 11px; }
  .map-attribution { display: none; }
  .modal-backdrop { padding: 12px; }
  .modal { padding: 23px 19px; max-height: 88vh; }
  .modal h2 { font-size: 21px; }
  .plan-heading { align-items: flex-start; }
}
@media (max-height: 740px) and (min-width: 901px) {
  .project-card { padding: 16px 19px; }
  .project-card h1 { font-size: 27px; }
  .project-note { display: none; }
  .sun-card { top: 344px; }
  .control-panel { padding: 16px 19px; }
}
