:root {
  color-scheme: dark;
  font-family: Tahoma, 'Malgun Gothic', sans-serif;
  background: #070907;
  color: #c1c5a4;
  font-size: 12px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse at center, #1b211b 0, #080b08 60%);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  background: linear-gradient(#363e30, #161d16);
  border: 1px solid #6e7661;
  border-radius: 0;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px #101510;
}
button:hover {
  border-color: #c6ad6e;
  color: #e9dbaa;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
button.active,
button[aria-pressed='true'] {
  border-color: #d99b42;
  color: #e8ba61;
  background: #343529;
}
a {
  color: #aeb999;
  text-decoration: none;
}
input,
select {
  border: 1px solid #5a6652;
  background: #070b08;
  padding: 7px;
  min-width: 0;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 2px solid #dcc57e;
  outline-offset: 1px;
}
[hidden] {
  display: none !important;
}
.page-bar {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 16px;
  background: #101610;
  border-bottom: 1px solid #303a2a;
  font-size: 11px;
}
.page-bar > span {
  letter-spacing: 3px;
  margin-right: auto;
  color: #9eaa8e;
}
.page-bar button {
  font-size: 10px;
  padding: 4px 8px;
}
#viewport {
  min-height: calc(100dvh - 66px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}
#screen-wrap {
  flex-shrink: 0;
  position: relative;
}
#screen {
  width: 800px;
  height: 600px;
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  background: #020602;
  overflow: hidden;
  box-shadow:
    0 0 0 1px #5e6853,
    0 15px 70px #000;
  image-rendering: pixelated;
}
#world {
  position: absolute;
  top: 0;
  left: 0;
  width: 800px;
  height: 406px;
  cursor: crosshair;
  touch-action: none;
  image-rendering: pixelated;
}
.region-heading {
  position: absolute;
  top: 7px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-size: 11px;
  text-shadow:
    1px 1px #000,
    -1px -1px #000;
}
.region-heading > span {
  background: #040904b8;
  border: 1px solid #45563a;
  padding: 4px 7px;
}
#connection {
  font-size: 10px;
  color: #aabb93;
}
.facility-shortcuts {
  position: absolute;
  right: 7px;
  top: 45px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.facility-shortcuts button {
  font-size: 10px;
  background: #071007d9;
  border-color: #55684c;
  width: 110px;
  padding: 6px;
  text-align: left;
}
#battle-status {
  position: absolute;
  left: 280px;
  top: 7px;
  width: 240px;
  text-align: center;
  font-size: 12px;
  background: #060b06dd;
  padding: 6px;
  border: 1px solid #6f6543;
  color: #d5c17f;
}
#unit-rail {
  position: absolute;
  left: 7px;
  top: 45px;
  width: 55px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rail-unit {
  height: 48px;
  width: 54px;
  padding: 0;
  position: relative;
  overflow: hidden;
  background: #090e09dd;
}
.rail-unit canvas {
  width: 48px;
  height: 38px;
  image-rendering: pixelated;
}
.rail-unit .hp {
  position: absolute;
  bottom: 2px;
  left: 3px;
  height: 3px;
  background: #7c9e42;
}
.rail-unit .number {
  position: absolute;
  left: 3px;
  top: 1px;
  font-size: 9px;
  color: #e7d59a;
}
#hud {
  position: absolute;
  top: 406px;
  left: 0;
  width: 800px;
  height: 194px;
  background-color: #11190e;
  background-image: var(--hud-image);
  background-size: 800px 194px;
  border-top: 2px ridge #788067;
}
#commander-status {
  position: absolute;
  left: 12px;
  top: 15px;
  width: 150px;
  height: 145px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 7px;
  background: #020702a8;
  border: 1px solid #2f432e;
  font-size: 11px;
}
#commander-status > b {
  color: #d4cb97;
}
#wallet {
  color: #d3aa5f;
}
#commander-status button {
  font-size: 10px;
  padding: 4px;
  margin-top: auto;
}
#order-bar {
  position: absolute;
  top: 3px;
  left: 185px;
  width: 440px;
  height: 33px;
  display: flex;
  align-items: center;
  gap: 3px;
}
#order-bar button {
  font-size: 10px;
  padding: 4px 5px;
  height: 26px;
  white-space: nowrap;
}
#chat-log {
  position: absolute;
  top: 70px;
  left: 197px;
  width: 400px;
  height: 116px;
  overflow: auto;
  color: #a7c68c;
  font-size: 11px;
  line-height: 1.55;
  padding: 3px 6px;
  background: #020602c0;
  scrollbar-width: thin;
}
#chat-log div {
  overflow-wrap: anywhere;
}
#chat-log b {
  color: #d2bd71;
}
#chat-form {
  position: absolute;
  top: 32px;
  left: 203px;
  width: 407px;
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 10px;
}
#chat-input {
  width: 100%;
  height: 24px;
  padding: 3px;
  background: #020602;
}
#chat-form button {
  padding: 3px 6px;
}
#mini {
  position: absolute;
  left: 657px;
  top: 50px;
  width: 137px;
  height: 137px;
  border: 1px solid #a1a27a;
  image-rendering: pixelated;
  touch-action: none;
}
#location-label {
  position: absolute;
  left: 646px;
  top: 10px;
  width: 140px;
  text-align: center;
  font-size: 10px;
  color: #d4b075;
}
#focus {
  position: absolute;
  left: 700px;
  top: 6px;
  height: 21px;
  padding: 1px 8px;
  font-size: 10px;
}
#panel {
  position: absolute;
  inset: 0;
  background-color: #050905;
  background-image: var(--panel-image);
  background-size: 800px 600px;
  z-index: 20;
}
#panel-title {
  position: absolute;
  top: 13px;
  left: 25px;
  height: 30px;
  padding: 5px 12px;
  color: #edba6a;
  letter-spacing: 2px;
  background: #050905d9;
  border: 1px solid #5c654b;
  font-weight: bold;
}
#panel-close {
  position: absolute;
  right: 13px;
  top: 10px;
  width: 34px;
  height: 30px;
  z-index: 5;
  padding: 0;
  color: #eab366;
  font-size: 22px;
}
#panel-content {
  position: absolute;
  top: 60px;
  left: 28px;
  width: 744px;
  height: 505px;
}
.panel-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.panel-tabs button {
  min-width: 90px;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  max-height: 416px;
  overflow: auto;
  scrollbar-width: thin;
}
.unit-shop {
  min-height: 155px;
  background: #071008e8;
  border: 1px solid #506344;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.unit-shop canvas {
  width: 88px;
  height: 66px;
  image-rendering: pixelated;
}
.unit-shop b {
  color: #d1c48c;
  font-size: 11px;
}
.unit-shop small {
  font-size: 9px;
  color: #a2ae99;
  text-align: center;
}
.unit-shop button {
  width: 100%;
  font-size: 10px;
  margin-top: auto;
}
.panel-summary {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  background: #040a05e8;
  border: 1px solid #40583a;
  margin-bottom: 10px;
  color: #c1b77f;
}
.army-layout {
  display: grid;
  grid-template-columns: 470px 260px;
  gap: 12px;
  height: 445px;
}
.army-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-content: start;
  gap: 6px;
  overflow: auto;
}
.army-card {
  position: relative;
  height: 100px;
  padding: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #061008ee;
  font-size: 10px;
}
.army-card.selected {
  border-color: #dcad52;
  box-shadow: inset 0 0 0 1px #c29847;
}
.army-card canvas {
  width: 70px;
  height: 60px;
  image-rendering: pixelated;
}
.army-card small {
  color: #a5b08f;
  font-size: 9px;
}
.army-detail {
  background: #030803e8;
  border: 1px solid #516448;
  padding: 12px;
  overflow: auto;
}
.army-detail h2 {
  font-size: 16px;
  color: #dac58c;
  margin: 0 0 10px;
}
.army-detail p {
  font-size: 11px;
  line-height: 1.6;
}
.equipment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  border-bottom: 1px solid #253321;
  padding: 5px 0;
  font-size: 11px;
}
.equipment-row button {
  font-size: 9px;
  padding: 3px 5px;
}
.device-card {
  padding: 7px 0;
  border-bottom: 1px solid #273a24;
  font-size: 10px;
}
.device-card button {
  margin-top: 4px;
  font-size: 10px;
  padding: 4px 7px;
}
.territory-layout {
  display: grid;
  grid-template-columns: 505px 225px;
  gap: 12px;
  height: 445px;
}
#territory-canvas {
  width: 505px;
  height: 400px;
  image-rendering: pixelated;
  background: #182416;
  border: 1px solid #617450;
}
.territory-side {
  background: #030903e8;
  border: 1px solid #516343;
  padding: 10px;
  overflow: auto;
}
.territory-side input,
.territory-side select {
  width: 100%;
  margin-bottom: 8px;
}
.region-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 270px;
  overflow: auto;
  margin-bottom: 9px;
}
.region-list button {
  text-align: left;
  font-size: 10px;
  padding: 6px;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.info-box {
  background: #030903e8;
  border: 1px solid #53664b;
  padding: 14px;
}
.info-box h2 {
  margin: 0 0 12px;
  color: #cdb97d;
  font-size: 15px;
}
.info-box p {
  font-size: 11px;
  line-height: 1.8;
}
.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #273722;
}
.action-row button {
  font-size: 10px;
}
.manual-text {
  height: 450px;
  overflow: auto;
  background: #071009f2;
  border: 1px solid #506348;
  padding: 18px;
  line-height: 1.8;
  font-size: 12px;
}
.squad-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}
.squad-slots button {
  min-height: 44px;
  padding: 7px 10px;
  cursor: grab;
}
.manual-text h2 {
  color: #dfbe7a;
  font-size: 16px;
}
.manual-text h3 {
  color: #a7c28c;
  font-size: 13px;
}
.manual-text a {
  color: #e4c58f;
  text-decoration: underline;
}
.army-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 9px 0;
}
.army-actions button {
  font-size: 10px;
  padding: 5px;
}
#panel:has(.native-shop) #panel-content {
  inset: 0;
  width: 800px;
  height: 600px;
}
#panel:has(.native-shop) #panel-title {
  display: none;
}
#panel:has(.native-shop) #panel-close {
  top: 570px;
  right: 10px;
  height: 27px;
}
.native-shop {
  position: absolute;
  inset: 0;
}
.native-tabs {
  position: absolute;
  left: 0;
  top: 1px;
  display: flex;
  width: 800px;
  height: 38px;
}
.native-tabs button {
  width: 200px;
  background: transparent;
  border-color: transparent;
  font-size: 0;
  color: transparent;
}
.native-tabs button.active {
  color: transparent;
  background: #c4a54618;
  border-color: #807143;
}
.native-previews {
  position: absolute;
  left: 60px;
  top: 76px;
  width: 677px;
  height: 118px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.native-previews button {
  width: 145px;
  min-width: 145px;
  padding: 0 50px 0 0;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  font-size: 10px;
  box-shadow: none;
  color: #aeb69a;
}
.native-previews button.active {
  color: #e6ba68;
}
.native-previews canvas {
  width: 93px;
  height: 84px;
  image-rendering: pixelated;
}
.native-previews span {
  width: 93px;
  text-align: center;
}
#large-unit {
  position: absolute;
  left: 22px;
  top: 230px;
  width: 280px;
  height: 335px;
  image-rendering: pixelated;
}
.native-unit-description {
  position: absolute;
  top: 220px;
  left: 360px;
  width: 410px;
  height: 111px;
  overflow: auto;
  padding: 8px;
  background: #030803bb;
  font-size: 12px;
  line-height: 1.8;
  color: #99ad87;
}
.native-unit-description b {
  color: #dab56a;
  font-size: 15px;
}
.native-unit-description p {
  margin: 5px 0;
}
.native-price {
  position: absolute;
  left: 390px;
  top: 383px;
  width: 165px;
  height: 166px;
  padding: 6px;
  background: #030803d9;
  font-size: 12px;
  line-height: 1.8;
}
.native-price h3,
.native-resources h3 {
  font-size: 12px;
  color: #cabe85;
  margin: 0 0 7px;
}
.native-price p {
  margin: 0;
}
.native-resources {
  position: absolute;
  left: 610px;
  top: 383px;
  width: 163px;
  height: 165px;
  padding: 6px;
  background: #030803e6;
  font-size: 11px;
}
.native-resources p {
  margin: 7px 0;
  display: flex;
  justify-content: space-between;
}
.native-resources small {
  font-size: 10px;
  color: #c4ad67;
}
.native-confirm {
  position: absolute;
  left: 350px;
  top: 570px;
  width: 420px;
  height: 29px;
  display: flex;
  gap: 8px;
}
.native-confirm button {
  flex: 1;
  padding: 5px;
  font-size: 11px;
}
.territory-caption {
  font-size: 10px;
  color: #adb898;
}
#toast {
  position: absolute;
  top: 350px;
  left: 180px;
  width: 440px;
  padding: 10px;
  border: 1px solid #b39b56;
  background: #070c04ee;
  color: #e2ca87;
  font-size: 12px;
  text-align: center;
  z-index: 40;
}
#loading {
  position: absolute;
  inset: 0;
  background: #020502f5;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 80px;
  text-align: center;
}
#loading h1 {
  font:
    30px Georgia,
    serif;
  color: #d8b66b;
  letter-spacing: 5px;
}
.loading-mark {
  font:
    60px Georgia,
    serif;
  color: #b9be90;
  border: 2px solid #6b775b;
  padding: 10px;
}
#loading p {
  line-height: 1.8;
  color: #a3b298;
  font-size: 13px;
}
#loading progress {
  width: 360px;
  height: 5px;
  accent-color: #aab26e;
}
.mobile-orders {
  display: none;
}
.page-footer {
  height: 30px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  color: #65765e;
}
dialog {
  background: #0b120bdc;
  border: 2px ridge #899275;
  color: #b9c6aa;
  width: 420px;
  max-width: calc(100vw - 24px);
  padding: 27px;
  box-shadow: 0 20px 80px #000;
}
dialog::backdrop {
  background: #010501cf;
  backdrop-filter: blur(3px);
}
dialog h1 {
  margin: 10px 0;
  color: #d6c08b;
  font-size: 24px;
}
dialog small {
  color: #b8ad76;
  letter-spacing: 2px;
  font-size: 10px;
}
dialog p {
  line-height: 1.6;
  font-size: 12px;
}
dialog label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 15px 0;
}
dialog .primary {
  width: 100%;
  color: #e8c376;
  padding: 12px;
}
#account-toggle {
  margin-top: 12px;
  width: 100%;
  font-size: 11px;
}
.account-buttons {
  display: flex;
  gap: 10px;
}
.account-buttons button {
  flex: 1;
}
.entry-note {
  font-size: 10px;
  color: #7f9275;
  margin-bottom: 0;
}
#entry-error {
  color: #e0a477;
}
@media (max-width: 700px) {
  .page-bar {
    gap: 5px;
    padding: 0 7px;
  }
  .page-bar > span {
    display: none;
  }
  .page-bar > a {
    margin-right: auto;
    font-size: 10px;
  }
  .page-bar button {
    font-size: 9px;
    padding: 4px 5px;
  }
  #viewport {
    min-height: calc(100dvh - 83px);
    padding: 3px;
    justify-content: center;
  }
  .mobile-orders {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-top: 14px;
  }
  .mobile-orders button {
    min-width: 40px;
    padding: 10px 7px;
    font-size: 11px;
  }
  .page-footer {
    height: 47px;
    align-items: center;
    padding: 5px 10px;
    font-size: 9px;
  }
  .page-footer > span {
    max-width: 60%;
  }
}
body > #panel {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 100;
  background-color: #071009;
  background-image: linear-gradient(#0a130be8, #060d07f5), var(--panel-image);
  background-size: cover;
  overflow: auto;
}
body > #panel #panel-title {
  display: block !important;
  top: 15px;
  left: 12px;
  font-size: 14px;
}

/* Whole original windows: fixed bitmap-local coordinates, never a responsive card grid. */
#panel:has(.original-window) {
  background: #000;
  overflow: auto;
  overscroll-behavior: contain;
}
#panel:has(.original-window) #panel-title,
#panel:has(.original-window) #panel-close {
  display: none !important;
}
#panel #panel-content.original-window-content,
body > #panel #panel-content.original-window-content,
body[data-hud-profile] > #panel #panel-content.original-window-content {
  position: relative;
  inset: 0 !important;
  width: 800px !important;
  height: 600px !important;
  min-width: 800px;
  margin: 0 !important;
  padding: 0;
  background: transparent;
  overflow: visible;
}
.original-window {
  position: relative;
  width: 800px;
  height: 600px;
  min-width: 800px;
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 800px 600px;
  image-rendering: pixelated;
  font-family: '굴림', Gulim, monospace;
}
.native-bitmap-window {
  position: absolute;
  background-position: 0 0;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
#panel #territory-canvas {
  position: absolute;
  inset: 0;
  width: 800px;
  height: 600px;
  max-width: none;
}
.native-map-frame {
  position: absolute;
  inset: 0;
  width: 800px;
  height: 600px;
  pointer-events: none;
}
.native-map-current {
  position: absolute;
  left: 112px;
  top: 24px;
  color: #e6e9db;
  font:
    12px/20px '굴림',
    Gulim,
    monospace;
  pointer-events: none;
}
.native-map-detail {
  position: absolute;
  left: 79px;
  top: 48px;
  width: 642px;
  height: 505px;
  background-repeat: no-repeat;
  background-position: 0 0;
}
.native-region-title {
  position: absolute;
  left: 40px;
  top: 33px;
  width: 230px;
  height: 13px;
  background: #000;
  color: #e6e9db;
  text-align: center;
  font:
    11px/13px '굴림',
    Gulim,
    monospace;
  overflow: hidden;
}
#native-region-preview {
  position: absolute;
  left: 91px;
  top: 68px;
  width: 128px;
  height: 128px;
}
.native-battle-information,
.native-route-information {
  position: absolute;
  background: #000;
  color: #e6e9db;
  font:
    12px/18px '굴림',
    Gulim,
    monospace;
  overflow: auto;
}
.native-battle-information {
  left: 363px;
  top: 85px;
  width: 223px;
  height: 192px;
}
.native-route-information {
  left: 43px;
  top: 317px;
  width: 226px;
  height: 91px;
}
.native-nsp-description {
  position: absolute;
  left: 387px;
  top: 226px;
  width: 391px;
  height: 116px;
  padding: 2px 4px;
  color: #d4d8ce;
  font:
    12px/18px '굴림',
    Gulim,
    monospace;
  overflow: auto;
}
.native-nsp-model {
  position: absolute;
  left: 19px;
  top: 225px;
  width: 281px;
  height: 345px;
  pointer-events: none;
}
.native-item-name {
  position: absolute;
  inset: 16px 2px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d4d8ce;
  font:
    12px/16px '굴림',
    Gulim,
    monospace;
  white-space: normal;
  text-align: center;
}
.native-item-price {
  position: absolute;
  bottom: 3px;
  left: 2px;
  right: 2px;
  color: #e4c990;
  font:
    11px/16px '굴림',
    Gulim,
    monospace;
  text-align: center;
}
.native-equipment-candidate[aria-pressed='true'] {
  outline: 1px solid #e6cf8f;
  outline-offset: -1px;
}
.native-sound-slider {
  position: absolute;
  min-height: 44px !important;
  padding: 0;
  margin: 0;
  border: 0;
  appearance: none;
  background: transparent;
  color: transparent;
}
.native-sound-slider::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
}
.native-sound-slider::-webkit-slider-thumb {
  appearance: none;
  width: 17px;
  height: 29px;
  margin-top: -10px;
  border: 0;
  border-radius: 0;
  background: var(--native-slider-thumb) 0 0 / 17px 29px no-repeat;
}
.native-sound-slider::-moz-range-track {
  height: 8px;
  background: transparent;
}
.native-sound-slider::-moz-range-thumb {
  width: 17px;
  height: 29px;
  border: 0;
  border-radius: 0;
  background: var(--native-slider-thumb) 0 0 / 17px 29px no-repeat;
}
.native-setting-disabled {
  position: absolute;
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 1;
}
.native-system-tools {
  position: absolute;
  left: 102px;
  top: 540px;
  width: 596px;
  min-height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.native-system-tools :is(button, a) {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 5px;
  border: 0;
  background: transparent;
  color: #d4d8ce;
  font:
    12px/20px '굴림',
    Gulim,
    monospace;
  text-decoration: underline;
}
.system-menu-content {
  display: none !important;
}
dialog.city-navigation {
  width: min(520px, 96vw);
  background: #080b08;
  border: 1px solid #778075;
  border-radius: 0;
  font-family: '굴림', Gulim, monospace;
}
.city-navigation .mobile-menu-grid button {
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid #353b32;
  border-radius: 0;
  background: transparent;
  color: #d4d8ce;
  text-align: left;
}
.region-navigation {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 0;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  gap: 8px;
}
.region-navigation input {
  min-height: 44px;
  font-size: 16px;
}
.region-navigation-list {
  max-height: min(430px, calc(var(--mobile-vh, 100dvh) - 160px));
  overflow: auto;
}
.region-navigation-list button {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid #353b32;
  background: transparent;
  color: #d4d8ce;
  text-align: left;
}
.original-window .native-hit {
  position: absolute;
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  touch-action: manipulation;
  overflow: visible;
}
.original-window .native-hit:disabled {
  opacity: 1;
  filter: none;
}
.original-window .native-hit:hover {
  background: transparent;
  border: 0;
}
.original-window .native-hit:focus-visible {
  outline: 1px solid #f7e4a7;
  outline-offset: 1px;
}
.native-hit > canvas {
  position: absolute;
  left: var(--native-art-x, 0px);
  top: var(--native-art-y, 0px);
  pointer-events: none;
  image-rendering: pixelated;
}
.native-floor {
  position: absolute;
  inset: 0;
  width: 800px;
  height: 600px;
  pointer-events: none;
}
.native-combat-slot > canvas.native-combat-model {
  left: -28px;
  top: -48px;
}
.native-owned-unit > canvas {
  left: 0;
  top: 0;
}
.original-window .native-value {
  position: absolute;
  display: block;
  border: 0;
  margin: 0;
  padding: 0 2px;
  background: transparent;
  color: #d4d8ce;
  font:
    12px/17px '굴림',
    Gulim,
    monospace;
  text-align: right;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}
.original-window[data-original-window='exchange'] .native-value {
  line-height: 24px;
}
.native-accessible {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.original-window .native-exchange-amount {
  position: absolute;
  min-width: 44px;
  min-height: 44px !important;
  height: 44px !important;
  transform: translateY(-11px);
  margin: 0;
  padding: 11px 1px;
  border: 0;
  border-radius: 0;
  appearance: textfield;
  background: transparent;
  color: #e5e9e1;
  font:
    12px/22px '굴림',
    Gulim,
    monospace;
  text-align: right;
}
.native-exchange-amount::-webkit-inner-spin-button,
.native-exchange-amount::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}
.original-window-missing {
  position: absolute;
  left: 160px;
  top: 230px;
  width: 480px;
  text-align: center;
}
.original-window-error-close {
  position: absolute;
  left: 330px;
  top: 300px;
  min-height: 44px;
}
@media (max-width: 700px),
  (max-width: 950px) and (max-height: 500px),
  (max-width: 1100px) and (pointer: coarse) {
  body[data-hud-profile='portal-mobile']:not(.embedded) > #panel:has(.original-window) {
    top: calc(44px + var(--tc-safe-top, 0px));
    height: calc(var(--mobile-vh, 100dvh) - 44px - var(--tc-safe-top, 0px));
    padding-left: var(--tc-safe-left, 0px);
    padding-right: var(--tc-safe-right, 0px);
    padding-bottom: var(--tc-safe-bottom, 0px);
  }
  .original-window .native-hit:not(.native-step) {
    min-width: 44px;
    min-height: 44px;
  }
}
body > #panel #panel-close {
  position: fixed;
  top: 15px !important;
  right: 12px;
  height: 32px !important;
  width: 36px;
}
body > #panel #panel-content {
  position: relative;
  inset: auto !important;
  width: auto !important;
  height: auto;
  margin: 65px 12px 25px;
}
body > #panel .army-layout,
body > #panel .territory-layout,
body > #panel .info-grid {
  display: flex;
  flex-direction: column;
  height: auto;
  gap: 12px;
}
body > #panel .army-grid {
  grid-template-columns: repeat(3, 1fr);
  max-height: 330px;
}
body > #panel .army-card {
  height: 105px;
  font-size: 11px;
}
body > #panel .army-detail {
  max-height: none;
  padding: 16px;
}
body > #panel .army-detail p,
body > #panel .device-card {
  font-size: 12px;
}
body > #panel .army-detail h2 {
  font-size: 18px;
}
body > #panel .equipment-row {
  padding: 9px 0;
  font-size: 13px;
}
body > #panel .equipment-row button,
body > #panel .device-card button {
  padding: 8px;
  font-size: 12px;
}
body > #panel .native-shop {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body > #panel .native-tabs {
  position: static;
  width: 100%;
  height: auto;
}
body > #panel .native-tabs button {
  width: 25%;
  padding: 10px 4px;
  font-size: 12px;
  color: #d8bc79;
}
body > #panel .native-previews {
  position: static;
  width: 100%;
  height: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: auto;
  gap: 6px;
  max-height: 285px;
}
body > #panel .native-previews button {
  width: 100%;
  min-width: 0;
  padding: 0;
  align-items: center;
  font-size: 11px;
  border: 1px solid #3a4f30;
  background: #091209;
}
body > #panel #large-unit {
  position: static;
  width: 100%;
  height: 210px;
  object-fit: contain;
}
body > #panel .native-unit-description,
body > #panel .native-price,
body > #panel .native-resources,
body > #panel .native-confirm {
  position: static;
  width: 100%;
  height: auto;
  padding: 12px;
}
body > #panel .native-unit-description {
  font-size: 13px;
}
body > #panel .native-price p {
  line-height: 1.9;
}
body > #panel .native-resources p {
  font-size: 13px;
}
body > #panel .native-confirm {
  position: sticky;
  bottom: 0;
  background: #0b160c;
  display: flex;
  padding: 10px 0;
}
body > #panel .native-confirm button {
  font-size: 13px;
  padding: 12px 5px;
}
body > #panel #territory-canvas {
  width: 100%;
  height: auto;
}
body > #panel .territory-side {
  width: 100%;
}
body > #panel .region-list {
  max-height: 220px;
}
body > #panel .region-list button {
  font-size: 12px;
  padding: 9px;
}
body > #panel .manual-text {
  height: auto;
  max-height: none;
  font-size: 13px;
}

/* Reference 2–4 layout, measured on an 800×600 screen. The later steel HUD
   artwork is not present in the verified install: framing/icons below are
   reconstructed CSS/SVG, not pixels cut from the supplied reference JPGs. */
body[data-hud-profile='reference'] {
  overflow: hidden;
  background: #020302;
}
body[data-hud-profile='reference'] #viewport {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  padding: 0;
  gap: 0;
  background: #020302;
}
body[data-hud-profile='reference'] #screen {
  box-shadow: none;
  outline: 1px solid #465044;
}
body[data-hud-profile='reference'] #world {
  height: 460px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
#hud svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body[data-hud-profile='reference'] #hud {
  top: 420px;
  height: 180px;
  border: 0;
  background: transparent;
  background-image: none;
  z-index: 8;
  pointer-events: none;
}
#hud > * {
  pointer-events: auto;
}
body[data-hud-profile='reference'] #hud::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  clip-path: polygon(
    0 30px,
    31px 30px,
    38px 22px,
    125px 22px,
    143px 33px,
    157px 44px,
    482px 44px,
    498px 33px,
    529px 33px,
    547px 18px,
    563px 18px,
    563px 10px,
    647px 10px,
    658px 0,
    786px 0,
    800px 14px,
    800px 180px,
    0 180px
  );
  background:
    linear-gradient(
      180deg,
      #62695b 0,
      #131c14 5px,
      #8b9280 8px,
      #1e2820 12px,
      #080d09 17px,
      #1b251a 35px,
      #778270 39px,
      #09100b 44px,
      #53604b 47px,
      #07100a 50px,
      #060b07 95%
    ),
    repeating-linear-gradient(90deg, #9eaa8d28 0 1px, transparent 1px 4px);
  box-shadow: inset 0 -3px #505c4b;
  filter: drop-shadow(0 -1px #a0ab92) drop-shadow(0 1px #030703);
}
body[data-hud-profile='reference'] #hud::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 44px;
  width: 132px;
  height: 132px;
  background: var(--minimap-grid-image, none) center / 132px 132px no-repeat;
  image-rendering: pixelated;
  opacity: 0.42;
  pointer-events: none;
}
.minimap-frame {
  position: absolute;
  left: 0;
  top: 31px;
  width: 150px;
  height: 149px;
  border: 5px ridge #68725e;
  border-radius: 15px 21px 0 0;
  background: #040905;
  box-shadow: inset 0 0 0 2px #1c2c20;
  pointer-events: none !important;
}
body[data-hud-profile='reference'] #mini {
  left: 8px;
  top: 44px;
  width: 132px;
  height: 132px;
  border: 1px solid #737e62;
  background: #020502;
}
body[data-hud-profile='reference'] #location-label {
  left: 12px;
  top: 27px;
  width: 106px;
  height: 11px;
  overflow: hidden;
  font:
    8px Tahoma,
    sans-serif;
  line-height: 11px;
  letter-spacing: 1px;
  color: #c3c8a8;
  text-shadow: 1px 1px #000;
}
body[data-hud-profile='reference'] #focus {
  left: 122px;
  top: 24px;
  width: 18px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: #131d12;
  color: #9eac8a;
  box-shadow: none;
}
#focus svg {
  width: 15px;
  height: 15px;
}
body[data-hud-profile='reference'] #focus[data-following='true'],
#mobile-focus[data-following='true'] {
  color: #a8ffad;
  border-color: #64935b;
  background-color: #203a23;
}
body[data-hud-profile='reference'] #commander-status {
  left: 158px;
  top: 31px;
  width: 410px;
  height: 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 11px;
  padding: 0 4px;
  border: 0;
  background: none;
  font:
    9px Tahoma,
    'Malgun Gothic',
    sans-serif;
  color: #8a9c78;
  text-shadow: 1px 1px #000;
}
#commander-name,
#commander-rank {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
body[data-hud-profile='reference'] #commander-name {
  color: #b6bd87;
  font-weight: normal;
}
body[data-hud-profile='reference'] #wallet {
  margin-left: auto;
  white-space: nowrap;
  color: #b7ae70;
}
body[data-hud-profile='reference'] #battle-status {
  left: 169px;
  top: 11px;
  width: 368px;
  height: 15px;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: transparent;
  font-size: 9px;
  line-height: 15px;
  color: #bbc18c;
  text-shadow: 1px 1px #000;
}
body[data-hud-profile='reference'] #chat-log {
  top: 60px;
  left: 157px;
  width: 410px;
  height: 96px;
  padding: 3px 6px;
  border: 1px inset #43513c;
  background: #1a0404ec;
  color: #b4c3a4;
  font:
    11px/15.5px Tahoma,
    'Malgun Gothic',
    sans-serif;
  scrollbar-color: #586448 #10170d;
}
body[data-hud-profile='reference'] #chat-log b {
  color: #d4c77c;
}
body[data-hud-profile='reference'] #chat-form {
  top: 159px;
  left: 157px;
  width: 410px;
  height: 17px;
  gap: 3px;
}
body[data-hud-profile='reference'] #chat-input {
  flex: 1;
  width: 0;
  height: 17px;
  padding: 0 4px;
  border: 1px inset #657558;
  background: #020502;
  font-size: 10px;
  color: #c4cba5;
}
body[data-hud-profile='reference'] #chat-form button {
  width: 23px;
  height: 17px;
  padding: 0;
  border: 1px solid #5c7750;
  background: #0d1d09;
  color: #95bd63;
  line-height: 14px;
}
body[data-hud-profile='reference'] #order-bar {
  left: 636px;
  top: 28px;
  width: 156px;
  height: 148px;
  display: block;
  border: 0;
  background: none;
}
.radial-frame {
  position: absolute;
  inset: 0;
  border: 4px double #6d7964;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      #101810 0 28%,
      #6c6036 28.5% 30%,
      #10190e 31% 34%,
      transparent 35% 64%,
      #73806c 65% 66%,
      #090f0a 67%
    ),
    repeating-conic-gradient(
      from -22.5deg,
      #9dad8d80 0 1deg,
      #07100ceb 1deg 44deg,
      #73846a60 44deg 45deg
    );
  box-shadow:
    0 0 0 2px #060b07,
    inset 0 0 0 3px #121e15;
  pointer-events: none;
}
#order-bar .radial-command {
  position: absolute;
  width: 33px;
  height: 33px;
  padding: 3px;
  border: 2px solid #5f7c4c;
  border-radius: 50%;
  background: #06100b;
  color: #93b874;
  box-shadow: inset 0 0 0 1px #182e18;
}
#order-bar .radial-command svg {
  width: 23px;
  height: 23px;
}
#order-bar .radial-command span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#order-bar .radial-command:hover,
#order-bar .radial-command.active {
  background: #172b0e;
  color: #b4dc85;
  border-color: #b0bd72;
}
#order-bar .order-move {
  left: 61px;
  top: 6px;
}
#order-bar .order-attack {
  left: 109px;
  top: 58px;
}
#order-bar .order-hold {
  left: 61px;
  top: 108px;
}
#order-bar .order-ability {
  left: 11px;
  top: 58px;
}
.battle-dial {
  position: absolute;
  left: 47px;
  top: 44px;
  width: 63px;
  height: 63px;
  border: 4px ridge #977a43;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #314a2c, #101b14 75%);
  box-shadow:
    0 0 0 2px #1d271d,
    inset 0 0 0 1px #677d4e;
  color: #b6be5d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  pointer-events: none;
}
#battle-clock {
  font:
    14px/17px Tahoma,
    monospace;
  font-variant-numeric: tabular-nums;
}
#clock-mode {
  font-size: 8px;
  color: #89a071;
}
.hud-menu {
  position: absolute;
  left: 586px;
  top: 42px;
  width: 46px;
  display: grid;
  grid-template-rows: repeat(5, 24px);
  gap: 3px;
}
.hud-menu > button,
.hud-menu summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 24px;
  padding: 0;
  border: 1px solid #597449;
  border-radius: 0;
  background: #06100b;
  color: #89a777;
  box-shadow: inset 0 0 0 1px #1b2b1a;
  cursor: pointer;
  list-style: none;
}
.hud-menu summary::-webkit-details-marker {
  display: none;
}
.hud-menu summary:hover,
.hud-menu > button:hover,
.hud-menu details[open] summary {
  color: #c5d195;
  border-color: #a8ad76;
  background: #152110;
}
.hud-menu summary:focus-visible {
  outline: 2px solid #dcc57e;
  outline-offset: 1px;
}
.system-menu-content {
  position: absolute;
  right: 0;
  bottom: 32px;
  width: 284px;
  max-height: 400px;
  overflow: auto;
  padding: 13px;
  border: 3px ridge #778263;
  background: #071009f7;
  box-shadow: 0 8px 20px #0009;
  color: #aebda0;
  font-size: 11px;
  z-index: 15;
}
.system-menu-content .region-heading {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 11px;
}
.system-menu-content .region-heading > span {
  border: 0;
  padding: 0;
  background: none;
}
.system-menu-content .facility-shortcuts {
  position: static;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 10px;
}
.system-menu-content .facility-shortcuts button {
  width: auto;
  padding: 7px 4px;
  font-size: 10px;
  text-align: center;
}
.system-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 10px;
}
.system-actions button {
  padding: 7px 4px;
  font-size: 10px;
}
.system-menu-content > a {
  display: block;
  padding: 8px 0;
  border-top: 1px solid #2f412a;
  color: #b0bc95;
}
.system-menu-content #runtime-status {
  display: block;
  margin-top: 6px;
  font-size: 9px;
  line-height: 1.6;
  color: #6f8768;
}
body[data-hud-profile='reference'] #unit-rail {
  left: 3px;
  top: 4px;
  width: 70px;
  max-height: 414px;
  gap: 5px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  z-index: 3;
}
body[data-hud-profile='reference'] .rail-unit {
  width: 69px;
  height: 64px;
  min-height: 64px;
  border: 2px ridge #7e826a;
  background: #151b11b8;
  box-shadow: inset 0 0 0 1px #101b0d;
}
body[data-hud-profile='reference'] .rail-unit canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 65px;
  height: 49px;
  object-fit: contain;
}
body[data-hud-profile='reference'] .rail-unit .hp {
  left: 3px;
  bottom: 14px;
  height: 3px;
  max-width: 59px;
  background: #75a64d;
  box-shadow: 0 1px #182611;
}
body[data-hud-profile='reference'] .rail-unit .energy {
  position: absolute;
  left: 3px;
  bottom: 11px;
  height: 2px;
  max-width: 59px;
  background: #c4b04f;
  box-shadow: 0 1px #302b11;
}
body[data-hud-profile='reference'] .rail-unit .number {
  left: 2px;
  top: 0;
  font:
    8px Tahoma,
    sans-serif;
  color: #c0c49c;
  text-shadow: 1px 1px #000;
}
body[data-hud-profile='reference'] .rail-unit::after {
  content: attr(data-name);
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 0;
  height: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font:
    8px/10px Tahoma,
    'Malgun Gothic',
    sans-serif;
  text-align: left;
  color: #bdc4a5;
}
@media (max-width: 700px) {
  body[data-hud-profile='reference'] {
    overflow: auto;
  }
  body[data-hud-profile='reference'] #viewport {
    min-height: 100dvh;
    height: auto;
    justify-content: center;
    padding: max(5px, env(safe-area-inset-top)) 4px max(5px, env(safe-area-inset-bottom));
  }
  .mobile-orders {
    gap: 6px;
    margin-top: 10px;
    padding: 0 3px;
  }
  .mobile-orders button {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 9px;
    font-size: 12px;
  }
}

/* Steel finish reuses small verified NSC-Low/LowB frame regions. The original
   HUD is neither mirrored nor substituted for the later reference layout. */
body[data-hud-profile='reference'] #hud::before {
  background:
    repeating-linear-gradient(90deg, #c5c8b923 0 1px, transparent 1px 4px),
    linear-gradient(
      180deg,
      #898d80 0,
      #252b26 3px,
      #bcc0ac 6px,
      #41493d 9px,
      #111612 13px,
      #080b09 34px,
      #8f9684 39px,
      #293228 42px,
      #080c09 45px,
      #9a9f8b 47px,
      #1b231b 50px,
      #060a07 95%
    );
  filter: drop-shadow(0 -1px #d6d9c5) drop-shadow(0 2px #020402);
}
body[data-hud-profile='reference'] .minimap-frame {
  border: 3px ridge #a5ac99;
  background-color: #070a07;
  background-image: var(--hud-image, none);
  background-size: 800px 194px;
  background-position: -650px -44px;
  background-repeat: no-repeat;
  background-origin: border-box;
  box-shadow:
    inset 0 0 0 1px #252d23,
    1px 0 #080b08;
}
body[data-hud-profile='reference'] #mini {
  border-color: #a7ae96;
}
body[data-hud-profile='reference'] #commander-status {
  z-index: 1;
}
body[data-hud-profile='reference'] #commander-status::before,
body[data-hud-profile='reference'] #commander-status::after,
body[data-hud-profile='reference'] #chat-form::before,
body[data-hud-profile='reference'] #chat-form::after {
  content: '';
  position: absolute;
  background-image: var(--hud-image, none);
  background-size: 800px 194px;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: -1;
}
body[data-hud-profile='reference'] #commander-status::before {
  left: -10px;
  top: 29px;
  width: 9px;
  height: 98px;
  background-position: -190px -69px;
}
body[data-hud-profile='reference'] #commander-status::after {
  left: -10px;
  top: 16px;
  width: 429px;
  height: 13px;
  background-position: -192px -54px;
}
body[data-hud-profile='reference'] #chat-log {
  border-color: #858c75;
  box-shadow: inset 0 0 0 1px #1b1e15;
}
body[data-hud-profile='reference'] #chat-form {
  z-index: 1;
}
body[data-hud-profile='reference'] #chat-form::before {
  left: -9px;
  top: -2px;
  width: 429px;
  height: 23px;
  background-position: -192px -171px;
}
body[data-hud-profile='reference'] #chat-form::after {
  right: -10px;
  top: -100px;
  width: 10px;
  height: 100px;
  background-position: -601px -69px;
}
body[data-hud-profile='reference'] .radial-frame {
  border-color: #afb4a4;
  background:
    radial-gradient(
      circle,
      #131711 0 28%,
      #82764d 28.5% 30%,
      #10140f 31% 34%,
      transparent 35% 64%,
      #adb4a0 65% 66%,
      #101510 67%
    ),
    repeating-conic-gradient(
      from -22.5deg,
      #b4bca080 0 1deg,
      #090d0aeb 1deg 44deg,
      #929d8060 44deg 45deg
    );
  box-shadow:
    0 0 0 2px #040704,
    inset 0 0 0 2px #252d22,
    inset 0 0 0 3px #6b7560;
}
body[data-hud-profile='reference'] .radial-frame::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background-image: var(--command-rim-image, none);
  background-size: 156px 162px;
  background-position: center -7px;
  background-repeat: no-repeat;
  mask-image: radial-gradient(ellipse, transparent 0 67%, #000 69% 100%);
  opacity: 0.8;
  pointer-events: none;
}
body[data-hud-profile='reference'] #order-bar .radial-command {
  border-color: #9ca58c;
  background: radial-gradient(circle at 45% 30%, #242d21, #070c08 80%);
  color: #a1b982;
  box-shadow:
    inset 0 0 0 1px #172014,
    0 1px #020502;
}
body[data-hud-profile='reference'] #order-bar .radial-command:hover,
body[data-hud-profile='reference'] #order-bar .radial-command.active {
  border-color: #d3c78b;
  color: #c5db9e;
  background: #26321d;
}
body[data-hud-profile='reference'] .hud-menu > button,
body[data-hud-profile='reference'] .hud-menu summary {
  border-color: #8a977b;
  background: linear-gradient(135deg, #303a2b, #090f0a 12%, #060b07 80%, #1e281b);
  color: #9caf86;
  box-shadow:
    inset 0 0 0 1px #1f2c1b,
    0 1px #030603;
}
body[data-hud-profile='reference'] .battle-dial {
  border-color: #b89a59;
  background: radial-gradient(circle at 45% 35%, #384634, #121910 80%);
  box-shadow:
    0 0 0 2px #444d37,
    inset 0 0 0 1px #11170e;
}

/* Exact additional international BCP/CTP pixels. The Korean resources above
   remain the fallback; the variant and private-publication boundary are in the manifest. */
body[data-hud-profile='reference'][data-reference-hud='original-variant'] #hud::before {
  inset: auto;
  left: 0;
  bottom: 0;
  width: 801px;
  height: var(--reference-hud-height, 184px);
  clip-path: none;
  background: var(--reference-hud-image) left bottom / 801px var(--reference-hud-height) no-repeat;
  image-rendering: pixelated;
  box-shadow: none;
  filter: none;
}
body[data-reference-hud='original-variant'] .minimap-frame,
body[data-reference-hud='original-variant'] .radial-frame,
body[data-reference-hud='original-variant'] #commander-status::before,
body[data-reference-hud='original-variant'] #commander-status::after,
body[data-reference-hud='original-variant'] #chat-form::before,
body[data-reference-hud='original-variant'] #chat-form::after {
  display: none;
}
body[data-hud-profile='reference'][data-reference-hud='original-variant'] #chat-log {
  border: 0;
  box-shadow: none;
  background: #180202d9;
}
body[data-reference-hud='original-variant'] #hud[data-scene='capital'] .radial-frame {
  display: block;
  inset: auto;
  left: 1px;
  top: -1px;
  width: 153px;
  height: 151px;
  border: 0;
  background: var(--reference-radial-image) left top / 153px 151px no-repeat;
  box-shadow: none;
}
body[data-reference-hud='original-variant'] .radial-frame::after {
  display: none;
}

/* NSU original black slots: bitmap/labels stay native 800x600. The values and
   combat arithmetic remain the current web implementation, not original prices. */
#screen > #panel:has(.native-shop) .native-unit-description {
  left: 386px;
  top: 221px;
  width: 390px;
  height: 115px;
  padding: 5px 8px;
  background: #020602;
  font-size: 11px;
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: #78826a #030703;
}
.native-combat-stats,
.native-roster-count {
  display: block;
  margin-top: 5px;
  color: #c1c8ab;
  font-size: 10px;
  line-height: 1.5;
}
#screen > #panel .native-shop[data-native-ui='ready'] .native-price,
#screen > #panel .native-shop[data-native-ui='ready'] .native-resources {
  top: 383px;
  height: 160px;
  padding: 0 8px;
  background: #020602;
  font-variant-numeric: tabular-nums;
}
#screen > #panel .native-shop[data-native-ui='ready'] .native-price {
  left: 392px;
  width: 164px;
}
#screen > #panel .native-shop[data-native-ui='ready'] .native-resources {
  left: 615px;
  width: 160px;
}
#screen > #panel .native-shop[data-native-ui='ready'] .native-price h3,
#screen > #panel .native-shop[data-native-ui='ready'] .native-resources h3,
#screen > #panel .native-shop[data-native-ui='ready'] .native-cost-row > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#screen > #panel .native-shop[data-native-ui='ready'] .native-cost-row,
#screen > #panel .native-shop[data-native-ui='ready'] .native-resources p {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 32px;
  margin: 0;
  padding: 0 4px;
  color: #e0e0b7;
  font-size: 0;
  line-height: 32px;
}
#screen > #panel .native-shop[data-native-ui='ready'] .native-cost-row strong,
#screen > #panel .native-shop[data-native-ui='ready'] .native-resources b {
  font-size: 12px;
  font-weight: normal;
}
#screen > #panel:has(.native-shop) #panel-close {
  display: none;
}
#screen > #panel .native-shop[data-native-ui='ready'] .native-confirm {
  left: 350px;
  top: 569px;
  width: 434px;
  height: 29px;
  gap: 11px;
}
#screen > #panel .native-shop[data-native-ui='ready'] .native-confirm button {
  min-height: 29px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: transparent;
  font-size: 0;
}
#screen > #panel .native-shop[data-native-ui='ready'] .native-confirm button:hover {
  border-color: #c9bb79;
  background: #d1b97418;
}
#screen > #panel .native-shop[data-native-ui='ready'] .native-confirm button:disabled {
  background: #050805ba;
  cursor: not-allowed;
  opacity: 1;
}
#screen > #panel:not(:has(.native-shop)) #panel-content {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #829070 #081008;
  overscroll-behavior: contain;
}
#screen > #panel #territory-canvas {
  width: 505px;
  height: auto;
  aspect-ratio: 4 / 3;
}
#screen > #panel .squad-slots button {
  min-height: 27px;
  padding: 4px 7px;
  font-size: 11px;
}
#screen > #panel .army-detail,
#screen > #panel .info-box,
#screen > #panel .territory-side {
  background-color: #030803;
  color: #c2c9b0;
}
body[data-hud-profile='reference'] #battle-status {
  height: 17px;
  padding: 0 5px;
  background: #040704d9;
  color: #d3d4a9;
  font-size: 10px;
  line-height: 17px;
  text-shadow:
    1px 1px #000,
    -1px -1px #000;
  pointer-events: none;
}
body > #panel .native-cost-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
body > #panel .native-combat-stats,
body > #panel .native-roster-count {
  font-size: 12px;
}
body > #panel :is(button, input, select) {
  min-height: 44px;
}
body > #panel #panel-title {
  max-width: calc(100% - 76px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.native-recruit-description {
  top: 221px;
}
.native-recruit-model {
  position: absolute;
  left: 19px;
  top: 214px;
  width: 281px;
  height: 335px;
  pointer-events: none;
}
#loading[data-original-title='true'] {
  background: #000 var(--native-entry-title) center / contain no-repeat;
  image-rendering: pixelated;
}
#loading[data-original-title='true'] #loading-message {
  position: absolute;
  left: 50%;
  bottom: 80px;
  width: min(640px, 90%);
  transform: translateX(-50%);
  color: #eef0e9;
  text-shadow:
    1px 1px #000,
    -1px -1px #000;
}
#loading[data-original-title='true'] #asset-progress {
  position: absolute;
  left: 25%;
  bottom: 40px;
  width: 50%;
}
#loading[data-original-title='true'] #client-update-refresh {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
}
#entry-dialog[data-original-title='true'] {
  --native-entry-top: calc(50dvh - min(4dvh, 3vw) + 12px);
  position: fixed;
  top: var(--native-entry-top);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: min(600px, calc(100vw - 24px));
  max-height: calc(100dvh - var(--native-entry-top) - max(12px, env(safe-area-inset-bottom, 0px)));
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: '굴림', Gulim, monospace;
}
#entry-dialog[data-original-title='true'] #entry-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 10px;
}
#entry-dialog[data-original-title='true'] #entry-form > :is(small, h1, p) {
  display: none;
}
#entry-dialog[data-original-title='true'] #entry-form > label {
  margin: 0;
  font-size: 12px;
}
#entry-dialog[data-original-title='true']::backdrop {
  background: #000 var(--native-entry-title) center / contain no-repeat;
  image-rendering: pixelated;
}
#entry-dialog[data-original-title='true'] input,
#entry-dialog[data-original-title='true'] select {
  min-height: 44px;
  background: #030603d9;
  color: #e1e5d8;
  border-radius: 0;
  border-color: #7c8476;
}
#entry-dialog[data-original-title='true'] #enter {
  display: block;
  width: 153px;
  min-height: 44px;
  margin: 0 auto;
  align-self: end;
  padding: 0;
  border: 0;
  background: var(--native-entry-confirm) center / 153px 31px no-repeat;
  color: transparent;
}

/* Final native-window fence: old generic panel scroll rules must not shrink
   the 800x600 canvas. NSP footer's 601st pixel is clipped as in native view. */
#screen > #panel #panel-content.original-window-content,
body[data-hud-profile] > #panel #panel-content.original-window-content {
  width: 800px !important;
  height: 600px !important;
  min-width: 800px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: visible !important;
}
#panel .original-window {
  overflow: hidden;
}
#screen > #panel #panel-content.original-window-content #territory-canvas {
  width: 800px !important;
  height: 600px !important;
  aspect-ratio: auto;
}
