/* Atlas: an independent layout, scoped so Classic remains unchanged. */
.interface-switch { display:flex; align-items:center; gap:8px; margin-left:auto; font-size:12px; }
.interface-switch select { min-height:38px; width:auto; }
.atlas-shell[hidden] { display:none; }
body.theme-atlas {
 --bg:#0e181b; --panel:#17272b; --panel-2:#20343a; --line:#34484c;
 --text:#f1eee5; --muted:#b0c0be; --accent:#e6c17e;
 background:var(--bg); overflow:hidden;
 font-family:Inter,"Segoe UI",system-ui,sans-serif;
}
body.theme-atlas #app { display:flex; flex-direction:column; height:100dvh; min-width:0; min-height:0; overflow:hidden; }
body.theme-atlas .workspace,body.theme-atlas .layout-toolbar,body.theme-atlas .mobile-nav { display:none!important; }
body.theme-atlas #topbar { display:flex; flex:none; flex-wrap:wrap; align-items:center; gap:10px 20px; padding:14px 22px; background:#101f23; border-bottom:1px solid #3b4945; }
body.theme-atlas #topbar .brand { display:block; font:600 20px Georgia,serif; letter-spacing:2px; color:#efd39d; }
body.theme-atlas #status { display:flex; flex:1; gap:8px; min-width:0; }
body.theme-atlas #status .stat { border:0; background:transparent; padding:4px 9px; border-right:1px solid var(--line); }
body.theme-atlas .top-actions { order:3; width:100%; display:flex; gap:6px; }
body.theme-atlas .top-menu summary { color:var(--muted); background:transparent; min-height:40px; padding:8px 14px; font-size:13px; }
body.theme-atlas .top-menu[open] summary { background:var(--panel-2); color:var(--accent); }
body.theme-atlas [data-menu="views"],body.theme-atlas [data-menu="city"],body.theme-atlas [data-menu="commands"] { display:none; }
body.theme-atlas .menu-popover { background:#17272b; border:1px solid #566157; box-shadow:0 16px 40px #0008; }
body.theme-atlas button,body.theme-atlas select { min-height:44px; border-radius:10px; }
body.theme-atlas button { background:#21363b; border-color:#41565a; color:var(--text); }
body.theme-atlas button:hover:not(:disabled) { background:#2c464b; border-color:#b49a66; }
body.theme-atlas button.primary { color:#182125; background:#e6c17e; border-color:#e6c17e; font-weight:700; }
body.theme-atlas button.primary:hover:not(:disabled) { background:#f4d8a0; }
body.theme-atlas :focus-visible { outline:3px solid #f2d399; outline-offset:3px; }
body.theme-atlas .atlas-shell {
 display:grid; flex:1; min-height:0; gap:0;
 grid-template-columns:92px minmax(0,1fr) minmax(310px,370px);
 grid-template-rows:minmax(0,1fr) auto;
 grid-template-areas:"nav map inspector" "nav map turn";
}
.atlas-nav { grid-area:nav; display:flex; flex-direction:column; gap:10px; padding:20px 8px; border-right:1px solid var(--line); background:#101f23; }
body.theme-atlas .atlas-nav button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-height:76px; padding:10px 2px; font-size:11px; border:1px solid transparent; color:var(--muted); background:transparent; }
.atlas-nav-icon { font:28px/1 Georgia,serif; }
body.theme-atlas .atlas-nav button[aria-current="page"] { background:#30403a; color:#f4d69e; border-color:#897650; }
.atlas-map-slot { grid-area:map; min-width:0; min-height:0; padding:18px; display:flex; background:radial-gradient(ellipse at top,#29403d,transparent 75%); }
body.theme-atlas .atlas-shell .workspace-pane { container-type:normal; width:100%; max-width:none; border-radius:12px; flex-shrink:0; }
body.theme-atlas .atlas-shell .workspace-pane[hidden] { display:none!important; }
body.theme-atlas .atlas-shell .pane-header { padding:12px 16px; background:transparent; border-bottom:1px solid #ffffff10; }
body.theme-atlas .atlas-shell .pane-grip { color:var(--muted); opacity:1; cursor:default; min-height:0; padding:0; background:transparent; border:0; font-size:12px; text-transform:uppercase; letter-spacing:1px; }
body.theme-atlas .atlas-shell .grip-icon,body.theme-atlas .atlas-shell .pane-controls,body.theme-atlas .atlas-shell .pane-resize { display:none!important; }
body.theme-atlas .atlas-shell .pane-content { height:auto; max-height:none; overflow:visible; }
body.theme-atlas .atlas-shell .pane-content > .panel { padding:16px; background:transparent; }
body.theme-atlas .atlas-map-slot [data-view="map"] { display:flex; flex-direction:column; flex:1; min-height:0; border:1px solid #657263; box-shadow:0 12px 35px #0004; }
body.theme-atlas .atlas-map-slot .pane-header { display:none; }
body.theme-atlas .atlas-map-slot .pane-content { flex:1; display:flex; min-height:0; }
body.theme-atlas #map-area { flex:1; display:flex; flex-direction:column; min-height:0; height:100%; }
body.theme-atlas #map-wrap { flex:1; min-height:50px; }
body.theme-atlas #map-bar { flex:none; min-height:48px; background:#122326; border-top:1px solid var(--line); padding:6px 12px; }
body.theme-atlas #hover { min-width:0; font-size:12px; }
body.theme-atlas .touch-hint { display:none; }
body.theme-atlas .map-mode { background:#192d31; padding:8px 12px; gap:10px; }
body.theme-atlas .map-mode span { color:#c0ceca; font-size:12px; }
body.theme-atlas .objective-teaser { border:0; border-bottom:1px solid #465248; border-radius:0; background:#273931; color:#e2ce9e; padding:10px 14px; font-size:12px; }
body.theme-atlas .mobile-quick { display:flex; flex:none; padding:8px; gap:8px; border-top:1px solid var(--line); position:static; }
body.theme-atlas .mobile-quick button { flex:1; background:#1d3237; border:1px solid #42585a; border-radius:8px; min-height:44px; font-size:12px; }
.atlas-inspector { grid-area:inspector; display:flex; flex-direction:column; min-height:0; min-width:0; background:#132327; border-left:1px solid var(--line); }
.atlas-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:24px 20px 18px; }
.atlas-heading h1 { font:400 25px/1.15 Georgia,serif; color:#f1d8a4; margin:0; }
.atlas-heading p { margin:8px 0 0; font-size:11px; letter-spacing:1px; color:var(--muted); }
.atlas-back { display:none; }
.atlas-inspector-body { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:0 16px 16px; scrollbar-width:thin; }
body.theme-atlas .atlas-inspector-body > .workspace-pane { margin-bottom:12px; border:1px solid #33494a; background:linear-gradient(145deg,#1b3034,#17292d); }
.atlas-shortcuts { display:flex; flex-wrap:wrap; gap:8px; padding:0 16px 16px; }
.atlas-shortcuts[hidden] { display:none; }
.atlas-shortcuts button { flex:1; font-size:12px; }
body.theme-atlas #minimap { width:100%; height:auto; max-height:190px; object-fit:contain; display:block; border-radius:8px; }
body.theme-atlas .mobile-command-slot { display:block; padding:0 16px 16px; }
body.theme-atlas #unit-commands .buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
body.theme-atlas #unit-commands button { white-space:normal; height:auto; padding:10px; }
body.theme-atlas .stack-picker { max-height:240px; overflow:auto; }
body.theme-atlas .city-row,body.theme-atlas .player-row { padding:14px 0; }
body.theme-atlas .atlas-turn-slot { grid-area:turn; padding:12px 16px 16px; background:#132327; border-left:1px solid var(--line); border-top:1px solid var(--line); }
body.theme-atlas .atlas-turn-slot .workspace-pane { border:0; background:transparent; position:static; margin:0; }
body.theme-atlas .atlas-turn-slot .pane-header { display:none; }
body.theme-atlas .atlas-turn-slot #turn-button { padding:0; margin:0; position:static; background:transparent; }
body.theme-atlas #turn-button button { width:100%; min-height:52px; background:#e6c17e; color:#172328; font-weight:750; border-color:#e6c17e; border-radius:12px; box-shadow:0 4px 16px #0003; }
body.theme-atlas #log-panel { height:auto; padding:14px; }
body.theme-atlas #log { max-height:none; }
body.theme-atlas #bottom-side { width:auto; padding:14px; display:block; }
body.theme-atlas .modal { background:#17282d; border:1px solid #6e715c; border-radius:20px; box-shadow:0 24px 80px #0009; }
body.theme-atlas .modal-header { background:#1d3337; padding:18px 22px; }
body.theme-atlas .modal-header h2 { color:#efd7a6; font-family:Georgia,serif; font-size:22px; font-weight:400; }
body.theme-atlas .modal-footer { background:#122327; }
@media (max-width:1100px) {
 body.theme-atlas #topbar { padding:8px 14px; gap:6px 12px; }
 body.theme-atlas #topbar .brand { font-size:16px; }
 body.theme-atlas .atlas-shell { grid-template-columns:76px minmax(0,1fr) 310px; }
 .atlas-map-slot { padding:10px; }
 body.theme-atlas #status { gap:0; overflow:auto; flex-wrap:nowrap; white-space:nowrap; }
}
body.theme-atlas .atlas-compact {
 grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto auto;
 grid-template-areas:"content" "turn" "nav";
}
body.theme-atlas .atlas-compact .atlas-map-slot { grid-area:content; padding:8px; }
body.theme-atlas .atlas-compact .atlas-inspector { grid-area:content; border:0; display:none; }
body.theme-atlas .atlas-compact:not([data-tab="map"]) .atlas-inspector { display:flex; }
body.theme-atlas .atlas-compact:not([data-tab="map"]) .atlas-map-slot { display:none; }
body.theme-atlas .atlas-compact .atlas-turn-slot { padding:6px 10px; border-left:0; }
body.theme-atlas .atlas-compact #turn-button button { min-height:46px; }
body.theme-atlas .atlas-compact .atlas-nav { flex-direction:row; padding:5px 5px calc(5px + env(safe-area-inset-bottom)); gap:3px; border:0; border-top:1px solid var(--line); }
body.theme-atlas .atlas-compact .atlas-nav button { flex:1; min-width:0; min-height:56px; padding:5px 1px; gap:4px; font-size:10px; overflow-wrap:anywhere; }
body.theme-atlas .atlas-compact .atlas-nav-icon { font-size:21px; }
body.theme-atlas .atlas-compact .atlas-heading { padding:16px; }
body.theme-atlas .atlas-compact .atlas-heading h1 { font-size:23px; }
body.theme-atlas .atlas-compact .atlas-heading p { display:none; }
body.theme-atlas .atlas-compact .atlas-back { display:block; padding:8px 12px; font-size:12px; }
body.theme-atlas .atlas-compact .atlas-inspector-body { padding:0 12px 12px; }
@media(max-width:760px),(max-height:500px) and (pointer:coarse) {
 body.theme-atlas #topbar { padding:6px 10px 0; gap:4px 8px; }
 body.theme-atlas #topbar .brand { display:block; font-size:14px; letter-spacing:1px; }
 body.theme-atlas .interface-switch { font-size:11px; gap:5px; }
 body.theme-atlas .interface-switch select { min-height:36px; font-size:12px; padding:4px 8px; }
 body.theme-atlas #status { display:flex; order:2; flex:1 0 100%; padding:3px 0; gap:0; overflow-x:auto; }
 body.theme-atlas #status .stat { font-size:11px; padding:2px 7px; }
 body.theme-atlas .top-actions { order:3; gap:2px; }
 body.theme-atlas .top-menu summary { min-height:40px; font-size:12px; padding:6px 10px; }
 body.theme-atlas .menu-popover { position:fixed; top:126px; left:8px!important; right:8px!important; width:auto; max-height:calc(100dvh - 200px); overflow:auto; }
 body.theme-atlas .map-mode { padding:4px 6px; gap:6px; }
 body.theme-atlas .map-mode span { font-size:10px; }
 body.theme-atlas #map-bar { padding:4px 6px; }
 body.theme-atlas .objective-teaser { padding:6px 10px; min-height:40px; font-size:11px; }
 body.theme-atlas .mobile-quick { padding:5px; gap:4px; }
 body.theme-atlas .mobile-quick button { font-size:11px; }
 body.theme-atlas .atlas-turn-slot [data-view="turn"] { left:auto; right:auto; bottom:auto; width:100%; box-shadow:none; }
}
@media(max-height:720px) and (max-width:760px), (max-height:500px) and (pointer:coarse) {
 body.theme-atlas .objective-teaser { display:none; }
 body.theme-atlas .map-mode span { display:none; }
 body.theme-atlas .atlas-compact .atlas-nav button { min-height:48px; }
}
@media(max-height:500px) and (pointer:coarse) {
 body.theme-atlas #status { display:none; }
 body.theme-atlas #topbar .top-actions { width:auto; flex:1; order:0; }
 body.theme-atlas .interface-switch span { display:none; }
 body.theme-atlas .mobile-quick { position:absolute; right:16px; bottom:155px; padding:3px; background:#14282bed; border:1px solid var(--line); }
 body.theme-atlas .mobile-quick button { min-height:36px; padding:3px 8px; }
 body.theme-atlas .menu-popover { top:54px; }
 body.theme-atlas .atlas-compact .atlas-nav-icon { display:none; }
 body.theme-atlas .atlas-compact .atlas-nav button { min-height:44px; }
}

.atlas-overview { display:none; }
body.theme-atlas .atlas-overview { display:block; flex:none; font-size:12px; }
body.theme-atlas .atlas-shell [data-view="unit"] .pane-content { display:flex; flex-direction:column; }
body.theme-atlas .atlas-shell [data-view="unit"] .panel,body.theme-atlas .atlas-shell #unit { display:contents; }
body.theme-atlas .atlas-shell #unit > .panel-title { order:-2; padding:14px 16px 0; }
body.theme-atlas .atlas-shell #unit > .stack-picker { order:-1; margin:12px 16px; }
body.theme-atlas .atlas-shell .mobile-command-slot { order:0; }
body.theme-atlas .atlas-shell #unit > .grid2 { order:1; padding:16px; }
body.theme-atlas .atlas-shell #unit > p { order:2; margin:12px 16px; }
body.theme-atlas .atlas-nav-label { white-space:nowrap; }
body.theme-atlas .objective-toast { pointer-events:none; top:auto; bottom:150px; }
body.theme-atlas .atlas-compact .atlas-nav-label { font-size:10px; letter-spacing:0; }

body.theme-atlas .atlas-nav button { position:relative; }
body.theme-atlas .atlas-nav button[data-pending]:not([data-pending=""])::after {
 content:attr(data-pending); position:absolute; top:2px; right:3px; min-width:18px;
 padding:1px 4px; border-radius:12px; background:#e6c17e; color:#172328; font-size:11px; font-weight:700;
}
