/* Shared page layout: purpose line, sub-page tabs, panels. Used by pages redesigned Oct 2026. */
.ph-purpose{margin:20px 0 6px}
.ph-purpose h2{font-size:1.4rem;margin:8px 0 6px}
.ph-purpose p{color:#D7D9DE;font-size:0.95rem;max-width:760px;margin:0}
.ph-tabs{margin:18px 0 8px;display:flex;flex-wrap:wrap;gap:8px}
.ph-panel{margin-top:16px}
/* Panels hide only when the script has run, so the page still works without JavaScript. */
.ph-js .ph-panel{display:none}
.ph-js .ph-panel.ph-on{display:block}
@media (max-width:760px){.ph-tabs{gap:6px}.ph-tabs .tab-btn{flex:1 1 auto}}

/* wide tables scroll sideways on phones instead of widening the page */
@media (max-width:760px){ table.compare{display:block !important;max-width:100% !important;overflow-x:auto !important;-webkit-overflow-scrolling:touch;} }

/* Nov 20, 2026: subject content first. Tabs and content sit high on the page; the "what this page is" blurb moves below the content. */
.wrap:has(>.ph-purpose){display:flex;flex-direction:column}
.wrap:has(>.ph-purpose)>*{order:2}
.wrap:has(>.ph-purpose)>.nav{order:0}
.wrap:has(>.ph-purpose)>.article-header{order:1;padding:24px 0 12px}
.wrap:has(>.ph-purpose)>.ph-tabs{order:1}
.wrap:has(>.ph-purpose)>.ph-purpose{order:3;margin-top:36px}
.wrap:has(>.ph-purpose)>footer{order:9}

/* Nov 20, 2026: sub-tab strip (Overview, AI, Robotics...) goes first inside its panel */
.ph-panel.ph-on:has(>.tabs){display:flex !important;flex-direction:column !important}
.ph-panel.ph-on:has(>.tabs)>*{order:2 !important}
.ph-panel.ph-on:has(>.tabs)>.tabs{order:1 !important;margin:0 0 16px !important}

/* Nov 20, 2026: city tab strips (div.tabs) also go first on every planet page */
.wrap:has(>.ph-purpose)>.tabs{order:1;margin-top:0}
.wrap:has(>.tabs):not(:has(>.ph-purpose)){display:flex;flex-direction:column}
.wrap:has(>.tabs):not(:has(>.ph-purpose))>*{order:2}
.wrap:has(>.tabs):not(:has(>.ph-purpose))>.nav{order:0}
.wrap:has(>.tabs):not(:has(>.ph-purpose))>.article-header{order:1}
.wrap:has(>.tabs):not(:has(>.ph-purpose))>.tabs{order:1}
.wrap:has(>.tabs):not(:has(>.ph-purpose))>footer{order:9}
