/* One set of materials and selected states throughout the game. */
:root{--notice-height:36px;--game-height:calc(100dvh - var(--notice-height));--command-blue:linear-gradient(110deg,#092a50,#155a91 55%,#082c53);--command-gold:#e8bc67}
:root body#realm-ui[data-ui-theme] .notification-berth{position:fixed;inset:auto 0 0;height:var(--notice-height);z-index:110;background:#21180f var(--weathered-oak) center/700px;border-top:1px solid #967143;pointer-events:none}
:root body#realm-ui[data-ui-theme] #toast,:root body#realm-ui[data-ui-theme][data-view=map] #toast{position:absolute;inset:0 auto 0 0;transform:none;display:flex;align-items:center;max-width:100%;width:max-content;height:100%;min-height:0;margin:0;padding:4px 12px;border:0;border-image:none;clip-path:none;border-radius:0;background:none;box-shadow:none;color:#ffebbe;font-size:13px;line-height:1.2;text-align:left;overflow:auto;pointer-events:auto}
:root body#realm-ui[data-ui-theme] #toast[hidden]{display:none}
:root body#realm-ui[data-ui-theme] #toast.error{color:#ffad91}
:root body#realm-ui[data-ui-theme] #sidebar #navigation .nav-item.active::before{background-image:url('/art/caribbean/menu-sign-active.webp')}
:root body#realm-ui[data-ui-theme] #sidebar #navigation .nav-item.active .nav-label{color:#fff4d0}
:root body#realm-ui[data-ui-theme] #sidebar #navigation .nav-item.active .nav-label::after{display:none}
:root body#realm-ui[data-ui-theme] #workspace .header-shortcuts button.active{background:var(--command-blue);border:1px solid #e8bc67;box-shadow:inset 0 0 0 1px #11253a;border-radius:0}
:root body#realm-ui[data-ui-theme] #workspace .island-subnav nav button[aria-current=page]{background:var(--command-blue);color:#fff3cb;box-shadow:inset 0 0 0 1px #e9c77c}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.captain-stats>div,.painted-ranking-table thead th){background:#21180f var(--weathered-oak) center/600px;color:#ffe8b5;border-color:#ac8247}
:root body#realm-ui[data-ui-theme] #workspace #content-page .recruitment-stock{display:flex;align-items:center;justify-content:center;gap:10px;min-height:23px;font-size:15px}
:root body#realm-ui[data-ui-theme] #workspace #content-page .recruitment-stock svg{width:13px;height:15px}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.fleet-tabs,.construction-catalog nav) button{border:5px solid transparent;border-image:var(--carved-frame) 170 140 170 140 / 7px / 0 stretch;min-height:40px}
:root body#realm-ui[data-ui-theme] #workspace #content-page button.primary,:root body#realm-ui[data-ui-theme] #modal button.primary{background:var(--command-blue);color:#fff2d4;text-shadow:0 1px 2px #000;border:7px solid transparent;border-image:var(--carved-frame) 170 140 170 140 / 10px / 0 stretch}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.realm-section-tabs,.fleet-tabs,.construction-catalog nav,.ranking-tabs,.tab-strip) button:is([aria-current=page],[aria-pressed=true],.active){background:var(--command-blue);color:#fff3cb;box-shadow:inset 0 0 0 1px #e9c77c;text-shadow:0 1px #000}
:root body#realm-ui[data-ui-theme] #workspace :is(.realm-section-tabs,.island-subnav nav,.fleet-tabs,.construction-catalog nav) button:is([aria-current=page],[aria-pressed=true],.active)::after{display:none}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.building-ribbon,.recruitment-catalog)>button[aria-pressed=true]{background:var(--command-blue);box-shadow:inset 0 0 0 2px #f3cf82;outline:0;color:#fff1c9}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.building-ribbon,.recruitment-catalog)>button[aria-pressed=true]>span{background:#103960;color:#ffefc2}

/* The island work plan is part of the existing timber panel, never a replacement. */
:root body#realm-ui[data-ui-theme] #workspace #content-page .island-command-rail{gap:8px}
:root body#realm-ui[data-ui-theme] #workspace #content-page .island-command-rail .scene-inspector{order:0}
:root body#realm-ui[data-ui-theme] #workspace #content-page .island-command-rail :is(.scene-inspector,.scene-inspector article){background:#21190f var(--weathered-oak) center/600px}
:root body#realm-ui[data-ui-theme] #workspace #content-page .island-command-rail .scene-orders{order:1;display:block;background:#21190f var(--weathered-oak) center/600px;padding:5px 7px}
:root body#realm-ui[data-ui-theme] #workspace #content-page .scene-orders-heading,:root body#realm-ui[data-ui-theme] #workspace #content-page .plan-heading{display:flex;align-items:center;gap:8px;font-size:18px;font-weight:500;color:#ffe6b3;margin:0;padding:7px 3px;border-bottom:1px solid #9e7942}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.scene-orders-heading,.plan-heading) .painted-icon{width:28px;height:28px;flex:none}
:root body#realm-ui[data-ui-theme] #workspace #content-page .scene-job{background:none;border:0;border-bottom:1px solid #88653955;box-shadow:none;color:#ffeac5}
:root body#realm-ui[data-ui-theme] #workspace #content-page .scene-job>span strong{white-space:normal;font-size:14px}
:root body#realm-ui[data-ui-theme] #workspace #content-page .scene-job-time{font-size:12px;max-width:74px;line-height:1.25}
:root body#realm-ui[data-ui-theme] #workspace #content-page .scene-build-plan{border:0;border-image:none;background:none;margin:0;padding:0;box-shadow:none;order:initial}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.scene-build-plan,.work-queue)>summary{display:flex;gap:8px;align-items:center;justify-content:flex-start;min-height:42px;padding:7px 4px;background:#120e0ab3;color:#ffe8b9;font-size:15px;border-bottom:1px solid #b58948;list-style:none}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.scene-build-plan,.work-queue)>summary::-webkit-details-marker{display:none}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.scene-build-plan,.work-queue)>summary>b{margin-left:auto;color:#fff1d1}
:root body#realm-ui[data-ui-theme] #workspace #content-page .disclosure-chevron{transition:transform .15s;display:inline-block;font-size:22px;line-height:18px}
:root body#realm-ui[data-ui-theme] #workspace #content-page details[open]>summary>.disclosure-chevron{transform:rotate(180deg)}
:root body#realm-ui[data-ui-theme] #workspace #content-page .scene-plan-tools{display:flex;align-items:center;gap:6px;padding:6px 2px;font-size:11px;color:#e3c89c}
:root body#realm-ui[data-ui-theme] #workspace #content-page .scene-plan-tools>span{margin-right:auto}
:root body#realm-ui[data-ui-theme] #workspace #content-page .scene-queue-list{list-style:none;margin:0;padding:0}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.scene-queued-job,.work-queue li){display:grid;grid-template-columns:40px minmax(0,1fr);gap:5px 8px;padding:8px 3px;border-top:1px solid #b18b4b88;background:#100d0980;margin:4px 0}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.scene-queued-job,.work-queue li)>img{display:block;width:40px;height:40px;object-fit:contain;grid-column:1;grid-row:1}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.scene-queued-job,.work-queue li) strong{display:block;font-size:15px;line-height:1.25;color:#ffedc5;white-space:normal}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.scene-queued-job,.work-queue li) small{display:block;font-size:12px;color:#ddbf8b;margin-top:3px}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.plan-row-controls,.work-queue li>div){display:flex;grid-column:2;justify-content:flex-end;gap:6px}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.plan-row-controls,.scene-plan-tools,.work-queue li>div)>button:not(.info-button){width:34px;min-width:34px;min-height:32px;padding:0;color:#ffe2a4;background:#21180e var(--weathered-oak) center/350px;border:5px solid transparent;border-image:var(--carved-frame) 170 140 170 140 / 6px / 0 stretch;border-radius:0;box-shadow:none}
:root body#realm-ui[data-ui-theme] #workspace #content-page :is(.plan-row-controls,.work-queue li>div)>button:disabled{opacity:.35;filter:grayscale(1)}
:root body#realm-ui[data-ui-theme] #workspace #content-page .plan-empty{font-size:13px;line-height:1.4;color:#dfc69a;margin:10px 4px}

/* Large, square research emblems; the order monitor has its own framed surface. */
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-scene{position:relative}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor{background:#21190f var(--weathered-oak) center/600px;border-width:9px;border-image-width:13px;color:#ffedc5;padding:4px 7px}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .research-project{position:relative;display:grid;grid-template-columns:34px minmax(0,1fr);gap:7px;padding:10px 2px;background:none;border:0;border-bottom:1px solid #987444;margin:0}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .research-project>img{width:34px;height:34px}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .research-project>strong{position:static;grid-column:2;max-width:none;font-size:13px;color:#ffe4ad}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .research-project h2{font-size:17px;margin:3px 0 6px;max-width:none}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .research-project progress{width:100%;height:8px;margin:5px 0}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .research-project span{font-size:12px}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .work-queue{margin:8px 0 0;padding:0;border:0;border-image:none;background:none;max-height:none;overflow:visible}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .work-queue ol{max-height:210px;overflow:auto}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-node[aria-pressed=true] .research-hex{background:#ffdc85}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-node[aria-pressed=true] .research-hex::before{background:var(--command-blue)}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-branch.selected{background:linear-gradient(#164d79,#081a2b);box-shadow:inset 0 0 0 1px #dbb873;outline:0}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-node .research-hex{box-sizing:border-box}
:root body#realm-ui[data-ui-theme] #workspace #content-page .research-node.queued .research-hex::before{background:#41331b}
@media(min-width:951px){
 :root body#realm-ui[data-ui-theme] #workspace #content-page .island-command-rail{max-height:calc(100% - 24px);scrollbar-color:#d7b16b #24180e}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .scene-chart{left:146px;right:auto;bottom:12px;width:190px;height:150px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .scene-chart svg{height:calc(100% - 22px);width:100%}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .scene-chart>span{position:absolute;left:10px;right:10px;bottom:5px;font-size:13px;line-height:18px;padding:2px;background:#20160fe8}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .scene-dispatch{left:146px;bottom:172px;width:190px;max-width:190px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .scene-ribbon-shell{left:350px;right:auto;transform:none;width:calc(100% - 680px)}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .captains-desk{height:calc(var(--game-height) - var(--workspace-top,128px) - 100px);max-height:none;grid-template-rows:60px 50px minmax(70px,1fr) 76px 44px;gap:4px 16px;overflow:hidden}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .captains-desk .study-heading{grid-row:1;min-height:0;padding:4px 10px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .captains-desk .desk-metrics{grid-row:2;padding:2px 0}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .captains-desk :is(.desk-orders,.desk-post){grid-row:3;min-height:0;overflow:auto;scrollbar-width:thin}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .captains-desk .desk-latest{grid-row:4;min-height:0;overflow:auto;scrollbar-width:thin}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .desk-shortcuts{position:static;grid-row:5;background:#21180f var(--weathered-oak) center/600px;padding:0}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-board{width:calc(100% - 280px);max-width:1000px;grid-template-columns:minmax(0,1fr);grid-template-rows:40px 30px minmax(260px,1fr) auto auto;overflow:auto}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor{position:absolute;left:146px;bottom:12px;width:256px;max-height:calc(100% - 24px);overflow:auto}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-tree{grid-row:3;container-type:size;min-height:260px;overflow:auto;padding:0;display:flex}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-branch{min-width:76px;flex:1 0 76px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-branch-title{height:58px;min-height:58px;font-size:12px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-branch-title .painted-icon{width:32px;height:32px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-ladder{flex:1;justify-content:space-around;gap:4px;min-height:0;padding:3px 0}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-node{width:clamp(42px,calc((100cqh - 92px)/4),72px);height:clamp(42px,calc((100cqh - 92px)/4),72px);min-width:42px;min-height:42px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-hex>.painted-icon{width:68%;height:68%;filter:none}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-node .node-lock{width:40%;height:50%}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-selection{grid-row:4}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-contribution{grid-row:5}
}
@media(max-width:950px){
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-scene{padding-top:110px;background-size:auto 360px}
 :root body#realm-ui[data-ui-theme] #mobile-dock{bottom:var(--notice-height)}
 :root body#realm-ui[data-ui-theme] #workspace{padding-bottom:calc(108px + env(safe-area-inset-bottom))}
 :root body#realm-ui[data-ui-theme] #mobile-dock button.active{background:url('/art/caribbean/menu-sign-active.webp') center/100% 100% no-repeat!important;border:0;box-shadow:none}
 :root body#realm-ui[data-ui-theme] #mobile-dock button.active::after{display:none}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-board{display:flex;flex-direction:column}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor{order:2;position:static;width:auto;margin:8px 4px;flex:none}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .research-project{padding:7px 2px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .research-project>strong{position:absolute;top:7px;right:2px;font-size:11px;max-width:72px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .research-project h2{font-size:15px;margin:4px 0;max-width:none}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .research-project>div>small{font-size:10px;display:block;padding-right:75px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-monitor .research-project progress{height:6px;margin:3px 0}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-tree{order:3;display:flex;overflow-x:auto;padding:6px;gap:4px;min-height:340px;scroll-snap-type:x proximity}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-branch{flex:0 0 98px;min-width:98px;display:flex;flex-direction:column;border-width:4px;border-image-width:6px;scroll-snap-align:start}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-branch-title{height:67px;min-height:67px;justify-content:flex-end}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-branch-title>span:not(.painted-icon){font-size:13px;background:#111a24}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-branch.selected .research-branch-title>span:not(.painted-icon){background:#124670}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-ladder{display:flex;flex:1;min-height:242px;gap:6px;padding:6px 0;justify-content:space-around}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-node{width:52px;height:52px;min-width:52px;min-height:52px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-hex>.painted-icon{width:34px;height:34px;filter:none}
 :root body#realm-ui[data-ui-theme] #workspace #content-page .research-node .node-lock{width:24px;height:28px}
 :root body#realm-ui[data-ui-theme] #workspace #content-page :is(.plan-row-controls,.scene-plan-tools,.work-queue li>div)>button:not(.info-button){min-width:42px;min-height:42px}
}
