/* Desktop window shell. Game colors stay terminal-green; only the layout behaves like an OS. */
:root{
  --desktop:#111a13;
  --desktop-grid:#243126;
  --window:#0d140f;
  --window-raised:#182219;
  --window-edge:#637052;
  --window-highlight:#aeb78a;
  --window-shadow:#020503c9;
  --title:#a98a45;
  --title-active:#d3b45f;
  --taskbar:#111811;
  --scrollbar-track:#10170f;
  --scrollbar-thumb:#536148;
  --scrollbar-edge:#87916e;
  --taskbar-height:34px;
  --desktop-bottom-gap:46px;
}

/* One square scrollbar theme for desktop windows, the start menu and portalled dropdowns. */
:where(.start-screen,.start-screen *,.terminal-select-list,.os-window,.os-window *,dialog.os-dialog-window,dialog.os-dialog-window *, .os-start-menu,.os-start-menu *)::-webkit-scrollbar{width:12px;height:12px}
:where(.start-screen,.start-screen *,.terminal-select-list,.os-window,.os-window *,dialog.os-dialog-window,dialog.os-dialog-window *, .os-start-menu,.os-start-menu *)::-webkit-scrollbar-track{background:var(--scrollbar-track);box-shadow:inset 1px 0 #030503}
:where(.start-screen,.start-screen *,.terminal-select-list,.os-window,.os-window *,dialog.os-dialog-window,dialog.os-dialog-window *, .os-start-menu,.os-start-menu *)::-webkit-scrollbar-thumb{min-height:24px;border:1px solid var(--scrollbar-edge);border-radius:0;background:var(--scrollbar-thumb);box-shadow:inset 1px 1px #a7af89,inset -1px -1px #263020}
:where(.start-screen,.start-screen *,.terminal-select-list,.os-window,.os-window *,dialog.os-dialog-window,dialog.os-dialog-window *, .os-start-menu,.os-start-menu *)::-webkit-scrollbar-corner{background:var(--scrollbar-track)}
@supports not selector(::-webkit-scrollbar){
  :where(.start-screen,.start-screen *,.terminal-select-list,.os-window,.os-window *,dialog.os-dialog-window,dialog.os-dialog-window *, .os-start-menu,.os-start-menu *){scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track)}
}

/* UI chrome should drag and click like a desktop, without accidental text selection. */
body,body *{-webkit-user-select:none;user-select:none}
input,textarea,[contenteditable="true"]{-webkit-user-select:text;user-select:text}

body.game-started{
  background-color:var(--desktop);
  background-image:
    linear-gradient(90deg,rgba(99,112,82,.055) 1px,transparent 1px),
    linear-gradient(rgba(99,112,82,.045) 1px,transparent 1px),
    radial-gradient(circle at 53% 42%,#253222 0,transparent 48%),
    linear-gradient(145deg,#121b14,#080d0a 72%);
  background-size:24px 24px,24px 24px,auto,auto;
}

.game-started .app-shell{padding:0;gap:0;background:transparent;isolation:isolate}
.game-started .scanlines{z-index:9999;opacity:.1}

/* The game desktop starts at the top edge; identity and status live in apps/taskbar. */
.game-started .topbar{
  display:none;
}

/* Win98-like taskbar: one launcher, running windows, compact resource tray. */
.game-started .main-nav{
  position:fixed;
  z-index:8500;
  left:0;
  right:0;
  bottom:0;
  height:var(--taskbar-height);
  min-height:var(--taskbar-height);
  padding:3px;
  border:1px solid var(--window-edge);
  background:#20281e;
  box-shadow:0 4px 18px #000c,inset 1px 1px #89916c55;
}
.game-started .main-nav button{
  min-width:0;
  border:1px solid transparent;
  padding:3px 7px;
  font-size:8px;
}
.game-started .main-nav button.active{
  border-color:#667050;
  background:#273322;
  box-shadow:inset 1px 1px #9aa27933;
}
.game-started .main-nav button.active:before{content:"● ";font-size:7px}
.game-started .main-nav .nav-end{margin-left:auto}

.game-started .workspace{
  position:relative;
  z-index:1;
  display:block;
  flex:1;
  min-height:0;
  overflow:hidden;
  padding-bottom:var(--desktop-bottom-gap);
}
.game-started .left-rail,.game-started .right-rail{display:contents}
.game-started .rail-tabs{display:none}

/* Shortcuts live below application windows, never over the map or dialog input. */
.os-desktop-icons{display:none}
.game-started .os-desktop-icons{position:absolute;z-index:0;inset:0 0 46px;display:block;padding:0;pointer-events:none}
.game-started .os-desktop-icon{position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:4px;width:72px;height:76px;margin:0;border:1px solid transparent;border-radius:0;padding:5px 2px;background:transparent;box-shadow:none;color:#c3c9a5;font:9px/1.4 var(--mono);cursor:default;touch-action:none;pointer-events:auto}
.game-started .os-desktop-icon.is-icon-dragging{z-index:1;opacity:.75;cursor:grabbing}
.os-desktop-icon img{display:block;flex:none;width:48px;height:48px;pointer-events:none;image-rendering:pixelated}
.os-desktop-icon span{max-width:100%;padding:1px 3px;white-space:nowrap;text-shadow:1px 1px #020503;pointer-events:none}
.game-started .os-desktop-icon.is-selected span{background:#314432;color:#ecd58b}

/* Shared raised-window treatment. */
.game-started .os-window{
  position:absolute;
  z-index:10;
  display:flex!important;
  flex-direction:column;
  margin:0;
  border:1px solid var(--window-edge);
  border-radius:2px;
  background:linear-gradient(145deg,rgba(21,31,22,.98),rgba(8,14,10,.985));
  box-shadow:2px 3px 0 #050805,8px 11px 28px var(--window-shadow),inset 1px 1px #9aa47b2e;
  overflow:hidden;
  transition:box-shadow .12s,border-color .12s,opacity .12s;
}
.game-started .os-window.is-active{
  border-color:#a68c4d;
  box-shadow:2px 3px 0 #050805,11px 15px 34px #000d,inset 1px 1px #d0bd7552;
}
.game-started .os-window.is-minimized{display:none!important}
.game-started .os-window.is-maximized{inset:8px 10px 54px!important;width:auto!important;height:auto!important;transform:none!important}

.game-started .terminal-card{padding:0}
.game-started .terminal-card>.card-title,
.game-started .turn-display>.card-title,
.game-started .map-column>.map-titlebar{
  position:relative;
  flex:0 0 23px;
  min-height:23px;
  margin:0;
  padding:3px 58px 3px 8px;
  border:0;
  border-bottom:1px solid #5e684d;
  background:#3b472b;
  color:#f1d981;
  cursor:grab;
  user-select:none;
  touch-action:none;
}
.game-started .os-window.is-active>.card-title,
.game-started .os-window.is-active>.map-titlebar{background:#69572d}
.game-started .terminal-card>.card-title:before,.game-started .map-column>.map-titlebar:before{content:"■";color:#d4b95e;font-size:6px}
.game-started .terminal-card>.card-title{font-size:9px}
.game-started .terminal-card>.card-title+*{min-height:0}
.game-started .terminal-card{font-size:8px}
.game-started .ruler-row h2{font-size:16px}.game-started .ruler-row p,.game-started .stat-grid span,.game-started .selection-panel,.game-started .force-item{font-size:8px}
.game-started .portrait{width:38px;height:42px;font-size:21px}.game-started .ruler-row{gap:8px;padding:3px}.game-started .stat-grid{margin-top:3px}.game-started .stat-grid span{padding:4px}.game-started .selection-panel h3{font-size:14px}
.game-started .terminal-log,.game-started .command-input input,.game-started .order-actions button,.game-started .order-queue,.game-started .legend,.game-started .turn-report{font-size:8px}
.game-started .faction-card>.ruler-row,.game-started .faction-card>.stat-grid{margin-inline:8px}
.game-started .faction-card>.ruler-row,.game-started .faction-card>.stat-grid{flex:none}
.game-started .selection-panel,.game-started .compact-list>#forceList,
.game-started .command-card>.terminal-log,.game-started .command-card>.command-input,
.game-started .command-card>.control-mode,.game-started .command-card>.advisor-button,
.game-started .order-card>.order-queue,.game-started .order-card>.order-actions{margin-left:8px;margin-right:8px}

.os-window-buttons{position:absolute;z-index:5;right:4px;top:3px;display:flex;gap:3px;margin:0}
.os-window-button{
  display:grid;
  place-items:center;
  width:15px;
  height:15px;
  border:1px solid #9c935f!important;
  padding:0!important;
  background:#151c13!important;
  color:#d8c56f!important;
  font:9px/1 var(--mono)!important;
  cursor:pointer!important;
  box-shadow:inset 1px 1px #626b4f;
}
.game-started .os-window.is-snapping{outline:1px dotted #d8c56f;outline-offset:-3px}
.os-window-resize{
  position:absolute;
  right:1px;
  bottom:1px;
  z-index:4;
  width:13px;
  height:13px;
  cursor:nwse-resize;
  touch-action:none;
  background:linear-gradient(135deg,transparent 0 46%,#48523d 47% 55%,transparent 56% 68%,#8a7a45 69% 77%,transparent 78%);
}
.os-window.is-maximized>.os-window-resize{display:none}
.game-started .os-window.is-closed{display:none!important}

/* Default desktop composition; positions are user-draggable and persisted. */
.game-started #resourcePanel{left:12px;top:6px;width:220px;height:74px}
.resource-window-body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;flex:1;min-height:0;padding:4px 7px;background:#0b120d}
.resource-window-body>button b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8px}
.fiscal-table-scroll{overflow-x:auto;max-width:100%}
.fiscal-summary .ledger-table td{vertical-align:top;white-space:normal}
.fiscal-summary .ledger-table small{display:block;color:var(--muted)}
.fiscal-summary details p{font-size:9px;line-height:1.65}
.fiscal-source{display:grid;gap:7px;margin-top:7px}
.fiscal-source-card{border:1px solid #3c4632;background:#141a11;padding:6px 7px}
.fiscal-source-card>header{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 8px;color:#d1c99f;font-size:9px}
.fiscal-source-card>header small{color:var(--muted)}
.fiscal-source-bar{display:flex;height:9px;margin:6px 0;border:1px solid #2b3324;background:#0d1109;overflow:hidden}
.fiscal-source-bar i{display:block;height:100%}
.fiscal-source-legend{display:grid;gap:3px;margin:0;padding:0;list-style:none}
.fiscal-source-legend li{display:grid;grid-template-columns:8px minmax(42px,auto) auto minmax(0,1fr);gap:6px;align-items:baseline;font-size:9px}
.fiscal-source-legend li>i{display:block;width:8px;height:8px}
.fiscal-source-legend li>b{color:#d1c99f}
.fiscal-source-legend li>small{color:#b7b08e}
.fiscal-source-legend li>em{overflow:hidden;color:#828875;font-style:normal;text-overflow:ellipsis;white-space:nowrap}
.fiscal-arrears{display:flex;flex-wrap:wrap;gap:5px 9px;align-items:center;margin-top:7px;border-top:1px dotted #343c2e;padding-top:6px;color:var(--muted);font-size:9px}
.fiscal-arrears b{color:#d1c99f;font-weight:400}
.fiscal-arrears button{margin-left:auto;padding:2px 7px;font-size:9px}
.resource-window-body>button{display:grid;grid-template-columns:19px 1fr;align-items:center;min-width:0;border:1px solid #47523e;padding:0;background:#121b13;color:inherit;cursor:pointer}
.resource-window-body i{display:grid;place-items:center;align-self:stretch;border-right:1px solid #47523e;background:#293525;color:#d8bd68;font:normal 9px serif}
.resource-window-body b{overflow:hidden;padding:0 4px;color:#cfd6ae;font-size:9px;text-align:right;text-overflow:ellipsis}
.game-started .turn-display{left:129px;top:96px;width:220px;min-width:0;height:174px;padding:0;text-align:left}
.game-started .turn-display>.card-title{display:flex;align-items:center;color:#f1d981;font-size:9px}
.game-started .turn-display>.card-title:before{content:"◆";margin-right:6px;color:#d4b95e;font-size:7px}
.game-started .turn-display .os-window-buttons{display:flex}
.os-calendar-body{display:flex;flex-direction:column;gap:4px;flex:1;min-height:0;padding:7px;background:#9ca08b;color:#10140f;box-shadow:inset 1px 1px #d8dacb,inset -1px -1px #4e5548}
.os-calendar-selectors{display:grid;grid-template-columns:.82fr 1.18fr;gap:5px}
.os-calendar-selectors>span,.os-calendar-selectors>strong{min-width:0;height:21px;margin:0!important;border:1px solid;border-color:#e4e5d7 #464c40 #464c40 #e4e5d7;padding:4px 6px;background:#c1c3b3;color:#172016!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 9px/1.2 var(--mono)!important;letter-spacing:0!important}
.os-calendar-days{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));width:100%;text-align:center}
.os-calendar-cycle{border:1px solid;border-color:#464c40 #e4e5d7 #e4e5d7 #464c40;padding:3px;background:#858b78;color:#f1f0da;font:8px/1.2 var(--mono);text-align:center;white-space:nowrap}
.os-calendar-week{border:1px solid;border-color:#464c40 #e4e5d7 #e4e5d7 #464c40;background:#858b78;color:#f1f0da;font-size:8px;line-height:16px}
.game-started .os-calendar-week span{color:#f1f0da;font-size:8px}
.os-calendar-days{flex:1;min-height:68px;grid-template-rows:repeat(4,1fr);border:1px solid;border-color:#464c40 #e4e5d7 #e4e5d7 #464c40;background:#d2d3c4;color:#172016}
.game-started .os-calendar-day{display:grid;place-items:center;min-width:0;border-right:1px dotted #a1a493;border-bottom:1px dotted #a1a493;color:#4e5548;font:7px/1 var(--mono)}
.game-started .os-calendar-day:nth-child(10n){border-right:0}.game-started .os-calendar-day.is-empty{color:transparent}.game-started .os-calendar-day.is-current{margin:1px;background:#304832;color:#f5e7aa;outline:1px dotted #e6dda9;outline-offset:-2px;font-weight:700}
.os-calendar-body .status-dot{align-self:stretch;border:1px solid;border-color:#464c40 #e4e5d7 #e4e5d7 #464c40;padding:3px 5px;background:#b6b9a7;color:#263d29;font-size:8px;white-space:nowrap}
.game-started #factionPanel{left:445px;top:610px;width:243px;height:144px}
.game-started #factionPanel{overflow:auto}
.game-started #factionPanel>.card-title{position:sticky;top:0;z-index:6}
.game-started #selectionRailPanel{left:0;top:285px;width:337px;height:265px}
.game-started #selectionRailPanel .selection-panel{flex:1;overflow:auto;padding-bottom:8px}
.game-started #forcesRailPanel{left:40px;top:563px;width:277px;height:191px}
.game-started .map-column{left:361px;right:auto;top:104px;bottom:auto;width:485px;height:500px;min-width:410px;min-height:320px}
.game-started #commandsRailPanel{left:auto;right:30px;top:57px;width:276px;height:413px}
.world-tabs{display:flex;flex:0 0 23px;border-bottom:1px solid #3d4737;padding:2px 5px;background:#111811}
.game-started .world-tabs button{flex:1;border:1px solid transparent;padding:2px 5px;background:transparent;color:#777f6d;font:8px/1 var(--mono);cursor:pointer}
.game-started .world-tabs button.active{border-color:#59634e;background:#273322;color:#e5cf7c;box-shadow:inset 1px 1px #77806444}
.world-tab-panel{flex:1;min-height:0;overflow:auto;padding:7px 8px}
.world-tab-panel{overflow-x:hidden;scrollbar-gutter:stable;overscroll-behavior:contain}
.world-tab-panel[hidden]{display:none!important}
.game-started .world-forces-panel>#forceList{margin:0}
.game-started .world-report-panel>.campaign-objective,.game-started .world-report-panel>.turn-report{margin:0 0 7px;padding:6px;line-height:1.55;overflow-wrap:anywhere}
.game-started .world-report-panel>.turn-report{border:1px solid #303a2d;background:#0a100b;color:#929983}
.orders-pane{display:flex;flex:0 0 144px;flex-direction:column;min-height:100px;margin-top:5px;border-top:1px solid #4b563f;background:#0a100b;overflow:hidden}
.orders-pane-title{display:flex;align-items:center;justify-content:space-between;flex:0 0 21px;padding:3px 8px;border-bottom:1px solid #303a2d;background:#172117;color:#d7bd69;font-size:8px}
.orders-pane-title small{color:#8d927b;font-size:7px}.orders-pane-title b{color:#d7bd69}
.command-entry-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:6px 0 3px}
.command-entry-header label{margin:0}
.command-entry-header>.command-book-button{flex:none;border:1px solid #586448;padding:3px 7px;background:#202c1d;color:#d7bd69;font:8px/1.2 var(--mono);cursor:pointer}

.game-started .map-column>.map-titlebar{display:flex;align-items:center}
.game-started .map-column>.map-toolbar{display:flex;flex:0 0 auto;flex-wrap:wrap;align-items:center;gap:3px 8px;min-height:25px;margin:0;padding:3px 6px;border-bottom:1px solid #3c4635;background:var(--window-raised)}
.game-started .map-column .layer-tabs{display:flex;flex-wrap:wrap;align-items:center;gap:1px;min-width:0;overflow:visible}
.os-map-caption{display:flex;align-items:center;gap:5px;min-width:0;overflow:hidden;text-overflow:ellipsis;color:#ffe08a;font-size:9px;white-space:nowrap}
.game-started .map-column .layer-tabs button{flex:none;padding:2px 7px;color:#d0c79b;font-size:8px;white-space:nowrap}
.game-started .map-column .layer-tabs button.active{color:#ffe38a;background:#161d13}
.game-started .map-column .map-actions{flex:none;margin:0 0 0 auto}
.game-started .map-column .map-actions button{flex:none;min-height:18px;padding:2px 6px;color:#d3c888;font:8px/1.2 var(--mono);white-space:nowrap}
.game-started .map-column .map-frame{min-height:0;border:0}
.game-started .map-column .map-footer{flex:0 0 24px;min-height:24px;gap:8px;padding:3px 7px;overflow:hidden;background:#0a100b;border-top:1px solid #3c4635}
.game-started .map-column .map-footer>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.game-started .map-column .map-footer>span:first-child{flex:1}
.game-started .map-column .map-footer>span:last-child{flex:0 1 auto;max-width:50%}
.game-started .map-column .map-legend{flex:0 0 74px;height:74px;min-height:74px;max-height:74px;align-content:flex-start;overflow:auto;scrollbar-gutter:stable;overscroll-behavior:contain;gap:4px 9px;padding:4px 16px 4px 8px;background:#0a100b;border-top:1px solid #3c4635}
.game-started .map-tooltip{max-width:200px;white-space:pre-line;overflow-wrap:anywhere;line-height:1.45}

.os-start-button{display:grid!important;place-items:center;flex:none;width:26px;min-width:26px!important;height:26px;border-color:#87916e!important;padding:0!important;background:#2d3929!important;color:#f0d983!important;font:700 15px/1 serif!important;box-shadow:inset 1px 1px #a9b08e,inset -1px -1px #080b08}
.os-start-button[aria-expanded="true"]{box-shadow:inset 1px 1px #080b08,inset -1px -1px #899171}
.os-start-menu{position:fixed;z-index:9000;inset:auto auto var(--taskbar-height) 0;margin:0;display:grid;grid-template-columns:1fr;grid-auto-rows:max-content;align-content:start;gap:2px;width:188px;height:max-content;max-height:calc(100dvh - var(--taskbar-height) - 8px);overflow:visible;border:1px solid #87916e;padding:5px 5px 5px 27px;background:#192218;color:inherit;box-shadow:2px 3px 0 #030503,10px 14px 32px #000c,inset 1px 1px #b5bc98}
.os-start-menu[hidden]{display:none}.os-start-menu:before{content:"三 国";position:absolute;inset:5px auto 5px 5px;width:17px;padding-top:7px;background:#3d4d37;color:#bfc79e;font:700 10px/1.45 serif;text-align:center}
.os-start-menu>button,.os-start-submenu>button{width:100%;border:1px solid transparent;padding:6px 7px;background:transparent;color:#cbd0ac;text-align:left;font-size:8px;cursor:pointer}
.os-submenu-trigger[aria-expanded="true"]{border-color:#6b765b;background:#293626;color:#ffe89b}
.os-start-menu .nav-command-book{color:#ead079}.os-submenu-trigger:after{content:"▶";float:right;color:#818a72;font-size:7px}
.os-start-submenu{position:fixed;z-index:1;display:grid;grid-template-columns:1fr;gap:2px;width:190px;max-height:calc(100vh - 44px);margin:0;border:1px solid #87916e;padding:4px;background:#192218;color:inherit;overflow:auto;box-shadow:2px 3px 0 #030503,8px 10px 24px #000b,inset 1px 1px #b5bc98}
.os-start-submenu[hidden]{display:none}.os-preset-row{display:grid;grid-template-columns:minmax(52px,1fr) 46px 46px;gap:3px;align-items:center;border-bottom:1px dotted #3d4838;padding:4px}.os-preset-row>span{color:#cbd0ac;font-size:8px}.os-preset-row>button{border:1px solid #56614e;padding:4px 3px;background:#151d15;color:#daca85;font-size:8px;cursor:pointer}
.os-task-strip{display:flex;align-items:center;gap:3px;min-width:0;max-width:none;flex:1;margin-left:2px;border-left:1px solid #47513e;padding-left:4px;overflow-x:auto;scrollbar-width:none}
.os-task-button{flex:1 1 74px;max-width:88px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-color:#485440!important;background:#151d15!important;text-align:left}
.os-task-button.is-minimized{color:#69705f!important}
.os-task-button[hidden],.os-resource-tray[hidden],.os-calendar-tray[hidden]{display:none!important}
.os-task-button.is-active{border-color:#9a9564!important;box-shadow:inset 1px 1px #050805,inset -1px -1px #6e7756}
.os-task-button[data-task-window="resourcePanel"]{display:none}
.os-task-button[data-task-window="calendarWindow"]{display:none}
.os-calendar-tray{position:relative;display:grid;place-items:end center;flex:none;width:24px;height:24px;border:1px solid #66705a;padding:7px 2px 2px;background:#c3c5b5;color:#263026;font:700 8px/1 var(--mono);cursor:pointer;box-shadow:inset 1px 1px #f0f0df,inset -1px -1px #343b31}
.os-calendar-tray:before{content:"";position:absolute;inset:2px 2px auto;height:5px;background:#536746}.os-calendar-tray[hidden]{display:none}
.os-resource-tray{display:flex;flex:none;gap:5px;border:1px solid #4f5a47;padding:4px 6px;background:#111811;color:#b5bc9b;font-size:7px;cursor:pointer;white-space:nowrap;box-shadow:inset 1px 1px #080b08,inset -1px -1px #6c755d}.os-resource-tray b{color:#dbc36f;font-weight:400}
.os-clock{align-self:center;margin:0 3px 0 0;border:1px solid #4f5a47;padding:4px 6px;background:#111811;color:#aeb59a;font-size:7px;white-space:nowrap}

/* Native dialogs keep their behavior, but read as movable OS windows. */
dialog{
  border-color:var(--window-edge)!important;
  border-radius:2px;
  background:linear-gradient(145deg,#172017,#0a100c 72%)!important;
  box-shadow:3px 4px 0 #030503,14px 18px 48px #000d,inset 1px 1px #9aa47b33!important;
}
dialog>.dialog-title{background:#4b4f2b;cursor:grab;user-select:none;touch-action:none}
dialog[open]:focus-within>.dialog-title{background:#69572d}
dialog.os-dialog-dragging{opacity:.93}
dialog.os-dialog-window.is-snapping{outline:1px dotted #e1ca78;outline-offset:-4px}
dialog.os-dialog-window{
  border:1px solid!important;
  border-color:var(--window-highlight) #30382d #30382d var(--window-highlight)!important;
  border-radius:0!important;
  padding:2px!important;
  background:#111911!important;
  box-shadow:2px 2px 0 #020302,10px 14px 36px #000b,inset 1px 1px #727d61!important;
}
dialog.os-managed-dialog{position:fixed;inset:0;margin:auto;resize:both;overflow:hidden;min-width:300px;min-height:160px;max-height:calc(100vh - 48px)}
dialog.os-managed-dialog.os-dialog-maximized{position:fixed!important;inset:8px 10px 44px!important;width:auto!important;max-width:none!important;height:auto!important;max-height:none!important;margin:0!important;resize:none}
dialog.os-managed-dialog.os-dialog-maximized>.dialog-content{max-height:none!important;height:calc(100% - 24px);overflow:auto}
dialog.os-managed-dialog.is-dialog-minimized{display:none!important}
.os-dialog-buttons{display:flex;flex:none;align-items:center;gap:3px;margin-left:auto}
dialog.os-dialog-window>.dialog-title .os-dialog-buttons button{display:grid;place-items:center;width:15px;height:15px;margin:0;border:1px solid;border-color:#d6d8c8 #3d4339 #3d4339 #d6d8c8;padding:0;background:#aeb19f;color:#151914;font:700 10px/1 sans-serif;box-shadow:none;cursor:pointer}
.os-dialog-task[hidden]{display:none!important}
dialog.os-dialog-window::backdrop{background:#020502b8}
dialog.os-dialog-window>.dialog-title{
  display:flex;align-items:center;min-height:22px;margin:0 0 2px;padding:3px 4px;border:0;background:#4b4f2b;color:#f0dfa0;font:700 9px/1 var(--mono);letter-spacing:.04em;cursor:grab;
}
dialog.os-dialog-window[open]:focus-within>.dialog-title,
dialog.os-dialog-window.is-active>.dialog-title{background:#69572d}
dialog.os-dialog-window>.dialog-title>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
dialog.os-dialog-window>.dialog-title>button{
  display:grid;place-items:center;flex:none;float:none;width:16px;height:15px;margin-left:auto;border:1px solid;border-color:#d6d8c8 #3d4339 #3d4339 #d6d8c8;padding:0;background:#aeb19f;color:#151914;font:700 11px/1 sans-serif;box-shadow:none;cursor:pointer;
}
dialog.os-dialog-window>.dialog-title .dialog-tools{display:flex;align-items:center;margin-left:auto}
dialog.os-dialog-window>.dialog-title .dialog-tools+.os-dialog-buttons{margin-left:3px}
dialog.os-dialog-window>.dialog-content{border-top:1px solid #303a2d;background:#101710}
.event-dialog.os-dialog-window{padding:2px!important;text-align:center;background:#111911!important;border-width:1px!important}
.event-window-body{padding:18px 24px 22px;background:radial-gradient(circle at 50% 0,#293020,#101710 58%)}
.event-window-body>p{color:var(--text);line-height:1.8}
.game-over-dialog.os-dialog-window{padding:2px!important}
.game-over-window-body{padding:24px;text-align:center}

/* Start menu as a centered boot window. */
.start-screen{background-color:#0c140e;background-image:linear-gradient(90deg,#1d291f55 1px,transparent 1px),linear-gradient(#1d291f44 1px,transparent 1px),radial-gradient(circle at 50% 42%,#263321,#080d0a 70%);background-size:28px 28px,28px 28px,auto}
.start-terminal.main-menu{border:1px solid #747e5e;box-shadow:4px 5px 0 #050805,18px 24px 60px #000c,inset 1px 1px #b7bd9040}
.main-menu .menu-header{min-height:68px;padding:9px 16px;background:#4b4f2b;border-bottom:1px solid #8e966f}
.main-menu .menu-header .brand-mark{width:42px;height:42px;font-size:25px;background:#111811}

body>.app-shell>footer{display:none}

@media(max-width:1250px) and (min-width:1001px){
  .game-started #resourcePanel{top:6px;height:74px}
  .game-started .turn-display{left:12px;top:88px;width:220px;height:174px}
  .game-started #factionPanel{left:12px;top:270px;width:220px;height:132px}
  .game-started #selectionRailPanel{left:12px;top:410px;width:224px;height:190px}
  .game-started #forcesRailPanel{left:12px;top:608px;width:220px;height:clamp(104px,calc(100dvh - 662px),191px)}
  .game-started .map-column{left:242px;right:270px;top:10px;bottom:48px;width:auto;height:auto}
  .game-started #commandsRailPanel{left:auto;right:12px;top:6px;width:250px;height:322px}
  .orders-pane{flex-basis:118px}
  .os-calendar-days{min-height:68px}
}
@media(max-width:1000px){
  .game-started{--taskbar-height:62px;--desktop-bottom-gap:74px}
  .game-started .os-desktop-icons{position:relative;inset:auto;display:grid;grid-template-columns:repeat(3,72px);gap:6px;justify-content:start;margin-bottom:8px}
  .game-started .os-desktop-icon{position:relative;left:auto!important;top:auto!important;touch-action:manipulation}
  .game-started .workspace{overflow:auto;padding:7px 7px var(--desktop-bottom-gap)}
  .game-started .os-window{position:relative!important;inset:auto!important;width:100%!important;height:auto!important;min-height:180px;margin-bottom:8px;transform:none!important}
  .game-started #resourcePanel{min-height:80px}.game-started .turn-display{min-height:194px}
  .game-started .map-column{min-width:0;min-height:440px}
  .game-started .left-rail,.game-started .right-rail{display:contents}
  .game-started .main-nav{display:grid;grid-template-columns:26px minmax(0,1fr) auto auto auto;grid-template-rows:26px 24px;gap:4px;align-items:center;overflow:visible}
  .game-started .os-start-button{grid-area:1/1}
  .game-started .os-task-strip{display:flex;grid-area:2/1/3/-1;width:100%;margin:0;padding:0;border:0;align-self:stretch;scrollbar-width:thin}
  .game-started .os-task-button{flex:0 0 88px;max-width:110px;min-width:68px}
  .game-started .os-resource-tray{grid-area:1/2;margin:0;min-width:0;overflow:hidden;justify-self:stretch}
  .game-started .os-calendar-tray{grid-area:1/3}
  .game-started .observer-controls{grid-area:1/4;margin:0}
  .game-started .os-clock{display:block;grid-area:1/5;margin:0}
  .game-started dialog.os-managed-dialog{inset:8px 3vw calc(var(--taskbar-height) + 8px)!important;min-width:0;width:94vw!important;max-width:94vw!important;height:max-content!important;max-height:calc(100dvh - var(--taskbar-height) - 16px)!important;margin:auto!important;resize:none}
  .game-started dialog.os-managed-dialog.os-dialog-maximized{height:auto!important}
}
.game-started .stat-grid button{background:transparent;text-align:left;font:inherit;font-size:8px;color:var(--muted);border:0;border-right:1px solid var(--line-dim);border-bottom:1px solid var(--line-dim);padding:4px;cursor:pointer}
.os-context-menu{position:fixed;inset:auto;margin:0;min-width:146px;padding:3px;border:1px solid #82906e;border-radius:0;background:#111910;box-shadow:2px 2px #000;color:var(--text);font:9px var(--mono);z-index:20000;max-height:calc(100vh - 8px);overflow:auto}
.os-context-menu[hidden]{display:none!important}
.os-context-menu button{display:block;width:100%;padding:6px 12px;border:0;border-radius:0;background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer;white-space:nowrap}
.os-context-menu hr{border:0;border-top:1px solid var(--line-dim);margin:3px 5px}
.os-shortcut-seal{display:grid;place-items:center;width:48px;height:48px;border:2px solid #8e9876;box-shadow:inset 2px 2px #414d34,inset -2px -2px #050905;background:#182115;color:var(--amber);font:26px serif;font-style:normal}

.game-started .map-tooltip.grain-tooltip{max-width:min(360px,calc(100% - 10px));font-size:10px;line-height:1.5}
