@font-face{font-family:Cinzel;src:url(assets/ui/cinzel.woff2) format("woff2");font-weight:500 800;font-display:swap}
@font-face{font-family:Barlow;src:url(assets/ui/barlow-500.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:Barlow;src:url(assets/ui/barlow-600.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:Barlow;src:url(assets/ui/barlow-700.woff2) format("woff2");font-weight:700;font-display:swap}
:root{
  color-scheme:dark;
  --ink:#14231e;--panel:#21342b;--dark:#192923;--panel-hover:#304337;
  --frame:#786644;--edge:#4a5441;--gold:#edc47f;--gold-dark:#b69457;
  --bone:#f0e6cb;--dim:#b9beaa;--faint:#a2ac96;--cream:#f2deb2;
  --sans:Barlow,"Arial Narrow","Segoe UI",sans-serif;
  --display:Cinzel,Georgia,serif;
}
*{box-sizing:border-box}
html{background:var(--ink)}
body{margin:0;background:var(--ink);color:var(--bone);font:500 15px/1.4 var(--sans);overscroll-behavior:none}
button,a{-webkit-tap-highlight-color:transparent}
button{font:inherit;cursor:pointer}
button:focus-visible,a:focus-visible,canvas:focus-visible{outline:2px solid #ffd893;outline-offset:3px}
::selection{color:#1e2c23;background:#efd19a}
.game{display:grid;grid-template-rows:68px minmax(0,1fr) 132px;height:100vh;height:100dvh;min-height:315px;overflow:hidden}
.topbar{
  display:grid;grid-template-columns:minmax(207px,1fr) auto minmax(42px,1fr);align-items:center;
  gap:18px;position:relative;z-index:5;padding:0 24px;
  background:linear-gradient(180deg,#27382d,#1b2b24);
  border-bottom:1px solid #a88650;
  box-shadow:0 3px 13px #10201788;
}
.topbar::after{content:"";position:absolute;left:0;right:0;bottom:2px;height:1px;background:#5d573e;pointer-events:none}
.wordmark{
  display:flex;align-items:center;width:max-content;gap:10px;color:#ffebba;text-decoration:none;
  white-space:nowrap;font:800 clamp(19px,2.05vw,29px)/1 var(--display);letter-spacing:-.032em;
  text-shadow:0 2px 3px #0f1c13;
}
.wordmark img{width:42px;height:42px;display:block;filter:drop-shadow(0 2px 2px #0b1912)}
.stocks{
  display:grid;grid-template-columns:repeat(6,minmax(82px,1fr));align-items:center;
  background:#182821;border:1px solid #596048;border-radius:5px;box-shadow:inset 0 2px 4px #112016;
}
.stock{
  display:flex;gap:9px;align-items:center;justify-content:center;padding:6px 13px 7px;
  border-inline-start:1px solid #3a4d3e;
}
.stock:first-child{border-inline-start:0}
.stock svg{display:block;width:23px;height:23px;color:#ebbc6d;flex:none}
.stock:nth-child(2) svg{color:#c79969}
.stock:nth-child(3) svg,.stock:nth-child(5) svg{color:#e4ba72}
.stock:nth-child(4) svg{color:#c7ccab}
.stock:nth-child(6) svg{color:#a9c5a2}
.stock b,.stock small{display:block;white-space:nowrap}
.stock b{font-size:20px;font-weight:700;line-height:1;color:#fff0d0;font-variant-numeric:tabular-nums}
.stock small{font-size:10px;line-height:1.1;color:var(--dim);margin-top:4px;text-transform:uppercase;font-weight:600;letter-spacing:.075em}
.button{
  display:inline-flex;align-items:center;justify-content:center;min-width:35px;min-height:35px;
  color:var(--gold);border:1px solid var(--frame);border-radius:5px;
  background:linear-gradient(#304238,#24362d);
  box-shadow:inset 0 1px 0 #a99a7329,0 2px 4px #101f183b;
  transition:background .15s,border-color .15s,color .15s,box-shadow .15s;
}
.button:hover,.button.selected{
  color:#ffedbb;border-color:#e1b973;background:#3d4a37;box-shadow:inset 0 1px 0 #e5c18044,0 2px 4px #101f187a;
}
.button svg{width:18px;height:18px;display:block}
.icon-button{width:38px;height:38px;padding:0;flex:none}
.settings{justify-self:end}
.stage{position:relative;min-height:0;overflow:hidden;isolation:isolate;background:#61724f}
.map,.map canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.map canvas{touch-action:none;cursor:grab}
.map canvas:active{cursor:grabbing}
.map.placing canvas{cursor:crosshair}
.stage::after{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:1;
  box-shadow:inset 0 11px 22px #14221833,inset 0 -18px 32px #182a2062;
}
.ledger{
  position:absolute;z-index:3;top:22px;left:23px;width:280px;
  color:var(--bone);background:#1c2e25;border:1px solid #b3935b;border-radius:8px;
  box-shadow:0 6px 20px #1723188c;overflow:hidden;
}
.ledger-heading{
  display:flex;align-items:center;gap:10px;padding:12px 13px;
  border-bottom:1px solid #a78651;background:linear-gradient(105deg,#354537,#293b30);
}
.seal{
  width:33px;height:33px;color:#f5ca86;background:#27382b;border:1px solid #b2945e;border-radius:50%;
  flex:none;display:grid;place-items:center;box-shadow:inset 0 0 0 2px #26392d,0 1px 5px #131f16;
}
.seal svg{width:19px;height:19px}
.ledger h1,.work-tools h2,.inspect h2,.dialog-content h2{
  margin:0;font:700 21px/1.17 var(--display);letter-spacing:-.024em;color:#f6ddb0;
}
.ledger-body{padding:9px 11px 11px}
.steps{margin:0 0 6px;padding:0;list-style:none;display:grid;gap:2px}
.step{
  display:flex;align-items:center;justify-content:space-between;gap:6px;
  min-height:35px;padding:4px 5px;border-radius:4px;border:1px solid transparent;
}
.step.current{border-color:#847047;background:#344434}
.step-label{display:flex;align-items:center;gap:8px;font-size:14px;line-height:1.1;min-width:0}
.step.current .step-label{font-weight:700;color:#ffe7b1}
.step.done .step-label{color:#c6ceb3}
.step-icon{
  display:grid;place-items:center;width:22px;height:22px;border:1px solid #777a5c;border-radius:4px;color:#d3b078;flex:none;
}
.step-icon svg{width:14px;height:14px}
.step.done .step-icon{color:#d9e5b9;background:#3d593d;border-color:#78965c}
.step button{
  border:1px solid #68765a;background:#293b30;border-radius:4px;padding:4px 9px;
  color:#dce0c6;font-size:11px;font-weight:700;white-space:nowrap;min-width:49px;
}
.step.current button{background:#edc57f;color:#302a19;border-color:#ffdb96}
.step button:hover{background:#ffe0a1;color:#292617;border-color:#ffe0a1}
.shipment{border-top:1px solid #50654e;padding:9px 4px 8px}
.shipment>div:first-child{display:flex;align-items:center;justify-content:space-between;font-size:13px;color:#c3cdb2}
.shipment strong{color:#f8dfae;font-size:16px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}
.progress{height:7px;overflow:hidden;background:#354735;border:1px solid #52614a;border-radius:3px;margin:6px 0 0}
.progress i{display:block;width:100%;height:100%;background:#dabb74;transform:scaleX(var(--progress,0));transform-origin:left;transition:transform .22s ease}
.ledger.completed .progress i{background:#afca89}
.charter-reward{
  display:flex;align-items:center;gap:6px;border-top:1px solid #405340;padding:8px 4px 1px;
  color:#dfc496;font-size:12px;line-height:1.1;font-weight:600;white-space:nowrap;
}
.charter-reward svg{width:15px;height:15px;color:#e1b46d;flex:none}
.charter-reward small{margin-left:auto;color:#c1bda4;font-size:11px;font-weight:500}
.ledger.completed .charter-reward span{color:#cce4aa}
#charter-toggle,.mobile-goal{display:none}
.map-tools{position:absolute;z-index:2;display:grid;gap:5px;right:21px;bottom:46px}
.map-tools .button{background:#263c31;border-color:#948357}
.map-tools .button:hover{background:#41543e}
.map-caption{
  position:absolute;bottom:13px;right:22px;z-index:2;display:flex;align-items:center;gap:8px;
  color:#faefce;text-shadow:0 1px 5px #183226;text-transform:uppercase;
  font-size:11px;letter-spacing:.15em;font-weight:700;pointer-events:none;
}
.map-caption i{display:block;width:6px;height:6px;transform:rotate(45deg);background:#ecc276}
.place-help,.toast{
  position:absolute;z-index:3;left:50%;transform:translateX(-50%);max-width:calc(100% - 106px);
  border-radius:5px;box-shadow:0 4px 14px #152a1e7d;text-align:center;color:#f9ebc9;
  background:#263c2f;border:1px solid #bca065;padding:7px 12px;font-size:14px;pointer-events:none;
}
.place-help{top:15px;min-width:250px}
.toast{bottom:13px;min-width:160px}
.toast.error{background:#5b3a33;border-color:#c48e75}
.inspect{
  position:absolute;z-index:3;bottom:16px;left:23px;width:246px;padding:11px 13px;
  background:#1c3027;border:1px solid #9d8859;color:var(--bone);box-shadow:0 7px 18px #14241a8c;border-radius:7px;
}
.inspect h2{font-size:18px;margin:0 4px 3px 0}
.inspect p{margin:4px 0;color:#c1ceb1;font-size:13px}
.inspect p.inspect-status{color:#f5d591;font-weight:600}
.inspect-header{display:flex;align-items:center;justify-content:space-between}
.inspect .button{min-width:27px;min-height:27px;width:27px;height:27px;border-radius:4px}
.inspect .button svg{width:14px;height:14px}
.hidden,[hidden]{display:none!important}
.loading{
  z-index:4;position:absolute;inset:0;display:flex;justify-content:center;align-items:center;gap:11px;
  background:#20352a;color:#f4dec1;font-size:18px;font-weight:600;
}
.loader{width:18px;height:18px;border:2px solid #af99694d;border-top-color:#f1bd77;border-radius:50%;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(1turn)}}
.buildbar{
  position:relative;z-index:4;display:grid;grid-template-columns:minmax(79px,1fr) minmax(0,870px) minmax(101px,1fr);
  align-items:center;gap:16px;padding:10px 24px 12px;
  background:linear-gradient(180deg,#2a3a2e,#1d2e25 52%,#1c2a24);
  border-top:1px solid #b38e55;box-shadow:0 -5px 14px #12241a80;
}
.buildbar::before{content:"";position:absolute;top:2px;left:0;right:0;height:1px;background:#626046;pointer-events:none}
.work-tools{display:grid;gap:7px;justify-items:start;align-content:center}
.work-tools h2{font-size:19px;color:#f4d9a3}
.work-tools .button{width:38px;height:36px;min-height:36px}
.build-options{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;min-width:0}
.build-card{
  min-width:0;position:relative;height:104px;overflow:hidden;padding:4px 4px 6px;
  border:1px solid #77724e;border-radius:6px;color:#efe7cc;
  background:linear-gradient(#394735 0%,#304231 61%,#25372c 62%);
  display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:2px;
  transition:background .16s,border-color .16s,box-shadow .16s;
}
.build-card:hover,.build-card.selected{
  border-color:#f0c479;background:linear-gradient(#526044 0%,#3e513a 61%,#314633 62%);
}
.build-card.selected{box-shadow:inset 0 0 0 1px #e6b96983}
.build-art{
  width:100%;min-height:0;height:61px;display:flex;align-items:center;justify-content:center;
  padding:3px 10px 5px;position:relative;flex:1 1 auto;
}
.build-art::before{
  content:"";position:absolute;width:76%;height:72%;top:15%;
  background:radial-gradient(ellipse,#8a95633e 0%,#7583590e 59%,transparent 73%);pointer-events:none;
}
.build-art img{
  position:relative;display:block;width:100%;height:100%;object-fit:contain;min-height:0;min-width:0;
  filter:drop-shadow(0 4px 4px #101b13aa);transform:translateY(0);
  transition:transform .2s cubic-bezier(.16,1,.3,1),filter .18s;
}
.build-card:hover .build-art img,.build-card.selected .build-art img{transform:translateY(-2px) scale(1.05)}
.build-card strong{font-size:15px;font-weight:700;line-height:1.03;white-space:nowrap;padding:1px 0 0}
.build-card .cost{display:flex;align-items:center;gap:7px;color:#d7c7a1;font-size:12px;line-height:1.1;font-variant-numeric:tabular-nums}
.cost span{display:flex;align-items:center;gap:2px}
.cost svg{width:11px;height:11px;color:#edbd73}
.cost span:nth-child(2) svg{color:#c29872}
.build-card .key{
  position:absolute;top:5px;left:5px;z-index:1;font:600 10px/1 var(--sans);color:#c4c6a8;
  border:1px solid #667053;border-radius:3px;background:#24362ad4;padding:2px 4px;
}
.card-lock{display:none;position:absolute;z-index:1;right:5px;top:5px;color:#dfd1a2}
.card-lock svg{width:14px;height:14px}
.build-card.locked{color:#b9c1aa;border-color:#5d644b;background:linear-gradient(#2b3d31 0%,#28392e 61%,#233328 62%)}
.build-card.locked .build-art img{filter:saturate(.46) brightness(.84) drop-shadow(0 3px 3px #101b13)}
.build-card.locked .card-lock{display:block}
.build-card.locked .cost{color:#b4ae96}
.game-tools{display:grid;gap:4px;justify-items:end}
.sim-label{color:#d7bc8a;font-weight:700;line-height:1;text-transform:uppercase;font-size:10px;letter-spacing:.11em}
.tool-line{display:flex;align-items:center;gap:5px}
.speed{min-width:43px;height:38px;padding:0 6px;font-size:15px;font-weight:700;font-variant-numeric:tabular-nums}
.save-text{font-size:11px;color:#c6ccac;white-space:nowrap;display:flex;align-items:center;gap:4px}
.save-text::before{content:"";display:inline-block;width:5px;height:5px;border-radius:50%;background:#a6c287}
.save-text.unavailable::before{background:#e08c68}
dialog{
  max-width:min(410px,calc(100% - 28px));padding:0;color:var(--bone);border:1px solid #b19459;border-radius:8px;
  background:#20332a;box-shadow:0 12px 34px #111d16a8;
}
dialog::backdrop{background:#122019a8}
.dialog-content{padding:19px;min-width:0}
.dialog-heading,.dialog-actions{display:flex;align-items:center;justify-content:space-between;gap:10px}
.dialog-content p{color:#c6ceb4;font-size:15px;max-width:38ch}
.dialog-content .icon-button{min-width:34px;min-height:34px;width:34px;height:34px}
.reset-button,.dialog-button{
  border:1px solid #9d8355;border-radius:5px;padding:7px 11px;background:#344b3a;color:#f0dfba;font-weight:600;
}
.reset-button{background:#80513a;color:#fff0cd}
kbd{font:700 .92em var(--sans);border:1px solid #788969;border-radius:3px;padding:0 3px;color:#f2d59b}
@media(max-width:1000px){
  .topbar{grid-template-columns:minmax(177px,1fr) auto minmax(42px,1fr);padding-inline:16px;gap:12px}
  .stocks{grid-template-columns:repeat(6,minmax(69px,1fr))}.stock{padding-inline:8px;gap:6px}.stock svg{width:20px;height:20px}
  .buildbar{padding-inline:16px;gap:10px;grid-template-columns:minmax(60px,1fr) minmax(0,870px) minmax(91px,1fr)}
  .ledger{left:16px}
}
@media(max-width:760px){
  .game{grid-template-rows:94px minmax(0,1fr) 119px}
  .topbar{padding:5px 9px 7px;gap:3px 7px;grid-template-columns:minmax(0,1fr) 40px;grid-template-rows:38px minmax(0,1fr)}
  .wordmark{grid-column:1;gap:7px;font-size:23px}.wordmark img{width:34px;height:34px}
  .settings{grid-area:1/2;width:36px;height:36px;min-width:36px;min-height:36px}
  .stocks{grid-column:1/-1;width:100%;grid-template-columns:repeat(6,minmax(0,1fr))}
  .stock{min-width:0;gap:3px;padding:4px 2px}.stock b{font-size:15px}.stock small{font-size:8px;margin-top:2px;letter-spacing:.04em}.stock svg{width:15px;height:15px}
  .ledger{width:187px;top:8px;left:8px}
  .ledger-heading{gap:6px;padding:6px 6px 6px 8px}
  .ledger h1{font-size:13px}
  .seal{width:24px;height:24px}.seal svg{width:14px;height:14px}
  #charter-toggle{display:grid;place-items:center;width:32px;min-width:32px;min-height:30px;margin-left:auto}
  #charter-toggle svg{width:14px;height:14px}
  #charter-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
  .ledger-body{display:none}
  .ledger.expanded{width:min(256px,calc(100% - 58px))}
  .ledger.expanded .ledger-body{display:block}
  .ledger.expanded .mobile-goal{display:none}
  .mobile-goal{display:block;font-size:11px;line-height:1.1;font-weight:600;color:#e5d49c;padding:6px 8px 7px}
  .map-tools{right:8px;bottom:10px;gap:4px}.map-tools .button{width:39px;height:39px}
  .map-caption{display:none}
  .place-help{top:auto;bottom:10px;left:8px;transform:none;min-width:0;max-width:calc(100% - 59px);font-size:12px;padding:5px 8px;text-align:left}
  .toast{bottom:43px;font-size:12px;max-width:calc(100% - 61px)}
  .inspect{left:8px;bottom:10px;width:190px;padding:7px 9px}.inspect h2{font-size:14px}.inspect p{font-size:12px}
  .buildbar{
    padding:5px 6px max(3px,env(safe-area-inset-bottom));display:grid;gap:4px 5px;
    grid-template-columns:44px minmax(0,1fr);grid-template-rows:minmax(70px,1fr) 36px;
  }
  .work-tools{grid-area:2/1;display:flex;justify-content:flex-start;align-items:center}.work-tools h2{display:none}
  .work-tools .button{min-height:33px;height:33px;width:38px}
  .build-options{grid-area:1/1/2/3;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px}
  .build-card{height:100%;min-height:63px;padding:1px 1px 4px;gap:1px;border-radius:4px}
  .build-art{height:42px;padding:2px 5px 3px}
  .build-card strong{font-size:11px;white-space:nowrap;text-overflow:ellipsis;max-width:100%;overflow:hidden;padding:0 1px}
  .build-card .cost{font-size:10px;gap:3px}.cost svg{width:8px;height:8px}
  .build-card .key{display:none}.card-lock{right:3px;top:2px}.card-lock svg{width:11px;height:11px}
  .game-tools{grid-area:2/2;display:flex;justify-content:flex-end;gap:7px;align-items:center}
  .sim-label{display:none}.tool-line{order:2}.tool-line .button{min-height:33px;height:33px;width:39px;min-width:39px}.tool-line .button svg{width:16px;height:16px}
  .save-text{font-size:10px;margin-right:auto}
}
@media(max-width:355px){.stock svg{width:12px;height:12px}.stock small{font-size:7px}.build-card strong{font-size:10px}.build-card .cost{font-size:9px}}
@media(max-height:520px) and (min-width:761px){
 .game{grid-template-rows:55px minmax(0,1fr) 92px}.topbar{padding-inline:14px}.wordmark img{width:34px;height:34px}
 .buildbar{padding-block:5px 6px}.build-card{height:76px}.build-art{height:40px}
 .ledger{top:8px;left:8px}.ledger-heading{padding:7px 10px}.ledger-body{padding:3px 8px 8px}.step{min-height:28px}.ship-ment{padding:5px 4px}.map-tools{bottom:13px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}

.stocks.industry{grid-template-columns:repeat(8,minmax(65px,1fr))}
.stocks.industry .stock{padding-inline:9px}
.buildbar{grid-template-columns:minmax(56px,1fr) minmax(0,1050px) minmax(96px,1fr)}
.build-options{grid-template-columns:repeat(9,minmax(66px,1fr));overflow-x:auto;padding-bottom:3px;scrollbar-width:thin;scrollbar-color:#8d7651 #22362b}
.upgrade-action{display:block;margin-top:8px;padding:5px 9px;color:#242d1d;background:#e8c985;border:1px solid #b4935d;border-radius:4px;font-weight:700}
.upgrade-action:disabled{color:#aabb9d;background:#284537;border-color:#52604a;cursor:default}
.reserve-control{display:flex;align-items:center;gap:5px;margin-top:5px;font-size:13px}
.reserve-control input{accent-color:#d0ab62}
@media(max-width:1000px){.stocks.industry{grid-template-columns:repeat(8,minmax(48px,1fr))}.stocks.industry .stock{padding-inline:4px}}
@media(max-width:760px){
 .buildbar{grid-template-columns:44px minmax(0,1fr)}
 .build-options{grid-template-columns:repeat(9,minmax(60px,1fr));gap:4px;scroll-snap-type:x proximity}
 .build-card{scroll-snap-align:start}
 .stocks.industry{grid-template-columns:repeat(8,minmax(0,1fr))}
 .stocks.industry .stock{padding-inline:1px;gap:2px}
 .stocks.industry .stock svg{width:12px;height:12px}
 .stocks.industry .stock b{font-size:13px}
 .stocks.industry .stock small{font-size:7px;letter-spacing:0}
}
@media(min-width:761px){
 .topbar:has(.stocks.industry){grid-template-columns:minmax(255px,1fr) minmax(0,820px) minmax(52px,1fr)}
 .stocks.industry{grid-template-columns:repeat(8,minmax(0,1fr))}
 .stocks.industry .stock{min-width:0;padding-inline:4px}
}
@media(min-width:761px) and (max-width:1000px){
 .topbar:has(.stocks.industry){grid-template-columns:minmax(176px,1fr) minmax(0,820px) 40px}
 .wordmark{font-size:20px}
 .stocks.industry .stock{gap:4px}
 .stocks.industry .stock b{font-size:16px}
 .stocks.industry .stock svg{width:16px;height:16px}
}

.top-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;justify-self:end}
.research-open{height:38px;padding:0 9px;gap:5px;white-space:nowrap;background:#344536}
#forge-icon{display:flex;align-items:center}
.research-open strong{color:#ffedbf;font-size:16px;font-variant-numeric:tabular-nums}
.research-label{font-size:12px;color:#e1d0a5}
.stocks{grid-template-columns:none!important;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;width:100%;min-width:0}
.stock{min-width:0}
.stocks.steam .stock{gap:4px;padding-inline:3px}
.stocks.steam .stock svg{width:17px;height:17px}
.stocks.steam .stock b{font-size:17px}
.build-options{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(73px,1fr)}
.build-card .cost{flex-wrap:wrap;row-gap:1px;justify-content:center}
.field-tools{display:flex;gap:5px}
.ledger{max-height:calc(100% - 45px);overflow:auto;scrollbar-width:thin;scrollbar-color:#887854 #23382c}
.ledger .step{min-height:32px}
.research-panel{width:min(660px,calc(100% - 24px));max-width:none;max-height:min(740px,calc(100dvh - 34px))}
.research-content{display:flex;flex-direction:column;max-height:min(735px,calc(100dvh - 38px));overflow:hidden}
.forge-wallet{display:flex;align-items:center;justify-content:space-between;gap:9px;margin:13px 0 9px;padding:9px 11px;border:1px solid #806848;border-radius:5px;background:#192c23;color:#e0cda3}
.forge-wallet>div{display:flex;align-items:baseline;gap:9px}
.forge-wallet strong{font-size:23px;line-height:1;color:#f3d79d;font-variant-numeric:tabular-nums}
.forge-wallet small{color:#c4ccac;font-size:13px}
.tech-list{overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#8f7d56 #263a2e}
.tech-list h3{margin:12px 0 4px;color:#efd4a0;font:700 15px/1.2 var(--display)}
.tech{display:grid;grid-template-columns:33px minmax(0,1fr) auto;gap:9px;align-items:start;padding:10px 0;border-bottom:1px solid #435543}
.tech-icon{height:31px;display:grid;place-items:center;color:#dab678;background:#263b30;border:1px solid #716747;border-radius:4px}
.tech-icon svg,.tech-buy svg,.tech-done svg{width:17px;height:17px}
.tech h4{margin:0;color:#f2deaf;font-size:17px;line-height:1.15}
.tech p{margin:2px 0 0;color:#d3d9bd;max-width:none;line-height:1.2;font-size:14px}
.tech small{color:#e2ba8c;font-size:12px}
.tech-buy{min-width:69px;padding:0 7px;gap:3px;white-space:nowrap}
.tech-buy:not(:disabled){background:#e4c47d;color:#2d3321}
.tech-buy:disabled{opacity:.56;cursor:default}
.tech-done{display:flex;align-items:center;gap:4px;margin:6px 4px;color:#c9dda4;font-size:13px}
.offline-panel{max-height:calc(100dvh - 30px);width:min(412px,calc(100% - 24px))}
.offline-panel p{max-width:none}
#offline-results{list-style:none;padding:0;margin:0 0 13px;max-height:38vh;overflow:auto}
#offline-results li{display:flex;justify-content:space-between;gap:9px;align-items:center;padding:4px 0;border-bottom:1px solid #465b47;color:#d6dcc4}
#offline-results strong{color:#e4c889;font-variant-numeric:tabular-nums}
@media(min-width:761px){
 .topbar,.topbar:has(.stocks.industry){grid-template-columns:minmax(192px,max-content) minmax(0,930px) minmax(89px,max-content);gap:15px;justify-content:space-between}
}
@media(min-width:761px) and (max-width:1030px){
 .topbar,.topbar:has(.stocks.industry){grid-template-columns:minmax(176px,max-content) minmax(0,930px) minmax(76px,max-content);gap:9px}
 .top-actions{gap:4px}
 .research-label{display:none}
 .stocks.steam .stock{gap:2px;padding-inline:1px}
 .stocks.steam .stock svg{width:13px;height:13px}
 .stocks.steam .stock b{font-size:14px}
 .stocks.steam .stock small{font-size:8px;letter-spacing:.03em}
}
@media(max-width:760px){
 .topbar{grid-template-columns:minmax(0,1fr) auto}
 .top-actions{grid-area:1/2}
 .research-open{height:33px;min-height:33px;padding:0 7px}
 .research-open strong{font-size:14px}
 .buildbar{grid-template-columns:84px minmax(0,1fr)}
 .build-options{grid-template-columns:none;grid-auto-columns:minmax(65px,1fr)}
 .stocks .stock,.stocks.industry .stock{padding-inline:1px}
 .stocks.steam .stock{gap:1px}
 .stocks.steam .stock svg{width:10px;height:10px}
 .stocks.steam .stock b{font-size:12px}
 .stocks.steam .stock small{font-size:7px}
 .ledger{max-height:calc(100% - 100px)}
 .research-content{padding:13px}
 .tech{grid-template-columns:26px minmax(0,1fr) auto;gap:6px}
 .tech-icon{height:26px}
 .tech-buy{padding:0 4px;min-width:51px;min-height:31px}
 .tech p{font-size:13px}
}
@media(max-width:380px){.research-label{display:none}}
.build-card strong{font-size:13px;white-space:normal;text-align:center;line-height:1.05}
@media(max-width:760px){.build-card strong{font-size:11px}.build-art{height:39px}.build-card .cost{font-size:9px}}
@media(max-width:760px){
 .buildbar{grid-template-rows:minmax(0,1fr) 36px}
 .build-options{height:100%;min-height:0;align-content:stretch;overflow-y:hidden}
 .build-card{min-height:0}
 .stocks.steam .stock:nth-child(6)>span:first-child{display:none}
 .stocks.steam .stock:nth-child(6) b{font-size:11px}
}
@media(max-width:400px){.research-label{display:none}}

.sound-settings{
  display:grid;grid-template-columns:6rem minmax(0,1fr);align-items:center;
  gap:6px 12px;margin:1rem 0;padding:8px 12px 12px;border:1px solid #7e7252;
  border-radius:5px;color:#eee0b9;font-size:14px
}
.sound-settings legend{padding-inline:5px;font-weight:700}
.sound-settings input{width:100%;min-width:0;min-height:24px;accent-color:#dab87d}
#sound-toggle[aria-pressed=false]{color:#b0b5a1}

/* Shared map panels keep messages, inspection, and placement in document flow. */
.map-tools{right:max(12px,env(safe-area-inset-right));bottom:38px;gap:6px}
.map-tool-group{display:grid;grid-template-columns:repeat(2,38px);gap:4px}
.map-tools .button[aria-pressed=true]{color:#ffedbb;background:#4a533b;border-color:#e5bb71}
.map-feedback{
  position:absolute;z-index:3;bottom:14px;left:max(14px,env(safe-area-inset-left));
  width:min(408px,calc(100% - 124px));display:grid;gap:6px;align-items:end;justify-items:start;pointer-events:none
}
.map-feedback .inspect,.map-feedback .toast{position:static;transform:none;max-width:100%;margin:0}
.map-feedback .inspect,.placement-panel{pointer-events:auto}
.map-feedback .inspect{
  width:min(100%,276px);max-height:clamp(90px,40cqh,270px);overflow:auto;
  scrollbar-width:thin;overscroll-behavior:contain;touch-action:pan-y
}
.map-feedback .toast{font-size:13px;min-width:0;padding:5px 9px;text-align:left}
.stage{container-type:size}
.placement-panel{
  display:flex;justify-content:space-between;align-items:center;gap:6px 10px;flex-wrap:wrap;
  width:100%;padding:8px 9px;color:var(--bone);background:#1c3027;
  border:1px solid #b39459;border-radius:6px;box-shadow:0 7px 18px #14241a8c
}
.placement-copy{flex:1 1 135px;min-width:0}
.placement-copy h2{margin:0;color:#f6ddb0;font:700 14px/1.2 var(--display)}
.placement-copy p{margin:2px 0 0;color:#cad4ba;font-size:13px;line-height:1.2;overflow-wrap:anywhere}
.placement-copy p.error{color:#ffc3aa}
.placement-actions{display:flex;gap:5px;align-items:center;min-width:0}
.placement-actions .button{height:35px;min-height:35px}
.placement-actions .icon-button{width:35px;min-width:35px}
.placement-confirm{padding:0 11px;background:#ecc881;color:#282e1f;border-color:#e7c171;font-weight:700;white-space:nowrap}
.placement-confirm:not(:disabled):hover{background:#ffdd9b;color:#252d1d}
.placement-confirm:disabled{cursor:default;background:#39473a;color:#a9b09a;border-color:#647157}
.work-tools{min-width:0}
.field-tools{display:grid;grid-template-columns:repeat(2,36px);gap:4px}
.work-tools .button{width:36px;height:36px;min-width:36px;min-height:36px}
.game-tools{min-width:max-content}
#settings-panel{width:min(465px,calc(100% - 18px));max-width:none;max-height:calc(100dvh - 24px)}
#settings-panel .dialog-content{display:flex;flex-direction:column;max-height:calc(100dvh - 26px)}
.settings-scroll{overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:0 5px 2px 0}
.control-guide h3{margin:12px 0 4px;font:700 15px/1.2 var(--display);color:var(--cream)}
.control-guide p{max-width:none;margin:3px 0 7px}
.control-guide dl{display:grid;grid-template-columns:max-content 1fr;gap:4px 10px;margin:9px 0;color:#e0ddbe;font-size:13px}
.control-guide dd{margin:0}
.top-actions #sound-toggle{width:35px;height:35px}
#charter-toggle{display:grid;place-items:center;flex:none;margin-left:auto}
#charter-toggle svg{width:15px;height:15px}
#charter-toggle[aria-expanded=true] svg{transform:rotate(180deg)}
.ledger:not(.expanded) .ledger-body{display:none}
.ledger:not(.expanded) .mobile-goal{display:block;padding:6px 10px 7px;font-size:12px;color:#e5d49c}
.ledger h1{min-width:0;overflow-wrap:anywhere}
.ledger-heading{padding-right:8px}
.ledger{max-height:min(390px,calc(57% - 15px));overscroll-behavior:contain;touch-action:pan-y}
.stage:has(.inspect:not(.hidden),.placement-panel:not(.hidden)) .ledger{max-height:calc(48% - 8px)}
@media(max-width:1080px) and (min-width:761px){
  .stocks.steam .stock>span:first-child{display:none}
  .stocks.steam .stock b{font-size:15px}
  .stocks.steam .stock small{font-size:8px}
}
@media(max-width:760px){
  .game{grid-template-rows:auto minmax(0,1fr) auto;min-height:0}
  .topbar{padding:5px max(8px,env(safe-area-inset-right)) 6px max(8px,env(safe-area-inset-left));min-width:0;grid-template-rows:36px auto;gap:4px 6px}
  .top-actions{gap:4px}
  .wordmark{max-width:100%;font-size:clamp(16px,5vw,24px);gap:5px}
  .wordmark img{width:28px;height:28px}
  .wordmark span{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .research-open{min-width:36px}
  .research-label{display:none}
  .top-actions #sound-toggle,.top-actions .settings{width:33px;min-width:33px;height:33px;min-height:33px}
  .stocks.steam{grid-template-columns:repeat(5,minmax(0,1fr))!important;grid-auto-flow:row}
  .stocks.steam .stock{justify-content:center;padding:3px 1px;gap:4px}
  .stocks.steam .stock:nth-child(n+6){border-top:1px solid #3a4d3e}
  .stocks.steam .stock:nth-child(6){border-inline-start:0}
  .stocks.steam .stock:nth-child(6)>span:first-child{display:block}
  .stocks.steam .stock svg{width:12px;height:12px}
  .stocks.steam .stock b,.stocks.steam .stock:nth-child(6) b{font-size:13px}
  .stocks.steam .stock small{font-size:8px;margin-top:1px}
  .ledger{max-width:calc(100% - 17px);top:7px;left:max(7px,env(safe-area-inset-left))}
  .ledger.expanded{max-height:min(340px,calc(62% - 14px))}
  .stage:has(.inspect:not(.hidden),.placement-panel:not(.hidden)) .ledger.expanded{max-height:calc(47% - 8px)}
  .map-tools{right:max(7px,env(safe-area-inset-right));bottom:8px;gap:5px}
  .map-tool-group{grid-template-columns:repeat(2,40px);gap:4px}
  .map-tools .button{width:40px;height:40px;min-width:40px;min-height:40px}
  .map-feedback{left:max(7px,env(safe-area-inset-left));bottom:8px;width:calc(100% - 107px - env(safe-area-inset-right))}
  .map-feedback .inspect{width:min(100%,252px);padding:7px 9px}
  .map-feedback .inspect .button{min-width:34px;min-height:34px}
  .placement-copy p,.map-feedback .toast{font-size:12px}
  .placement-panel{padding:6px 7px;gap:5px}
  .placement-actions .button{height:37px;min-height:37px}
  .buildbar{
    grid-template-columns:minmax(144px,max-content) minmax(0,1fr);
    grid-template-rows:76px minmax(37px,auto);gap:4px 8px;
    padding:5px max(6px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))
  }
  .build-options{grid-auto-columns:minmax(71px,1fr);padding-bottom:2px}
  .build-card{min-height:69px;padding-bottom:4px}
  .build-card strong{font-size:11px}
  .field-tools{display:flex;gap:3px}
  .work-tools .button{width:34px;height:36px;min-width:34px;min-height:36px}
  .game-tools{gap:5px}
  .tool-line{gap:3px}
  .tool-line .button{min-width:32px;width:34px;height:35px}
}
@media(max-width:370px){
  .save-text{font-size:9px;white-space:normal;line-height:1.1}
  .stocks:not(.steam) .stock b{font-size:13px}
  .stocks:not(.steam) .stock svg{width:11px;height:11px}
  .stocks:not(.steam) .stock small{font-size:7px}
}
@media(max-height:410px) and (max-width:760px){
  .map-tools{bottom:5px;gap:3px}
  .map-tool-group{grid-template-columns:repeat(2,33px);gap:3px}
  .map-tools .button{width:33px;height:32px;min-width:33px;min-height:32px}
  .map-feedback{bottom:5px;width:calc(100% - 89px - env(safe-area-inset-right))}
  .map-feedback .inspect{max-height:max(65px,calc(100cqh - 47px))}
  .buildbar{grid-template-rows:64px 35px}
  .build-card{min-height:59px}
}
.map-feedback .toast{overflow-wrap:anywhere}
.map-tools .icon-button:focus-visible{outline-offset:1px}
.map.placing canvas:active{cursor:crosshair}
@media(max-width:760px){
  .placement-copy{flex-basis:112px}
}
@media(max-height:435px) and (max-width:760px){
  .stage:has(.inspect:not(.hidden),.placement-panel:not(.hidden)) .ledger{max-height:45px}
  .stage:has(.inspect:not(.hidden),.placement-panel:not(.hidden)) .ledger .ledger-body,
  .stage:has(.inspect:not(.hidden),.placement-panel:not(.hidden)) .ledger .mobile-goal{display:none}
  .map-feedback .inspect{max-height:max(55px,calc(100cqh - 92px))}
}
@media(max-width:760px){
  .topbar{padding-top:max(5px,env(safe-area-inset-top))}
  .stocks.industry:not(.steam){grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-auto-flow:row}
  .stocks.industry:not(.steam) .stock:nth-child(n+5){border-top:1px solid #3a4d3e}
  .stocks.industry:not(.steam) .stock:nth-child(5){border-inline-start:0}
  .stocks .stock.wide-stock>span:first-child{display:none}
  .stocks .stock.wide-stock b{font-size:12px}
}

.district-panel{width:min(590px,calc(100% - 20px));max-width:none;max-height:calc(100dvh - 24px)}
.district-content{display:flex;flex-direction:column;max-height:calc(100dvh - 28px);gap:10px}
.district-tabs,.district-actions{display:flex;flex-wrap:wrap;gap:6px}
.district-tabs .button,.district-card .button{padding:0 9px;min-height:32px}
.district-tabs [aria-pressed=true]{border-color:#e8c585;color:#ffe5ab;background:#47543c}
.district-list{overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:1px 4px 3px 1px}
.district-card{margin-bottom:7px;padding:8px 9px;border:1px solid #627257;border-left:3px solid var(--region-tone);border-radius:5px;background:#26392e}
.district-heading{display:flex;align-items:center;justify-content:space-between;gap:6px}
.district-card h3{margin:0;color:#f6ddb0;font:700 15px var(--display)}
.district-card p{margin:4px 0 6px;font-size:13px}
.district-card .atlas-action:not(:disabled){background:#ebc780;color:#282e1f}
.district-card .button:disabled{opacity:.56;cursor:default}
.cargo-ledger{display:grid;grid-template-columns:1fr auto;gap:5px 13px;color:#e6e3cb}
.cargo-ledger dd{margin:0;color:#ecca8a;font-variant-numeric:tabular-nums}
.build-art>svg{width:44%;height:70%;color:#e8c785;filter:drop-shadow(0 3px 3px #142319)}
@media(max-height:460px){.map-tools{gap:3px}.map-tool-group{gap:3px}.map-tools .icon-button{height:30px;min-height:30px}}

.sea-panel{width:min(792px,calc(100% - 24px));max-width:none;max-height:calc(100dvh - 24px)}
.sea-content{display:flex;flex-direction:column;gap:11px;max-height:calc(100dvh - 26px);overflow:hidden}
.sea-summary{display:flex;flex-wrap:wrap;gap:4px 16px;padding:8px 10px;background:#192b23;border:1px solid #5e6b50;border-radius:5px;font-size:13px;color:#d6d5b8}
.sea-summary strong{margin-inline-start:auto;color:#ebc989}
.sea-tabs,.sea-build-actions{display:flex;gap:5px;flex-wrap:wrap}
.sea-panel .button{padding:4px 10px;min-height:32px}
.sea-panel .dialog-heading .button{padding:0}
.sea-panel .button[aria-pressed=true]{background:#465541;border-color:#bc9863}
.sea-panel .button:disabled{opacity:.51;cursor:default}
.sea-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;align-items:start;gap:8px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:1px 4px 4px 1px;min-height:0}
.sea-list:has(.customs-grid){display:block}
.sea-list>p{grid-column:1/-1;margin:6px 0 10px;max-width:none}
.sea-card,.customs-lot{border:1px solid #627457;border-top:2px solid var(--isle-tone,#b49864);border-radius:6px;background:#273b31;padding:9px;min-width:0}
.sea-card h3,.customs-lot h3{margin:0;font:700 16px/1.13 var(--display);color:#f2d7a3}
.sea-card p,.customs-lot p{margin:4px 0 7px;font-size:13px;max-width:none}
.sea-card-head,.sea-route-head,.sea-voyage-stats,.landmark-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:6px}
.sea-panel .sea-visit{min-width:49px;flex:none}
.sea-chain{height:83px;display:flex;align-items:center;justify-content:center;gap:10px;color:#e8c785;background:radial-gradient(ellipse at 50% 77%,#70836b66,transparent 68%);margin:0 -1px 4px}
.sea-chain img{height:81px;width:42%;object-fit:contain;filter:drop-shadow(0 3px 2px #14281eaa)}
.sea-stock{display:grid;grid-template-columns:1fr 1fr;gap:3px 7px;margin:4px 0 7px;color:#cdd0b9;font-size:12px}
.sea-stock b{display:block;color:#efce96;font-size:15px}
.sea-build-actions .button{padding-inline:7px}
.sea-panel .sea-primary:not(:disabled){background:#e4c084;color:#243024;border-color:#ebc780;font-weight:700}
.sea-panel .sea-primary:not(:disabled):hover{background:#f0d29c;border-color:#ffe6b2}
.sea-route{margin-top:8px;padding:7px;background:#192f27;border:1px solid #50634f;border-radius:5px;font-size:12px}
.sea-route strong{color:#eece99}
.sea-route-head{align-items:center}
.sea-route .button{min-height:29px;padding-inline:7px;font-size:12px}
.sea-route .progress{height:4px}
.sea-voyage-stats{font-size:11px;color:#c7d2ba;margin:4px 0 5px}
.sea-selector{display:flex;flex-wrap:wrap;align-items:center;gap:4px}
.sea-selector>span{color:#cad3ba;margin-right:auto}
.customs-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.customs-lot p{color:#d2d6bc}
.landmark-heading{justify-content:flex-start;align-items:center}
.landmark-heading img{width:68px;height:82px;object-fit:contain;flex:none}
.project-stages{margin:6px 0 8px;padding-left:24px;color:#ddd0ac;font-size:13px}
.project-stages li{padding:2px 0 4px}
.project-stages span{display:block;color:#bdcbb3;font-size:12px}
.project-stages .done{color:#b9d2a8}
#sea-message{margin:0;color:#f0cf91;font-size:13px}
#sea-message:empty{display:none}
@media(max-width:610px){
  .sea-panel{width:calc(100% - 14px);max-height:calc(100dvh - 14px)}
  .sea-content{padding:11px;gap:7px;max-height:calc(100dvh - 16px)}
  .sea-list{grid-template-columns:1fr;padding-right:2px}
  .sea-summary{gap:4px 8px;font-size:12px;padding:5px 6px}
}
@media(max-width:360px){
  .customs-grid{grid-template-columns:1fr}
  .sea-route-head{align-items:flex-start}
}

.diamond-open{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:40px;padding:0 7px;color:#9ee0de;border-color:#698f87}
.diamond-open svg{display:block;width:18px;height:18px}
.diamond-open strong{font-size:14px;font-variant-numeric:tabular-nums}
.raid-alert{color:#ffd6ac!important;border-color:#d79266!important;box-shadow:inset 0 0 0 1px #d7926677}
.work-controls{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
.work-controls .button{padding:3px 7px;min-height:28px;font-size:12px}
.work-controls .button[aria-pressed=true]{background:#465541;border-color:#d8b376}
.frontier-panel{width:min(940px,calc(100% - 24px));max-width:none;max-height:calc(100dvh - 24px)}
.frontier-content{display:flex;flex-direction:column;gap:9px;max-height:calc(100dvh - 26px);overflow:hidden}
.frontier-status{display:flex;flex-wrap:wrap;align-items:center;gap:4px 15px;padding:8px 10px;background:#192b23;border:1px solid #697555;border-radius:5px;color:#d6d5b8;font-size:13px}
.frontier-status strong{margin-inline-start:auto;color:#a6ddda}
.frontier-tabs,.office-switches,.office-actions,.atlas-navigation{display:flex;flex-wrap:wrap;align-items:center;gap:5px}
.frontier-tabs{border-bottom:1px solid #58684d;padding-bottom:8px}
.frontier-panel .button{padding:5px 9px;min-height:34px;line-height:1.2}
.frontier-panel .dialog-heading .button{padding:0}
.frontier-panel .button:disabled{opacity:.48;cursor:default}
.frontier-panel .button[aria-pressed=true],.frontier-panel .active-office{background:#46553e;color:#f1d79a;border-color:#c2a06c}
.frontier-panel .primary-office:not(:disabled){background:#e3c189;color:#243024;border-color:#ecc684;font-weight:700}
.frontier-panel .gem-office{background:#2b4944;color:#bee9e5;border-color:#6f9d90}
.frontier-panel .gem-office:not(:disabled):hover,.diamond-open:hover{background:#3d5f53;color:#d5f4ed}
.frontier-body{overflow:auto;overscroll-behavior:contain;min-height:0;display:grid;gap:8px;scrollbar-width:thin;padding:1px 4px 4px 1px}
.frontier-body h3,.frontier-body h4{margin:0;line-height:1.15}
.frontier-body h3{font-family:var(--display);font-size:18px;font-weight:700;color:#f2d6a1}
.office-card{min-width:0;padding:10px;border:1px solid #687654;border-radius:6px;background:#273b31}
.office-card p{max-width:none;margin:5px 0 8px;font-size:13px;line-height:1.41}
.office-card svg{width:22px;height:22px;flex:none;color:#d4bc88}
.office-card .office-art{width:72px;height:60px;object-fit:contain;flex:none;filter:drop-shadow(0 3px 2px #16281d99)}
.office-card-head,.office-line{display:flex;align-items:center;justify-content:space-between;gap:8px}
.office-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:8px}
.office-line{background:#1b3027;border:1px solid #4f6250;border-radius:4px;padding:7px 8px;margin:6px 0;color:#ced3b8;font-size:13px;flex-wrap:wrap}
.office-line strong{color:#e9ca8f}
.office-actions{margin-top:6px}
.office-note{display:block;margin-top:6px;font-size:12px;color:#c7cfb8}
.office-field{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:7px 0 6px;font-size:13px;color:#ebcf99}
.office-field select{min-width:125px}
.frontier-panel :is(select,input:not([type=checkbox])){
  border-radius:4px;border:1px solid #70815f;color:#eee0b5;background:#1b2e25;min-height:34px;padding:3px 6px;font:inherit
}
.frontier-panel :is(select,input):focus-visible{outline:2px solid #d8b37b;outline-offset:1px}
.atlas-navigation input{width:70px;margin-left:4px}
.atlas-navigation label{font-size:13px;color:#dfc597}
.atlas-navigation button:last-child{margin-left:auto}
.province-card{border-top:2px solid var(--biome);background:linear-gradient(130deg,#293d30,#26392f)}
.province-heading{display:grid;grid-template-columns:70px minmax(0,1fr) max-content;align-items:center;gap:10px}
.province-banner{width:70px;height:68px;display:grid;place-items:center;border-radius:4px;background:color-mix(in srgb,var(--biome) 48%,#19352a);border:1px solid var(--biome)}
.province-banner svg{width:34px;height:34px;color:#f1d6a4}
.province-heading h3{font-size:25px}
.province-heading p{margin:3px 0;color:#cdd4bc}
.province-meta{font-size:12px;color:#d3c196}
.raid-card{background:#42352a;border-color:#b27756}
.raid-card .office-line{background:#342c22;border-color:#8f644c}
.company-roster{display:flex;flex-wrap:wrap;gap:4px;margin:6px 0;font-size:12px}
.company-roster span{flex:1 1 65px;min-width:0;padding:5px 6px;border:1px solid #526650;border-radius:4px;background:#203229}
.company-roster b{display:block;color:#ecd09a;font-size:16px;line-height:1.1}
.recruit-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
.recruit-options>div{display:grid;align-content:space-between;gap:4px;padding:5px;border:1px solid #56684c;border-radius:4px}
.recruit-options small{font-size:11px;color:#d7ceb1;line-height:1.2}
.office-subheading{margin-top:9px!important;font:700 12px var(--body);color:#d9bc83}
.office-list{list-style:none;margin:6px 0 0;padding:0;font-size:13px;color:#d3d9c3}
.office-list li{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:5px 1px;border-bottom:1px solid #51654d}
.office-list li:last-child{border-bottom:0}
.office-list li strong{color:#e4c593}
.office-trades{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.office-catalog-heading{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:7px}
.office-catalog-heading h3{margin-right:auto}
.office-catalog-heading input{width:min(100%,190px)}
.office-catalog-heading select{max-width:100%}
.office-catalog{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:5px}
.catalog-item{display:grid;grid-template-rows:42px auto auto;justify-items:center;gap:3px;color:#ecd5a9;text-align:center;min-width:0}
.catalog-item .office-art{width:80px;height:44px}
.catalog-item svg{align-self:center}
.catalog-item strong{font-size:12px}
.catalog-item small{font-size:11px;color:#bdc7ae}
.office-repeat{display:flex;align-items:center;gap:5px;margin-top:9px;color:#d4d3b5;font-size:12px}
.office-repeat input{accent-color:#d3ad70;width:16px;height:16px}
.gem-wallet{display:flex;align-items:center;gap:12px;background:#294741;border-color:#71968a}
.gem-wallet svg{width:35px;height:35px;color:#a6ddda}
.gem-wallet p{margin-bottom:0}
.wallet-team{justify-content:flex-start}
.offer-card{display:flex;flex-direction:column;align-items:flex-start;min-height:121px}
.offer-card>.button{margin-top:auto}
#frontier-notice{margin:0;color:#f0ce92;font-size:13px}
#frontier-notice:empty{display:none}

@media(max-width:760px){
  .diamond-open{min-height:33px;height:33px;min-width:35px;padding:0 5px}
  .diamond-open svg{width:15px;height:15px}
  .diamond-open strong{font-size:12px}
  .frontier-panel{width:calc(100% - 14px);max-height:calc(100dvh - 14px)}
  .frontier-content{padding:10px;gap:7px;max-height:calc(100dvh - 16px)}
  .frontier-panel .button{font-size:12px;padding-inline:7px}
  .frontier-status{font-size:12px;padding:5px 6px;gap:4px 9px}
  .frontier-tabs{padding-bottom:6px;gap:4px}
  .office-pair{grid-template-columns:minmax(0,1fr)}
  .province-heading{grid-template-columns:42px minmax(0,1fr) max-content;gap:6px}
  .province-banner{width:42px;height:50px}
  .province-banner svg{width:24px;height:24px}
  .province-heading h3{font-size:19px}
  .province-heading .province-meta{font-size:11px}
  .atlas-navigation input{width:53px}
  .atlas-navigation button:last-child{margin-left:0}
  .office-card{padding:8px}
  .office-catalog-heading input{flex:1 1 135px;width:0;min-width:115px}
  .office-catalog{grid-template-columns:repeat(auto-fit,minmax(105px,1fr))}
}

.tool-line .clock-open{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:66px;width:auto;padding:0 6px;font-size:13px}
.clock-open svg{display:block;width:16px;height:16px}
.clock-open strong,.clock-overview time,.clock-overview strong,.clock-eta{font-variant-numeric:tabular-nums}
.clock-open.clock-paused{color:#c1c4b2;border-color:#77806a}
.clock-panel,.cities-panel{width:min(850px,calc(100% - 24px));max-width:none;max-height:calc(100dvh - 24px)}
.clock-content,.cities-content{display:flex;flex-direction:column;gap:9px;max-height:calc(100dvh - 26px);overflow:hidden}
.clock-scroll,.cities-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:1px 4px 4px 1px}
.clock-panel h3,.cities-panel h3,.city-create legend{margin:0;color:#f2d6a1;font:700 18px/1.14 var(--display)}
.clock-overview{display:flex;align-items:center;flex-wrap:wrap;gap:9px 13px;padding:8px 10px;border:1px solid #697555;border-radius:5px;background:#192b23}
.clock-overview div{min-width:0}
.clock-overview div:first-child{flex:1 1 120px}
.clock-overview small{display:block;color:#aebca7;font-size:12px;line-height:1.2;overflow-wrap:anywhere}
.clock-overview strong,.clock-overview time{color:#f0ce93;font-size:17px}
.clock-overview time{color:#e0dcc2;font-size:14px}
#clock-rate{padding:3px 6px;border-radius:4px;border:1px solid #71815d;color:#e2cca0;font-size:12px;white-space:nowrap}
.clock-overview .button,.clock-filters .button,.cities-panel .button,.settings-city-actions .button{min-height:34px;padding:4px 8px}
.clock-section{margin-bottom:10px}
.clock-section-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:5px}
.clock-filters{display:flex;flex-wrap:wrap;gap:3px}
.clock-filters .button[aria-pressed=true]{background:#46553e;border-color:#bc9f68;color:#efdaab}
.clock-hint{margin:4px 0 6px;font-size:12px;color:#c6d0b6}
.clock-list,.city-list{list-style:none;margin:5px 0 0;padding:0}
.clock-job,.city-item{display:flex;align-items:center;gap:5px 10px;min-width:0;min-height:40px;padding:6px 8px;background:#283c31;border:1px solid #52674f;border-radius:4px}
.clock-job+.clock-job,.city-item+.city-item{margin-top:4px}
.clock-job div,.city-item div{flex:1;min-width:0}
.clock-job strong,.city-item strong{display:block;color:#eccf9a;font-size:14px}
.clock-job small,.city-item small{display:block;color:#c5cdba;font-size:12px;overflow-wrap:anywhere}
.clock-eta{color:#e8d1a2;font-size:13px;text-align:right}
.clock-raid{background:#3d3528;border-color:#9c7752}
.clock-link{flex:none;display:grid;place-items:center;width:31px;height:31px;min-width:31px;min-height:31px;padding:0}
.clock-link svg{width:16px;height:16px}
.clock-records li{display:grid;grid-template-columns:max-content 1fr;gap:8px;align-items:baseline;padding:6px 2px;border-bottom:1px solid #53654d;color:#d9ddc6;font-size:13px}
.clock-records time{font-size:12px;color:#d9bd89}
.clock-list .clock-empty{display:block;padding:9px 0;color:#bfcbbc;font-size:13px}
.cities-panel h2{display:flex;gap:7px;align-items:center}
#cities-icon{display:grid;place-items:center;color:#eacb91}
#cities-icon svg{width:23px;height:23px}
.city-current{font-size:12px;color:#bacd9f}
.city-create{display:grid;gap:8px;margin-top:12px;padding:10px;border:1px solid #687654;border-radius:6px;background:#24382e}
.city-create>label{font-size:14px;color:#ecd2a0}
.city-create>input{min-height:38px;padding:5px 7px;border:1px solid #758960;border-radius:4px;background:#1b2e25;color:#f2dfba;font:inherit}
.city-create fieldset{margin:0;padding:0;border:0;min-width:0}
.city-create legend{margin-bottom:6px}
.city-plans{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.city-plan{cursor:pointer;min-width:0;display:grid;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:5px;padding:6px;background:#2d4236;border:1px solid #627452;border-radius:5px}
.city-plan:has(input:checked){border-color:#ddb778;background:#3d4e39}
.city-plan input{align-self:start;margin:2px 0;accent-color:#ddb778}
.city-plan canvas{width:100%;height:auto;max-height:92px;object-fit:cover;border-radius:3px}
.city-plan span{grid-column:1/-1;display:grid;gap:3px}
.city-plan strong{font:700 15px var(--display);color:#efd39f}
.city-plan small{color:#ccd0b9;font-size:12px;line-height:1.3}
.city-start{justify-self:start;background:#e2c083;color:#233127;border-color:#efca86;font-weight:700}
.city-start:hover{background:#efd59f;color:#233127}
.city-message{margin:6px 0 0;color:#f3c491;font-size:13px}
.city-message:empty{display:none}
.settings-city-actions{display:flex;flex-wrap:wrap;gap:8px}

@media(min-width:761px){
  .buildbar{grid-template-columns:minmax(76px,1fr) minmax(0,1050px) minmax(164px,1fr)}
}
@media(max-width:760px){
  .clock-panel,.cities-panel{width:calc(100% - 14px);max-height:calc(100dvh - 14px)}
  .clock-content,.cities-content{padding:10px;gap:7px;max-height:calc(100dvh - 16px)}
  .clock-overview{gap:5px 8px;padding:6px 7px}
  .clock-overview strong{font-size:14px}
  .clock-filters .button{font-size:12px;min-height:29px;padding:3px 6px}
  .tool-line .clock-open{min-width:57px;padding-inline:4px;font-size:12px;gap:2px}
  .clock-open svg{width:14px;height:14px}
  .city-plans{grid-template-columns:1fr}
  .city-plan{grid-template-columns:16px 76px minmax(0,1fr);align-items:center;gap:6px}
  .city-plan input{align-self:center}
  .city-plan canvas{max-height:57px}
  .city-plan span{grid-column:auto}
}
@media(max-width:350px){
  .game-tools .save-text{font-size:0;white-space:nowrap}
}

.artisan-research-link{align-self:flex-start;min-height:34px;margin:5px 0 1px;padding-inline:10px;border-color:#a68e5d;color:#f2d69b}
.artisan-hero{display:grid;grid-template-columns:108px minmax(0,1fr);align-items:center;gap:10px}
.artisan-home-art,.artisan-exhibition-art{width:100%;max-height:122px;object-fit:contain;filter:drop-shadow(0 4px 3px #17291e8c)}
.artisan-hero .office-line{margin:5px 0}
.artisan-construction{display:grid;gap:5px;margin-top:8px}
.artisan-build-item{display:grid;grid-template-columns:53px minmax(0,1fr) max-content;align-items:center;gap:6px;padding:3px 5px;background:#213429;border:1px solid #52664d;border-radius:4px}
.artisan-model{width:100%;height:47px;object-fit:contain}
.artisan-build-item strong,.artisan-build-item small{display:block}
.artisan-build-item strong{font-size:14px;color:#edd29e}
.artisan-build-item small{font-size:11px;color:#c9cfb7}
.artisan-build-item .button{max-width:108px}
.artisan-home-list .office-actions{justify-content:flex-end}
.artisan-notice{margin:0;color:#edca93;font-size:13px}
.artisan-notice:empty{display:none}
.gem-group-title{padding:3px 2px;color:#f0d49f}
.permanent-offer{align-items:stretch;border-color:#688a76}
.permanent-offer .office-art{width:73px;height:57px}
.permanent-offer>.button,.permit-active{align-self:flex-start}
.permit-active{padding:4px 0;font-size:13px;color:#b2dfb2}
.promote-note{overflow-wrap:anywhere}

@media(max-width:760px){
  .artisan-hero{grid-template-columns:67px minmax(0,1fr);align-items:start;gap:6px}
  .artisan-hero .office-line{gap:4px}
  .artisan-hero .office-actions{gap:4px}
  .artisan-build-item{grid-template-columns:44px minmax(0,1fr) max-content}
  .artisan-build-item .button{max-width:87px}
  .artisan-home-list li{align-items:start}
  .artisan-home-list .office-actions{flex-direction:column;align-items:flex-end}
}

.ledger-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(90px,.55fr);gap:8px;padding-bottom:5px}
.ledger-filters[hidden]{display:none}
.ledger-field{display:flex;min-width:0;flex-direction:column;gap:3px;font-size:12px;color:#e1c995}
.ledger-field input,.ledger-field select{font:inherit;font-size:16px;color:#f3e3ba;background:#172b24;border:1px solid #6f795b;border-radius:4px;min-width:0;min-height:36px;padding:5px 7px}
.ledger-field input:focus-visible,.ledger-field select:focus-visible{outline:2px solid #efca81;outline-offset:2px}
.ledger-list,.ledger-page{display:grid;gap:7px;min-width:0;align-content:start}
.ledger-page>.button{justify-self:start}
.ledger-row{display:flex;align-items:center;gap:9px;width:100%;text-align:left;padding:6px 10px;min-height:44px;min-width:0;background:#263c31;border:1px solid #55664e;border-radius:5px;color:#efdeb6;font:inherit}
button.ledger-row{cursor:pointer}
button.ledger-row:hover{background:#31483a;border-color:#c7a86e}
.ledger-row span:nth-last-child(2){flex:1;min-width:0}
.ledger-row strong,.ledger-row small{display:block;overflow-wrap:anywhere}
.ledger-row small,.ledger-event small,.ledger-history small{color:#bec9b1;font-size:12px}
.ledger-chev,.ledger-crop-stock{font-size:18px;color:#dec292}
.ledger-crop-stock{min-width:19px;text-align:right}
.ledger-portrait{background:#283d32;border:1px solid #8a7c57;display:grid;place-items:center;width:32px;height:36px;position:relative;overflow:hidden;border-radius:4px;flex:none}
.ledger-portrait::before{content:"";background:var(--coat);width:26px;height:14px;border-radius:47% 47% 3px 3px;position:absolute;bottom:1px}
.ledger-portrait i{height:14px;width:13px;background:var(--skin);border:solid var(--hair);border-width:4px 2px 0;border-radius:45% 48% 35% 42%;position:absolute;top:5px;box-shadow:1px 1px #19221b63}
.ledger-portrait i::after{content:"";background:#2c211c;position:absolute;right:1px;top:4px;width:2px;height:2px}
.citizen-heading{display:flex;align-items:center;gap:12px}
.citizen-heading .ledger-portrait{width:48px;height:52px}
.citizen-heading .ledger-portrait::before{width:34px;height:21px}
.citizen-heading .ledger-portrait i{width:20px;height:24px;top:6px;border-width:6px 3px 0}
.ledger-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.ledger-stats div{display:flex;flex-direction:column;background:#172b24;border:1px solid #596549;padding:6px;color:#c3cdb7;font-size:12px;overflow-wrap:anywhere}
.ledger-stats b{color:#efdeb6;font-size:17px}
.ledger-pantry{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:7px}
.ledger-link{display:flex;align-items:center;gap:8px;margin:5px 0;color:#c4cdb8;font-size:13px}
.ledger-link .button{min-height:32px}
.ledger-history{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:7px}
.ledger-history li{display:grid;gap:3px;padding-left:8px;border-left:2px solid #93805a;color:#ecdcb5}
.ledger-pages{display:flex;min-height:38px;align-items:center;justify-content:space-between;gap:9px;color:#d3caad}
.ledger-event{display:grid;gap:4px}
.ledger-event .button,.ledger-page .office-card>.button{justify-self:start;min-height:34px;margin-top:5px}
.ledger-empty{padding:7px;color:#c5cbb5}
.crop-chip{width:26px;height:26px;flex:none;border:1px solid #8b7a56;border-radius:50%;background:#334239;position:relative}
.crop-chip::before,.crop-chip::after{content:"";position:absolute;border-radius:60% 15% 61% 22%;width:12px;height:8px;top:9px;left:3px;background:var(--leaf);transform:rotate(30deg)}
.crop-chip::after{background:var(--plant);left:10px;top:7px;transform:rotate(-28deg)}
@media(max-width:540px){
  .ledger-row{padding:5px 7px;gap:6px}
  .ledger-field input,.ledger-field select{min-height:34px;padding:3px 5px}
  .ledger-stats{gap:4px}
}
