* {
  box-sizing: border-box;
}

@font-face {
  font-family: "Inconsolata";
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/inconsolata/inconsolata-v37-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Inconsolata";
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/inconsolata/inconsolata-v37-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inconsolata";
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/inconsolata/inconsolata-v37-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Global top HUD: keep the existing page body intact. */
:root {
  --game-latin-font: "Inconsolata";
  --game-code-font: "Inconsolata", "SF Mono", "SFMono-Regular", "Cascadia Mono", "Consolas", "Liberation Mono", ui-monospace, monospace;
  --apple-china-font: var(--game-latin-font), "PingFang SC", "PingFang HK", "PingFang TC", "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  --global-topbar-height: 76px;
  --global-bottom-nav-reserve: 92px;
  --global-topbar-bg: rgba(250, 247, 238, 0.94);
  --global-topbar-border: rgba(119, 102, 68, 0.16);
  --global-topbar-text: #243039;
  --global-topbar-muted: #6c766e;
  --global-topbar-accent: #496f63;
  --global-nav-bottom: max(16px, env(safe-area-inset-bottom));
  --global-nav-bg: #fbf8ee;
  --global-nav-z: 5000;
  --global-hud-z: 6200;
  --global-workbench-modal-z: 5400;
  --global-system-dialog-z: 40000;
}

.global-feedback-host {
  position: fixed;
  z-index: 6400;
  top: calc(var(--global-topbar-height) + 14px);
  right: max(18px, env(safe-area-inset-right));
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}

.global-feedback-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid rgba(222, 213, 185, 0.8);
  border-left-width: 4px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.98), rgba(244, 239, 223, 0.94)),
    #fbf7eb;
  color: #22302d;
  box-shadow: 0 14px 34px rgba(24, 30, 27, 0.18);
  font-family: var(--apple-china-font);
  pointer-events: auto;
  animation: global-feedback-enter 180ms ease-out both;
  backdrop-filter: blur(14px);
  will-change: opacity, transform, filter;
}

.global-feedback-toast.leaving {
  animation: global-feedback-leave 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: none;
}

.global-feedback-toast-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(34, 48, 45, 0.08);
  color: #496055;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.global-feedback-toast-text {
  min-width: 0;
  color: #22302d;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.global-feedback-toast.success {
  border-left-color: #32b88a;
}

.global-feedback-toast.success .global-feedback-toast-label {
  background: rgba(50, 184, 138, 0.16);
  color: #177052;
}

.global-feedback-toast.error {
  border-left-color: #e15656;
}

.global-feedback-toast.error .global-feedback-toast-label {
  background: rgba(225, 86, 86, 0.14);
  color: #9d3030;
}

.global-feedback-toast.warning {
  border-left-color: #d8a62d;
}

.global-feedback-toast.warning .global-feedback-toast-label {
  background: rgba(216, 166, 45, 0.18);
  color: #8a6214;
}

.global-feedback-toast.info {
  border-left-color: #4d80a8;
}

.global-feedback-toast.info .global-feedback-toast-label {
  background: rgba(77, 128, 168, 0.14);
  color: #355f7e;
}

@keyframes global-feedback-enter {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes global-feedback-leave {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(-10px) scale(0.985);
  }
}

.game-system-dialog-backdrop {
  position: fixed;
  z-index: var(--global-system-dialog-z);
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 48% 24%, rgba(255, 255, 255, 0.44), transparent 34%),
    linear-gradient(135deg, rgba(229, 249, 246, 0.48), rgba(247, 241, 226, 0.38)),
    rgba(15, 23, 24, 0.34);
  backdrop-filter: blur(24px) saturate(1.28);
  -webkit-backdrop-filter: blur(24px) saturate(1.28);
  animation: game-system-dialog-backdrop-in 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.game-system-dialog-backdrop.leaving {
  animation: game-system-dialog-backdrop-out 180ms ease both;
}

.game-system-dialog {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.88), rgba(238, 250, 247, 0.72) 46%, rgba(255, 248, 232, 0.78)),
    rgba(255, 255, 255, 0.72);
  color: #132d2d;
  font-family: var(--apple-china-font);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(255, 255, 255, 0.28),
    0 32px 84px rgba(9, 18, 18, 0.24),
    0 8px 24px rgba(38, 93, 86, 0.12);
  animation: game-system-dialog-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
  isolation: isolate;
}

.game-system-dialog::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 29px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.72), transparent 32%),
    radial-gradient(circle at 78% 2%, rgba(147, 225, 218, 0.38), transparent 28%);
  pointer-events: none;
}

.game-system-dialog-orb {
  position: absolute;
  top: -70px;
  right: -58px;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(127, 219, 210, 0.34), rgba(127, 219, 210, 0));
  filter: blur(1px);
  pointer-events: none;
}

.game-system-dialog.danger {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(250, 240, 232, 0.72) 46%, rgba(255, 246, 230, 0.8)),
    rgba(255, 255, 255, 0.72);
}

.game-system-dialog-kicker {
  position: relative;
  margin-bottom: 6px;
  color: rgba(58, 101, 96, 0.78);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.game-system-dialog-title {
  position: relative;
  margin: 0;
  color: #102929;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 950;
  line-height: 1.04;
  letter-spacing: 0;
}

.game-system-dialog-message {
  position: relative;
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  color: rgba(24, 48, 47, 0.76);
  font-size: 16px;
  font-weight: 760;
  line-height: 1.55;
}

.game-system-dialog-message p {
  margin: 0;
}

.game-system-dialog-input-wrap {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.game-system-dialog-input-label {
  color: rgba(24, 48, 47, 0.55);
  font-size: 13px;
  font-weight: 850;
}

.game-system-dialog-input {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid rgba(37, 78, 73, 0.22);
  border-radius: 18px;
  outline: none;
  background: rgba(255, 255, 255, 0.62);
  color: #102929;
  font: 850 19px/1.2 var(--apple-china-font);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(12, 42, 39, 0.08);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.game-system-dialog-input:focus {
  border-color: rgba(30, 132, 123, 0.54);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 0 0 5px rgba(69, 178, 166, 0.16);
}

.game-system-dialog-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.game-system-dialog-button {
  min-width: 104px;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--apple-china-font);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.game-system-dialog-button:hover {
  transform: translateY(-1px);
}

.game-system-dialog-button:active {
  transform: translateY(0) scale(0.985);
}

.game-system-dialog-button.secondary {
  border-color: rgba(50, 76, 73, 0.1);
  background: rgba(255, 255, 255, 0.58);
  color: rgba(19, 45, 45, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.game-system-dialog-button.primary {
  background:
    linear-gradient(180deg, rgba(39, 152, 233, 0.98), rgba(20, 108, 213, 0.98));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 12px 28px rgba(24, 113, 218, 0.25);
}

.game-system-dialog.danger .game-system-dialog-button.primary {
  background: linear-gradient(180deg, rgba(245, 110, 88, 0.98), rgba(206, 66, 62, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 12px 28px rgba(202, 70, 61, 0.22);
}

@keyframes game-system-dialog-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes game-system-dialog-backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes game-system-dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.965);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .game-system-dialog {
    width: min(100%, calc(100vw - 24px));
    padding: 20px;
    border-radius: 26px;
  }

  .game-system-dialog-title {
    font-size: 28px;
  }

  .game-system-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .game-system-dialog-button {
    min-width: 0;
  }

  .game-system-dialog-actions:has(.game-system-dialog-button:only-child) {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .global-feedback-host {
    top: auto;
    right: 14px;
    bottom: calc(var(--global-bottom-nav-reserve) + 12px);
    left: 14px;
    width: auto;
  }

  .global-feedback-toast {
    min-height: 50px;
    padding: 11px 12px;
  }

  .global-feedback-toast-text {
    font-size: 14px;
  }
}

.app,
body[data-page="island"] .app {
  max-width: none;
  padding-top: calc(var(--global-topbar-height) + 18px);
  padding-bottom: var(--global-bottom-nav-reserve);
}

body[data-page="island"] .app {
  padding-right: 0;
  padding-left: 0;
}

.topbar,
body[data-page="island"] .topbar {
  position: fixed;
  z-index: var(--global-hud-z);
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: var(--global-topbar-height);
  margin: 0;
  padding: 8px 24px;
  border-bottom: 1px solid var(--global-topbar-border);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(246, 241, 230, 0.92)),
    var(--global-topbar-bg);
  color: var(--global-topbar-text);
  box-shadow: 0 10px 34px rgba(42, 35, 21, 0.08);
  backdrop-filter: blur(14px);
}

.legacy-top-title,
.legacy-top-actions,
.page-tabs,
body[data-page="island"] .page-tabs {
  display: none !important;
}

.global-player-button {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 10px;
  min-width: 128px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--global-topbar-text);
  text-align: left;
}

.global-player-anchor {
  position: relative;
  z-index: 140;
  flex: 0 0 auto;
}

.global-player-anchor .global-player-button {
  min-height: 52px;
  padding: 3px 8px 3px 3px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.global-player-anchor .global-player-button:hover,
.global-player-anchor .global-player-button.menu-open {
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 8px 22px rgba(39, 51, 43, 0.12);
}

.global-player-anchor .global-player-button:focus-visible {
  outline: 2px solid rgba(73, 111, 99, 0.35);
  outline-offset: 3px;
}

.global-player-button .player-avatar {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(73, 111, 99, 0.2);
  box-shadow: 0 8px 20px rgba(44, 55, 47, 0.1);
}

.global-player-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.global-player-text strong,
.global-player-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-player-text strong {
  font-size: 14px;
  line-height: 1.15;
}

.global-player-text small {
  color: var(--global-topbar-muted);
  font-size: 11px;
}

.global-player-menu {
  position: absolute;
  z-index: calc(var(--global-hud-z) + 520);
  top: calc(100% + 9px);
  left: 0;
  display: none;
  width: 232px;
  overflow: hidden;
  isolation: isolate;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 6%, rgba(255, 255, 255, 0.22), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(120, 220, 206, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(30, 39, 39, 0.84), rgba(15, 20, 21, 0.76));
  box-shadow:
    0 24px 58px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px) saturate(1.45);
  -webkit-backdrop-filter: blur(24px) saturate(1.45);
}

.topbar.player-menu-open,
body[data-page="island"] .topbar.player-menu-open {
  z-index: calc(var(--global-hud-z) + 520);
  overflow: visible;
}

.topbar.player-menu-open .global-player-anchor,
body[data-page="island"] .topbar.player-menu-open .global-player-anchor {
  z-index: 4;
}

.global-player-menu.open {
  display: grid;
}

.global-player-menu::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -35%;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.22), transparent 24%),
    radial-gradient(circle at 70% 82%, rgba(255, 255, 255, 0.1), transparent 28%),
    linear-gradient(115deg, transparent 0 34%, rgba(255, 255, 255, 0.1) 42%, transparent 54%);
  filter: blur(8px);
  transform: rotate(-8deg);
  pointer-events: none;
}

.global-player-menu::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1px;
  border-radius: 17px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 38%),
    radial-gradient(circle at 52% 0%, rgba(255, 255, 255, 0.18), transparent 30%);
  opacity: 0.9;
  pointer-events: none;
}

.global-player-menu-item {
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 46px;
  overflow: hidden;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #f3f0e8;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.global-player-menu-item:nth-child(3),
.global-player-menu-item:nth-child(6) {
  margin-top: 8px;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.1);
}

.global-player-menu-item i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(248, 252, 245, 0.34), rgba(224, 238, 228, 0.14)),
    rgba(248, 244, 231, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 6px 14px rgba(11, 22, 18, 0.16);
  color: rgba(255, 255, 255, 0.96);
  font-style: normal;
  font-size: 0;
  font-weight: 900;
}

.global-player-menu-item i svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.global-player-menu-item:not(.placeholder):hover i,
.global-player-menu-item:not(.placeholder):focus-visible i {
  border-color: rgba(255, 255, 255, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 249, 0.34), rgba(220, 239, 228, 0.13)),
    rgba(252, 247, 229, 0.16);
  color: #ffffff;
}

.global-player-menu-item span {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-player-menu-item:not(.placeholder):hover,
.global-player-menu-item:not(.placeholder):focus-visible {
  background:
    radial-gradient(circle at 18% 50%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.global-player-menu-item.placeholder {
  cursor: default;
}

.global-primary-nav {
  position: fixed;
  z-index: calc(var(--global-hud-z) + 360);
  bottom: var(--global-nav-bottom);
  left: 50%;
  max-width: calc(100vw - 32px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: visible;
  padding: 4px;
  border: 1px solid rgba(73, 111, 99, 0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, #fffdf7 0%, #f5efe1 100%),
    var(--global-nav-bg);
  background-clip: padding-box;
  box-shadow: 0 16px 38px rgba(30, 36, 31, 0.18);
  transform: translateX(-50%);
  backdrop-filter: none;
  isolation: isolate;
  opacity: 1;
  pointer-events: auto;
  scrollbar-width: none;
}

.global-primary-nav::-webkit-scrollbar {
  display: none;
}

.global-nav-item {
  position: relative;
  display: flex;
  flex: 0 0 auto;
}

.global-nav-button {
  gap: 7px;
  min-width: 74px;
  min-height: 42px;
  width: 100%;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #56635b;
  font-weight: 800;
}

.global-nav-button i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(73, 111, 99, 0.1);
  color: var(--global-topbar-accent);
  font-style: normal;
  font-size: 12px;
}

.global-nav-button.global-nav-button-visual {
  gap: 8px;
  min-width: 104px;
  min-height: 58px;
  padding: 6px 16px 6px 8px;
}

.global-nav-button.global-nav-button-visual i {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: transparent;
  overflow: visible;
}

.global-nav-button.global-nav-button-visual i img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.global-nav-button.selected {
  background: #dfe7df;
  color: #1f3f36;
}

.global-nav-item.world-menu-open .global-nav-button[data-page="world"],
.global-nav-item.government-menu-open .global-nav-button[data-page="government"],
.global-nav-item.diplomacy-menu-open .global-nav-button[data-page="diplomacy"] {
  background: #e8efe7;
  color: #1f3f36;
  box-shadow: inset 0 0 0 2px #2db85f;
}

.global-world-nav-menu,
.global-government-nav-menu,
.global-diplomacy-nav-menu {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: calc(var(--global-hud-z) + 320);
  display: grid;
  gap: 7px;
  min-width: 118px;
  padding: 8px;
  border: 1px solid rgba(73, 111, 99, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(245, 239, 225, 0.96)),
    var(--global-nav-bg);
  box-shadow: 0 18px 42px rgba(30, 36, 31, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px) scale(0.98);
  transform-origin: center bottom;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.global-government-nav-menu,
.global-diplomacy-nav-menu {
  min-width: 126px;
}

.global-diplomacy-nav-menu {
  right: 0;
  left: auto;
  transform: translate(0, 8px) scale(0.98);
  transform-origin: right bottom;
}

.global-world-nav-menu::after,
.global-government-nav-menu::after,
.global-diplomacy-nav-menu::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border-right: 1px solid rgba(73, 111, 99, 0.18);
  border-bottom: 1px solid rgba(73, 111, 99, 0.18);
  background: #f5efe1;
  transform: translateX(-50%) rotate(45deg);
}

.global-diplomacy-nav-menu::after {
  right: 42px;
  left: auto;
  transform: rotate(45deg);
}

.global-nav-item.world-menu-open .global-world-nav-menu,
.global-nav-item.government-menu-open .global-government-nav-menu,
.global-nav-item.diplomacy-menu-open .global-diplomacy-nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.global-nav-item.diplomacy-menu-open .global-diplomacy-nav-menu {
  transform: translate(0, 0) scale(1);
}

.global-world-nav-option,
.global-government-nav-option,
.global-diplomacy-nav-option {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px 8px 9px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #4f5d55;
  font-weight: 900;
  white-space: nowrap;
}

.global-world-nav-option i,
.global-government-nav-option i,
.global-diplomacy-nav-option i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(73, 111, 99, 0.11);
  color: var(--global-topbar-accent);
  font-style: normal;
  font-size: 12px;
}

.global-world-nav-option.visual-icon,
.global-government-nav-option.visual-icon,
.global-diplomacy-nav-option.visual-icon {
  gap: 12px;
  min-height: 72px;
  padding: 8px 17px 8px 10px;
}

.global-world-nav-option.visual-icon i,
.global-government-nav-option.visual-icon i,
.global-diplomacy-nav-option.visual-icon i {
  width: 56px;
  height: 56px;
  border-radius: 17px;
  background: transparent;
  overflow: visible;
}

.global-world-nav-option.visual-icon i img,
.global-government-nav-option.visual-icon i img,
.global-diplomacy-nav-option.visual-icon i img {
  display: block;
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 3px 5px rgba(34, 47, 39, 0.16));
  object-fit: contain;
}

.global-world-nav-option:hover,
.global-world-nav-option:focus-visible,
.global-government-nav-option:hover,
.global-government-nav-option:focus-visible,
.global-diplomacy-nav-option:hover,
.global-diplomacy-nav-option:focus-visible {
  background: #dfe7df;
  color: #1f3f36;
}

.global-world-nav-option:focus-visible,
.global-government-nav-option:focus-visible,
.global-diplomacy-nav-option:focus-visible {
  outline: 2px solid rgba(45, 184, 95, 0.42);
  outline-offset: 2px;
}

.global-status,
body[data-page="island"] .global-status {
  position: static;
  z-index: auto;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-self: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: min(860px, calc(100vw - 380px));
  height: auto;
  min-width: max-content;
  margin: 0;
  overflow-x: auto;
  pointer-events: auto;
  scrollbar-width: thin;
}

.global-status .metric,
body[data-page="island"] .global-status .metric {
  display: grid;
  grid-template-columns: 24px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 7px;
  min-width: 92px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid rgba(73, 111, 99, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--global-topbar-text);
}

.global-status .metric i,
body[data-page="island"] .global-status .metric i {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(73, 111, 99, 0.12);
  color: var(--global-topbar-accent);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.global-status .metric span,
body[data-page="island"] .global-status .metric span {
  margin: 0;
  color: var(--global-topbar-muted);
  font-size: 11px;
  line-height: 1;
}

.global-status .metric strong,
body[data-page="island"] .global-status .metric strong {
  overflow: hidden;
  color: var(--global-topbar-text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-mailbox-anchor {
  flex: 0 0 auto;
  justify-self: end;
}

.global-mailbox-anchor .mailbox-toggle {
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 7px 14px 7px 9px;
  border-color: rgba(73, 111, 99, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: #243039;
  font-weight: 900;
}

.global-mailbox-anchor .mailbox-toggle-icon {
  display: block;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  object-fit: contain;
}

.global-mailbox-anchor .mailbox-toggle-label {
  line-height: 1;
  white-space: nowrap;
}

.global-mailbox-anchor .mailbox-popover {
  z-index: 120;
}

@media (max-width: 900px) {
  .topbar,
  body[data-page="island"] .topbar {
    gap: 10px;
    justify-content: center;
    padding: 8px 12px;
  }

  .global-primary-nav {
    gap: 4px;
    max-width: calc(100vw - 24px);
  }

  .global-nav-button {
    min-width: 58px;
    padding: 8px 9px;
  }

  .global-nav-button.global-nav-button-visual {
    min-width: 86px;
    padding: 6px 11px 6px 7px;
  }

  .global-nav-button span {
    font-size: 12px;
  }

  .global-status {
    justify-content: flex-start;
    width: max-content;
    max-width: min(520px, calc(100vw - 260px));
  }
}

@media (max-width: 640px) {
  :root {
    --global-topbar-height: 88px;
  }

  .app,
  body[data-page="island"] .app {
    padding-top: calc(var(--global-topbar-height) + 12px);
    padding-bottom: var(--global-bottom-nav-reserve);
  }

  .topbar,
  body[data-page="island"] .topbar {
    height: var(--global-topbar-height);
    align-items: center;
    overflow-x: auto;
  }

  .global-player-button {
    grid-template-columns: 38px minmax(0, 1fr);
    min-width: 96px;
  }

  .global-player-button .player-avatar {
    width: 38px;
    height: 38px;
  }

  .global-status {
    max-width: min(420px, calc(100vw - 220px));
    padding-top: 2px;
  }

  .global-status .metric {
    min-width: 82px;
    min-height: 40px;
    padding: 6px 8px;
  }

  .global-mailbox-anchor {
    align-self: start;
  }

  .global-mailbox-anchor .mailbox-toggle {
    min-height: 38px;
    padding: 7px 11px;
  }

  .global-primary-nav {
    right: 12px;
    bottom: var(--global-nav-bottom);
    left: 12px;
    max-width: none;
    justify-content: space-between;
    padding: 6px;
    border-radius: 20px;
    background:
      linear-gradient(180deg, #fffdf7 0%, #f5efe1 100%),
      var(--global-nav-bg);
    box-shadow: 0 16px 38px rgba(30, 36, 31, 0.18);
    transform: none;
    backdrop-filter: none;
  }

  .global-nav-item {
    flex: 1 1 0;
    min-width: 0;
  }

  .global-nav-button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 50px;
    flex-direction: column;
    gap: 3px;
    border-radius: 16px;
    padding: 6px 4px;
  }

  .global-nav-button i {
    width: 22px;
    height: 22px;
  }

  .global-nav-button.global-nav-button-visual i,
  .global-nav-button.global-nav-button-visual i img {
    width: 34px;
    height: 34px;
  }

  .global-nav-button span {
    font-size: 11px;
  }
}

body {
  margin: 0;
  background: #f4f7f8;
  color: #18252d;
  font-family: var(--apple-china-font);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}

button,
select,
input,
textarea,
.button-link {
  font: inherit;
}

svg text {
  font-family: var(--apple-china-font);
}

:where(
  code,
  kbd,
  samp,
  pre,
  input[type="number"],
  .world-sea-code,
  .live-remaining-duration,
  [data-live-countdown-at],
  .global-status .metric strong,
  .metric strong,
  .mailbox-stat-card strong,
  .warehouse-stat-card strong
) {
  font-family: var(--game-code-font), "PingFang SC", "PingFang HK", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
  letter-spacing: 0;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #0f6b66;
  background: #0f6b66;
  color: white;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
}

button.secondary,
.button-link.secondary {
  border-color: #b8c7cb;
  background: white;
  color: #1d343c;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.small {
  padding: 4px 8px;
  font-size: 12px;
}

select {
  width: 100%;
  border: 1px solid #c8d4d8;
  border-radius: 6px;
  padding: 8px;
  background: white;
}

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 6px 0 0;
  color: #60727a;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.mailbox-widget {
  position: relative;
}

.mailbox-toggle {
  gap: 6px;
}

.mailbox-badge {
  align-items: center;
  background: #b42318;
  border-radius: 999px;
  color: white;
  display: none;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  min-width: 20px;
  padding: 4px 6px;
}

.mailbox-popover {
  background: rgba(255, 252, 245, 0.98);
  border: 1px solid rgba(147, 125, 87, 0.28);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(18, 31, 38, 0.18);
  display: none;
  min-width: 320px;
  padding: 12px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
}

.mailbox-popover.open {
  display: grid;
  gap: 10px;
}

.mailbox-popover-header,
.mailbox-popover-actions,
.mailbox-toolbar,
.mailbox-row-meta,
.mailbox-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.mailbox-popover-header span,
.mailbox-toolbar span,
.mailbox-row-meta time,
.mailbox-preview-item small,
.mailbox-preview-item em,
.mailbox-row p {
  color: #60727a;
}

.mailbox-preview-list,
.mailbox-list {
  display: grid;
  gap: 8px;
}

.mailbox-preview-item {
  align-items: start;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(55, 76, 89, 0.1);
  color: #18252d;
  display: grid;
  gap: 3px;
  justify-content: stretch;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.mailbox-preview-item span,
.mailbox-type {
  background: rgba(15, 107, 102, 0.1);
  border-radius: 999px;
  color: #0f6b66;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  width: fit-content;
}

.mailbox-preview-item.unread,
.mailbox-row.unread {
  border-color: rgba(15, 107, 102, 0.38);
  box-shadow: inset 0 0 0 1px rgba(15, 107, 102, 0.12);
}

.mailbox-dashboard {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 14px;
}

.mailbox-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mailbox-filter-button {
  align-items: center;
  background: rgba(255, 252, 245, 0.9);
  border: 1px solid rgba(147, 125, 87, 0.26);
  border-radius: 999px;
  color: #29434e;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.mailbox-filter-button:hover:not(:disabled) {
  background: rgba(15, 107, 102, 0.08);
  border-color: rgba(15, 107, 102, 0.34);
  transform: translateY(-1px);
}

.mailbox-filter-button.active {
  background: #0f6b66;
  border-color: #0f6b66;
  color: #fffaf0;
}

.mailbox-filter-button span {
  background: rgba(15, 107, 102, 0.12);
  border-radius: 999px;
  color: inherit;
  font-size: 12px;
  line-height: 1;
  min-width: 22px;
  padding: 4px 7px;
  text-align: center;
}

.mailbox-filter-button.active span {
  background: rgba(255, 252, 245, 0.18);
}

.mailbox-stat-card,
.mailbox-row {
  background: rgba(255, 252, 245, 0.94);
  border: 1px solid rgba(147, 125, 87, 0.24);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(32, 40, 48, 0.08);
  padding: 14px;
}

.mailbox-stat-card {
  display: grid;
  gap: 4px;
}

.mailbox-stat-card span {
  color: #60727a;
  font-size: 13px;
}

.mailbox-stat-card strong {
  color: #0b2b3a;
  font-size: 24px;
}

.mailbox-toolbar {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.mailbox-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.mailbox-row h3 {
  margin: 8px 0 6px;
}

.mailbox-row p {
  margin: 0;
}

.mailbox-actions {
  justify-content: end;
}

.summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric,
.side section,
.plot {
  background: white;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
}

.metric {
  padding: 14px;
}

.metric i {
  display: none;
  font-style: normal;
}

.metric span {
  display: block;
  color: #60727a;
  font-size: 13px;
  margin-bottom: 6px;
}

.metric strong {
  font-size: 22px;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: #60727a;
}

.storage-bar,
.status-bar {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef0;
}

.storage-fill,
.status-fill {
  height: 100%;
  border-radius: inherit;
  background: #0f6b66;
}

.storage-metric.warning .storage-fill,
.power-metric.warning .status-fill {
  background: #c18400;
}

.storage-metric.danger .storage-fill,
.power-metric.danger .status-fill {
  background: #b42318;
}

.storage-metric.warning,
.power-metric.warning {
  border-color: #e4bd68;
}

.storage-metric.danger,
.power-metric.danger {
  border-color: #e08a82;
}

.durability {
  border-bottom: 1px solid #edf2f3;
  padding-bottom: 8px;
}

.durability .row {
  border-bottom: 0;
}

.durability.warning .status-fill {
  background: #c18400;
}

.durability.danger .status-fill {
  background: #b42318;
}

.page-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.page-tab {
  border-color: #dbe4e7;
  background: white;
  color: #40535b;
}

.page-tab.selected {
  border-color: #0f6b66;
  background: #0f6b66;
  color: white;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

body[data-page="world"] {
  background:
    radial-gradient(circle at 22% 6%, rgba(29, 107, 129, 0.18), transparent 34%),
    linear-gradient(180deg, #101d22 0%, #071117 58%, #050b10 100%);
}

body[data-page="world"] .app {
  max-width: min(100vw, 1900px);
  width: 100%;
  padding-top: calc(var(--global-topbar-height) + 10px);
  padding-right: clamp(16px, 2.4vw, 44px);
  padding-left: clamp(16px, 2.4vw, 44px);
}

body[data-page="world"] #worldPage > section > h2 {
  display: none;
}

.world-command-console {
  --world-panel: rgba(9, 22, 29, 0.88);
  --world-panel-soft: rgba(17, 38, 49, 0.7);
  --world-line: rgba(145, 181, 189, 0.24);
  --world-text: #eef7f5;
  --world-muted: #91a7ad;
  --world-gold: #d6aa55;
  --world-teal: #42c4b2;
  --world-danger: #d35f67;
  --world-axis-size: 44px;
  --world-cell-gap: 5px;
  --world-cell-size: clamp(60px, 7.1vw, 108px);
  color: var(--world-text);
  border: 1px solid rgba(213, 173, 91, 0.2);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(15, 33, 42, 0.97), rgba(6, 16, 22, 0.98)),
    #081219;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 28px);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

.world-command-header {
  align-items: end;
  border-bottom: 1px solid rgba(213, 173, 91, 0.18);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 2px 2px 8px;
}

.world-command-title {
  display: grid;
  gap: 4px;
}

.world-command-title span,
.world-map-board-head span,
.world-layer-rail > span,
.world-dossier-head span {
  color: var(--world-gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.world-command-title h3 {
  font-size: 28px;
  line-height: 1;
  margin: 0;
}

.world-command-title p {
  color: var(--world-muted);
  margin: 0;
}

.world-command-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(94px, 1fr));
}

.world-command-metric {
  border: 1px solid var(--world-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  min-height: 56px;
  padding: 6px 9px;
}

.world-command-metric span,
.world-command-metric small {
  color: var(--world-muted);
  display: block;
  font-size: 12px;
}

.world-command-metric strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
  margin-top: 2px;
}

.world-command-metric.scout strong,
.world-command-metric.fleet strong {
  color: var(--world-teal);
}

.world-command-metric.route strong {
  color: var(--world-gold);
}

.world-command-metric.danger strong {
  color: #ff8a92;
}

.world-command-body {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  overflow-x: hidden;
  overscroll-behavior-x: contain;
  padding-top: 8px;
}

.world-layer-rail {
  align-self: start;
  display: grid;
  gap: 8px;
  position: sticky;
  top: 16px;
}

.world-layer-pill {
  align-items: center;
  border: 1px solid var(--world-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 64px;
  padding: 7px 4px;
}

.world-layer-pill i {
  border-radius: 999px;
  display: block;
  height: 10px;
  width: 10px;
}

.world-layer-pill strong {
  font-size: 12px;
}

.world-layer-pill small {
  color: var(--world-muted);
  font-size: 11px;
}

.world-layer-pill.faction i { background: #8ea6ff; }
.world-layer-pill.resource i { background: var(--world-gold); }
.world-layer-pill.route i { background: var(--world-teal); }
.world-layer-pill.fleet i { background: #eef7f5; }
.world-layer-pill.danger i { background: var(--world-danger); }
.world-layer-pill.market i { background: #a776ff; }

.world-map-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: max-content;
  justify-content: center;
  min-width: max-content;
}

.world-map-board,
.world-sea-panel {
  border: 1px solid var(--world-line);
  border-radius: 8px;
  background: var(--world-panel);
}

.world-map-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: max-content;
  overflow: visible;
  padding: 10px;
  width: max-content;
}

.world-map-board-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.world-map-board-head div:first-child {
  display: grid;
  gap: 2px;
}

.world-map-board-head strong {
  font-size: 18px;
}

.world-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.world-map-legend span {
  align-items: center;
  color: var(--world-muted);
  display: inline-flex;
  font-size: 12px;
  gap: 5px;
}

.world-map-legend i {
  border-radius: 999px;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.legend-scouted { background: var(--world-teal); }
.legend-resource { background: var(--world-gold); }
.legend-route { background: #66d8ff; }
.legend-danger { background: var(--world-danger); }

.world-chart-wrap {
  background:
    radial-gradient(circle at 44% 48%, rgba(54, 111, 126, 0.2), transparent 28%),
    linear-gradient(0deg, rgba(141, 181, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 181, 184, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16, 47, 61, 0.96), rgba(4, 18, 27, 0.98));
  background-size: auto, 44px 44px, 44px 44px, auto;
  border: 1px solid rgba(132, 173, 181, 0.16);
  border-radius: 8px;
  align-content: start;
  display: grid;
  min-height: 0;
  overflow: visible;
  padding: 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  width: max-content;
}

.world-chart-wrap.world-map-drag-ready {
  cursor: grab;
}

.world-chart-wrap.world-map-dragging,
.world-chart-wrap.world-map-dragging * {
  cursor: grabbing !important;
}

.world-map-column-axis {
  display: grid;
  gap: var(--world-cell-gap);
  grid-template-columns: var(--world-axis-size) repeat(15, var(--world-cell-size));
  min-width: 0;
  width: max-content;
}

.world-map-field-shell {
  display: grid;
  gap: var(--world-cell-gap);
  grid-template-columns: var(--world-axis-size) max-content;
  min-width: 0;
  width: max-content;
}

.world-map-row-axis {
  display: grid;
  gap: var(--world-cell-gap);
  grid-template-rows: repeat(15, var(--world-cell-size));
}

.world-map-axis,
.world-map-corner {
  color: rgba(216, 231, 229, 0.66);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  min-height: 28px;
  place-items: center;
}

.world-map-field {
  height: auto;
  min-height: 0;
  min-width: 0;
  position: relative;
  width: max-content;
}

.world-map-grid {
  display: grid;
  gap: var(--world-cell-gap);
  grid-template-columns: repeat(15, var(--world-cell-size));
  grid-template-rows: repeat(15, var(--world-cell-size));
  position: relative;
  width: max-content;
  z-index: 3;
}

.world-voyage-routes {
  height: 100%;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 8;
}

.world-voyage-route {
  pointer-events: none;
}

.world-voyage-route-guide,
.world-voyage-route-line {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.world-voyage-route-guide {
  opacity: 0.32;
  stroke: rgba(9, 60, 76, 0.78);
  stroke-width: 6;
}

.world-voyage-route-line {
  stroke: rgba(118, 235, 221, 0.9);
  stroke-dasharray: 12 10;
  stroke-width: 2.4;
}

.world-voyage-route-dot {
  stroke: rgba(223, 255, 251, 0.9);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.world-voyage-route-dot.start {
  fill: rgba(26, 156, 146, 0.94);
}

.world-voyage-route-dot.end {
  fill: rgba(244, 194, 90, 0.96);
}

.world-voyage-route-ship {
  opacity: 0.96;
  pointer-events: auto;
}

.world-voyage-route-ship-action {
  cursor: pointer;
  outline: none;
  pointer-events: auto;
}

.world-voyage-route-ship-action:hover .route-voyage-ship-icon,
.world-voyage-route-ship-action:focus-visible .route-voyage-ship-icon {
  filter:
    drop-shadow(0 2px 2px rgba(0, 11, 18, 0.44))
    drop-shadow(0 0 7px rgba(118, 235, 221, 0.58));
}

.world-voyage-ship-hit {
  fill: rgba(255, 255, 255, 0.001);
  pointer-events: auto;
  stroke: transparent;
}

.world-voyage-route-ship .route-voyage-ship-icon {
  display: block;
  filter:
    drop-shadow(0 1px 1px rgba(0, 11, 18, 0.34))
    drop-shadow(0 0 3px rgba(116, 235, 239, 0.18));
  height: 50px;
  pointer-events: none;
  width: 18px;
}

.world-voyage-route-ship .route-voyage-icon-disc {
  fill: rgba(18, 126, 139, 0.58);
  stroke: rgba(130, 235, 242, 0.72);
  stroke-width: 1.2;
}

.world-moving-ship-menu-object {
  overflow: visible;
  pointer-events: auto;
}

.world-ship-dock-menu.world-moving-ship-menu {
  bottom: auto;
  box-sizing: border-box;
  max-width: none;
  min-width: 0;
  position: relative;
  right: auto;
  width: 334px;
}

.world-ship-dock-menu.world-moving-ship-menu::after {
  left: 50%;
  right: auto;
  transform: translateX(-50%) rotate(45deg);
}

.world-ship-dock-menu .world-moving-ship-row {
  box-sizing: border-box;
  cursor: pointer;
  gap: 8px;
  grid-template-columns: 158px 132px;
  justify-content: start;
  padding: 8px 10px;
}

.world-ship-dock-menu .world-moving-ship-row .world-docked-ship-bars {
  justify-self: start;
  max-width: 132px;
  min-width: 0;
  width: 132px;
}

.world-ship-dock-menu .world-moving-ship-row .world-docked-ship-bars i {
  max-width: 100%;
  width: 132px;
}

.world-ship-dock-menu .world-moving-ship-row:hover,
.world-ship-dock-menu .world-moving-ship-row:focus-visible {
  background: transparent;
  outline: none;
}

.world-sea-cell-slot {
  height: var(--world-cell-size);
  min-height: 0;
  min-width: 0;
  position: relative;
  width: var(--world-cell-size);
  z-index: 1;
}

.world-sea-cell-slot.menu-open {
  z-index: 30;
}

button.world-sea-cell {
  align-items: stretch;
  background:
    radial-gradient(circle at 30% 22%, rgba(92, 148, 163, 0.26), transparent 44%),
    linear-gradient(145deg, rgba(15, 55, 70, 0.76), rgba(5, 24, 35, 0.88));
  border: 1px solid rgba(130, 173, 180, 0.26);
  border-radius: 5px;
  color: #d9f2ef;
  display: block;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
  text-align: left;
  width: 100%;
}

button.world-sea-cell:hover {
  border-color: rgba(214, 170, 85, 0.65);
  box-shadow: inset 0 0 0 1px rgba(214, 170, 85, 0.28);
}

button.world-sea-cell.menu-open {
  border-color: rgba(72, 220, 198, 0.74);
  box-shadow:
    0 0 0 2px rgba(72, 220, 198, 0.18),
    inset 0 0 0 1px rgba(72, 220, 198, 0.36);
}

.world-sea-action-menu {
  background:
    linear-gradient(145deg, rgba(12, 31, 39, 0.98), rgba(5, 17, 24, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(72, 220, 198, 0.18), transparent 58%);
  border: 1px solid rgba(138, 202, 200, 0.44);
  border-radius: 7px;
  bottom: calc(100% + 8px);
  box-shadow:
    0 14px 26px rgba(0, 8, 14, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 4px;
  left: 50%;
  min-width: 72px;
  padding: 5px;
  position: absolute;
  transform: translateX(-50%);
  width: min(94px, calc(var(--world-cell-size) * 1.24));
  z-index: 40;
}

.world-sea-action-menu::after {
  background: rgba(8, 23, 31, 0.98);
  border-bottom: 1px solid rgba(138, 202, 200, 0.36);
  border-right: 1px solid rgba(138, 202, 200, 0.36);
  bottom: -5px;
  content: "";
  height: 9px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%) rotate(45deg);
  width: 9px;
}

.world-sea-action-button {
  align-items: center;
  background: rgba(223, 246, 242, 0.08);
  border: 1px solid rgba(223, 246, 242, 0.13);
  border-radius: 5px;
  color: rgba(234, 252, 248, 0.94);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 26px;
  justify-content: center;
  line-height: 1;
  padding: 0 8px;
  position: relative;
  z-index: 1;
}

.world-sea-action-button:hover {
  background: rgba(72, 220, 198, 0.18);
  border-color: rgba(72, 220, 198, 0.38);
  color: white;
}

.world-sea-action-button.scout,
.world-sea-action-button.voyage {
  background: rgba(16, 142, 129, 0.32);
  border-color: rgba(72, 220, 198, 0.38);
}

.world-sea-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

body.world-sea-view-modal-open {
  overflow: hidden;
}

#worldSeaViewModalHost .world-sea-view-backdrop {
  align-items: center;
  background: rgba(0, 9, 14, 0.56);
  backdrop-filter: blur(9px);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 30000;
}

#worldSeaViewModalHost .world-sea-view-modal {
  background:
    linear-gradient(145deg, rgba(14, 37, 45, 0.97), rgba(5, 19, 27, 0.98)),
    linear-gradient(180deg, rgba(72, 220, 198, 0.08), rgba(214, 170, 85, 0.05));
  border: 1px solid rgba(138, 202, 200, 0.46);
  border-radius: 10px;
  box-shadow:
    0 28px 72px rgba(0, 8, 14, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: #eafcf8;
  max-height: calc(100vh - 36px);
  max-width: calc(100vw - 32px);
  overflow: auto;
  padding: 22px;
  position: relative;
  width: 520px;
}

#worldSeaViewModalHost .world-sea-view-modal.has-city-concept {
  width: min(820px, calc(100vw - 32px));
}

#worldSeaViewModalHost .world-sea-view-close {
  align-items: center;
  background: rgba(234, 252, 248, 0.08);
  border: 1px solid rgba(234, 252, 248, 0.16);
  border-radius: 7px;
  color: rgba(234, 252, 248, 0.9);
  cursor: pointer;
  display: inline-flex;
  font-size: 22px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 38px;
}

#worldSeaViewModalHost .world-sea-view-close:hover {
  background: rgba(72, 220, 198, 0.18);
  border-color: rgba(72, 220, 198, 0.42);
  color: #ffffff;
}

#worldSeaViewModalHost .world-sea-view-head {
  display: grid;
  gap: 6px;
  padding-right: 48px;
}

#worldSeaViewModalHost .world-sea-view-head span {
  color: var(--world-gold, #d6aa55);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

#worldSeaViewModalHost .world-sea-view-head strong {
  color: #f4fffc;
  font-size: 28px;
  font-weight: 950;
  line-height: 1.08;
}

#worldSeaViewModalHost .world-sea-view-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

#worldSeaViewModalHost .world-sea-view-fact {
  align-items: center;
  background: rgba(223, 246, 242, 0.07);
  border: 1px solid rgba(223, 246, 242, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 58px;
  padding: 12px;
}

#worldSeaViewModalHost .world-sea-view-fact > span {
  color: var(--world-muted, rgba(194, 216, 214, 0.68));
  font-size: 12px;
  font-weight: 900;
}

#worldSeaViewModalHost .world-sea-view-fact > strong {
  color: #eafcf8;
  font-size: 18px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

#worldSeaViewModalHost .world-sea-view-fact.has-action {
  grid-template-columns: 112px minmax(0, 1fr) auto;
}

#worldSeaViewModalHost .world-sea-view-destination-button {
  align-self: center;
  background: linear-gradient(180deg, rgba(22, 150, 132, 0.98), rgba(10, 104, 96, 0.98));
  border: 1px solid rgba(72, 220, 198, 0.34);
  border-radius: 7px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 24px rgba(0, 8, 14, 0.24);
  color: #f2fffb;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 950;
  justify-self: end;
  min-height: 36px;
  min-width: 78px;
  padding: 0 18px;
}

#worldSeaViewModalHost .world-sea-view-destination-button:hover {
  background: linear-gradient(180deg, rgba(30, 177, 156, 0.98), rgba(14, 126, 113, 0.98));
  border-color: rgba(72, 220, 198, 0.54);
}

#worldSeaViewModalHost .world-sea-view-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#worldSeaViewModalHost .world-sea-view-action {
  align-items: center;
  appearance: none;
  background:
    radial-gradient(circle at 22% 0, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(35, 64, 61, 0.94), rgba(13, 35, 37, 0.96));
  border: 1px solid rgba(223, 246, 242, 0.16);
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(0, 8, 14, 0.22);
  color: #f4fffc;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 15px;
  font-weight: 950;
  justify-content: center;
  min-height: 46px;
  padding: 0 10px;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

#worldSeaViewModalHost .world-sea-view-action.primary {
  background:
    radial-gradient(circle at 18% 0, rgba(255, 255, 255, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(38, 198, 175, 0.98), rgba(8, 126, 116, 0.98));
  border-color: rgba(72, 220, 198, 0.42);
}

#worldSeaViewModalHost .world-sea-view-action.primary.deliver {
  background:
    radial-gradient(circle at 18% 0, rgba(255, 255, 255, 0.24), transparent 44%),
    linear-gradient(180deg, rgba(66, 214, 146, 0.98), rgba(9, 137, 101, 0.98));
  border-color: rgba(106, 231, 171, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 28px rgba(0, 18, 12, 0.28),
    0 0 0 1px rgba(106, 231, 171, 0.1);
}

#worldSeaViewModalHost .world-sea-view-action.primary.salvage {
  background:
    radial-gradient(circle at 18% 0, rgba(255, 255, 255, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(42, 202, 184, 0.98), rgba(10, 113, 122, 0.98));
  border-color: rgba(72, 220, 198, 0.52);
}

#worldSeaViewModalHost .world-sea-view-action.quiet {
  background:
    radial-gradient(circle at 24% 0, rgba(255, 255, 255, 0.16), transparent 44%),
    linear-gradient(180deg, rgba(214, 170, 85, 0.24), rgba(17, 35, 35, 0.96));
  border-color: rgba(214, 170, 85, 0.26);
  color: #f6e6b8;
}

#worldSeaViewModalHost .world-sea-view-action:hover:not(:disabled),
#worldSeaViewModalHost .world-sea-view-action:focus-visible {
  border-color: rgba(72, 220, 198, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 14px 28px rgba(0, 8, 14, 0.28),
    0 0 0 3px rgba(72, 220, 198, 0.12);
  outline: 0;
  transform: translateY(-1px);
}

#worldSeaViewModalHost .world-sea-view-action.active {
  border-color: rgba(246, 221, 147, 0.64);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 3px rgba(214, 170, 85, 0.14);
}

#worldSeaViewModalHost .world-sea-view-action:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

#worldSeaViewModalHost .world-sea-view-action:disabled {
  color: rgba(234, 252, 248, 0.34);
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

#worldSeaViewModalHost .world-sea-salvage-panel {
  background:
    radial-gradient(circle at 16% 0, rgba(72, 220, 198, 0.12), transparent 38%),
    linear-gradient(145deg, rgba(223, 246, 242, 0.08), rgba(5, 19, 27, 0.58)),
    rgba(5, 19, 27, 0.72);
  border: 1px solid rgba(72, 220, 198, 0.2);
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 28px rgba(0, 8, 14, 0.22);
  display: grid;
  gap: 10px;
  padding: 12px;
}

#worldSeaViewModalHost .world-sea-salvage-panel.active {
  border-color: rgba(72, 220, 198, 0.5);
}

#worldSeaViewModalHost .world-sea-salvage-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

#worldSeaViewModalHost .world-sea-salvage-head span {
  color: rgba(194, 216, 214, 0.78);
  font-size: 12px;
  font-weight: 900;
}

#worldSeaViewModalHost .world-sea-salvage-head strong {
  color: #f4fffc;
  font-size: 18px;
  font-weight: 950;
}

#worldSeaViewModalHost .world-sea-salvage-progress {
  background: rgba(223, 246, 242, 0.14);
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(0, 8, 14, 0.42);
  height: 10px;
  overflow: hidden;
}

#worldSeaViewModalHost .world-sea-salvage-progress-fill {
  background: linear-gradient(90deg, #139685, #2fd4bd);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 0.2s linear;
}

#worldSeaViewModalHost .world-sea-salvage-meta {
  color: rgba(194, 216, 214, 0.78);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  font-size: 12px;
  font-weight: 800;
}

#worldSeaViewModalHost .world-sea-salvage-meta span {
  display: grid;
  gap: 3px;
}

#worldSeaViewModalHost .world-sea-salvage-meta strong {
  color: #f4fffc;
  font-size: 14px;
  font-weight: 950;
}

#worldSeaViewModalHost .world-sea-salvage-select {
  display: grid;
  gap: 6px;
}

#worldSeaViewModalHost .world-sea-salvage-select span,
#worldSeaViewModalHost .world-sea-salvage-panel small {
  color: rgba(194, 216, 214, 0.78);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

#worldSeaViewModalHost .world-sea-salvage-select select {
  appearance: none;
  background:
    linear-gradient(180deg, rgba(223, 246, 242, 0.12), rgba(223, 246, 242, 0.06)),
    rgba(5, 19, 27, 0.66);
  border: 1px solid rgba(72, 220, 198, 0.26);
  border-radius: 9px;
  color: #f4fffc;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  min-height: 42px;
  padding: 0 12px;
}

#worldSeaViewModalHost .world-sea-salvage-ship-list {
  display: grid;
  gap: 8px;
}

#worldSeaViewModalHost .world-sea-salvage-ship-card {
  align-items: center;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(223, 246, 242, 0.12), rgba(223, 246, 242, 0.06)),
    rgba(5, 19, 27, 0.66);
  border: 1px solid rgba(72, 220, 198, 0.26);
  border-radius: 9px;
  color: rgba(244, 255, 252, 0.84);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 2px;
  justify-items: start;
  min-height: 48px;
  padding: 8px 12px;
  text-align: left;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

#worldSeaViewModalHost .world-sea-salvage-ship-card span {
  font-size: 15px;
  font-weight: 950;
  line-height: 1.12;
}

#worldSeaViewModalHost .world-sea-salvage-ship-card small {
  color: rgba(194, 216, 214, 0.76);
  font-size: 12px;
  font-weight: 800;
}

#worldSeaViewModalHost .world-sea-salvage-ship-card:hover,
#worldSeaViewModalHost .world-sea-salvage-ship-card:focus-visible {
  border-color: rgba(72, 220, 198, 0.58);
  box-shadow: 0 0 0 3px rgba(72, 220, 198, 0.1);
  outline: 0;
}

#worldSeaViewModalHost .world-sea-salvage-ship-card.selected {
  background:
    radial-gradient(circle at 16% 0, rgba(255, 255, 255, 0.24), transparent 42%),
    linear-gradient(180deg, rgba(42, 202, 184, 0.94), rgba(8, 126, 116, 0.94));
  border-color: rgba(72, 220, 198, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 22px rgba(0, 8, 14, 0.24),
    0 0 0 3px rgba(72, 220, 198, 0.12);
  color: #ffffff;
}

#worldSeaViewModalHost .world-sea-salvage-ship-card.selected small {
  color: rgba(244, 255, 252, 0.82);
}

#worldSeaViewModalHost .world-sea-salvage-start {
  align-items: center;
  appearance: none;
  background:
    radial-gradient(circle at 18% 0, rgba(255, 255, 255, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(42, 202, 184, 0.98), rgba(10, 113, 122, 0.98));
  border: 1px solid rgba(72, 220, 198, 0.52);
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 24px rgba(0, 8, 14, 0.22);
  color: #f4fffc;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 15px;
  font-weight: 950;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  width: 100%;
}

#worldSeaViewModalHost .world-sea-salvage-start:hover,
#worldSeaViewModalHost .world-sea-salvage-start:focus-visible {
  border-color: rgba(72, 220, 198, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 28px rgba(0, 8, 14, 0.28),
    0 0 0 3px rgba(72, 220, 198, 0.12);
  outline: 0;
}

#worldSeaViewModalHost .world-sea-salvage-start:disabled {
  background:
    linear-gradient(180deg, rgba(223, 246, 242, 0.08), rgba(223, 246, 242, 0.04)),
    rgba(5, 19, 27, 0.6);
  border-color: rgba(223, 246, 242, 0.12);
  box-shadow: none;
  color: rgba(244, 255, 252, 0.36);
  cursor: not-allowed;
}

#worldSeaViewModalHost .world-sea-view-construction-materials {
  background:
    radial-gradient(circle at 12% 0, rgba(255, 255, 255, 0.1), transparent 36%),
    linear-gradient(145deg, rgba(223, 246, 242, 0.08), rgba(5, 19, 27, 0.58)),
    rgba(5, 19, 27, 0.72);
  border: 1px solid rgba(72, 220, 198, 0.18);
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 28px rgba(0, 8, 14, 0.22);
  display: grid;
  gap: 10px;
  padding: 12px;
}

#worldSeaViewModalHost .world-sea-view-construction-materials.deliverable {
  border-color: rgba(64, 220, 132, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 14px 28px rgba(0, 8, 14, 0.24),
    0 0 0 2px rgba(64, 220, 132, 0.18);
}

#worldSeaViewModalHost .world-sea-view-construction-materials.ready {
  border-color: rgba(246, 221, 147, 0.42);
}

#worldSeaViewModalHost .world-sea-view-construction-materials-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

#worldSeaViewModalHost .world-sea-view-construction-materials-head span {
  color: #f4fffc;
  font-size: 15px;
  font-weight: 950;
}

#worldSeaViewModalHost .world-sea-view-construction-materials-head small {
  color: rgba(194, 216, 214, 0.72);
  font-size: 12px;
  font-weight: 900;
}

#worldSeaViewModalHost .world-sea-view-construction-material-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#worldSeaViewModalHost .world-sea-view-construction-material-card {
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.82), transparent 46%),
    linear-gradient(180deg, #fbf9ef 0%, #edf5ef 54%, #dfe9e2 100%);
  border: 1px solid rgba(246, 221, 147, 0.34);
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 22px rgba(0, 8, 14, 0.22);
  color: #07332f;
  display: grid;
  grid-template-rows: 78px minmax(34px, auto);
  min-height: 114px;
  overflow: hidden;
  position: relative;
  width: 96px;
}

#worldSeaViewModalHost .world-sea-view-construction-material-badge {
  align-items: center;
  background: linear-gradient(180deg, #d2a33a, #a97815);
  border-bottom-left-radius: 11px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 6px 12px rgba(0, 8, 14, 0.18);
  color: #fff8df;
  display: inline-flex;
  font-size: 13px;
  font-weight: 950;
  justify-content: center;
  min-height: 24px;
  min-width: 28px;
  padding: 0 7px;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 2;
}

#worldSeaViewModalHost .world-sea-view-construction-material-image {
  align-items: center;
  border-bottom: 1px solid rgba(7, 51, 47, 0.08);
  display: flex;
  font-size: 34px;
  font-weight: 950;
  justify-content: center;
  padding: 10px 12px 8px;
}

#worldSeaViewModalHost .world-sea-view-construction-material-image .product-icon-image {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

#worldSeaViewModalHost .world-sea-view-construction-material-card strong {
  align-items: center;
  color: #07332f;
  display: flex;
  font-size: 13px;
  font-weight: 950;
  justify-content: center;
  line-height: 1.15;
  padding: 6px 6px 8px;
  text-align: center;
}

#worldSeaViewModalHost .world-sea-view-construction-ready {
  color: rgba(234, 252, 248, 0.72);
  font-size: 13px;
  font-weight: 900;
  padding: 4px 0;
}

#worldSeaViewModalHost .world-sea-view-construction-materials-foot {
  align-items: center;
  border-top: 1px solid rgba(223, 246, 242, 0.1);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-top: 10px;
}

#worldSeaViewModalHost .world-sea-view-construction-materials-foot small {
  color: rgba(194, 216, 214, 0.76);
  font-size: 12px;
  font-weight: 900;
}

#worldSeaViewModalHost .world-sea-view-construction-cancel {
  appearance: none;
  background:
    radial-gradient(circle at 22% 0, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(111, 62, 49, 0.94), rgba(44, 24, 28, 0.96));
  border: 1px solid rgba(244, 167, 143, 0.34);
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 20px rgba(0, 8, 14, 0.2);
  color: #ffe5dc;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 950;
  min-height: 36px;
  min-width: 104px;
  padding: 0 16px;
}

#worldSeaViewModalHost .world-sea-view-construction-cancel:hover,
#worldSeaViewModalHost .world-sea-view-construction-cancel:focus-visible {
  border-color: rgba(244, 167, 143, 0.64);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 24px rgba(0, 8, 14, 0.24),
    0 0 0 3px rgba(244, 167, 143, 0.12);
  outline: 0;
}

#worldSeaViewModalHost .world-sea-view-islands {
  background:
    linear-gradient(145deg, rgba(223, 246, 242, 0.08), rgba(5, 19, 27, 0.54)),
    rgba(5, 19, 27, 0.72);
  border: 1px solid rgba(72, 220, 198, 0.16);
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 28px rgba(0, 8, 14, 0.22);
  display: grid;
  gap: 10px;
  padding: 12px;
}

#worldSeaViewModalHost .world-sea-view-islands.empty {
  gap: 4px;
}

#worldSeaViewModalHost .world-sea-view-islands > strong,
#worldSeaViewModalHost .world-sea-view-islands-head strong {
  color: #f4fffc;
  font-size: 17px;
  font-weight: 950;
}

#worldSeaViewModalHost .world-sea-view-islands > small,
#worldSeaViewModalHost .world-sea-view-islands-head span {
  color: var(--world-muted, rgba(194, 216, 214, 0.68));
  font-size: 12px;
  font-weight: 850;
}

#worldSeaViewModalHost .world-sea-view-islands-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

#worldSeaViewModalHost .world-sea-view-island-list {
  display: grid;
  gap: 8px;
}

#worldSeaViewModalHost .world-sea-view-island-row {
  align-items: center;
  background: rgba(223, 246, 242, 0.055);
  border: 1px solid rgba(223, 246, 242, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 54px;
  padding: 9px 10px;
}

#worldSeaViewModalHost .world-sea-view-island-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

#worldSeaViewModalHost .world-sea-view-island-row strong {
  color: #f4fffc;
  font-size: 16px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#worldSeaViewModalHost .world-sea-view-island-row small {
  color: var(--world-muted, rgba(194, 216, 214, 0.68));
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#worldSeaViewModalHost .world-sea-view-island-row button {
  background: rgba(72, 220, 198, 0.14);
  border: 1px solid rgba(72, 220, 198, 0.3);
  border-radius: 999px;
  color: #eafffb;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  min-height: 34px;
  min-width: 58px;
  padding: 0 14px;
}

#worldSeaViewModalHost .world-sea-view-island-row button:disabled {
  background: rgba(223, 246, 242, 0.07);
  border-color: rgba(223, 246, 242, 0.1);
  color: rgba(194, 216, 214, 0.48);
  cursor: not-allowed;
}

#worldSeaViewModalHost .world-sea-unknown-art {
  background:
    radial-gradient(circle at 26% 28%, rgba(234, 252, 248, 0.2), transparent 12%),
    radial-gradient(circle at 72% 32%, rgba(214, 170, 85, 0.16), transparent 11%),
    radial-gradient(circle at 52% 78%, rgba(72, 220, 198, 0.16), transparent 16%),
    linear-gradient(145deg, rgba(14, 72, 82, 0.82), rgba(4, 20, 30, 0.96));
  border: 1px solid rgba(138, 202, 200, 0.24);
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -42px 78px rgba(0, 8, 14, 0.42);
  height: 190px;
  overflow: hidden;
  position: relative;
}

#worldSeaViewModalHost .world-sea-unknown-art::before {
  background:
    linear-gradient(90deg, transparent, rgba(234, 252, 248, 0.16), transparent),
    repeating-linear-gradient(0deg, rgba(234, 252, 248, 0.08) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(234, 252, 248, 0.06) 0 1px, transparent 1px 26px);
  content: "";
  inset: 0;
  opacity: 0.42;
  position: absolute;
}

#worldSeaViewModalHost .world-sea-unknown-art::after {
  background:
    radial-gradient(ellipse at 18% 50%, rgba(234, 252, 248, 0.7), transparent 34%),
    radial-gradient(ellipse at 78% 44%, rgba(234, 252, 248, 0.58), transparent 36%),
    linear-gradient(90deg, rgba(234, 252, 248, 0.36), transparent 18%, transparent 82%, rgba(234, 252, 248, 0.36));
  content: "";
  filter: blur(16px);
  inset: -24px;
  opacity: 0.62;
  position: absolute;
}

#worldSeaViewModalHost .world-sea-unknown-grid {
  background:
    linear-gradient(110deg, transparent 0 46%, rgba(234, 252, 248, 0.2) 47% 48%, transparent 49% 100%),
    linear-gradient(24deg, transparent 0 55%, rgba(72, 220, 198, 0.18) 56% 57%, transparent 58% 100%);
  inset: 0;
  position: absolute;
}

#worldSeaViewModalHost .world-sea-unknown-route {
  border: 2px dashed rgba(214, 170, 85, 0.58);
  border-color: transparent transparent rgba(214, 170, 85, 0.58) transparent;
  border-radius: 50%;
  height: 120px;
  position: absolute;
  width: 260px;
}

#worldSeaViewModalHost .world-sea-unknown-route.route-a {
  left: 34px;
  top: 36px;
  transform: rotate(-12deg);
}

#worldSeaViewModalHost .world-sea-unknown-route.route-b {
  border-bottom-color: rgba(72, 220, 198, 0.38);
  right: 22px;
  top: 70px;
  transform: rotate(18deg);
}

#worldSeaViewModalHost .world-sea-unknown-signal {
  background: rgba(234, 252, 248, 0.82);
  border-radius: 50%;
  box-shadow:
    0 0 0 8px rgba(234, 252, 248, 0.1),
    0 0 22px rgba(72, 220, 198, 0.5);
  height: 8px;
  position: absolute;
  width: 8px;
}

#worldSeaViewModalHost .world-sea-unknown-signal.signal-a {
  left: 28%;
  top: 36%;
}

#worldSeaViewModalHost .world-sea-unknown-signal.signal-b {
  right: 22%;
  top: 62%;
}

#worldSeaViewModalHost .world-sea-unknown-fog {
  background: rgba(234, 252, 248, 0.34);
  border-radius: 999px;
  filter: blur(12px);
  height: 42px;
  position: absolute;
  width: 210px;
}

#worldSeaViewModalHost .world-sea-unknown-fog.fog-a {
  left: -22px;
  top: 26px;
}

#worldSeaViewModalHost .world-sea-unknown-fog.fog-b {
  bottom: 24px;
  right: -34px;
}

#worldSeaViewModalHost .world-sea-unknown-art strong {
  align-items: center;
  background: rgba(5, 19, 27, 0.68);
  border: 1px solid rgba(234, 252, 248, 0.3);
  border-radius: 50%;
  color: rgba(234, 252, 248, 0.96);
  display: inline-flex;
  font-size: 56px;
  font-weight: 950;
  height: 92px;
  justify-content: center;
  left: 50%;
  line-height: 1;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 92px;
  z-index: 2;
}

#worldSeaViewModalHost .world-sea-unknown-art::before,
#worldSeaViewModalHost .world-sea-unknown-art::after {
  content: none;
  display: none;
}

#worldSeaViewModalHost .world-sea-unknown-art-image {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

#worldSeaViewModalHost .world-sea-view-city {
  align-items: center;
  display: grid;
  gap: 2px 10px;
  grid-template-columns: 44px minmax(0, 1fr);
}

#worldSeaViewModalHost .world-sea-view-city-icon {
  align-items: center;
  background: rgba(214, 170, 85, 0.18);
  border: 1px solid rgba(214, 170, 85, 0.32);
  border-radius: 9px;
  display: inline-flex;
  grid-row: span 2;
  height: 44px;
  justify-content: center;
  overflow: hidden;
  width: 44px;
}

#worldSeaViewModalHost .world-sea-view-city-icon img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

#worldSeaViewModalHost .world-sea-view-city-icon.text {
  color: #f9e8b4;
  font-size: 20px;
  font-weight: 950;
}

#worldSeaViewModalHost .world-sea-view-city strong {
  color: #f4fffc;
  font-size: 18px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

#worldSeaViewModalHost .world-sea-view-city small {
  color: var(--world-muted, rgba(194, 216, 214, 0.68));
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

#worldSeaViewModalHost .world-sea-view-city-concept {
  background:
    linear-gradient(145deg, rgba(223, 246, 242, 0.08), rgba(5, 19, 27, 0.52)),
    rgba(5, 19, 27, 0.7);
  border: 1px solid rgba(223, 246, 242, 0.14);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 36px rgba(0, 8, 14, 0.24);
  aspect-ratio: 16 / 9;
  height: auto;
  overflow: hidden;
  position: relative;
}

#worldSeaViewModalHost .world-sea-view-city-concept img {
  display: block;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  width: 100%;
}

#worldSeaViewModalHost .world-sea-view-city-concept.scouted {
  aspect-ratio: auto;
  height: 190px;
}

#worldSeaViewModalHost .world-sea-view-city-concept.scouted img {
  object-fit: cover;
  object-position: center 46%;
}

@media (max-width: 760px) {
  #worldSeaViewModalHost .world-sea-view-modal {
    padding: 18px;
  }

  #worldSeaViewModalHost .world-sea-view-head strong {
    font-size: 24px;
  }

  #worldSeaViewModalHost .world-sea-view-fact {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #worldSeaViewModalHost .world-sea-view-fact.has-action {
    grid-template-columns: 1fr;
  }

  #worldSeaViewModalHost .world-sea-view-destination-button {
    justify-self: start;
    margin-top: 4px;
  }

  #worldSeaViewModalHost .world-sea-view-actions {
    grid-template-columns: 1fr;
  }

  #worldSeaViewModalHost .world-sea-view-island-row {
    grid-template-columns: 1fr;
  }

  #worldSeaViewModalHost .world-sea-view-island-row button {
    justify-self: start;
  }

  #worldSeaViewModalHost .world-sea-view-city-concept {
    aspect-ratio: 16 / 9;
  }

  #worldSeaViewModalHost .world-sea-view-city-concept.scouted {
    aspect-ratio: auto;
    height: 170px;
  }
}

.world-sea-cell.disabled {
  opacity: 0.4;
}

.world-sea-cell .world-sea-surface {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 32%),
    radial-gradient(circle at 70% 76%, rgba(255, 255, 255, 0.08), transparent 42%);
  inset: 0;
  position: absolute;
}

.world-sea-cell::after {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  content: "";
  inset: 3px;
  pointer-events: none;
  position: absolute;
}

.world-sea-cell.unscouted {
  filter: saturate(0.72);
}

.world-sea-cell.unscouted::before {
  background: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.22) 0 6px, rgba(255, 255, 255, 0.025) 6px 12px);
  content: "";
  inset: 0;
  opacity: 0.72;
  position: absolute;
  z-index: 1;
}

.world-sea-cell.scouted {
  box-shadow: inset 0 0 0 1px rgba(66, 196, 178, 0.2);
}

.world-sea-cell.selected {
  border-color: var(--world-gold);
  box-shadow:
    0 0 0 2px rgba(214, 170, 85, 0.24),
    0 0 24px rgba(214, 170, 85, 0.22),
    inset 0 0 0 1px rgba(214, 170, 85, 0.45);
  z-index: 6;
}

.world-sea-code,
.world-sea-capital-icon,
.world-sea-island-icon,
.world-sea-type-mark,
.world-sea-marker-stack,
.world-sea-bottom {
  position: absolute;
  z-index: 2;
}

.world-sea-code {
  font-size: 11px;
  font-weight: 900;
  left: 6px;
  top: 5px;
}

.world-sea-capital-icon {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  height: clamp(32px, calc(var(--world-cell-size) * 0.48), 48px);
  justify-content: center;
  left: 50%;
  pointer-events: none;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(32px, calc(var(--world-cell-size) * 0.48), 48px);
  z-index: 2;
  filter:
    drop-shadow(0 4px 8px rgba(0, 9, 18, 0.42))
    drop-shadow(0 0 10px rgba(214, 170, 85, 0.2));
}

.world-map-target-icon {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  line-height: 0;
  padding: 0;
  pointer-events: auto;
  z-index: 8;
}

.world-map-target-icon:hover,
.world-map-target-icon:focus-visible {
  filter:
    drop-shadow(0 5px 10px rgba(0, 9, 18, 0.48))
    drop-shadow(0 0 12px rgba(72, 220, 198, 0.35));
  outline: none;
  transform: translate(-50%, -50%) scale(1.05);
}

.world-map-target-icon:focus-visible {
  box-shadow: 0 0 0 2px rgba(72, 220, 198, 0.45);
}

.world-sea-capital-icon img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.world-sea-island-icon {
  align-items: center;
  border-radius: 999px;
  border: 2px solid rgba(91, 226, 148, 0.95);
  display: inline-flex;
  height: clamp(32px, calc(var(--world-cell-size) * 0.48), 48px);
  justify-content: center;
  left: 50%;
  padding: 1px;
  pointer-events: none;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(32px, calc(var(--world-cell-size) * 0.48), 48px);
  z-index: 2;
  box-shadow:
    0 0 0 1px rgba(3, 42, 31, 0.86),
    0 0 0 3px rgba(91, 226, 148, 0.16),
    inset 0 0 0 1px rgba(210, 255, 226, 0.28);
  filter:
    drop-shadow(0 4px 8px rgba(0, 9, 18, 0.42))
    drop-shadow(0 0 10px rgba(91, 226, 148, 0.26));
}

.world-sea-island-icon img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.world-sea-island-icon.world-map-target-icon {
  appearance: none;
  cursor: pointer;
  pointer-events: auto;
  z-index: 8;
}

.world-sea-island-icon.world-map-target-icon:hover,
.world-sea-island-icon.world-map-target-icon:focus-visible {
  transform: translate(-50%, -50%) scale(1.05);
}

.world-sea-cell.kind-pollution .world-sea-capital-icon {
  height: clamp(40px, calc(var(--world-cell-size) * 0.62), 64px);
  width: clamp(40px, calc(var(--world-cell-size) * 0.62), 64px);
  filter:
    drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 13px rgba(238, 42, 111, 0.32))
    drop-shadow(0 0 9px rgba(214, 198, 44, 0.22));
}

.world-sea-cell.has-capital-icon .world-sea-code,
.world-sea-cell.has-island-icon .world-sea-code {
  text-shadow: 0 1px 3px rgba(0, 10, 18, 0.78);
  z-index: 3;
}

.world-sea-type-mark {
  align-items: center;
  background: rgba(12, 17, 20, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff2cf;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  right: 5px;
  top: 5px;
  width: 20px;
}

.world-sea-marker-stack {
  bottom: 6px;
  display: flex;
  gap: 4px;
  left: 6px;
}

.world-sea-resource {
  align-items: center;
  border-radius: 4px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 4px;
}

.world-sea-resource {
  background: rgba(214, 170, 85, 0.22);
  border: 1px solid rgba(214, 170, 85, 0.5);
  color: #ffe5a6;
}

.world-sea-resource.visual-icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 2px 3px rgba(0, 10, 14, 0.4));
}

.world-sea-resource.visual-icon img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.world-sea-bottom {
  align-items: center;
  bottom: 4px;
  color: rgba(236, 249, 247, 0.86);
  display: flex;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  gap: 3px;
  right: 5px;
}

.world-sea-bottom strong,
.world-sea-bottom em {
  font-size: 10px;
  font-style: normal;
}

.world-sea-count-badge {
  align-items: center;
  display: inline-flex;
  gap: 2px;
  height: 18px;
  min-width: 24px;
  padding: 1px 4px 1px 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fffaf0;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 3px 8px rgba(0, 12, 18, 0.26);
}

button.world-sea-count-badge {
  appearance: none;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.world-sea-count-badge b {
  min-width: 5px;
  font: inherit;
}

.world-sea-count-badge.island {
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 245, 180, 0.34), transparent 42%),
    linear-gradient(180deg, rgba(53, 170, 118, 0.9), rgba(18, 104, 94, 0.92));
  border-color: rgba(138, 226, 163, 0.52);
}

.world-sea-count-badge.ship {
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.34), transparent 42%),
    linear-gradient(180deg, rgba(74, 159, 224, 0.94), rgba(31, 79, 143, 0.94));
  border-color: rgba(135, 203, 255, 0.56);
}

button.world-sea-cell.has-ships .world-sea-bottom {
  right: 35px;
}

.world-sea-docked-ship-button {
  bottom: 4px;
  pointer-events: auto;
  position: absolute;
  right: 5px;
  z-index: 14;
}

.world-sea-docked-ship-button:hover,
.world-sea-docked-ship-button:focus-visible,
.world-sea-docked-ship-button.open {
  border-color: rgba(202, 238, 255, 0.9);
  box-shadow:
    0 0 0 2px rgba(94, 185, 255, 0.2),
    0 6px 14px rgba(0, 12, 18, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  filter: saturate(1.12) brightness(1.04);
  outline: none;
}

.world-ship-dock-menu {
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.92), transparent 42%),
    linear-gradient(145deg, rgba(242, 255, 252, 0.98), rgba(215, 239, 234, 0.94));
  border: 1px solid rgba(129, 202, 191, 0.52);
  border-radius: 8px;
  bottom: 30px;
  box-shadow:
    0 16px 28px rgba(0, 12, 18, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  display: grid;
  gap: 8px;
  max-width: min(320px, calc(100vw - 24px));
  min-width: 260px;
  padding: 10px;
  position: absolute;
  right: -8px;
  z-index: 45;
}

.world-ship-dock-menu::after {
  background: rgba(225, 244, 240, 0.98);
  border-bottom: 1px solid rgba(129, 202, 191, 0.46);
  border-right: 1px solid rgba(129, 202, 191, 0.46);
  bottom: -5px;
  content: "";
  height: 9px;
  position: absolute;
  right: 22px;
  transform: rotate(45deg);
  width: 9px;
}

.world-docked-ship-row {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #0d6f78;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(142px, 1fr) 88px;
  padding: 6px 7px;
  text-align: left;
  width: 100%;
}

.world-docked-ship-row:hover,
.world-docked-ship-row:focus-visible {
  background: rgba(255, 255, 255, 0.48);
  outline: 1px solid rgba(31, 147, 143, 0.22);
}

.world-docked-ship-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.world-docked-ship-copy strong {
  color: #087681;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1.1;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.world-docked-ship-copy small {
  align-items: center;
  color: rgba(38, 70, 69, 0.74);
  display: grid;
  font-size: 11px;
  font-weight: 900;
  gap: 5px;
  grid-template-columns: 14px minmax(0, 1fr);
  line-height: 1.18;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.world-docked-ship-copy small span {
  min-width: 0;
  overflow: visible;
  white-space: normal;
}

.world-docked-ship-pin {
  background: linear-gradient(180deg, #ff6173, #d9214b);
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 3px 8px rgba(184, 18, 52, 0.28);
  display: inline-block;
  flex: 0 0 auto;
  height: 14px;
  position: relative;
  transform: rotate(-45deg);
  width: 14px;
}

.world-docked-ship-pin::after {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  content: "";
  height: 5px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
}

.world-docked-ship-bars {
  display: grid;
  gap: 5px;
}

.world-docked-ship-bars i {
  background: rgba(17, 68, 70, 0.12);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0, 29, 32, 0.14);
  display: block;
  height: 7px;
  overflow: hidden;
  position: relative;
  width: 88px;
}

.world-docked-ship-bars i::before {
  border-radius: inherit;
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: var(--value, 0%);
}

.world-docked-ship-bars .fuel::before {
  background: linear-gradient(90deg, #f5a623, #ffd266);
}

.world-docked-ship-bars .durability {
  background: rgba(151, 38, 55, 0.16);
}

.world-docked-ship-bars .durability::before {
  background: linear-gradient(90deg, #d8324c, #ff7a64);
}

.world-docked-ship-bars .cargo::before {
  background: linear-gradient(90deg, #64c4b9, #c9e9df);
}

.world-sea-count-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.world-sea-count-icon .island-sun {
  fill: #ffe38a;
  stroke: rgba(96, 67, 16, 0.28);
  stroke-width: 0.7;
}

.world-sea-count-icon .island-water {
  fill: none;
  stroke: #98f2ff;
  stroke-width: 1.6;
}

.world-sea-count-icon .island-land {
  fill: #9add65;
  stroke: rgba(32, 72, 34, 0.36);
  stroke-width: 1;
}

.world-sea-count-icon .island-palm {
  fill: none;
  stroke: #f6f0c9;
  stroke-width: 1.45;
}

.world-sea-count-icon .ship-wake {
  fill: none;
  stroke: #b8efff;
  stroke-width: 1.55;
}

.world-sea-count-icon .ship-hull {
  fill: #2b75bd;
  stroke: #d8f6ff;
  stroke-width: 1;
}

.world-sea-count-icon .ship-deck {
  fill: #f3fbff;
  stroke: rgba(12, 59, 109, 0.36);
  stroke-width: 0.9;
}

.world-sea-count-icon .ship-bridge {
  fill: #ffd37c;
  stroke: rgba(77, 55, 18, 0.38);
  stroke-width: 0.9;
}

.world-sea-count-icon .ship-window {
  fill: none;
  stroke: #154b78;
  stroke-width: 1.25;
}

.world-sea-voyage-ship-icon {
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 11, 18, 0.26));
  height: 30px;
  position: relative;
  width: 30px;
  z-index: 1;
}

.world-sea-voyage-ship-icon .voyage-scan {
  fill: none;
  stroke: rgba(195, 250, 255, 0.92);
  stroke-linecap: round;
  stroke-width: 1.65;
}

.world-sea-voyage-ship-icon .voyage-hull {
  fill: #2b7fc4;
  stroke: #e0fbff;
  stroke-linejoin: round;
  stroke-width: 1.08;
}

.world-sea-voyage-ship-icon .voyage-deck {
  fill: #f6fcff;
  stroke: rgba(16, 58, 88, 0.38);
  stroke-linejoin: round;
  stroke-width: 1;
}

.world-sea-voyage-ship-icon .voyage-bridge {
  fill: #ffd37a;
  stroke: rgba(81, 58, 17, 0.42);
  stroke-linejoin: round;
  stroke-width: 0.92;
}

.world-sea-voyage-ship-icon .voyage-mast,
.world-sea-voyage-ship-icon .voyage-window {
  fill: none;
  stroke: #104a75;
  stroke-linecap: round;
  stroke-width: 1.35;
}

.world-sea-voyage-ship-icon .voyage-flag {
  fill: #f6c65b;
  stroke: rgba(76, 54, 17, 0.42);
  stroke-linejoin: round;
  stroke-width: 0.86;
}

.world-sea-cell.faction-faction_a {
  background:
    radial-gradient(circle at 28% 22%, rgba(130, 165, 255, 0.38), transparent 48%),
    linear-gradient(145deg, rgba(26, 54, 93, 0.84), rgba(6, 29, 43, 0.9));
  border-color: rgba(130, 165, 255, 0.42);
}

.world-sea-cell.faction-faction_b {
  background:
    radial-gradient(circle at 28% 22%, rgba(226, 93, 96, 0.34), transparent 48%),
    linear-gradient(145deg, rgba(91, 35, 45, 0.82), rgba(28, 20, 31, 0.9));
  border-color: rgba(226, 93, 96, 0.42);
}

.world-sea-cell.faction-faction_c {
  background:
    radial-gradient(circle at 28% 22%, rgba(220, 205, 170, 0.28), transparent 48%),
    linear-gradient(145deg, rgba(77, 70, 61, 0.82), rgba(22, 29, 34, 0.9));
  border-color: rgba(220, 205, 170, 0.42);
}

.world-sea-cell.kind-pollution {
  background:
    radial-gradient(circle at 52% 52%, rgba(205, 79, 102, 0.46), transparent 50%),
    repeating-linear-gradient(135deg, rgba(255, 96, 120, 0.18) 0 7px, rgba(59, 20, 58, 0.18) 7px 14px),
    linear-gradient(145deg, rgba(77, 22, 61, 0.95), rgba(23, 9, 34, 0.98));
  border-color: rgba(255, 117, 136, 0.58);
  color: white;
}

.world-sea-cell.kind-black_market {
  background:
    radial-gradient(circle at 50% 50%, rgba(214, 170, 85, 0.45), transparent 42%),
    linear-gradient(145deg, #1e1820, #050407);
  border-color: rgba(214, 170, 85, 0.8);
}

.world-sea-cell.kind-black_market_entrance {
  background:
    radial-gradient(circle at 50% 50%, rgba(150, 104, 246, 0.34), transparent 48%),
    linear-gradient(145deg, rgba(41, 35, 67, 0.9), rgba(5, 18, 30, 0.94));
  border-color: rgba(181, 147, 255, 0.54);
}

.world-sea-panel {
  max-height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 145px);
  min-height: 0;
  overflow: auto;
  padding: 14px;
  scrollbar-color: rgba(214, 170, 85, 0.55) rgba(255, 255, 255, 0.05);
  width: 100%;
}

.world-dossier-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.world-dossier-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.world-dossier-head strong {
  font-size: 20px;
}

.world-dossier-head small {
  color: var(--world-muted);
}

.world-dossier-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.world-dossier-badge {
  border: 1px solid var(--world-line);
  border-radius: 999px;
  color: var(--world-muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.world-dossier-badge.ok {
  background: rgba(66, 196, 178, 0.12);
  border-color: rgba(66, 196, 178, 0.42);
  color: #96eee1;
}

.world-dossier-badge.danger {
  background: rgba(211, 95, 103, 0.14);
  border-color: rgba(211, 95, 103, 0.48);
  color: #ffb1b7;
}

.world-dossier-badge.market,
.world-dossier-badge.resource {
  background: rgba(214, 170, 85, 0.12);
  border-color: rgba(214, 170, 85, 0.42);
  color: #ffe2a0;
}

.world-dossier-badge.faction {
  background: rgba(142, 166, 255, 0.12);
  border-color: rgba(142, 166, 255, 0.38);
  color: #c9d4ff;
}

.world-dossier-badge.muted {
  background: rgba(255, 255, 255, 0.04);
}

.world-dossier-facts {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.world-sea-fact {
  border: 1px solid rgba(145, 181, 189, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 8px;
}

.world-sea-fact span {
  color: var(--world-muted);
  font-size: 12px;
}

.world-sea-fact strong {
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.world-primary-actions,
.world-sea-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.world-primary-actions button,
.world-sea-actions button,
.world-sea-panel button {
  border-color: rgba(66, 196, 178, 0.52);
  border-radius: 6px;
  background: rgba(13, 130, 114, 0.86);
}

.world-primary-actions button.secondary,
.world-sea-panel button.secondary {
  border-color: rgba(145, 181, 189, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: #e8f4f2;
}

.world-route-preview {
  border: 1px solid rgba(66, 196, 178, 0.34);
  border-radius: 8px;
  background: rgba(16, 64, 68, 0.44);
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 10px;
}

.world-route-preview span,
.world-route-preview small {
  color: var(--world-muted);
  font-size: 12px;
}

.world-route-preview strong {
  color: #eafffb;
}

.world-route-preview.warning {
  border-color: rgba(214, 170, 85, 0.42);
  background: rgba(83, 64, 26, 0.34);
}

.world-route-preview.danger {
  border-color: rgba(211, 95, 103, 0.44);
  background: rgba(70, 29, 43, 0.38);
}

.world-route-preview.muted {
  border-color: var(--world-line);
  background: rgba(255, 255, 255, 0.045);
}

.world-panel-section {
  border-top: 1px solid rgba(145, 181, 189, 0.18);
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
}

.world-panel-section-title,
.world-sea-section-title {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.world-panel-section-title span,
.world-sea-section-title span {
  color: var(--world-muted);
  font-size: 12px;
  font-weight: 800;
}

.world-sea-list {
  display: grid;
  gap: 8px;
}

.world-sea-list > strong {
  color: #f4f7f4;
  font-size: 13px;
}

.world-sea-item {
  border: 1px solid rgba(145, 181, 189, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 9px;
}

.world-sea-item small {
  color: var(--world-muted);
  display: block;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.world-sea-panel .empty-state {
  border: 1px dashed rgba(145, 181, 189, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--world-muted);
  padding: 10px;
}

.world-sea-panel select,
.world-sea-panel input {
  border-color: rgba(145, 181, 189, 0.28);
  background: rgba(4, 15, 20, 0.86);
  color: #f3fbf9;
}

.colony-panel,
.plunder-panel {
  border-top: 1px solid rgba(145, 181, 189, 0.18);
  padding-top: 12px;
}

.colony-card {
  background: rgba(66, 196, 178, 0.06);
}

.plunder-target-card,
.plunder-job-card {
  align-items: center;
  background: rgba(214, 170, 85, 0.08);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.plunder-job-card {
  grid-template-columns: 1fr;
}

.plunder-progress {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.plunder-progress span {
  background: linear-gradient(90deg, var(--world-gold), var(--world-teal));
  display: block;
  height: 100%;
}

.world-sea-note {
  color: var(--world-muted);
  font-size: 12px;
  line-height: 1.45;
}

.construction-project-card {
  display: grid;
  gap: 8px;
}

.construction-material-list {
  display: grid;
  gap: 8px;
}

.construction-material-row {
  align-items: center;
  border-top: 1px solid rgba(145, 181, 189, 0.18);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 72px auto;
  padding-top: 8px;
}

.construction-material-row input {
  width: 100%;
}

.world-rule-note {
  border: 1px solid rgba(214, 170, 85, 0.22);
  border-radius: 8px;
  background: rgba(214, 170, 85, 0.08);
  color: #ead9b7;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 14px;
  padding: 10px;
}

@media (max-width: 1260px) {
  .world-command-console {
    --world-axis-size: 44px;
    --world-cell-gap: 5px;
    --world-cell-size: clamp(68px, 12.5vw, 98px);
    min-height: auto;
  }

  .world-command-header,
  .world-map-layout,
  .world-command-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .world-command-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .world-layer-rail {
    display: flex;
    overflow-x: auto;
    position: static;
  }

  .world-layer-rail > span {
    align-self: center;
  }

  .world-layer-pill {
    min-width: 72px;
  }

  .world-sea-panel {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .world-command-console {
    --world-axis-size: 38px;
    --world-cell-gap: 5px;
    --world-cell-size: clamp(57px, 17vw, 81px);
    padding: 10px;
  }

  .world-command-title h3 {
    font-size: 24px;
  }

  .world-command-metrics,
  .world-dossier-facts {
    grid-template-columns: 1fr 1fr;
  }

  .world-map-board {
    padding: 8px;
  }

  .world-map-board-head {
    align-items: start;
    display: grid;
  }

  .world-chart-wrap {
    margin: 0 -4px;
  }

  .construction-material-row,
  .plunder-target-card {
    grid-template-columns: 1fr;
  }
}

.island-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.island-identity {
  margin-top: 10px;
}

.island-identity-card {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(340px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 248, 0.96)),
    #ffffff;
}

.island-identity-main {
  display: grid;
  gap: 2px;
}

.island-identity-main strong {
  font-size: 19px;
}

.island-identity-main span,
.island-identity-meta,
.island-next-cost {
  color: #60727a;
  font-size: 13px;
}

.island-identity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.island-identity-meta > span:not(.visibility-pill) {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}

.island-identity-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.island-identity-card button {
  min-width: 64px;
}

.island-next-cost {
  margin-top: 4px;
  padding-left: 2px;
}

.island-switcher {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.island-switch-item {
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 6px 8px;
  text-align: left;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  background: #ffffff;
  color: #18252d;
}

.island-switch-item.selected {
  border-color: #0f766e;
  background: #eefaf7;
}

.island-switch-item small {
  color: #60727a;
}

.visibility-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 13px;
}

.visibility-pill.hidden {
  color: #1f4f6b;
  background: #dff0fa;
}

.visibility-pill.public {
  color: #7a2e0e;
  background: #ffe3c2;
}

.energy-summary {
  display: none;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  background: #ffffff;
}

.energy-summary-empty {
  color: #60727a;
  font-size: 13px;
}

.energy-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.energy-summary-head strong {
  display: block;
  font-size: 16px;
}

.energy-summary-head span,
.energy-summary-head small {
  color: #60727a;
  font-size: 13px;
}

.energy-summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.energy-summary-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: start;
  min-height: 96px;
  padding: 10px;
  text-align: left;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  background: #f8fbfb;
  color: #18252d;
  cursor: pointer;
}

.energy-summary-item strong {
  font-size: 18px;
}

.energy-summary-item small {
  grid-column: 1 / -1;
  color: #60727a;
  font-size: 12px;
  line-height: 1.35;
}

.energy-summary-item.running {
  border-color: #9ccfc2;
}

.energy-summary-item.warning {
  border-color: #e4bd68;
  background: #fff8e8;
}

.energy-summary-item.danger {
  border-color: #e08a82;
  background: #fff3f1;
}

.energy-summary-item.paused {
  border-color: #cfd8dc;
  background: #f2f5f6;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.island-subpage-layout {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.island-subpage-content {
  min-width: 0;
}

.island-subpage-nav {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(15, 107, 102, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbfa, #eef6f4);
}

.island-subpage-nav-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 46px;
  padding: 7px 8px;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  background: white;
  color: #18363c;
  text-align: left;
  cursor: pointer;
}

.island-subpage-nav-item:hover,
.island-subpage-nav-item.selected {
  border-color: #0f6b66;
  background: #e8f5f3;
}

.island-subpage-nav-item i {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #0f6b66;
  color: white;
  font-style: normal;
  font-weight: 800;
}

.island-subpage-nav-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.island-subpage-nav-item strong {
  font-size: 14px;
  line-height: 1.15;
}

.island-subpage-nav-item small {
  overflow: hidden;
  color: #60727a;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-grid section,
#exchangePage > section,
#workforcePage > section,
#goalsPage > section {
  background: white;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  padding: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-actions span {
  color: #60727a;
  font-size: 13px;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

body[data-page="island"] .app {
  max-width: none;
  min-height: 100vh;
  padding: 0 0 0 140px;
  background:
    radial-gradient(circle at 42% 34%, rgba(74, 151, 145, 0.22), transparent 34%),
    linear-gradient(180deg, #0c2c35 0%, #0a1b23 100%);
}

body[data-page="island"] .topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  margin-bottom: 0;
  padding: 0 18px 0 28px;
  border-bottom: 1px solid rgba(213, 174, 98, 0.28);
  background: linear-gradient(180deg, rgba(9, 35, 44, 0.98), rgba(5, 25, 33, 0.98));
  color: #f4e7c5;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

body[data-page="island"] .topbar h1 {
  min-width: 210px;
  padding-left: 46px;
  font-size: 22px;
  letter-spacing: 0;
  position: relative;
}

body[data-page="island"] .topbar h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(232, 196, 121, 0.82);
  border-radius: 7px;
  transform: translateY(-50%) rotate(45deg);
  background: linear-gradient(135deg, #1d5f70, #102d37);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.07);
}

body[data-page="island"] .topbar p {
  display: none;
}

body[data-page="island"] .top-actions {
  margin-left: auto;
}

body[data-page="island"] .top-actions .button-link,
body[data-page="island"] .top-actions button {
  border-color: rgba(232, 196, 121, 0.5);
  background: rgba(8, 31, 39, 0.74);
  color: #f1ddb0;
}

body[data-page="island"] .summary {
  position: fixed;
  z-index: 31;
  top: 0;
  left: 282px;
  right: 178px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

body[data-page="island"] .metric {
  min-width: 96px;
  min-height: 46px;
  display: grid;
  grid-template-columns: 26px auto;
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f7ead0;
  pointer-events: auto;
}

body[data-page="island"] .metric i {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #f1c66d;
  background: rgba(244, 216, 140, 0.1);
}

body[data-page="island"] .metric span {
  color: rgba(245, 231, 197, 0.72);
  font-size: 11px;
  margin-bottom: 4px;
}

body[data-page="island"] .metric strong {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

body[data-page="island"] .metric small {
  grid-column: 2;
  margin-top: 0;
  color: #a8d26c;
  font-size: 11px;
  white-space: nowrap;
}

body[data-page="island"] .storage-bar,
body[data-page="island"] .status-bar {
  margin-top: 6px;
}

body[data-page="island"] .page-tabs {
  position: fixed;
  z-index: 29;
  top: 64px;
  left: 0;
  bottom: 0;
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0;
  padding-top: 18px;
  border-right: 1px solid rgba(213, 174, 98, 0.24);
  background: linear-gradient(180deg, rgba(8, 37, 48, 0.97), rgba(5, 25, 33, 0.98));
  box-shadow: 12px 0 24px rgba(0, 0, 0, 0.2);
}

body[data-page="island"] .page-tab {
  width: 100%;
  justify-content: flex-start;
  min-height: 56px;
  padding: 0 18px 0 26px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: #d5c59f;
  font-weight: 700;
}

body[data-page="island"] .page-tab.selected {
  position: relative;
  background:
    linear-gradient(90deg, rgba(166, 121, 55, 0.46), rgba(166, 121, 55, 0.1)),
    rgba(255, 255, 255, 0.03);
  color: #fff1c9;
}

body[data-page="island"] .page-tab.selected::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%) rotate(45deg);
  background: #c49a52;
}

body[data-page="island"] .section-title {
  display: none;
}

body[data-page="island"] .section-title h2 {
  margin-bottom: 0;
  color: #f7ead0;
}

body[data-page="island"] .section-actions span {
  color: #d5c59f;
}

body[data-page="island"] .island-page-header {
  position: relative;
  margin: 0;
}

body[data-page="island"] .island-identity {
  display: none;
}

body[data-page="island"] .island-identity-card {
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 14px;
  border-color: rgba(210, 160, 82, 0.55);
  background: rgba(10, 45, 55, 0.78);
  color: #f7ead0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

body[data-page="island"] .island-identity-main strong {
  color: #fff1c9;
}

body[data-page="island"] .island-identity-main span,
body[data-page="island"] .island-identity-meta,
body[data-page="island"] .island-next-cost {
  color: #d5c59f;
}

body[data-page="island"] .island-identity-meta {
  grid-column: 1 / -1;
}

body[data-page="island"] .island-identity-actions,
body[data-page="island"] .island-next-cost,
body[data-page="island"] .island-switcher {
  display: none;
}

.island-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

body[data-page="island"] .island-workspace {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 64px);
  padding-top: 0;
}

.plots {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid #9ebfc2;
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 24%, rgba(255, 255, 255, 0.34) 0 1px, transparent 2px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 25%, transparent 25% 50%, rgba(255, 255, 255, 0.11) 50% 75%, transparent 75%),
    linear-gradient(180deg, #8dc5c8 0%, #2f7f86 100%);
  background-size: 34px 34px, 32px 32px, auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), inset 0 -26px 44px rgba(10, 60, 71, 0.2);
  min-height: 720px;
  padding: 16px 22px 26px;
  overflow-x: auto;
  overflow-y: hidden;
}

body[data-page="island"] .plots {
  min-height: calc(100vh - 64px);
  padding: 28px 36px 42px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 46% 44%, rgba(108, 178, 158, 0.34), transparent 31%),
    radial-gradient(circle at 40% 60%, rgba(40, 102, 94, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, #11707a 0%, #07526a 48%, #052c3a 100%);
  background-size: auto, auto, 34px 34px, auto;
  box-shadow:
    inset 0 28px 60px rgba(255, 255, 255, 0.08),
    inset 0 -52px 92px rgba(0, 14, 22, 0.38);
  overflow: hidden;
}

body[data-page="island"] .plots::before {
  content: "";
  position: absolute;
  inset: 76px 18px 26px 18px;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 28%, rgba(255, 255, 255, 0.54) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.36) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 76%, rgba(255, 255, 255, 0.28) 0 1px, transparent 2px);
  opacity: 0.9;
}

body[data-page="island"] .island-status-hud {
  position: absolute;
  z-index: 38;
  top: 14px;
  right: clamp(18px, 2.2vw, 32px);
  width: 324px;
  max-width: calc(100vw - 36px);
  padding-bottom: 44px;
  overflow: visible;
  pointer-events: auto;
  --island-glass-edge: rgba(174, 255, 234, 0.18);
  --island-glass-gold: #ffe39a;
  --island-glass-ink: #0a302f;
  --island-enamel: rgba(255, 248, 224, 0.93);
}

body[data-page="island"] .island-status-hud.custom-positioned {
  right: auto;
  width: 324px;
  max-width: calc(100vw - 36px);
}

body[data-page="island"] .island-status-hud.collapsed {
  max-width: none;
  padding-bottom: 0;
}

body[data-page="island"] .island-status-hud.dragging {
  z-index: 72;
}

body[data-page="island"] .island-status-collapse-button {
  position: absolute;
  z-index: 30;
  left: 50%;
  right: auto;
  top: auto;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 74px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: transparent;
  color: #e7fff4;
  box-shadow: none;
  cursor: pointer;
  transform: translateX(-50%);
  transition: filter 0.16s ease, transform 0.16s ease;
}

body[data-page="island"] .island-status-collapse-button::before,
body[data-page="island"] .island-status-collapse-button::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

body[data-page="island"] .island-status-collapse-button::before {
  inset: 0;
  border: 1px solid rgba(151, 255, 222, 0.56);
  background:
    radial-gradient(circle at 35% 16%, rgba(229, 255, 246, 0.72), transparent 34%),
    linear-gradient(135deg, rgba(30, 170, 139, 0.96), rgba(8, 124, 111, 0.98) 58%, rgba(4, 68, 67, 0.98)),
    #087f73;
  box-shadow:
    0 10px 22px rgba(4, 77, 72, 0.26),
    0 0 0 1px rgba(201, 255, 236, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -10px 18px rgba(0, 45, 42, 0.22);
  backdrop-filter: blur(16px) saturate(1.32);
  -webkit-backdrop-filter: blur(16px) saturate(1.32);
  opacity: 1;
  transition: opacity 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

body[data-page="island"] .island-status-collapse-button::after {
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  filter: drop-shadow(0 1px 4px rgba(0, 52, 48, 0.28));
  opacity: 0.96;
  transform: translate(-50%, -50%);
  transition: opacity 0.16s ease, filter 0.16s ease;
}

body[data-page="island"] .island-status-collapse-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

body[data-page="island"] .island-status-collapse-button:hover {
  filter: brightness(1.06) saturate(1.04);
  transform: translateX(-50%) translateY(-1px);
}

body[data-page="island"] .island-status-collapse-button:hover::before {
  border-color: rgba(196, 255, 236, 0.82);
  background:
    radial-gradient(circle at 35% 16%, rgba(242, 255, 251, 0.82), transparent 35%),
    linear-gradient(135deg, rgba(45, 190, 154, 0.98), rgba(7, 134, 119, 0.98) 58%, rgba(3, 78, 76, 0.98)),
    #087f73;
  box-shadow:
    0 12px 24px rgba(4, 77, 72, 0.3),
    0 0 0 1px rgba(201, 255, 236, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    inset 0 -10px 18px rgba(0, 45, 42, 0.2);
  opacity: 1;
}

body[data-page="island"] .island-status-collapse-button:hover::after {
  filter: drop-shadow(0 1px 5px rgba(0, 52, 48, 0.36));
  opacity: 1;
}

body[data-page="island"] .island-status-collapse-button.edge-right {
  left: 50%;
  right: auto;
  top: auto;
  bottom: 5px;
  transform: translateX(-50%);
}

body[data-page="island"] .island-status-collapse-button.edge-right:hover {
  transform: translateX(-50%) translateY(-1px);
}

body[data-page="island"] .island-status-collapse-button.edge-right::before {
  border-radius: 11px 17px 17px 11px;
  clip-path: polygon(8% 12%, 72% 12%, 94% 50%, 72% 88%, 8% 88%);
}

body[data-page="island"] .island-status-collapse-button.edge-right::after {
  left: 52%;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid rgba(255, 247, 203, 0.95);
  border-right: 0;
}

body[data-page="island"] .island-status-collapse-button.edge-left {
  left: 50%;
  right: auto;
  top: auto;
  bottom: 5px;
  transform: translateX(-50%);
}

body[data-page="island"] .island-status-collapse-button.edge-left:hover {
  transform: translateX(-50%) translateY(-1px);
}

body[data-page="island"] .island-status-collapse-button.edge-left::before {
  border-radius: 17px 11px 11px 17px;
  clip-path: polygon(92% 12%, 28% 12%, 6% 50%, 28% 88%, 92% 88%);
}

body[data-page="island"] .island-status-collapse-button.edge-left::after {
  left: 48%;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid rgba(255, 247, 203, 0.95);
  border-left: 0;
}

body[data-page="island"] .island-status-hud.collapsed .island-status-collapse-button {
  position: static;
  width: 44px;
  height: 44px;
  transform: none;
}

body[data-page="island"] .island-status-hud.collapsed .island-status-collapse-button:hover {
  transform: none;
}

body[data-page="island"] .island-status-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--island-glass-edge);
  border-radius: 23px;
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 244, 197, 0.14), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(84, 215, 194, 0.22), transparent 32%),
    linear-gradient(145deg, rgba(24, 88, 78, 0.78), rgba(6, 36, 36, 0.84) 46%, rgba(2, 17, 19, 0.96)),
    rgba(5, 24, 25, 0.8);
  box-shadow:
    0 24px 48px rgba(0, 17, 21, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -30px 54px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(24px) saturate(1.45) contrast(1.02);
  -webkit-backdrop-filter: blur(24px) saturate(1.45) contrast(1.02);
}

body[data-page="island"] .island-status-panel::before,
body[data-page="island"] .island-status-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

body[data-page="island"] .island-status-panel::before {
  inset: 1px;
  border-radius: 22px;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.18), transparent 28%),
    radial-gradient(circle at 78% 18%, rgba(121, 255, 229, 0.16), transparent 22%),
    linear-gradient(290deg, transparent 56%, rgba(255, 229, 160, 0.08));
  opacity: 0.78;
}

body[data-page="island"] .island-status-panel::after {
  inset: auto 18px 8px 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(188, 255, 237, 0.28), transparent);
}

body[data-page="island"] .island-status-hud.dragging .island-status-panel {
  box-shadow:
    0 34px 68px rgba(0, 18, 24, 0.43),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.23),
    inset 0 -30px 54px rgba(0, 0, 0, 0.2);
  transform: translateY(-4px) scale(1.01);
}

body[data-page="island"] .island-status-panel-head {
  position: relative;
  overflow: hidden;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 12px;
  align-items: center;
  padding: 12px 13px 13px 14px;
  border: 1px solid rgba(147, 246, 223, 0.16);
  border-radius: 17px;
  background:
    radial-gradient(circle at 84% 18%, rgba(110, 255, 226, 0.2), transparent 34%),
    linear-gradient(142deg, rgba(29, 108, 95, 0.72), rgba(10, 69, 64, 0.68) 58%, rgba(4, 46, 47, 0.82)),
    rgba(11, 68, 63, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.19),
    inset 0 -18px 34px rgba(0, 0, 0, 0.13),
    0 9px 18px rgba(0, 13, 17, 0.12);
  backdrop-filter: blur(12px) saturate(1.25);
  -webkit-backdrop-filter: blur(12px) saturate(1.25);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

body[data-page="island"] .island-status-panel-head::after {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: 16px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.16), transparent 22%),
    linear-gradient(300deg, transparent 62%, rgba(255, 230, 158, 0.1));
}

body[data-page="island"] .island-status-hud.ready-to-drag .island-status-panel-head,
body[data-page="island"] .island-status-hud.dragging .island-status-panel-head {
  cursor: grabbing;
}

body[data-page="island"] .island-status-title {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 6px;
  align-self: center;
}

body[data-page="island"] .island-status-name-row {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

body[data-page="island"] .island-status-island-name {
  flex: 0 1 auto;
  overflow: hidden;
  max-width: min(178px, calc(100% - 36px));
  color: #fff8df;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

body[data-page="island"] .island-status-name-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 31px;
  padding: 0 9px;
  border: 2px solid #ffcd31;
  border-radius: 8px;
  outline: none;
  background: rgba(5, 27, 28, 0.55);
  color: #fff7dd;
  font: inherit;
  font-size: 21px;
  font-weight: 1000;
  line-height: 1;
  box-shadow:
    0 0 0 3px rgba(255, 205, 49, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

body[data-page="island"] .island-status-name-action {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 2px solid rgba(255, 213, 75, 0.9);
  border-radius: 8px;
  appearance: none;
  background:
    radial-gradient(circle at 38% 20%, rgba(255, 255, 232, 0.26), transparent 36%),
    linear-gradient(180deg, rgba(255, 245, 196, 0.12), rgba(255, 190, 40, 0.08)),
    rgba(9, 54, 50, 0.72);
  color: #ffe797;
  font-size: 17px;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

body[data-page="island"] .island-status-name-action.confirm {
  color: #fff2b9;
}

body[data-page="island"] .island-status-name-action.cancel {
  border-color: rgba(255, 205, 49, 0.58);
  color: rgba(255, 231, 151, 0.82);
}

body[data-page="island"] .island-status-name-action:hover {
  border-color: #ffe27a;
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.22), 0 0 0 3px rgba(255, 205, 49, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

body[data-page="island"] .island-status-rename-button {
  position: relative;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border: 2px solid rgba(255, 213, 75, 0.9);
  border-radius: 8px;
  background:
    radial-gradient(circle at 38% 20%, rgba(255, 255, 232, 0.26), transparent 36%),
    linear-gradient(180deg, rgba(255, 245, 196, 0.1), rgba(255, 190, 40, 0.08)),
    rgba(9, 54, 50, 0.68);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

body[data-page="island"] .island-status-rename-button::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: #ffe797;
  box-shadow: 0 0 0 1px rgba(110, 75, 12, 0.18);
  transform: rotate(42deg);
  transform-origin: center;
}

body[data-page="island"] .island-status-rename-button::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 17px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 231, 151, 0.82);
  transform: rotate(-10deg);
}

body[data-page="island"] .island-status-rename-button:hover {
  border-color: #ffe27a;
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.22), 0 0 0 3px rgba(255, 205, 49, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

body[data-page="island"] .island-status-rename-button:focus-visible {
  outline: 3px solid rgba(255, 226, 122, 0.34);
  outline-offset: 2px;
}

body[data-page="island"] .island-status-list {
  display: grid;
  gap: 10px;
}

body[data-page="island"] .island-status-card {
  min-width: 0;
  min-height: 74px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 246, 217, 0.68);
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.86), transparent 28%),
    linear-gradient(180deg, rgba(255, 253, 239, 0.98), var(--island-enamel) 62%, rgba(236, 226, 198, 0.92)),
    #f7efd8;
  color: #17383a;
  box-shadow:
    0 10px 22px rgba(0, 17, 20, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -13px 26px rgba(185, 153, 89, 0.08);
}

body[data-page="island"] .island-status-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 15px;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.46), transparent 32%),
    linear-gradient(300deg, transparent 72%, rgba(58, 190, 160, 0.1));
}

body[data-page="island"] .island-status-card::after {
  content: "";
  position: absolute;
  left: 74px;
  right: 13px;
  bottom: 12px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 121, 109, 0.26), transparent);
}

body[data-page="island"] button.island-status-card {
  width: 100%;
  border: 1px solid rgba(255, 246, 217, 0.68);
  appearance: none;
  font: inherit;
  text-align: left;
}

body[data-page="island"] .island-status-card.clickable {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

body[data-page="island"] .island-status-card.clickable:hover {
  border-color: rgba(74, 208, 178, 0.48);
  box-shadow:
    0 15px 26px rgba(0, 17, 20, 0.25),
    0 0 0 1px rgba(79, 196, 169, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -13px 26px rgba(185, 153, 89, 0.07);
  filter: saturate(1.03);
  transform: translateY(-2px);
}

body[data-page="island"] .island-status-metric-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #fff7de;
  font-style: normal;
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
  overflow: visible;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body[data-page="island"] .island-status-metric-icon::after {
  content: none;
  pointer-events: none;
}

body[data-page="island"] .island-status-metric-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 2px 1px rgba(0, 27, 30, 0.18))
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.16));
}

body[data-page="island"] .island-status-metric-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body[data-page="island"] .island-status-metric-body > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

body[data-page="island"] .island-status-card span {
  overflow: hidden;
  color: #697166;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-status-card small {
  color: #078474;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1.15;
  white-space: nowrap;
}

body[data-page="island"] .island-status-card strong {
  overflow: visible;
  color: #17383a;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1.02;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

body[data-page="island"] .island-status-card.value-long strong {
  font-size: 19px;
  line-height: 1.04;
  overflow-wrap: normal;
  white-space: nowrap;
}

body[data-page="island"] .island-status-card.value-xlong strong {
  font-size: 17px;
  line-height: 1.05;
  overflow-wrap: normal;
  white-space: nowrap;
}

body[data-page="island"] .island-status-select-face {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 23px;
  padding: 0 14px;
  border: 1px solid rgba(255, 244, 190, 0.56);
  border-radius: 999px;
  background:
    radial-gradient(circle at 40% 15%, rgba(255, 255, 255, 0.72), transparent 36%),
    linear-gradient(180deg, #fff7dd, #ecd7a0);
  color: #7c6531;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body[data-page="island"] .island-status-dropdown-button {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 48px;
  border: 2px solid rgba(255, 213, 75, 0.92);
  border-radius: 12px;
  background:
    radial-gradient(circle at 42% 18%, rgba(255, 255, 226, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(18, 83, 75, 0.86), rgba(7, 49, 50, 0.94));
  box-shadow:
    0 9px 18px rgba(0, 23, 25, 0.38),
    inset 0 1px 0 rgba(127, 230, 207, 0.28),
    inset 0 -10px 18px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

body[data-page="island"] .island-status-dropdown-button::before,
body[data-page="island"] .island-status-dropdown-button::after {
  content: "";
  position: absolute;
  top: 21px;
  width: 10px;
  height: 3px;
  border-radius: 999px;
  background: #ffe79c;
}

body[data-page="island"] .island-status-dropdown-button::before {
  left: 10px;
  transform: rotate(38deg);
}

body[data-page="island"] .island-status-dropdown-button::after {
  right: 10px;
  transform: rotate(-38deg);
}

body[data-page="island"] .island-status-dropdown-button:hover {
  border-color: #ffe486;
  box-shadow:
    0 12px 21px rgba(0, 20, 22, 0.42),
    0 0 0 3px rgba(255, 213, 75, 0.13),
    inset 0 1px 0 rgba(142, 242, 219, 0.34);
  transform: translateY(-1px);
}

body[data-page="island"] .island-status-dropdown-button:focus-visible {
  outline: 3px solid #8f7130;
  outline-offset: 2px;
}

body[data-page="island"] .island-status-dropdown {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 237, 176, 0.54);
  border-radius: 16px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 232, 0.94), rgba(235, 223, 190, 0.94));
  color: #17383a;
  box-shadow:
    0 20px 38px rgba(0, 23, 25, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

body[data-page="island"] .island-status-dropdown-list {
  display: grid;
  gap: 6px;
}

body[data-page="island"] .island-status-dropdown-empty,
body[data-page="island"] .island-status-dropdown-item {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #113f3d;
  color: #fff7dd;
  box-shadow: inset 0 1px 0 #2d6d65;
}

body[data-page="island"] .island-status-dropdown-empty {
  display: grid;
  place-items: center;
  color: #d9cfad;
  font-size: 13px;
  font-weight: 900;
}

body[data-page="island"] .island-status-dropdown-item {
  border: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

body[data-page="island"] .island-status-dropdown-item:hover {
  background: #0c5a55;
}

body[data-page="island"] .island-status-dropdown-item span {
  min-width: 34px;
  color: #f0d792;
  font-size: 11px;
  font-weight: 1000;
}

body[data-page="island"] .island-status-dropdown-item strong {
  overflow: hidden;
  color: #fff7dd;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-status-dropdown-item small {
  color: #bfe2d7;
  font-size: 11px;
  font-weight: 900;
}

body[data-page="island"] .island-status-metric {
  overflow: hidden;
}

body[data-page="island"] .island-status-track {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 54, 62, 0.13);
  box-shadow: inset 0 1px 1px rgba(0, 30, 32, 0.08);
}

body[data-page="island"] .island-status-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0d8174, #4fc391);
  box-shadow: 0 0 8px rgba(43, 172, 140, 0.2);
}

body[data-page="island"] .island-status-metric.warning .island-status-track span {
  background: linear-gradient(90deg, #bb7c1a, #e6bb58);
}

body[data-page="island"] .island-status-metric.danger .island-status-track span {
  background: linear-gradient(90deg, #9b3330, #df6f5e);
}

.hex-map {
  display: block;
  width: min(100%, 980px);
  max-width: none;
  height: auto;
  margin: 16px auto 12px;
  overflow: visible;
}

body[data-page="island"] .hex-map {
  width: min(calc(100% - 48px), 1120px);
  margin: 0 auto;
  transform: scale(0.98);
  transform-origin: center top;
  filter: drop-shadow(0 26px 24px rgba(0, 20, 24, 0.35));
}

.plot-hex {
  cursor: pointer;
  filter: drop-shadow(0 7px 5px rgba(14, 51, 55, 0.2));
  transition: filter 0.16s ease;
}

body[data-page="island"] .plot-hex {
  filter: drop-shadow(0 11px 9px rgba(4, 31, 27, 0.32));
}

.plot-hex-land {
  stroke: rgba(246, 239, 208, 0.78);
  stroke-width: 1.6;
  pointer-events: fill;
  vector-effect: non-scaling-stroke;
}

body[data-page="island"] .plot-hex-land {
  fill: transparent;
  stroke: transparent;
  stroke-width: 0;
}

.plot-grid-outline {
  fill: transparent;
  pointer-events: none;
  stroke: rgba(38, 53, 28, 0.82);
  stroke-linejoin: round;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

body[data-page="island"] .plot-hex.selected .plot-grid-outline {
  filter:
    drop-shadow(0 0 4px rgba(255, 208, 93, 0.9))
    drop-shadow(0 0 9px rgba(255, 208, 93, 0.55));
  stroke: #ffd05d;
  stroke-width: 3;
}

body[data-page="island"] .plot-hex.coastal .plot-hex-land {
  fill: #789d58;
}

body[data-page="island"] .plot-hex.inland .plot-hex-land {
  fill: #8aa85d;
}

body[data-page="island"] .plot-hex.occupied .plot-hex-land {
  fill: #7f985a;
}

body[data-page="island"] .plot-hex.building-admin_center .plot-hex-land {
  fill: #a99a68;
}

body[data-page="island"] .plot-hex.building-port .plot-hex-land {
  fill: #6f948b;
}

body[data-page="island"] .plot-hex.building-warehouse .plot-hex-land {
  fill: #a79a79;
}

body[data-page="island"] .plot-hex.building-farm .plot-hex-land {
  fill: #96b553;
}

body[data-page="island"] .plot-hex.building-mine .plot-hex-land {
  fill: #8b8d78;
}

body[data-page="island"] .plot-hex.building-food_factory .plot-hex-land,
body[data-page="island"] .plot-hex.building-smelter .plot-hex-land {
  fill: #a6815b;
}

.plot-hex.coastal .plot-hex-land {
  fill: #72aa80;
}

.plot-hex.inland .plot-hex-land {
  fill: #93b35c;
}

.plot-hex.occupied .plot-hex-land {
  fill: #8ea75a;
}

.plot-hex.building-admin_center .plot-hex-land {
  fill: #c8ac70;
}

.plot-hex.building-port .plot-hex-land {
  fill: #6fa1a6;
}

.plot-hex.building-warehouse .plot-hex-land {
  fill: #b9ad91;
}

.plot-hex.building-farm .plot-hex-land {
  fill: #8fba53;
}

.plot-hex.building-desalination_plant .plot-hex-land {
  fill: #7bbabd;
}

.plot-hex.building-mine .plot-hex-land {
  fill: #8a8d7b;
}

.plot-hex.building-food_factory .plot-hex-land {
  fill: #bf9951;
}

.plot-hex.building-smelter .plot-hex-land {
  fill: #a77d69;
}

.plot-hex.selected {
  filter: drop-shadow(0 9px 8px rgba(72, 50, 16, 0.28));
}

.plot-hex.selected .plot-hex-land {
  stroke: #f2c25b;
  stroke-width: 4.2;
}

body[data-page="island"] .plot-hex.selected {
  filter:
    drop-shadow(0 0 6px rgba(255, 198, 84, 0.88))
    drop-shadow(0 12px 9px rgba(4, 31, 27, 0.32));
}

body[data-page="island"] .plot-hex.selected .plot-hex-land {
  stroke: transparent;
  stroke-width: 0;
  opacity: 0;
}

.plot-hex:hover .plot-hex-land {
  stroke: #f7e2a7;
  stroke-width: 3;
}

body[data-page="island"] .plot-hex-land,
body[data-page="island"] .plot-hex:hover .plot-hex-land,
body[data-page="island"] .plot-hex.selected .plot-hex-land {
  fill: transparent;
  opacity: 0;
  stroke: transparent;
  stroke-width: 0;
}

.plot-hex text {
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: var(--apple-china-font);
}

.plot-building-label {
  fill: #fff4cf;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(27, 40, 25, 0.82);
  stroke-width: 3;
}

body[data-page="island"] .plot-building-label {
  font-size: 10px;
}

.plot-hex-queue {
  filter: drop-shadow(0 3px 4px rgba(21, 45, 38, 0.28));
  pointer-events: none;
}


.plot-hex-queue-gear {
  filter: drop-shadow(0 1px 1px rgba(18, 42, 39, 0.2));
  transform-box: fill-box;
  transform-origin: center;
  animation: plotQueueGearSpin 2.2s linear infinite;
}

@keyframes plotQueueGearSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .plot-hex-queue-gear {
    animation: none;
  }
}

.plot-level-badge,
.plot-resource-label {
  pointer-events: none;
}

body[data-page="island"] .plot-level-badge-bg {
  fill: rgba(0, 0, 0, 0.68);
  stroke: none;
}

body[data-page="island"] .plot-level-badge-text {
  fill: #fff;
  font-family: var(--apple-china-font);
  font-size: 10.5px;
  font-stretch: condensed;
  font-weight: 900;
  dominant-baseline: middle;
  letter-spacing: 0;
  paint-order: normal;
  stroke: none;
  text-anchor: middle;
}

.plot-resource-label-bg {
  fill: transparent;
  stroke: none;
}

.plot-resource-label-image {
  filter: drop-shadow(0 1px 1px rgba(42, 37, 25, 0.28));
}

.hex-map.info-hidden .plot-level-badge,
.hex-map.info-hidden .plot-resource-label,
.hex-map.info-hidden .plot-hex-queue {
  display: none;
}

.expansion-point {
  cursor: pointer;
  filter: drop-shadow(0 5px 4px rgba(16, 60, 66, 0.24));
}

body[data-page="island"] .expansion-point {
  opacity: 0.6;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.expansion-point-bg {
  fill: rgba(246, 236, 195, 0.92);
  stroke: #f2c25b;
  stroke-width: 2;
}

.expansion-point-plus {
  fill: #4f3a17;
  font-size: 20px;
  font-weight: 800;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: middle;
}

body[data-page="island"] .expansion-point-plus {
  font-size: 13px;
}

.expansion-point.selected .expansion-point-bg,
.expansion-point:hover .expansion-point-bg {
  fill: #fff6cf;
  stroke-width: 3;
}

body[data-page="island"] .expansion-point.selected,
body[data-page="island"] .expansion-point:hover {
  opacity: 1;
}

.expansion-preview {
  pointer-events: none;
}

.expansion-preview-depth {
  fill: rgba(70, 106, 73, 0.58);
  stroke: rgba(41, 72, 51, 0.42);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.expansion-preview-shore {
  fill: #d8c06f;
  opacity: 0.72;
}

.expansion-preview-land {
  fill: rgba(124, 177, 120, 0.42);
  stroke: #f2c25b;
  stroke-dasharray: 5 4;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.expansion-preview-text {
  fill: #4f3a17;
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}

.expansion-modal {
  position: fixed;
  bottom: 16px;
  left: max(24px, calc((100vw - 1280px) / 2 + 24px));
  width: min(366px, calc(100vw - 48px));
  z-index: 5;
  display: grid;
  gap: 12px;
  border: 1px solid #bdd7dc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(24, 37, 45, 0.14);
  color: #18252d;
  padding: 12px;
}

.expansion-modal-title {
  font-weight: 800;
  margin-bottom: 5px;
}

.expansion-modal-detail {
  color: #60727a;
  font-size: 13px;
  line-height: 1.5;
}

.expansion-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.selected-plot-modal-backdrop {
  position: fixed;
  z-index: 120;
  inset: 0;
  background: transparent;
}

.empty-plot-modal {
  position: fixed;
  z-index: 121;
  top: 88px;
  left: 50%;
  width: min(1420px, calc(100vw - 56px));
  max-height: calc(100vh - 124px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid rgba(68, 92, 105, 0.28);
  border-radius: 8px;
  background: rgba(29, 31, 31, 0.96);
  box-shadow: 0 22px 60px rgba(4, 18, 24, 0.42);
  color: #f4f1e8;
  overflow: hidden;
  transform: translateX(-50%);
}

.empty-plot-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(68, 68, 68, 0.92);
  padding: 14px 18px;
}

.empty-plot-modal-header strong {
  display: block;
  font-size: 22px;
}

.empty-plot-kicker {
  display: block;
  color: #c9b98e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 3px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: rgba(244, 241, 232, 0.72);
  font-size: 30px;
  line-height: 1;
  padding: 0;
}

.icon-button:hover {
  color: #ffffff;
}

.empty-plot-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(41, 43, 43, 0.96);
}

.empty-plot-tabs button {
  min-height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8db7df;
  font-weight: 800;
}

.empty-plot-tabs button.selected {
  background: #3f648c;
  color: #ffffff;
}

.empty-plot-modal-body {
  min-height: 0;
  overflow-y: auto;
}

.empty-plot-modal-body.build {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.empty-plot-modal-body.build .empty-plot-toolbar {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(38, 41, 40, 0.98), rgba(25, 28, 27, 0.97));
}

.empty-plot-toolbar {
  display: grid;
  grid-template-columns: minmax(340px, 382px) minmax(420px, 560px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
}

.empty-plot-type-select {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: stretch;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid rgba(106, 139, 166, 0.58);
  border-radius: 8px;
  background: rgba(34, 38, 37, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 20px rgba(0, 0, 0, 0.16);
}

.empty-plot-type-select span {
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(94, 93, 78, 0.62), rgba(62, 64, 57, 0.72));
  color: #e1d6b6;
  font-size: 15px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.empty-plot-type-select select {
  height: 46px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: rgba(31, 35, 34, 0.98);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  padding: 0 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

.empty-plot-tier-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  min-height: 46px;
  overflow: hidden;
  border: 1px solid rgba(106, 139, 166, 0.58);
  border-radius: 8px;
  background: rgba(34, 38, 37, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 10px 20px rgba(0, 0, 0, 0.16);
}

.empty-plot-tier-tabs button {
  min-height: 46px;
  border: 0;
  border-left: 1px solid rgba(106, 139, 166, 0.36);
  border-radius: 0;
  background: transparent;
  color: #8ebce5;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.26);
}

.empty-plot-tier-tabs button:first-child {
  border-left: 0;
}

.empty-plot-tier-tabs button.selected {
  background:
    linear-gradient(180deg, rgba(91, 132, 173, 0.94), rgba(58, 96, 132, 0.98));
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -12px 20px rgba(0, 0, 0, 0.1);
}

.empty-plot-build-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 16px 18px;
  overflow-y: auto;
}

.empty-plot-build-row {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 520px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  border-left: 4px solid var(--industry-color, rgba(143, 150, 144, 0.7));
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--industry-surface, rgba(143, 150, 144, 0.08)), rgba(20, 22, 22, 0.96) 35%, rgba(20, 22, 22, 0.96)),
    rgba(20, 22, 22, 0.96);
  box-shadow:
    inset 0 1px 0 var(--industry-border, rgba(255, 255, 255, 0.045)),
    inset 0 0 0 1px rgba(255, 255, 255, 0.045),
    0 14px 28px rgba(0, 0, 0, 0.2);
  min-height: 318px;
  padding: 18px 20px;
}

.empty-plot-building-main {
  display: grid;
  grid-template-columns: 376px 118px;
  align-items: start;
  gap: 22px;
  min-width: 0;
}

.empty-plot-building-card {
  display: grid;
  grid-template-rows: 238px 62px;
  width: 376px;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.building-thumb {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f6efe1, #d7c7a5);
  color: #183341;
  font-size: 24px;
  font-weight: 900;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.08);
}

.building-thumb-image {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
}

.empty-plot-build-row .building-thumb {
  justify-self: stretch;
  width: 100%;
  height: 238px;
  border-radius: 8px 8px 0 0;
  background: #ffffff;
  box-shadow: none;
  font-size: 48px;
  overflow: hidden;
}

.empty-plot-build-row .building-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  transform: scale(1.18) translateY(-5%);
  transform-origin: center center;
}

.building-preview-fallback {
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

button.building-thumb {
  border: 0;
  cursor: pointer;
  font: inherit;
}

button.building-thumb:hover,
.encyclopedia-inline-button:hover {
  filter: brightness(1.08);
}

.empty-plot-building-title {
  display: grid;
  place-items: center;
  min-width: 0;
  color: #ffffff;
  background: rgba(18, 20, 19, 0.94);
  font-size: 25px;
  font-weight: 900;
  line-height: 1.12;
  padding: 8px 10px;
  text-align: center;
}

.build-recommend {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #107a5f;
  color: #d9fff2;
  font-size: 11px;
  margin-left: 8px;
  padding: 3px 8px;
  vertical-align: middle;
}

.empty-plot-building-meta {
  display: grid;
  align-content: start;
  gap: 24px;
  margin-top: 0;
}

.empty-plot-building-meta span {
  display: grid;
  place-items: center;
  min-height: 54px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.085);
  color: #d6d0c2;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
  padding: 8px 10px;
  text-align: center;
}

.industry-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--industry-border, rgba(255, 255, 255, 0.16));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.08)),
    var(--industry-soft, rgba(255, 255, 255, 0.1));
  color: var(--industry-text, #d6d0c2);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 8px 18px rgba(0, 0, 0, 0.14);
}

.empty-plot-building-meta span.industry-chip {
  display: grid;
  min-height: 54px;
  border-color: rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.14)),
    var(--industry-color, #8f9690);
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -10px 18px rgba(0, 0, 0, 0.1),
    0 10px 20px rgba(0, 0, 0, 0.16);
}

.mini-link-button {
  border: 1px solid rgba(132, 179, 218, 0.55);
  border-radius: 999px;
  background: rgba(65, 111, 151, 0.34);
  color: #b8dcff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 8px;
}

.mini-link-button:hover {
  background: rgba(75, 135, 187, 0.48);
  color: #ffffff;
}

.empty-plot-costs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  max-width: none;
  gap: 8px;
}

.empty-plot-build-side {
  display: grid;
  align-self: center;
  align-items: center;
  height: 300px;
  min-width: 0;
  padding: 0;
}

.empty-plot-requirements {
  display: grid;
  grid-template-rows: 120px 120px;
  align-content: stretch;
  gap: 60px;
  height: 300px;
  min-width: 0;
}

.empty-plot-requirement-group {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.workforce-requirement-group {
  min-height: 0;
}

.material-requirement-group {
  min-height: 0;
}

.empty-plot-requirement-label {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
  align-self: start;
  justify-self: end;
  width: auto;
  min-width: 88px;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  padding: 2px 0 0 16px;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.empty-plot-requirement-label::before {
  position: absolute;
  top: 0;
  bottom: auto;
  left: 0;
  width: 4px;
  height: 34px;
  border-radius: 999px;
  background: rgba(202, 188, 150, 0.82);
  box-shadow: 0 0 14px rgba(202, 188, 150, 0.18);
  content: "";
}

.empty-plot-requirement-label::after {
  display: none;
  content: none;
}

.empty-plot-requirement-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 108px));
  justify-content: start;
  align-items: start;
  max-width: none;
  gap: 14px 18px;
  min-width: 0;
}

.empty-plot-requirement-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 258px;
  align-items: start;
  gap: 34px;
  min-width: 0;
}

.empty-plot-cost-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 2px;
  background: #8b674d;
  color: #fff3dc;
  padding: 5px;
}

button.empty-plot-cost-tile {
  border: 0;
  cursor: pointer;
  font: inherit;
}

button.empty-plot-cost-tile:hover {
  filter: brightness(1.08);
}

.empty-plot-cost-tile.missing {
  box-shadow: inset 0 0 0 2px rgba(220, 66, 48, 0.75);
}

.empty-plot-cost-tile.workforce {
  background: #4f5961;
}

.empty-plot-cost-tile.workforce.enough {
  box-shadow: inset 0 0 0 2px rgba(111, 181, 133, 0.7);
}

.empty-plot-cost-tile strong {
  align-items: center;
  display: flex;
  font-size: 18px;
  height: 26px;
  justify-content: center;
  line-height: 1;
}

.product-icon-image {
  display: block;
  height: 26px;
  object-fit: contain;
  width: 26px;
}

.empty-plot-cost-tile em {
  position: absolute;
  top: 4px;
  right: 5px;
  color: #ffffff;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.empty-plot-cost-tile small {
  color: #fff3dc;
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
}

.empty-plot-cost-tile.build-asset-tile {
  width: auto;
  height: auto;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.empty-plot-cost-tile.build-asset-tile.missing,
.empty-plot-cost-tile.build-asset-tile.workforce.enough {
  box-shadow: none;
}

.build-asset-frame {
  position: relative;
  display: grid;
  grid-template-rows: minmax(54px, 1fr) auto;
  width: 74px;
  height: 82px;
  overflow: hidden;
  border-radius: 4px;
}

.empty-plot-build-row .build-asset-frame {
  grid-template-rows: minmax(76px, 1fr) auto;
  width: 108px;
  height: 120px;
  border-radius: 6px;
}

.empty-plot-cost-tile.build-asset-tile.missing .build-asset-frame {
  box-shadow: inset 0 0 0 2px rgba(220, 66, 48, 0.86);
}

.empty-plot-cost-tile.build-asset-tile.workforce.enough .build-asset-frame {
  box-shadow: inset 0 0 0 2px rgba(111, 181, 133, 0.78);
}

.empty-plot-cost-tile.build-asset-tile.population-reward .build-asset-frame {
  box-shadow:
    inset 0 0 0 2px rgba(125, 160, 107, 0.86),
    0 0 18px rgba(125, 160, 107, 0.18);
}

.empty-plot-cost-tile.build-asset-tile strong {
  width: 100%;
  height: 58px;
  background: #f3f0e8;
  font-size: 24px;
}

.empty-plot-build-row .empty-plot-cost-tile.build-asset-tile strong {
  height: 84px;
  font-size: 31px;
}

.empty-plot-cost-tile.build-asset-tile .product-icon-image,
.empty-plot-cost-tile.build-asset-tile .workforce-type-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.empty-plot-cost-tile.build-asset-tile .workforce-type-icon {
  object-fit: cover;
}

.empty-plot-cost-tile.build-asset-tile em {
  top: 0;
  right: 0;
  min-width: 22px;
  border-radius: 0 0 0 4px;
  background: rgba(26, 28, 27, 0.76);
  padding: 2px 5px;
  text-align: right;
}

.empty-plot-build-row .empty-plot-cost-tile.build-asset-tile em {
  min-width: 30px;
  font-size: 20px;
  padding: 3px 7px;
}

.empty-plot-cost-tile.build-asset-tile small {
  box-sizing: border-box;
  width: 100%;
  min-height: 24px;
  overflow: hidden;
  background: rgba(26, 28, 27, 0.76);
  color: #fff3dc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  padding: 4px 3px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-plot-build-row .empty-plot-cost-tile.build-asset-tile small {
  min-height: 36px;
  font-size: 16px;
  line-height: 1.12;
  padding: 8px 4px 7px;
}

.empty-plot-no-cost {
  color: #c9b98e;
  font-weight: 800;
}

.empty-plot-build-button {
  grid-column: 2;
  align-self: start;
  justify-self: stretch;
  width: 100%;
  min-height: 120px;
  border-color: rgba(117, 169, 218, 0.86);
  border-radius: 8px;
  background: linear-gradient(180deg, #426f99, #345a7d);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 10px 18px rgba(0, 0, 0, 0.2);
  font-size: 25px;
  font-weight: 900;
}

.empty-plot-detail-tab {
  min-height: 0;
  display: grid;
  padding: 0;
  overflow: hidden;
}

.plot-detail-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(620px, 1.7fr) minmax(300px, 0.72fr);
  background: linear-gradient(90deg, rgba(246, 240, 225, 0.96), rgba(239, 232, 214, 0.98));
  color: #202424;
  overflow: hidden;
}

.plot-detail-visual-pane {
  min-height: 520px;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(87, 76, 55, 0.18);
  padding: 18px;
}

.plot-resource-visual {
  position: relative;
  display: grid;
  gap: 3px;
  width: min(100%, 640px, calc((100vh - 250px) * 0.75));
  aspect-ratio: 3 / 4;
  max-height: calc(100vh - 250px);
  min-height: 0;
  border: 1px solid rgba(76, 62, 37, 0.24);
  border-radius: 7px;
  background: #1d211e;
  box-shadow: 0 18px 34px rgba(22, 18, 10, 0.18);
  overflow: hidden;
}

.plot-resource-visual.layout-one,
.plot-resource-visual.layout-none {
  grid-template-columns: 1fr;
}

.plot-resource-visual.layout-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 1080px, calc((100vh - 250px) * 1.5));
  aspect-ratio: 3 / 2;
}

.plot-resource-visual.layout-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 1080px, calc((100vh - 250px) * 2.25));
  aspect-ratio: 9 / 4;
}

.plot-resource-visual-stack {
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 3px;
}

.plot-resource-visual.layout-three .plot-resource-visual-stack {
  display: contents;
}

.plot-resource-art {
  position: relative;
  min-width: 0;
  min-height: 0;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.plot-resource-art::before,
.plot-resource-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plot-resource-art::before {
  background: radial-gradient(circle at 55% 38%, rgba(255, 244, 214, 0.1), transparent 42%), linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.12));
  mix-blend-mode: screen;
}

.plot-resource-art::after {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 -34px 60px rgba(13, 17, 15, 0.2);
}

.plot-resource-art.resource-barren {
  background-color: #d8c9aa;
  background-image: url("./assets/plot-resource-concepts/barren.webp?v=flat-20260610");
}

.plot-resource-art.resource-fertile {
  background-color: #799465;
  background-image: url("./assets/plot-resource-concepts/fertile.webp?v=flat-20260610");
}

.plot-resource-art.resource-mineral {
  background-color: #8d8676;
  background-image: url("./assets/plot-resource-concepts/mineral.webp?v=flat-20260610");
}

.plot-resource-art.resource-liquid {
  background-color: #314b47;
  background-image: url("./assets/plot-resource-concepts/liquid.webp?v=flat-20260610");
}

.plot-resource-art.resource-gas {
  background-color: #8ca49b;
  background-image: url("./assets/plot-resource-concepts/gas.webp?v=flat-20260610");
}

.plot-resource-art.resource-oil {
  background-color: #2f3331;
  background-image: url("./assets/plot-resource-concepts/oil.webp?v=flat-20260610");
}

.plot-resource-art-chip {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  display: grid;
  grid-template-columns: 28px auto;
  grid-template-areas:
    "icon title"
    "icon metric"
    "icon material";
  align-items: center;
  column-gap: 8px;
  max-width: calc(100% - 24px);
  border: 1px solid rgba(235, 224, 194, 0.18);
  border-radius: 7px;
  background: rgba(24, 25, 22, 0.74);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  color: #f7f0df;
  padding: 8px 10px;
}

.plot-resource-art-chip span {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 0;
  background: transparent;
  color: #d8c58f;
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.plot-resource-art-icon-image {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(16, 14, 10, 0.44));
}

.plot-resource-art-chip strong {
  grid-area: title;
  color: #fff9e9;
  font-size: 14px;
  line-height: 1.1;
}

.plot-resource-art-chip em,
.plot-resource-art-chip small {
  color: #cfe5d1;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
}

.plot-resource-art-chip em {
  grid-area: metric;
}

.plot-resource-art-chip small {
  grid-area: material;
  color: rgba(247, 240, 223, 0.68);
}

.plot-detail-side {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 12px;
  padding: 22px;
}

.plot-detail-section {
  display: grid;
  gap: 0;
}

.plot-detail-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #2b302e;
  font-size: 16px;
  font-weight: 900;
}

.plot-detail-section h3 span {
  color: #687c72;
  font-size: 14px;
}

.plot-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 38px;
  border-bottom: 1px solid rgba(85, 74, 55, 0.16);
  color: #494d49;
}

.plot-detail-row-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
}

.plot-detail-row-label i {
  display: grid;
  place-items: center;
  width: 20px;
  color: #6d756e;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.plot-detail-row strong {
  color: #222624;
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}

.plot-detail-remaining {
  align-content: start;
  gap: 14px;
}

.plot-remaining-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(85, 74, 55, 0.12);
  padding: 0 0 13px;
}

.plot-remaining-icon {
  border: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 0;
  background: transparent;
  color: #5f806f;
  cursor: default;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

button.plot-remaining-icon {
  cursor: pointer;
}

.plot-remaining-icon:hover,
.plot-remaining-name:hover {
  color: #2d645c;
}

.plot-remaining-icon-image {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(43, 36, 22, 0.26));
}

.plot-remaining-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.plot-remaining-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 8px;
}

.plot-remaining-title strong {
  min-width: 0;
  color: #222624;
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plot-remaining-name {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #222624;
  cursor: default;
  font: inherit;
  padding: 0;
  text-align: left;
}

button.plot-remaining-name {
  cursor: pointer;
}

.plot-remaining-name strong {
  display: block;
}

.plot-remaining-title span {
  border-radius: 999px;
  background: rgba(40, 47, 43, 0.09);
  color: #646c65;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
}

.plot-remaining-title em {
  color: #303532;
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

.plot-remaining-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(35, 34, 29, 0.12);
  overflow: hidden;
}

.plot-remaining-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #5f9875;
}

.plot-remaining-row.resource-mineral .plot-remaining-track span {
  background: #c4a15e;
}

.plot-remaining-row.resource-liquid .plot-remaining-track span {
  background: #5a9fba;
}

.plot-remaining-row.resource-gas .plot-remaining-track span {
  background: #84a79d;
}

.plot-remaining-row.resource-oil .plot-remaining-track span {
  background: #7d6d4b;
}

.plot-remaining-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed rgba(85, 74, 55, 0.22);
  border-radius: 8px;
  color: #847d6e;
  font-weight: 900;
}

.plot-detail-refresh {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(85, 74, 55, 0.12);
  padding-top: 16px;
}

.plot-detail-refresh button {
  min-height: 54px;
  border: 1px solid rgba(37, 87, 78, 0.46);
  border-radius: 7px;
  background: linear-gradient(180deg, #779d96, #4f7e78);
  box-shadow: 0 10px 18px rgba(19, 53, 49, 0.16);
  color: #fff8e8;
  font-size: 19px;
  font-weight: 900;
}

.plot-detail-refresh button span {
  margin-right: 8px;
}

.plot-refresh-cost-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #526b61;
  font-size: 13px;
  font-weight: 800;
}

.plot-refresh-cost-line i {
  display: block;
  width: 1px;
  height: 14px;
  background: rgba(82, 107, 97, 0.28);
}

.empty-plot-modal.building-plot-modal {
  top: calc(var(--global-topbar-height) + 10px);
  width: min(540px, calc(100vw - 28px));
  max-height: calc(100vh - var(--global-topbar-height) - 12px);
  background: rgba(14, 22, 25, 0.97);
}

.building-plot-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.building-modal-title-block {
  min-width: 0;
}

.building-modal-title-link {
  display: block;
  border: 0;
  background: transparent;
  color: #fff3dc;
  cursor: pointer;
  font: inherit;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.1;
  padding: 0;
  text-align: left;
}

.building-modal-title-link:hover {
  color: #ffffff;
}

.building-modal-title-block .empty-plot-kicker {
  color: #bfb5a0;
  font-size: 13px;
}

.building-modal-title-block .empty-plot-kicker i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #28bd94;
  margin: 0 6px 1px;
}

.building-modal-body {
  display: grid;
  gap: 14px;
  max-height: none;
  padding: 16px;
  overflow-y: auto;
}

.building-plot-modal .empty-plot-modal-body.building {
  display: block;
  overflow-y: auto;
}

body[data-page="island"] .building-upgrade-confirm-backdrop {
  position: fixed;
  z-index: 130;
  top: var(--global-topbar-height);
  right: 0;
  bottom: var(--global-bottom-nav-reserve);
  left: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 13, 18, 0.58);
  backdrop-filter: blur(5px);
}

body[data-page="island"] .building-upgrade-confirm {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(480px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 28px));
  overflow: hidden;
  border: 1px solid rgba(255, 226, 167, 0.22);
  border-radius: 10px;
  background:
    radial-gradient(circle at 18% 0%, rgba(52, 194, 160, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(28, 35, 35, 0.99), rgba(13, 19, 20, 0.99));
  color: #f4f1e8;
  box-shadow: 0 28px 76px rgba(0, 8, 12, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body[data-page="island"] .building-upgrade-confirm-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

body[data-page="island"] .building-upgrade-confirm-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body[data-page="island"] .building-upgrade-confirm-head span {
  color: #bfb5a0;
  font-size: 12px;
  font-weight: 900;
}

body[data-page="island"] .building-upgrade-confirm-head strong {
  overflow: hidden;
  color: #fff3dc;
  font-size: 22px;
  line-height: 1.14;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .building-upgrade-confirm-body {
  display: grid;
  gap: 12px;
  overflow-y: auto;
  padding: 14px;
}

body[data-page="island"] .building-upgrade-panel {
  display: grid;
  gap: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  padding: 12px;
}

body[data-page="island"] .building-upgrade-panel h3 {
  margin: 0;
  color: #fff3dc;
  font-size: 16px;
}

body[data-page="island"] .building-upgrade-cost-list,
body[data-page="island"] .building-upgrade-benefit-list {
  display: grid;
  gap: 8px;
}

body[data-page="island"] .building-upgrade-cost-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border-radius: 8px;
  background: rgba(10, 15, 16, 0.64);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 6px 10px 6px 6px;
}

body[data-page="island"] .building-upgrade-cost-row.missing {
  box-shadow: inset 0 0 0 1px rgba(229, 73, 58, 0.54);
}

body[data-page="island"] .building-upgrade-cost-row span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #f3f0e8;
  color: #2d3532;
  font-weight: 900;
  overflow: hidden;
}

body[data-page="island"] .building-upgrade-cost-row .product-icon-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body[data-page="island"] .building-upgrade-cost-row strong {
  min-width: 0;
  overflow: hidden;
  color: #fff3dc;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .building-upgrade-cost-row em {
  color: #74d6bb;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

body[data-page="island"] .building-upgrade-cost-row.missing em {
  color: #ff9387;
}

body[data-page="island"] .building-upgrade-benefit-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 3px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 0 8px;
}

body[data-page="island"] .building-upgrade-benefit-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

body[data-page="island"] .building-upgrade-benefit-row span {
  color: #bfb5a0;
  font-size: 13px;
  font-weight: 900;
}

body[data-page="island"] .building-upgrade-benefit-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #fff3dc;
  font-size: 15px;
}

body[data-page="island"] .building-upgrade-benefit-row small {
  grid-column: 2;
  color: rgba(244, 241, 232, 0.62);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

body[data-page="island"] .building-upgrade-confirm .block-reasons {
  border-color: rgba(229, 73, 58, 0.44);
  background: rgba(229, 73, 58, 0.12);
  color: #ffd2cc;
}

body[data-page="island"] .building-upgrade-empty {
  color: #bfb5a0;
  font-weight: 800;
}

body[data-page="island"] .building-upgrade-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 13, 0.78);
}

body[data-page="island"] .building-upgrade-confirm-actions button {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 900;
}

.building-overview-tab {
  gap: 12px;
}

.building-modal-status-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
}

.building-modal-visual {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 176px;
  border-radius: 8px;
  background: rgba(14, 16, 16, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 12px;
}

.building-modal-visual strong {
  color: #ffffff;
  font-size: 18px;
  text-align: center;
}

.building-modal-visual span {
  color: #d8c99c;
  font-weight: 900;
}

.building-modal-thumb {
  width: 108px;
  height: 108px;
  font-size: 38px;
}

.building-modal-image {
  display: block;
  max-width: 138px;
  max-height: 138px;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.35));
}

.building-modal-hero {
  display: grid;
  place-items: center;
  min-height: 230px;
  border: 0;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 42%, rgba(42, 68, 65, 0.24), rgba(6, 13, 16, 0.58) 68%);
  cursor: pointer;
  overflow: visible;
  padding: 16px;
}

.building-modal-hero:hover {
  filter: brightness(1.05);
}

.building-modal-overview-image {
  display: block;
  width: min(100%, 430px);
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.38));
}

.building-modal-overview-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.building-overview-chip {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value";
  align-items: center;
  gap: 1px 9px;
  min-height: 68px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  padding: 10px 12px;
}

.building-overview-chip i {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #d8c99c;
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.building-overview-chip-icon-image {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: none;
}

.building-overview-chip-icon-fallback {
  display: block;
  line-height: 1;
}

.building-overview-chip span {
  grid-area: label;
  color: #bfb5a0;
  font-size: 13px;
  font-weight: 800;
}

.building-overview-chip strong {
  grid-area: value;
  min-width: 0;
  color: #fff3dc;
  font-size: 18px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-modal-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.building-modal-info-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 11px;
}

.building-modal-info-card span {
  color: #c9b98e;
  font-size: 12px;
  font-weight: 800;
}

.building-modal-info-card strong {
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 17px;
}

.building-modal-note {
  border-radius: 8px;
  background: rgba(242, 183, 73, 0.13);
  color: #f5dcad;
  font-weight: 800;
  line-height: 1.45;
  padding: 10px 12px;
}

.building-modal-durability {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 11px;
}

.building-production-summary {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  padding: 14px;
}

.building-production-summary > header,
.building-production-summary > .building-production-state,
.building-production-summary > small {
  position: relative;
  z-index: 1;
}

.building-production-overview-summary::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 12px 18px 10px 42%;
  background-image: var(--building-production-summary-bg-image, none);
  background-position: center right;
  background-repeat: no-repeat;
  background-size: min(220px, 78%) auto;
  opacity: 0.12;
  pointer-events: none;
}

.building-production-summary header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.building-production-summary header strong {
  color: #fff3dc;
  font-size: 20px;
}

.building-production-summary .text-button {
  color: #34c2a0;
  font-size: 13px;
  font-weight: 900;
}

.building-production-summary > small {
  color: #8f8878;
  font-weight: 800;
}

.building-production-state {
  min-width: 0;
}

.building-production-idle,
.building-production-active {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.building-production-idle i,
.building-production-product-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: rgba(15, 19, 19, 0.72);
  color: #2cc19d;
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
}

.building-production-product-icon .product-icon-image {
  width: 44px;
  height: 44px;
}

.building-production-idle strong,
.building-production-active-main strong {
  display: block;
  color: #34c2a0;
  font-size: 18px;
  font-weight: 900;
}

.building-production-idle span {
  color: #bfb5a0;
  font-size: 13px;
  font-weight: 800;
}

.building-production-active-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.building-production-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.building-production-stat-grid span {
  min-width: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.13);
  padding-left: 9px;
}

.building-production-stat-grid span:first-child {
  border-left: 0;
  padding-left: 0;
}

.building-production-stat-grid em {
  display: block;
  color: #aaa18e;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.building-production-stat-grid b {
  display: block;
  color: #34c2a0;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-energy-overview-summary .building-production-active-main,
.building-production-overview-summary .building-production-active-main {
  gap: 10px;
}

.building-energy-overview-progress,
.building-production-overview-progress {
  width: 100%;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.22);
}

.building-energy-overview-progress span,
.building-production-overview-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0c8f84, #28d6b2);
  box-shadow: 0 0 18px rgba(36, 209, 173, 0.42);
  transition: width 0.25s ease;
}

.building-energy-consumed-materials {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.building-energy-consumed-materials > span:first-child,
.building-energy-consumed-empty {
  color: rgba(43, 64, 60, 0.68);
  font-style: normal;
  font-weight: 850;
}

.building-energy-consumed-item {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  min-height: 28px;
  padding: 3px 9px 3px 4px;
  border: 1px solid rgba(20, 143, 132, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #0b3b35;
  font-weight: 950;
  line-height: 1;
}

.building-energy-consumed-item i {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(14, 160, 146, 0.12);
  font-style: normal;
}

.building-energy-consumed-item .product-icon-image {
  width: 21px;
  height: 21px;
}

.building-energy-output-icon {
  background: transparent;
}

.building-energy-output-icon .building-overview-chip-icon-image {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.building-overview-actions {
  position: sticky;
  z-index: 1;
  bottom: -16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  background: linear-gradient(180deg, rgba(14, 22, 25, 0), rgba(14, 22, 25, 0.98) 18%);
  margin: 2px -2px -16px;
  padding: 10px 2px 16px;
}

.building-overview-actions.residential-actions,
.building-overview-actions.compact-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.building-overview-actions > button,
.building-overview-more summary {
  display: grid;
  place-items: center;
  min-height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(18, 25, 26, 0.92);
  color: #e7dec8;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 8px 4px;
}

.building-overview-actions i,
.building-overview-more summary i {
  font-style: normal;
  font-size: 24px;
  line-height: 1;
}

.building-overview-actions span,
.building-overview-more summary span {
  font-size: 13px;
}

.building-overview-actions > button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.building-overview-more {
  position: relative;
}

.building-overview-more summary {
  list-style: none;
}

.building-overview-more summary::-webkit-details-marker {
  display: none;
}

.building-overview-more div {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  min-width: 128px;
  border-radius: 8px;
  background: rgba(15, 19, 19, 0.98);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
  padding: 8px;
}

.building-overview-more:not([open]) div {
  display: none;
}

.building-overview-more .danger {
  border-color: rgba(229, 73, 58, 0.72);
  background: #d84d3f;
  color: #fff2eb;
}

.building-modal-extra-rows {
  display: grid;
  gap: 6px;
}

.building-modal-extra-rows:empty {
  display: none;
}

.building-modal-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.building-modal-action-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 184px;
  border-radius: 8px;
  background: rgba(18, 20, 20, 0.94);
  box-shadow: inset 4px 0 0 rgba(117, 169, 218, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.building-modal-action-card.repair {
  box-shadow: inset 4px 0 0 rgba(20, 181, 142, 0.78), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.building-modal-action-card.demolish {
  box-shadow: inset 4px 0 0 rgba(229, 73, 58, 0.82), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.building-modal-action-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.building-modal-action-head strong {
  display: block;
  color: #ffffff;
  font-size: 18px;
}

.building-modal-action-head span,
.building-modal-action-head em,
.building-modal-action-detail {
  color: #d7d0c0;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.building-modal-action-card .empty-plot-costs {
  justify-content: flex-start;
  max-width: none;
}

.building-modal-action-button {
  align-self: end;
  display: flex;
  justify-content: flex-end;
}

.building-modal-action-button button {
  min-width: 116px;
}

.building-modal-action-button button.danger {
  border-color: #f05a49;
  background: #d84d3f;
}

.building-modal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #c9b98e;
}

.building-modal-section-head strong {
  color: #ffffff;
  font-size: 18px;
}

.building-production-section-head {
  align-items: start;
}

.building-production-tools {
  display: grid;
  justify-items: end;
  gap: 8px;
  width: min(260px, 42vw);
  min-width: 190px;
}

.building-production-tools .building-production-speed-summary {
  width: 100%;
  min-width: 0;
}

.building-production-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
}

.building-production-action-row .building-production-orders-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.building-production-automation-status {
  display: grid;
  grid-template-areas:
    "state yield"
    "actions yield";
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  column-gap: 18px;
  row-gap: 12px;
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(47, 197, 169, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(222, 249, 242, 0.5)),
    rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(18, 86, 76, 0.08);
}

.building-production-automation-state,
.building-production-automation-yield {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.building-production-automation-state {
  grid-area: state;
}

.building-production-automation-yield {
  grid-area: yield;
  justify-self: center;
  transform: translateX(18px);
}

.building-production-automation-yield-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-width: 0;
}

.building-production-automation-state span,
.building-production-automation-yield span {
  color: rgba(28, 56, 51, 0.68);
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.building-production-automation-state strong,
.building-production-automation-yield-empty {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #08786c;
  font-size: 20px;
  font-weight: 1000;
  line-height: 1.15;
}

.building-production-automation-yield-tile {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 70px;
  min-height: 82px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(237, 249, 246, 0.62)),
    rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 16px rgba(18, 86, 76, 0.08);
  color: #0e342f;
  cursor: pointer;
  font: inherit;
}

.building-production-automation-yield-tile strong {
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 5px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.78), rgba(236, 245, 241, 0.5));
}

.building-production-automation-yield-tile strong img {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.building-production-automation-yield-tile em {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  border-radius: 0 13px 0 10px;
  background: linear-gradient(180deg, #c69b25, #a8750f);
  color: #fffdf2;
  font-size: 13px;
  font-style: normal;
  font-weight: 1000;
  line-height: 24px;
  text-align: center;
  text-shadow: 0 1px 1px rgba(56, 37, 6, 0.24);
}

.building-production-automation-yield-tile small {
  display: block;
  min-height: 23px;
  padding: 3px 5px 5px;
  overflow: hidden;
  color: #0e342f;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-production-automation-yield-tile:hover,
.building-production-automation-yield-tile:focus-visible {
  border-color: rgba(47, 197, 169, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(224, 249, 242, 0.72)),
    rgba(255, 255, 255, 0.62);
  outline: 0;
}

.building-production-automation-state span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.building-production-automation-state span::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2fc5a9;
  box-shadow: 0 0 0 5px rgba(47, 197, 169, 0.14);
}

.building-production-automation-status-actions {
  grid-area: actions;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  padding-top: 2px;
}

.building-production-automation-status-actions button {
  min-width: 132px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(8, 120, 108, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: #08786c;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.building-production-automation-status-actions button:hover,
.building-production-automation-status-actions button:focus-visible {
  border-color: rgba(8, 120, 108, 0.48);
  background: rgba(47, 197, 169, 0.16);
  outline: 0;
}

.building-production-speed-summary {
  position: relative;
  display: grid;
  gap: 5px;
  width: min(260px, 42vw);
  min-width: 190px;
  color: #c9d2cf;
}

.building-production-speed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 900;
}

.building-production-speed-row > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #aebbb6;
  white-space: nowrap;
}

.building-production-speed-row strong {
  color: #fff6df;
  font-size: 15px;
  line-height: 1;
}

.building-production-speed-help {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  border: 1px solid rgba(201, 210, 207, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #dce4e0;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
}

.building-production-speed-help:hover,
.building-production-speed-help:focus-visible {
  border-color: rgba(47, 197, 169, 0.78);
  background: rgba(47, 197, 169, 0.14);
  color: #a5ffe9;
  outline: 0;
}

.building-production-speed-bar {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(201, 210, 207, 0.32);
  border-radius: 3px;
  background: rgba(201, 210, 207, 0.1);
}

.building-production-speed-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #b84c52 0%, #d8a65a 55%, #2fc5a9 100%);
}

.building-production-speed-tooltip {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: min(340px, calc(100vw - 64px));
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(47, 197, 169, 0.34);
  border-radius: 8px;
  background: rgba(7, 18, 20, 0.97);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  color: #f2fbf7;
  font-size: 12px;
  line-height: 1.42;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}

.building-production-speed-summary:hover .building-production-speed-tooltip,
.building-production-speed-summary:focus-within .building-production-speed-tooltip {
  display: grid;
}

.building-production-speed-tooltip strong {
  color: #ffffff;
  font-size: 15px;
  font-weight: 1000;
}

.building-production-speed-tooltip span {
  color: #edf8f4;
}

.building-production-speed-tooltip em {
  margin-top: 2px;
  color: #9ffff0;
  font-style: normal;
  font-weight: 900;
}

@media (max-width: 560px) {
  .building-modal-section-head {
    align-items: start;
  }

  .building-production-speed-summary {
    width: min(210px, 52vw);
    min-width: 150px;
  }

  .building-production-tools {
    width: min(210px, 52vw);
    min-width: 150px;
  }

  .building-production-action-row {
    gap: 10px;
    margin-top: 12px;
  }

  .building-production-automation-status {
    grid-template-areas:
      "state"
      "yield"
      "actions";
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
  }

  .building-production-automation-yield {
    justify-self: start;
    transform: none;
  }

  .building-production-automation-yield-items {
    justify-content: flex-start;
  }

  .building-production-automation-status-actions {
    justify-content: flex-start;
  }

  .building-production-automation-status-actions button {
    flex: 0 0 auto;
  }

  .building-production-automation-button {
    width: min(210px, 52vw);
    min-width: 150px;
  }

  .building-production-speed-row {
    gap: 6px;
    font-size: 12px;
  }

  .building-production-speed-row strong {
    font-size: 13px;
  }

  .building-production-speed-help {
    width: 16px;
    height: 16px;
    min-width: 16px;
    font-size: 11px;
  }

  .building-production-speed-tooltip {
    right: -4px;
    width: min(300px, calc(100vw - 32px));
  }
}

.building-production-controls {
  display: grid;
  gap: 10px;
}

.building-production-heading-stack {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-width: 0;
}

.building-production-orders-button {
  min-width: 116px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(47, 197, 169, 0.32);
  border-radius: 999px;
  background: rgba(47, 197, 169, 0.12);
  color: #2fc5a9;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.building-production-orders-button:hover,
.building-production-orders-button:focus-visible {
  border-color: rgba(47, 197, 169, 0.62);
  background: rgba(47, 197, 169, 0.2);
  outline: 0;
}

.building-production-automation-button {
  width: min(260px, 42vw);
  min-width: 190px;
}

.building-production-orders-backdrop {
  position: fixed;
  z-index: 132;
  top: var(--global-topbar-height);
  right: 0;
  bottom: var(--global-bottom-nav-reserve);
  left: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 13, 18, 0.34);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
}

.building-production-orders-modal.empty-plot-modal.building-plot-modal {
  position: relative;
  z-index: 133;
  top: auto;
  left: auto;
  width: min(820px, calc(100vw - 28px));
  max-height: min(820px, calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  transform: none;
}

.building-production-orders-modal .building-production-orders-body {
  min-height: 0;
  overflow-y: auto;
}

.building-production-orders-modal .building-production-orders-body .building-modal-body {
  min-height: 0;
}

.building-production-automation-modal.empty-plot-modal.building-plot-modal {
  width: min(720px, calc(100vw - 28px));
}

.building-production-automation-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.building-automation-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(47, 197, 169, 0.22);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 251, 247, 0.44)),
    rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 22px rgba(15, 76, 69, 0.08);
}

.building-automation-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(28, 56, 51, 0.72);
  font-size: 15px;
  font-weight: 950;
}

.building-automation-card-head strong {
  color: #08786c;
  font-size: 24px;
  line-height: 1;
}

.building-automation-queue {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 42px;
}

.building-automation-queue-chip,
.building-automation-empty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(47, 197, 169, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #193b36;
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
}

.building-automation-queue-chip em {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 120, 108, 0.12);
  color: #08786c;
  font-style: normal;
  font-size: 13px;
}

.building-automation-empty {
  color: rgba(28, 56, 51, 0.62);
}

.building-automation-duration-card {
  --building-automation-range-progress: 50%;
}

.building-automation-hours-ticks {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.building-automation-hour-button {
  min-height: 42px;
  border: 1px solid rgba(47, 197, 169, 0.24);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  color: rgba(28, 56, 51, 0.74);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 950;
}

.building-automation-hour-button.selected {
  border-color: rgba(8, 120, 108, 0.58);
  background: linear-gradient(180deg, #19b9a8, #08786c);
  color: #fff;
  box-shadow: 0 8px 18px rgba(8, 120, 108, 0.22);
}

.building-automation-hours-range {
  width: 100%;
  height: 34px;
  margin: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.building-automation-hours-range::-webkit-slider-runnable-track {
  height: 12px;
  border: 1px solid rgba(8, 120, 108, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(90deg, #08786c 0%, #2fc5a9 var(--building-automation-range-progress), rgba(8, 120, 108, 0.14) var(--building-automation-range-progress), rgba(8, 120, 108, 0.14) 100%);
  box-shadow: inset 0 2px 4px rgba(8, 38, 34, 0.16);
}

.building-automation-hours-range::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -9px;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: #08786c;
  box-shadow: 0 6px 14px rgba(8, 64, 58, 0.24);
  appearance: none;
  -webkit-appearance: none;
}

.building-automation-hours-range::-moz-range-track {
  height: 12px;
  border: 1px solid rgba(8, 120, 108, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(90deg, #08786c 0%, #2fc5a9 var(--building-automation-range-progress), rgba(8, 120, 108, 0.14) var(--building-automation-range-progress), rgba(8, 120, 108, 0.14) 100%);
  box-shadow: inset 0 2px 4px rgba(8, 38, 34, 0.16);
}

.building-automation-hours-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: #08786c;
  box-shadow: 0 6px 14px rgba(8, 64, 58, 0.24);
}

.building-automation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.building-automation-confirm-button {
  min-width: 160px;
  border-color: rgba(8, 120, 108, 0.5);
  background: linear-gradient(180deg, #22c7b5, #08786c);
  color: #fff;
}

.building-automation-confirm-button:disabled {
  border-color: rgba(28, 56, 51, 0.12);
  background: rgba(28, 56, 51, 0.12);
  color: rgba(28, 56, 51, 0.42);
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 760px) {
  .building-production-orders-backdrop {
    padding: 10px;
  }

  .building-production-orders-modal.empty-plot-modal.building-plot-modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 20px);
  }

  .building-automation-hours-ticks {
    gap: 6px;
  }

  .building-automation-hour-button {
    min-height: 38px;
    border-radius: 14px;
    font-size: 14px;
  }

  .building-automation-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.building-production-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(237, 224, 190, 0.78);
  font-weight: 900;
  font-size: 15px;
}

.building-production-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d7caa8;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.building-production-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #2fc5a9;
}

.commercial-sales-tab {
  gap: 12px;
}

.commercial-sales-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.commercial-sales-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.building-energy-tab {
  gap: 12px;
}

.building-energy-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.building-energy-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.commercial-sales-kpis span,
.commercial-sales-metrics span,
.building-energy-kpis span {
  display: grid;
  min-width: 0;
  gap: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 8px 9px;
}

.commercial-sales-kpis em,
.commercial-sales-metrics em,
.building-energy-kpis em {
  color: rgba(237, 224, 190, 0.58);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.commercial-sales-kpis strong,
.commercial-sales-metrics strong,
.building-energy-kpis strong {
  min-width: 0;
  color: #fff6df;
  font-size: 14px;
  font-weight: 1000;
}

.commercial-sales-kpis strong {
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.building-energy-kpis strong {
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.commercial-sales-metrics strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-energy-fuel-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(250px, 1.15fr);
  gap: 12px;
  align-items: stretch;
  border: 1px solid rgba(92, 128, 121, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
}

.building-energy-fuel-copy,
.building-energy-fuel-control,
.building-energy-fuel-static {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.building-energy-fuel-copy {
  align-content: center;
}

.building-energy-fuel-copy strong {
  color: #fff6df;
  font-size: 17px;
  font-weight: 1000;
}

.building-energy-fuel-copy span,
.building-energy-fuel-control span,
.building-energy-fuel-control small,
.building-energy-fuel-static span,
.building-energy-fuel-static small {
  color: rgba(237, 224, 190, 0.68);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.building-energy-fuel-control span,
.building-energy-fuel-static span {
  color: rgba(237, 224, 190, 0.86);
  font-size: 12px;
  font-weight: 950;
}

.building-energy-fuel-select {
  min-height: 46px;
  border-radius: 10px;
  border-color: rgba(41, 196, 166, 0.38);
  background: rgba(255, 255, 255, 0.92);
  color: #173b36;
  font-weight: 950;
}

.building-energy-fuel-static {
  align-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  padding: 10px;
}

.building-energy-fuel-static strong {
  color: #fff6df;
  font-size: 15px;
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.building-energy-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.building-energy-facts div {
  display: grid;
  min-width: 0;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.052);
  padding: 10px;
}

.building-energy-facts span {
  color: rgba(237, 224, 190, 0.6);
  font-size: 12px;
  font-weight: 950;
}

.building-energy-facts strong {
  color: #fff6df;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.commercial-sales-list {
  display: grid;
  gap: 10px;
}

.commercial-sales-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(235, 224, 190, 0.16);
  border-radius: 8px;
  background: rgba(9, 18, 20, 0.74);
  padding: 10px 12px;
}

.commercial-sales-row.ready {
  border-color: rgba(47, 197, 169, 0.42);
}

.commercial-sales-row.warning {
  border-color: rgba(242, 183, 73, 0.42);
}

.commercial-sales-row.danger {
  border-color: rgba(230, 83, 71, 0.48);
}

.commercial-sales-product-tile {
  align-self: start;
  cursor: pointer;
}

.building-recipe-product.compact.commercial-sales-product-tile {
  grid-template-rows: 58px;
  width: 58px;
  min-height: 58px;
}

.building-recipe-product.compact.commercial-sales-product-tile .building-recipe-product-icon {
  height: 58px;
}

.commercial-sales-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.commercial-sales-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}

.commercial-sales-title button {
  min-width: 0;
  border: 0;
  background: none;
  color: #fff3dc;
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 1000;
  overflow: hidden;
  padding: 0;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commercial-sales-title button:hover {
  color: #7ce6cd;
}

.commercial-sales-title span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(196, 160, 93, 0.18);
  color: #e9d4a6;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
}

.commercial-sales-price-mobile-button {
  display: none;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff6df;
  cursor: pointer;
  font: inherit;
  min-width: 76px;
  padding: 6px 8px;
  text-align: left;
}

.commercial-sales-price-mobile-button em {
  display: block;
  color: rgba(237, 224, 190, 0.58);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
}

.commercial-sales-price-mobile-button strong {
  display: block;
  color: #fff6df;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1.2;
}

.commercial-sales-price-mobile-button.custom strong {
  color: #ff8e83;
}

.commercial-sales-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.commercial-sales-metrics small {
  color: rgba(216, 204, 173, 0.68);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commercial-sales-metrics .ready strong {
  color: #7ce6cd;
}

.commercial-sales-metrics .warning strong {
  color: #f2c46f;
}

.commercial-sales-metrics .danger strong {
  color: #ff8e83;
}

.commercial-sales-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.commercial-sales-footer > small {
  flex: 0 1 auto;
  min-width: 0;
  color: rgba(216, 204, 173, 0.66);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commercial-sales-price-control {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(237, 224, 190, 0.72);
  font-size: 11px;
  font-weight: 900;
  padding: 5px 6px;
}

.commercial-sales-price-control input {
  width: 76px;
  min-width: 0;
  border: 1px solid rgba(235, 224, 190, 0.18);
  border-radius: 6px;
  background: rgba(5, 12, 13, 0.88);
  color: #fff6df;
  font: inherit;
  font-size: 12px;
  outline: none;
  padding: 4px 5px;
}

.commercial-sales-price-control input:focus {
  border-color: rgba(124, 230, 205, 0.78);
}

.commercial-sales-price-reset {
  flex: 0 0 auto;
  border: 1px solid rgba(235, 224, 190, 0.16);
  border-radius: 7px;
  background: rgba(196, 160, 93, 0.16);
  color: #eeddb5;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 8px;
}

.commercial-sales-price-reset:hover {
  border-color: rgba(124, 230, 205, 0.56);
  color: #7ce6cd;
}

.commercial-sales-price-sheet-backdrop {
  display: none;
}

.commercial-sales-price-sheet {
  display: grid;
  gap: 10px;
  margin: 0 10px 10px;
  border: 1px solid rgba(235, 224, 190, 0.16);
  border-radius: 8px;
  background: rgba(9, 18, 20, 0.98);
  padding: 14px;
  box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.36);
}

.commercial-sales-price-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.commercial-sales-price-sheet-head strong {
  min-width: 0;
  color: #fff3dc;
  font-size: 16px;
  font-weight: 1000;
}

.commercial-sales-price-sheet-head button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(237, 224, 190, 0.78);
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
}

.commercial-sales-price-sheet p,
.commercial-sales-price-sheet small {
  margin: 0;
  color: rgba(216, 204, 173, 0.68);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.commercial-sales-price-sheet-input {
  display: grid;
  gap: 5px;
  color: rgba(237, 224, 190, 0.72);
  font-size: 11px;
  font-weight: 900;
}

.commercial-sales-price-sheet-input input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(235, 224, 190, 0.18);
  border-radius: 8px;
  background: rgba(5, 12, 13, 0.96);
  color: #fff6df;
  font: inherit;
  font-size: 16px;
  outline: none;
  padding: 9px 10px;
}

.commercial-sales-price-sheet-input input:focus {
  border-color: rgba(124, 230, 205, 0.78);
}

.commercial-sales-price-sheet-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.commercial-sales-price-sheet-actions button {
  min-width: 0;
  border: 1px solid rgba(235, 224, 190, 0.16);
  border-radius: 8px;
  background: rgba(196, 160, 93, 0.16);
  color: #eeddb5;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 10px;
}

.commercial-sales-price-sheet-actions button.primary {
  border-color: rgba(124, 230, 205, 0.24);
  background: rgba(66, 109, 154, 0.84);
  color: #fff6df;
}

.building-recipe-list {
  display: grid;
  gap: 10px;
}

.building-recipe-card {
  display: grid;
  gap: 0;
  padding: 9px 10px;
  border: 1px solid rgba(235, 224, 190, 0.16);
  border-radius: 8px;
  background: rgba(9, 18, 20, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.building-recipe-card:hover {
  border-color: rgba(47, 197, 169, 0.48);
  background: rgba(12, 28, 30, 0.86);
}

.building-recipe-card.selected {
  border-color: rgba(47, 197, 169, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(47, 197, 169, 0.16),
    0 0 0 1px rgba(47, 197, 169, 0.1);
}

.building-recipe-card.expanded {
  background: rgba(10, 24, 25, 0.9);
}

.building-recipe-card.blocked {
  opacity: 0.76;
}

.building-recipe-flow {
  display: grid;
  grid-template-columns: minmax(188px, 1fr) 64px 76px 64px;
  align-items: start;
  column-gap: 10px;
  row-gap: 8px;
  min-width: 0;
}

.building-recipe-side,
.building-recipe-technology-cell,
.building-recipe-time-cell {
  min-width: 0;
}

.building-recipe-side {
  display: grid;
  align-content: start;
  gap: 6px;
}

.building-recipe-side > span,
.building-recipe-technology-cell > span,
.building-recipe-time-cell > span {
  color: rgba(237, 224, 190, 0.56);
  font-weight: 800;
  font-size: 12px;
}

.building-recipe-side.output {
  text-align: right;
}

.building-recipe-items {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.building-recipe-side.output .building-recipe-items {
  justify-content: flex-end;
}

.building-recipe-product {
  position: relative;
  display: grid;
  grid-template-rows: 38px auto auto;
  justify-items: center;
  gap: 3px;
  width: 68px;
  min-height: 84px;
  padding: 7px 5px 5px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  background: rgba(255, 253, 247, 0.08);
  color: #fff6df;
  font: inherit;
  cursor: default;
}

.building-recipe-product.compact {
  grid-template-rows: 48px 18px;
  gap: 0;
  width: 58px;
  min-height: 66px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none !important;
  appearance: none;
  overflow: hidden;
}

button.building-recipe-product.compact {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  outline: 0;
}

button.building-recipe-product.compact:hover,
button.building-recipe-product.compact:focus,
button.building-recipe-product.compact:focus-visible {
  border: 0 !important;
  outline: 0;
  box-shadow: none !important;
}

button.building-recipe-product {
  cursor: pointer;
}

button.building-recipe-product:hover {
  border-color: rgba(47, 197, 169, 0.5);
}

.building-recipe-product.missing {
  background: rgba(176, 48, 48, 0.16);
  border-color: rgba(238, 109, 98, 0.34);
}

.building-recipe-product-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: rgba(255, 253, 247, 0.88);
  color: #21302f;
  font-size: 21px;
  font-weight: 1000;
  overflow: hidden;
}

.building-recipe-product.compact .building-recipe-product-icon {
  width: 100%;
  height: 48px;
  border-radius: 0;
  background: transparent;
}

.building-recipe-product-icon .product-icon-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.building-recipe-product.compact .product-icon-image {
  width: 100%;
  height: 100%;
}

.building-recipe-product strong {
  max-width: 100%;
  color: #fff6df;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.building-recipe-product.compact strong {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 18px;
  padding: 0 2px;
  background: rgba(9, 18, 20, 0.78);
  color: #fff3dc;
  font-size: 10px;
  line-height: 1.15;
}

.building-recipe-product em {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 22px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 246, 223, 0.18);
  color: #fff6df;
  font-size: 12px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1.25;
}

.building-recipe-product.compact em {
  top: 0;
  right: 0;
  min-width: 20px;
  padding: 2px 4px;
  border-radius: 0 0 0 4px;
  background: rgba(42, 45, 43, 0.72);
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
}

.building-recipe-product small {
  max-width: 100%;
  color: rgba(237, 224, 190, 0.66);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.building-recipe-product.compact small {
  display: none;
}

.building-recipe-technology-cell,
.building-recipe-time-cell {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.building-recipe-tech-tile {
  position: relative;
  display: grid;
  grid-template-rows: 48px 18px;
  justify-items: center;
  width: 58px;
  min-height: 66px;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: rgba(255, 253, 247, 0.92);
  color: #fff6df;
}

.building-recipe-tech-tile strong {
  display: grid;
  place-items: center;
  width: 100%;
  height: 48px;
  overflow: hidden;
}

.building-recipe-tech-tile .technology-industry-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.building-recipe-tech-tile em {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 20px;
  padding: 2px 4px;
  border-radius: 0 0 0 4px;
  background: #d9a33b;
  color: #fff7e8;
  font-size: 11px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
}

.building-recipe-tech-tile small {
  box-sizing: border-box;
  width: 100%;
  padding: 2px 2px 3px;
  background: rgba(9, 18, 20, 0.78);
  color: #fff6df;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-recipe-tech-empty {
  display: grid;
  place-items: center;
  width: 58px;
  min-height: 66px;
  border: 1px dashed rgba(237, 224, 190, 0.18);
  border-radius: 3px;
  color: rgba(237, 224, 190, 0.68);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.building-recipe-time-cell strong {
  display: grid;
  min-height: 66px;
  place-items: center;
  color: #8de0cf;
  font-size: 17px;
  font-weight: 1000;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.building-recipe-duration {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.building-recipe-duration span {
  display: block;
  white-space: nowrap;
}

.building-recipe-duration.placeholder {
  color: rgba(237, 224, 190, 0.64);
  font-size: 13px;
}

.building-recipe-reasons {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(245, 82, 74, 0.1);
  color: #ffb1aa;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.building-recipe-actions {
  display: flex;
  justify-content: flex-end;
}

.building-recipe-actions button {
  min-width: 112px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid rgba(47, 197, 169, 0.48);
  border-radius: 7px;
  background: #117f73;
  color: #fff6df;
  font-weight: 1000;
}

.building-recipe-actions button:disabled {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(237, 224, 190, 0.42);
}

.building-recipe-no-items {
  display: grid;
  place-items: center;
  width: 68px;
  min-height: 84px;
  border: 1px dashed rgba(237, 224, 190, 0.18);
  border-radius: 6px;
  color: rgba(237, 224, 190, 0.56);
  font-weight: 900;
}

.building-recipe-empty {
  border: 1px dashed rgba(237, 224, 190, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 560px) {
  .building-recipe-card {
    padding: 8px;
  }

  .building-recipe-flow {
    grid-template-columns: minmax(96px, 1fr) 30px 42px 30px;
    column-gap: 5px;
  }

  .building-recipe-items {
    gap: 3px;
  }

  .building-recipe-product.compact,
  .building-recipe-tech-tile,
  .building-recipe-tech-empty {
    width: 30px;
    min-height: 42px;
  }

  .building-recipe-product.compact,
  .building-recipe-tech-tile {
    grid-template-rows: 30px 12px;
  }

  .building-recipe-product.compact .building-recipe-product-icon,
  .building-recipe-tech-tile strong {
    height: 30px;
  }

  .building-recipe-product.compact strong,
  .building-recipe-tech-tile small {
    font-size: 7px;
  }

  .building-recipe-product.compact strong {
    height: 12px;
    padding: 0 1px;
  }

  .building-recipe-time-cell strong {
    min-height: 42px;
    font-size: 11px;
  }

  .building-recipe-product.compact em,
  .building-recipe-tech-tile em {
    min-width: 14px;
    padding: 1px 3px;
    font-size: 8px;
  }

  .building-recipe-detail-asset {
    grid-template-rows: 30px 12px;
    width: 30px;
    min-height: 42px;
  }

  .building-recipe-detail-asset strong {
    height: 30px;
  }

  .building-recipe-detail-asset small {
    height: 12px;
    padding: 0 1px;
    font-size: 7px;
  }

  .building-recipe-detail-asset em {
    min-width: 14px;
    padding: 1px 3px;
    font-size: 8px;
  }

  .commercial-sales-section-head,
  .commercial-sales-title {
    display: grid;
  }

  .commercial-sales-kpis,
  .commercial-sales-metrics,
  .building-energy-kpis,
  .building-energy-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .building-energy-fuel-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .commercial-sales-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .commercial-sales-title {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px 8px;
  }

  .commercial-sales-title button:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .commercial-sales-title span {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  .commercial-sales-price-mobile-button {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: block;
  }

  .commercial-sales-price-desktop {
    display: none;
  }

  .building-recipe-product.compact.commercial-sales-product-tile {
    grid-template-rows: 52px;
    width: 52px;
    min-height: 52px;
  }

  .building-recipe-product.compact.commercial-sales-product-tile .building-recipe-product-icon {
    height: 52px;
  }

  .commercial-sales-price-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 132;
    display: grid;
    align-items: end;
    background: rgba(2, 8, 9, 0.52);
  }
}

.building-recipe-detail {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(237, 224, 190, 0.12);
  cursor: default;
}

.building-recipe-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.building-recipe-detail-stats span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.building-recipe-detail-stats em,
.building-recipe-detail-products > span,
.building-recipe-detail-time span {
  color: rgba(237, 224, 190, 0.56);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.building-recipe-detail-stats strong,
.building-recipe-detail-time strong {
  color: #fff6df;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1.25;
}

.building-recipe-detail-stat-assets {
  align-content: start;
}

.building-recipe-detail-assets {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.building-recipe-detail-asset {
  position: relative;
  display: grid;
  grid-template-rows: 48px 18px;
  width: 58px;
  min-height: 66px;
  overflow: hidden;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none !important;
  color: #fff3dc;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.building-recipe-detail-asset:hover {
  filter: brightness(1.06);
}

.building-recipe-detail-asset strong {
  display: grid;
  place-items: center;
  width: 100%;
  height: 48px;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #21302f;
  font-size: 18px;
  line-height: 1;
}

.building-recipe-detail-asset .product-icon-image,
.building-recipe-detail-asset .workforce-type-icon {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  box-shadow: none;
  object-fit: contain;
}

.building-recipe-detail-asset em {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 20px;
  padding: 2px 4px;
  border-radius: 0 0 0 4px;
  background: rgba(42, 45, 43, 0.72);
  color: #ffffff;
  font-size: 11px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  text-align: center;
}

.building-recipe-detail-asset small {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 18px;
  padding: 0 2px;
  background: rgba(9, 18, 20, 0.78);
  color: #fff3dc;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-recipe-detail-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px auto;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.building-recipe-detail-products,
.building-recipe-detail-time {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.building-recipe-detail-order button:not(.building-recipe-product):not(.building-recipe-detail-asset) {
  min-width: 112px;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid rgba(47, 197, 169, 0.48);
  border-radius: 7px;
  background: #117f73;
  color: #fff6df;
  font-weight: 1000;
}

.building-recipe-detail-order button:disabled {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(237, 224, 190, 0.42);
}

.building-plot-modal .plot-detail-layout {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  background: linear-gradient(180deg, rgba(246, 240, 225, 0.98), rgba(239, 232, 214, 0.99));
  overflow: visible;
}

.building-plot-modal .empty-plot-detail-tab {
  display: block;
  overflow: visible;
}

.building-plot-modal .plot-detail-visual-pane {
  min-height: 0;
  place-items: start center;
  border-right: 0;
  border-bottom: 1px solid rgba(87, 76, 55, 0.18);
  padding: 14px 16px;
}

.building-plot-modal .plot-resource-visual {
  width: min(100%, 430px);
  max-height: 330px;
  aspect-ratio: 4 / 3;
}

.building-plot-modal .plot-detail-side {
  grid-template-rows: auto auto auto;
  gap: 14px;
  padding: 16px;
}

.building-plot-modal .plot-detail-row {
  min-height: 34px;
}

.building-plot-modal .plot-remaining-empty {
  min-height: 92px;
}

.building-modal-job-list {
  display: grid;
  gap: 8px;
}

.building-skin-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.building-skin-preview-button,
.building-skin-empty {
  width: 220px;
  height: 180px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fffdf7 0%, #f2eee4 100%);
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.16),
    inset 0 0 0 1px rgba(64, 49, 30, 0.08);
}

.building-skin-preview-button {
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(50, 190, 166, 0.2);
  cursor: zoom-in;
}

.building-skin-preview-button:hover {
  border-color: rgba(50, 190, 166, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 2px rgba(50, 190, 166, 0.12);
}

.building-skin-preview {
  display: block;
  width: auto;
  height: auto;
  max-width: 92%;
  max-height: 92%;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.18));
  transform: translate(var(--skin-center-shift-x, 0), var(--skin-center-shift-y, 0)) scale(1.12);
  transform-origin: center center;
}

.building-skin-empty {
  display: grid;
  place-items: center;
  color: #7a6f5f;
  font-weight: 900;
}

.building-skin-current {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.building-skin-current span,
.building-skin-option small {
  color: rgba(237, 224, 190, 0.74);
  font-weight: 800;
}

.building-skin-current strong {
  color: #fff6df;
  font-size: 28px;
  line-height: 1.1;
}

.building-skin-current small {
  max-width: 520px;
  color: rgba(237, 224, 190, 0.7);
  font-weight: 800;
  line-height: 1.45;
}

.building-skin-list {
  display: grid;
  gap: 10px;
}

.building-skin-option {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) minmax(82px, auto);
  align-items: center;
  gap: 12px;
  min-height: 104px;
  padding: 10px;
  border: 1px solid rgba(236, 220, 180, 0.16);
  border-radius: 8px;
  background: rgba(13, 18, 20, 0.72);
}

.building-skin-option.owned {
  border-color: rgba(50, 190, 166, 0.34);
}

.building-skin-option.ready {
  border-color: rgba(214, 183, 107, 0.46);
}

.building-skin-option.gem-locked {
  border-color: rgba(122, 170, 226, 0.32);
}

.building-skin-option.locked {
  opacity: 0.62;
}

.building-skin-image-button {
  display: grid;
  place-items: center;
  width: 96px;
  height: 82px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid rgba(64, 49, 30, 0.1);
  border-radius: 6px;
  background:
    linear-gradient(180deg, #fffdf7 0%, #f2eee4 100%);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  cursor: zoom-in;
}

.building-skin-image-button:hover {
  border-color: rgba(50, 190, 166, 0.62);
  box-shadow: 0 0 0 2px rgba(50, 190, 166, 0.1);
}

.building-skin-image-button img {
  display: block;
  width: auto;
  height: auto;
  max-width: 96%;
  max-height: 96%;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.16));
  transform: translate(var(--skin-center-shift-x, 0), var(--skin-center-shift-y, 0)) scale(1.28);
  transform-origin: center center;
}

.building-skin-option-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.building-skin-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.building-skin-option-head strong {
  min-width: 0;
  overflow: hidden;
  color: #fff6df;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-skin-option-head span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(237, 224, 190, 0.12);
  color: rgba(237, 224, 190, 0.88);
  font-size: 12px;
  font-weight: 900;
}

body[data-page="island"] .building-skin-lightbox-backdrop {
  position: fixed;
  z-index: 6240;
  top: var(--global-topbar-height);
  right: 0;
  bottom: var(--global-bottom-nav-reserve);
  left: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 13, 18, 0.7);
  backdrop-filter: blur(6px);
}

body[data-page="island"] .building-skin-lightbox {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(720px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 28px));
  overflow: hidden;
  border: 1px solid rgba(50, 190, 166, 0.28);
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 0%, rgba(50, 190, 166, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(18, 25, 26, 0.98), rgba(6, 11, 12, 0.98));
  box-shadow: 0 28px 76px rgba(0, 7, 10, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #f8edd3;
}

body[data-page="island"] .building-skin-lightbox-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  background: rgba(8, 12, 13, 0.72);
  color: #f7ead0;
  font-size: 28px;
  line-height: 1;
}

body[data-page="island"] .building-skin-lightbox-image-wrap {
  display: grid;
  place-items: center;
  min-height: min(58vh, 520px);
  padding: 34px 28px 22px;
  background:
    linear-gradient(180deg, #fffdf7 0%, #f3eee4 100%);
  box-shadow: inset 0 -1px 0 rgba(64, 49, 30, 0.08);
}

body[data-page="island"] .building-skin-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(54vh, 500px);
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.18));
  transform: translate(var(--skin-center-shift-x, 0), var(--skin-center-shift-y, 0)) scale(1.06);
  transform-origin: center center;
}

body[data-page="island"] .building-skin-lightbox-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 16px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-page="island"] .building-skin-lightbox-footer div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body[data-page="island"] .building-skin-lightbox-footer span,
body[data-page="island"] .building-skin-lightbox-footer small {
  color: rgba(237, 224, 190, 0.74);
  font-weight: 800;
}

body[data-page="island"] .building-skin-lightbox-footer strong {
  overflow: hidden;
  color: #fff6df;
  font-size: 22px;
  line-height: 1.14;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .building-skin-lightbox-footer small {
  text-align: right;
}

@media (max-width: 560px) {
  body[data-page="island"] .building-skin-lightbox-footer {
    grid-template-columns: 1fr;
    align-items: start;
  }

  body[data-page="island"] .building-skin-lightbox-footer small {
    text-align: left;
  }
}

@media (max-width: 1350px) {
  .empty-plot-build-row {
    grid-template-columns: 460px minmax(0, 1fr);
    gap: 20px;
    min-height: 292px;
  }

  .empty-plot-building-main {
    grid-template-columns: 330px 104px;
    gap: 18px;
  }

  .empty-plot-building-card {
    grid-template-rows: 210px 56px;
    width: 330px;
  }

  .empty-plot-build-row .building-thumb {
    height: 210px;
  }

  .empty-plot-build-side {
    height: 266px;
  }

  .empty-plot-requirements {
    grid-template-rows: 110px 110px;
    gap: 46px;
    height: 266px;
  }

  .empty-plot-requirement-group {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px;
  }

  .empty-plot-requirement-label {
    width: auto;
    min-width: 84px;
    min-height: 32px;
  }

  .empty-plot-building-title {
    font-size: 22px;
  }

  .empty-plot-build-row .build-asset-frame {
    width: 96px;
    height: 110px;
  }

  .empty-plot-build-row .empty-plot-cost-tile.build-asset-tile strong {
    height: 76px;
  }

  .empty-plot-requirement-tiles {
    grid-template-columns: repeat(auto-fill, minmax(96px, 96px));
    gap: 12px 14px;
  }

  .empty-plot-requirement-action-row {
    grid-template-columns: minmax(0, 1fr) 224px;
    gap: 24px;
  }

  .empty-plot-build-button {
    justify-self: stretch;
    width: 100%;
    min-height: 110px;
  }
}

@media (max-width: 1100px) {
  .empty-plot-modal {
    left: 50%;
    width: calc(100vw - 32px);
  }

  .empty-plot-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .empty-plot-type-select {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .empty-plot-tier-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .empty-plot-build-row {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .empty-plot-building-main {
    grid-template-columns: minmax(260px, 376px) 118px;
    align-items: start;
  }

  .empty-plot-building-card {
    grid-template-rows: 220px 58px;
    width: min(376px, 100%);
  }

  .empty-plot-build-row .building-thumb {
    height: 220px;
  }

  .empty-plot-building-title {
    font-size: 22px;
  }

  .empty-plot-build-side {
    height: auto;
    padding-top: 0;
  }

  .empty-plot-requirements {
    grid-template-rows: none;
    height: auto;
    gap: 24px;
  }

  .empty-plot-requirement-action-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .empty-plot-requirement-group,
  .material-requirement-group,
  .workforce-requirement-group {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .empty-plot-build-button {
    justify-self: stretch;
    width: 100%;
    min-height: 86px;
  }

  .empty-plot-costs {
    justify-content: flex-start;
    max-width: none;
  }

  .plot-detail-layout {
    grid-template-columns: 1fr;
  }

  .plot-detail-visual-pane {
    min-height: 340px;
    border-right: 0;
    border-bottom: 1px solid rgba(87, 76, 55, 0.18);
  }

  .plot-resource-visual {
    width: min(100%, 520px, calc((100vh - 300px) * 0.75));
    max-height: calc(100vh - 300px);
  }

  .plot-resource-visual.layout-two,
  .plot-resource-visual.layout-three {
    width: min(100%, 780px, calc((100vh - 300px) * 1.5));
  }

  .plot-resource-visual.layout-three {
    width: min(100%, 780px, calc((100vh - 300px) * 2.25));
  }

  .plot-detail-side {
    grid-template-rows: auto auto auto;
  }

  .building-modal-status-layout,
  .building-skin-card {
    grid-template-columns: 1fr;
  }

  .building-skin-option {
    grid-template-columns: minmax(0, 1fr);
  }

  .building-skin-option > button:last-child {
    grid-column: 1 / -1;
  }

  .building-skin-image-button {
    width: 78px;
    height: 68px;
  }

  .building-modal-info-grid,
  .building-modal-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plot {
  min-height: 210px;
  padding: 14px;
}

.plot-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.plot-title {
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e8f1f0;
  color: #0f6b66;
  font-size: 12px;
  padding: 4px 8px;
}

.muted {
  color: #60727a;
}

.actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.build-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.build-type-tabs button {
  background: #f4f7f7;
  border: 1px solid #dbe4e7;
  color: #40535b;
  padding: 7px 10px;
}

.build-type-tabs button.selected {
  background: #0f6b66;
  border-color: #0f6b66;
  color: #ffffff;
}

.recipe-preview {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  background: #f8fbfb;
  padding: 12px;
}

.recipe-preview-title,
.recipe-checks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.recipe-preview-title span,
.recipe-column-title,
.recipe-item small {
  color: #60727a;
  font-size: 13px;
}

.recipe-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.recipe-column-title {
  margin-bottom: 6px;
}

.recipe-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #edf2f3;
  padding: 6px 0;
}

.recipe-item-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.recipe-item-button:hover span {
  color: #0f6b66;
}

.recipe-item:last-child {
  border-bottom: 0;
}

.check-ok,
.check-bad {
  border-radius: 999px;
  font-size: 12px;
  padding: 4px 8px;
}

.check-ok {
  background: #e7f4ed;
  color: #17633a;
}

.check-bad {
  background: #fdecec;
  color: #b42318;
}

.block-reasons {
  display: grid;
  gap: 6px;
  border: 1px solid #f0c6c2;
  border-radius: 8px;
  background: #fff7f6;
  color: #9f1c12;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px;
}

.operation-preview {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.operation-card {
  display: grid;
  gap: 6px;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px;
}

.market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #e7eef1;
  padding: 8px 0;
}

.market-row:first-of-type {
  border-top: 0;
}

.market-row small {
  display: block;
  color: #6d8390;
  line-height: 1.4;
  margin-top: 2px;
}

.right-align {
  text-align: right;
  color: #0b2b3a;
  font-weight: 700;
}

.empty-text {
  color: #6d8390;
  font-size: 14px;
  padding: 8px 0;
}

.form-row {
  display: grid;
  gap: 6px;
  color: #526b78;
  font-size: 14px;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
}

.form-row textarea {
  border: 1px solid #c8d4d8;
  border-radius: 6px;
  font: inherit;
  line-height: 1.5;
  padding: 8px;
  resize: vertical;
}

.form-hint {
  color: #60727a;
  font-size: 12px;
  line-height: 1.5;
}

.player-profile-header {
  align-items: center;
  display: flex;
  gap: 12px;
}

.player-profile-header div:last-child {
  display: grid;
  gap: 3px;
}

.player-profile-header span {
  color: #60727a;
  font-size: 13px;
}

.player-introduction {
  background: #f7faf9;
  border: 1px solid #edf2f3;
  border-radius: 6px;
  color: #344b52;
  line-height: 1.6;
  min-height: 54px;
  overflow-wrap: anywhere;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.player-avatar {
  align-items: center;
  background: linear-gradient(135deg, #f4efe4, #d7c29a);
  border: 1px solid rgba(117, 91, 47, 0.26);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(32, 40, 48, 0.12);
  color: #18313a;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 800;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.player-avatar.player-avatar-character {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.88), transparent 34%),
    linear-gradient(145deg, rgba(241, 248, 247, 0.92), rgba(202, 220, 218, 0.58));
  overflow: hidden;
  padding: 0;
}

.player-avatar.player-avatar-character img {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  width: 100%;
}

.player-avatar.player-avatar-upload {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.88), transparent 34%),
    linear-gradient(145deg, rgba(241, 248, 247, 0.92), rgba(202, 220, 218, 0.58));
  overflow: hidden;
  padding: 0;
}

.player-avatar.player-avatar-upload img {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.player-avatar.player-avatar-nation {
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.9), transparent 38%),
    linear-gradient(145deg, rgba(246, 242, 225, 0.95), rgba(206, 221, 217, 0.72));
  border-color: rgba(42, 117, 126, 0.26);
  overflow: hidden;
  padding: 6px;
}

.player-avatar.player-avatar-nation img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.avatar-picker {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.avatar-option {
  background: white;
  border-color: #c8d4d8;
  color: #1d343c;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 70px;
}

.avatar-option span {
  align-items: center;
  background: #eef5f2;
  border-radius: 50%;
  color: #0f6b66;
  display: inline-flex;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.avatar-option small {
  font-size: 12px;
}

.avatar-option.selected {
  border-color: #0f6b66;
  box-shadow: inset 0 0 0 1px #0f6b66;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wide-card {
  grid-column: 1 / -1;
}

.player-island-stat-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.player-island-stat {
  align-items: center;
  border-top: 1px solid #edf2f3;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-top: 10px;
}

.player-island-stat div {
  display: grid;
  gap: 3px;
}

.player-island-stat .player-island-stat-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.player-island-stat span {
  color: #60727a;
  font-size: 13px;
}

.player-link {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.player-link:hover strong,
.player-link:hover {
  color: #0f6b66;
}

.inline-player-link {
  display: inline;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(15, 107, 102, 0.28);
  text-underline-offset: 3px;
}

.player-directory-toolbar {
  align-items: end;
  background: #ffffff;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 0.8fr) auto;
  margin-bottom: 12px;
  padding: 12px;
}

.player-directory-actions {
  display: flex;
  gap: 8px;
}

.player-directory-summary {
  align-items: center;
  color: #60727a;
  display: flex;
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.player-directory-summary strong {
  color: #9f1c12;
}

.player-directory-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.player-directory-card {
  background: #ffffff;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(22, 39, 46, 0.06);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.player-directory-card-head {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.player-directory-card-head div:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.player-directory-card-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-directory-card-head span {
  color: #60727a;
  font-size: 13px;
}

.player-directory-meta {
  display: grid;
  gap: 6px;
}

.compact-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.operation-reasons {
  display: grid;
  gap: 4px;
  color: #9f1c12;
  font-size: 13px;
  line-height: 1.5;
}

#technologyPage > section > h2 {
  display: none;
}

.technology-console {
  display: grid;
  gap: 18px;
  color: #f5efe0;
}

.research-command-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(360px, 1fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.research-command-panel,
.research-data-panel,
.research-reset-panel,
.technology-branch {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #222421;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 32px rgba(20, 25, 24, 0.18);
}

.technology-branch.industry-surface,
.encyclopedia-hero.industry-surface {
  border-color: var(--industry-border, rgba(255, 255, 255, 0.08));
  background:
    linear-gradient(135deg, var(--industry-surface, rgba(143, 150, 144, 0.08)), rgba(34, 36, 33, 0) 38%),
    #222421;
}

.research-command-panel,
.research-data-panel,
.research-reset-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 168px;
  padding: 18px;
}

.research-panel-title,
.technology-branch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.research-panel-title strong,
.technology-branch-header strong {
  color: #fff8e8;
  font-size: 18px;
  letter-spacing: 0;
}

.research-panel-title span,
.technology-branch-header span {
  color: #a7a296;
  font-size: 13px;
  font-weight: 800;
}

.technology-branch-header .industry-chip {
  min-height: 26px;
  border-radius: 999px;
  color: var(--industry-text, #d6d0c2);
  font-size: 12px;
  padding: 4px 10px;
}

.research-token-row {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 5px;
}

.research-tech-token {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 0;
  background: #50504d;
  color: #fff8e8;
  overflow: hidden;
  padding: 0;
}

.research-tech-token.industry-token {
  border-color: var(--industry-border, rgba(255, 255, 255, 0.08));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.06)),
    var(--industry-soft, #50504d);
  box-shadow:
    inset 0 -4px 0 var(--industry-color, #8f9690),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.research-tech-token i {
  display: block;
  width: 100%;
  height: 100%;
  font-style: normal;
  font-weight: 900;
  font-size: 20px;
}

.research-tech-token b {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  border-radius: 0 0 0 3px;
  background: rgba(27, 29, 27, 0.72);
  color: #fffdf3;
  font-size: 12px;
  line-height: 1;
  padding: 3px 5px 4px;
  text-align: right;
  z-index: 1;
}

.technology-industry-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.research-point-summary,
.research-exchange-summary,
.research-reset-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.research-exchange-summary,
.research-reset-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.research-point-summary span,
.research-exchange-summary span,
.research-reset-summary span {
  display: grid;
  gap: 3px;
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: #1b1d1b;
  padding: 10px 12px;
}

.research-point-summary b,
.research-exchange-summary b,
.research-reset-summary b {
  color: #fff8e8;
  font-size: 22px;
  line-height: 1;
}

.research-point-summary small,
.research-exchange-summary small,
.research-reset-summary small {
  color: #8f8a7e;
  font-size: 12px;
  font-weight: 800;
}

.research-cost-list {
  display: grid;
  gap: 8px;
}

.research-cost-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: #171917;
  color: #fff8e8;
  padding: 8px 10px;
  text-align: left;
}

.research-cost-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #333531;
  color: #f0c35d;
  font-weight: 900;
}

.research-cost-row.missing {
  opacity: 0.55;
}

.research-cost-name {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.research-cost-name strong {
  overflow: hidden;
  color: #72b8ff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-cost-name em {
  color: #8f8a7e;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.research-cost-row b {
  color: #fff8e8;
  font-size: 17px;
}

.research-cost-progress {
  grid-column: 1 / -1;
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #343632;
}

.research-cost-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #e59a14;
}

.research-exchange-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.research-exchange-footer small {
  color: #8f8a7e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.research-exchange-button {
  min-width: 136px;
  min-height: 42px;
  border-color: rgba(73, 111, 99, 0.8);
  background: #3e6689;
  box-shadow: none;
  font-weight: 900;
}

.research-reset-impact {
  display: grid;
  gap: 7px;
}

.research-reset-impact span {
  min-height: 28px;
  border-left: 3px solid #e0a332;
  background: #1b1d1b;
  color: #c7c0b0;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

.research-reset-submit {
  min-height: 42px;
  border-color: rgba(148, 112, 71, 0.75);
  background: #7b5b3b;
  box-shadow: none;
  color: #fff8e8;
  font-weight: 900;
}

.research-empty {
  display: grid;
  place-items: center;
  min-height: 64px;
  color: #6f6f6a;
  font-size: 18px;
  font-weight: 800;
}

.research-empty.large {
  min-height: 96px;
  font-size: 22px;
}

.technology-branch-list {
  display: grid;
  gap: 18px;
}

.technology-branch {
  overflow: hidden;
  scroll-margin-top: calc(var(--global-topbar-height) + 16px);
}

.technology-branch-header {
  min-height: 46px;
  padding: 0 18px;
  background: #484946;
}

.technology-branch.industry-surface .technology-branch-header {
  background:
    linear-gradient(90deg, var(--industry-soft, rgba(255, 255, 255, 0.08)), rgba(72, 73, 70, 0.92) 42%),
    #484946;
}

.technology-branch-header strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.technology-branch-header i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-style: normal;
  overflow: hidden;
}

.technology-branch-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.technology-level-panel {
  position: relative;
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 142px;
  overflow: hidden;
  border-radius: 8px;
  background: #1b1d1b;
  padding: 24px;
}

.technology-ghost-icon {
  position: absolute;
  right: 26px;
  bottom: -18px;
  width: 168px;
  height: 168px;
  color: rgba(255, 255, 255, 0.025);
  font-size: 150px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.16;
  pointer-events: none;
}

.technology-ghost-icon .technology-industry-icon {
  border-radius: 12px;
  filter: saturate(0.75) contrast(0.9);
}

.technology-stat-line {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(80px, auto);
  align-items: baseline;
  gap: 14px;
  max-width: 320px;
}

.technology-stat-line span {
  color: #77756e;
  font-size: 14px;
  text-align: right;
}

.technology-stat-line strong {
  border-left: 2px solid #383a37;
  color: #fff8e8;
  font-size: 22px;
  padding-left: 14px;
}

.technology-cost-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 4px;
}

.technology-point-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  gap: 7px;
  padding: 0 12px;
  background: #e0a332;
  color: #fff8e8;
  font-weight: 900;
}

.technology-point-chip i {
  color: #8bd1ec;
  font-style: normal;
}

.technology-start-button {
  min-height: 36px;
  border: 0;
  border-radius: 0 6px 6px 0;
  background: #3e6689;
  color: #cfd8df;
  padding: 0 26px;
  font-weight: 900;
}

.technology-level-panel.next small {
  color: #837f75;
  font-weight: 800;
}

.technology-level-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  align-items: stretch;
  gap: 8px;
  padding: 0 18px 18px;
}

.technology-level-tile,
.technology-level-gap {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 112px;
  border: 2px solid #191b19;
  background: #464743;
  color: #fff8e8;
  padding: 8px 8px 10px 44px;
}

.technology-level-gap {
  align-content: center;
  min-height: 82px;
  padding: 12px;
  border-style: dashed;
  background: #30322f;
}

.technology-level-tile b {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  place-items: center;
  width: 34px;
  background: #3e5d7a;
  font-size: 18px;
}

.technology-level-bonus {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 5px;
  min-height: 24px;
  border-radius: 5px;
  background: #171917;
  padding: 2px 8px;
  font-weight: 900;
}

.technology-level-bonus i {
  font-style: normal;
}

.technology-level-tile.researched {
  border-color: rgba(111, 181, 133, 0.45);
}

.technology-level-tile.next {
  border-color: #e0a332;
}

.technology-level-tile.locked {
  opacity: 0.72;
}

.technology-level-tile.unlock-detail-trigger {
  cursor: pointer;
}

.technology-level-tile.unlock-detail-trigger:hover,
.technology-level-tile.selected-detail {
  border-color: #e0a332;
  box-shadow: inset 0 0 0 1px rgba(224, 163, 50, 0.28);
}

.technology-level-tile.selected-detail::after {
  content: "";
  position: absolute;
  right: 50%;
  bottom: -10px;
  width: 18px;
  height: 18px;
  background: #3f403d;
  border-right: 2px solid #191b19;
  border-bottom: 2px solid #191b19;
  transform: translateX(50%) rotate(45deg);
}

.technology-level-gap strong {
  color: #d8cfb9;
  font-size: 17px;
}

.technology-level-gap span {
  justify-self: start;
  border-radius: 999px;
  background: #171917;
  color: #9d978a;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.technology-unlock-row {
  display: grid;
  align-content: start;
  gap: 5px;
}

.technology-unlock-chip {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 28px;
  border: 0;
  border-radius: 5px;
  background: #252724;
  color: #f0c35d;
  padding: 3px 7px 3px 3px;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.technology-unlock-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.technology-unlock-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #f0c35d;
  line-height: 1.25;
}

.technology-unlock-empty {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 5px;
  background: #252724;
  color: #9d978a;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
}

.technology-unlock-icon .product-icon-image,
.research-cost-icon .product-icon-image {
  width: 20px;
  height: 20px;
}

.technology-level-detail {
  margin: -2px 18px 18px;
  overflow: hidden;
  border: 2px solid #191b19;
  border-radius: 0 0 8px 8px;
  background: #30302d;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26);
}

.technology-level-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  background: #484946;
}

.technology-level-detail-head strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff8e8;
  font-size: 18px;
}

.technology-level-detail-head i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-style: normal;
}

.technology-level-detail-head button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b7b2a8;
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  padding: 0;
}

.technology-level-detail-head button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff8e8;
}

.technology-level-detail-body {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.technology-detail-speed {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  min-height: 120px;
  background: #1b1d1b;
  color: #fff8e8;
  padding: 16px;
}

.technology-detail-speed strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 24px;
}

.technology-detail-speed i {
  font-style: normal;
}

.technology-detail-speed span {
  color: #d8cfb9;
  font-size: 14px;
  font-weight: 800;
}

.technology-detail-content {
  display: grid;
  gap: 10px;
}

.technology-detail-recipe {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}

.technology-detail-building {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 94px;
  border: 0;
  border-radius: 0;
  background: #1b1d1b;
  color: #fff8e8;
  padding: 10px;
  text-align: center;
}

.technology-detail-building-image {
  width: 72px;
  height: 54px;
  object-fit: contain;
}

.technology-detail-building span {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.technology-detail-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.technology-detail-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}

.technology-detail-arrow {
  color: #5d605b;
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.technology-detail-item {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  min-height: 84px;
  border: 0;
  border-radius: 0;
  background: #43596f;
  color: #fff8e8;
  padding: 10px 8px 8px;
  text-align: center;
}

.technology-detail-item.output {
  background: #927047;
}

.technology-detail-item span {
  display: grid;
  place-items: center;
  min-height: 28px;
  font-size: 20px;
}

.technology-detail-item strong {
  color: #fff8e8;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.technology-detail-item em {
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 20px;
  color: #fff8e8;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.technology-detail-item .product-icon-image {
  width: 30px;
  height: 30px;
}

.technology-detail-empty {
  display: grid;
  place-items: center;
  min-height: 84px;
  background: #252724;
  color: #8f8a7e;
  font-size: 13px;
  font-weight: 900;
}

.technology-unlocked-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

@media (max-width: 1180px) {
  .research-command-grid,
  .technology-branch-main {
    grid-template-columns: 1fr;
  }

  .technology-level-track {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .technology-level-detail-body,
  .technology-detail-recipe {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .research-command-panel,
  .research-data-panel,
  .research-reset-panel,
  .technology-branch {
    border-radius: 0;
  }

  .research-token-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .technology-level-track {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .research-point-summary,
  .research-exchange-summary,
  .research-reset-summary,
  .research-exchange-footer {
    grid-template-columns: 1fr;
  }

  .technology-branch-main,
  .technology-branch-header,
  .technology-level-track,
  .technology-level-detail-body {
    padding-right: 12px;
    padding-left: 12px;
  }

  .technology-level-detail {
    margin-right: 12px;
    margin-left: 12px;
  }

  .technology-detail-flow {
    grid-template-columns: 1fr;
  }

  .technology-detail-arrow {
    transform: rotate(90deg);
  }

  .technology-stat-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .technology-stat-line span {
    text-align: left;
  }

  .technology-stat-line strong {
    border-left: 0;
    padding-left: 0;
  }
}

body.technology-modal-open {
  overflow: hidden;
}

body.encyclopedia-modal-open {
  overflow: hidden;
}

.technology-workbench-modal {
  position: fixed;
  z-index: var(--global-workbench-modal-z);
  top: var(--global-topbar-height);
  right: 0;
  bottom: var(--global-bottom-nav-reserve);
  left: 0;
  display: grid;
  align-items: center;
  justify-content: center;
  padding: 14px 18px 10px;
  background:
    radial-gradient(circle at 18% 12%, rgba(89, 134, 156, 0.24), transparent 34%),
    radial-gradient(circle at 80% 20%, rgba(224, 163, 50, 0.13), transparent 32%),
    rgba(5, 8, 10, 0.82);
  backdrop-filter: blur(12px);
}

.technology-workbench-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1560px, calc(100vw - 36px));
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(214, 185, 123, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.055), rgba(255, 248, 232, 0) 42%),
    #111417;
  box-shadow: 0 38px 110px rgba(0, 0, 0, 0.58);
  color: #f5efe0;
}

.technology-workbench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(214, 185, 123, 0.22);
  background:
    linear-gradient(90deg, rgba(62, 102, 137, 0.28), rgba(224, 163, 50, 0.1)),
    rgba(18, 21, 20, 0.94);
}

.technology-workbench-head span {
  display: block;
  margin-bottom: 6px;
  color: #e0a332;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.technology-workbench-head h2 {
  margin: 0;
  color: #fff8e8;
  font-family: var(--apple-china-font);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  line-height: 1;
}

.technology-workbench-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: stretch;
  max-width: min(720px, 58vw);
  margin-left: auto;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(214, 185, 123, 0.34);
  background: rgba(5, 8, 10, 0.34);
}

.technology-workbench-tab {
  min-width: 118px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid rgba(214, 185, 123, 0.22);
  border-radius: 0;
  background: transparent;
  color: rgba(255, 248, 232, 0.7);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.technology-workbench-tab:last-child {
  border-right: 0;
}

.technology-workbench-tab:hover {
  background: rgba(255, 248, 232, 0.06);
  color: #fff8e8;
}

.technology-workbench-tab.selected {
  background:
    linear-gradient(145deg, rgba(224, 163, 50, 0.24), rgba(255, 248, 232, 0.05)),
    rgba(224, 163, 50, 0.12);
  color: #fff8e8;
}

.technology-workbench-close {
  display: grid;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(214, 185, 123, 0.42);
  border-radius: 0;
  background: rgba(5, 8, 10, 0.5);
  color: #fff8e8;
  font-size: 28px;
  line-height: 1;
}

.technology-workbench-close:hover {
  border-color: rgba(224, 163, 50, 0.9);
  background: rgba(224, 163, 50, 0.12);
}

.technology-workbench-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.technology-workbench-body .technology-console {
  min-height: 100%;
}

.technology-workbench-body .technology-branch {
  scroll-margin-top: 18px;
}

.technology-workbench-body .policy-doctrine-shell {
  min-height: 100%;
}

.technology-workbench-body .policy-lane-head {
  top: 18px;
}

.technology-workbench-body .policy-dossier-modal {
  z-index: 8;
  padding: 38px;
}

.technology-workbench-body .task-command-center {
  max-width: 1320px;
  margin-right: auto;
  margin-left: auto;
}

.technology-workbench-body .task-panel-header h3,
.technology-workbench-body .task-checkin-card strong {
  color: #082533;
}

@media (max-width: 760px) {
  .technology-workbench-modal {
    padding: 8px 10px;
  }

  .technology-workbench-shell {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
  }

  .technology-workbench-head {
    flex-wrap: wrap;
    min-height: 72px;
    padding: 12px 14px;
  }

  .technology-workbench-tabs {
    order: 3;
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  .technology-workbench-tab {
    flex: 1 0 auto;
    min-width: 96px;
  }

  .technology-workbench-body {
    padding: 12px;
  }

  .technology-workbench-body .policy-dossier-modal {
    padding: 12px;
  }
}

.side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.side section {
  padding: 14px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf2f3;
  padding: 8px 0;
}

.row:last-child {
  border-bottom: 0;
}

.inventory-group {
  border: 1px solid #edf2f3;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.inventory-group:last-child {
  margin-bottom: 0;
}

.inventory-group-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: #f8fbfb;
  border-bottom: 1px solid #edf2f3;
  color: #40535b;
  padding: 8px 10px;
}

.inventory-group .row {
  padding-left: 10px;
  padding-right: 10px;
}

.inventory-group small {
  color: #60727a;
  font-size: 12px;
  font-weight: 400;
}

.warehouse-page {
  display: grid;
  gap: 12px;
}

.warehouse-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 12px;
  align-items: stretch;
  border: 1px solid rgba(15, 107, 102, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 107, 102, 0.09), rgba(255, 255, 255, 0) 52%),
    #ffffff;
  padding: 18px;
}

.warehouse-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 4px;
  background: rgba(15, 107, 102, 0.1);
  color: #0f6b66;
  font-size: 12px;
  font-weight: 900;
  padding: 3px 8px;
}

.warehouse-hero h2 {
  color: #102f35;
  font-size: 28px;
  line-height: 1.15;
  margin: 10px 0 8px;
}

.warehouse-hero p {
  max-width: 680px;
  color: #60727a;
  line-height: 1.7;
  margin: 0;
}

.warehouse-capacity-card {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 128px;
  border-radius: 8px;
  background: #14373b;
  color: #e9f8f5;
  padding: 16px;
}

.warehouse-capacity-card span,
.warehouse-capacity-card em {
  color: rgba(233, 248, 245, 0.72);
  font-style: normal;
  font-weight: 800;
}

.warehouse-capacity-card strong {
  font-size: 34px;
  line-height: 1;
}

.warehouse-capacity-track,
.warehouse-island-card i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.warehouse-capacity-track i,
.warehouse-island-card b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1ca58d, #67d8c3);
}

.warehouse-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.warehouse-stat-card,
.warehouse-island-strip,
.warehouse-inventory-panel,
.warehouse-info-panel {
  border: 1px solid #dde7e9;
  border-radius: 8px;
  background: #ffffff;
}

.warehouse-stat-card {
  display: grid;
  gap: 5px;
  min-height: 84px;
  padding: 13px 14px;
}

.warehouse-stat-card span,
.warehouse-stat-card small {
  min-width: 0;
  overflow: hidden;
  color: #60727a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-stat-card strong {
  min-width: 0;
  overflow: hidden;
  color: #102f35;
  font-size: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-island-strip,
.warehouse-inventory-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.warehouse-island-strip > header,
.warehouse-inventory-panel > header,
.warehouse-category-block > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.warehouse-island-strip > header strong,
.warehouse-inventory-panel > header strong,
.warehouse-category-block > header strong,
.warehouse-info-panel strong {
  color: #102f35;
  font-size: 18px;
}

.warehouse-island-strip > header span,
.warehouse-inventory-panel > header span {
  color: #60727a;
  font-size: 13px;
  font-weight: 800;
}

.warehouse-island-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.warehouse-island-card {
  display: grid;
  gap: 5px;
  min-height: 96px;
  border: 1px solid #dde7e9;
  border-radius: 8px;
  background: #f8fbfb;
  color: #18363c;
  text-align: left;
  cursor: pointer;
  font: inherit;
  padding: 12px;
}

.warehouse-island-card.selected {
  border-color: rgba(15, 107, 102, 0.5);
  background: #e8f5f3;
}

.warehouse-island-card.pending {
  color: #60727a;
}

.warehouse-island-card span,
.warehouse-island-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-island-card span {
  color: #0f6b66;
  font-size: 12px;
  font-weight: 900;
}

.warehouse-island-card strong {
  overflow: hidden;
  color: #102f35;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.warehouse-category-block {
  display: grid;
  gap: 12px;
  border: 1px solid var(--industry-border, #dde7e9);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--industry-surface, rgba(143, 150, 144, 0.08)), rgba(255, 255, 255, 0) 44%),
    #fbfdfd;
  padding: 12px;
}

.warehouse-category-block > header span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  color: var(--industry-color, #60727a);
  font-size: 12px;
  font-weight: 900;
}

.warehouse-category-block > header em {
  color: #40535b;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.warehouse-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.warehouse-product-card {
  position: relative;
  display: grid;
  grid-template-rows: 86px 34px 20px 18px;
  gap: 4px;
  min-width: 0;
  min-height: 170px;
  overflow: hidden;
  border: 1px solid rgba(16, 47, 53, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #f8f4ec 0 86px, #172629 86px);
  color: #fff3dc;
  cursor: pointer;
  font: inherit;
  padding: 0 8px 8px;
}

.warehouse-product-card:hover {
  border-color: rgba(15, 107, 102, 0.45);
  filter: brightness(1.03);
}

.warehouse-product-icon {
  display: grid;
  place-items: center;
  height: 86px;
  color: #263533;
  font-size: 30px;
  font-weight: 1000;
}

.warehouse-product-icon .product-icon-image {
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.warehouse-product-card strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  color: #fff3dc;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
}

.warehouse-product-card em,
.warehouse-product-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-product-card em {
  color: #6dd9c5;
  font-style: normal;
  font-weight: 1000;
}

.warehouse-product-card small {
  color: #9fb0b3;
  font-size: 12px;
  font-weight: 800;
}

.warehouse-footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.warehouse-info-panel {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 16px;
}

.warehouse-info-panel p,
.warehouse-message-list {
  color: #60727a;
  line-height: 1.7;
  margin: 0;
}

.warehouse-message-list {
  display: grid;
  gap: 4px;
}

@media (max-width: 980px) {
  .warehouse-hero,
  .warehouse-footer-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .warehouse-hero,
  .warehouse-island-strip,
  .warehouse-inventory-panel {
    padding: 12px;
  }

  .warehouse-stat-grid,
  .warehouse-footer-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warehouse-inventory-panel > header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.warehouse-page-compact {
  gap: 12px;
}

.warehouse-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 2px;
}

.warehouse-toolbar h2 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  color: #0d333a;
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
}

.warehouse-toolbar h2 span {
  color: #60727a;
  font-size: 14px;
  font-weight: 900;
}

.warehouse-toolbar small {
  display: block;
  color: #60727a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 4px;
}

.warehouse-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.warehouse-island-select {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid #c9d6da;
  border-radius: 7px;
  background: #ffffff;
  color: #294a55;
  font-size: 14px;
  font-weight: 900;
  padding: 0 9px;
}

.warehouse-island-select span {
  color: #60727a;
  font-size: 12px;
  white-space: nowrap;
}

.warehouse-island-select select {
  min-width: 170px;
  border: 0;
  background: transparent;
  color: #0d333a;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  outline: 0;
  padding: 0 2px;
}

.warehouse-island-select:focus-within {
  border-color: rgba(15, 107, 102, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 107, 102, 0.1);
}

.warehouse-capacity-line {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eff1;
}

.warehouse-capacity-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f7e72, #64d3c0);
}

.warehouse-list-panel {
  display: grid;
  gap: 12px;
}

.warehouse-page-compact .warehouse-category-block {
  gap: 14px;
  border-color: var(--industry-border, #dde7e9);
  background:
    linear-gradient(135deg, var(--industry-surface, rgba(143, 150, 144, 0.08)), rgba(255, 255, 255, 0) 46%),
    #fcfdfd;
  padding: 14px 18px 18px;
}

.warehouse-page-compact .warehouse-category-block > header {
  align-items: baseline;
  min-height: 28px;
}

.warehouse-page-compact .warehouse-category-block > header div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.warehouse-page-compact .warehouse-category-block > header span {
  color: var(--industry-color, #60727a);
  font-size: 14px;
}

.warehouse-page-compact .warehouse-category-block > header strong {
  color: #0d333a;
  font-size: 22px;
  line-height: 1.1;
}

.warehouse-page-compact .warehouse-category-block > header em {
  color: #294a55;
  font-size: 20px;
  line-height: 1.1;
}

.warehouse-page-compact .warehouse-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 118px));
  gap: 14px 16px;
  align-items: start;
}

.warehouse-page-compact .warehouse-product-card {
  position: relative;
  display: grid;
  grid-template-rows: 88px 34px 20px;
  gap: 0;
  width: 100%;
  min-height: 142px;
  overflow: hidden;
  border: 1px solid rgba(16, 47, 53, 0.12);
  border-radius: 6px;
  background: #132426;
  color: #fff3dc;
  cursor: pointer;
  font: inherit;
  padding: 0;
  box-shadow: none;
}

.warehouse-page-compact .warehouse-product-card:hover {
  border-color: rgba(15, 107, 102, 0.55);
  filter: brightness(1.04);
}

.warehouse-page-compact .warehouse-product-icon {
  display: grid;
  place-items: center;
  height: 88px;
  background: #f3efe6;
  color: #263533;
  font-size: 28px;
  font-weight: 1000;
}

.warehouse-page-compact .warehouse-product-icon .product-icon-image {
  width: 104px;
  height: 104px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.warehouse-page-compact .warehouse-product-card strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  background: #132426;
  color: #fff3dc;
  font-size: 14px;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

.warehouse-page-compact .warehouse-product-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  background: #132426;
  color: #a9b9ba;
  font-size: 12px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
}

.warehouse-page-compact .warehouse-product-amount {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  max-width: 58px;
  height: 28px;
  overflow: hidden;
  background: rgba(43, 47, 45, 0.94);
  color: #fff7e6;
  font-size: 16px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  padding: 0 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .warehouse-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .warehouse-toolbar-actions {
    justify-content: flex-start;
  }

  .warehouse-island-select,
  .warehouse-island-select select {
    width: 100%;
  }

  .warehouse-page-compact .warehouse-category-block {
    padding: 12px;
  }

  .warehouse-page-compact .warehouse-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  }

  .warehouse-page-compact .warehouse-product-card {
    max-width: 118px;
  }
}

body[data-page="warehouse"] {
  background:
    linear-gradient(135deg, #061010 0%, #0d2022 42%, #171713 100%);
}

body[data-page="warehouse"] .app {
  max-width: none;
}

body[data-page="warehouse"] .island-subpage-layout {
  display: block;
}

body[data-page="warehouse"] .island-subpage-nav {
  display: none;
}

body[data-page="warehouse"] .island-subpage-content {
  width: 100%;
}

body[data-page="warehouse"] #warehousePage > section > h2 {
  display: none;
}

.warehouse-archive {
  --warehouse-bg: rgba(7, 16, 16, 0.78);
  --warehouse-panel: rgba(17, 30, 30, 0.64);
  --warehouse-panel-2: rgba(33, 43, 39, 0.56);
  --warehouse-line: rgba(255, 246, 220, 0.16);
  --warehouse-line-strong: rgba(235, 205, 127, 0.32);
  --warehouse-gold: #f1d47a;
  --warehouse-paper: rgba(247, 239, 213, 0.92);
  --warehouse-paper-2: rgba(224, 211, 174, 0.9);
  --warehouse-text: #fff6df;
  --warehouse-muted: #c8c1ad;
  min-height: calc(100vh - 126px);
  overflow: hidden;
  border: 1px solid rgba(255, 246, 220, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 42%, rgba(239, 196, 94, 0.06)),
    var(--warehouse-bg);
  background-size: 168px 168px, 168px 168px, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(22px) saturate(142%);
  color: var(--warehouse-text);
}

.warehouse-archive button,
.warehouse-archive select {
  font: inherit;
}

.warehouse-archive-top {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  min-height: 158px;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--warehouse-line-strong);
  background:
    linear-gradient(90deg, rgba(8, 19, 19, 0.9) 0%, rgba(24, 36, 34, 0.74) 34%, rgba(24, 36, 34, 0.26) 54%, rgba(62, 49, 24, 0.18) 100%),
    url("/assets/government-concepts/warehouse-hero/national_treasury_storage_banner_v2_cropped.png?v=warehouse-hero-20260612-v2") center right / cover no-repeat;
  backdrop-filter: blur(18px) saturate(135%);
}

.warehouse-archive-hero-art {
  display: none;
}

.warehouse-archive-hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.warehouse-archive-title,
.warehouse-archive-stat,
.warehouse-wallet-strip {
  min-width: 0;
  border-right: 1px solid var(--warehouse-line);
}

.warehouse-archive-title {
  border-right: 0;
  position: relative;
  z-index: 1;
}

.warehouse-archive-title {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 24px 28px;
}

.warehouse-archive-title > span,
.warehouse-main-head span,
.warehouse-dossier-head > span,
.warehouse-capacity-panel > span {
  color: var(--warehouse-gold);
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 2px;
}

.warehouse-archive-title > div:first-of-type {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.warehouse-archive-title i,
.warehouse-category-index-item i,
.warehouse-archive-product-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 231, 151, 0.5);
  border-radius: 8px;
  background: rgba(241, 212, 122, 0.88);
  color: #151510;
  font-style: normal;
  font-weight: 1000;
}

.warehouse-archive-title i {
  width: 48px;
  height: 48px;
  font-size: 21px;
}

.warehouse-archive-title h1 {
  margin: 0;
  overflow: hidden;
  color: #fff3dc;
  font-family: var(--apple-china-font);
  font-size: 50px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-archive-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.warehouse-archive-chips b,
.warehouse-archive-island-select {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(255, 246, 220, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--warehouse-gold);
  font-size: 13px;
  font-weight: 1000;
  padding: 0 12px;
  backdrop-filter: blur(14px) saturate(135%);
}

.warehouse-archive-island-select {
  background: rgba(24, 126, 132, 0.42);
  color: #eafff5;
  padding: 0;
}

.warehouse-archive-island-select select {
  min-width: 140px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 1000;
  outline: 0;
  padding: 0 10px;
}

.warehouse-archive-island-select option {
  background: #101a19;
  color: #fff3dc;
}

.warehouse-archive-stat {
  display: grid;
  align-content: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.035);
  padding: 20px 18px;
}

.warehouse-archive-stat span {
  color: var(--warehouse-gold);
  font-size: 13px;
  font-weight: 1000;
}

.warehouse-archive-stat strong {
  color: #fff3dc;
  font-size: 25px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.warehouse-archive-stat small {
  overflow: hidden;
  color: var(--warehouse-muted);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-wallet-strip {
  display: grid;
  grid-template-columns: minmax(86px, 1.2fr) minmax(72px, 0.9fr) minmax(72px, 0.9fr);
  gap: 10px;
  align-content: center;
  padding: 20px;
}

.warehouse-wallet-strip div {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(255, 246, 220, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px;
  backdrop-filter: blur(12px) saturate(130%);
}

.warehouse-wallet-strip span {
  color: #d6cba6;
  font-size: 12px;
  font-weight: 900;
}

.warehouse-wallet-strip strong {
  color: #fff3dc;
  font-size: 15px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.warehouse-archive-body {
  display: grid;
  grid-template-columns: 270px minmax(520px, 1fr) 420px;
  min-height: calc(100vh - 284px);
}

.warehouse-archive-sidebar,
.warehouse-archive-main,
.warehouse-dossier {
  min-width: 0;
}

.warehouse-archive-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
  border-right: 1px solid var(--warehouse-line);
  background: rgba(5, 14, 14, 0.58);
  padding: 22px 20px;
  backdrop-filter: blur(18px) saturate(128%);
}

.warehouse-capacity-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 246, 220, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 249, 231, 0.96), rgba(218, 199, 151, 0.82));
  color: #171611;
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.warehouse-capacity-panel h3 {
  margin: 0;
  font-family: var(--apple-china-font);
  font-size: 28px;
  line-height: 1.05;
}

.warehouse-capacity-panel div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #5f5236;
  font-size: 16px;
}

.warehouse-capacity-panel i,
.warehouse-composition i {
  display: block;
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(68, 54, 28, 0.25);
  background: rgba(31, 35, 30, 0.18);
}

.warehouse-capacity-panel b,
.warehouse-composition b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2a9d93, #f2d267, #9b3e35);
}

.warehouse-island-overview {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 246, 220, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
  backdrop-filter: blur(14px) saturate(130%);
}

.warehouse-island-overview header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 4px;
}

.warehouse-island-overview header span {
  color: var(--warehouse-gold);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 1.6px;
}

.warehouse-island-overview header strong {
  color: #fff3dc;
  font-size: 15px;
}

.warehouse-island-overview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(255, 246, 220, 0.14);
  border-radius: 8px;
  background: rgba(5, 13, 13, 0.42);
  color: var(--warehouse-text);
  cursor: pointer;
  text-align: left;
  padding: 9px 10px;
}

.warehouse-island-overview-row.selected,
.warehouse-island-overview-row:hover {
  border-color: rgba(241, 212, 122, 0.62);
  background: rgba(241, 212, 122, 0.12);
}

.warehouse-island-overview-row.warning {
  border-color: rgba(241, 212, 122, 0.34);
}

.warehouse-island-overview-row.danger {
  border-color: rgba(214, 92, 79, 0.48);
}

.warehouse-island-overview-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.warehouse-island-overview-row strong,
.warehouse-island-overview-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-island-overview-row strong {
  color: #fff3dc;
  font-size: 13px;
}

.warehouse-island-overview-row small {
  color: var(--warehouse-muted);
  font-size: 11px;
  font-weight: 900;
}

.warehouse-island-overview-row em {
  color: var(--warehouse-gold);
  font-size: 12px;
  font-style: normal;
  font-weight: 1000;
}

.warehouse-island-overview-row i {
  grid-column: 1 / -1;
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.warehouse-island-overview-row i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38b7ad, #f1d47a, #d65c4f);
}

.warehouse-category-index {
  display: grid;
  gap: 8px;
}

.warehouse-category-index-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 60px;
  border: 1px solid rgba(255, 246, 220, 0.14);
  border-radius: 8px;
  background: rgba(11, 22, 21, 0.58);
  color: var(--warehouse-text);
  cursor: pointer;
  text-align: left;
  padding: 8px 10px;
}

.warehouse-category-index-item.selected,
.warehouse-category-index-item:hover {
  border-color: rgba(241, 212, 122, 0.58);
  background: rgba(241, 212, 122, 0.12);
}

.warehouse-category-index-item i {
  width: 38px;
  height: 38px;
  font-size: 18px;
}

.warehouse-category-index-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.warehouse-category-index-item strong,
.warehouse-category-index-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-category-index-item strong {
  color: #f2d267;
  font-size: 14px;
}

.warehouse-category-index-item small {
  color: #aaa08c;
  font-size: 12px;
  font-weight: 900;
}

.warehouse-category-index-item em {
  color: #f2d267;
  font-style: normal;
  font-weight: 1000;
  white-space: nowrap;
}

.warehouse-archive-main {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  background: rgba(10, 20, 19, 0.6);
  backdrop-filter: blur(14px) saturate(124%);
}

.warehouse-main-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--warehouse-line);
  background: rgba(255, 255, 255, 0.025);
  padding: 30px 26px 24px;
}

.warehouse-main-head h2 {
  margin: 4px 0 0;
  color: #fff3dc;
  font-family: var(--apple-china-font);
  font-size: 44px;
  line-height: 1.05;
}

.warehouse-value-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
}

.warehouse-value-heading strong {
  color: var(--warehouse-gold);
  font-size: 0.78em;
  font-weight: 1000;
  white-space: nowrap;
}

.warehouse-value-heading em {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(241, 212, 122, 0.24);
  border-radius: 999px;
  background: rgba(241, 212, 122, 0.1);
  color: var(--warehouse-muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.warehouse-main-head p {
  max-width: 680px;
  margin: 0;
  color: var(--warehouse-muted);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.55;
}

.warehouse-main-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 8px;
  flex: 0 0 244px;
}

.warehouse-main-actions button {
  min-height: 48px;
  border: 1px solid rgba(241, 212, 122, 0.48);
  border-radius: 8px;
  background: rgba(241, 212, 122, 0.92);
  color: #1a1710;
  cursor: pointer;
  font-weight: 1000;
}

.warehouse-main-actions button.secondary {
  border-color: rgba(167, 231, 232, 0.26);
  background: rgba(35, 134, 140, 0.58);
  color: #fff6df;
}

.warehouse-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 22px;
}

.warehouse-archive-product-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(126px, auto) auto auto auto;
  justify-items: center;
  min-height: 244px;
  border: 1px solid rgba(255, 246, 220, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, var(--warehouse-paper), var(--warehouse-paper-2));
  color: #171611;
  cursor: pointer;
  text-align: center;
  padding: 14px 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.warehouse-archive-product-card.selected,
.warehouse-archive-product-card:hover {
  border-color: #f2d267;
  box-shadow:
    inset 0 0 0 2px rgba(242, 210, 103, 0.48),
    0 10px 28px rgba(0, 0, 0, 0.16);
}

.warehouse-archive-product-icon {
  display: grid;
  width: 100%;
  max-width: 172px;
  aspect-ratio: 1.25;
  height: auto;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  font-size: 32px;
}

.warehouse-archive-product-icon .product-icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.warehouse-archive-product-card > em {
  position: absolute;
  top: 18px;
  right: 18px;
  max-width: calc(100% - 36px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
  color: #171611;
  font-size: 15px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  padding: 6px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-archive-product-card > strong {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  font-size: 22px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-archive-product-card > small {
  color: #806c3c;
  font-size: 13px;
  font-weight: 1000;
  margin-top: 4px;
}

.warehouse-archive-product-meta {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 10px;
  width: min(150px, 100%);
  margin-top: 14px;
  border-top: 1px solid rgba(94, 77, 39, 0.18);
  color: #806c3c;
  font-size: 12px;
  font-weight: 1000;
  padding-top: 12px;
}

.warehouse-archive-empty {
  align-self: start;
  border: 1px dashed rgba(231, 199, 111, 0.28);
  color: var(--warehouse-muted);
  font-weight: 900;
  padding: 24px;
}

.warehouse-composition {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--warehouse-line);
  background: rgba(25, 31, 27, 0.52);
  padding: 18px 22px 22px;
  backdrop-filter: blur(14px) saturate(128%);
}

.warehouse-composition header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.warehouse-composition header strong {
  color: #fff3dc;
  font-size: 20px;
}

.warehouse-composition header span,
.warehouse-composition p {
  color: var(--warehouse-muted);
  font-weight: 900;
}

.warehouse-composition > div {
  display: grid;
  gap: 8px;
}

.warehouse-composition button {
  display: grid;
  grid-template-columns: 90px minmax(120px, 1fr) 96px;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: #f2d267;
  cursor: pointer;
  font-weight: 1000;
  text-align: left;
}

.warehouse-composition strong {
  justify-self: end;
  color: #fff3dc;
}

.warehouse-dossier {
  position: sticky;
  top: 86px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-self: start;
  min-height: calc(100vh - 126px);
  border-left: 1px solid var(--warehouse-line);
  background: rgba(5, 12, 12, 0.64);
  backdrop-filter: blur(18px) saturate(132%);
}

.warehouse-dossier-head {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--warehouse-line);
  background:
    linear-gradient(135deg, var(--industry-surface, rgba(143, 150, 144, 0.08)), rgba(0, 0, 0, 0) 52%),
    rgba(17, 26, 24, 0.7);
  padding: 30px 22px 22px;
}

.warehouse-dossier-head h2 {
  margin: 0;
  color: #fff3dc;
  font-family: var(--apple-china-font);
  font-size: 34px;
  line-height: 1.05;
}

.warehouse-dossier-head div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.warehouse-dossier-head b {
  border-radius: 6px;
  background: rgba(231, 199, 111, 0.88);
  color: #1a1710;
  font-size: 13px;
  padding: 7px 10px;
}

.warehouse-dossier-card {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
}

.warehouse-dossier-hero {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(255, 246, 220, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8e5, #dac89b);
  color: #171611;
  padding: 16px;
}

.warehouse-dossier-hero i {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #f4d979, #b58b39);
  color: #171611;
  font-size: 46px;
  font-style: normal;
  font-weight: 1000;
}

.warehouse-dossier-hero .product-icon-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.warehouse-dossier-hero strong {
  display: block;
  overflow: hidden;
  font-size: 26px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-dossier-hero small {
  color: #685936;
  font-size: 15px;
  font-weight: 1000;
}

.warehouse-dossier-card dl {
  display: grid;
  margin: 0;
  border-radius: 8px;
  background: #e8dcc0;
  color: #171611;
  overflow: hidden;
}

.warehouse-dossier-card dl div {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 12px;
  min-height: 46px;
  border-bottom: 1px solid rgba(76, 62, 35, 0.16);
  padding: 12px;
}

.warehouse-dossier-card dl div:last-child {
  border-bottom: 0;
}

.warehouse-dossier-card dt {
  color: #806c3c;
  font-weight: 1000;
}

.warehouse-dossier-card dd {
  min-width: 0;
  overflow: hidden;
  font-weight: 1000;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-dossier-card dl div.warehouse-dossier-market-row {
  grid-template-columns: 116px minmax(0, 1fr) 46px;
  align-items: center;
}

.warehouse-dossier-exchange-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(17, 130, 121, 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 20%, rgba(255, 255, 255, 0.7), transparent 34%),
    linear-gradient(180deg, #21b9a3, #087d72);
  color: #fffdf4;
  cursor: pointer;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    0 12px 22px rgba(8, 125, 114, 0.24);
}

.warehouse-dossier-exchange-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.42;
}

.warehouse-dossier-distribution {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 246, 220, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
}

.warehouse-dossier-distribution header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.warehouse-dossier-distribution header strong {
  color: #fff3dc;
  font-size: 16px;
}

.warehouse-dossier-distribution header span {
  color: var(--warehouse-muted);
  font-size: 12px;
  font-weight: 900;
}

.warehouse-dossier-distribution > div {
  display: grid;
  gap: 7px;
}

.warehouse-dossier-distribution-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  align-items: center;
  min-height: 52px;
  border: 1px solid rgba(255, 246, 220, 0.13);
  border-radius: 8px;
  background: rgba(4, 13, 13, 0.42);
  color: #fff3dc;
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}

.warehouse-dossier-distribution-row.selected,
.warehouse-dossier-distribution-row:hover {
  border-color: rgba(241, 212, 122, 0.6);
  background: rgba(241, 212, 122, 0.12);
}

.warehouse-dossier-distribution-row.muted {
  opacity: 0.58;
}

.warehouse-dossier-distribution-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.warehouse-dossier-distribution-row strong,
.warehouse-dossier-distribution-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-dossier-distribution-row strong {
  color: #fff3dc;
  font-size: 13px;
}

.warehouse-dossier-distribution-row small {
  color: var(--warehouse-muted);
  font-size: 11px;
  font-weight: 900;
}

.warehouse-dossier-distribution-row em {
  color: var(--warehouse-gold);
  font-style: normal;
  font-weight: 1000;
}

.warehouse-dossier-distribution-row i {
  grid-column: 1 / -1;
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.warehouse-dossier-distribution-row i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #23868c, #f1d47a);
}

.warehouse-dossier-distribution-reset {
  min-height: 34px;
  border: 1px solid rgba(255, 246, 220, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--warehouse-gold);
  cursor: pointer;
  font-weight: 1000;
}

.warehouse-dossier-empty {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 260px;
  color: var(--warehouse-muted);
  padding: 24px;
}

.warehouse-dossier-empty span {
  color: var(--warehouse-gold);
  font-weight: 1000;
  letter-spacing: 2px;
}

.warehouse-dossier-empty strong {
  color: #fff3dc;
  font-size: 28px;
}

@media (max-width: 1320px) {
  .warehouse-archive-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warehouse-archive-title {
    grid-column: 1 / -1;
  }

  .warehouse-archive-hero-art {
    grid-column: 1 / -1;
    height: clamp(118px, 12vw, 156px);
    margin: 0 18px 18px;
  }

  .warehouse-archive-body {
    grid-template-columns: 240px minmax(480px, 1fr);
  }

  .warehouse-dossier {
    position: static;
    grid-column: 1 / -1;
    min-height: 0;
    border-top: 1px solid var(--warehouse-line);
    border-left: 0;
  }
}

@media (max-width: 860px) {
  .warehouse-archive-title h1 {
    font-size: 40px;
  }

  .warehouse-archive-top,
  .warehouse-archive-body,
  .warehouse-main-head,
  .warehouse-dossier-hero {
    grid-template-columns: 1fr;
  }

  .warehouse-main-head {
    display: grid;
  }

  .warehouse-archive-hero-art {
    height: 116px;
    margin: 0 14px 14px;
  }

  .warehouse-main-actions {
    grid-template-columns: 1fr;
    flex-basis: auto;
  }

  .warehouse-archive-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--warehouse-line);
  }

  .warehouse-archive-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-composition button {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .warehouse-composition button strong {
    grid-column: 2;
    justify-self: start;
  }
}

.exchange-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.market-summary {
  margin: 10px 0 0;
}

.market-summary .stat-row {
  background: #ffffff;
  border: 1px solid #edf2f3;
  border-radius: 8px;
  padding: 8px 10px;
}

.exchange-toolbar,
.exchange-create-order {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.exchange-toolbar label {
  display: grid;
  gap: 4px;
  color: #60727a;
  font-size: 12px;
}

.exchange-toolbar select,
.exchange-create-order input {
  min-width: 180px;
}

.exchange-board {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.exchange-message {
  background: #f8fbfb;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  color: #40535b;
  display: grid;
  gap: 8px;
  line-height: 1.5;
  margin: 10px 0 12px;
  padding: 10px;
}

.exchange-order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.exchange-order-grid h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.exchange-order {
  display: grid;
  grid-template-columns: 90px 80px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #edf2f3;
  color: #40535b;
  padding: 6px 0;
}

.exchange-order strong {
  color: #0f6b66;
}

.text-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: #0f6b66;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-align: left;
}

.text-button:hover {
  text-decoration: underline;
}

.exchange-order small {
  color: #60727a;
  overflow-wrap: anywhere;
}

.exchange-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.exchange-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.exchange-section {
  background: #fbfcfc;
  border: 1px solid #edf2f3;
  border-radius: 8px;
  padding: 10px;
}

.exchange-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px repeat(4, auto);
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #edf2f3;
  padding-bottom: 8px;
}

.exchange-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.exchange-item small {
  display: block;
  color: #60727a;
  margin-top: 2px;
}

.exchange-item .exchange-shipping-preview {
  color: #0f766e;
  font-weight: 700;
  margin-top: 4px;
}

.exchange-ship-select {
  color: #60727a;
  display: grid;
  font-size: 12px;
  gap: 4px;
  margin-top: 6px;
}

.exchange-ship-select select {
  max-width: 360px;
  min-height: 34px;
}

.completed-transport strong {
  color: #17633a;
}

.arrived-transport strong,
.ship-log-row.arrived strong {
  color: #0f766e;
}

.exchange-item input {
  width: 100%;
}

@media (max-width: 860px) {
  .exchange-sections {
    grid-template-columns: 1fr;
  }

  .exchange-order-grid {
    grid-template-columns: 1fr;
  }

  .exchange-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .exchange-item input,
  .exchange-item button {
    width: 100%;
  }
}

.exchange-terminal {
  --exchange-bg: #08100f;
  --exchange-panel: #101b19;
  --exchange-panel-soft: #152320;
  --exchange-line: rgba(168, 197, 188, 0.18);
  --exchange-text: #edf6f2;
  --exchange-muted: #8ca49d;
  --exchange-green: #21c989;
  --exchange-red: #f05b66;
  --exchange-blue: #3d6f98;
  --exchange-price-neutral: #f4f1e8;
  --exchange-price-high: #e2b46d;
  --exchange-price-extreme-high: #e86f7b;
  --exchange-price-low: #a7d8b8;
  --exchange-price-extreme-low: #4fbd86;
  background: radial-gradient(circle at 30% 0%, rgba(35, 90, 84, 0.35), transparent 32%), var(--exchange-bg);
  border: 1px solid rgba(199, 217, 210, 0.14);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 18, 16, 0.22);
  color: var(--exchange-text);
  padding: 12px;
}

.exchange-terminal select,
.exchange-terminal input {
  background: #0b1514;
  border-color: rgba(168, 197, 188, 0.24);
  color: var(--exchange-text);
}

.exchange-terminal .empty-state {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(168, 197, 188, 0.14);
  color: var(--exchange-muted);
}

.exchange-desk-board {
  background: rgba(35, 35, 35, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  margin-bottom: 12px;
  overflow: hidden;
}

.exchange-desk-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(0, 2fr);
  background: linear-gradient(180deg, rgba(65, 65, 62, 0.98), rgba(45, 46, 44, 0.98));
  border-bottom: 1px solid rgba(0, 0, 0, 0.38);
}

.exchange-desk-exchange-picker {
  align-items: center;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  min-height: 58px;
  border-right: 1px solid rgba(0, 0, 0, 0.38);
  padding: 10px 14px;
}

.exchange-desk-exchange-picker span {
  color: #d7c58f;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.exchange-desk-exchange-picker select {
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(215, 197, 143, 0.28);
  border-radius: 7px;
  background: rgba(8, 16, 15, 0.74);
  color: #fff8e8;
  font-size: 17px;
  font-weight: 900;
  text-align: center;
}

.exchange-desk-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
}

.exchange-desk-tabs button {
  align-items: center;
  background: #3f3f3f;
  border: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  font-size: 21px;
  font-weight: 900;
  gap: 10px;
  justify-content: center;
  min-height: 58px;
  padding: 10px 14px;
}

.exchange-desk-tabs button:last-child {
  border-right: 0;
}

.exchange-desk-tabs button.selected {
  background: #333333;
  color: #ffffff;
}

.exchange-desk-tabs button span:first-child {
  color: #ffffff;
  font-size: 23px;
  line-height: 1;
}

.exchange-desk-cargo {
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  padding: 22px 24px 24px;
}

.exchange-desk-cargo.compact {
  gap: 18px;
  grid-template-columns: 1fr;
}

.exchange-desk-cargo-panel {
  background: rgba(11, 15, 14, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  min-width: 0;
  overflow: hidden;
  padding: 0 0 14px;
}

.exchange-desk-cargo-panel.wide {
  min-height: 260px;
}

.exchange-desk-select-bar {
  align-items: center;
  background: rgba(60, 102, 142, 0.96);
  border: 1px solid rgba(120, 167, 207, 0.55);
  border-radius: 7px;
  color: #ffffff;
  display: flex;
  font-size: 22px;
  font-weight: 900;
  justify-content: center;
  margin: 14px 14px 12px;
  min-height: 56px;
  padding: 8px 16px;
  text-align: center;
}

.exchange-desk-select-bar.muted {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.42);
}

.exchange-desk-panel-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 0 18px 10px;
}

.exchange-desk-panel-head strong {
  color: #f5f0df;
  display: block;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.exchange-desk-panel-head small {
  color: rgba(245, 240, 223, 0.56);
  display: block;
  font-size: 14px;
  font-weight: 800;
  margin-top: 4px;
}

.exchange-desk-capacity {
  color: #ff951f;
  font-size: 20px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.exchange-desk-capacity.warning {
  color: #ffd36e;
}

.exchange-desk-capacity.danger {
  color: #ff6f6f;
}

.exchange-desk-arrow {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 9px;
  color: #fffaf0;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 23px;
  font-weight: 900;
  height: 48px;
  justify-content: center;
  margin-left: 10px;
  min-width: 48px;
  padding: 0;
}

.exchange-desk-arrow.left {
  margin-left: 8px;
}

.exchange-desk-arrow:disabled {
  color: rgba(255, 255, 255, 0.18);
  opacity: 0.5;
}

.exchange-desk-track {
  background: rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  height: 6px;
  margin: 0 18px 12px;
  overflow: hidden;
}

.exchange-desk-track span {
  background: #f3a51d;
  border-radius: inherit;
  display: block;
  height: 100%;
}

.exchange-desk-track.ship span {
  background: #9fa6a1;
}

.exchange-desk-table-head {
  color: rgba(245, 240, 223, 0.44);
  display: grid;
  font-size: 11px;
  font-weight: 900;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 78px 88px 92px;
  padding: 0 18px 8px 14px;
}

.exchange-desk-table-head span:not(:first-child) {
  text-align: right;
}

.exchange-desk-table-head span:last-child {
  justify-self: center;
  min-width: 46px;
  text-align: center;
}

.exchange-desk-list {
  display: grid;
  max-height: 360px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 10px 10px 0;
  scrollbar-color: rgba(255, 244, 214, 0.58) rgba(255, 255, 255, 0.08);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.exchange-desk-list.offers {
  gap: 6px;
  padding: 0 12px 12px;
}

.exchange-desk-record-section-head {
  align-items: end;
  border-bottom: 1px solid rgba(168, 197, 188, 0.12);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 15px 18px 12px;
}

.exchange-desk-record-section-head strong {
  color: #fff8e8;
  display: block;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.1;
}

.exchange-desk-record-section-head small {
  color: var(--exchange-muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.exchange-desk-row {
  align-items: center;
  border-radius: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #fffaf0;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 78px 88px 92px;
  margin: 0 0 2px;
  min-height: 62px;
  padding: 8px 8px 8px 14px;
}

.exchange-desk-row.compact {
  grid-template-columns: minmax(0, 1fr) 78px 88px 54px;
}

.exchange-desk-row:hover {
  background: rgba(255, 244, 214, 0.045);
}

.exchange-desk-row > span {
  color: #fff8e8;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

.exchange-desk-product {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.exchange-desk-product div {
  align-content: center;
  display: grid;
  gap: 4px;
  min-height: 42px;
  min-width: 0;
}

.exchange-desk-product-icon {
  background: transparent;
  color: #f5d587;
  display: grid;
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 900;
  height: 42px;
  overflow: visible;
  place-items: center;
  width: 42px;
}

.exchange-desk-product-icon .product-icon-image {
  border-radius: 2px;
  height: 42px;
  max-height: none;
  max-width: none;
  object-fit: contain;
  width: 42px;
}

.exchange-desk-product strong,
.exchange-desk-product small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-desk-product strong {
  color: #5e9ad2;
  display: block;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.12;
}

.exchange-desk-product.tier-1 strong {
  color: #f7f3ea;
}

.exchange-desk-product.tier-2 strong {
  color: #78d36d;
}

.exchange-desk-product.tier-3 strong {
  color: #7dbde6;
}

.exchange-desk-product.tier-4 strong {
  color: #dc8bc8;
}

.exchange-desk-product small {
  color: rgba(245, 240, 223, 0.46);
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.12;
  margin-top: 2px;
}

.exchange-desk-row-actions {
  align-items: center;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.exchange-desk-row-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  display: inline-flex;
  font-size: 20px;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  min-width: 42px;
  padding: 0;
}

.exchange-desk-row-button:hover {
  background: rgba(255, 157, 46, 0.7);
}

.exchange-desk-row-button:disabled {
  color: rgba(255, 255, 255, 0.18);
  opacity: 0.48;
}

.exchange-desk-transfer {
  align-items: center;
  background: rgba(255, 250, 232, 0.06);
  border-radius: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
  color: rgba(255, 244, 214, 0.72);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 7px;
  grid-template-columns: 64px minmax(80px, 1fr) 74px 48px 48px 36px 36px;
  margin: 0 10px 8px 0;
  min-height: 50px;
  padding: 9px 8px;
}

.exchange-desk-transfer.unload {
  background: rgba(62, 125, 188, 0.11);
}

.exchange-desk-transfer input[type="range"] {
  accent-color: #ffac2f;
  width: 100%;
}

.exchange-desk-transfer.unload input[type="range"] {
  accent-color: #6ea6d4;
}

.exchange-desk-transfer input[type="number"] {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 244, 214, 0.12);
  border-radius: 8px;
  color: #fff8e8;
  font-weight: 900;
  height: 32px;
  min-width: 0;
  padding: 0 6px;
  width: 100%;
}

.exchange-desk-transfer strong {
  color: #fff8e8;
  text-align: right;
}

.exchange-desk-transfer small {
  color: rgba(247, 234, 208, 0.44);
  font-size: 11px;
}

.exchange-desk-transfer-confirm,
.exchange-desk-transfer-cancel {
  background: rgba(255, 255, 255, 0.15);
  border: 0;
  border-radius: 9px;
  color: #fff8e8;
  cursor: pointer;
  display: grid;
  font-size: 18px;
  font-weight: 900;
  height: 32px;
  place-items: center;
  width: 36px;
}

.exchange-desk-transfer-confirm {
  background: rgba(255, 157, 46, 0.72);
}

.exchange-desk-transfer.unload .exchange-desk-transfer-confirm {
  background: rgba(62, 125, 188, 0.8);
}

.exchange-desk-transfer-confirm:hover,
.exchange-desk-transfer-cancel:hover {
  filter: brightness(1.08);
}

.exchange-desk-empty {
  align-items: center;
  color: rgba(245, 240, 223, 0.32);
  display: flex;
  font-size: 22px;
  font-weight: 900;
  justify-content: center;
  min-height: 118px;
  padding: 20px;
  text-align: center;
}

.exchange-desk-ship-tabs {
  display: grid;
  gap: 0;
  grid-auto-flow: column;
  grid-auto-columns: minmax(130px, 1fr);
  margin: 14px 14px 12px;
  overflow: hidden;
}

.exchange-desk-ship-tabs button {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.22);
  font-size: 18px;
  font-weight: 900;
  min-height: 56px;
}

.exchange-desk-ship-tabs button:first-child {
  border-radius: 7px 0 0 7px;
}

.exchange-desk-ship-tabs button:last-child {
  border-radius: 0 7px 7px 0;
}

.exchange-desk-ship-tabs button.selected {
  background: rgba(60, 102, 142, 0.96);
  border-color: rgba(120, 167, 207, 0.55);
  color: #ffffff;
}

.exchange-terminal-header {
  display: grid;
  grid-template-columns: minmax(560px, 2.1fr) minmax(340px, 0.8fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 10px;
}

.exchange-terminal-header-main {
  display: grid;
  grid-template-columns: minmax(420px, 1.45fr) minmax(270px, 0.72fr);
  gap: 10px;
  min-width: 0;
}

.exchange-pair-card,
.exchange-selector-strip,
.exchange-ticker-metrics,
.exchange-panel {
  background: rgba(16, 27, 25, 0.92);
  border: 1px solid var(--exchange-line);
  border-radius: 8px;
}

.exchange-pair-card {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 56px minmax(0, 1fr);
  padding: 12px;
}

.exchange-pair-card.selectable {
  appearance: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  grid-template-columns: 56px minmax(0, 1fr) 34px;
  min-width: 0;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  width: 100%;
}

.exchange-pair-card.selectable:hover {
  background: rgba(18, 36, 33, 0.96);
  border-color: rgba(104, 220, 198, 0.46);
  box-shadow: 0 0 0 1px rgba(104, 220, 198, 0.08), 0 16px 34px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.exchange-pair-card.selectable:focus-visible {
  outline: 2px solid rgba(104, 220, 198, 0.72);
  outline-offset: 2px;
}

.exchange-pair-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 244, 214, 0.1);
  border-radius: 8px;
  color: #f0c66f;
  display: inline-flex;
  font-size: 24px;
  font-weight: 900;
  height: 56px;
  justify-content: center;
  overflow: hidden;
  width: 56px;
}

.exchange-pair-icon .product-icon-image {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.exchange-pair-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.exchange-pair-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-pair-subtitle {
  color: var(--exchange-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-pair-select-icon {
  align-items: center;
  background: linear-gradient(145deg, rgba(40, 73, 67, 0.9), rgba(8, 15, 14, 0.95));
  border: 1px solid rgba(238, 210, 126, 0.52);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 3px rgba(104, 220, 198, 0.07);
  display: inline-flex;
  height: 24px;
  justify-content: center;
  justify-self: end;
  position: relative;
  width: 24px;
}

.exchange-pair-select-icon::after {
  border-bottom: 2px solid rgba(237, 246, 242, 0.9);
  border-right: 2px solid rgba(237, 246, 242, 0.9);
  content: "";
  height: 6px;
  margin-top: -3px;
  transform: rotate(45deg);
  width: 6px;
}

.exchange-product-selector-backdrop {
  align-items: center;
  backdrop-filter: blur(12px);
  background:
    radial-gradient(circle at 72% 18%, rgba(70, 142, 131, 0.18), transparent 34%),
    rgba(1, 7, 8, 0.72);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 28px;
  position: fixed;
  z-index: 1200;
}

.exchange-product-selector-modal {
  background: linear-gradient(145deg, rgba(6, 10, 12, 0.98), rgba(13, 22, 20, 0.98));
  border: 1px solid rgba(174, 192, 187, 0.2);
  border-radius: 12px;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--exchange-text);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-height: min(760px, calc(100dvh - 56px));
  overflow: hidden;
  width: min(1480px, calc(100vw - 32px));
}

.exchange-order-confirm-backdrop {
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(1, 7, 8, 0.72);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 24px;
  position: fixed;
  z-index: 1220;
}

.exchange-order-confirm-modal {
  background: linear-gradient(145deg, rgba(6, 10, 12, 0.99), rgba(13, 22, 20, 0.99));
  border: 1px solid rgba(174, 192, 187, 0.2);
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--exchange-text);
  display: grid;
  gap: 14px;
  padding: 18px;
  width: min(380px, calc(100vw - 32px));
}

.exchange-order-confirm-head {
  border-bottom: 1px solid rgba(174, 192, 187, 0.14);
  padding-bottom: 12px;
}

.exchange-order-confirm-head strong {
  color: #ffffff;
  display: block;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}

.exchange-order-confirm-head small {
  color: var(--exchange-muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 6px;
}

.exchange-order-confirm-body {
  display: grid;
  gap: 8px;
}

.exchange-order-confirm-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(168, 197, 188, 0.12);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 42px;
  padding: 9px 11px;
}

.exchange-order-confirm-row span {
  color: var(--exchange-muted);
  font-size: 12px;
  font-weight: 800;
}

.exchange-order-confirm-row strong {
  color: #f1fbf7;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  text-align: right;
}

.exchange-order-confirm-row.amount {
  cursor: default;
  grid-template-columns: minmax(0, 1fr) minmax(64px, 96px);
  row-gap: 10px;
}

.exchange-order-confirm-amount-input {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(168, 197, 188, 0.14);
  border-radius: 8px;
  color: #f1fbf7;
  font: inherit;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  justify-self: end;
  min-height: 34px;
  padding: 4px 10px;
  text-align: right;
  width: 100%;
}

.exchange-order-confirm-amount-input:focus {
  border-color: rgba(33, 201, 137, 0.62);
  box-shadow: 0 0 0 3px rgba(33, 201, 137, 0.14);
  outline: none;
}

.exchange-order-confirm-amount-slider {
  appearance: none;
  background: transparent;
  cursor: pointer;
  grid-column: 1 / -1;
  height: 28px;
  margin: 0;
  width: 100%;
}

.exchange-order-confirm-amount-slider:focus {
  outline: none;
}

.exchange-order-confirm-amount-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(33, 201, 137, 0.22), 0 6px 14px rgba(0, 0, 0, 0.36);
}

.exchange-order-confirm-amount-slider:disabled {
  cursor: default;
  opacity: 0.58;
}

.exchange-order-confirm-amount-slider::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #21c989 0 var(--exchange-confirm-amount-progress, 100%), rgba(168, 197, 188, 0.16) var(--exchange-confirm-amount-progress, 100%) 100%);
  border: 1px solid rgba(168, 197, 188, 0.18);
  border-radius: 999px;
  height: 8px;
}

.exchange-order-confirm-amount-slider::-webkit-slider-thumb {
  appearance: none;
  background: #f1fbf7;
  border: 3px solid #21c989;
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.36);
  height: 24px;
  margin-top: -9px;
  width: 24px;
}

.exchange-order-confirm-amount-slider::-moz-range-track {
  background: rgba(168, 197, 188, 0.16);
  border: 1px solid rgba(168, 197, 188, 0.18);
  border-radius: 999px;
  height: 8px;
}

.exchange-order-confirm-amount-slider::-moz-range-progress {
  background: #21c989;
  border-radius: 999px;
  height: 8px;
}

.exchange-order-confirm-amount-slider::-moz-range-thumb {
  background: #f1fbf7;
  border: 3px solid #21c989;
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.36);
  height: 18px;
  width: 18px;
}

.exchange-order-confirm-row.total strong {
  color: #ffffff;
  font-size: 19px;
}

.exchange-order-confirm-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.exchange-order-confirm-actions button {
  min-height: 40px;
  width: 100%;
}

.exchange-order-replace-modal {
  width: min(420px, calc(100vw - 32px));
}

.exchange-order-replace-field {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(168, 197, 188, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px 11px;
}

.exchange-order-replace-field span {
  color: var(--exchange-muted);
  font-size: 12px;
  font-weight: 800;
}

.exchange-order-replace-field input {
  background: rgba(1, 10, 10, 0.44);
  border: 1px solid rgba(168, 197, 188, 0.16);
  border-radius: 8px;
  color: #f1fbf7;
  font: inherit;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  min-height: 52px;
  padding: 8px 12px;
  text-align: right;
  width: 100%;
}

.exchange-order-replace-field input:focus {
  border-color: rgba(33, 201, 137, 0.62);
  box-shadow: 0 0 0 3px rgba(33, 201, 137, 0.14);
  outline: none;
}

.exchange-order-confirm-submit.buy {
  background: #21c989;
  border-color: rgba(33, 201, 137, 0.58);
  color: #04130f;
}

.exchange-order-confirm-submit.sell {
  background: #f05b66;
  border-color: rgba(240, 91, 102, 0.6);
  color: #190406;
}

.exchange-history-more-button,
.exchange-history-close-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(168, 197, 188, 0.16);
  border-radius: 999px;
  color: #9fc5bd;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  min-height: 30px;
  min-width: 56px;
  padding: 5px 10px;
}

.exchange-history-more-button:hover,
.exchange-history-close-button:hover {
  background: rgba(67, 133, 183, 0.18);
  border-color: rgba(101, 171, 225, 0.38);
  color: #d7eef8;
}

.exchange-history-close-button {
  color: #d7e4df;
  font-size: 18px;
  line-height: 1;
  min-width: 34px;
  padding: 0;
  width: 34px;
}

.exchange-trade-history-modal {
  background: linear-gradient(145deg, rgba(6, 10, 12, 0.99), rgba(13, 22, 20, 0.99));
  border: 1px solid rgba(174, 192, 187, 0.2);
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--exchange-text);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(760px, calc(100dvh - 48px));
  overflow: hidden;
  padding: 16px 18px 18px;
  width: min(720px, calc(100vw - 32px));
}

.exchange-trade-history-modal-head {
  align-items: center;
  border-bottom: 1px solid rgba(174, 192, 187, 0.14);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
  padding-bottom: 12px;
}

.exchange-trade-history-modal-head strong {
  color: #ffffff;
  display: block;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.12;
}

.exchange-trade-history-modal-head small {
  color: var(--exchange-muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 4px;
}

.exchange-trade-history-modal-list {
  display: grid;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.exchange-trade-history-modal-list .exchange-trade-labels {
  background: rgba(8, 16, 15, 0.98);
  padding-top: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.exchange-trade-history-modal .exchange-trade-route {
  width: 100%;
}

.exchange-product-selector-head {
  align-items: center;
  border-bottom: 1px solid rgba(174, 192, 187, 0.14);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 480px) auto 38px;
  padding: 18px 20px;
}

.exchange-product-selector-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.exchange-product-selector-head small {
  color: rgba(238, 210, 126, 0.78);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.exchange-product-selector-head strong {
  color: #fff8e8;
  font-size: 26px;
  font-weight: 900;
}

.exchange-product-selector-head > span {
  color: rgba(237, 246, 242, 0.7);
  font-weight: 800;
}

.exchange-product-selector-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: rgba(245, 240, 223, 0.72);
  cursor: pointer;
  display: inline-flex;
  font-size: 24px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.exchange-product-selector-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff8e8;
}

.exchange-product-selector-toolbar {
  align-items: center;
  border-bottom: 1px solid rgba(174, 192, 187, 0.12);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 14px 16px;
}

.exchange-product-selector-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  min-width: 0;
}

.exchange-product-selector-tabs button {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(237, 246, 242, 0.72);
  cursor: pointer;
  display: inline-flex;
  font-size: 15px;
  font-weight: 900;
  gap: 7px;
  min-height: 40px;
  min-width: 0;
  padding: 0 13px;
}

.exchange-product-selector-tabs button small {
  color: rgba(237, 246, 242, 0.42);
  font-size: 12px;
}

.exchange-product-selector-tabs button.selected {
  background: linear-gradient(145deg, rgba(233, 195, 91, 0.94), rgba(185, 139, 49, 0.92));
  border-color: rgba(255, 236, 157, 0.45);
  color: #12100a;
}

.exchange-product-selector-tabs button.selected small {
  color: rgba(18, 16, 10, 0.62);
}

.exchange-product-selector-search {
  align-items: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(190, 210, 206, 0.22);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 24px minmax(0, 1fr);
  min-height: 44px;
  padding: 0 12px;
}

.exchange-product-selector-search span {
  color: rgba(237, 246, 242, 0.72);
  font-size: 22px;
  line-height: 1;
}

.exchange-product-selector-search input {
  background: transparent;
  border: 0;
  color: var(--exchange-text);
  font-size: 16px;
  font-weight: 800;
  min-width: 0;
  outline: 0;
}

.exchange-product-selector-search input::placeholder {
  color: rgba(237, 246, 242, 0.34);
}

.exchange-product-selector-table {
  min-height: 0;
  overflow: auto;
}

.exchange-product-selector-labels,
.exchange-product-selector-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1.45fr) minmax(110px, 0.7fr) minmax(128px, 0.75fr) minmax(148px, 0.85fr) minmax(138px, 0.75fr);
}

.exchange-product-selector-labels {
  align-items: center;
  background: rgba(6, 10, 12, 0.96);
  border-bottom: 1px solid rgba(174, 192, 187, 0.1);
  color: rgba(237, 246, 242, 0.46);
  font-size: 13px;
  font-weight: 900;
  padding: 11px 20px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.exchange-product-selector-sort {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 7px;
  justify-content: flex-start;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.exchange-product-selector-sort:hover,
.exchange-product-selector-sort.active {
  color: rgba(245, 240, 223, 0.86);
}

.exchange-product-selector-sort-arrows {
  display: inline-grid;
  gap: 3px;
  justify-items: center;
}

.exchange-product-selector-sort-arrows i {
  display: block;
  height: 0;
  opacity: 0.34;
  width: 0;
}

.exchange-product-selector-sort-arrows .up {
  border-bottom: 5px solid currentColor;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.exchange-product-selector-sort-arrows .down {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.exchange-product-selector-sort.asc .up,
.exchange-product-selector-sort.desc .down {
  color: #e8c560;
  opacity: 1;
}

.exchange-product-selector-list {
  display: grid;
}

.exchange-product-selector-row {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(174, 192, 187, 0.08);
  color: var(--exchange-text);
  cursor: pointer;
  font: inherit;
  min-height: 66px;
  padding: 10px 20px;
  text-align: left;
}

.exchange-product-selector-row:hover {
  background: rgba(255, 255, 255, 0.045);
}

.exchange-product-selector-row.selected {
  background: linear-gradient(90deg, rgba(55, 174, 151, 0.18), rgba(55, 174, 151, 0.03));
  box-shadow: inset 3px 0 0 rgba(104, 220, 198, 0.94);
}

.exchange-product-selector-product {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 42px minmax(0, 1fr);
  min-width: 0;
}

.exchange-product-selector-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 244, 214, 0.12);
  border-radius: 8px;
  color: #e7c46c;
  display: inline-flex;
  font-size: 20px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  overflow: hidden;
  width: 42px;
}

.exchange-product-selector-icon .product-icon-image {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.exchange-product-selector-product strong,
.exchange-product-selector-price,
.exchange-product-selector-change,
.exchange-product-selector-volume,
.exchange-product-selector-stock {
  color: var(--exchange-text);
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.exchange-product-selector-product small,
.exchange-product-selector-volume small,
.exchange-product-selector-stock small {
  color: rgba(237, 246, 242, 0.46);
  font-size: 12px;
  font-weight: 800;
}

.exchange-product-selector-product > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.exchange-product-selector-change.up {
  color: var(--exchange-green);
}

.exchange-product-selector-change.down {
  color: var(--exchange-red);
}

.exchange-product-selector-change.neutral {
  color: rgba(237, 246, 242, 0.46);
}

.exchange-product-selector-empty {
  color: rgba(237, 246, 242, 0.44);
  font-size: 18px;
  font-weight: 900;
  padding: 56px 20px;
  text-align: center;
}

.exchange-selector-strip {
  display: grid;
  grid-template-columns: minmax(112px, 0.86fr) minmax(150px, 1fr);
  gap: 8px;
  padding: 10px;
}

.exchange-selector-strip label,
.exchange-ticket-form label {
  color: var(--exchange-muted);
  display: grid;
  font-size: 12px;
  gap: 5px;
}

.exchange-ticker-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.exchange-ticker-metric {
  background: rgba(255, 255, 255, 0.025);
  display: grid;
  gap: 4px;
  padding: 10px;
}

.exchange-ticker-metric small {
  color: var(--exchange-muted);
}

.exchange-ticker-metric strong {
  color: var(--exchange-text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.exchange-ticker-metric.up strong,
.exchange-terminal .up strong,
.exchange-book-row.buy .exchange-book-price {
  color: var(--exchange-green);
}

.exchange-ticker-metric.down strong,
.exchange-terminal .down strong,
.exchange-book-row.sell .exchange-book-price {
  color: var(--exchange-red);
}

.exchange-ticker-metric.warn strong {
  color: #e5b454;
}

.exchange-terminal .exchange-message {
  background: rgba(15, 28, 26, 0.85);
  border-color: var(--exchange-line);
  color: var(--exchange-muted);
}

.exchange-terminal-grid {
  display: grid;
  grid-template-columns: minmax(560px, 2.1fr) minmax(340px, 0.8fr);
  grid-template-areas:
    "chart history"
    "book ticket";
  gap: 12px;
}

.exchange-panel {
  min-width: 0;
  padding: 12px;
}

.exchange-chart-panel {
  grid-area: chart;
}

.exchange-book-panel {
  grid-area: book;
}

.exchange-ticket-panel {
  grid-area: ticket;
}

.exchange-history-panel {
  grid-area: history;
}

.exchange-panel-head {
  align-items: center;
  border-bottom: 1px solid var(--exchange-line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: -2px 0 10px;
  padding-bottom: 10px;
}

.exchange-panel-head strong {
  color: #ffffff;
  font-size: 16px;
}

.exchange-panel-head small {
  color: var(--exchange-muted);
  display: block;
  margin-top: 2px;
}

.exchange-interval-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.exchange-interval-tabs button {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(168, 197, 188, 0.18);
  color: #b9d0ca;
  min-height: 30px;
  padding: 4px 8px;
}

.exchange-interval-tabs button.selected {
  background: var(--exchange-blue);
  color: white;
}

.exchange-chart-wrap {
  position: relative;
}

.exchange-candle-svg {
  display: block;
  height: auto;
  max-height: 390px;
  width: 100%;
}

.exchange-chart-bg {
  fill: #07100f;
}

.exchange-chart-grid,
.exchange-chart-axis {
  stroke: rgba(168, 197, 188, 0.13);
  stroke-width: 1;
}

.exchange-chart-label {
  fill: #79918a;
  font-size: 11px;
}

.exchange-candle.up .candle-body,
.exchange-candle.up .volume-bar {
  fill: var(--exchange-green);
}

.exchange-candle.down .candle-body,
.exchange-candle.down .volume-bar {
  fill: var(--exchange-red);
}

.candle-wick {
  stroke: currentColor;
  stroke-width: 1.4;
}

.exchange-candle.up {
  color: var(--exchange-green);
}

.exchange-candle.down {
  color: var(--exchange-red);
}

.volume-bar {
  opacity: 0.42;
}

.exchange-chart-empty-note {
  bottom: 14px;
  color: #a9bcb6;
  font-size: 12px;
  left: 16px;
  position: absolute;
}

.exchange-terminal .market-summary {
  margin-top: 10px;
}

.exchange-terminal .market-summary .stat-row,
.exchange-ticket-preview .stat-row {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(168, 197, 188, 0.12);
  color: var(--exchange-muted);
}

.exchange-terminal .market-summary .stat-row strong,
.exchange-ticket-preview .stat-row strong {
  color: var(--exchange-text);
}

.exchange-tax-rate-row {
  overflow: visible;
  position: relative;
  z-index: 3;
}

.exchange-tax-rate-label {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  min-width: 0;
}

.exchange-tax-help {
  display: inline-flex;
  position: relative;
}

.exchange-tax-help::before {
  bottom: 100%;
  content: "";
  height: 16px;
  left: -120px;
  position: absolute;
  width: 260px;
}

.exchange-tax-help-button {
  align-items: center;
  background: rgba(244, 241, 232, 0.06);
  border: 1px solid rgba(244, 241, 232, 0.22);
  border-radius: 50%;
  color: rgba(244, 241, 232, 0.74);
  cursor: help;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 20px;
}

.exchange-tax-help-button:hover,
.exchange-tax-help-button:focus-visible {
  background: rgba(226, 180, 109, 0.14);
  border-color: rgba(226, 180, 109, 0.5);
  color: var(--exchange-price-high);
  outline: none;
}

.exchange-tax-help-popover {
  backdrop-filter: blur(12px);
  background: linear-gradient(145deg, rgba(7, 15, 14, 0.98), rgba(16, 27, 25, 0.98));
  border: 1px solid rgba(226, 180, 109, 0.24);
  border-radius: 10px;
  bottom: calc(100% + 12px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: rgba(244, 241, 232, 0.78);
  display: grid;
  gap: 7px;
  left: 50%;
  line-height: 1.45;
  min-width: 280px;
  opacity: 0;
  padding: 12px 13px;
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, 6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  visibility: hidden;
  z-index: 20;
}

.exchange-tax-help-popover::after {
  background: rgba(7, 15, 14, 0.98);
  border-bottom: 1px solid rgba(226, 180, 109, 0.24);
  border-right: 1px solid rgba(226, 180, 109, 0.24);
  bottom: -6px;
  content: "";
  height: 10px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
}

.exchange-tax-help-popover strong {
  color: var(--exchange-price-neutral);
  font-size: 13px;
  font-weight: 900;
}

.exchange-tax-help-popover em {
  color: rgba(244, 241, 232, 0.64);
  display: block;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.exchange-tax-help:hover .exchange-tax-help-popover,
.exchange-tax-help:focus-within .exchange-tax-help-popover {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.exchange-book-labels,
.exchange-book-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px 72px 96px 66px;
  column-gap: 14px;
  align-items: center;
}

.exchange-trade-labels,
.exchange-terminal-trade {
  align-items: center;
  display: grid;
  column-gap: 6px;
  grid-template-areas: "route price amount total time";
  grid-template-columns: minmax(108px, 1fr) 42px 28px 58px 44px;
  row-gap: 0;
  width: 100%;
}

.exchange-trade-labels {
  color: var(--exchange-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0 6px 8px 0;
}

.exchange-trade-labels span:nth-child(1) {
  grid-area: route;
}

.exchange-trade-labels span:nth-child(2) {
  grid-area: price;
  text-align: right;
}

.exchange-trade-labels span:nth-child(3) {
  grid-area: amount;
}

.exchange-trade-labels span:nth-child(4) {
  grid-area: total;
}

.exchange-trade-labels span:nth-child(5) {
  grid-area: time;
}

.exchange-trade-labels span:not(:first-child) {
  display: block;
  text-align: right;
}

.exchange-trade-labels span:nth-child(2) {
  text-align: right;
}

.exchange-trade-list {
  align-content: start;
  display: grid;
}

.exchange-book-labels {
  color: var(--exchange-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0 12px 8px;
}

.exchange-book-labels span:not(:first-child) {
  display: block;
  text-align: center;
}

.exchange-book-labels.buy-labels {
  border-top: 1px solid var(--exchange-line);
  margin-top: 10px;
  padding-top: 10px;
}

.exchange-book-side {
  --exchange-book-row-height: 48px;
  align-content: start;
  display: grid;
  gap: 0;
  grid-auto-rows: minmax(var(--exchange-book-row-height), auto);
  max-height: calc(var(--exchange-book-row-height) * 10);
  min-height: calc(var(--exchange-book-row-height) * 10);
  overflow-y: auto;
  overscroll-behavior-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(168, 197, 188, 0.32) rgba(168, 197, 188, 0.08);
  scrollbar-width: thin;
}

.exchange-book-row {
  border-radius: 4px;
  color: #d7e4df;
  min-height: var(--exchange-book-row-height);
  overflow: hidden;
  padding: 5px 12px;
  position: relative;
}

.exchange-book-row + .exchange-book-row {
  border-top: 1px solid rgba(168, 197, 188, 0.1);
}

.exchange-book-row .exchange-depth-fill {
  bottom: 0;
  opacity: 0.32;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 0;
}

.exchange-book-row.sell .exchange-depth-fill {
  background: rgba(240, 91, 102, 0.45);
}

.exchange-book-row.buy .exchange-depth-fill {
  background: rgba(33, 201, 137, 0.42);
}

.exchange-book-row > *:not(.exchange-depth-fill) {
  position: relative;
  z-index: 1;
}

.exchange-book-amount,
.exchange-book-weight {
  color: #f1fbf7;
  display: block;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  justify-self: stretch;
  line-height: 1;
  text-align: center;
}

.exchange-book-weight {
  color: #a7c5bd;
  font-size: 13px;
  font-weight: 800;
}

.exchange-book-row .text-button.exchange-book-amount {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
  width: 100%;
}

.exchange-book-row .text-button.exchange-book-price {
  display: inline-flex;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  justify-content: center;
  justify-self: stretch;
  line-height: 1;
  min-width: 0;
  text-decoration: none;
  text-align: center;
  width: 100%;
}

.exchange-book-editable-cell {
  border-radius: 7px;
  min-height: 30px;
  padding: 4px 6px;
}

.exchange-book-editable-cell:hover,
.exchange-book-editable-cell:focus-visible {
  background: rgba(67, 133, 183, 0.12);
  box-shadow: inset 0 0 0 1px rgba(101, 171, 225, 0.24);
  outline: none;
}

.exchange-book-action {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  justify-self: end;
  line-height: 1;
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
  width: 58px;
}

.exchange-book-action.buy {
  background: rgba(33, 201, 137, 0.14);
  border-color: rgba(33, 201, 137, 0.36);
  color: var(--exchange-green);
}

.exchange-book-action.sell {
  background: rgba(240, 91, 102, 0.13);
  border-color: rgba(240, 91, 102, 0.36);
  color: var(--exchange-red);
}

.exchange-book-action.secondary {
  background: rgba(168, 197, 188, 0.08);
  border-color: rgba(168, 197, 188, 0.2);
  color: var(--exchange-muted);
}

.exchange-book-trader {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 34px minmax(0, 1fr);
  min-width: 0;
}

.exchange-book-trader .player-avatar {
  box-shadow: none;
  font-size: 13px;
  height: 34px;
  width: 34px;
}

.exchange-book-trader-copy {
  align-items: center;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.exchange-book-alliance {
  background: rgba(59, 111, 151, 0.24);
  border: 1px solid rgba(91, 145, 185, 0.18);
  border-radius: 6px;
  color: #6aa4d7;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  max-width: 86px;
  overflow: hidden;
  padding: 2px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-book-player-name,
.exchange-book-trader .inline-player-link {
  color: #5b91c5;
  display: block;
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-mid-price {
  align-items: center;
  border-bottom: 1px solid var(--exchange-line);
  border-top: 1px solid var(--exchange-line);
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  padding: 9px 2px;
}

.exchange-mid-price strong {
  color: #ffffff;
  font-size: 18px;
}

.exchange-mid-price small {
  color: var(--exchange-muted);
}

.mini-link-button {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(168, 197, 188, 0.18);
  color: #d8e7e2;
  min-height: 24px;
  padding: 2px 6px;
}

.exchange-ticket-form {
  display: grid;
  gap: 12px;
}

.exchange-ticket-form label {
  gap: 7px;
  font-size: 13px;
  font-weight: 850;
}

.exchange-ticket-form label:focus-within {
  color: #c9ded8;
}

.exchange-ticket-form input {
  background:
    linear-gradient(180deg, rgba(16, 32, 29, 0.98), rgba(8, 18, 17, 0.98));
  border: 1px solid rgba(168, 197, 188, 0.28);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.12);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  min-height: 56px;
  padding: 9px 14px;
  text-align: right;
  width: 100%;
}

.exchange-ticket-form input:focus {
  border-color: rgba(101, 171, 225, 0.72);
  box-shadow:
    0 0 0 3px rgba(61, 111, 152, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  outline: 0;
}

.exchange-ticket-preview {
  display: grid;
  gap: 7px;
  margin-top: 2px;
}

.exchange-ticket-preview .stat-row {
  align-items: center;
  border-radius: 7px;
  min-height: 42px;
  padding: 8px 11px;
}

.exchange-ticket-preview .stat-row span {
  font-size: 13px;
  font-weight: 780;
}

.exchange-ticket-preview .stat-row strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.exchange-ticket-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.exchange-ticket-actions button {
  border-radius: 8px;
  font-size: 16px;
  font-weight: 900;
  min-height: 48px;
}

.exchange-ticket-actions .buy-action {
  background: #0d8c62;
  border-color: #18b27f;
}

.exchange-ticket-actions .sell-action {
  background: #b83d4a;
  border-color: #ee6670;
}

.exchange-ticket-form > button.secondary {
  border-radius: 8px;
  font-size: 15px;
  font-weight: 850;
  min-height: 44px;
}

.exchange-my-orders-panel {
  border-top: 1px solid var(--exchange-line);
  display: grid;
  gap: 8px;
  margin-top: 4px;
  min-height: 0;
  padding-top: 12px;
}

.exchange-my-orders-head {
  align-items: end;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.exchange-my-orders-head strong {
  color: #ffffff;
  display: block;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.1;
}

.exchange-my-orders-head small {
  color: var(--exchange-muted);
  display: block;
  font-size: 11px;
  font-weight: 760;
  margin-top: 3px;
}

.exchange-my-orders-list {
  display: grid;
  gap: 0;
  max-height: clamp(220px, 30vh, 430px);
  min-height: 160px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.exchange-my-order-labels {
  align-items: center;
  background: #08100f;
  color: var(--exchange-muted);
  display: grid;
  font-size: 12px;
  font-weight: 850;
  gap: 8px;
  grid-template-columns: 52px minmax(72px, 1fr) 48px 66px;
  min-height: 24px;
  padding: 0 0 4px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.exchange-my-order-labels span:nth-child(3) {
  text-align: right;
}

.exchange-my-order-row {
  align-items: center;
  border-bottom: 1px solid rgba(168, 197, 188, 0.1);
  display: grid;
  gap: 8px;
  grid-template-columns: 52px minmax(72px, 1fr) 48px 66px;
  min-height: 48px;
  padding: 7px 0;
}

.exchange-my-order-row strong,
.exchange-my-order-row > span {
  font-variant-numeric: tabular-nums;
  min-width: 0;
}

.exchange-my-order-row > strong {
  font-size: 15px;
  font-weight: 950;
}

.exchange-my-order-row > span:nth-child(3) {
  color: #eaf7f2;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

.exchange-my-order-side {
  border: 1px solid rgba(168, 197, 188, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  justify-self: start;
  line-height: 1;
  padding: 6px 9px;
}

.exchange-my-order-side.buy {
  background: rgba(33, 201, 137, 0.12);
  border-color: rgba(33, 201, 137, 0.34);
  color: var(--exchange-green);
}

.exchange-my-order-side.sell {
  background: rgba(240, 91, 102, 0.12);
  border-color: rgba(240, 91, 102, 0.34);
  color: var(--exchange-red);
}

.exchange-my-order-cancel {
  background: rgba(168, 197, 188, 0.08);
  border-color: rgba(168, 197, 188, 0.22);
  border-radius: 999px;
  color: var(--exchange-muted);
  font-size: 13px;
  font-weight: 900;
  justify-self: end;
  line-height: 1;
  min-height: 34px;
  padding: 0 13px;
  white-space: nowrap;
}

.exchange-my-orders-empty {
  align-content: center;
  border: 1px dashed rgba(168, 197, 188, 0.16);
  border-radius: 8px;
  color: rgba(169, 199, 190, 0.64);
  display: grid;
  font-size: 13px;
  font-weight: 850;
  min-height: 120px;
  padding: 18px 10px;
  text-align: center;
}

.exchange-terminal .job-detail {
  color: var(--exchange-muted);
}

.exchange-terminal-trade {
  border-bottom: 1px solid rgba(168, 197, 188, 0.1);
  box-sizing: border-box;
  color: #d7e4df;
  min-height: 64px;
  padding: 7px 6px 7px 0;
}

.exchange-trade-route {
  align-items: start;
  display: grid;
  column-gap: 5px;
  grid-area: route;
  grid-template-areas:
    "arrow seller"
    "arrow buyer";
  grid-template-columns: 16px minmax(0, 1fr);
  justify-self: stretch;
  min-width: 0;
  row-gap: 4px;
  width: 100%;
}

.exchange-trade-party.seller {
  grid-area: seller;
}

.exchange-trade-party.buyer {
  grid-area: buyer;
}

.exchange-trade-party {
  align-items: start;
  display: grid;
  gap: 4px;
  grid-template-columns: 22px minmax(0, 1fr);
  min-width: 0;
}

.exchange-trade-party .player-avatar {
  box-shadow: none;
  font-size: 11px;
  height: 22px;
  width: 22px;
}

.exchange-trade-player-name,
.exchange-trade-party .inline-player-link {
  color: #5b91c5;
  display: block;
  font-size: clamp(10px, 0.8vw, 12px);
  font-weight: 800;
  line-height: 1.08;
  min-width: 0;
  overflow: visible;
  text-align: left;
  text-decoration-thickness: 1px;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.exchange-trade-arrow {
  align-self: stretch;
  color: rgba(168, 197, 188, 0.46);
  display: grid;
  font-size: 14px;
  font-weight: 900;
  grid-area: arrow;
  place-items: center;
  text-align: center;
}

.exchange-trade-price,
.exchange-trade-amount,
.exchange-trade-total,
.exchange-trade-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.exchange-trade-price {
  grid-area: price;
  text-align: right;
}

.exchange-trade-amount {
  grid-area: amount;
}

.exchange-trade-total {
  grid-area: total;
}

.exchange-trade-time {
  grid-area: time;
  line-height: 1.15;
  white-space: normal;
}

.exchange-trade-price,
.exchange-trade-total {
  font-weight: 900;
}

.exchange-terminal-trade .exchange-trade-time {
  color: var(--exchange-muted);
}

.exchange-terminal h3 {
  color: #dbe8e4;
  font-size: 13px;
  margin: 0 0 8px;
}

.exchange-terminal .exchange-order {
  border-color: rgba(168, 197, 188, 0.1);
  color: #d7e4df;
}

.exchange-terminal .exchange-order small {
  color: var(--exchange-muted);
}

.exchange-terminal .exchange-order strong {
  color: var(--exchange-green);
}

.exchange-terminal .exchange-record-row {
  align-items: center;
  border-bottom: 1px solid rgba(168, 197, 188, 0.1);
  color: #d7e4df;
  display: grid;
  gap: 14px;
  grid-template-columns: 68px minmax(190px, 0.72fr) 118px minmax(0, 1fr) 76px;
  min-height: 68px;
  padding: 9px 6px;
}

.exchange-terminal .exchange-record-trade {
  grid-template-columns: 68px minmax(190px, 0.72fr) 118px minmax(0, 1fr);
}

.exchange-terminal .exchange-record-side {
  border: 1px solid rgba(168, 197, 188, 0.18);
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 950;
  justify-content: center;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}

.exchange-terminal .exchange-record-side.buy {
  background: rgba(33, 201, 137, 0.12);
  border-color: rgba(33, 201, 137, 0.34);
  color: var(--exchange-green);
}

.exchange-terminal .exchange-record-side.sell {
  background: rgba(240, 91, 102, 0.12);
  border-color: rgba(240, 91, 102, 0.34);
  color: var(--exchange-red);
}

.exchange-record-product {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 36px minmax(0, 1fr);
  min-width: 0;
}

.exchange-record-product-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 244, 214, 0.1);
  border-radius: 8px;
  color: #f0c66f;
  display: inline-flex;
  font-size: 18px;
  font-weight: 950;
  height: 36px;
  justify-content: center;
  overflow: hidden;
  width: 36px;
}

.exchange-record-product-icon .product-icon-image {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.exchange-record-product-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.exchange-terminal .exchange-record-product-copy strong {
  color: #f1fbf7;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-record-product-copy small {
  color: rgba(159, 197, 189, 0.72);
  font-size: 11px;
  font-weight: 820;
  line-height: 1.1;
}

.exchange-record-price {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  min-width: 0;
  text-align: left;
}

.exchange-terminal .exchange-record-meta {
  color: var(--exchange-muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
}

.exchange-record-cancel {
  border-radius: 999px;
  justify-self: end;
  min-height: 34px;
  padding: 0 13px;
  white-space: nowrap;
}

.exchange-terminal .exchange-price-value {
  color: var(--exchange-price-neutral);
  font-variant-numeric: tabular-nums;
}

.exchange-terminal input.exchange-price-neutral {
  color: var(--exchange-price-neutral);
}

.exchange-terminal .exchange-price-value.exchange-price-high,
.exchange-terminal input.exchange-price-high {
  color: var(--exchange-price-high);
  text-shadow: 0 0 18px rgba(226, 180, 109, 0.16);
}

.exchange-terminal .exchange-price-value.exchange-price-extreme-high,
.exchange-terminal input.exchange-price-extreme-high {
  color: var(--exchange-price-extreme-high);
  text-shadow: 0 0 18px rgba(232, 111, 123, 0.18);
}

.exchange-terminal .exchange-price-value.exchange-price-low,
.exchange-terminal input.exchange-price-low {
  color: var(--exchange-price-low);
  text-shadow: 0 0 18px rgba(167, 216, 184, 0.15);
}

.exchange-terminal .exchange-price-value.exchange-price-extreme-low,
.exchange-terminal input.exchange-price-extreme-low {
  color: var(--exchange-price-extreme-low);
  text-shadow: 0 0 18px rgba(79, 189, 134, 0.18);
}

.exchange-terminal .exchange-item small,
.exchange-terminal .exchange-ship-select {
  color: var(--exchange-muted);
}

.exchange-terminal .exchange-item strong {
  color: var(--exchange-text);
}

.exchange-terminal .exchange-item {
  border-color: rgba(168, 197, 188, 0.1);
  grid-template-columns: minmax(0, 1fr) 78px repeat(4, minmax(68px, auto));
}

@media (max-width: 1280px) {
  .exchange-terminal-header {
    grid-template-columns: 1fr;
  }

  .exchange-desk-cargo {
    gap: 18px;
  }

  .exchange-terminal-grid {
    grid-template-columns: minmax(0, 1fr) 400px;
    grid-template-areas:
      "chart history"
      "book ticket";
  }

  .exchange-ticker-metrics,
  .exchange-history-panel {
    justify-self: end;
    width: min(100%, 400px);
  }

  .exchange-ticker-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .exchange-terminal {
    border-radius: 0;
    margin: 0 -10px;
    padding: 10px;
  }

  .exchange-terminal-header-main {
    grid-template-columns: 1fr;
  }

  .exchange-desk-toolbar {
    grid-template-columns: 1fr;
  }

  .exchange-desk-exchange-picker {
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.38);
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .exchange-desk-tabs button {
    font-size: 16px;
    min-height: 48px;
  }

  .exchange-desk-cargo {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .exchange-desk-select-bar,
  .exchange-desk-ship-tabs {
    margin: 12px 12px 10px;
  }

  .exchange-desk-panel-head {
    padding: 0 14px 8px;
  }

  .exchange-desk-table-head,
  .exchange-desk-row {
    grid-template-columns: minmax(0, 1fr) 70px 78px 88px;
  }

  .exchange-desk-record-section-head {
    padding: 13px 14px 11px;
  }

  .exchange-terminal .exchange-record-row,
  .exchange-terminal .exchange-record-trade {
    column-gap: 10px;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    grid-template-areas:
      "side product price"
      ". meta action";
    min-height: 76px;
    padding: 9px 2px;
    row-gap: 7px;
  }

  .exchange-terminal .exchange-record-trade {
    grid-template-areas:
      "side product price"
      ". meta meta";
  }

  .exchange-terminal .exchange-record-side {
    font-size: 12px;
    grid-area: side;
    justify-self: start;
    padding: 7px 9px;
  }

  .exchange-record-product {
    grid-area: product;
  }

  .exchange-record-product-icon {
    height: 32px;
    width: 32px;
  }

  .exchange-record-product-copy small {
    display: none;
  }

  .exchange-record-price {
    grid-area: price;
    justify-self: end;
    text-align: right;
  }

  .exchange-terminal .exchange-record-meta {
    grid-area: meta;
  }

  .exchange-record-cancel {
    grid-area: action;
  }

  .exchange-desk-row.compact {
    grid-template-columns: minmax(0, 1fr) 70px 78px 48px;
  }

  .exchange-desk-product-icon,
  .exchange-desk-product-icon .product-icon-image {
    height: 44px;
    width: 44px;
  }

  .exchange-selector-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exchange-product-selector-backdrop {
    align-items: end;
    padding: 12px;
  }

  .exchange-product-selector-modal {
    border-radius: 12px 12px 0 0;
    max-height: calc(100dvh - 24px);
    width: 100%;
  }

  .exchange-order-confirm-backdrop {
    align-items: end;
    padding: 12px;
  }

  .exchange-order-confirm-modal {
    border-radius: 12px 12px 0 0;
    width: 100%;
  }

  .exchange-trade-history-modal {
    border-radius: 12px 12px 0 0;
    max-height: calc(100dvh - 24px);
    width: 100%;
  }

  .exchange-product-selector-head {
    grid-template-columns: minmax(0, 1fr) auto 38px;
    padding: 15px;
  }

  .exchange-product-selector-head .exchange-product-selector-search {
    grid-column: 1 / -1;
  }

  .exchange-product-selector-head strong {
    font-size: 22px;
  }

  .exchange-product-selector-toolbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .exchange-product-selector-labels,
  .exchange-product-selector-row {
    min-width: 820px;
  }

  .exchange-terminal-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "chart"
      "history"
      "book"
      "ticket";
  }

  .exchange-ticker-metrics,
  .exchange-history-panel {
    justify-self: center;
    margin-inline: auto;
    width: min(100%, 584px);
  }
}

@media (max-width: 640px) {
  .app {
    overflow-x: hidden;
    padding: 16px 12px;
  }

  .exchange-desk-table-head {
    display: none;
  }

  .exchange-desk-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .exchange-desk-row > span {
    text-align: left;
  }

  .exchange-desk-row-actions {
    justify-content: flex-start;
  }

  .exchange-desk-transfer {
    gap: 8px;
    grid-template-columns: 1fr 1fr 58px 36px;
    margin-right: 8px;
  }

  .exchange-desk-transfer input[type="range"] {
    grid-column: 1 / -1;
  }

  .exchange-desk-transfer small {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .page-tabs {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .top-actions button,
  .top-actions .button-link,
  .page-tab {
    flex: 0 0 auto;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .exchange-selector-strip,
  .exchange-ticker-metrics {
    grid-template-columns: 1fr;
  }

  .exchange-panel {
    padding: 10px;
  }

  .exchange-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .exchange-history-panel .exchange-panel-head {
    align-items: center;
    flex-direction: row;
  }

  .exchange-book-labels,
  .exchange-book-row {
    column-gap: 6px;
    grid-template-columns: minmax(96px, 1fr) 42px 48px 58px 50px;
  }

  .exchange-trade-labels {
    display: none;
  }

  .exchange-terminal-trade {
    column-gap: 5px;
    grid-template-areas: "route price amount total time";
    grid-template-columns: minmax(104px, 1fr) 38px 24px 50px 44px;
    row-gap: 0;
  }

  .exchange-trade-route {
    grid-area: route;
  }

  .exchange-trade-price {
    grid-area: price;
    text-align: right;
  }

  .exchange-trade-amount {
    grid-area: amount;
  }

  .exchange-trade-total {
    grid-area: total;
    text-align: right;
  }

  .exchange-trade-time {
    grid-area: time;
  }

  .exchange-book-trader {
    gap: 7px;
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .exchange-book-trader .player-avatar {
    font-size: 12px;
    height: 30px;
    width: 30px;
  }

  .exchange-book-trader-copy {
    gap: 5px;
  }

  .exchange-book-alliance {
    max-width: 58px;
  }

  .exchange-book-player-name,
  .exchange-book-trader .inline-player-link {
    font-size: 13px;
  }

  .exchange-book-row .text-button.exchange-book-price {
    font-size: 17px;
  }

  .exchange-book-weight {
    font-size: 12px;
  }

  .exchange-book-action {
    font-size: 12px;
    min-height: 30px;
    padding: 0 8px;
    width: 52px;
  }

  .exchange-terminal .exchange-item {
    grid-template-columns: 1fr;
  }

  .exchange-terminal .exchange-item input,
  .exchange-terminal .exchange-item button {
    width: 100%;
  }
}

.exchange-value {
  color: #0f6b66;
  font-weight: 700;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.filter-tab {
  border-color: #dbe4e7;
  background: white;
  color: #40535b;
  font-size: 13px;
  padding: 5px 9px;
}

.filter-tab.industry-filter-tab {
  border-color: var(--industry-border, #dbe4e7);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.68)),
    var(--industry-soft, #ffffff);
  color: var(--industry-ink, #40535b);
}

.filter-tab.selected {
  border-color: #0f6b66;
  background: #e8f1f0;
  color: #0f6b66;
}

.filter-tab.industry-filter-tab.selected {
  border-color: var(--industry-color, #0f6b66);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    var(--industry-soft, #e8f1f0);
  color: var(--industry-ink, #0f6b66);
  box-shadow: inset 0 -3px 0 var(--industry-color, #0f6b66);
}

.goal-item {
  display: grid;
  gap: 6px;
  border: 1px solid #edf2f3;
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 10px;
}

.goal-item:last-child {
  margin-bottom: 0;
}

.goal-item.done {
  background: #f4faf7;
  border-color: #cfe9dc;
}

.goal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.goal-title span {
  border-radius: 999px;
  background: #eef5f5;
  color: #0f6b66;
  font-size: 12px;
  padding: 3px 8px;
}

.goal-item.done .goal-title span {
  background: #e7f4ed;
  color: #17633a;
}

.task-command-center {
  display: grid;
  gap: 12px;
  max-width: 1380px;
  margin: 0 auto;
  color: #eef4ee;
}

.task-briefing-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(460px, 1fr);
  gap: 18px;
  overflow: hidden;
  border: 1px solid rgba(214, 185, 123, 0.28);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(24, 64, 76, 0.92), rgba(20, 24, 24, 0.96) 58%),
    rgba(8, 13, 15, 0.96);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.26);
}

.task-briefing-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(224, 163, 50, 0.18), transparent 36%),
    linear-gradient(0deg, rgba(255, 248, 232, 0.05), transparent 56%);
  pointer-events: none;
}

.task-briefing-copy,
.task-dashboard,
.task-unlock-line {
  position: relative;
  z-index: 1;
}

.task-briefing-copy {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.task-briefing-copy > span,
.task-checkin-card > div > span,
.task-panel-header span,
.task-card-header span {
  color: rgba(181, 211, 214, 0.88);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.task-briefing-copy h3 {
  margin: 0;
  color: #fff8e8;
  font-size: clamp(24px, 2.5vw, 36px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.08;
}

.task-briefing-copy p {
  max-width: 60ch;
  margin: 0;
  color: rgba(238, 244, 238, 0.78);
  font-size: 15px;
  line-height: 1.65;
}

.task-briefing-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}

.task-briefing-foot b,
.task-briefing-foot small,
.task-unlock-line {
  border: 1px solid rgba(214, 185, 123, 0.22);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.08);
  color: rgba(255, 248, 232, 0.82);
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 10px;
}

.task-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-self: start;
}

.task-stat-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid rgba(255, 248, 232, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 248, 232, 0.075);
}

.task-stat-card span {
  color: rgba(181, 211, 214, 0.84);
  font-size: 12px;
}

.task-stat-card strong {
  overflow-wrap: anywhere;
  color: #fff8e8;
  font-size: 18px;
  line-height: 1.22;
}

.task-unlock-line {
  grid-column: 1 / -1;
  border-radius: 8px;
  background: rgba(5, 8, 10, 0.26);
}

.task-checkin-card,
.task-panel,
.task-card {
  border: 1px solid rgba(214, 185, 123, 0.22);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.task-checkin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background:
    linear-gradient(90deg, rgba(224, 163, 50, 0.15), rgba(45, 99, 101, 0.2)),
    rgba(14, 22, 24, 0.9);
}

.task-checkin-card strong {
  display: block;
  margin-top: 3px;
  color: #fff8e8;
  font-size: 18px;
}

.technology-workbench-body .task-command-center .task-checkin-card strong,
.technology-workbench-body .task-command-center .task-panel-header h3 {
  color: #fff8e8;
}

.task-checkin-card p {
  margin: 3px 0 0;
  color: rgba(181, 211, 214, 0.86);
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 12px;
}

.task-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 420px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.1), rgba(255, 248, 232, 0.035)),
    rgba(12, 17, 18, 0.92);
}

.task-panel-active {
  background:
    linear-gradient(180deg, rgba(45, 99, 101, 0.18), rgba(255, 248, 232, 0.035)),
    rgba(12, 17, 18, 0.92);
}

.task-panel-header,
.task-card-header,
.task-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-panel-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(214, 185, 123, 0.18);
}

.task-panel-header h3 {
  margin: 3px 0 0;
  color: #fff8e8;
  font-size: 22px;
  line-height: 1.15;
}

.task-panel-header em {
  border: 1px solid rgba(181, 211, 214, 0.28);
  border-radius: 999px;
  color: rgba(255, 248, 232, 0.9);
  font-size: 13px;
  font-style: normal;
  padding: 6px 10px;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.94), rgba(237, 246, 242, 0.92)),
    #f6f8f6;
  color: #082533;
}

.task-card.completed {
  border-color: rgba(32, 160, 132, 0.45);
  background:
    linear-gradient(135deg, rgba(237, 251, 245, 0.98), rgba(255, 248, 232, 0.9)),
    #f2fbf6;
}

.task-card-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.task-card-header {
  justify-content: flex-start;
}

.task-card-header > div {
  min-width: 0;
}

.task-card-header strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: #082533;
  font-size: 18px;
  line-height: 1.2;
}

.task-card-header em {
  margin-left: auto;
  border-radius: 999px;
  background: rgba(15, 107, 102, 0.1);
  color: #0f6b66;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 5px 9px;
}

.task-type-sigil {
  display: grid;
  flex: 0 0 50px;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(15, 107, 102, 0.24);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(15, 107, 102, 0.16), rgba(224, 163, 50, 0.12)),
    rgba(255, 255, 255, 0.58);
  color: #0f6b66;
  font-weight: 900;
  overflow: hidden;
}

.task-type-sigil.task-type-sigil-image {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.task-type-sigil-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

.task-type-sigil-text {
  font-size: 15px;
  line-height: 1;
}

.task-card p {
  margin: 0;
  color: #40535b;
  line-height: 1.55;
}

.task-card-lines {
  display: grid;
  gap: 7px;
}

.task-meta,
.task-reward {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: #557078;
  font-size: 13px;
  line-height: 1.45;
}

.task-meta b,
.task-reward b {
  color: #082533;
}

.task-reward > span {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.task-reward i {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(15, 107, 102, 0.14);
  border-radius: 999px;
  background: rgba(15, 107, 102, 0.07);
  color: #30545c;
  font-style: normal;
  padding: 3px 7px;
}

.task-reward i.primary {
  border-color: rgba(224, 163, 50, 0.38);
  background: rgba(224, 163, 50, 0.14);
  color: #6a4c13;
}

.task-reward-chip.has-resource-icon {
  padding: 2px 8px 2px 3px;
}

.task-reward-icon {
  display: grid;
  flex: 0 0 20px;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 2px 6px rgba(19, 47, 44, 0.12);
}

.task-reward-icon img {
  display: block;
  width: 21px;
  height: 21px;
  object-fit: contain;
}

.task-progress-row {
  display: grid;
  gap: 6px;
}

.task-progress-row small {
  color: #557078;
}

.task-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #dfe9e8;
}

.task-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f6b66, #20a084);
}

button.task-primary-action,
button.task-reset-button,
button.task-quiet-action {
  min-height: 42px;
  white-space: nowrap;
}

button.task-primary-action {
  align-self: start;
  border-color: #0f6b66;
  background: linear-gradient(180deg, #158177, #0d6b63);
  box-shadow: 0 10px 18px rgba(15, 107, 102, 0.18);
  font-weight: 800;
}

button.task-primary-action:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #189083, #0f746b);
}

button.task-primary-action:active,
button.task-reset-button:active,
button.task-quiet-action:active {
  transform: translateY(1px);
}

button.task-reset-button {
  gap: 8px;
  border-color: rgba(181, 211, 214, 0.36);
  background: rgba(255, 248, 232, 0.08);
  color: #fff8e8;
}

button.task-reset-button small {
  color: rgba(181, 211, 214, 0.86);
}

button.task-quiet-action {
  border-color: rgba(15, 107, 102, 0.22);
  background: rgba(255, 255, 255, 0.72);
}

.task-empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 190px;
  border: 1px dashed rgba(214, 185, 123, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 248, 232, 0.08), rgba(45, 99, 101, 0.06)),
    rgba(5, 8, 10, 0.18);
  color: rgba(255, 248, 232, 0.72);
  text-align: center;
}

.task-empty-state strong {
  color: #fff8e8;
  font-size: 18px;
}

.task-empty-state span {
  max-width: 34ch;
  color: rgba(181, 211, 214, 0.86);
  line-height: 1.5;
}

.task-empty-state-large {
  min-height: 330px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 900px) {
  .task-briefing-card,
  .task-layout {
    grid-template-columns: 1fr;
  }

  .task-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-panel {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .technology-workbench-body .task-command-center,
  .task-briefing-card,
  .task-dashboard,
  .task-layout,
  .task-panel,
  .task-card,
  .task-card-main {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .task-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-dashboard,
  .task-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-panel-header,
  .task-checkin-card {
    align-items: stretch;
    flex-direction: column;
  }

  button.task-primary-action,
  button.task-reset-button,
  button.task-quiet-action {
    width: 100%;
  }
}

.stats-grid {
  display: grid;
  gap: 0;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf2f3;
  padding: 8px 0;
}

.stat-row:last-child {
  border-bottom: 0;
}

.stat-row span {
  color: #60727a;
}

.stat-row strong {
  text-align: right;
}

.player-honor-panel {
  border-top: 1px solid #edf2f3;
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
}

.player-honor-panel .panel-title {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.player-honor-panel .panel-title span,
.player-honor-chip small {
  color: #60727a;
  font-size: 12px;
}

.player-honor-chip {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.player-honor-chip small {
  background: rgba(255, 252, 245, 0.72);
  border-radius: 999px;
  padding: 2px 6px;
}

#accountPage > section,
#playersPage > section {
  border: 0;
  background:
    radial-gradient(circle at 18% 5%, rgba(134, 207, 230, 0.3), transparent 30%),
    radial-gradient(circle at 88% 2%, rgba(255, 255, 255, 0.82), transparent 34%),
    linear-gradient(145deg, #edf2f5 0%, #f8fbfc 45%, #dbe6eb 100%);
  border-radius: 22px;
  padding: clamp(14px, 2.4vw, 28px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 24px 70px rgba(48, 68, 78, 0.12);
}

#accountPage > section > h2,
#playersPage > section > h2 {
  display: none;
}

.player-profile-console,
.player-directory-console {
  --profile-ink: #111820;
  --profile-muted: rgba(35, 52, 61, 0.62);
  --profile-line: rgba(255, 255, 255, 0.58);
  --profile-glass: rgba(255, 255, 255, 0.58);
  --profile-glass-strong: rgba(255, 255, 255, 0.78);
  --profile-accent: #147d8f;
  --profile-accent-soft: rgba(20, 125, 143, 0.14);
  color: var(--profile-ink);
}

.player-profile-console {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: clamp(14px, 2vw, 22px);
}

.player-profile-honor-rail {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr);
  align-content: stretch;
  min-height: 350px;
  align-self: stretch;
}

.player-profile-hero,
.player-profile-edit-panel,
.player-profile-glass-card,
.player-profile-console > .operation-card,
.player-directory-hero,
.player-directory-toolbar,
.player-directory-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.38)),
    rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(255, 255, 255, 0.28),
    0 20px 58px rgba(46, 64, 74, 0.14);
  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
}

.player-profile-hero::before,
.player-profile-edit-panel::before,
.player-profile-glass-card::before,
.player-profile-console > .operation-card::before,
.player-directory-hero::before,
.player-directory-toolbar::before,
.player-directory-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.82), transparent 36%),
    linear-gradient(100deg, rgba(255, 255, 255, 0.18), transparent 42%, rgba(255, 255, 255, 0.2));
  pointer-events: none;
}

.player-profile-hero {
  display: grid;
  gap: 14px;
  min-height: 350px;
  padding: clamp(20px, 3vw, 34px);
}

.player-profile-hero.select-open {
  overflow: visible;
  z-index: 320;
}

.player-profile-hero-title {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  align-self: start;
  justify-self: start;
  margin: 0;
  color: #0e1820;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: 0;
  transform: translateY(-10px);
}

.player-profile-hero-title-text {
  display: inline-block;
}

.player-profile-speed-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  min-height: 46px;
  padding: 7px 13px 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(135deg, rgba(243, 251, 249, 0.92), rgba(214, 240, 234, 0.58));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 14px 30px rgba(36, 70, 72, 0.11);
  color: #21363b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.player-profile-speed-chip i {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.player-profile-speed-chip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-profile-speed-chip strong {
  color: #10252b;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.player-profile-hero-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(180px, 230px);
  gap: clamp(16px, 2.2vw, 26px);
  align-items: start;
}

.player-profile-avatar-stage {
  display: grid;
  place-items: center;
  position: relative;
  width: clamp(96px, 11vw, 142px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 32px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.9), transparent 36%),
    linear-gradient(145deg, rgba(229, 239, 245, 0.82), rgba(255, 255, 255, 0.4));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 46px rgba(42, 59, 68, 0.16);
}

.player-profile-avatar-stage .player-avatar {
  width: clamp(68px, 8vw, 98px);
  height: clamp(68px, 8vw, 98px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.92), transparent 32%),
    linear-gradient(145deg, #f2f7fa, #aebfc9 52%, #f8fbfc);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 16px 38px rgba(31, 50, 60, 0.18);
  color: #0c2730;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}

.player-profile-avatar-trigger {
  appearance: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.player-profile-avatar-trigger:hover .player-avatar,
.player-profile-avatar-trigger:focus-visible .player-avatar {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 42px rgba(10, 124, 112, 0.2);
}

.player-profile-avatar-trigger:focus-visible {
  outline: 3px solid rgba(27, 175, 156, 0.26);
  outline-offset: 5px;
}

.player-profile-character-avatar-image {
  display: block;
  width: clamp(78px, 8.6vw, 110px);
  height: clamp(78px, 8.6vw, 110px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.88), transparent 34%),
    linear-gradient(145deg, rgba(241, 248, 247, 0.92), rgba(202, 220, 218, 0.58));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 16px 38px rgba(31, 50, 60, 0.18);
  object-fit: cover;
  object-position: center 32%;
}

.player-profile-avatar-file-input {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.player-profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-profile-avatar-actions-floating {
  bottom: 8px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  z-index: 2;
}

.player-profile-avatar-action {
  appearance: none;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(225, 246, 242, 0.68)),
    rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 10px 22px rgba(22, 76, 75, 0.14);
  color: #0a6764;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-height: 32px;
  padding: 0 14px;
  white-space: nowrap;
}

.player-profile-avatar-action.secondary {
  color: rgba(41, 62, 66, 0.72);
}

.player-profile-hero-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.player-profile-character-panel {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: start;
  display: grid;
  gap: 10px;
  justify-self: end;
  width: min(230px, 100%);
  margin-top: 0;
}

.player-profile-character-frame {
  position: relative;
  display: grid;
  align-items: end;
  justify-items: center;
  height: clamp(240px, 23vw, 320px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.84), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(224, 244, 240, 0.18)),
    rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(33, 70, 66, 0.08),
    0 18px 46px rgba(42, 59, 68, 0.12);
}

.player-profile-character-frame::after {
  content: "";
  position: absolute;
  left: 13%;
  right: 13%;
  bottom: 12px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(24, 43, 45, 0.18), transparent 68%);
  filter: blur(1px);
  pointer-events: none;
}

.player-profile-character-image {
  position: relative;
  z-index: 1;
  max-width: 118%;
  height: 96%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 18px rgba(21, 35, 38, 0.16));
  transform: translateY(4px);
}

.player-profile-character-change {
  justify-self: center;
  min-width: 96px;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background:
    radial-gradient(circle at 28% 12%, rgba(255, 255, 255, 0.92), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(231, 246, 242, 0.38)),
    rgba(255, 255, 255, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(38, 62, 60, 0.13);
  color: #206b61;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.player-profile-character-change:hover {
  background:
    radial-gradient(circle at 28% 12%, rgba(255, 255, 255, 0.98), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(218, 246, 239, 0.48)),
    rgba(255, 255, 255, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 28px rgba(38, 62, 60, 0.16);
  transform: translateY(-1px);
}

.player-profile-character-change:focus-visible {
  outline: 3px solid rgba(27, 175, 156, 0.24);
  outline-offset: 3px;
}

.player-character-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 34px);
  background:
    radial-gradient(circle at 50% 22%, rgba(238, 255, 250, 0.28), transparent 44%),
    rgba(8, 22, 26, 0.34);
  backdrop-filter: blur(16px) saturate(1.22);
  -webkit-backdrop-filter: blur(16px) saturate(1.22);
}

.player-character-picker {
  width: min(980px, 100%);
  max-height: min(82vh, 760px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(237, 249, 246, 0.58)),
    rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 26px 80px rgba(9, 25, 31, 0.22);
  color: var(--profile-ink, #111820);
}

.player-character-picker-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(330px, 460px) auto;
  align-items: center;
  gap: 14px;
  padding: clamp(18px, 2.6vw, 28px) clamp(18px, 3vw, 32px) 12px;
}

.player-character-picker-head div {
  display: grid;
  gap: 4px;
}

.player-character-picker-head span {
  color: var(--profile-accent, #147d8f);
  font-size: 13px;
  font-weight: 900;
}

.player-character-picker-head strong {
  color: #0e1820;
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 1000;
  line-height: 1.08;
  letter-spacing: 0;
}

.player-character-picker-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 5px;
  border: 1px solid rgba(30, 110, 101, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(237, 247, 244, 0.38)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 28px rgba(39, 67, 70, 0.08);
}

.player-avatar-picker-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.player-character-picker-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(38, 64, 67, 0.68);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.1;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.player-character-picker-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-character-picker-tab-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.72;
  filter: saturate(0.82) contrast(0.98);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.74),
    0 3px 8px rgba(19, 73, 68, 0.12);
}

.player-character-picker-tab.selected {
  background:
    radial-gradient(circle at 34% 16%, rgba(255, 255, 255, 0.9), transparent 48%),
    linear-gradient(180deg, rgba(202, 238, 229, 0.78), rgba(170, 222, 211, 0.54));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 18px rgba(20, 116, 100, 0.12);
  color: #126f67;
}

.player-character-picker-tab.selected .player-character-picker-tab-icon {
  opacity: 1;
  filter: saturate(1.04) contrast(1.02);
}

.player-character-picker-tab:hover {
  color: #126f67;
  transform: translateY(-1px);
}

.player-character-picker-tab:focus-visible {
  outline: 3px solid rgba(27, 175, 156, 0.22);
  outline-offset: 2px;
}

.player-character-picker-close {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background:
    radial-gradient(circle at 34% 12%, rgba(255, 255, 255, 0.92), transparent 38%),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(38, 62, 60, 0.12);
  color: rgba(21, 41, 46, 0.82);
  cursor: pointer;
  font: inherit;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.player-character-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-height: calc(min(82vh, 760px) - 170px);
  overflow: auto;
  padding: 8px clamp(18px, 3vw, 32px) clamp(18px, 3vw, 32px);
}

.player-character-option {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(38, 102, 94, 0.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 34% 0%, rgba(255, 255, 255, 0.78), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(226, 244, 239, 0.32)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 14px 34px rgba(35, 57, 62, 0.1);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.player-character-option.selected {
  border-color: rgba(14, 159, 132, 0.58);
  background:
    radial-gradient(circle at 34% 0%, rgba(255, 255, 255, 0.84), transparent 42%),
    linear-gradient(180deg, rgba(237, 255, 249, 0.72), rgba(212, 244, 235, 0.44)),
    rgba(238, 255, 249, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 38px rgba(19, 116, 99, 0.18);
}

.player-character-option:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 159, 132, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 42px rgba(35, 57, 62, 0.16);
}

.player-character-option:focus-visible {
  outline: 3px solid rgba(27, 175, 156, 0.24);
  outline-offset: 3px;
}

.player-character-option-stage {
  position: relative;
  display: grid;
  align-items: end;
  justify-items: center;
  height: 280px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.9), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(226, 242, 238, 0.26));
}

.player-character-option-stage::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 18%;
  right: 18%;
  bottom: 10px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(24, 43, 45, 0.16), transparent 68%);
}

.player-character-option-image {
  position: relative;
  z-index: 2;
  max-width: 118%;
  height: 96%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 16px 16px rgba(21, 35, 38, 0.14));
}

.player-character-option-image.character-empire_imperial_queen {
  align-self: start;
  width: 86%;
  max-width: 86%;
  height: auto;
  object-position: center top;
  transform: translateY(-4px);
}

.player-character-option-image.character-empire_corrupt_prince {
  align-self: start;
  width: 103%;
  max-width: 103%;
  height: auto;
  object-position: center top;
  transform: translateY(-82px);
}

.player-character-option-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.player-character-option-avatar {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 8px 18px rgba(30, 52, 54, 0.12);
  object-fit: cover;
  object-position: center 32%;
}

.player-character-option-meta span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.player-character-option-meta b {
  overflow: hidden;
  color: #102027;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-character-option-meta small {
  overflow: hidden;
  color: rgba(35, 52, 61, 0.58);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-character-option > i {
  justify-self: start;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #226e64;
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
}

.player-character-option.selected > i {
  background: rgba(15, 174, 145, 0.16);
  color: #087c70;
}

.player-character-picker-empty {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  min-height: 300px;
  padding: 28px;
  border: 1px solid rgba(38, 102, 94, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.78), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(226, 244, 239, 0.28)),
    rgba(255, 255, 255, 0.4);
  color: rgba(28, 51, 55, 0.64);
  text-align: center;
}

.player-character-picker-empty strong {
  color: #11242a;
  font-size: 20px;
  font-weight: 950;
}

.player-character-picker-empty span {
  max-width: 360px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.player-avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-height: calc(min(82vh, 760px) - 170px);
  overflow: auto;
  padding: 8px clamp(18px, 3vw, 32px) clamp(18px, 3vw, 32px);
}

.player-avatar-option {
  appearance: none;
  display: grid;
  gap: 12px;
  min-width: 0;
  justify-items: center;
  padding: 18px 14px 14px;
  border: 1px solid rgba(38, 102, 94, 0.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.78), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(226, 244, 239, 0.32)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 14px 34px rgba(35, 57, 62, 0.1);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.player-avatar-option.selected {
  border-color: rgba(14, 159, 132, 0.58);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.86), transparent 46%),
    linear-gradient(180deg, rgba(237, 255, 249, 0.74), rgba(212, 244, 235, 0.46)),
    rgba(238, 255, 249, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 38px rgba(19, 116, 99, 0.18);
}

.player-avatar-option:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 159, 132, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 42px rgba(35, 57, 62, 0.16);
}

.player-avatar-option:focus-visible {
  outline: 3px solid rgba(27, 175, 156, 0.24);
  outline-offset: 3px;
}

.player-avatar-option-preview {
  display: grid;
  width: clamp(92px, 8vw, 122px);
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.94), transparent 34%),
    linear-gradient(145deg, rgba(238, 249, 247, 0.92), rgba(191, 222, 218, 0.58));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(31, 76, 74, 0.13);
}

.player-avatar-option-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
}

.player-avatar-option-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  width: 100%;
}

.player-avatar-option-copy b {
  overflow: hidden;
  color: #102027;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-avatar-option-copy small {
  overflow: hidden;
  color: rgba(35, 52, 61, 0.58);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-avatar-option > i {
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #226e64;
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
}

.player-avatar-option.selected > i {
  background: rgba(15, 174, 145, 0.16);
  color: #087c70;
}

.player-avatar-picker-grid.custom {
  grid-template-columns: minmax(0, 1fr);
}

.player-avatar-picker-custom-panel {
  display: grid;
  align-content: center;
  grid-column: 1 / -1;
  gap: 12px;
  justify-items: center;
  min-height: 360px;
  place-items: center;
}

.player-avatar-custom-upload-button {
  appearance: none;
  display: grid;
  gap: 14px;
  min-width: min(280px, 100%);
  min-height: 210px;
  place-items: center;
  padding: 26px 30px;
  border: 1px solid rgba(25, 139, 124, 0.2);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.86), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(222, 246, 240, 0.34)),
    rgba(255, 255, 255, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 38px rgba(19, 74, 70, 0.12);
  color: #086f67;
  cursor: pointer;
  font: inherit;
  font-weight: 950;
  letter-spacing: 0;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.player-avatar-custom-upload-button:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 159, 132, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 20px 46px rgba(19, 74, 70, 0.16);
}

.player-avatar-custom-upload-button:focus-visible {
  outline: 3px solid rgba(27, 175, 156, 0.24);
  outline-offset: 3px;
}

.player-avatar-custom-upload-button i {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.94), transparent 34%),
    linear-gradient(145deg, rgba(238, 249, 247, 0.92), rgba(191, 222, 218, 0.58));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(31, 76, 74, 0.13);
  color: #0b8c7e;
  font-size: 40px;
  font-style: normal;
  line-height: 1;
}

.player-avatar-custom-upload-button i img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.player-avatar-custom-upload-button b {
  color: #086f67;
  font-size: 18px;
  line-height: 1.2;
}

.player-avatar-custom-upload-rule {
  max-width: min(520px, 100%);
  margin: 0;
  color: rgba(10, 58, 54, 0.66);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.45;
  text-align: center;
}

.player-profile-name-editor {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
}

.player-profile-name-editor.editing {
  width: min(520px, 100%);
}

.player-profile-display-name {
  flex: 0 1 auto;
  display: block;
  overflow: hidden;
  max-width: min(560px, calc(100% - 52px));
  color: #0e1820;
  font-size: clamp(30px, 4.2vw, 56px);
  font-weight: 1000;
  line-height: 1.12;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  text-shadow: none;
}

.player-profile-name-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  outline: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(232, 246, 244, 0.44)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -1px 0 rgba(39, 78, 70, 0.1),
    0 0 0 2px rgba(27, 134, 121, 0.13);
  color: #0e1820;
  font: inherit;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 1000;
  letter-spacing: 0;
}

.player-profile-name-input:focus {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(39, 78, 70, 0.1),
    0 0 0 3px rgba(27, 134, 121, 0.18);
}

.player-profile-name-edit-button,
.player-profile-intro-edit-button,
.player-profile-name-action,
.player-profile-intro-action {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 15px;
  appearance: none;
  background:
    radial-gradient(circle at 36% 14%, rgba(255, 255, 255, 0.94), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(231, 244, 240, 0.38)),
    rgba(255, 255, 255, 0.38);
  box-shadow:
    0 10px 20px rgba(40, 62, 57, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -1px 0 rgba(55, 88, 80, 0.1);
  color: #2e625a;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.player-profile-name-edit-button::before,
.player-profile-intro-edit-button::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 10px;
  width: 5px;
  height: 20px;
  border-radius: 999px;
  background: #2e625a;
  transform: rotate(42deg);
  transform-origin: center;
}

.player-profile-name-edit-button::after,
.player-profile-intro-edit-button::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 28px;
  width: 10px;
  height: 3px;
  border-radius: 999px;
  background: rgba(46, 98, 90, 0.72);
  transform: rotate(-10deg);
}

.player-profile-name-edit-button:hover,
.player-profile-intro-edit-button:hover,
.player-profile-name-action:hover,
.player-profile-intro-action:hover {
  background:
    radial-gradient(circle at 36% 14%, rgba(255, 255, 255, 0.98), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(231, 244, 240, 0.48)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    0 12px 24px rgba(40, 62, 57, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.player-profile-name-edit-button:focus-visible,
.player-profile-intro-edit-button:focus-visible,
.player-profile-name-action:focus-visible,
.player-profile-intro-action:focus-visible {
  outline: 3px solid rgba(27, 175, 156, 0.24);
  outline-offset: 3px;
}

.player-profile-name-action.cancel {
  color: rgba(46, 98, 90, 0.76);
}

.profile-eyebrow {
  width: fit-content;
  border: 1px solid rgba(20, 125, 143, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--profile-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 5px 10px;
}

.player-profile-hero-copy h2,
.player-directory-hero h2 {
  margin: 0;
  color: #0e1820;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.player-profile-hero-copy p,
.player-directory-hero p {
  max-width: 46ch;
  margin: 0;
  color: var(--profile-muted);
  font-size: 15px;
  line-height: 1.65;
}

.player-profile-meta-line,
.player-profile-chip-row,
.player-profile-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.player-profile-meta-line span,
.player-profile-chip-row span,
.player-profile-visibility,
.player-directory-private {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: rgba(17, 24, 32, 0.72);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 11px;
}

.player-profile-meta-line .player-profile-account-status.healthy,
.player-profile-chip-row .player-profile-account-status.healthy {
  border-color: rgba(68, 206, 164, 0.28);
  background:
    radial-gradient(circle at 26% 12%, rgba(255, 255, 255, 0.78), transparent 42%),
    linear-gradient(135deg, rgba(220, 250, 239, 0.86), rgba(191, 244, 224, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 8px 18px rgba(42, 176, 139, 0.1);
  color: #08796f;
  font-weight: 850;
}

.player-profile-chip-row .player-profile-faction-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px 7px 12px;
  white-space: nowrap;
}

.player-profile-faction-name {
  display: inline-block;
  color: rgba(26, 53, 74, 0.76);
  font-weight: 900;
  line-height: 1;
}

.player-profile-faction-icon {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(24, 58, 86, 0.14));
}

.player-profile-nation-identity {
  grid-column: 1 / 3;
  display: grid;
  grid-template-columns: clamp(96px, 11vw, 142px) minmax(0, 420px);
  gap: clamp(16px, 2.8vw, 34px);
  align-items: center;
  width: min(100%, 620px);
  margin-top: clamp(-52px, -3.5vw, -24px);
}

.player-profile-nation-flag {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  background:
    radial-gradient(circle at 30% 16%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(224, 244, 240, 0.3)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(58, 88, 84, 0.08),
    0 16px 38px rgba(37, 58, 67, 0.12);
}

.player-profile-nation-flag-button {
  appearance: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.player-profile-nation-flag-button:hover,
.player-profile-nation-flag-button:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(58, 88, 84, 0.08),
    0 18px 42px rgba(10, 124, 112, 0.18);
}

.player-profile-nation-flag-button:focus-visible {
  outline: 3px solid rgba(27, 175, 156, 0.24);
  outline-offset: 5px;
}

.player-profile-nation-flag::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.28), transparent 48%),
    rgba(236, 250, 247, 0.24);
  pointer-events: none;
}

.player-profile-nation-flag-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 72%;
  height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(22, 42, 46, 0.18));
}

.player-profile-nation-flag-image.custom {
  height: 100%;
  object-fit: cover;
  width: 100%;
  filter: none;
}

.player-profile-nation-flag span {
  position: relative;
  z-index: 1;
  color: #12363d;
  font-size: 42px;
  font-weight: 950;
}

.player-profile-nation-copy {
  display: grid;
  gap: 6px;
  min-height: 78px;
  align-content: center;
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.84), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(223, 246, 242, 0.34)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 14px 32px rgba(38, 62, 60, 0.1);
}

.player-profile-nation-copy span {
  color: rgba(37, 59, 66, 0.6);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.player-profile-nation-copy strong {
  color: #0e1820;
  font-size: clamp(28px, 2.6rem, 42px);
  font-weight: 950;
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.player-profile-nation-name-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.player-profile-nation-name-editor.editing {
  width: min(360px, 100%);
}

.player-profile-nation-name {
  min-width: 0;
}

.player-profile-nation-name-input {
  height: 44px;
  border-radius: 14px;
  font-size: clamp(22px, 2.2vw, 32px);
}

.player-profile-nation-name-editor .player-profile-name-edit-button,
.player-profile-nation-name-editor .player-profile-name-action {
  width: 34px;
  height: 34px;
  border-radius: 13px;
  font-size: 18px;
}

.player-profile-nation-edit-button::before {
  left: 13px;
  top: 8px;
  width: 4px;
  height: 16px;
}

.player-profile-nation-edit-button::after {
  left: 17px;
  top: 23px;
  width: 8px;
}

.player-profile-nation-copy small {
  color: rgba(31, 49, 54, 0.58);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.player-profile-nation-avatar-actions {
  margin-top: 8px;
}

.player-profile-faction-chip.faction-new_federation .player-profile-faction-name {
  color: rgba(55, 88, 124, 0.72);
}

.player-profile-meta-line .player-profile-uid-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 7px 6px 11px;
}

.player-profile-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  min-width: 0;
}

.player-profile-uid-label {
  color: rgba(17, 24, 32, 0.46);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.player-profile-uid-value {
  color: #0e1820;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

.player-profile-uid-copy {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  appearance: none;
  background: transparent;
  box-shadow: none;
  color: #2e9fca;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.player-profile-uid-copy::before,
.player-profile-uid-copy::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 12px;
  border-radius: 3px;
}

.player-profile-uid-copy::before {
  right: 5px;
  top: 3px;
  background: currentColor;
  opacity: 0.78;
}

.player-profile-uid-copy::after {
  left: 5px;
  top: 8px;
  border: 2px solid currentColor;
  background: rgba(255, 255, 255, 0.64);
}

.player-profile-uid-copy:hover {
  background: rgba(67, 175, 207, 0.12);
  color: #1688b8;
  transform: translateY(-1px);
}

.player-profile-uid-copy:focus-visible {
  outline: 3px solid rgba(27, 175, 156, 0.24);
  outline-offset: 2px;
}

.player-profile-language-inline {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto minmax(86px, 118px);
  gap: 7px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
}

.player-profile-subject-inline {
  grid-template-columns: auto minmax(78px, 108px);
  margin-left: 0;
}

.player-profile-language-inline .exchange-glass-select {
  width: min(128px, 100%);
  z-index: 250;
}

.player-profile-language-inline .exchange-glass-select-button {
  min-height: 34px;
  grid-template-columns: minmax(0, 1fr) 12px;
  gap: 7px;
  padding: 0 12px 0 14px;
  border-radius: 17px;
  font-size: 15px;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(34, 61, 57, 0.06),
    0 8px 18px rgba(42, 72, 66, 0.08);
}

.player-profile-language-inline .exchange-glass-select-chevron {
  width: 8px;
  height: 8px;
}

.player-profile-language-inline .exchange-glass-select-chevron::before {
  border-right-width: 2px;
  border-bottom-width: 2px;
}

.player-profile-language-inline .exchange-glass-select.open {
  z-index: 340;
}

.player-profile-language-inline .exchange-glass-select-menu {
  width: max(100%, 180px);
  z-index: 350;
}

.player-profile-language-inline .exchange-glass-select-option {
  min-height: 36px;
  grid-template-columns: minmax(0, 1fr) 16px;
  padding: 0 10px 0 12px;
  border-radius: 12px;
  font-size: 15px;
}

.player-profile-language-inline > span {
  color: rgba(17, 24, 32, 0.66);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.player-profile-language-inline select {
  width: 100%;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  appearance: none;
  background:
    radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.44), transparent 38%),
    linear-gradient(135deg, rgba(43, 173, 177, 0.92), rgba(12, 120, 132, 0.9));
  box-shadow:
    0 12px 26px rgba(12, 94, 101, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(7, 71, 78, 0.18);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0;
  outline: none;
  padding: 0 34px 0 14px;
}

.player-profile-language-inline::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.9);
  border-bottom: 2px solid rgba(255, 255, 255, 0.9);
  pointer-events: none;
  transform: translateY(-64%) rotate(45deg);
}

.player-profile-language-inline select:focus-visible {
  box-shadow:
    0 0 0 4px rgba(26, 177, 170, 0.16),
    0 12px 26px rgba(12, 94, 101, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.player-profile-visibility {
  align-self: start;
  white-space: nowrap;
}

.player-profile-meta-line span.player-profile-online-status {
  position: relative;
  padding-left: 24px;
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(255, 255, 255, 0.3),
    0 10px 24px rgba(39, 67, 65, 0.08);
}

.player-profile-meta-line span.player-profile-online-status::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  transform: translateY(-50%);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.44),
    0 0 12px currentColor;
}

.player-profile-meta-line span.player-profile-online-status.online {
  background:
    radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.84), transparent 38%),
    linear-gradient(135deg, rgba(236, 255, 249, 0.92), rgba(203, 246, 232, 0.62)),
    rgba(218, 252, 242, 0.78);
  color: #08796d;
}

.player-profile-meta-line span.player-profile-online-status.online::before {
  background: #3bd4b3;
}

.player-profile-meta-line span.player-profile-online-status.offline {
  background:
    radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.86), transparent 38%),
    linear-gradient(135deg, rgba(255, 244, 244, 0.94), rgba(255, 215, 216, 0.62)),
    rgba(255, 229, 230, 0.78);
  color: #a84545;
}

.player-profile-meta-line span.player-profile-online-status.offline::before {
  background: #e75f5f;
}

.player-profile-visibility-toggle {
  position: absolute;
  top: clamp(12px, 2.2vw, 24px);
  right: clamp(20px, 3vw, 34px);
  display: inline-flex;
  align-items: center;
  justify-self: end;
  align-self: start;
  gap: 14px;
  min-height: 48px;
  padding: 7px 10px 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.7), transparent 34%),
    radial-gradient(circle at 92% 88%, rgba(60, 196, 179, 0.16), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.18)),
    rgba(236, 249, 247, 0.42);
  box-shadow:
    0 14px 34px rgba(31, 59, 66, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    inset 0 -1px 0 rgba(255, 255, 255, 0.3);
  color: rgba(35, 48, 50, 0.94);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0;
  user-select: none;
  backdrop-filter: blur(22px) saturate(1.42) contrast(1.01);
  -webkit-backdrop-filter: blur(22px) saturate(1.42) contrast(1.01);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.player-profile-visibility-toggle::before {
  content: "";
  flex: 0 0 auto;
  width: 50px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16)),
    rgba(42, 68, 70, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -10px 18px rgba(13, 28, 30, 0.1);
}

.player-profile-visibility-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 13px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.72) 42%, rgba(238, 255, 249, 0.52)),
    #ffffff;
  box-shadow:
    0 6px 14px rgba(19, 38, 36, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transform: translateY(-50%);
  transition: transform 0.18s ease, background 0.18s ease;
}

.player-profile-visibility-toggle.public::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.08)),
    linear-gradient(90deg, rgba(18, 185, 158, 0.94), rgba(92, 220, 178, 0.78));
}

.player-profile-visibility-toggle.public::after {
  transform: translate(20px, -50%);
}

.player-profile-visibility-toggle.private::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.12)),
    rgba(148, 120, 73, 0.28);
}

.player-profile-visibility-toggle span {
  white-space: nowrap;
  line-height: 1;
}

.player-profile-visibility-toggle i {
  min-width: 32px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
  color: rgba(35, 48, 50, 0.84);
  font-size: 14px;
  font-style: normal;
  line-height: 1;
  text-align: center;
}

.player-profile-visibility-toggle:hover {
  border-color: rgba(27, 175, 156, 0.36);
  box-shadow:
    0 18px 38px rgba(31, 59, 66, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

.player-profile-visibility-toggle:focus-visible {
  outline: 3px solid rgba(27, 175, 156, 0.22);
  outline-offset: 3px;
}

.player-profile-visibility.public {
  color: #075d66;
  background: rgba(221, 251, 250, 0.72);
}

.player-profile-visibility.private,
.player-directory-private {
  color: #73624a;
  background: rgba(255, 244, 220, 0.76);
}

.player-profile-intro-block {
  display: grid;
  gap: 10px;
  max-width: 860px;
  border-top: 1px solid rgba(111, 134, 145, 0.14);
  padding-top: 18px;
}

.player-profile-intro-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player-profile-intro-block span,
.profile-panel-title span {
  color: var(--profile-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.player-profile-intro-edit-button {
  width: 34px;
  height: 34px;
  border-radius: 13px;
}

.player-profile-intro-edit-button::before {
  left: 13px;
  top: 8px;
  width: 4px;
  height: 16px;
}

.player-profile-intro-edit-button::after {
  left: 17px;
  top: 24px;
  width: 8px;
  height: 2px;
}

.player-profile-intro-block strong {
  color: #111820;
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 750;
  line-height: 1.42;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.player-profile-intro-block.editing {
  max-width: 720px;
}

.player-profile-intro-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.player-profile-intro-action {
  width: 34px;
  height: 34px;
  border-radius: 13px;
  color: #2e625a;
  font-size: 18px;
}

.player-profile-intro-action.cancel {
  color: rgba(46, 98, 90, 0.76);
}

.player-profile-intro-textarea {
  width: 100%;
  min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.96), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(250, 253, 252, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(42, 68, 70, 0.04),
    0 14px 34px rgba(42, 64, 73, 0.08);
  color: #111820;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
  outline: none;
  padding: 18px 20px;
  resize: vertical;
}

.player-profile-intro-textarea:focus {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 0 0 4px rgba(27, 134, 121, 0.12),
    0 16px 36px rgba(42, 64, 73, 0.1);
}

.player-profile-action-row button,
.player-profile-edit-panel button,
.player-directory-actions button,
.player-directory-card .button-row button {
  min-height: 42px;
  border: 1px solid rgba(15, 92, 106, 0.12);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(37, 151, 171, 0.96), rgba(14, 103, 125, 0.98));
  color: #f8feff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 24px rgba(20, 125, 143, 0.18);
  font-weight: 800;
  padding: 10px 16px;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.player-profile-action-row button.secondary,
.player-directory-card .button-row button.secondary,
.player-directory-actions button.secondary {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.62);
  color: #172632;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.player-profile-action-row button:hover:not(:disabled),
.player-profile-edit-panel button:hover:not(:disabled),
.player-directory-actions button:hover:not(:disabled),
.player-directory-card .button-row button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 16px 34px rgba(20, 125, 143, 0.22);
}

.player-profile-action-row button:active:not(:disabled),
.player-profile-edit-panel button:active:not(:disabled),
.player-directory-actions button:active:not(:disabled),
.player-directory-card .button-row button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.player-profile-action-row small {
  color: var(--profile-muted);
  line-height: 1.45;
}

.player-profile-edit-panel,
.player-profile-glass-card,
.player-profile-console > .operation-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(16px, 2vw, 22px);
}

.player-profile-edit-panel {
  grid-row: span 2;
}

.profile-panel-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.profile-panel-title div {
  display: grid;
  gap: 4px;
}

.profile-panel-title strong {
  color: #111820;
  font-size: 22px;
  line-height: 1.1;
}

.profile-panel-title i {
  color: var(--profile-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.player-profile-edit-panel .form-row {
  color: rgba(17, 24, 32, 0.72);
  font-weight: 700;
}

.player-profile-edit-panel .form-row input,
.player-profile-edit-panel .form-row select,
.player-profile-edit-panel .form-row textarea,
.player-directory-toolbar .form-row input,
.player-directory-toolbar .form-row select {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 20px rgba(47, 67, 78, 0.08);
  color: #121b22;
  padding: 11px 13px;
  outline: none;
}

.player-profile-edit-panel .form-row input:focus,
.player-profile-edit-panel .form-row select:focus,
.player-profile-edit-panel .form-row textarea:focus,
.player-directory-toolbar .form-row input:focus,
.player-directory-toolbar .form-row select:focus {
  border-color: rgba(20, 125, 143, 0.52);
  box-shadow:
    0 0 0 4px rgba(20, 125, 143, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.player-profile-edit-panel .avatar-picker {
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
}

.player-profile-edit-panel .avatar-option {
  min-height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  color: #13222a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.player-profile-edit-panel .avatar-option span {
  background: rgba(20, 125, 143, 0.12);
  color: #075d66;
}

.player-profile-edit-panel .avatar-option.selected {
  border-color: rgba(20, 125, 143, 0.5);
  background: rgba(230, 250, 252, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(20, 125, 143, 0.34),
    0 10px 24px rgba(20, 125, 143, 0.1);
}

.player-profile-wide,
.player-profile-console > .wide-card {
  grid-column: 1 / -1;
}

.player-profile-ideology-panel {
  align-self: end;
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
}

.player-profile-ideology-panel .recipe-preview-title {
  align-items: start;
}

.player-profile-ideology-panel .recipe-preview-title strong {
  font-size: 18px;
}

.player-profile-ideology-panel .recipe-preview-title span {
  font-size: 13px;
}

.player-profile-console .operation-card .job-detail {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.player-profile-console > .operation-card .form-row select {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 20px rgba(47, 67, 78, 0.08);
  color: #121b22;
  padding: 11px 13px;
  outline: none;
}

.player-profile-console > .operation-card .form-row select:focus {
  border-color: rgba(20, 125, 143, 0.52);
  box-shadow:
    0 0 0 4px rgba(20, 125, 143, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.player-profile-console > .operation-card button {
  min-height: 42px;
  border: 1px solid rgba(15, 92, 106, 0.12);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(37, 151, 171, 0.96), rgba(14, 103, 125, 0.98));
  color: #f8feff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 24px rgba(20, 125, 143, 0.18);
  font-weight: 800;
  padding: 10px 16px;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.player-profile-console > .operation-card button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 16px 34px rgba(20, 125, 143, 0.22);
}

.player-profile-console .stat-row,
.player-directory-card .stat-row {
  border-color: rgba(83, 105, 115, 0.12);
  padding: 9px 0;
}

.player-profile-ideology-panel .stat-row {
  grid-template-columns: minmax(86px, 0.78fr) minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
}

.player-profile-ideology-panel .stat-row span {
  font-size: 13px;
}

.player-profile-ideology-panel .stat-row strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.player-profile-ideology-icon-row strong {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.player-profile-ideology-value-icon {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 5px 12px rgba(25, 48, 54, 0.12);
}

.player-profile-ideology-icon-row strong b {
  min-width: 0;
  overflow: hidden;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-stat-card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.player-stat-card {
  display: grid;
  gap: 8px;
  min-height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  padding: 13px;
}

.player-stat-card span {
  color: var(--profile-muted);
  font-size: 12px;
  font-weight: 800;
}

.player-stat-card strong {
  align-self: end;
  color: #111820;
  font-size: clamp(16px, 1.5vw, 22px);
  line-height: 1.1;
  word-break: break-word;
}

.player-stat-card.primary {
  background:
    linear-gradient(145deg, rgba(222, 251, 255, 0.78), rgba(255, 255, 255, 0.52)),
    rgba(255, 255, 255, 0.72);
}

.player-island-stat-list {
  gap: 10px;
}

.player-island-stat {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  padding: 12px;
}

.player-island-stat .player-island-capital-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 14px;
  border: 1px solid rgba(207, 159, 53, 0.35);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 244, 190, 0.98), rgba(231, 190, 83, 0.82)),
    #f1d079;
  color: #6f4d10;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 7px 14px rgba(162, 111, 22, 0.12);
}

.player-island-stat > div:last-child {
  min-width: 160px;
}

.player-island-stat i {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 56, 67, 0.1);
}

.player-island-stat i::before {
  content: "";
  display: block;
  width: var(--share, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5fd6df, #147d8f);
}

.player-honor-panel {
  border-top-color: rgba(83, 105, 115, 0.12);
}

.player-profile-honor-rail .player-honor-panel {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.player-profile-honor-rail .player-honor-panel .panel-title {
  align-items: start;
  display: grid;
  gap: 5px;
}

.player-honor-panel .panel-title span,
.player-honor-chip small {
  color: var(--profile-muted);
}

.player-profile-console .leaderboard-honor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-profile-honor-rail .leaderboard-honor-list {
  display: grid;
  gap: 10px;
}

.player-profile-honor-rail .leaderboard-honor-list .empty-state {
  min-height: 180px;
  align-content: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  color: rgba(17, 24, 32, 0.72);
}

.player-honor-chip {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.42));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  padding: 7px 9px 7px 12px;
}

.player-profile-honor-rail .player-honor-chip {
  border-radius: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-items: stretch;
  padding: 10px 12px;
  width: 100%;
}

.player-profile-honor-rail {
  overflow: visible;
  z-index: 4;
}

.player-profile-honor-rail .recipe-preview-title {
  align-items: start;
}

.player-honor-showcase {
  position: relative;
  display: grid;
  gap: 14px;
}

.player-honor-showcase-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.player-honor-showcase-slot-wrap {
  position: relative;
  min-width: 0;
}

.player-honor-showcase-slot-wrap.open {
  z-index: 30;
}

.player-honor-showcase-slot {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  min-height: 92px;
  border: 1px solid rgba(20, 125, 143, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.36)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(42, 69, 76, 0.08);
  color: #0d3a36;
  cursor: pointer;
  padding: 10px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.player-honor-showcase-slot:disabled {
  cursor: default;
}

.player-honor-showcase-slot:not(:disabled):hover,
.player-honor-showcase-slot-wrap.open .player-honor-showcase-slot {
  border-color: rgba(0, 148, 131, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 16px 30px rgba(26, 104, 96, 0.14);
  transform: translateY(-1px);
}

.player-honor-slot-plus {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid rgba(20, 125, 143, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.94), rgba(240, 251, 248, 0.58)),
    rgba(255, 255, 255, 0.62);
  color: #0a8f82;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.player-honor-showcase-slot.filled {
  align-content: center;
  gap: 8px;
}

.player-honor-slot-medal {
  display: grid;
  place-items: center;
}

.player-honor-slot-copy {
  display: grid;
  gap: 2px;
  max-width: 100%;
  text-align: center;
}

.player-honor-slot-copy strong,
.player-honor-slot-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-honor-slot-copy strong {
  color: #0c3835;
  font-size: 12px;
  font-weight: 950;
}

.player-honor-slot-copy small {
  color: rgba(25, 57, 58, 0.58);
  font-size: 11px;
  font-weight: 800;
}

.player-honor-showcase-empty {
  margin: 0;
  color: var(--profile-muted);
  font-size: 14px;
  line-height: 1.5;
}

.player-honor-showcase .leaderboard-rank-badge {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fffdf5;
  isolation: isolate;
  line-height: 1;
}

.player-honor-showcase .leaderboard-rank-badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(32, 58, 57, 0.18));
}

.player-honor-showcase .leaderboard-rank-badge b {
  position: absolute;
  right: -2px;
  bottom: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border: 2px solid rgba(255, 255, 246, 0.96);
  border-radius: 999px;
  background: #0b8f82;
  box-shadow:
    0 4px 10px rgba(22, 56, 54, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  color: #fffdf5;
  font-size: 12px;
  font-weight: 950;
}

.player-honor-showcase .leaderboard-rank-badge.rank-1 b {
  background: #b88b24;
}

.player-honor-showcase .leaderboard-rank-badge.rank-2 b {
  background: #7d8d95;
}

.player-honor-showcase .leaderboard-rank-badge.rank-3 b {
  background: #a1642c;
}

.player-honor-showcase .leaderboard-rank-badge.plain,
.player-honor-showcase .leaderboard-rank-badge.rank-empty {
  border-radius: 999px;
  background: rgba(20, 125, 143, 0.12);
  color: #0b514b;
}

.player-honor-showcase .leaderboard-rank-badge.plain b,
.player-honor-showcase .leaderboard-rank-badge.rank-empty b {
  position: static;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #0b514b;
}

.player-honor-picker {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 64px));
  padding: 12px;
  border: 1px solid rgba(20, 125, 143, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(236, 250, 246, 0.9)),
    rgba(255, 255, 255, 0.9);
  box-shadow:
    0 24px 50px rgba(32, 57, 62, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.player-honor-showcase-slot-wrap:nth-child(3n) .player-honor-picker {
  right: 0;
  left: auto;
}

.player-honor-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.player-honor-picker-head strong {
  color: #0d3432;
  font-size: 15px;
  font-weight: 950;
}

.player-honor-picker-head button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(20, 125, 143, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(13, 52, 50, 0.72);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.player-honor-picker-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

.player-honor-picker-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  border: 1px solid rgba(20, 125, 143, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  color: #0c3835;
  padding: 8px 10px;
  text-align: left;
}

.player-honor-picker-option.selected {
  border-color: rgba(0, 143, 130, 0.48);
  background:
    linear-gradient(145deg, rgba(0, 143, 130, 0.18), rgba(255, 255, 255, 0.72));
}

.player-honor-picker-option.used:not(.selected) {
  opacity: 0.72;
}

.player-honor-picker-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.player-honor-picker-option strong,
.player-honor-picker-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-honor-picker-option strong {
  font-size: 14px;
  font-weight: 950;
}

.player-honor-picker-option small,
.player-honor-picker-empty {
  color: rgba(25, 57, 58, 0.62);
  font-size: 12px;
  font-weight: 800;
}

.player-honor-picker-rank {
  width: 44px;
  height: 44px;
}

.player-honor-picker-empty {
  border: 1px dashed rgba(20, 125, 143, 0.22);
  border-radius: 14px;
  padding: 14px;
  line-height: 1.5;
}

.player-honor-picker-clear {
  justify-self: stretch;
  min-height: 40px;
  border: 1px solid rgba(176, 88, 76, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #9a3d34;
  font-weight: 950;
}

.player-directory-console {
  display: grid;
  gap: 12px;
}

.player-directory-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: clamp(18px, 2.4vw, 30px);
}

.player-directory-toolbar {
  grid-template-columns: minmax(240px, 1.4fr) minmax(180px, 0.8fr) auto;
  align-items: end;
  margin-bottom: 0;
  padding: 14px;
}

.player-directory-summary {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.player-directory-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.player-directory-card {
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.player-directory-card-head .player-avatar {
  border-color: rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at 32% 20%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(145deg, #eef5f8, #b4c4cc);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 26px rgba(47, 67, 78, 0.14);
}

.directory-chip-row {
  gap: 6px;
}

.directory-chip-row span {
  font-size: 11px;
  padding: 7px 9px;
}

.player-directory-card .player-introduction {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.42);
}

.player-directory-private {
  width: fit-content;
}

.compact-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.compact-stats .stat-row {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.44);
  padding: 10px;
}

.compact-stats .stat-row strong {
  text-align: left;
}

@media (max-width: 980px) {
  .player-profile-console,
  .player-profile-hero-main,
  .player-directory-hero,
  .player-directory-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .player-profile-edit-panel {
    grid-row: auto;
  }

  .player-profile-honor-rail {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
  }

  .player-profile-avatar-stage {
    width: 118px;
  }

  .player-profile-avatar-action {
    min-height: 30px;
    padding: 0 12px;
  }

  .player-profile-nation-identity {
    grid-column: auto;
    grid-template-columns: 118px minmax(0, 1fr);
    width: 100%;
    margin-top: 6px;
  }

  .player-profile-character-panel {
    grid-column: auto;
    justify-self: start;
    width: min(260px, 100%);
    margin-top: 4px;
  }

  .player-profile-character-frame {
    height: 280px;
  }

  .player-character-picker-head {
    grid-template-columns: minmax(180px, 1fr) minmax(280px, 420px) auto;
  }

  .player-character-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-stat-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #accountPage > section,
  #playersPage > section {
    border-radius: 18px;
    padding: 12px;
  }

  .player-profile-hero,
  .player-profile-edit-panel,
  .player-profile-glass-card,
  .player-profile-console > .operation-card,
  .player-directory-hero,
  .player-directory-toolbar,
  .player-directory-card {
    border-radius: 18px;
  }

  .player-profile-visibility-toggle {
    position: static;
    justify-self: start;
  }

  .player-profile-hero-title {
    gap: 10px;
  }

  .player-profile-speed-chip {
    min-width: 118px;
    min-height: 42px;
    padding: 6px 12px 6px 8px;
  }

  .player-profile-action-row,
  .player-directory-actions,
  .player-directory-card .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .player-profile-action-row button,
  .player-profile-edit-panel button,
  .player-directory-actions button,
  .player-directory-card .button-row button {
    width: 100%;
  }

  .player-profile-name-editor.editing {
    width: 100%;
  }

  .player-profile-name-input {
    width: 100%;
    font-size: 24px;
  }

  .player-profile-display-name {
    max-width: calc(100% - 52px);
  }

  .player-profile-nation-identity {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
  }

  .player-profile-nation-copy {
    min-height: 72px;
    padding: 12px 14px;
  }

  .player-profile-nation-avatar-actions {
    gap: 6px;
  }

  .player-profile-nation-copy strong {
    font-size: 26px;
  }

  .player-profile-language-inline {
    width: min(190px, 100%);
  }

  .player-profile-subject-inline {
    margin-left: 0;
    width: min(190px, 100%);
  }

  .player-profile-character-panel {
    justify-self: stretch;
    width: 100%;
  }

  .player-profile-character-frame {
    height: 300px;
  }

  .player-character-picker-backdrop {
    align-items: end;
    padding: 10px;
  }

  .player-character-picker {
    max-height: 88vh;
    border-radius: 22px;
  }

  .player-character-picker-head {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 16px 16px 10px;
  }

  .player-character-picker-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-character-picker-tab {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 13px;
  }

  .player-character-picker-grid {
    grid-template-columns: minmax(0, 1fr);
    max-height: calc(88vh - 150px);
    padding: 6px 16px 16px;
  }

  .player-avatar-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: calc(88vh - 150px);
    padding: 6px 16px 16px;
  }

  .player-avatar-picker-grid.custom {
    grid-template-columns: minmax(0, 1fr);
  }

  .player-avatar-picker-custom-panel {
    min-height: 280px;
  }

  .player-character-option-stage {
    height: 240px;
  }

  .player-profile-intro-block.editing {
    max-width: 100%;
  }

  .player-profile-intro-textarea {
    min-height: 140px;
  }

  .player-stat-card-grid,
  .compact-stats,
  .player-island-stat {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .player-profile-hero,
  .player-profile-edit-panel,
  .player-profile-glass-card,
  .player-profile-console > .operation-card,
  .player-directory-hero,
  .player-directory-toolbar,
  .player-directory-card {
    animation: profilePanelIn 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .player-profile-edit-panel,
  .player-directory-card:nth-child(2n) {
    animation-delay: 0.04s;
  }

  .player-profile-glass-card,
  .player-directory-card:nth-child(3n) {
    animation-delay: 0.08s;
  }
}

@keyframes profilePanelIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .player-profile-hero,
  .player-profile-edit-panel,
  .player-profile-glass-card,
  .player-profile-console > .operation-card,
  .player-directory-hero,
  .player-directory-toolbar,
  .player-directory-card {
    background: rgba(255, 255, 255, 0.94);
  }
}

.workforce-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid #edf2f3;
  margin-top: 14px;
  padding-top: 14px;
}

.workforce-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.workforce-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.workforce-card {
  display: grid;
  gap: 8px;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px;
}

.workforce-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workforce-card-head strong {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.workforce-type-icon {
  display: block;
  height: 28px;
  object-fit: contain;
  width: 28px;
}

.workforce-card-head span {
  border-radius: 999px;
  background: #e8f1f0;
  color: #0f6b66;
  font-size: 12px;
  padding: 3px 8px;
}

.workforce-needs {
  display: grid;
  gap: 6px;
}

.workforce-finance {
  display: grid;
  gap: 6px;
  border: 1px solid #e2ebee;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.workforce-sources {
  display: grid;
  gap: 6px;
  border: 1px solid #e2ebee;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.workforce-finance-title,
.workforce-finance-item,
.workforce-source-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.workforce-finance-title span {
  color: #60727a;
  font-size: 12px;
}

.workforce-finance-list {
  display: grid;
  gap: 5px;
  border-top: 1px solid #edf2f3;
  padding-top: 6px;
}

.workforce-finance-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
  color: #40535b;
  font-size: 12px;
}

.workforce-source-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
  color: #40535b;
  font-size: 12px;
}

.workforce-finance-item span,
.workforce-source-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workforce-finance-item small,
.workforce-source-item small,
.workforce-source-empty {
  color: #60727a;
}

.workforce-finance-item strong,
.workforce-source-item strong {
  font-size: 12px;
}

.workforce-source-warning {
  border-top: 1px solid #edf2f3;
  color: #a15c00;
  font-size: 12px;
  padding-top: 6px;
}

.workforce-need {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  color: #40535b;
  font-size: 12px;
}

.workforce-need span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workforce-need small {
  color: #60727a;
}

.workforce-need strong {
  font-size: 12px;
}

.job-item {
  border-bottom: 1px solid #edf2f3;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.job-item:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.job-item .row {
  border-bottom: 0;
}

.job-detail {
  color: #60727a;
  font-size: 13px;
  line-height: 1.5;
}

.job-group {
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.job-group-header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid #dbe4e7;
  border-radius: 0;
  background: #f8fbfb;
  color: #18252d;
  text-align: left;
}

.job-group-header small {
  display: block;
  margin-top: 3px;
  color: #60727a;
}

.job-group .job-item {
  padding: 8px 10px;
  margin-bottom: 0;
}

.completed-jobs {
  border-top: 1px solid #edf2f3;
  margin-top: 12px;
  padding-top: 10px;
}

.completed-title {
  color: #60727a;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

body[data-page="data"] {
  background:
    linear-gradient(135deg, #071112 0%, #102426 46%, #171713 100%);
  overflow-x: hidden;
}

body[data-page="data"] .app {
  max-width: none;
}

body[data-page="data"] #dataPage,
body[data-page="data"] #dataPage > section,
body[data-page="data"] #dataOverview {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

body[data-page="data"] .island-subpage-layout {
  display: block;
}

body[data-page="data"] .island-subpage-nav {
  display: none;
}

body[data-page="data"] .island-subpage-content {
  width: 100%;
}

body[data-page="data"] #dataPage > section > h2 {
  display: none;
}

.technology-workbench-body .statistics-command-center {
  margin: 0 auto;
  max-width: 1440px;
}

.statistics-command-center {
  color: #17272b;
  display: grid;
  gap: 14px;
  max-width: 100%;
  min-width: 0;
  padding-bottom: 96px;
}

.statistics-brief {
  align-items: stretch;
  background: linear-gradient(135deg, #111819 0%, #1c2b29 56%, #604c20 100%);
  border: 1px solid rgba(214, 179, 100, 0.36);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(5, 9, 10, 0.24);
  color: #fbf6e8;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 250px;
  min-height: 176px;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.statistics-brief::before {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 74px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 46px);
  content: "";
  inset: 0;
  opacity: 0.32;
  pointer-events: none;
  position: absolute;
}

.statistics-brief-main,
.statistics-brief-stamp {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.statistics-brief-main > span,
.statistics-panel-header span,
.statistics-observation-strip > div span {
  color: #d3a841;
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.statistics-brief-main h2 {
  color: #fff8e8;
  font-size: 36px;
  line-height: 1.1;
  margin: 7px 0 9px;
}

.statistics-brief-main p {
  color: rgba(251, 246, 232, 0.76);
  line-height: 1.6;
  margin: 0;
  max-width: 720px;
  overflow-wrap: anywhere;
}

.statistics-brief-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.statistics-brief-tags b,
.statistics-focus-pill {
  align-items: center;
  background: rgba(250, 243, 225, 0.11);
  border: 1px solid rgba(250, 243, 225, 0.18);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
}

.statistics-brief-stamp {
  align-self: end;
  background: rgba(14, 18, 17, 0.52);
  border: 1px solid rgba(214, 179, 100, 0.32);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 16px;
}

.statistics-brief-stamp span,
.statistics-brief-stamp small {
  color: rgba(251, 246, 232, 0.66);
  font-size: 12px;
}

.statistics-brief-stamp strong {
  color: #fff7df;
  font-size: 21px;
  line-height: 1.2;
}

.statistics-kpi-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.statistics-kpi {
  background: #fbfaf4;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
}

.statistics-kpi span,
.statistics-kpi small,
.statistics-panel-header small {
  color: #65747a;
  font-size: 12px;
  line-height: 1.45;
}

.statistics-kpi strong {
  color: #17272b;
  font-size: 27px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.statistics-kpi.is-gdp {
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: inset 4px 0 0 #0f766e;
}

.statistics-kpi.is-civic {
  border-color: rgba(138, 164, 94, 0.46);
  box-shadow: inset 4px 0 0 #8aa45e;
}

.statistics-kpi.is-storage {
  border-color: rgba(59, 130, 160, 0.34);
  box-shadow: inset 4px 0 0 #3b82a0;
}

.statistics-kpi.is-honor {
  border-color: rgba(176, 132, 42, 0.42);
  box-shadow: inset 4px 0 0 #b0842a;
}

.statistics-observation-strip {
  align-items: center;
  background: #fffdf7;
  border: 1px solid #dbe3df;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 190px minmax(0, 1fr);
  padding: 16px;
}

.statistics-observation-strip h3 {
  color: #14242a;
  font-size: 20px;
  line-height: 1.2;
  margin: 3px 0 0;
}

.statistics-observation-strip ul {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.statistics-observation-strip li {
  background: #f7faf7;
  border: 1px solid #e0e8e3;
  border-radius: 8px;
  color: #344a50;
  font-size: 13px;
  line-height: 1.5;
  min-height: 44px;
  padding: 10px 12px;
}

.statistics-chart-grid,
.statistics-insight-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.statistics-insight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.statistics-panel {
  align-content: start;
  background: #fffdf7;
  border: 1px solid #dbe3df;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
}

.statistics-panel-header {
  align-items: start;
  border-bottom: 1px solid #edf1ed;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 12px;
}

.statistics-panel-header h3 {
  color: #14242a;
  font-size: 20px;
  line-height: 1.2;
  margin: 3px 0 0;
}

.statistics-panel-header small {
  text-align: right;
}

.statistics-bar-chart {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-auto-flow: column;
  grid-auto-columns: minmax(78px, 1fr);
  justify-content: center;
  min-height: 260px;
  overflow-x: auto;
  padding: 8px 4px 0;
}

.statistics-bar-column {
  align-items: center;
  display: grid;
  gap: 8px;
  justify-items: center;
  justify-self: center;
  max-width: 140px;
  min-width: 0;
  width: 100%;
}

.statistics-bar-track {
  align-items: end;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.05), rgba(211, 168, 65, 0.08)),
    #edf3ef;
  border: 1px solid #dfe8e3;
  border-radius: 8px;
  display: flex;
  height: 178px;
  justify-content: center;
  max-width: 118px;
  overflow: hidden;
  padding: 0 10px;
  width: 100%;
}

.statistics-bar-track i {
  border-radius: 8px 8px 0 0;
  display: block;
  min-height: 8px;
  width: 100%;
}

.statistics-bar-column strong,
.statistics-bar-column span {
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-bar-column strong {
  color: #14242a;
  font-size: 13px;
}

.statistics-bar-column span {
  color: #60727a;
  font-size: 12px;
  font-weight: 900;
}

.statistics-donut-layout {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 164px minmax(0, 1fr);
}

.statistics-donut {
  align-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(23, 39, 43, 0.12);
  display: flex;
  height: 164px;
  justify-content: center;
  width: 164px;
}

.statistics-donut > div {
  align-content: center;
  background: #fffdf7;
  border: 1px solid #e1e7e2;
  border-radius: 50%;
  display: grid;
  height: 112px;
  justify-items: center;
  padding: 12px;
  text-align: center;
  width: 112px;
}

.statistics-donut strong {
  color: #14242a;
  font-size: 14px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-donut small {
  color: #65747a;
  font-size: 11px;
  margin-top: 4px;
}

.statistics-legend,
.statistics-industry-bars,
.statistics-civic-list,
.statistics-change-chart {
  display: grid;
  gap: 9px;
}

.statistics-legend div,
.statistics-industry-row,
.statistics-change-row {
  align-items: center;
  display: grid;
  gap: 9px;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  min-width: 0;
}

.statistics-legend i {
  border-radius: 50%;
  display: block;
  height: 10px;
  width: 10px;
}

.statistics-legend span,
.statistics-industry-row span,
.statistics-change-row span {
  color: #344a50;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-legend strong,
.statistics-industry-row strong,
.statistics-change-row strong {
  color: #17272b;
  font-size: 13px;
  white-space: nowrap;
}

.statistics-industry-row,
.statistics-change-row {
  grid-template-columns: 64px minmax(0, 1fr) auto;
}

.statistics-industry-row i,
.statistics-change-row i,
.statistics-gauge-row > i {
  background: #dfe8e3;
  border-radius: 999px;
  display: block;
  height: 9px;
  overflow: hidden;
}

.statistics-industry-row em,
.statistics-change-row em,
.statistics-gauge-row > i em {
  background: linear-gradient(90deg, #0f766e, #d3a841);
  display: block;
  height: 100%;
}

.statistics-change-row.negative em {
  background: linear-gradient(90deg, #9b4b3f, #d3a841);
}

.statistics-gauge-row {
  background: #f8faf7;
  border: 1px solid #e1e8e2;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 72px;
  padding: 10px;
}

.statistics-gauge-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.statistics-gauge-row strong {
  color: #14242a;
}

.statistics-gauge-row span {
  color: #60727a;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.statistics-gauge-row b {
  color: #0f766e;
  font-size: 18px;
  line-height: 1.15;
  white-space: nowrap;
}

.statistics-gauge-row > i {
  grid-column: 1 / -1;
}

.statistics-matrix-panel {
  overflow: hidden;
}

.statistics-matrix-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.statistics-matrix-row {
  align-items: center;
  background: #fafcf8;
  border: 1px solid #e0e8e3;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(170px, 1.2fr) 78px 76px 78px 82px 94px minmax(124px, 1fr) 96px 70px;
  min-height: 58px;
  min-width: 950px;
  padding: 10px;
}

.statistics-matrix-row.head {
  background: #17201d;
  border-color: #17201d;
  color: #f7efd9;
  font-size: 12px;
  font-weight: 900;
  min-height: 38px;
}

.statistics-matrix-row.selected {
  background: #edf7f3;
  border-color: rgba(15, 118, 110, 0.36);
}

.statistics-matrix-row:not(.head) > span {
  color: #344a50;
  font-size: 13px;
  min-width: 0;
}

.statistics-matrix-row strong {
  color: #13262b;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-matrix-row small {
  color: #60727a;
  display: block;
  font-size: 12px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-focus-pill {
  background: #eef4ed;
  border-color: #dbe7db;
  color: #31574e;
  min-height: 26px;
}

.statistics-link-button {
  background: #123936;
  border-color: #123936;
  color: #fff;
  min-width: 58px;
}

.statistics-link-button:hover {
  background: #0f766e;
  border-color: #0f766e;
}

.statistics-public-panel {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.06), rgba(211, 168, 65, 0.08)),
    #fffdf7;
}

.statistics-public-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
}

.statistics-public-copy {
  background: #f8faf7;
  border: 1px solid #e1e8e2;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.statistics-public-copy strong {
  color: #14242a;
}

.statistics-public-copy span,
.statistics-honor-list span {
  color: #60727a;
  font-size: 13px;
  line-height: 1.5;
}

.statistics-honor-list {
  align-content: start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.statistics-honor-list b {
  background: linear-gradient(180deg, #fff7de, #f0dfb5);
  border: 1px solid rgba(155, 115, 40, 0.28);
  border-radius: 999px;
  color: #5b4216;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 12px;
}

@media (max-width: 1180px) {
  .statistics-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .statistics-chart-grid,
  .statistics-insight-grid,
  .statistics-public-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .statistics-brief {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  body[data-page="data"] .app {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding-left: 12px;
    padding-right: 12px;
  }

  .statistics-brief-main h2 {
    font-size: 30px;
  }

  .statistics-brief-tags b {
    white-space: normal;
  }

  .statistics-kpi,
  .statistics-panel,
  .statistics-observation-strip,
  .statistics-public-copy {
    min-width: 0;
  }

  .statistics-kpi-grid,
  .statistics-observation-strip,
  .statistics-observation-strip ul,
  .statistics-donut-layout {
    grid-template-columns: 1fr;
  }

  .statistics-panel-header {
    display: grid;
  }

  .statistics-panel-header small {
    text-align: left;
  }

  .statistics-donut {
    justify-self: center;
  }

  .statistics-industry-row,
  .statistics-change-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .statistics-industry-row strong,
  .statistics-change-row strong {
    grid-column: 2;
    justify-self: end;
  }
}

.production-command-center {
  color: #17272b;
  display: grid;
  gap: 14px;
  padding-bottom: 96px;
}

.production-brief {
  align-items: stretch;
  background: linear-gradient(135deg, #121817 0%, #1f2a26 58%, #59481d 100%);
  border: 1px solid rgba(214, 179, 100, 0.36);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(5, 9, 10, 0.24);
  color: #fbf6e8;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 240px;
  min-height: 160px;
  overflow: hidden;
  padding: 22px;
  position: relative;
}

.production-brief::before {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 70px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 42px);
  content: "";
  inset: 0;
  opacity: 0.34;
  pointer-events: none;
  position: absolute;
}

.production-brief-main,
.production-brief-stamp {
  position: relative;
  z-index: 1;
}

.production-brief-main > span,
.production-panel-header span {
  color: #d3a841;
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.production-brief-main h2 {
  font-size: 34px;
  line-height: 1.1;
  margin: 6px 0 8px;
}

.production-brief-main p {
  color: rgba(251, 246, 232, 0.76);
  line-height: 1.55;
  margin: 0;
  max-width: 680px;
}

.production-brief-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.production-brief-tags b,
.production-status-pill {
  align-items: center;
  background: rgba(250, 243, 225, 0.11);
  border: 1px solid rgba(250, 243, 225, 0.18);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
}

.production-brief-stamp {
  align-self: end;
  background: rgba(14, 18, 17, 0.52);
  border: 1px solid rgba(214, 179, 100, 0.32);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 16px;
}

.production-brief-stamp span,
.production-brief-stamp small {
  color: rgba(251, 246, 232, 0.66);
  font-size: 12px;
}

.production-brief-stamp strong {
  color: #fff7df;
  font-size: 20px;
  line-height: 1.2;
}

.production-kpi-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.production-kpi-card {
  background: #fbfaf4;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 16px;
}

.production-kpi-card span,
.production-kpi-card small {
  color: #65747a;
  font-size: 12px;
}

.production-kpi-card strong {
  color: #17272b;
  font-size: 30px;
  line-height: 1;
}

.production-kpi-card.is-active {
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: inset 4px 0 0 #0f766e;
}

.production-kpi-card.is-gold {
  border-color: rgba(176, 132, 42, 0.42);
  box-shadow: inset 4px 0 0 #b0842a;
}

.production-dashboard-grid,
.production-current-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
}

.production-panel {
  align-content: start;
  background: #fffdf7;
  border: 1px solid #dbe3df;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.production-panel-header {
  align-items: start;
  border-bottom: 1px solid #edf1ed;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 12px;
}

.production-panel-header h3 {
  color: #14242a;
  font-size: 20px;
  line-height: 1.2;
  margin: 3px 0 0;
}

.production-panel-header small {
  color: #60727a;
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.production-island-list,
.production-flow-sections {
  align-content: start;
  display: grid;
  gap: 8px;
  grid-auto-rows: min-content;
}

.production-island-list {
  max-height: 390px;
  overflow: auto;
  padding-right: 2px;
}

.production-island-row {
  align-items: center;
  background: #f7faf7;
  border: 1px solid #e0e8e3;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, 1.25fr) 54px 54px minmax(96px, 0.7fr) auto auto;
  min-height: 68px;
  padding: 10px;
}

.production-island-row.selected,
.production-matrix-row.selected {
  background: #edf7f3;
  border-color: rgba(15, 118, 110, 0.36);
}

.production-island-name {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.production-island-name strong,
.production-matrix-row strong {
  color: #13262b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-island-name small,
.production-matrix-row small {
  color: #60727a;
  display: block;
  font-size: 12px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-island-row > div:not(.production-island-name):not(.production-island-progress) {
  display: grid;
  gap: 2px;
}

.production-island-row span {
  color: #687980;
  font-size: 11px;
}

.production-island-row b {
  color: #17272b;
  font-size: 18px;
}

.production-island-progress {
  display: grid;
  gap: 6px;
}

.production-island-progress i,
.production-progress-track {
  background: #dfe8e3;
  border-radius: 999px;
  display: block;
  height: 7px;
  overflow: hidden;
}

.production-island-progress em,
.production-progress-track i {
  background: linear-gradient(90deg, #0f766e, #d3a841);
  display: block;
  height: 100%;
}

.production-status-pill {
  background: #eef4ed;
  border-color: #dbe7db;
  color: #31574e;
  justify-self: start;
}

.production-link-button {
  background: #123936;
  border-color: #123936;
  color: #fff;
  min-width: 58px;
}

.production-link-button:hover {
  background: #0f766e;
  border-color: #0f766e;
}

.production-flow-panel {
  align-content: start;
}

.production-flow-block {
  display: grid;
  gap: 8px;
}

.production-flow-title {
  color: #41565e;
  font-size: 13px;
  font-weight: 800;
}

.production-flow-item {
  background: #f8faf7;
  border: 1px solid #e1e8e2;
  border-left: 4px solid #0f766e;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 10px;
}

.production-flow-item.is-pending {
  border-left-color: #8b7a45;
}

.production-flow-item.is-completed {
  border-left-color: #60727a;
}

.production-flow-item-head {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.production-flow-item-head strong {
  color: #14242a;
}

.production-flow-item-head small,
.production-flow-item-head span {
  color: #60727a;
  font-size: 12px;
}

.production-flow-empty {
  background: #f6f7f2;
  border: 1px dashed #dce3dc;
  border-radius: 8px;
  color: #78858a;
  font-size: 13px;
  padding: 12px;
}

.production-job-products {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.production-product-chip {
  align-items: center;
  background: #fffdf7;
  border: 1px solid #dbe4de;
  border-radius: 999px;
  color: #2d4349;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
  min-height: 26px;
  padding: 0 8px;
}

.production-product-chip i {
  align-items: center;
  background: #edf5f2;
  border-radius: 50%;
  display: inline-flex;
  font-size: 11px;
  height: 18px;
  justify-content: center;
  overflow: hidden;
  width: 18px;
}

.production-product-chip .product-icon-image {
  height: 18px;
  object-fit: cover;
  width: 18px;
}

.production-product-chip.muted {
  color: #728289;
  font-weight: 700;
}

.production-matrix-panel {
  overflow: hidden;
}

.production-matrix-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.production-matrix-row {
  align-items: center;
  background: #fafcf8;
  border: 1px solid #e0e8e3;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(170px, 1.3fr) 90px 64px 64px 64px minmax(150px, 1fr) 120px 70px;
  min-height: 58px;
  min-width: 850px;
  padding: 10px;
}

.production-matrix-row.head {
  background: #17201d;
  border-color: #17201d;
  color: #f7efd9;
  font-size: 12px;
  font-weight: 800;
  min-height: 38px;
}

.production-matrix-row:not(.head) > span {
  color: #344a50;
  font-size: 13px;
  min-width: 0;
}

.production-subpanel {
  background: #f8faf7;
  border: 1px solid #e0e8e3;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.production-subpanel-title {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.production-subpanel-title strong {
  color: #14242a;
}

.production-subpanel-title span {
  color: #60727a;
  font-size: 12px;
}

.production-building-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.production-building-card {
  background: #fffdf7;
  border: 1px solid #dbe4de;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  min-height: 156px;
  padding: 12px;
}

.production-building-card.is-running {
  box-shadow: inset 3px 0 0 #0f766e;
}

.production-building-card.is-paused {
  box-shadow: inset 3px 0 0 #8b7a45;
}

.production-building-card-head,
.production-building-meta {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.production-building-card-head strong {
  color: #14242a;
  display: block;
  line-height: 1.25;
}

.production-building-card-head small,
.production-building-meta span {
  color: #60727a;
  font-size: 12px;
}

.production-building-card-head > span {
  background: #eef4ed;
  border-radius: 999px;
  color: #31574e;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.production-building-main {
  display: grid;
  gap: 4px;
}

.production-building-main span {
  color: #60727a;
  font-size: 12px;
}

.production-building-main strong {
  color: #182a30;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.production-filter-tabs {
  margin-bottom: 0;
}

.production-job-list .job-group,
.production-job-list .completed-jobs {
  background: #fffdf7;
}

@media (max-width: 1100px) {
  .production-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .production-dashboard-grid,
  .production-current-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .production-brief {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .production-brief-main h2 {
    font-size: 28px;
  }

  .production-kpi-grid {
    grid-template-columns: 1fr;
  }

  .production-panel-header,
  .production-flow-item-head,
  .production-subpanel-title {
    display: grid;
    text-align: left;
  }

  .production-panel-header small {
    text-align: left;
  }

  .production-island-row {
    grid-template-columns: minmax(0, 1fr) 58px 58px;
  }

  .production-island-progress,
  .production-status-pill,
  .production-island-row .production-link-button {
    grid-column: 1 / -1;
  }

  .production-island-row .production-link-button {
    justify-self: stretch;
  }
}

.message {
  display: grid;
  gap: 8px;
  color: #40535b;
  line-height: 1.6;
}

.message-item {
  border-bottom: 1px solid #edf2f3;
  padding-bottom: 8px;
  overflow-wrap: anywhere;
}

.message-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

body[data-page="chat"] .app {
  max-width: none;
  min-height: 100vh;
  padding: calc(var(--global-topbar-height) + 16px) clamp(14px, 3vw, 30px) calc(var(--global-bottom-nav-reserve) + 22px);
  background:
    radial-gradient(circle at 14% 16%, rgba(85, 200, 189, 0.18), transparent 30%),
    radial-gradient(circle at 88% 6%, rgba(224, 194, 111, 0.14), transparent 26%),
    linear-gradient(135deg, #07181c 0%, #0d2b2f 45%, #11140f 100%);
}

body[data-page="chat"] #chatPage > section > h2 {
  display: none;
}

.chat-directorate-shell {
  --chat-ink: #f8f1df;
  --chat-muted: rgba(248, 241, 223, 0.66);
  --chat-soft: rgba(248, 241, 223, 0.1);
  --chat-glass: rgba(7, 24, 25, 0.62);
  --chat-glass-strong: rgba(10, 30, 31, 0.82);
  --chat-line: rgba(229, 206, 147, 0.2);
  --chat-line-strong: rgba(229, 206, 147, 0.42);
  --chat-gold: #e0c26f;
  --chat-teal: #55c8bd;
  --chat-danger: #d36a5c;
  display: grid;
  gap: 14px;
  color: var(--chat-ink);
}

.chat-directorate-shell a {
  color: inherit;
  text-decoration: none;
}

.chat-command-hero,
.chat-channel-list,
.chat-panel,
.chat-dossier {
  border: 1px solid var(--chat-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    var(--chat-glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 20px 46px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(26px) saturate(1.35) contrast(1.02);
  -webkit-backdrop-filter: blur(26px) saturate(1.35) contrast(1.02);
}

.chat-command-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 12px;
  overflow: hidden;
  border-radius: 24px;
  padding: clamp(16px, 2.4vw, 26px);
}

.chat-command-hero::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(224, 194, 111, 0.2), transparent 40%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
  content: "";
}

.chat-hero-copy,
.chat-hero-metrics {
  position: relative;
  z-index: 1;
}

.chat-eyebrow,
.chat-rail-title span,
.chat-channel-group > span,
.chat-panel-header > div > span,
.chat-dossier-head span {
  color: var(--chat-gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chat-hero-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.chat-hero-title-row img {
  width: 78px;
  height: 78px;
  border: 1px solid rgba(229, 206, 147, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  object-fit: cover;
}

.chat-hero-title-row h2 {
  margin: 0;
  color: var(--chat-ink);
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 950;
  line-height: 0.98;
}

.chat-hero-title-row p {
  max-width: 58ch;
  margin: 10px 0 0;
  color: var(--chat-muted);
  font-size: 15px;
  line-height: 1.65;
}

.chat-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.chat-hero-metric {
  min-width: 0;
  border: 1px solid rgba(229, 206, 147, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  padding: 13px;
}

.chat-hero-metric span,
.chat-hero-metric small,
.chat-channel-copy small,
.chat-dossier-list dt,
.chat-translation-note span {
  color: var(--chat-muted);
  font-size: 12px;
}

.chat-hero-metric strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--chat-ink);
  font-size: 21px;
  font-weight: 950;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hero-metric small {
  display: block;
  margin-top: 6px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: start;
}

.chat-channel-list,
.chat-panel,
.chat-dossier {
  border-radius: 22px;
  padding: 14px;
}

.chat-channel-list {
  position: sticky;
  top: calc(var(--global-topbar-height) + 12px);
  display: grid;
  gap: 13px;
}

.chat-rail-title {
  display: grid;
  gap: 4px;
}

.chat-rail-title strong,
.chat-dossier-head strong {
  color: var(--chat-ink);
  font-size: 19px;
  font-weight: 950;
}

.chat-channel-group {
  display: grid;
  gap: 7px;
}

.chat-channel-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(229, 206, 147, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--chat-ink);
  text-align: left;
}

.chat-channel-button:hover,
.chat-channel-button:focus-visible {
  border-color: var(--chat-line-strong);
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.chat-channel-button.selected {
  border-color: rgba(85, 200, 189, 0.52);
  background: rgba(23, 139, 129, 0.32);
  box-shadow: inset 0 0 0 1px rgba(85, 200, 189, 0.18);
}

.chat-channel-button.locked {
  opacity: 0.72;
}

.chat-channel-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(224, 194, 111, 0.16);
  color: var(--chat-gold);
  font-size: 15px;
  font-weight: 950;
}

.chat-channel-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chat-channel-copy strong {
  overflow: hidden;
  color: var(--chat-ink);
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-channel-badge {
  min-width: 42px;
  border: 1px solid rgba(229, 206, 147, 0.18);
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--chat-muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.chat-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.chat-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.chat-panel-header strong {
  display: block;
  margin-top: 3px;
  color: var(--chat-ink);
  font-size: 25px;
  font-weight: 950;
  line-height: 1.1;
}

.chat-panel-header small {
  display: block;
  max-width: 58ch;
  margin-top: 6px;
  color: var(--chat-muted);
  font-size: 13px;
  line-height: 1.5;
}

.chat-channel-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid rgba(85, 200, 189, 0.26);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(85, 200, 189, 0.1);
  color: var(--chat-ink);
  font-size: 13px;
  font-weight: 900;
}

.chat-channel-status i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--chat-teal);
}

.chat-channel-status.warning,
.chat-channel-status.cooldown {
  border-color: rgba(224, 194, 111, 0.36);
  background: rgba(224, 194, 111, 0.12);
}

.chat-channel-status.warning i,
.chat-channel-status.cooldown i {
  background: var(--chat-gold);
}

.chat-channel-status.danger {
  border-color: rgba(211, 106, 92, 0.42);
  background: rgba(211, 106, 92, 0.14);
}

.chat-channel-status.danger i {
  background: var(--chat-danger);
}

.chat-scope-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chat-scope-strip span,
.chat-recipient-line,
.chat-compose,
.chat-warning,
.chat-empty-state,
.chat-translation-note {
  border: 1px solid rgba(229, 206, 147, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.065);
}

.chat-scope-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--chat-muted);
  font-size: 12px;
  font-weight: 800;
}

.chat-scope-strip strong {
  color: var(--chat-ink);
}

.chat-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  color: #f7c79a;
}

.chat-warning.danger {
  border-color: rgba(211, 106, 92, 0.38);
  color: #ffd9d2;
}

.chat-warning strong,
.chat-warning span {
  display: block;
}

.chat-warning strong {
  margin-bottom: 3px;
  color: var(--chat-ink);
  font-size: 14px;
}

.chat-warning span {
  color: currentColor;
  font-size: 13px;
  line-height: 1.5;
}

.chat-warning button,
.chat-empty-state button,
.chat-send-button {
  border: 1px solid rgba(224, 194, 111, 0.36);
  border-radius: 14px;
  background: rgba(224, 194, 111, 0.18);
  color: var(--chat-ink);
  font-weight: 900;
}

.chat-recipient-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.chat-recipient-line span,
.chat-recipient-line em {
  color: var(--chat-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.chat-recipient-line strong {
  border: 1px solid rgba(85, 200, 189, 0.24);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(85, 200, 189, 0.1);
  color: var(--chat-ink);
  font-size: 12px;
}

.chat-target-input,
.chat-compose textarea {
  min-width: 0;
  border: 1px solid rgba(229, 206, 147, 0.16);
  border-radius: 14px;
  background: rgba(5, 15, 15, 0.38);
  color: var(--chat-ink);
}

.chat-target-input {
  min-height: 40px;
}

.chat-target-input::placeholder,
.chat-compose textarea::placeholder {
  color: rgba(248, 241, 223, 0.38);
}

.chat-message-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 400px;
  max-height: min(58vh, 620px);
  overflow: auto;
  border: 1px solid rgba(229, 206, 147, 0.12);
  border-radius: 18px;
  background: rgba(0, 7, 8, 0.22);
  padding: 12px;
  scrollbar-width: thin;
}

.chat-message-row {
  display: grid;
  align-items: start;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr);
  width: min(86%, 680px);
  border: 1px solid rgba(229, 206, 147, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  padding: 12px;
}

.chat-message-avatar {
  width: 44px;
}

.chat-message-avatar .player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 8px 18px rgba(5, 18, 20, 0.16);
}

.chat-message-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.chat-message-row.own {
  justify-self: end;
  border-color: rgba(85, 200, 189, 0.28);
  background: rgba(23, 139, 129, 0.18);
}

.chat-message-row.private {
  border-color: rgba(224, 194, 111, 0.22);
}

.chat-message-meta,
.chat-message-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-message-meta {
  color: var(--chat-muted);
  font-size: 13px;
}

.chat-message-meta strong {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  color: var(--chat-ink);
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-alliance-tag {
  color: var(--chat-muted);
  font-weight: 900;
}

.chat-message-sender .inline-player-link {
  min-width: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
}

.chat-message-meta span,
.chat-message-foot span {
  flex: 0 0 auto;
}

.chat-message-row p {
  margin: 0;
  color: rgba(248, 241, 223, 0.9);
  font-size: 15px;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.chat-message-foot {
  justify-content: start;
}

.chat-message-foot span,
.chat-translation {
  border: 1px solid rgba(229, 206, 147, 0.12);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--chat-muted);
  font-size: 11px;
}

.chat-private-arrow {
  color: var(--chat-gold);
}

.chat-empty-state {
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 18px;
  color: var(--chat-muted);
}

.chat-empty-state strong {
  color: var(--chat-ink);
  font-size: 17px;
}

.chat-empty-state span {
  font-size: 13px;
  line-height: 1.5;
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
}

.chat-compose-input {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.chat-compose-input > span {
  color: var(--chat-muted);
  font-size: 12px;
  font-weight: 850;
}

.chat-compose textarea {
  min-height: 86px;
  resize: vertical;
}

.chat-compose-foot {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 132px;
}

.chat-compose-meta {
  position: relative;
  display: grid;
  gap: 5px;
  align-content: start;
  overflow: hidden;
  border: 1px solid rgba(229, 206, 147, 0.12);
  border-radius: 14px;
  background: rgba(0, 7, 8, 0.2);
  padding: 10px;
  color: var(--chat-muted);
  font-size: 12px;
  font-weight: 850;
}

.chat-compose-meta b {
  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  height: 3px;
  background: linear-gradient(90deg, var(--chat-gold), var(--chat-danger));
}

.chat-send-button {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 8px 18px;
  background:
    linear-gradient(180deg, rgba(224, 194, 111, 0.78), rgba(178, 139, 52, 0.76)),
    rgba(224, 194, 111, 0.22);
  color: #15130c;
}

.chat-send-button small {
  color: rgba(21, 19, 12, 0.62);
  font-size: 10px;
  font-weight: 950;
}

.chat-send-button:disabled {
  border-color: rgba(229, 206, 147, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 241, 223, 0.38);
}

.chat-dossier {
  position: sticky;
  top: calc(var(--global-topbar-height) + 12px);
  display: grid;
  gap: 13px;
}

.chat-dossier-head {
  display: grid;
  gap: 5px;
}

.chat-dossier-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.chat-dossier-list div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid rgba(229, 206, 147, 0.12);
  padding: 11px 0;
}

.chat-dossier-list div:last-child {
  border-bottom: 0;
}

.chat-dossier-list dt,
.chat-dossier-list dd {
  margin: 0;
}

.chat-dossier-list dd {
  color: var(--chat-ink);
  font-size: 13px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.chat-translation-note {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.chat-translation-note strong {
  color: var(--chat-gold);
  font-size: 13px;
}

@media (max-width: 1120px) {
  .chat-command-hero,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-channel-list,
  .chat-dossier {
    position: static;
  }

  .chat-channel-list {
    display: flex;
    overflow-x: auto;
    padding: 12px;
    scrollbar-width: thin;
  }

  .chat-rail-title {
    flex: 0 0 150px;
  }

  .chat-channel-group {
    flex: 0 0 min(310px, 82vw);
  }

  .chat-dossier {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 760px) {
  body[data-page="chat"] .app {
    padding: calc(var(--global-topbar-height) + 10px) 10px calc(var(--global-bottom-nav-reserve) + 20px);
  }

  .chat-command-hero,
  .chat-channel-list,
  .chat-panel,
  .chat-dossier {
    border-radius: 18px;
    padding: 12px;
  }

  .chat-hero-title-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
  }

  .chat-hero-title-row img {
    width: 52px;
    height: 52px;
    border-radius: 15px;
  }

  .chat-hero-title-row h2 {
    font-size: 34px;
  }

  .chat-hero-title-row p {
    font-size: 13px;
  }

  .chat-hero-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .chat-hero-metric strong {
    font-size: 17px;
  }

  .chat-panel-header,
  .chat-warning,
  .chat-message-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-channel-status {
    width: max-content;
  }

  .chat-message-list {
    min-height: 360px;
    max-height: 52vh;
  }

  .chat-message-row {
    grid-template-columns: 38px minmax(0, 1fr);
    width: 100%;
  }

  .chat-message-avatar,
  .chat-message-avatar .player-avatar {
    width: 38px;
    height: 38px;
  }

  .chat-message-meta {
    align-items: center;
    flex-direction: row;
  }

  .chat-recipient-line,
  .chat-compose {
    grid-template-columns: 1fr;
  }

  .chat-compose-foot {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: none;
  }

  .chat-dossier {
    grid-template-columns: 1fr;
  }
}

.debug-page {
  display: grid;
  gap: 12px;
}

.debug-card {
  background: white;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
}

.dev-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dev-inventory-tool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}

.dev-inventory-tool label {
  display: grid;
  gap: 4px;
  min-width: 180px;
  color: #60727a;
  font-size: 12px;
}

.dev-inventory-tool select,
.dev-inventory-tool input {
  border: 1px solid #c8d4d8;
  border-radius: 6px;
  font: inherit;
  min-height: 38px;
  padding: 8px;
}

.dev-speed-tool {
  background: #f6faf8;
  border: 1px solid #dbe8dd;
  border-radius: 8px;
  padding: 10px;
}

.dev-speed-current {
  align-self: center;
  color: #60727a;
  font-size: 13px;
}

.debug-grid-tool {
  display: grid;
  gap: 12px;
}

.debug-toggle-row {
  align-items: center;
  color: #20333a;
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
}

.debug-grid-control-layout {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 0.6fr);
}

.debug-color-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.debug-color-grid label {
  color: #60727a;
  display: grid;
  font-size: 12px;
  gap: 5px;
}

.debug-color-grid input[type="color"] {
  border: 1px solid #c8d4d8;
  border-radius: 6px;
  height: 38px;
  padding: 3px;
  width: 100%;
}

.debug-range-row {
  grid-column: span 2;
}

.debug-range-row input[type="range"] {
  width: 100%;
}

.debug-range-row span {
  color: #20333a;
  font-weight: 800;
}

.island-grid-debug-preview {
  min-height: 210px;
  overflow: hidden;
  position: relative;
  border: 1px solid #c8d4d8;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 36%, rgba(var(--island-grid-highlight-rgb, 255, 255, 255), var(--island-grid-highlight-opacity, 0.76)), transparent 46%),
    radial-gradient(circle, rgba(var(--island-grid-dot-rgb, 77, 127, 140), var(--island-grid-dot-opacity, 0.2)) 0 1px, transparent 1.6px),
    linear-gradient(180deg, var(--island-grid-bg-top, #f3fbfc) 0%, var(--island-grid-bg-mid, #e1f4f6) 54%, var(--island-grid-bg-bottom, #cce8eb) 100%);
  background-size: auto, 16px 16px, auto;
}

.island-grid-debug-preview.disabled::after {
  position: absolute;
  right: 10px;
  bottom: 9px;
  content: "æœªå¯ç”?;
  color: rgba(32, 51, 58, 0.62);
  font-size: 12px;
  font-weight: 800;
}

.island-grid-debug-preview svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.island-grid-debug-preview-lines polygon {
  fill: none;
  stroke: rgba(var(--island-grid-line-rgb, 95, 143, 154), var(--island-grid-line-opacity, 0.32));
  stroke-dasharray: 6 6;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.island-grid-debug-preview-lines line {
  stroke: rgba(var(--island-grid-ridge-rgb, 110, 163, 171), var(--island-grid-ridge-opacity, 0.18));
  stroke-dasharray: 5 7;
  stroke-linecap: round;
  stroke-width: 1.3;
}

@media (max-width: 760px) {
  .debug-grid-control-layout {
    grid-template-columns: 1fr;
  }

  .debug-range-row {
    grid-column: span 1;
  }
}

.asset-manager-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
}

.asset-upload-panel,
.asset-list-panel {
  border: 1px solid #e0e8eb;
  border-radius: 8px;
  padding: 12px;
}

.asset-form-grid,
.asset-display-grid,
.asset-filter-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.asset-form-grid label,
.asset-display-grid label,
.asset-filter-row label,
.asset-apply-row {
  color: #60727a;
  display: grid;
  font-size: 12px;
  gap: 4px;
}

.asset-form-grid select,
.asset-form-grid input,
.asset-filter-row select,
.asset-display-grid input {
  border: 1px solid #c8d4d8;
  border-radius: 6px;
  font: inherit;
  min-height: 38px;
  padding: 8px;
}

.asset-apply-row {
  align-items: center;
  display: flex;
  margin: 10px 0;
}

.asset-standard {
  color: #60727a;
  font-size: 12px;
  margin-top: 8px;
}

.asset-filter-row {
  margin-bottom: 10px;
}

.asset-filter-count {
  color: #60727a;
  font-size: 12px;
  margin: 0 0 10px;
}

.asset-preview-box {
  align-items: center;
  background: #f7faf9;
  border: 1px dashed #c8d4d8;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  margin: 10px 0;
  min-height: 92px;
  padding: 10px;
}

.asset-preview-box img,
.asset-thumb {
  background:
    linear-gradient(45deg, #eef3f1 25%, transparent 25%),
    linear-gradient(-45deg, #eef3f1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef3f1 75%),
    linear-gradient(-45deg, transparent 75%, #eef3f1 75%),
    #ffffff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  height: 78px;
  object-fit: contain;
  width: 78px;
}

.asset-list {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
}

.asset-card {
  align-items: center;
  border: 1px solid #edf2f4;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 128px 1fr;
  padding: 10px;
}

.asset-card.inactive {
  background: #f8faf9;
  opacity: 0.72;
}

.asset-visual-column {
  align-items: center;
  display: grid;
  justify-items: center;
}

.asset-hex-preview {
  display: block;
  height: 120px;
  width: 120px;
}

.asset-hex-fill {
  fill: #f6f1e5;
  filter: drop-shadow(0 4px 8px rgba(11, 37, 44, 0.12));
  stroke: #d7c99e;
  stroke-width: 1;
}

.asset-hex-outline {
  fill: none;
  stroke: rgba(16, 52, 59, 0.42);
  stroke-width: 1.5;
}

.asset-hex-center-line {
  stroke: rgba(7, 93, 82, 0.36);
  stroke-linecap: round;
  stroke-width: 1.5;
}

.asset-icon-preview {
  display: block;
  height: 96px;
  width: 96px;
}

.asset-icon-fill {
  fill: #f7faf9;
  filter: drop-shadow(0 4px 8px rgba(11, 37, 44, 0.1));
  stroke: #dbe4e7;
  stroke-width: 1;
}

.asset-card-body {
  display: grid;
  gap: 6px;
}

.asset-card-body span {
  color: #60727a;
  font-size: 12px;
}

.asset-status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  padding: 2px 7px;
  vertical-align: middle;
}

.asset-status.active {
  background: #e6f4ef;
  color: #0f766e;
}

.asset-status.inactive {
  background: #f4e8e8;
  color: #9f1d1d;
}

.asset-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.danger {
  background: #b42318;
  border-color: #b42318;
  color: white;
}

.recipe-status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.recipe-status.ready {
  background: #e7f4ed;
  color: #17633a;
}

.recipe-status.pending {
  background: #fff4df;
  color: #8a4b00;
}

.recipe-warning-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.recipe-warning-summary div {
  background: #f8fbfb;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.recipe-warning-summary span {
  color: #60727a;
  font-size: 12px;
}

.recipe-warning-summary strong {
  color: #102026;
  font-size: 18px;
}

.recipe-warning {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  margin: 2px;
  padding: 4px 8px;
}

.recipe-warning.ok {
  background: #edf2f3;
  color: #40535b;
}

.recipe-warning.pending,
.recipe-warning.heavy-output {
  background: #fff4df;
  color: #8a4b00;
}

.recipe-warning.free-output,
.recipe-warning.missing-source {
  background: #fdecec;
  color: #b42318;
}

.technology-lock-note {
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  font-size: 13px;
  padding: 8px 10px;
}

.technology-lock-note.unlocked {
  background: #e7f4ed;
  color: #17633a;
}

.technology-lock-note.locked {
  background: #fdecec;
  color: #b42318;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.ship-page-summary,
.ship-stat-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.ship-page-summary {
  margin-bottom: 14px;
}

.ship-rental-panel {
  align-items: center;
  background: #f8fbfb;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.ship-rental-panel strong {
  color: #102026;
  display: block;
  font-size: 16px;
}

.ship-rental-panel small {
  color: #60727a;
  display: block;
  margin-top: 4px;
}

.ship-rental-action {
  align-items: center;
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.ship-rental-action span {
  color: #0f766e;
  font-weight: 800;
}

.battle-dashboard {
  background: #f8fbfb;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

.battle-dashboard-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.battle-dashboard-columns {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.battle-dashboard-columns > div {
  background: #ffffff;
  border: 1px solid #edf2f3;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.battle-report-row,
.battle-protection-chip {
  border-top: 1px solid #edf2f3;
  display: grid;
  gap: 3px;
  padding-top: 8px;
}

.battle-report-row small,
.battle-protection-chip span {
  color: #60727a;
}

.ship-battle-panel {
  border-color: #c7ded9;
}

.ship-battle-controls,
.ship-battle-actions {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 0.45fr) auto;
}

.ship-battle-actions {
  align-items: center;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ship-battle-controls label {
  color: #60727a;
  display: grid;
  font-size: 13px;
  gap: 4px;
}

.battle-order-list,
.island-defense-panel,
.battle-preview-card {
  background: #ffffff;
  border: 1px solid #e3eded;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.minor-section-title {
  color: #203033;
  font-size: 13px;
  font-weight: 900;
}

.battle-order-row,
.island-defense-row {
  align-items: center;
  border-top: 1px solid #edf2f3;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 72px;
  padding-top: 8px;
}

.island-defense-row {
  grid-template-columns: auto 1fr 72px;
}

.island-defense-row.selected {
  border-color: #bad7cf;
}

.battle-order-row span,
.island-defense-row span {
  display: grid;
  gap: 2px;
}

.battle-order-row small,
.island-defense-row small,
.battle-preview-log {
  color: #60727a;
  font-size: 12px;
}

.battle-preview-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.battle-preview-log {
  border-top: 1px solid #edf2f3;
  padding-top: 8px;
}

.island-defense-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.danger-lite {
  color: #9b1c1c;
}

.ship-management-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.ship-card {
  background: #ffffff;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.ship-card-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ship-card-header strong {
  color: #102026;
  display: block;
  font-size: 18px;
}

.ship-card-header small {
  color: #60727a;
  display: block;
  margin-top: 4px;
}

.ship-status {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  white-space: nowrap;
}

.ship-status.docked {
  background: #e7f4ed;
  color: #17633a;
}

.ship-status.in_transit {
  background: #fff4df;
  color: #8a4b00;
}

.ship-bars {
  display: grid;
  gap: 8px;
}

.ship-bar-label {
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin-bottom: 5px;
}

.ship-bar-label span {
  color: #60727a;
}

.ship-bar-label strong {
  color: #102026;
}

.ship-bar-track {
  background: #edf2f3;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.ship-bar-track span {
  display: block;
  height: 100%;
}

.ship-bar.normal .ship-bar-track span {
  background: #0f766e;
}

.ship-bar.warning .ship-bar-track span {
  background: #d97706;
}

.ship-bar.danger .ship-bar-track span {
  background: #b42318;
}

.ship-component-list {
  border-top: 1px solid #edf2f3;
  display: grid;
  gap: 6px;
  padding-top: 10px;
}

.ship-modify-panel {
  background: #f8fbfb;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 10px;
}

.ship-modify-list {
  display: grid;
  gap: 8px;
}

.ship-modify-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 72px 1fr;
}

.ship-modify-row span {
  color: #60727a;
  font-size: 13px;
}

.ship-modify-row select {
  min-width: 0;
}

.ship-system-installed,
.ship-system-install {
  display: grid;
  gap: 8px;
}

.ship-system-install {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ship-system-row {
  align-items: center;
  border-top: 1px solid #edf2f3;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-top: 8px;
}

.ship-system-row span {
  color: #102026;
  font-weight: 700;
}

.ship-fuel-list {
  display: grid;
  gap: 8px;
}

.ship-fuel-row {
  align-items: center;
  border-top: 1px solid #edf2f3;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-top: 8px;
}

.ship-fuel-row strong {
  color: #102026;
  display: block;
}

.ship-fuel-row small {
  color: #60727a;
  display: block;
  margin-top: 3px;
}

.ship-fuel-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.ship-fuel-actions span {
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
}

.ship-component-row,
.ship-log-row {
  align-items: center;
  display: grid;
  gap: 8px;
}

.ship-component-row {
  grid-template-columns: 1fr auto;
}

.ship-cargo-panel {
  background: #f8fbfb;
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
}

.ship-cargo-panel.loaded {
  border-color: #71b7ad;
}

.ship-cargo-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.ship-cargo-head span,
.ship-cargo-panel small {
  color: #60727a;
}

.ship-cargo-track {
  background: #dbe4e7;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.ship-cargo-track span {
  background: #0f766e;
  display: block;
  height: 100%;
}

.ship-component-row span,
.ship-log-row span {
  color: #60727a;
}

.ship-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ship-log-panel {
  margin-top: 16px;
}

.ship-log-list {
  border: 1px solid #dbe4e7;
  border-radius: 8px;
  overflow: hidden;
}

.ship-log-row {
  grid-template-columns: 1fr 1.2fr 1.1fr 1.2fr 1.4fr auto;
  padding: 10px 12px;
}

.ship-log-row + .ship-log-row {
  border-top: 1px solid #edf2f3;
}

body[data-page="ships"] #shipsPage > section > h2 {
  display: none;
}

body[data-page="ships"] #shipsPage > section {
  background: #0f2528;
  border-radius: 0;
  box-shadow: none;
  margin: -6px -6px 0;
  padding: 0;
}

.fleet-command-page {
  background:
    linear-gradient(135deg, rgba(15, 37, 40, 0.96), rgba(21, 52, 48, 0.9) 42%, rgba(243, 238, 222, 0.98) 42%),
    #f3eede;
  color: #102026;
  display: grid;
  gap: 18px;
  min-height: calc(100vh - 120px);
  padding: 18px;
}

.fleet-command-hero {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(4, 22, 27, 0.86), rgba(7, 44, 49, 0.5) 44%, rgba(4, 22, 27, 0.2)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 18, 22, 0.08)),
    url("/assets/fleet-command/fleet_command_hero_scene_ios27_flat_v2.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 1px solid rgba(244, 232, 197, 0.2);
  border-radius: 8px;
  color: #f8f2df;
  display: grid;
  gap: 18px;
  min-height: 176px;
  overflow: hidden;
  padding: 22px 24px;
}

.fleet-command-hero-copy {
  display: grid;
  gap: 8px;
}

.fleet-command-kicker {
  color: #d4b45f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.fleet-command-hero h3 {
  font-size: 34px;
  line-height: 1.05;
  margin: 0;
}

.fleet-command-hero p {
  color: #dce8e4;
  font-size: 14px;
  margin: 0;
}

.fleet-command-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
}

.fleet-command-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.fleet-command-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.fleet-command-metric {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d9e2dc;
  border-left: 4px solid #0f766e;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 96px;
  padding: 12px;
}

.fleet-command-metric small,
.fleet-command-metric span {
  color: #60727a;
  font-size: 12px;
}

.fleet-command-metric strong {
  color: #102026;
  font-size: 22px;
  line-height: 1.1;
}

.fleet-command-metric.warning {
  border-left-color: #d97706;
}

.fleet-command-metric.battle {
  border-left-color: #a8432f;
}

.fleet-command-metric.route {
  border-left-color: #2d6f9f;
}

.fleet-command-metric.cargo {
  border-left-color: #7c6a35;
}

.fleet-command-metric.ok {
  border-left-color: #2f8f5b;
}

.fleet-command-section,
.fleet-command-inspector,
.fleet-command-drawer {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d9e2dc;
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(12, 32, 34, 0.12);
}

.fleet-command-section {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.fleet-command-section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.fleet-command-section-head strong {
  color: #102026;
  display: block;
  font-size: 17px;
}

.fleet-command-section-head small {
  color: #60727a;
  display: block;
  margin-top: 3px;
}

.fleet-command-table {
  display: grid;
  gap: 8px;
}

.fleet-ship-row {
  align-items: center;
  background: #fbfcf8;
  border: 1px solid #e1e8e2;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 0.85fr) minmax(190px, 1fr) minmax(160px, 0.75fr);
  min-height: 126px;
  padding: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.fleet-ship-row:hover,
.fleet-ship-row.selected {
  border-color: #0f766e;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.14);
}

.fleet-ship-identity,
.fleet-inspector-header > div {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.fleet-ship-mark,
.fleet-inspector-header > div > span {
  align-items: center;
  background: transparent;
  border-radius: 14px;
  color: #087c76;
  display: inline-flex;
  flex: 0 0 44px;
  font-size: 18px;
  font-weight: 900;
  height: 44px;
  justify-content: center;
  overflow: visible;
  width: 44px;
}

.fleet-ship-icon-image {
  display: block;
  filter: none;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  width: 44px;
}

.fleet-ship-identity strong,
.fleet-inspector-header strong {
  color: #102026;
  display: block;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fleet-ship-identity small,
.fleet-ship-status small,
.fleet-ship-route small,
.fleet-inspector-header small {
  color: #60727a;
  display: block;
  font-size: 12px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fleet-location-inline {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  vertical-align: middle;
}

.fleet-location-inline > span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fleet-location-pin {
  background:
    radial-gradient(circle at 30% 12%, rgba(255, 255, 255, 0.92), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(228, 241, 238, 0.38)),
    rgba(255, 255, 255, 0.36);
  border-radius: 9px;
  box-shadow:
    0 5px 10px rgba(45, 68, 62, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(69, 109, 101, 0.1);
  color: transparent;
  display: inline-grid;
  flex: 0 0 21px;
  font-size: 0;
  height: 21px;
  line-height: 0;
  overflow: visible;
  place-items: center;
  position: relative;
  text-shadow: none;
  width: 21px;
}

.fleet-location-pin::before {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 202, 202, 0.96), transparent 27%),
    linear-gradient(135deg, #ff5d66 0%, #e02e3f 58%, #a91d2d 100%);
  border-radius: 50% 50% 50% 2px;
  box-shadow:
    0 4px 9px rgba(193, 33, 51, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  content: "";
  height: 11px;
  left: 5px;
  position: absolute;
  top: 3px;
  transform: rotate(-45deg);
  width: 11px;
}

.fleet-location-pin::after {
  background: rgba(255, 250, 246, 0.96);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28),
    0 2px 5px rgba(120, 18, 31, 0.16);
  content: "";
  height: 4px;
  left: 8.5px;
  position: absolute;
  top: 6.5px;
  width: 4px;
}

.fleet-ship-status {
  display: grid;
  gap: 6px;
  grid-column: 1;
  grid-row: 2;
  justify-items: start;
}

.fleet-ship-gauges,
.fleet-inspector-gauges {
  display: grid;
  gap: 8px;
}

.fleet-ship-gauges {
  grid-column: 2 / 4;
  grid-row: 2;
}

.fleet-command-gauge {
  display: grid;
  gap: 4px;
}

.fleet-command-gauge div {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.fleet-command-gauge span {
  color: #60727a;
  font-size: 12px;
}

.fleet-command-gauge strong {
  color: #102026;
  font-size: 12px;
}

.fleet-command-gauge i {
  background: #e3ebe7;
  border-radius: 999px;
  display: block;
  height: 7px;
  overflow: hidden;
}

.fleet-command-gauge b {
  background: #0f766e;
  display: block;
  height: 100%;
}

.fleet-command-gauge.warning b {
  background: #d97706;
}

.fleet-command-gauge.danger b {
  background: #b42318;
}

.fleet-ship-route {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.fleet-ship-route strong {
  color: #102026;
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fleet-ship-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 3;
  grid-row: 1;
  justify-content: flex-end;
}

.fleet-command-operations {
  display: grid;
  gap: 12px;
}

.fleet-command-operations .ship-rental-panel,
.fleet-command-drawer .ship-log-panel,
.fleet-command-drawer .battle-dashboard {
  box-shadow: none;
  margin: 0;
}

.fleet-command-drawer {
  display: grid;
  overflow: hidden;
}

.fleet-command-drawer summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  padding: 14px;
}

.fleet-command-drawer summary::-webkit-details-marker {
  display: none;
}

.fleet-command-drawer summary span {
  color: #102026;
  font-weight: 900;
}

.fleet-command-drawer summary small {
  color: #60727a;
}

.fleet-command-drawer[open] summary {
  border-bottom: 1px solid #e2e9e5;
}

.fleet-command-drawer > section,
.fleet-command-drawer > div {
  border: 0;
  border-radius: 0;
}

.fleet-command-inspector {
  display: grid;
  gap: 14px;
  padding: 14px;
  position: sticky;
  top: 76px;
}

.fleet-inspector-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.fleet-spec-grid,
.fleet-battle-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fleet-spec-grid div,
.fleet-battle-stats div {
  background: #f5f8f4;
  border: 1px solid #e2e9e5;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 9px;
}

.fleet-spec-grid span,
.fleet-battle-stats span {
  color: #60727a;
  font-size: 12px;
}

.fleet-spec-grid strong,
.fleet-battle-stats strong {
  color: #102026;
  font-size: 15px;
}

.fleet-inspector-tabs {
  background: #eef3ef;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px;
}

.fleet-inspector-tabs button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #52646a;
  font-size: 13px;
  min-height: 34px;
  padding: 7px 4px;
}

.fleet-inspector-tabs button.selected {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 37, 40, 0.12);
  color: #102026;
}

.fleet-inspector-body,
.fleet-tab-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.fleet-current-task,
.fleet-mini-panel {
  background: #f8fbf8;
  border: 1px solid #e2e9e5;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.fleet-current-task span {
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
}

.fleet-current-task strong {
  color: #102026;
  font-size: 16px;
}

.fleet-current-task small,
.fleet-destination-row small {
  color: #60727a;
}

.fleet-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.fleet-mode-switch .selected {
  background: #102026;
  color: #f4e8c5;
}

.fleet-destination-row,
.fleet-cargo-row,
.fleet-voyage-row {
  align-items: center;
  border-top: 1px solid #e2e9e5;
  display: grid;
  gap: 10px;
  padding-top: 9px;
}

.fleet-destination-row {
  grid-template-columns: minmax(0, 1fr);
}

.fleet-destination-row:first-of-type,
.fleet-cargo-row:first-child,
.fleet-voyage-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.fleet-cargo-list {
  display: grid;
  gap: 9px;
}

.fleet-cargo-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.fleet-cargo-row > span {
  align-items: center;
  background: #102026;
  border-radius: 8px;
  color: #f4e8c5;
  display: inline-flex;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  overflow: hidden;
  width: 34px;
}

.fleet-cargo-row img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.fleet-cargo-row strong {
  color: #102026;
  display: block;
}

.fleet-cargo-row small {
  color: #60727a;
  display: block;
  margin-top: 2px;
}

.fleet-cargo-row b {
  color: #0f766e;
}

.fleet-voyage-list {
  border: 1px solid #e2e9e5;
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.fleet-voyage-row {
  border-top: 1px solid #e2e9e5;
  grid-template-columns: minmax(180px, 1.25fr) minmax(120px, 0.75fr) minmax(90px, 0.55fr) minmax(220px, 1.2fr) auto;
  padding: 11px 12px;
}

.fleet-voyage-row:first-child {
  border-top: 0;
}

.fleet-voyage-row.arrived {
  background: #f3f6e7;
}

.fleet-voyage-row strong {
  color: #102026;
}

.fleet-voyage-row small,
.fleet-voyage-row span {
  color: #60727a;
  font-size: 13px;
}

body[data-page="ships"] .ship-modify-panel,
body[data-page="ships"] .ship-cargo-panel,
body[data-page="ships"] .battle-order-list,
body[data-page="ships"] .island-defense-panel,
body[data-page="ships"] .battle-preview-card {
  background: #f8fbf8;
  border-color: #e2e9e5;
}

body[data-page="ships"] .recipe-preview-title {
  align-items: center;
}

body[data-page="ships"] .ship-component-list {
  border-top-color: #e2e9e5;
}

body[data-page="ships"] .battle-dashboard {
  background: transparent;
  border: 0;
  padding: 14px;
}

th,
td {
  border-bottom: 1px solid #edf2f3;
  padding: 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #60727a;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .summary,
  .island-identity-card,
  .island-workspace,
  .island-subpage-layout,
  .page-grid,
  .recipe-preview-grid,
  .ship-page-summary,
  .battle-dashboard-grid,
  .battle-dashboard-columns,
  .battle-preview-grid,
  .ship-stat-grid,
  .ship-battle-controls,
  .ship-battle-actions,
  .ship-system-install,
  .ship-system-row,
  .ship-fuel-row,
  .ship-log-row,
  .plots {
    grid-template-columns: 1fr;
  }

  .island-identity-card button {
    width: 100%;
  }

  .island-identity-actions {
    justify-content: stretch;
  }

  .island-identity-actions button {
    flex: 1 1 120px;
  }

  .ship-rental-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .ship-fuel-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .plots {
    min-height: 520px;
  }

  .island-subpage-nav {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fleet-command-page {
    margin: 0;
    padding: 12px;
  }

  .fleet-command-hero,
  .fleet-command-layout,
  .fleet-ship-row,
  .fleet-voyage-row {
    grid-template-columns: 1fr;
  }

  .fleet-command-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fleet-command-hero {
    min-height: 0;
  }

  .fleet-command-inspector {
    position: static;
  }

  .fleet-ship-status,
  .fleet-ship-gauges,
  .fleet-ship-route,
  .fleet-ship-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .fleet-ship-actions {
    justify-content: flex-start;
  }

  .fleet-voyage-row {
    align-items: start;
  }
}

@media (max-width: 480px) {
  .island-subpage-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plots {
    padding-left: 8px;
    padding-right: 8px;
  }

  body[data-page="ships"] #shipsPage > section {
    margin: -4px -4px 0;
  }

  .fleet-command-page {
    padding: 8px;
  }

  .fleet-command-hero {
    padding: 16px;
  }

  .fleet-command-hero h3 {
    font-size: 28px;
  }

  .fleet-command-summary,
  .fleet-spec-grid,
  .fleet-battle-stats,
  .fleet-inspector-tabs {
    grid-template-columns: 1fr;
  }

  .fleet-inspector-header,
  .fleet-command-section-head,
  .ship-rental-action {
    align-items: stretch;
    flex-direction: column;
  }

  .fleet-inspector-tabs button {
    min-height: 38px;
  }
}

/* Island white hex base geometry normalization. */
body[data-page="island"] .plots {
  padding: 112px 32px 42px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.18), transparent 34%),
    radial-gradient(circle at 50% 52%, rgba(41, 133, 151, 0.25), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, #0b7b86 0%, #07566a 55%, #043343 100%);
  background-size: auto, auto, 34px 34px, auto;
}

body[data-page="island"] .hex-map {
  width: min(calc(100% - 24px), 1120px);
  margin: 0 auto 20px;
  transform: none;
  filter: drop-shadow(0 24px 28px rgba(0, 24, 31, 0.32));
  isolation: isolate;
}

body[data-page="island"] .island-map-shell {
  position: relative;
  z-index: 1;
  width: max-content;
  margin: 0 auto 20px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  will-change: transform;
}

body[data-page="island"] .island-map-shell-ready-to-pan,
body[data-page="island"] .island-map-shell-panning {
  cursor: grabbing;
}

body[data-page="island"] .island-map-shell .hex-map {
  max-width: none;
  margin: 0;
  position: relative;
  z-index: 1;
}

@media (hover: none), (pointer: coarse) {
  body[data-page="island"] .plots {
    touch-action: none;
    overscroll-behavior: contain;
  }
}

body[data-page="island"] .island-map-zoom-controls {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 42;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(211, 168, 91, 0.56);
  border-radius: 999px;
  background: rgba(8, 38, 48, 0.82);
  box-shadow: 0 12px 28px rgba(0, 20, 26, 0.28);
  backdrop-filter: blur(8px);
}

body[data-page="island"] .island-map-info-toggle {
  position: fixed;
  right: 22px;
  bottom: 82px;
  z-index: 42;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 12px 8px 13px;
  border: 1px solid rgba(211, 168, 91, 0.52);
  border-radius: 999px;
  background: rgba(8, 38, 48, 0.82);
  box-shadow: 0 12px 28px rgba(0, 20, 26, 0.24);
  color: #fff4d6;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  user-select: none;
  backdrop-filter: blur(8px);
}

body[data-page="island"] .island-map-info-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body[data-page="island"] .island-map-info-toggle::before {
  content: "";
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 214, 0.18);
}

body[data-page="island"] .island-map-info-toggle::after {
  content: "";
  position: absolute;
  left: 16px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #d5d8d1;
  box-shadow: 0 2px 5px rgba(0, 15, 20, 0.28);
  transition: transform 0.16s ease, background 0.16s ease;
}

body[data-page="island"] .island-map-info-toggle.active::before {
  background: linear-gradient(90deg, #0f9a8a, #62d1a6);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 214, 0.26);
}

body[data-page="island"] .island-map-info-toggle.active::after {
  transform: translateX(14px);
  background: #fff9e8;
}

body[data-page="island"] .island-map-info-toggle span {
  line-height: 1;
}

body[data-page="island"] .island-map-info-toggle i {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 244, 214, 0.14);
  color: rgba(255, 244, 214, 0.86);
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  text-align: center;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-backdrop {
  position: fixed;
  z-index: 5200;
  top: var(--global-topbar-height);
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(3, 18, 24, 0.5);
  backdrop-filter: blur(4px);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1160px, calc(100vw - 48px));
  max-height: min(790px, calc(100vh - var(--global-topbar-height) - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 220, 147, 0.2);
  border-radius: 16px;
  background:
    radial-gradient(circle at 16% 0%, rgba(68, 103, 91, 0.34), transparent 36%),
    linear-gradient(180deg, rgba(31, 34, 34, 0.98), rgba(20, 22, 22, 0.98));
  color: #f7ead0;
  box-shadow: 0 30px 80px rgba(0, 10, 14, 0.54), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 230, 176, 0.2);
  border-radius: 999px;
  background: rgba(255, 244, 214, 0.12);
  color: #fff4d6;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-close:hover {
  background: rgba(255, 244, 214, 0.22);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 62px 14px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-head span {
  color: rgba(247, 234, 208, 0.56);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-head strong {
  overflow: hidden;
  color: #fff8e8;
  font-size: 20px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-head em {
  color: #ff9d2e;
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

body[data-page="island"] .island-power-modal {
  width: min(980px, calc(100vw - 56px));
  border-color: rgba(98, 209, 166, 0.22);
  background:
    radial-gradient(circle at 18% 0%, rgba(30, 115, 104, 0.28), transparent 34%),
    radial-gradient(circle at 86% 100%, rgba(255, 202, 112, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(28, 33, 32, 0.99), rgba(15, 18, 18, 0.99));
}

body[data-page="island"] .island-power-detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 18px;
}

body[data-page="island"] .island-power-overview {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="island"] .island-power-stat {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(255, 244, 214, 0.09);
  border-radius: 10px;
  background: rgba(9, 13, 13, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body[data-page="island"] .island-power-stat span {
  color: rgba(247, 234, 208, 0.6);
  font-size: 12px;
  font-weight: 900;
}

body[data-page="island"] .island-power-stat strong {
  overflow: hidden;
  color: #fff8e8;
  font-size: 24px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-power-stat small {
  overflow: hidden;
  color: rgba(247, 234, 208, 0.56);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-power-stat.warning strong {
  color: #ffd177;
}

body[data-page="island"] .island-power-stat.danger strong {
  color: #ff796d;
}

body[data-page="island"] .island-power-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 280px;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 214, 0.08);
  border-radius: 12px;
  background: rgba(9, 13, 13, 0.66);
}

body[data-page="island"] .island-power-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body[data-page="island"] .island-power-panel-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body[data-page="island"] .island-power-panel-head strong {
  color: #fff4d6;
  font-size: 17px;
  line-height: 1.1;
}

body[data-page="island"] .island-power-panel-head span {
  color: rgba(247, 234, 208, 0.52);
  font-size: 11px;
  font-weight: 800;
}

body[data-page="island"] .island-power-panel-head em {
  color: #62d1a6;
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

body[data-page="island"] .island-power-list {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

body[data-page="island"] .island-power-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 244, 214, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: #f7ead0;
  text-align: left;
}

body[data-page="island"] button.island-power-row {
  cursor: pointer;
}

body[data-page="island"] button.island-power-row:hover {
  border-color: rgba(98, 209, 166, 0.34);
  background: rgba(98, 209, 166, 0.07);
}

body[data-page="island"] .island-power-row.active {
  border-color: rgba(98, 209, 166, 0.22);
}

body[data-page="island"] .island-power-row.paused {
  border-color: rgba(255, 121, 109, 0.22);
  opacity: 0.82;
}

body[data-page="island"] .island-power-row-thumb,
body[data-page="island"] .island-power-row-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

body[data-page="island"] .island-power-row-mark {
  background: linear-gradient(145deg, rgba(98, 209, 166, 0.95), rgba(10, 123, 119, 0.95));
  color: #fff8e8;
  font-size: 20px;
  font-weight: 900;
}

body[data-page="island"] .island-power-row-mark.policy {
  background: linear-gradient(145deg, rgba(209, 179, 109, 0.95), rgba(128, 96, 42, 0.95));
}

body[data-page="island"] .island-power-building-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body[data-page="island"] .island-power-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body[data-page="island"] .island-power-row-main strong {
  overflow: hidden;
  color: #fff8e8;
  font-size: 14px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-power-row-main strong small {
  color: rgba(247, 234, 208, 0.48);
  font-size: 11px;
  font-weight: 900;
}

body[data-page="island"] .island-power-row-main > small {
  overflow: hidden;
  color: rgba(247, 234, 208, 0.56);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-power-row em {
  color: #62d1a6;
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

body[data-page="island"] .island-power-row.paused em {
  color: #ff796d;
}

body[data-page="island"] .island-power-empty {
  display: grid;
  place-items: center;
  min-height: 140px;
  border: 1px dashed rgba(255, 244, 214, 0.16);
  border-radius: 10px;
  color: rgba(247, 234, 208, 0.48);
  font-size: 14px;
  font-weight: 900;
}

/* Power detail modal: iOS liquid-glass treatment consistent with island overlays. */
body[data-page="island"] .island-power-backdrop {
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.42), transparent 32%),
    radial-gradient(circle at 18% 76%, rgba(96, 210, 194, 0.24), transparent 34%),
    linear-gradient(135deg, rgba(211, 232, 229, 0.54), rgba(248, 241, 222, 0.4)),
    rgba(20, 31, 33, 0.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.28);
  backdrop-filter: blur(26px) saturate(1.28);
}

body[data-page="island"] .island-power-modal {
  width: min(1120px, calc(100vw - 56px));
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 30px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.72), transparent 34%),
    radial-gradient(circle at 90% 0%, rgba(255, 225, 126, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(229, 249, 244, 0.72) 52%, rgba(255, 248, 226, 0.76)),
    rgba(242, 250, 247, 0.88);
  color: #133532;
  box-shadow:
    0 34px 90px rgba(26, 55, 52, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(117, 159, 152, 0.16);
  -webkit-backdrop-filter: blur(30px) saturate(1.3);
  backdrop-filter: blur(30px) saturate(1.3);
}

body[data-page="island"] .island-power-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 26%, rgba(255, 255, 255, 0.34) 38%, transparent 50%),
    radial-gradient(circle at 96% 82%, rgba(20, 176, 151, 0.1), transparent 34%);
  opacity: 0.9;
}

body[data-page="island"] .island-power-modal .island-cargo-modal-head,
body[data-page="island"] .island-power-modal .island-power-detail-body {
  position: relative;
  z-index: 1;
}

body[data-page="island"] .island-power-modal .island-cargo-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 246, 242, 0.62)),
    rgba(255, 255, 255, 0.48);
  color: rgba(31, 62, 58, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 24px rgba(30, 68, 64, 0.14);
  font-size: 26px;
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

body[data-page="island"] .island-power-modal .island-cargo-close:hover,
body[data-page="island"] .island-power-modal .island-cargo-close:focus-visible {
  background: rgba(255, 255, 255, 0.82);
  color: #0f9183;
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .island-power-modal .island-cargo-modal-head {
  min-height: 104px;
  padding: 24px 82px 22px 26px;
  border-bottom: 1px solid rgba(43, 89, 82, 0.12);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.64), rgba(231, 249, 245, 0.38) 58%, rgba(255, 244, 213, 0.34)),
    rgba(255, 255, 255, 0.18);
}

body[data-page="island"] .island-power-modal .island-cargo-modal-head span {
  color: rgba(15, 111, 103, 0.74);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="island"] .island-power-modal .island-cargo-modal-head strong {
  color: #123733;
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: 850;
  line-height: 1.06;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

body[data-page="island"] .island-power-modal .island-cargo-modal-head em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  min-width: 154px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 6%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(250, 242, 211, 0.5)),
    rgba(255, 255, 255, 0.36);
  color: #a66b0c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(120, 84, 20, 0.07),
    0 12px 28px rgba(120, 91, 34, 0.08);
  font-size: 26px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(1.24);
  backdrop-filter: blur(22px) saturate(1.24);
}

body[data-page="island"] .island-power-detail-body {
  gap: 12px;
  padding: 18px 22px 22px;
  scrollbar-color: rgba(8, 125, 103, 0.28) rgba(255, 255, 255, 0.25);
  scrollbar-width: thin;
}

body[data-page="island"] .island-power-overview {
  gap: 12px;
}

body[data-page="island"] .island-power-stat {
  min-height: 102px;
  padding: 16px 17px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(235, 249, 246, 0.48)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 12px 26px rgba(37, 72, 66, 0.1);
  color: #143432;
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

body[data-page="island"] .island-power-stat span {
  color: rgba(35, 62, 58, 0.62);
  font-size: 13px;
  letter-spacing: 0;
}

body[data-page="island"] .island-power-stat strong {
  color: #143432;
  font-size: 30px;
  font-weight: 900;
}

body[data-page="island"] .island-power-stat small {
  color: rgba(35, 62, 58, 0.58);
  font-size: 12px;
}

body[data-page="island"] .island-power-stat.warning {
  border-color: rgba(232, 174, 52, 0.34);
  box-shadow:
    inset 4px 0 0 rgba(232, 174, 52, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 12px 26px rgba(189, 135, 31, 0.1);
}

body[data-page="island"] .island-power-stat.warning strong {
  color: #a66b0c;
}

body[data-page="island"] .island-power-stat.danger {
  border-color: rgba(235, 91, 91, 0.34);
  box-shadow:
    inset 4px 0 0 rgba(235, 91, 91, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 12px 26px rgba(190, 57, 57, 0.1);
}

body[data-page="island"] .island-power-stat.danger strong {
  color: #c74e47;
}

body[data-page="island"] .island-power-panel {
  min-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(232, 249, 245, 0.5)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    0 22px 54px rgba(37, 72, 66, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(83, 129, 121, 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  backdrop-filter: blur(18px) saturate(1.16);
}

body[data-page="island"] .island-power-panel-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(43, 89, 82, 0.12);
}

body[data-page="island"] .island-power-panel-head strong {
  color: #123733;
  font-size: 22px;
  font-weight: 900;
}

body[data-page="island"] .island-power-panel-head span {
  color: rgba(35, 62, 58, 0.58);
  font-size: 12px;
}

body[data-page="island"] .island-power-panel-head em {
  color: #0f9b82;
  font-size: 24px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.66);
}

body[data-page="island"] .island-power-list {
  gap: 10px;
  padding: 14px;
  scrollbar-color: rgba(8, 125, 103, 0.28) rgba(255, 255, 255, 0.25);
  scrollbar-width: thin;
}

body[data-page="island"] .island-power-row {
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid rgba(33, 112, 97, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(236, 249, 245, 0.38)),
    rgba(255, 255, 255, 0.3);
  color: #143432;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(37, 72, 66, 0.06);
}

body[data-page="island"] button.island-power-row:hover,
body[data-page="island"] button.island-power-row:focus-visible {
  border-color: rgba(15, 145, 131, 0.34);
  background:
    linear-gradient(145deg, rgba(238, 255, 249, 0.86), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 4px 0 0 rgba(15, 145, 131, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(15, 145, 131, 0.13);
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .island-power-row.active {
  border-color: rgba(15, 145, 131, 0.28);
  background:
    linear-gradient(145deg, rgba(236, 255, 249, 0.76), rgba(255, 255, 255, 0.52)),
    rgba(255, 255, 255, 0.38);
}

body[data-page="island"] .island-power-row.paused {
  border-color: rgba(235, 91, 91, 0.26);
  background:
    linear-gradient(145deg, rgba(255, 246, 242, 0.74), rgba(255, 255, 255, 0.46)),
    rgba(255, 255, 255, 0.34);
  opacity: 1;
}

body[data-page="island"] .island-power-row-thumb,
body[data-page="island"] .island-power-row-mark {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 246, 242, 0.62)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 9px 18px rgba(37, 72, 66, 0.08);
}

body[data-page="island"] .island-power-row-mark {
  background:
    radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.34), transparent 38%),
    linear-gradient(180deg, #35c8b2, #0f9183);
  color: #fffdf4;
  font-size: 22px;
}

body[data-page="island"] .island-power-row-mark.policy {
  background:
    radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.34), transparent 38%),
    linear-gradient(180deg, #e2bc63, #ad7c28);
}

body[data-page="island"] .island-power-row-main strong {
  color: #123733;
  font-size: 16px;
  font-weight: 900;
}

body[data-page="island"] .island-power-row-main strong small,
body[data-page="island"] .island-power-row-main > small {
  color: rgba(35, 62, 58, 0.58);
  font-size: 12px;
}

body[data-page="island"] .island-power-row em {
  color: #0f9b82;
  font-size: 24px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.66);
}

body[data-page="island"] .island-power-row.paused em {
  color: #c74e47;
}

body[data-page="island"] .island-power-empty {
  border-color: rgba(35, 62, 58, 0.18);
  background: rgba(255, 255, 255, 0.26);
  color: rgba(35, 62, 58, 0.52);
}

body[data-page="island"] .island-population-modal {
  grid-template-rows: auto auto;
  width: min(1280px, calc(100vw - 56px));
  max-height: calc(100vh - var(--global-topbar-height) - 40px);
  overflow-x: hidden;
  overflow-y: auto;
  border-color: rgba(98, 209, 166, 0.2);
  background:
    radial-gradient(circle at 14% 0%, rgba(31, 112, 102, 0.3), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(255, 214, 142, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(28, 31, 31, 0.99), rgba(15, 17, 17, 0.99));
}

body[data-page="island"] .island-population-detail-body {
  display: grid;
  gap: 14px;
  min-height: auto;
  overflow: visible;
  padding: 16px 18px 18px;
}

body[data-page="island"] .island-population-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="island"] .island-population-stat {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(255, 244, 214, 0.09);
  border-radius: 10px;
  background: rgba(9, 13, 13, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body[data-page="island"] .island-population-stat span {
  color: rgba(247, 234, 208, 0.6);
  font-size: 12px;
  font-weight: 900;
}

body[data-page="island"] .island-population-stat strong {
  overflow: hidden;
  color: #fff8e8;
  font-size: 24px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-population-stat small {
  overflow: hidden;
  color: rgba(247, 234, 208, 0.56);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-population-stat.warning strong {
  color: #ffd177;
}

body[data-page="island"] .island-population-stat.danger strong {
  color: #ff796d;
}

body[data-page="island"] .island-population-panel {
  display: grid;
  grid-template-rows: auto auto;
  min-height: 430px;
  overflow: visible;
  border: 1px solid rgba(255, 244, 214, 0.08);
  border-radius: 12px;
  background: rgba(9, 13, 13, 0.68);
}

body[data-page="island"] .island-population-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

body[data-page="island"] .island-population-panel-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body[data-page="island"] .island-population-panel-head strong {
  color: #fff4d6;
  font-size: 18px;
  line-height: 1.1;
}

body[data-page="island"] .island-population-panel-head span {
  color: rgba(247, 234, 208, 0.52);
  font-size: 11px;
  font-weight: 800;
}

body[data-page="island"] .island-population-panel-head em {
  color: #62d1a6;
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

body[data-page="island"] .island-population-panel-body {
  display: grid;
  grid-template-columns: 1fr;
  min-height: auto;
  overflow: visible;
  padding: 0 12px 12px;
}

body[data-page="island"] .island-population-table {
  display: grid;
  min-height: auto;
  min-width: 0;
  overflow: visible;
}

body[data-page="island"] .island-population-table-head,
body[data-page="island"] .island-population-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.05fr) minmax(218px, 1fr) repeat(5, minmax(82px, 0.56fr)) 56px;
  align-items: center;
  gap: 10px;
}

body[data-page="island"] .island-population-table-head {
  position: sticky;
  z-index: 1;
  top: 0;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(24, 27, 27, 0.98);
  color: rgba(247, 234, 208, 0.56);
  font-size: 12px;
  font-weight: 900;
}

body[data-page="island"] .island-population-table-head span:not(:first-child):not(:nth-child(2)) {
  text-align: right;
}

body[data-page="island"] .island-population-table-head span:nth-child(2) {
  text-align: left;
}

body[data-page="island"] .island-population-help {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: visible;
}

body[data-page="island"] .island-population-help-button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 3px solid #ff5e59;
  border-radius: 999px;
  background: rgba(255, 94, 89, 0.1);
  color: #fff8e8;
  cursor: help;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

body[data-page="island"] .island-population-help-button:hover,
body[data-page="island"] .island-population-help-button:focus-visible {
  border-color: #ff7771;
  background: rgba(255, 94, 89, 0.18);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 94, 89, 0.18);
}

body[data-page="island"] .island-population-help-popover {
  position: absolute;
  z-index: 8;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  gap: 5px;
  width: min(260px, calc(100vw - 28px));
  padding: 11px 12px;
  border: 1px solid rgba(255, 244, 214, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(33, 38, 38, 0.98), rgba(17, 20, 20, 0.98));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: rgba(247, 234, 208, 0.78);
  opacity: 0;
  overflow-wrap: anywhere;
  pointer-events: none;
  text-align: left;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

body[data-page="island"] .island-population-help-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 9px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(255, 244, 214, 0.2);
  border-left: 1px solid rgba(255, 244, 214, 0.2);
  background: rgba(33, 38, 38, 0.98);
  transform: rotate(45deg);
}

body[data-page="island"] .island-population-help-popover strong {
  color: #fff4d6;
  font-size: 13px;
  font-weight: 950;
}

body[data-page="island"] .island-population-help-popover span {
  color: rgba(247, 234, 208, 0.72);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}

body[data-page="island"] .island-population-help:hover .island-population-help-popover,
body[data-page="island"] .island-population-help:focus-within .island-population-help-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

body[data-page="island"] .island-population-table-head span:last-child {
  text-align: center;
}

body[data-page="island"] .island-population-row {
  min-height: 76px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.018);
}

body[data-page="island"] .island-population-row.expanded {
  border-bottom-color: rgba(212, 191, 130, 0.18);
  background: linear-gradient(90deg, rgba(212, 191, 130, 0.055), rgba(255, 255, 255, 0.018) 42%);
}

body[data-page="island"] .island-population-row:last-child {
  border-bottom: 0;
}

body[data-page="island"] .island-population-row.tier-1 {
  --population-tier-color: #f7f3ea;
  --population-tier-soft: rgba(247, 243, 234, 0.16);
  --population-tier-border: rgba(247, 243, 234, 0.36);
}

body[data-page="island"] .island-population-row.tier-2 {
  --population-tier-color: #78d36d;
  --population-tier-soft: rgba(120, 211, 109, 0.16);
  --population-tier-border: rgba(120, 211, 109, 0.42);
}

body[data-page="island"] .island-population-row.tier-3 {
  --population-tier-color: #7dbde6;
  --population-tier-soft: rgba(125, 189, 230, 0.16);
  --population-tier-border: rgba(125, 189, 230, 0.42);
}

body[data-page="island"] .island-population-row.tier-4 {
  --population-tier-color: #dc8bc8;
  --population-tier-soft: rgba(220, 139, 200, 0.16);
  --population-tier-border: rgba(220, 139, 200, 0.42);
}

body[data-page="island"] .island-population-row.empty {
  opacity: 0.74;
}

body[data-page="island"] .island-population-worker {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

body[data-page="island"] .island-population-worker-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--population-tier-border, rgba(255, 244, 214, 0.14));
  border-radius: 9px;
  background: #f3eee0;
  color: #0d3434;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.16),
    0 0 0 3px var(--population-tier-soft, rgba(255, 244, 214, 0.05));
}

body[data-page="island"] .island-population-worker-icon .workforce-type-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body[data-page="island"] .island-population-initial {
  font-size: 22px;
  font-weight: 900;
}

body[data-page="island"] .island-population-worker div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body[data-page="island"] .island-population-worker strong {
  overflow: hidden;
  color: var(--population-tier-color, #7fb5ef);
  font-size: 19px;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.32);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-population-worker small {
  overflow: hidden;
  color: rgba(247, 234, 208, 0.52);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-population-wage {
  display: grid;
  gap: 5px;
  min-width: 0;
}

body[data-page="island"] .island-population-wage.empty {
  justify-items: start;
  color: rgba(247, 234, 208, 0.46);
}

body[data-page="island"] .island-population-wage-current {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

body[data-page="island"] .island-population-wage-current span {
  overflow: hidden;
  color: rgba(247, 234, 208, 0.54);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-population-wage-current strong {
  color: #fff4d6;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

body[data-page="island"] .island-population-wage small,
body[data-page="island"] .island-population-wage em {
  overflow: hidden;
  color: rgba(247, 234, 208, 0.55);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-population-wage em {
  color: rgba(125, 228, 204, 0.78);
}

body[data-page="island"] .island-population-wage.cooling em {
  color: #ffb05f;
}

body[data-page="island"] .island-population-wage-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

body[data-page="island"] .island-population-wage-option {
  min-width: 0;
  height: 24px;
  padding: 0 4px;
  border: 1px solid rgba(247, 234, 208, 0.18);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(247, 234, 208, 0.72);
  font: inherit;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}

body[data-page="island"] .island-population-wage-option.active {
  border-color: rgba(125, 228, 204, 0.58);
  background: linear-gradient(180deg, rgba(33, 180, 156, 0.82), rgba(11, 130, 110, 0.72));
  color: #fff4d6;
}

body[data-page="island"] .island-population-wage-option:disabled {
  cursor: default;
  opacity: 0.55;
}

body[data-page="island"] .island-population-wage-option:not(:disabled):hover {
  border-color: rgba(212, 191, 130, 0.65);
  color: #fff4d6;
  transform: translateY(-1px);
}

body[data-page="island"] .island-population-number {
  color: #fff8e8;
  font-size: 20px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

body[data-page="island"] .island-population-number.available {
  color: #00cda8;
}

body[data-page="island"] .island-population-number.unemployment {
  color: #ff796d;
}

body[data-page="island"] .island-population-number.savings {
  color: #62d1a6;
}

body[data-page="island"] .island-population-value-with-help {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  overflow: visible;
}

body[data-page="island"] .island-population-value-with-help .island-population-number {
  min-width: 0;
}

body[data-page="island"] .island-population-row.empty .island-population-number {
  color: rgba(247, 234, 208, 0.5);
}

body[data-page="island"] .island-population-mood {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  color: #62d1a6;
  white-space: nowrap;
}

body[data-page="island"] .island-population-mood strong {
  font-size: 19px;
  font-weight: 900;
}

body[data-page="island"] .island-population-mood > span:not(.island-population-help) {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(98, 209, 166, 0.12);
  color: currentColor;
  font-size: 11px;
  font-weight: 900;
}

body[data-page="island"] .island-population-mood.warning {
  color: #ffd177;
}

body[data-page="island"] .island-population-mood.warning > span:not(.island-population-help) {
  background: rgba(255, 209, 119, 0.12);
}

body[data-page="island"] .island-population-mood.danger {
  color: #ff796d;
}

body[data-page="island"] .island-population-mood.danger > span:not(.island-population-help) {
  background: rgba(255, 121, 109, 0.13);
}

body[data-page="island"] .island-population-mood.empty {
  color: rgba(247, 234, 208, 0.5);
}

body[data-page="island"] .island-population-mood.empty > span:not(.island-population-help) {
  background: rgba(255, 255, 255, 0.06);
}

body[data-page="island"] .island-population-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: rgba(247, 234, 208, 0.48);
  font-size: 14px;
  font-weight: 900;
}

body[data-page="island"] .island-population-expand-button {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 244, 214, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body[data-page="island"] .island-population-expand-button:hover {
  border-color: rgba(212, 191, 130, 0.52);
  background:
    linear-gradient(180deg, rgba(212, 191, 130, 0.16), rgba(212, 191, 130, 0.06)),
    rgba(255, 255, 255, 0.045);
}

body[data-page="island"] .island-population-expand-button span {
  width: 11px;
  height: 11px;
  border-right: 3px solid #fff4d6;
  border-bottom: 3px solid #fff4d6;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 160ms ease;
}

body[data-page="island"] .island-population-row.expanded .island-population-expand-button {
  border-color: rgba(212, 191, 130, 0.65);
  background:
    linear-gradient(180deg, rgba(212, 191, 130, 0.2), rgba(212, 191, 130, 0.08)),
    rgba(255, 255, 255, 0.045);
}

body[data-page="island"] .island-population-row.expanded .island-population-expand-button span {
  transform: translateY(3px) rotate(225deg);
}

body[data-page="island"] .island-population-need-dropdown {
  display: grid;
  gap: 0;
  margin: 0 14px 14px;
  overflow: hidden;
  border: 1px solid rgba(212, 191, 130, 0.22);
  border-radius: 10px;
  background: #dce6e2;
  color: #2f4140;
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

body[data-page="island"] .island-population-need-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 38px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(47, 65, 64, 0.12);
  background: #d3dfdc;
}

body[data-page="island"] .island-population-need-summary strong {
  color: #536665;
  font-size: 13px;
  font-weight: 900;
}

body[data-page="island"] .island-population-need-summary span {
  color: rgba(47, 65, 64, 0.62);
  font-size: 12px;
  font-weight: 800;
}

body[data-page="island"] .island-population-need-support-table {
  display: grid;
  min-width: 0;
  overflow: visible;
}

body[data-page="island"] .island-population-need-support-head,
body[data-page="island"] .island-population-need-support-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 92px 118px 118px 132px 132px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
}

body[data-page="island"] .island-population-need-support-head {
  min-height: 36px;
  border-bottom: 1px solid rgba(47, 65, 64, 0.12);
  color: #687b7a;
  font-size: 12px;
  font-weight: 900;
}

body[data-page="island"] .island-population-need-support-head span:not(:first-child),
body[data-page="island"] .island-population-need-support-row > span:not(:first-child) {
  text-align: right;
}

body[data-page="island"] .island-population-need-support-row {
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid rgba(47, 65, 64, 0.1);
  border-radius: 0;
  background: transparent;
  color: #354746;
  font: inherit;
  text-align: left;
}

body[data-page="island"] .island-population-need-support-row:last-child {
  border-bottom: 0;
}

body[data-page="island"] .island-population-need-support-row:hover {
  background: rgba(255, 255, 255, 0.34);
}

body[data-page="island"] .island-population-need-product {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

body[data-page="island"] .island-population-need-product i {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 5px;
  background: #111918;
  color: #fff4d6;
  font-style: normal;
  font-weight: 900;
}

body[data-page="island"] .island-population-need-product .product-icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body[data-page="island"] .island-population-need-product strong {
  overflow: hidden;
  color: #007f8b;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-population-need-type {
  justify-self: end;
  min-width: 58px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.22);
  color: #657472;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

body[data-page="island"] .island-population-need-type.required {
  background: rgba(255, 121, 109, 0.1);
  color: #c24d45;
}

body[data-page="island"] .island-population-need-support-row > span {
  color: #374847;
  font-size: 15px;
  font-weight: 800;
}

body[data-page="island"] .island-population-need-support-row .island-population-need-support {
  color: #233736;
  font-weight: 900;
}

body[data-page="island"] .island-population-need-support-row.warning .island-population-need-support {
  color: #a36d22;
}

body[data-page="island"] .island-population-need-support-row.danger .island-population-need-support {
  color: #c84842;
}

body[data-page="island"] .island-population-need-support-row.empty .island-population-need-support {
  color: rgba(47, 65, 64, 0.46);
}

body[data-page="island"] .island-population-needs-empty {
  display: grid;
  place-items: center;
  min-height: 72px;
  border: 1px dashed rgba(255, 244, 214, 0.12);
  border-radius: 10px;
  color: rgba(247, 234, 208, 0.46);
  font-size: 12px;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  padding: 18px 20px 20px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-panel {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 214, 0.1);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(16, 19, 18, 0.82), rgba(10, 13, 13, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-ship-panel {
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 11px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-panel-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-panel-head .island-cargo-panel-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-panel-head strong {
  overflow: hidden;
  color: #f9ecd0;
  font-size: 16px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-panel-head small,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-panel-head span {
  color: rgba(247, 234, 208, 0.58);
  font-size: 12px;
  font-weight: 800;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-panel-actions .island-cargo-capacity {
  color: #ff9d2e;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-bulk-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff8e8;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-bulk-button:hover {
  background: rgba(255, 157, 46, 0.78);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-bulk-button.unload:hover {
  background: rgba(62, 125, 188, 0.78);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-bulk-button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-track {
  height: 4px;
  margin: 0 14px 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 244, 214, 0.12);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9d2e, #f0c66f);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-track.ship span {
  background: linear-gradient(90deg, #3e7dbc, #86b9d0);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-table-head,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px 88px 92px;
  align-items: center;
  gap: 12px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-table-head {
  padding: 0 18px 8px 14px;
  color: rgba(247, 234, 208, 0.46);
  font-size: 11px;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-table-head > span:not(:first-child) {
  text-align: right;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-table-head > span:last-child {
  justify-self: center;
  width: auto;
  min-width: 46px;
  text-align: center;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-table-head.no-action > span:last-child {
  justify-self: stretch;
  width: auto;
  text-align: right;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-table-head.compact,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-row.compact {
  grid-template-columns: minmax(0, 1fr) 78px 88px 54px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-list,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-ship-cargo {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 10px 10px 0;
  scrollbar-color: rgba(255, 244, 214, 0.58) rgba(255, 255, 255, 0.08);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-row {
  min-height: 62px;
  margin: 0 0 2px;
  padding: 8px 8px 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff7e6;
  font-size: 14px;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-row:hover {
  background: rgba(255, 244, 214, 0.045);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-row > span {
  color: #fff8e8;
  text-align: right;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-product {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-product div {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 42px;
  min-width: 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-product strong,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-product small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-product strong {
  color: #5e9ad2;
  font-size: 15px;
  line-height: 1.12;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-product.tier-1 strong {
  color: #f7f3ea;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-product.tier-2 strong {
  color: #78d36d;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-product.tier-3 strong {
  color: #7dbde6;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-product.tier-4 strong {
  color: #dc8bc8;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-product small {
  color: rgba(247, 234, 208, 0.48);
  font-size: 11px;
  line-height: 1.12;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: visible;
  background: transparent;
  color: #f5d587;
  font-size: 20px;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-icon .product-icon-image {
  width: 42px;
  height: 42px;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-load-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-load-controls input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(255, 244, 214, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff8e8;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-load {
  display: grid;
  place-items: center;
  width: 42px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-load:hover {
  background: rgba(255, 157, 46, 0.7);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-load:disabled,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-load-controls input:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer {
  display: grid;
  grid-template-columns: 64px minmax(80px, 1fr) 74px 48px 48px 36px 36px;
  align-items: center;
  gap: 7px;
  min-height: 50px;
  margin: 0 10px 8px 0;
  padding: 9px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 250, 232, 0.06);
  color: rgba(255, 244, 214, 0.72);
  font-size: 12px;
  font-weight: 900;
  box-sizing: border-box;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer.unload {
  background: rgba(62, 125, 188, 0.11);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer input[type="range"] {
  width: 100%;
  accent-color: #ffac2f;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer.unload input[type="range"] {
  accent-color: #6ea6d4;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer input[type="number"] {
  width: 100%;
  height: 32px;
  min-width: 0;
  padding: 0 6px;
  border: 1px solid rgba(255, 244, 214, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff8e8;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer strong {
  color: #fff8e8;
  text-align: right;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer small {
  color: rgba(247, 234, 208, 0.44);
  font-size: 11px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer-confirm,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer-cancel {
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff8e8;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer-confirm {
  background: rgba(255, 157, 46, 0.72);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer.unload .island-cargo-transfer-confirm {
  background: rgba(62, 125, 188, 0.8);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer-confirm:hover,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer-cancel:hover {
  filter: brightness(1.08);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-ship-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  padding: 10px 10px 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-ship-tabs button {
  min-width: 0;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 214, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(247, 234, 208, 0.42);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-ship-tabs button.active {
  border-color: rgba(73, 131, 186, 0.62);
  background: rgba(61, 111, 160, 0.78);
  color: #fff8e8;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-ship-select {
  padding: 10px 10px 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-ship-select select {
  width: 100%;
  height: 44px;
  min-width: 0;
  border: 1px solid rgba(114, 174, 220, 0.58);
  border-radius: 8px;
  background: rgba(61, 111, 160, 0.78);
  color: #fff8e8;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-ship-select select:focus-visible {
  outline: 2px solid rgba(255, 196, 90, 0.72);
  outline-offset: 2px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-empty {
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 18px;
  color: rgba(247, 234, 208, 0.42);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-empty-tall {
  min-height: 100%;
  align-content: center;
  gap: 8px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-empty-tall strong {
  color: #fff8e8;
  font-size: 18px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-empty-tall span {
  color: rgba(247, 234, 208, 0.5);
  font-size: 13px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal {
  width: min(980px, calc(100vw - 56px));
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-body {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 18px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-tabs button {
  min-width: 0;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 214, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(247, 234, 208, 0.42);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-tabs button.active {
  border-color: rgba(73, 131, 186, 0.72);
  background: rgba(61, 111, 160, 0.82);
  color: #fff8e8;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-planner,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo {
  border: 1px solid rgba(255, 244, 214, 0.08);
  border-radius: 10px;
  background: rgba(13, 16, 16, 0.78);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-planner {
  display: grid;
  gap: 14px;
  padding: 14px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route {
  display: grid;
  grid-template-columns: minmax(150px, auto) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route strong {
  overflow: hidden;
  color: #fff8e8;
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route i {
  color: rgba(247, 234, 208, 0.42);
  font-style: normal;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route label {
  min-width: 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route input {
  width: 100%;
  height: 44px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid rgba(114, 174, 220, 0.58);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff8e8;
  font-size: 17px;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route input:focus-visible {
  outline: 2px solid rgba(255, 196, 90, 0.74);
  outline-offset: 2px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-destination-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-destination-chips button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(255, 244, 214, 0.1);
  border-radius: 999px;
  background: rgba(255, 244, 214, 0.08);
  color: rgba(247, 234, 208, 0.76);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-destination-chips button.active {
  border-color: rgba(255, 196, 90, 0.7);
  background: rgba(255, 157, 46, 0.24);
  color: #fff8e8;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 244, 214, 0.07);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stat span {
  color: rgba(247, 234, 208, 0.46);
  font-size: 11px;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stat strong {
  overflow: hidden;
  color: #fff8e8;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: rgba(61, 111, 160, 0.86);
  color: #fff8e8;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-start-button.rush {
  background: rgba(10, 139, 108, 0.92);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-start-button:hover {
  filter: brightness(1.08);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-start-button span {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  height: 100%;
  margin-left: -14px;
  background: rgba(0, 0, 0, 0.14);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(116, 210, 190, 0.36);
  border-radius: 8px;
  background: rgba(10, 139, 108, 0.92);
  color: #fff8e8;
  font-size: 14px;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode span {
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid rgba(255, 244, 214, 0.22);
  border-radius: 6px;
  background: rgba(7, 16, 15, 0.74);
  color: #fff8e8;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-warning {
  color: rgba(255, 196, 90, 0.86);
  font-size: 12px;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-vitals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255, 244, 214, 0.07);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff8e8;
  font-size: 14px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital strong span {
  color: rgba(247, 234, 208, 0.72);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital strong em {
  font-style: normal;
  font-size: 18px;
  color: #fff8e8;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 244, 214, 0.12);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-track b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9d2e, #f0c66f);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-track.condition b {
  background: linear-gradient(90deg, #ef5b52, #ffb15d);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action small {
  overflow: hidden;
  color: rgba(247, 234, 208, 0.64);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action button {
  min-width: 92px;
  height: 34px;
  border: 1px solid rgba(120, 178, 223, 0.36);
  border-radius: 8px;
  background: linear-gradient(180deg, #3d6f9b, #2d5276);
  color: #fff8e8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(8, 16, 20, 0.22);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action button:disabled {
  border-color: rgba(255, 244, 214, 0.08);
  background: rgba(255, 244, 214, 0.12);
  color: rgba(247, 234, 208, 0.42);
  cursor: not-allowed;
  box-shadow: none;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-dialog {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(239, 199, 121, 0.18);
  border-radius: 12px;
  background: rgba(10, 13, 12, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 244, 214, 0.05);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-dialog header strong {
  color: #fff8e8;
  font-size: 17px;
  font-weight: 950;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-dialog header button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 244, 214, 0.1);
  color: rgba(247, 234, 208, 0.75);
  cursor: pointer;
  font-size: 24px;
  font-weight: 800;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-metrics {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 14px;
  color: rgba(247, 234, 208, 0.62);
  font-size: 12px;
  font-weight: 900;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-metrics strong {
  color: #fff8e8;
  font-size: 16px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-amount {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(120, 178, 223, 0.28);
  border-radius: 9px;
  background: rgba(255, 244, 214, 0.06);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-amount span {
  display: grid;
  place-items: center;
  min-width: 0;
  background: rgba(61, 111, 155, 0.34);
  color: #fff8e8;
  font-size: 22px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-amount input {
  min-width: 0;
  height: 46px;
  border: 0;
  background: transparent;
  color: #fff8e8;
  font-size: 22px;
  font-weight: 900;
  outline: none;
  padding: 0 14px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-range {
  width: 100%;
  accent-color: #6fa6d3;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-actions button {
  width: 52px;
  height: 42px;
  border: 0;
  border-radius: 9px;
  color: #fff8e8;
  cursor: pointer;
  font-size: 24px;
  font-weight: 950;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-actions .cancel {
  background: rgba(255, 244, 214, 0.14);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-actions .confirm {
  background: #3d6f9b;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 210px;
  overflow: hidden;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-table-head.no-action,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-row.no-action {
  grid-template-columns: minmax(0, 1fr) 78px 88px;
}

body[data-page="island"] .island-map-zoom-button,
body[data-page="island"] .island-map-center-button {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 220, 147, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 244, 212, 0.98), rgba(222, 183, 103, 0.96));
  color: #19323a;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 5px 12px rgba(0, 16, 22, 0.22);
  cursor: pointer;
}

body[data-page="island"] .island-map-zoom-button {
  width: 34px;
  padding: 0;
  font-size: 24px;
}

body[data-page="island"] .island-map-center-button {
  font-size: 13px;
}

body[data-page="island"] .island-map-expansion-button {
  min-width: 56px;
}

body[data-page="island"] .island-map-expansion-button.active {
  border-color: rgba(170, 231, 222, 0.8);
  background: linear-gradient(180deg, rgba(17, 140, 127, 0.98), rgba(7, 99, 100, 0.98));
  color: #fff7de;
}

body[data-page="island"] .island-ship-brief-dock {
  position: absolute;
  z-index: 39;
  left: 18px;
  top: 494px;
  width: 184px;
  max-height: 280px;
  overflow: hidden;
  border: 1px solid rgba(255, 238, 191, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(8, 31, 38, 0.8), rgba(5, 24, 31, 0.62)),
    radial-gradient(circle at 50% 0%, rgba(255, 228, 169, 0.1), transparent 48%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  transition: width 0.18s ease, padding 0.18s ease, background 0.18s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

body[data-page="island"] .island-ship-brief-dock.custom-positioned {
  left: auto;
  top: auto;
}

body[data-page="island"] .island-ship-brief-dock.dragging {
  z-index: 73;
  box-shadow:
    0 24px 44px rgba(0, 18, 24, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

body[data-page="island"] .island-ship-brief-dock.collapsed {
  width: 66px;
  padding: 8px;
}

body[data-page="island"] .island-side-ship-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px 30px;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 7px;
  border-bottom: 1px solid rgba(255, 238, 191, 0.1);
  background: rgba(255, 250, 232, 0.08);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

body[data-page="island"] .island-ship-brief-dock.ready-to-drag .island-side-ship-head,
body[data-page="island"] .island-ship-brief-dock.dragging .island-side-ship-head {
  cursor: grabbing;
}

body[data-page="island"] .island-ship-brief-dock.collapsed .island-side-ship-head {
  grid-template-columns: 1fr;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

body[data-page="island"] .island-side-ship-head strong {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  color: #fff4d6;
  font-size: 15px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-side-ship-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-side-ship-title-icon {
  display: block;
  flex: 0 0 34px;
  height: 34px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  width: 34px;
}

body[data-page="island"] .island-ship-brief-dock.collapsed .island-side-ship-head strong,
body[data-page="island"] .island-ship-brief-dock.collapsed .island-side-ship-manage {
  display: none;
}

body[data-page="island"] .island-side-ship-head button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff4d6;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

body[data-page="island"] .island-ship-brief-dock.collapsed .island-side-ship-toggle {
  justify-self: center;
}

body[data-page="island"] .island-side-ship-head button:hover {
  background: rgba(255, 250, 232, 0.13);
}

body[data-page="island"] .island-side-ship-collapsed-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #18363c;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  overflow: visible;
  padding: 0;
}

body[data-page="island"] .island-side-ship-collapsed-image {
  display: block;
  height: 42px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  width: 42px;
}

body[data-page="island"] .island-side-ship-list {
  display: grid;
}

body[data-page="island"] .island-side-ship-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 4px 8px;
  min-height: 66px;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 238, 191, 0.08);
  border-radius: 0;
  background: transparent;
  color: #fff4d6;
  text-align: left;
  cursor: pointer;
}

body[data-page="island"] .island-side-ship-item:hover {
  background: rgba(255, 250, 232, 0.08);
}

body[data-page="island"] .island-side-ship-name {
  overflow: hidden;
  color: #78b6ff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-side-ship-location {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 244, 214, 0.82);
  font-size: 12px;
  font-weight: 700;
  grid-column: 1 / 2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-side-ship-location i {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 250, 232, 0.12);
  color: rgba(255, 244, 214, 0.78);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

body[data-page="island"] .island-side-ship-gauges {
  display: grid;
  align-content: center;
  gap: 5px;
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  width: 56px;
}

body[data-page="island"] .island-side-ship-gauge {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

body[data-page="island"] .island-side-ship-gauge span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

body[data-page="island"] .island-side-ship-gauge.ship-durability {
  background: rgba(151, 38, 55, 0.16);
}

body[data-page="island"] .island-side-ship-gauge.fuel span {
  background: linear-gradient(90deg, #d38111, #ffb02e);
}

body[data-page="island"] .island-side-ship-gauge.ship-durability span {
  background: linear-gradient(90deg, #d8324c, #ff7a64);
  box-shadow: 0 0 10px rgba(216, 50, 76, 0.22);
}

body[data-page="island"] .island-side-ship-gauge.cargo span {
  background: linear-gradient(90deg, #4bc7c2, #bfe8d1);
  box-shadow: 0 0 10px rgba(89, 206, 190, 0.28);
}

body[data-page="island"] .island-side-ship-empty,
body[data-page="island"] .island-side-ship-more {
  padding: 10px;
  border: 0;
  background: transparent;
  color: rgba(255, 244, 214, 0.7);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

body[data-page="island"] .island-side-ship-more {
  cursor: pointer;
}

body[data-page="island"] .island-side-ship-more:hover {
  color: #fff4d6;
}

body[data-page="island"] .island-map-zoom-button:hover:not(:disabled),
body[data-page="island"] .island-map-center-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

body[data-page="island"] .island-map-zoom-button:disabled,
body[data-page="island"] .island-map-center-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

body[data-page="island"] .island-map-layout-edit-actions {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 43;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(211, 168, 91, 0.56);
  border-radius: 999px;
  background: rgba(8, 38, 48, 0.9);
  box-shadow: 0 12px 28px rgba(0, 20, 26, 0.28);
}

body[data-page="island"] .island-map-layout-edit-status {
  max-width: min(280px, calc(100vw - 220px));
  padding: 0 10px;
  color: #fff3cf;
  font-size: 12px;
  font-weight: 900;
  line-height: 34px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-map-layout-edit-status.valid {
  color: #c9fff0;
}

body[data-page="island"] .island-map-layout-edit-status.invalid {
  color: #ffd0cc;
}

body[data-page="island"] .island-map-layout-cancel-button,
body[data-page="island"] .island-map-layout-save-button {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 220, 147, 0.42);
  border-radius: 999px;
  color: #19323a;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

body[data-page="island"] .island-map-layout-cancel-button {
  background: linear-gradient(180deg, rgba(226, 235, 237, 0.98), rgba(157, 173, 171, 0.96));
}

body[data-page="island"] .island-map-layout-save-button {
  background: linear-gradient(180deg, rgba(255, 244, 212, 0.98), rgba(222, 183, 103, 0.96));
}

body[data-page="island"] .island-map-layout-save-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

body[data-page="island"] .island-map-zoom-value {
  min-width: 52px;
  color: #fff3cf;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
}

body[data-page="island"] .island-map-zoom-controls,
body[data-page="island"] .island-map-info-toggle,
body[data-page="island"] .island-map-layout-edit-actions {
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.66), transparent 34%),
    radial-gradient(circle at 88% 90%, rgba(88, 218, 203, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.16) 42%, rgba(42, 74, 77, 0.28)),
    rgba(245, 251, 247, 0.24);
  box-shadow:
    0 18px 44px rgba(22, 38, 36, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 0 -1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(26px) saturate(1.55) contrast(1.02);
  -webkit-backdrop-filter: blur(26px) saturate(1.55) contrast(1.02);
}

body[data-page="island"] .island-map-zoom-controls::before,
body[data-page="island"] .island-map-info-toggle::before,
body[data-page="island"] .island-map-layout-edit-actions::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.44), transparent 38%, rgba(255, 255, 255, 0.2) 68%, transparent),
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.34), transparent 24%);
  opacity: 0.92;
  pointer-events: none;
}

body[data-page="island"] .island-map-zoom-controls::after,
body[data-page="island"] .island-map-info-toggle::after,
body[data-page="island"] .island-map-layout-edit-actions::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 18px 4px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  filter: blur(12px);
  pointer-events: none;
}

body[data-page="island"] .island-map-info-toggle {
  min-height: 48px;
  padding: 8px 14px 8px 12px;
  color: rgba(36, 48, 57, 0.92);
  font-size: 16px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.46);
}

body[data-page="island"] .island-map-info-toggle::before {
  position: static;
  z-index: 0;
  width: 50px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16)),
    rgba(42, 68, 70, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -10px 18px rgba(13, 28, 30, 0.12);
}

body[data-page="island"] .island-map-info-toggle::after {
  inset: auto;
  top: 50%;
  right: auto;
  bottom: auto;
  z-index: 1;
  left: 17px;
  width: 22px;
  height: 22px;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.68) 38%, rgba(255, 255, 255, 0.36)),
    #f8fff9;
  box-shadow:
    0 6px 14px rgba(19, 38, 36, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  filter: none;
  transform: translateY(-50%);
}

body[data-page="island"] .island-map-info-toggle.active::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.08)),
    linear-gradient(90deg, rgba(18, 185, 158, 0.94), rgba(92, 220, 178, 0.78));
}

body[data-page="island"] .island-map-info-toggle.active::after {
  transform: translate(20px, -50%);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.74) 42%, rgba(238, 255, 249, 0.52)),
    #ffffff;
}

body[data-page="island"] .island-map-info-toggle span {
  color: rgba(35, 48, 50, 0.94);
  font-weight: 950;
}

body[data-page="island"] .island-map-info-toggle i {
  min-width: 32px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.28);
  color: rgba(35, 48, 50, 0.84);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

body[data-page="island"] .island-map-zoom-controls {
  gap: 10px;
  padding: 9px;
}

body[data-page="island"] .island-map-zoom-button,
body[data-page="island"] .island-map-center-button,
body[data-page="island"] .island-map-layout-cancel-button,
body[data-page="island"] .island-map-layout-save-button {
  border-color: rgba(255, 255, 255, 0.54);
  background:
    radial-gradient(circle at 30% 16%, rgba(255, 255, 255, 0.86), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.18)),
    rgba(255, 246, 220, 0.38);
  color: rgba(37, 48, 50, 0.96);
  box-shadow:
    0 8px 18px rgba(24, 44, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}

body[data-page="island"] .island-map-zoom-button {
  width: 48px;
  height: 48px;
  font-size: 28px;
}

body[data-page="island"] .island-map-center-button,
body[data-page="island"] .island-map-layout-cancel-button,
body[data-page="island"] .island-map-layout-save-button {
  min-width: 70px;
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
}

body[data-page="island"] .island-map-zoom-value {
  min-width: 62px;
  color: rgba(37, 48, 50, 0.96);
  font-size: 16px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.58);
}

body[data-page="island"] .island-map-expansion-button {
  min-width: 76px;
}

body[data-page="island"] .island-map-expansion-button.active,
body[data-page="island"] .island-map-layout-save-button {
  border-color: rgba(255, 255, 255, 0.62);
  background:
    radial-gradient(circle at 30% 16%, rgba(255, 255, 255, 0.78), transparent 42%),
    linear-gradient(180deg, rgba(73, 202, 181, 0.78), rgba(26, 127, 116, 0.72));
  color: #f7fffb;
  text-shadow: 0 1px 2px rgba(8, 44, 42, 0.28);
}

body[data-page="island"] .island-map-zoom-button:hover:not(:disabled),
body[data-page="island"] .island-map-center-button:hover:not(:disabled),
body[data-page="island"] .island-map-layout-cancel-button:hover:not(:disabled),
body[data-page="island"] .island-map-layout-save-button:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.015);
  filter: saturate(1.08) brightness(1.03);
}

@media (max-width: 560px) {
  body[data-page="island"] .island-map-zoom-controls {
    right: 10px;
    left: 10px;
    justify-content: space-between;
    gap: 5px;
    padding: 7px;
  }

  body[data-page="island"] .island-map-zoom-button {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  body[data-page="island"] .island-map-center-button {
    min-width: 54px;
    height: 40px;
    padding: 0 9px;
    font-size: 13px;
  }

  body[data-page="island"] .island-map-expansion-button {
    min-width: 56px;
  }

  body[data-page="island"] .island-map-zoom-value {
    min-width: 45px;
    font-size: 14px;
  }
}

/* Final liquid-glass pass for the global top HUD. */
.topbar,
body[data-page="island"] .topbar {
  isolation: isolate;
  overflow: visible;
  gap: 14px;
  height: var(--global-topbar-height);
  padding: 7px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.48);
  background:
    radial-gradient(ellipse at 50% -30%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.2) 42%, transparent 66%),
    radial-gradient(circle at 16% 20%, rgba(150, 230, 214, 0.16), transparent 28%),
    radial-gradient(circle at 84% 28%, rgba(255, 220, 154, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(255, 252, 244, 0.72), rgba(247, 242, 229, 0.38) 54%, rgba(238, 246, 244, 0.28)),
    rgba(250, 248, 241, 0.42);
  box-shadow:
    0 18px 58px rgba(34, 44, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(30px) saturate(1.55) contrast(1.02);
  -webkit-backdrop-filter: blur(30px) saturate(1.55) contrast(1.02);
}

.topbar::before,
body[data-page="island"] .topbar::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 5px max(18px, env(safe-area-inset-right)) 6px max(18px, env(safe-area-inset-left));
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.58), transparent 31%, rgba(255, 255, 255, 0.2) 58%, transparent 76%),
    radial-gradient(circle at 9% 50%, rgba(255, 255, 255, 0.46), transparent 20%),
    radial-gradient(circle at 82% 52%, rgba(118, 207, 192, 0.16), transparent 24%),
    rgba(255, 255, 255, 0.2);
  box-shadow:
    0 12px 36px rgba(30, 43, 41, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.topbar::after,
body[data-page="island"] .topbar::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72) 18%, rgba(75, 119, 111, 0.34) 50%, rgba(255, 255, 255, 0.62) 82%, transparent);
  opacity: 0.78;
  pointer-events: none;
}

.topbar > *,
body[data-page="island"] .topbar > * {
  position: relative;
  z-index: 1;
}

.global-player-anchor .global-player-button,
body[data-page="island"] .global-player-anchor .global-player-button,
.global-mailbox-anchor .mailbox-toggle,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
  border: 1px solid rgba(255, 255, 255, 0.56);
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.74), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.18)),
    rgba(249, 252, 248, 0.28);
  box-shadow:
    0 10px 24px rgba(36, 49, 46, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(20px) saturate(1.38);
  -webkit-backdrop-filter: blur(20px) saturate(1.38);
}

.global-player-anchor .global-player-button,
body[data-page="island"] .global-player-anchor .global-player-button {
  min-height: 50px;
  padding: 4px 11px 4px 4px;
  border-radius: 999px;
}

.global-player-button .player-avatar,
body[data-page="island"] .global-player-button .player-avatar {
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow:
    0 9px 22px rgba(35, 52, 47, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.global-player-text strong,
body[data-page="island"] .global-player-text strong {
  color: rgba(30, 43, 44, 0.92);
  font-weight: 950;
}

.global-player-text small,
body[data-page="island"] .global-player-text small {
  color: rgba(63, 78, 74, 0.72);
}

.topbar .global-status,
body[data-page="island"] .topbar .global-status {
  gap: 7px;
  overflow: visible;
  padding: 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 999px;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.72), transparent 32%),
    radial-gradient(circle at 88% 100%, rgba(88, 210, 196, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.16) 46%, rgba(224, 239, 236, 0.28)),
    rgba(255, 255, 255, 0.22);
  box-shadow:
    0 14px 34px rgba(31, 44, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(24px) saturate(1.42);
  -webkit-backdrop-filter: blur(24px) saturate(1.42);
  scrollbar-width: none;
}

.topbar .global-status::-webkit-scrollbar,
body[data-page="island"] .topbar .global-status::-webkit-scrollbar {
  display: none;
}

.topbar .global-status .metric,
body[data-page="island"] .topbar .global-status .metric {
  position: relative;
  overflow: hidden;
  min-width: 88px;
  min-height: 44px;
  padding: 6px 10px;
  border-color: rgba(255, 255, 255, 0.58);
  border-radius: 18px;
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.7), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.16)),
    rgba(255, 255, 255, 0.24);
  box-shadow:
    0 8px 18px rgba(31, 44, 42, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(16px) saturate(1.28);
  -webkit-backdrop-filter: blur(16px) saturate(1.28);
}

.topbar .global-status .metric::after,
body[data-page="island"] .topbar .global-status .metric::after,
.topbar .global-status .wallet-slot::after,
body[data-page="island"] .topbar .global-status .wallet-slot::after,
.global-mailbox-anchor .mailbox-toggle::after,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.42), transparent 32%, rgba(255, 255, 255, 0.16) 58%, transparent 76%);
  opacity: 0.76;
  pointer-events: none;
}

.topbar .global-status .metric i,
body[data-page="island"] .topbar .global-status .metric i {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.28) 44%, rgba(99, 142, 133, 0.18)),
    rgba(255, 255, 255, 0.2);
  box-shadow:
    0 5px 12px rgba(39, 60, 55, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.topbar .global-status .metric.metric-visual-icon i,
body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i {
  width: 31px;
  height: 31px;
  border-radius: 999px;
}

.topbar .global-status .metric span,
body[data-page="island"] .topbar .global-status .metric span {
  position: relative;
  z-index: 1;
  color: rgba(70, 80, 75, 0.72);
  font-size: 10px;
  font-weight: 800;
}

.topbar .global-status .metric strong,
body[data-page="island"] .topbar .global-status .metric strong {
  position: relative;
  z-index: 1;
  color: rgba(26, 38, 43, 0.96);
  font-size: 15px;
  font-weight: 1000;
}

.topbar .global-status .wallet-metric,
body[data-page="island"] .topbar .global-status .wallet-metric {
  flex: 0 0 296px;
  grid-template-rows: 27px 27px;
  gap: 4px;
  width: 296px;
  min-width: 296px;
  min-height: 62px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.56), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)),
    rgba(255, 255, 255, 0.16);
  box-shadow:
    0 12px 26px rgba(33, 45, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(1.34);
  -webkit-backdrop-filter: blur(18px) saturate(1.34);
}

.topbar .global-status .wallet-slot,
body[data-page="island"] .topbar .global-status .wallet-slot {
  overflow: hidden;
  height: 27px;
  padding: 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow:
    0 7px 16px rgba(26, 42, 38, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.topbar .global-status .wallet-slot > *,
body[data-page="island"] .topbar .global-status .wallet-slot > * {
  position: relative;
  z-index: 1;
}

.topbar .global-status .wallet-slot i,
body[data-page="island"] .topbar .global-status .wallet-slot i {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 5px;
  width: 25px;
  height: 25px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.28) 48%, rgba(255, 255, 255, 0.1)),
    rgba(255, 255, 255, 0.2);
  box-shadow:
    0 4px 10px rgba(18, 34, 31, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transform: translateY(-50%);
}

.topbar .global-status .wallet-slot strong,
body[data-page="island"] .topbar .global-status .wallet-slot strong {
  color: rgba(255, 255, 249, 0.97);
  font-size: 16px;
  text-shadow: 0 1px 2px rgba(23, 38, 34, 0.24);
}

.topbar .global-status .wallet-cash,
body[data-page="island"] .topbar .global-status .wallet-cash {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.52), transparent 42%),
    linear-gradient(180deg, rgba(137, 199, 40, 0.94), rgba(79, 157, 9, 0.86)),
    rgba(119, 184, 22, 0.78);
}

.topbar .global-status .wallet-gold,
body[data-page="island"] .topbar .global-status .wallet-gold {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.58), transparent 42%),
    linear-gradient(180deg, rgba(252, 220, 110, 0.94), rgba(215, 157, 39, 0.86)),
    rgba(228, 181, 62, 0.78);
}

.topbar .global-status .wallet-gems,
body[data-page="island"] .topbar .global-status .wallet-gems {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.62), transparent 42%),
    linear-gradient(180deg, rgba(166, 221, 246, 0.94), rgba(91, 181, 227, 0.86)),
    rgba(99, 187, 231, 0.78);
}

.global-mailbox-anchor .mailbox-toggle,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
  position: relative;
  overflow: hidden;
  min-height: 46px;
  padding: 6px 15px 6px 8px;
  color: rgba(26, 38, 43, 0.96);
}

.global-mailbox-anchor .mailbox-toggle-icon,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-icon {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 5px 10px rgba(31, 50, 46, 0.16));
}

.global-mailbox-anchor .mailbox-toggle-label,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-label,
.mailbox-badge {
  position: relative;
  z-index: 1;
}

.topbar .global-status .metric-clickable:hover,
body[data-page="island"] .topbar .global-status .metric-clickable:hover,
.topbar .global-status .wallet-clickable:hover,
body[data-page="island"] .topbar .global-status .wallet-clickable:hover,
.global-mailbox-anchor .mailbox-toggle:hover,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle:hover,
.global-player-anchor .global-player-button:hover,
body[data-page="island"] .global-player-anchor .global-player-button:hover {
  border-color: rgba(255, 255, 255, 0.74);
  filter: saturate(1.06) brightness(1.03);
  transform: translateY(-1px);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar,
  body[data-page="island"] .topbar,
  .topbar .global-status,
  body[data-page="island"] .topbar .global-status,
  .topbar .global-status .metric,
  body[data-page="island"] .topbar .global-status .metric,
  .global-player-anchor .global-player-button,
  body[data-page="island"] .global-player-anchor .global-player-button,
  .global-mailbox-anchor .mailbox-toggle,
  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
    background-color: rgba(250, 248, 241, 0.92);
  }
}

@media (max-width: 900px) {
  .topbar,
  body[data-page="island"] .topbar {
    gap: 9px;
    padding: 7px 12px;
  }

  .topbar .global-status,
  body[data-page="island"] .topbar .global-status {
    max-width: min(560px, calc(100vw - 250px));
  }
}

@media (max-width: 640px) {
  .topbar,
  body[data-page="island"] .topbar {
    gap: 8px;
    padding: 7px 12px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .topbar::before,
  body[data-page="island"] .topbar::before {
    inset: 5px 10px 6px;
  }

  .topbar .global-status,
  body[data-page="island"] .topbar .global-status {
    gap: 6px;
    max-width: none;
    min-width: max-content;
    padding: 4px 5px;
  }

  .topbar .global-status .wallet-metric,
  body[data-page="island"] .topbar .global-status .wallet-metric {
    flex-basis: 264px;
    width: 264px;
    min-width: 264px;
  }

  .topbar .global-status .metric,
  body[data-page="island"] .topbar .global-status .metric {
    min-width: 82px;
    min-height: 42px;
    padding: 6px 9px;
  }
}

body[data-page="island"] .island-map-zoom-controls {
  right: 16px;
  bottom: 16px;
  gap: 8px;
  width: fit-content;
  padding: 6px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.58), transparent 32%),
    radial-gradient(circle at 92% 86%, rgba(94, 205, 190, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.14) 48%, rgba(42, 74, 77, 0.22)),
    rgba(245, 251, 247, 0.18);
  box-shadow:
    0 12px 28px rgba(22, 38, 36, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(22px) saturate(1.42) contrast(1.01);
  -webkit-backdrop-filter: blur(22px) saturate(1.42) contrast(1.01);
}

body[data-page="island"] .island-map-info-toggle {
  right: 16px;
  bottom: 82px;
  min-height: 40px;
  column-gap: 14px;
  padding: 5px 9px 5px 8px;
  font-size: 14px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.58), transparent 32%),
    radial-gradient(circle at 92% 86%, rgba(94, 205, 190, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.14) 48%, rgba(42, 74, 77, 0.22)),
    rgba(245, 251, 247, 0.18);
  box-shadow:
    0 12px 28px rgba(22, 38, 36, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(22px) saturate(1.42) contrast(1.01);
  -webkit-backdrop-filter: blur(22px) saturate(1.42) contrast(1.01);
}

body[data-page="island"] .island-map-info-toggle::before {
  width: 42px;
  height: 24px;
}

body[data-page="island"] .island-map-info-toggle::after {
  left: 11px;
  width: 18px;
  height: 18px;
}

body[data-page="island"] .island-map-info-toggle.active::after {
  transform: translate(18px, -50%);
}

body[data-page="island"] .island-map-info-toggle span {
  min-width: max-content;
}

body[data-page="island"] .island-map-info-toggle i {
  min-width: 28px;
  margin-left: 2px;
  padding: 4px 7px;
  font-size: 12px;
}

body[data-page="island"] .island-map-zoom-button {
  width: 40px;
  height: 40px;
  font-size: 24px;
}

body[data-page="island"] .island-map-center-button,
body[data-page="island"] .island-map-layout-cancel-button,
body[data-page="island"] .island-map-layout-save-button {
  min-width: 60px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
}

body[data-page="island"] .island-map-expansion-button {
  min-width: 64px;
}

body[data-page="island"] .island-map-zoom-value {
  min-width: 54px;
  font-size: 15px;
}

@media (max-width: 560px) {
  body[data-page="island"] .island-map-zoom-controls {
    right: 10px;
    bottom: 16px;
    left: auto;
    justify-content: flex-start;
    gap: 6px;
    width: fit-content;
    max-width: calc(100vw - 20px);
    padding: 6px;
  }

  body[data-page="island"] .island-map-info-toggle {
    right: 10px;
    bottom: 78px;
    min-height: 40px;
    column-gap: 12px;
    padding: 5px 8px;
    font-size: 14px;
  }

  body[data-page="island"] .island-map-zoom-button {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  body[data-page="island"] .island-map-center-button {
    min-width: 50px;
    height: 36px;
    padding: 0 9px;
    font-size: 13px;
  }

  body[data-page="island"] .island-map-expansion-button {
    min-width: 54px;
  }

  body[data-page="island"] .island-map-zoom-value {
    min-width: 44px;
    font-size: 14px;
  }
}

body[data-page="island"] .plot-hex {
  filter: none;
  transition: none;
}

body[data-page="island"] .plot-hex-land,
body[data-page="island"] .plot-hex:hover .plot-hex-land,
body[data-page="island"] .plot-hex.selected .plot-hex-land {
  fill: url("#creamTileGradient");
  opacity: 1;
  shape-rendering: geometricPrecision;
  stroke: rgba(211, 201, 185, 0.82);
  stroke-linejoin: round;
  stroke-width: 1.1;
}

body[data-page="island"] .plot-hex.coastal .plot-hex-land {
  fill: url("#creamTileGradient");
  stroke: rgba(211, 201, 185, 0.82);
}

body[data-page="island"] .plot-hex.inland .plot-hex-land {
  fill: url("#creamTileGradient");
  stroke: rgba(211, 201, 185, 0.82);
}

body[data-page="island"] .plot-hex.occupied .plot-hex-land {
  fill: url("#creamTileGradient");
  stroke: rgba(190, 171, 132, 0.9);
}

body[data-page="island"] .plot-grid-outline {
  filter: none;
  shape-rendering: geometricPrecision;
  stroke: rgba(128, 111, 86, 0.4);
  stroke-linejoin: round;
  stroke-width: 1.15;
}

body[data-page="island"] .plot-hex.coastal .plot-grid-outline {
  stroke: rgba(128, 111, 86, 0.4);
}

body[data-page="island"] .plot-hex.occupied .plot-grid-outline {
  stroke: rgba(150, 122, 68, 0.48);
}

body[data-page="island"] .plot-hover-highlight {
  display: none;
  pointer-events: none;
  will-change: transform;
}

body[data-page="island"] .plot-hover-fill {
  fill: rgba(255, 235, 173, 0.08);
  stroke: none;
}

body[data-page="island"] .plot-hover-outline {
  fill: transparent;
  filter: drop-shadow(0 0 7px rgba(255, 224, 142, 0.58));
  shape-rendering: geometricPrecision;
  stroke: #f4d27d;
  stroke-linejoin: round;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

body[data-page="island"] .plot-hex.selected {
  filter:
    drop-shadow(0 0 8px rgba(255, 215, 112, 0.9))
    drop-shadow(0 0 18px rgba(255, 201, 78, 0.55))
    drop-shadow(0 12px 10px rgba(0, 24, 31, 0.28));
}

body[data-page="island"] .plot-hex.selected .plot-grid-outline {
  stroke: #ffd166;
  stroke-width: 4;
}

body[data-page="island"] .plot-building-label {
  fill: #2d3338;
  font-size: 12px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 4;
}

body[data-page="island"] .plot-building-image {
  filter: drop-shadow(0 6px 5px rgba(31, 39, 45, 0.26));
  pointer-events: none;
}

body[data-page="island"] .plot-building-image-admin_center {
  opacity: 0.98;
}

body[data-page="island"] .expansion-point {
  opacity: 0.86;
  filter: drop-shadow(0 7px 7px rgba(0, 24, 31, 0.22));
}

body[data-page="island"] .expansion-point-bg {
  fill: rgba(255, 255, 255, 0.94);
  stroke: #d4a846;
  stroke-width: 2.4;
}

body[data-page="island"] .expansion-point-plus {
  fill: #6b4b14;
  font-size: 16px;
}

body[data-page="island"] .expansion-preview-depth,
body[data-page="island"] .expansion-preview-shore {
  display: none;
}

body[data-page="island"] .expansion-preview-land {
  fill: rgba(255, 255, 255, 0.42);
  stroke: #ffd166;
  stroke-dasharray: 6 5;
  stroke-width: 3;
}

body[data-page="island"] .plot-iso-shadow,
body[data-page="island"] .plot-iso-side,
body[data-page="island"] .plot-iso-base-texture,
body[data-page="island"] .plot-iso-bottom-edge,
body[data-page="island"] .plot-iso-side-edge {
  pointer-events: none;
  shape-rendering: geometricPrecision;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

body[data-page="island"] .plot-iso-shadow {
  fill: rgba(0, 16, 19, 0.28);
  filter: blur(2px);
}

body[data-page="island"] .plot-iso-side {
  fill: #647869;
  stroke: rgba(23, 40, 37, 0.42);
  stroke-width: 0.8;
}

body[data-page="island"] .plot-iso-side.left {
  fill: #738166;
}

body[data-page="island"] .plot-iso-side.right {
  fill: #607168;
}

body[data-page="island"] .plot-iso-side.front {
  fill: #586b61;
}

body[data-page="island"] .plot-iso-base-texture {
  image-rendering: auto;
}

body[data-page="island"] .plot-iso-bottom-edge,
body[data-page="island"] .plot-iso-side-edge {
  fill: none;
  stroke: rgba(15, 28, 28, 0.5);
  stroke-linecap: round;
  stroke-width: 1;
}

body[data-page="island"] .plots.chessboard {
  background:
    radial-gradient(circle at 50% 36%, rgba(var(--island-grid-highlight-rgb, 255, 255, 255), var(--island-grid-highlight-opacity, 0.76)), transparent 46%),
    radial-gradient(circle, rgba(var(--island-grid-dot-rgb, 77, 127, 140), var(--island-grid-dot-opacity, 0.2)) 0 1px, transparent 1.6px),
    linear-gradient(180deg, var(--island-grid-bg-top, #f3fbfc) 0%, var(--island-grid-bg-mid, #e1f4f6) 54%, var(--island-grid-bg-bottom, #cce8eb) 100%);
  background-size: auto, 16px 16px, auto;
  box-shadow:
    inset 0 28px 60px rgba(255, 255, 255, 0.58),
    inset 0 -40px 82px rgba(46, 121, 137, 0.16);
}

body[data-page="island"] .plots.chessboard::before {
  opacity: 0.14;
}

body[data-page="island"] .plots.chessboard-world-demo {
  background: #f6fbfa;
  box-shadow: none;
}

body[data-page="island"] .plots.chessboard-world-demo::before {
  opacity: 0;
}

body[data-page="island"] .hex-map.chessboard {
  filter:
    drop-shadow(0 26px 26px rgba(55, 75, 75, 0.24))
    drop-shadow(0 0 18px rgba(255, 255, 255, 0.44));
}

body[data-page="island"] .hex-map.chessboard-world-demo {
  filter: none;
}

body[data-page="island"] .hex-map.chessboard-world-demo .chessboard-world-bg {
  fill: #f7fbfa;
}

body[data-page="island"] .hex-map.chessboard-world-demo .chessboard-world-dot {
  fill: rgba(116, 166, 184, 0.38);
}

body[data-page="island"] .hex-map.chessboard-world-demo .chessboard-world-dot-fill,
body[data-page="island"] .hex-map.chessboard-world-demo .chessboard-world-grid,
body[data-page="island"] .hex-map.chessboard-world-demo .chessboard-world-selection-layer,
body[data-page="island"] .hex-map.chessboard-world-demo .chessboard-world-piece-layer {
  pointer-events: none;
  shape-rendering: geometricPrecision;
  vector-effect: non-scaling-stroke;
}

body[data-page="island"] .hex-map.chessboard-world-demo .chessboard-world-grid-edge {
  stroke: rgba(151, 171, 177, 0.5);
  stroke-dasharray: 4 6;
  stroke-linecap: butt;
  stroke-width: 1.15;
}

body[data-page="island"] .hex-map.chessboard-world-demo .chessboard-world-selected-cell polygon {
  fill: transparent;
  stroke: #d5a909;
  stroke-linejoin: round;
  stroke-width: 3.1;
  filter: drop-shadow(0 1px 0 rgba(70, 54, 0, 0.24));
}

body[data-page="island"] .hex-map.chessboard-world-demo .chessboard-world-piece-image {
  image-rendering: auto;
}

body[data-page="island"] .hex-map.chessboard .island-chessboard-layer,
body[data-page="island"] .hex-map.chessboard .island-chessboard-cell,
body[data-page="island"] .hex-map.chessboard .island-chessboard-ocean-tile,
body[data-page="island"] .hex-map.chessboard .island-chessboard-ocean-piece,
body[data-page="island"] .hex-map.chessboard .island-chessboard-cell-face,
body[data-page="island"] .hex-map.chessboard .island-chessboard-cell-ridge {
  pointer-events: none;
  shape-rendering: geometricPrecision;
  vector-effect: non-scaling-stroke;
}

body[data-page="island"] .hex-map.chessboard .island-chessboard-ocean-piece {
  filter:
    drop-shadow(0 12px 10px rgba(18, 58, 78, 0.16))
    saturate(0.98);
}

body[data-page="island"] .hex-map.chessboard .island-chessboard-cell-face {
  fill: transparent;
  stroke: rgba(var(--island-grid-line-rgb, 95, 143, 154), var(--island-grid-line-opacity, 0.32));
  stroke-dasharray: 6 6;
  stroke-linejoin: round;
  stroke-width: 1.05;
}

body[data-page="island"] .hex-map.chessboard .island-chessboard-cell-ridge {
  stroke: rgba(var(--island-grid-ridge-rgb, 110, 163, 171), var(--island-grid-ridge-opacity, 0.18));
  stroke-dasharray: 5 7;
  stroke-linecap: round;
  stroke-width: 0.9;
}

body[data-page="island"] .hex-map.chessboard .plot-hex {
  filter:
    drop-shadow(0 18px 13px rgba(74, 73, 60, 0.2))
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.42));
}

body[data-page="island"] .hex-map.chessboard .plot-iso-shadow {
  fill: rgba(76, 82, 75, 0.22);
  filter: blur(2.4px);
}

body[data-page="island"] .hex-map.chessboard .plot-hex-land,
body[data-page="island"] .hex-map.chessboard .plot-hex:hover .plot-hex-land,
body[data-page="island"] .hex-map.chessboard .plot-hex.selected .plot-hex-land {
  fill: #e5cf95;
  stroke: rgba(255, 248, 220, 0.86);
  stroke-width: 1.15;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.coastal .plot-hex-land {
  fill: #66bdc0;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.inland .plot-hex-land {
  fill: #e5cf95;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.occupied .plot-hex-land {
  fill: #d7bd78;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.building-admin_center .plot-hex-land {
  fill: #caa96a;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.building-port .plot-hex-land,
body[data-page="island"] .hex-map.chessboard .plot-hex.building-desalination_plant .plot-hex-land {
  fill: #55b4be;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.building-warehouse .plot-hex-land {
  fill: #c5b487;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.building-farm .plot-hex-land {
  fill: #a8bf60;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.building-mine .plot-hex-land {
  fill: #9a9982;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.building-food_factory .plot-hex-land,
body[data-page="island"] .hex-map.chessboard .plot-hex.building-smelter .plot-hex-land {
  fill: #b88a5c;
}

body[data-page="island"] .hex-map.chessboard .plot-grid-outline {
  stroke: rgba(75, 62, 42, 0.5);
  stroke-width: 1.15;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.selected .plot-grid-outline {
  filter:
    drop-shadow(0 0 7px rgba(255, 195, 75, 0.95))
    drop-shadow(0 0 15px rgba(255, 195, 75, 0.42));
  stroke: #ffbf4b;
  stroke-width: 3.2;
}

body[data-page="island"] .hex-map.chessboard .plot-iso-side.land.left {
  fill: #b58a58;
}

body[data-page="island"] .hex-map.chessboard .plot-iso-side.land.right {
  fill: #8d704d;
}

body[data-page="island"] .hex-map.chessboard .plot-iso-side.land.front {
  fill: #735a43;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.coastal .plot-iso-side.land.left {
  fill: #2196a6;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.coastal .plot-iso-side.land.right {
  fill: #1b788f;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.coastal .plot-iso-side.land.front {
  fill: #176174;
}

body[data-page="island"] .hex-map.chessboard .plot-building-image {
  filter: none;
}

body[data-page="island"] .hex-map.chessboard {
  filter: drop-shadow(0 18px 18px rgba(55, 75, 75, 0.12));
}

body[data-page="island"] .hex-map.chessboard .plot-hex {
  filter: none;
}

body[data-page="island"] .hex-map.chessboard .plot-iso-shadow {
  fill: transparent;
  filter: none;
}

body[data-page="island"] .hex-map.chessboard .plot-hex .plot-hex-land,
body[data-page="island"] .hex-map.chessboard .plot-hex.coastal .plot-hex-land,
body[data-page="island"] .hex-map.chessboard .plot-hex.inland .plot-hex-land,
body[data-page="island"] .hex-map.chessboard .plot-hex.occupied .plot-hex-land,
body[data-page="island"] .hex-map.chessboard .plot-hex[class*="building-"] .plot-hex-land,
body[data-page="island"] .hex-map.chessboard .plot-hex:hover .plot-hex-land,
body[data-page="island"] .hex-map.chessboard .plot-hex.selected .plot-hex-land {
  fill: #ffffff;
  stroke: rgba(80, 115, 143, 0.72);
  stroke-width: 1.15;
}

body[data-page="island"] .hex-map.chessboard .plot-grid-outline {
  stroke: rgba(72, 118, 156, 0.78);
  stroke-width: 1.1;
}

body[data-page="island"] .hex-map.chessboard .plot-hex.selected .plot-grid-outline {
  stroke: #ffbf4b;
  stroke-width: 3.2;
}

body[data-page="island"] .hex-map.chessboard .plot-iso-side.land.left,
body[data-page="island"] .hex-map.chessboard .plot-hex.coastal .plot-iso-side.land.left {
  fill: #f1f3f5;
}

body[data-page="island"] .hex-map.chessboard .plot-iso-side.land.right,
body[data-page="island"] .hex-map.chessboard .plot-hex.coastal .plot-iso-side.land.right {
  fill: #d9dee3;
}

body[data-page="island"] .hex-map.chessboard .plot-iso-side.land.front,
body[data-page="island"] .hex-map.chessboard .plot-hex.coastal .plot-iso-side.land.front {
  fill: #cbd3da;
}

body[data-page="island"] .hex-map.chessboard .plot-iso-side-edge {
  stroke: rgba(65, 94, 118, 0.58);
  stroke-width: 0.9;
}

body[data-page="island"] .hex-map.chessboard .plot-building-image {
  filter: none;
}

body[data-page="island"] .island-map-shell.layout-editing {
  cursor: default;
}

body[data-page="island"] .hex-map.layout-editing .plot-hex.layout-editable {
  cursor: grab;
}

body[data-page="island"] .hex-map.layout-editing .plot-hex.layout-editable:active {
  cursor: grabbing;
}

body[data-page="island"] .plot-hex-drag-body {
  transform-box: fill-box;
  transform-origin: center;
}

body[data-page="island"] .hex-map.layout-editing .plot-hex.layout-dragging {
  cursor: grabbing;
}

body[data-page="island"] .hex-map.layout-editing .plot-hex.layout-dragging .plot-hex-drag-body {
  animation: islandPlotLift 130ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  filter:
    drop-shadow(0 23px 16px rgba(19, 38, 49, 0.2))
    drop-shadow(0 7px 5px rgba(19, 38, 49, 0.16));
}

body[data-page="island"] .hex-map.layout-editing .plot-hex.layout-dragging .plot-grid-outline {
  stroke: #2563eb;
  stroke-width: 3.4;
}

body[data-page="island"] .hex-map.layout-editing .plot-hex.layout-dropping .plot-hex-drag-body {
  animation: islandPlotDrop 240ms cubic-bezier(0.18, 0.72, 0.2, 1) both;
}

body[data-page="island"] .island-layout-drop-target polygon {
  fill: rgba(37, 99, 235, 0.1);
  stroke: rgba(37, 99, 235, 0.72);
  stroke-width: 3;
  stroke-dasharray: 10 8;
  filter:
    drop-shadow(0 0 8px rgba(37, 99, 235, 0.28))
    drop-shadow(0 10px 14px rgba(37, 99, 235, 0.1));
  animation: islandDropTargetPulse 900ms ease-in-out infinite;
}

body[data-page="island"] .hex-map.layout-editing .plot-hover-highlight {
  display: none;
}

body[data-page="island"] .hex-map.layout-editing .plot-hex.layout-invalid .plot-grid-outline,
body[data-page="island"] .hex-map.chessboard.layout-editing .plot-hex.layout-invalid .plot-grid-outline {
  filter:
    drop-shadow(0 0 7px rgba(239, 68, 68, 0.9))
    drop-shadow(0 0 15px rgba(239, 68, 68, 0.48));
  stroke: #ef4444;
  stroke-width: 4;
}

@keyframes islandPlotLift {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(-18px) scale(1.035);
  }
}

@keyframes islandPlotDrop {
  0% {
    transform: translateY(-18px) scale(1.035);
    filter:
      drop-shadow(0 23px 16px rgba(19, 38, 49, 0.18))
      drop-shadow(0 7px 5px rgba(19, 38, 49, 0.14));
  }
  72% {
    transform: translateY(3px) scale(0.995);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: none;
  }
}

@keyframes islandDropTargetPulse {
  0%, 100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  body[data-page="island"] .island-workspace {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .plots {
    padding: 24px 16px 28px;
  }

  body[data-page="island"] .island-status-hud {
    right: 14px;
    width: 306px;
    max-width: calc(100vw - 28px);
  }

  body[data-page="island"] .island-status-hud.custom-positioned {
    width: 306px;
    max-width: calc(100vw - 28px);
  }

  body[data-page="island"] .hex-map {
    width: min(1120px, 100%);
  }

  body[data-page="island"] .island-map-zoom-controls {
    right: 18px;
    bottom: 18px;
  }

  body[data-page="island"] .island-map-info-toggle {
    right: 18px;
    bottom: 78px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-backdrop {
    padding: 18px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal {
    width: calc(100vw - 36px);
    max-height: calc(100vh - var(--global-topbar-height) - 36px);
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-columns {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  body[data-page="island"] .island-power-detail-body {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .island-power-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="island"] .island-power-panel {
    min-height: 220px;
  }

  body[data-page="island"] .island-population-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="island"] .island-population-panel {
    min-height: 300px;
  }

  body[data-page="island"] .island-population-panel-body {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }

  body[data-page="island"] .island-population-table {
    overflow: visible;
  }

  body[data-page="island"] .island-population-table-head,
  body[data-page="island"] .island-population-row {
    grid-template-columns: minmax(180px, 0.95fr) minmax(182px, 0.9fr) repeat(5, minmax(66px, 0.52fr)) 52px;
    min-width: 0;
  }

  body[data-page="island"] .island-ship-brief-dock {
    left: 14px;
    top: 494px;
  }
}

@media (max-width: 560px) {
  body[data-page="island"] .plots {
    padding-top: 324px;
  }

  body[data-page="island"] .island-status-hud {
    left: 14px;
    right: 14px;
    width: auto;
  }

  body[data-page="island"] .island-status-hud.custom-positioned {
    left: auto;
    right: auto;
    width: min(306px, calc(100vw - 28px));
  }

  body[data-page="island"] .island-map-info-toggle {
    right: 14px;
    bottom: 78px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-backdrop {
    padding: 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - var(--global-topbar-height) - 24px);
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-head {
    padding: 16px 54px 12px 16px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-head strong {
    font-size: 17px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-columns {
    gap: 12px;
    padding: 12px;
  }

  body[data-page="island"] .island-power-detail-body {
    gap: 12px;
    padding: 12px;
  }

  body[data-page="island"] .island-power-overview {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .island-population-detail-body {
    gap: 12px;
    padding: 12px;
  }

  body[data-page="island"] .island-population-overview {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .island-population-panel-head {
    padding: 13px 14px 10px;
  }

  body[data-page="island"] .island-population-panel-body {
    padding: 0 10px 10px;
  }

  body[data-page="island"] .island-population-table-head,
  body[data-page="island"] .island-population-row {
    grid-template-columns: minmax(136px, 0.86fr) minmax(142px, 0.78fr) repeat(5, minmax(48px, 0.5fr)) 42px;
    min-width: 0;
    gap: 7px;
    padding-right: 14px;
    padding-left: 14px;
  }

  body[data-page="island"] .island-population-expand-button {
    width: 40px;
    height: 40px;
  }

  body[data-page="island"] .island-population-need-dropdown {
    margin-right: 10px;
    margin-left: 10px;
  }

  body[data-page="island"] .island-population-need-support-table {
    min-width: 0;
  }

  body[data-page="island"] .island-population-need-support-head,
  body[data-page="island"] .island-population-need-support-row {
    grid-template-columns: minmax(116px, 1fr) 52px 62px 62px 76px 78px;
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  body[data-page="island"] .island-population-worker-icon {
    width: 42px;
    height: 42px;
  }

  body[data-page="island"] .island-population-worker strong,
  body[data-page="island"] .island-population-number,
  body[data-page="island"] .island-population-mood strong {
    font-size: 17px;
  }

  body[data-page="island"] .island-population-wage-current strong {
    font-size: 15px;
  }

  body[data-page="island"] .island-population-wage-option {
    height: 22px;
    padding-right: 2px;
    padding-left: 2px;
    font-size: 9px;
  }

  body[data-page="island"] .island-population-help-popover {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: 42vh;
    overflow: auto;
    transform: translateY(8px);
  }

  body[data-page="island"] .island-population-help-popover::before {
    display: none;
  }

  body[data-page="island"] .island-power-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
  }

  body[data-page="island"] .island-power-row-thumb,
  body[data-page="island"] .island-power-row-mark {
    width: 42px;
    height: 42px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-table-head,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-row {
    grid-template-columns: minmax(0, 1fr) 52px 62px 78px;
    gap: 8px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-table-head.compact,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-row.compact {
    grid-template-columns: minmax(0, 1fr) 52px 62px 44px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-table-head.no-action,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-row.no-action {
    grid-template-columns: minmax(0, 1fr) 52px 62px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-body {
    gap: 12px;
    padding: 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-actions,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-vitals {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer {
    grid-template-columns: 1fr 1fr 58px 36px;
    gap: 8px;
    margin-right: 8px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer input[type="range"] {
    grid-column: 1 / -1;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-transfer small {
    display: none;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-product strong {
    font-size: 13px;
  }

  body[data-page="island"] .island-ship-brief-dock {
    top: 692px;
  }

}

.alliance-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.alliance-card {
  background: rgba(255, 252, 245, 0.92);
  border: 1px solid rgba(147, 125, 87, 0.24);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(32, 40, 48, 0.08);
  padding: 16px;
}

.alliance-wide {
  grid-column: 1 / -1;
}

.alliance-overview-card {
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(246, 239, 226, 0.96));
}

.alliance-stat-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 12px 0;
}

.alliance-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.alliance-columns {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.alliance-list {
  display: grid;
  gap: 10px;
}

.alliance-row,
.alliance-member-row {
  align-items: center;
  border-bottom: 1px solid rgba(55, 76, 89, 0.12);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 0;
}

.alliance-row small,
.alliance-member-row small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.alliance-subtitle {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  margin: 8px 0;
}

.alliance-policy-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.alliance-policy-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(59, 78, 88, 0.14);
  border-radius: 8px;
  padding: 12px;
}

.alliance-policy-card.active {
  border-color: rgba(18, 127, 113, 0.46);
  box-shadow: inset 0 0 0 1px rgba(18, 127, 113, 0.18);
}

.alliance-progress {
  margin: 10px 0;
}

body[data-page="policy"] {
  background:
    linear-gradient(90deg, rgba(8, 10, 12, 0.96), rgba(8, 10, 12, 0.78) 46%, rgba(8, 10, 12, 0.94)),
    linear-gradient(180deg, rgba(9, 11, 13, 0.18), rgba(9, 11, 13, 0.92)),
    url("/assets/building-uploads/faction_a_admin_center_lv10_asset_1779868521864_de32cd8cb6a5f8.webp") center / cover fixed;
  color: #f8f1e2;
}

body[data-page="policy"] .app {
  max-width: none;
  padding-bottom: calc(var(--global-bottom-nav-reserve) + 42px);
  padding-right: clamp(16px, 2.2vw, 30px);
  padding-left: clamp(16px, 2.2vw, 30px);
}

body[data-page="policy"] #policyPage > section > h2 {
  display: none;
}

.policy-doctrine-shell {
  --policy-ink: #f8f1e2;
  --policy-muted: rgba(248, 241, 226, 0.64);
  --policy-panel: rgba(12, 15, 18, 0.78);
  --policy-panel-solid: #111417;
  --policy-line: rgba(224, 201, 152, 0.24);
  --policy-line-strong: rgba(224, 201, 152, 0.62);
  --policy-gold: #d7b66b;
  --policy-gold-soft: rgba(215, 182, 107, 0.18);
  --policy-jade: #7dc8b3;
  --policy-ruby: #c96b62;
  --policy-shadow: rgba(0, 0, 0, 0.42);
  display: grid;
  gap: 14px;
  min-height: calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 30px);
  color: var(--policy-ink);
}

.policy-doctrine-shell button {
  border-radius: 0;
  color: inherit;
}

.policy-doctrine-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--policy-line);
}

.policy-doctrine-hero::before {
  position: absolute;
  top: 0;
  left: 0;
  width: min(360px, 62vw);
  height: 1px;
  background: linear-gradient(90deg, var(--policy-gold), transparent);
  content: "";
}

.policy-eyebrow {
  margin-bottom: 8px;
  color: var(--policy-gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.policy-doctrine-hero h1 {
  margin: 0;
  font-family: var(--apple-china-font);
  font-size: clamp(38px, 5vw, 72px);
  font-weight: 500;
  line-height: 0.9;
}

.policy-doctrine-hero p {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--policy-muted);
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.55;
}

.policy-mandate-panel {
  padding: 12px 16px;
  border: 1px solid var(--policy-line);
  background: linear-gradient(145deg, rgba(16, 18, 20, 0.92), rgba(16, 18, 20, 0.62));
  box-shadow: 0 24px 70px var(--policy-shadow);
}

.policy-mandate-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.policy-mandate-head span,
.policy-mandate-metrics span,
.policy-stage-toolbar span,
.policy-lane-head div,
.policy-dossier-title span,
.policy-dossier-grid span {
  color: var(--policy-muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.policy-mandate-score {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-top: 9px;
}

.policy-mandate-score strong {
  font-family: var(--apple-china-font);
  font-size: clamp(38px, 3.7vw, 52px);
  font-weight: 500;
  line-height: 0.9;
}

.policy-mandate-score small {
  padding-bottom: 5px;
  color: var(--policy-muted);
  font-size: 16px;
}

.policy-mandate-rail {
  height: 5px;
  margin: 8px 0 10px;
  overflow: hidden;
  background: rgba(248, 241, 226, 0.12);
}

.policy-mandate-rail span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--policy-gold), var(--policy-jade));
}

.policy-mandate-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.policy-mandate-metrics div,
.policy-dossier-grid div {
  padding: 8px 10px;
  border: 1px solid rgba(248, 241, 226, 0.1);
  background: rgba(248, 241, 226, 0.055);
}

.policy-mandate-metrics strong,
.policy-dossier-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}

.policy-doctrine-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 72px;
  overflow: hidden;
  border: 1px solid var(--policy-line);
  background:
    linear-gradient(90deg, rgba(215, 182, 107, 0.12), rgba(248, 241, 226, 0.035) 42%, rgba(8, 10, 12, 0.42)),
    rgba(12, 15, 18, 0.78);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

.policy-doctrine-tabs::before {
  position: absolute;
  top: 0;
  right: 4%;
  left: 4%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215, 182, 107, 0.76), transparent);
  content: "";
}

.policy-doctrine-tab {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 11px 14px;
  border: 0;
  border-right: 1px solid rgba(248, 241, 226, 0.11);
  background: transparent;
  text-align: left;
}

.policy-doctrine-tab:last-child {
  border-right: 0;
}

.policy-doctrine-tab::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 2px;
  background: var(--policy-gold);
  opacity: 0;
  content: "";
}

.policy-doctrine-tab:hover {
  background: rgba(248, 241, 226, 0.055);
}

.policy-doctrine-tab.selected {
  background:
    linear-gradient(145deg, rgba(215, 182, 107, 0.18), rgba(248, 241, 226, 0.045)),
    rgba(248, 241, 226, 0.035);
}

.policy-doctrine-tab.selected::after {
  opacity: 1;
}

.policy-tab-mark {
  display: grid;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 1px solid rgba(215, 182, 107, 0.42);
  border-radius: 14px;
  background: rgba(248, 241, 226, 0.1);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  color: var(--policy-gold);
  font-family: var(--apple-china-font);
  font-size: 17px;
}

.policy-tab-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.policy-tab-mark.text span {
  line-height: 1;
}

.policy-tab-copy {
  min-width: 0;
}

.policy-tab-copy strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.policy-tab-copy small {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--policy-muted);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-tab-count {
  color: var(--policy-gold);
  font-family: var(--apple-china-font);
  font-size: 20px;
  white-space: nowrap;
}

.policy-doctrine-workspace {
  display: block;
}

.policy-doctrine-stage,
.policy-dossier-panel {
  border: 1px solid var(--policy-line);
  background:
    linear-gradient(135deg, rgba(248, 241, 226, 0.045), rgba(248, 241, 226, 0)),
    var(--policy-panel);
  box-shadow: 0 22px 72px var(--policy-shadow);
}

.policy-doctrine-stage {
  position: relative;
  overflow: hidden;
}

.policy-doctrine-stage::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(215, 182, 107, 0.5), transparent 48%, rgba(125, 200, 179, 0.24));
  content: "";
}

.policy-stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--policy-line);
  background: linear-gradient(90deg, rgba(215, 182, 107, 0.12), rgba(248, 241, 226, 0.025));
}

.policy-stage-toolbar strong {
  display: block;
  font-size: 17px;
}

.policy-stage-toolbar span {
  display: block;
  margin-top: 4px;
  text-transform: none;
}

.policy-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.policy-filter-tabs button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(248, 241, 226, 0.11);
  background: rgba(248, 241, 226, 0.055);
  font-size: 12px;
  white-space: nowrap;
}

.policy-filter-tabs button.selected {
  border-color: var(--policy-line-strong);
  background: var(--policy-gold-soft);
  color: #fff8e7;
}

.policy-stage-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(248, 241, 226, 0.1);
}

.policy-stage-ledger span {
  display: flex;
  justify-content: space-between;
  min-height: 40px;
  padding: 10px 12px;
  background: rgba(248, 241, 226, 0.04);
}

.policy-stage-ledger b {
  color: rgba(248, 241, 226, 0.78);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.policy-stage-ledger em {
  color: var(--policy-gold);
  font-size: 12px;
  font-style: normal;
}

.policy-doctrine-lanes {
  position: relative;
  display: grid;
  gap: 0;
  padding: 14px 16px 26px 26px;
}

.policy-doctrine-lanes::before {
  position: absolute;
  top: 34px;
  bottom: 34px;
  left: 86px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(215, 182, 107, 0.72) 14%, rgba(215, 182, 107, 0.32) 66%, transparent);
  content: "";
}

.policy-lane {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  min-width: 0;
  padding: 0 0 14px;
}

.policy-lane::before {
  position: absolute;
  top: 31px;
  left: 55px;
  z-index: 1;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(248, 241, 226, 0.4);
  background: linear-gradient(145deg, rgba(215, 182, 107, 0.9), rgba(248, 241, 226, 0.12));
  box-shadow: 0 0 0 5px rgba(12, 15, 18, 0.72);
  transform: rotate(45deg);
  content: "";
}

.policy-lane-head {
  align-self: start;
  min-height: 82px;
  padding: 8px 10px 12px 0;
  position: sticky;
  top: calc(var(--global-topbar-height) + 12px);
}

.policy-lane-head strong {
  display: block;
  margin: 6px 0;
  font-family: var(--apple-china-font);
  font-size: 24px;
  font-weight: 500;
}

.policy-lane-head p {
  margin: 0;
  color: var(--policy-muted);
  font-size: 12px;
  line-height: 1.55;
}

.policy-node-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  min-width: 0;
}

.policy-node {
  position: relative;
  display: grid;
  gap: 9px;
  width: 100%;
  min-height: 88px;
  padding: 12px;
  border: 1px solid rgba(248, 241, 226, 0.13);
  background:
    linear-gradient(135deg, rgba(248, 241, 226, 0.075), rgba(248, 241, 226, 0.035) 55%, rgba(215, 182, 107, 0.035)),
    rgba(8, 10, 12, 0.48);
  text-align: left;
}

.policy-node::before {
  position: absolute;
  top: 0;
  right: 12px;
  left: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215, 182, 107, 0.8), transparent);
  opacity: 0;
  content: "";
}

.policy-node::after {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 13px;
  height: 13px;
  border-right: 1px solid rgba(215, 182, 107, 0.22);
  border-bottom: 1px solid rgba(215, 182, 107, 0.22);
  content: "";
}

.policy-node:hover {
  border-color: rgba(215, 182, 107, 0.44);
  background: rgba(248, 241, 226, 0.085);
  transform: translateY(-2px);
}

.policy-node:hover::before,
.policy-node.selected::before,
.policy-node.active::before {
  opacity: 1;
}

.policy-node.selected {
  border-color: var(--policy-line-strong);
  background: linear-gradient(135deg, rgba(215, 182, 107, 0.21), rgba(248, 241, 226, 0.075));
}

.policy-node.active {
  border-color: rgba(125, 200, 179, 0.58);
  box-shadow: inset 0 0 0 1px rgba(125, 200, 179, 0.18);
}

.policy-node.locked {
  opacity: 0.58;
}

.policy-node-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.policy-node-topline > span {
  min-width: 0;
}

.policy-node-topline strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-node-topline small {
  display: block;
  margin-top: 5px;
  color: var(--policy-muted);
  font-size: 11px;
}

.policy-node-topline i {
  display: grid;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid rgba(215, 182, 107, 0.42);
  background: rgba(215, 182, 107, 0.08);
  color: var(--policy-gold);
  font-size: 12px;
  font-style: normal;
}

.policy-node-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--policy-muted);
  font-size: 11px;
}

.policy-pill {
  display: inline-flex;
  min-height: 24px;
  padding: 4px 7px;
  border: 1px solid rgba(248, 241, 226, 0.14);
  color: rgba(248, 241, 226, 0.76);
}

.policy-pill.ready {
  border-color: rgba(215, 182, 107, 0.46);
  color: var(--policy-gold);
}

.policy-pill.active {
  border-color: rgba(125, 200, 179, 0.52);
  color: var(--policy-jade);
}

.policy-pill.locked {
  border-color: rgba(201, 107, 98, 0.4);
  color: #e4a39c;
}

.policy-empty-state {
  padding: 24px 14px;
  border: 1px dashed rgba(248, 241, 226, 0.16);
  color: var(--policy-muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.policy-dossier-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(940px, calc(100vw - 34px));
  max-height: min(82vh, 760px);
  min-width: 0;
  overflow: hidden;
}

.policy-dossier-modal {
  position: fixed;
  z-index: 5200;
  inset: 0;
  display: grid;
  align-items: center;
  justify-content: center;
  padding: calc(var(--global-topbar-height) + 18px) 18px calc(var(--global-bottom-nav-reserve) + 18px);
  background:
    radial-gradient(circle at 50% 34%, rgba(215, 182, 107, 0.14), transparent 32%),
    rgba(4, 7, 9, 0.78);
  backdrop-filter: blur(10px);
}

.policy-dossier-close {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  display: grid;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(215, 182, 107, 0.42);
  background: rgba(8, 10, 12, 0.72);
  color: var(--policy-ink);
  font-size: 24px;
  line-height: 1;
}

.policy-dossier-close:hover {
  border-color: var(--policy-line-strong);
  background: rgba(215, 182, 107, 0.16);
}

.policy-dossier-visual {
  min-height: 220px;
  padding: 18px;
  border-bottom: 1px solid var(--policy-line);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.2), transparent 32%),
    linear-gradient(90deg, rgba(8, 10, 12, 0.18), rgba(8, 10, 12, 0.02) 48%, rgba(8, 10, 12, 0.26)),
    linear-gradient(180deg, rgba(8, 10, 12, 0.02), rgba(8, 10, 12, 0.5)),
    var(--policy-dossier-illustration, url("/assets/building-uploads/faction_a_cbd_lv10_asset_1779887274317_236d802abf8598.webp")) center / cover;
  overflow: hidden;
  position: relative;
}

.policy-dossier-visual::after {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(215, 182, 107, 0.34);
  pointer-events: none;
  content: "";
}

.policy-dossier-icon {
  position: relative;
  z-index: 1;
  display: grid;
  justify-content: center;
  align-items: center;
  width: 68px;
  height: 68px;
  overflow: hidden;
  margin: 0 auto 0 0;
  border: 1px solid var(--policy-line-strong);
  border-radius: 18px;
  background: rgba(8, 10, 12, 0.42);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  font-family: var(--apple-china-font);
}

.policy-dossier-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.policy-dossier-icon.text span {
  line-height: 1;
}

.policy-dossier-body {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 24px;
}

.policy-dossier-title {
  display: grid;
  gap: 7px;
}

.policy-dossier-title h2 {
  margin: 0;
  font-family: var(--apple-china-font);
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 500;
  line-height: 1.05;
}

.policy-dossier-body p {
  margin: 0;
  color: rgba(248, 241, 226, 0.84);
  font-size: 14px;
  line-height: 1.85;
}

.policy-dossier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.policy-requirement-box {
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--policy-gold);
  color: rgba(248, 241, 226, 0.82);
  font-size: 13px;
  line-height: 1.75;
}

.policy-requirement-box.locked {
  border-left-color: var(--policy-ruby);
  color: #e4a39c;
}

.policy-dossier-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 24px 24px;
}

.policy-dossier-actions button {
  min-height: 44px;
  border: 1px solid var(--policy-line-strong);
  background: linear-gradient(135deg, rgba(215, 182, 107, 0.22), rgba(248, 241, 226, 0.08));
  color: var(--policy-ink);
  font-weight: 800;
}

.policy-dossier-actions button.secondary {
  border-color: rgba(248, 241, 226, 0.18);
  background: rgba(248, 241, 226, 0.055);
}

.policy-dossier-actions button.danger:not(:disabled) {
  border-color: rgba(201, 107, 98, 0.52);
  color: #f0b0a9;
}

@media (max-width: 1120px) {
  .policy-doctrine-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body[data-page="policy"] .app {
    padding-right: 12px;
    padding-left: 12px;
  }

  .policy-doctrine-shell {
    gap: 12px;
  }

  .policy-doctrine-hero {
    padding: 20px 0 18px;
  }

  .policy-mandate-metrics,
  .policy-doctrine-tabs,
  .policy-stage-ledger,
  .policy-dossier-grid,
  .policy-dossier-actions {
    grid-template-columns: 1fr;
  }

  .policy-doctrine-tab {
    min-height: 68px;
    padding: 11px 12px;
  }

  .policy-stage-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .policy-filter-tabs {
    justify-content: start;
  }

  .policy-doctrine-lanes {
    padding: 16px 12px 18px;
  }

  .policy-doctrine-lanes::before,
  .policy-lane::before {
    display: none;
  }

  .policy-lane {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .policy-lane-head {
    position: static;
    min-height: 0;
    padding: 4px 0;
  }

  .policy-node-stack {
    grid-template-columns: 1fr;
  }

  .policy-dossier-modal {
    align-items: end;
    padding: var(--global-topbar-height) 10px 10px;
  }

  .policy-dossier-panel {
    width: min(100%, 560px);
    max-height: calc(100vh - var(--global-topbar-height) - 20px);
  }

  .policy-dossier-visual {
    min-height: 150px;
  }

  .policy-dossier-body {
    padding: 18px;
  }

  .policy-dossier-actions {
    padding: 0 18px 18px;
  }
}

.technology-workbench-modal[data-workbench-tab="policy"] {
  background:
    radial-gradient(circle at 18% 0%, rgba(126, 214, 202, 0.24), transparent 36%),
    radial-gradient(circle at 76% 14%, rgba(226, 187, 101, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(244, 251, 248, 0.84), rgba(225, 238, 234, 0.78));
  -webkit-backdrop-filter: blur(18px) saturate(1.24);
  backdrop-filter: blur(18px) saturate(1.24);
}

.technology-workbench-shell[data-workbench-tab="policy"] {
  --policy-ink: #153331;
  --policy-muted: rgba(34, 62, 58, 0.62);
  --policy-panel: rgba(255, 255, 255, 0.58);
  --policy-panel-solid: rgba(250, 254, 252, 0.88);
  --policy-line: rgba(53, 91, 84, 0.14);
  --policy-line-strong: rgba(13, 126, 112, 0.32);
  --policy-gold: #b88b2f;
  --policy-gold-soft: rgba(226, 187, 101, 0.2);
  --policy-jade: #0f8f80;
  --policy-ruby: #c35f63;
  --policy-shadow: rgba(45, 75, 68, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 30px;
  background:
    radial-gradient(circle at 9% 0%, rgba(126, 214, 202, 0.2), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(226, 187, 101, 0.18), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(232, 247, 243, 0.62) 54%, rgba(250, 247, 235, 0.68)),
    rgba(255, 255, 255, 0.58);
  box-shadow:
    0 34px 90px rgba(35, 67, 60, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(47, 82, 75, 0.1);
  color: var(--policy-ink);
  -webkit-backdrop-filter: blur(28px) saturate(1.34);
  backdrop-filter: blur(28px) saturate(1.34);
}

.technology-workbench-shell[data-workbench-tab="policy"] .technology-workbench-head {
  min-height: 88px;
  border-bottom: 1px solid rgba(59, 92, 85, 0.13);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(229, 247, 243, 0.56) 58%, rgba(250, 241, 218, 0.46)),
    rgba(255, 255, 255, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 10px 26px rgba(37, 68, 62, 0.08);
}

.technology-workbench-shell[data-workbench-tab="policy"] .technology-workbench-head span {
  color: rgba(15, 126, 112, 0.82);
}

.technology-workbench-shell[data-workbench-tab="policy"] .technology-workbench-head h2 {
  color: #132f2e;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.technology-workbench-shell[data-workbench-tab="policy"] .technology-workbench-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(232, 247, 243, 0.54)),
    rgba(255, 255, 255, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 28px rgba(38, 70, 64, 0.1);
}

.technology-workbench-shell[data-workbench-tab="policy"] .technology-workbench-tab {
  border-right: 0;
  border-radius: 18px;
  color: rgba(30, 58, 55, 0.62);
}

.technology-workbench-shell[data-workbench-tab="policy"] .technology-workbench-tab:hover {
  background: rgba(255, 255, 255, 0.58);
  color: rgba(17, 51, 49, 0.9);
}

.technology-workbench-shell[data-workbench-tab="policy"] .technology-workbench-tab.selected {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(213, 240, 234, 0.62)),
    rgba(15, 143, 128, 0.08);
  color: #153331;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 10px 22px rgba(29, 80, 72, 0.12);
}

.technology-workbench-shell[data-workbench-tab="policy"] .technology-workbench-close {
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(232, 247, 243, 0.64)),
    rgba(255, 255, 255, 0.52);
  color: rgba(21, 51, 49, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(31, 64, 58, 0.12);
}

.technology-workbench-shell[data-workbench-tab="policy"] .technology-workbench-close:hover {
  color: var(--policy-jade);
  background: rgba(255, 255, 255, 0.82);
}

.technology-workbench-shell[data-workbench-tab="policy"] .technology-workbench-body {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 42%),
    radial-gradient(circle at 78% 6%, rgba(226, 187, 101, 0.1), transparent 34%),
    radial-gradient(circle at 24% 18%, rgba(15, 143, 128, 0.08), transparent 38%);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-shell {
  --policy-ink: #153331;
  --policy-muted: rgba(34, 62, 58, 0.62);
  --policy-panel: rgba(255, 255, 255, 0.58);
  --policy-panel-solid: rgba(250, 254, 252, 0.88);
  --policy-line: rgba(53, 91, 84, 0.14);
  --policy-line-strong: rgba(13, 126, 112, 0.32);
  --policy-gold: #b88b2f;
  --policy-gold-soft: rgba(226, 187, 101, 0.2);
  --policy-jade: #0f8f80;
  --policy-ruby: #c35f63;
  --policy-shadow: rgba(45, 75, 68, 0.16);
  gap: 12px;
  color: var(--policy-ink);
}

body[data-page="policy"] {
  background: linear-gradient(180deg, #f6fbf8, #e6f1ed);
  color: #153331;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-hero {
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(232, 247, 243, 0.46)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    0 20px 44px var(--policy-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(47, 82, 75, 0.08);
  padding: 18px 20px;
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-hero::before {
  display: none;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-eyebrow {
  color: rgba(15, 126, 112, 0.84);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-hero h1 {
  color: #153331;
  font-weight: 650;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.78);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-hero p {
  color: var(--policy-muted);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-panel,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-tabs,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-stage,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-panel {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(231, 247, 243, 0.5)),
    rgba(255, 255, 255, 0.45);
  box-shadow:
    0 22px 54px var(--policy-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(47, 82, 75, 0.09);
  -webkit-backdrop-filter: blur(24px) saturate(1.22);
  backdrop-filter: blur(24px) saturate(1.22);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-panel {
  padding: 16px 18px;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-head span,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-metrics span,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-stage-toolbar span,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane-head div,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-title span,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-grid span {
  color: rgba(34, 62, 58, 0.56);
  font-weight: 900;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-score strong,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-score small,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-metrics strong,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-grid strong {
  color: var(--policy-ink);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-rail {
  height: 7px;
  border-radius: 999px;
  background: rgba(40, 75, 69, 0.12);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-rail span {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--policy-jade), #66c9b5, var(--policy-gold));
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-metrics div,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-grid div {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(232, 247, 243, 0.42)),
    rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 8px;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-tabs::before {
  display: none;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-tab {
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(235, 249, 245, 0.42)),
    rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  color: var(--policy-ink);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-tab::after {
  right: 22px;
  bottom: 8px;
  left: 22px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--policy-jade), var(--policy-gold));
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-tab:hover {
  background: rgba(255, 255, 255, 0.66);
  transform: translateY(-1px);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-tab.selected {
  border-color: rgba(15, 143, 128, 0.28);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(145deg, rgba(221, 247, 241, 0.82), rgba(255, 249, 234, 0.5)),
    rgba(255, 255, 255, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 14px 30px rgba(30, 83, 74, 0.14);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-tab-mark,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-node-topline i {
  border: 1px solid rgba(15, 143, 128, 0.26);
  border-radius: 15px;
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 255, 255, 0.92), transparent 44%),
    linear-gradient(145deg, rgba(184, 139, 47, 0.18), rgba(15, 143, 128, 0.16)),
    rgba(255, 255, 255, 0.44);
  color: var(--policy-jade);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 18px rgba(31, 68, 61, 0.1);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-tab-copy strong,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-stage-toolbar strong,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane-head strong,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-node-topline strong,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-title h2 {
  color: var(--policy-ink);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-tab-copy small,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane-head p,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-node-topline small,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-node-footer,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-empty-state,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-body p,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-requirement-box {
  color: var(--policy-muted);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-tab-count {
  color: var(--policy-gold);
  font-weight: 800;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-stage {
  overflow: hidden;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-stage::before {
  width: 5px;
  background: linear-gradient(180deg, rgba(15, 143, 128, 0.72), rgba(226, 187, 101, 0.34), transparent);
  box-shadow: 0 0 24px rgba(15, 143, 128, 0.2);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-stage-toolbar {
  border-bottom: 1px solid rgba(53, 91, 84, 0.12);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.62), rgba(232, 247, 243, 0.4)),
    rgba(255, 255, 255, 0.3);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-filter-tabs button {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 245, 0.46)),
    rgba(255, 255, 255, 0.38);
  color: rgba(34, 62, 58, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-filter-tabs button.selected {
  border-color: rgba(15, 143, 128, 0.28);
  background:
    linear-gradient(145deg, rgba(15, 143, 128, 0.86), rgba(9, 105, 95, 0.84)),
    var(--policy-jade);
  color: #fffdf4;
  box-shadow:
    0 10px 22px rgba(9, 105, 95, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-stage-ledger {
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(53, 91, 84, 0.1);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-stage-ledger span {
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(232, 247, 243, 0.34)),
    rgba(255, 255, 255, 0.28);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-stage-ledger b {
  color: rgba(34, 62, 58, 0.72);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-stage-ledger em {
  color: var(--policy-jade);
  font-weight: 900;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-lanes::before {
  left: 86px;
  background: linear-gradient(180deg, transparent, rgba(15, 143, 128, 0.42) 14%, rgba(184, 139, 47, 0.28) 68%, transparent);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane::before {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 4px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(15, 143, 128, 0.38));
  box-shadow:
    0 0 0 5px rgba(241, 249, 246, 0.9),
    0 8px 18px rgba(15, 143, 128, 0.16);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-node {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(235, 249, 245, 0.46)),
    rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 24px rgba(38, 70, 64, 0.08);
  color: var(--policy-ink);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-node::before {
  right: 18px;
  left: 18px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--policy-jade), var(--policy-gold), transparent);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-node::after {
  border-color: rgba(15, 143, 128, 0.22);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-node:hover {
  border-color: rgba(15, 143, 128, 0.3);
  background: rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 16px 30px rgba(28, 83, 74, 0.13);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-node.selected {
  border-color: rgba(15, 143, 128, 0.42);
  background:
    linear-gradient(145deg, rgba(224, 249, 243, 0.86), rgba(255, 250, 236, 0.58)),
    rgba(255, 255, 255, 0.58);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-node.active {
  border-color: rgba(15, 143, 128, 0.46);
  box-shadow:
    inset 0 0 0 1px rgba(15, 143, 128, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 12px 26px rgba(15, 143, 128, 0.12);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-node.locked {
  opacity: 0.74;
  filter: saturate(0.72);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-pill {
  border: 1px solid rgba(53, 91, 84, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: rgba(34, 62, 58, 0.68);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-pill.ready {
  border-color: rgba(184, 139, 47, 0.28);
  color: #9a701f;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-pill.active {
  border-color: rgba(15, 143, 128, 0.34);
  color: var(--policy-jade);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-pill.locked {
  border-color: rgba(195, 95, 99, 0.26);
  color: var(--policy-ruby);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-empty-state {
  border: 1px dashed rgba(53, 91, 84, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.3);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-modal {
  background:
    radial-gradient(circle at 50% 20%, rgba(126, 214, 202, 0.18), transparent 36%),
    rgba(234, 245, 241, 0.68);
  -webkit-backdrop-filter: blur(18px) saturate(1.22);
  backdrop-filter: blur(18px) saturate(1.22);
}

.technology-workbench-shell[data-workbench-tab="policy"] .technology-workbench-body .policy-dossier-modal {
  z-index: 12;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-panel {
  overflow: hidden;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-close {
  border: 0;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(230, 246, 242, 0.62)),
    rgba(255, 255, 255, 0.52);
  color: rgba(21, 51, 49, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 10px 20px rgba(32, 67, 60, 0.13);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-close:hover {
  color: var(--policy-jade);
  background: rgba(255, 255, 255, 0.82);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-visual {
  min-height: 210px;
  border-bottom: 1px solid rgba(53, 91, 84, 0.12);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.5), transparent 34%),
    linear-gradient(90deg, rgba(233, 249, 245, 0.6), rgba(233, 249, 245, 0.08) 45%, rgba(255, 246, 220, 0.12)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(180, 219, 210, 0.18)),
    var(--policy-dossier-illustration, url("/assets/building-uploads/faction_a_cbd_lv10_asset_1779887274317_236d802abf8598.webp")) center / cover;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-visual::after {
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 20px;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-visual > div {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 17px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(232, 247, 243, 0.42)),
    rgba(255, 255, 255, 0.36);
  color: var(--policy-jade);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 12px 24px rgba(32, 67, 60, 0.16);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-actions button {
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(15, 143, 128, 0.92), rgba(9, 105, 95, 0.9)),
    var(--policy-jade);
  color: #fffdf4;
  box-shadow:
    0 12px 26px rgba(9, 105, 95, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-actions button.secondary {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(232, 247, 243, 0.48)),
    rgba(255, 255, 255, 0.42);
  color: var(--policy-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 10px 20px rgba(31, 67, 60, 0.09);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-actions button.danger:not(:disabled) {
  color: #9c3c42;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-actions button:disabled {
  background: rgba(255, 255, 255, 0.48);
  color: rgba(34, 62, 58, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

@media (max-width: 980px) {
  :is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .technology-workbench-shell[data-workbench-tab="policy"] {
    border-radius: 0;
  }

  :is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-hero,
  :is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-panel,
  :is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-tabs,
  :is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-stage,
  :is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-dossier-panel {
    border-radius: 22px;
  }

  :is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-tabs {
    grid-template-columns: 1fr;
  }
}

.warning-text {
  color: #a4531b;
  font-size: 13px;
  margin-top: 8px;
}

button.danger,
.button-link.danger {
  border-color: rgba(168, 70, 70, 0.35);
  color: #8c2e2e;
}

.leaderboard-dashboard {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 16px;
}

.leaderboard-stat-card,
.leaderboard-card {
  background: rgba(255, 252, 245, 0.94);
  border: 1px solid rgba(147, 125, 87, 0.24);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(32, 40, 48, 0.08);
  padding: 16px;
}

.encyclopedia-overlay {
  align-items: center;
  background: rgba(5, 11, 15, 0.72);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 22px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 5600;
  overscroll-behavior: contain;
}

.encyclopedia-modal {
  background: #282b2a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  color: #f4f1e8;
  display: flex;
  flex-direction: column;
  max-height: min(900px, 94vh);
  overflow: hidden;
  width: min(1420px, 96vw);
}

.encyclopedia-header {
  align-items: center;
  background: #424240;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto auto;
  padding: 12px 16px;
}

.encyclopedia-header div {
  align-items: center;
  display: flex;
  gap: 10px;
}

.encyclopedia-header div span,
.encyclopedia-hero-icon,
.encyclopedia-entry > span {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.encyclopedia-header div span {
  background: #f4f1e8;
  border-radius: 50%;
  color: #333;
  font-weight: 800;
  height: 22px;
  width: 22px;
}

.encyclopedia-header strong {
  font-size: 22px;
}

.encyclopedia-close {
  background: transparent;
  border: 0;
  color: #c8c4b9;
  font-size: 34px;
  height: 42px;
  line-height: 1;
  padding: 0;
  width: 42px;
}

.encyclopedia-body {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(560px, 0.95fr) minmax(620px, 1.05fr);
  min-height: 0;
  overflow: hidden;
}

.encyclopedia-sidebar {
  background: #303231;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 14px;
}

.encyclopedia-sidebar [data-encyclopedia-list] {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.encyclopedia-search {
  align-items: center;
  background: #202322;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  gap: 8px;
  padding: 0 10px;
}

.encyclopedia-search span {
  color: #9ca3a1;
  font-size: 26px;
}

.encyclopedia-search input,
.encyclopedia-filters select {
  background: transparent;
  border: 0;
  color: #f4f1e8;
  min-height: 44px;
  outline: 0;
  width: 100%;
}

.encyclopedia-tier-tabs {
  display: grid;
  gap: 0;
}

.encyclopedia-tier-tabs {
  grid-template-columns: repeat(4, minmax(48px, 1fr));
}

.encyclopedia-tier-tabs button {
  background: #252827;
  border: 1px solid rgba(80, 132, 179, 0.55);
  border-radius: 0;
  color: #9dcbf5;
  min-height: 42px;
}

.encyclopedia-tier-tabs button:first-child {
  border-radius: 6px 0 0 6px;
}

.encyclopedia-tier-tabs button:last-child {
  border-radius: 0 6px 6px 0;
}

.encyclopedia-tier-tabs button.selected {
  background: #416b98;
  color: #fff;
}

.encyclopedia-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 0.72fr) minmax(240px, 1.28fr);
}

.encyclopedia-filters select {
  background: #252827;
  border: 1px solid rgba(80, 132, 179, 0.55);
  border-radius: 6px;
  padding: 0 12px;
}

.encyclopedia-list-title {
  align-items: center;
  color: #f4f1e8;
  display: flex;
  font-size: 20px;
  font-weight: 800;
  justify-content: space-between;
}

.encyclopedia-list-title span {
  color: #9ca3a1;
  font-size: 14px;
}

.encyclopedia-list-scroll {
  display: grid;
  flex: 1 1 auto;
  gap: 18px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.encyclopedia-list-block {
  display: grid;
  gap: 8px;
}

.encyclopedia-grid {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}

.encyclopedia-grid-products {
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}

.encyclopedia-grid-buildings {
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.encyclopedia-grid-workforce {
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}

.encyclopedia-entry {
  align-items: center;
  background: #474a49;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #f4f1e8;
  display: grid;
  gap: 5px;
  grid-template-rows: 64px auto auto;
  justify-items: center;
  min-height: 104px;
  padding: 6px;
}

.encyclopedia-entry-products {
  background: #323532;
  border-color: rgba(255, 255, 255, 0.1);
  gap: 8px;
  grid-template-rows: 112px auto;
  min-height: 152px;
  padding: 8px 8px 10px;
}

.encyclopedia-entry-products.tier-1 strong {
  color: #f7f3ea;
}

.encyclopedia-entry-products.tier-2 strong {
  color: #78d36d;
}

.encyclopedia-entry-products.tier-3 strong {
  color: #7dbde6;
}

.encyclopedia-entry-products.tier-4 strong {
  color: #dc8bc8;
}

.encyclopedia-entry-buildings {
  background:
    linear-gradient(180deg, #fffdf7 0%, #f4efe2 100%);
  border-color: rgba(215, 199, 161, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  gap: 6px;
  grid-template-rows: 1fr;
  min-height: 240px;
  overflow: hidden;
  padding: 8px;
  position: relative;
}

.encyclopedia-entry-buildings.tier-1 strong {
  color: #f7f3ea;
}

.encyclopedia-entry-buildings.tier-2 strong {
  color: #78d36d;
}

.encyclopedia-entry-buildings.tier-3 strong {
  color: #7dbde6;
}

.encyclopedia-entry-buildings.tier-4 strong {
  color: #dc8bc8;
}

.encyclopedia-entry-workforce {
  background: #323532;
  border-color: rgba(255, 255, 255, 0.1);
  gap: 8px;
  grid-template-rows: 112px auto;
  min-height: 152px;
  padding: 8px 8px 10px;
}

.encyclopedia-entry-workforce.tier-1 strong {
  color: #f7f3ea;
}

.encyclopedia-entry-workforce.tier-2 strong {
  color: #78d36d;
}

.encyclopedia-entry-workforce.tier-3 strong {
  color: #7dbde6;
}

.encyclopedia-entry-workforce.tier-4 strong {
  color: #dc8bc8;
}

.encyclopedia-entry.selected {
  border-color: #5f96cc;
  box-shadow: inset 0 0 0 2px rgba(95, 150, 204, 0.7);
}

.encyclopedia-entry > span {
  font-size: 28px;
  height: 64px;
  overflow: hidden;
  width: 100%;
}

.encyclopedia-entry-products > span {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  height: 112px;
  padding: 0;
  place-items: center;
}

.encyclopedia-entry-buildings > span {
  background:
    radial-gradient(circle at 50% 64%, rgba(216, 205, 177, 0.34), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 234, 218, 0.78));
  align-items: start;
  display: grid;
  height: 224px;
  overflow: visible;
  padding: 0;
  justify-items: center;
  width: 100%;
}

.encyclopedia-entry-workforce > span {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  height: 112px;
  padding: 0;
  place-items: center;
}

.encyclopedia-entry .product-icon-image,
.encyclopedia-entry .workforce-type-icon {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.encyclopedia-entry-building-image {
  display: block;
  height: 92%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center top;
  transform: translateY(-30px);
  width: 100%;
}

.encyclopedia-entry-building-image.encyclopedia-building-flat-image {
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
  width: 100%;
}

.encyclopedia-entry-buildings .building-preview-fallback {
  color: #2d3532;
  font-size: 46px;
  font-weight: 900;
}

.encyclopedia-entry strong,
.encyclopedia-entry small {
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.encyclopedia-entry strong {
  font-size: 14px;
  line-height: 1.25;
}

.encyclopedia-entry-products strong {
  font-size: 16px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.encyclopedia-entry-workforce strong {
  font-size: 16px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.encyclopedia-entry-buildings strong {
  background: rgba(32, 35, 33, 0.88);
  border-radius: 4px;
  bottom: 8px;
  font-size: 18px;
  font-weight: 900;
  left: 50%;
  max-width: calc(100% - 36px);
  min-width: 0;
  padding: 4px 10px 5px;
  position: absolute;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
  z-index: 1;
}

.encyclopedia-entry small {
  color: #c7c2b8;
  font-size: 11px;
}

.encyclopedia-entry-products small {
  color: #bdb7ad;
}

.encyclopedia-detail {
  background: #202221;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px;
}

.encyclopedia-hero,
.encyclopedia-section,
.encyclopedia-market-strip {
  background: #1a1c1b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.encyclopedia-hero {
  display: grid;
  gap: 20px;
  grid-template-columns: 164px 1fr;
  padding: 18px;
}

.encyclopedia-hero.industry-surface {
  border-color: var(--industry-border, rgba(255, 255, 255, 0.08));
  background:
    linear-gradient(135deg, var(--industry-surface, rgba(143, 150, 144, 0.08)), rgba(26, 28, 27, 0) 42%),
    #1a1c1b;
}

.encyclopedia-hero.industry-surface .encyclopedia-hero-icon {
  box-shadow:
    inset 0 0 0 1px var(--industry-border, rgba(255, 255, 255, 0.08)),
    0 10px 20px rgba(0, 0, 0, 0.12);
}

.encyclopedia-hero.industry-surface .encyclopedia-meta {
  color: var(--industry-text, #9dcbf5);
}

.encyclopedia-hero-icon {
  border-radius: 6px;
  color: #f1d593;
  font-size: 48px;
  min-height: 148px;
  overflow: hidden;
}

.encyclopedia-hero-icon .product-icon-image,
.encyclopedia-hero-icon .workforce-type-icon {
  height: 148px;
  width: 148px;
}

.encyclopedia-hero-building-image {
  display: block;
  width: 148px;
  height: 148px;
  object-fit: contain;
}

.encyclopedia-hero-building-image.encyclopedia-building-flat-image {
  object-position: center;
  transform: none;
}

.encyclopedia-hero h2 {
  font-size: 30px;
  margin: 0 0 8px;
}

.encyclopedia-meta {
  color: #9dcbf5;
  font-weight: 800;
  margin-bottom: 10px;
}

.encyclopedia-hero p {
  color: #c8c4b9;
  line-height: 1.7;
  margin: 0;
}

.encyclopedia-market-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px 16px;
}

.encyclopedia-product-dossier {
  --product-tier-color: #f7f3ea;
  --product-tier-soft: rgba(247, 243, 234, 0.12);
  background: #1a1c1b;
  border: 1px solid var(--industry-border, rgba(255, 255, 255, 0.08));
  border-radius: 6px;
  display: grid;
  gap: 8px;
}

.encyclopedia-product-dossier.tier-1 {
  --product-tier-color: #f7f3ea;
  --product-tier-soft: rgba(247, 243, 234, 0.12);
}

.encyclopedia-product-dossier.tier-2 {
  --product-tier-color: #78d36d;
  --product-tier-soft: rgba(120, 211, 109, 0.14);
}

.encyclopedia-product-dossier.tier-3 {
  --product-tier-color: #7dbde6;
  --product-tier-soft: rgba(125, 189, 230, 0.14);
}

.encyclopedia-product-dossier.tier-4 {
  --product-tier-color: #dc8bc8;
  --product-tier-soft: rgba(220, 139, 200, 0.16);
}

.encyclopedia-product-card {
  background:
    linear-gradient(135deg, var(--industry-surface, rgba(143, 150, 144, 0.08)), rgba(26, 28, 27, 0) 46%),
    #1a1c1b;
  border-radius: 6px 6px 0 0;
  display: grid;
  gap: 22px;
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 168px;
  padding: 18px;
}

.encyclopedia-building-dossier .encyclopedia-product-card {
  border-radius: 6px;
}

.encyclopedia-product-icon {
  align-self: center;
  color: var(--product-tier-color);
  display: grid;
  justify-items: center;
}

.encyclopedia-product-icon .product-icon-image {
  display: block;
  height: 148px;
  object-fit: contain;
  width: 148px;
}

.encyclopedia-building-icon .encyclopedia-hero-building-image {
  height: 148px;
  width: 148px;
}

.encyclopedia-product-copy {
  align-content: center;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.encyclopedia-product-copy h2 {
  color: var(--product-tier-color);
  font-size: 32px;
  line-height: 1.15;
  margin: 0;
}

.encyclopedia-product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.encyclopedia-product-tag {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #f4f1e8;
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  min-height: 30px;
  padding: 6px 10px;
}

.encyclopedia-product-tag.tier {
  background: var(--product-tier-soft);
  border-color: var(--product-tier-color);
  color: var(--product-tier-color);
}

.encyclopedia-product-tag.industry {
  background: var(--industry-surface, rgba(255, 255, 255, 0.08));
  border-color: var(--industry-border, rgba(255, 255, 255, 0.12));
  color: var(--industry-text, #f4f1e8);
}

.encyclopedia-product-tag.power {
  background: rgba(93, 158, 214, 0.16);
  border-color: rgba(93, 158, 214, 0.42);
  color: #d2e9fb;
}

.encyclopedia-product-tag.coastal {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ddd8ca;
}

.encyclopedia-product-tag.coastal.required {
  background: rgba(217, 166, 74, 0.16);
  border-color: rgba(217, 166, 74, 0.46);
  color: #f3dfb3;
}

.encyclopedia-product-copy p {
  color: #bdb7ad;
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
}

.encyclopedia-product-marketbar {
  align-items: center;
  background: rgba(0, 0, 0, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  padding: 12px;
}

.encyclopedia-product-price {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.encyclopedia-product-price span {
  color: #9ca3a1;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.encyclopedia-product-price strong {
  color: #f4f1e8;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

.encyclopedia-product-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.encyclopedia-product-action {
  align-items: center;
  background: #3f4240;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #f4f1e8;
  display: inline-flex;
  font-size: 22px;
  font-weight: 900;
  height: 44px;
  justify-content: center;
  padding: 0;
  width: 44px;
}

.encyclopedia-product-action[aria-disabled="true"] {
  cursor: default;
  opacity: 0.75;
}

.encyclopedia-product-action.trade {
  background: #485f73;
  color: #fff7e8;
}

.encyclopedia-product-action.trade:hover:not(:disabled) {
  background: #54718a;
}

.encyclopedia-market-strip span,
.encyclopedia-info-grid > div > span,
.encyclopedia-flow > div > span {
  color: #9ca3a1;
}

.encyclopedia-section h3 {
  background: #3a3d3b;
  border-radius: 6px 6px 0 0;
  font-size: 18px;
  margin: 0;
  padding: 12px 16px;
}

.encyclopedia-info-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  padding: 1px;
}

.encyclopedia-info-grid > div {
  background: #202221;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.encyclopedia-info-grid > .encyclopedia-info-assets {
  align-content: start;
  gap: 10px;
}

.encyclopedia-info-assets .empty-plot-costs {
  align-items: start;
}

.encyclopedia-build-cost-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 34px;
}

.encyclopedia-build-cost-heading > span {
  color: #9ca3a1;
}

.encyclopedia-level-cost-select {
  background: #151716;
  border: 1px solid rgba(157, 203, 245, 0.34);
  border-radius: 5px;
  color: #f4f1e8;
  font-size: 15px;
  font-weight: 900;
  min-height: 34px;
  min-width: 104px;
  padding: 4px 8px;
}

.encyclopedia-level-cost-panels {
  display: grid;
  min-height: 148px;
}

.encyclopedia-level-cost-panel {
  align-content: start;
}

.encyclopedia-level-cost-panel[hidden] {
  display: none !important;
}

.encyclopedia-flow {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.encyclopedia-flow {
  grid-template-columns: 150px 1fr 150px 110px 1fr;
}

.encyclopedia-flow > div {
  display: grid;
  gap: 8px;
}

.encyclopedia-flow-time {
  justify-items: center;
  text-align: center;
}

.encyclopedia-duration {
  align-items: center;
  display: inline-grid;
  justify-items: center;
  line-height: 1.12;
  text-align: center;
}

.encyclopedia-duration span {
  display: block;
  white-space: nowrap;
}

.encyclopedia-recipe-list {
  background: #202221;
  display: grid;
  gap: 0;
}

.encyclopedia-recipe-header,
.encyclopedia-recipe-row {
  display: grid;
  column-gap: 8px;
  grid-template-columns: 96px minmax(288px, 1fr) 92px 52px minmax(92px, 0.34fr);
  row-gap: 12px;
}

.encyclopedia-recipe-header {
  background: #202221;
  border-bottom: 0;
  color: #8f9690;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 10px 8px;
}

.encyclopedia-recipe-header span:nth-child(4) {
  justify-self: stretch;
  text-align: center;
}

.encyclopedia-recipe-header span:nth-child(5) {
  justify-self: end;
  text-align: center;
  width: 92px;
}

.encyclopedia-recipe-row {
  align-items: start;
  background: #202221;
  border-top: 0;
  min-height: 134px;
  padding: 8px 10px 10px;
}

.encyclopedia-recipe-row + .encyclopedia-recipe-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

.encyclopedia-recipe-cell {
  min-width: 0;
}

.encyclopedia-recipe-cell.building {
  align-self: start;
  display: flex;
  align-items: flex-start;
  justify-self: start;
}

.encyclopedia-recipe-cell.building .encyclopedia-mini-building {
  flex: 0 0 auto;
  height: 112px;
  margin: 0;
  width: 92px;
}

.encyclopedia-recipe-cell.building .encyclopedia-mini-building strong {
  height: 88px;
  min-height: 88px;
  width: 100%;
}

.encyclopedia-recipe-cell.building .encyclopedia-mini-building .encyclopedia-mini-building-image.encyclopedia-building-flat-image {
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
  width: 100%;
}

.encyclopedia-recipe-cell.building .encyclopedia-mini-building .encyclopedia-mini-building-image.encyclopedia-building-fill-image {
  object-fit: cover;
}

.encyclopedia-recipe-cell.inputs .empty-plot-costs,
.encyclopedia-recipe-cell.outputs .empty-plot-costs {
  align-items: start;
}

.encyclopedia-recipe-cell.outputs,
.encyclopedia-recipe-cell.outputs .empty-plot-costs {
  justify-content: end;
}

.encyclopedia-recipe-cell.outputs .empty-plot-costs {
  width: 100%;
}

.encyclopedia-recipe-cell.technology {
  align-self: start;
  justify-self: center;
}

.encyclopedia-recipe-cell.time {
  align-self: center;
  display: grid;
  justify-items: center;
  justify-self: stretch;
}

.encyclopedia-recipe-cell.time strong {
  color: #f4f1e8;
  display: block;
  font-size: 16px;
  line-height: 1.12;
  max-height: 128px;
  text-align: center;
}

.encyclopedia-recipe-tech-tile {
  color: #f4f1e8;
  display: grid;
  grid-template-rows: minmax(84px, 1fr) auto;
  height: 112px;
  justify-items: center;
  overflow: hidden;
  position: relative;
  text-align: center;
  width: 92px;
}

.encyclopedia-recipe-tech-tile strong {
  align-items: center;
  background: transparent;
  display: grid;
  height: 88px;
  justify-items: center;
  overflow: hidden;
  width: 100%;
}

.encyclopedia-recipe-tech-tile .technology-industry-icon {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.encyclopedia-recipe-tech-tile em {
  background: #d9a33b;
  color: #fff7e8;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  padding: 4px 6px;
  position: absolute;
  right: 0;
  top: 0;
}

.encyclopedia-recipe-tech-tile small {
  background: rgba(26, 28, 27, 0.72);
  box-sizing: border-box;
  color: #fff3dc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  padding: 4px 3px 5px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.encyclopedia-recipe-empty {
  color: #9ca3a1;
  font-size: 13px;
  font-weight: 800;
}

.encyclopedia-mini-building {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #f4f1e8;
  display: grid;
  grid-template-rows: minmax(84px, 1fr) auto;
  height: 112px;
  overflow: hidden;
  padding: 0;
  text-align: center;
  width: 92px;
}

.encyclopedia-mini-building strong {
  align-items: center;
  background: linear-gradient(180deg, #fffdf7 0%, #f0eadc 100%);
  display: grid;
  height: 88px;
  justify-items: center;
  overflow: hidden;
  width: 100%;
}

.encyclopedia-mini-building-image {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.encyclopedia-mini-building-image.encyclopedia-building-flat-image {
  object-fit: contain;
  object-position: center;
  transform: none;
}

.encyclopedia-mini-building small {
  background: rgba(26, 28, 27, 0.72);
  box-sizing: border-box;
  color: #fff3dc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  padding: 4px 3px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.encyclopedia-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

.encyclopedia-chip-row button {
  background: #444846;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f4f1e8;
}

.encyclopedia-modal .empty-plot-costs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.encyclopedia-modal .empty-plot-cost-tile {
  border: 0;
  min-height: 106px;
}

.encyclopedia-modal .empty-plot-cost-tile.encyclopedia-asset-tile {
  background: transparent;
  border-radius: 4px;
  display: grid;
  grid-template-rows: minmax(84px, 1fr) auto;
  height: 112px;
  overflow: hidden;
  padding: 0;
  width: 92px;
}

.encyclopedia-modal .encyclopedia-asset-tile strong {
  background: transparent;
  height: 88px;
  width: 100%;
}

.encyclopedia-modal .encyclopedia-asset-tile .product-icon-image,
.encyclopedia-modal .encyclopedia-asset-tile .workforce-type-icon {
  height: 100%;
  width: 100%;
}

.encyclopedia-modal .encyclopedia-asset-tile em {
  background: rgba(26, 28, 27, 0.72);
  border-radius: 0 0 0 4px;
  padding: 2px 5px;
  right: 0;
  top: 0;
}

.encyclopedia-modal .encyclopedia-asset-tile small {
  background: rgba(26, 28, 27, 0.72);
  box-sizing: border-box;
  color: #fff3dc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  padding: 4px 3px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

button.empty-plot-cost-tile {
  cursor: pointer;
}

@media (max-width: 980px) {
  .encyclopedia-body {
    grid-template-columns: 1fr;
  }

  .encyclopedia-sidebar {
    max-height: 42vh;
  }

  .encyclopedia-flow,
  .encyclopedia-recipe-row {
    grid-template-columns: 1fr;
  }

  .encyclopedia-recipe-header {
    display: none;
  }

  .encyclopedia-recipe-cell {
    display: grid;
    gap: 6px;
  }

  .encyclopedia-recipe-cell::before {
    color: #8f9690;
    content: attr(data-label);
    font-size: 12px;
    font-weight: 800;
  }

  .encyclopedia-product-card,
  .encyclopedia-product-marketbar {
    grid-template-columns: 1fr;
  }

  .encyclopedia-product-icon {
    justify-items: start;
  }

  .encyclopedia-product-price {
    flex-wrap: wrap;
  }

  .encyclopedia-product-actions {
    justify-content: start;
  }

  .encyclopedia-filters {
    grid-template-columns: 1fr;
  }
}

.leaderboard-hall {
  color: #102532;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.leaderboard-hero-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-width: 0;
}

.leaderboard-hero {
  background: linear-gradient(135deg, #104c52, #137b6f);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(16, 59, 63, 0.2);
  color: #f8fffb;
  min-height: 230px;
  overflow: hidden;
  padding: 28px;
  min-width: 0;
}

.leaderboard-hero-eyebrow {
  color: #ffe7a4;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 10px;
}

.leaderboard-hero h2 {
  color: #fffef8;
  font-size: clamp(34px, 4vw, 56px);
  letter-spacing: 0;
  line-height: 1;
  margin: 0 0 12px;
}

.leaderboard-hero p {
  color: rgba(246, 255, 252, 0.86);
  line-height: 1.7;
  margin: 0;
  max-width: 680px;
  overflow-wrap: anywhere;
}

.leaderboard-hero-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
}

.leaderboard-hero-metrics div {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  min-width: 0;
  padding: 12px 14px;
}

.leaderboard-hero-metrics span,
.leaderboard-stat-card span,
.leaderboard-card-header p,
.leaderboard-player small,
.leaderboard-medal-row small,
.honor-chip small {
  color: var(--muted);
}

.leaderboard-hero-metrics span {
  color: rgba(243, 255, 251, 0.68);
  display: block;
  font-size: 12px;
  font-weight: 900;
}

.leaderboard-hero-metrics strong {
  color: #ffffff;
  display: block;
  font-size: 20px;
  line-height: 1.18;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.leaderboard-rules-panel,
.leaderboard-stat-card,
.leaderboard-card {
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid rgba(147, 125, 87, 0.24);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(32, 40, 48, 0.08);
  min-width: 0;
  padding: 18px;
}

.leaderboard-card-header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.leaderboard-card-header h3 {
  font-size: 22px;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0 0 5px;
}

.leaderboard-card-header p {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.leaderboard-header-token {
  background: rgba(236, 247, 242, 0.78);
  border: 1px solid rgba(18, 127, 113, 0.16);
  border-radius: 999px;
  color: #0f6f66;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
  white-space: nowrap;
}

.leaderboard-medal-list {
  display: grid;
  gap: 10px;
}

.leaderboard-medal-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(55, 76, 89, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 8px 10px;
}

.leaderboard-medal-row strong,
.leaderboard-medal-row small {
  display: block;
}

.leaderboard-medal-row b {
  font-size: 13px;
  white-space: nowrap;
}

.leaderboard-medal-mark {
  align-items: center;
  color: #162b31;
  display: inline-flex;
  font-weight: 950;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.leaderboard-medal-mark.gold,
.leaderboard-podium-card.rank-gold .leaderboard-podium-rank {
  background: linear-gradient(135deg, #ffe58d, #dca83a);
}

.leaderboard-medal-mark.silver,
.leaderboard-podium-card.rank-silver .leaderboard-podium-rank {
  background: linear-gradient(135deg, #f5f8fb, #aab9c3);
}

.leaderboard-medal-mark.bronze,
.leaderboard-podium-card.rank-bronze .leaderboard-podium-rank {
  background: linear-gradient(135deg, #ffd0a3, #bb7838);
}

.leaderboard-medal-mark.ribbon {
  background: linear-gradient(135deg, #80d8c8, #f1c767);
  font-size: 13px;
}

.leaderboard-medal-mark.leaderboard-rank-badge {
  width: 48px;
  height: 48px;
}

.leaderboard-medal-mark.leaderboard-rank-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.leaderboard-medal-mark.leaderboard-rank-badge b {
  right: 0;
  bottom: 0;
}

.leaderboard-dashboard {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0;
  min-width: 0;
}

.leaderboard-stat-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
}

.leaderboard-stat-card strong {
  color: #061f2b;
  font-size: 28px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.leaderboard-stat-card small {
  color: #008073;
  font-weight: 900;
  line-height: 1.45;
}

.leaderboard-main-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 340px;
  min-width: 0;
}

.leaderboard-support-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.leaderboard-wide {
  grid-column: 1 / -1;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.leaderboard-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(55, 76, 89, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  min-height: 54px;
  padding: 8px 10px;
}

.leaderboard-rank {
  background: #103845;
  border-radius: 999px;
  color: #fff8e8;
  font-weight: 900;
  padding: 5px 8px;
  text-align: center;
}

.leaderboard-rank.leaderboard-rank-badge {
  width: 46px;
  height: 46px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.leaderboard-player {
  background: transparent;
  border: 0;
  color: inherit;
  display: grid;
  font: inherit;
  font-weight: 900;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.leaderboard-player small {
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}

.leaderboard-value {
  color: #008073;
  font-weight: 950;
  white-space: nowrap;
}

.leaderboard-podium {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 4px 0 12px;
}

.leaderboard-podium.single {
  grid-template-columns: minmax(0, 1fr);
}

.leaderboard-podium-card {
  align-content: start;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(55, 76, 89, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 12px;
}

.leaderboard-podium-card.rank-gold {
  background: linear-gradient(180deg, #fff8df, rgba(255, 255, 255, 0.82));
  border-color: rgba(214, 165, 62, 0.55);
}

.leaderboard-podium-card.rank-silver {
  border-color: rgba(150, 158, 166, 0.48);
}

.leaderboard-podium-card.rank-bronze {
  border-color: rgba(168, 111, 63, 0.5);
}

.leaderboard-podium-rank {
  align-items: center;
  background: #103845;
  border-radius: 8px;
  color: #102532;
  display: inline-flex;
  font-weight: 950;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.leaderboard-podium-rank.leaderboard-rank-badge {
  width: 58px;
  height: 58px;
  background: transparent;
  border-radius: 0;
}

.leaderboard-podium-card strong {
  font-size: 18px;
  line-height: 1.2;
}

.leaderboard-podium-card small {
  color: var(--muted);
  font-weight: 800;
}

.leaderboard-podium-card b {
  color: #008073;
  font-size: 20px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.leaderboard-self {
  align-items: center;
  background: rgba(232, 248, 242, 0.88);
  border: 1px solid rgba(18, 127, 113, 0.2);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 12px;
}

.leaderboard-self span,
.leaderboard-self small {
  display: grid;
}

.leaderboard-self small,
.leaderboard-self em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.leaderboard-self strong {
  color: #0b2b3a;
}

.leaderboard-coordinate-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(235, 249, 245, 0.86));
}

.leaderboard-coordinate-meter {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(55, 76, 89, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
}

.leaderboard-coordinate-meter div {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.leaderboard-coordinate-meter span {
  font-weight: 900;
}

.leaderboard-coordinate-meter strong {
  color: #0b2b3a;
  font-size: 13px;
}

.leaderboard-coordinate-meter i {
  background: #d8e7e3;
  border-radius: 999px;
  display: block;
  height: 10px;
  overflow: hidden;
}

.leaderboard-coordinate-meter b {
  background: linear-gradient(90deg, #18a991, #e2b84d);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.leaderboard-coordinate-note {
  background: #fff5d8;
  border: 1px solid rgba(219, 178, 83, 0.22);
  border-radius: 8px;
  color: #193b43;
  font-size: 13px;
  line-height: 1.55;
  margin: 14px 0 0;
  padding: 12px;
}

.leaderboard-industry-section {
  overflow: hidden;
}

.leaderboard-industry-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.leaderboard-industry-tab {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(32, 91, 94, 0.14);
  border-radius: 999px;
  color: #4d6669;
  cursor: pointer;
  font-weight: 900;
  padding: 8px 13px;
}

.leaderboard-industry-tab.selected {
  background: linear-gradient(135deg, #0f6f6d, #19a88d);
  border-color: transparent;
  color: #ffffff;
}

.leaderboard-industry-focus {
  display: grid;
  gap: 12px;
  grid-template-columns: 300px minmax(0, 1fr);
}

.leaderboard-industry-summary {
  background: linear-gradient(145deg, #176167, #1fa283);
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  min-height: 190px;
  padding: 20px;
}

.leaderboard-industry-summary span {
  font-size: 24px;
  font-weight: 950;
}

.leaderboard-industry-summary strong {
  align-self: end;
  color: #ffffff;
  font-size: 42px;
  line-height: 1;
}

.leaderboard-industry-summary small {
  color: rgba(238, 255, 249, 0.9);
  font-weight: 900;
}

.leaderboard-industry-list {
  min-width: 0;
}

.leaderboard-honor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.honor-chip {
  background: linear-gradient(180deg, #fff7de, #f0dfb5);
  border: 1px solid rgba(155, 115, 40, 0.28);
  border-radius: 18px;
  color: #5b4216;
  display: inline-grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  font-weight: 900;
  gap: 8px;
  padding: 7px 12px 7px 8px;
}

.honor-chip small {
  font-size: 12px;
  font-weight: 800;
}

.leaderboard-honor-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.leaderboard-honor-chip strong {
  overflow-wrap: anywhere;
}

.leaderboard-honor-rank {
  width: 42px;
  height: 42px;
}

.leaderboard-honor-rank b {
  min-width: 18px;
  height: 18px;
  font-size: 11px;
}

@media (max-width: 1180px) {
  .leaderboard-hero-grid,
  .leaderboard-main-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leaderboard-support-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body[data-page="leaderboard"] {
    overflow-x: hidden;
  }

  body[data-page="leaderboard"] .app {
    max-width: 100%;
    overflow-x: hidden;
    padding-right: 12px;
    padding-left: 12px;
    width: 100%;
  }

  body[data-page="leaderboard"] #leaderboardPage,
  body[data-page="leaderboard"] #leaderboard {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .mailbox-popover {
    left: auto;
    min-width: min(320px, calc(100vw - 32px));
    right: -96px;
  }

  .mailbox-row {
    grid-template-columns: 1fr;
  }

  .mailbox-filter-bar,
  .mailbox-toolbar {
    align-items: stretch;
  }

  .mailbox-filter-button,
  .mailbox-toolbar button {
    justify-content: center;
  }

  .mailbox-actions {
    justify-content: start;
  }

  .player-directory-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .player-directory-actions {
    flex-wrap: wrap;
  }

  .player-directory-actions button {
    flex: 1 1 120px;
  }

  .leaderboard-hero-grid,
  .leaderboard-main-grid,
  .leaderboard-support-grid,
  .leaderboard-industry-focus {
    grid-template-columns: 1fr;
  }

  .leaderboard-hero {
    min-height: 0;
    padding: 20px;
  }

  .leaderboard-hero h2 {
    font-size: 36px;
  }

  .leaderboard-hero-metrics,
  .leaderboard-dashboard,
  .leaderboard-podium {
    grid-template-columns: 1fr;
  }

  .leaderboard-card-header {
    align-items: start;
    flex-direction: column;
  }

  .leaderboard-medal-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .leaderboard-medal-row b {
    grid-column: 2;
  }

  .leaderboard-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .leaderboard-value {
    grid-column: 2;
  }
}

/* Final global top HUD override. */
.app,
body[data-page="island"] .app {
  max-width: none;
  padding-top: calc(var(--global-topbar-height) + 18px);
  padding-bottom: var(--global-bottom-nav-reserve);
}

body[data-page="island"] .app {
  padding-right: 0;
  padding-left: 0;
}

.topbar,
body[data-page="island"] .topbar {
  position: fixed;
  z-index: var(--global-hud-z);
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: var(--global-topbar-height);
  margin: 0;
  padding: 8px 24px;
  border-bottom: 1px solid var(--global-topbar-border);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(246, 241, 230, 0.92)),
    var(--global-topbar-bg);
  color: var(--global-topbar-text);
  box-shadow: 0 10px 34px rgba(42, 35, 21, 0.08);
  backdrop-filter: blur(14px);
}

.legacy-top-title,
.legacy-top-actions,
.page-tabs,
body[data-page="island"] .page-tabs {
  display: none !important;
}

.topbar .global-status,
body[data-page="island"] .topbar .global-status {
  position: static;
  z-index: auto;
  display: flex;
  flex: 0 0 auto;
  grid-template-columns: none;
  align-items: center;
  justify-self: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: min(860px, calc(100vw - 380px));
  height: auto;
  min-width: max-content;
  margin: 0;
  overflow-x: auto;
  pointer-events: auto;
  scrollbar-width: thin;
}

.topbar .global-status .metric,
body[data-page="island"] .topbar .global-status .metric {
  display: grid;
  grid-template-columns: 24px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 7px;
  min-width: 92px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid rgba(73, 111, 99, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--global-topbar-text);
}

.topbar .global-status .metric i,
body[data-page="island"] .topbar .global-status .metric i {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(73, 111, 99, 0.12);
  color: var(--global-topbar-accent);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.topbar .global-status .metric.metric-visual-icon,
body[data-page="island"] .topbar .global-status .metric.metric-visual-icon {
  grid-template-columns: 30px auto;
}

.topbar .global-status .metric.metric-visual-icon i,
body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i {
  width: 30px;
  height: 30px;
  background: transparent;
  overflow: visible;
}

.topbar .global-status .metric.metric-visual-icon i img,
body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i img {
  display: block;
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.topbar .global-status .metric span,
body[data-page="island"] .topbar .global-status .metric span {
  margin: 0;
  color: var(--global-topbar-muted);
  font-size: 11px;
  line-height: 1;
}

.topbar .global-status .metric strong,
body[data-page="island"] .topbar .global-status .metric strong {
  overflow: hidden;
  color: var(--global-topbar-text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .global-status .wallet-metric,
body[data-page="island"] .topbar .global-status .wallet-metric {
  display: grid;
  flex: 0 0 288px;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 28px 28px;
  gap: 5px;
  width: 288px;
  min-width: 288px;
  min-height: 61px;
}

.topbar .global-status .wallet-slot,
body[data-page="island"] .topbar .global-status .wallet-slot {
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  height: 28px;
  padding: 0 36px;
  border: 0;
  border-radius: 999px;
  color: #fffaf0;
  font: inherit;
  line-height: 1;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 5px 14px rgba(24, 34, 32, 0.16);
}

.topbar .global-status .wallet-slot i,
body[data-page="island"] .topbar .global-status .wallet-slot i {
  display: grid;
  position: absolute;
  top: 50%;
  left: 7px;
  place-items: center;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-style: normal;
  font-size: 11px;
  font-weight: 1000;
}

.topbar .global-status .wallet-slot i img,
body[data-page="island"] .topbar .global-status .wallet-slot i img {
  display: block;
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.topbar .global-status .wallet-slot span,
body[data-page="island"] .topbar .global-status .wallet-slot span {
  color: rgba(255, 250, 240, 0.9);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.topbar .global-status .wallet-slot strong,
body[data-page="island"] .topbar .global-status .wallet-slot strong {
  overflow: hidden;
  justify-self: center;
  max-width: 100%;
  color: #fffdf4;
  font-size: 17px;
  font-weight: 1000;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .global-status .wallet-gold,
.topbar .global-status .wallet-gems,
body[data-page="island"] .topbar .global-status .wallet-gold,
body[data-page="island"] .topbar .global-status .wallet-gems {
  grid-template-columns: minmax(0, 1fr);
}

.topbar .global-status .wallet-gold span,
.topbar .global-status .wallet-gems span,
body[data-page="island"] .topbar .global-status .wallet-gold span,
body[data-page="island"] .topbar .global-status .wallet-gems span {
  display: none;
}

.topbar .global-status .wallet-cash,
body[data-page="island"] .topbar .global-status .wallet-cash {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, #83b918, #659f0b);
}

.topbar .global-status .wallet-gold,
body[data-page="island"] .topbar .global-status .wallet-gold {
  background: linear-gradient(180deg, #f5d66a, #d99d28);
}

.topbar .global-status .wallet-gems,
body[data-page="island"] .topbar .global-status .wallet-gems {
  background: linear-gradient(180deg, #9ed8f5, #68bde8);
}

.topbar .global-status button.wallet-slot,
body[data-page="island"] .topbar .global-status button.wallet-slot {
  appearance: none;
}

.topbar .global-status .wallet-clickable,
body[data-page="island"] .topbar .global-status .wallet-clickable {
  cursor: pointer;
  transition: filter 0.14s ease, transform 0.14s ease;
}

.topbar .global-status .wallet-clickable:hover,
body[data-page="island"] .topbar .global-status .wallet-clickable:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.topbar .global-status .wallet-clickable:focus-visible,
body[data-page="island"] .topbar .global-status .wallet-clickable:focus-visible {
  outline: 2px solid rgba(87, 57, 108, 0.36);
  outline-offset: 2px;
}

.topbar .global-status button.metric,
body[data-page="island"] .topbar .global-status button.metric {
  appearance: none;
  font: inherit;
  text-align: left;
}

.topbar .global-status .metric-clickable,
body[data-page="island"] .topbar .global-status .metric-clickable {
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.topbar .global-status .metric-clickable:hover,
body[data-page="island"] .topbar .global-status .metric-clickable:hover {
  border-color: rgba(73, 111, 99, 0.26);
  box-shadow: 0 7px 18px rgba(25, 48, 46, 0.12);
  transform: translateY(-1px);
}

.topbar .global-status .metric-clickable:focus-visible,
body[data-page="island"] .topbar .global-status .metric-clickable:focus-visible {
  outline: 2px solid rgba(73, 111, 99, 0.35);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .topbar,
  body[data-page="island"] .topbar {
    gap: 10px;
    justify-content: center;
    padding: 8px 12px;
  }

  .topbar .global-status {
    justify-content: flex-start;
    width: max-content;
    max-width: min(520px, calc(100vw - 260px));
  }
}

@media (max-width: 640px) {
  :root {
    --global-topbar-height: 88px;
  }

  .app,
  body[data-page="island"] .app {
    padding-top: calc(var(--global-topbar-height) + 12px);
    padding-bottom: var(--global-bottom-nav-reserve);
  }

  .topbar,
  body[data-page="island"] .topbar {
    height: var(--global-topbar-height);
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }

  .global-player-anchor,
  .global-mailbox-anchor {
    align-self: center;
  }

  .topbar .global-status {
    max-width: none;
    min-width: max-content;
    padding-top: 2px;
  }

  .global-primary-nav {
    right: 12px;
    bottom: var(--global-nav-bottom);
    left: 12px;
    max-width: none;
    justify-content: space-between;
    padding: 6px;
    border-radius: 20px;
    background:
      linear-gradient(180deg, #fffdf7 0%, #f5efe1 100%),
      var(--global-nav-bg);
    box-shadow: 0 16px 38px rgba(30, 36, 31, 0.18);
    transform: none;
    backdrop-filter: none;
  }

  .global-player-menu {
    width: min(232px, calc(100vw - 24px));
  }
}

.app {
  max-width: 1440px;
}

body[data-page="island"] .app {
  max-width: none;
}

@media (max-width: 560px) {
  body[data-page="island"] .island-map-zoom-controls {
    right: 10px;
    bottom: 18px;
    left: 10px;
    width: auto;
    max-width: calc(100vw - 20px);
    justify-content: space-between;
    gap: 5px;
    padding: 7px;
  }

  body[data-page="island"] .island-map-info-toggle {
    right: 10px;
    bottom: 74px;
    min-height: 44px;
    padding: 7px 12px 7px 10px;
    font-size: 14px;
  }

  body[data-page="island"] .island-map-info-toggle::before {
    width: 46px;
    height: 28px;
  }

  body[data-page="island"] .island-map-info-toggle::after {
    left: 15px;
    width: 20px;
    height: 20px;
  }

  body[data-page="island"] .island-map-info-toggle.active::after {
    transform: translate(18px, -50%);
  }

  body[data-page="island"] .island-map-info-toggle i {
    min-width: 28px;
    padding: 4px 7px;
    font-size: 12px;
  }

  body[data-page="island"] .island-map-zoom-button {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  body[data-page="island"] .island-map-center-button {
    min-width: 54px;
    height: 40px;
    padding: 0 9px;
    font-size: 13px;
  }

  body[data-page="island"] .island-map-expansion-button {
    min-width: 56px;
  }

  body[data-page="island"] .island-map-zoom-value {
    min-width: 45px;
    font-size: 14px;
  }
}

/* Final compact pass for the island map liquid-glass HUD. */
body[data-page="island"] .island-map-zoom-controls {
  right: 16px;
  bottom: 16px;
  left: auto;
  justify-content: flex-start;
  gap: 8px;
  width: fit-content;
  max-width: calc(100vw - 32px);
  padding: 6px;
}

body[data-page="island"] .island-map-info-toggle {
  right: 16px;
  bottom: 82px;
  min-height: 40px;
  gap: 14px;
  padding: 5px 9px 5px 8px;
  font-size: 14px;
}

body[data-page="island"] .island-map-info-toggle::before {
  width: 42px;
  height: 24px;
}

body[data-page="island"] .island-map-info-toggle::after {
  left: 11px;
  width: 18px;
  height: 18px;
}

body[data-page="island"] .island-map-info-toggle.active::after {
  transform: translate(18px, -50%);
}

body[data-page="island"] .island-map-info-toggle span {
  min-width: max-content;
}

body[data-page="island"] .island-map-info-toggle i {
  min-width: 28px;
  margin-left: 2px;
  padding: 4px 7px;
  font-size: 12px;
}

body[data-page="island"] .island-map-zoom-button {
  width: 40px;
  height: 40px;
  font-size: 24px;
}

body[data-page="island"] .island-map-center-button,
body[data-page="island"] .island-map-layout-cancel-button,
body[data-page="island"] .island-map-layout-save-button {
  min-width: 60px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
}

body[data-page="island"] .island-map-expansion-button {
  min-width: 64px;
}

body[data-page="island"] .island-map-zoom-value {
  min-width: 54px;
  font-size: 15px;
}

@media (max-width: 560px) {
  body[data-page="island"] .island-map-zoom-controls {
    right: 10px;
    bottom: 16px;
    left: auto;
    justify-content: flex-start;
    gap: 6px;
    width: fit-content;
    max-width: calc(100vw - 20px);
    padding: 6px;
  }

  body[data-page="island"] .island-map-info-toggle {
    right: 10px;
    bottom: 82px;
    min-height: 40px;
    gap: 12px;
    padding: 5px 8px;
    font-size: 14px;
  }

  body[data-page="island"] .island-map-zoom-button {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  body[data-page="island"] .island-map-center-button {
    min-width: 50px;
    height: 36px;
    padding: 0 9px;
    font-size: 13px;
  }

  body[data-page="island"] .island-map-expansion-button {
    min-width: 54px;
  }

  body[data-page="island"] .island-map-zoom-value {
    min-width: 44px;
    font-size: 14px;
  }
}

/* True final liquid-glass layer for the global top HUD. */
.topbar,
body[data-page="island"] .topbar {
  isolation: isolate;
  overflow: visible;
  gap: 14px;
  padding: 7px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  background:
    radial-gradient(ellipse at 50% -35%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.25) 44%, transparent 68%),
    radial-gradient(circle at 14% 22%, rgba(131, 220, 205, 0.16), transparent 30%),
    radial-gradient(circle at 86% 25%, rgba(255, 224, 161, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 252, 244, 0.72), rgba(246, 241, 230, 0.36) 55%, rgba(235, 245, 243, 0.28)),
    rgba(250, 248, 241, 0.42);
  box-shadow:
    0 18px 58px rgba(34, 44, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(30px) saturate(1.55) contrast(1.02);
  -webkit-backdrop-filter: blur(30px) saturate(1.55) contrast(1.02);
}

.topbar::before,
body[data-page="island"] .topbar::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 5px max(18px, env(safe-area-inset-right)) 6px max(18px, env(safe-area-inset-left));
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.58), transparent 31%, rgba(255, 255, 255, 0.2) 58%, transparent 76%),
    radial-gradient(circle at 9% 50%, rgba(255, 255, 255, 0.46), transparent 20%),
    radial-gradient(circle at 82% 52%, rgba(118, 207, 192, 0.16), transparent 24%),
    rgba(255, 255, 255, 0.2);
  box-shadow:
    0 12px 36px rgba(30, 43, 41, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.topbar::after,
body[data-page="island"] .topbar::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72) 18%, rgba(75, 119, 111, 0.34) 50%, rgba(255, 255, 255, 0.62) 82%, transparent);
  opacity: 0.78;
  pointer-events: none;
}

.topbar > *,
body[data-page="island"] .topbar > * {
  position: relative;
  z-index: 1;
}

.global-player-anchor .global-player-button,
body[data-page="island"] .global-player-anchor .global-player-button,
.global-mailbox-anchor .mailbox-toggle,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle,
.topbar .global-status,
body[data-page="island"] .topbar .global-status,
.topbar .global-status .metric,
body[data-page="island"] .topbar .global-status .metric,
.topbar .global-status .wallet-metric,
body[data-page="island"] .topbar .global-status .wallet-metric {
  border-color: rgba(255, 255, 255, 0.56);
  box-shadow:
    0 12px 28px rgba(31, 44, 42, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(22px) saturate(1.42);
  -webkit-backdrop-filter: blur(22px) saturate(1.42);
}

.global-player-anchor .global-player-button,
body[data-page="island"] .global-player-anchor .global-player-button,
.global-mailbox-anchor .mailbox-toggle,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
  border: 1px solid rgba(255, 255, 255, 0.56);
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.74), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.18)),
    rgba(249, 252, 248, 0.28);
}

.global-player-anchor .global-player-button,
body[data-page="island"] .global-player-anchor .global-player-button {
  min-height: 50px;
  padding: 4px 11px 4px 4px;
  border-radius: 999px;
}

.global-player-button .player-avatar,
body[data-page="island"] .global-player-button .player-avatar {
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow:
    0 9px 22px rgba(35, 52, 47, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.topbar .global-status,
body[data-page="island"] .topbar .global-status {
  gap: 7px;
  overflow: visible;
  padding: 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 999px;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.72), transparent 32%),
    radial-gradient(circle at 88% 100%, rgba(88, 210, 196, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.16) 46%, rgba(224, 239, 236, 0.28)),
    rgba(255, 255, 255, 0.22);
  scrollbar-width: none;
}

.topbar .global-status::-webkit-scrollbar,
body[data-page="island"] .topbar .global-status::-webkit-scrollbar {
  display: none;
}

.topbar .global-status .metric,
body[data-page="island"] .topbar .global-status .metric {
  position: relative;
  overflow: hidden;
  min-width: 88px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 18px;
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.7), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.16)),
    rgba(255, 255, 255, 0.24);
}

.topbar .global-status .metric::after,
body[data-page="island"] .topbar .global-status .metric::after,
.topbar .global-status .wallet-slot::after,
body[data-page="island"] .topbar .global-status .wallet-slot::after,
.global-mailbox-anchor .mailbox-toggle::after,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.42), transparent 32%, rgba(255, 255, 255, 0.16) 58%, transparent 76%);
  opacity: 0.76;
  pointer-events: none;
}

.topbar .global-status .metric i,
body[data-page="island"] .topbar .global-status .metric i {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.28) 44%, rgba(99, 142, 133, 0.18)),
    rgba(255, 255, 255, 0.2);
  box-shadow:
    0 5px 12px rgba(39, 60, 55, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.topbar .global-status .metric.metric-visual-icon i,
body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i {
  width: 31px;
  height: 31px;
  border-radius: 999px;
}

.topbar .global-status .metric span,
body[data-page="island"] .topbar .global-status .metric span,
.topbar .global-status .metric strong,
body[data-page="island"] .topbar .global-status .metric strong {
  position: relative;
  z-index: 1;
}

.topbar .global-status .metric span,
body[data-page="island"] .topbar .global-status .metric span {
  color: rgba(70, 80, 75, 0.72);
  font-size: 10px;
  font-weight: 800;
}

.topbar .global-status .metric strong,
body[data-page="island"] .topbar .global-status .metric strong {
  color: rgba(26, 38, 43, 0.96);
  font-size: 15px;
  font-weight: 1000;
}

.topbar .global-status .wallet-metric,
body[data-page="island"] .topbar .global-status .wallet-metric {
  flex: 0 0 296px;
  grid-template-rows: 27px 27px;
  gap: 4px;
  width: 296px;
  min-width: 296px;
  min-height: 62px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.56), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)),
    rgba(255, 255, 255, 0.16);
}

.topbar .global-status .wallet-slot,
body[data-page="island"] .topbar .global-status .wallet-slot {
  position: relative;
  overflow: hidden;
  height: 27px;
  padding: 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow:
    0 7px 16px rgba(26, 42, 38, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.topbar .global-status .wallet-slot > *,
body[data-page="island"] .topbar .global-status .wallet-slot > * {
  position: relative;
  z-index: 1;
}

.topbar .global-status .wallet-slot i,
body[data-page="island"] .topbar .global-status .wallet-slot i {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 5px;
  width: 25px;
  height: 25px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.28) 48%, rgba(255, 255, 255, 0.1)),
    rgba(255, 255, 255, 0.2);
  box-shadow:
    0 4px 10px rgba(18, 34, 31, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transform: translateY(-50%);
}

.topbar .global-status .wallet-slot strong,
body[data-page="island"] .topbar .global-status .wallet-slot strong {
  color: rgba(255, 255, 249, 0.97);
  font-size: 16px;
  text-shadow: 0 1px 2px rgba(23, 38, 34, 0.24);
}

.topbar .global-status .wallet-cash,
body[data-page="island"] .topbar .global-status .wallet-cash {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.52), transparent 42%),
    linear-gradient(180deg, rgba(137, 199, 40, 0.94), rgba(79, 157, 9, 0.86)),
    rgba(119, 184, 22, 0.78);
}

.topbar .global-status .wallet-gold,
body[data-page="island"] .topbar .global-status .wallet-gold {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.58), transparent 42%),
    linear-gradient(180deg, rgba(252, 220, 110, 0.94), rgba(215, 157, 39, 0.86)),
    rgba(228, 181, 62, 0.78);
}

.topbar .global-status .wallet-gems,
body[data-page="island"] .topbar .global-status .wallet-gems {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.62), transparent 42%),
    linear-gradient(180deg, rgba(166, 221, 246, 0.94), rgba(91, 181, 227, 0.86)),
    rgba(99, 187, 231, 0.78);
}

.global-mailbox-anchor .mailbox-toggle,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
  position: relative;
  overflow: hidden;
  min-height: 46px;
  padding: 6px 15px 6px 8px;
  color: rgba(26, 38, 43, 0.96);
}

.global-mailbox-anchor .mailbox-toggle-icon,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-icon,
.global-mailbox-anchor .mailbox-toggle-label,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-label,
.mailbox-badge {
  position: relative;
  z-index: 1;
}

.global-mailbox-anchor .mailbox-toggle-icon,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-icon {
  filter: drop-shadow(0 5px 10px rgba(31, 50, 46, 0.16));
}

.topbar .global-status .metric-clickable:hover,
body[data-page="island"] .topbar .global-status .metric-clickable:hover,
.topbar .global-status .wallet-clickable:hover,
body[data-page="island"] .topbar .global-status .wallet-clickable:hover,
.global-mailbox-anchor .mailbox-toggle:hover,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle:hover,
.global-player-anchor .global-player-button:hover,
body[data-page="island"] .global-player-anchor .global-player-button:hover {
  border-color: rgba(255, 255, 255, 0.74);
  filter: saturate(1.06) brightness(1.03);
  transform: translateY(-1px);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar,
  body[data-page="island"] .topbar,
  .topbar .global-status,
  body[data-page="island"] .topbar .global-status,
  .topbar .global-status .metric,
  body[data-page="island"] .topbar .global-status .metric,
  .global-player-anchor .global-player-button,
  body[data-page="island"] .global-player-anchor .global-player-button,
  .global-mailbox-anchor .mailbox-toggle,
  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
    background-color: rgba(250, 248, 241, 0.92);
  }
}

@media (max-width: 900px) {
  .topbar,
  body[data-page="island"] .topbar {
    gap: 9px;
    padding: 7px 12px;
  }

  .topbar .global-status,
  body[data-page="island"] .topbar .global-status {
    max-width: min(560px, calc(100vw - 250px));
  }
}

@media (max-width: 640px) {
  .topbar,
  body[data-page="island"] .topbar {
    gap: 8px;
    padding: 7px 12px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .topbar::before,
  body[data-page="island"] .topbar::before {
    inset: 5px 10px 6px;
  }

  .topbar .global-status,
  body[data-page="island"] .topbar .global-status {
    gap: 6px;
    max-width: none;
    min-width: max-content;
    padding: 4px 5px;
  }

  .topbar .global-status .wallet-metric,
  body[data-page="island"] .topbar .global-status .wallet-metric {
    flex-basis: 264px;
    width: 264px;
    min-width: 264px;
  }

  .topbar .global-status .metric,
  body[data-page="island"] .topbar .global-status .metric {
    min-width: 82px;
    min-height: 42px;
    padding: 6px 9px;
  }
}

/* Fit pass: keep the liquid-glass HUD inside the fixed topbar height. */
.topbar .global-status,
body[data-page="island"] .topbar .global-status {
  padding: 3px 4px;
}

.topbar .global-status .wallet-metric,
body[data-page="island"] .topbar .global-status .wallet-metric {
  flex-basis: 292px;
  grid-template-rows: 24px 24px;
  width: 292px;
  min-width: 292px;
  min-height: 60px;
  padding: 3px;
}

.topbar .global-status .wallet-slot,
body[data-page="island"] .topbar .global-status .wallet-slot {
  height: 24px;
  padding: 0 32px;
}

.topbar .global-status .wallet-slot i,
body[data-page="island"] .topbar .global-status .wallet-slot i {
  width: 22px;
  height: 22px;
}

.topbar .global-status .wallet-slot i img,
body[data-page="island"] .topbar .global-status .wallet-slot i img {
  width: 22px;
  height: 22px;
}

.topbar .global-status .wallet-slot strong,
body[data-page="island"] .topbar .global-status .wallet-slot strong {
  font-size: 15px;
}

@media (max-width: 640px) {
  .topbar .global-status .wallet-metric,
  body[data-page="island"] .topbar .global-status .wallet-metric {
    flex-basis: 258px;
    width: 258px;
    min-width: 258px;
  }
}

/* Reduced-line pass: one glass surface, fewer nested outlines. */
.topbar,
body[data-page="island"] .topbar {
  border-bottom: 0;
  background:
    radial-gradient(ellipse at 50% -48%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.18) 48%, transparent 72%),
    radial-gradient(circle at 18% 38%, rgba(118, 200, 188, 0.14), transparent 32%),
    radial-gradient(circle at 86% 34%, rgba(255, 222, 163, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(250, 249, 243, 0.66), rgba(232, 244, 241, 0.3)),
    rgba(247, 249, 244, 0.28);
  box-shadow:
    0 14px 40px rgba(34, 44, 42, 0.08),
    inset 0 -1px 0 rgba(58, 96, 91, 0.2);
}

.topbar::before,
body[data-page="island"] .topbar::before {
  display: none;
}

.topbar::after,
body[data-page="island"] .topbar::after {
  bottom: 0;
  height: 1px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.74) 24%, rgba(66, 108, 102, 0.22) 50%, rgba(255, 255, 255, 0.56) 76%, transparent);
  opacity: 0.8;
}

.topbar .global-status,
body[data-page="island"] .topbar .global-status {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.global-player-anchor .global-player-button,
body[data-page="island"] .global-player-anchor .global-player-button,
.global-mailbox-anchor .mailbox-toggle,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
  border: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.58), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.14)),
    rgba(255, 255, 255, 0.2);
  box-shadow:
    0 8px 20px rgba(31, 44, 42, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.topbar .global-status .metric,
body[data-page="island"] .topbar .global-status .metric {
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.12);
  box-shadow:
    0 7px 16px rgba(31, 44, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.topbar .global-status .metric::after,
body[data-page="island"] .topbar .global-status .metric::after,
.topbar .global-status .wallet-slot::after,
body[data-page="island"] .topbar .global-status .wallet-slot::after,
.global-mailbox-anchor .mailbox-toggle::after,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle::after {
  display: none;
}

.topbar .global-status .metric i,
body[data-page="island"] .topbar .global-status .metric i {
  border: 0;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.topbar .global-status .metric.metric-visual-icon i,
body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i {
  background: transparent;
  box-shadow: none;
}

.topbar .global-status .wallet-metric,
body[data-page="island"] .topbar .global-status .wallet-metric {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.topbar .global-status .wallet-slot,
body[data-page="island"] .topbar .global-status .wallet-slot {
  border: 0;
  box-shadow:
    0 6px 14px rgba(25, 40, 36, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.topbar .global-status .wallet-slot i,
body[data-page="island"] .topbar .global-status .wallet-slot i {
  background: rgba(255, 255, 255, 0.26);
  box-shadow:
    0 3px 8px rgba(18, 34, 31, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.global-player-button .player-avatar,
body[data-page="island"] .global-player-button .player-avatar {
  border: 0;
  box-shadow:
    0 7px 16px rgba(35, 52, 47, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.global-mailbox-anchor .mailbox-toggle,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
  box-shadow:
    0 8px 20px rgba(31, 44, 42, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

/* Final liquid-glass pass for the global bottom navigation. */
.global-primary-nav {
  gap: 8px;
  overflow: visible;
  padding: 7px 9px;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 255, 255, 0.82), transparent 42%),
    radial-gradient(ellipse at 86% 100%, rgba(123, 204, 191, 0.18), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(230, 243, 239, 0.46) 54%, rgba(255, 251, 238, 0.38)),
    rgba(244, 250, 247, 0.64);
  background-clip: border-box;
  box-shadow:
    0 18px 46px rgba(37, 50, 46, 0.16),
    0 4px 14px rgba(66, 101, 94, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(64, 105, 99, 0.16);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.global-primary-nav::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.1) 36%, rgba(99, 180, 166, 0.12) 64%, rgba(255, 255, 255, 0.38)),
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.72), transparent 24%);
  opacity: 0.84;
  pointer-events: none;
}

.global-primary-nav::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: -8px;
  left: 20px;
  z-index: 0;
  height: 16px;
  border-radius: 999px;
  background: rgba(66, 105, 98, 0.14);
  filter: blur(12px);
  pointer-events: none;
}

.global-nav-item {
  z-index: 1;
}

.global-nav-button {
  position: relative;
  overflow: hidden;
  gap: 8px;
  min-width: 78px;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: rgba(39, 56, 52, 0.78);
  box-shadow: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.56);
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.global-nav-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 22% 10%, rgba(255, 255, 255, 0.74), transparent 43%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.14)),
    rgba(219, 238, 232, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.global-nav-button:hover,
.global-nav-button:focus-visible {
  color: #263c37;
  transform: translateY(-1px);
}

.global-nav-button:hover::before,
.global-nav-button:focus-visible::before {
  opacity: 0.44;
}

.global-nav-button.selected,
.global-nav-item.world-menu-open .global-nav-button[data-page="world"],
.global-nav-item.government-menu-open .global-nav-button[data-page="government"],
.global-nav-item.diplomacy-menu-open .global-nav-button[data-page="diplomacy"] {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.68), transparent 38%),
    linear-gradient(180deg, rgba(196, 226, 214, 0.94), rgba(145, 197, 178, 0.82)),
    rgba(141, 195, 176, 0.86);
  color: #123f36;
  box-shadow:
    0 12px 24px rgba(37, 78, 66, 0.2),
    inset 0 0 0 1px rgba(61, 137, 116, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -10px 18px rgba(50, 124, 105, 0.12);
}

.global-nav-button.selected::before,
.global-nav-item.world-menu-open .global-nav-button[data-page="world"]::before,
.global-nav-item.government-menu-open .global-nav-button[data-page="government"]::before,
.global-nav-item.diplomacy-menu-open .global-nav-button[data-page="diplomacy"]::before {
  opacity: 0.32;
}

.global-nav-button i {
  position: relative;
  z-index: 1;
  background: transparent;
  color: currentColor;
  box-shadow: none;
}

.global-nav-button span {
  position: relative;
  z-index: 1;
  font-weight: 950;
  letter-spacing: 0;
  color: inherit;
}

.global-nav-button.global-nav-button-visual {
  gap: 9px;
  min-width: 102px;
  min-height: 54px;
  padding: 6px 16px 6px 8px;
}

.global-nav-button.global-nav-button-visual i {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: transparent;
  overflow: hidden;
  filter: drop-shadow(0 7px 10px rgba(43, 59, 54, 0.12));
}

.global-nav-button.global-nav-button-visual i img {
  width: 54px;
  height: 54px;
  max-width: none;
  transform: translate(-6px, -6px);
  object-fit: cover;
}

.global-nav-button.selected.global-nav-button-visual i img,
.global-nav-item.world-menu-open .global-nav-button.global-nav-button-visual[data-page="world"] i img,
.global-nav-item.government-menu-open .global-nav-button.global-nav-button-visual[data-page="government"] i img,
.global-nav-item.diplomacy-menu-open .global-nav-button.global-nav-button-visual[data-page="diplomacy"] i img {
  mix-blend-mode: multiply;
}

.global-world-nav-menu,
.global-government-nav-menu,
.global-diplomacy-nav-menu {
  bottom: calc(100% + 12px);
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(73, 111, 99, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.98), transparent 42%),
    linear-gradient(145deg, rgba(255, 253, 247, 0.99), rgba(240, 248, 244, 0.98)),
    #f8faf6;
  box-shadow:
    0 22px 48px rgba(31, 44, 41, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(64, 105, 99, 0.16);
  backdrop-filter: blur(8px) saturate(1.08);
  -webkit-backdrop-filter: blur(8px) saturate(1.08);
}

.global-world-nav-menu::after,
.global-government-nav-menu::after,
.global-diplomacy-nav-menu::after {
  bottom: -5px;
  border: 0;
  background: #f8faf6;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.6),
    4px 4px 12px rgba(31, 44, 41, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.global-world-nav-option,
.global-government-nav-option,
.global-diplomacy-nav-option {
  border-radius: 16px;
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.84), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(236, 247, 243, 0.34)),
    rgba(244, 249, 246, 0.7);
  color: rgba(39, 56, 52, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(74, 111, 99, 0.08);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.52);
}

.global-world-nav-option:hover,
.global-government-nav-option:hover,
.global-diplomacy-nav-option:hover,
.global-world-nav-option.selected,
.global-government-nav-option.selected,
.global-diplomacy-nav-option.selected {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.72), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16)),
    rgba(221, 239, 233, 0.44);
  color: #243a35;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 8px 18px rgba(43, 65, 58, 0.09);
}

@media (max-width: 900px) {
  .global-primary-nav {
    gap: 6px;
    padding: 7px;
  }

  .global-nav-button.global-nav-button-visual {
    min-width: 86px;
    min-height: 52px;
    padding: 6px 11px 6px 7px;
  }
}

@media (max-width: 640px) {
  .global-primary-nav {
    right: 12px;
    left: 12px;
    gap: 4px;
    justify-content: space-between;
    padding: 6px;
    border-radius: 24px;
    background:
      radial-gradient(ellipse at 18% 0%, rgba(255, 255, 255, 0.88), transparent 42%),
      radial-gradient(ellipse at 86% 100%, rgba(123, 204, 191, 0.2), transparent 48%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(230, 243, 239, 0.66) 54%, rgba(255, 251, 238, 0.58)),
      rgba(249, 252, 250, 0.86);
    backdrop-filter: blur(42px) saturate(1.48) contrast(1.03);
    -webkit-backdrop-filter: blur(42px) saturate(1.48) contrast(1.03);
    transform: none;
  }

  .global-primary-nav::before {
    opacity: 0.9;
  }

  .global-nav-item {
    flex: 1 1 0;
    min-width: 0;
  }

  .global-nav-button,
  .global-nav-button.global-nav-button-visual {
    min-width: 0;
    min-height: 50px;
    flex-direction: column;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 18px;
  }

  .global-nav-button.global-nav-button-visual i,
  .global-nav-button.global-nav-button-visual i img {
    width: 34px;
    height: 34px;
  }

  .global-nav-button span {
    font-size: 11px;
    line-height: 1;
  }
}

/* Pin island map controls to the lower-right playfield edge. */
body[data-page="island"] .island-map-zoom-controls {
  right: 16px;
  bottom: calc(var(--global-nav-bottom) + 16px);
}

body[data-page="island"] .island-map-info-toggle {
  right: 16px;
  bottom: calc(var(--global-nav-bottom) + 74px);
}

@media (max-width: 560px) {
  body[data-page="island"] .island-map-zoom-controls {
    right: 10px;
    bottom: calc(var(--global-nav-bottom) + 14px);
    left: auto;
    max-width: calc(100vw - 20px);
  }

  body[data-page="island"] .island-map-info-toggle {
    right: 10px;
    bottom: calc(var(--global-nav-bottom) + 72px);
  }
}

/* Island page edge cleanup: remove legacy dark app gutters above and below the map. */
body[data-page="island"] {
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.76), transparent 46%),
    radial-gradient(circle, rgba(77, 127, 140, 0.2) 0 1px, transparent 1.6px),
    linear-gradient(180deg, #f3fbfc 0%, #e1f4f6 54%, #cce8eb 100%);
  background-size: auto, 16px 16px, auto;
}

body[data-page="island"] .app {
  min-height: 100vh;
  padding: 0 !important;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.76), transparent 46%),
    radial-gradient(circle, rgba(77, 127, 140, 0.2) 0 1px, transparent 1.6px),
    linear-gradient(180deg, #f3fbfc 0%, #e1f4f6 54%, #cce8eb 100%);
  background-size: auto, 16px 16px, auto;
}

body[data-page="island"] #islandPage,
body[data-page="island"] .island-workspace,
body[data-page="island"] #plots {
  min-height: 100vh;
}

/* Final iOS-style liquid-glass pass for the island ship brief dock. */
body[data-page="island"] .island-ship-brief-dock {
  isolation: isolate;
  top: clamp(112px, 42vh, calc(100vh - var(--global-bottom-nav-reserve) - 340px));
  width: 206px;
  max-height: min(318px, calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 42px));
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 16% 0%, rgba(255, 255, 255, 0.9), transparent 42%),
    radial-gradient(ellipse at 100% 70%, rgba(110, 202, 189, 0.24), transparent 52%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(225, 242, 238, 0.5) 58%, rgba(244, 250, 247, 0.62)),
    rgba(244, 250, 247, 0.74);
  box-shadow:
    0 20px 48px rgba(35, 54, 50, 0.18),
    0 4px 14px rgba(66, 101, 94, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(68, 111, 105, 0.15);
  color: #243a35;
  backdrop-filter: blur(30px) saturate(1.5) contrast(1.03);
  -webkit-backdrop-filter: blur(30px) saturate(1.5) contrast(1.03);
  scrollbar-width: none;
}

body[data-page="island"] .island-ship-brief-dock::-webkit-scrollbar {
  display: none;
}

body[data-page="island"] .island-ship-brief-dock::before,
body[data-page="island"] .island-ship-brief-dock::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

body[data-page="island"] .island-ship-brief-dock::before {
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.08) 36%, rgba(104, 188, 175, 0.12) 66%, rgba(255, 255, 255, 0.34)),
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.72), transparent 24%);
  opacity: 0.72;
}

body[data-page="island"] .island-ship-brief-dock::after {
  right: 14px;
  bottom: -8px;
  left: 14px;
  z-index: 0;
  height: 16px;
  border-radius: 999px;
  background: rgba(65, 103, 96, 0.14);
  filter: blur(12px);
}

body[data-page="island"] .island-ship-brief-dock > * {
  position: relative;
  z-index: 1;
}

body[data-page="island"] .island-ship-brief-dock.dragging {
  box-shadow:
    0 28px 58px rgba(32, 48, 44, 0.24),
    0 8px 20px rgba(66, 101, 94, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(68, 111, 105, 0.16);
  transform: translateY(-2px) scale(1.01);
}

body[data-page="island"] .island-ship-brief-dock.collapsed {
  width: 66px;
  padding: 7px;
  border-radius: 19px;
}

body[data-page="island"] .island-side-ship-head {
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  gap: 5px;
  min-height: 54px;
  padding: 11px 12px 10px;
  border-bottom: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -1px 0 rgba(71, 108, 101, 0.1);
}

body[data-page="island"] .island-ship-brief-dock.collapsed .island-side-ship-head {
  min-height: auto;
  box-shadow: none;
}

body[data-page="island"] .island-side-ship-head strong {
  align-items: center;
  color: #253c36;
  display: flex;
  font-size: 16px;
  font-weight: 950;
  gap: 9px;
  letter-spacing: 0;
  min-width: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

body[data-page="island"] .island-side-ship-title-icon {
  flex-basis: 36px;
  height: 36px;
  width: 36px;
}

body[data-page="island"] .island-side-ship-head button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: transparent;
  color: rgba(35, 56, 51, 0.86);
  font-size: 21px;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

body[data-page="island"] .island-side-ship-head button:hover,
body[data-page="island"] .island-side-ship-head button:focus-visible {
  background: rgba(255, 255, 255, 0.48);
  color: #1f3934;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 6px 14px rgba(41, 64, 58, 0.08);
  transform: translateY(-1px);
}

body[data-page="island"] .island-side-ship-collapsed-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #27433d;
  box-shadow: none;
  padding: 0;
}

body[data-page="island"] .island-side-ship-collapsed-image {
  height: 46px;
  width: 46px;
}

body[data-page="island"] .island-side-ship-list {
  gap: 2px;
  padding: 4px 7px 8px;
}

body[data-page="island"] .island-side-ship-item {
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 5px 9px;
  min-height: 68px;
  padding: 10px 9px;
  border-bottom: 0;
  border-radius: 16px;
  color: #263c37;
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

body[data-page="island"] .island-side-ship-item::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.68), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1)),
    rgba(224, 240, 235, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

body[data-page="island"] .island-side-ship-item:hover,
body[data-page="island"] .island-side-ship-item:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 8px 18px rgba(43, 65, 58, 0.08);
  transform: translateY(-1px);
}

body[data-page="island"] .island-side-ship-item:hover::before,
body[data-page="island"] .island-side-ship-item:focus-visible::before {
  opacity: 0.76;
}

body[data-page="island"] .island-side-ship-name,
body[data-page="island"] .island-side-ship-location,
body[data-page="island"] .island-side-ship-gauges {
  position: relative;
  z-index: 1;
}

body[data-page="island"] .island-side-ship-name {
  color: #1b6f7a;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.66);
}

body[data-page="island"] .island-side-ship-location {
  color: rgba(43, 60, 56, 0.74);
  font-size: 12px;
  font-weight: 850;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.54);
}

body[data-page="island"] .island-side-ship-location i {
  width: 19px;
  height: 19px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(226, 240, 236, 0.38)),
    rgba(255, 255, 255, 0.34);
  color: rgba(44, 66, 60, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: 10px;
}

body[data-page="island"] .island-side-ship-location i {
  position: relative;
  width: 21px;
  height: 21px;
  overflow: visible;
  border-radius: 9px;
  background:
    radial-gradient(circle at 30% 12%, rgba(255, 255, 255, 0.92), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(228, 241, 238, 0.38)),
    rgba(255, 255, 255, 0.36);
  color: transparent;
  font-size: 0;
  line-height: 0;
  text-shadow: none;
  box-shadow:
    0 5px 10px rgba(45, 68, 62, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(69, 109, 101, 0.1);
}

body[data-page="island"] .island-side-ship-location i::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50% 50% 50% 2px;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 202, 202, 0.96), transparent 27%),
    linear-gradient(135deg, #ff5d66 0%, #e02e3f 58%, #a91d2d 100%);
  box-shadow:
    0 4px 9px rgba(193, 33, 51, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: rotate(-45deg);
}

body[data-page="island"] .island-side-ship-location i::after {
  content: "";
  position: absolute;
  left: 8.5px;
  top: 6.5px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.96);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28),
    0 2px 5px rgba(120, 18, 31, 0.16);
}

body[data-page="island"] .island-side-ship-gauges {
  width: 58px;
  gap: 6px;
}

body[data-page="island"] .island-side-ship-gauge {
  height: 7px;
  background: rgba(35, 66, 60, 0.13);
  box-shadow:
    inset 0 1px 2px rgba(32, 57, 51, 0.14),
    inset 0 -1px 0 rgba(255, 255, 255, 0.5);
}

body[data-page="island"] .island-side-ship-gauge.fuel span {
  background: linear-gradient(90deg, #e99117, #ffc34f);
  box-shadow: 0 0 10px rgba(244, 164, 34, 0.22);
}

body[data-page="island"] .island-side-ship-gauge.ship-durability {
  background: rgba(151, 38, 55, 0.16);
}

body[data-page="island"] .island-side-ship-gauge.ship-durability span {
  background: linear-gradient(90deg, #d8324c, #ff7a64);
  box-shadow: 0 0 10px rgba(216, 50, 76, 0.22);
}

body[data-page="island"] .island-side-ship-empty,
body[data-page="island"] .island-side-ship-more {
  padding: 10px 12px 12px;
  color: rgba(42, 60, 55, 0.62);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.56);
}

body[data-page="island"] .island-side-ship-more:hover,
body[data-page="island"] .island-side-ship-more:focus-visible {
  color: #24413b;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 14px;
}

/* Ship brief dropdown: reveal more ships without leaving the island map. */
body[data-page="island"] .island-ship-brief-dock.list-expanded {
  top: clamp(112px, 26vh, calc(100vh - var(--global-bottom-nav-reserve) - 468px));
  max-height: min(468px, calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 36px));
}

body[data-page="island"] .island-ship-brief-dock.list-expanded .island-side-ship-list {
  max-height: calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 96px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 9px;
  scrollbar-width: none;
}

body[data-page="island"] .island-ship-brief-dock.list-expanded .island-side-ship-list::-webkit-scrollbar {
  display: none;
}

body[data-page="island"] .island-side-ship-more {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  margin: 6px 2px 0;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.82), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(232, 244, 240, 0.28)),
    rgba(246, 251, 249, 0.58);
  color: #263c37;
  box-shadow:
    0 10px 22px rgba(43, 65, 58, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(70, 110, 102, 0.1);
  cursor: pointer;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

body[data-page="island"] .island-side-ship-more span {
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

body[data-page="island"] .island-side-ship-more i {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(229, 241, 238, 0.34)),
    rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
  transition: transform 0.18s ease;
}

body[data-page="island"] .island-side-ship-more i::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(38, 60, 55, 0.76);
  border-bottom: 2px solid rgba(38, 60, 55, 0.76);
  transform: translateY(-2px) rotate(45deg);
}

body[data-page="island"] .island-side-ship-more.expanded i {
  transform: rotate(180deg);
}

body[data-page="island"] .island-side-ship-more:hover,
body[data-page="island"] .island-side-ship-more:focus-visible {
  color: #1f3934;
  background:
    radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.92), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(232, 244, 240, 0.38)),
    rgba(248, 252, 250, 0.72);
  box-shadow:
    0 12px 26px rgba(43, 65, 58, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  body[data-page="island"] .island-ship-brief-dock {
    width: min(206px, calc(100vw - 24px));
    backdrop-filter: blur(36px) saturate(1.48) contrast(1.03);
    -webkit-backdrop-filter: blur(36px) saturate(1.48) contrast(1.03);
  }
}

/* Island status HUD: iOS-style liquid glass refinement. */
body[data-page="island"] .island-status-hud {
  top: calc(var(--global-topbar-height) + 14px);
  width: 342px;
  --status-liquid-ink: #213b37;
  --status-liquid-muted: rgba(48, 65, 60, 0.66);
  --status-liquid-teal: #087f73;
  --status-liquid-gold: #a9822e;
}

body[data-page="island"] .island-status-hud.custom-positioned {
  width: 342px;
}

body[data-page="island"] .island-status-hud,
body[data-page="island"] .island-ship-brief-dock {
  will-change: left, top, transform;
}

body[data-page="island"] .island-status-panel {
  gap: 10px;
  padding: 12px;
  border: 0;
  border-radius: 32px;
  background:
    radial-gradient(ellipse at 14% 0%, rgba(255, 255, 255, 0.92), transparent 42%),
    radial-gradient(ellipse at 94% 18%, rgba(118, 210, 196, 0.26), transparent 39%),
    radial-gradient(ellipse at 58% 100%, rgba(238, 218, 162, 0.18), transparent 44%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(227, 244, 240, 0.5) 55%, rgba(248, 252, 249, 0.64)),
    rgba(244, 250, 247, 0.78);
  box-shadow:
    0 28px 62px rgba(28, 50, 46, 0.24),
    0 9px 22px rgba(255, 255, 255, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(46, 84, 77, 0.1);
  backdrop-filter: blur(34px) saturate(1.55) contrast(1.03);
  -webkit-backdrop-filter: blur(34px) saturate(1.55) contrast(1.03);
}

body[data-page="island"] .island-status-panel::before {
  z-index: 0;
  inset: 1px;
  border-radius: 31px;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.72), transparent 30%),
    linear-gradient(292deg, transparent 56%, rgba(255, 234, 178, 0.22)),
    radial-gradient(circle at 82% 18%, rgba(111, 210, 195, 0.16), transparent 27%);
  opacity: 0.88;
}

body[data-page="island"] .island-status-panel::after {
  z-index: 0;
  inset: auto 42px 7px 42px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(22, 116, 105, 0.18), transparent);
  filter: blur(0.4px);
}

body[data-page="island"] .island-status-panel > * {
  position: relative;
  z-index: 1;
}

body[data-page="island"] .island-status-hud.dragging .island-status-panel {
  box-shadow:
    0 34px 72px rgba(28, 50, 46, 0.28),
    0 10px 24px rgba(255, 255, 255, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(46, 84, 77, 0.12);
  transform: translateY(-4px) scale(1.008);
}

body[data-page="island"] .island-status-panel-head {
  min-height: 76px;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  padding: 12px 13px;
  border: 0;
  border-radius: 25px;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255, 255, 255, 0.88), transparent 48%),
    radial-gradient(ellipse at 92% 25%, rgba(97, 199, 185, 0.28), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(221, 244, 239, 0.42) 58%, rgba(255, 250, 234, 0.34)),
    rgba(238, 248, 245, 0.52);
  box-shadow:
    0 12px 26px rgba(39, 61, 56, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(43, 77, 70, 0.08);
  backdrop-filter: blur(24px) saturate(1.42);
  -webkit-backdrop-filter: blur(24px) saturate(1.42);
}

body[data-page="island"] .island-status-panel-head::after {
  z-index: 0;
  inset: 1px;
  border-radius: 24px;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.6), transparent 28%),
    linear-gradient(300deg, transparent 64%, rgba(244, 221, 158, 0.18));
  opacity: 0.84;
}

body[data-page="island"] .island-status-title,
body[data-page="island"] .island-status-dropdown-button {
  position: relative;
  z-index: 1;
}

body[data-page="island"] .island-status-title {
  gap: 7px;
}

body[data-page="island"] .island-status-select-face {
  min-width: 59px;
  height: 24px;
  border: 0;
  background:
    radial-gradient(circle at 34% 12%, rgba(255, 255, 255, 0.92), transparent 38%),
    linear-gradient(180deg, rgba(255, 252, 235, 0.88), rgba(236, 214, 151, 0.62)),
    rgba(248, 239, 202, 0.62);
  color: #7b6125;
  box-shadow:
    0 7px 14px rgba(101, 82, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(126, 100, 42, 0.08);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="island"] .island-status-island-name {
  max-width: min(204px, calc(100% - 40px));
  color: var(--status-liquid-ink);
  font-size: 27px;
  line-height: 1.04;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(30, 56, 50, 0.1);
}

body[data-page="island"] .island-status-name-input {
  height: 34px;
  border: 0;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(232, 245, 241, 0.42)),
    rgba(255, 255, 255, 0.48);
  color: var(--status-liquid-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(39, 78, 70, 0.1),
    0 0 0 2px rgba(27, 134, 121, 0.14);
  text-shadow: none;
}

body[data-page="island"] .island-status-name-action,
body[data-page="island"] .island-status-rename-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 11px;
  background:
    radial-gradient(circle at 36% 14%, rgba(255, 255, 255, 0.9), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(231, 244, 240, 0.36)),
    rgba(255, 255, 255, 0.34);
  color: #246257;
  box-shadow:
    0 8px 16px rgba(40, 62, 57, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(55, 88, 80, 0.1);
}

body[data-page="island"] .island-status-name-action:hover,
body[data-page="island"] .island-status-rename-button:hover {
  background:
    radial-gradient(circle at 36% 14%, rgba(255, 255, 255, 0.96), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(231, 244, 240, 0.46)),
    rgba(255, 255, 255, 0.46);
  box-shadow:
    0 10px 20px rgba(40, 62, 57, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

body[data-page="island"] .island-status-rename-button::before {
  left: 10px;
  top: 7px;
  width: 4px;
  height: 15px;
  background: #2e625a;
  box-shadow: none;
}

body[data-page="island"] .island-status-rename-button::after {
  left: 15px;
  top: 19px;
  width: 8px;
  height: 2px;
  background: rgba(46, 98, 90, 0.72);
}

body[data-page="island"] .island-status-list {
  gap: 9px;
}

body[data-page="island"] .island-status-details-handle {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  justify-self: center;
  width: 96px;
  height: 22px;
  margin: -8px auto -7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

body[data-page="island"] .island-status-details-handle span {
  display: block;
  width: 52px;
  height: 5px;
  border-radius: 999px;
  background: rgba(42, 96, 88, 0.24);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    0 1px 4px rgba(44, 82, 76, 0.14);
  transition:
    width 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

body[data-page="island"] .island-status-details-handle:hover span,
body[data-page="island"] .island-status-details-handle:focus-visible span {
  width: 62px;
  background: rgba(25, 142, 132, 0.34);
}

body[data-page="island"] .island-status-hud.details-gesture-active .island-status-details-handle {
  cursor: grabbing;
}

body[data-page="island"] .island-status-hud.details-gesture-active .island-status-details-handle span {
  width: 66px;
  background: rgba(15, 118, 110, 0.42);
  transform: translateY(-1px);
}

body[data-page="island"] .island-status-hud.details-collapsed .island-status-list {
  display: none;
}

body[data-page="island"] .island-status-hud.details-collapsed .island-status-panel {
  gap: 6px;
}

body[data-page="island"] .island-status-hud.details-collapsed .island-status-details-handle {
  margin-top: -1px;
}

body[data-page="island"] .island-status-card,
body[data-page="island"] button.island-status-card {
  min-height: 70px;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 11px;
  padding: 9px 12px;
  border: 0;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, 0.9), transparent 44%),
    radial-gradient(ellipse at 92% 88%, rgba(118, 210, 196, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(239, 248, 244, 0.56)),
    rgba(250, 253, 250, 0.7);
  color: var(--status-liquid-ink);
  box-shadow:
    0 12px 26px rgba(40, 62, 57, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(65, 95, 88, 0.08);
  backdrop-filter: blur(18px) saturate(1.34);
  -webkit-backdrop-filter: blur(18px) saturate(1.34);
}

body[data-page="island"] .island-status-card::before {
  z-index: 0;
  inset: 1px;
  border-radius: 19px;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.58), transparent 31%),
    linear-gradient(300deg, transparent 70%, rgba(228, 204, 138, 0.12));
}

body[data-page="island"] .island-status-card::after {
  display: none;
}

body[data-page="island"] .island-status-card > * {
  position: relative;
  z-index: 1;
}

body[data-page="island"] .island-status-card.clickable:hover {
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, 0.96), transparent 44%),
    radial-gradient(ellipse at 92% 88%, rgba(118, 210, 196, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(239, 248, 244, 0.64)),
    rgba(250, 253, 250, 0.76);
  box-shadow:
    0 16px 30px rgba(40, 62, 57, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(65, 95, 88, 0.1);
  filter: none;
  transform: translateY(-1px);
}

body[data-page="island"] .island-status-metric-icon {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: #fff8e4;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body[data-page="island"] .island-status-metric-icon::after {
  content: none;
}

body[data-page="island"] .island-status-metric-icon img {
  filter:
    drop-shadow(0 2px 1px rgba(0, 27, 30, 0.16))
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.14));
}

body[data-page="island"] .island-status-metric-body {
  gap: 4px;
}

body[data-page="island"] .island-status-card span {
  color: var(--status-liquid-muted);
  font-size: 12px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.66);
}

body[data-page="island"] .island-status-card small {
  color: var(--status-liquid-teal);
  font-size: 12px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.64);
}

body[data-page="island"] .island-status-card strong {
  color: #173b3b;
  font-size: 22px;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.78),
    0 7px 14px rgba(24, 56, 51, 0.08);
}

body[data-page="island"] .island-status-card.value-long strong {
  font-size: 19px;
}

body[data-page="island"] .island-status-card.value-xlong strong {
  font-size: 17px;
}

body[data-page="island"] .island-status-track {
  height: 5px;
  background: rgba(38, 69, 63, 0.13);
  box-shadow:
    inset 0 1px 2px rgba(29, 57, 51, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.56);
}

body[data-page="island"] .island-status-track span {
  background: linear-gradient(90deg, #06917d, #53c898);
  box-shadow: 0 0 10px rgba(48, 186, 150, 0.24);
}

body[data-page="island"] .island-status-metric.warning .island-status-track span {
  background: linear-gradient(90deg, #d28a18, #ffc453);
  box-shadow: 0 0 10px rgba(238, 169, 42, 0.22);
}

body[data-page="island"] .island-status-metric.danger .island-status-track span {
  background: linear-gradient(90deg, #c34b45, #f08a76);
}

body[data-page="island"] .island-status-dropdown-button {
  width: 44px;
  height: 50px;
  border: 0;
  border-radius: 17px;
  background:
    radial-gradient(circle at 35% 13%, rgba(255, 255, 255, 0.88), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(218, 240, 234, 0.3)),
    rgba(255, 255, 255, 0.28);
  box-shadow:
    0 10px 20px rgba(40, 62, 57, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(55, 88, 80, 0.1);
}

body[data-page="island"] .island-status-dropdown-button::before,
body[data-page="island"] .island-status-dropdown-button::after {
  background: transparent;
}

body[data-page="island"] .island-status-dropdown-button::before {
  top: 48%;
  left: 50%;
  width: 15px;
  height: 15px;
  border-right: 5px solid #315f57;
  border-bottom: 5px solid #315f57;
  border-radius: 3px;
  transform: translate(-50%, -62%) rotate(45deg);
}

body[data-page="island"] .island-status-dropdown-button::after {
  display: none;
}

body[data-page="island"] .island-status-dropdown-button:hover {
  background:
    radial-gradient(circle at 35% 13%, rgba(255, 255, 255, 0.96), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(218, 240, 234, 0.38)),
    rgba(255, 255, 255, 0.4);
  box-shadow:
    0 12px 24px rgba(40, 62, 57, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

body[data-page="island"] .island-status-dropdown {
  top: calc(100% + 10px);
  z-index: 12;
  gap: 8px;
  padding: 11px;
  border: 0;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 16% 0%, rgba(255, 255, 255, 0.88), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(232, 246, 242, 0.64)),
    rgba(248, 252, 249, 0.76);
  color: var(--status-liquid-ink);
  box-shadow:
    0 24px 46px rgba(35, 55, 50, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(58, 91, 84, 0.08);
  backdrop-filter: blur(28px) saturate(1.46);
  -webkit-backdrop-filter: blur(28px) saturate(1.46);
}

body[data-page="island"] .island-status-panel,
body[data-page="island"] .island-status-panel-head {
  overflow: visible;
}

body[data-page="island"] .island-status-hud.dropdown-open .island-status-panel-head {
  z-index: 24;
}

body[data-page="island"] .island-status-hud.dropdown-open {
  z-index: 82;
}

body[data-page="island"] .island-status-hud.dropdown-open .island-status-dropdown {
  z-index: 30;
}

body[data-page="island"] .island-status-dropdown-item strong {
  color: #1f3d39;
}

body[data-page="island"] .island-status-dropdown-empty,
body[data-page="island"] .island-status-dropdown-item {
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(230, 243, 239, 0.34)),
    rgba(255, 255, 255, 0.32);
  color: var(--status-liquid-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(55, 88, 80, 0.08);
}

body[data-page="island"] .island-status-dropdown-empty {
  color: rgba(46, 64, 59, 0.64);
}

body[data-page="island"] .island-status-dropdown-item:hover {
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.8), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(223, 242, 237, 0.44)),
    rgba(255, 255, 255, 0.44);
}

body[data-page="island"] .island-status-dropdown-item span {
  color: var(--status-liquid-gold);
}

body[data-page="island"] .island-status-dropdown-item small {
  color: rgba(8, 127, 115, 0.76);
}

body[data-page="island"] .island-status-collapse-button::before {
  border: 1px solid rgba(151, 255, 222, 0.56);
  background:
    radial-gradient(circle at 35% 16%, rgba(229, 255, 246, 0.72), transparent 34%),
    linear-gradient(135deg, rgba(30, 170, 139, 0.96), rgba(8, 124, 111, 0.98) 58%, rgba(4, 68, 67, 0.98)),
    #087f73;
  box-shadow:
    0 10px 22px rgba(4, 77, 72, 0.26),
    0 0 0 1px rgba(201, 255, 236, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -10px 18px rgba(0, 45, 42, 0.22);
  backdrop-filter: blur(16px) saturate(1.32);
  -webkit-backdrop-filter: blur(16px) saturate(1.32);
  opacity: 1;
}

body[data-page="island"] .island-status-collapse-button::after {
  filter: drop-shadow(0 1px 4px rgba(0, 52, 48, 0.28));
}

@media (max-width: 640px) {
  body[data-page="island"] .island-status-hud,
  body[data-page="island"] .island-status-hud.custom-positioned {
    width: min(322px, calc(100vw - 24px));
  }

  body[data-page="island"] .island-status-panel {
    border-radius: 28px;
    padding: 11px;
  }

  body[data-page="island"] .island-status-panel-head {
    min-height: 74px;
    border-radius: 22px;
  }

  body[data-page="island"] .island-status-island-name {
    font-size: 25px;
  }

  body[data-page="island"] .island-status-card,
  body[data-page="island"] button.island-status-card {
    min-height: 68px;
    grid-template-columns: 54px minmax(0, 1fr);
  }
}

/* Mailbox glass archive modal */
body.mailbox-modal-open {
  overflow: hidden;
}

.mailbox-popover {
  border: 1px solid rgba(255, 255, 255, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 240, 229, 0.78)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 58px rgba(26, 36, 38, 0.2);
  backdrop-filter: blur(22px) saturate(150%);
}

.mailbox-preview-item {
  border-color: rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.mailbox-modal-backdrop {
  position: fixed;
  z-index: calc(var(--global-hud-z) + 160);
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 24px;
  background: rgba(12, 18, 22, 0.52);
  backdrop-filter: blur(18px) saturate(138%);
}

.mailbox-modal-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(1480px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(237, 234, 222, 0.72)),
    rgba(246, 242, 232, 0.72);
  box-shadow: 0 38px 96px rgba(4, 11, 14, 0.34);
  color: #17262c;
  backdrop-filter: blur(26px) saturate(150%);
}

.mailbox-modal-close {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  color: #17262c;
  font-size: 26px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.mailbox-modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  min-height: 118px;
  padding: 24px 72px 22px 28px;
  border-bottom: 1px solid rgba(221, 205, 171, 0.28);
  background:
    linear-gradient(120deg, rgba(17, 42, 45, 0.96), rgba(59, 73, 57, 0.86)),
    rgba(20, 43, 45, 0.92);
  color: #fff7e7;
}

.mailbox-modal-head span,
.mailbox-modal-toolbar span,
.mailbox-modal-detail-kicker,
.mailbox-action-confirm span,
.mailbox-modal-detail-empty span {
  display: block;
  color: #d9b95f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mailbox-modal-head h2 {
  margin: 6px 0 0;
  color: #fffaf0;
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 600;
  line-height: 0.98;
}

.mailbox-modal-summary {
  display: grid;
  min-width: 128px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  text-align: right;
}

.mailbox-modal-summary strong {
  color: #fffaf0;
  font-size: 38px;
  line-height: 1;
}

.mailbox-modal-summary span {
  color: rgba(255, 250, 240, 0.7);
  font-size: 13px;
  font-weight: 800;
}

.mailbox-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid rgba(34, 50, 48, 0.12);
  background: rgba(255, 255, 255, 0.26);
}

.mailbox-modal-stats div {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 16px 20px;
  border-right: 1px solid rgba(34, 50, 48, 0.1);
}

.mailbox-modal-stats div:last-child {
  border-right: 0;
}

.mailbox-modal-stats span {
  color: #687675;
  font-size: 13px;
  font-weight: 800;
}

.mailbox-modal-stats strong {
  color: #11282d;
  font-size: 28px;
  line-height: 1;
}

.mailbox-modal-body {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 370px;
  min-height: 0;
}

.mailbox-modal-rail {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  border-right: 1px solid rgba(34, 50, 48, 0.12);
}

.mailbox-modal-category {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgba(32, 55, 55, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
  color: #20363a;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.mailbox-modal-category span {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 900;
}

.mailbox-modal-category strong {
  color: #153b3e;
  font-size: 18px;
}

.mailbox-modal-category em {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 19px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.mailbox-modal-category.active {
  border-color: rgba(19, 107, 102, 0.34);
  background: linear-gradient(135deg, rgba(14, 105, 100, 0.96), rgba(45, 92, 82, 0.9));
  color: #fffaf0;
  box-shadow: 0 14px 28px rgba(15, 72, 69, 0.22);
}

.mailbox-modal-category.active strong {
  color: #fffaf0;
}

.mailbox-modal-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border-right: 1px solid rgba(34, 50, 48, 0.12);
}

.mailbox-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 80px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(34, 50, 48, 0.1);
}

.mailbox-modal-toolbar strong {
  display: block;
  margin-top: 5px;
  color: #152a30;
  font-size: 26px;
  line-height: 1;
}

.mailbox-modal-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mailbox-modal-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 22px;
}

.mailbox-modal-group {
  margin-top: 6px;
  color: #687675;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.mailbox-modal-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  min-height: 102px;
  width: 100%;
  padding: 14px 16px 14px 18px;
  border: 1px solid rgba(32, 55, 55, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: #17262c;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.mailbox-modal-item::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 8px;
  width: 4px;
  height: calc(100% - 32px);
  border-radius: 999px;
  background: transparent;
}

.mailbox-modal-item.unread::before {
  background: #0f766e;
}

.mailbox-modal-item.selected {
  border-color: rgba(15, 107, 102, 0.48);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(235, 228, 207, 0.72)),
    rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 36px rgba(21, 47, 46, 0.14);
}

.mailbox-modal-item-type {
  width: fit-content;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 107, 102, 0.1);
  color: #0f6b66;
  font-size: 12px;
  font-weight: 900;
}

.mailbox-modal-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #14272d;
  font-size: 20px;
  line-height: 1.18;
}

.mailbox-modal-item small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #637372;
  font-size: 14px;
  line-height: 1.4;
}

.mailbox-modal-item time {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: start;
  color: #687675;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.mailbox-modal-detail {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 22px;
  background: rgba(22, 41, 39, 0.08);
}

.mailbox-modal-detail h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: #13272c;
  font-size: 32px;
  line-height: 1.06;
}

.mailbox-modal-detail p {
  margin: 0;
  color: #435554;
  font-size: 16px;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.mailbox-modal-dossier {
  display: grid;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(32, 55, 55, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.44);
}

.mailbox-modal-dossier div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  border-bottom: 1px solid rgba(32, 55, 55, 0.1);
}

.mailbox-modal-dossier div:last-child {
  border-bottom: 0;
}

.mailbox-modal-dossier dt,
.mailbox-modal-dossier dd {
  margin: 0;
  padding: 12px;
  overflow-wrap: anywhere;
}

.mailbox-modal-dossier dt {
  color: #7a6d4a;
  font-weight: 900;
}

.mailbox-modal-dossier dd {
  color: #17262c;
  font-weight: 800;
}

.mailbox-modal-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mailbox-modal-detail-empty {
  display: grid;
  gap: 8px;
  min-height: 180px;
  padding: 22px;
  border: 1px solid rgba(32, 55, 55, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
}

.mailbox-modal-detail-empty strong {
  color: #17262c;
  font-size: 28px;
}

.mailbox-action-confirm-layer {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 22, 24, 0.34);
  backdrop-filter: blur(12px) saturate(130%);
}

.mailbox-action-confirm {
  display: grid;
  gap: 12px;
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(244, 239, 225, 0.86)),
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 28px 68px rgba(0, 0, 0, 0.26);
}

.mailbox-action-confirm h3 {
  margin: 0;
  color: #162a2f;
  font-size: 26px;
  line-height: 1.12;
}

.mailbox-action-confirm p {
  margin: 0;
  color: #50605e;
  line-height: 1.56;
}

.mailbox-action-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mailbox-action-confirm .danger,
.mailbox-modal-detail-actions .danger {
  border-color: rgba(172, 43, 32, 0.42);
  background: #b42318;
  color: #fff;
}

@media (max-width: 1080px) {
  .mailbox-modal-body {
    grid-template-columns: 164px minmax(0, 1fr) 320px;
  }

  .mailbox-modal-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mailbox-modal-toolbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .mailbox-modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .mailbox-modal-shell {
    width: 100%;
    height: min(92vh, 860px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }

  .mailbox-modal-head {
    min-height: 96px;
    padding: 18px 64px 16px 18px;
  }

  .mailbox-modal-head h2 {
    font-size: 34px;
  }

  .mailbox-modal-summary {
    min-width: 86px;
    padding: 10px 12px;
  }

  .mailbox-modal-summary strong {
    font-size: 28px;
  }

  .mailbox-modal-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mailbox-modal-stats div {
    min-height: 62px;
    padding: 10px 12px;
  }

  .mailbox-modal-stats strong {
    font-size: 22px;
  }

  .mailbox-modal-body {
    display: grid;
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .mailbox-modal-rail {
    grid-auto-columns: max-content;
    grid-auto-flow: column;
    gap: 8px;
    overflow-x: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(34, 50, 48, 0.12);
  }

  .mailbox-modal-category {
    min-width: 128px;
  }

  .mailbox-modal-main {
    border-right: 0;
  }

  .mailbox-modal-toolbar {
    min-height: 0;
    padding: 14px 12px;
  }

  .mailbox-modal-toolbar strong {
    font-size: 22px;
  }

  .mailbox-modal-toolbar-actions {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .mailbox-modal-toolbar-actions button {
    flex: 0 0 auto;
  }

  .mailbox-modal-list {
    max-height: 42vh;
    padding: 12px;
  }

  .mailbox-modal-item {
    min-height: 112px;
    padding: 12px 12px 12px 18px;
  }

  .mailbox-modal-item strong {
    font-size: 18px;
  }

  .mailbox-modal-item time {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .mailbox-modal-detail {
    position: sticky;
    bottom: 0;
    z-index: 2;
    max-height: 42vh;
    padding: 16px;
    border-top: 1px solid rgba(34, 50, 48, 0.14);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(241, 236, 221, 0.84)),
      rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px) saturate(140%);
  }

  .mailbox-modal-detail h3 {
    font-size: 25px;
  }

  .mailbox-modal-dossier div {
    grid-template-columns: 82px minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .mailbox-modal-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .mailbox-modal-summary {
    display: none;
  }

  .mailbox-modal-stats span {
    font-size: 12px;
  }

  .mailbox-modal-stats strong {
    font-size: 20px;
  }

  .mailbox-modal-list {
    max-height: 40vh;
  }

  .mailbox-action-confirm-actions,
  .mailbox-modal-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Exchange page: Apple-style liquid glass trading desk. */
body[data-page="exchange"] {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 28%),
    radial-gradient(circle at 82% 9%, rgba(168, 222, 210, 0.34), rgba(168, 222, 210, 0) 31%),
    linear-gradient(135deg, #f8fbf6 0%, #edf6f1 42%, #f8f0df 100%);
}

body[data-page="exchange"] #exchangePage > section {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: clamp(10px, 1.5vw, 18px);
}

body[data-page="exchange"] .exchange-terminal {
  --exchange-bg: rgba(244, 251, 246, 0.76);
  --exchange-panel: rgba(255, 255, 255, 0.56);
  --exchange-panel-soft: rgba(246, 253, 249, 0.44);
  --exchange-line: rgba(36, 61, 55, 0.12);
  --exchange-text: #213b37;
  --exchange-muted: rgba(38, 61, 57, 0.62);
  --exchange-green: #087d67;
  --exchange-red: #be535e;
  --exchange-blue: #4f8fb8;
  --exchange-gold: #bf8b24;
  --exchange-price-neutral: #203c38;
  --exchange-price-high: #9a6817;
  --exchange-price-extreme-high: #b24d58;
  --exchange-price-low: #236c4e;
  --exchange-price-extreme-low: #04795d;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(233, 249, 244, 0.48) 44%, rgba(255, 246, 225, 0.54)),
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 86% 16%, rgba(83, 177, 157, 0.2), rgba(83, 177, 157, 0) 34%);
  border: 0;
  border-radius: 30px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(40, 68, 63, 0.08),
    0 28px 72px rgba(44, 74, 68, 0.15),
    0 2px 8px rgba(44, 74, 68, 0.08);
  color: var(--exchange-text);
  isolation: isolate;
  overflow: visible;
  padding: clamp(12px, 1.4vw, 18px);
  position: relative;
  -webkit-backdrop-filter: blur(34px) saturate(1.45);
  backdrop-filter: blur(34px) saturate(1.45);
}

body[data-page="exchange"] .exchange-terminal::before {
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 18%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

body[data-page="exchange"] .exchange-terminal select,
body[data-page="exchange"] .exchange-terminal input,
body[data-page="exchange"] .exchange-terminal textarea {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(238, 249, 245, 0.58)),
    rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(34, 61, 57, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 1px 0 rgba(255, 255, 255, 0.54);
  color: var(--exchange-text);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

body[data-page="exchange"] .exchange-terminal select:focus,
body[data-page="exchange"] .exchange-terminal input:focus,
body[data-page="exchange"] .exchange-terminal textarea:focus {
  border-color: rgba(8, 125, 103, 0.36);
  box-shadow:
    0 0 0 4px rgba(8, 125, 103, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  outline: none;
}

body[data-page="exchange"] .exchange-terminal .empty-state,
body[data-page="exchange"] .exchange-my-orders-empty {
  background: rgba(255, 255, 255, 0.34);
  border: 1px dashed rgba(36, 61, 55, 0.16);
  color: rgba(38, 61, 57, 0.56);
}

body[data-page="exchange"] .exchange-desk-board,
body[data-page="exchange"] .exchange-pair-card,
body[data-page="exchange"] .exchange-selector-strip,
body[data-page="exchange"] .exchange-ticker-metrics,
body[data-page="exchange"] .exchange-panel,
body[data-page="exchange"] .exchange-product-selector-modal,
body[data-page="exchange"] .exchange-order-confirm-modal,
body[data-page="exchange"] .exchange-trade-history-modal {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(235, 249, 244, 0.46) 56%, rgba(255, 248, 232, 0.48)),
    rgba(255, 255, 255, 0.42);
  border: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(34, 61, 57, 0.07),
    0 18px 46px rgba(42, 72, 66, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.58);
  color: var(--exchange-text);
  -webkit-backdrop-filter: blur(28px) saturate(1.38);
  backdrop-filter: blur(28px) saturate(1.38);
}

body[data-page="exchange"] .exchange-desk-board {
  border-radius: 26px;
  margin-bottom: 14px;
  overflow: visible;
  position: relative;
  z-index: 20;
}

body[data-page="exchange"] .exchange-desk-board.select-open,
body[data-page="exchange"] .exchange-terminal-header.select-open {
  z-index: 240;
}

body[data-page="exchange"] .exchange-desk-toolbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(240, 249, 245, 0.34)),
    rgba(255, 255, 255, 0.28);
  border-bottom: 1px solid rgba(34, 61, 57, 0.08);
  overflow: visible;
}

body[data-page="exchange"] .exchange-desk-exchange-picker {
  border-right: 1px solid rgba(34, 61, 57, 0.08);
  min-height: 64px;
}

body[data-page="exchange"] .exchange-desk-exchange-picker span {
  color: rgba(41, 64, 60, 0.62);
  font-size: 12px;
  letter-spacing: 0.04em;
}

body[data-page="exchange"] .exchange-desk-exchange-picker select {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(238, 250, 246, 0.58)),
    rgba(255, 255, 255, 0.48);
  border: 0;
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 8px 20px rgba(42, 72, 66, 0.08);
  color: #173430;
  min-height: 42px;
}

body[data-page="exchange"] .exchange-desk-tabs {
  gap: 6px;
  padding: 8px;
}

body[data-page="exchange"] .exchange-desk-tabs button {
  background: transparent;
  border: 0;
  border-radius: 18px;
  color: rgba(35, 58, 54, 0.58);
  font-size: 19px;
  min-height: 48px;
  transition: background 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

body[data-page="exchange"] .exchange-desk-tabs button:hover {
  background: rgba(255, 255, 255, 0.34);
  color: rgba(28, 50, 46, 0.86);
}

body[data-page="exchange"] .exchange-desk-tabs button.selected {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(240, 250, 246, 0.54));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 10px 24px rgba(42, 72, 66, 0.1);
  color: #173430;
}

body[data-page="exchange"] .exchange-desk-tabs button span:first-child {
  color: inherit;
}

body[data-page="exchange"] .exchange-desk-cargo {
  gap: clamp(14px, 1.8vw, 22px);
  padding: clamp(14px, 1.8vw, 22px);
}

body[data-page="exchange"] .exchange-desk-cargo-panel {
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.54), rgba(235, 250, 245, 0.34)),
    rgba(255, 255, 255, 0.28);
  border: 0;
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 28px rgba(42, 72, 66, 0.08);
  padding-bottom: 14px;
}

body[data-page="exchange"] .exchange-desk-select-bar {
  background:
    linear-gradient(180deg, rgba(8, 125, 103, 0.88), rgba(13, 96, 84, 0.82));
  border: 0;
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 10px 20px rgba(8, 125, 103, 0.18);
  color: #fffdf3;
  font-size: 20px;
}

body[data-page="exchange"] .exchange-desk-select-bar.muted {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(236, 249, 245, 0.58)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(42, 72, 66, 0.08);
  color: rgba(20, 50, 46, 0.78);
}

body[data-page="exchange"] .exchange-desk-select-bar.muted:disabled {
  color: #173430;
  opacity: 1;
}

body[data-page="exchange"] .exchange-desk-warehouse-title {
  display: grid;
  column-gap: 8px;
  row-gap: 6px;
  grid-template-columns: max-content minmax(106px, 132px);
  justify-content: start;
  min-width: 0;
  max-width: 100%;
  width: min(360px, 100%);
}
body[data-page="exchange"] .exchange-desk-warehouse-title .exchange-desk-warehouse-picker {
  grid-column: 1 / -1;
}

body[data-page="exchange"] .exchange-desk-warehouse-title > small {
  align-self: center;
  grid-column: 1;
  margin-top: 0;
  white-space: nowrap;
}

body[data-page="exchange"] .exchange-desk-warehouse-category-filter {
  align-self: center;
  display: block;
  grid-column: 2;
  justify-self: start;
  min-width: 0;
  width: min(132px, 100%);
}
body[data-page="exchange"] .exchange-desk-ship-title {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  width: min(300px, 100%);
}

body[data-page="exchange"] .exchange-desk-ship-title {
  width: min(280px, 100%);
}

body[data-page="exchange"] .exchange-desk-ship-location {
  align-items: center;
  color: rgba(43, 60, 56, 0.74);
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  gap: 6px;
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.54);
  white-space: nowrap;
}

body[data-page="exchange"] .exchange-desk-ship-location > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="exchange"] .exchange-desk-ship-location .fleet-location-pin {
  flex-basis: 21px;
  height: 21px;
  width: 21px;
}

body[data-page="exchange"] .exchange-desk-warehouse-picker,
body[data-page="exchange"] .exchange-desk-ship-picker {
  display: block;
  min-width: 0;
  width: 100%;
}

body[data-page="exchange"] .exchange-desk-ship-empty-picker {
  align-items: center;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(236, 249, 245, 0.58)),
    rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(34, 61, 57, 0.07),
    0 9px 20px rgba(42, 72, 66, 0.08);
  color: rgba(23, 52, 48, 0.58);
  display: flex;
  font-size: 21px;
  font-weight: 950;
  min-height: 50px;
  padding: 0 16px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  backdrop-filter: blur(20px) saturate(1.25);
}

body[data-page="exchange"] .exchange-glass-select {
  min-width: 0;
  position: relative;
  width: 100%;
  z-index: 3;
}

body[data-page="exchange"] .exchange-glass-select.open {
  z-index: 140;
}

body[data-page="exchange"] .exchange-glass-select-native {
  height: 1px !important;
  inset: 50% auto auto 50% !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 1px !important;
}

body[data-page="exchange"] .exchange-glass-select-button {
  align-items: center;
  appearance: none;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(236, 249, 245, 0.58)),
    rgba(255, 255, 255, 0.5);
  border: 0;
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(34, 61, 57, 0.07),
    0 9px 20px rgba(42, 72, 66, 0.08);
  color: #173430;
  display: grid;
  font: inherit;
  font-size: 17px;
  font-weight: 950;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 18px;
  min-height: 42px;
  padding: 0 14px 0 16px;
  position: relative;
  text-align: left;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.58);
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
  width: 100%;
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  backdrop-filter: blur(20px) saturate(1.25);
}

body[data-page="exchange"] .exchange-glass-select-button:hover,
body[data-page="exchange"] .exchange-glass-select-button:focus-visible,
body[data-page="exchange"] .exchange-glass-select.open .exchange-glass-select-button {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(232, 250, 245, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 0 0 4px rgba(8, 125, 103, 0.08),
    0 14px 28px rgba(42, 72, 66, 0.13);
  color: #082d28;
  outline: 0;
}

body[data-page="exchange"] .exchange-glass-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="exchange"] .exchange-glass-select-chevron {
  height: 9px;
  justify-self: center;
  position: relative;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.18s ease;
  width: 9px;
}

body[data-page="exchange"] .exchange-glass-select-chevron::before {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  inset: 0;
  opacity: 0.82;
  position: absolute;
}

body[data-page="exchange"] .exchange-glass-select.open .exchange-glass-select-chevron {
  transform: translateY(2px) rotate(225deg);
}

body[data-page="exchange"] .exchange-glass-select-menu {
  background:
    radial-gradient(circle at 22% 0%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(232, 250, 245, 0.7) 54%, rgba(255, 248, 232, 0.72)),
    rgba(250, 253, 250, 0.72);
  border: 0;
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(34, 61, 57, 0.08),
    0 24px 52px rgba(35, 62, 56, 0.18),
    0 7px 18px rgba(35, 62, 56, 0.1);
  display: grid;
  gap: 4px;
  left: 0;
  max-height: min(320px, calc(100vh - var(--global-topbar-height) - 48px));
  min-width: 100%;
  opacity: 0;
  overflow: auto;
  padding: 7px;
  pointer-events: none;
  position: absolute;
  right: 0;
  scrollbar-color: rgba(8, 125, 103, 0.28) rgba(255, 255, 255, 0.28);
  scrollbar-width: thin;
  top: calc(100% + 8px);
  transform: translateY(-5px) scale(0.985);
  transform-origin: top center;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
  visibility: hidden;
  width: max(100%, 220px);
  -webkit-backdrop-filter: blur(30px) saturate(1.42);
  backdrop-filter: blur(30px) saturate(1.42);
}

body[data-page="exchange"] .exchange-desk-exchange-picker .exchange-glass-select-menu {
  width: max(100%, 260px);
}

body[data-page="exchange"] .exchange-desk-warehouse-picker .exchange-glass-select-button,
body[data-page="exchange"] .exchange-desk-ship-picker .exchange-glass-select-button {
  min-height: 50px;
  border-radius: 20px;
  font-size: 21px;
  font-weight: 950;
  padding-left: 16px;
}

body[data-page="exchange"] .exchange-desk-warehouse-picker .exchange-glass-select-menu,
body[data-page="exchange"] .exchange-desk-ship-picker .exchange-glass-select-menu {
  width: max(100%, 280px);
}

body[data-page="exchange"] .exchange-desk-warehouse-category-filter .exchange-glass-select-button,
body[data-page="exchange"] .exchange-desk-warehouse-category-filter select {
  border-radius: 15px;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 12px;
  min-height: 34px;
  padding: 0 10px 0 12px;
}

body[data-page="exchange"] .exchange-desk-warehouse-category-filter .exchange-glass-select-chevron {
  height: 7px;
  width: 7px;
}

body[data-page="exchange"] .exchange-desk-warehouse-category-filter .exchange-glass-select-menu {
  width: max(100%, 176px);
}

body[data-page="exchange"] .exchange-desk-warehouse-category-filter .exchange-glass-select-option {
  border-radius: 12px;
  font-size: 14px;
  min-height: 36px;
}
body[data-page="exchange"] .exchange-glass-select.open .exchange-glass-select-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}

body[data-page="exchange"] .exchange-glass-select-option {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 14px;
  color: rgba(20, 50, 46, 0.82);
  cursor: pointer;
  display: grid;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  grid-template-columns: minmax(0, 1fr) 20px;
  min-height: 42px;
  padding: 0 11px 0 13px;
  position: relative;
  text-align: left;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  transition:
    background 0.14s ease,
    box-shadow 0.14s ease,
    color 0.14s ease,
    transform 0.14s ease;
  width: 100%;
}

body[data-page="exchange"] .exchange-glass-select-option:hover,
body[data-page="exchange"] .exchange-glass-select-option:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(235, 250, 245, 0.46));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: #082d28;
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="exchange"] .exchange-glass-select-option[aria-selected="true"] {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(9, 119, 101, 0.94), rgba(7, 82, 74, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 8px 18px rgba(7, 82, 74, 0.16);
  color: #fffdf4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

body[data-page="exchange"] .exchange-glass-select-option[aria-selected="true"]::after {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  height: 10px;
  justify-self: center;
  margin-top: -4px;
  opacity: 0.9;
  transform: rotate(45deg);
  width: 6px;
}

body[data-page="exchange"] .exchange-glass-select-option:disabled {
  color: rgba(34, 61, 57, 0.28);
  cursor: default;
}

body[data-page="exchange"] .exchange-desk-ship-tabs-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 14px 14px 12px;
  min-width: 0;
  position: relative;
}

body[data-page="exchange"] .exchange-desk-ship-tabs-shell.has-overflow {
  grid-template-columns: 42px minmax(0, 1fr) 42px;
}

body[data-page="exchange"] .exchange-desk-ship-tabs {
  display: flex;
  gap: 8px;
  min-height: 56px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 7px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(235, 249, 245, 0.34)),
    rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 10px 24px rgba(42, 72, 66, 0.07);
  scroll-padding: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-backdrop-filter: blur(20px) saturate(1.28);
  backdrop-filter: blur(20px) saturate(1.28);
}

body[data-page="exchange"] .exchange-desk-ship-tabs-shell.has-overflow .exchange-desk-ship-tabs {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

body[data-page="exchange"] .exchange-desk-ship-tabs::-webkit-scrollbar {
  display: none;
}

body[data-page="exchange"] .exchange-desk-ship-scroll {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(235, 249, 245, 0.52)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 22px rgba(42, 72, 66, 0.1);
  color: rgba(16, 55, 50, 0.72);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  padding: 0 0 4px;
  -webkit-backdrop-filter: blur(18px) saturate(1.22);
  backdrop-filter: blur(18px) saturate(1.22);
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

body[data-page="exchange"] .exchange-desk-ship-scroll:hover,
body[data-page="exchange"] .exchange-desk-ship-scroll:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(229, 248, 243, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 13px 26px rgba(42, 72, 66, 0.14);
  color: #0d7569;
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="exchange"] .exchange-desk-ship-tabs button {
  flex: 1 0 max(142px, calc((100% - 16px) / 3));
  min-height: 42px;
  min-width: 0;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(237, 249, 245, 0.42));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  color: rgba(21, 48, 44, 0.72);
  font-size: 18px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  scroll-snap-align: center;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

body[data-page="exchange"] .exchange-desk-ship-tabs-shell.has-overflow .exchange-desk-ship-tabs button {
  flex-grow: 0;
}

body[data-page="exchange"] .exchange-desk-ship-tabs button:first-child,
body[data-page="exchange"] .exchange-desk-ship-tabs button:last-child {
  border-radius: 16px;
}

body[data-page="exchange"] .exchange-desk-ship-tabs button:not(.selected):hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(233, 249, 244, 0.58));
  color: #173430;
  transform: translateY(-1px);
}

body[data-page="exchange"] .exchange-desk-ship-tabs button.selected {
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(9, 119, 101, 0.94), rgba(7, 82, 74, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 10px 22px rgba(7, 82, 74, 0.18);
  color: #fffdf4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

body[data-page="exchange"] .exchange-desk-panel-head strong,
body[data-page="exchange"] .exchange-desk-record-section-head strong,
body[data-page="exchange"] .exchange-panel-head strong,
body[data-page="exchange"] .exchange-my-orders-head strong,
body[data-page="exchange"] .exchange-order-confirm-head strong,
body[data-page="exchange"] .exchange-trade-history-modal-head strong {
  color: #173430;
}

body[data-page="exchange"] .exchange-desk-panel-head small,
body[data-page="exchange"] .exchange-desk-record-section-head small,
body[data-page="exchange"] .exchange-panel-head small,
body[data-page="exchange"] .exchange-my-orders-head small,
body[data-page="exchange"] .exchange-order-confirm-head small,
body[data-page="exchange"] .exchange-trade-history-modal-head small {
  color: var(--exchange-muted);
}

body[data-page="exchange"] .exchange-desk-capacity {
  color: #a66b0c;
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1;
  min-height: 50px;
  min-width: 190px;
  padding: 0 10px;
}

body[data-page="exchange"] .exchange-desk-capacity.warning {
  color: #a0790b;
}

body[data-page="exchange"] .exchange-desk-capacity.danger {
  color: var(--exchange-red);
}

body[data-page="exchange"] .exchange-desk-track,
body[data-page="exchange"] .exchange-order-confirm-amount-slider::-webkit-slider-runnable-track {
  background: rgba(26, 60, 53, 0.12);
  box-shadow: inset 0 1px 2px rgba(34, 61, 57, 0.08);
}

body[data-page="exchange"] .exchange-desk-track span {
  background: linear-gradient(90deg, #f4bc4f, #d89617);
}

body[data-page="exchange"] .exchange-desk-track.ship span {
  background: linear-gradient(90deg, rgba(90, 151, 184, 0.72), rgba(115, 172, 201, 0.56));
}

body[data-page="exchange"] .exchange-desk-table-head,
body[data-page="exchange"] .exchange-book-labels,
body[data-page="exchange"] .exchange-trade-labels,
body[data-page="exchange"] .exchange-product-selector-labels,
body[data-page="exchange"] .exchange-my-order-labels {
  background: transparent;
  border-color: rgba(34, 61, 57, 0.08);
  color: rgba(41, 64, 60, 0.52);
}

body[data-page="exchange"] .exchange-desk-list {
  scrollbar-color: rgba(8, 125, 103, 0.28) rgba(255, 255, 255, 0.28);
}

body[data-page="exchange"] .exchange-desk-record-section-head,
body[data-page="exchange"] .exchange-panel-head,
body[data-page="exchange"] .exchange-my-orders-panel,
body[data-page="exchange"] .exchange-mid-price,
body[data-page="exchange"] .exchange-product-selector-head,
body[data-page="exchange"] .exchange-product-selector-toolbar,
body[data-page="exchange"] .exchange-order-confirm-head,
body[data-page="exchange"] .exchange-trade-history-modal-head {
  border-color: rgba(34, 61, 57, 0.08);
}

body[data-page="exchange"] .exchange-desk-row {
  border-top: 1px solid rgba(34, 61, 57, 0.07);
  color: var(--exchange-text);
  transition: background 160ms ease, transform 160ms ease;
}

body[data-page="exchange"] .exchange-desk-row:hover,
body[data-page="exchange"] .exchange-product-selector-row:hover,
body[data-page="exchange"] .exchange-book-row:hover,
body[data-page="exchange"] .exchange-terminal-trade:hover {
  background: rgba(255, 255, 255, 0.34);
}

body[data-page="exchange"] .exchange-desk-row > span,
body[data-page="exchange"] .exchange-desk-product.tier-1 strong,
body[data-page="exchange"] .exchange-desk-transfer strong,
body[data-page="exchange"] .exchange-book-amount,
body[data-page="exchange"] .exchange-ticket-preview .stat-row strong,
body[data-page="exchange"] .exchange-my-order-row > span:nth-child(3),
body[data-page="exchange"] .exchange-terminal .exchange-record-product-copy strong {
  color: var(--exchange-text);
}

body[data-page="exchange"] .exchange-desk-product-icon,
body[data-page="exchange"] .exchange-pair-icon,
body[data-page="exchange"] .exchange-product-selector-icon,
body[data-page="exchange"] .exchange-record-product-icon {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(230, 248, 243, 0.54)),
    rgba(255, 255, 255, 0.46);
  border: 0;
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(34, 61, 57, 0.08),
    0 8px 18px rgba(42, 72, 66, 0.1);
  color: var(--exchange-gold);
}

body[data-page="exchange"] .exchange-desk-product-icon .product-icon-image,
body[data-page="exchange"] .exchange-pair-icon .product-icon-image,
body[data-page="exchange"] .exchange-product-selector-icon .product-icon-image,
body[data-page="exchange"] .exchange-record-product-icon .product-icon-image {
  border-radius: 12px;
  object-fit: contain;
}

body[data-page="exchange"] .exchange-desk-product strong,
body[data-page="exchange"] .exchange-book-player-name,
body[data-page="exchange"] .exchange-book-trader .inline-player-link,
body[data-page="exchange"] .exchange-trade-player-name,
body[data-page="exchange"] .exchange-trade-party .inline-player-link {
  color: #136f80;
}

body[data-page="exchange"] .exchange-desk-product.tier-2 strong {
  color: #177d54;
}

body[data-page="exchange"] .exchange-desk-product.tier-3 strong {
  color: #226f9e;
}

body[data-page="exchange"] .exchange-desk-product.tier-4 strong {
  color: #926095;
}

body[data-page="exchange"] .exchange-desk-product small,
body[data-page="exchange"] .exchange-desk-transfer small,
body[data-page="exchange"] .exchange-product-selector-product small,
body[data-page="exchange"] .exchange-product-selector-volume small,
body[data-page="exchange"] .exchange-product-selector-stock small,
body[data-page="exchange"] .exchange-record-product-copy small,
body[data-page="exchange"] .exchange-book-weight,
body[data-page="exchange"] .exchange-terminal-trade .exchange-trade-time,
body[data-page="exchange"] .exchange-terminal .job-detail {
  color: rgba(38, 61, 57, 0.55);
}

body[data-page="exchange"] .exchange-desk-row-button,
body[data-page="exchange"] .exchange-desk-arrow,
body[data-page="exchange"] .exchange-desk-transfer-confirm,
body[data-page="exchange"] .exchange-desk-transfer-cancel,
body[data-page="exchange"] .exchange-history-more-button,
body[data-page="exchange"] .exchange-history-close-button,
body[data-page="exchange"] .mini-link-button,
body[data-page="exchange"] .exchange-my-order-cancel,
body[data-page="exchange"] .exchange-record-cancel,
body[data-page="exchange"] .exchange-terminal button.secondary,
body[data-page="exchange"] .exchange-product-selector-close {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(233, 247, 243, 0.55));
  border: 0;
  border-radius: 15px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 7px 16px rgba(42, 72, 66, 0.1);
  color: #243d39;
}

body[data-page="exchange"] .exchange-desk-row-button:hover,
body[data-page="exchange"] .exchange-desk-arrow:hover,
body[data-page="exchange"] .mini-link-button:hover,
body[data-page="exchange"] .exchange-history-more-button:hover,
body[data-page="exchange"] .exchange-history-close-button:hover,
body[data-page="exchange"] .exchange-product-selector-close:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(229, 250, 244, 0.68));
  color: #082d28;
  transform: translateY(-1px);
}

body[data-page="exchange"] .exchange-desk-row-button:disabled,
body[data-page="exchange"] .exchange-desk-arrow:disabled,
body[data-page="exchange"] button:disabled {
  color: rgba(34, 61, 57, 0.26);
  opacity: 0.58;
  transform: none;
}

body[data-page="exchange"] .exchange-desk-transfer {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(230, 250, 245, 0.42));
  border: 0;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: var(--exchange-muted);
}

body[data-page="exchange"] .exchange-desk-transfer.unload {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(230, 244, 252, 0.48));
}

body[data-page="exchange"] .exchange-desk-transfer input[type="range"] {
  accent-color: var(--exchange-gold);
}

body[data-page="exchange"] .exchange-desk-transfer.unload input[type="range"] {
  accent-color: var(--exchange-blue);
}

body[data-page="exchange"] .exchange-terminal-header,
body[data-page="exchange"] .exchange-terminal-grid {
  gap: clamp(10px, 1.2vw, 14px);
  position: relative;
}

body[data-page="exchange"] .exchange-terminal-header {
  z-index: 30;
}

body[data-page="exchange"] .exchange-terminal-grid {
  z-index: 10;
}

body[data-page="exchange"] .exchange-pair-card,
body[data-page="exchange"] .exchange-selector-strip,
body[data-page="exchange"] .exchange-ticker-metrics,
body[data-page="exchange"] .exchange-panel {
  border-radius: 22px;
}

body[data-page="exchange"] .exchange-pair-card.selectable {
  transition: box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

body[data-page="exchange"] .exchange-pair-card.selectable:hover {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(232, 250, 245, 0.6));
  border-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 20px 44px rgba(42, 72, 66, 0.14);
}

body[data-page="exchange"] .exchange-pair-title,
body[data-page="exchange"] .exchange-product-selector-product strong,
body[data-page="exchange"] .exchange-product-selector-price,
body[data-page="exchange"] .exchange-product-selector-change,
body[data-page="exchange"] .exchange-product-selector-volume,
body[data-page="exchange"] .exchange-product-selector-stock,
body[data-page="exchange"] .exchange-mid-price strong,
body[data-page="exchange"] .exchange-terminal h3 {
  color: #173430;
}

body[data-page="exchange"] .exchange-pair-subtitle {
  color: var(--exchange-muted);
}

body[data-page="exchange"] .exchange-pair-select-icon {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(222, 247, 241, 0.6));
  border: 0;
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 16px rgba(42, 72, 66, 0.12);
}

body[data-page="exchange"] .exchange-pair-select-icon::after {
  border-color: rgba(23, 52, 48, 0.78);
}

body[data-page="exchange"] .exchange-selector-strip label,
body[data-page="exchange"] .exchange-ticket-form label {
  color: rgba(38, 61, 57, 0.62);
}

body[data-page="exchange"] .exchange-ticker-metrics {
  gap: 8px;
  overflow: visible;
  padding: 8px;
}

body[data-page="exchange"] .exchange-ticker-metric {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(238, 250, 246, 0.44));
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
  padding: 11px 12px;
}

body[data-page="exchange"] .exchange-ticker-metric small {
  color: rgba(38, 61, 57, 0.54);
}

body[data-page="exchange"] .exchange-ticker-metric strong {
  color: #173430;
}

body[data-page="exchange"] .exchange-ticker-metric.up strong,
body[data-page="exchange"] .exchange-terminal .up strong,
body[data-page="exchange"] .exchange-book-row.buy .exchange-book-price,
body[data-page="exchange"] .exchange-product-selector-change.up {
  color: var(--exchange-green);
}

body[data-page="exchange"] .exchange-ticker-metric.down strong,
body[data-page="exchange"] .exchange-terminal .down strong,
body[data-page="exchange"] .exchange-book-row.sell .exchange-book-price,
body[data-page="exchange"] .exchange-product-selector-change.down {
  color: var(--exchange-red);
}

body[data-page="exchange"] .exchange-ticker-metric.warn strong {
  color: var(--exchange-gold);
}

body[data-page="exchange"] .exchange-terminal .exchange-message {
  background: rgba(255, 255, 255, 0.42);
  border: 0;
  color: var(--exchange-muted);
}

body[data-page="exchange"] .exchange-panel {
  padding: clamp(12px, 1.2vw, 16px);
}

body[data-page="exchange"] .exchange-terminal-grid {
  padding-bottom: calc(var(--global-bottom-nav-reserve) + 10px);
}

body[data-page="exchange"] .exchange-interval-tabs button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 249, 245, 0.5));
  border: 0;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  color: rgba(36, 61, 55, 0.48);
}

body[data-page="exchange"] .exchange-interval-tabs button:not(:disabled):hover {
  color: #173430;
  transform: translateY(-1px);
}

body[data-page="exchange"] .exchange-interval-tabs button.selected {
  background:
    linear-gradient(180deg, rgba(20, 150, 123, 0.94), rgba(8, 125, 103, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 18px rgba(8, 125, 103, 0.18);
  color: #fffdf4;
}

body[data-page="exchange"] .exchange-chart-bg {
  fill: rgba(255, 255, 255, 0.18);
}

body[data-page="exchange"] .exchange-chart-grid,
body[data-page="exchange"] .exchange-chart-axis {
  stroke: rgba(30, 60, 54, 0.12);
}

body[data-page="exchange"] .exchange-chart-label {
  fill: rgba(38, 61, 57, 0.48);
}

body[data-page="exchange"] .exchange-candle.up .candle-body,
body[data-page="exchange"] .exchange-candle.up .volume-bar {
  fill: #10a27c;
}

body[data-page="exchange"] .exchange-candle.down .candle-body,
body[data-page="exchange"] .exchange-candle.down .volume-bar {
  fill: #d45b67;
}

body[data-page="exchange"] .exchange-candle.up {
  color: #10a27c;
}

body[data-page="exchange"] .exchange-candle.down {
  color: #d45b67;
}

body[data-page="exchange"] .volume-bar {
  opacity: 0.62;
}

body[data-page="exchange"] .exchange-chart-empty-note {
  color: rgba(38, 61, 57, 0.56);
}

body[data-page="exchange"] .exchange-terminal .market-summary .stat-row,
body[data-page="exchange"] .exchange-ticket-preview .stat-row,
body[data-page="exchange"] .exchange-order-confirm-row,
body[data-page="exchange"] .exchange-order-replace-field {
  background: rgba(255, 255, 255, 0.42);
  border: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: var(--exchange-muted);
}

body[data-page="exchange"] .exchange-book-row {
  border-radius: 12px;
  color: var(--exchange-text);
  margin-bottom: 2px;
}

body[data-page="exchange"] .exchange-book-row + .exchange-book-row,
body[data-page="exchange"] .exchange-terminal-trade,
body[data-page="exchange"] .exchange-my-order-row,
body[data-page="exchange"] .exchange-product-selector-row,
body[data-page="exchange"] .exchange-terminal .exchange-record-row {
  border-color: rgba(34, 61, 57, 0.08);
}

body[data-page="exchange"] .exchange-book-row.sell .exchange-depth-fill {
  background: linear-gradient(90deg, rgba(190, 83, 94, 0), rgba(190, 83, 94, 0.18));
}

body[data-page="exchange"] .exchange-book-row.buy .exchange-depth-fill {
  background: linear-gradient(90deg, rgba(8, 125, 103, 0), rgba(8, 125, 103, 0.18));
}

body[data-page="exchange"] .exchange-book-action {
  border: 0;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="exchange"] .exchange-book-action.buy,
body[data-page="exchange"] .exchange-ticket-actions .buy-action,
body[data-page="exchange"] .exchange-order-confirm-submit.buy {
  background: linear-gradient(180deg, #1aa785, #087d67);
  border: 0;
  color: #fffdf4;
}

body[data-page="exchange"] .exchange-book-action.sell,
body[data-page="exchange"] .exchange-ticket-actions .sell-action,
body[data-page="exchange"] .exchange-order-confirm-submit.sell {
  background: linear-gradient(180deg, #d56a73, #b94f5b);
  border: 0;
  color: #fffdf4;
}

body[data-page="exchange"] .exchange-book-action.secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(234, 248, 244, 0.52));
  color: rgba(36, 61, 55, 0.62);
}

body[data-page="exchange"] .exchange-book-trader .player-avatar,
body[data-page="exchange"] .exchange-trade-party .player-avatar {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(230, 248, 242, 0.62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 5px 14px rgba(42, 72, 66, 0.12);
  color: #173430;
}

body[data-page="exchange"] .exchange-book-alliance {
  background: rgba(80, 143, 184, 0.12);
  border: 0;
  color: #2f789f;
}

body[data-page="exchange"] .exchange-ticket-form input,
body[data-page="exchange"] .exchange-order-replace-field input,
body[data-page="exchange"] .exchange-order-confirm-amount-input {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(238, 250, 246, 0.58));
  border: 0;
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(34, 61, 57, 0.08),
    0 8px 18px rgba(42, 72, 66, 0.08);
  color: var(--exchange-text);
}

body[data-page="exchange"] .exchange-ticket-actions button,
body[data-page="exchange"] .exchange-ticket-form > button.secondary,
body[data-page="exchange"] .exchange-order-confirm-actions button {
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 9px 20px rgba(42, 72, 66, 0.12);
}

body[data-page="exchange"] .exchange-ticket-form > button.secondary,
body[data-page="exchange"] .exchange-order-confirm-actions button.secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(233, 247, 243, 0.55));
  color: #243d39;
}

body[data-page="exchange"] .exchange-my-order-side,
body[data-page="exchange"] .exchange-terminal .exchange-record-side {
  border: 0;
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

body[data-page="exchange"] .exchange-my-order-side.buy,
body[data-page="exchange"] .exchange-terminal .exchange-record-side.buy {
  background: rgba(8, 125, 103, 0.13);
  color: var(--exchange-green);
}

body[data-page="exchange"] .exchange-my-order-side.sell,
body[data-page="exchange"] .exchange-terminal .exchange-record-side.sell {
  background: rgba(190, 83, 94, 0.13);
  color: var(--exchange-red);
}

body[data-page="exchange"] .exchange-terminal-trade {
  color: var(--exchange-text);
}

body[data-page="exchange"] .exchange-trade-arrow {
  color: rgba(38, 61, 57, 0.34);
}

body[data-page="exchange"] .exchange-product-selector-backdrop,
body[data-page="exchange"] .exchange-order-confirm-backdrop {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 36%),
    rgba(241, 248, 244, 0.58);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
}

body[data-page="exchange"] .exchange-product-selector-backdrop {
  --exchange-product-selector-left: 16px;
  --exchange-product-selector-max-height: min(720px, calc(100dvh - var(--exchange-product-selector-top) - 14px));
  --exchange-product-selector-top: calc(var(--global-topbar-height) + 16px);
  --exchange-product-selector-width: min(1640px, calc(100vw - 48px));
  align-items: start;
  justify-items: center;
  padding: 0;
}

body[data-page="exchange"] .exchange-product-selector-modal {
  border-radius: 28px;
  left: 50%;
  max-height: min(720px, var(--exchange-product-selector-max-height));
  overflow: hidden;
  position: absolute;
  top: var(--exchange-product-selector-top);
  transform: translateX(-50%);
  transform-origin: top center;
  width: min(var(--exchange-product-selector-width), calc(100vw - 32px));
}

body[data-page="exchange"] .exchange-product-selector-head small {
  color: rgba(8, 125, 103, 0.68);
}

body[data-page="exchange"] .exchange-product-selector-head strong {
  color: #173430;
}

body[data-page="exchange"] .exchange-product-selector-head > span {
  color: var(--exchange-muted);
}

body[data-page="exchange"] .exchange-product-selector-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: space-between;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 1px;
  scrollbar-width: none;
}

body[data-page="exchange"] .exchange-product-selector-tabs::-webkit-scrollbar {
  display: none;
}

body[data-page="exchange"] .exchange-product-selector-tabs button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(236, 249, 246, 0.66));
  border: 1px solid rgba(38, 82, 75, 0.12);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(38, 82, 75, 0.07),
    0 7px 16px rgba(42, 72, 66, 0.07);
  color: rgba(35, 58, 54, 0.72);
  flex: 1 0 auto;
  justify-content: center;
  min-width: max-content;
  padding: 0 14px;
  white-space: nowrap;
}

body[data-page="exchange"] .exchange-product-selector-tabs button small {
  color: rgba(35, 58, 54, 0.42);
}

body[data-page="exchange"] .exchange-product-selector-tabs button.selected {
  background:
    linear-gradient(180deg, rgba(25, 151, 124, 0.92), rgba(8, 125, 103, 0.86));
  border-color: rgba(6, 105, 88, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 10px 22px rgba(8, 125, 103, 0.2);
  color: #fffdf4;
}

body[data-page="exchange"] .exchange-product-selector-tabs button.selected small {
  color: rgba(255, 253, 244, 0.66);
}

body[data-page="exchange"] .exchange-product-selector-search {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 250, 246, 0.56));
  border: 0;
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 18px rgba(42, 72, 66, 0.08);
}

body[data-page="exchange"] .exchange-product-selector-search span {
  color: rgba(35, 58, 54, 0.54);
}

body[data-page="exchange"] .exchange-product-selector-search input {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--exchange-text);
}

body[data-page="exchange"] .exchange-product-selector-search input::placeholder {
  color: rgba(35, 58, 54, 0.34);
}

body[data-page="exchange"] .exchange-product-selector-labels {
  background: rgba(249, 253, 250, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

body[data-page="exchange"] .exchange-product-selector-row {
  color: var(--exchange-text);
}

body[data-page="exchange"] .exchange-product-selector-row.selected {
  background: linear-gradient(90deg, rgba(8, 125, 103, 0.15), rgba(8, 125, 103, 0.03));
  box-shadow: inset 4px 0 0 rgba(8, 125, 103, 0.72);
}

body[data-page="exchange"] .exchange-product-selector-sort:hover,
body[data-page="exchange"] .exchange-product-selector-sort.active {
  color: #173430;
}

body[data-page="exchange"] .exchange-product-selector-sort.asc .up,
body[data-page="exchange"] .exchange-product-selector-sort.desc .down {
  color: var(--exchange-green);
}

body[data-page="exchange"] .exchange-product-selector-empty {
  color: rgba(38, 61, 57, 0.48);
}

body[data-page="exchange"] .exchange-order-confirm-modal,
body[data-page="exchange"] .exchange-trade-history-modal {
  border-radius: 26px;
}

body[data-page="exchange"] .exchange-order-confirm-row strong,
body[data-page="exchange"] .exchange-order-confirm-row.total strong {
  color: var(--exchange-text);
}

body[data-page="exchange"] .exchange-tax-help-button {
  background: rgba(255, 255, 255, 0.48);
  border: 0;
  color: rgba(36, 61, 55, 0.62);
}

body[data-page="exchange"] .exchange-tax-help-button:hover,
body[data-page="exchange"] .exchange-tax-help-button:focus-visible {
  background: rgba(255, 255, 255, 0.7);
  color: var(--exchange-gold);
}

body[data-page="exchange"] .exchange-tax-help-popover {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(235, 249, 244, 0.74));
  border: 0;
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 22px 50px rgba(42, 72, 66, 0.16);
  color: rgba(38, 61, 57, 0.72);
}

body[data-page="exchange"] .exchange-tax-help-popover::after {
  background: rgba(245, 252, 249, 0.9);
  border: 0;
}

body[data-page="exchange"] .exchange-tax-help-popover strong {
  color: #173430;
}

body[data-page="exchange"] .exchange-tax-help-popover em {
  color: rgba(38, 61, 57, 0.58);
}

body[data-page="exchange"] .exchange-terminal .exchange-record-row {
  color: var(--exchange-text);
}

body[data-page="exchange"] .exchange-terminal .exchange-order {
  border-color: rgba(34, 61, 57, 0.08);
  color: var(--exchange-text);
}

body[data-page="exchange"] .exchange-terminal .exchange-order small,
body[data-page="exchange"] .exchange-terminal .exchange-record-meta,
body[data-page="exchange"] .exchange-terminal .exchange-item small,
body[data-page="exchange"] .exchange-terminal .exchange-ship-select {
  color: var(--exchange-muted);
}

body[data-page="exchange"] .exchange-terminal .exchange-order strong,
body[data-page="exchange"] .exchange-terminal .exchange-item strong {
  color: var(--exchange-text);
}

body[data-page="exchange"] .exchange-terminal .exchange-price-value {
  color: var(--exchange-price-neutral);
  text-shadow: none;
}

body[data-page="exchange"] .exchange-terminal .exchange-price-value.exchange-price-high,
body[data-page="exchange"] .exchange-terminal input.exchange-price-high {
  color: var(--exchange-price-high);
  text-shadow: none;
}

body[data-page="exchange"] .exchange-terminal .exchange-price-value.exchange-price-extreme-high,
body[data-page="exchange"] .exchange-terminal input.exchange-price-extreme-high {
  color: var(--exchange-price-extreme-high);
  text-shadow: none;
}

body[data-page="exchange"] .exchange-terminal .exchange-price-value.exchange-price-low,
body[data-page="exchange"] .exchange-terminal input.exchange-price-low {
  color: var(--exchange-price-low);
  text-shadow: none;
}

body[data-page="exchange"] .exchange-terminal .exchange-price-value.exchange-price-extreme-low,
body[data-page="exchange"] .exchange-terminal input.exchange-price-extreme-low {
  color: var(--exchange-price-extreme-low);
  text-shadow: none;
}

@media (max-width: 1280px) {
  body[data-page="exchange"] .exchange-ticker-metrics,
  body[data-page="exchange"] .exchange-history-panel {
    width: min(100%, 420px);
  }
}

@media (max-width: 900px) {
  body[data-page="exchange"] #exchangePage > section {
    padding: 0;
  }

  body[data-page="exchange"] .exchange-terminal {
    border-radius: 24px;
    margin: 0;
    padding: 12px;
  }

  body[data-page="exchange"] .exchange-desk-exchange-picker {
    border-bottom: 1px solid rgba(34, 61, 57, 0.08);
    border-right: 0;
  }

  body[data-page="exchange"] .exchange-desk-tabs button {
    font-size: 16px;
    min-height: 44px;
  }

  body[data-page="exchange"] .exchange-product-selector-modal,
  body[data-page="exchange"] .exchange-order-confirm-modal,
  body[data-page="exchange"] .exchange-trade-history-modal {
    border-radius: 24px 24px 0 0;
  }

  body[data-page="exchange"] .exchange-product-selector-modal {
    border-radius: 24px;
  }
}

@media (max-width: 640px) {
  body[data-page="exchange"] .exchange-terminal {
    border-radius: 20px;
    padding: 10px;
  }

  body[data-page="exchange"] .exchange-desk-board,
  body[data-page="exchange"] .exchange-pair-card,
  body[data-page="exchange"] .exchange-selector-strip,
  body[data-page="exchange"] .exchange-ticker-metrics,
  body[data-page="exchange"] .exchange-panel {
    border-radius: 18px;
  }

  body[data-page="exchange"] .exchange-desk-tabs {
    gap: 4px;
    padding: 6px;
  }

  body[data-page="exchange"] .exchange-desk-tabs button {
    border-radius: 14px;
    font-size: 15px;
  }

  body[data-page="exchange"] .exchange-ticker-metrics {
    gap: 7px;
  }

  body[data-page="exchange"] .exchange-book-labels,
  body[data-page="exchange"] .exchange-book-row {
    grid-template-columns: minmax(96px, 1fr) 42px 48px 58px 48px;
  }
}

/* Alliance page: iOS glass civic directorate. */
:is(body[data-page="alliance"], body.diplomacy-modal-open) {
  background:
    linear-gradient(110deg, rgba(4, 18, 18, 0.96), rgba(10, 45, 43, 0.78) 46%, rgba(6, 18, 16, 0.94)),
    linear-gradient(180deg, rgba(246, 240, 220, 0.1), rgba(7, 13, 12, 0.86)),
    url("/assets/building-uploads/faction_a_admin_center_lv10_euler.webp") center / cover fixed;
  color: #f7f0dd;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .app {
  max-width: none;
  padding: calc(var(--global-topbar-height) + 18px) clamp(14px, 2.8vw, 34px) calc(var(--global-bottom-nav-reserve) + 34px);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) #alliancePage > section > h2,
:is(body[data-page="alliance"], body.diplomacy-modal-open) #alliancePage > h2 {
  display: none;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-shell {
  --alliance-ink: #f7f0dd;
  --alliance-muted: rgba(247, 240, 221, 0.66);
  --alliance-soft: rgba(247, 240, 221, 0.1);
  --alliance-glass: rgba(8, 22, 21, 0.64);
  --alliance-glass-strong: rgba(13, 31, 29, 0.82);
  --alliance-line: rgba(229, 206, 147, 0.2);
  --alliance-line-strong: rgba(229, 206, 147, 0.44);
  --alliance-gold: #e0c26f;
  --alliance-teal: #55c8bd;
  --alliance-danger: #d36a5c;
  display: grid;
  gap: 14px;
  min-height: calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 42px);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-shell a {
  color: inherit;
  text-decoration: none;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-glass-card,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs {
  border: 1px solid var(--alliance-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    var(--alliance-glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 20px 46px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(26px) saturate(1.35) contrast(1.02);
  -webkit-backdrop-filter: blur(26px) saturate(1.35) contrast(1.02);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  align-items: stretch;
  gap: 12px;
  overflow: hidden;
  border-radius: 24px;
  padding: clamp(16px, 2.4vw, 26px);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(224, 194, 111, 0.22), transparent 38%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.16));
  content: "";
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-copy,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-metrics {
  position: relative;
  z-index: 1;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-eyebrow {
  margin-bottom: 8px;
  color: var(--alliance-gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-copy h2 {
  margin: 0;
  color: var(--alliance-ink);
  font-size: clamp(32px, 6vw, 58px);
  font-weight: 950;
  line-height: 0.98;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-copy p,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-card-copy {
  max-width: 56ch;
  margin: 12px 0 0;
  color: var(--alliance-muted);
  font-size: 15px;
  line-height: 1.65;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-identity-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-identity-line strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-identity-line span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(229, 206, 147, 0.22);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--alliance-ink);
  font-size: 13px;
  font-weight: 800;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-identity-line span {
  color: rgba(247, 240, 221, 0.78);
  font-weight: 750;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-faction-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 5px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-faction-icon {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(7, 28, 30, 0.18));
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-faction-chip b {
  color: inherit;
  font: inherit;
  line-height: 1;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-metric,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-item,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-empty-panel {
  border: 1px solid rgba(229, 206, 147, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  padding: 13px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-metric span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-item span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-empty-panel span {
  display: block;
  color: var(--alliance-muted);
  font-size: 12px;
  font-weight: 800;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-metric strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-item strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-empty-panel strong {
  display: block;
  margin-top: 4px;
  color: var(--alliance-ink);
  font-size: 23px;
  font-weight: 950;
  line-height: 1.08;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-metric small,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-item small {
  display: block;
  margin-top: 5px;
  color: rgba(247, 240, 221, 0.52);
  font-size: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  border-radius: 18px;
  padding: 6px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 13px;
  color: var(--alliance-muted);
  font-size: 14px;
  font-weight: 850;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs a:hover,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs a:focus-visible {
  background: rgba(224, 194, 111, 0.16);
  color: var(--alliance-ink);
  outline: none;
}

/* State affairs workbench: extend to the viewport bottom while keeping the global HUD above it. */
body.technology-modal-open .global-primary-nav {
  z-index: var(--global-hud-z);
}

body.diplomacy-modal-open {
  overflow: hidden;
}

body.diplomacy-modal-open .global-primary-nav {
  z-index: var(--global-hud-z);
}

.technology-workbench-modal {
  bottom: 0;
  align-items: stretch;
  justify-content: center;
  padding: 14px 18px 0;
}

.technology-workbench-shell {
  width: min(1560px, calc(100vw - 36px));
  height: 100%;
  max-height: none;
}

.technology-workbench-body {
  padding: 18px 18px calc(var(--global-bottom-nav-reserve) + 18px);
  scroll-padding-bottom: calc(var(--global-bottom-nav-reserve) + 18px);
}

@media (max-width: 760px) {
  .technology-workbench-modal {
    padding: 0;
  }

  .technology-workbench-body {
    padding: 12px 12px calc(var(--global-bottom-nav-reserve) + 14px);
    scroll-padding-bottom: calc(var(--global-bottom-nav-reserve) + 14px);
  }
}

/* Diplomatic workbench: compact iOS glass shell for communications and alliance affairs. */
.diplomacy-workbench-modal {
  background:
    radial-gradient(ellipse at 18% 5%, rgba(95, 223, 205, 0.22), transparent 38%),
    radial-gradient(ellipse at 82% 14%, rgba(238, 199, 99, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(241, 248, 246, 0.78), rgba(226, 241, 238, 0.86));
  backdrop-filter: blur(22px) saturate(1.22);
}

.diplomacy-workbench-shell {
  --diplomacy-ink: #102a2e;
  --diplomacy-muted: #5d7375;
  --diplomacy-teal: #0c7f75;
  --diplomacy-gold: #d6aa48;
  --diplomacy-panel: rgba(255, 255, 255, 0.7);
  --diplomacy-line: rgba(255, 255, 255, 0.64);
  --diplomacy-shadow: rgba(27, 68, 65, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 22px 22px 0 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.48)),
    rgba(230, 244, 241, 0.78);
  box-shadow: 0 32px 100px rgba(30, 72, 68, 0.24);
  color: var(--diplomacy-ink);
  backdrop-filter: blur(24px) saturate(1.18);
}

.diplomacy-workbench-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.66);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.74), rgba(232, 245, 241, 0.54)),
    rgba(255, 255, 255, 0.5);
  color: var(--diplomacy-ink);
}

.diplomacy-workbench-head span {
  color: var(--diplomacy-teal);
}

.diplomacy-workbench-head h2 {
  color: var(--diplomacy-ink);
}

.diplomacy-workbench-tabs {
  max-width: min(320px, 42vw);
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74), 0 14px 32px rgba(27, 68, 65, 0.11);
  backdrop-filter: blur(18px) saturate(1.12);
}

.diplomacy-workbench-tab {
  min-width: 122px;
  border-right-color: rgba(29, 95, 89, 0.12);
  color: rgba(16, 42, 46, 0.66);
}

.diplomacy-workbench-tab:hover {
  background: rgba(255, 255, 255, 0.34);
  color: var(--diplomacy-ink);
}

.diplomacy-workbench-tab.selected {
  background:
    linear-gradient(145deg, rgba(12, 127, 117, 0.14), rgba(214, 170, 72, 0.12)),
    rgba(255, 255, 255, 0.68);
  color: var(--diplomacy-ink);
}

.diplomacy-workbench-close {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.48);
  color: var(--diplomacy-ink);
  border-radius: 14px;
}

.diplomacy-workbench-close:hover {
  border-color: rgba(12, 127, 117, 0.42);
  background: rgba(12, 127, 117, 0.1);
}

.diplomacy-workbench-body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.62), transparent 30%),
    linear-gradient(180deg, rgba(245, 251, 249, 0.54), rgba(233, 244, 241, 0.58));
}

.diplomacy-workbench-body .chat-directorate-shell,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-directorate-shell {
  min-height: 100%;
}

.diplomacy-workbench-body .chat-directorate-shell {
  padding-top: 0;
}

.diplomacy-workbench-body .chat-page {
  max-width: none;
}

@media (max-width: 760px) {
  .diplomacy-workbench-shell {
    border: 0;
    border-radius: 0;
  }

  .diplomacy-workbench-tabs {
    max-width: none;
  }

  .diplomacy-workbench-tab {
    min-width: 0;
  }
}

/* High-definition glass pass: keep the iOS material, remove the foggy low-contrast haze. */
.chat-directorate-shell {
  --chat-muted: rgba(255, 248, 232, 0.78);
  --chat-soft: rgba(255, 248, 232, 0.13);
  --chat-glass: rgba(7, 24, 25, 0.78);
  --chat-glass-strong: rgba(8, 26, 27, 0.92);
  --chat-line: rgba(229, 206, 147, 0.32);
  --chat-line-strong: rgba(229, 206, 147, 0.58);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.chat-command-hero,
.chat-channel-list,
.chat-panel,
.chat-dossier {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045)),
    var(--chat-glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.045),
    0 18px 44px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(12px) saturate(1.18) contrast(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.18) contrast(1.08);
}

.chat-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    var(--chat-glass-strong);
}

.chat-hero-title-row p,
.chat-panel-header small,
.chat-message-meta,
.chat-message-foot span,
.chat-translation,
.chat-compose-input > span,
.chat-recipient-line span,
.chat-recipient-line em {
  color: var(--chat-muted);
}

.chat-channel-button,
.chat-scope-strip span,
.chat-recipient-line,
.chat-compose,
.chat-warning,
.chat-empty-state,
.chat-translation-note {
  border-color: rgba(229, 206, 147, 0.22);
  background: rgba(255, 255, 255, 0.085);
}

.chat-channel-button:hover,
.chat-channel-button:focus-visible {
  border-color: var(--chat-line-strong);
  background: rgba(255, 255, 255, 0.16);
}

.chat-channel-button.selected {
  border-color: rgba(85, 200, 189, 0.68);
  background: rgba(20, 138, 129, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(149, 238, 225, 0.22),
    0 10px 26px rgba(18, 112, 105, 0.18);
}

.chat-message-list {
  border-color: rgba(229, 206, 147, 0.22);
  background: rgba(1, 10, 11, 0.5);
}

.chat-message-row {
  border-color: rgba(229, 206, 147, 0.2);
  background: rgba(255, 255, 255, 0.095);
}

.chat-message-row.own {
  border-color: rgba(85, 200, 189, 0.42);
  background: rgba(20, 138, 129, 0.24);
}

.chat-message-row p {
  color: rgba(255, 250, 238, 0.94);
}

.chat-target-input,
.chat-compose textarea,
.chat-compose-meta {
  border-color: rgba(229, 206, 147, 0.24);
  background: rgba(2, 12, 13, 0.62);
}

.diplomacy-workbench-modal {
  background:
    radial-gradient(ellipse at 18% 5%, rgba(95, 223, 205, 0.16), transparent 34%),
    radial-gradient(ellipse at 82% 14%, rgba(238, 199, 99, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(245, 250, 248, 0.94), rgba(230, 241, 238, 0.96));
  backdrop-filter: blur(8px) saturate(1.08) contrast(1.08);
  -webkit-backdrop-filter: blur(8px) saturate(1.08) contrast(1.08);
}

.diplomacy-workbench-shell {
  border-color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(240, 249, 246, 0.86)),
    rgba(233, 244, 241, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 28px 88px rgba(20, 62, 60, 0.22);
  backdrop-filter: blur(10px) saturate(1.08) contrast(1.06);
  -webkit-backdrop-filter: blur(10px) saturate(1.08) contrast(1.06);
}

.diplomacy-workbench-head {
  border-bottom-color: rgba(24, 91, 86, 0.13);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(237, 248, 245, 0.88)),
    rgba(255, 255, 255, 0.9);
}

.diplomacy-workbench-tabs {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px) saturate(1.06) contrast(1.04);
  -webkit-backdrop-filter: blur(8px) saturate(1.06) contrast(1.04);
}

.diplomacy-workbench-body {
  background:
    linear-gradient(180deg, rgba(245, 251, 249, 0.98), rgba(231, 242, 239, 0.96));
}

.diplomacy-workbench-body .chat-command-hero,
.diplomacy-workbench-body .chat-channel-list,
.diplomacy-workbench-body .chat-panel,
.diplomacy-workbench-body .chat-dossier,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-directorate-hero,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-glass-card,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-section-tabs {
  backdrop-filter: blur(10px) saturate(1.16) contrast(1.08);
  -webkit-backdrop-filter: blur(10px) saturate(1.16) contrast(1.08);
}

body.diplomacy-modal-open .diplomacy-workbench-body .alliance-directorate-shell {
  --alliance-muted: rgba(255, 248, 232, 0.78) !important;
  --alliance-glass: rgba(8, 22, 21, 0.82) !important;
  --alliance-glass-strong: rgba(13, 31, 29, 0.92) !important;
  --alliance-line: rgba(229, 206, 147, 0.3) !important;
  --alliance-line-strong: rgba(229, 206, 147, 0.58) !important;
}

.diplomacy-workbench-body .alliance-directorate-hero,
.diplomacy-workbench-body .alliance-glass-card,
.diplomacy-workbench-body .alliance-section-tabs {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045)),
    var(--alliance-glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 18px 44px rgba(0, 0, 0, 0.26);
}

/* Technology tab only: iOS 27 liquid-glass government workbench. */
.technology-workbench-modal[data-workbench-tab="technology"] {
  background:
    radial-gradient(ellipse at 22% 3%, rgba(119, 224, 206, 0.24), transparent 38%),
    radial-gradient(ellipse at 80% 16%, rgba(241, 209, 118, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(244, 251, 249, 0.72), rgba(232, 244, 241, 0.82));
  backdrop-filter: blur(20px) saturate(1.25);
}

.technology-workbench-shell[data-workbench-tab="technology"] {
  --tech-glass-ink: #163130;
  --tech-glass-muted: #687e7a;
  --tech-glass-soft: rgba(255, 255, 255, 0.58);
  --tech-glass-panel: rgba(255, 255, 255, 0.68);
  --tech-glass-panel-strong: rgba(255, 255, 255, 0.82);
  --tech-glass-line: rgba(255, 255, 255, 0.56);
  --tech-glass-shadow: rgba(41, 74, 70, 0.16);
  --tech-glass-teal: #0e9182;
  --tech-glass-deep: #0e5f64;
  --tech-glass-gold: #d6a62e;
  --tech-glass-blue: #467fa8;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 30px 30px 0 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(229, 250, 245, 0.74) 48%, rgba(255, 247, 222, 0.78)),
    rgba(239, 249, 246, 0.86);
  box-shadow:
    0 34px 90px rgba(26, 55, 52, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(117, 159, 152, 0.18);
  color: var(--tech-glass-ink);
  backdrop-filter: blur(28px) saturate(1.28);
}

.technology-workbench-shell[data-workbench-tab="technology"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, transparent 0 28%, rgba(255, 255, 255, 0.34) 36%, transparent 48%),
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.38), transparent 28%),
    radial-gradient(circle at 92% 86%, rgba(13, 145, 130, 0.12), transparent 32%);
  opacity: 0.9;
  pointer-events: none;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-head {
  min-height: 88px;
  border-bottom: 1px solid rgba(150, 190, 184, 0.28);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(230, 249, 245, 0.64) 58%, rgba(255, 244, 213, 0.62)),
    rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.62);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-head span {
  color: rgba(162, 113, 26, 0.82);
  letter-spacing: 0.16em;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-head h2 {
  color: var(--tech-glass-ink);
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-tabs {
  gap: 4px;
  border: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(95, 136, 130, 0.14),
    0 14px 34px rgba(43, 77, 73, 0.12);
  padding: 5px;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-tab {
  min-width: 108px;
  min-height: 40px;
  border: 0;
  border-radius: 17px;
  color: rgba(22, 49, 48, 0.68);
  background: transparent;
  font-size: 14px;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-tab:hover {
  background: rgba(255, 255, 255, 0.46);
  color: var(--tech-glass-ink);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-tab.selected {
  background:
    linear-gradient(145deg, rgba(16, 143, 128, 0.94), rgba(11, 95, 101, 0.88)),
    rgba(14, 145, 130, 0.78);
  color: #fffdf4;
  box-shadow:
    0 10px 24px rgba(6, 108, 101, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
  transform: translateY(-1px);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-close {
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(230, 244, 240, 0.62)),
    rgba(255, 255, 255, 0.52);
  color: rgba(22, 49, 48, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 12px 24px rgba(30, 68, 64, 0.14);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-close:hover {
  background: rgba(255, 255, 255, 0.82);
  color: var(--tech-glass-teal);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-body {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 44%),
    radial-gradient(circle at 72% 12%, rgba(13, 145, 130, 0.08), transparent 34%);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-console {
  color: var(--tech-glass-ink);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-command-grid {
  gap: 12px;
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-command-panel,
.technology-workbench-shell[data-workbench-tab="technology"] .research-data-panel,
.technology-workbench-shell[data-workbench-tab="technology"] .research-reset-panel,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-branch {
  border: 1px solid var(--tech-glass-line);
  border-radius: 26px;
  background:
    linear-gradient(145deg, var(--tech-glass-panel-strong), rgba(226, 247, 242, 0.54)),
    var(--tech-glass-soft);
  box-shadow:
    0 20px 44px var(--tech-glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(94, 135, 129, 0.13);
  backdrop-filter: blur(22px) saturate(1.16);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-branch.industry-surface {
  border-color: color-mix(in srgb, var(--industry-color, #0e9182) 24%, rgba(255, 255, 255, 0.62));
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), color-mix(in srgb, var(--industry-soft, rgba(14, 145, 130, 0.18)) 46%, rgba(255, 255, 255, 0.58))),
    rgba(242, 250, 247, 0.7);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-panel-title strong,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-branch-header strong {
  color: var(--tech-glass-ink);
  font-size: 19px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-panel-title span,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-branch-header span {
  color: var(--tech-glass-muted);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-point-summary span,
.technology-workbench-shell[data-workbench-tab="technology"] .research-exchange-summary span,
.technology-workbench-shell[data-workbench-tab="technology"] .research-reset-summary span,
.technology-workbench-shell[data-workbench-tab="technology"] .research-cost-row,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-panel,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-speed,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-building,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-item,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-empty {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(229, 246, 242, 0.5)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 28px rgba(40, 76, 71, 0.1);
  color: var(--tech-glass-ink);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-point-summary b,
.technology-workbench-shell[data-workbench-tab="technology"] .research-exchange-summary b,
.technology-workbench-shell[data-workbench-tab="technology"] .research-reset-summary b,
.technology-workbench-shell[data-workbench-tab="technology"] .research-cost-row b,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-stat-line strong,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-speed strong {
  color: var(--tech-glass-ink);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-point-summary small,
.technology-workbench-shell[data-workbench-tab="technology"] .research-exchange-summary small,
.technology-workbench-shell[data-workbench-tab="technology"] .research-reset-summary small,
.technology-workbench-shell[data-workbench-tab="technology"] .research-exchange-footer small,
.technology-workbench-shell[data-workbench-tab="technology"] .research-cost-name em,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-panel.next small,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-speed span {
  color: var(--tech-glass-muted);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-tech-token {
  min-height: 58px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 17px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(222, 243, 239, 0.44)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 22px rgba(31, 65, 61, 0.12);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-tech-token.industry-token {
  border-color: color-mix(in srgb, var(--industry-color, #0e9182) 24%, rgba(255, 255, 255, 0.7));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.08)),
    color-mix(in srgb, var(--industry-soft, rgba(14, 145, 130, 0.24)) 52%, rgba(255, 255, 255, 0.52));
  box-shadow:
    inset 0 -4px 0 color-mix(in srgb, var(--industry-color, #0e9182) 70%, rgba(255, 255, 255, 0.2)),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 22px rgba(31, 65, 61, 0.1);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-tech-token b {
  top: 5px;
  right: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--tech-glass-ink);
  box-shadow: 0 4px 10px rgba(22, 49, 48, 0.12);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-cost-icon {
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(217, 238, 234, 0.54)),
    rgba(255, 255, 255, 0.62);
  color: var(--tech-glass-gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-cost-name strong {
  color: var(--tech-glass-deep);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-cost-row.missing {
  opacity: 0.62;
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-cost-progress {
  height: 6px;
  background: rgba(48, 88, 82, 0.12);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-cost-progress span {
  background: linear-gradient(90deg, var(--tech-glass-gold), #f4c95a);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-exchange-button,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-start-button,
.technology-workbench-shell[data-workbench-tab="technology"] .research-reset-submit {
  min-height: 42px;
  border: 0;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(18, 145, 130, 0.95), rgba(13, 91, 98, 0.92)),
    var(--tech-glass-teal);
  color: #fffdf5;
  box-shadow:
    0 12px 26px rgba(10, 105, 99, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  font-weight: 900;
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-reset-submit {
  background:
    linear-gradient(145deg, rgba(209, 151, 42, 0.95), rgba(144, 93, 38, 0.92)),
    var(--tech-glass-gold);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-exchange-button:disabled,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-start-button:disabled,
.technology-workbench-shell[data-workbench-tab="technology"] .research-reset-submit:disabled {
  background: rgba(255, 255, 255, 0.46);
  color: rgba(22, 49, 48, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-reset-impact span {
  border-left: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.54);
  color: rgba(22, 49, 48, 0.72);
}

.technology-workbench-shell[data-workbench-tab="technology"] .research-empty,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-empty {
  color: rgba(22, 49, 48, 0.42);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-branch-header {
  position: relative;
  min-height: 58px;
  overflow: hidden;
  padding: 0 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--industry-color, #0e9182) 32%, rgba(117, 158, 151, 0.16));
  background:
    radial-gradient(circle at 26px 50%, color-mix(in srgb, var(--industry-color, #0e9182) 28%, transparent) 0 34px, transparent 72px),
    linear-gradient(90deg,
      color-mix(in srgb, var(--industry-color, #0e9182) 23%, rgba(255, 255, 255, 0.82)) 0%,
      color-mix(in srgb, var(--industry-soft, rgba(14, 145, 130, 0.15)) 86%, rgba(255, 255, 255, 0.58)) 42%,
      rgba(255, 255, 255, 0.64) 100%),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 color-mix(in srgb, var(--industry-color, #0e9182) 16%, rgba(255, 255, 255, 0.38));
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-branch-header::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--industry-color, #0e9182) 84%, rgba(255, 255, 255, 0.18)),
    color-mix(in srgb, var(--industry-color, #0e9182) 58%, rgba(13, 91, 98, 0.24)));
  box-shadow: 0 0 24px color-mix(in srgb, var(--industry-color, #0e9182) 46%, transparent);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-branch-header strong,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-branch-header span {
  position: relative;
  z-index: 1;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-branch-header strong {
  color: color-mix(in srgb, var(--industry-ink, #0e5f64) 72%, var(--tech-glass-ink));
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 24px color-mix(in srgb, var(--industry-color, #0e9182) 18%, transparent);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-branch-header i {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--industry-color, #0e9182) 22%, rgba(255, 255, 255, 0.72));
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.96), transparent 42%),
    linear-gradient(145deg,
      color-mix(in srgb, var(--industry-color, #0e9182) 28%, rgba(255, 255, 255, 0.88)),
      color-mix(in srgb, var(--industry-soft, rgba(14, 145, 130, 0.22)) 72%, rgba(255, 255, 255, 0.52)));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 color-mix(in srgb, var(--industry-color, #0e9182) 22%, rgba(60, 92, 86, 0.12)),
    0 10px 22px color-mix(in srgb, var(--industry-color, #0e9182) 18%, rgba(31, 65, 61, 0.1));
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-branch-header .industry-chip {
  position: relative;
  z-index: 1;
  border: 1px solid color-mix(in srgb, var(--industry-color, #0e9182) 28%, rgba(255, 255, 255, 0.72));
  background:
    linear-gradient(145deg,
      color-mix(in srgb, var(--industry-color, #0e9182) 38%, rgba(255, 255, 255, 0.72)),
      color-mix(in srgb, var(--industry-soft, rgba(14, 145, 130, 0.22)) 78%, rgba(255, 255, 255, 0.56)));
  color: color-mix(in srgb, var(--industry-ink, #0e5f64) 86%, var(--tech-glass-ink));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 18px color-mix(in srgb, var(--industry-color, #0e9182) 16%, rgba(31, 65, 61, 0.1));
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-panel {
  min-height: 154px;
  padding: 24px;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-panel.current {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), color-mix(in srgb, var(--industry-soft, rgba(14, 145, 130, 0.18)) 34%, rgba(255, 255, 255, 0.82))),
    rgba(255, 255, 255, 0.84);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-ghost-icon {
  right: 24px;
  bottom: -14px;
  color: color-mix(in srgb, var(--industry-color, #0e9182) 26%, transparent);
  opacity: 0.52;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-panel.current .technology-ghost-icon {
  opacity: 0.72;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-ghost-icon .technology-industry-icon {
  opacity: 1;
  filter: saturate(1.18) contrast(1.08);
  mix-blend-mode: normal;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-stat-line span {
  color: var(--tech-glass-muted);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-stat-line strong {
  border-left-color: rgba(14, 145, 130, 0.18);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-cost-row {
  gap: 6px;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-point-chip {
  min-height: 42px;
  border-radius: 15px;
  background:
    linear-gradient(145deg, #f7c756, #d49a28),
    var(--tech-glass-gold);
  box-shadow:
    0 10px 22px rgba(194, 134, 28, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-start-button {
  border-radius: 15px;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-track {
  gap: 10px;
  padding: 0 18px 20px;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-tile,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-gap {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(238, 249, 246, 0.86)),
    rgba(255, 255, 255, 0.9);
  color: var(--tech-glass-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 10px 24px rgba(31, 65, 61, 0.12);
  padding: 10px 10px 12px 52px;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-gap {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.72);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-tile b {
  inset: 8px auto 8px 8px;
  width: 34px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(70, 127, 168, 0.95), rgba(20, 95, 104, 0.9)),
    var(--tech-glass-blue);
  color: #fffdf5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-bonus,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-gap span,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-unlock-empty {
  background: rgba(255, 255, 255, 0.84);
  color: rgba(38, 67, 65, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 4px 10px rgba(31, 65, 61, 0.06);
  font-weight: 900;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-gap strong {
  color: var(--tech-glass-ink);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-tile.researched {
  border-color: rgba(14, 145, 130, 0.28);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-tile.next,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-tile.unlock-detail-trigger:hover,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-tile.selected-detail {
  border-color: rgba(213, 158, 42, 0.62);
  box-shadow:
    0 16px 30px rgba(194, 134, 28, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-tile.locked {
  opacity: 1;
  filter: none;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-tile.selected-detail::after {
  bottom: -9px;
  width: 18px;
  height: 18px;
  border: 0;
  background: rgba(246, 252, 250, 0.9);
  box-shadow: 6px 6px 16px rgba(40, 76, 71, 0.08);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-unlock-chip {
  grid-template-columns: 24px minmax(0, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--tech-glass-gold);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 5px 12px rgba(31, 65, 61, 0.06);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-unlock-icon {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-unlock-name {
  color: color-mix(in srgb, var(--tech-glass-gold) 68%, var(--tech-glass-ink));
  text-shadow: none;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-unlock-icon .product-icon-image,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-item .product-icon-image,
.technology-workbench-shell[data-workbench-tab="technology"] .research-cost-icon .product-icon-image {
  opacity: 1;
  filter: saturate(1.16) contrast(1.08);
  mix-blend-mode: normal;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-detail {
  margin: -2px 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(229, 248, 243, 0.58)),
    rgba(255, 255, 255, 0.62);
  box-shadow:
    0 22px 46px rgba(31, 65, 61, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px) saturate(1.18);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-detail-head {
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(117, 158, 151, 0.14);
  background: rgba(255, 255, 255, 0.34);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-detail-head strong {
  color: var(--tech-glass-ink);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-detail-head i {
  background: rgba(255, 255, 255, 0.58);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-detail-head button {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.38);
  color: rgba(22, 49, 48, 0.58);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-level-detail-head button:hover {
  background: rgba(255, 255, 255, 0.66);
  color: var(--tech-glass-teal);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-building span,
.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-item strong {
  color: var(--tech-glass-ink);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-flow {
  gap: 12px;
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-arrow {
  color: rgba(22, 49, 48, 0.34);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-item.output {
  background:
    linear-gradient(145deg, rgba(255, 249, 226, 0.82), rgba(242, 214, 132, 0.34)),
    rgba(255, 255, 255, 0.5);
}

.technology-workbench-shell[data-workbench-tab="technology"] .technology-detail-item em {
  color: var(--tech-glass-deep);
}

@media (max-width: 1180px) {
  .technology-workbench-shell[data-workbench-tab="technology"] .research-command-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .technology-workbench-shell[data-workbench-tab="technology"] {
    border-radius: 0;
  }

  .technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-head {
    min-height: 76px;
  }

  .technology-workbench-shell[data-workbench-tab="technology"] .technology-workbench-tab {
    min-width: 96px;
  }

  .technology-workbench-shell[data-workbench-tab="technology"] .research-command-panel,
  .technology-workbench-shell[data-workbench-tab="technology"] .research-data-panel,
  .technology-workbench-shell[data-workbench-tab="technology"] .research-reset-panel,
  .technology-workbench-shell[data-workbench-tab="technology"] .technology-branch {
    border-radius: 22px;
  }

  .technology-workbench-shell[data-workbench-tab="technology"] .technology-level-tile,
  .technology-workbench-shell[data-workbench-tab="technology"] .technology-level-gap {
    border-radius: 18px;
  }
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr) minmax(240px, 0.65fr);
  gap: 14px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-glass-card {
  min-width: 0;
  border-radius: 22px;
  padding: 16px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-wide {
  grid-column: 1 / -1;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-title span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-subtitle {
  color: var(--alliance-gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-title strong {
  color: var(--alliance-ink);
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-announcement {
  border-left: 2px solid var(--alliance-gold);
  margin-bottom: 12px;
  padding-left: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-announcement span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress-copy span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus span {
  color: var(--alliance-muted);
  font-size: 12px;
  font-weight: 800;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-announcement p {
  margin: 5px 0 0;
  color: var(--alliance-ink);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.55;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-grid,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button {
  border: 1px solid rgba(229, 206, 147, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--alliance-ink);
  font-size: 14px;
  font-weight: 900;
  box-shadow: none;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button {
  min-height: 40px;
  padding: 0 14px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button.primary {
  border-color: rgba(85, 200, 189, 0.48);
  background: rgba(25, 142, 132, 0.82);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button.danger,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button.danger {
  border-color: rgba(211, 106, 92, 0.42);
  color: #ffd9d2;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button:hover,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button:focus-visible,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button:hover,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button:focus-visible {
  border-color: var(--alliance-line-strong);
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-list {
  display: grid;
  gap: 8px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button {
  display: grid;
  gap: 3px;
  justify-items: start;
  width: 100%;
  padding: 12px;
  text-align: left;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button strong {
  font-size: 15px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button span {
  color: var(--alliance-muted);
  font-size: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress-copy strong {
  color: var(--alliance-ink);
  font-size: 17px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress.status-bar,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .status-bar.alliance-progress {
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(229, 206, 147, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress .status-fill {
  background: linear-gradient(90deg, var(--alliance-teal), var(--alliance-gold));
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-list,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-queue-stack {
  display: grid;
  gap: 10px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(229, 206, 147, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  padding: 11px 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row strong {
  color: var(--alliance-ink);
  font-size: 15px;
  font-weight: 900;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row small,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row small {
  display: block;
  margin-top: 4px;
  color: var(--alliance-muted);
  font-size: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-role-group {
  display: grid;
  gap: 8px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-role-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 4px;
  color: var(--alliance-muted);
  font-size: 12px;
  font-weight: 900;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-role-heading strong {
  color: var(--alliance-gold);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route {
  min-width: 0;
  border: 1px solid rgba(229, 206, 147, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  margin-bottom: 10px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route header span {
  color: var(--alliance-ink);
  font-size: 16px;
  font-weight: 950;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route header strong {
  color: var(--alliance-gold);
  font-size: 14px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route header small {
  grid-column: 1 / -1;
  color: var(--alliance-muted);
  font-size: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card {
  border: 1px solid rgba(229, 206, 147, 0.14);
  border-radius: 16px;
  background: rgba(4, 14, 13, 0.42);
  padding: 11px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card.active {
  border-color: rgba(224, 194, 111, 0.62);
  background: rgba(224, 194, 111, 0.12);
  box-shadow: inset 0 0 0 1px rgba(224, 194, 111, 0.14);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card.locked {
  opacity: 0.72;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-head,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-head strong {
  color: var(--alliance-ink);
  font-size: 15px;
  font-weight: 950;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-head span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-meta span {
  color: var(--alliance-gold);
  font-size: 12px;
  font-weight: 850;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-meta {
  margin-top: 5px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-meta span {
  color: var(--alliance-muted);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card p {
  margin: 8px 0 7px;
  color: rgba(247, 240, 221, 0.82);
  font-size: 13px;
  line-height: 1.5;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card small {
  color: rgba(247, 240, 221, 0.55);
  font-size: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus {
  grid-template-columns: 1fr 0.75fr;
  margin-bottom: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus div {
  border: 1px solid rgba(229, 206, 147, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.065);
  padding: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus strong {
  display: block;
  margin-top: 5px;
  color: var(--alliance-ink);
  font-size: 18px;
  font-weight: 950;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-empty-panel {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-empty-panel strong {
  font-size: 16px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .empty-state,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .warning-text {
  border: 1px solid rgba(229, 206, 147, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--alliance-muted);
  padding: 11px 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .warning-text {
  margin-top: 8px;
  color: #f7c79a;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-diplomacy-shell .alliance-command-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.75fr) minmax(240px, 0.75fr);
}

@media (max-width: 980px) {
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-grid,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-diplomacy-shell .alliance-command-grid,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-columns,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-routes {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-card {
    order: -1;
  }
}

@media (max-width: 640px) {
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .app {
    padding: calc(var(--global-topbar-height) + 10px) 10px calc(var(--global-bottom-nav-reserve) + 20px);
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-shell {
    gap: 10px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-glass-card {
    border-radius: 18px;
    padding: 13px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-copy h2 {
    font-size: 38px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-metrics,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-grid,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus {
    grid-template-columns: 1fr 1fr;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs {
    gap: 4px;
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(64px, 1fr));
    border-radius: 16px;
    padding: 5px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs a {
    min-height: 34px;
    font-size: 13px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress-copy {
    align-items: stretch;
    flex-direction: column;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-action-row {
    width: 100%;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-action-row .alliance-button {
    flex: 1 1 auto;
  }
}

@media (max-width: 760px) {
  body[data-page="data"] .app {
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow-x: hidden;
    padding-left: 12px !important;
    padding-right: 12px !important;
    width: 100% !important;
  }

  body[data-page="data"] #dataPage,
  body[data-page="data"] #dataPage > section,
  body[data-page="data"] #dataOverview,
  body[data-page="data"] .island-subpage-content,
  body[data-page="data"] .statistics-command-center,
  body[data-page="data"] .statistics-brief,
  body[data-page="data"] .statistics-panel,
  body[data-page="data"] .statistics-observation-strip {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  body[data-page="data"] .statistics-brief-main h2,
  body[data-page="data"] .statistics-brief-main p,
  body[data-page="data"] .statistics-observation-strip li {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: normal;
  }
}

/* Final diplomacy clarity override: alliance rules are defined late, so this pass must live last. */
.diplomacy-workbench-body .alliance-directorate-shell {
  --alliance-muted: rgba(255, 248, 232, 0.78);
  --alliance-glass: rgba(8, 22, 21, 0.82);
  --alliance-glass-strong: rgba(13, 31, 29, 0.92);
  --alliance-line: rgba(229, 206, 147, 0.3);
  --alliance-line-strong: rgba(229, 206, 147, 0.58);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body.diplomacy-modal-open .diplomacy-workbench-body .alliance-directorate-hero,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-glass-card,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-section-tabs {
  border-color: var(--alliance-line) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045)),
    var(--alliance-glass) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.045),
    0 18px 44px rgba(0, 0, 0, 0.26) !important;
  backdrop-filter: blur(10px) saturate(1.16) contrast(1.08) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.16) contrast(1.08) !important;
}

body.diplomacy-modal-open .diplomacy-workbench-body .alliance-row,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-member-row,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-policy-card,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-command-button,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-empty-panel {
  border-color: rgba(229, 206, 147, 0.22) !important;
  background: rgba(255, 255, 255, 0.085) !important;
}

body.diplomacy-modal-open .diplomacy-workbench-body .alliance-hero-copy p,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-card-copy,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-row small,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-member-row small,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-policy-card p,
body.diplomacy-modal-open .diplomacy-workbench-body .alliance-policy-card small {
  color: var(--alliance-muted) !important;
}

/* iOS 27-inspired building detail modal. Apple Liquid Glass is platform-native;
   this web pass approximates it with layered translucency, soft borders, and quiet depth. */
body[data-page="island"] .selected-plot-modal-backdrop {
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(180deg, rgba(235, 246, 243, 0.22), rgba(188, 212, 205, 0.18));
  backdrop-filter: blur(8px) saturate(1.14);
  -webkit-backdrop-filter: blur(8px) saturate(1.14);
}

body[data-page="island"] .empty-plot-modal.building-plot-modal {
  --building-ios-ink: #163833;
  --building-ios-muted: rgba(35, 61, 56, 0.64);
  --building-ios-line: rgba(37, 91, 83, 0.15);
  --building-ios-line-strong: rgba(255, 255, 255, 0.62);
  --building-ios-panel: rgba(255, 255, 255, 0.55);
  --building-ios-panel-strong: rgba(255, 255, 255, 0.72);
  --building-ios-teal: #078f80;
  --building-ios-mint: #22c7a9;
  --building-ios-gold: #9e812f;
  top: max(12px, calc(var(--global-topbar-height) + 8px));
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - var(--global-topbar-height) - 10px);
  border: 1px solid var(--building-ios-line-strong);
  border-radius: 32px;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255, 255, 255, 0.92), transparent 42%),
    radial-gradient(ellipse at 100% 12%, rgba(96, 214, 196, 0.32), transparent 44%),
    radial-gradient(ellipse at 48% 100%, rgba(233, 209, 145, 0.18), transparent 44%),
    linear-gradient(145deg, rgba(250, 255, 252, 0.78), rgba(226, 246, 241, 0.62) 54%, rgba(250, 252, 248, 0.72)),
    rgba(238, 249, 245, 0.82);
  color: var(--building-ios-ink);
  box-shadow:
    0 34px 78px rgba(21, 56, 51, 0.24),
    0 10px 28px rgba(8, 34, 31, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(31, 92, 83, 0.08);
  backdrop-filter: blur(34px) saturate(1.56) contrast(1.03);
  -webkit-backdrop-filter: blur(34px) saturate(1.56) contrast(1.03);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body[data-page="island"] .empty-plot-modal.building-plot-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), transparent 27%),
    linear-gradient(315deg, rgba(255, 255, 255, 0.32), transparent 32%);
  opacity: 0.78;
}

body[data-page="island"] .building-plot-modal .empty-plot-modal-header,
body[data-page="island"] .building-plot-modal .empty-plot-tabs,
body[data-page="island"] .building-plot-modal .empty-plot-modal-body {
  position: relative;
  z-index: 1;
}

body[data-page="island"] .building-plot-modal .empty-plot-modal-header {
  align-items: center;
  border-bottom: 1px solid rgba(22, 56, 51, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.18)),
    rgba(238, 250, 246, 0.34);
  padding: 20px 24px 16px;
}

body[data-page="island"] .building-plot-modal .building-modal-title-link {
  max-width: 100%;
  overflow: hidden;
  color: #193b36;
  font-size: 29px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.02;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.62);
  white-space: nowrap;
}

body[data-page="island"] .building-plot-modal .building-modal-title-link:hover,
body[data-page="island"] .building-plot-modal .building-modal-title-link:focus-visible {
  color: #057f72;
  outline: 0;
}

body[data-page="island"] .building-plot-modal .building-modal-title-block .empty-plot-kicker {
  margin-top: 5px;
  color: var(--building-ios-muted);
  font-size: 13px;
  font-weight: 900;
}

body[data-page="island"] .building-plot-modal .building-modal-title-block .empty-plot-kicker i {
  width: 8px;
  height: 8px;
  background: #18c89d;
  box-shadow: 0 0 0 5px rgba(24, 200, 157, 0.14), 0 0 14px rgba(24, 200, 157, 0.56);
}

body[data-page="island"] .building-plot-modal .icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(241, 250, 247, 0.46)),
    rgba(255, 255, 255, 0.38);
  color: rgba(28, 54, 50, 0.66);
  font-size: 28px;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 10px 24px rgba(22, 56, 51, 0.12);
}

body[data-page="island"] .building-plot-modal .icon-button:hover,
body[data-page="island"] .building-plot-modal .icon-button:focus-visible {
  color: #102f2b;
  transform: translateY(-1px);
  outline: 0;
}

body[data-page="island"] .building-plot-modal .empty-plot-tabs {
  align-items: center;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-height: 64px;
  overflow: hidden;
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
  padding: 8px 12px 14px;
}

body[data-page="island"] .building-plot-modal .empty-plot-tabs button {
  display: grid;
  place-items: center;
  height: 40px;
  min-width: 0;
  min-height: 0;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(29, 59, 54, 0.62);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

body[data-page="island"] .building-plot-modal .empty-plot-tabs button:hover,
body[data-page="island"] .building-plot-modal .empty-plot-tabs button:focus-visible {
  border-color: rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.34);
  color: #123b35;
  outline: 0;
}

body[data-page="island"] .building-plot-modal .empty-plot-tabs button.selected {
  border-color: rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 251, 247, 0.72)),
    rgba(255, 255, 255, 0.64);
  color: #08786c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(9, 137, 122, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.26);
  transform: none;
}

body[data-page="island"] .building-plot-modal .empty-plot-modal-body.building {
  border-top: 1px solid rgba(22, 56, 51, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(232, 248, 244, 0.18)),
    rgba(238, 249, 246, 0.16);
  scrollbar-color: rgba(35, 90, 82, 0.34) transparent;
}

body[data-page="island"] .building-plot-modal .building-modal-body {
  gap: 14px;
  padding: 16px 16px 18px;
}

body[data-page="island"] .building-plot-modal .building-modal-hero {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.92), transparent 34%),
    radial-gradient(circle at 48% 58%, rgba(52, 189, 166, 0.2), transparent 55%),
    linear-gradient(145deg, rgba(245, 250, 247, 0.72), rgba(222, 242, 237, 0.56));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(22, 86, 78, 0.08),
    0 16px 34px rgba(21, 72, 65, 0.1);
}

body[data-page="island"] .building-plot-modal .building-modal-hero::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 38%);
}

body[data-page="island"] .building-plot-modal .building-modal-hero:hover,
body[data-page="island"] .building-plot-modal .building-modal-hero:focus-visible {
  filter: none;
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .building-plot-modal .building-modal-overview-image,
body[data-page="island"] .building-plot-modal .building-modal-image {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 20px 22px rgba(26, 71, 62, 0.22));
}

body[data-page="island"] .building-plot-modal .building-modal-overview-chips,
body[data-page="island"] .building-plot-modal .building-modal-info-grid {
  gap: 10px;
}

body[data-page="island"] .building-plot-modal .building-overview-chip,
body[data-page="island"] .building-plot-modal .building-modal-info-card,
body[data-page="island"] .building-plot-modal .building-production-summary,
body[data-page="island"] .building-plot-modal .building-modal-durability,
body[data-page="island"] .building-plot-modal .building-modal-note {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.3)),
    rgba(238, 249, 245, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 24px rgba(24, 74, 67, 0.08);
}

body[data-page="island"] .building-plot-modal .building-modal-note {
  color: #111f1c;
  font-weight: 950;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-overview-chip {
  min-height: 76px;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 2px 12px;
  padding: 12px 14px;
}

body[data-page="island"] .building-plot-modal .building-overview-chip i {
  width: 56px;
  height: 56px;
  color: var(--building-ios-gold);
  font-size: 25px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.56);
}

body[data-page="island"] .building-plot-modal .building-overview-chip-icon-image {
  width: 58px;
  height: 58px;
  filter: none;
}

body[data-page="island"] .building-plot-modal .building-overview-chip span,
body[data-page="island"] .building-plot-modal .building-modal-info-card span {
  color: var(--building-ios-muted);
  font-size: 13px;
  font-weight: 900;
}

body[data-page="island"] .building-plot-modal .building-overview-chip strong,
body[data-page="island"] .building-plot-modal .building-modal-info-card strong {
  color: #193b36;
  font-size: 19px;
  font-weight: 950;
}

body[data-page="island"] .building-plot-modal .building-modal-durability {
  padding: 13px 14px 14px;
}

body[data-page="island"] .building-plot-modal .building-modal-durability .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--building-ios-muted);
  font-size: 15px;
  font-weight: 900;
}

body[data-page="island"] .building-plot-modal .building-modal-durability .row strong {
  color: #183933;
  font-size: 18px;
  font-weight: 950;
}

body[data-page="island"] .building-plot-modal .building-modal-durability .status-bar,
body[data-page="island"] .building-plot-modal .building-production-speed-bar {
  height: 9px;
  border: 1px solid rgba(28, 80, 72, 0.1);
  background: rgba(24, 71, 64, 0.12);
  box-shadow: inset 0 1px 3px rgba(24, 71, 64, 0.16);
}

body[data-page="island"] .building-plot-modal .building-modal-durability .status-fill {
  background: linear-gradient(90deg, #0c8f84, #24d1ad);
  box-shadow: 0 0 18px rgba(36, 209, 173, 0.34);
}

body[data-page="island"] .building-plot-modal .building-production-summary {
  gap: 13px;
  padding: 16px;
}

body[data-page="island"] .building-plot-modal .building-production-overview-summary::before {
  inset: 10px 22px 8px 38%;
  background-position: center right 4px;
  background-size: min(260px, 82%) auto;
  opacity: 0.14;
  filter: saturate(0.95) drop-shadow(0 18px 24px rgba(25, 76, 68, 0.1));
  mix-blend-mode: multiply;
}

body[data-page="island"] .building-plot-modal .building-production-summary header strong,
body[data-page="island"] .building-plot-modal .building-modal-section-head strong,
body[data-page="island"] .building-plot-modal .building-modal-action-head strong {
  color: #193b36;
  font-size: 20px;
  font-weight: 950;
}

body[data-page="island"] .building-plot-modal .building-production-summary .text-button {
  border-radius: 999px;
  color: var(--building-ios-teal);
  font-size: 13px;
  font-weight: 950;
  padding: 7px 9px;
}

body[data-page="island"] .building-plot-modal .building-production-summary .text-button:hover,
body[data-page="island"] .building-plot-modal .building-production-summary .text-button:focus-visible {
  background: rgba(8, 143, 128, 0.1);
  outline: 0;
}

body[data-page="island"] .building-plot-modal .building-production-summary > small,
body[data-page="island"] .building-plot-modal .building-production-idle span,
body[data-page="island"] .building-plot-modal .building-production-stat-grid em,
body[data-page="island"] .building-plot-modal .building-modal-action-head span,
body[data-page="island"] .building-plot-modal .building-modal-action-head em,
body[data-page="island"] .building-plot-modal .building-modal-action-detail {
  color: var(--building-ios-muted);
}

body[data-page="island"] .building-plot-modal .building-production-idle i,
body[data-page="island"] .building-plot-modal .building-production-product-icon {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(221, 247, 240, 0.48)),
    rgba(255, 255, 255, 0.34);
  color: var(--building-ios-teal);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 10px 20px rgba(19, 92, 81, 0.12);
}

body[data-page="island"] .building-plot-modal .residential-population-icon .workforce-type-icon {
  width: 54px;
  height: 54px;
  filter: none;
}

body[data-page="island"] .building-plot-modal .building-production-idle strong,
body[data-page="island"] .building-plot-modal .building-production-active-main strong,
body[data-page="island"] .building-plot-modal .building-production-stat-grid b {
  color: var(--building-ios-teal);
  font-weight: 950;
}

body[data-page="island"] .building-plot-modal .building-energy-overview-progress,
body[data-page="island"] .building-plot-modal .building-production-overview-progress {
  border: 1px solid rgba(28, 80, 72, 0.1);
  background: rgba(24, 71, 64, 0.12);
  box-shadow: inset 0 1px 3px rgba(24, 71, 64, 0.16);
}

body[data-page="island"] .building-plot-modal .building-energy-overview-progress span,
body[data-page="island"] .building-plot-modal .building-production-overview-progress span {
  background: linear-gradient(90deg, #0c8f84, #24d1ad);
  box-shadow: 0 0 18px rgba(36, 209, 173, 0.34);
}

body[data-page="island"] .building-plot-modal .building-energy-output-icon {
  background: transparent;
  box-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-energy-output-icon .building-overview-chip-icon-image {
  width: 58px;
  height: 58px;
  filter: none;
}

body[data-page="island"] .building-plot-modal .building-overview-actions {
  bottom: -18px;
  gap: 9px;
  background: linear-gradient(180deg, rgba(237, 250, 246, 0), rgba(237, 250, 246, 0.92) 28%, rgba(237, 250, 246, 0.98));
  margin: 4px -2px -18px;
  padding: 12px 2px 18px;
}

body[data-page="island"] .building-plot-modal .building-overview-actions > button,
body[data-page="island"] .building-plot-modal .building-overview-more summary {
  min-height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 21px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(238, 249, 245, 0.52)),
    rgba(255, 255, 255, 0.38);
  color: #1a3934;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 12px 24px rgba(22, 74, 66, 0.1);
}

body[data-page="island"] .building-plot-modal .building-overview-actions > button:hover:not(:disabled),
body[data-page="island"] .building-plot-modal .building-overview-more summary:hover,
body[data-page="island"] .building-plot-modal .building-overview-actions > button:focus-visible,
body[data-page="island"] .building-plot-modal .building-overview-more summary:focus-visible {
  color: var(--building-ios-teal);
  transform: translateY(-1px);
  outline: 0;
}

body[data-page="island"] .building-plot-modal .building-overview-actions i,
body[data-page="island"] .building-plot-modal .building-overview-more summary i {
  color: var(--building-ios-gold);
  font-size: 25px;
}

body[data-page="island"] .building-plot-modal .building-overview-actions span,
body[data-page="island"] .building-plot-modal .building-overview-more summary span {
  color: inherit;
  font-size: 13px;
  font-weight: 950;
}

body[data-page="island"] .building-plot-modal .building-overview-actions > button:disabled {
  background: rgba(255, 255, 255, 0.34);
  color: rgba(30, 56, 52, 0.44);
  opacity: 1;
}

body[data-page="island"] .building-plot-modal .building-overview-more div {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(236, 249, 245, 0.74)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 38px rgba(20, 66, 59, 0.18);
  backdrop-filter: blur(18px) saturate(1.24);
  -webkit-backdrop-filter: blur(18px) saturate(1.24);
}

body[data-page="island"] .building-plot-modal .building-overview-more .danger,
body[data-page="island"] .building-plot-modal .building-modal-action-button button.danger {
  border-color: rgba(214, 69, 68, 0.42);
  background: linear-gradient(180deg, #ff746d, #d83d3d);
  color: #fffafa;
}

body[data-page="island"] .building-plot-modal .building-modal-action-grid {
  gap: 11px;
}

body[data-page="island"] .building-plot-modal .building-modal-action-card {
  min-height: 174px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.28)),
    rgba(238, 249, 245, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 4px 0 0 rgba(9, 143, 128, 0.52),
    0 10px 24px rgba(24, 74, 67, 0.08);
  padding: 13px;
}

body[data-page="island"] .building-plot-modal .building-modal-action-card.repair {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 4px 0 0 rgba(34, 199, 169, 0.54),
    0 10px 24px rgba(24, 74, 67, 0.08);
}

body[data-page="island"] .building-plot-modal .building-modal-action-card.demolish {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 4px 0 0 rgba(216, 61, 61, 0.58),
    0 10px 24px rgba(24, 74, 67, 0.08);
}

body[data-page="island"] .building-plot-modal .building-modal-action-button button {
  min-height: 42px;
  min-width: 112px;
  border-radius: 999px;
  font-weight: 950;
}

body[data-page="island"] .building-plot-modal .check-ok,
body[data-page="island"] .building-plot-modal .check-bad {
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.44);
}

body[data-page="island"] .building-plot-modal .check-ok {
  color: #078f80;
}

body[data-page="island"] .building-plot-modal .check-bad,
body[data-page="island"] .building-plot-modal .operation-reasons {
  color: #c83e3a;
}

body[data-page="island"] .building-plot-modal .empty-plot-cost-tile {
  border-color: rgba(20, 74, 67, 0.14);
  background: rgba(255, 255, 255, 0.5);
  color: #193b36;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body[data-page="island"] .empty-plot-modal.building-plot-modal {
    background: #eef8f5;
  }
}

@media (prefers-reduced-transparency: reduce) {
  body[data-page="island"] .selected-plot-modal-backdrop {
    background: rgba(222, 238, 234, 0.72);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body[data-page="island"] .empty-plot-modal.building-plot-modal {
    background: #eef8f5;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 560px) {
  body[data-page="island"] .empty-plot-modal.building-plot-modal {
    width: calc(100vw - 16px);
    border-radius: 26px;
  }

  body[data-page="island"] .building-plot-modal .empty-plot-modal-header {
    padding: 17px 18px 13px;
  }

  body[data-page="island"] .building-plot-modal .building-modal-title-link {
    font-size: 25px;
  }

  body[data-page="island"] .building-plot-modal .empty-plot-tabs {
    gap: 4px;
    min-height: 57px;
    padding: 7px 8px 12px;
  }

  body[data-page="island"] .building-plot-modal .empty-plot-tabs button {
    height: 38px;
    min-height: 0;
    font-size: 13px;
  }

  body[data-page="island"] .building-plot-modal .building-modal-body {
    padding: 12px;
  }

  body[data-page="island"] .building-plot-modal .building-modal-hero {
    min-height: 196px;
    border-radius: 22px;
  }

  body[data-page="island"] .building-plot-modal .building-overview-chip {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 66px;
    border-radius: 18px;
    padding: 10px;
  }

  body[data-page="island"] .building-plot-modal .building-overview-chip i {
    width: 48px;
    height: 48px;
    font-size: 21px;
  }

  body[data-page="island"] .building-plot-modal .building-overview-chip-icon-image {
    width: 50px;
    height: 50px;
  }

  body[data-page="island"] .building-plot-modal .building-overview-actions > button,
  body[data-page="island"] .building-plot-modal .building-overview-more summary {
    min-height: 64px;
    border-radius: 18px;
  }
}

@media (max-width: 420px) {
  body[data-page="island"] .building-plot-modal .building-modal-overview-chips,
  body[data-page="island"] .building-plot-modal .building-modal-info-grid,
  body[data-page="island"] .building-plot-modal .building-modal-action-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .building-plot-modal .building-overview-actions,
  body[data-page="island"] .building-plot-modal .building-overview-actions.residential-actions,
  body[data-page="island"] .building-plot-modal .building-overview-actions.compact-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Final readability pass for the island layout edit confirmation text. */
body[data-page="island"] .island-map-layout-edit-status {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  max-width: min(360px, calc(100vw - 190px));
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.24)),
    rgba(240, 251, 247, 0.32);
  color: rgba(27, 49, 49, 0.92);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.12;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.68);
}

body[data-page="island"] .island-map-layout-edit-status.valid {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(225, 252, 244, 0.38)),
    rgba(192, 244, 228, 0.24);
  color: #076b61;
}

body[data-page="island"] .island-map-layout-edit-status.invalid {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 235, 232, 0.42)),
    rgba(255, 222, 218, 0.28);
  color: #96342d;
}

@media (max-width: 560px) {
  body[data-page="island"] .island-map-layout-edit-status {
    max-width: min(260px, calc(100vw - 150px));
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }
}

/* Final HD clarity pass for building production recipes: no foggy mask over assets. */
body[data-page="island"] .building-plot-modal .building-production-tab {
  color: #173b36;
}

body[data-page="island"] .building-plot-modal .building-energy-kpis span,
body[data-page="island"] .building-plot-modal .building-energy-fuel-panel,
body[data-page="island"] .building-plot-modal .building-energy-fuel-static,
body[data-page="island"] .building-plot-modal .building-energy-facts div {
  border: 1px solid rgba(15, 105, 92, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(239, 251, 247, 0.55)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    0 8px 18px rgba(18, 86, 76, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body[data-page="island"] .building-plot-modal .building-energy-kpis em,
body[data-page="island"] .building-plot-modal .building-energy-fuel-copy span,
body[data-page="island"] .building-plot-modal .building-energy-fuel-control span,
body[data-page="island"] .building-plot-modal .building-energy-fuel-control small,
body[data-page="island"] .building-plot-modal .building-energy-fuel-static span,
body[data-page="island"] .building-plot-modal .building-energy-fuel-static small,
body[data-page="island"] .building-plot-modal .building-energy-facts span {
  color: rgba(44, 70, 65, 0.62);
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-energy-kpis strong,
body[data-page="island"] .building-plot-modal .building-energy-fuel-copy strong,
body[data-page="island"] .building-plot-modal .building-energy-fuel-static strong,
body[data-page="island"] .building-plot-modal .building-energy-facts strong {
  color: #173b36;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-energy-fuel-select {
  border: 1px solid rgba(7, 143, 128, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 251, 247, 0.9)),
    #ffffff;
  color: #173b36;
  box-shadow:
    0 8px 18px rgba(18, 86, 76, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body[data-page="island"] .building-plot-modal.select-open {
  overflow: visible;
  z-index: 260;
}

body[data-page="island"] .building-plot-modal.select-open .empty-plot-modal-body,
body[data-page="island"] .building-plot-modal.select-open .empty-plot-modal-body.building,
body[data-page="island"] .building-plot-modal.select-open .building-modal-body {
  overflow: visible;
}

body[data-page="island"] .building-plot-modal .building-energy-fuel-control .exchange-glass-select {
  z-index: 24;
}

body[data-page="island"] .building-plot-modal .building-energy-fuel-control .exchange-glass-select.open {
  z-index: 280;
}

body[data-page="island"] .building-plot-modal .building-energy-fuel-control .exchange-glass-select-button {
  min-height: 54px;
  border: 1px solid rgba(7, 143, 128, 0.28);
  border-radius: 20px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 251, 247, 0.82));
  color: #173b36;
  font-size: 18px;
  box-shadow:
    0 8px 18px rgba(18, 86, 76, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body[data-page="island"] .building-plot-modal .building-energy-fuel-control .exchange-glass-select-menu {
  width: max(100%, 300px);
  max-height: none;
  overflow: visible;
  border-radius: 22px;
}

body[data-page="island"] .building-plot-modal .building-energy-fuel-control .exchange-glass-select-option {
  min-height: 48px;
  font-size: 18px;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-production-filter-row {
  color: rgba(28, 56, 51, 0.84);
  font-size: 16px;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-production-heading-stack {
  gap: 5px;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-production-orders-button {
  min-width: 126px;
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid rgba(7, 143, 128, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(231, 250, 245, 0.5)),
    rgba(255, 255, 255, 0.36);
  color: #08786c;
  font-size: 16px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 5px 10px rgba(18, 86, 76, 0.06);
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-production-orders-button:hover,
body[data-page="island"] .building-plot-modal .building-production-tab .building-production-orders-button:focus-visible {
  border-color: rgba(7, 143, 128, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(221, 249, 242, 0.62)),
    rgba(255, 255, 255, 0.48);
  transform: translateY(-1px);
  outline: 0;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-production-toggle {
  color: rgba(28, 56, 51, 0.78);
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-card {
  border: 1px solid rgba(15, 105, 92, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 251, 247, 0.9)),
    #f7fffb;
  box-shadow:
    0 10px 22px rgba(18, 86, 76, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-card:hover {
  border-color: rgba(10, 143, 128, 0.44);
  background:
    linear-gradient(180deg, #ffffff, #effcf8),
    #f7fffb;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-card.selected {
  border-color: rgba(7, 143, 128, 0.7);
  box-shadow:
    0 12px 26px rgba(18, 86, 76, 0.12),
    inset 0 0 0 2px rgba(7, 143, 128, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-card.expanded {
  background:
    linear-gradient(180deg, #ffffff, #eefcf8),
    #f7fffb;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-card.blocked {
  opacity: 1;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-side > span,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-technology-cell > span,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-time-cell > span {
  color: rgba(44, 70, 65, 0.62);
  font-size: 13px;
  font-weight: 950;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-product.compact,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-tech-tile,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-asset {
  border: 1px solid rgba(20, 86, 78, 0.14) !important;
  border-radius: 4px;
  background: #ffffff;
  box-shadow:
    0 5px 10px rgba(18, 86, 76, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9) !important;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-product.compact .building-recipe-product-icon,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-tech-tile strong,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-asset strong {
  background: #ffffff;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-product-icon .product-icon-image,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-tech-tile .technology-industry-icon,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-asset .product-icon-image,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-asset .workforce-type-icon {
  image-rendering: auto;
  filter: none;
  opacity: 1;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-product.compact strong,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-tech-tile small,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-asset small {
  background: rgba(25, 49, 45, 0.9);
  color: #ffffff;
  font-weight: 950;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-product.compact em,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-tech-tile em,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-asset em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  top: 0;
  right: 0;
  box-sizing: border-box;
  min-width: 24px;
  max-width: calc(100% - 3px);
  height: 22px;
  padding: 0 5px;
  border: 0;
  border-radius: 0 4px 0 8px;
  background: linear-gradient(180deg, #c99a2a, #a87813);
  color: #ffffff;
  font-size: 12px;
  font-weight: 1000;
  line-height: 22px;
  text-align: center;
  text-shadow: none;
  box-shadow: -2px 2px 7px rgba(39, 31, 13, 0.18);
  z-index: 2;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-product.compact.missing {
  border-color: rgba(205, 67, 58, 0.38) !important;
  background: #fff8f7;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-tech-empty,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-no-items {
  border-color: rgba(31, 81, 74, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: rgba(38, 64, 59, 0.58);
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-time-cell strong {
  color: #08786c;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-duration.blocked,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-duration.placeholder {
  color: rgba(44, 70, 65, 0.66);
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail {
  border-top-color: rgba(15, 105, 92, 0.16);
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-stats span,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-order {
  border: 1px solid rgba(15, 105, 92, 0.12);
  background: rgba(255, 255, 255, 0.62);
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-stats em,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-products > span,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-time span {
  color: rgba(44, 70, 65, 0.58);
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-stats strong,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-time strong {
  color: #173b36;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-reasons {
  background: rgba(205, 67, 58, 0.1);
  color: #96342d;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-actions button,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-order button:not(.building-recipe-product):not(.building-recipe-detail-asset) {
  border-color: rgba(7, 143, 128, 0.42);
  background: linear-gradient(180deg, #19b99d, #08786c);
  color: #ffffff;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-actions button:disabled,
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-detail-order button:disabled {
  border-color: rgba(31, 81, 74, 0.12);
  background: rgba(31, 81, 74, 0.08);
  color: rgba(38, 64, 59, 0.44);
}

/* iOS 27-inspired building production queue. This is a web glass approximation. */
body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-empty,
body[data-page="island"] .building-plot-modal .building-production-tab .building-production-queue-empty,
body[data-page="island"] .building-plot-modal .building-production-tab .building-production-job-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(229, 250, 245, 0.5) 58%, rgba(248, 244, 226, 0.36)),
    rgba(255, 255, 255, 0.52);
  -webkit-backdrop-filter: blur(26px) saturate(170%) contrast(1.04);
  backdrop-filter: blur(26px) saturate(170%) contrast(1.04);
  box-shadow:
    0 18px 42px rgba(20, 86, 78, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(255, 255, 255, 0.34);
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-empty::before,
body[data-page="island"] .building-plot-modal .building-production-tab .building-production-queue-empty::before,
body[data-page="island"] .building-plot-modal .building-production-tab .building-production-job-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.34)),
    radial-gradient(circle at 86% 12%, rgba(112, 219, 200, 0.24), rgba(112, 219, 200, 0) 30%);
  pointer-events: none;
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-production-job-card::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 20px;
  bottom: 18px;
  z-index: -1;
  width: min(44%, 280px);
  background-image: var(--building-production-job-bg-image);
  background-position: center right;
  background-repeat: no-repeat;
  background-size: contain;
  filter: saturate(0.92) contrast(0.96);
  opacity: 0.13;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 100%);
}

body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-empty,
body[data-page="island"] .building-plot-modal .building-production-tab .building-production-queue-empty {
  padding: 18px 20px;
  color: rgba(21, 58, 52, 0.78);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.55;
  text-align: left;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-modal-job-list {
  margin-top: 18px;
}

body[data-page="island"] .building-plot-modal .building-production-queue-list {
  display: grid;
  gap: 14px;
}

body[data-page="island"] .building-plot-modal .building-production-job-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  color: #143a35;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-production-job-card.running {
  border-color: rgba(18, 184, 157, 0.32);
}

body[data-page="island"] .building-plot-modal .building-production-job-card.pending {
  border-color: rgba(207, 181, 98, 0.34);
}

body[data-page="island"] .building-plot-modal .building-production-job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

body[data-page="island"] .building-plot-modal .building-production-job-head > div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

body[data-page="island"] .building-plot-modal .building-production-job-head strong {
  color: #0e3934;
  font-size: 24px;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

body[data-page="island"] .building-plot-modal .building-production-job-status {
  justify-self: start;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  padding: 5px 11px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.46)),
    rgba(255, 255, 255, 0.5);
  color: #08786c;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  box-shadow:
    0 8px 18px rgba(16, 112, 100, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body[data-page="island"] .building-plot-modal .building-production-job-card.pending .building-production-job-status {
  color: #9a7518;
}

body[data-page="island"] .building-plot-modal .building-production-job-cancel {
  flex: 0 0 auto;
  min-width: 70px;
  min-height: 40px;
  border: 1px solid rgba(15, 105, 92, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 249, 246, 0.7)),
    rgba(255, 255, 255, 0.58);
  color: rgba(23, 59, 54, 0.82);
  font-size: 15px;
  font-weight: 850;
  box-shadow:
    0 10px 20px rgba(18, 86, 76, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body[data-page="island"] .building-plot-modal .building-production-job-cancel:hover,
body[data-page="island"] .building-plot-modal .building-production-job-cancel:focus-visible {
  border-color: rgba(7, 143, 128, 0.36);
  color: #08786c;
  transform: translateY(-1px);
}

body[data-page="island"] .building-plot-modal .building-production-job-cancel:active {
  transform: translateY(1px) scale(0.98);
}

body[data-page="island"] .building-plot-modal .building-production-job-timing,
body[data-page="island"] .building-plot-modal .building-production-job-facts {
  display: grid;
  gap: 10px;
}

body[data-page="island"] .building-plot-modal .building-production-job-timing {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="island"] .building-plot-modal .building-production-job-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="island"] .building-plot-modal .building-production-job-timing span,
body[data-page="island"] .building-plot-modal .building-production-job-facts span {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid rgba(15, 105, 92, 0.1);
  border-radius: 20px;
  padding: 11px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.34)),
    rgba(245, 255, 252, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(18, 86, 76, 0.06);
}

body[data-page="island"] .building-plot-modal .building-production-job-timing em,
body[data-page="island"] .building-plot-modal .building-production-job-facts em {
  color: rgba(40, 73, 67, 0.58);
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.2;
}

body[data-page="island"] .building-plot-modal .building-production-job-timing b,
body[data-page="island"] .building-plot-modal .building-production-job-facts b {
  color: #103b35;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

body[data-page="island"] .building-plot-modal .building-production-job-timing b {
  color: #08786c;
  font-size: 22px;
}

body[data-page="island"] .building-plot-modal .building-production-job-card.pending .building-production-job-timing b {
  color: #a17613;
}

body[data-page="island"] .building-plot-modal .building-production-job-rule {
  margin: 0;
  border-top: 1px solid rgba(15, 105, 92, 0.12);
  padding-top: 12px;
  color: rgba(38, 67, 62, 0.62);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.55;
}

@media (max-width: 760px) {
  body[data-page="island"] .building-plot-modal .building-production-job-card {
    border-radius: 24px;
    padding: 15px;
  }

  body[data-page="island"] .building-plot-modal .building-production-job-head {
    align-items: stretch;
  }

  body[data-page="island"] .building-plot-modal .building-production-job-head strong {
    font-size: 21px;
  }

  body[data-page="island"] .building-plot-modal .building-production-job-timing,
  body[data-page="island"] .building-plot-modal .building-production-job-facts {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-transparency: reduce) {
  body[data-page="island"] .building-plot-modal .building-production-tab .building-recipe-empty,
  body[data-page="island"] .building-plot-modal .building-production-tab .building-production-queue-empty,
  body[data-page="island"] .building-plot-modal .building-production-tab .building-production-job-card {
    background: rgba(248, 255, 252, 0.96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* iOS 27-inspired building skin tab. This is a web glass approximation. */
body[data-page="island"] .building-plot-modal .building-skin-tab {
  color: #143a35;
}

body[data-page="island"] .building-plot-modal .building-skin-card {
  grid-template-columns: minmax(220px, 0.92fr) minmax(0, 1.08fr);
  align-items: stretch;
  gap: 18px;
}

body[data-page="island"] .building-plot-modal .building-skin-preview-button,
body[data-page="island"] .building-plot-modal .building-skin-empty {
  width: 100%;
  height: auto;
  min-height: 226px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  background:
    radial-gradient(circle at 48% 30%, rgba(255, 255, 255, 0.9), transparent 38%),
    radial-gradient(circle at 70% 78%, rgba(46, 196, 172, 0.16), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(239, 251, 247, 0.58)),
    rgba(255, 255, 255, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(19, 83, 75, 0.08),
    0 14px 30px rgba(22, 76, 68, 0.1);
  backdrop-filter: blur(20px) saturate(1.32);
  -webkit-backdrop-filter: blur(20px) saturate(1.32);
}

body[data-page="island"] .building-plot-modal .building-skin-preview-button {
  padding: 14px;
}

body[data-page="island"] .building-plot-modal .building-skin-preview-button:hover,
body[data-page="island"] .building-plot-modal .building-skin-preview-button:focus-visible {
  border-color: rgba(8, 143, 128, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    0 16px 32px rgba(22, 76, 68, 0.13);
  outline: 0;
}

body[data-page="island"] .building-plot-modal .building-skin-preview {
  max-width: 90%;
  max-height: 90%;
  filter: drop-shadow(0 16px 18px rgba(26, 71, 62, 0.2));
  transform: translate(var(--skin-center-shift-x, 0), var(--skin-center-shift-y, 0)) scale(1.08);
}

body[data-page="island"] .building-plot-modal .building-skin-current {
  justify-content: center;
  gap: 13px;
  min-height: 226px;
  padding: 24px 26px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(236, 250, 246, 0.52)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(31, 92, 83, 0.08),
    0 14px 30px rgba(22, 76, 68, 0.09);
}

body[data-page="island"] .building-plot-modal .building-skin-current span,
body[data-page="island"] .building-plot-modal .building-skin-option small {
  color: rgba(35, 70, 64, 0.68);
  font-weight: 900;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-skin-current span {
  font-size: 15px;
}

body[data-page="island"] .building-plot-modal .building-skin-current strong {
  color: #123a35;
  font-size: 32px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-skin-current small {
  max-width: 560px;
  color: rgba(35, 70, 64, 0.72);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.5;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-skin-list {
  gap: 12px;
}

body[data-page="island"] .building-plot-modal .building-skin-option {
  grid-template-columns: 112px minmax(0, 1fr) minmax(94px, auto);
  gap: 12px;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.86), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(235, 250, 246, 0.5)),
    rgba(255, 255, 255, 0.44);
  color: #143a35;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(31, 92, 83, 0.08),
    0 12px 28px rgba(22, 76, 68, 0.09);
  opacity: 1;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body[data-page="island"] .building-plot-modal .building-skin-option:hover {
  border-color: rgba(8, 143, 128, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(31, 92, 83, 0.08),
    0 16px 32px rgba(22, 76, 68, 0.12);
  transform: translateY(-1px);
}

body[data-page="island"] .building-plot-modal .building-skin-option.owned {
  border-color: rgba(8, 143, 128, 0.3);
}

body[data-page="island"] .building-plot-modal .building-skin-option.ready {
  border-color: rgba(176, 139, 46, 0.32);
}

body[data-page="island"] .building-plot-modal .building-skin-option.gem-locked {
  border-color: rgba(75, 147, 192, 0.3);
}

body[data-page="island"] .building-plot-modal .building-skin-option.locked {
  border-color: rgba(37, 70, 64, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(235, 244, 241, 0.38)),
    rgba(255, 255, 255, 0.34);
}

body[data-page="island"] .building-plot-modal .building-skin-image-button {
  width: 112px;
  height: 92px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background:
    radial-gradient(circle at 42% 22%, rgba(255, 255, 255, 0.92), transparent 44%),
    linear-gradient(180deg, #fffefa, #eef9f5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 18px rgba(22, 76, 68, 0.11);
}

body[data-page="island"] .building-plot-modal .building-skin-image-button:hover,
body[data-page="island"] .building-plot-modal .building-skin-image-button:focus-visible {
  border-color: rgba(8, 143, 128, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 10px 20px rgba(22, 76, 68, 0.13);
  outline: 0;
}

body[data-page="island"] .building-plot-modal .building-skin-image-button img {
  max-width: 98%;
  max-height: 98%;
  filter: drop-shadow(0 9px 10px rgba(26, 71, 62, 0.18));
  transform: translate(var(--skin-center-shift-x, 0), var(--skin-center-shift-y, 0)) scale(1.12);
}

body[data-page="island"] .building-plot-modal .building-skin-option.locked .building-skin-image-button img {
  filter: saturate(0.72) opacity(0.82);
}

body[data-page="island"] .building-plot-modal .building-skin-option-main {
  gap: 8px;
}

body[data-page="island"] .building-plot-modal .building-skin-option-head {
  align-items: center;
}

body[data-page="island"] .building-plot-modal .building-skin-option-head strong {
  color: #123a35;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-skin-option-head span {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(237, 249, 245, 0.42)),
    rgba(26, 64, 58, 0.08);
  color: rgba(70, 83, 62, 0.88);
  font-size: 13px;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-skin-option > button:not(.building-skin-image-button) {
  min-width: 92px;
  min-height: 40px;
  border: 1px solid rgba(8, 143, 128, 0.36);
  border-radius: 12px;
  background:
    linear-gradient(180deg, #20c7ad, #078f80 48%, #06796d);
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 8px 16px rgba(7, 112, 101, 0.18);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
}

body[data-page="island"] .building-plot-modal .building-skin-option > button:not(.building-skin-image-button):hover:not(:disabled),
body[data-page="island"] .building-plot-modal .building-skin-option > button:not(.building-skin-image-button):focus-visible:not(:disabled) {
  border-color: rgba(7, 143, 128, 0.58);
  background:
    linear-gradient(180deg, #31d7bd, #0b9a8a 48%, #087d71);
  outline: 0;
}

body[data-page="island"] .building-plot-modal .building-skin-option > button.secondary:disabled,
body[data-page="island"] .building-plot-modal .building-skin-option > button:disabled {
  border-color: rgba(35, 70, 64, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(237, 246, 243, 0.34)),
    rgba(35, 70, 64, 0.08);
  color: rgba(35, 70, 64, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
  text-shadow: none;
}

body[data-page="island"] .building-skin-lightbox-backdrop {
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.42), transparent 32%),
    rgba(205, 226, 221, 0.48);
  backdrop-filter: blur(18px) saturate(1.36);
  -webkit-backdrop-filter: blur(18px) saturate(1.36);
}

body[data-page="island"] .building-skin-lightbox {
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 30px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.86), transparent 34%),
    radial-gradient(circle at 84% 10%, rgba(231, 210, 139, 0.22), transparent 42%),
    linear-gradient(145deg, rgba(250, 255, 253, 0.86), rgba(223, 242, 237, 0.72)),
    rgba(238, 249, 245, 0.82);
  color: #143a35;
  box-shadow:
    0 36px 92px rgba(20, 63, 56, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body[data-page="island"] .building-skin-lightbox-close {
  top: 14px;
  right: 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(239, 249, 246, 0.48)),
    rgba(255, 255, 255, 0.44);
  color: rgba(34, 60, 56, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 10px 24px rgba(22, 56, 51, 0.12);
}

body[data-page="island"] .building-skin-lightbox-image-wrap {
  background:
    radial-gradient(circle at 52% 34%, rgba(255, 255, 255, 0.94), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(238, 250, 246, 0.56));
}

body[data-page="island"] .building-skin-lightbox-footer {
  border-top: 1px solid rgba(20, 86, 78, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(239, 250, 246, 0.42)),
    rgba(255, 255, 255, 0.34);
  color: #143a35;
}

body[data-page="island"] .building-skin-lightbox-footer span,
body[data-page="island"] .building-skin-lightbox-footer small {
  color: rgba(35, 70, 64, 0.66);
  text-shadow: none;
}

body[data-page="island"] .building-skin-lightbox-footer strong {
  color: #123a35;
  text-shadow: none;
}

@media (max-width: 760px) {
  body[data-page="island"] .building-plot-modal .building-skin-card {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .building-plot-modal .building-skin-option {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  body[data-page="island"] .building-plot-modal .building-skin-image-button {
    width: 96px;
  }

  body[data-page="island"] .building-plot-modal .building-skin-option > button:not(.building-skin-image-button) {
    grid-column: 2;
    justify-self: start;
  }
}

/* iOS 27-inspired empty-plot build modal. This is a visual-only pass:
   build filters, costs, workforce checks, and backend calls stay unchanged. */
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) {
  --empty-build-ink: #153833;
  --empty-build-muted: rgba(28, 61, 55, 0.66);
  --empty-build-line: rgba(255, 255, 255, 0.62);
  --empty-build-soft-line: rgba(30, 82, 74, 0.12);
  --empty-build-panel: rgba(255, 255, 255, 0.5);
  --empty-build-panel-strong: rgba(255, 255, 255, 0.72);
  --empty-build-teal: #078f80;
  --empty-build-teal-strong: #046f66;
  --empty-build-mint: #25d1ae;
  --empty-build-gold: #9d8130;
  top: max(14px, calc(var(--global-topbar-height) + 8px));
  width: min(1480px, calc(100vw - 28px));
  max-height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 22px);
  border: 1px solid var(--empty-build-line);
  border-radius: 32px;
  background:
    radial-gradient(ellipse at 10% 0%, rgba(255, 255, 255, 0.92), transparent 38%),
    radial-gradient(ellipse at 92% 8%, rgba(95, 213, 196, 0.26), transparent 42%),
    radial-gradient(ellipse at 54% 100%, rgba(230, 207, 146, 0.16), transparent 45%),
    linear-gradient(145deg, rgba(251, 255, 253, 0.8), rgba(224, 244, 239, 0.66) 54%, rgba(248, 251, 247, 0.76)),
    rgba(238, 249, 245, 0.84);
  color: var(--empty-build-ink);
  box-shadow:
    0 34px 82px rgba(19, 54, 48, 0.25),
    0 10px 28px rgba(5, 31, 28, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(31, 92, 83, 0.08);
  backdrop-filter: blur(34px) saturate(1.52) contrast(1.03);
  -webkit-backdrop-filter: blur(34px) saturate(1.52) contrast(1.03);
  isolation: isolate;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), transparent 26%),
    linear-gradient(315deg, rgba(255, 255, 255, 0.28), transparent 34%);
  opacity: 0.78;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-header,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body {
  position: relative;
  z-index: 1;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-header {
  align-items: center;
  border-bottom: 1px solid rgba(22, 56, 51, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.18)),
    rgba(238, 250, 246, 0.34);
  padding: 21px 25px 16px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-header strong {
  color: #173a35;
  font-size: 30px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.02;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.62);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-kicker {
  margin-bottom: 5px;
  color: var(--empty-build-muted);
  font-size: 13px;
  font-weight: 950;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(241, 250, 247, 0.46)),
    rgba(255, 255, 255, 0.38);
  color: rgba(28, 54, 50, 0.66);
  font-size: 28px;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 10px 24px rgba(22, 56, 51, 0.12);
  transition: color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .icon-button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .icon-button:focus-visible {
  color: #102f2b;
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs {
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 8px 14px 14px;
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(29, 59, 54, 0.62);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button:focus-visible {
  border-color: rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.34);
  color: #123b35;
  outline: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button.selected {
  border-color: rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 251, 247, 0.72)),
    rgba(255, 255, 255, 0.64);
  color: var(--empty-build-teal);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(9, 137, 122, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body.build {
  border-top: 1px solid rgba(22, 56, 51, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(232, 248, 244, 0.18)),
    rgba(238, 249, 246, 0.16);
  scrollbar-color: rgba(35, 90, 82, 0.34) transparent;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body.build .empty-plot-toolbar {
  gap: 14px;
  grid-template-columns: minmax(248px, 390px) minmax(340px, 560px);
  border-bottom: 1px solid rgba(22, 56, 51, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.18)),
    rgba(237, 250, 246, 0.36);
  padding: 14px 18px 16px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs {
  min-height: 48px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(239, 250, 247, 0.42)),
    rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 10px 22px rgba(22, 74, 66, 0.08);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select {
  grid-template-columns: 104px minmax(0, 1fr);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select span {
  border-right: 1px solid rgba(28, 80, 72, 0.1);
  background: rgba(255, 255, 255, 0.28);
  color: var(--empty-build-gold);
  font-size: 14px;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select select {
  height: 48px;
  background: transparent;
  color: #173a35;
  font-size: 18px;
  font-weight: 950;
  text-shadow: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs {
  grid-template-columns: repeat(4, minmax(72px, 1fr));
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button {
  min-height: 48px;
  border-left: 1px solid rgba(28, 80, 72, 0.1);
  color: rgba(25, 61, 55, 0.64);
  font-size: 18px;
  font-weight: 950;
  text-shadow: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button:focus-visible {
  background: rgba(255, 255, 255, 0.38);
  color: #123b35;
  outline: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button.selected {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(221, 250, 243, 0.58)),
    rgba(255, 255, 255, 0.56);
  color: var(--empty-build-teal);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -2px 0 rgba(7, 143, 128, 0.38);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-list {
  gap: 12px;
  padding: 16px 18px 20px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row {
  position: relative;
  grid-template-columns: minmax(360px, 500px) minmax(0, 1fr);
  gap: 24px;
  min-height: 286px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-left: 0;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 0% 0%, var(--industry-surface, rgba(7, 143, 128, 0.12)), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.28)),
    rgba(240, 251, 247, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 18px 38px rgba(20, 66, 59, 0.12);
  padding: 16px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 28px 0 0 28px;
  background: linear-gradient(180deg, var(--industry-color, var(--empty-build-teal)), rgba(255, 255, 255, 0.2));
  opacity: 0.86;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row:hover {
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 22px 46px rgba(20, 66, 59, 0.16);
  transform: translateY(-1px);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-main {
  grid-template-columns: minmax(250px, 1fr) 112px;
  gap: 12px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-card {
  grid-template-rows: minmax(188px, 1fr) 56px;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.92), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(229, 245, 240, 0.5));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(20, 72, 64, 0.1);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .building-thumb {
  height: 100%;
  min-height: 188px;
  border-radius: 23px 23px 0 0;
  background: transparent;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .building-thumb-image {
  transform: scale(1.08) translateY(-3%);
  filter: drop-shadow(0 18px 18px rgba(24, 70, 62, 0.2));
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-title {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.2)),
    rgba(15, 49, 44, 0.74);
  color: #ffffff;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.08;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta {
  gap: 12px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta span {
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.26)),
    rgba(255, 255, 255, 0.34);
  color: var(--empty-build-muted);
  font-size: 16px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 8px 18px rgba(20, 72, 64, 0.08);
  text-shadow: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta span.industry-chip {
  border-color: rgba(255, 255, 255, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(0, 0, 0, 0.08)),
    var(--industry-color, var(--empty-build-teal));
  color: #ffffff;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-side,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirements {
  height: auto;
  min-height: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirements {
  grid-template-rows: auto auto;
  align-content: center;
  gap: 20px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-group {
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 14px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-label {
  min-width: 0;
  color: #173a35;
  font-size: 15px;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.62);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-label::before {
  width: 4px;
  background: linear-gradient(180deg, var(--empty-build-gold), rgba(157, 129, 48, 0.26));
  box-shadow: 0 0 18px rgba(157, 129, 48, 0.18);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-tiles {
  grid-template-columns: repeat(auto-fill, minmax(88px, 88px));
  gap: 10px 12px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .build-asset-frame {
  width: 88px;
  height: 98px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.28)),
    rgba(255, 255, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 9px 18px rgba(20, 72, 64, 0.08);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile strong {
  height: 68px;
  background: rgba(255, 255, 255, 0.5);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile small {
  min-height: 30px;
  background: rgba(17, 51, 46, 0.74);
  color: #f9fffb;
  font-size: 13px;
  font-weight: 950;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile em {
  min-width: 27px;
  border-radius: 0 15px 0 9px;
  background: rgba(21, 56, 51, 0.74);
  color: #ffffff;
  font-size: 16px;
  font-weight: 950;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile.missing .build-asset-frame {
  border-color: rgba(211, 69, 63, 0.68);
  box-shadow:
    inset 0 0 0 2px rgba(211, 69, 63, 0.38),
    0 9px 18px rgba(121, 25, 22, 0.12);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile.workforce.enough .build-asset-frame,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile.population-reward .build-asset-frame {
  border-color: rgba(7, 143, 128, 0.42);
  box-shadow:
    inset 0 0 0 2px rgba(7, 143, 128, 0.24),
    0 9px 18px rgba(20, 72, 64, 0.1);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-action-row {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  align-items: end;
  gap: 22px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button {
  align-self: end;
  min-height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.46), transparent 46%),
    linear-gradient(180deg, #159b8e, #066f66);
  color: #f8fffc;
  font-size: 25px;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16),
    0 16px 30px rgba(6, 111, 102, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button:hover:not(:disabled),
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button:focus-visible:not(:disabled) {
  filter: brightness(1.05);
  outline: 0;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    inset 0 -1px 0 rgba(0, 0, 0, 0.14),
    0 20px 36px rgba(6, 111, 102, 0.28);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button:disabled {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(232, 238, 236, 0.34)),
    rgba(255, 255, 255, 0.36);
  color: rgba(29, 58, 53, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 10px 20px rgba(20, 72, 64, 0.08);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-state.compact {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.28)),
    rgba(255, 255, 255, 0.36);
  color: var(--empty-build-muted);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 12px 26px rgba(20, 72, 64, 0.08);
}

@media (prefers-reduced-transparency: reduce) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) {
    background: #eef8f5;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 1180px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirements {
    align-content: start;
  }
}

@media (max-width: 760px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) {
    width: calc(100vw - 16px);
    border-radius: 26px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-header {
    padding: 17px 18px 13px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-header strong {
    font-size: 25px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs {
    gap: 5px;
    min-height: 57px;
    padding: 7px 8px 12px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button {
    min-height: 38px;
    font-size: 13px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body.build .empty-plot-toolbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-list {
    padding: 12px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row {
    border-radius: 24px;
    padding: 12px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-main,
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-action-row {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-group {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-label {
    justify-self: start;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-tiles {
    grid-template-columns: repeat(auto-fill, minmax(84px, 84px));
  }
}

/* Empty-plot build modal v2: preserve the previous layout geometry exactly.
   This pass only changes surface treatment, keeping image, row, cost and button sizes. */
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) {
  --empty-build-ink: #f4f1e8;
  --empty-build-muted: rgba(221, 216, 202, 0.76);
  --empty-build-line: rgba(203, 226, 235, 0.2);
  --empty-build-soft-line: rgba(255, 255, 255, 0.075);
  --empty-build-panel: rgba(22, 27, 28, 0.76);
  --empty-build-panel-strong: rgba(34, 40, 42, 0.86);
  --empty-build-blue: #4b7eac;
  --empty-build-blue-strong: #365f87;
  --empty-build-gold: #cdbc92;
  top: 88px;
  left: 50%;
  width: min(1420px, calc(100vw - 56px));
  max-height: calc(100vh - 124px);
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid rgba(160, 190, 204, 0.26);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(112, 163, 196, 0.16), transparent 38%),
    radial-gradient(ellipse at 90% 0%, rgba(231, 209, 149, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(49, 53, 54, 0.94), rgba(20, 24, 24, 0.96) 42%, rgba(12, 15, 15, 0.98)),
    rgba(24, 27, 27, 0.96);
  color: var(--empty-build-ink);
  box-shadow:
    0 30px 76px rgba(2, 10, 13, 0.52),
    0 12px 28px rgba(3, 18, 24, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateX(-50%);
  backdrop-filter: blur(24px) saturate(1.24);
  -webkit-backdrop-filter: blur(24px) saturate(1.24);
  isolation: isolate;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), transparent 28%),
    linear-gradient(315deg, rgba(255, 255, 255, 0.055), transparent 38%);
  opacity: 0.9;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-header,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body {
  position: relative;
  z-index: 1;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-header {
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(79, 82, 82, 0.86), rgba(55, 58, 58, 0.92)),
    rgba(68, 68, 68, 0.92);
  padding: 14px 18px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-header strong {
  color: #ffffff;
  font-size: 22px;
  font-weight: 950;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-kicker {
  margin-bottom: 3px;
  color: var(--empty-build-gold);
  font-size: 12px;
  font-weight: 900;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(244, 241, 232, 0.72);
  font-size: 30px;
  line-height: 1;
  padding: 0;
  box-shadow: none;
  transition: color 140ms ease, background 140ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .icon-button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  outline: 0;
  transform: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  min-height: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(42, 47, 48, 0.94), rgba(30, 35, 35, 0.96)),
    rgba(41, 43, 43, 0.96);
  padding: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button {
  min-height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #9fc9ee;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button:focus-visible {
  background: rgba(96, 144, 185, 0.18);
  color: #ffffff;
  outline: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button.selected {
  background:
    linear-gradient(180deg, rgba(82, 128, 174, 0.98), rgba(58, 96, 135, 0.98)),
    #3f648c;
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -14px 24px rgba(0, 0, 0, 0.08);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body.build {
  border-top: 0;
  background:
    radial-gradient(ellipse at 16% 0%, rgba(111, 169, 213, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(24, 29, 29, 0.98), rgba(10, 13, 13, 0.98));
  overflow: hidden;
  scrollbar-color: rgba(137, 173, 196, 0.44) rgba(255, 255, 255, 0.06);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body.build .empty-plot-toolbar {
  display: grid;
  grid-template-columns: minmax(340px, 382px) minmax(420px, 560px) minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(39, 45, 45, 0.98), rgba(24, 29, 29, 0.97)),
    rgba(25, 28, 27, 0.97);
  padding: 12px 18px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs {
  min-height: 46px;
  overflow: hidden;
  border: 1px solid rgba(123, 159, 184, 0.5);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(41, 47, 47, 0.96), rgba(25, 31, 31, 0.96)),
    rgba(34, 38, 37, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(0, 0, 0, 0.16);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select {
  grid-template-columns: 96px minmax(0, 1fr);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select span {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(111, 105, 82, 0.72), rgba(63, 65, 57, 0.76));
  color: #e5dab8;
  font-size: 15px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select select {
  height: 46px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: rgba(31, 35, 34, 0.72);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  padding: 0 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs {
  grid-template-columns: repeat(4, minmax(92px, 1fr));
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button {
  min-height: 46px;
  border: 0;
  border-left: 1px solid rgba(123, 159, 184, 0.34);
  border-radius: 0;
  background: transparent;
  color: #9fc9ee;
  font-size: 18px;
  font-weight: 900;
  padding: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button:first-child {
  border-left: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button:focus-visible {
  background: rgba(96, 144, 185, 0.18);
  color: #ffffff;
  outline: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button.selected {
  background:
    linear-gradient(180deg, rgba(82, 128, 174, 0.96), rgba(58, 96, 135, 0.98));
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    inset 0 -12px 20px rgba(0, 0, 0, 0.1);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-list {
  gap: 14px;
  padding: 0 16px 18px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row {
  position: relative;
  grid-template-columns: 520px minmax(0, 1fr);
  gap: 24px;
  min-height: 318px;
  overflow: hidden;
  border: 0;
  border-left: 4px solid var(--industry-color, rgba(143, 150, 144, 0.7));
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 0% 0%, var(--industry-surface, rgba(143, 150, 144, 0.1)), transparent 44%),
    linear-gradient(90deg, rgba(32, 37, 36, 0.96), rgba(16, 20, 20, 0.97) 36%, rgba(9, 12, 12, 0.98)),
    rgba(20, 22, 22, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 16px 32px rgba(0, 0, 0, 0.24);
  padding: 18px 20px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row::before {
  display: none;
  content: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row:hover {
  border-left-color: var(--industry-color, rgba(143, 150, 144, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.065),
    0 18px 36px rgba(0, 0, 0, 0.28);
  transform: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-main {
  grid-template-columns: 376px 118px;
  gap: 22px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-card {
  grid-template-rows: 238px 62px;
  width: 376px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 14px 30px rgba(0, 0, 0, 0.18);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .building-thumb {
  justify-self: stretch;
  width: 100%;
  height: 238px;
  min-height: 0;
  border-radius: 8px 8px 0 0;
  background: #ffffff;
  box-shadow: none;
  font-size: 48px;
  overflow: hidden;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .building-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  transform: scale(1.18) translateY(-5%);
  transform-origin: center center;
  filter: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-title {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(29, 34, 33, 0.98), rgba(16, 20, 19, 0.96));
  font-size: 25px;
  font-weight: 950;
  line-height: 1.12;
  padding: 8px 10px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta {
  grid-template-columns: none;
  gap: 24px;
  margin-top: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta span {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.055));
  color: #ded8ca;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
  padding: 8px 10px;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 18px rgba(0, 0, 0, 0.14);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta span.industry-chip {
  border-color: rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.14)),
    var(--industry-color, #8f9690);
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-side {
  height: 300px;
  min-height: 0;
  padding: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirements {
  grid-template-rows: 120px 120px;
  align-content: stretch;
  gap: 60px;
  height: 300px;
  min-height: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-group {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-label {
  justify-self: end;
  width: auto;
  min-width: 88px;
  min-height: 34px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  padding: 2px 0 0 16px;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-label::before {
  width: 4px;
  height: 34px;
  border-radius: 999px;
  background: rgba(202, 188, 150, 0.86);
  box-shadow: 0 0 14px rgba(202, 188, 150, 0.18);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-tiles {
  grid-template-columns: repeat(auto-fill, minmax(108px, 108px));
  gap: 14px 18px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-action-row {
  grid-template-columns: minmax(0, 1fr) 258px;
  align-items: start;
  gap: 34px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .build-asset-frame {
  grid-template-rows: minmax(76px, 1fr) auto;
  width: 108px;
  height: 120px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.16);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .empty-plot-cost-tile.build-asset-tile strong {
  height: 84px;
  background: #f3f0e8;
  font-size: 31px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .empty-plot-cost-tile.build-asset-tile em {
  top: 0;
  right: 0;
  min-width: 30px;
  border-radius: 0 0 0 4px;
  background: rgba(26, 28, 27, 0.76);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  padding: 3px 7px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .empty-plot-cost-tile.build-asset-tile small {
  min-height: 36px;
  background: rgba(26, 28, 27, 0.82);
  color: #fff3dc;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.12;
  padding: 8px 4px 7px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile.missing .build-asset-frame {
  box-shadow:
    inset 0 0 0 2px rgba(220, 66, 48, 0.86),
    0 10px 20px rgba(0, 0, 0, 0.16);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile.workforce.enough .build-asset-frame {
  box-shadow:
    inset 0 0 0 2px rgba(111, 181, 133, 0.78),
    0 10px 20px rgba(0, 0, 0, 0.16);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile.population-reward .build-asset-frame {
  box-shadow:
    inset 0 0 0 2px rgba(125, 160, 107, 0.86),
    0 0 18px rgba(125, 160, 107, 0.18),
    0 10px 20px rgba(0, 0, 0, 0.16);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button {
  grid-column: 2;
  align-self: start;
  justify-self: stretch;
  width: 100%;
  min-height: 120px;
  border: 1px solid rgba(145, 196, 237, 0.78);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.24), transparent 50%),
    linear-gradient(180deg, #4b7eac, #345a7d);
  color: #ffffff;
  font-size: 25px;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -12px 20px rgba(0, 0, 0, 0.08),
    0 12px 22px rgba(0, 0, 0, 0.22);
  transition: filter 140ms ease, box-shadow 140ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button:hover:not(:disabled),
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button:focus-visible:not(:disabled) {
  filter: brightness(1.06);
  outline: 0;
  transform: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -12px 20px rgba(0, 0, 0, 0.08),
    0 14px 26px rgba(0, 0, 0, 0.26);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button:active:not(:disabled) {
  transform: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button:disabled {
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(87, 96, 100, 0.56), rgba(43, 49, 51, 0.58));
  color: rgba(244, 241, 232, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 18px rgba(0, 0, 0, 0.16);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-state.compact {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--empty-build-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@media (prefers-reduced-transparency: reduce) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) {
    background: rgba(24, 27, 27, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 1350px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row {
    grid-template-columns: 460px minmax(0, 1fr);
    gap: 20px;
    min-height: 292px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-main {
    grid-template-columns: 330px 104px;
    gap: 18px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-card {
    grid-template-rows: 210px 56px;
    width: 330px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .building-thumb {
    height: 210px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-title {
    font-size: 22px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-side {
    height: 266px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirements {
    grid-template-rows: 110px 110px;
    gap: 46px;
    height: 266px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-group {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-label {
    width: auto;
    min-width: 84px;
    min-height: 32px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-tiles {
    grid-template-columns: repeat(auto-fill, minmax(96px, 96px));
    gap: 12px 14px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-action-row {
    grid-template-columns: minmax(0, 1fr) 224px;
    gap: 24px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .build-asset-frame {
    width: 96px;
    height: 110px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .empty-plot-cost-tile.build-asset-tile strong {
    height: 76px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button {
    width: 100%;
    min-height: 110px;
  }
}

@media (max-width: 1100px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) {
    left: 50%;
    width: calc(100vw - 32px);
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body.build .empty-plot-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-main {
    grid-template-columns: minmax(260px, 376px) 118px;
    align-items: start;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-card {
    grid-template-rows: 220px 58px;
    width: min(376px, 100%);
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .building-thumb {
    height: 220px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-title {
    font-size: 22px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-side {
    height: auto;
    padding-top: 0;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirements {
    grid-template-rows: none;
    height: auto;
    gap: 24px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-action-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-group,
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group,
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button {
    width: 100%;
    min-height: 86px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-costs {
    justify-content: flex-start;
    max-width: none;
  }
}

/* Unified State Affairs tab rail: one liquid-glass language across every government tab. */
.technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  flex: 0 1 min(760px, 58vw);
  width: min(760px, 58vw);
  max-width: min(760px, 58vw);
  min-width: 0;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(232, 248, 244, 0.58) 54%, rgba(255, 249, 231, 0.56)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(91, 137, 130, 0.13),
    0 16px 38px rgba(34, 72, 67, 0.13);
  scrollbar-width: none;
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  backdrop-filter: blur(18px) saturate(1.16);
}

.technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tabs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 clamp(10px, 1.2vw, 18px);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(28, 59, 56, 0.66);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab:hover {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.34);
  color: rgba(18, 50, 48, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab.selected {
  background:
    linear-gradient(145deg, rgba(20, 154, 139, 0.96), rgba(10, 108, 112, 0.92)),
    rgba(14, 145, 130, 0.82);
  color: #fffdf4;
  box-shadow:
    0 10px 26px rgba(6, 108, 101, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(2, 70, 75, 0.18);
  transform: translateY(-1px);
}

.policy-doctrine-concept-banner {
  display: none;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-hero {
  align-items: stretch;
  column-gap: clamp(20px, 2.4vw, 34px);
  grid-template-areas:
    "summary concept";
  grid-template-columns: minmax(430px, 0.48fr) minmax(760px, 1fr);
  grid-template-rows: auto;
  padding: 14px 18px;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-summary {
  display: grid;
  grid-area: summary;
  align-content: center;
  align-self: stretch;
  gap: 15px;
  padding-left: clamp(2px, 0.5vw, 10px);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-concept-banner {
  position: relative;
  grid-area: concept;
  display: block;
  align-self: stretch;
  justify-self: center;
  height: 100%;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 26px;
  background:
    linear-gradient(90deg, rgba(238, 250, 247, 0.44), rgba(238, 250, 247, 0.06) 18%, transparent 76%, rgba(247, 244, 224, 0.34)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 36%, rgba(238, 250, 247, 0.14)),
    url("/assets/government-concepts/state-affairs-factions.png") center 52% / cover no-repeat,
    rgba(232, 247, 243, 0.36);
  filter: saturate(0.9) contrast(0.98) brightness(1.02);
  isolation: isolate;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    inset 0 18px 36px rgba(255, 255, 255, 0.18),
    inset 0 -22px 38px rgba(14, 95, 101, 0.12),
    0 20px 44px rgba(42, 75, 70, 0.12);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-concept-banner::before,
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-concept-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-concept-banner::before {
  background:
    radial-gradient(ellipse at 8% 50%, rgba(244, 252, 249, 0.54), transparent 42%),
    radial-gradient(ellipse at 98% 52%, rgba(247, 244, 224, 0.5), transparent 40%);
  mix-blend-mode: screen;
  opacity: 0.88;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-concept-banner::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.36), transparent 16%, transparent 84%, rgba(255, 255, 255, 0.26)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 48%, rgba(10, 63, 69, 0.08));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.74),
    inset 0 0 30px rgba(239, 250, 247, 0.2);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-panel {
  grid-area: auto;
  align-self: start;
  max-width: 620px;
  padding: 13px 15px;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-hero h1 {
  font-size: clamp(50px, 4vw, 72px);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-head {
  margin-bottom: 6px;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-score {
  gap: 8px;
  margin-bottom: 8px;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-score strong {
  font-size: clamp(44px, 4.3vw, 64px);
  line-height: 0.92;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-rail {
  height: 6px;
  margin: 8px 0 10px;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-metrics {
  gap: 8px;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-mandate-metrics div {
  min-height: 58px;
  padding: 10px 12px;
}

@media (max-width: 980px) {
  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tabs {
    width: 100%;
    max-width: none;
  }

  :is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-hero {
    grid-template-areas:
      "summary"
      "concept";
    grid-template-columns: 1fr;
  }

  :is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-concept-banner {
    min-height: 180px;
  }
}

@media (max-width: 760px) {
  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-left: 0;
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab {
    min-width: 0;
    min-height: 40px;
    font-size: 13px;
  }
}

/* Final mobile State Affairs tab rail: one horizontal text-only glass bar. */
@media (max-width: 760px) {
  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-content: end;
    align-items: center;
    gap: 8px 10px;
    padding: 12px 14px 0;
    border-bottom-color: rgba(122, 166, 157, 0.22);
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-head > div {
    min-width: 0;
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-close {
    grid-column: 2;
    grid-row: 1;
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tabs {
    grid-column: 1 / -1;
    order: 3;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-self: end;
    align-items: stretch;
    width: 100%;
    max-width: none;
    min-height: 50px;
    margin: 2px 0 -1px;
    padding: 5px;
    gap: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-bottom-color: rgba(126, 171, 162, 0.18);
    border-radius: 24px 24px 0 0;
    background:
      radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.88), transparent 42%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(224, 248, 243, 0.4) 56%, rgba(255, 246, 225, 0.34)),
      rgba(239, 252, 248, 0.38);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      inset 0 -1px 0 rgba(48, 104, 95, 0.08),
      0 -10px 24px rgba(255, 255, 255, 0.26),
      0 12px 28px rgba(28, 72, 65, 0.08);
    scrollbar-width: none;
    -webkit-backdrop-filter: blur(24px) saturate(1.42) contrast(1.02);
    backdrop-filter: blur(24px) saturate(1.42) contrast(1.02);
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tabs::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab {
    position: relative;
    display: grid;
    place-items: center;
    width: auto;
    min-width: 0;
    min-height: 40px;
    padding: 0 4px;
    border: 1px solid transparent;
    border-radius: 18px;
    background: transparent;
    color: rgba(25, 59, 55, 0.58);
    box-shadow: none;
    font-size: 13px;
    font-weight: 950;
    line-height: 1;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.58);
    transform: none;
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab::before {
    content: "";
    position: absolute;
    top: 8px;
    right: -2px;
    bottom: 8px;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(64, 112, 105, 0.14), transparent);
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab:last-child::before,
  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab.selected::before,
  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab:has(+ .selected)::before {
    display: none;
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab:hover,
  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab:focus-visible {
    border-color: rgba(255, 255, 255, 0.56);
    background: rgba(255, 255, 255, 0.28);
    color: rgba(18, 53, 49, 0.86);
    outline: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    transform: none;
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab.selected {
    border-color: rgba(255, 255, 255, 0.82);
    background:
      radial-gradient(circle at 28% 0%, rgba(255, 255, 255, 0.95), transparent 48%),
      linear-gradient(145deg, rgba(25, 171, 154, 0.9), rgba(95, 224, 202, 0.62)),
      rgba(22, 153, 139, 0.55);
    color: #fffdf6;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.58),
      inset 0 -1px 0 rgba(4, 92, 86, 0.12),
      0 10px 20px rgba(11, 121, 112, 0.18);
    text-shadow: 0 1px 8px rgba(3, 67, 63, 0.22);
    transform: none;
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-tab.selected::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 5px;
    left: 12px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 0 9px rgba(255, 255, 255, 0.38);
  }
}

/* Exchange product selector: show every category chip instead of clipping the last one. */
body[data-page="exchange"] .exchange-product-selector-modal {
  width: min(1520px, calc(100vw - 32px));
}

body[data-page="exchange"] .exchange-product-selector-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  align-items: center;
  gap: 8px;
  justify-content: stretch;
  overflow: visible;
  padding-bottom: 0;
}

body[data-page="exchange"] .exchange-product-selector-tabs button {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
}

@media (max-width: 760px) {
  body[data-page="exchange"] .exchange-product-selector-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Final iOS 27 pass for the building skin tab. Keep the glass mood and text crisp. */
body[data-page="island"] .building-plot-modal .building-skin-tab {
  color: #163833;
}

body[data-page="island"] .building-plot-modal .building-skin-card {
  align-items: stretch;
}

body[data-page="island"] .building-plot-modal .building-skin-current {
  align-self: stretch;
  justify-content: center;
  padding: 24px 26px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(236, 250, 246, 0.52)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(31, 92, 83, 0.08),
    0 14px 30px rgba(22, 76, 68, 0.09);
}

body[data-page="island"] .building-plot-modal .building-skin-current span {
  color: rgba(35, 70, 64, 0.68);
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-skin-current strong {
  color: #123b35;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-skin-current small {
  color: rgba(35, 70, 64, 0.72);
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-skin-option {
  border-color: rgba(255, 255, 255, 0.62);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.86), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(235, 250, 246, 0.5)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(31, 92, 83, 0.08),
    0 12px 28px rgba(22, 76, 68, 0.09);
}

body[data-page="island"] .building-plot-modal .building-skin-option.locked {
  opacity: 1;
}

body[data-page="island"] .building-plot-modal .building-skin-option-head strong {
  color: #123a35;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-skin-option small {
  color: rgba(35, 70, 64, 0.68);
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-skin-option-head span {
  border: 1px solid rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(237, 249, 245, 0.42)),
    rgba(26, 64, 58, 0.08);
  color: rgba(70, 83, 62, 0.88);
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .building-skin-option.owned .building-skin-option-head span {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(237, 249, 245, 0.46)),
    rgba(144, 135, 82, 0.12);
  color: #5f6144;
}

body[data-page="island"] .building-plot-modal .building-skin-option.ready .building-skin-option-head span {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 245, 211, 0.56)),
    rgba(176, 139, 46, 0.12);
  color: #8b6b16;
}

body[data-page="island"] .building-plot-modal .building-skin-option.locked .building-skin-option-head span {
  background: rgba(35, 70, 64, 0.07);
  color: rgba(35, 70, 64, 0.58);
}

/* iOS 27-inspired building plot detail tab. Visual-only: plot/resource data stays unchanged. */
body[data-page="island"] .building-plot-modal .empty-plot-detail-tab {
  background: transparent;
}

body[data-page="island"] .building-plot-modal .plot-detail-layout {
  display: grid;
  gap: 14px;
  background:
    radial-gradient(ellipse at 15% 4%, rgba(255, 255, 255, 0.7), transparent 42%),
    radial-gradient(ellipse at 92% 18%, rgba(89, 216, 197, 0.2), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(233, 249, 244, 0.14));
  color: #163833;
  overflow: visible;
}

body[data-page="island"] .building-plot-modal .plot-detail-visual-pane {
  padding: 16px 16px 2px;
  border: 0;
}

body[data-page="island"] .building-plot-modal .plot-resource-visual {
  width: min(100%, 458px);
  max-height: 336px;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  background: rgba(12, 35, 31, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(20, 96, 86, 0.12),
    0 18px 36px rgba(19, 64, 57, 0.14);
  transform: translateZ(0);
}

body[data-page="island"] .building-plot-modal .plot-resource-art {
  background-size: cover;
  isolation: isolate;
}

body[data-page="island"] .building-plot-modal .plot-resource-art::before {
  background:
    radial-gradient(circle at 42% 26%, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(8, 34, 30, 0.06));
  mix-blend-mode: screen;
}

body[data-page="island"] .building-plot-modal .plot-resource-art::after {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -36px 58px rgba(8, 34, 30, 0.16);
}

body[data-page="island"] .building-plot-modal .plot-resource-art-chip {
  top: 12px;
  left: 12px;
  column-gap: 9px;
  min-width: 136px;
  max-width: calc(100% - 24px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(23, 43, 39, 0.76), rgba(15, 34, 31, 0.64)),
    rgba(15, 34, 31, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 12px 28px rgba(8, 28, 25, 0.24);
  color: #fffdf2;
  padding: 9px 11px;
  -webkit-backdrop-filter: blur(16px) saturate(1.32);
  backdrop-filter: blur(16px) saturate(1.32);
}

body[data-page="island"] .building-plot-modal .plot-resource-art-chip span {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(236, 249, 245, 0.64)),
    rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 5px 12px rgba(5, 28, 25, 0.22);
}

body[data-page="island"] .building-plot-modal .plot-resource-art-icon-image {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 1px 1px rgba(8, 28, 25, 0.36));
}

body[data-page="island"] .building-plot-modal .plot-resource-art-chip strong {
  color: #fffdf2;
  font-size: 15px;
  letter-spacing: 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

body[data-page="island"] .building-plot-modal .plot-resource-art-chip em,
body[data-page="island"] .building-plot-modal .plot-resource-art-chip small {
  color: rgba(231, 255, 247, 0.84);
  font-size: 12px;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .plot-detail-side {
  gap: 14px;
  padding: 4px 16px 18px;
}

body[data-page="island"] .building-plot-modal .plot-detail-section {
  gap: 8px;
}

body[data-page="island"] .building-plot-modal .plot-detail-section h3 {
  margin: 0;
  color: #153833;
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.58);
}

body[data-page="island"] .building-plot-modal .plot-detail-section h3 span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(18, 96, 86, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: rgba(7, 143, 128, 0.78);
  font-size: 10px;
}

body[data-page="island"] .building-plot-modal .plot-detail-row {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(22, 86, 78, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(241, 252, 248, 0.5)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(18, 86, 76, 0.06);
  color: rgba(22, 56, 51, 0.72);
}

body[data-page="island"] .building-plot-modal .plot-detail-row-label {
  color: rgba(22, 56, 51, 0.66);
  font-size: 14px;
  font-weight: 900;
}

body[data-page="island"] .building-plot-modal .plot-detail-row-label i {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: rgba(7, 143, 128, 0.72);
}

body[data-page="island"] .building-plot-modal .plot-detail-row strong {
  color: #102f2b;
  font-size: 16px;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.66);
}

body[data-page="island"] .building-plot-modal .plot-detail-remaining {
  gap: 8px;
}

body[data-page="island"] .building-plot-modal .plot-remaining-row {
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 76px;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(22, 86, 78, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(241, 252, 248, 0.52)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(18, 86, 76, 0.07);
}

body[data-page="island"] .building-plot-modal .plot-remaining-icon {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(22, 86, 78, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(239, 249, 246, 0.62)),
    rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 5px 12px rgba(18, 86, 76, 0.1);
}

body[data-page="island"] .building-plot-modal .plot-remaining-icon-image {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 2px rgba(18, 50, 45, 0.18));
}

body[data-page="island"] .building-plot-modal .plot-remaining-title {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 8px;
}

body[data-page="island"] .building-plot-modal .plot-remaining-name {
  color: #153833;
}

body[data-page="island"] .building-plot-modal .plot-remaining-title strong {
  color: #153833;
  font-size: 15px;
  letter-spacing: 0;
}

body[data-page="island"] .building-plot-modal .plot-remaining-title span {
  background: rgba(24, 64, 58, 0.1);
  color: rgba(22, 56, 51, 0.62);
  font-size: 12px;
}

body[data-page="island"] .building-plot-modal .plot-remaining-title em {
  grid-column: 2;
  color: #153833;
  font-size: 15px;
  letter-spacing: 0;
}

body[data-page="island"] .building-plot-modal .plot-remaining-track {
  height: 7px;
  background: rgba(24, 64, 58, 0.12);
  box-shadow: inset 0 1px 2px rgba(8, 34, 30, 0.08);
}

body[data-page="island"] .building-plot-modal .plot-remaining-track span {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 4px 10px rgba(36, 137, 113, 0.16);
}

body[data-page="island"] .building-plot-modal .plot-remaining-empty {
  min-height: 112px;
  border-color: rgba(22, 86, 78, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.46);
  color: rgba(22, 56, 51, 0.56);
}

@media (max-width: 760px) {
  body[data-page="island"] .building-plot-modal .plot-detail-visual-pane {
    padding: 12px 12px 0;
  }

  body[data-page="island"] .building-plot-modal .plot-detail-side {
    padding: 2px 12px 14px;
  }

  body[data-page="island"] .building-plot-modal .plot-resource-visual {
    border-radius: 18px;
  }
}

/* Empty-plot build modal v3: iOS 27 visual polish only.
   Building thumbnail sizing and list geometry are intentionally left untouched. */
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) {
  --empty-build-ink: #143c37;
  --empty-build-muted: rgba(29, 61, 56, 0.68);
  --empty-build-line: rgba(255, 255, 255, 0.72);
  --empty-build-soft-line: rgba(30, 92, 82, 0.13);
  --empty-build-panel: rgba(255, 255, 255, 0.58);
  --empty-build-panel-strong: rgba(255, 255, 255, 0.76);
  --empty-build-blue: #0b8f82;
  --empty-build-blue-strong: #08756d;
  --empty-build-gold: #977830;
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, 0.86), transparent 40%),
    radial-gradient(ellipse at 90% 0%, rgba(88, 216, 198, 0.34), transparent 42%),
    radial-gradient(ellipse at 46% 104%, rgba(236, 214, 150, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(250, 255, 252, 0.82), rgba(228, 248, 243, 0.66) 52%, rgba(251, 252, 248, 0.76)),
    rgba(238, 249, 245, 0.88);
  color: var(--empty-build-ink);
  box-shadow:
    0 34px 82px rgba(19, 57, 51, 0.24),
    0 12px 32px rgba(7, 27, 24, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(30, 92, 82, 0.08);
  -webkit-backdrop-filter: blur(34px) saturate(1.5) contrast(1.02);
  backdrop-filter: blur(34px) saturate(1.5) contrast(1.02);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal)::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent 30%),
    linear-gradient(315deg, rgba(255, 255, 255, 0.28), transparent 38%);
  opacity: 0.74;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-header {
  border-bottom-color: rgba(22, 72, 64, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.2)),
    rgba(238, 250, 246, 0.38);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-header strong {
  color: #123b35;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.68);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-kicker {
  color: rgba(150, 119, 47, 0.92);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.58);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .icon-button {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(242, 250, 247, 0.5)),
    rgba(255, 255, 255, 0.42);
  color: rgba(29, 57, 52, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 10px 24px rgba(22, 56, 51, 0.12);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .icon-button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .icon-button:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(241, 252, 248, 0.64)),
    rgba(255, 255, 255, 0.54);
  color: #102f2b;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs {
  border-bottom-color: rgba(22, 72, 64, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(232, 248, 244, 0.22)),
    rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -1px 0 rgba(22, 72, 64, 0.06);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button {
  color: rgba(29, 59, 54, 0.66);
  text-shadow: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button:focus-visible {
  background: rgba(255, 255, 255, 0.32);
  color: #123b35;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button.selected {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 251, 247, 0.72)),
    rgba(255, 255, 255, 0.64);
  color: #08786c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(9, 137, 122, 0.12);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body.build {
  background:
    radial-gradient(ellipse at 16% 0%, rgba(255, 255, 255, 0.36), transparent 36%),
    radial-gradient(ellipse at 92% 14%, rgba(82, 216, 197, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(232, 248, 244, 0.14));
  scrollbar-color: rgba(35, 90, 82, 0.34) transparent;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body.build .empty-plot-toolbar {
  border-bottom-color: rgba(22, 72, 64, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(241, 252, 248, 0.32)),
    rgba(255, 255, 255, 0.24);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs {
  border-color: rgba(22, 86, 78, 0.2);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 251, 247, 0.58)),
    rgba(255, 255, 255, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 22px rgba(18, 86, 76, 0.08);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select span {
  border-right-color: rgba(22, 86, 78, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(239, 248, 245, 0.38)),
    rgba(255, 255, 255, 0.24);
  color: rgba(22, 56, 51, 0.66);
  text-shadow: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select select {
  background: transparent;
  color: #123b35;
  text-shadow: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button {
  border-left-color: rgba(22, 86, 78, 0.13);
  color: rgba(29, 59, 54, 0.64);
  text-shadow: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button:focus-visible {
  background: rgba(255, 255, 255, 0.36);
  color: #123b35;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button.selected {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(231, 250, 246, 0.72)),
    rgba(255, 255, 255, 0.58);
  color: #08786c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(9, 137, 122, 0.12);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row {
  border-top: 1px solid rgba(255, 255, 255, 0.64);
  border-right: 1px solid rgba(255, 255, 255, 0.64);
  border-bottom: 1px solid rgba(22, 86, 78, 0.13);
  border-left-color: var(--industry-color, rgba(7, 143, 128, 0.62));
  background:
    radial-gradient(ellipse at 0% 0%, var(--industry-surface, rgba(7, 143, 128, 0.11)), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(239, 251, 247, 0.54) 48%, rgba(255, 255, 255, 0.48)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(22, 86, 78, 0.06),
    0 16px 34px rgba(18, 86, 76, 0.11);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row:hover {
  background:
    radial-gradient(ellipse at 0% 0%, var(--industry-surface, rgba(7, 143, 128, 0.14)), transparent 44%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(236, 251, 247, 0.64) 48%, rgba(255, 255, 255, 0.56)),
    rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(22, 86, 78, 0.08),
    0 18px 38px rgba(18, 86, 76, 0.14);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-card {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 253, 250, 0.88)),
    #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 14px 30px rgba(18, 86, 76, 0.12);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .building-thumb {
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.95), transparent 38%),
    linear-gradient(180deg, #ffffff, #f5fbf8);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-title {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(240, 251, 247, 0.68)),
    rgba(255, 255, 255, 0.62);
  color: #123b35;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta span {
  border-color: rgba(22, 86, 78, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(241, 252, 248, 0.48)),
    rgba(255, 255, 255, 0.42);
  color: rgba(22, 56, 51, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(18, 86, 76, 0.08);
  text-shadow: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta span.industry-chip {
  border-color: rgba(255, 255, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08)),
    var(--industry-color, #0b8f82);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 10px 22px var(--industry-glow, rgba(7, 143, 128, 0.16));
  text-shadow: 0 1px 2px rgba(8, 34, 30, 0.22);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-label {
  color: rgba(22, 56, 51, 0.82);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.68);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-label::before {
  background: linear-gradient(180deg, #19b99d, #08786c);
  box-shadow: 0 0 18px rgba(7, 143, 128, 0.18);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .build-asset-frame {
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(237, 250, 246, 0.62)),
    rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 9px 18px rgba(18, 86, 76, 0.09);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .empty-plot-cost-tile.build-asset-tile strong {
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.95), transparent 45%),
    linear-gradient(180deg, #ffffff, #f4fbf8);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .empty-plot-cost-tile.build-asset-tile em {
  background:
    linear-gradient(180deg, rgba(30, 60, 54, 0.92), rgba(15, 43, 39, 0.9));
  color: #fffdf2;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row .empty-plot-cost-tile.build-asset-tile small {
  background:
    linear-gradient(180deg, rgba(27, 53, 48, 0.94), rgba(16, 42, 38, 0.92));
  color: #fffdf2;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile.missing .build-asset-frame {
  box-shadow:
    inset 0 0 0 2px rgba(219, 71, 58, 0.76),
    0 9px 18px rgba(18, 86, 76, 0.09);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile.workforce.enough .build-asset-frame,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-cost-tile.build-asset-tile.population-reward .build-asset-frame {
  box-shadow:
    inset 0 0 0 2px rgba(25, 185, 157, 0.46),
    0 9px 18px rgba(18, 86, 76, 0.09);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button {
  border-color: rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.32), transparent 54%),
    linear-gradient(180deg, #21caa9, #0b8f82 52%, #08756d);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    inset 0 -14px 24px rgba(2, 70, 75, 0.18),
    0 14px 26px rgba(7, 143, 128, 0.22);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button:hover:not(:disabled),
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button:focus-visible:not(:disabled) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -14px 24px rgba(2, 70, 75, 0.18),
    0 16px 30px rgba(7, 143, 128, 0.28);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button:disabled {
  border-color: rgba(22, 86, 78, 0.12);
  background:
    linear-gradient(180deg, rgba(222, 235, 232, 0.72), rgba(196, 214, 209, 0.58));
  color: rgba(22, 56, 51, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 8px 18px rgba(18, 86, 76, 0.06);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-state.compact {
  border-color: rgba(22, 86, 78, 0.14);
  background: rgba(255, 255, 255, 0.48);
  color: rgba(22, 56, 51, 0.58);
}

/* Opportunity workbench glass task panel. */
.technology-workbench-modal[data-workbench-tab="goals"] {
  background:
    radial-gradient(ellipse at 18% 0%, rgba(112, 218, 204, 0.24), transparent 38%),
    radial-gradient(ellipse at 82% 13%, rgba(235, 195, 96, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(244, 251, 248, 0.74), rgba(229, 242, 239, 0.82));
  -webkit-backdrop-filter: blur(20px) saturate(1.24);
  backdrop-filter: blur(20px) saturate(1.24);
}

.technology-workbench-shell[data-workbench-tab="goals"] {
  --goal-ink: #143432;
  --goal-muted: rgba(37, 64, 60, 0.62);
  --goal-soft: rgba(255, 255, 255, 0.58);
  --goal-panel: rgba(255, 255, 255, 0.7);
  --goal-panel-strong: rgba(255, 255, 255, 0.86);
  --goal-line: rgba(39, 89, 81, 0.14);
  --goal-teal: #0f9183;
  --goal-deep: #0a646b;
  --goal-gold: #c99b31;
  --goal-blue: #4c83a6;
  --goal-shadow: rgba(37, 72, 66, 0.16);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 30px 30px 0 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(230, 249, 244, 0.74) 52%, rgba(255, 248, 226, 0.72)),
    rgba(239, 249, 246, 0.88);
  box-shadow:
    0 34px 90px rgba(26, 55, 52, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -1px 0 rgba(117, 159, 152, 0.18);
  color: var(--goal-ink);
  -webkit-backdrop-filter: blur(28px) saturate(1.28);
  backdrop-filter: blur(28px) saturate(1.28);
}

.technology-workbench-shell[data-workbench-tab="goals"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, transparent 0 24%, rgba(255, 255, 255, 0.34) 36%, transparent 48%),
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.42), transparent 28%),
    radial-gradient(circle at 94% 82%, rgba(15, 145, 131, 0.12), transparent 32%);
  opacity: 0.92;
  pointer-events: none;
}

.technology-workbench-shell[data-workbench-tab="goals"] .technology-workbench-head {
  min-height: 88px;
  border-bottom: 1px solid rgba(133, 177, 170, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(231, 249, 245, 0.62) 58%, rgba(255, 244, 213, 0.58)),
    rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.62);
}

.technology-workbench-shell[data-workbench-tab="goals"] .technology-workbench-head h2 {
  color: var(--goal-ink);
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

.technology-workbench-shell[data-workbench-tab="goals"] .technology-workbench-close {
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(230, 244, 240, 0.64)),
    rgba(255, 255, 255, 0.54);
  color: rgba(20, 52, 50, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(30, 68, 64, 0.14);
}

.technology-workbench-shell[data-workbench-tab="goals"] .technology-workbench-close:hover {
  color: var(--goal-teal);
  background: rgba(255, 255, 255, 0.82);
}

.technology-workbench-shell[data-workbench-tab="goals"] .technology-workbench-body {
  background:
    radial-gradient(circle at 18% 9%, rgba(15, 145, 131, 0.08), transparent 34%),
    radial-gradient(circle at 78% 4%, rgba(201, 155, 49, 0.1), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%);
  padding: 18px clamp(16px, 2vw, 24px);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-command-center {
  gap: 12px;
  max-width: 1360px;
  color: var(--goal-ink);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-briefing-card {
  grid-template-columns: minmax(300px, 1.04fr) minmax(430px, 0.96fr);
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  padding: 18px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(228, 248, 244, 0.58) 58%, rgba(255, 247, 225, 0.58)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    0 22px 54px rgba(37, 72, 66, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(83, 129, 121, 0.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.14);
  backdrop-filter: blur(18px) saturate(1.14);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-briefing-card::before {
  background:
    linear-gradient(115deg, transparent 0 32%, rgba(255, 255, 255, 0.46) 42%, transparent 54%),
    radial-gradient(circle at 90% 0%, rgba(201, 155, 49, 0.16), transparent 30%);
  opacity: 0.74;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-briefing-copy > span,
.technology-workbench-shell[data-workbench-tab="goals"] .task-checkin-card > div > span,
.technology-workbench-shell[data-workbench-tab="goals"] .task-panel-header span,
.technology-workbench-shell[data-workbench-tab="goals"] .task-card-header span {
  color: rgba(15, 111, 103, 0.72);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-briefing-copy h3 {
  color: var(--goal-ink);
  font-size: clamp(28px, 2.8vw, 42px);
  font-weight: 800;
  line-height: 1.04;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.76);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-briefing-copy p,
.technology-workbench-shell[data-workbench-tab="goals"] .task-checkin-card p,
.technology-workbench-shell[data-workbench-tab="goals"] .task-card p,
.technology-workbench-shell[data-workbench-tab="goals"] .task-progress-row small {
  color: var(--goal-muted);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-briefing-foot b,
.technology-workbench-shell[data-workbench-tab="goals"] .task-briefing-foot small,
.technology-workbench-shell[data-workbench-tab="goals"] .task-unlock-line {
  border: 1px solid rgba(255, 255, 255, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.42);
  color: rgba(28, 60, 56, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(37, 72, 66, 0.08);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-dashboard {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-stat-card {
  min-height: 88px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 22px;
  padding: 14px 15px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(37, 72, 66, 0.09);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-stat-card span {
  color: rgba(37, 64, 60, 0.56);
  font-weight: 800;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-stat-card strong {
  color: var(--goal-ink);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-checkin-card {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  padding: 14px 16px;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.74), rgba(226, 247, 242, 0.56) 58%, rgba(255, 247, 224, 0.58)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    0 18px 42px rgba(37, 72, 66, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-checkin-card strong,
.technology-workbench-shell[data-workbench-tab="goals"] .task-panel-header h3,
.technology-workbench-shell[data-workbench-tab="goals"] .task-card-header strong,
.technology-workbench-shell[data-workbench-tab="goals"] .task-meta b,
.technology-workbench-shell[data-workbench-tab="goals"] .task-reward b,
.technology-workbench-shell[data-workbench-tab="goals"] .task-empty-state strong {
  color: var(--goal-ink);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-layout {
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 12px;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-panel {
  min-height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 28px;
  padding: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(232, 249, 245, 0.5)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    0 22px 54px rgba(37, 72, 66, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-panel-active {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(230, 244, 249, 0.52)),
    rgba(255, 255, 255, 0.42);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-panel-header {
  border-bottom: 1px solid var(--goal-line);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-panel-header em {
  border: 1px solid rgba(255, 255, 255, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.42);
  color: rgba(28, 60, 56, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-card {
  --task-accent: var(--goal-teal);
  --task-accent-soft: rgba(15, 145, 131, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(240, 251, 248, 0.58)),
    rgba(255, 255, 255, 0.56);
  box-shadow:
    0 14px 30px rgba(37, 72, 66, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--goal-ink);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-card.completed {
  border-color: rgba(23, 165, 132, 0.42);
  background:
    linear-gradient(145deg, rgba(238, 255, 249, 0.86), rgba(255, 248, 226, 0.62)),
    rgba(255, 255, 255, 0.62);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-type-production_contract,
.technology-workbench-shell[data-workbench-tab="goals"] .task-type-cargo_delivery {
  --task-accent: #c99b31;
  --task-accent-soft: rgba(201, 155, 49, 0.14);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-type-shipment_to_exchange,
.technology-workbench-shell[data-workbench-tab="goals"] .task-type-salvage {
  --task-accent: #4c83a6;
  --task-accent-soft: rgba(76, 131, 166, 0.14);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-type-upgrade_building,
.technology-workbench-shell[data-workbench-tab="goals"] .task-type-upgrade_technology {
  --task-accent: #0f9183;
  --task-accent-soft: rgba(15, 145, 131, 0.14);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-type-clear_pirates,
.technology-workbench-shell[data-workbench-tab="goals"] .task-type-fleet_escort {
  --task-accent: #b86868;
  --task-accent-soft: rgba(184, 104, 104, 0.14);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-type-sigil {
  width: 56px;
  height: 56px;
  flex-basis: 56px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.9), transparent 38%),
    linear-gradient(145deg, var(--task-accent-soft), rgba(255, 255, 255, 0.52)),
    rgba(255, 255, 255, 0.58);
  color: var(--task-accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(37, 72, 66, 0.1);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-type-sigil-image img {
  width: 100%;
  height: 100%;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-type-sigil.task-type-sigil-image {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-card-header em {
  background: var(--task-accent-soft);
  color: var(--task-accent);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-meta,
.technology-workbench-shell[data-workbench-tab="goals"] .task-reward {
  color: rgba(37, 64, 60, 0.66);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip {
  --reward-fill: rgba(15, 145, 131, 0.11);
  --reward-glow: rgba(37, 72, 66, 0.08);
  --reward-ink: rgba(28, 60, 56, 0.78);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(235, 249, 246, 0.5)),
    var(--reward-fill);
  color: var(--reward-ink);
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 16px var(--reward-glow);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-cash {
  --reward-fill: linear-gradient(180deg, #83b918, #659f0b);
  --reward-glow: rgba(101, 159, 11, 0.2);
  --reward-ink: #fffdf4;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-bound-gems,
.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-gems {
  --reward-fill: linear-gradient(180deg, #77c8e7, #4f95bd);
  --reward-glow: rgba(79, 149, 189, 0.18);
  --reward-ink: #fffdf4;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-construction {
  --reward-fill: rgba(115, 157, 143, 0.18);
  --reward-glow: rgba(78, 128, 113, 0.12);
  --reward-ink: #41685d;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-industrial {
  --reward-fill: rgba(120, 147, 163, 0.2);
  --reward-glow: rgba(83, 111, 128, 0.12);
  --reward-ink: #476373;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-research {
  --reward-fill: rgba(91, 129, 172, 0.18);
  --reward-glow: rgba(75, 111, 156, 0.12);
  --reward-ink: #3f668d;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-maintenance {
  --reward-fill: rgba(184, 120, 104, 0.16);
  --reward-glow: rgba(184, 104, 104, 0.12);
  --reward-ink: #8a5a50;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-supply {
  --reward-fill: rgba(143, 174, 98, 0.18);
  --reward-glow: rgba(118, 151, 78, 0.12);
  --reward-ink: #607a3f;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-gold {
  --reward-fill: linear-gradient(180deg, #e2c868, #b9942e);
  --reward-glow: rgba(201, 155, 49, 0.2);
  --reward-ink: #fffdf4;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-cash,
.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-bound-gems,
.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-gems,
.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.reward-gold {
  border-color: rgba(255, 255, 255, 0.74);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.has-resource-icon {
  padding: 2px 10px 2px 4px;
  min-height: 27px;
  text-shadow: 0 1px 1px rgba(23, 40, 36, 0.18);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.has-resource-icon .task-reward-icon {
  width: 23px;
  height: 23px;
  flex-basis: 23px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 3px 8px rgba(18, 46, 42, 0.16);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-reward-chip.has-resource-icon .task-reward-icon img {
  width: 24px;
  height: 24px;
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-progress {
  height: 9px;
  background: rgba(28, 60, 56, 0.12);
  box-shadow: inset 0 1px 2px rgba(28, 60, 56, 0.08);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-progress span {
  background: linear-gradient(90deg, var(--task-accent), var(--goal-teal));
  box-shadow: 0 0 18px color-mix(in srgb, var(--task-accent) 34%, transparent);
}

.technology-workbench-shell[data-workbench-tab="goals"] button.task-primary-action,
.technology-workbench-shell[data-workbench-tab="goals"] button.task-reset-button,
.technology-workbench-shell[data-workbench-tab="goals"] button.task-quiet-action {
  min-height: 42px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: 0;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.technology-workbench-shell[data-workbench-tab="goals"] button.task-primary-action {
  border: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.36), transparent 54%),
    linear-gradient(180deg, #21c7aa, #0f9183 54%, #0a6f70);
  color: #fffdf4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -14px 24px rgba(2, 70, 75, 0.18),
    0 12px 24px rgba(7, 143, 128, 0.2);
}

.technology-workbench-shell[data-workbench-tab="goals"] button.task-primary-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -14px 24px rgba(2, 70, 75, 0.18),
    0 15px 30px rgba(7, 143, 128, 0.26);
}

.technology-workbench-shell[data-workbench-tab="goals"] button.task-reset-button,
.technology-workbench-shell[data-workbench-tab="goals"] button.task-quiet-action {
  border: 1px solid rgba(255, 255, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(235, 249, 246, 0.5)),
    rgba(255, 255, 255, 0.48);
  color: rgba(20, 52, 50, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 22px rgba(37, 72, 66, 0.1);
}

.technology-workbench-shell[data-workbench-tab="goals"] button.task-reset-button small {
  color: rgba(20, 52, 50, 0.52);
}

.technology-workbench-shell[data-workbench-tab="goals"] button.task-primary-action:disabled,
.technology-workbench-shell[data-workbench-tab="goals"] button.task-reset-button:disabled,
.technology-workbench-shell[data-workbench-tab="goals"] button.task-quiet-action:disabled {
  opacity: 1;
  background:
    linear-gradient(180deg, rgba(229, 240, 237, 0.72), rgba(204, 220, 216, 0.56));
  color: rgba(20, 52, 50, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 8px 18px rgba(37, 72, 66, 0.06);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-empty-state {
  border: 1px dashed rgba(15, 145, 131, 0.26);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(231, 249, 245, 0.34)),
    rgba(255, 255, 255, 0.34);
  color: var(--goal-muted);
}

.technology-workbench-shell[data-workbench-tab="goals"] .task-empty-state span {
  color: var(--goal-muted);
}

@media (max-width: 980px) {
  .technology-workbench-shell[data-workbench-tab="goals"] .task-briefing-card,
  .technology-workbench-shell[data-workbench-tab="goals"] .task-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .technology-workbench-shell[data-workbench-tab="goals"] {
    border-radius: 0;
  }

  .technology-workbench-shell[data-workbench-tab="goals"] .task-briefing-card,
  .technology-workbench-shell[data-workbench-tab="goals"] .task-checkin-card,
  .technology-workbench-shell[data-workbench-tab="goals"] .task-panel {
    border-radius: 24px;
  }

  .technology-workbench-shell[data-workbench-tab="goals"] .task-dashboard,
  .technology-workbench-shell[data-workbench-tab="goals"] .task-card {
    grid-template-columns: 1fr;
  }

  .technology-workbench-shell[data-workbench-tab="goals"] .task-panel-header,
  .technology-workbench-shell[data-workbench-tab="goals"] .task-checkin-card {
    align-items: stretch;
    flex-direction: column;
  }

  .technology-workbench-shell[data-workbench-tab="goals"] button.task-primary-action,
  .technology-workbench-shell[data-workbench-tab="goals"] button.task-reset-button,
  .technology-workbench-shell[data-workbench-tab="goals"] button.task-quiet-action {
    width: 100%;
  }
}

/* iOS 27 custom dropdown for empty-plot building type. Replaces the browser native select surface. */
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select.custom {
  position: relative;
  overflow: visible;
  z-index: 8;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select.custom.open {
  z-index: 28;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select.custom > span {
  border-right-color: rgba(22, 86, 78, 0.12);
  border-radius: 16px 0 0 16px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  border: 0;
  border-radius: 0 16px 16px 0;
  background: transparent;
  color: #123b35;
  cursor: pointer;
  padding: 0 16px 0 18px;
  text-align: left;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-trigger strong {
  min-width: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-trigger > i {
  width: 11px;
  height: 11px;
  margin-left: 14px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  color: rgba(16, 61, 55, 0.78);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 160ms ease, color 160ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-select.custom.open .empty-plot-type-trigger > i {
  color: #08786c;
  transform: translateY(3px) rotate(225deg);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-trigger:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.34);
  outline: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: min(520px, calc(100dvh - 260px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 255, 255, 0.9), transparent 42%),
    radial-gradient(ellipse at 88% 10%, rgba(102, 221, 202, 0.2), transparent 44%),
    linear-gradient(180deg, rgba(252, 255, 253, 0.92), rgba(234, 250, 245, 0.86)),
    rgba(244, 253, 249, 0.92);
  box-shadow:
    0 24px 48px rgba(18, 86, 76, 0.18),
    0 8px 18px rgba(8, 34, 30, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 8px;
  -webkit-backdrop-filter: blur(24px) saturate(1.36);
  backdrop-filter: blur(24px) saturate(1.36);
  scrollbar-color: rgba(55, 165, 150, 0.42) transparent;
  scrollbar-width: thin;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-menu::-webkit-scrollbar {
  width: 8px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-menu::-webkit-scrollbar-track {
  background: transparent;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(55, 165, 150, 0.42);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: rgba(21, 56, 51, 0.82);
  cursor: pointer;
  padding: 0 18px;
  text-align: left;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-option:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-option:focus-visible {
  background: rgba(255, 255, 255, 0.56);
  color: #123b35;
  outline: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-option span {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  text-shadow: none;
  white-space: nowrap;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-option i {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  opacity: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-option.selected {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.24), transparent 55%),
    linear-gradient(180deg, #25c4a8, #08786c);
  color: #fffdf2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -10px 18px rgba(2, 70, 75, 0.14),
    0 10px 22px rgba(7, 120, 108, 0.2);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-option.selected i {
  opacity: 1;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-type-option.selected i::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 7px;
  width: 7px;
  height: 14px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg);
}

/* Ships page iOS 27-inspired liquid-glass pass.
   Visual-only: fleet selection, voyages, service, retrofit and battle logic stay unchanged. */
body[data-page="ships"] #shipsPage > section {
  margin: -6px -6px 0;
  padding: 0;
  border: 0;
  background:
    linear-gradient(180deg, #edf7f8 0%, #f8fbf8 46%, #eaf4f5 100%);
  box-shadow: none;
  overflow: hidden;
}

body[data-page="ships"],
body[data-page="ships"] .app,
body[data-page="ships"] #shipsPage {
  max-width: 100%;
  overflow-x: hidden;
}

body[data-page="ships"] #shipsPage > section > h2 {
  display: none;
}

body[data-page="ships"] .fleet-command-page {
  --fleet-glass-ink: #143430;
  --fleet-glass-muted: rgba(36, 67, 63, 0.62);
  --fleet-glass-soft: rgba(255, 255, 255, 0.48);
  --fleet-glass-panel: rgba(255, 255, 255, 0.66);
  --fleet-glass-panel-strong: rgba(255, 255, 255, 0.82);
  --fleet-glass-line: rgba(35, 82, 75, 0.1);
  --fleet-glass-teal: #087d67;
  --fleet-glass-blue: #347ea5;
  --fleet-glass-gold: #a66b0c;
  --fleet-glass-red: #c55361;
  min-height: calc(100dvh - var(--global-topbar-height) - 18px);
  display: grid;
  gap: clamp(12px, 1.2vw, 16px);
  padding: 14px;
  color: var(--fleet-glass-ink);
  background:
    linear-gradient(135deg, rgba(228, 244, 247, 0.98), rgba(248, 252, 248, 0.96) 42%, rgba(220, 239, 242, 0.98)),
    #eef7f8;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body[data-page="ships"] .fleet-command-page::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: var(--global-topbar-height) 0 var(--global-bottom-nav-reserve) 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 36%),
    linear-gradient(180deg, rgba(7, 125, 103, 0.04), rgba(52, 126, 165, 0.05));
}

body[data-page="ships"] .fleet-command-page > * {
  position: relative;
  z-index: 1;
}

body[data-page="ships"] .fleet-command-hero {
  min-height: 188px;
  display: grid;
  gap: 18px;
  align-items: center;
  padding: 24px;
  overflow: hidden;
  border: 0;
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(4, 22, 27, 0.84), rgba(9, 51, 56, 0.42) 46%, rgba(4, 22, 27, 0.18)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    url("/assets/fleet-command/fleet_command_hero_scene_ios27_flat_v2.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  color: #fffdf4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(4, 29, 32, 0.24),
    0 22px 52px rgba(25, 73, 82, 0.2);
}

body[data-page="ships"] .fleet-command-hero-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

body[data-page="ships"] .fleet-command-kicker {
  color: rgba(255, 244, 214, 0.72);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="ships"] .fleet-command-hero h3 {
  margin: 0;
  color: #ffffff;
  font-size: 38px;
  font-weight: 950;
  line-height: 1.04;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
}

body[data-page="ships"] .fleet-command-hero p {
  margin: 0;
  color: rgba(245, 252, 249, 0.78);
  font-size: 14px;
  font-weight: 800;
}

body[data-page="ships"] .fleet-command-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 440px);
  gap: clamp(12px, 1.2vw, 16px);
  align-items: start;
}

body[data-page="ships"] .fleet-command-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

body[data-page="ships"] .fleet-command-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

body[data-page="ships"] .fleet-command-metric,
body[data-page="ships"] .fleet-command-section,
body[data-page="ships"] .fleet-command-inspector,
body[data-page="ships"] .fleet-command-drawer,
body[data-page="ships"] .ship-rental-panel {
  border: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(231, 249, 246, 0.5)),
    var(--fleet-glass-panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(35, 82, 75, 0.06),
    0 18px 42px rgba(32, 73, 80, 0.12);
  -webkit-backdrop-filter: blur(24px) saturate(1.28);
  backdrop-filter: blur(24px) saturate(1.28);
}

body[data-page="ships"] .fleet-command-metric {
  min-height: 96px;
  display: grid;
  gap: 5px;
  padding: 12px;
  border-left: 0;
  border-radius: 20px;
  overflow: hidden;
}

body[data-page="ships"] .fleet-command-metric small,
body[data-page="ships"] .fleet-command-metric span,
body[data-page="ships"] .fleet-command-section-head small,
body[data-page="ships"] .fleet-ship-identity small,
body[data-page="ships"] .fleet-ship-status small,
body[data-page="ships"] .fleet-ship-route small,
body[data-page="ships"] .fleet-inspector-header small,
body[data-page="ships"] .fleet-command-gauge span,
body[data-page="ships"] .fleet-spec-grid span,
body[data-page="ships"] .fleet-battle-stats span,
body[data-page="ships"] .fleet-current-task small,
body[data-page="ships"] .fleet-destination-row small,
body[data-page="ships"] .fleet-cargo-row small,
body[data-page="ships"] .fleet-voyage-row small,
body[data-page="ships"] .fleet-voyage-row span,
body[data-page="ships"] .ship-rental-panel small,
body[data-page="ships"] .ship-fuel-row small,
body[data-page="ships"] .ship-cargo-panel small {
  color: var(--fleet-glass-muted);
}

body[data-page="ships"] .fleet-command-metric strong {
  color: var(--fleet-glass-ink);
  font-size: 23px;
  font-weight: 950;
  line-height: 1.1;
}

body[data-page="ships"] .fleet-command-metric::before {
  content: "";
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: var(--fleet-glass-teal);
}

body[data-page="ships"] .fleet-command-metric.warning::before { background: var(--fleet-glass-gold); }
body[data-page="ships"] .fleet-command-metric.battle::before { background: var(--fleet-glass-red); }
body[data-page="ships"] .fleet-command-metric.route::before { background: var(--fleet-glass-blue); }
body[data-page="ships"] .fleet-command-metric.cargo::before { background: #8b7a41; }
body[data-page="ships"] .fleet-command-metric.ok::before { background: #159a77; }

body[data-page="ships"] .fleet-command-section,
body[data-page="ships"] .fleet-command-drawer {
  border-radius: 24px;
  overflow: hidden;
}

body[data-page="ships"] .fleet-command-section {
  display: grid;
  gap: 12px;
  padding: 14px;
}

body[data-page="ships"] .fleet-command-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body[data-page="ships"] .fleet-command-section-head strong,
body[data-page="ships"] .fleet-inspector-header strong,
body[data-page="ships"] .fleet-ship-identity strong,
body[data-page="ships"] .fleet-ship-route strong,
body[data-page="ships"] .fleet-current-task strong,
body[data-page="ships"] .fleet-cargo-row strong,
body[data-page="ships"] .fleet-voyage-row strong,
body[data-page="ships"] .ship-rental-panel strong,
body[data-page="ships"] .ship-fuel-row strong {
  color: var(--fleet-glass-ink);
}

body[data-page="ships"] .fleet-command-section-head strong {
  display: block;
  font-size: 18px;
  font-weight: 950;
}

body[data-page="ships"] .fleet-command-table {
  display: grid;
  gap: 8px;
}

body[data-page="ships"] .fleet-ship-row {
  min-height: 126px;
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(190px, 1fr) minmax(160px, 0.75fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 0;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 249, 247, 0.46)),
    rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease;
}

body[data-page="ships"] .fleet-ship-row:hover,
body[data-page="ships"] .fleet-ship-row.selected {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(229, 249, 245, 0.62)),
    rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 4px 0 0 rgba(8, 125, 103, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  transform: none;
}

body[data-page="ships"] .fleet-ship-identity,
body[data-page="ships"] .fleet-inspector-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body[data-page="ships"] .fleet-ship-mark,
body[data-page="ships"] .fleet-inspector-header > div > span {
  display: inline-flex;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  color: var(--fleet-glass-teal);
  font-size: 18px;
  font-weight: 950;
}

body[data-page="ships"] .fleet-ship-icon-image {
  height: 48px;
  width: 48px;
}

body[data-page="ships"] .fleet-ship-identity strong,
body[data-page="ships"] .fleet-inspector-header strong,
body[data-page="ships"] .fleet-ship-identity small,
body[data-page="ships"] .fleet-ship-status small,
body[data-page="ships"] .fleet-ship-route small,
body[data-page="ships"] .fleet-inspector-header small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="ships"] .fleet-ship-identity strong,
body[data-page="ships"] .fleet-inspector-header strong {
  display: block;
  font-size: 16px;
  font-weight: 950;
}

body[data-page="ships"] .fleet-ship-status {
  display: grid;
  grid-column: 1;
  grid-row: 2;
  gap: 6px;
  justify-items: start;
}

body[data-page="ships"] .ship-status {
  border: 0;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-weight: 950;
}

body[data-page="ships"] .ship-status.docked {
  background: rgba(8, 125, 103, 0.13);
  color: #087d67;
}

body[data-page="ships"] .ship-status.in_transit {
  background: rgba(52, 126, 165, 0.14);
  color: #276f98;
}

body[data-page="ships"] .fleet-ship-gauges,
body[data-page="ships"] .fleet-inspector-gauges {
  display: grid;
  gap: 8px;
}

body[data-page="ships"] .fleet-ship-gauges {
  grid-column: 2 / 4;
  grid-row: 2;
}

body[data-page="ships"] .fleet-command-gauge {
  display: grid;
  gap: 5px;
}

body[data-page="ships"] .fleet-command-gauge div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body[data-page="ships"] .fleet-command-gauge strong {
  color: var(--fleet-glass-ink);
  font-size: 12px;
  font-weight: 900;
}

body[data-page="ships"] .fleet-command-gauge i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(26, 60, 53, 0.12);
  box-shadow: inset 0 1px 2px rgba(34, 61, 57, 0.08);
}

body[data-page="ships"] .fleet-command-gauge b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1aa785, #087d67);
}

body[data-page="ships"] .fleet-command-gauge.durability i,
body[data-page="ships"] .ship-bar.durability .ship-bar-track {
  background: rgba(151, 38, 55, 0.13);
}

body[data-page="ships"] .fleet-command-gauge.durability b,
body[data-page="ships"] .ship-bar.durability .ship-bar-track span {
  background: linear-gradient(90deg, #d8324c 0%, #ff725f 100%);
}

body[data-page="ships"] .fleet-command-gauge.fuel i,
body[data-page="ships"] .ship-bar.fuel .ship-bar-track {
  background: rgba(171, 110, 14, 0.14);
}

body[data-page="ships"] .fleet-command-gauge.fuel b,
body[data-page="ships"] .ship-bar.fuel .ship-bar-track span {
  background: linear-gradient(90deg, #f2a51c 0%, #ffd15c 100%);
}

body[data-page="ships"] .fleet-command-gauge.cargo i,
body[data-page="ships"] .ship-bar.cargo .ship-bar-track,
body[data-page="ships"] .ship-cargo-track {
  background: rgba(30, 74, 72, 0.1);
}

body[data-page="ships"] .fleet-command-gauge.cargo b,
body[data-page="ships"] .ship-bar.cargo .ship-bar-track span,
body[data-page="ships"] .ship-cargo-track span {
  background: linear-gradient(90deg, #64c4b9 0%, #c9e9df 100%);
}

body[data-page="ships"] .fleet-command-gauge.warning b {
  background: linear-gradient(90deg, #f4bc4f, #d89617);
}

body[data-page="ships"] .fleet-command-gauge.danger b {
  background: linear-gradient(90deg, #d56a73, #b94f5b);
}

body[data-page="ships"] .fleet-command-gauge.durability.warning b,
body[data-page="ships"] .fleet-command-gauge.durability.danger b {
  background: linear-gradient(90deg, #d8324c 0%, #ff725f 100%);
}

body[data-page="ships"] .fleet-command-gauge.fuel.warning b,
body[data-page="ships"] .fleet-command-gauge.fuel.danger b {
  background: linear-gradient(90deg, #f2a51c 0%, #ffd15c 100%);
}

body[data-page="ships"] .fleet-command-gauge.cargo.warning b,
body[data-page="ships"] .fleet-command-gauge.cargo.danger b {
  background: linear-gradient(90deg, #64c4b9 0%, #c9e9df 100%);
}

body[data-page="ships"] .fleet-ship-route {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

body[data-page="ships"] .fleet-ship-route strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="ships"] .fleet-ship-actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 3;
  grid-row: 1;
  gap: 6px;
  justify-content: flex-end;
}

body[data-page="ships"] button.secondary,
body[data-page="ships"] .button-link.secondary,
body[data-page="ships"] .fleet-mode-switch .secondary,
body[data-page="ships"] .ship-fuel-actions button,
body[data-page="ships"] .ship-actions button,
body[data-page="ships"] .ship-system-row button,
body[data-page="ships"] .ship-system-install button,
body[data-page="ships"] .ship-rental-panel button,
body[data-page="ships"] .fleet-tab-stack > button {
  border: 0;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(233, 247, 243, 0.55));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 7px 16px rgba(42, 72, 66, 0.1);
  color: #243d39;
  font-weight: 900;
  transition: background 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

body[data-page="ships"] button.secondary:hover:not(:disabled),
body[data-page="ships"] .button-link.secondary:hover,
body[data-page="ships"] .ship-fuel-actions button:hover:not(:disabled),
body[data-page="ships"] .ship-actions button:hover:not(:disabled),
body[data-page="ships"] .ship-system-row button:hover:not(:disabled),
body[data-page="ships"] .ship-system-install button:hover:not(:disabled),
body[data-page="ships"] .ship-rental-panel button:hover:not(:disabled),
body[data-page="ships"] .fleet-tab-stack > button:hover:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(229, 250, 244, 0.68));
  color: #082d28;
  transform: none;
}

body[data-page="ships"] button:disabled {
  color: rgba(34, 61, 57, 0.26);
  opacity: 0.58;
  transform: none;
}

body[data-page="ships"] .fleet-command-operations {
  display: grid;
  gap: 12px;
}

body[data-page="ships"] .fleet-command-operations .ship-rental-panel,
body[data-page="ships"] .fleet-command-drawer .ship-log-panel,
body[data-page="ships"] .fleet-command-drawer .battle-dashboard {
  margin: 0;
  box-shadow: none;
}

body[data-page="ships"] .fleet-command-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  cursor: pointer;
  list-style: none;
}

body[data-page="ships"] .fleet-command-drawer summary::-webkit-details-marker {
  display: none;
}

body[data-page="ships"] .fleet-command-drawer summary span {
  color: var(--fleet-glass-ink);
  font-weight: 950;
}

body[data-page="ships"] .fleet-command-drawer summary small {
  color: var(--fleet-glass-muted);
}

body[data-page="ships"] .fleet-command-drawer[open] summary {
  border-bottom: 1px solid var(--fleet-glass-line);
}

body[data-page="ships"] .fleet-command-drawer > section,
body[data-page="ships"] .fleet-command-drawer > div {
  border: 0;
  border-radius: 0;
  background: transparent;
}

body[data-page="ships"] .fleet-command-inspector {
  position: sticky;
  top: calc(var(--global-topbar-height) + 10px);
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 28px;
}

body[data-page="ships"] .fleet-inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body[data-page="ships"] .fleet-spec-grid,
body[data-page="ships"] .fleet-battle-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body[data-page="ships"] .fleet-spec-grid div,
body[data-page="ships"] .fleet-battle-stats div,
body[data-page="ships"] .fleet-current-task,
body[data-page="ships"] .fleet-mini-panel,
body[data-page="ships"] .ship-modify-panel,
body[data-page="ships"] .ship-cargo-panel,
body[data-page="ships"] .battle-order-list,
body[data-page="ships"] .island-defense-panel,
body[data-page="ships"] .battle-preview-card,
body[data-page="ships"] .ship-fuel-row,
body[data-page="ships"] .ship-system-row {
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(238, 250, 247, 0.44));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body[data-page="ships"] .fleet-spec-grid div,
body[data-page="ships"] .fleet-battle-stats div {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px;
}

body[data-page="ships"] .fleet-spec-grid strong,
body[data-page="ships"] .fleet-battle-stats strong {
  color: var(--fleet-glass-ink);
  font-size: 15px;
  font-weight: 950;
}

body[data-page="ships"] .fleet-inspector-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(235, 249, 245, 0.34)),
    rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 10px 24px rgba(42, 72, 66, 0.07);
}

body[data-page="ships"] .fleet-inspector-tabs button {
  min-height: 38px;
  min-width: 0;
  padding: 7px 4px;
  border: 0;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(237, 249, 245, 0.42));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  color: rgba(21, 48, 44, 0.7);
  font-size: 13px;
  font-weight: 950;
}

body[data-page="ships"] .fleet-inspector-tabs button:hover:not(.selected) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(233, 249, 244, 0.58));
  color: #173430;
  transform: none;
}

body[data-page="ships"] .fleet-inspector-tabs button.selected,
body[data-page="ships"] .fleet-mode-switch .selected {
  background:
    linear-gradient(180deg, rgba(25, 151, 124, 0.92), rgba(8, 125, 103, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 10px 22px rgba(8, 125, 103, 0.2);
  color: #fffdf4;
}

body[data-page="ships"] .fleet-inspector-body,
body[data-page="ships"] .fleet-tab-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

body[data-page="ships"] .fleet-current-task,
body[data-page="ships"] .fleet-mini-panel,
body[data-page="ships"] .ship-modify-panel,
body[data-page="ships"] .ship-cargo-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
}

body[data-page="ships"] .fleet-current-task span {
  color: var(--fleet-glass-teal);
  font-size: 12px;
  font-weight: 950;
}

body[data-page="ships"] .fleet-current-task strong {
  font-size: 16px;
  font-weight: 950;
}

body[data-page="ships"] .fleet-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

body[data-page="ships"] .fleet-destination-row,
body[data-page="ships"] .fleet-cargo-row,
body[data-page="ships"] .fleet-voyage-row {
  display: grid;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--fleet-glass-line);
  padding-top: 9px;
}

body[data-page="ships"] .fleet-destination-row:first-of-type,
body[data-page="ships"] .fleet-cargo-row:first-child,
body[data-page="ships"] .fleet-voyage-row:first-child {
  border-top: 0;
  padding-top: 0;
}

body[data-page="ships"] .fleet-cargo-list {
  display: grid;
  gap: 9px;
}

body[data-page="ships"] .fleet-cargo-row {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

body[data-page="ships"] .fleet-cargo-row > span {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(224, 248, 243, 0.58));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 8px 18px rgba(42, 72, 66, 0.1);
  color: var(--fleet-glass-gold);
  font-weight: 950;
}

body[data-page="ships"] .fleet-cargo-row img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body[data-page="ships"] .fleet-cargo-row b {
  color: var(--fleet-glass-teal);
}

body[data-page="ships"] .fleet-voyage-list {
  display: grid;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body[data-page="ships"] .fleet-voyage-row {
  grid-template-columns: minmax(180px, 1.25fr) minmax(120px, 0.75fr) minmax(90px, 0.55fr) minmax(220px, 1.2fr) auto;
  padding: 12px;
}

body[data-page="ships"] .fleet-voyage-row.arrived {
  background: rgba(8, 125, 103, 0.08);
}

body[data-page="ships"] .ship-rental-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 24px;
  padding: 16px;
}

body[data-page="ships"] .ship-rental-action {
  display: flex;
  align-items: center;
  gap: 10px;
}

body[data-page="ships"] .ship-component-list {
  border-top-color: var(--fleet-glass-line);
}

body[data-page="ships"] .ship-component-row,
body[data-page="ships"] .ship-log-row {
  border-color: var(--fleet-glass-line);
}

body[data-page="ships"] .ship-fuel-list,
body[data-page="ships"] .ship-modify-list,
body[data-page="ships"] .ship-system-installed,
body[data-page="ships"] .ship-system-install {
  display: grid;
  gap: 8px;
}

body[data-page="ships"] .ship-fuel-row,
body[data-page="ships"] .ship-system-row {
  padding: 11px;
}

body[data-page="ships"] .ship-fuel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-page="ships"] select,
body[data-page="ships"] input {
  border: 0;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(238, 250, 246, 0.58));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(34, 61, 57, 0.08),
    0 8px 18px rgba(42, 72, 66, 0.08);
  color: var(--fleet-glass-ink);
}

body[data-page="ships"] .empty-state {
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: var(--fleet-glass-muted);
}

body[data-page="ships"] .battle-dashboard {
  border: 0;
  background: transparent;
  padding: 14px;
}

@media (prefers-reduced-transparency: reduce) {
  body[data-page="ships"] .fleet-command-metric,
  body[data-page="ships"] .fleet-command-section,
  body[data-page="ships"] .fleet-command-inspector,
  body[data-page="ships"] .fleet-command-drawer,
  body[data-page="ships"] .ship-rental-panel {
    background: #f7fbf8;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 1280px) {
  body[data-page="ships"] .fleet-command-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body[data-page="ships"] #shipsPage > section {
    margin: -4px -4px 0;
  }

  body[data-page="ships"] .fleet-command-page {
    padding: 12px;
  }

  body[data-page="ships"] .fleet-command-hero,
  body[data-page="ships"] .fleet-command-layout,
  body[data-page="ships"] .fleet-ship-row,
  body[data-page="ships"] .fleet-voyage-row {
    grid-template-columns: 1fr;
  }

  body[data-page="ships"] .fleet-command-hero {
    min-height: 0;
  }

  body[data-page="ships"] .fleet-command-inspector {
    position: static;
  }

  body[data-page="ships"] .fleet-ship-status,
  body[data-page="ships"] .fleet-ship-gauges,
  body[data-page="ships"] .fleet-ship-route,
  body[data-page="ships"] .fleet-ship-actions {
    grid-column: auto;
    grid-row: auto;
  }

  body[data-page="ships"] .fleet-ship-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  body[data-page="ships"] .fleet-command-page {
    padding: 8px;
  }

  body[data-page="ships"] .fleet-command-hero {
    border-radius: 22px;
    padding: 18px;
  }

  body[data-page="ships"] .fleet-command-hero h3 {
    font-size: 30px;
  }

  body[data-page="ships"] .fleet-command-summary,
  body[data-page="ships"] .fleet-spec-grid,
  body[data-page="ships"] .fleet-battle-stats,
  body[data-page="ships"] .fleet-inspector-tabs {
    grid-template-columns: 1fr;
  }

  body[data-page="ships"] .fleet-command-section,
  body[data-page="ships"] .fleet-command-drawer,
  body[data-page="ships"] .ship-rental-panel {
    border-radius: 20px;
  }

  body[data-page="ships"] .fleet-command-inspector {
    border-radius: 22px;
  }

  body[data-page="ships"] .fleet-inspector-header,
  body[data-page="ships"] .fleet-command-section-head,
  body[data-page="ships"] .ship-rental-panel,
  body[data-page="ships"] .ship-rental-action {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-page="ships"] .fleet-inspector-tabs button {
    min-height: 40px;
  }
}

/* Fleet command width calibration: keep the iOS glass surface centered and readable on wide screens. */
body[data-page="ships"] #shipsPage {
  display: flex;
  justify-content: center;
}

body[data-page="ships"] #shipsPage > section {
  width: min(100%, 1540px);
  max-width: 1540px;
  margin: 0 auto;
}

body[data-page="ships"] .fleet-command-page {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: clamp(12px, 1vw, 18px);
}

body[data-page="ships"] .fleet-command-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 390px);
}

body[data-page="ships"] .fleet-command-hero {
  min-height: 176px;
}

body[data-page="ships"] .fleet-command-section {
  min-width: 0;
}

@media (min-width: 1760px) {
  body[data-page="ships"] #shipsPage > section,
  body[data-page="ships"] .fleet-command-page {
    width: min(100%, 1480px);
    max-width: 1480px;
  }
}

@media (max-width: 1280px) {
  body[data-page="ships"] #shipsPage > section,
  body[data-page="ships"] .fleet-command-page {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 900px) {
  body[data-page="ships"] #shipsPage {
    display: block;
  }

  body[data-page="ships"] #shipsPage > section {
    margin: -4px -4px 0;
  }

  body[data-page="ships"] .fleet-command-page {
    padding: 12px;
  }

  body[data-page="ships"] .fleet-command-hero {
    min-height: 0;
  }

  body[data-page="ships"] .fleet-command-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body[data-page="ships"] .fleet-command-page {
    padding: 8px;
  }
}

/* Leaderboard page: iOS 27-inspired liquid-glass archive.
   Apple Liquid Glass is native to Apple platforms; this web layer approximates it
   with translucent material, soft edge light, and restrained civic-gold accents. */
body[data-page="leaderboard"] {
  --leaderboard-ios-ink: #173532;
  --leaderboard-ios-muted: rgba(42, 70, 66, 0.64);
  --leaderboard-ios-subtle: rgba(42, 70, 66, 0.46);
  --leaderboard-ios-teal: #087f73;
  --leaderboard-ios-teal-soft: rgba(8, 127, 115, 0.12);
  --leaderboard-ios-gold: #b78921;
  --leaderboard-ios-gold-soft: rgba(232, 196, 99, 0.28);
  --leaderboard-ios-red: #b95762;
  --leaderboard-ios-blue: #4c89a8;
  --leaderboard-ios-glass: rgba(255, 255, 255, 0.58);
  --leaderboard-ios-glass-strong: rgba(255, 255, 255, 0.76);
  --leaderboard-ios-line: rgba(255, 255, 255, 0.66);
  --leaderboard-ios-shadow: rgba(27, 65, 59, 0.16);
  background:
    linear-gradient(135deg, rgba(249, 253, 250, 0.98) 0%, rgba(234, 247, 243, 0.94) 48%, rgba(249, 243, 226, 0.96) 100%);
  color: var(--leaderboard-ios-ink);
}

body[data-page="leaderboard"] .app {
  max-width: none;
  padding-right: 20px;
  padding-left: 20px;
}

body[data-page="leaderboard"] #leaderboardPage > section {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 10px 0 28px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body[data-page="leaderboard"] #leaderboardPage > section > h2 {
  position: relative;
  width: fit-content;
  margin: 4px auto 18px;
  padding: 9px 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(234, 249, 245, 0.58)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    0 18px 42px rgba(34, 70, 64, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: var(--leaderboard-ios-ink);
  font-size: 27px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  backdrop-filter: blur(22px) saturate(1.25);
}

body[data-page="leaderboard"] .leaderboard-hall {
  position: relative;
  isolation: isolate;
  gap: 18px;
  color: var(--leaderboard-ios-ink);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body[data-page="leaderboard"] .leaderboard-hall::before {
  content: "";
  position: absolute;
  inset: -12px -10px 38%;
  z-index: -1;
  border-radius: 36px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(189, 232, 224, 0.18), rgba(255, 255, 255, 0));
  pointer-events: none;
}

body[data-page="leaderboard"] .leaderboard-hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(350px, 410px);
  gap: 18px;
  align-items: stretch;
}

body[data-page="leaderboard"] .leaderboard-hero,
body[data-page="leaderboard"] .leaderboard-rules-panel,
body[data-page="leaderboard"] .leaderboard-stat-card,
body[data-page="leaderboard"] .leaderboard-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--leaderboard-ios-line);
  border-radius: 28px;
  background:
    linear-gradient(145deg, var(--leaderboard-ios-glass-strong), rgba(229, 249, 244, 0.54) 54%, rgba(255, 248, 230, 0.48)),
    var(--leaderboard-ios-glass);
  box-shadow:
    0 24px 64px var(--leaderboard-ios-shadow),
    0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(32, 78, 70, 0.08);
  color: var(--leaderboard-ios-ink);
  -webkit-backdrop-filter: blur(28px) saturate(1.34);
  backdrop-filter: blur(28px) saturate(1.34);
}

body[data-page="leaderboard"] .leaderboard-hero::before,
body[data-page="leaderboard"] .leaderboard-rules-panel::before,
body[data-page="leaderboard"] .leaderboard-card::before,
body[data-page="leaderboard"] .leaderboard-stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 34%),
    linear-gradient(315deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 30%);
  opacity: 0.78;
  pointer-events: none;
}

body[data-page="leaderboard"] .leaderboard-hero > *,
body[data-page="leaderboard"] .leaderboard-rules-panel > *,
body[data-page="leaderboard"] .leaderboard-card > *,
body[data-page="leaderboard"] .leaderboard-stat-card > * {
  position: relative;
  z-index: 1;
}

body[data-page="leaderboard"] .leaderboard-hero {
  min-height: 300px;
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(217, 247, 241, 0.58) 50%, rgba(255, 245, 215, 0.56)),
    linear-gradient(180deg, rgba(250, 255, 253, 0.72), rgba(238, 250, 247, 0.68));
}

body[data-page="leaderboard"] .leaderboard-hero-eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 13px;
  padding: 8px 12px;
  border: 1px solid rgba(183, 137, 33, 0.22);
  border-radius: 999px;
  background: rgba(255, 247, 221, 0.62);
  color: var(--leaderboard-ios-gold);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="leaderboard"] .leaderboard-hero h2 {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--leaderboard-ios-ink);
  font-size: 60px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.98;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

body[data-page="leaderboard"] .leaderboard-hero p {
  max-width: 760px;
  color: rgba(29, 55, 52, 0.72);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

body[data-page="leaderboard"] .leaderboard-hero-metrics {
  gap: 12px;
  margin-top: 30px;
}

body[data-page="leaderboard"] .leaderboard-hero-metrics div {
  min-height: 82px;
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(238, 250, 247, 0.48)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(35, 72, 66, 0.1);
}

body[data-page="leaderboard"] .leaderboard-hero-metrics span,
body[data-page="leaderboard"] .leaderboard-stat-card span,
body[data-page="leaderboard"] .leaderboard-card-header p,
body[data-page="leaderboard"] .leaderboard-player small,
body[data-page="leaderboard"] .leaderboard-medal-row small,
body[data-page="leaderboard"] .honor-chip small {
  color: var(--leaderboard-ios-muted);
}

body[data-page="leaderboard"] .leaderboard-hero-metrics span {
  font-size: 12px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-hero-metrics strong {
  color: var(--leaderboard-ios-ink);
  font-size: 22px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-rules-panel {
  padding: 24px;
}

body[data-page="leaderboard"] .leaderboard-card-header {
  align-items: center;
  margin-bottom: 18px;
}

body[data-page="leaderboard"] .leaderboard-card-header h3 {
  color: var(--leaderboard-ios-ink);
  font-size: 29px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="leaderboard"] .leaderboard-card-header p {
  color: var(--leaderboard-ios-muted);
  font-size: 14px;
  font-weight: 800;
}

body[data-page="leaderboard"] .leaderboard-header-token {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(224, 249, 243, 0.56)),
    rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--leaderboard-ios-teal);
  font-size: 12px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-dashboard {
  gap: 14px;
}

body[data-page="leaderboard"] .leaderboard-stat-card {
  min-height: 122px;
  padding: 20px;
  border-radius: 24px;
  gap: 10px;
}

body[data-page="leaderboard"] .leaderboard-stat-card strong {
  color: var(--leaderboard-ios-ink);
  font-size: 32px;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.76);
}

body[data-page="leaderboard"] .leaderboard-stat-card small {
  color: var(--leaderboard-ios-teal);
  font-size: 14px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-main-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.05fr) minmax(330px, 0.76fr);
  gap: 18px;
}

body[data-page="leaderboard"] .leaderboard-support-grid {
  gap: 18px;
}

body[data-page="leaderboard"] .leaderboard-card {
  padding: 24px;
  border-radius: 28px;
}

body[data-page="leaderboard"] .leaderboard-medal-list {
  gap: 12px;
}

body[data-page="leaderboard"] .leaderboard-medal-row,
body[data-page="leaderboard"] .leaderboard-row,
body[data-page="leaderboard"] .leaderboard-podium-card,
body[data-page="leaderboard"] .leaderboard-coordinate-meter,
body[data-page="leaderboard"] .leaderboard-self,
body[data-page="leaderboard"] .leaderboard-coordinate-note {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(236, 250, 246, 0.46)),
    rgba(255, 255, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 22px rgba(34, 70, 64, 0.08);
}

body[data-page="leaderboard"] .leaderboard-medal-row {
  min-height: 68px;
  padding: 11px 12px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
}

body[data-page="leaderboard"] .leaderboard-medal-row strong {
  color: var(--leaderboard-ios-ink);
  font-size: 15px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-medal-row b {
  color: rgba(23, 53, 50, 0.82);
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-medal-mark,
body[data-page="leaderboard"] .leaderboard-podium-rank {
  border-radius: 15px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 8px 20px rgba(102, 77, 20, 0.14);
}

body[data-page="leaderboard"] .leaderboard-medal-mark.gold,
body[data-page="leaderboard"] .leaderboard-podium-card.rank-gold .leaderboard-podium-rank {
  background: linear-gradient(145deg, #ffe796, #d5a32d);
}

body[data-page="leaderboard"] .leaderboard-medal-mark.silver,
body[data-page="leaderboard"] .leaderboard-podium-card.rank-silver .leaderboard-podium-rank {
  background: linear-gradient(145deg, #f9fbfb, #b9c8ca);
}

body[data-page="leaderboard"] .leaderboard-medal-mark.bronze,
body[data-page="leaderboard"] .leaderboard-podium-card.rank-bronze .leaderboard-podium-rank {
  background: linear-gradient(145deg, #ffd1a2, #c27a3b);
}

body[data-page="leaderboard"] .leaderboard-medal-mark.ribbon {
  background: linear-gradient(145deg, #83d9c7, #e7c667);
}

body[data-page="leaderboard"] .leaderboard-podium {
  gap: 12px;
  margin: 6px 0 14px;
}

body[data-page="leaderboard"] .leaderboard-podium-card {
  min-height: 150px;
  padding: 14px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

body[data-page="leaderboard"] .leaderboard-podium-card:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 34px rgba(34, 70, 64, 0.12);
}

body[data-page="leaderboard"] .leaderboard-podium-card.rank-gold {
  background:
    linear-gradient(145deg, rgba(255, 248, 220, 0.86), rgba(255, 255, 255, 0.58) 62%),
    rgba(255, 251, 232, 0.46);
  border-color: rgba(232, 196, 99, 0.48);
}

body[data-page="leaderboard"] .leaderboard-podium-card.rank-silver {
  border-color: rgba(171, 193, 194, 0.44);
}

body[data-page="leaderboard"] .leaderboard-podium-card.rank-bronze {
  border-color: rgba(194, 122, 59, 0.34);
}

body[data-page="leaderboard"] .leaderboard-podium-rank {
  color: var(--leaderboard-ios-ink);
  font-size: 18px;
  height: 42px;
  width: 42px;
}

body[data-page="leaderboard"] .leaderboard-podium-card strong {
  color: var(--leaderboard-ios-ink);
  font-size: 19px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-podium-card b,
body[data-page="leaderboard"] .leaderboard-value {
  color: var(--leaderboard-ios-teal);
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-list {
  gap: 9px;
  margin-top: 14px;
}

body[data-page="leaderboard"] .leaderboard-row {
  min-height: 62px;
  padding: 10px 12px;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

body[data-page="leaderboard"] .leaderboard-row:hover {
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(229, 249, 244, 0.54)),
    rgba(255, 255, 255, 0.5);
}

body[data-page="leaderboard"] .leaderboard-rank {
  padding: 7px 9px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(19, 70, 65, 0.94), rgba(8, 127, 115, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 10px 20px rgba(8, 71, 65, 0.14);
  color: #fffdf5;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-row.rank-gold .leaderboard-rank {
  background: linear-gradient(145deg, #ffe48b, #d4a129);
  color: #173532;
}

body[data-page="leaderboard"] .leaderboard-row.rank-silver .leaderboard-rank {
  background: linear-gradient(145deg, #f9fbfb, #b6c6c7);
  color: #173532;
}

body[data-page="leaderboard"] .leaderboard-row.rank-bronze .leaderboard-rank {
  background: linear-gradient(145deg, #ffd0a0, #be7738);
  color: #173532;
}

body[data-page="leaderboard"] .leaderboard-player {
  color: var(--leaderboard-ios-ink);
  font-weight: 950;
}

body[data-page="leaderboard"] .player-link {
  cursor: pointer;
}

body[data-page="leaderboard"] .player-link:hover,
body[data-page="leaderboard"] .player-link:focus-visible {
  color: var(--leaderboard-ios-teal);
  outline: 0;
}

body[data-page="leaderboard"] .leaderboard-self {
  margin-top: 14px;
  padding: 13px 15px;
  background:
    linear-gradient(90deg, rgba(224, 249, 243, 0.76), rgba(255, 246, 219, 0.5)),
    rgba(255, 255, 255, 0.42);
  border-color: rgba(8, 127, 115, 0.18);
}

body[data-page="leaderboard"] .leaderboard-self strong {
  color: var(--leaderboard-ios-ink);
  font-size: 16px;
}

body[data-page="leaderboard"] .leaderboard-coordinate-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(225, 249, 243, 0.58)),
    rgba(255, 255, 255, 0.52);
}

body[data-page="leaderboard"] .leaderboard-coordinate-meter {
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
}

body[data-page="leaderboard"] .leaderboard-coordinate-meter span {
  color: var(--leaderboard-ios-ink);
  font-size: 15px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-coordinate-meter strong {
  color: var(--leaderboard-ios-ink);
  font-size: 13px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-coordinate-meter i {
  height: 11px;
  background: rgba(42, 70, 66, 0.12);
  box-shadow: inset 0 1px 2px rgba(28, 58, 54, 0.12);
}

body[data-page="leaderboard"] .leaderboard-coordinate-meter b {
  background: linear-gradient(90deg, #16aa93, #d9b64a);
  box-shadow: 0 0 18px rgba(22, 170, 147, 0.18);
}

body[data-page="leaderboard"] .leaderboard-coordinate-note {
  color: rgba(31, 62, 58, 0.78);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.58;
  margin-top: 15px;
  padding: 14px;
  border-color: rgba(183, 137, 33, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 248, 223, 0.78), rgba(255, 255, 255, 0.44)),
    rgba(255, 246, 219, 0.42);
}

body[data-page="leaderboard"] .leaderboard-industry-tabs {
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="leaderboard"] .leaderboard-industry-tab {
  min-height: 38px;
  padding: 8px 15px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: rgba(28, 55, 52, 0.62);
  font-weight: 950;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

body[data-page="leaderboard"] .leaderboard-industry-tab:hover,
body[data-page="leaderboard"] .leaderboard-industry-tab:focus-visible {
  background: rgba(255, 255, 255, 0.46);
  color: var(--leaderboard-ios-ink);
  outline: 0;
}

body[data-page="leaderboard"] .leaderboard-industry-tab.selected {
  background:
    linear-gradient(145deg, rgba(8, 127, 115, 0.96), rgba(12, 97, 103, 0.9));
  box-shadow:
    0 10px 24px rgba(8, 105, 96, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.44);
  color: #fffdf5;
  transform: translateY(-1px);
}

body[data-page="leaderboard"] .leaderboard-industry-focus {
  gap: 18px;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

body[data-page="leaderboard"] .leaderboard-industry-summary {
  min-height: 210px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(8, 127, 115, 0.92), rgba(15, 95, 100, 0.9) 58%, rgba(183, 137, 33, 0.72));
  box-shadow:
    0 24px 44px rgba(8, 79, 73, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

body[data-page="leaderboard"] .leaderboard-industry-summary span {
  color: #fffdf5;
  font-size: 25px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-industry-summary strong {
  color: #fffdf5;
  font-size: 44px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-industry-summary small {
  color: rgba(255, 253, 245, 0.82);
  font-weight: 900;
}

body[data-page="leaderboard"] .honor-chip {
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 248, 223, 0.9), rgba(255, 255, 255, 0.58)),
    rgba(255, 246, 219, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(99, 73, 18, 0.09);
  color: #5c4517;
}

body[data-page="leaderboard"] .empty-state {
  border: 1px dashed rgba(42, 70, 66, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--leaderboard-ios-muted);
  font-weight: 900;
}

@media (min-width: 1760px) {
  body[data-page="leaderboard"] #leaderboardPage > section {
    width: min(100%, 1560px);
  }
}

@media (max-width: 1280px) {
  body[data-page="leaderboard"] .leaderboard-hero-grid,
  body[data-page="leaderboard"] .leaderboard-main-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="leaderboard"] .leaderboard-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-page="leaderboard"] {
    overflow-x: hidden;
  }

  body[data-page="leaderboard"] .app {
    max-width: 100%;
    overflow-x: hidden;
    padding-right: 12px;
    padding-left: 12px;
    width: 100%;
  }

  body[data-page="leaderboard"] #leaderboardPage,
  body[data-page="leaderboard"] #leaderboard,
  body[data-page="leaderboard"] #leaderboardPage > section,
  body[data-page="leaderboard"] .leaderboard-hall {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body[data-page="leaderboard"] #leaderboardPage > section > h2 {
    font-size: 22px;
  }

  body[data-page="leaderboard"] .leaderboard-hero,
  body[data-page="leaderboard"] .leaderboard-card,
  body[data-page="leaderboard"] .leaderboard-rules-panel,
  body[data-page="leaderboard"] .leaderboard-stat-card {
    border-radius: 24px;
    padding: 18px;
  }

  body[data-page="leaderboard"] .leaderboard-hero {
    min-height: 0;
  }

  body[data-page="leaderboard"] .leaderboard-hero h2 {
    font-size: 34px;
  }

  body[data-page="leaderboard"] .leaderboard-hero p {
    font-size: 14px;
    line-height: 1.72;
  }

  body[data-page="leaderboard"] .leaderboard-hero-metrics,
  body[data-page="leaderboard"] .leaderboard-dashboard,
  body[data-page="leaderboard"] .leaderboard-podium,
  body[data-page="leaderboard"] .leaderboard-support-grid,
  body[data-page="leaderboard"] .leaderboard-industry-focus {
    grid-template-columns: 1fr;
  }

  body[data-page="leaderboard"] .leaderboard-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

body[data-page="leaderboard"] .leaderboard-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  body[data-page="leaderboard"] .leaderboard-value {
    grid-column: 2;
  }
}

/* Leaderboard v2: three-board dark archive terminal. */
body[data-page="leaderboard"] {
  --leaderboard-terminal-bg: #080c0f;
  --leaderboard-terminal-panel: rgba(18, 22, 24, 0.84);
  --leaderboard-terminal-panel-strong: rgba(26, 30, 33, 0.92);
  --leaderboard-terminal-line: rgba(255, 255, 255, 0.11);
  --leaderboard-terminal-line-soft: rgba(255, 255, 255, 0.07);
  --leaderboard-terminal-ink: #f2efe5;
  --leaderboard-terminal-muted: rgba(229, 226, 214, 0.58);
  --leaderboard-terminal-dim: rgba(229, 226, 214, 0.36);
  --leaderboard-terminal-blue: #2f5f96;
  --leaderboard-terminal-blue-soft: rgba(47, 95, 150, 0.3);
  --leaderboard-terminal-teal: #30c4ad;
  --leaderboard-terminal-gold: #d4a84d;
  --leaderboard-terminal-copper: #c06d4c;
  background:
    radial-gradient(circle at 20% 0%, rgba(48, 196, 173, 0.1), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(212, 168, 77, 0.1), transparent 26%),
    linear-gradient(180deg, #121719 0%, var(--leaderboard-terminal-bg) 58%, #050708 100%);
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] #leaderboardPage > section {
  width: min(100%, 1640px);
  padding: 10px 0 30px;
}

body[data-page="leaderboard"] #leaderboardPage > section > h2 {
  display: none;
}

body[data-page="leaderboard"] .leaderboard-terminal {
  width: min(100%, 1580px);
  margin: 0 auto;
  border: 1px solid var(--leaderboard-terminal-line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(10, 13, 15, 0.9);
  box-shadow:
    0 28px 88px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  backdrop-filter: blur(22px) saturate(1.18);
}

body[data-page="leaderboard"] .leaderboard-terminal-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 70px;
  border-bottom: 1px solid var(--leaderboard-terminal-line);
  background: rgba(255, 255, 255, 0.025);
}

body[data-page="leaderboard"] .leaderboard-terminal-tab {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 0;
  border-right: 1px solid var(--leaderboard-terminal-line-soft);
  background: rgba(255, 255, 255, 0.015);
  color: var(--leaderboard-terminal-muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

body[data-page="leaderboard"] .leaderboard-terminal-tab:last-child {
  border-right: 0;
}

body[data-page="leaderboard"] .leaderboard-terminal-tab strong {
  color: inherit;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

body[data-page="leaderboard"] .leaderboard-terminal-tab small {
  color: var(--leaderboard-terminal-dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

body[data-page="leaderboard"] .leaderboard-terminal-tab:hover,
body[data-page="leaderboard"] .leaderboard-terminal-tab:focus-visible {
  background: rgba(255, 255, 255, 0.045);
  color: var(--leaderboard-terminal-ink);
  outline: 0;
}

body[data-page="leaderboard"] .leaderboard-terminal-tab.selected {
  background:
    linear-gradient(180deg, rgba(47, 95, 150, 0.56), rgba(36, 68, 108, 0.46)),
    rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(89, 154, 226, 0.3);
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-terminal-tab.selected small {
  color: rgba(242, 239, 229, 0.72);
}

body[data-page="leaderboard"] .leaderboard-terminal-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--leaderboard-terminal-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(19, 23, 25, 0.78);
}

body[data-page="leaderboard"] .leaderboard-terminal-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--leaderboard-terminal-gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

body[data-page="leaderboard"] .leaderboard-terminal-toolbar h2 {
  margin: 0;
  color: var(--leaderboard-terminal-ink);
  font-size: 30px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.08;
}

body[data-page="leaderboard"] .leaderboard-terminal-toolbar p {
  margin: 5px 0 0;
  color: var(--leaderboard-terminal-muted);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

body[data-page="leaderboard"] .leaderboard-terminal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body[data-page="leaderboard"] .leaderboard-terminal-actions button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--leaderboard-terminal-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(242, 239, 229, 0.68);
  font-size: 13px;
  font-weight: 900;
}

body[data-page="leaderboard"] .leaderboard-terminal-actions button:disabled {
  opacity: 0.72;
}

body[data-page="leaderboard"] .leaderboard-terminal-body {
  padding: 18px;
}

body[data-page="leaderboard"] .leaderboard-terminal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 12px;
  align-items: start;
}

body[data-page="leaderboard"] .leaderboard-terminal-main,
body[data-page="leaderboard"] .leaderboard-terminal-side {
  display: grid;
  gap: 14px;
  min-width: 0;
}

body[data-page="leaderboard"] .leaderboard-terminal-panel {
  min-width: 0;
  border: 1px solid var(--leaderboard-terminal-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    var(--leaderboard-terminal-panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

body[data-page="leaderboard"] .leaderboard-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--leaderboard-terminal-line);
  background: rgba(255, 255, 255, 0.045);
}

body[data-page="leaderboard"] .leaderboard-table-head h3 {
  margin: 0;
  color: var(--leaderboard-terminal-ink);
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="leaderboard"] .leaderboard-table-head p {
  margin: 3px 0 0;
  color: var(--leaderboard-terminal-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

body[data-page="leaderboard"] .leaderboard-table-head span {
  color: var(--leaderboard-terminal-teal);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-terminal-table {
  overflow-x: auto;
}

body[data-page="leaderboard"] .leaderboard-table-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--leaderboard-terminal-line-soft);
  color: var(--leaderboard-terminal-ink);
  font-variant-numeric: tabular-nums;
}

body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row {
  grid-template-columns: 76px minmax(220px, 1fr) 160px 96px 140px 116px;
  min-width: 900px;
}

body[data-page="leaderboard"] .leaderboard-terminal-table-alliance .leaderboard-table-row {
  grid-template-columns: 76px minmax(240px, 1fr) 110px 180px 112px;
  min-width: 760px;
}

body[data-page="leaderboard"] .leaderboard-terminal-table.compact .leaderboard-table-row {
  grid-template-columns: 58px minmax(160px, 1fr) 140px;
  min-width: 360px;
}

body[data-page="leaderboard"] .leaderboard-table-row:last-child {
  border-bottom: 0;
}

body[data-page="leaderboard"] .leaderboard-table-row:hover:not(.leaderboard-table-labels) {
  background: rgba(47, 95, 150, 0.16);
}

body[data-page="leaderboard"] .leaderboard-table-row.leaderboard-table-labels {
  min-height: 34px;
  padding-top: 7px;
  padding-bottom: 7px;
  color: var(--leaderboard-terminal-dim);
  font-size: 12px;
  font-weight: 900;
}

body[data-page="leaderboard"] .leaderboard-table-row strong {
  color: var(--leaderboard-terminal-ink);
  font-size: 15px;
  font-weight: 950;
  text-align: right;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-table-row span,
body[data-page="leaderboard"] .leaderboard-table-row em {
  min-width: 0;
  color: rgba(242, 239, 229, 0.72);
  font-style: normal;
  font-weight: 800;
}

body[data-page="leaderboard"] .leaderboard-table-row em {
  text-align: right;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-labels span:nth-child(n + 3),
body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row > span:nth-child(4),
body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row > strong:nth-child(5),
body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row > em {
  text-align: right;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-table-rank {
  color: var(--leaderboard-terminal-ink) !important;
  font-size: 16px;
  font-weight: 950 !important;
}

body[data-page="leaderboard"] .leaderboard-table-row.rank-gold .leaderboard-table-rank {
  color: var(--leaderboard-terminal-gold) !important;
}

body[data-page="leaderboard"] .leaderboard-table-row.rank-silver .leaderboard-table-rank {
  color: #d7dde0 !important;
}

body[data-page="leaderboard"] .leaderboard-table-row.rank-bronze .leaderboard-table-rank {
  color: var(--leaderboard-terminal-copper) !important;
}

body[data-page="leaderboard"] .leaderboard-name-cell {
  display: inline-grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

body[data-page="leaderboard"] button.leaderboard-name-cell {
  cursor: pointer;
}

body[data-page="leaderboard"] button.leaderboard-name-cell:hover .leaderboard-name-copy b,
body[data-page="leaderboard"] button.leaderboard-name-cell:focus-visible .leaderboard-name-copy b {
  color: var(--leaderboard-terminal-teal);
}

body[data-page="leaderboard"] button.leaderboard-name-cell:focus-visible {
  outline: 1px solid rgba(48, 196, 173, 0.6);
  outline-offset: 3px;
}

body[data-page="leaderboard"] .leaderboard-emblem {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #061012;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-page="leaderboard"] .leaderboard-emblem.emblem-0 { background: #30c4ad; }
body[data-page="leaderboard"] .leaderboard-emblem.emblem-1 { background: #d4a84d; }
body[data-page="leaderboard"] .leaderboard-emblem.emblem-2 { background: #6da2d8; }
body[data-page="leaderboard"] .leaderboard-emblem.emblem-3 { background: #c06d4c; }
body[data-page="leaderboard"] .leaderboard-emblem.emblem-4 { background: #b9c7d1; }
body[data-page="leaderboard"] .leaderboard-emblem.emblem-5 { background: #8fbf6f; }

body[data-page="leaderboard"] .leaderboard-name-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body[data-page="leaderboard"] .leaderboard-name-copy b {
  overflow: hidden;
  color: rgba(118, 168, 218, 0.92);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-name-copy small {
  overflow: hidden;
  color: var(--leaderboard-terminal-dim);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-terminal-self,
body[data-page="leaderboard"] .leaderboard-terminal-table .leaderboard-self {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin: 0;
  min-height: 56px;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid rgba(89, 154, 226, 0.28);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(47, 95, 150, 0.4), rgba(47, 95, 150, 0.22)),
    rgba(17, 31, 44, 0.78);
  box-shadow: none;
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-terminal-self span {
  display: grid;
  gap: 2px;
}

body[data-page="leaderboard"] .leaderboard-terminal-self b,
body[data-page="leaderboard"] .leaderboard-terminal-self strong {
  color: var(--leaderboard-terminal-ink);
  font-weight: 950;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-terminal-self small,
body[data-page="leaderboard"] .leaderboard-terminal-self em {
  color: rgba(242, 239, 229, 0.68);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-dossier-panel {
  background:
    linear-gradient(180deg, rgba(47, 95, 150, 0.14), rgba(255, 255, 255, 0.015)),
    var(--leaderboard-terminal-panel-strong);
}

body[data-page="leaderboard"] .leaderboard-dossier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--leaderboard-terminal-line-soft);
}

body[data-page="leaderboard"] .leaderboard-dossier-grid div {
  min-height: 94px;
  padding: 13px;
  background: rgba(9, 13, 15, 0.62);
}

body[data-page="leaderboard"] .leaderboard-dossier-grid span,
body[data-page="leaderboard"] .leaderboard-dossier-honor span {
  display: block;
  margin-bottom: 7px;
  color: var(--leaderboard-terminal-muted);
  font-size: 12px;
  font-weight: 900;
}

body[data-page="leaderboard"] .leaderboard-dossier-grid strong,
body[data-page="leaderboard"] .leaderboard-dossier-honor strong {
  display: block;
  overflow: hidden;
  color: var(--leaderboard-terminal-ink);
  font-size: 19px;
  font-weight: 950;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-dossier-grid small {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--leaderboard-terminal-dim);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-dossier-honor {
  padding: 14px;
  border-top: 1px solid var(--leaderboard-terminal-line-soft);
  background: rgba(212, 168, 77, 0.08);
}

body[data-page="leaderboard"] .leaderboard-industry-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body[data-page="leaderboard"] .leaderboard-industry-panel .leaderboard-table-head {
  min-height: 54px;
}

body[data-page="leaderboard"] .leaderboard-terminal-table.industry .leaderboard-table-row {
  min-height: 46px;
}

body[data-page="leaderboard"] .empty-state {
  margin: 10px;
  padding: 14px;
  border: 1px dashed rgba(242, 239, 229, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--leaderboard-terminal-muted);
  font-size: 13px;
  font-weight: 850;
}

@media (max-width: 1180px) {
  body[data-page="leaderboard"] .leaderboard-terminal-layout {
    grid-template-columns: 1fr;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="leaderboard"] .leaderboard-terminal-side .leaderboard-dossier-panel {
    grid-column: 1 / -1;
  }

  body[data-page="leaderboard"] .leaderboard-industry-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-page="leaderboard"] .leaderboard-terminal {
    border-radius: 8px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-tabs {
    min-height: 58px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-tab {
    padding: 8px 6px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-tab strong {
    font-size: 15px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-tab small {
    display: none;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-toolbar h2 {
    font-size: 24px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-body {
    padding: 12px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-side,
  body[data-page="leaderboard"] .leaderboard-industry-matrix {
    grid-template-columns: 1fr;
  }

  body[data-page="leaderboard"] .leaderboard-table-head {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-page="leaderboard"] .leaderboard-dossier-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-self,
  body[data-page="leaderboard"] .leaderboard-terminal-table .leaderboard-self {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* Leaderboard v3: Taste skill Apple Liquid Glass pass.
   Apple Liquid Glass is native-platform material; this web layer approximates it
   with translucency, layered edge light, saturating blur, and tactile highlights. */
body[data-page="leaderboard"] {
  --leaderboard-terminal-bg: #edf5f4;
  --leaderboard-terminal-panel: rgba(255, 255, 255, 0.56);
  --leaderboard-terminal-panel-strong: rgba(255, 255, 255, 0.72);
  --leaderboard-terminal-line: rgba(255, 255, 255, 0.64);
  --leaderboard-terminal-line-soft: rgba(37, 78, 87, 0.1);
  --leaderboard-terminal-ink: #132f35;
  --leaderboard-terminal-muted: rgba(26, 55, 62, 0.62);
  --leaderboard-terminal-dim: rgba(26, 55, 62, 0.44);
  --leaderboard-terminal-blue: #3479ba;
  --leaderboard-terminal-blue-soft: rgba(52, 121, 186, 0.16);
  --leaderboard-terminal-teal: #087f73;
  --leaderboard-terminal-gold: #b78b24;
  --leaderboard-terminal-copper: #a86045;
  background:
    linear-gradient(132deg, rgba(246, 251, 249, 0.98) 0%, rgba(222, 239, 245, 0.96) 44%, rgba(247, 243, 232, 0.94) 100%),
    linear-gradient(180deg, #f7fbfa, #e5f0f2);
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-terminal {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(228, 245, 248, 0.5) 52%, rgba(255, 248, 229, 0.38)),
    rgba(255, 255, 255, 0.46);
  box-shadow:
    0 32px 90px rgba(42, 76, 82, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(21, 74, 83, 0.08);
  -webkit-backdrop-filter: blur(34px) saturate(1.55);
  backdrop-filter: blur(34px) saturate(1.55);
}

body[data-page="leaderboard"] .leaderboard-terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 34%),
    linear-gradient(315deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 30%);
  opacity: 0.72;
  pointer-events: none;
}

body[data-page="leaderboard"] .leaderboard-terminal > * {
  position: relative;
  z-index: 1;
}

body[data-page="leaderboard"] .leaderboard-terminal-tabs {
  min-height: 78px;
  border-bottom: 1px solid rgba(39, 78, 86, 0.12);
  background: rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.62);
}

body[data-page="leaderboard"] .leaderboard-terminal-tab {
  border-right: 1px solid rgba(38, 75, 83, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08)),
    transparent;
  color: rgba(19, 47, 53, 0.62);
}

body[data-page="leaderboard"] .leaderboard-terminal-tab strong {
  font-size: 19px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.58);
}

body[data-page="leaderboard"] .leaderboard-terminal-tab small {
  color: rgba(26, 55, 62, 0.48);
}

body[data-page="leaderboard"] .leaderboard-terminal-tab:hover,
body[data-page="leaderboard"] .leaderboard-terminal-tab:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(242, 249, 250, 0.36)),
    rgba(255, 255, 255, 0.2);
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-terminal-tab.selected {
  background:
    linear-gradient(150deg, rgba(61, 132, 197, 0.7), rgba(55, 123, 186, 0.52) 52%, rgba(255, 255, 255, 0.32)),
    rgba(68, 139, 203, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    inset 0 -1px 0 rgba(29, 87, 145, 0.32),
    0 16px 34px rgba(47, 106, 166, 0.16);
  color: #fffdf7;
}

body[data-page="leaderboard"] .leaderboard-terminal-tab.selected small {
  color: rgba(255, 253, 247, 0.78);
}

body[data-page="leaderboard"] .leaderboard-terminal-toolbar {
  border-bottom: 1px solid rgba(39, 78, 86, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(237, 248, 249, 0.22)),
    rgba(255, 255, 255, 0.2);
}

body[data-page="leaderboard"] .leaderboard-terminal-kicker {
  color: var(--leaderboard-terminal-gold);
}

body[data-page="leaderboard"] .leaderboard-terminal-toolbar h2 {
  color: var(--leaderboard-terminal-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.68);
}

body[data-page="leaderboard"] .leaderboard-terminal-toolbar p {
  color: var(--leaderboard-terminal-muted);
}

body[data-page="leaderboard"] .leaderboard-terminal-actions button {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(237, 247, 248, 0.42)),
    rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 22px rgba(42, 76, 82, 0.1);
  color: rgba(19, 47, 53, 0.68);
}

body[data-page="leaderboard"] .leaderboard-terminal-body {
  background: rgba(255, 255, 255, 0.08);
}

body[data-page="leaderboard"] .leaderboard-terminal-panel {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(232, 247, 250, 0.38)),
    rgba(255, 255, 255, 0.4);
  box-shadow:
    0 18px 46px rgba(43, 77, 83, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(24, 82, 91, 0.07);
  -webkit-backdrop-filter: blur(26px) saturate(1.42);
  backdrop-filter: blur(26px) saturate(1.42);
}

body[data-page="leaderboard"] .leaderboard-table-head {
  min-height: 64px;
  border-bottom: 1px solid rgba(39, 78, 86, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(242, 250, 250, 0.24)),
    rgba(255, 255, 255, 0.14);
}

body[data-page="leaderboard"] .leaderboard-table-head h3 {
  color: var(--leaderboard-terminal-ink);
  font-size: 20px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.62);
}

body[data-page="leaderboard"] .leaderboard-table-head p {
  color: var(--leaderboard-terminal-muted);
}

body[data-page="leaderboard"] .leaderboard-table-head span {
  color: var(--leaderboard-terminal-teal);
}

body[data-page="leaderboard"] .leaderboard-table-row {
  border-bottom: 1px solid rgba(31, 77, 86, 0.08);
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-table-row:hover:not(.leaderboard-table-labels) {
  background:
    linear-gradient(90deg, rgba(52, 121, 186, 0.12), rgba(255, 255, 255, 0.24)),
    rgba(255, 255, 255, 0.2);
}

body[data-page="leaderboard"] .leaderboard-table-row.leaderboard-table-labels {
  color: rgba(26, 55, 62, 0.42);
}

body[data-page="leaderboard"] .leaderboard-table-row strong {
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-table-row span,
body[data-page="leaderboard"] .leaderboard-table-row em {
  color: rgba(19, 47, 53, 0.72);
}

body[data-page="leaderboard"] .leaderboard-table-rank {
  color: #1d4b56 !important;
}

body[data-page="leaderboard"] .leaderboard-table-row.rank-gold .leaderboard-table-rank {
  color: #ad7d12 !important;
}

body[data-page="leaderboard"] .leaderboard-table-row.rank-silver .leaderboard-table-rank {
  color: #687980 !important;
}

body[data-page="leaderboard"] .leaderboard-table-row.rank-bronze .leaderboard-table-rank {
  color: #a86045 !important;
}

body[data-page="leaderboard"] .leaderboard-emblem {
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 10px 22px rgba(45, 78, 84, 0.1);
}

body[data-page="leaderboard"] .leaderboard-name-copy b {
  color: #286aa3;
}

body[data-page="leaderboard"] .leaderboard-name-copy small {
  color: rgba(26, 55, 62, 0.42);
}

body[data-page="leaderboard"] .leaderboard-terminal-self,
body[data-page="leaderboard"] .leaderboard-terminal-table .leaderboard-self {
  border-top: 1px solid rgba(52, 121, 186, 0.22);
  background:
    linear-gradient(100deg, rgba(52, 121, 186, 0.22), rgba(255, 255, 255, 0.52) 56%, rgba(8, 127, 115, 0.12)),
    rgba(236, 248, 250, 0.5);
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-terminal-self b,
body[data-page="leaderboard"] .leaderboard-terminal-self strong {
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-terminal-self small,
body[data-page="leaderboard"] .leaderboard-terminal-self em {
  color: rgba(19, 47, 53, 0.64);
}

body[data-page="leaderboard"] .leaderboard-dossier-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(227, 244, 248, 0.5)),
    rgba(255, 255, 255, 0.46);
}

body[data-page="leaderboard"] .leaderboard-dossier-grid {
  background: rgba(31, 77, 86, 0.08);
}

body[data-page="leaderboard"] .leaderboard-dossier-grid div {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(244, 250, 250, 0.32)),
    rgba(255, 255, 255, 0.22);
}

body[data-page="leaderboard"] .leaderboard-dossier-grid span,
body[data-page="leaderboard"] .leaderboard-dossier-honor span {
  color: var(--leaderboard-terminal-muted);
}

body[data-page="leaderboard"] .leaderboard-dossier-grid strong,
body[data-page="leaderboard"] .leaderboard-dossier-honor strong {
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-dossier-grid small {
  color: var(--leaderboard-terminal-dim);
}

body[data-page="leaderboard"] .leaderboard-dossier-honor {
  border-top: 1px solid rgba(31, 77, 86, 0.08);
  background:
    linear-gradient(90deg, rgba(255, 247, 220, 0.58), rgba(255, 255, 255, 0.2)),
    rgba(255, 250, 232, 0.34);
}

body[data-page="leaderboard"] .empty-state {
  border-color: rgba(28, 67, 76, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(241, 249, 249, 0.26)),
    rgba(255, 255, 255, 0.2);
  color: var(--leaderboard-terminal-muted);
}

@media (prefers-reduced-transparency: reduce) {
  body[data-page="leaderboard"] .leaderboard-terminal,
  body[data-page="leaderboard"] .leaderboard-terminal-panel {
    background: rgba(247, 251, 250, 0.96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 760px) {
  body[data-page="leaderboard"] .leaderboard-terminal {
    border-radius: 24px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-tab strong {
    font-size: 15px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-panel {
    border-radius: 18px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table.compact {
    overflow-x: hidden;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table.compact .leaderboard-table-row {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    min-width: 0;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table.compact .leaderboard-terminal-self,
  body[data-page="leaderboard"] .leaderboard-terminal-table.compact .leaderboard-self {
    min-width: 0;
  }
}

/* Policy doctrine lane labels: remove the small metadata rows and keep the lane titles compact. */
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 0 10px 14px 0;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane-head strong {
  margin: 0;
}

/* Production tab: iOS liquid-glass command surface. */
.technology-workbench-modal[data-workbench-tab="production"] {
  background:
    radial-gradient(ellipse at 18% 0%, rgba(117, 214, 202, 0.24), transparent 38%),
    radial-gradient(ellipse at 84% 12%, rgba(233, 192, 92, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(244, 251, 248, 0.78), rgba(230, 242, 238, 0.84));
  -webkit-backdrop-filter: blur(20px) saturate(1.24);
  backdrop-filter: blur(20px) saturate(1.24);
}

.technology-workbench-shell[data-workbench-tab="production"] {
  --production-ink: #143432;
  --production-muted: rgba(35, 62, 58, 0.62);
  --production-line: rgba(39, 89, 81, 0.15);
  --production-line-strong: rgba(13, 126, 112, 0.32);
  --production-panel: rgba(255, 255, 255, 0.64);
  --production-panel-strong: rgba(255, 255, 255, 0.84);
  --production-teal: #0f9183;
  --production-deep: #0a646b;
  --production-gold: #c99b31;
  --production-blue: #4c83a6;
  --production-shadow: rgba(37, 72, 66, 0.16);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 30px 30px 0 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.62), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(229, 249, 244, 0.72) 52%, rgba(255, 248, 226, 0.72)),
    rgba(239, 249, 246, 0.88);
  box-shadow:
    0 34px 90px rgba(26, 55, 52, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(117, 159, 152, 0.18);
  color: var(--production-ink);
  -webkit-backdrop-filter: blur(28px) saturate(1.28);
  backdrop-filter: blur(28px) saturate(1.28);
}

.technology-workbench-shell[data-workbench-tab="production"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(118deg, transparent 0 26%, rgba(255, 255, 255, 0.36) 38%, transparent 50%),
    radial-gradient(circle at 94% 86%, rgba(15, 145, 131, 0.12), transparent 34%),
    radial-gradient(circle at 8% 24%, rgba(255, 255, 255, 0.44), transparent 28%);
  opacity: 0.9;
  pointer-events: none;
}

.technology-workbench-shell[data-workbench-tab="production"] .technology-workbench-head {
  min-height: 88px;
  border-bottom: 1px solid rgba(133, 177, 170, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(231, 249, 245, 0.62) 58%, rgba(255, 244, 213, 0.58)),
    rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.62);
}

.technology-workbench-shell[data-workbench-tab="production"] .technology-workbench-head h2 {
  color: var(--production-ink);
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

.technology-workbench-shell[data-workbench-tab="production"] .technology-workbench-close {
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(230, 244, 240, 0.64)),
    rgba(255, 255, 255, 0.54);
  color: rgba(20, 52, 50, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(30, 68, 64, 0.14);
}

.technology-workbench-shell[data-workbench-tab="production"] .technology-workbench-close:hover {
  color: var(--production-teal);
  background: rgba(255, 255, 255, 0.84);
}

.technology-workbench-shell[data-workbench-tab="production"] .technology-workbench-body {
  background:
    radial-gradient(circle at 18% 9%, rgba(15, 145, 131, 0.08), transparent 34%),
    radial-gradient(circle at 78% 4%, rgba(201, 155, 49, 0.1), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 42%);
  padding: 18px clamp(16px, 2vw, 24px);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-command-center {
  gap: 12px;
  max-width: 1360px;
  margin: 0 auto;
  padding-bottom: 26px;
  color: var(--production-ink);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-brief {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.32fr);
  min-height: 156px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  padding: 20px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(90deg, rgba(250, 255, 253, 0.92) 0%, rgba(237, 250, 246, 0.78) 35%, rgba(237, 250, 246, 0.3) 66%, rgba(255, 247, 225, 0.14) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(181, 219, 211, 0.16)),
    url("/assets/government-concepts/production-hero/national_production_dispatch.webp?v=production-hero-20260611-v1") center / cover;
  box-shadow:
    0 22px 54px var(--production-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(83, 129, 121, 0.1);
  color: var(--production-ink);
  -webkit-backdrop-filter: blur(18px) saturate(1.14);
  backdrop-filter: blur(18px) saturate(1.14);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-brief::before {
  background:
    linear-gradient(112deg, transparent 0 34%, rgba(255, 255, 255, 0.44) 44%, transparent 56%),
    radial-gradient(circle at 90% 0%, rgba(201, 155, 49, 0.15), transparent 30%);
  opacity: 0.72;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-brief-main > span,
.technology-workbench-shell[data-workbench-tab="production"] .production-panel-header span {
  color: rgba(15, 111, 103, 0.74);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-brief-main h2 {
  margin-top: 8px;
  color: var(--production-ink);
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 850;
  line-height: 1.04;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.76);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-brief-main p,
.technology-workbench-shell[data-workbench-tab="production"] .production-panel-header small,
.technology-workbench-shell[data-workbench-tab="production"] .production-kpi-card span,
.technology-workbench-shell[data-workbench-tab="production"] .production-kpi-card small,
.technology-workbench-shell[data-workbench-tab="production"] .production-island-name small,
.technology-workbench-shell[data-workbench-tab="production"] .production-matrix-row small,
.technology-workbench-shell[data-workbench-tab="production"] .production-flow-item-head small,
.technology-workbench-shell[data-workbench-tab="production"] .production-flow-item-head span,
.technology-workbench-shell[data-workbench-tab="production"] .production-subpanel-title span,
.technology-workbench-shell[data-workbench-tab="production"] .production-building-card-head small,
.technology-workbench-shell[data-workbench-tab="production"] .production-building-meta span,
.technology-workbench-shell[data-workbench-tab="production"] .production-building-main span,
.technology-workbench-shell[data-workbench-tab="production"] .job-detail,
.technology-workbench-shell[data-workbench-tab="production"] .completed-title {
  color: var(--production-muted);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-brief-tags b,
.technology-workbench-shell[data-workbench-tab="production"] .production-status-pill,
.technology-workbench-shell[data-workbench-tab="production"] .production-product-chip {
  border: 1px solid rgba(255, 255, 255, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.42);
  color: rgba(28, 60, 56, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(37, 72, 66, 0.08);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-brief-stamp {
  align-self: stretch;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(233, 249, 245, 0.48)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 12px 24px rgba(37, 72, 66, 0.1);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-brief-stamp span,
.technology-workbench-shell[data-workbench-tab="production"] .production-brief-stamp small {
  color: rgba(35, 62, 58, 0.58);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-brief-stamp strong {
  color: var(--production-ink);
  font-size: 22px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-kpi-grid {
  gap: 12px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-kpi-card {
  min-height: 104px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  padding: 15px 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(235, 249, 246, 0.48)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 12px 26px rgba(37, 72, 66, 0.1);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-kpi-card strong {
  color: var(--production-ink);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-kpi-card.is-active {
  border-color: rgba(15, 145, 131, 0.34);
  background:
    linear-gradient(145deg, rgba(238, 255, 249, 0.86), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 4px 0 0 rgba(15, 145, 131, 0.84),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(15, 145, 131, 0.13);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-kpi-card.is-gold {
  border-color: rgba(201, 155, 49, 0.38);
  box-shadow:
    inset 4px 0 0 rgba(201, 155, 49, 0.84),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(201, 155, 49, 0.12);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-dashboard-grid,
.technology-workbench-shell[data-workbench-tab="production"] .production-current-grid {
  gap: 14px;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-panel,
.technology-workbench-shell[data-workbench-tab="production"] .production-subpanel {
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(232, 249, 245, 0.5)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    0 22px 54px var(--production-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(83, 129, 121, 0.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-panel {
  gap: 14px;
  padding: 16px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-panel-header {
  border-bottom: 1px solid var(--production-line);
  padding-bottom: 13px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-panel-header h3,
.technology-workbench-shell[data-workbench-tab="production"] .production-island-name strong,
.technology-workbench-shell[data-workbench-tab="production"] .production-matrix-row strong,
.technology-workbench-shell[data-workbench-tab="production"] .production-flow-item-head strong,
.technology-workbench-shell[data-workbench-tab="production"] .production-subpanel-title strong,
.technology-workbench-shell[data-workbench-tab="production"] .production-building-card-head strong,
.technology-workbench-shell[data-workbench-tab="production"] .production-building-main strong,
.technology-workbench-shell[data-workbench-tab="production"] .job-group-header strong {
  color: var(--production-ink);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-panel-header h3 {
  font-size: 21px;
  font-weight: 850;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-island-list {
  max-height: 420px;
  padding-right: 4px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-island-row,
.technology-workbench-shell[data-workbench-tab="production"] .production-flow-item,
.technology-workbench-shell[data-workbench-tab="production"] .production-matrix-row,
.technology-workbench-shell[data-workbench-tab="production"] .production-building-card,
.technology-workbench-shell[data-workbench-tab="production"] .production-job-list .job-group,
.technology-workbench-shell[data-workbench-tab="production"] .production-job-list .completed-jobs {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(239, 251, 248, 0.54)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 26px rgba(37, 72, 66, 0.09);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-island-row {
  min-height: 74px;
  grid-template-columns: minmax(160px, 1.25fr) 58px 58px minmax(108px, 0.7fr) auto auto;
  padding: 11px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-island-row.selected,
.technology-workbench-shell[data-workbench-tab="production"] .production-matrix-row.selected {
  border-color: rgba(15, 145, 131, 0.36);
  background:
    linear-gradient(145deg, rgba(221, 250, 243, 0.84), rgba(255, 255, 255, 0.62)),
    rgba(255, 255, 255, 0.56);
  box-shadow:
    inset 4px 0 0 rgba(15, 145, 131, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 14px 32px rgba(15, 145, 131, 0.14);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-island-row span {
  color: rgba(35, 62, 58, 0.56);
  font-weight: 750;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-island-row b {
  color: var(--production-ink);
  font-weight: 900;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-island-progress i,
.technology-workbench-shell[data-workbench-tab="production"] .production-progress-track {
  height: 8px;
  background:
    linear-gradient(180deg, rgba(29, 66, 60, 0.12), rgba(255, 255, 255, 0.28)),
    rgba(42, 83, 75, 0.12);
  box-shadow: inset 0 1px 2px rgba(31, 70, 62, 0.12);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-island-progress em,
.technology-workbench-shell[data-workbench-tab="production"] .production-progress-track i {
  background: linear-gradient(90deg, var(--production-teal), #5ec7b2, var(--production-gold));
  box-shadow: 0 0 14px rgba(15, 145, 131, 0.18);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-link-button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.3), transparent 54%),
    linear-gradient(180deg, #20b9a4, #0f9183 52%, #08756d);
  color: #fffdf4;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -12px 18px rgba(3, 73, 74, 0.18),
    0 12px 22px rgba(15, 145, 131, 0.2);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-link-button:hover {
  border-color: rgba(255, 255, 255, 0.74);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.36), transparent 54%),
    linear-gradient(180deg, #29c9af, #0f9d8c 52%, #087a72);
  transform: translateY(-1px);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-flow-title {
  color: rgba(15, 111, 103, 0.76);
  font-size: 13px;
  font-weight: 900;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-flow-item {
  border-left: 0;
  box-shadow:
    inset 4px 0 0 rgba(15, 145, 131, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 26px rgba(37, 72, 66, 0.09);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-flow-item.is-pending {
  box-shadow:
    inset 4px 0 0 rgba(201, 155, 49, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 26px rgba(37, 72, 66, 0.09);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-flow-item.is-completed {
  box-shadow:
    inset 4px 0 0 rgba(76, 131, 166, 0.76),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 26px rgba(37, 72, 66, 0.09);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-flow-empty,
.technology-workbench-shell[data-workbench-tab="production"] .empty-state {
  border: 1px dashed rgba(15, 126, 112, 0.24);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.46);
  color: rgba(35, 62, 58, 0.58);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-product-chip i {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at 36% 24%, rgba(255, 255, 255, 0.92), transparent 44%),
    linear-gradient(145deg, rgba(15, 145, 131, 0.14), rgba(201, 155, 49, 0.11)),
    rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-matrix-row {
  grid-template-columns: minmax(170px, 1.3fr) 90px 64px 64px 64px minmax(150px, 1fr) 120px 78px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-matrix-row.head {
  min-height: 44px;
  border-color: rgba(255, 255, 255, 0.34);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.26), transparent 38%),
    linear-gradient(145deg, rgba(15, 145, 131, 0.94), rgba(10, 100, 107, 0.9));
  color: #fffdf4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 14px 28px rgba(9, 105, 95, 0.14);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-matrix-row:not(.head) > span {
  color: rgba(35, 62, 58, 0.74);
  font-size: 13px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-current-panel {
  overflow: visible;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-subpanel {
  border-radius: 24px;
  padding: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 32px rgba(37, 72, 66, 0.1);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-building-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.technology-workbench-shell[data-workbench-tab="production"] .production-building-card {
  min-height: 160px;
  border-radius: 22px;
  padding: 14px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-building-card.is-running {
  box-shadow:
    inset 4px 0 0 rgba(15, 145, 131, 0.84),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 26px rgba(37, 72, 66, 0.09);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-building-card.is-paused {
  box-shadow:
    inset 4px 0 0 rgba(201, 155, 49, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 26px rgba(37, 72, 66, 0.09);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-building-card-head > span {
  border: 1px solid rgba(255, 255, 255, 0.64);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 246, 0.46)),
    rgba(15, 145, 131, 0.1);
  color: var(--production-teal);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-filter-tabs {
  gap: 8px;
  margin-bottom: 0;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-filter-tabs .filter-tab {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 246, 0.46)),
    var(--industry-surface, rgba(255, 255, 255, 0.36));
  color: rgba(35, 62, 58, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 16px rgba(37, 72, 66, 0.08);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-filter-tabs .filter-tab.selected {
  border-color: rgba(255, 255, 255, 0.68);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.32), transparent 54%),
    linear-gradient(180deg, var(--industry-color, #20b9a4), var(--production-teal) 56%, var(--production-deep));
  color: #fffdf4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 12px 24px var(--industry-glow, rgba(15, 145, 131, 0.18));
}

.technology-workbench-shell[data-workbench-tab="production"] .production-job-list .job-group {
  overflow: hidden;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-job-list .job-group-header {
  border: 0;
  border-bottom: 1px solid var(--production-line);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.62), rgba(232, 249, 245, 0.36)),
    rgba(255, 255, 255, 0.3);
  color: var(--production-ink);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-job-list .job-item {
  margin: 0;
  padding: 10px 12px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-job-list .job-item + .job-item {
  border-top: 1px solid rgba(39, 89, 81, 0.1);
}

.technology-workbench-shell[data-workbench-tab="production"] .production-job-list .completed-jobs {
  margin-top: 12px;
  padding: 12px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-command-center ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.technology-workbench-shell[data-workbench-tab="production"] .production-command-center ::-webkit-scrollbar-thumb {
  border: 3px solid rgba(239, 249, 246, 0.78);
  border-radius: 999px;
  background: rgba(16, 105, 96, 0.34);
}

@media (max-width: 1100px) {
  .technology-workbench-shell[data-workbench-tab="production"] .production-dashboard-grid,
  .technology-workbench-shell[data-workbench-tab="production"] .production-current-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .technology-workbench-shell[data-workbench-tab="production"] {
    border-radius: 24px 24px 0 0;
  }

  .technology-workbench-shell[data-workbench-tab="production"] .technology-workbench-body {
    padding: 14px 12px;
  }

  .technology-workbench-shell[data-workbench-tab="production"] .production-brief,
  .technology-workbench-shell[data-workbench-tab="production"] .production-panel {
    border-radius: 24px;
  }

  .technology-workbench-shell[data-workbench-tab="production"] .production-brief {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .technology-workbench-shell[data-workbench-tab="production"] .production-kpi-grid {
    grid-template-columns: 1fr;
  }

  .technology-workbench-shell[data-workbench-tab="production"] .production-panel-header,
  .technology-workbench-shell[data-workbench-tab="production"] .production-flow-item-head,
  .technology-workbench-shell[data-workbench-tab="production"] .production-subpanel-title {
    align-items: start;
    display: grid;
    text-align: left;
  }

  .technology-workbench-shell[data-workbench-tab="production"] .production-panel-header small {
    text-align: left;
  }

  .technology-workbench-shell[data-workbench-tab="production"] .production-island-row {
    grid-template-columns: minmax(0, 1fr) 58px 58px;
  }
}

/* Treasury tab: liquid-glass national inventory archive. */
.technology-workbench-modal[data-workbench-tab="warehouse"] {
  background:
    radial-gradient(ellipse at 16% 0%, rgba(117, 214, 202, 0.24), transparent 38%),
    radial-gradient(ellipse at 84% 12%, rgba(224, 188, 94, 0.24), transparent 35%),
    linear-gradient(180deg, rgba(245, 251, 248, 0.78), rgba(230, 242, 237, 0.86));
  -webkit-backdrop-filter: blur(20px) saturate(1.24);
  backdrop-filter: blur(20px) saturate(1.24);
}

.technology-workbench-shell[data-workbench-tab="warehouse"] {
  --treasury-ink: #143432;
  --treasury-muted: rgba(35, 62, 58, 0.62);
  --treasury-line: rgba(39, 89, 81, 0.15);
  --treasury-line-strong: rgba(13, 126, 112, 0.3);
  --treasury-panel: rgba(255, 255, 255, 0.64);
  --treasury-panel-strong: rgba(255, 255, 255, 0.84);
  --treasury-teal: #0f9183;
  --treasury-deep: #0a646b;
  --treasury-gold: #c99b31;
  --treasury-blue: #4c83a6;
  --treasury-red: #bd6a61;
  --treasury-shadow: rgba(37, 72, 66, 0.16);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 30px 30px 0 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.62), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(228, 248, 244, 0.72) 52%, rgba(255, 248, 226, 0.72)),
    rgba(239, 249, 246, 0.88);
  box-shadow:
    0 34px 90px rgba(26, 55, 52, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(117, 159, 152, 0.18);
  color: var(--treasury-ink);
  -webkit-backdrop-filter: blur(28px) saturate(1.28);
  backdrop-filter: blur(28px) saturate(1.28);
}

.technology-workbench-shell[data-workbench-tab="warehouse"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(118deg, transparent 0 26%, rgba(255, 255, 255, 0.36) 38%, transparent 50%),
    radial-gradient(circle at 94% 86%, rgba(15, 145, 131, 0.12), transparent 34%),
    radial-gradient(circle at 8% 24%, rgba(255, 255, 255, 0.44), transparent 28%);
  opacity: 0.9;
  pointer-events: none;
}

.technology-workbench-shell[data-workbench-tab="warehouse"] .technology-workbench-head {
  min-height: 88px;
  border-bottom: 1px solid rgba(133, 177, 170, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(231, 249, 245, 0.62) 58%, rgba(255, 244, 213, 0.58)),
    rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.62);
}

.technology-workbench-shell[data-workbench-tab="warehouse"] .technology-workbench-head h2 {
  color: var(--treasury-ink);
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

.technology-workbench-shell[data-workbench-tab="warehouse"] .technology-workbench-close {
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(230, 244, 240, 0.64)),
    rgba(255, 255, 255, 0.54);
  color: rgba(20, 52, 50, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(30, 68, 64, 0.14);
}

.technology-workbench-shell[data-workbench-tab="warehouse"] .technology-workbench-close:hover {
  color: var(--treasury-teal);
  background: rgba(255, 255, 255, 0.84);
}

.technology-workbench-shell[data-workbench-tab="warehouse"] .technology-workbench-body {
  background:
    radial-gradient(circle at 18% 9%, rgba(15, 145, 131, 0.08), transparent 34%),
    radial-gradient(circle at 78% 4%, rgba(201, 155, 49, 0.1), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 42%);
  padding: 18px clamp(16px, 2vw, 24px);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive {
  --warehouse-bg: rgba(239, 249, 246, 0.88);
  --warehouse-panel: rgba(255, 255, 255, 0.62);
  --warehouse-panel-2: rgba(232, 249, 245, 0.52);
  --warehouse-line: rgba(39, 89, 81, 0.14);
  --warehouse-line-strong: rgba(13, 126, 112, 0.28);
  --warehouse-gold: #c99b31;
  --warehouse-paper: rgba(255, 255, 255, 0.82);
  --warehouse-paper-2: rgba(239, 251, 248, 0.64);
  --warehouse-text: #143432;
  --warehouse-muted: rgba(35, 62, 58, 0.62);
  max-width: 1420px;
  min-height: 100%;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 30px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.72), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(201, 155, 49, 0.14), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(232, 249, 245, 0.56) 58%, rgba(255, 248, 226, 0.58)),
    rgba(255, 255, 255, 0.48);
  background-size: auto;
  box-shadow:
    0 28px 74px rgba(37, 72, 66, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(83, 129, 121, 0.09);
  color: var(--warehouse-text);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  backdrop-filter: blur(22px) saturate(1.18);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-top {
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  min-height: 190px;
  border-bottom: 1px solid var(--warehouse-line);
  background:
    linear-gradient(90deg, rgba(250, 255, 253, 0.98) 0%, rgba(242, 252, 249, 0.9) 32%, rgba(238, 250, 247, 0.44) 52%, rgba(255, 247, 220, 0.08) 100%),
    radial-gradient(ellipse at 18% 14%, rgba(255, 255, 255, 0.9), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(181, 219, 211, 0.12)),
    url("/assets/government-concepts/warehouse-hero/national_treasury_storage_banner_v2_cropped.png?v=warehouse-hero-20260612-v2") center right / cover no-repeat;
  background-color: rgba(255, 255, 255, 0.38);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  backdrop-filter: blur(18px) saturate(1.16);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-top.select-open {
  overflow: visible;
  z-index: 80;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-top.select-open .warehouse-archive-title {
  z-index: 85;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-hero-art {
  display: none;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-title,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-stat,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-wallet-strip {
  border-right: 1px solid rgba(39, 89, 81, 0.1);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-title {
  border-right: 0;
  padding: 22px 24px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-title > span,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-main-head span,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-head > span,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-capacity-panel > span,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview header span,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-empty span {
  color: rgba(15, 111, 103, 0.74);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-title i,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-category-index-item i,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-icon {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 255, 255, 0.9), transparent 42%),
    linear-gradient(145deg, rgba(201, 155, 49, 0.26), rgba(15, 145, 131, 0.16)),
    rgba(255, 255, 255, 0.56);
  color: var(--treasury-teal);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 22px rgba(37, 72, 66, 0.1);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-category-index-icon.warehouse-category-index-icon--visual {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 10px 18px rgba(37, 72, 66, 0.12);
  overflow: hidden;
  padding: 0;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-category-index-icon--visual .technology-industry-icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-title h1 {
  color: var(--warehouse-text);
  font-size: clamp(34px, 3.2vw, 50px);
  font-weight: 760;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.78);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-chips b,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-island-select,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-wallet-strip div,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-head b {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.42);
  color: rgba(28, 60, 56, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(37, 72, 66, 0.08);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-island-select {
  border-color: rgba(15, 145, 131, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(229, 249, 244, 0.5)),
    rgba(15, 145, 131, 0.1);
  color: var(--warehouse-text);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-island-select select {
  color: inherit;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-island-select option {
  background: #f5fbf8;
  color: #143432;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-stat {
  gap: 7px;
  background: rgba(255, 255, 255, 0.22);
  padding: 18px 16px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-stat span,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-wallet-strip span {
  color: rgba(35, 62, 58, 0.56);
  font-weight: 850;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-stat strong,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-wallet-strip strong {
  color: var(--warehouse-text);
  font-weight: 900;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-stat small {
  color: var(--warehouse-muted);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-wallet-strip {
  gap: 8px;
  padding: 18px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-wallet-strip div {
  border-radius: 18px;
  padding: 10px 12px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-body {
  grid-template-columns: 276px minmax(520px, 1fr) 390px;
  min-height: 0;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-sidebar,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-main,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(232, 249, 245, 0.46)),
    rgba(255, 255, 255, 0.36);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-sidebar {
  gap: 14px;
  border-right: 1px solid var(--warehouse-line);
  padding: 18px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-capacity-panel {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.74), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 247, 224, 0.58)),
    rgba(255, 255, 255, 0.5);
  color: var(--warehouse-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(37, 72, 66, 0.1);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-capacity-panel h3,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-main-head h2,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-head h2,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-empty strong {
  color: var(--warehouse-text);
  font-weight: 780;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.76);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-capacity-panel div,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-main-head p,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition header span,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition p,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-empty {
  color: var(--warehouse-muted);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-capacity-panel i,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition i,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview-row i,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution-row i {
  height: 8px;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(29, 66, 60, 0.12), rgba(255, 255, 255, 0.28)),
    rgba(42, 83, 75, 0.12);
  box-shadow: inset 0 1px 2px rgba(31, 70, 62, 0.12);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-capacity-panel b,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition b,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview-row i b,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution-row i b {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--treasury-teal), #5ec7b2, var(--treasury-gold));
  box-shadow: 0 0 14px rgba(15, 145, 131, 0.18);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution {
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 12px 26px rgba(37, 72, 66, 0.08);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview header strong,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition header strong,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution header strong {
  color: var(--warehouse-text);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview-row,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-category-index-item,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution-row {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(239, 251, 248, 0.54)),
    rgba(255, 255, 255, 0.5);
  color: var(--warehouse-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 22px rgba(37, 72, 66, 0.08);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview-row.selected,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview-row:hover,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-category-index-item.selected,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-category-index-item:hover,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution-row.selected,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution-row:hover {
  border-color: rgba(15, 145, 131, 0.36);
  background:
    linear-gradient(145deg, rgba(221, 250, 243, 0.84), rgba(255, 255, 255, 0.62)),
    rgba(255, 255, 255, 0.56);
  box-shadow:
    inset 4px 0 0 rgba(15, 145, 131, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 14px 32px rgba(15, 145, 131, 0.13);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview-row.warning {
  border-color: rgba(201, 155, 49, 0.34);
  box-shadow:
    inset 4px 0 0 rgba(201, 155, 49, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(201, 155, 49, 0.1);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview-row.danger {
  border-color: rgba(189, 106, 97, 0.34);
  box-shadow:
    inset 4px 0 0 rgba(189, 106, 97, 0.76),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(189, 106, 97, 0.1);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview-row strong,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-category-index-item strong,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution-row strong {
  color: var(--warehouse-text);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview-row small,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-category-index-item small,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution-row small,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution header span {
  color: var(--warehouse-muted);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-island-overview-row em,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-category-index-item em,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution-row em,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution-reset {
  color: var(--treasury-gold);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-main {
  grid-template-rows: auto minmax(360px, 1fr) auto;
  border-right: 1px solid var(--warehouse-line);
  border-left: 1px solid var(--warehouse-line);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-main-head {
  border-bottom: 1px solid var(--warehouse-line);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.7), rgba(232, 249, 245, 0.42)),
    rgba(255, 255, 255, 0.28);
  padding: 24px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-main-head h2 {
  font-size: clamp(30px, 3vw, 44px);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-value-heading strong {
  color: var(--treasury-teal);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.78);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-value-heading em {
  border-color: rgba(255, 255, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.42);
  color: rgba(28, 60, 56, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(37, 72, 66, 0.08);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-main-actions button,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition button {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.3), transparent 54%),
    linear-gradient(180deg, #20b9a4, #0f9183 52%, #08756d);
  color: #fffdf4;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -12px 18px rgba(3, 73, 74, 0.18),
    0 12px 22px rgba(15, 145, 131, 0.18);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-main-actions button.secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.42);
  color: rgba(28, 60, 56, 0.78);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-grid {
  gap: 14px;
  padding: 18px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card {
  grid-template-rows: minmax(132px, auto) auto auto auto;
  justify-items: center;
  min-height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.82), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(240, 251, 248, 0.6)),
    rgba(255, 255, 255, 0.56);
  color: var(--warehouse-text);
  text-align: center;
  padding: 14px 16px 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(37, 72, 66, 0.1);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-icon {
  width: min(100%, 184px);
  max-width: 184px;
  aspect-ratio: 1.25;
  height: auto;
  border-radius: 18px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-icon .product-icon-image {
  object-fit: cover;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card.selected,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card:hover {
  border-color: rgba(15, 145, 131, 0.36);
  box-shadow:
    inset 0 0 0 2px rgba(15, 145, 131, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 16px 34px rgba(15, 145, 131, 0.14);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card > em,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card > strong {
  color: var(--warehouse-text);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card > em {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(235, 249, 246, 0.5)),
    rgba(255, 255, 255, 0.54);
  color: rgba(16, 57, 52, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(37, 72, 66, 0.08);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card > strong {
  margin-top: 8px;
  font-size: 24px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card > small,
:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-meta {
  color: rgba(35, 62, 58, 0.58);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-meta {
  border-top: 1px solid rgba(39, 89, 81, 0.12);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-empty {
  border: 1px dashed rgba(15, 126, 112, 0.24);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--warehouse-muted);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition {
  border-top: 1px solid var(--warehouse-line);
  padding: 16px 20px 20px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition button {
  grid-template-columns: 90px minmax(120px, 1fr) 96px;
  min-height: 38px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.42);
  color: rgba(28, 60, 56, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 16px rgba(37, 72, 66, 0.07);
  padding: 0 10px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition strong {
  color: var(--warehouse-text);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100%;
  border-left: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(232, 249, 245, 0.5)),
    rgba(255, 255, 255, 0.42);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-head {
  border-bottom: 1px solid var(--warehouse-line);
  background:
    radial-gradient(circle at 16% 0%, var(--industry-surface, rgba(15, 145, 131, 0.12)), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(235, 249, 246, 0.44)),
    rgba(255, 255, 255, 0.34);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-head b {
  border-radius: 999px;
  color: rgba(28, 60, 56, 0.78);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-card {
  padding: 18px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-hero {
  grid-template-columns: 104px minmax(0, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.82), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 247, 224, 0.58)),
    rgba(255, 255, 255, 0.54);
  color: var(--warehouse-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(37, 72, 66, 0.1);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-hero i {
  width: 96px;
  height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 255, 255, 0.9), transparent 42%),
    linear-gradient(145deg, rgba(201, 155, 49, 0.26), rgba(15, 145, 131, 0.16)),
    rgba(255, 255, 255, 0.58);
  color: var(--treasury-teal);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 22px rgba(37, 72, 66, 0.1);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-hero strong {
  color: var(--warehouse-text);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-hero small {
  color: var(--warehouse-muted);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-card dl {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.42);
  color: var(--warehouse-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-card dl div {
  border-bottom: 1px solid rgba(39, 89, 81, 0.1);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-card dt {
  color: rgba(35, 62, 58, 0.56);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-card dd {
  color: var(--warehouse-text);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-card dl div.warehouse-dossier-market-row {
  grid-template-columns: 116px minmax(0, 1fr) 48px;
  padding-right: 10px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-exchange-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 255, 255, 0.78), transparent 34%),
    linear-gradient(180deg, #20b9a4, #0f9183 52%, #08756d);
  color: #fffdf4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    inset 0 -10px 16px rgba(3, 73, 74, 0.18),
    0 12px 22px rgba(15, 145, 131, 0.2);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-exchange-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -10px 16px rgba(3, 73, 74, 0.2),
    0 16px 28px rgba(15, 145, 131, 0.26);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-distribution-reset {
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

:is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive ::-webkit-scrollbar-thumb {
  border: 3px solid rgba(239, 249, 246, 0.78);
  border-radius: 999px;
  background: rgba(16, 105, 96, 0.34);
}

@media (max-width: 1320px) {
  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-title {
    grid-column: 1 / -1;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-body {
    grid-template-columns: 250px minmax(480px, 1fr);
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier {
    position: static;
    grid-column: 1 / -1;
    min-height: 0;
    border-top: 1px solid var(--warehouse-line);
  }
}

@media (max-width: 860px) {
  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive {
    border-radius: 24px;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-top,
  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-body,
  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-main-head,
  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-dossier-hero {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-main-head {
    display: grid;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-main-actions {
    grid-template-columns: 1fr;
    flex-basis: auto;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--warehouse-line);
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-grid {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition button {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-composition button strong {
    grid-column: 2;
    justify-self: start;
  }
}

/* Statistics tab: liquid-glass national development report. */
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) {
  --statistics-ink: #163734;
  --statistics-deep: #083f3b;
  --statistics-muted: rgba(33, 61, 58, 0.62);
  --statistics-soft: rgba(239, 250, 247, 0.78);
  --statistics-line: rgba(46, 99, 91, 0.14);
  --statistics-teal: #109385;
  --statistics-teal-deep: #08766e;
  --statistics-mint: #58d2bd;
  --statistics-gold: #c99b31;
  --statistics-blue: #6aaed3;
  --statistics-green: #8eb872;
  --statistics-red: #c55d55;
  --statistics-shadow: 0 24px 70px rgba(36, 70, 64, 0.18);
}

.technology-workbench-modal[data-workbench-tab="data"] {
  background:
    radial-gradient(circle at 22% 4%, rgba(114, 202, 188, 0.16), transparent 32%),
    radial-gradient(circle at 76% 10%, rgba(211, 168, 65, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(241, 250, 248, 0.94), rgba(226, 242, 238, 0.88));
}

.technology-workbench-shell[data-workbench-tab="data"] {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 30px 30px 0 0;
  color: var(--statistics-ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(235, 248, 245, 0.54)),
    rgba(247, 252, 250, 0.6);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 28px 80px rgba(33, 54, 49, 0.22);
}

.technology-workbench-shell[data-workbench-tab="data"] .technology-workbench-head {
  min-height: 88px;
  border-bottom: 1px solid rgba(133, 177, 170, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(231, 249, 245, 0.62) 58%, rgba(255, 244, 213, 0.58)),
    rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.62);
}

.technology-workbench-shell[data-workbench-tab="data"] .technology-workbench-head h2 {
  color: var(--statistics-ink);
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

.technology-workbench-shell[data-workbench-tab="data"] .technology-workbench-close {
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(230, 244, 240, 0.64)),
    rgba(255, 255, 255, 0.54);
  color: rgba(20, 52, 50, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(30, 68, 64, 0.14);
}

.technology-workbench-shell[data-workbench-tab="data"] .technology-workbench-close:hover {
  color: var(--statistics-teal);
  background: rgba(255, 255, 255, 0.82);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-command-center {
  color: var(--statistics-ink);
  gap: 12px;
  max-width: 1440px;
  padding: 0 0 96px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-observation-strip,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-panel,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-public-copy {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(237, 250, 246, 0.48)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 18px 44px rgba(35, 69, 63, 0.11);
  backdrop-filter: blur(22px) saturate(1.24);
  -webkit-backdrop-filter: blur(22px) saturate(1.24);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief {
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(250, 255, 253, 0.9) 0%, rgba(238, 250, 247, 0.72) 35%, rgba(238, 250, 247, 0.28) 62%, rgba(255, 247, 220, 0.1) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(181, 219, 211, 0.18)),
    url("/assets/government-concepts/statistics-hero/national_development_report.webp?v=statistics-hero-20260611-v1") center / cover;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  min-height: 178px;
  padding: 26px 28px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief::before {
  background:
    radial-gradient(circle at 13% 6%, rgba(255, 255, 255, 0.74), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(211, 168, 65, 0.18), transparent 34%),
    linear-gradient(115deg, transparent 0 28%, rgba(255, 255, 255, 0.28) 42%, transparent 56%),
    repeating-linear-gradient(90deg, rgba(16, 147, 133, 0.045) 0 1px, transparent 1px 86px);
  opacity: 1;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief-main > span,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-panel-header span,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-observation-strip > div span {
  color: rgba(12, 126, 116, 0.78);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief-main h2 {
  color: var(--statistics-ink);
  font-size: clamp(34px, 3.2vw, 52px);
  font-weight: 950;
  line-height: 1.02;
  margin: 8px 0 10px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief-main p {
  color: var(--statistics-muted);
  font-size: 15px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief-tags {
  gap: 10px;
  margin-top: 18px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief-tags b,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-focus-pill {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(231, 246, 242, 0.5)),
    rgba(255, 255, 255, 0.46);
  color: rgba(24, 63, 58, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(35, 69, 63, 0.08);
  padding: 0 13px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief-stamp {
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.86), transparent 46%),
    linear-gradient(145deg, rgba(9, 72, 66, 0.86), rgba(22, 55, 50, 0.76));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 18px 38px rgba(10, 54, 50, 0.18);
  padding: 18px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief-stamp span,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief-stamp small {
  color: rgba(255, 253, 242, 0.7);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief-stamp strong {
  color: #fffdf2;
  font-size: 24px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi-grid {
  gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi {
  border-radius: 18px;
  gap: 9px;
  min-height: 118px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, rgba(16, 147, 133, 0.82), rgba(88, 210, 189, 0.28));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi.is-gdp::before {
  background: linear-gradient(180deg, var(--statistics-teal), var(--statistics-mint));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi.is-civic::before {
  background: linear-gradient(180deg, var(--statistics-green), rgba(171, 211, 126, 0.45));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi.is-storage::before {
  background: linear-gradient(180deg, var(--statistics-blue), rgba(149, 211, 232, 0.42));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi.is-honor::before {
  background: linear-gradient(180deg, var(--statistics-gold), rgba(255, 226, 145, 0.48));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi span,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi small,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-panel-header small {
  color: var(--statistics-muted);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi strong {
  color: var(--statistics-ink);
  font-size: clamp(24px, 1.9vw, 34px);
  font-weight: 950;
  letter-spacing: 0;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-observation-strip {
  border-radius: 22px;
  grid-template-columns: 190px minmax(0, 1fr);
  padding: 18px 20px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-observation-strip h3,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-panel-header h3 {
  color: var(--statistics-ink);
  font-size: 21px;
  font-weight: 950;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-observation-strip ul {
  gap: 10px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-observation-strip li {
  min-height: 46px;
  border: 1px solid rgba(42, 91, 83, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(239, 250, 247, 0.42)),
    rgba(255, 255, 255, 0.42);
  color: rgba(32, 65, 60, 0.74);
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-chart-grid,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-insight-grid {
  gap: 14px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-panel {
  border-radius: 24px;
  gap: 12px;
  padding: 18px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-panel-header {
  border-bottom: 1px solid var(--statistics-line);
  padding-bottom: 14px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-panel-wide {
  min-height: 350px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-bar-chart {
  min-height: 266px;
  padding: 12px 4px 2px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-bar-track {
  height: 184px;
  border: 1px solid rgba(42, 91, 83, 0.11);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(226, 244, 240, 0.52)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 18px rgba(35, 69, 63, 0.08);
  padding: 0 14px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-bar-track i {
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 18px rgba(255, 255, 255, 0.22) inset;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-bar-column strong {
  color: var(--statistics-ink);
  font-weight: 950;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-bar-column span {
  color: rgba(17, 118, 109, 0.78);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-donut-layout {
  grid-template-columns: 172px minmax(0, 1fr);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-donut {
  width: 172px;
  height: 172px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.76),
    inset 0 0 28px rgba(255, 255, 255, 0.52),
    0 16px 34px rgba(35, 69, 63, 0.12);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-donut > div {
  width: 116px;
  height: 116px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  background:
    radial-gradient(circle at 30% 10%, rgba(255, 255, 255, 0.96), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(236, 248, 245, 0.62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 8px 18px rgba(35, 69, 63, 0.1);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-donut strong {
  color: var(--statistics-ink);
  font-weight: 950;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-donut small {
  color: var(--statistics-muted);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-legend,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-industry-bars,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-civic-list,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-change-chart {
  gap: 10px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-legend div,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-industry-row,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-change-row,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-gauge-row {
  border: 1px solid rgba(42, 91, 83, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(239, 250, 247, 0.42)),
    rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  padding: 10px 12px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-legend div {
  grid-template-columns: 14px minmax(0, 1fr) auto;
  min-height: 42px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-industry-row,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-change-row {
  grid-template-columns: 72px minmax(0, 1fr) auto;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-legend span,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-industry-row span,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-change-row span,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-gauge-row span {
  color: rgba(33, 61, 58, 0.66);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-legend strong,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-industry-row strong,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-change-row strong,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-gauge-row strong {
  color: var(--statistics-ink);
  font-weight: 950;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-industry-row i,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-change-row i,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-gauge-row > i {
  height: 10px;
  background: rgba(38, 85, 78, 0.12);
  box-shadow: inset 0 1px 2px rgba(35, 69, 63, 0.08);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-gauge-row {
  min-height: 78px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-gauge-row b {
  color: var(--statistics-teal-deep);
  font-weight: 950;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-change-row.negative em {
  background: linear-gradient(90deg, var(--statistics-red), #f0b47e);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-panel {
  overflow: hidden;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-table {
  gap: 8px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row {
  min-height: 62px;
  border: 1px solid rgba(42, 91, 83, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(239, 250, 247, 0.46)),
    rgba(255, 255, 255, 0.46);
  color: rgba(33, 61, 58, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row.head {
  min-height: 42px;
  border: 1px solid rgba(8, 118, 110, 0.16);
  background:
    linear-gradient(180deg, rgba(14, 136, 126, 0.9), rgba(8, 94, 88, 0.9));
  color: #fffdf2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 10px 24px rgba(8, 118, 110, 0.14);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row.selected {
  border-color: rgba(16, 147, 133, 0.32);
  background:
    linear-gradient(145deg, rgba(224, 248, 243, 0.9), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 4px 0 0 rgba(16, 147, 133, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 14px 32px rgba(18, 112, 103, 0.11);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span {
  color: rgba(33, 61, 58, 0.74);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row strong {
  color: var(--statistics-ink);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row small {
  color: rgba(33, 61, 58, 0.54);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-link-button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--statistics-teal), var(--statistics-teal-deep));
  color: #fffdf2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 22px rgba(8, 118, 110, 0.22);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-link-button:hover {
  background: linear-gradient(180deg, #1aaaa0, #08766e);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-public-panel {
  background:
    radial-gradient(circle at 10% 0%, rgba(88, 210, 189, 0.18), transparent 34%),
    radial-gradient(circle at 92% 18%, rgba(211, 168, 65, 0.16), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(237, 250, 246, 0.52)),
    rgba(255, 255, 255, 0.5);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-public-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-public-copy {
  border-radius: 18px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-public-copy strong {
  color: var(--statistics-ink);
  font-weight: 950;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-public-copy span,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-honor-list span {
  color: rgba(33, 61, 58, 0.66);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-honor-list b {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 244, 205, 0.92), rgba(237, 202, 125, 0.66));
  color: #664a14;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 8px 18px rgba(154, 118, 38, 0.12);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-command-center ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-command-center ::-webkit-scrollbar-thumb {
  border: 3px solid rgba(239, 249, 246, 0.78);
  border-radius: 999px;
  background: rgba(16, 105, 96, 0.34);
}

@media (max-width: 1180px) {
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-chart-grid,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-insight-grid,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-public-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-observation-strip,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-donut-layout {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief {
    border-radius: 24px;
    padding: 20px;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-brief-stamp {
    align-self: stretch;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-kpi-grid,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-observation-strip ul {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-panel-header {
    display: grid;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-panel-header small {
    text-align: left;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-donut {
    justify-self: center;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-industry-row,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-change-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-industry-row strong,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-change-row strong {
    grid-column: 2;
    justify-self: end;
  }
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  width: min(680px, 100%);
  margin: 0 auto 2px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(226, 242, 239, 0.44)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 14px 34px rgba(35, 69, 63, 0.12);
  backdrop-filter: blur(24px) saturate(1.22);
  -webkit-backdrop-filter: blur(24px) saturate(1.22);
  padding: 7px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-view-tab {
  flex: 1 1 92px;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(33, 61, 58, 0.7);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-view-tab:hover {
  color: var(--statistics-teal-deep);
  background: rgba(255, 255, 255, 0.48);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-view-tab.selected {
  color: #fffdf2;
  background:
    linear-gradient(180deg, rgba(28, 161, 150, 0.98), rgba(7, 103, 96, 0.95)),
    var(--statistics-teal);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 22px rgba(8, 118, 110, 0.22);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-preview {
  min-height: 242px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-preview .statistics-panel-header {
  align-items: center;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-preview-balance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-preview-balance span {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(42, 91, 83, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  padding: 10px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-preview-balance i,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  font-style: normal;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-preview-balance img,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-preview-balance strong {
  min-width: 0;
  color: var(--statistics-ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-preview-list {
  display: grid;
  gap: 8px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-preview-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 40px;
  border-bottom: 1px solid rgba(42, 91, 83, 0.08);
  color: rgba(33, 61, 58, 0.72);
  font-weight: 800;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-empty-mini {
  display: block !important;
  border: 1px dashed rgba(42, 91, 83, 0.16) !important;
  border-radius: 16px;
  padding: 14px;
  color: rgba(33, 61, 58, 0.6);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 255, 255, 0.84), transparent 32%),
    radial-gradient(circle at 84% 16%, rgba(88, 210, 189, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(232, 246, 243, 0.52)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 18px 44px rgba(35, 69, 63, 0.12);
  backdrop-filter: blur(24px) saturate(1.24);
  -webkit-backdrop-filter: blur(24px) saturate(1.24);
  padding: 24px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-hero span,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-detail > span {
  color: rgba(12, 126, 116, 0.78);
  font-size: 12px;
  font-weight: 950;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-hero h2 {
  margin: 8px 0 10px;
  color: var(--statistics-ink);
  font-size: clamp(32px, 3vw, 50px);
  font-weight: 950;
  line-height: 1.04;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--statistics-muted);
  font-size: 15px;
  line-height: 1.65;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-hero-metric {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(239, 250, 247, 0.44)),
    rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  padding: 18px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-hero-metric strong {
  color: var(--statistics-ink);
  font-size: 20px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-hero-metric small {
  color: rgba(33, 61, 58, 0.58);
  font-weight: 800;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 164px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(237, 250, 246, 0.46)),
    rgba(255, 255, 255, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 14px 32px rgba(35, 69, 63, 0.1);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--statistics-teal), rgba(88, 210, 189, 0.24));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card.gold::before {
  background: linear-gradient(180deg, var(--statistics-gold), rgba(255, 226, 145, 0.36));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card.gems::before {
  background: linear-gradient(180deg, var(--statistics-blue), rgba(149, 211, 232, 0.38));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card.bound::before {
  background: linear-gradient(180deg, #8aa45e, rgba(171, 211, 126, 0.34));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: rgba(33, 61, 58, 0.68);
  font-weight: 900;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card > strong {
  color: var(--statistics-ink);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 950;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card small,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card em {
  color: rgba(33, 61, 58, 0.58);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.34fr);
  gap: 14px;
  align-items: start;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-main,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-aside {
  min-width: 0;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-filter-stack {
  display: grid;
  gap: 9px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-filter-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-filter-row > span {
  color: rgba(33, 61, 58, 0.58);
  font-size: 12px;
  font-weight: 950;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-filter-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-filter-row button {
  min-height: 32px;
  border: 1px solid rgba(42, 91, 83, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: rgba(33, 61, 58, 0.68);
  font-size: 12px;
  font-weight: 900;
  padding: 0 12px;
  cursor: pointer;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-filter-row button.selected {
  border-color: rgba(8, 118, 110, 0.2);
  background: linear-gradient(180deg, var(--statistics-teal), var(--statistics-teal-deep));
  color: #fffdf2;
  box-shadow: 0 8px 18px rgba(8, 118, 110, 0.18);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-flow-bars {
  display: grid;
  gap: 9px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-flow-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(170px, auto);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  border: 1px solid rgba(42, 91, 83, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  padding: 10px 12px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-flow-row > span {
  color: rgba(33, 61, 58, 0.7);
  font-weight: 900;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-flow-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-flow-row i {
  display: block;
  min-width: 4px;
  height: 7px;
  border-radius: 999px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-flow-row .income {
  background: linear-gradient(90deg, var(--statistics-teal), var(--statistics-mint));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-flow-row .expense {
  background: linear-gradient(90deg, #f0b47e, var(--statistics-red));
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-flow-row strong {
  color: var(--statistics-ink);
  font-size: 13px;
  text-align: right;
  overflow-wrap: anywhere;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-table {
  display: grid;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-row {
  display: grid;
  grid-template-columns: 96px minmax(190px, 1.4fr) 96px 82px minmax(118px, 0.8fr) minmax(118px, 0.8fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  min-width: 780px;
  border: 1px solid rgba(42, 91, 83, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(239, 250, 247, 0.42)),
    rgba(255, 255, 255, 0.42);
  color: rgba(33, 61, 58, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  padding: 10px 12px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-row.head {
  min-height: 38px;
  background:
    linear-gradient(180deg, rgba(14, 136, 126, 0.9), rgba(8, 94, 88, 0.9));
  color: #fffdf2;
  font-size: 12px;
  font-weight: 950;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-row strong {
  display: block;
  color: var(--statistics-ink);
  font-weight: 950;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-row small {
  display: block;
  margin-top: 3px;
  color: rgba(33, 61, 58, 0.52);
  font-size: 11px;
  font-weight: 800;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-row b {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: rgba(8, 118, 110, 0.1);
  color: var(--statistics-teal-deep);
  font-size: 12px;
  padding: 0 9px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .is-income {
  color: var(--statistics-teal-deep) !important;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .is-expense {
  color: #a3553e !important;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .is-refund {
  color: #6c7d2f !important;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .is-freeze,
:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .is-neutral {
  color: rgba(33, 61, 58, 0.58) !important;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-empty-state {
  display: grid;
  gap: 6px;
  min-height: 108px;
  place-items: center;
  border: 1px dashed rgba(42, 91, 83, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.36);
  color: rgba(33, 61, 58, 0.6);
  text-align: center;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-empty-state strong {
  color: var(--statistics-ink);
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-detail {
  display: grid;
  gap: 12px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-detail h3 {
  margin: 0;
  color: var(--statistics-ink);
  font-size: 24px;
  font-weight: 950;
  line-height: 1.12;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-detail > strong {
  font-size: 28px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-detail dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-detail dl div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  min-height: 36px;
  align-items: center;
  border: 1px solid rgba(42, 91, 83, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  padding: 8px 10px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-detail dt {
  color: rgba(33, 61, 58, 0.52);
  font-size: 12px;
  font-weight: 900;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-detail dd {
  margin: 0;
  color: var(--statistics-ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-detail p {
  margin: 0;
  color: rgba(33, 61, 58, 0.62);
  line-height: 1.55;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-sources {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-sources > div:last-child {
  display: grid;
  gap: 8px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-sources span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 38px;
  align-items: center;
  border: 1px solid rgba(42, 91, 83, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  padding: 8px 10px;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-sources strong {
  min-width: 0;
  color: var(--statistics-ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

:is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-sources em {
  color: rgba(33, 61, 58, 0.58);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

@media (max-width: 1180px) {
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-layout,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-view-tabs {
    width: 100%;
    border-radius: 24px;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-view-tab {
    flex-basis: calc(50% - 8px);
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-grid,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-preview-balance {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-hero,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-wallet-card {
    border-radius: 22px;
    padding: 18px;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-filter-row {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-flow-row {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-flow-row strong {
    text-align: left;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-ledger-empty-state {
    place-items: center start;
    text-align: left;
  }
}

/* Policy lane title clearance: keep the decorative timeline from covering the size labels. */
:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-lanes {
  --policy-lane-axis-x: 34px;
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-doctrine-lanes::before {
  left: var(--policy-lane-axis-x);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane {
  grid-template-columns: 178px minmax(0, 1fr);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane::before {
  left: calc(var(--policy-lane-axis-x) - 5px);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane-head {
  min-width: 0;
  padding-left: calc(var(--policy-lane-axis-x) + 22px);
}

:is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane-head strong {
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

@media (max-width: 900px) {
  :is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="policy"], .technology-workbench-shell[data-workbench-tab="policy"]) .policy-lane-head {
    padding-left: 0;
  }
}

/* Alliance final pass: iOS 27 liquid-glass diplomacy surface, aligned with technology and policy workbenches. */
body[data-page="alliance"] {
  background:
    radial-gradient(ellipse at 16% 0%, rgba(119, 224, 206, 0.24), transparent 38%),
    radial-gradient(ellipse at 82% 12%, rgba(239, 205, 118, 0.2), transparent 34%),
    linear-gradient(180deg, #f5fbf9 0%, #e9f4f1 100%) !important;
  color: #153531;
}

body[data-page="alliance"] .app {
  max-width: none;
  padding: calc(var(--global-topbar-height) + 16px) clamp(12px, 2.2vw, 28px) calc(var(--global-bottom-nav-reserve) + 28px);
}

body[data-page="alliance"] #alliancePage > section {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-shell {
  --alliance-ink: #153531 !important;
  --alliance-muted: rgba(39, 68, 64, 0.64) !important;
  --alliance-soft: rgba(255, 255, 255, 0.52) !important;
  --alliance-glass: rgba(255, 255, 255, 0.58) !important;
  --alliance-glass-strong: rgba(255, 255, 255, 0.78) !important;
  --alliance-line: rgba(42, 91, 83, 0.12) !important;
  --alliance-line-strong: rgba(255, 255, 255, 0.68) !important;
  --alliance-gold: #b99035 !important;
  --alliance-teal: #0b8f80 !important;
  --alliance-teal-deep: #086f69 !important;
  --alliance-danger: #c75f68 !important;
  width: min(100%, 1480px);
  margin: 0 auto;
  color: var(--alliance-ink);
  gap: 12px;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body.diplomacy-modal-open .diplomacy-workbench-modal[data-diplomacy-tab="alliance"] {
  background:
    radial-gradient(ellipse at 18% 3%, rgba(119, 224, 206, 0.2), transparent 38%),
    radial-gradient(ellipse at 82% 14%, rgba(239, 205, 118, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(246, 252, 250, 0.96), rgba(229, 242, 239, 0.98)) !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.08) contrast(1.04);
  backdrop-filter: blur(8px) saturate(1.08) contrast(1.04);
}

body.diplomacy-modal-open .diplomacy-workbench-shell[data-diplomacy-tab="alliance"] {
  border-color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(237, 249, 246, 0.86)),
    rgba(232, 244, 241, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 28px 88px rgba(20, 62, 60, 0.22);
}

body.diplomacy-modal-open .diplomacy-workbench-shell[data-diplomacy-tab="alliance"] .diplomacy-workbench-head {
  border-bottom-color: rgba(24, 91, 86, 0.12);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(236, 249, 245, 0.9)),
    rgba(255, 255, 255, 0.92);
}

body.diplomacy-modal-open .diplomacy-workbench-shell[data-diplomacy-tab="alliance"] .diplomacy-workbench-body {
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 255, 255, 0.78), transparent 32%),
    linear-gradient(180deg, rgba(246, 252, 250, 0.98), rgba(232, 244, 241, 0.96));
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-glass-card,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs {
  border: 1px solid var(--alliance-line-strong) !important;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, 0.82), transparent 38%),
    radial-gradient(ellipse at 100% 8%, rgba(91, 211, 193, 0.2), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(235, 249, 245, 0.5)),
    var(--alliance-glass) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(35, 83, 76, 0.06),
    0 18px 42px rgba(35, 76, 72, 0.12) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.14) contrast(1.04) !important;
  backdrop-filter: blur(16px) saturate(1.14) contrast(1.04) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero {
  min-height: 238px;
  border-radius: 32px;
  padding: clamp(22px, 3vw, 34px);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero::before {
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 42%),
    radial-gradient(ellipse at 15% 100%, rgba(11, 143, 128, 0.14), transparent 46%),
    radial-gradient(ellipse at 92% 12%, rgba(185, 144, 53, 0.13), transparent 38%) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-eyebrow {
  color: var(--alliance-teal);
  letter-spacing: 0;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-copy h2 {
  color: var(--alliance-ink) !important;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.96;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-copy p,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-card-copy,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row small,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row small,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card p,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card small,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button span {
  color: var(--alliance-muted) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-identity-line strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-identity-line span {
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(229, 247, 243, 0.48)),
    rgba(255, 255, 255, 0.45);
  color: rgba(21, 53, 49, 0.76) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 8px 18px rgba(35, 76, 72, 0.08);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-metrics {
  align-content: center;
  gap: 12px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-metric,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-item,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-empty-panel,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus div {
  border: 1px solid rgba(255, 255, 255, 0.68) !important;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(232, 249, 245, 0.42)),
    rgba(255, 255, 255, 0.38) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 24px rgba(35, 76, 72, 0.08);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-metric span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-item span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-empty-panel span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-announcement span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress-copy span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus span {
  color: rgba(39, 68, 64, 0.62) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-metric strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-item strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-empty-panel strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress-copy strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-head strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-title strong {
  color: var(--alliance-ink) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-glass-card {
  border-radius: 26px;
  padding: 18px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-title span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-subtitle,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-role-heading strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route header strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-head span {
  color: var(--alliance-teal) !important;
  letter-spacing: 0;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-announcement {
  border-left-color: var(--alliance-teal);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-announcement p {
  color: var(--alliance-ink) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs {
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(235, 249, 245, 0.52)),
    rgba(255, 255, 255, 0.48) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs a {
  color: rgba(21, 53, 49, 0.62) !important;
  border-radius: 16px;
  transition:
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs a:hover,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs a:focus-visible {
  background:
    linear-gradient(145deg, rgba(14, 145, 130, 0.92), rgba(8, 101, 96, 0.9)),
    var(--alliance-teal);
  color: #fffdf4 !important;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 10px 22px rgba(8, 101, 96, 0.18);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.82fr) minmax(260px, 0.68fr);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-diplomacy-shell .alliance-command-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.78fr) minmax(260px, 0.78fr);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .empty-state,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .warning-text {
  border: 1px solid rgba(42, 91, 83, 0.1) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(238, 250, 246, 0.45)),
    rgba(255, 255, 255, 0.42) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card {
  border-radius: 18px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card.active {
  border-color: rgba(14, 145, 130, 0.28) !important;
  background:
    linear-gradient(145deg, rgba(221, 248, 242, 0.88), rgba(255, 249, 229, 0.5)),
    rgba(255, 255, 255, 0.5) !important;
  box-shadow:
    inset 4px 0 0 rgba(14, 145, 130, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 28px rgba(14, 145, 130, 0.1);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card.locked {
  opacity: 1;
  filter: saturate(0.86);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-meta span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route header small,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-role-heading,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .warning-text {
  color: var(--alliance-muted) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button {
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(235, 249, 245, 0.52)),
    rgba(255, 255, 255, 0.48) !important;
  color: var(--alliance-ink) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 22px rgba(35, 76, 72, 0.1);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button {
  border-radius: 999px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button {
  border-radius: 18px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button.primary {
  border-color: rgba(14, 145, 130, 0.34) !important;
  background:
    linear-gradient(180deg, #2cc9ad, #0f9183 56%, #0a706d),
    var(--alliance-teal) !important;
  color: #fffdf4 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -12px 22px rgba(0, 88, 82, 0.18),
    0 12px 24px rgba(9, 135, 121, 0.2);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button.danger,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button.danger {
  border-color: rgba(199, 95, 104, 0.22) !important;
  background:
    linear-gradient(145deg, rgba(255, 238, 238, 0.72), rgba(255, 255, 255, 0.46)),
    rgba(199, 95, 104, 0.08) !important;
  color: #9f3945 !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button:hover,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button:focus-visible,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button:hover,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button:focus-visible {
  border-color: rgba(14, 145, 130, 0.28) !important;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 28px rgba(35, 76, 72, 0.14);
  outline: 0;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress.status-bar,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .status-bar.alliance-progress {
  height: 10px;
  border: 0;
  background: rgba(38, 83, 76, 0.12);
  box-shadow: inset 0 1px 2px rgba(38, 83, 76, 0.12);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress .status-fill {
  background: linear-gradient(90deg, var(--alliance-teal), #5ed7c1, var(--alliance-gold));
  box-shadow: 0 0 18px rgba(14, 145, 130, 0.28);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-routes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-grid,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-diplomacy-shell .alliance-command-grid,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-columns,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-routes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-shell {
    width: 100%;
    gap: 12px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-glass-card {
    border-radius: 24px;
    padding: 16px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero {
    min-height: 0;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-copy h2 {
    font-size: 42px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-metrics,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-grid,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus {
    grid-template-columns: 1fr;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs {
    border-radius: 18px;
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(72px, 1fr));
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress-copy {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Encyclopedia: iOS 27 liquid-glass archive. */
.encyclopedia-overlay {
  align-items: center;
  background:
    radial-gradient(circle at 18% 8%, rgba(97, 202, 186, 0.2), transparent 34%),
    radial-gradient(circle at 82% 10%, rgba(218, 179, 93, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(236, 249, 246, 0.9), rgba(219, 238, 234, 0.86)),
    rgba(224, 239, 236, 0.72);
  padding: max(18px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

.encyclopedia-modal {
  --encyclopedia-ink: #153331;
  --encyclopedia-muted: rgba(35, 63, 59, 0.62);
  --encyclopedia-line: rgba(48, 91, 84, 0.14);
  --encyclopedia-teal: #0f9183;
  --encyclopedia-teal-deep: #08766e;
  --encyclopedia-gold: #c99b31;
  --encyclopedia-panel: rgba(255, 255, 255, 0.62);
  width: min(1460px, calc(100vw - 44px));
  max-height: min(920px, calc(100dvh - 44px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.74), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(201, 155, 49, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(232, 249, 245, 0.62) 58%, rgba(255, 248, 226, 0.62)),
    rgba(255, 255, 255, 0.54);
  box-shadow:
    0 34px 90px rgba(31, 64, 59, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(83, 129, 121, 0.1);
  color: var(--encyclopedia-ink);
  -webkit-backdrop-filter: blur(28px) saturate(1.26);
  backdrop-filter: blur(28px) saturate(1.26);
}

.encyclopedia-header {
  min-height: 88px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(133, 177, 170, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(231, 249, 245, 0.62) 58%, rgba(255, 244, 213, 0.58)),
    rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.62);
}

.encyclopedia-header div {
  gap: 12px;
  min-width: 0;
}

.encyclopedia-header div span {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.88), transparent 48%),
    linear-gradient(145deg, rgba(232, 249, 245, 0.88), rgba(255, 247, 224, 0.72));
  color: var(--encyclopedia-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 22px rgba(35, 69, 63, 0.1);
}

.encyclopedia-header strong {
  color: var(--encyclopedia-ink);
  font-family: var(--apple-china-font);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

.encyclopedia-header .secondary,
.encyclopedia-close {
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(230, 244, 240, 0.64)),
    rgba(255, 255, 255, 0.54);
  color: rgba(20, 52, 50, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(30, 68, 64, 0.14);
}

.encyclopedia-header .secondary {
  min-height: 44px;
  padding: 0 18px;
  font-weight: 900;
}

.encyclopedia-header .secondary:hover:not(:disabled),
.encyclopedia-close:hover {
  background: rgba(255, 255, 255, 0.82);
  color: var(--encyclopedia-teal);
}

.encyclopedia-header .secondary:disabled {
  color: rgba(35, 63, 59, 0.34);
  opacity: 0.7;
}

.encyclopedia-close {
  font-size: 30px;
}

.encyclopedia-body {
  grid-template-columns: minmax(500px, 0.92fr) minmax(640px, 1.08fr);
  background:
    linear-gradient(135deg, rgba(239, 250, 247, 0.88), rgba(255, 251, 239, 0.62)),
    rgba(245, 251, 249, 0.72);
}

.encyclopedia-sidebar,
.encyclopedia-detail {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(232, 249, 245, 0.46)),
    rgba(255, 255, 255, 0.36);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  backdrop-filter: blur(18px) saturate(1.12);
}

.encyclopedia-sidebar {
  gap: 14px;
  border-right: 1px solid var(--encyclopedia-line);
  padding: 18px;
}

.encyclopedia-search,
.encyclopedia-filters select,
.encyclopedia-tier-tabs,
.encyclopedia-list-block,
.encyclopedia-hero,
.encyclopedia-section,
.encyclopedia-market-strip,
.encyclopedia-product-dossier {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(238, 250, 247, 0.5)),
    rgba(255, 255, 255, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 14px 30px rgba(35, 69, 63, 0.08);
}

.encyclopedia-search {
  min-height: 48px;
  border-radius: 18px;
  padding: 0 14px;
}

.encyclopedia-search span {
  color: rgba(28, 61, 57, 0.52);
  font-size: 23px;
}

.encyclopedia-search input,
.encyclopedia-filters select,
.encyclopedia-level-cost-select {
  color: var(--encyclopedia-ink);
  font-weight: 850;
}

.encyclopedia-search input::placeholder {
  color: rgba(35, 63, 59, 0.46);
}

.encyclopedia-filters {
  gap: 12px;
  grid-template-columns: minmax(180px, 0.72fr) minmax(260px, 1.28fr);
}

.encyclopedia-filters select {
  min-height: 48px;
  border-radius: 18px;
  padding: 0 14px;
}

.encyclopedia-filters option,
.encyclopedia-level-cost-select option {
  background: #f4fbf8;
  color: #153331;
}

.encyclopedia-tier-tabs {
  gap: 5px;
  padding: 5px;
  border-radius: 18px;
}

.encyclopedia-tier-tabs button,
.encyclopedia-tier-tabs button:first-child,
.encyclopedia-tier-tabs button:last-child {
  min-height: 38px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(28, 59, 56, 0.66);
  font-weight: 900;
}

.encyclopedia-tier-tabs button:hover {
  background: rgba(255, 255, 255, 0.52);
  color: var(--encyclopedia-ink);
}

.encyclopedia-tier-tabs button.selected {
  background:
    linear-gradient(145deg, rgba(20, 154, 139, 0.96), rgba(10, 108, 112, 0.92)),
    rgba(14, 145, 130, 0.82);
  color: #fffdf4;
  box-shadow:
    0 10px 22px rgba(6, 108, 101, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.encyclopedia-list-block {
  border-radius: 22px;
  padding: 14px;
}

.encyclopedia-list-title {
  color: var(--encyclopedia-ink);
  font-size: 21px;
  font-weight: 950;
}

.encyclopedia-list-title span {
  color: rgba(35, 63, 59, 0.5);
}

.encyclopedia-list-scroll {
  gap: 14px;
  padding-right: 2px;
}

.encyclopedia-grid-products,
.encyclopedia-grid-workforce {
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.encyclopedia-grid-buildings {
  gap: 12px;
}

.encyclopedia-entry {
  border: 1px solid rgba(42, 91, 83, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 6%, rgba(255, 255, 255, 0.82), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(239, 251, 248, 0.54)),
    rgba(255, 255, 255, 0.5);
  color: var(--encyclopedia-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 22px rgba(37, 72, 66, 0.08);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.encyclopedia-entry:hover {
  border-color: rgba(15, 145, 131, 0.32);
  transform: translateY(-1px);
}

.encyclopedia-entry.selected {
  border-color: rgba(15, 145, 131, 0.44);
  box-shadow:
    inset 0 0 0 2px rgba(15, 145, 131, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 16px 34px rgba(15, 145, 131, 0.14);
}

.encyclopedia-entry-products,
.encyclopedia-entry-workforce {
  min-height: 154px;
}

.encyclopedia-entry-buildings {
  min-height: 230px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.78), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(240, 251, 248, 0.58));
}

.encyclopedia-entry-products > span,
.encyclopedia-entry-workforce > span,
.encyclopedia-entry-buildings > span {
  border-radius: 16px;
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 255, 255, 0.82), transparent 44%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 247, 224, 0.42));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.encyclopedia-entry-buildings > span {
  height: 214px;
}

.encyclopedia-entry-products.tier-1 strong,
.encyclopedia-entry-buildings.tier-1 strong,
.encyclopedia-entry-workforce.tier-1 strong,
.encyclopedia-entry-products.tier-2 strong,
.encyclopedia-entry-buildings.tier-2 strong,
.encyclopedia-entry-workforce.tier-2 strong,
.encyclopedia-entry-products.tier-3 strong,
.encyclopedia-entry-buildings.tier-3 strong,
.encyclopedia-entry-workforce.tier-3 strong,
.encyclopedia-entry-products.tier-4 strong,
.encyclopedia-entry-buildings.tier-4 strong,
.encyclopedia-entry-workforce.tier-4 strong,
.encyclopedia-entry strong {
  color: var(--encyclopedia-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.64);
}

.encyclopedia-entry-buildings strong {
  bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(235, 249, 246, 0.54)),
    rgba(255, 255, 255, 0.46);
  color: var(--encyclopedia-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 16px rgba(37, 72, 66, 0.08);
}

.encyclopedia-detail {
  gap: 12px;
  padding: 18px;
}

.encyclopedia-hero,
.encyclopedia-section,
.encyclopedia-market-strip,
.encyclopedia-product-dossier {
  border-radius: 24px;
}

.encyclopedia-hero {
  grid-template-columns: 164px minmax(0, 1fr);
  padding: 20px;
}

.encyclopedia-hero.industry-surface,
.encyclopedia-product-card {
  background:
    radial-gradient(circle at 12% 0%, var(--industry-surface, rgba(15, 145, 131, 0.12)), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(239, 251, 248, 0.52)),
    rgba(255, 255, 255, 0.48);
}

.encyclopedia-hero-icon,
.encyclopedia-product-icon {
  border-radius: 20px;
  color: var(--encyclopedia-teal);
}

.encyclopedia-hero-icon .product-icon-image,
.encyclopedia-hero-icon .workforce-type-icon,
.encyclopedia-product-icon .product-icon-image,
.encyclopedia-building-icon .encyclopedia-hero-building-image {
  filter: drop-shadow(0 10px 18px rgba(36, 70, 64, 0.1));
}

.encyclopedia-hero h2,
.encyclopedia-product-copy h2 {
  color: var(--encyclopedia-ink);
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.encyclopedia-meta,
.encyclopedia-hero.industry-surface .encyclopedia-meta {
  color: rgba(13, 126, 112, 0.82);
}

.encyclopedia-hero p,
.encyclopedia-product-copy p,
.encyclopedia-product-price span,
.encyclopedia-market-strip span,
.encyclopedia-info-grid > div > span,
.encyclopedia-flow > div > span,
.encyclopedia-build-cost-heading > span,
.encyclopedia-recipe-header,
.encyclopedia-recipe-empty {
  color: var(--encyclopedia-muted);
}

.encyclopedia-product-dossier {
  --product-tier-color: var(--encyclopedia-ink);
  --product-tier-soft: rgba(15, 145, 131, 0.12);
  overflow: hidden;
}

.encyclopedia-product-dossier.tier-2 {
  --product-tier-color: #277b55;
  --product-tier-soft: rgba(88, 181, 111, 0.16);
}

.encyclopedia-product-dossier.tier-3 {
  --product-tier-color: #2875a5;
  --product-tier-soft: rgba(90, 157, 203, 0.16);
}

.encyclopedia-product-dossier.tier-4 {
  --product-tier-color: #9b5aa0;
  --product-tier-soft: rgba(178, 113, 184, 0.16);
}

.encyclopedia-product-card {
  border-radius: 24px 24px 0 0;
  min-height: 178px;
  padding: 20px;
}

.encyclopedia-building-dossier .encyclopedia-product-card {
  border-radius: 24px;
}

.encyclopedia-product-tag,
.encyclopedia-chip-row button,
.encyclopedia-level-cost-select {
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 246, 0.46)),
    rgba(255, 255, 255, 0.42);
  color: rgba(28, 60, 56, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.encyclopedia-product-tag.tier {
  border-color: rgba(15, 145, 131, 0.26);
  background: var(--product-tier-soft);
  color: var(--product-tier-color);
}

.encyclopedia-product-tag.industry {
  border-color: rgba(15, 145, 131, 0.2);
  background: rgba(15, 145, 131, 0.1);
  color: var(--industry-text, var(--encyclopedia-ink));
}

.encyclopedia-product-tag.power {
  background: rgba(91, 158, 205, 0.14);
  border-color: rgba(91, 158, 205, 0.28);
  color: #286d92;
}

.encyclopedia-product-tag.coastal,
.encyclopedia-product-tag.coastal.required {
  background: rgba(201, 155, 49, 0.12);
  border-color: rgba(201, 155, 49, 0.26);
  color: #705116;
}

.encyclopedia-product-marketbar {
  border-top: 1px solid var(--encyclopedia-line);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.56), rgba(237, 250, 246, 0.38)),
    rgba(255, 255, 255, 0.28);
  padding: 14px 16px;
}

.encyclopedia-product-price strong,
.encyclopedia-recipe-cell.time strong,
.encyclopedia-info-grid > div strong {
  color: var(--encyclopedia-ink);
}

.encyclopedia-product-action {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(230, 244, 240, 0.58)),
    rgba(255, 255, 255, 0.5);
  color: rgba(24, 63, 58, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 10px 20px rgba(37, 72, 66, 0.08);
}

.encyclopedia-product-action.trade {
  background: linear-gradient(180deg, var(--encyclopedia-teal), var(--encyclopedia-teal-deep));
  color: #fffdf4;
}

.encyclopedia-product-action.trade:hover:not(:disabled) {
  background: linear-gradient(180deg, #1aaaa0, var(--encyclopedia-teal-deep));
}

.encyclopedia-section h3 {
  border-bottom: 1px solid var(--encyclopedia-line);
  border-radius: 24px 24px 0 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(231, 249, 245, 0.48)),
    rgba(255, 255, 255, 0.34);
  color: var(--encyclopedia-ink);
  font-size: 21px;
  font-weight: 950;
}

.encyclopedia-info-grid,
.encyclopedia-recipe-list {
  background: transparent;
}

.encyclopedia-info-grid {
  gap: 10px;
  padding: 12px;
}

.encyclopedia-info-grid > div,
.encyclopedia-flow > div,
.encyclopedia-recipe-row {
  border: 1px solid rgba(42, 91, 83, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(239, 250, 247, 0.42)),
    rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.encyclopedia-flow {
  gap: 10px;
  padding: 12px;
}

.encyclopedia-flow > div {
  padding: 12px;
}

.encyclopedia-recipe-list {
  gap: 8px;
  padding: 12px;
}

.encyclopedia-recipe-header {
  background: transparent;
  padding: 0 12px 2px;
}

.encyclopedia-recipe-row {
  min-height: 142px;
  padding: 10px;
}

.encyclopedia-recipe-row + .encyclopedia-recipe-row {
  border-top: 1px solid rgba(42, 91, 83, 0.1);
}

.encyclopedia-recipe-tech-tile,
.encyclopedia-mini-building,
.encyclopedia-modal .empty-plot-cost-tile.encyclopedia-asset-tile {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 10%, rgba(255, 255, 255, 0.72), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(239, 250, 247, 0.48));
  color: var(--encyclopedia-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 16px rgba(37, 72, 66, 0.07);
}

.encyclopedia-mini-building strong,
.encyclopedia-recipe-tech-tile strong,
.encyclopedia-modal .encyclopedia-asset-tile strong {
  background: transparent;
}

.encyclopedia-mini-building strong {
  isolation: isolate;
  position: relative;
}

.encyclopedia-mini-building .encyclopedia-mini-building-image {
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  transform: scale(1.72);
  transform-origin: center 50%;
  width: 100%;
}

.encyclopedia-mini-building .encyclopedia-mini-building-image.encyclopedia-building-flat-image {
  object-fit: contain;
  object-position: center;
  transform: none;
}

.encyclopedia-mini-building strong::after {
  border-radius: 14px 14px 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -16px 24px rgba(15, 73, 67, 0.08);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.encyclopedia-recipe-tech-tile em,
.encyclopedia-modal .encyclopedia-asset-tile em {
  border-radius: 0 14px 0 12px;
  background: linear-gradient(180deg, var(--encyclopedia-gold), #b98422);
  color: #fffdf4;
}

.encyclopedia-recipe-tech-tile small,
.encyclopedia-mini-building small,
.encyclopedia-modal .encyclopedia-asset-tile small {
  border-top: 1px solid rgba(42, 91, 83, 0.08);
  background: rgba(255, 255, 255, 0.54);
  color: var(--encyclopedia-ink);
  text-shadow: none;
}

.encyclopedia-chip-row {
  padding: 12px;
}

.encyclopedia-modal .empty-plot-no-cost,
.encyclopedia-modal .empty-state {
  color: var(--encyclopedia-muted);
}

.encyclopedia-modal ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.encyclopedia-modal ::-webkit-scrollbar-thumb {
  border: 3px solid rgba(239, 249, 246, 0.78);
  border-radius: 999px;
  background: rgba(16, 105, 96, 0.34);
}

@media (max-width: 980px) {
  .encyclopedia-modal {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 24px;
  }

  .encyclopedia-header {
    grid-template-columns: 1fr auto;
  }

  .encyclopedia-header .secondary {
    display: none;
  }

  .encyclopedia-body {
    grid-template-columns: 1fr;
  }

  .encyclopedia-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--encyclopedia-line);
    max-height: 44dvh;
  }

  .encyclopedia-product-card,
  .encyclopedia-product-marketbar,
  .encyclopedia-hero {
    grid-template-columns: 1fr;
  }

  .encyclopedia-product-icon {
    justify-items: start;
  }

  .encyclopedia-flow,
  .encyclopedia-recipe-row {
    grid-template-columns: 1fr;
  }

  .encyclopedia-recipe-header {
    display: none;
  }
}

/* Alliance redo v2: clear iOS 27 glass, higher contrast, no grey veil. */
body[data-page="alliance"] {
  background:
    radial-gradient(ellipse at 12% -8%, rgba(44, 214, 184, 0.28), transparent 42%),
    radial-gradient(ellipse at 88% 2%, rgba(245, 199, 88, 0.18), transparent 34%),
    linear-gradient(180deg, #fbfffd 0%, #eef9f5 48%, #e4f3ef 100%) !important;
  color: #072f2c !important;
}

body[data-page="alliance"] .app {
  background: transparent !important;
  max-width: none;
  padding: calc(var(--global-topbar-height) + 16px) clamp(12px, 2.2vw, 28px) calc(var(--global-bottom-nav-reserve) + 28px);
}

body[data-page="alliance"] #alliancePage > section {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-shell {
  --alliance-ink: #072f2c !important;
  --alliance-ink-soft: #16443f !important;
  --alliance-muted: #3f625d !important;
  --alliance-muted-soft: rgba(63, 98, 93, 0.76) !important;
  --alliance-glass: rgba(255, 255, 255, 0.8) !important;
  --alliance-glass-strong: rgba(255, 255, 255, 0.92) !important;
  --alliance-line: rgba(22, 93, 84, 0.14) !important;
  --alliance-line-strong: rgba(255, 255, 255, 0.86) !important;
  --alliance-teal: #078f80 !important;
  --alliance-teal-bright: #1fc6ac !important;
  --alliance-teal-deep: #056c67 !important;
  --alliance-gold: #b5841f !important;
  --alliance-danger: #b9404f !important;
  width: min(100%, 1480px);
  margin: 0 auto;
  color: var(--alliance-ink) !important;
  gap: 12px;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-shell * {
  text-shadow: none !important;
}

body.diplomacy-modal-open .diplomacy-workbench-modal[data-diplomacy-tab="alliance"] {
  background:
    radial-gradient(ellipse at 16% 0%, rgba(44, 214, 184, 0.22), transparent 38%),
    radial-gradient(ellipse at 84% 10%, rgba(245, 199, 88, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(250, 255, 253, 0.98), rgba(230, 244, 240, 0.98)) !important;
  -webkit-backdrop-filter: blur(6px) saturate(1.08) contrast(1.04) !important;
  backdrop-filter: blur(6px) saturate(1.08) contrast(1.04) !important;
}

body.diplomacy-modal-open .diplomacy-workbench-shell[data-diplomacy-tab="alliance"] {
  border-color: rgba(255, 255, 255, 0.9) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(238, 250, 246, 0.94)),
    #f3fbf8 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 28px 78px rgba(14, 74, 68, 0.18) !important;
}

body.diplomacy-modal-open .diplomacy-workbench-shell[data-diplomacy-tab="alliance"] .diplomacy-workbench-head {
  border-bottom-color: rgba(7, 108, 103, 0.13) !important;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(231, 249, 244, 0.94)),
    #f8fffc !important;
}

body.diplomacy-modal-open .diplomacy-workbench-shell[data-diplomacy-tab="alliance"] .diplomacy-workbench-body {
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 255, 255, 0.9), transparent 32%),
    linear-gradient(180deg, #f8fffc, #edf8f4) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-glass-card,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs {
  border: 1px solid var(--alliance-line-strong) !important;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(255, 255, 255, 0.94), transparent 34%),
    radial-gradient(ellipse at 96% 4%, rgba(31, 198, 172, 0.18), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(235, 250, 246, 0.7)),
    var(--alliance-glass) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(7, 108, 103, 0.05),
    0 18px 36px rgba(14, 74, 68, 0.11) !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.08) contrast(1.04) !important;
  backdrop-filter: blur(8px) saturate(1.08) contrast(1.04) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero {
  min-height: 238px;
  border-radius: 32px;
  padding: clamp(22px, 3vw, 34px);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero::before {
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 44%),
    radial-gradient(ellipse at 14% 100%, rgba(7, 143, 128, 0.16), transparent 46%),
    radial-gradient(ellipse at 92% 10%, rgba(181, 132, 31, 0.14), transparent 38%) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-eyebrow {
  color: var(--alliance-teal) !important;
  letter-spacing: 0.08em;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-copy h2 {
  color: var(--alliance-ink) !important;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 0.96;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-copy p,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-card-copy,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row small,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row small,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card p,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card small,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route header small,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-role-heading,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .warning-text {
  color: var(--alliance-muted) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-identity-line strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-identity-line span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-metric,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-item,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-empty-panel,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus div {
  border: 1px solid rgba(255, 255, 255, 0.86) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(229, 249, 244, 0.68)),
    rgba(255, 255, 255, 0.72) !important;
  color: var(--alliance-ink) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 22px rgba(14, 74, 68, 0.08);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-identity-line strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-identity-line span {
  color: var(--alliance-ink-soft) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-metric span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-item span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-empty-panel span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-announcement span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress-copy span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus span {
  color: var(--alliance-muted-soft) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-metric strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-item strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-empty-panel strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress-copy strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-head strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-title strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route header span {
  color: var(--alliance-ink) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-glass-card {
  border-radius: 26px;
  padding: 18px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-title span,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-subtitle,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-role-heading strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route header strong,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-head span {
  color: var(--alliance-teal-deep) !important;
  letter-spacing: 0.02em;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-announcement {
  border-left-color: var(--alliance-teal) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-announcement p {
  color: var(--alliance-ink) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs {
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(229, 249, 244, 0.72)),
    rgba(255, 255, 255, 0.78) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs a {
  color: var(--alliance-ink-soft) !important;
  border-radius: 16px;
  transition:
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs a:hover,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs a:focus-visible {
  background:
    linear-gradient(145deg, #1fc6ac, #078f80 62%, #056c67),
    var(--alliance-teal) !important;
  color: #fffdf4 !important;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 10px 22px rgba(7, 143, 128, 0.2);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs .alliance-section-tab {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--alliance-ink-soft) !important;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
  transition:
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs .alliance-section-tab:hover,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs .alliance-section-tab:focus-visible,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs .alliance-section-tab.selected {
  background:
    linear-gradient(145deg, #1fc6ac, #078f80 62%, #056c67),
    var(--alliance-teal) !important;
  color: #fffdf4 !important;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 10px 22px rgba(7, 143, 128, 0.2);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs .alliance-section-tab:focus-visible {
  outline: 2px solid rgba(7, 143, 128, 0.26);
  outline-offset: 2px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-route,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .empty-state,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .warning-text {
  border: 1px solid rgba(22, 93, 84, 0.12) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(234, 249, 245, 0.64)),
    rgba(255, 255, 255, 0.72) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-row,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-member-row,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card {
  border-radius: 18px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card.active {
  border-color: rgba(7, 143, 128, 0.34) !important;
  background:
    linear-gradient(145deg, rgba(214, 248, 241, 0.94), rgba(255, 250, 230, 0.62)),
    rgba(255, 255, 255, 0.82) !important;
  box-shadow:
    inset 4px 0 0 rgba(7, 143, 128, 0.86),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 12px 28px rgba(7, 143, 128, 0.1);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-card.locked {
  opacity: 1;
  filter: saturate(0.9);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-meta span {
  color: var(--alliance-muted) !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button {
  border: 1px solid rgba(255, 255, 255, 0.86) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(232, 249, 244, 0.72)),
    rgba(255, 255, 255, 0.78) !important;
  color: var(--alliance-ink) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 22px rgba(14, 74, 68, 0.1);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button {
  border-radius: 999px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button {
  border-radius: 18px;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button.primary {
  border-color: rgba(7, 143, 128, 0.36) !important;
  background:
    linear-gradient(180deg, #2bd3b4, #078f80 56%, #056c67),
    var(--alliance-teal) !important;
  color: #fffdf4 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -12px 22px rgba(0, 88, 82, 0.18),
    0 12px 24px rgba(7, 143, 128, 0.22);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button.danger,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button.danger {
  border-color: rgba(185, 64, 79, 0.22) !important;
  background:
    linear-gradient(145deg, rgba(255, 239, 240, 0.8), rgba(255, 255, 255, 0.6)),
    rgba(185, 64, 79, 0.08) !important;
  color: #923441 !important;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button:hover,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-button:focus-visible,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button:hover,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-button:focus-visible {
  border-color: rgba(7, 143, 128, 0.34) !important;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 14px 28px rgba(14, 74, 68, 0.14);
  outline: 0;
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress.status-bar,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .status-bar.alliance-progress {
  height: 10px;
  border: 0 !important;
  background: rgba(22, 93, 84, 0.12) !important;
  box-shadow: inset 0 1px 2px rgba(22, 93, 84, 0.12);
}

:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-progress .status-fill {
  background: linear-gradient(90deg, var(--alliance-teal), var(--alliance-teal-bright), var(--alliance-gold)) !important;
  box-shadow: 0 0 18px rgba(7, 143, 128, 0.3);
}

@media (max-width: 1180px) {
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-command-grid,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-diplomacy-shell .alliance-command-grid,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-columns,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-policy-routes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-shell {
    width: 100%;
    gap: 12px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-glass-card {
    border-radius: 24px;
    padding: 16px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-directorate-hero {
    min-height: 0;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-copy h2 {
    font-size: 42px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-hero-metrics,
:is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-brief-grid,
  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-task-focus {
    grid-template-columns: 1fr;
  }
}

/* Alliance redo v3: outrank the old dark diplomacy selectors and restore crisp readable glass. */
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-directorate-shell {
  --alliance-ink: #062f2c !important;
  --alliance-ink-soft: #16433e !important;
  --alliance-muted: #456862 !important;
  --alliance-muted-soft: #5b7a74 !important;
  --alliance-panel: rgba(255, 255, 255, 0.9) !important;
  --alliance-panel-soft: rgba(236, 251, 246, 0.78) !important;
  --alliance-line: rgba(17, 102, 92, 0.14) !important;
  --alliance-line-strong: rgba(255, 255, 255, 0.9) !important;
  --alliance-teal: #078f80 !important;
  --alliance-teal-bright: #23c8ad !important;
  --alliance-teal-deep: #056b66 !important;
  --alliance-gold: #b88620 !important;
  --alliance-danger: #b83c4a !important;
  color: var(--alliance-ink) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-directorate-shell * {
  text-shadow: none !important;
}

#diplomacyModalHost .diplomacy-workbench-modal[data-diplomacy-tab="alliance"] {
  background:
    radial-gradient(ellipse at 14% -4%, rgba(35, 200, 173, 0.2), transparent 38%),
    radial-gradient(ellipse at 86% 4%, rgba(244, 194, 82, 0.14), transparent 32%),
    linear-gradient(180deg, #fbfffd 0%, #edf8f4 100%) !important;
}

#diplomacyModalHost .diplomacy-workbench-shell[data-diplomacy-tab="alliance"] {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(238, 251, 247, 0.94)),
    #f6fffb !important;
}

#diplomacyModalHost .diplomacy-workbench-shell[data-diplomacy-tab="alliance"] .diplomacy-workbench-body {
  background:
    linear-gradient(180deg, rgba(251, 255, 253, 0.98), rgba(235, 247, 243, 0.96)),
    #f5fffb !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-directorate-hero,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-glass-card,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-section-tabs {
  border: 1px solid var(--alliance-line-strong) !important;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(255, 255, 255, 0.96), transparent 34%),
    radial-gradient(ellipse at 96% 0%, rgba(35, 200, 173, 0.16), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(235, 251, 246, 0.76)),
    var(--alliance-panel) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(17, 102, 92, 0.05),
    0 16px 32px rgba(12, 67, 62, 0.1) !important;
  color: var(--alliance-ink) !important;
  -webkit-backdrop-filter: blur(6px) saturate(1.08) contrast(1.05) !important;
  backdrop-filter: blur(6px) saturate(1.08) contrast(1.05) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-directorate-hero {
  background:
    linear-gradient(90deg, rgba(251, 255, 253, 0.96) 0%, rgba(242, 253, 249, 0.84) 34%, rgba(242, 253, 249, 0.38) 62%, rgba(255, 247, 222, 0.18) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(181, 219, 211, 0.14)),
    url("/assets/government-concepts/diplomacy-hall/diplomacy_hall_factions_v7_flat.webp?v=diplomacy-hall-factions-flat-20260611-v7") center / cover !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-directorate-hero::before {
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 44%),
    radial-gradient(ellipse at 12% 100%, rgba(7, 143, 128, 0.14), transparent 44%),
    radial-gradient(ellipse at 92% 10%, rgba(184, 134, 32, 0.12), transparent 36%) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-eyebrow,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-section-title span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-subtitle,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route header strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-head span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-role-heading strong {
  color: var(--alliance-teal-deep) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-copy h2,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-metric strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-brief-item strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-empty-panel strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-row strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-row strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-head strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route header span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-command-button strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-section-title strong {
  color: var(--alliance-ink) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-copy p,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-card-copy,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-metric span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-metric small,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-brief-item span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-brief-item small,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-empty-panel span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-row small,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-row small,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-card p,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-card small,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-meta span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route header small,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-command-button span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-announcement span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-progress-copy span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-focus span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .warning-text {
  color: var(--alliance-muted) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-identity-line strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-identity-line span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-metric,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-brief-item,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-empty-panel,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-focus div,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-row,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-row,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-card,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-command-button,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .empty-state,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .warning-text {
  border: 1px solid rgba(17, 102, 92, 0.12) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(235, 251, 246, 0.72)),
    rgba(255, 255, 255, 0.82) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  color: var(--alliance-ink) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-card.active {
  border-color: rgba(7, 143, 128, 0.34) !important;
  background:
    linear-gradient(145deg, rgba(214, 248, 241, 0.96), rgba(255, 250, 230, 0.64)),
    rgba(255, 255, 255, 0.88) !important;
  box-shadow:
    inset 4px 0 0 rgba(7, 143, 128, 0.88),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(7, 143, 128, 0.1) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-profile-row {
  align-items: center;
  gap: 14px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-profile {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px 12px;
  min-width: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-avatar {
  display: inline-flex;
  flex: 0 0 auto;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-avatar .player-avatar {
  width: 44px;
  height: 44px;
  border-color: rgba(28, 137, 126, 0.2);
  box-shadow:
    0 10px 20px rgba(15, 91, 84, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  font-size: 18px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-name {
  flex: 0 1 auto;
  min-width: 120px;
  line-height: 1.1;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-name .inline-player-link {
  display: inline-block;
  max-width: min(260px, 28vw);
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid rgba(17, 139, 125, 0.14);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(245, 255, 252, 0.92), rgba(225, 249, 243, 0.72)),
    rgba(255, 255, 255, 0.84);
  color: rgba(26, 83, 78, 0.78);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  padding: 6px 12px;
  white-space: nowrap;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-role {
  color: var(--alliance-ink);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu {
  position: relative;
  flex: 0 0 auto;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu summary {
  display: inline-grid;
  place-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(17, 139, 125, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(229, 249, 244, 0.72)),
    rgba(255, 255, 255, 0.8);
  box-shadow:
    0 12px 24px rgba(18, 89, 82, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: pointer;
  list-style: none;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu summary::-webkit-details-marker {
  display: none;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu summary span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: rgba(19, 92, 84, 0.78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu summary:hover,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu summary:focus-visible,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu[open] summary {
  border-color: rgba(17, 139, 125, 0.28);
  background:
    linear-gradient(145deg, rgba(232, 255, 249, 0.96), rgba(255, 250, 230, 0.62)),
    rgba(255, 255, 255, 0.92);
  outline: none;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: grid;
  gap: 6px;
  min-width: 150px;
  padding: 8px;
  border: 1px solid rgba(17, 139, 125, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(229, 251, 246, 0.86)),
    rgba(255, 255, 255, 0.9);
  box-shadow:
    0 18px 36px rgba(16, 80, 74, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--alliance-ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 12px;
  white-space: nowrap;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu-item:hover,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu-item:focus-visible {
  background: rgba(213, 249, 240, 0.86);
  outline: none;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu-item.danger {
  color: #8a2f34;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-member-menu-empty {
  color: var(--alliance-muted);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 10px;
  white-space: nowrap;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-faction-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 5px !important;
  color: var(--alliance-ink) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-faction-icon {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 2px 4px rgba(24, 58, 86, 0.12));
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-identity {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 30px);
  min-width: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-avatar-stage {
  position: relative;
  flex: 0 0 clamp(98px, 9vw, 132px);
  display: grid;
  place-items: center;
  width: clamp(98px, 9vw, 132px);
  height: clamp(98px, 9vw, 132px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.9), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(221, 242, 237, 0.54)),
    rgba(255, 255, 255, 0.62);
  box-shadow:
    0 20px 40px rgba(19, 73, 68, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(26, 88, 82, 0.12);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-avatar-button {
  appearance: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-avatar-button:hover {
  transform: translateY(-2px);
  border-color: rgba(17, 168, 145, 0.36);
  box-shadow:
    0 24px 44px rgba(19, 73, 68, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(26, 88, 82, 0.14);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-avatar-button:focus-visible {
  outline: 3px solid rgba(27, 186, 164, 0.34);
  outline-offset: 4px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-avatar-image {
  display: block;
  width: 76%;
  height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(15, 57, 55, 0.2));
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-avatar-stage.custom .alliance-hero-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-avatar-stage span {
  color: var(--alliance-ink);
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 1000;
  line-height: 1;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-name-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-name-editor {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: min(760px, 100%);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-name-editor.editing {
  width: min(560px, 100%);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-display-name {
  display: block;
  overflow: hidden;
  max-width: min(660px, calc(100% - 52px));
  color: var(--alliance-ink);
  font-size: clamp(38px, 5vw, 70px);
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1.04;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-name-input {
  height: clamp(48px, 5vw, 62px);
  font-size: clamp(28px, 3.6vw, 44px);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-tags {
  margin-top: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-intro-block {
  display: grid;
  gap: 10px;
  max-width: min(640px, 100%);
  margin-top: 18px;
  color: var(--alliance-ink);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-intro-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-intro-head span {
  color: var(--alliance-muted) !important;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-intro-block strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  color: var(--alliance-ink);
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 750;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-intro-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-intro-textarea {
  min-height: 126px;
  max-width: 100%;
  color: var(--alliance-ink);
}

@media (max-width: 760px) {
  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-identity {
    align-items: flex-start;
    gap: 14px;
  }

  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hero-avatar-stage {
    flex-basis: 74px;
    width: 74px;
    height: 74px;
    border-radius: 22px;
  }

  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-display-name {
    font-size: 34px;
  }

  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-intro-block {
    margin-top: 14px;
  }
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-button {
  border: 1px solid rgba(255, 255, 255, 0.88) !important;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(232, 250, 245, 0.76)),
    rgba(255, 255, 255, 0.82) !important;
  color: var(--alliance-ink) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 10px 20px rgba(12, 67, 62, 0.1) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-button.primary {
  border-color: rgba(7, 143, 128, 0.36) !important;
  background:
    linear-gradient(180deg, #2bd3b4, #078f80 56%, #056b66),
    var(--alliance-teal) !important;
  color: #fffdf4 !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-button.danger,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-command-button.danger {
  border-color: rgba(184, 60, 74, 0.22) !important;
  background:
    linear-gradient(145deg, rgba(255, 239, 240, 0.82), rgba(255, 255, 255, 0.66)),
    rgba(184, 60, 74, 0.08) !important;
  color: #8e303c !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-progress.status-bar,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .status-bar.alliance-progress {
  border: 0 !important;
  background: rgba(17, 102, 92, 0.12) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-progress .status-fill {
  background: linear-gradient(90deg, var(--alliance-teal), var(--alliance-teal-bright), var(--alliance-gold)) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-materials {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-title {
  margin: 0 !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 12px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 8px;
  min-height: 210px;
  padding: 12px;
  border: 1px solid rgba(17, 102, 92, 0.14) !important;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(233, 250, 245, 0.74)),
    rgba(255, 255, 255, 0.88) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 12px 24px rgba(12, 67, 62, 0.08) !important;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-card.complete {
  opacity: 0.72;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-icon {
  position: relative;
  display: grid;
  place-items: center;
  height: 86px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.98), transparent 48%),
    linear-gradient(145deg, rgba(225, 247, 243, 0.9), rgba(255, 249, 226, 0.72));
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-icon .product-icon-image {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(19, 73, 68, 0.16));
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-icon b {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 0 14px 0 12px;
  background: linear-gradient(180deg, #d6a431, #b78313);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  box-shadow: 0 6px 12px rgba(184, 134, 32, 0.24);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: center;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-copy strong {
  color: var(--alliance-ink) !important;
  font-size: 17px;
  font-weight: 900;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-copy span {
  color: var(--alliance-muted) !important;
  font-size: 12px;
  font-weight: 800;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 102, 92, 0.12);
  box-shadow: inset 0 1px 3px rgba(12, 67, 62, 0.14);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--alliance-teal), var(--alliance-teal-bright));
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-hq-material-card .alliance-button {
  width: 100%;
  min-height: 36px;
  justify-content: center;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-overlay {
  position: fixed;
  inset: 0;
  z-index: 920;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 32px);
  background: rgba(224, 244, 239, 0.38);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-modal {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid rgba(17, 102, 92, 0.18);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(235, 251, 246, 0.86)),
    rgba(255, 255, 255, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 28px 70px rgba(12, 67, 62, 0.24);
  color: var(--alliance-ink);
  padding: clamp(18px, 2.8vw, 28px);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-head span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-material span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-stats span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-input span {
  color: var(--alliance-muted);
  font-size: 13px;
  font-weight: 900;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-head h3 {
  margin: 4px 0 0;
  color: var(--alliance-ink);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 950;
  line-height: 1.05;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-head button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--alliance-ink);
  font-size: 26px;
  font-weight: 900;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-material {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(17, 102, 92, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(235, 251, 246, 0.7)),
    rgba(255, 255, 255, 0.78);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-icon {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 246, 0.8)),
    rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 12px 26px rgba(12, 67, 62, 0.12);
  color: var(--alliance-teal-deep);
  font-size: 34px;
  font-weight: 950;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-icon .product-icon-image {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-material strong {
  display: block;
  margin-top: 4px;
  color: var(--alliance-ink);
  font-size: 28px;
  font-weight: 950;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-material small {
  display: block;
  margin-top: 4px;
  color: var(--alliance-muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-stats div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(17, 102, 92, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-stats strong {
  overflow: hidden;
  color: var(--alliance-ink);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-input {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-input input {
  width: 100%;
  min-height: 56px;
  border: 1px solid rgba(17, 102, 92, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--alliance-ink);
  font-size: 26px;
  font-weight: 950;
  padding: 0 16px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-quick button {
  min-height: 42px;
  border: 1px solid rgba(7, 143, 128, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--alliance-teal-deep);
  font-weight: 950;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-note {
  margin: 0 0 16px;
  color: var(--alliance-muted);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 680px) {
  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-modal {
    border-radius: 22px;
  }

  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-quick,
  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-task-donation-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Encyclopedia detail repair: stable product dossier and deeper iOS 27 glass. */
.encyclopedia-overlay {
  background:
    radial-gradient(ellipse at 16% 0%, rgba(74, 211, 189, 0.28), transparent 36%),
    radial-gradient(ellipse at 86% 4%, rgba(245, 204, 98, 0.22), transparent 34%),
    radial-gradient(ellipse at 50% 108%, rgba(126, 202, 218, 0.18), transparent 46%),
    linear-gradient(180deg, rgba(250, 255, 252, 0.94), rgba(227, 244, 239, 0.88) 54%, rgba(244, 240, 222, 0.78)),
    rgba(232, 246, 242, 0.84);
}

.encyclopedia-modal {
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(circle at 9% 0%, rgba(255, 255, 255, 0.92), transparent 32%),
    radial-gradient(circle at 94% 9%, rgba(245, 207, 111, 0.2), transparent 34%),
    radial-gradient(circle at 32% 100%, rgba(93, 201, 184, 0.16), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(232, 249, 244, 0.68) 56%, rgba(255, 249, 230, 0.66)),
    rgba(248, 255, 252, 0.58);
  box-shadow:
    0 36px 96px rgba(31, 65, 59, 0.22),
    0 12px 34px rgba(255, 255, 255, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(72, 134, 124, 0.12);
  -webkit-backdrop-filter: blur(34px) saturate(1.32);
  backdrop-filter: blur(34px) saturate(1.32);
}

.encyclopedia-modal::before,
.encyclopedia-modal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.encyclopedia-modal::before {
  z-index: 0;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.58), transparent 23% 62%, rgba(255, 255, 255, 0.34)),
    repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 76px);
  opacity: 0.68;
}

.encyclopedia-modal::after {
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 18%, rgba(255, 255, 255, 0.46), transparent 24%),
    radial-gradient(ellipse at 76% 78%, rgba(15, 145, 131, 0.12), transparent 32%);
  mix-blend-mode: soft-light;
}

.encyclopedia-header,
.encyclopedia-body {
  position: relative;
  z-index: 1;
}

.encyclopedia-body {
  background:
    linear-gradient(135deg, rgba(251, 255, 253, 0.8), rgba(234, 250, 246, 0.64) 45%, rgba(255, 249, 231, 0.56)),
    rgba(246, 255, 252, 0.58);
}

.encyclopedia-sidebar,
.encyclopedia-detail {
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.58), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(232, 249, 245, 0.44)),
    rgba(255, 255, 255, 0.38);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
}

.encyclopedia-detail {
  gap: 20px;
  padding: 22px;
  scroll-padding-top: 22px;
}

.encyclopedia-product-dossier {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0;
  overflow: visible;
  border-radius: 30px;
  background:
    radial-gradient(circle at 10% 0%, var(--industry-surface, rgba(15, 145, 131, 0.16)), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(238, 252, 248, 0.58) 58%, rgba(255, 250, 234, 0.5)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(53, 109, 100, 0.08),
    0 22px 48px rgba(29, 75, 68, 0.1);
}

.encyclopedia-product-card {
  align-items: center;
  grid-template-columns: 204px minmax(0, 1fr);
  min-height: 232px;
  overflow: visible;
  padding: 24px 28px;
  border-radius: 30px 30px 0 0;
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 255, 255, 0.64), transparent 32%),
    radial-gradient(circle at 78% 0%, var(--industry-surface, rgba(15, 145, 131, 0.15)), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(237, 252, 248, 0.52)),
    rgba(255, 255, 255, 0.46);
}

.encyclopedia-building-dossier .encyclopedia-product-card {
  border-radius: 30px;
}

.encyclopedia-product-icon {
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 180px;
  min-height: 180px;
  padding: 12px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 255, 255, 0.92), transparent 46%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(228, 247, 243, 0.5)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -14px 28px rgba(15, 145, 131, 0.08),
    0 18px 32px rgba(38, 76, 70, 0.1);
}

.encyclopedia-product-icon .product-icon-image,
.encyclopedia-building-icon .encyclopedia-hero-building-image {
  width: 158px;
  height: 158px;
  object-fit: contain;
  opacity: 1;
  filter: saturate(1.08) contrast(1.04) drop-shadow(0 12px 18px rgba(35, 70, 64, 0.12));
}

.encyclopedia-product-copy {
  gap: 13px;
  min-height: 0;
  padding: 2px 0;
}

.encyclopedia-product-copy h2 {
  font-size: clamp(38px, 4vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.encyclopedia-product-copy p {
  max-width: 68ch;
  color: rgba(28, 63, 59, 0.72);
  font-size: 16px;
  line-height: 1.72;
}

.encyclopedia-product-tags {
  gap: 10px;
}

.encyclopedia-product-tag {
  min-height: 34px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 900;
}

.encyclopedia-product-marketbar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  margin: 0;
  overflow: visible;
  padding: 14px 18px;
  border-top: 1px solid rgba(48, 91, 84, 0.14);
  border-radius: 0 0 30px 30px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.68), rgba(235, 250, 246, 0.48)),
    rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.encyclopedia-product-price {
  min-height: 48px;
}

.encyclopedia-product-actions {
  align-items: center;
  min-height: 48px;
}

.encyclopedia-product-dossier + .encyclopedia-section {
  margin-top: 2px;
}

.encyclopedia-section {
  overflow: visible;
}

.encyclopedia-section h3 {
  min-height: 66px;
  display: flex;
  align-items: center;
}

.encyclopedia-recipe-list {
  overflow: visible;
}

.encyclopedia-hero {
  min-height: 214px;
  align-items: center;
  grid-template-columns: 184px minmax(0, 1fr);
}

.encyclopedia-hero-icon {
  display: grid;
  place-items: center;
  width: 176px;
  min-height: 176px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 255, 255, 0.9), transparent 46%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(228, 247, 243, 0.5));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 32px rgba(38, 76, 70, 0.1);
}

.encyclopedia-hero-icon .product-icon-image,
.encyclopedia-hero-icon .workforce-type-icon {
  width: 154px;
  height: 154px;
  object-fit: contain;
  opacity: 1;
  filter: saturate(1.08) contrast(1.04) drop-shadow(0 12px 18px rgba(35, 70, 64, 0.12));
}

@media (max-width: 980px) {
  .encyclopedia-detail {
    padding: 16px;
  }

  .encyclopedia-product-card,
  .encyclopedia-product-marketbar,
  .encyclopedia-hero {
    grid-template-columns: 1fr;
  }

  .encyclopedia-product-card {
    min-height: 0;
    padding: 18px;
  }

  .encyclopedia-product-icon,
  .encyclopedia-hero-icon {
    justify-self: start;
    width: 148px;
    min-height: 148px;
  }

  .encyclopedia-product-icon .product-icon-image,
  .encyclopedia-building-icon .encyclopedia-hero-building-image,
  .encyclopedia-hero-icon .product-icon-image,
  .encyclopedia-hero-icon .workforce-type-icon {
    width: 126px;
    height: 126px;
  }

  .encyclopedia-product-copy h2 {
    font-size: clamp(32px, 9vw, 44px);
  }

  .encyclopedia-product-marketbar {
    min-height: 0;
  }
}

.encyclopedia-product-icon:not(.encyclopedia-building-icon) {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.encyclopedia-product-icon:not(.encyclopedia-building-icon) .product-icon-image {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 28px;
  filter: none;
}

/* Encyclopedia tier palette: 1 white, 2 green, 3 blue, 4 purple. */
.encyclopedia-product-dossier {
  --product-tier-badge-bg: linear-gradient(180deg, #ffffff, #f4f7f3);
  --product-tier-badge-border: rgba(89, 121, 115, 0.34);
  --product-tier-badge-text: #173835;
  --product-tier-badge-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -10px 16px rgba(21, 51, 49, 0.04),
    0 10px 18px rgba(37, 72, 66, 0.08);
  --product-tier-badge-text-shadow: none;
}

.encyclopedia-product-dossier.tier-1 {
  --product-tier-color: #ffffff;
  --product-tier-soft: rgba(255, 255, 255, 0.74);
  --product-tier-badge-bg: linear-gradient(180deg, #ffffff, #f5f8f3);
  --product-tier-badge-border: rgba(98, 124, 118, 0.38);
  --product-tier-badge-text: #173835;
}

.encyclopedia-product-dossier.tier-2 {
  --product-tier-color: #26b875;
  --product-tier-soft: rgba(38, 184, 117, 0.18);
  --product-tier-badge-bg: linear-gradient(180deg, #62dfa0, #18a46a 62%, #0a8058);
  --product-tier-badge-border: rgba(8, 124, 82, 0.42);
  --product-tier-badge-text: #fbfff8;
  --product-tier-badge-text-shadow: 0 1px 0 rgba(2, 76, 53, 0.28);
}

.encyclopedia-product-dossier.tier-3 {
  --product-tier-color: #2d8ed8;
  --product-tier-soft: rgba(45, 142, 216, 0.18);
  --product-tier-badge-bg: linear-gradient(180deg, #78c6f2, #2d8ed8 60%, #1f679f);
  --product-tier-badge-border: rgba(31, 103, 159, 0.42);
  --product-tier-badge-text: #fbfdff;
  --product-tier-badge-text-shadow: 0 1px 0 rgba(14, 68, 112, 0.28);
}

.encyclopedia-product-dossier.tier-4 {
  --product-tier-color: #9b64d8;
  --product-tier-soft: rgba(155, 100, 216, 0.18);
  --product-tier-badge-bg: linear-gradient(180deg, #c79af3, #9360d4 60%, #673aa6);
  --product-tier-badge-border: rgba(103, 58, 166, 0.42);
  --product-tier-badge-text: #fffaff;
  --product-tier-badge-text-shadow: 0 1px 0 rgba(72, 36, 124, 0.3);
}

.encyclopedia-product-tag.tier {
  border-color: var(--product-tier-badge-border);
  background: var(--product-tier-badge-bg);
  color: var(--product-tier-badge-text);
  opacity: 1;
  text-shadow: var(--product-tier-badge-text-shadow);
  box-shadow: var(--product-tier-badge-shadow);
}

.encyclopedia-product-tag.industry {
  border-color: var(--industry-border, rgba(9, 124, 112, 0.28));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), var(--industry-soft, rgba(196, 238, 231, 0.5))),
    var(--industry-surface, rgba(15, 145, 131, 0.14));
  color: var(--industry-ink, var(--industry-color, #08766e));
  opacity: 1;
  text-shadow: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -10px 18px var(--industry-surface, rgba(15, 145, 131, 0.08)),
    0 8px 14px rgba(14, 100, 91, 0.08);
}

/* Chat redo v1: clear iOS 27 glass for the diplomacy comms surface. */
body[data-page="chat"] {
  background:
    radial-gradient(ellipse at 14% 0%, rgba(35, 200, 173, 0.2), transparent 36%),
    radial-gradient(ellipse at 86% 2%, rgba(244, 194, 82, 0.13), transparent 30%),
    linear-gradient(180deg, #fbfffd 0%, #edf8f4 100%) !important;
  color: #062f2c;
}

body[data-page="chat"] .app {
  max-width: none;
  padding: calc(var(--global-topbar-height) + 18px) clamp(14px, 2.8vw, 34px) calc(var(--global-bottom-nav-reserve) + 34px);
}

#diplomacyModalHost .diplomacy-workbench-modal[data-diplomacy-tab="chat"] {
  background:
    radial-gradient(ellipse at 14% -4%, rgba(35, 200, 173, 0.22), transparent 38%),
    radial-gradient(ellipse at 88% 6%, rgba(244, 194, 82, 0.15), transparent 32%),
    linear-gradient(180deg, #fbfffd 0%, #edf8f4 100%) !important;
}

#diplomacyModalHost .diplomacy-workbench-shell[data-diplomacy-tab="chat"],
#diplomacyModalHost .diplomacy-workbench-shell[data-diplomacy-tab="chat"] .diplomacy-workbench-body {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(238, 251, 247, 0.94)),
    #f6fffb !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-directorate-shell {
  --chat-ink: #062f2c !important;
  --chat-ink-soft: #16433e !important;
  --chat-muted: #486b65 !important;
  --chat-muted-soft: #6f8983 !important;
  --chat-soft: rgba(7, 143, 128, 0.1) !important;
  --chat-glass: rgba(255, 255, 255, 0.9) !important;
  --chat-glass-strong: rgba(246, 255, 252, 0.94) !important;
  --chat-line: rgba(17, 102, 92, 0.14) !important;
  --chat-line-strong: rgba(255, 255, 255, 0.9) !important;
  --chat-gold: #a77918 !important;
  --chat-teal: #078f80 !important;
  --chat-teal-bright: #24c9ae !important;
  --chat-danger: #b83c4a !important;
  color: var(--chat-ink) !important;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-directorate-shell * {
  text-shadow: none !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-command-hero,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-list,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-panel,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-dossier {
  border: 1px solid var(--chat-line-strong) !important;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(255, 255, 255, 0.97), transparent 34%),
    radial-gradient(ellipse at 96% 0%, rgba(35, 200, 173, 0.16), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(235, 251, 246, 0.76)),
    var(--chat-glass) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(17, 102, 92, 0.05),
    0 16px 32px rgba(12, 67, 62, 0.1) !important;
  color: var(--chat-ink) !important;
  -webkit-backdrop-filter: blur(6px) saturate(1.08) contrast(1.05) !important;
  backdrop-filter: blur(6px) saturate(1.08) contrast(1.05) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-command-hero {
  border-radius: 32px;
  min-height: 184px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.99) 0%, rgba(249, 255, 252, 0.95) 28%, rgba(241, 252, 248, 0.58) 48%, rgba(242, 251, 247, 0.12) 72%),
    radial-gradient(ellipse at 10% 100%, rgba(7, 143, 128, 0.12), transparent 44%),
    url("/assets/diplomacy-concepts/communication-center/diplomacy_communications_center_hero_v1.png?v=diplomacy-communication-hero-20260612-v1") center right / cover no-repeat !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-command-hero::before {
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 46%),
    radial-gradient(ellipse at 12% 100%, rgba(7, 143, 128, 0.14), transparent 44%),
    radial-gradient(ellipse at 92% 10%, rgba(184, 134, 32, 0.08), transparent 36%) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-eyebrow,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-rail-title span,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-group > span,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-panel-header > div > span,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-dossier-head span,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-translation-note strong {
  color: var(--chat-teal) !important;
  letter-spacing: 0.08em;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-hero-title-row img {
  border-color: rgba(255, 255, 255, 0.9) !important;
  background:
    radial-gradient(circle at 35% 18%, rgba(255, 255, 255, 0.94), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(226, 248, 242, 0.64)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 10px 22px rgba(12, 67, 62, 0.12);
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-hero-title-row h2,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-hero-metric strong,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-rail-title strong,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-dossier-head strong,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-copy strong,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-panel-header strong,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-scope-strip strong,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-message-meta strong,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-empty-state strong,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-warning strong,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-dossier-list dd {
  color: var(--chat-ink) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-hero-title-row p,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-hero-metric span,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-hero-metric small,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-copy small,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-badge,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-panel-header small,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-message-meta,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-message-foot span,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-translation,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-compose-input > span,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-recipient-line span,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-recipient-line em,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-dossier-list dt,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-translation-note span,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-empty-state span {
  color: var(--chat-muted) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-hero-metric,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-button,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-scope-strip span,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-recipient-line,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-compose,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-warning,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-empty-state,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-translation-note {
  border: 1px solid rgba(17, 102, 92, 0.12) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(235, 251, 246, 0.72)),
    rgba(255, 255, 255, 0.82) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-button {
  min-height: 60px;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-button:hover,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-button:focus-visible {
  border-color: rgba(7, 143, 128, 0.28) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(222, 248, 242, 0.8)),
    rgba(255, 255, 255, 0.9) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 10px 20px rgba(12, 67, 62, 0.08);
  transform: translateY(-1px);
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-button.selected {
  border-color: rgba(7, 143, 128, 0.4) !important;
  background:
    linear-gradient(145deg, rgba(221, 250, 243, 0.98), rgba(255, 251, 232, 0.68)),
    rgba(255, 255, 255, 0.9) !important;
  box-shadow:
    inset 4px 0 0 rgba(7, 143, 128, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 10px 22px rgba(7, 143, 128, 0.12) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-button.locked {
  opacity: 1;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-mark {
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.74), transparent 54%),
    linear-gradient(145deg, rgba(7, 143, 128, 0.16), rgba(184, 134, 32, 0.12));
  color: var(--chat-teal) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-badge,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-message-foot span,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-translation,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-recipient-line strong {
  border-color: rgba(17, 102, 92, 0.12) !important;
  background: rgba(7, 143, 128, 0.08) !important;
  color: var(--chat-teal) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-status {
  border-color: rgba(7, 143, 128, 0.22) !important;
  background:
    linear-gradient(145deg, rgba(225, 249, 244, 0.9), rgba(255, 255, 255, 0.68)),
    rgba(7, 143, 128, 0.08) !important;
  color: var(--chat-teal) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-status.warning,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-status.cooldown {
  border-color: rgba(184, 134, 32, 0.24) !important;
  background: rgba(184, 134, 32, 0.1) !important;
  color: var(--chat-gold) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-status.danger {
  border-color: rgba(184, 60, 74, 0.24) !important;
  background: rgba(184, 60, 74, 0.09) !important;
  color: var(--chat-danger) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-message-list {
  border: 1px solid rgba(17, 102, 92, 0.1) !important;
  background:
    linear-gradient(180deg, rgba(249, 255, 253, 0.92), rgba(237, 250, 246, 0.7)),
    rgba(255, 255, 255, 0.72) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(17, 102, 92, 0.04);
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-message-row {
  border-color: rgba(17, 102, 92, 0.12) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(237, 251, 247, 0.82)),
    rgba(255, 255, 255, 0.88) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 18px rgba(12, 67, 62, 0.06);
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-message-row.own {
  border-color: rgba(7, 143, 128, 0.24) !important;
  background:
    linear-gradient(145deg, rgba(218, 248, 242, 0.94), rgba(255, 255, 255, 0.84)),
    rgba(255, 255, 255, 0.88) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-message-row.private {
  border-color: rgba(184, 134, 32, 0.24) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-message-row p {
  color: var(--chat-ink-soft) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-message-avatar .player-avatar {
  border-color: rgba(17, 102, 92, 0.16) !important;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.88), transparent 34%),
    linear-gradient(145deg, rgba(226, 250, 245, 0.95), rgba(123, 205, 193, 0.62)) !important;
  color: var(--chat-ink) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-alliance-tag {
  color: var(--chat-muted) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-target-input,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-compose textarea,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-compose-meta {
  border: 1px solid rgba(17, 102, 92, 0.14) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(238, 251, 247, 0.74)),
    rgba(255, 255, 255, 0.9) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(17, 102, 92, 0.05);
  color: var(--chat-ink) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-target-input::placeholder,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-compose textarea::placeholder {
  color: rgba(72, 107, 101, 0.52) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-compose-meta {
  color: var(--chat-muted) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-compose-meta b {
  background: linear-gradient(90deg, var(--chat-teal), var(--chat-teal-bright), var(--chat-gold)) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-warning {
  color: var(--chat-gold) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-warning.danger {
  border-color: rgba(184, 60, 74, 0.2) !important;
  background: rgba(184, 60, 74, 0.08) !important;
  color: var(--chat-danger) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-warning button,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-empty-state button,
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-send-button {
  border: 1px solid rgba(255, 255, 255, 0.88) !important;
  background:
    linear-gradient(180deg, #2bd3b4, #078f80 56%, #056b66),
    var(--chat-teal) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 10px 20px rgba(7, 143, 128, 0.18);
  color: #fffdf4 !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-send-button small {
  color: rgba(255, 253, 244, 0.72) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-send-button:disabled {
  border-color: rgba(17, 102, 92, 0.1) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(226, 240, 236, 0.58)),
    rgba(255, 255, 255, 0.62) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  color: rgba(72, 107, 101, 0.52) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-send-button:disabled small {
  color: rgba(72, 107, 101, 0.46) !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-dossier-list div {
  border-bottom-color: rgba(17, 102, 92, 0.1) !important;
}

@media (max-width: 1120px) {
  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-dossier {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 760px) {
  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-command-hero,
  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-list,
  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-panel,
  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-dossier {
    border-radius: 22px;
  }
}

/* Mailbox preview redo v1: compact iOS 27 liquid-glass notification surface. */
.global-mailbox-anchor .mailbox-popover,
.mailbox-popover {
  --mailbox-preview-ink: #082f2d;
  --mailbox-preview-soft: #486b65;
  --mailbox-preview-muted: #6b8780;
  --mailbox-preview-teal: #078f80;
  --mailbox-preview-mint: #24c9ae;
  --mailbox-preview-gold: #a77918;
  right: 0;
  top: calc(100% + 14px);
  width: min(462px, calc(100vw - 28px));
  max-height: min(760px, calc(100dvh - var(--global-topbar-height) - 28px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.92) !important;
  border-radius: 28px;
  padding: 12px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, 0.98), transparent 34%),
    radial-gradient(ellipse at 92% 4%, rgba(35, 200, 173, 0.18), transparent 34%),
    radial-gradient(ellipse at 50% 104%, rgba(244, 194, 82, 0.12), transparent 44%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(237, 251, 247, 0.76)),
    rgba(249, 255, 252, 0.86) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(17, 102, 92, 0.06),
    0 28px 68px rgba(12, 54, 51, 0.18) !important;
  color: var(--mailbox-preview-ink);
  -webkit-backdrop-filter: blur(18px) saturate(1.18) contrast(1.04);
  backdrop-filter: blur(18px) saturate(1.18) contrast(1.04);
}

.global-mailbox-anchor .mailbox-popover::before,
.mailbox-popover::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(116deg, rgba(255, 255, 255, 0.62), transparent 26% 62%, rgba(255, 255, 255, 0.24)),
    repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 80px);
  opacity: 0.72;
}

.global-mailbox-anchor .mailbox-popover.open,
.mailbox-popover.open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.mailbox-popover-header,
.mailbox-preview-list,
.mailbox-popover-actions {
  position: relative;
  z-index: 1;
}

.mailbox-popover-header {
  min-height: 50px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid rgba(17, 102, 92, 0.1);
}

.mailbox-popover-header strong {
  color: var(--mailbox-preview-ink);
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.08;
}

.mailbox-popover-header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid rgba(17, 102, 92, 0.1);
  border-radius: 999px;
  padding: 0 11px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(234, 250, 246, 0.66)),
    rgba(255, 255, 255, 0.72);
  color: var(--mailbox-preview-soft) !important;
  font-size: 18px;
  font-weight: 780;
}

.mailbox-preview-list {
  display: grid;
  gap: 10px;
  max-height: min(596px, calc(100dvh - var(--global-topbar-height) - 150px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(7, 143, 128, 0.42) rgba(17, 102, 92, 0.08);
}

.mailbox-preview-list::-webkit-scrollbar {
  width: 8px;
}

.mailbox-preview-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(17, 102, 92, 0.08);
}

.mailbox-preview-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(242, 253, 249, 0.86);
  border-radius: 999px;
  background: rgba(7, 143, 128, 0.42);
}

.mailbox-preview-item {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 116px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.84) !important;
  border-radius: 20px;
  padding: 14px 16px 15px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, 0.96), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(239, 252, 248, 0.62)),
    rgba(255, 255, 255, 0.74) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 22px rgba(12, 67, 62, 0.07) !important;
  color: var(--mailbox-preview-ink);
  text-align: left;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.mailbox-preview-item::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(7, 143, 128, 0);
  box-shadow: none;
}

.mailbox-preview-item:hover,
.mailbox-preview-item:focus-visible {
  border-color: rgba(7, 143, 128, 0.24) !important;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, 1), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(225, 249, 244, 0.76)),
    rgba(255, 255, 255, 0.88) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 14px 28px rgba(12, 67, 62, 0.1) !important;
  outline: none;
  transform: translateY(-1px);
}

.mailbox-preview-item.unread {
  border-color: rgba(7, 143, 128, 0.28) !important;
  background:
    radial-gradient(ellipse at 16% 0%, rgba(255, 255, 255, 0.98), transparent 36%),
    linear-gradient(145deg, rgba(221, 250, 243, 0.94), rgba(255, 251, 232, 0.54)),
    rgba(255, 255, 255, 0.84) !important;
  box-shadow:
    inset 4px 0 0 rgba(7, 143, 128, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 12px 26px rgba(7, 143, 128, 0.1) !important;
}

.mailbox-preview-item.unread::before {
  background: var(--mailbox-preview-mint);
  box-shadow: 0 0 0 5px rgba(36, 201, 174, 0.14);
}

.mailbox-preview-item span,
.mailbox-type {
  width: fit-content;
  border: 1px solid rgba(7, 143, 128, 0.12);
  border-radius: 999px;
  padding: 5px 10px;
  background:
    linear-gradient(145deg, rgba(218, 248, 242, 0.92), rgba(255, 255, 255, 0.62)),
    rgba(7, 143, 128, 0.08);
  color: var(--mailbox-preview-teal) !important;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.mailbox-preview-item strong {
  max-width: calc(100% - 18px);
  color: var(--mailbox-preview-ink);
  font-size: 19px;
  font-weight: 950;
  line-height: 1.22;
}

.mailbox-preview-item small {
  color: var(--mailbox-preview-soft) !important;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.42;
}

.mailbox-preview-item em {
  color: var(--mailbox-preview-muted) !important;
  font-size: 16px;
  font-style: italic;
  font-weight: 720;
  line-height: 1.1;
}

.mailbox-preview-list .empty-state.compact {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 20px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(236, 250, 246, 0.58)),
    rgba(255, 255, 255, 0.68);
  color: var(--mailbox-preview-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.mailbox-popover-actions {
  gap: 10px;
  padding: 10px 2px 2px;
  border-top: 1px solid rgba(17, 102, 92, 0.1);
}

.mailbox-popover-actions button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.86) !important;
  border-radius: 14px;
  padding: 0 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(234, 250, 246, 0.68)),
    rgba(255, 255, 255, 0.74) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 8px 16px rgba(12, 67, 62, 0.07);
  color: var(--mailbox-preview-ink) !important;
  font-size: 15px;
  font-weight: 850;
}

.mailbox-popover-actions button:not(.secondary) {
  min-width: 98px;
  background:
    linear-gradient(180deg, #2bd3b4, #078f80 58%, #056b66),
    var(--mailbox-preview-teal) !important;
  color: #fffdf4 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 10px 22px rgba(7, 143, 128, 0.2);
}

.mailbox-popover-actions button:disabled {
  border-color: rgba(17, 102, 92, 0.08) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(232, 242, 238, 0.48)),
    rgba(255, 255, 255, 0.5) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: rgba(72, 107, 101, 0.48) !important;
}

@media (max-width: 640px) {
  .global-mailbox-anchor .mailbox-popover,
  .mailbox-popover {
    position: fixed;
    top: calc(var(--global-topbar-height) + 8px);
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 22px);
    border-radius: 24px;
  }

  .mailbox-preview-item {
    min-height: 104px;
    padding: 13px 14px;
  }

  .mailbox-preview-item strong {
    font-size: 17px;
  }

  .mailbox-preview-item small,
  .mailbox-preview-item em {
    font-size: 14px;
  }
}

/* Mailbox modal redo v1: full archive in clear iOS 27 liquid glass. */
#mailboxModalHost .mailbox-modal-backdrop {
  padding: 22px;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(35, 200, 173, 0.22), transparent 36%),
    radial-gradient(ellipse at 88% 10%, rgba(244, 194, 82, 0.14), transparent 34%),
    radial-gradient(ellipse at 48% 108%, rgba(126, 202, 218, 0.16), transparent 44%),
    linear-gradient(180deg, rgba(246, 255, 252, 0.72), rgba(228, 243, 239, 0.8)),
    rgba(232, 246, 242, 0.76) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.2) contrast(1.03);
  backdrop-filter: blur(18px) saturate(1.2) contrast(1.03);
}

#mailboxModalHost .mailbox-modal-shell {
  --mailbox-modal-ink: #082f2d;
  --mailbox-modal-soft: #486b65;
  --mailbox-modal-muted: #6b8780;
  --mailbox-modal-line: rgba(17, 102, 92, 0.12);
  --mailbox-modal-line-strong: rgba(255, 255, 255, 0.9);
  --mailbox-modal-panel: rgba(255, 255, 255, 0.86);
  --mailbox-modal-teal: #078f80;
  --mailbox-modal-mint: #24c9ae;
  --mailbox-modal-gold: #a77918;
  --mailbox-modal-danger: #b83c4a;
  width: min(1500px, calc(100vw - 44px));
  height: min(884px, calc(100dvh - 44px));
  border: 1px solid var(--mailbox-modal-line-strong) !important;
  border-radius: 34px;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(255, 255, 255, 0.96), transparent 34%),
    radial-gradient(ellipse at 96% 0%, rgba(35, 200, 173, 0.16), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(237, 251, 247, 0.74)),
    rgba(249, 255, 252, 0.86) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(17, 102, 92, 0.06),
    0 38px 92px rgba(12, 54, 51, 0.22) !important;
  color: var(--mailbox-modal-ink);
  -webkit-backdrop-filter: blur(16px) saturate(1.16) contrast(1.04);
  backdrop-filter: blur(16px) saturate(1.16) contrast(1.04);
}

#mailboxModalHost .mailbox-modal-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(116deg, rgba(255, 255, 255, 0.56), transparent 24% 64%, rgba(255, 255, 255, 0.24)),
    repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 86px);
  opacity: 0.68;
}

#mailboxModalHost .mailbox-modal-shell > * {
  position: relative;
  z-index: 1;
}

#mailboxModalHost .mailbox-modal-close {
  top: 20px;
  right: 20px;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.92) !important;
  border-radius: 20px;
  background:
    radial-gradient(circle at 35% 16%, rgba(255, 255, 255, 0.98), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(232, 249, 245, 0.58)),
    rgba(255, 255, 255, 0.66) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 12px 24px rgba(12, 67, 62, 0.12);
  color: var(--mailbox-modal-ink) !important;
  font-size: 30px;
  font-weight: 800;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

#mailboxModalHost .mailbox-modal-close:hover,
#mailboxModalHost .mailbox-modal-close:focus-visible {
  background:
    radial-gradient(circle at 35% 16%, rgba(255, 255, 255, 1), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(220, 248, 242, 0.7)),
    rgba(255, 255, 255, 0.82) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 16px 30px rgba(12, 67, 62, 0.16);
  outline: none;
  transform: translateY(-1px);
}

#mailboxModalHost .mailbox-modal-head {
  min-height: 172px;
  padding: 34px 104px 28px 34px;
  border-bottom: 1px solid var(--mailbox-modal-line);
  background:
    radial-gradient(ellipse at 8% 0%, rgba(255, 255, 255, 0.96), transparent 38%),
    radial-gradient(ellipse at 95% 0%, rgba(36, 201, 174, 0.2), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(229, 249, 244, 0.64)),
    rgba(255, 255, 255, 0.72) !important;
  color: var(--mailbox-modal-ink);
}

#mailboxModalHost .mailbox-modal-head span,
#mailboxModalHost .mailbox-modal-toolbar span,
#mailboxModalHost .mailbox-modal-detail-kicker,
#mailboxModalHost .mailbox-action-confirm span,
#mailboxModalHost .mailbox-modal-detail-empty span {
  color: var(--mailbox-modal-teal) !important;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.16em;
}

#mailboxModalHost .mailbox-modal-head h2 {
  color: var(--mailbox-modal-ink) !important;
  font-size: clamp(44px, 5vw, 74px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.94;
}

#mailboxModalHost .mailbox-modal-summary {
  min-width: 150px;
  padding: 17px 18px;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(232, 250, 246, 0.68)),
    rgba(255, 255, 255, 0.72) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 14px 28px rgba(12, 67, 62, 0.1);
}

#mailboxModalHost .mailbox-modal-summary strong {
  color: var(--mailbox-modal-ink) !important;
  font-size: 48px;
  font-weight: 950;
}

#mailboxModalHost .mailbox-modal-summary span,
#mailboxModalHost .mailbox-modal-stats span {
  color: var(--mailbox-modal-soft) !important;
}

#mailboxModalHost .mailbox-modal-stats {
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--mailbox-modal-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(237, 251, 247, 0.44)),
    rgba(255, 255, 255, 0.48) !important;
}

#mailboxModalHost .mailbox-modal-stats div {
  min-height: 78px;
  border: 1px solid rgba(17, 102, 92, 0.1) !important;
  border-radius: 20px;
  padding: 15px 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(236, 251, 247, 0.62)),
    rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#mailboxModalHost .mailbox-modal-stats strong {
  color: var(--mailbox-modal-ink) !important;
  font-size: 32px;
  font-weight: 950;
}

#mailboxModalHost .mailbox-modal-body {
  grid-template-columns: 204px minmax(0, 1fr) 520px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), rgba(233, 249, 245, 0.34)),
    rgba(255, 255, 255, 0.28);
}

#mailboxModalHost .mailbox-modal-rail,
#mailboxModalHost .mailbox-modal-main,
#mailboxModalHost .mailbox-modal-detail {
  border-color: var(--mailbox-modal-line) !important;
}

#mailboxModalHost .mailbox-modal-rail,
#mailboxModalHost .mailbox-modal-list,
#mailboxModalHost .mailbox-modal-detail {
  scrollbar-width: thin;
  scrollbar-color: rgba(7, 143, 128, 0.42) rgba(17, 102, 92, 0.08);
}

#mailboxModalHost .mailbox-modal-rail::-webkit-scrollbar,
#mailboxModalHost .mailbox-modal-list::-webkit-scrollbar,
#mailboxModalHost .mailbox-modal-detail::-webkit-scrollbar {
  width: 8px;
}

#mailboxModalHost .mailbox-modal-rail::-webkit-scrollbar-track,
#mailboxModalHost .mailbox-modal-list::-webkit-scrollbar-track,
#mailboxModalHost .mailbox-modal-detail::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(17, 102, 92, 0.08);
}

#mailboxModalHost .mailbox-modal-rail::-webkit-scrollbar-thumb,
#mailboxModalHost .mailbox-modal-list::-webkit-scrollbar-thumb,
#mailboxModalHost .mailbox-modal-detail::-webkit-scrollbar-thumb {
  border: 2px solid rgba(242, 253, 249, 0.84);
  border-radius: 999px;
  background: rgba(7, 143, 128, 0.42);
}

#mailboxModalHost .mailbox-modal-category,
#mailboxModalHost .mailbox-modal-item,
#mailboxModalHost .mailbox-modal-dossier,
#mailboxModalHost .mailbox-modal-detail-empty,
#mailboxModalHost .mailbox-action-confirm {
  border: 1px solid rgba(255, 255, 255, 0.84) !important;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, 0.95), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(239, 252, 248, 0.62)),
    rgba(255, 255, 255, 0.72) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 22px rgba(12, 67, 62, 0.06);
  color: var(--mailbox-modal-ink) !important;
}

#mailboxModalHost .mailbox-modal-category {
  min-height: 66px;
  border-radius: 16px;
  padding: 12px 14px;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

#mailboxModalHost .mailbox-modal-category:hover,
#mailboxModalHost .mailbox-modal-category:focus-visible {
  border-color: rgba(7, 143, 128, 0.22) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(223, 249, 244, 0.72)),
    rgba(255, 255, 255, 0.86) !important;
  outline: none;
  transform: translateY(-1px);
}

#mailboxModalHost .mailbox-modal-category.active {
  border-color: rgba(7, 143, 128, 0.42) !important;
  background:
    linear-gradient(145deg, rgba(218, 248, 242, 0.96), rgba(255, 251, 232, 0.62)),
    rgba(255, 255, 255, 0.88) !important;
  box-shadow:
    inset 4px 0 0 rgba(7, 143, 128, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 12px 26px rgba(7, 143, 128, 0.12) !important;
  color: var(--mailbox-modal-ink) !important;
}

#mailboxModalHost .mailbox-modal-category span,
#mailboxModalHost .mailbox-modal-category strong,
#mailboxModalHost .mailbox-modal-category.active strong {
  color: var(--mailbox-modal-ink) !important;
}

#mailboxModalHost .mailbox-modal-category em {
  background:
    linear-gradient(180deg, #ff7b83, #b83c4a),
    var(--mailbox-modal-danger) !important;
  box-shadow: 0 0 0 4px rgba(184, 60, 74, 0.12);
}

#mailboxModalHost .mailbox-modal-toolbar {
  min-height: 92px;
  border-bottom: 1px solid var(--mailbox-modal-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(237, 251, 247, 0.42)),
    rgba(255, 255, 255, 0.42);
}

#mailboxModalHost .mailbox-modal-toolbar strong {
  color: var(--mailbox-modal-ink) !important;
  font-size: 30px;
  font-weight: 950;
}

#mailboxModalHost .mailbox-modal-toolbar-actions button,
#mailboxModalHost .mailbox-modal-detail-actions button,
#mailboxModalHost .mailbox-action-confirm-actions button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.86) !important;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(234, 250, 246, 0.68)),
    rgba(255, 255, 255, 0.74) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 8px 16px rgba(12, 67, 62, 0.07);
  color: var(--mailbox-modal-ink) !important;
  font-weight: 850;
}

#mailboxModalHost .mailbox-modal-toolbar-actions .mailbox-filter-button.active,
#mailboxModalHost .mailbox-modal-toolbar-actions button:not(.secondary),
#mailboxModalHost .mailbox-modal-detail-actions button:not(.secondary),
#mailboxModalHost .mailbox-action-confirm-actions button:not(.secondary) {
  background:
    linear-gradient(180deg, #2bd3b4, #078f80 58%, #056b66),
    var(--mailbox-modal-teal) !important;
  color: #fffdf4 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 10px 22px rgba(7, 143, 128, 0.18);
}

#mailboxModalHost .mailbox-modal-toolbar-actions .danger,
#mailboxModalHost .mailbox-modal-detail-actions .danger,
#mailboxModalHost .mailbox-action-confirm-actions .danger,
#mailboxModalHost .mailbox-action-confirm .danger {
  border-color: rgba(184, 60, 74, 0.2) !important;
  background:
    linear-gradient(180deg, #e76f7b, #b83c4a),
    var(--mailbox-modal-danger) !important;
  color: #fffdf4 !important;
}

#mailboxModalHost .mailbox-modal-toolbar-actions button:disabled,
#mailboxModalHost .mailbox-modal-detail-actions button:disabled,
#mailboxModalHost .mailbox-action-confirm-actions button:disabled {
  border-color: rgba(17, 102, 92, 0.08) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(232, 242, 238, 0.48)),
    rgba(255, 255, 255, 0.5) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: rgba(72, 107, 101, 0.48) !important;
}

#mailboxModalHost .mailbox-modal-list {
  gap: 11px;
  padding: 16px 18px 24px;
  background:
    linear-gradient(180deg, rgba(250, 255, 253, 0.52), rgba(238, 250, 247, 0.34)),
    rgba(255, 255, 255, 0.2);
}

#mailboxModalHost .mailbox-modal-group {
  color: var(--mailbox-modal-teal) !important;
  font-size: 12px;
  font-weight: 950;
}

#mailboxModalHost .mailbox-modal-item {
  min-height: 112px;
  border-radius: 18px;
  padding: 15px 18px 15px 20px;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

#mailboxModalHost .mailbox-modal-item:hover,
#mailboxModalHost .mailbox-modal-item:focus-visible {
  border-color: rgba(7, 143, 128, 0.22) !important;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, 1), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(224, 249, 244, 0.74)),
    rgba(255, 255, 255, 0.86) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 14px 28px rgba(12, 67, 62, 0.1);
  outline: none;
  transform: translateY(-1px);
}

#mailboxModalHost .mailbox-modal-item::before {
  left: 8px;
  background: transparent;
}

#mailboxModalHost .mailbox-modal-item.unread::before {
  background: var(--mailbox-modal-mint) !important;
  box-shadow: 0 0 0 4px rgba(36, 201, 174, 0.12);
}

#mailboxModalHost .mailbox-modal-item.selected {
  border-color: rgba(7, 143, 128, 0.34) !important;
  background:
    radial-gradient(ellipse at 16% 0%, rgba(255, 255, 255, 0.98), transparent 36%),
    linear-gradient(145deg, rgba(220, 250, 244, 0.96), rgba(255, 251, 232, 0.58)),
    rgba(255, 255, 255, 0.84) !important;
  box-shadow:
    inset 4px 0 0 rgba(7, 143, 128, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 14px 30px rgba(7, 143, 128, 0.12) !important;
}

#mailboxModalHost .mailbox-modal-item-type,
#mailboxModalHost .mailbox-modal-detail-kicker {
  width: fit-content;
  border: 1px solid rgba(7, 143, 128, 0.12);
  border-radius: 999px;
  padding: 5px 10px;
  background:
    linear-gradient(145deg, rgba(218, 248, 242, 0.92), rgba(255, 255, 255, 0.62)),
    rgba(7, 143, 128, 0.08);
  color: var(--mailbox-modal-teal) !important;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

#mailboxModalHost .mailbox-modal-item strong,
#mailboxModalHost .mailbox-modal-detail h3,
#mailboxModalHost .mailbox-modal-detail-empty strong,
#mailboxModalHost .mailbox-action-confirm h3 {
  color: var(--mailbox-modal-ink) !important;
  font-weight: 950;
}

#mailboxModalHost .mailbox-modal-item small,
#mailboxModalHost .mailbox-modal-item time,
#mailboxModalHost .mailbox-modal-detail p,
#mailboxModalHost .mailbox-action-confirm p {
  color: var(--mailbox-modal-soft) !important;
}

#mailboxModalHost .mailbox-modal-detail {
  gap: 17px;
  padding: 24px;
  background:
    radial-gradient(ellipse at 95% 0%, rgba(35, 200, 173, 0.11), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(238, 250, 247, 0.36)),
    rgba(255, 255, 255, 0.28) !important;
}

#mailboxModalHost .mailbox-modal-detail h3 {
  font-size: clamp(30px, 2.4vw, 42px);
  line-height: 1.04;
}

#mailboxModalHost .mailbox-modal-detail p {
  font-size: 17px;
  line-height: 1.72;
}

#mailboxModalHost .mailbox-modal-dossier {
  overflow: hidden;
  border-radius: 20px;
}

#mailboxModalHost .mailbox-modal-dossier div {
  border-bottom-color: rgba(17, 102, 92, 0.1) !important;
  background: rgba(255, 255, 255, 0.28);
}

#mailboxModalHost .mailbox-modal-dossier dt {
  color: var(--mailbox-modal-soft) !important;
}

#mailboxModalHost .mailbox-modal-dossier dd {
  color: var(--mailbox-modal-ink) !important;
}

#mailboxModalHost .mailbox-action-confirm-layer {
  background:
    radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.44), transparent 34%),
    rgba(232, 246, 242, 0.5) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.18);
  backdrop-filter: blur(16px) saturate(1.18);
}

#mailboxModalHost .mailbox-action-confirm {
  border-radius: 26px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 26px 60px rgba(12, 54, 51, 0.2) !important;
}

@media (max-width: 1180px) {
  #mailboxModalHost .mailbox-modal-body {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  #mailboxModalHost .mailbox-modal-detail {
    grid-column: 1 / -1;
    max-height: 330px;
    border-top: 1px solid var(--mailbox-modal-line);
  }
}

@media (max-width: 760px) {
  #mailboxModalHost .mailbox-modal-backdrop {
    padding: 10px;
  }

  #mailboxModalHost .mailbox-modal-shell {
    width: calc(100vw - 20px);
    height: calc(100dvh - 20px);
    border-radius: 26px;
  }

  #mailboxModalHost .mailbox-modal-head {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 22px 78px 18px 20px;
  }

  #mailboxModalHost .mailbox-modal-head h2 {
    font-size: clamp(34px, 11vw, 48px);
  }

  #mailboxModalHost .mailbox-modal-summary {
    justify-self: start;
    min-width: 126px;
    text-align: left;
  }

  #mailboxModalHost .mailbox-modal-stats {
    grid-template-columns: 1fr;
  }

  #mailboxModalHost .mailbox-modal-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  #mailboxModalHost .mailbox-modal-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--mailbox-modal-line);
  }

  #mailboxModalHost .mailbox-modal-category {
    min-width: 156px;
  }

  #mailboxModalHost .mailbox-modal-main {
    border-right: 0;
  }

  #mailboxModalHost .mailbox-modal-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #mailboxModalHost .mailbox-modal-toolbar-actions {
    justify-content: flex-start;
  }

  #mailboxModalHost .mailbox-modal-item {
    grid-template-columns: 1fr;
  }

  #mailboxModalHost .mailbox-modal-item time {
    grid-column: auto;
    grid-row: auto;
  }

  #mailboxModalHost .mailbox-modal-detail {
    max-height: none;
  }
}

/* Mailbox modal cleanup v1: remove leaked counters and lock controls. */
#mailboxModalHost .mailbox-modal-shell {
  grid-template-rows: auto minmax(0, 1fr) !important;
  isolation: isolate;
}

#mailboxModalHost .mailbox-modal-shell > .mailbox-modal-close {
  position: absolute !important;
  top: 22px !important;
  right: 22px !important;
  left: auto !important;
  z-index: 8 !important;
  width: 54px !important;
  min-width: 54px !important;
  height: 54px !important;
  min-height: 54px !important;
  overflow: hidden;
  line-height: 1 !important;
  transform: none !important;
}

#mailboxModalHost .mailbox-modal-stats {
  display: none !important;
}

#mailboxModalHost .mailbox-modal-body {
  border-top: 1px solid rgba(17, 102, 92, 0.1);
}

#mailboxModalHost .mailbox-modal-category {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center;
}

#mailboxModalHost .mailbox-modal-category::before,
#mailboxModalHost .mailbox-modal-category::after {
  content: none !important;
  display: none !important;
}

#mailboxModalHost .mailbox-modal-category span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#mailboxModalHost .mailbox-modal-category strong {
  position: static !important;
  display: block !important;
  min-width: 34px;
  max-width: 48px;
  overflow: hidden;
  color: var(--mailbox-modal-ink) !important;
  font-size: 18px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  opacity: 1 !important;
  text-align: right;
  transform: none !important;
  white-space: nowrap;
}

#mailboxModalHost .mailbox-modal-category.active strong {
  color: var(--mailbox-modal-ink) !important;
}

#mailboxModalHost .mailbox-modal-category em {
  z-index: 2;
}

#mailboxModalHost .mailbox-modal-toolbar {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(237, 251, 247, 0.5)),
    rgba(255, 255, 255, 0.52) !important;
}

#mailboxModalHost .mailbox-modal-toolbar::before,
#mailboxModalHost .mailbox-modal-toolbar::after {
  content: none !important;
  display: none !important;
}

#mailboxModalHost .mailbox-modal-toolbar > div:first-child {
  min-width: 0;
}

#mailboxModalHost .mailbox-modal-toolbar-actions {
  position: relative;
  z-index: 2;
  align-items: center;
}

#mailboxModalHost .mailbox-modal-toolbar-actions .mailbox-filter-button span {
  position: static !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 0 7px;
  background: rgba(255, 255, 255, 0.44) !important;
  color: inherit !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  opacity: 1 !important;
  transform: none !important;
}

#mailboxModalHost .mailbox-modal-toolbar-actions .mailbox-filter-button.active span {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #fffdf4 !important;
}

@media (max-width: 760px) {
  #mailboxModalHost .mailbox-modal-shell > .mailbox-modal-close {
    top: 16px !important;
    right: 16px !important;
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
  }
}

/* Leaderboard unified iOS 27 liquid-glass pass. */
body[data-page="leaderboard"] {
  --leaderboard-terminal-bg: #f2faf7;
  --leaderboard-terminal-panel: rgba(255, 255, 255, 0.58);
  --leaderboard-terminal-panel-strong: rgba(255, 255, 255, 0.78);
  --leaderboard-terminal-line: rgba(255, 255, 255, 0.72);
  --leaderboard-terminal-line-soft: rgba(30, 83, 82, 0.1);
  --leaderboard-terminal-ink: #103634;
  --leaderboard-terminal-muted: rgba(28, 61, 59, 0.64);
  --leaderboard-terminal-dim: rgba(28, 61, 59, 0.46);
  --leaderboard-terminal-blue: #2d8bc5;
  --leaderboard-terminal-blue-soft: rgba(45, 139, 197, 0.14);
  --leaderboard-terminal-teal: #0c8e82;
  --leaderboard-terminal-teal-bright: #25c6ad;
  --leaderboard-terminal-gold: #bd8a1f;
  --leaderboard-terminal-copper: #a56546;
  background:
    radial-gradient(ellipse at 14% -6%, rgba(37, 198, 173, 0.24), transparent 38%),
    radial-gradient(ellipse at 84% 0%, rgba(240, 198, 96, 0.2), transparent 34%),
    radial-gradient(ellipse at 55% 112%, rgba(112, 187, 217, 0.16), transparent 46%),
    linear-gradient(180deg, #fbfffc 0%, #eef8f5 48%, #e5f1ee 100%) !important;
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .app {
  max-width: none;
  background: transparent;
  padding: calc(var(--global-topbar-height, 102px) + 18px) clamp(14px, 2.6vw, 34px) calc(var(--global-bottom-nav-reserve, 96px) + 30px);
}

body[data-page="leaderboard"] #leaderboardPage > section {
  width: min(100%, 1840px);
  padding: 0;
}

body[data-page="leaderboard"] #leaderboardPage > section > h2 {
  display: none;
}

body[data-page="leaderboard"] .leaderboard-terminal {
  position: relative;
  isolation: isolate;
  width: min(100%, 1780px);
  min-height: min(1040px, calc(100dvh - var(--global-topbar-height, 102px) - var(--global-bottom-nav-reserve, 96px) - 56px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 38px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.96), transparent 30%),
    radial-gradient(circle at 92% 8%, rgba(238, 202, 112, 0.18), transparent 34%),
    radial-gradient(circle at 28% 100%, rgba(67, 184, 181, 0.14), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(230, 249, 246, 0.66) 54%, rgba(255, 250, 233, 0.62)),
    rgba(250, 255, 252, 0.58);
  box-shadow:
    0 38px 100px rgba(37, 72, 67, 0.2),
    0 16px 38px rgba(255, 255, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(41, 105, 99, 0.1);
  -webkit-backdrop-filter: blur(34px) saturate(1.34);
  backdrop-filter: blur(34px) saturate(1.34);
}

body[data-page="leaderboard"] .leaderboard-terminal::before,
body[data-page="leaderboard"] .leaderboard-terminal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

body[data-page="leaderboard"] .leaderboard-terminal::before {
  z-index: 0;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.64), transparent 24% 64%, rgba(255, 255, 255, 0.28)),
    repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 88px);
  opacity: 0.7;
}

body[data-page="leaderboard"] .leaderboard-terminal::after {
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 18%, rgba(255, 255, 255, 0.42), transparent 24%),
    radial-gradient(ellipse at 76% 76%, rgba(12, 142, 130, 0.11), transparent 34%);
  mix-blend-mode: soft-light;
}

body[data-page="leaderboard"] .leaderboard-terminal > * {
  position: relative;
  z-index: 1;
}

body[data-page="leaderboard"] .leaderboard-terminal-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(1160px, calc(100% - 64px));
  min-height: 74px;
  margin: 18px auto 0;
  padding: 7px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(232, 248, 245, 0.56)),
    rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 16px 34px rgba(34, 77, 72, 0.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  backdrop-filter: blur(22px) saturate(1.2);
}

body[data-page="leaderboard"] .leaderboard-terminal-tab,
body[data-page="leaderboard"] .leaderboard-terminal-tab:last-child {
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(30, 61, 58, 0.68);
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

body[data-page="leaderboard"] .leaderboard-terminal-tab strong {
  color: inherit;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: none;
}

body[data-page="leaderboard"] .leaderboard-terminal-tab small {
  color: rgba(30, 61, 58, 0.48);
  font-size: 12px;
  font-weight: 850;
}

body[data-page="leaderboard"] .leaderboard-terminal-tab:hover,
body[data-page="leaderboard"] .leaderboard-terminal-tab:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(237, 249, 247, 0.48)),
    rgba(255, 255, 255, 0.4);
  color: var(--leaderboard-terminal-ink);
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="leaderboard"] .leaderboard-terminal-tab.selected {
  background:
    linear-gradient(180deg, #25c6ad, #0c8e82 58%, #08746e),
    var(--leaderboard-terminal-teal);
  color: #fffdf5;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -12px 22px rgba(0, 92, 86, 0.18),
    0 14px 28px rgba(8, 126, 116, 0.22);
}

body[data-page="leaderboard"] .leaderboard-terminal-tab.selected small {
  color: rgba(255, 253, 245, 0.76);
}

body[data-page="leaderboard"] .leaderboard-terminal-toolbar {
  align-items: flex-end;
  padding: 26px 32px 24px;
  border-bottom: 1px solid rgba(43, 91, 86, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(236, 249, 246, 0.24)),
    rgba(255, 255, 255, 0.16);
}

body[data-page="leaderboard"] .leaderboard-terminal-kicker {
  margin-bottom: 7px;
  color: var(--leaderboard-terminal-gold);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="leaderboard"] .leaderboard-terminal-toolbar h2 {
  color: var(--leaderboard-terminal-ink);
  font-size: 36px;
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

body[data-page="leaderboard"] .leaderboard-terminal-toolbar p {
  max-width: 680px;
  color: var(--leaderboard-terminal-muted);
  font-size: 15px;
  line-height: 1.45;
}

body[data-page="leaderboard"] .leaderboard-terminal-actions {
  gap: 10px;
}

body[data-page="leaderboard"] .leaderboard-terminal-actions button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(236, 248, 246, 0.5)),
    rgba(255, 255, 255, 0.48);
  color: rgba(19, 52, 49, 0.7);
  font-size: 14px;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 22px rgba(33, 79, 73, 0.1);
}

body[data-page="leaderboard"] .leaderboard-terminal-actions button:hover:not(:disabled),
body[data-page="leaderboard"] .leaderboard-terminal-actions button:focus-visible {
  border-color: rgba(12, 142, 130, 0.28);
  color: var(--leaderboard-terminal-teal);
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="leaderboard"] .leaderboard-terminal-actions button:disabled {
  opacity: 0.62;
}

body[data-page="leaderboard"] .leaderboard-terminal-body {
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(247, 255, 252, 0.3), rgba(255, 249, 232, 0.18)),
    transparent;
}

body[data-page="leaderboard"] .leaderboard-terminal-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
  gap: 18px;
}

body[data-page="leaderboard"] .leaderboard-terminal-main,
body[data-page="leaderboard"] .leaderboard-terminal-side {
  gap: 18px;
}

body[data-page="leaderboard"] .leaderboard-terminal-main > .leaderboard-terminal-panel:first-child {
  min-height: clamp(430px, 46dvh, 560px);
}

body[data-page="leaderboard"] .leaderboard-terminal-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.64), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(232, 249, 245, 0.46)),
    rgba(255, 255, 255, 0.42);
  color: var(--leaderboard-terminal-ink);
  box-shadow:
    0 20px 46px rgba(35, 75, 70, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(40, 94, 88, 0.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.18);
  backdrop-filter: blur(24px) saturate(1.18);
}

body[data-page="leaderboard"] .leaderboard-terminal-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.44), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(240, 198, 96, 0.08), transparent 30%);
  pointer-events: none;
}

body[data-page="leaderboard"] .leaderboard-terminal-panel > * {
  position: relative;
  z-index: 1;
}

body[data-page="leaderboard"] .leaderboard-table-head {
  min-height: 76px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(35, 84, 80, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(240, 250, 248, 0.32)),
    rgba(255, 255, 255, 0.22);
}

body[data-page="leaderboard"] .leaderboard-table-head h3 {
  color: var(--leaderboard-terminal-ink);
  font-size: 23px;
  font-weight: 950;
  line-height: 1.08;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="leaderboard"] .leaderboard-table-head p {
  color: var(--leaderboard-terminal-muted);
  font-size: 13px;
  line-height: 1.4;
}

body[data-page="leaderboard"] .leaderboard-table-head span {
  color: var(--leaderboard-terminal-teal);
  font-size: 13px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-terminal-table {
  overflow-x: auto;
  background: transparent;
}

body[data-page="leaderboard"] .leaderboard-table-row {
  min-height: 64px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(35, 84, 80, 0.08);
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-table-row:hover:not(.leaderboard-table-labels) {
  background:
    linear-gradient(90deg, rgba(12, 142, 130, 0.12), rgba(255, 255, 255, 0.3)),
    rgba(255, 255, 255, 0.24);
}

body[data-page="leaderboard"] .leaderboard-table-row.leaderboard-table-labels {
  min-height: 46px;
  color: rgba(28, 61, 59, 0.46);
  font-size: 12px;
  font-weight: 950;
  text-transform: none;
}

body[data-page="leaderboard"] .leaderboard-table-row strong {
  color: var(--leaderboard-terminal-ink);
  font-size: 17px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-table-row span,
body[data-page="leaderboard"] .leaderboard-table-row em {
  color: rgba(16, 54, 52, 0.74);
}

body[data-page="leaderboard"] .leaderboard-table-rank {
  align-self: center;
  color: #1b5b56 !important;
  font-size: 20px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-rank-badge {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #fffdf5 !important;
  isolation: isolate;
  line-height: 1;
}

body[data-page="leaderboard"] .leaderboard-rank-badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 7px 10px rgba(45, 66, 65, 0.18));
}

body[data-page="leaderboard"] .leaderboard-rank-badge b {
  position: absolute;
  right: 0;
  bottom: 1px;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid rgba(255, 255, 246, 0.96);
  border-radius: 999px;
  background: var(--leaderboard-terminal-teal);
  box-shadow:
    0 4px 10px rgba(22, 56, 54, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  color: #fffdf5;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="leaderboard"] .leaderboard-rank-badge.rank-1 b {
  background: #b88b24;
}

body[data-page="leaderboard"] .leaderboard-rank-badge.rank-2 b {
  background: #6b7a82;
}

body[data-page="leaderboard"] .leaderboard-rank-badge.rank-3 b {
  background: #a1603c;
}

body[data-page="leaderboard"] .leaderboard-rank-badge.flag b {
  right: -1px;
  bottom: 2px;
  background: #078f84;
}

body[data-page="leaderboard"] .leaderboard-rank-badge.plain,
body[data-page="leaderboard"] .leaderboard-rank-badge.rank-empty {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
}

body[data-page="leaderboard"] .leaderboard-rank-badge.plain b,
body[data-page="leaderboard"] .leaderboard-rank-badge.rank-empty b {
  position: static;
  min-width: 34px;
  height: 28px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--leaderboard-terminal-ink);
  font-size: 15px;
}

body[data-page="leaderboard"] .leaderboard-table-rank.leaderboard-rank-badge {
  width: 50px;
  height: 50px;
  justify-self: center;
}

body[data-page="leaderboard"] .leaderboard-terminal-table.compact .leaderboard-table-rank.leaderboard-rank-badge {
  width: 42px;
  height: 42px;
}

body[data-page="leaderboard"] .leaderboard-self-rank-summary {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

body[data-page="leaderboard"] .leaderboard-self-rank-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body[data-page="leaderboard"] .leaderboard-self-rank-badge {
  width: 38px;
  height: 38px;
}

body[data-page="leaderboard"] .leaderboard-self-rank-badge b {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-size: 10px;
}

body[data-page="leaderboard"] .leaderboard-table-row.rank-gold .leaderboard-table-rank {
  color: #b98512 !important;
}

body[data-page="leaderboard"] .leaderboard-table-row.rank-silver .leaderboard-table-rank {
  color: #6d7d82 !important;
}

body[data-page="leaderboard"] .leaderboard-table-row.rank-bronze .leaderboard-table-rank {
  color: var(--leaderboard-terminal-copper) !important;
}

body[data-page="leaderboard"] .leaderboard-name-cell {
  gap: 12px;
}

body[data-page="leaderboard"] button.leaderboard-name-cell {
  border-radius: 18px;
}

body[data-page="leaderboard"] button.leaderboard-name-cell:hover,
body[data-page="leaderboard"] button.leaderboard-name-cell:focus-visible {
  background: rgba(255, 255, 255, 0.34);
  outline: 0;
}

body[data-page="leaderboard"] .leaderboard-emblem {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  color: #fffdf5;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 10px 20px rgba(33, 77, 72, 0.12);
}

body[data-page="leaderboard"] .leaderboard-name-copy b {
  color: #126d96;
  font-size: 15px;
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-name-copy small {
  color: rgba(28, 61, 59, 0.46);
  font-weight: 850;
}

body[data-page="leaderboard"] .leaderboard-terminal-self,
body[data-page="leaderboard"] .leaderboard-terminal-table .leaderboard-self {
  min-height: 68px;
  border-top: 1px solid rgba(12, 142, 130, 0.22);
  background:
    linear-gradient(100deg, rgba(45, 139, 197, 0.18), rgba(255, 255, 255, 0.62) 54%, rgba(12, 142, 130, 0.14)),
    rgba(232, 249, 246, 0.52);
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-terminal-self b,
body[data-page="leaderboard"] .leaderboard-terminal-self strong {
  color: var(--leaderboard-terminal-ink);
  font-weight: 950;
}

body[data-page="leaderboard"] .leaderboard-terminal-self small,
body[data-page="leaderboard"] .leaderboard-terminal-self em {
  color: rgba(16, 54, 52, 0.64);
}

body[data-page="leaderboard"] .leaderboard-dossier-panel {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.74), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(228, 247, 244, 0.54)),
    rgba(255, 255, 255, 0.5);
}

body[data-page="leaderboard"] .leaderboard-dossier-grid {
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(35, 84, 80, 0.08);
  border-radius: 18px;
  background: rgba(35, 84, 80, 0.08);
}

body[data-page="leaderboard"] .leaderboard-dossier-grid div {
  min-height: 100px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(242, 251, 249, 0.42)),
    rgba(255, 255, 255, 0.28);
}

body[data-page="leaderboard"] .leaderboard-dossier-grid span,
body[data-page="leaderboard"] .leaderboard-dossier-honor span {
  color: var(--leaderboard-terminal-muted);
  font-size: 13px;
  font-weight: 900;
}

body[data-page="leaderboard"] .leaderboard-dossier-grid strong,
body[data-page="leaderboard"] .leaderboard-dossier-honor strong {
  color: var(--leaderboard-terminal-ink);
  font-size: 24px;
  font-weight: 950;
  line-height: 1.08;
}

body[data-page="leaderboard"] .leaderboard-dossier-grid small {
  color: var(--leaderboard-terminal-dim);
  font-weight: 850;
}

body[data-page="leaderboard"] .leaderboard-dossier-honor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 18px 20px;
  border-top: 1px solid rgba(35, 84, 80, 0.08);
  background:
    linear-gradient(90deg, rgba(255, 247, 222, 0.66), rgba(255, 255, 255, 0.28)),
    rgba(255, 250, 232, 0.42);
}

body[data-page="leaderboard"] .leaderboard-dossier-honor.has-honor {
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
}

body[data-page="leaderboard"] .leaderboard-dossier-honor-rank {
  grid-row: span 2;
  width: 52px;
  height: 52px;
}

body[data-page="leaderboard"] .leaderboard-industry-matrix {
  gap: 18px;
}

body[data-page="leaderboard"] .leaderboard-industry-panel {
  display: flex;
  flex-direction: column;
  min-height: 258px;
  border-color: var(--industry-border, rgba(255, 255, 255, 0.78));
}

body[data-page="leaderboard"] .leaderboard-industry-table-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 96px;
  padding: 18px 20px;
}

body[data-page="leaderboard"] .leaderboard-industry-card-icon {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--industry-border, rgba(255, 255, 255, 0.78));
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), var(--industry-soft, rgba(12, 142, 130, 0.16))),
    rgba(255, 255, 255, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -12px 22px rgba(18, 91, 84, 0.08),
    0 14px 28px rgba(35, 75, 70, 0.13);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

body[data-page="leaderboard"] .leaderboard-industry-card-icon .technology-industry-icon {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
}

body[data-page="leaderboard"] .leaderboard-industry-card-title {
  min-width: 0;
  display: grid;
  gap: 5px;
}

body[data-page="leaderboard"] .leaderboard-industry-card-title h3 {
  color: var(--industry-ink, var(--leaderboard-terminal-ink));
}

body[data-page="leaderboard"] .leaderboard-industry-card-title p {
  color: color-mix(in srgb, var(--industry-ink, #103634) 62%, rgba(255, 255, 255, 0.2));
}

body[data-page="leaderboard"] .leaderboard-terminal-table.industry {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-x: auto;
  overflow-y: visible;
}

body[data-page="leaderboard"] .leaderboard-terminal-table.industry .leaderboard-table-row {
  flex: 0 0 auto;
}

body[data-page="leaderboard"] .empty-state {
  border: 1px solid rgba(35, 84, 80, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(241, 250, 248, 0.36)),
    rgba(255, 255, 255, 0.32);
  color: var(--leaderboard-terminal-muted);
}

body[data-page="leaderboard"] .leaderboard-terminal-table.industry .empty-state {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 54px;
  margin: 12px 14px;
}

body[data-page="leaderboard"] .leaderboard-terminal-table.industry .leaderboard-terminal-self,
body[data-page="leaderboard"] .leaderboard-terminal-table.industry .leaderboard-self {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(86px, auto) minmax(88px, auto);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  margin-top: auto;
  padding: 14px 20px;
  border: 0;
  border-top: 1px solid rgba(12, 142, 130, 0.16);
  border-radius: 0 0 28px 28px;
  background:
    linear-gradient(100deg, rgba(220, 246, 248, 0.72), rgba(255, 255, 255, 0.68) 46%, rgba(213, 244, 235, 0.64)),
    rgba(238, 251, 248, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(12, 142, 130, 0.08);
  color: var(--leaderboard-terminal-ink);
}

body[data-page="leaderboard"] .leaderboard-terminal-table.industry .leaderboard-terminal-self span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body[data-page="leaderboard"] .leaderboard-terminal-table.industry .leaderboard-terminal-self b {
  color: var(--leaderboard-terminal-ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.1;
}

body[data-page="leaderboard"] .leaderboard-terminal-table.industry .leaderboard-terminal-self small,
body[data-page="leaderboard"] .leaderboard-terminal-table.industry .leaderboard-terminal-self em {
  color: rgba(16, 54, 52, 0.62);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-terminal-table.industry .leaderboard-terminal-self strong {
  color: var(--leaderboard-terminal-ink);
  font-size: 16px;
  font-weight: 950;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
}

body[data-page="leaderboard"] .leaderboard-terminal-table.industry .leaderboard-terminal-self em {
  text-align: right;
}

@media (prefers-reduced-transparency: reduce) {
  body[data-page="leaderboard"] .leaderboard-terminal,
  body[data-page="leaderboard"] .leaderboard-terminal-tabs,
  body[data-page="leaderboard"] .leaderboard-terminal-panel {
    background: rgba(248, 253, 251, 0.96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 1180px) {
  body[data-page="leaderboard"] .leaderboard-terminal-layout {
    grid-template-columns: 1fr;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="leaderboard"] .leaderboard-terminal-side .leaderboard-dossier-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body[data-page="leaderboard"] .app {
    padding-inline: 12px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal {
    min-height: 0;
    border-radius: 26px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-tabs {
    width: calc(100% - 24px);
    min-height: 62px;
    margin-top: 12px;
    gap: 4px;
    padding: 5px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-tab {
    min-height: 50px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-tab strong {
    font-size: 14px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-tab small {
    display: none;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-toolbar h2 {
    font-size: 30px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-body {
    padding: 12px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-panel {
    border-radius: 22px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-side {
    grid-template-columns: 1fr;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-main > .leaderboard-terminal-panel:first-child {
    min-height: 0;
  }
}

body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-terminal-self-player {
  grid-template-columns: 76px minmax(220px, 1fr) 160px 96px 140px 116px;
  min-width: 900px;
}

body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-terminal-self-player > span:first-child {
  grid-column: 1 / 3;
}

body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-self-population,
body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-per-capita-gdp,
body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-terminal-self-player > em {
  text-align: right;
  white-space: nowrap;
}

/* Empty-plot detail tab: iOS 27-inspired liquid glass treatment. */
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body.detail {
  background:
    radial-gradient(ellipse at 18% 4%, rgba(255, 255, 255, 0.58), transparent 40%),
    radial-gradient(ellipse at 94% 14%, rgba(104, 222, 207, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(231, 248, 244, 0.18));
  scrollbar-color: rgba(35, 90, 82, 0.34) transparent;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-detail-tab {
  min-height: 0;
  padding: 18px;
  background: transparent;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-layout {
  min-height: min(690px, calc(100vh - 230px));
  display: grid;
  grid-template-columns: minmax(520px, 1.42fr) minmax(330px, 0.58fr);
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(238, 251, 247, 0.46) 48%, rgba(250, 252, 247, 0.58)),
    rgba(255, 255, 255, 0.44);
  color: #133a35;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(22, 86, 78, 0.07),
    0 24px 58px rgba(18, 86, 76, 0.14);
  overflow: hidden;
  -webkit-backdrop-filter: blur(24px) saturate(1.34);
  backdrop-filter: blur(24px) saturate(1.34);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-visual-pane {
  min-height: clamp(520px, calc(100vh - 260px), 760px);
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(22, 86, 78, 0.1);
  padding: 22px;
  background:
    radial-gradient(ellipse at 28% 14%, rgba(255, 255, 255, 0.58), transparent 38%),
    radial-gradient(ellipse at 78% 4%, rgba(88, 216, 198, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(235, 249, 245, 0.22));
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-visual {
  gap: 10px;
  width: min(100%, 680px);
  max-height: calc(100vh - 292px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.44), rgba(229, 248, 243, 0.22)),
    rgba(18, 52, 47, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 20px 44px rgba(16, 70, 62, 0.16);
  padding: 10px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-visual.layout-two {
  width: min(100%, 1040px);
  aspect-ratio: 16 / 9;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-visual.layout-three {
  width: min(100%, 1080px);
  aspect-ratio: 20 / 9;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-visual-stack {
  gap: 10px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-art {
  border-radius: 20px;
  background-size: cover;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 12px 24px rgba(15, 55, 49, 0.11);
  isolation: isolate;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-art::before {
  background:
    radial-gradient(circle at 42% 24%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(7, 42, 37, 0.08));
  mix-blend-mode: screen;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-art::after {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -42px 64px rgba(8, 34, 30, 0.12);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-art-chip {
  top: 16px;
  left: 16px;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon metric"
    "icon material";
  align-content: center;
  align-items: center;
  column-gap: 8px;
  row-gap: 1px;
  min-width: 174px;
  min-height: 68px;
  max-width: calc(100% - 32px);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(235, 251, 247, 0.52)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 14px 30px rgba(9, 42, 37, 0.2);
  color: #123b35;
  padding: 9px 14px 9px 10px;
  -webkit-backdrop-filter: blur(18px) saturate(1.32);
  backdrop-filter: blur(18px) saturate(1.32);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-art-chip span {
  align-self: center;
  justify-self: center;
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translateY(-1px);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-art-icon-image {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(8, 38, 34, 0.26));
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-art-chip strong {
  align-self: end;
  color: #113832;
  font-size: 15px;
  line-height: 1.08;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.64);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-art-chip em,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-art-chip small {
  color: rgba(24, 59, 53, 0.7);
  font-size: 12px;
  line-height: 1.14;
  text-shadow: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-art-chip em {
  align-self: start;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-art-chip small {
  align-self: start;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-side {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 14px;
  padding: 22px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.54), transparent 40%),
    linear-gradient(180deg, rgba(254, 251, 240, 0.5), rgba(237, 250, 246, 0.34));
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-section,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-refresh {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(237, 250, 246, 0.48)),
    rgba(255, 255, 255, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 12px 26px rgba(18, 86, 76, 0.08);
  padding: 16px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-section {
  gap: 8px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-section h3 {
  margin: 0 0 4px;
  color: #123b35;
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.68);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-section h3 span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(17, 133, 119, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  color: rgba(7, 143, 128, 0.78);
  font-size: 10px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-row {
  min-height: 46px;
  border: 1px solid rgba(22, 86, 78, 0.1);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(241, 252, 248, 0.44)),
    rgba(255, 255, 255, 0.38);
  color: rgba(22, 56, 51, 0.68);
  padding: 0 13px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-row-label {
  color: rgba(22, 56, 51, 0.66);
  font-size: 14px;
  font-weight: 900;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-row-label i {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(235, 249, 245, 0.44));
  color: rgba(7, 143, 128, 0.72);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-row strong {
  color: #102f2b;
  font-size: 16px;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.66);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-remaining {
  min-height: 0;
  align-content: start;
  gap: 10px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-row {
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 78px;
  gap: 12px;
  border: 1px solid rgba(22, 86, 78, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(239, 251, 247, 0.44)),
    rgba(255, 255, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 20px rgba(18, 86, 76, 0.06);
  padding: 11px 12px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-icon {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background:
    radial-gradient(circle at 38% 24%, rgba(255, 255, 255, 0.92), transparent 44%),
    linear-gradient(180deg, rgba(246, 254, 251, 0.88), rgba(217, 242, 236, 0.7));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 18px rgba(18, 86, 76, 0.1);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-icon-image {
  width: 34px;
  height: 34px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-title {
  gap: 7px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-title strong {
  color: #123b35;
  font-size: 15px;
  letter-spacing: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-title span {
  background: rgba(255, 255, 255, 0.58);
  color: rgba(24, 59, 53, 0.56);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-title em {
  color: #153833;
  font-size: 14px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-track {
  height: 7px;
  background: rgba(18, 86, 76, 0.1);
  box-shadow: inset 0 1px 2px rgba(16, 70, 62, 0.1);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-track span {
  background: linear-gradient(90deg, #18b99e, #72d7c6);
  box-shadow: 0 0 14px rgba(24, 185, 158, 0.22);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-row.resource-mineral .plot-remaining-track span {
  background: linear-gradient(90deg, #c79a35, #ead077);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-row.resource-liquid .plot-remaining-track span {
  background: linear-gradient(90deg, #4aa6c5, #9be1eb);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-row.resource-gas .plot-remaining-track span {
  background: linear-gradient(90deg, #7aa99e, #bde8dd);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-row.resource-oil .plot-remaining-track span {
  background: linear-gradient(90deg, #756a4a, #c6b577);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-remaining-empty {
  border-color: rgba(22, 86, 78, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  color: rgba(22, 56, 51, 0.56);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-refresh {
  display: grid;
  gap: 10px;
  border-top: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-refresh button {
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.34), transparent 54%),
    linear-gradient(180deg, #22c6a9, #0b8f82 52%, #08756d);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    inset 0 -14px 24px rgba(2, 70, 75, 0.18),
    0 14px 26px rgba(7, 143, 128, 0.22);
  font-size: 20px;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(2, 49, 55, 0.22);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-refresh button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-refresh button:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -14px 24px rgba(2, 70, 75, 0.18),
    0 16px 30px rgba(7, 143, 128, 0.28);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-refresh-cost-line {
  color: rgba(22, 56, 51, 0.66);
  font-size: 14px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.64);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-refresh-cost-line i {
  background: rgba(22, 86, 78, 0.2);
}

@media (max-width: 1120px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-layout {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-visual-pane {
    border-right: 0;
    border-bottom: 1px solid rgba(22, 86, 78, 0.1);
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-side {
    grid-template-rows: auto auto auto;
  }
}

@media (max-width: 640px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-detail-tab {
    padding: 12px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-layout {
    border-radius: 22px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-visual-pane,
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-side {
    padding: 14px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-visual.layout-two,
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-resource-visual.layout-three {
    grid-template-columns: 1fr;
    aspect-ratio: 4 / 5;
  }
}

@media (prefers-reduced-transparency: reduce) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-modal-body.detail,
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-layout,
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-section,
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .plot-detail-refresh {
    background: rgba(248, 253, 251, 0.96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Building plot detail: match the empty-plot detail resource badge/list alignment. */
body[data-page="island"] .building-plot-modal .plot-resource-art-chip {
  top: 16px;
  left: 16px;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon metric"
    "icon material";
  align-content: center;
  align-items: center;
  column-gap: 8px;
  row-gap: 1px;
  min-width: 174px;
  min-height: 68px;
  max-width: calc(100% - 32px);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(235, 251, 247, 0.52)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 14px 30px rgba(9, 42, 37, 0.2);
  color: #123b35;
  padding: 9px 14px 9px 10px;
  -webkit-backdrop-filter: blur(18px) saturate(1.32);
  backdrop-filter: blur(18px) saturate(1.32);
}

body[data-page="island"] .building-plot-modal .plot-resource-art-chip span {
  align-self: center;
  justify-self: center;
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translateY(-1px);
}

body[data-page="island"] .building-plot-modal .plot-resource-art-icon-image {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(8, 38, 34, 0.26));
}

body[data-page="island"] .building-plot-modal .plot-resource-art-chip strong {
  align-self: end;
  color: #113832;
  font-size: 15px;
  line-height: 1.08;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.64);
}

body[data-page="island"] .building-plot-modal .plot-resource-art-chip em,
body[data-page="island"] .building-plot-modal .plot-resource-art-chip small {
  align-self: start;
  color: rgba(24, 59, 53, 0.7);
  font-size: 12px;
  line-height: 1.14;
  text-shadow: none;
}

body[data-page="island"] .building-plot-modal .plot-remaining-row {
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 78px;
  gap: 12px;
  border: 1px solid rgba(22, 86, 78, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(239, 251, 247, 0.44)),
    rgba(255, 255, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 20px rgba(18, 86, 76, 0.06);
  padding: 11px 12px;
}

body[data-page="island"] .building-plot-modal .plot-remaining-icon {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background:
    radial-gradient(circle at 38% 24%, rgba(255, 255, 255, 0.92), transparent 44%),
    linear-gradient(180deg, rgba(246, 254, 251, 0.88), rgba(217, 242, 236, 0.7));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 18px rgba(18, 86, 76, 0.1);
}

body[data-page="island"] .building-plot-modal .plot-remaining-icon-image {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(18, 50, 45, 0.18));
}

body[data-page="island"] .building-plot-modal .plot-remaining-title {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 8px;
}

body[data-page="island"] .building-plot-modal .plot-remaining-title span {
  background: rgba(255, 255, 255, 0.58);
  color: rgba(24, 59, 53, 0.56);
  font-size: 11px;
}

body[data-page="island"] .building-plot-modal .plot-remaining-title em {
  grid-column: auto;
  color: #153833;
  font-size: 14px;
  letter-spacing: 0;
}

/* Plot detail rows: remove decorative glyphs that read like stray symbols. */
body[data-page="island"] .empty-plot-modal .plot-detail-section h3 span,
body[data-page="island"] .empty-plot-modal .plot-detail-row-label i {
  display: none;
}

/* Mailbox modal layer repair v1: keep archive header and close button above content. */
#mailboxModalHost .mailbox-modal-shell {
  display: grid !important;
  grid-template-rows: 164px minmax(0, 1fr) !important;
  isolation: isolate;
  overflow: hidden !important;
}

#mailboxModalHost .mailbox-modal-shell::before {
  z-index: 0 !important;
}

#mailboxModalHost .mailbox-modal-shell > .mailbox-modal-close {
  position: absolute !important;
  top: 28px !important;
  right: 28px !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 30 !important;
  display: grid !important;
  place-items: center !important;
  width: 56px !important;
  min-width: 56px !important;
  height: 56px !important;
  min-height: 56px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 1 !important;
  transform: none !important;
}

#mailboxModalHost .mailbox-modal-head {
  position: relative !important;
  z-index: 8 !important;
  grid-row: 1 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 22px !important;
  min-height: 164px !important;
  height: 164px !important;
  overflow: hidden !important;
  padding: 34px 116px 28px 36px !important;
}

#mailboxModalHost .mailbox-modal-head::before {
  content: "";
  position: absolute;
  inset: 0 290px 0 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.74) 36%, rgba(255, 255, 255, 0.28) 58%, rgba(225, 249, 244, 0.1) 100%),
    url("/assets/mailbox-concepts/national_communications_archive_hero_v1.png") center right / cover no-repeat;
  pointer-events: none;
}

#mailboxModalHost .mailbox-modal-head::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 4% 10%, rgba(255, 255, 255, 0.9), transparent 40%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.34), transparent 56%);
  pointer-events: none;
}

#mailboxModalHost .mailbox-modal-head > * {
  position: relative;
  z-index: 1;
}

#mailboxModalHost .mailbox-modal-head h2 {
  position: static !important;
  margin: 0 !important;
  max-width: 100% !important;
  overflow: hidden;
  color: var(--mailbox-modal-ink) !important;
  font-size: clamp(46px, 4.9vw, 76px) !important;
  font-weight: 950 !important;
  line-height: 1.08 !important;
  opacity: 1 !important;
  text-overflow: ellipsis;
  transform: none !important;
  white-space: nowrap;
}

#mailboxModalHost .mailbox-modal-head span {
  position: static !important;
  color: var(--mailbox-modal-teal) !important;
  opacity: 1 !important;
  transform: none !important;
}

#mailboxModalHost .mailbox-modal-summary {
  position: static !important;
  z-index: 9 !important;
  align-self: center !important;
  opacity: 1 !important;
  transform: none !important;
}

#mailboxModalHost .mailbox-modal-stats {
  display: none !important;
}

#mailboxModalHost .mailbox-modal-body {
  position: relative !important;
  z-index: 4 !important;
  grid-row: 2 !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden !important;
  border-top: 1px solid rgba(17, 102, 92, 0.1) !important;
}

#mailboxModalHost .mailbox-modal-rail,
#mailboxModalHost .mailbox-modal-main,
#mailboxModalHost .mailbox-modal-detail {
  min-height: 0 !important;
}

@media (max-width: 760px) {
  #mailboxModalHost .mailbox-modal-shell {
    grid-template-rows: 138px minmax(0, 1fr) !important;
  }

  #mailboxModalHost .mailbox-modal-shell > .mailbox-modal-close {
    top: 18px !important;
    right: 18px !important;
    width: 50px !important;
    min-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
  }

  #mailboxModalHost .mailbox-modal-head {
    min-height: 138px !important;
    height: 138px !important;
    padding: 24px 82px 22px 22px !important;
  }

  #mailboxModalHost .mailbox-modal-head::before {
    inset: 0;
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.76) 54%, rgba(229, 249, 244, 0.36) 100%),
      url("/assets/mailbox-concepts/national_communications_archive_hero_v1.png") center right / cover no-repeat;
  }

  #mailboxModalHost .mailbox-modal-head h2 {
    font-size: clamp(34px, 10vw, 46px) !important;
  }
}

/* Island plot/building segmented controls: align with the government iOS 27 pill navigation. */
body[data-page="island"] .building-plot-modal .empty-plot-tabs,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs {
  display: grid;
  align-items: center;
  gap: 6px;
  width: calc(100% - 48px);
  min-height: 66px;
  margin: 10px auto 16px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(235, 248, 245, 0.58) 56%, rgba(255, 252, 240, 0.52)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(28, 80, 72, 0.08),
    0 18px 42px rgba(28, 80, 72, 0.13);
  padding: 6px;
  -webkit-backdrop-filter: blur(24px) saturate(1.24);
  backdrop-filter: blur(24px) saturate(1.24);
}

body[data-page="island"] .building-plot-modal .empty-plot-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 760px;
}

body[data-page="island"] .building-plot-modal .empty-plot-tabs:has(> button:nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(640px, calc(100% - 96px));
  max-width: 640px;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 960px;
}

body[data-page="island"] .building-plot-modal .empty-plot-tabs button,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(33, 67, 62, 0.68);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  box-shadow: none;
  text-shadow: none;
  transform: none;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

body[data-page="island"] .building-plot-modal .empty-plot-tabs button:hover,
body[data-page="island"] .building-plot-modal .empty-plot-tabs button:focus-visible,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(238, 250, 247, 0.42)),
    rgba(255, 255, 255, 0.34);
  color: rgba(17, 52, 48, 0.9);
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .building-plot-modal .empty-plot-tabs button.selected,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button.selected {
  background:
    linear-gradient(180deg, #24c7ae, #0d9487 58%, #08766f),
    #0d9487;
  color: #fffdf6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -12px 24px rgba(0, 91, 84, 0.18),
    0 13px 28px rgba(8, 126, 116, 0.24);
  text-shadow: 0 1px 0 rgba(0, 65, 58, 0.16);
  transform: none;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  justify-self: center;
  gap: 6px;
  width: 100%;
  max-width: 620px;
  min-height: 58px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(235, 248, 245, 0.58) 56%, rgba(255, 252, 240, 0.52)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(28, 80, 72, 0.08),
    0 14px 30px rgba(28, 80, 72, 0.1);
  padding: 6px;
  -webkit-backdrop-filter: blur(22px) saturate(1.22);
  backdrop-filter: blur(22px) saturate(1.22);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button {
  min-width: 0;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(33, 67, 62, 0.68);
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
  box-shadow: none;
  text-shadow: none;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button:first-child {
  border-left: 0;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button:hover,
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(238, 250, 247, 0.42)),
    rgba(255, 255, 255, 0.34);
  color: rgba(17, 52, 48, 0.9);
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button.selected {
  background:
    linear-gradient(180deg, #24c7ae, #0d9487 58%, #08766f),
    #0d9487;
  color: #fffdf6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -10px 20px rgba(0, 91, 84, 0.18),
    0 11px 24px rgba(8, 126, 116, 0.22);
  transform: none;
}

@media (max-width: 760px) {
  body[data-page="island"] .building-plot-modal .empty-plot-tabs,
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs {
    width: calc(100% - 24px);
    min-height: 58px;
    margin-top: 8px;
    margin-bottom: 12px;
    gap: 4px;
    padding: 5px;
  }

  body[data-page="island"] .building-plot-modal .empty-plot-tabs button,
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs button {
    min-height: 48px;
    font-size: 14px;
  }

  body[data-page="island"] .building-plot-modal .empty-plot-tabs:has(> button:nth-child(3):last-child) {
    width: calc(100% - 40px);
    max-width: 560px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs {
    min-height: 52px;
    gap: 4px;
    padding: 5px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tier-tabs button {
    min-height: 42px;
    font-size: 14px;
  }
}

/* Keep building modals clear of the fixed global bottom navigation. */
body[data-page="island"] .empty-plot-modal.building-plot-modal {
  max-height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 20px);
}

body[data-page="island"] .building-plot-modal .building-overview-actions {
  bottom: 0;
  margin-bottom: 0;
  padding-bottom: 14px;
}

body[data-page="island"] .building-production-orders-backdrop {
  z-index: 132;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.24), transparent 34%),
    rgba(7, 22, 22, 0.42);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
}

body[data-page="island"] .empty-plot-modal.building-plot-modal.building-production-orders-modal {
  position: relative;
  z-index: 133;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: min(840px, calc(100vw - 28px));
  max-height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 28px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  transform: none;
}

body[data-page="island"] .empty-plot-modal.building-plot-modal.building-production-orders-modal.building-production-automation-modal {
  width: min(720px, calc(100vw - 28px));
}

body[data-page="island"] .building-production-orders-modal .building-production-orders-head {
  min-height: 88px;
}

body[data-page="island"] .building-production-orders-modal .building-production-orders-head strong {
  display: block;
  color: #193b36;
  font-size: 32px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.62);
}

body[data-page="island"] .building-production-orders-modal .building-production-orders-body {
  min-height: 0;
  overflow-y: auto;
}

body[data-page="island"] .building-production-orders-modal .building-production-orders-body .building-modal-body {
  min-height: 0;
  padding: 16px;
}

@media (max-width: 760px) {
  body[data-page="island"] .building-production-orders-backdrop {
    padding: 10px;
  }

  body[data-page="island"] .empty-plot-modal.building-plot-modal.building-production-orders-modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 20px);
  }

  body[data-page="island"] .empty-plot-modal.building-plot-modal.building-production-orders-modal.building-production-automation-modal {
    width: calc(100vw - 20px);
  }

  body[data-page="island"] .building-production-orders-modal .building-production-orders-head {
    min-height: 76px;
  }

  body[data-page="island"] .building-production-orders-modal .building-production-orders-head strong {
    font-size: 26px;
  }
}

/* Energy supply pages are short controls, so let the modal breathe instead of showing an inner scrollbar. */
body[data-page="island"] .empty-plot-modal.building-plot-modal.building-plot-modal-energy-tab {
  bottom: calc(var(--global-bottom-nav-reserve) + 10px);
  height: auto;
  max-height: none;
}

body[data-page="island"] .building-plot-modal.building-plot-modal-energy-tab .empty-plot-modal-body.building,
body[data-page="island"] .building-plot-modal.building-plot-modal-energy-tab .building-modal-body {
  overflow: visible;
}

body[data-page="island"] .building-plot-modal.building-plot-modal-energy-tab .building-energy-tab {
  align-content: start;
}

@media (max-height: 560px) {
  body[data-page="island"] .empty-plot-modal.building-plot-modal.building-plot-modal-energy-tab {
    bottom: calc(var(--global-bottom-nav-reserve) + 6px);
  }

  body[data-page="island"] .building-plot-modal.building-plot-modal-energy-tab .empty-plot-modal-body.building,
  body[data-page="island"] .building-plot-modal.building-plot-modal-energy-tab .building-modal-body {
    overflow-y: auto;
  }
}

body.ship-voyage-modal-open .island-cargo-modal-backdrop:has(.island-ship-voyage-modal) {
  position: fixed;
  z-index: 5200;
  top: var(--global-topbar-height);
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  padding: 28px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-backdrop:has(.island-ship-voyage-modal) {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 34%),
    linear-gradient(135deg, rgba(217, 243, 238, 0.36), rgba(255, 250, 232, 0.26)),
    rgba(18, 43, 47, 0.22);
  -webkit-backdrop-filter: blur(18px) saturate(1.26);
  backdrop-filter: blur(18px) saturate(1.26);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, calc(100vw - 58px));
  max-height: min(840px, calc(100vh - var(--global-topbar-height) - 42px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 92% 8%, rgba(253, 234, 166, 0.5), rgba(253, 234, 166, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(226, 249, 243, 0.62) 55%, rgba(255, 249, 231, 0.68)),
    rgba(245, 253, 250, 0.76);
  color: #173430;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(34, 61, 57, 0.06),
    0 34px 80px rgba(33, 63, 58, 0.2),
    0 10px 32px rgba(221, 196, 124, 0.12);
  -webkit-backdrop-filter: blur(34px) saturate(1.42);
  backdrop-filter: blur(34px) saturate(1.42);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal::before {
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 32%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.13) 0 1px, rgba(255, 255, 255, 0) 1px 28px);
  opacity: 0.52;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal > * {
  position: relative;
  z-index: 1;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal > .island-cargo-close {
  position: absolute !important;
  top: 26px !important;
  right: 26px !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 12 !important;
  display: grid;
  place-items: center;
  width: 44px !important;
  min-width: 44px;
  height: 44px !important;
  min-height: 44px;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(236, 249, 245, 0.5)),
    rgba(255, 255, 255, 0.48);
  color: rgba(23, 52, 48, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 8px 20px rgba(42, 72, 66, 0.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.28);
  backdrop-filter: blur(22px) saturate(1.28);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal > .island-cargo-close:hover,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal > .island-cargo-close:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(232, 250, 245, 0.66)),
    rgba(255, 255, 255, 0.58);
  color: #0f4c44;
  outline: 0;
  transform: translateY(-1px);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head {
  position: relative;
  z-index: 4;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, auto);
  align-items: end;
  gap: 28px;
  min-height: 154px;
  padding: 30px 118px 30px 22px;
  border-bottom: 1px solid rgba(34, 61, 57, 0.08);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08));
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head div {
  max-width: min(620px, calc(100% - 230px));
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head > div > span {
  color: #4d9f95;
  display: block;
  font-size: 13px;
  letter-spacing: 0.14em;
  transform: translateY(-8px);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head strong {
  color: #123733;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 950;
  line-height: 1.04;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.76);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-title-row {
  display: block;
  align-items: center;
  max-width: 100% !important;
  min-width: 0;
  width: min(620px, 100%);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-title-row strong {
  flex: 0 0 auto;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker {
  position: relative;
  display: block;
  width: min(560px, 100%) !important;
  max-width: 100%;
  min-width: 260px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 62px;
  padding: 0 58px 2px 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(228, 247, 242, 0.5)),
    rgba(255, 255, 255, 0.42);
  color: #123733;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(20, 88, 77, 0.08),
    0 14px 28px rgba(34, 77, 69, 0.1);
  font: inherit;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 950;
  line-height: 1.04;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.78);
  white-space: nowrap;
  cursor: pointer;
  -webkit-backdrop-filter: blur(22px) saturate(1.32);
  backdrop-filter: blur(22px) saturate(1.32);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker::after {
  display: none;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker select:hover,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker select:focus-visible {
  border-color: rgba(36, 178, 159, 0.44);
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(219, 249, 242, 0.58)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 16px 34px rgba(28, 117, 103, 0.14),
    0 0 0 4px rgba(36, 178, 159, 0.1);
  outline: 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select {
  display: block !important;
  gap: 0 !important;
  max-width: none !important;
  min-width: 0;
  position: relative;
  width: 100%;
  z-index: 8;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select.open {
  z-index: 60;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal.select-open,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-planner.select-open {
  z-index: 20;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-native {
  height: 1px !important;
  inset: 50% auto auto 50% !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 1px !important;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-button {
  align-items: center;
  appearance: none;
  background:
    radial-gradient(circle at 18% 4%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(232, 250, 245, 0.62)),
    rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(34, 61, 57, 0.07),
    0 12px 28px rgba(42, 72, 66, 0.1);
  color: #123733;
  display: grid;
  font: inherit;
  font-weight: 950;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 22px;
  min-height: 54px;
  padding: 0 18px 0 20px;
  position: relative;
  text-align: left;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
  width: 100%;
  -webkit-backdrop-filter: blur(24px) saturate(1.32);
  backdrop-filter: blur(24px) saturate(1.32);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-button:hover,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-button:focus-visible,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select.open .exchange-glass-select-button {
  background:
    radial-gradient(circle at 18% 4%, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(224, 250, 244, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 0 0 4px rgba(8, 125, 103, 0.1),
    0 16px 34px rgba(28, 117, 103, 0.14);
  color: #082d28;
  outline: 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-value {
  color: inherit;
  font-size: inherit;
  letter-spacing: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head .exchange-glass-select-value {
  color: inherit;
  font-size: inherit;
  letter-spacing: 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-chevron {
  color: currentColor;
  display: block;
  height: 22px;
  justify-self: center;
  letter-spacing: 0;
  position: relative;
  transform: translateY(0);
  transition: transform 0.18s ease;
  width: 22px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head .exchange-glass-select-chevron {
  color: inherit;
  font-size: 0;
  letter-spacing: 0;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-chevron::before {
  background: currentColor;
  border: 0;
  border-radius: 999px;
  content: "";
  height: 3px;
  left: 3px;
  opacity: 0.78;
  position: absolute;
  top: 10px;
  transform: rotate(45deg);
  transform-origin: right center;
  width: 10px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-chevron::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 3px;
  opacity: 0.78;
  position: absolute;
  right: 3px;
  top: 10px;
  transform: rotate(-45deg);
  transform-origin: left center;
  width: 10px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select.open .exchange-glass-select-chevron {
  transform: translateY(1px) rotate(180deg);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-menu {
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(233, 250, 246, 0.94) 54%, rgba(255, 250, 236, 0.94)),
    rgba(250, 253, 250, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(34, 61, 57, 0.08),
    0 26px 58px rgba(35, 62, 56, 0.2),
    0 8px 20px rgba(35, 62, 56, 0.11);
  display: grid;
  gap: 5px;
  left: 0;
  max-height: min(330px, calc(100vh - var(--global-topbar-height) - 72px));
  min-width: 100%;
  opacity: 0;
  overflow: auto;
  padding: 8px;
  pointer-events: none;
  position: absolute;
  right: auto;
  scrollbar-color: rgba(8, 125, 103, 0.28) rgba(255, 255, 255, 0.28);
  scrollbar-width: thin;
  top: calc(100% + 9px);
  transform: translateY(-5px) scale(0.985);
  transform-origin: top center;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
  visibility: hidden;
  width: max(100%, 300px);
  -webkit-backdrop-filter: blur(32px) saturate(1.42);
  backdrop-filter: blur(32px) saturate(1.42);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head .exchange-glass-select-menu {
  display: grid !important;
  gap: 5px !important;
  max-width: none !important;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select.open .exchange-glass-select-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-option {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 16px;
  color: rgba(20, 50, 46, 0.84);
  cursor: pointer;
  display: grid;
  font: inherit;
  font-size: 18px;
  font-weight: 950;
  grid-template-columns: minmax(0, 1fr) 22px;
  min-height: 46px;
  padding: 0 13px 0 15px;
  position: relative;
  text-align: left;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.52);
  transition:
    background 0.14s ease,
    box-shadow 0.14s ease,
    color 0.14s ease,
    transform 0.14s ease;
  width: 100%;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-option:hover,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-option:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(235, 250, 245, 0.48));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  color: #082d28;
  outline: 0;
  transform: translateY(-1px);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-option[aria-selected="true"] {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(19, 152, 134, 0.96), rgba(7, 104, 95, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 9px 19px rgba(7, 82, 74, 0.18);
  color: #fffdf4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-option[aria-selected="true"]::after {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  height: 11px;
  justify-self: center;
  margin-top: -4px;
  opacity: 0.9;
  transform: rotate(45deg);
  width: 7px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .exchange-glass-select-option:disabled {
  color: rgba(34, 61, 57, 0.28);
  cursor: default;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker .exchange-glass-select-button {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 42px;
  min-height: 76px;
  border-radius: 28px;
  font-size: clamp(34px, 3vw, 46px);
  line-height: 1.02;
  padding: 0 18px 0 32px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker .exchange-glass-select-chevron {
  align-self: center;
  justify-self: end;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0) 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(232, 248, 243, 0.54)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(34, 61, 57, 0.08),
    0 8px 18px rgba(37, 72, 66, 0.1);
  color: rgba(42, 75, 69, 0.88);
  transform: none;
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker .exchange-glass-select-chevron::before,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker .exchange-glass-select-chevron::after {
  top: 19px;
  width: 12px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker .exchange-glass-select-chevron::before {
  left: 9px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker .exchange-glass-select-chevron::after {
  right: 9px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker .exchange-glass-select-menu {
  width: max(100%, 360px);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker .exchange-glass-select-option {
  min-height: 58px;
  border-radius: 18px;
  font-size: 22px;
  padding-inline: 18px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode-picker {
  overflow: visible;
  position: relative;
  z-index: 10;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode-picker .exchange-glass-select-button {
  min-height: 46px;
  border-radius: 18px;
  font-size: 16px;
  padding: 0 16px 0 18px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode-picker .exchange-glass-select-menu {
  left: auto;
  right: 0;
  width: max(100%, 360px);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode-picker .exchange-glass-select-option {
  min-height: 48px;
  font-size: 17px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head em {
  align-items: center;
  align-self: end;
  background:
    radial-gradient(circle at 20% 6%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 242, 211, 0.48)),
    rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(120, 84, 20, 0.07),
    0 12px 28px rgba(120, 91, 34, 0.08);
  color: #a66b0c;
  display: inline-flex;
  font-size: 25px;
  justify-content: center;
  justify-self: start;
  min-height: 76px;
  min-width: 244px;
  padding: 0 28px;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(1.24);
  backdrop-filter: blur(22px) saturate(1.24);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-body {
  position: relative;
  z-index: 2;
  grid-row: 2;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 24px 22px 22px;
  scrollbar-color: rgba(8, 125, 103, 0.28) rgba(255, 255, 255, 0.25);
  scrollbar-width: thin;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-tabs {
  gap: 10px;
  margin: 0 0 10px;
  position: relative;
  z-index: 3;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-tabs button {
  min-height: 50px;
  height: auto;
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(237, 249, 245, 0.42)),
    rgba(255, 255, 255, 0.32);
  color: rgba(24, 55, 50, 0.66);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(42, 72, 66, 0.06);
  font-size: 18px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(1.22);
  backdrop-filter: blur(18px) saturate(1.22);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-tabs button.active {
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #19b7a4, #0b857d 58%, #076b68),
    #0b857d;
  color: #fffdf4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 12px 24px rgba(8, 126, 116, 0.22);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-planner,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-dialog {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(233, 249, 244, 0.46) 56%, rgba(255, 248, 232, 0.48)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(34, 61, 57, 0.06),
    0 16px 38px rgba(42, 72, 66, 0.1);
  color: #173430;
  -webkit-backdrop-filter: blur(26px) saturate(1.34);
  backdrop-filter: blur(26px) saturate(1.34);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-planner {
  padding: 18px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route {
  align-items: center;
  gap: 14px;
  grid-template-columns: minmax(210px, 240px) 30px minmax(0, 1fr);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-origin,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route-arrow {
  color: #173430;
  font-size: 18px;
  font-weight: 950;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-origin {
  align-items: center;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 249, 245, 0.46)),
    rgba(255, 255, 255, 0.36);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 9px 20px rgba(42, 72, 66, 0.07);
  display: flex;
  gap: 10px;
  min-height: 54px;
  min-width: 0;
  padding: 0 16px;
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-origin .fleet-location-pin {
  flex-basis: 24px;
  height: 24px;
  width: 24px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-origin strong {
  color: #173430;
  font-size: 18px;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route-arrow {
  color: #102421 !important;
  opacity: 1;
  text-align: center;
  text-shadow: none;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route input,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode select,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-amount {
  border: 0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(236, 249, 245, 0.58)),
    rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(34, 61, 57, 0.07),
    0 9px 20px rgba(42, 72, 66, 0.08);
  color: #173430;
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  backdrop-filter: blur(20px) saturate(1.25);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route input {
  height: 54px;
  font-size: 20px;
  padding: 0 20px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route input::placeholder {
  color: rgba(23, 52, 48, 0.38);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route input:focus-visible,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode select:focus-visible,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-amount:focus-within {
  outline: 0;
  box-shadow:
    0 0 0 4px rgba(8, 125, 103, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 12px 26px rgba(42, 72, 66, 0.12);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-destination-chips {
  gap: 9px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-destination-chips button {
  min-height: 36px;
  height: auto;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(237, 249, 245, 0.45)),
    rgba(255, 255, 255, 0.34);
  color: rgba(23, 52, 48, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(42, 72, 66, 0.06);
  padding: 0 14px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-destination-chips button.active,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-destination-chips button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(229, 250, 244, 0.62));
  color: #0b756b;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats {
  gap: 10px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stat,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(238, 250, 247, 0.34)),
    rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stat span,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats > div span,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital strong span,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action small,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-metrics,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-panel-head small,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-table-head {
  color: rgba(38, 61, 57, 0.58);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stat strong,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats > div strong,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital strong,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital strong em,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-dialog header strong,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-metrics strong,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-panel-head strong,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-row.no-action {
  color: #173430;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-actions {
  gap: 14px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-start-button {
  min-height: 54px;
  height: auto;
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 46%),
    linear-gradient(180deg, #25c9b4, #0b8b80 60%, #08746f);
  color: #fffdf6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 14px 28px rgba(8, 126, 116, 0.24);
  font-size: 18px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-start-button:hover,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-start-button:focus-visible {
  filter: none;
  outline: 0;
  transform: translateY(-1px);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode {
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(236, 249, 245, 0.44)),
    rgba(255, 255, 255, 0.32);
  color: #173430;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 22px rgba(42, 72, 66, 0.08);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode span {
  color: #0b756b;
  font-size: 15px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode select {
  height: 42px;
  font-size: 15px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-warning {
  color: #9d6a0a;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital {
  gap: 10px;
  padding: 16px 18px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital strong {
  font-size: 16px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital strong em {
  color: #173430;
  font-size: 24px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-track {
  height: 7px;
  background: rgba(26, 60, 53, 0.12);
  box-shadow: inset 0 1px 2px rgba(34, 61, 57, 0.08);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-track b {
  background: linear-gradient(90deg, #f1aa23, #f4ce6a);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-track.condition b {
  background: linear-gradient(90deg, #ec575d, #f4bd62);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action {
  gap: 14px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action button,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-actions button {
  border: 0;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(233, 247, 243, 0.55));
  color: #243d39;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 7px 16px rgba(42, 72, 66, 0.1);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action button:hover,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-actions button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(229, 250, 244, 0.66));
  color: #08756b;
  transform: translateY(-1px);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action button:disabled {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(237, 247, 244, 0.28));
  color: rgba(38, 61, 57, 0.3);
  opacity: 1;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-dialog {
  padding: 16px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-dialog header button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(237, 249, 245, 0.46));
  color: rgba(23, 52, 48, 0.72);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-amount {
  overflow: hidden;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-amount span {
  background:
    linear-gradient(180deg, rgba(36, 199, 176, 0.22), rgba(8, 117, 107, 0.12));
  color: #0b756b;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-amount input {
  color: #173430;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-actions .confirm {
  background:
    linear-gradient(180deg, #25c9b4, #0b8b80 60%, #08746f);
  color: #fffdf6;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-range {
  accent-color: #0b8b80;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 250px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-panel-head {
  border-bottom: 1px solid rgba(34, 61, 57, 0.08);
  padding: 16px 18px 12px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-ship-cargo-weight {
  color: #a66b0c;
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-cargo-head-actions {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: flex-end;
  margin-left: auto;
  min-width: max-content;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-auto-unload-toggle {
  align-items: center;
  border: 1px solid rgba(20, 137, 125, 0.22);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(226, 247, 243, 0.6));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 10px 22px rgba(31, 78, 72, 0.08);
  color: #2f5d58;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 30px;
  padding: 3px 6px 3px 4px;
  white-space: nowrap;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-auto-unload-toggle i {
  border-radius: 999px;
  background: rgba(117, 156, 150, 0.28);
  box-shadow:
    inset 0 1px 3px rgba(33, 71, 66, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  display: block;
  height: 22px;
  position: relative;
  width: 38px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-auto-unload-toggle i::after {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  box-shadow:
    0 4px 10px rgba(33, 75, 69, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  content: "";
  height: 18px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform 160ms ease;
  width: 18px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-auto-unload-toggle.on i {
  background: linear-gradient(180deg, #57d8c8, #0c9486);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-auto-unload-toggle.on i::after {
  transform: translateX(16px);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-auto-unload-toggle span {
  color: #244c48;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-auto-unload-toggle em {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #3e605b;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  min-width: 26px;
  padding: 5px 7px;
  text-align: center;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-track {
  background: rgba(26, 60, 53, 0.12);
  box-shadow: inset 0 1px 2px rgba(34, 61, 57, 0.08);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-track span {
  background: linear-gradient(90deg, rgba(90, 151, 184, 0.72), rgba(115, 172, 201, 0.56));
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-table-head {
  align-items: center;
  border-bottom: 1px solid rgba(34, 61, 57, 0.08);
  color: rgba(38, 61, 57, 0.62);
  min-height: 32px;
  padding: 8px 18px 8px 14px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-ship-cargo {
  padding-top: 4px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-row.no-action {
  border-bottom: 1px solid rgba(34, 61, 57, 0.07);
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-row.no-action > span {
  color: #173430;
  font-weight: 950;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-product strong {
  color: #0b756b;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-product small {
  color: rgba(38, 61, 57, 0.52);
}

@media (max-width: 760px) {
  body.ship-voyage-modal-open .island-cargo-modal-backdrop:has(.island-ship-voyage-modal) {
  position: fixed;
  z-index: 5200;
  top: var(--global-topbar-height);
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  padding: 28px;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-backdrop:has(.island-ship-voyage-modal) {
    padding: 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal {
  position: relative;
    width: calc(100vw - 24px);
    border-radius: 24px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal > .island-cargo-close {
    top: 18px !important;
    right: 18px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 12 !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head {
    min-height: 132px;
    padding: 22px 76px 22px 14px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head div {
    max-width: 100%;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head strong {
    font-size: 28px;
    white-space: normal;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-title-row strong {
    font-size: 24px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker {
    width: min(100%, 360px);
    min-width: 0;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker select {
    min-height: 54px;
    padding-right: 50px;
    font-size: 28px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker::after {
    right: 20px;
    width: 10px;
    height: 10px;
    border-width: 3px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head em {
    min-height: 42px;
    min-width: 0;
    width: min(100%, 260px);
    font-size: 18px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-origin {
    width: 100%;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-body {
    gap: 12px;
    padding: 16px 14px 14px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-actions,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-vitals {
    grid-template-columns: 1fr;
  }
}

/* Encyclopedia building skin preview button and gallery. */
.encyclopedia-product-title-row{display:flex;align-items:center;flex-wrap:wrap;gap:14px;min-width:0}.encyclopedia-product-title-row h2{margin:0}.encyclopedia-building-skin-button{appearance:none;display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:0 22px;border:1px solid rgba(16,145,131,.26);border-radius:999px;background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(235,250,246,.74));box-shadow:inset 0 1px 0 rgba(255,255,255,.96),inset 0 -10px 16px rgba(14,116,105,.06),0 14px 28px rgba(27,84,76,.12);color:#0b7f74;cursor:pointer;font-size:17px;font-weight:900;letter-spacing:0;white-space:nowrap}.encyclopedia-building-skin-button:hover{border-color:rgba(14,142,128,.42);box-shadow:inset 0 1px 0 rgba(255,255,255,.98),0 18px 34px rgba(27,84,76,.16);transform:translateY(-1px)}.encyclopedia-building-skin-button:active{transform:translateY(0)}
.encyclopedia-skin-backdrop{position:fixed;z-index:calc(var(--global-workbench-modal-z) + 80);inset:0;display:grid;place-items:center;padding:32px;background:radial-gradient(circle at 22% 8%,rgba(255,255,255,.72),transparent 34%),radial-gradient(circle at 74% 18%,rgba(124,226,211,.22),transparent 36%),rgba(219,240,236,.46);-webkit-backdrop-filter:blur(18px) saturate(1.2);backdrop-filter:blur(18px) saturate(1.2)}.encyclopedia-skin-modal{display:grid;grid-template-rows:auto minmax(0,1fr);width:min(920px,calc(100vw - 48px));max-height:min(760px,calc(100dvh - 48px));overflow:hidden;border:1px solid rgba(255,255,255,.82);border-radius:34px;background:radial-gradient(circle at 16% 0%,rgba(255,255,255,.92),transparent 36%),linear-gradient(145deg,rgba(255,255,255,.9),rgba(229,250,246,.72) 64%,rgba(255,250,232,.62));box-shadow:inset 0 1px 0 rgba(255,255,255,.96),0 34px 90px rgba(28,76,69,.22);color:#103836}.encyclopedia-skin-head{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:108px;padding:18px 22px;border-bottom:1px solid rgba(45,105,96,.12);background:linear-gradient(90deg,rgba(255,255,255,.72),rgba(229,250,246,.42))}.encyclopedia-skin-building{display:flex;align-items:center;min-width:0;gap:16px}.encyclopedia-skin-building-icon{display:grid;place-items:center;flex:0 0 auto;width:76px;height:76px;overflow:hidden;border:1px solid rgba(255,255,255,.84);border-radius:22px;background:radial-gradient(circle at 36% 18%,rgba(255,255,255,.94),transparent 48%),linear-gradient(145deg,rgba(255,255,255,.76),rgba(223,247,242,.54));box-shadow:0 16px 30px rgba(34,80,73,.12)}.encyclopedia-skin-building-preview{width:66px;height:66px;object-fit:contain;filter:saturate(1.06) contrast(1.04) drop-shadow(0 8px 14px rgba(35,70,64,.12))}.encyclopedia-skin-building span{display:block;color:rgba(17,90,82,.72);font-size:15px;font-weight:900}.encyclopedia-skin-building strong{display:block;margin-top:3px;color:#0d3432;font-size:clamp(26px,4vw,38px);line-height:1.05}.encyclopedia-skin-close{appearance:none;display:inline-grid;place-items:center;flex:0 0 auto;width:52px;height:52px;border:1px solid rgba(255,255,255,.78);border-radius:18px;background:rgba(255,255,255,.68);box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 14px 26px rgba(33,80,73,.1);color:#244a47;cursor:pointer;font-size:30px;font-weight:900;line-height:1}
.encyclopedia-skin-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;min-height:0;overflow:auto;padding:20px;scrollbar-color:rgba(42,155,142,.52) rgba(255,255,255,.38);scrollbar-width:thin}.encyclopedia-skin-option{display:grid;gap:12px;min-height:0;padding:12px;border:1px solid rgba(255,255,255,.82);border-radius:26px;background:linear-gradient(145deg,rgba(255,255,255,.84),rgba(232,249,245,.62));box-shadow:inset 0 1px 0 rgba(255,255,255,.92),0 16px 32px rgba(32,84,76,.1)}.encyclopedia-skin-image-frame{display:grid;place-items:center;aspect-ratio:1/.78;overflow:hidden;border-radius:20px;background:radial-gradient(circle at 50% 30%,rgba(255,255,255,.92),transparent 58%),linear-gradient(145deg,rgba(255,255,255,.76),rgba(222,245,240,.52))}.encyclopedia-skin-image{width:100%;height:100%;object-fit:contain;transform:translate(var(--skin-center-shift-x,0),var(--skin-center-shift-y,0)) scale(1.08);filter:saturate(1.08) contrast(1.04) drop-shadow(0 14px 18px rgba(35,70,64,.14))}.encyclopedia-skin-option-copy{display:grid;gap:6px;min-width:0}.encyclopedia-skin-option-copy strong{overflow:hidden;color:#123b38;font-size:20px;font-weight:950;line-height:1.18;text-overflow:ellipsis;white-space:nowrap}.encyclopedia-skin-option-copy span{justify-self:start;min-height:28px;padding:4px 10px;border-radius:999px;background:linear-gradient(180deg,rgba(44,196,157,.2),rgba(21,142,121,.12));color:#08796f;font-size:14px;font-weight:900}.encyclopedia-skin-option-copy small,.encyclopedia-skin-empty{color:rgba(37,80,75,.68);font-size:14px;font-weight:800;line-height:1.55}.encyclopedia-skin-empty{display:grid;place-items:center;min-height:240px;border:1px dashed rgba(15,145,131,.24);border-radius:24px;background:rgba(255,255,255,.42)}@media(max-width:980px){.encyclopedia-building-skin-button{min-height:42px;padding:0 18px;font-size:15px}.encyclopedia-skin-backdrop{padding:18px}.encyclopedia-skin-head{align-items:flex-start;min-height:0;padding:16px}.encyclopedia-skin-grid{grid-template-columns:1fr;padding:16px}}

/* Warehouse cargo transfer modal: iOS liquid-glass pass. */
body[data-page="island"] .island-warehouse-cargo-backdrop {
  background:
    radial-gradient(circle at 50% 4%, rgba(255, 255, 255, 0.46), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(67, 192, 178, 0.2), transparent 38%),
    radial-gradient(circle at 90% 84%, rgba(230, 191, 85, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(205, 229, 226, 0.58), rgba(248, 242, 222, 0.4)),
    rgba(19, 34, 35, 0.18);
  -webkit-backdrop-filter: blur(28px) saturate(1.28);
  backdrop-filter: blur(28px) saturate(1.28);
}

body[data-page="island"] .island-warehouse-cargo-modal {
  width: min(1320px, calc(100vw - 56px));
  max-height: min(810px, calc(100vh - var(--global-topbar-height) - 56px));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.76), transparent 34%),
    radial-gradient(circle at 92% 4%, rgba(255, 230, 135, 0.2), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(229, 249, 244, 0.72) 54%, rgba(255, 248, 226, 0.74)),
    rgba(242, 250, 247, 0.88);
  color: #123733;
  box-shadow:
    0 36px 92px rgba(26, 55, 52, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(117, 159, 152, 0.16);
  -webkit-backdrop-filter: blur(30px) saturate(1.28);
  backdrop-filter: blur(30px) saturate(1.28);
}

body[data-page="island"] .island-warehouse-cargo-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 24%, rgba(255, 255, 255, 0.32) 38%, transparent 51%),
    radial-gradient(circle at 96% 86%, rgba(20, 176, 151, 0.1), transparent 34%);
  opacity: 0.95;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-close,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-modal-head,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-columns {
  position: relative;
  z-index: 1;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.93), rgba(232, 246, 242, 0.64)),
    rgba(255, 255, 255, 0.48);
  color: rgba(31, 62, 58, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 12px 24px rgba(30, 68, 64, 0.14);
  font-size: 28px;
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-close:hover,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-close:focus-visible {
  background: rgba(255, 255, 255, 0.84);
  color: #0f9183;
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-modal-head {
  min-height: 88px;
  padding: 24px 84px 20px 28px;
  border-bottom: 1px solid rgba(43, 89, 82, 0.12);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.66), rgba(231, 249, 245, 0.38) 58%, rgba(255, 244, 213, 0.34)),
    rgba(255, 255, 255, 0.18);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-modal-head strong {
  color: #123733;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-columns {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  padding: 22px 24px 24px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(234, 249, 245, 0.48)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    0 22px 54px rgba(37, 72, 66, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(83, 129, 121, 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  backdrop-filter: blur(18px) saturate(1.16);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-select {
  position: relative;
  padding: 18px 18px 0;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-select::after {
  content: "";
  position: absolute;
  top: 40px;
  right: 40px;
  width: 10px;
  height: 10px;
  border-right: 3px solid rgba(45, 78, 73, 0.76);
  border-bottom: 3px solid rgba(45, 78, 73, 0.76);
  pointer-events: none;
  transform: rotate(45deg);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-select select {
  height: 58px;
  padding: 0 58px 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 23px;
  appearance: none;
  background:
    radial-gradient(circle at 22% 8%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(236, 249, 245, 0.52)),
    rgba(255, 255, 255, 0.44);
  color: #123733;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 12px 26px rgba(37, 72, 66, 0.08);
  font-size: 18px;
  font-weight: 900;
  text-align: left;
  text-align-last: left;
  -webkit-backdrop-filter: blur(20px) saturate(1.18);
  backdrop-filter: blur(20px) saturate(1.18);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-select select:focus-visible {
  border-color: rgba(18, 150, 135, 0.54);
  outline: 3px solid rgba(18, 150, 135, 0.16);
  outline-offset: 2px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head {
  padding: 20px 20px 13px;
  border-bottom: 1px solid rgba(43, 89, 82, 0.1);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head strong {
  color: #123733;
  font-size: 24px;
  font-weight: 950;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head small,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head span {
  color: rgba(35, 62, 58, 0.58);
  font-size: 13px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-actions {
  gap: 10px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-actions > span,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-actions .island-cargo-capacity {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 242, 211, 0.5)),
    rgba(255, 255, 255, 0.34);
  color: #a66b0c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 20px rgba(120, 91, 34, 0.07);
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-bulk-button,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-load {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(233, 247, 243, 0.56)),
    rgba(255, 255, 255, 0.38);
  color: #173430;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 8px 18px rgba(37, 72, 66, 0.1);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-bulk-button {
  width: 48px;
  height: 42px;
  border-radius: 16px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-load {
  width: 48px;
  height: 44px;
  border-radius: 17px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-bulk-button:hover,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-load:hover,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-bulk-button:focus-visible,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-load:focus-visible {
  background:
    linear-gradient(180deg, #25c9b4, #0b8b80 60%, #08746f);
  color: #fffdf6;
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-bulk-button.unload:hover,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-load-controls .island-cargo-load[title="å¸è´§"]:hover {
  background:
    linear-gradient(180deg, #75bdd8, #3587b5 62%, #246f98);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-bulk-button:disabled,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-load:disabled {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(237, 247, 244, 0.28));
  color: rgba(38, 61, 57, 0.3);
  opacity: 1;
  transform: none;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-track {
  height: 7px;
  margin: 0 20px 13px;
  background: rgba(26, 60, 53, 0.12);
  box-shadow: inset 0 1px 2px rgba(34, 61, 57, 0.08);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-track span {
  background: linear-gradient(90deg, #f1aa23, #f4ce6a);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-track.ship span {
  background: linear-gradient(90deg, rgba(90, 151, 184, 0.78), rgba(115, 172, 201, 0.62));
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-table-head {
  padding: 0 22px 10px 20px;
  border-bottom: 1px solid rgba(34, 61, 57, 0.08);
  color: rgba(38, 61, 57, 0.56);
  font-size: 13px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-list,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-cargo {
  padding: 0 14px 16px;
  scrollbar-color: rgba(8, 125, 103, 0.32) rgba(255, 255, 255, 0.28);
  scrollbar-width: thin;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row {
  min-height: 70px;
  margin: 0 0 4px;
  padding: 10px 12px 10px 14px;
  border-top: 0;
  border-bottom: 1px solid rgba(34, 61, 57, 0.07);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.54), rgba(236, 249, 245, 0.3)),
    rgba(255, 255, 255, 0.22);
  color: #173430;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row:hover {
  background:
    linear-gradient(145deg, rgba(238, 255, 249, 0.78), rgba(255, 255, 255, 0.5)),
    rgba(255, 255, 255, 0.48);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row > span {
  color: #173430;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product strong {
  color: #0b756b;
  font-size: 17px;
  font-weight: 950;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product.tier-1 strong {
  color: #173430;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product.tier-2 strong {
  color: #4b8d4f;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product.tier-3 strong {
  color: #2476a9;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product.tier-4 strong {
  color: #9c57a8;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product small {
  color: rgba(38, 61, 57, 0.54);
  font-size: 12px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(236, 249, 245, 0.36)),
    rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(37, 72, 66, 0.06);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-icon .product-icon-image {
  width: 46px;
  height: 46px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer {
  grid-template-columns: 70px minmax(120px, 1fr) 78px 52px 48px 40px 40px;
  min-height: 56px;
  margin: 4px 14px 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 247, 222, 0.38)),
    rgba(255, 255, 255, 0.32);
  color: rgba(35, 62, 58, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(110, 85, 34, 0.08);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer.unload {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(224, 246, 255, 0.38)),
    rgba(255, 255, 255, 0.32);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer input[type="range"] {
  accent-color: #d8941c;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer.unload input[type="range"] {
  accent-color: #3587b5;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer input[type="number"] {
  height: 38px;
  border: 1px solid rgba(43, 89, 82, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  color: #123733;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer strong {
  color: #123733;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer small {
  color: rgba(35, 62, 58, 0.54);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-confirm,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-cancel {
  width: 40px;
  height: 38px;
  border-radius: 14px;
  color: #fffdf6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-confirm {
  background: linear-gradient(180deg, #f0b13a, #c98112);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer.unload .island-cargo-transfer-confirm {
  background: linear-gradient(180deg, #75bdd8, #2f7dab);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-cancel {
  background: linear-gradient(180deg, #ffffff, #dfeeea);
  color: rgba(31, 62, 58, 0.72);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-empty {
  min-height: 150px;
  color: rgba(35, 62, 58, 0.52);
  font-size: 18px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-empty-tall {
  grid-row: 1 / -1;
  min-height: 100%;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.54), rgba(236, 249, 245, 0.32)),
    rgba(255, 255, 255, 0.28);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-empty-tall strong {
  color: #123733;
  font-size: 24px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-empty-tall span {
  color: rgba(35, 62, 58, 0.56);
  font-size: 14px;
}

@media (max-width: 900px) {
  body[data-page="island"] .island-warehouse-cargo-modal {
    width: calc(100vw - 32px);
    max-height: calc(100vh - var(--global-topbar-height) - 32px);
    border-radius: 26px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-columns {
    grid-template-columns: 1fr;
    gap: 12px;
    overflow: auto;
    padding: 16px;
  }
}

@media (max-width: 560px) {
  body[data-page="island"] .island-warehouse-cargo-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - var(--global-topbar-height) - 20px);
    border-radius: 22px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-modal-head {
    min-height: 76px;
    padding: 20px 72px 16px 20px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-modal-head strong {
    font-size: 28px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-table-head,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row {
    grid-template-columns: minmax(0, 1fr) 48px 58px 48px;
    gap: 7px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-table-head.compact,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row.compact {
    grid-template-columns: minmax(0, 1fr) 48px 58px 44px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer {
    grid-template-columns: 1fr 1fr 58px 40px;
    gap: 8px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer input[type="range"] {
    grid-column: 1 / -1;
  }
}

/* Encyclopedia building skin button single-line alignment. */
.encyclopedia-product-title-row{display:flex;align-items:center;flex-wrap:nowrap;gap:18px;max-width:100%}.encyclopedia-product-title-row h2{flex:0 1 auto;min-width:0;max-width:calc(100% - 170px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.encyclopedia-product-title-row .encyclopedia-building-skin-button{flex:0 0 auto;margin:0;align-self:center}
@media(max-width:980px){.encyclopedia-product-title-row{flex-wrap:wrap}.encyclopedia-product-title-row h2{max-width:100%;white-space:normal}.encyclopedia-product-title-row .encyclopedia-building-skin-button{margin-top:0}}

/* Encyclopedia build cost heading compact single line. */
.encyclopedia-build-cost-heading{display:flex;align-items:center;justify-content:flex-start;gap:14px;min-width:0}.encyclopedia-build-cost-heading>span{flex:0 0 auto;white-space:nowrap;line-height:1;font-size:18px;font-weight:900}.encyclopedia-build-cost-heading .encyclopedia-level-cost-select{flex:0 0 116px;width:116px;min-width:116px;max-width:116px;min-height:42px;padding:0 34px 0 16px;text-align:left}.encyclopedia-build-cost-card .empty-plot-costs{margin-top:10px}
@media(max-width:720px){.encyclopedia-build-cost-heading{gap:10px}.encyclopedia-build-cost-heading .encyclopedia-level-cost-select{flex-basis:104px;width:104px;min-width:104px;max-width:104px}}

/* Encyclopedia building skin entry: only the building-detail hero image opens the skin gallery. */
.encyclopedia-product-title-row h2{max-width:100%}.encyclopedia-building-skin-trigger{appearance:none;margin:0;font:inherit;cursor:pointer;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.encyclopedia-building-skin-trigger:hover{border-color:rgba(15,145,131,.34);box-shadow:inset 0 1px 0 rgba(255,255,255,.94),inset 0 -14px 28px rgba(15,145,131,.1),0 22px 40px rgba(28,92,84,.16);transform:translateY(-2px)}.encyclopedia-building-skin-trigger:focus-visible{outline:3px solid rgba(31,181,166,.36);outline-offset:4px}.encyclopedia-building-skin-trigger:active{transform:translateY(0)}

/* Keep the warehouse cargo modal clear of the global bottom HUD. */
body[data-page="island"] .island-warehouse-cargo-backdrop {
  bottom: var(--global-bottom-nav-reserve);
  padding: 24px 28px 20px;
}

body[data-page="island"] .island-warehouse-cargo-modal {
  max-height: min(810px, calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 44px));
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row.compact .island-cargo-load:hover {
  background: linear-gradient(180deg, #75bdd8, #3587b5 62%, #246f98);
}

@media (max-width: 900px) {
  body[data-page="island"] .island-warehouse-cargo-backdrop {
    padding: 18px 16px 16px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal {
    max-height: calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 32px);
  }
}

@media (max-width: 560px) {
  body[data-page="island"] .island-warehouse-cargo-backdrop {
    padding: 12px 10px 12px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal {
    max-height: calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 24px);
  }
}

/* World sea view specialty fact row. */
#worldSeaViewModalHost .world-sea-view-specialty{display:grid;grid-template-columns:44px minmax(0,1fr);gap:2px 10px;align-items:center}#worldSeaViewModalHost .world-sea-view-specialty-icon{display:inline-flex;align-items:center;justify-content:center;grid-row:span 2;width:44px;height:44px;overflow:hidden;border:1px solid rgba(72,220,198,.34);border-radius:9px;background:linear-gradient(145deg,rgba(72,220,198,.18),rgba(214,170,85,.1));box-shadow:inset 0 1px 0 rgba(255,255,255,.12)}#worldSeaViewModalHost .world-sea-view-specialty-icon-image{width:100%;height:100%;object-fit:contain}#worldSeaViewModalHost .world-sea-view-specialty strong{color:#f4fffc;font-size:18px;font-weight:950;overflow-wrap:anywhere}#worldSeaViewModalHost .world-sea-view-specialty small{color:var(--world-muted,rgba(194,216,214,.68));font-size:12px;font-weight:800;line-height:1.45;overflow-wrap:anywhere}#worldSeaViewModalHost .world-sea-view-fact.specialty{border-color:rgba(72,220,198,.18);background:linear-gradient(145deg,rgba(72,220,198,.08),rgba(223,246,242,.055))}#worldSeaViewModalHost .world-sea-view-fact.specialty.empty .world-sea-view-specialty{grid-template-columns:1fr}#worldSeaViewModalHost .world-sea-view-fact.specialty.empty strong{color:rgba(234,252,248,.84)}

/* Global glass select: default dropdown language follows the iOS 27 reference menu. */
.exchange-glass-select {
  min-width: 0;
  position: relative;
  width: 100%;
  z-index: 3;
}

.exchange-glass-select.open {
  z-index: 240;
}

.exchange-glass-select-native {
  height: 1px !important;
  inset: 50% auto auto 50% !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 1px !important;
}

.exchange-glass-select-button {
  align-items: center;
  appearance: none;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(236, 249, 245, 0.58)),
    rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(34, 61, 57, 0.07),
    0 12px 26px rgba(42, 72, 66, 0.1);
  color: #123733;
  display: grid;
  font: inherit;
  font-size: 18px;
  font-weight: 950;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 20px;
  min-height: 48px;
  padding: 0 17px 0 19px;
  position: relative;
  text-align: left;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.62);
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
  width: 100%;
  -webkit-backdrop-filter: blur(22px) saturate(1.28);
  backdrop-filter: blur(22px) saturate(1.28);
}

.exchange-glass-select-button:hover,
.exchange-glass-select-button:focus-visible,
.exchange-glass-select.open .exchange-glass-select-button {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(232, 250, 245, 0.74));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 0 0 4px rgba(8, 125, 103, 0.09),
    0 16px 34px rgba(42, 72, 66, 0.14);
  color: #082d28;
  outline: 0;
}

.exchange-glass-select-button:disabled {
  cursor: default;
  opacity: 0.52;
}

.exchange-glass-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-glass-select-chevron {
  height: 10px;
  justify-self: center;
  position: relative;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.18s ease;
  width: 10px;
}

.exchange-glass-select-chevron::before {
  border-bottom: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
  content: "";
  inset: 0;
  opacity: 0.82;
  position: absolute;
}

.exchange-glass-select.open .exchange-glass-select-chevron {
  transform: translateY(3px) rotate(225deg);
}

.exchange-glass-select-menu {
  background:
    radial-gradient(circle at 22% 0%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(232, 250, 245, 0.72) 54%, rgba(255, 248, 232, 0.72)),
    rgba(250, 253, 250, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(34, 61, 57, 0.08),
    0 26px 58px rgba(35, 62, 56, 0.2),
    0 8px 20px rgba(35, 62, 56, 0.1);
  display: grid;
  gap: 5px;
  left: 0;
  max-height: min(340px, calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 34px));
  min-width: 100%;
  opacity: 0;
  overflow: auto;
  padding: 8px;
  pointer-events: none;
  position: absolute;
  right: 0;
  scrollbar-color: rgba(8, 125, 103, 0.28) rgba(255, 255, 255, 0.28);
  scrollbar-width: thin;
  top: calc(100% + 8px);
  transform: translateY(-5px) scale(0.985);
  transform-origin: top center;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
  visibility: hidden;
  width: max(100%, 240px);
  -webkit-backdrop-filter: blur(30px) saturate(1.42);
  backdrop-filter: blur(30px) saturate(1.42);
}

.exchange-glass-select.open .exchange-glass-select-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.exchange-glass-select-option {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 15px;
  color: rgba(20, 50, 46, 0.84);
  cursor: pointer;
  display: grid;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  grid-template-columns: minmax(0, 1fr) 22px;
  min-height: 46px;
  padding: 0 13px 0 15px;
  position: relative;
  text-align: left;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.52);
  transition:
    background 0.14s ease,
    box-shadow 0.14s ease,
    color 0.14s ease,
    transform 0.14s ease;
  width: 100%;
}

.exchange-glass-select-option:hover,
.exchange-glass-select-option:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(235, 250, 245, 0.48));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
  color: #082d28;
  outline: 0;
  transform: translateY(-1px);
}

.exchange-glass-select-option[aria-selected="true"] {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(9, 119, 101, 0.95), rgba(7, 82, 74, 0.91));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 9px 20px rgba(7, 82, 74, 0.18);
  color: #fffdf4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.exchange-glass-select-option[aria-selected="true"]::after {
  border-bottom: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
  content: "";
  height: 11px;
  justify-self: center;
  margin-top: -4px;
  opacity: 0.92;
  transform: rotate(45deg);
  width: 7px;
}

.exchange-glass-select-option:disabled {
  color: rgba(34, 61, 57, 0.28);
  cursor: default;
}

.island-cargo-ship-select .exchange-glass-select-button,
.island-warehouse-cargo-modal .exchange-glass-select-button {
  min-height: 50px;
  border-radius: 20px;
  font-size: 20px;
}

.island-cargo-ship-select .exchange-glass-select-menu,
.island-warehouse-cargo-modal .exchange-glass-select-menu {
  width: max(100%, 310px);
}

@media (max-width: 640px) {
  .exchange-glass-select-button {
    min-height: 44px;
    font-size: 16px;
    padding-inline: 15px;
  }

  .exchange-glass-select-option {
    min-height: 42px;
    font-size: 16px;
  }
}

/* Population detail modal: web approximation of iOS liquid glass, aligned with island overlays. */

/* Player settings modal: iOS 27 liquid-glass control center. */
body.settings-modal-open {
  overflow: hidden;
}

#settingsModalHost {
  position: relative;
  z-index: 7000;
}

.settings-modal-backdrop {
  position: fixed;
  z-index: 7000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 26px;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.78), transparent 30%),
    linear-gradient(135deg, rgba(218, 241, 237, 0.76), rgba(244, 236, 211, 0.62) 46%, rgba(224, 241, 248, 0.7));
  -webkit-backdrop-filter: blur(28px) saturate(1.18);
  backdrop-filter: blur(28px) saturate(1.18);
}

.settings-modal-shell {
  --settings-ink: #143a35;
  --settings-muted: rgba(37, 67, 63, 0.62);
  --settings-line: rgba(255, 255, 255, 0.68);
  --settings-line-dark: rgba(31, 92, 84, 0.12);
  --settings-glass: rgba(255, 255, 255, 0.62);
  --settings-glass-strong: rgba(255, 255, 255, 0.82);
  --settings-teal: #079384;
  --settings-blue: #4b89aa;
  --settings-gold: #b88924;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, calc(100vw - 42px));
  max-height: min(860px, calc(100dvh - 42px));
  overflow: hidden;
  border: 1px solid var(--settings-line);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(231, 250, 245, 0.72) 50%, rgba(255, 247, 225, 0.56)),
    var(--settings-glass);
  color: var(--settings-ink);
  box-shadow:
    0 38px 110px rgba(24, 62, 56, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(72, 126, 118, 0.12);
  -webkit-backdrop-filter: blur(32px) saturate(1.18);
  backdrop-filter: blur(32px) saturate(1.18);
}

.settings-modal-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.54), transparent 34%, rgba(255, 255, 255, 0.22) 58%, transparent 78%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 22px);
  opacity: 0.56;
}

.settings-modal-close {
  position: absolute;
  z-index: 4;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  color: #234842;
  cursor: pointer;
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(30, 74, 68, 0.12);
}

.settings-modal-close:hover,
.settings-modal-close:focus-visible {
  outline: 0;
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

.settings-modal-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 118px;
  padding: 22px 86px 20px 30px;
  border-bottom: 1px solid var(--settings-line-dark);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.52), rgba(232, 250, 246, 0.34)),
    rgba(255, 255, 255, 0.14);
}

.settings-modal-title-block {
  display: grid;
  align-content: center;
  gap: 8px;
}

.settings-modal-title-block span {
  color: var(--settings-teal);
  font-size: 13px;
  font-weight: 950;
}

.settings-modal-title-block strong {
  color: var(--settings-ink);
  font-size: clamp(44px, 6vw, 70px);
  line-height: 0.96;
}

.settings-modal-title-block small {
  color: var(--settings-muted);
  font-size: 15px;
  font-weight: 850;
}

.settings-modal-head-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-content: end;
}

.settings-head-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 106px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(238, 251, 248, 0.46)),
    rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 16px 34px rgba(34, 76, 70, 0.09);
}

.settings-head-card span,
.settings-head-card small {
  color: var(--settings-muted);
  font-size: 12px;
  font-weight: 900;
}

.settings-head-card strong {
  overflow: hidden;
  color: var(--settings-ink);
  font-size: 24px;
  font-weight: 1000;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-modal-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 0;
}

.settings-modal-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 22px 16px 22px 22px;
  border-right: 1px solid var(--settings-line-dark);
}

.settings-tab-button {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: transparent;
  color: var(--settings-ink);
  cursor: pointer;
  text-align: left;
}

.settings-tab-button i {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(230, 247, 243, 0.52)),
    rgba(255, 255, 255, 0.36);
  color: var(--settings-teal);
  font-style: normal;
  font-weight: 1000;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(34, 78, 71, 0.08);
}

.settings-tab-icon svg {
  display: block;
  width: 30px;
  height: 30px;
  overflow: visible;
}

.settings-tab-icon-line,
.settings-tab-icon-glow {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.35;
}

.settings-tab-icon-line.thin {
  stroke-width: 1.75;
}

.settings-tab-icon-glow {
  opacity: 0.18;
  stroke-width: 5.2;
}

.settings-tab-icon-fill {
  fill: currentColor;
  opacity: 0.92;
}

.settings-tab-icon-fill.accent {
  opacity: 0.58;
}

.settings-tab-icon-fallback {
  font-weight: 1000;
}

.settings-tab-button span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-tab-button strong {
  color: var(--settings-ink);
  font-size: 18px;
  line-height: 1;
}

.settings-tab-button small {
  overflow: hidden;
  color: var(--settings-muted);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-tab-button:hover,
.settings-tab-button:focus-visible,
.settings-tab-button.selected {
  border-color: rgba(255, 255, 255, 0.78);
  outline: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(224, 248, 243, 0.54)),
    rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 16px 34px rgba(27, 78, 70, 0.12);
}

.settings-tab-button.selected i {
  background: linear-gradient(180deg, #22c8b3, #07877a);
  color: #fffdf6;
}

.settings-modal-content {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 22px 24px 26px;
}

.settings-section,
.settings-card {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 26px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.78), rgba(238, 251, 248, 0.52)),
    rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 42px rgba(31, 78, 72, 0.1);
}

.settings-section-hero {
  min-height: 150px;
  padding: 26px;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.86), rgba(217, 248, 240, 0.62) 58%, rgba(250, 235, 198, 0.42)),
    rgba(255, 255, 255, 0.42);
}

.settings-section-hero.display {
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.86), rgba(224, 244, 250, 0.62) 56%, rgba(223, 247, 236, 0.48)),
    rgba(255, 255, 255, 0.42);
}

.settings-section-hero.operation {
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.86), rgba(236, 247, 230, 0.62) 52%, rgba(252, 236, 205, 0.48)),
    rgba(255, 255, 255, 0.42);
}

.settings-section-hero.privacy {
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.86), rgba(232, 245, 252, 0.62) 56%, rgba(234, 247, 241, 0.48)),
    rgba(255, 255, 255, 0.42);
}

.settings-section-hero.account {
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.86), rgba(229, 249, 244, 0.58) 52%, rgba(246, 241, 221, 0.58)),
    rgba(255, 255, 255, 0.42);
}

.settings-language-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 24px;
  align-items: center;
}

.settings-language-copy {
  min-width: 0;
}

.settings-language-copy h3 {
  margin-top: 0;
}

.settings-language-picker {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(31, 92, 84, 0.1);
  border-radius: 20px;
  background:
    radial-gradient(circle at 22% 0%, rgba(255, 255, 255, 0.84), transparent 42%),
    rgba(255, 255, 255, 0.4);
}

.settings-section .settings-language-picker > span {
  color: var(--settings-muted);
  font-size: 12px;
  font-weight: 950;
}

.settings-language-picker .exchange-glass-select {
  width: 100%;
}

.settings-language-picker .exchange-glass-select-button {
  min-height: 46px;
  font-size: 17px;
  font-weight: 950;
}

.settings-section span,
.settings-card-title span {
  color: var(--settings-teal);
  font-size: 13px;
  font-weight: 950;
}

.settings-section h3 {
  margin: 8px 0 0;
  color: var(--settings-ink);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.04;
}

.settings-section p,
.settings-card-note {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--settings-muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.7;
}

.settings-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.settings-card-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--settings-line-dark);
}

.settings-card-title div {
  display: grid;
  gap: 5px;
}

.settings-card-title strong {
  color: var(--settings-ink);
  font-size: 22px;
  line-height: 1;
}

.settings-card-title small {
  color: var(--settings-muted);
  font-size: 13px;
  font-weight: 900;
}

.settings-reminder-table {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(31, 92, 84, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.36);
}

.settings-reminder-head,
.settings-reminder-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, 74px);
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(31, 92, 84, 0.08);
}

.settings-reminder-head {
  min-height: 44px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--settings-muted);
  font-size: 12px;
  font-weight: 950;
}

.settings-reminder-head b {
  text-align: center;
}

.settings-reminder-row:last-child {
  border-bottom: 0;
}

.settings-reminder-row > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-reminder-row strong,
.settings-action-row strong {
  color: var(--settings-ink);
  font-size: 16px;
  line-height: 1.15;
}

.settings-reminder-row small,
.settings-action-row small {
  color: var(--settings-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.settings-switch {
  justify-self: center;
  position: relative;
  width: 54px;
  height: 32px;
  border: 1px solid rgba(31, 92, 84, 0.14);
  border-radius: 999px;
  background: rgba(131, 160, 154, 0.3);
  cursor: pointer;
  box-shadow:
    inset 0 1px 3px rgba(33, 71, 66, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.settings-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 5px 12px rgba(33, 75, 69, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transition: transform 160ms ease;
}

.settings-switch.on {
  border-color: rgba(7, 147, 132, 0.26);
  background: linear-gradient(180deg, #25c9b4, #07887b);
}

.settings-switch.on i {
  transform: translateX(22px);
}

.settings-switch:disabled {
  cursor: default;
  opacity: 0.48;
}

.settings-threshold-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-threshold-control {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.44);
}

.settings-threshold-control span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-threshold-control strong {
  color: var(--settings-ink);
  font-size: 15px;
}

.settings-threshold-control b {
  color: var(--settings-teal);
  font-size: 17px;
}

.settings-threshold-control input {
  width: 100%;
  accent-color: var(--settings-teal);
}

.settings-row-list {
  display: grid;
  gap: 10px;
}

.settings-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, auto) auto;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid rgba(31, 92, 84, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.38);
}

.settings-action-row > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.settings-action-row > span {
  color: var(--settings-muted);
  font-size: 14px;
  font-weight: 950;
  text-align: right;
  white-space: nowrap;
}

.settings-inline-button,
.settings-action-strip button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 15px;
  background: linear-gradient(180deg, #23c5b2, #07897c);
  color: #fffdf6;
  cursor: pointer;
  font-size: 14px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 12px 24px rgba(7, 137, 124, 0.16);
}

.settings-inline-button:hover,
.settings-inline-button:focus-visible,
.settings-action-strip button:hover,
.settings-action-strip button:focus-visible {
  outline: 0;
  transform: translateY(-1px);
}

.settings-inline-button.danger {
  background: linear-gradient(180deg, #d8666f, #a83c45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 12px 24px rgba(168, 60, 69, 0.15);
}

.settings-segment {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(58px, 1fr));
  min-height: 38px;
  padding: 4px;
  border: 1px solid rgba(31, 92, 84, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.46);
}

.settings-segment button {
  min-width: 58px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--settings-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
}

.settings-segment button.selected {
  background: linear-gradient(180deg, #23c5b2, #07897c);
  color: #fffdf6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 8px 18px rgba(7, 137, 124, 0.14);
}

.settings-segment button:disabled {
  color: rgba(37, 67, 63, 0.34);
  cursor: default;
}

.settings-account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.settings-account-fact {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(31, 92, 84, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.4);
}

.settings-account-fact span {
  color: var(--settings-muted);
  font-size: 12px;
  font-weight: 900;
}

.settings-account-fact strong {
  overflow: hidden;
  color: var(--settings-ink);
  font-size: 17px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-danger-lite {
  border-color: rgba(216, 102, 111, 0.2);
}

@media (max-width: 980px) {
  .settings-modal-backdrop {
    padding: 12px;
  }

  .settings-modal-shell {
    width: min(720px, calc(100vw - 18px));
    max-height: calc(100dvh - 18px);
    border-radius: 26px;
  }

  .settings-modal-head {
    min-height: 104px;
    padding: 24px 76px 18px 22px;
  }

  .settings-modal-head-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-modal-layout {
    grid-template-columns: 1fr;
  }

  .settings-modal-rail {
    grid-auto-flow: column;
    grid-auto-columns: minmax(136px, 1fr);
    overflow-x: auto;
    padding: 14px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--settings-line-dark);
  }

  .settings-tab-button {
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 58px;
  }

  .settings-tab-button i {
    width: 38px;
    height: 38px;
  }

  .settings-modal-content {
    padding: 16px;
  }

  .settings-language-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-reminder-head,
  .settings-reminder-row {
    grid-template-columns: minmax(190px, 1fr) repeat(3, 62px);
  }

  .settings-threshold-grid,
  .settings-account-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .settings-modal-title-block strong {
    font-size: 42px;
  }

  .settings-modal-head-cards {
    grid-template-columns: 1fr;
  }

  .settings-head-card {
    min-height: 82px;
  }

  .settings-section-hero {
    min-height: auto;
    padding: 20px;
  }

  .settings-section h3 {
    font-size: 28px;
  }

  .settings-card {
    padding: 14px;
    border-radius: 22px;
  }

  .settings-reminder-table {
    overflow-x: auto;
  }

  .settings-reminder-head,
  .settings-reminder-row {
    min-width: 500px;
  }

  .settings-action-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .settings-action-row > span {
    grid-column: 1 / 2;
    grid-row: 2;
    text-align: left;
  }

  .settings-action-row > .settings-switch,
  .settings-action-row > .settings-inline-button,
  .settings-action-row > .settings-segment {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .settings-modal-backdrop,
  .settings-modal-shell {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .settings-modal-shell {
    background: rgba(246, 252, 249, 0.98);
  }
}
body[data-page="island"] .island-population-backdrop {
  bottom: var(--global-bottom-nav-reserve);
  padding: 24px 28px 20px;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.44), transparent 32%),
    radial-gradient(circle at 15% 72%, rgba(72, 205, 184, 0.24), transparent 36%),
    radial-gradient(circle at 90% 16%, rgba(255, 224, 139, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(211, 232, 229, 0.54), rgba(248, 241, 222, 0.42)),
    rgba(20, 31, 33, 0.18);
  -webkit-backdrop-filter: blur(26px) saturate(1.28);
  backdrop-filter: blur(26px) saturate(1.28);
}

body[data-page="island"] .island-population-modal {
  position: relative;
  isolation: isolate;
  width: min(1280px, calc(100vw - 56px));
  max-height: min(820px, calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 44px));
  overflow: hidden auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 32px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.74), transparent 34%),
    radial-gradient(circle at 92% 0%, rgba(255, 225, 126, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(229, 249, 244, 0.72) 52%, rgba(255, 248, 226, 0.76)),
    rgba(242, 250, 247, 0.9);
  color: #123733;
  box-shadow:
    0 34px 90px rgba(26, 55, 52, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(117, 159, 152, 0.16);
  scrollbar-color: rgba(8, 125, 103, 0.28) rgba(255, 255, 255, 0.25);
  scrollbar-width: thin;
  -webkit-backdrop-filter: blur(30px) saturate(1.3);
  backdrop-filter: blur(30px) saturate(1.3);
}

body[data-page="island"] .island-population-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 25%, rgba(255, 255, 255, 0.36) 38%, transparent 51%),
    radial-gradient(circle at 96% 82%, rgba(20, 176, 151, 0.1), transparent 34%);
  opacity: 0.92;
}

body[data-page="island"] .island-population-modal .island-cargo-modal-head,
body[data-page="island"] .island-population-detail-body {
  position: relative;
  z-index: 1;
}

body[data-page="island"] .island-population-modal .island-cargo-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 246, 242, 0.62)),
    rgba(255, 255, 255, 0.48);
  color: rgba(31, 62, 58, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 24px rgba(30, 68, 64, 0.14);
  font-size: 26px;
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

body[data-page="island"] .island-population-modal .island-cargo-close:hover,
body[data-page="island"] .island-population-modal .island-cargo-close:focus-visible {
  background: rgba(255, 255, 255, 0.84);
  color: #0f9183;
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .island-population-modal .island-cargo-modal-head {
  min-height: 112px;
  padding: 24px 82px 22px 26px;
  border-bottom: 1px solid rgba(43, 89, 82, 0.12);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.64), rgba(231, 249, 245, 0.38) 58%, rgba(255, 244, 213, 0.34)),
    rgba(255, 255, 255, 0.18);
}

body[data-page="island"] .island-population-modal .island-cargo-modal-head span {
  color: rgba(15, 111, 103, 0.74);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="island"] .island-population-modal .island-cargo-modal-head strong {
  color: #123733;
  font-size: clamp(28px, 2.5vw, 40px);
  font-weight: 850;
  line-height: 1.06;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

body[data-page="island"] .island-population-modal .island-cargo-modal-head em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  min-width: 140px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 6%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(250, 242, 211, 0.5)),
    rgba(255, 255, 255, 0.36);
  color: #a66b0c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(120, 84, 20, 0.07),
    0 12px 28px rgba(120, 91, 34, 0.08);
  font-size: 26px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(1.24);
  backdrop-filter: blur(22px) saturate(1.24);
}

body[data-page="island"] .island-population-detail-body {
  gap: 12px;
  padding: 18px 22px 22px;
  color: #123733;
}

body[data-page="island"] .island-population-overview {
  gap: 12px;
}

body[data-page="island"] .island-population-stat {
  min-height: 104px;
  padding: 16px 17px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(235, 249, 246, 0.48)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 12px 26px rgba(37, 72, 66, 0.1);
  color: #143432;
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

body[data-page="island"] .island-population-stat span {
  color: rgba(35, 62, 58, 0.62);
  font-size: 13px;
  letter-spacing: 0;
}

body[data-page="island"] .island-population-stat strong {
  color: #143432;
  font-size: 30px;
  font-weight: 900;
}

body[data-page="island"] .island-population-stat small {
  color: rgba(35, 62, 58, 0.58);
  font-size: 12px;
}

body[data-page="island"] .island-population-stat.warning {
  border-color: rgba(232, 174, 52, 0.34);
  box-shadow:
    inset 4px 0 0 rgba(232, 174, 52, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 12px 26px rgba(189, 135, 31, 0.1);
}

body[data-page="island"] .island-population-stat.warning strong {
  color: #a66b0c;
}

body[data-page="island"] .island-population-stat.danger {
  border-color: rgba(235, 91, 91, 0.34);
  box-shadow:
    inset 4px 0 0 rgba(235, 91, 91, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 12px 26px rgba(190, 57, 57, 0.1);
}

body[data-page="island"] .island-population-stat.danger strong {
  color: #c74e47;
}

body[data-page="island"] .island-population-panel {
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(232, 249, 245, 0.5)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    0 22px 54px rgba(37, 72, 66, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(83, 129, 121, 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  backdrop-filter: blur(18px) saturate(1.16);
}

body[data-page="island"] .island-population-panel-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(43, 89, 82, 0.12);
}

body[data-page="island"] .island-population-panel-head strong {
  color: #123733;
  font-size: 22px;
  font-weight: 900;
}

body[data-page="island"] .island-population-panel-head span {
  color: rgba(35, 62, 58, 0.58);
  font-size: 12px;
}

body[data-page="island"] .island-population-panel-body {
  padding: 12px 14px 14px;
  overflow: visible;
}

body[data-page="island"] .island-population-table {
  gap: 8px;
  overflow: visible;
}

body[data-page="island"] .island-population-table-head,
body[data-page="island"] .island-population-row {
  grid-template-columns: minmax(210px, 1.05fr) minmax(218px, 1fr) repeat(5, minmax(86px, 0.58fr)) 56px;
}

body[data-page="island"] .island-population-table-head {
  top: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(234, 248, 244, 0.46)),
    rgba(255, 255, 255, 0.36);
  color: rgba(38, 70, 65, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
  font-size: 12px;
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  backdrop-filter: blur(14px) saturate(1.12);
}

body[data-page="island"] .island-population-row {
  min-height: 78px;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid rgba(33, 112, 97, 0.12);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(236, 249, 245, 0.4)),
    rgba(255, 255, 255, 0.3);
  color: #143432;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(37, 72, 66, 0.06);
}

body[data-page="island"] .island-population-row.expanded {
  border-color: rgba(15, 145, 131, 0.28);
  background:
    linear-gradient(145deg, rgba(235, 255, 249, 0.78), rgba(255, 255, 255, 0.54)),
    rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 4px 0 0 rgba(15, 145, 131, 0.68),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(15, 145, 131, 0.1);
}

body[data-page="island"] .island-population-row.empty {
  opacity: 0.72;
}

body[data-page="island"] .island-population-row.tier-1 {
  --population-tier-color: #4b5c58;
  --population-tier-soft: rgba(255, 255, 255, 0.7);
  --population-tier-border: rgba(142, 159, 154, 0.32);
}

body[data-page="island"] .island-population-row.tier-2 {
  --population-tier-color: #3f8d4d;
  --population-tier-soft: rgba(130, 204, 117, 0.18);
  --population-tier-border: rgba(91, 168, 84, 0.36);
}

body[data-page="island"] .island-population-row.tier-3 {
  --population-tier-color: #2c7faa;
  --population-tier-soft: rgba(101, 176, 223, 0.18);
  --population-tier-border: rgba(55, 134, 186, 0.36);
}

body[data-page="island"] .island-population-row.tier-4 {
  --population-tier-color: #9c589f;
  --population-tier-soft: rgba(198, 119, 197, 0.18);
  --population-tier-border: rgba(159, 82, 166, 0.36);
}

body[data-page="island"] .island-population-worker-icon {
  width: 52px;
  height: 52px;
  box-sizing: border-box;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="island"] .island-population-worker-icon .workforce-type-icon {
  width: 48px;
  height: 48px;
  border-radius: 0;
  object-fit: contain;
}

body[data-page="island"] .island-population-worker strong {
  color: var(--population-tier-color, #2c7faa);
  font-size: 19px;
  font-weight: 900;
  text-shadow: none;
}

body[data-page="island"] .island-population-worker small {
  color: rgba(35, 62, 58, 0.58);
  font-size: 12px;
}

body[data-page="island"] .island-population-wage.empty,
body[data-page="island"] .island-population-wage small,
body[data-page="island"] .island-population-wage em,
body[data-page="island"] .island-population-wage-current span {
  color: rgba(35, 62, 58, 0.58);
}

body[data-page="island"] .island-population-wage em {
  color: #0f9b82;
}

body[data-page="island"] .island-population-wage.cooling em {
  color: #a66b0c;
}

body[data-page="island"] .island-population-wage-current strong {
  color: #143432;
}

body[data-page="island"] .island-population-wage-option {
  height: 27px;
  border: 1px solid rgba(43, 89, 82, 0.14);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(235, 249, 246, 0.44)),
    rgba(255, 255, 255, 0.28);
  color: rgba(35, 62, 58, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

body[data-page="island"] .island-population-wage-option.active {
  border-color: rgba(15, 145, 131, 0.4);
  background: linear-gradient(180deg, #22c9b4, #078676);
  color: #ffffff;
}

body[data-page="island"] .island-population-wage-option:not(:disabled):hover {
  border-color: rgba(15, 145, 131, 0.42);
  color: #0b7f72;
}

body[data-page="island"] .island-population-number {
  color: #143432;
  font-size: 20px;
}

body[data-page="island"] .island-population-number.available,
body[data-page="island"] .island-population-number.savings {
  color: #0f9b82;
}

body[data-page="island"] .island-population-number.unemployment {
  color: #c74e47;
}

body[data-page="island"] .island-population-row.empty .island-population-number,
body[data-page="island"] .island-population-mood.empty {
  color: rgba(35, 62, 58, 0.42);
}

body[data-page="island"] .island-population-mood {
  color: #0f9b82;
}

body[data-page="island"] .island-population-mood > span:not(.island-population-help) {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(225, 247, 241, 0.42)),
    rgba(15, 145, 131, 0.08);
  color: currentColor;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body[data-page="island"] .island-population-mood.warning {
  color: #a66b0c;
}

body[data-page="island"] .island-population-mood.warning > span:not(.island-population-help) {
  background: rgba(232, 174, 52, 0.13);
}

body[data-page="island"] .island-population-mood.danger {
  color: #c74e47;
}

body[data-page="island"] .island-population-mood.danger > span:not(.island-population-help) {
  background: rgba(235, 91, 91, 0.13);
}

body[data-page="island"] .island-population-help-button {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(235, 91, 91, 0.48);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 234, 232, 0.56)),
    rgba(255, 255, 255, 0.36);
  color: #b6433e;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 14px rgba(190, 57, 57, 0.12);
}

body[data-page="island"] .island-population-help-button:hover,
body[data-page="island"] .island-population-help-button:focus-visible {
  border-color: rgba(199, 78, 71, 0.64);
  background: rgba(255, 255, 255, 0.84);
  color: #9e2f2a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0 0 4px rgba(235, 91, 91, 0.12);
}

body[data-page="island"] .island-population-help-popover {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(234, 249, 245, 0.78)),
    rgba(255, 255, 255, 0.78);
  color: rgba(35, 62, 58, 0.78);
  box-shadow:
    0 18px 38px rgba(31, 65, 60, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

body[data-page="island"] .island-population-help-popover::before {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(248, 253, 250, 0.94);
}

body[data-page="island"] .island-population-help-popover strong {
  color: #123733;
}

body[data-page="island"] .island-population-help-popover span {
  color: rgba(35, 62, 58, 0.74);
}

body[data-page="island"] .island-population-expand-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(235, 249, 246, 0.5)),
    rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 18px rgba(37, 72, 66, 0.08);
}

body[data-page="island"] .island-population-expand-button:hover,
body[data-page="island"] .island-population-row.expanded .island-population-expand-button {
  border-color: rgba(15, 145, 131, 0.36);
  background:
    linear-gradient(145deg, rgba(235, 255, 249, 0.84), rgba(255, 255, 255, 0.6)),
    rgba(255, 255, 255, 0.44);
}

body[data-page="island"] .island-population-expand-button span {
  border-right-color: #345b56;
  border-bottom-color: #345b56;
}

body[data-page="island"] .island-population-need-dropdown {
  margin: 0 0 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(232, 249, 245, 0.54)),
    rgba(255, 255, 255, 0.46);
  color: #143432;
  box-shadow:
    0 18px 38px rgba(37, 72, 66, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  backdrop-filter: blur(18px) saturate(1.16);
}

body[data-page="island"] .island-population-need-summary {
  min-height: 46px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(43, 89, 82, 0.12);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.64), rgba(231, 249, 245, 0.48)),
    rgba(255, 255, 255, 0.26);
}

body[data-page="island"] .island-population-need-summary strong {
  color: #123733;
  font-size: 14px;
}

body[data-page="island"] .island-population-need-summary span {
  color: rgba(35, 62, 58, 0.62);
  font-size: 12px;
}

body[data-page="island"] .island-population-need-support-head {
  min-height: 38px;
  border-bottom: 1px solid rgba(43, 89, 82, 0.12);
  color: rgba(38, 70, 65, 0.58);
}

body[data-page="island"] .island-population-need-support-row {
  min-height: 50px;
  border-bottom: 1px solid rgba(43, 89, 82, 0.09);
  color: #143432;
}

body[data-page="island"] .island-population-need-support-row:hover {
  background: rgba(255, 255, 255, 0.42);
}

body[data-page="island"] .island-population-need-product i {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(235, 249, 246, 0.48)),
    rgba(255, 255, 255, 0.42);
  color: #123733;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 8px 16px rgba(37, 72, 66, 0.08);
}

body[data-page="island"] .island-population-need-product strong {
  color: #007f8b;
  font-size: 14px;
}

body[data-page="island"] .island-population-need-type {
  min-width: 64px;
  padding: 5px 9px;
  border: 1px solid rgba(43, 89, 82, 0.1);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 246, 0.42)),
    rgba(255, 255, 255, 0.34);
  color: rgba(35, 62, 58, 0.68);
}

body[data-page="island"] .island-population-need-type.required {
  border-color: rgba(235, 91, 91, 0.22);
  background: rgba(235, 91, 91, 0.08);
  color: #b6433e;
}

body[data-page="island"] .island-population-need-support-row > span {
  color: #143432;
}

body[data-page="island"] .island-population-need-support-row .island-population-need-support {
  color: #123733;
}

body[data-page="island"] .island-population-need-support-row.warning .island-population-need-support {
  color: #a66b0c;
}

body[data-page="island"] .island-population-need-support-row.danger .island-population-need-support {
  color: #c74e47;
}

body[data-page="island"] .island-population-needs-empty,
body[data-page="island"] .island-population-empty {
  border-color: rgba(43, 89, 82, 0.16);
  color: rgba(35, 62, 58, 0.42);
}

@media (max-width: 900px) {
  body[data-page="island"] .island-population-backdrop {
    padding: 16px;
  }

  body[data-page="island"] .island-population-modal {
    width: calc(100vw - 32px);
    max-height: calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 32px);
  }

  body[data-page="island"] .island-population-panel-body {
    overflow-x: auto;
    scrollbar-color: rgba(8, 125, 103, 0.28) rgba(255, 255, 255, 0.25);
    scrollbar-width: thin;
  }

  body[data-page="island"] .island-population-table {
    min-width: 920px;
  }
}

@media (max-width: 560px) {
  body[data-page="island"] .island-population-backdrop {
    padding: 12px;
  }

  body[data-page="island"] .island-population-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 24px);
    border-radius: 26px;
  }

  body[data-page="island"] .island-population-modal .island-cargo-modal-head {
    min-height: 96px;
    padding: 18px 64px 16px 18px;
  }

  body[data-page="island"] .island-population-modal .island-cargo-modal-head strong {
    font-size: 24px;
  }

  body[data-page="island"] .island-population-modal .island-cargo-modal-head em {
    min-width: 106px;
    min-height: 46px;
    padding: 0 16px;
    font-size: 20px;
  }

  body[data-page="island"] .island-population-detail-body {
    gap: 12px;
    padding: 12px;
  }

  body[data-page="island"] .island-population-overview {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .island-population-table {
    min-width: 900px;
  }

  body[data-page="island"] .island-population-need-support-table {
    overflow-x: auto;
  }

  body[data-page="island"] .island-population-need-support-head,
  body[data-page="island"] .island-population-need-support-row {
    min-width: 700px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  body[data-page="island"] .island-population-backdrop,
  body[data-page="island"] .island-population-modal,
  body[data-page="island"] .island-population-stat,
  body[data-page="island"] .island-population-panel,
  body[data-page="island"] .island-population-row,
  body[data-page="island"] .island-population-need-dropdown {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  body[data-page="island"] .island-population-modal {
    background: rgba(247, 252, 249, 0.97);
  }
}

/* Currency modal: gold panel as a focused overlay. */
body.currency-modal-open {
  overflow: hidden;
}

.currency-page-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 96px;
  padding: 18px;
  border: 1px solid rgba(210, 226, 223, 0.9);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 248, 244, 0.72)),
    rgba(248, 252, 250, 0.9);
  box-shadow: 0 18px 42px rgba(34, 65, 60, 0.1);
}

.currency-page-entry div {
  display: grid;
  gap: 5px;
}

.currency-page-entry span {
  color: rgba(36, 61, 57, 0.62);
  font-size: 13px;
  font-weight: 900;
}

.currency-page-entry strong {
  color: #143733;
  font-size: 28px;
  line-height: 1;
}

.currency-page-entry button {
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #25c9b4, #07877c);
  color: #fffdf6;
  cursor: pointer;
  font-size: 16px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 14px 28px rgba(8, 126, 116, 0.22);
}

.currency-modal-backdrop {
  position: fixed;
  z-index: 5260;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(219, 239, 235, 0.58);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  backdrop-filter: blur(22px) saturate(1.18);
}

.currency-modal-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(760px, calc(100vw - 48px));
  max-height: min(820px, calc(100dvh - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(228, 249, 244, 0.78) 58%, rgba(255, 248, 224, 0.74)),
    rgba(246, 252, 249, 0.92);
  color: #133632;
  box-shadow:
    0 38px 96px rgba(27, 61, 56, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(108, 152, 146, 0.14);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  backdrop-filter: blur(28px) saturate(1.2);
}

.currency-modal-close {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  color: #244a47;
  cursor: pointer;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(31, 74, 68, 0.12);
}

.currency-modal-close:hover,
.currency-modal-close:focus-visible {
  background: rgba(255, 255, 255, 0.88);
  outline: 0;
  transform: translateY(-1px);
}

.currency-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 104px;
  padding: 22px 84px 18px 24px;
  border-bottom: 1px solid rgba(42, 94, 86, 0.1);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.68), rgba(233, 249, 245, 0.42));
}

.currency-modal-head div {
  display: grid;
  gap: 6px;
}

.currency-modal-head span {
  color: #a16e10;
  font-size: 13px;
  font-weight: 950;
}

.currency-modal-head strong {
  color: #123733;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1;
}

.currency-modal-head em {
  justify-self: end;
  min-width: 150px;
  padding: 10px 15px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(246, 214, 106, 0.96), rgba(217, 157, 40, 0.92));
  color: #fffdf2;
  font-style: normal;
  font-size: 22px;
  font-weight: 1000;
  text-align: center;
  text-shadow: 0 1px 2px rgba(82, 51, 0, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 12px 24px rgba(172, 120, 30, 0.18);
}

.currency-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 20px;
}

.currency-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.currency-modal-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(241, 251, 248, 0.54)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 18px 38px rgba(30, 71, 65, 0.1);
}

.currency-modal-card .recipe-preview-title {
  margin-bottom: 2px;
}

.currency-modal-card .recipe-preview-title strong {
  color: #143733;
  font-size: 22px;
}

.currency-modal-card .recipe-preview-title span {
  color: rgba(37, 70, 66, 0.56);
  font-weight: 900;
}

.currency-modal-card .stat-row {
  border-color: rgba(37, 70, 66, 0.09);
  padding: 10px 0;
}

.currency-modal-card .stat-row span {
  color: rgba(37, 70, 66, 0.62);
}

.currency-modal-card .stat-row strong {
  color: #123733;
}

.currency-modal-card .form-row {
  gap: 7px;
  color: rgba(37, 70, 66, 0.66);
  font-weight: 900;
}

.currency-modal-card .form-row input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(41, 97, 89, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #173733;
  font: inherit;
  font-size: 16px;
  font-weight: 850;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 18px rgba(36, 76, 70, 0.07);
}

.currency-modal-card .form-row input:focus {
  border-color: rgba(10, 139, 128, 0.52);
  box-shadow:
    0 0 0 4px rgba(18, 183, 164, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.currency-modal-card .job-detail {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
  color: rgba(37, 70, 66, 0.64);
}

.currency-modal-card button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #27c9b5, #0a857b);
  color: #fffdf6;
  cursor: pointer;
  font-size: 18px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 14px 28px rgba(8, 126, 116, 0.2);
}

.currency-modal-card button:hover:not(:disabled),
.currency-page-entry button:hover {
  transform: translateY(-1px);
}

.currency-modal-card button:disabled {
  background: linear-gradient(180deg, rgba(159, 200, 194, 0.82), rgba(128, 177, 171, 0.82));
  color: rgba(255, 255, 255, 0.78);
  cursor: default;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

#currencyModalHost .currency-pool-card {
  grid-column: 1 / -1;
}

#currencyModalHost .currency-golden-card {
  grid-column: 1 / -1;
}

#currencyModalHost .currency-golden-card .payment-package-row {
  position: relative;
  display: grid;
  align-items: center;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 100px;
  margin: 0;
  padding: 12px 16px 12px 18px;
  border: 1px solid rgba(42, 91, 83, 0.08);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(241, 251, 247, 0.42)),
    rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 10px 22px rgba(34, 83, 77, 0.07);
}

#currencyModalHost .currency-golden-card .payment-package-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd77a, #a66a00);
}

#currencyModalHost .currency-golden-card .payment-golden-package-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
}

#currencyModalHost .currency-golden-card .payment-golden-package-icon img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter:
    drop-shadow(0 8px 16px rgba(47, 112, 122, 0.13))
    drop-shadow(0 1px 1px rgba(255, 255, 255, 0.7));
}

#currencyModalHost .currency-golden-card .payment-package-copy {
  min-width: 0;
}

#currencyModalHost .currency-golden-card .payment-package-copy strong {
  color: #123733;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
}

#currencyModalHost .currency-golden-card .payment-package-copy small {
  color: rgba(37, 70, 66, 0.62);
  font-size: 14px;
  font-weight: 850;
}

#currencyModalHost .currency-golden-card .payment-note {
  margin: 0;
}

#currencyModalHost .currency-golden-card button.small {
  min-width: 116px;
  min-height: 44px;
  padding: 8px 16px 8px 10px;
  border: 1px solid rgba(70, 169, 213, 0.54);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(174, 224, 250, 0.98), rgba(93, 184, 226, 0.98)),
    #68bde8;
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
  text-shadow: 0 2px 3px rgba(31, 102, 138, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 9px 18px rgba(55, 150, 199, 0.24);
}

#currencyModalHost .currency-golden-card .payment-gem-price-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#currencyModalHost .currency-golden-card .payment-gem-price-button img {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter:
    drop-shadow(0 2px 2px rgba(12, 82, 126, 0.24))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.72));
}

#currencyModalHost .currency-golden-card .payment-gem-price-button span {
  line-height: 1;
}

#currencyModalHost .currency-golden-card button.small:disabled {
  border-color: rgba(70, 169, 213, 0.42);
  background:
    linear-gradient(180deg, rgba(174, 224, 250, 0.86), rgba(93, 184, 226, 0.82)),
    #68bde8;
  color: rgba(255, 255, 255, 0.9);
  opacity: 0.82;
  text-shadow: 0 2px 3px rgba(31, 102, 138, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 6px 12px rgba(55, 150, 199, 0.14);
}

@media (max-width: 820px) {
  .currency-modal-backdrop {
    place-items: end center;
    padding: 12px;
  }

  .currency-modal-shell {
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 26px 26px 0 0;
  }

  .currency-modal-head {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 20px 76px 18px 18px;
  }

  .currency-modal-head em {
    justify-self: start;
    min-width: 0;
  }

  .currency-modal-body {
    padding: 14px;
  }

  .currency-modal-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #currencyModalHost .currency-golden-card .payment-package-row {
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 90px;
    padding: 12px 14px;
  }

  #currencyModalHost .currency-golden-card .payment-golden-package-icon,
  #currencyModalHost .currency-golden-card .payment-golden-package-icon img {
    width: 58px;
    height: 58px;
  }

  #currencyModalHost .currency-golden-card button.small {
    grid-column: 1 / -1;
    width: 100%;
  }

  .currency-page-entry {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .currency-modal-backdrop,
  .currency-modal-shell {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .currency-modal-shell {
    background: rgba(247, 252, 249, 0.98);
  }
}

/* Production overview: generated image gear icon rotation. */
.building-production-idle .industrial-gear-icon,
.industrial-gear-active-icon {
  overflow: hidden;
}

.industrial-gear-image {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 3px 5px rgba(6, 48, 43, 0.18));
}

.industrial-gear-image.is-spinning {
  animation: industrial-gear-spin 8s linear infinite;
  will-change: transform;
}

body[data-page="island"] .building-plot-modal .industrial-gear-image {
  width: 48px;
  height: 48px;
}

@keyframes industrial-gear-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .industrial-gear-image.is-spinning {
    animation: none;
  }
}

/* iOS 27-inspired payment page. This is a web glass approximation. */
body[data-page="payment"] {
  --payment-ink: #143a35;
  --payment-muted: rgba(41, 71, 66, 0.68);
  --payment-teal: #0b9183;
  --payment-teal-deep: #08786e;
  --payment-gold: #a66a00;
  --payment-gem: #3a9fc6;
  background:
    radial-gradient(circle at 14% 7%, rgba(116, 217, 202, 0.2), transparent 34%),
    radial-gradient(circle at 90% 14%, rgba(255, 226, 138, 0.22), transparent 34%),
    linear-gradient(135deg, #eef9f7 0%, #fbfaf1 100%);
  color: var(--payment-ink);
}

body[data-page="payment"] #paymentPage {
  color: var(--payment-ink);
}

body[data-page="payment"] #paymentPage > section {
  width: min(1660px, calc(100vw - 72px));
  margin: 0 auto;
  padding: 24px 0 116px;
}

body[data-page="payment"] #paymentPage > section > h2 {
  margin: 0 0 16px;
  padding-left: 2px;
  color: #123832;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

body[data-page="payment"] #payment {
  display: grid;
  gap: 18px;
}

body[data-page="payment"] .payment-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 18px;
  align-items: center;
  overflow: hidden;
  min-height: 150px;
  padding: 24px 26px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.92), transparent 40%),
    radial-gradient(circle at 78% 12%, rgba(76, 213, 194, 0.22), transparent 42%),
    radial-gradient(circle at 94% 74%, rgba(255, 209, 111, 0.24), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(233, 250, 246, 0.52)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(25, 86, 78, 0.08),
    0 28px 70px rgba(38, 87, 80, 0.16);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
}

body[data-page="payment"] .payment-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -42%;
  background:
    linear-gradient(112deg, transparent 0 38%, rgba(255, 255, 255, 0.34) 45%, transparent 54%),
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.36), transparent 24%);
  filter: blur(8px);
  transform: rotate(-5deg);
  pointer-events: none;
}

body[data-page="payment"] .payment-hero-copy {
  display: grid;
  gap: 8px;
}

body[data-page="payment"] .payment-hero-copy span {
  color: #189b8d;
  font-size: 13px;
  font-weight: 950;
}

body[data-page="payment"] .payment-hero-copy strong {
  color: #103a34;
  font-size: clamp(30px, 3.2vw, 54px);
  font-weight: 950;
  line-height: 1.02;
  letter-spacing: 0;
}

body[data-page="payment"] .payment-hero-copy small {
  color: var(--payment-muted);
  font-size: 16px;
  font-weight: 850;
}

body[data-page="payment"] .payment-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(126px, 1fr));
  gap: 10px;
  min-width: min(560px, 48vw);
}

body[data-page="payment"] .payment-hero-metrics span {
  display: grid;
  gap: 8px;
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(243, 251, 248, 0.42)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 12px 26px rgba(25, 82, 74, 0.08);
}

body[data-page="payment"] .payment-hero-metrics em {
  color: rgba(41, 71, 66, 0.64);
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

body[data-page="payment"] .payment-hero-metrics b {
  color: #133b35;
  font-size: 25px;
  font-weight: 950;
  line-height: 1;
}

body[data-page="payment"] .payment-console {
  grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: start;
}

body[data-page="payment"] .payment-column {
  display: grid;
  gap: 18px;
  min-width: 0;
  align-content: start;
}

body[data-page="payment"] .payment-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.88), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(235, 250, 246, 0.5)),
    rgba(255, 255, 255, 0.46);
  color: var(--payment-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(27, 92, 83, 0.08),
    0 20px 52px rgba(34, 83, 77, 0.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.34);
  backdrop-filter: blur(22px) saturate(1.34);
}

body[data-page="payment"] .payment-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1px;
  border-radius: 27px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.28), transparent 40%),
    radial-gradient(circle at 92% 10%, rgba(54, 197, 180, 0.14), transparent 28%);
  pointer-events: none;
}

body[data-page="payment"] .payment-status-card {
  align-content: start;
}

body[data-page="payment"] .payment-card-title {
  min-height: 40px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(42, 91, 83, 0.1);
}

body[data-page="payment"] .payment-card-title strong {
  color: #123a35;
  font-size: 22px;
  font-weight: 950;
  line-height: 1.1;
}

body[data-page="payment"] .payment-card-title span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(238, 250, 246, 0.46)),
    rgba(20, 113, 103, 0.08);
  color: rgba(31, 66, 60, 0.72);
  font-size: 13px;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body[data-page="payment"] .payment-card .stat-row {
  min-height: 42px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(42, 91, 83, 0.08);
}

body[data-page="payment"] .payment-card .stat-row span {
  color: var(--payment-muted);
  font-size: 16px;
  font-weight: 850;
}

body[data-page="payment"] .payment-card .stat-row strong {
  color: #123a35;
  font-size: 20px;
  font-weight: 950;
}

body[data-page="payment"] .payment-benefit-list,
body[data-page="payment"] .payment-note {
  display: grid;
  gap: 5px;
  margin: 2px 0 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(239, 250, 246, 0.36)),
    rgba(255, 255, 255, 0.28);
  color: rgba(35, 70, 64, 0.76);
  font-size: 13.5px;
  font-weight: 850;
  line-height: 1.42;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="payment"] .payment-benefit-list div {
  position: relative;
  padding-left: 16px;
}

body[data-page="payment"] .payment-benefit-list div::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #32d4bb, #078f80);
  box-shadow: 0 0 0 4px rgba(41, 202, 182, 0.12);
}

body[data-page="payment"] .payment-actions {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

body[data-page="payment"] .payment-card button {
  min-height: 40px;
  border: 1px solid rgba(8, 143, 128, 0.34);
  border-radius: 14px;
  background:
    linear-gradient(180deg, #27cbb3, #0a9384 52%, #08786e);
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 10px 20px rgba(7, 112, 101, 0.18);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
}

body[data-page="payment"] .payment-card button.small {
  min-width: 96px;
  padding: 8px 14px;
  border-radius: 13px;
}

body[data-page="payment"] .payment-card button:hover:not(:disabled),
body[data-page="payment"] .payment-card button:focus-visible:not(:disabled) {
  border-color: rgba(7, 143, 128, 0.58);
  background:
    linear-gradient(180deg, #34d8c0, #0b9f90 52%, #078277);
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="payment"] .payment-card button:active:not(:disabled) {
  transform: translateY(0);
}

body[data-page="payment"] .payment-card button.secondary {
  border-color: rgba(18, 77, 69, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(239, 250, 246, 0.5)),
    rgba(255, 255, 255, 0.42);
  color: #234740;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 18px rgba(24, 70, 63, 0.08);
  text-shadow: none;
}

body[data-page="payment"] .payment-card button.secondary:hover:not(:disabled),
body[data-page="payment"] .payment-card button.secondary:focus-visible:not(:disabled) {
  border-color: rgba(8, 143, 128, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(232, 249, 244, 0.62)),
    rgba(255, 255, 255, 0.52);
  color: #123a35;
}

body[data-page="payment"] .payment-card button:disabled {
  border-color: rgba(38, 73, 67, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(229, 240, 236, 0.28)),
    rgba(255, 255, 255, 0.18);
  color: rgba(38, 73, 67, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
  text-shadow: none;
}

body[data-page="payment"] .payment-package-row {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 76px;
  margin-top: 0;
  padding: 14px 16px;
  border: 1px solid rgba(42, 91, 83, 0.08);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(241, 251, 247, 0.42)),
    rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 22px rgba(34, 83, 77, 0.07);
}

body[data-page="payment"] .payment-gem-package-row,
body[data-page="payment"] .payment-membership-package-row,
body[data-page="payment"] .payment-golden-package-row {
  grid-template-columns: 82px minmax(0, 1fr) auto;
  min-height: 104px;
  padding: 12px 16px 12px 18px;
  gap: 14px;
}

body[data-page="payment"] .payment-gem-package-icon,
body[data-page="payment"] .payment-membership-package-icon,
body[data-page="payment"] .payment-golden-package-icon {
  align-items: center;
  align-self: center;
  display: inline-flex;
  height: 76px;
  justify-content: center;
  position: relative;
  width: 76px;
}

body[data-page="payment"] .payment-gem-package-icon img,
body[data-page="payment"] .payment-membership-package-icon img,
body[data-page="payment"] .payment-golden-package-icon img {
  display: block;
  height: 76px;
  object-fit: contain;
  width: 76px;
  filter:
    drop-shadow(0 8px 16px rgba(47, 112, 122, 0.13))
    drop-shadow(0 1px 1px rgba(255, 255, 255, 0.7));
}

body[data-page="payment"] .payment-package-copy {
  min-width: 0;
}

body[data-page="payment"] .payment-package-row:first-of-type {
  border: 1px solid rgba(42, 91, 83, 0.08);
}

body[data-page="payment"] .payment-package-row:hover {
  border-color: rgba(8, 143, 128, 0.25);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(236, 251, 247, 0.5)),
    rgba(255, 255, 255, 0.42);
}

body[data-page="payment"] .payment-package-row strong {
  color: #123a35;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="payment"] .payment-package-row small {
  color: rgba(41, 71, 66, 0.62);
  font-size: 14px;
  font-weight: 850;
}

body[data-page="payment"] .payment-gems-card .payment-package-row::before,
body[data-page="payment"] .payment-premium-card .payment-package-row::before,
body[data-page="payment"] .payment-golden-card .payment-package-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 999px;
}

body[data-page="payment"] .payment-gems-card .payment-package-row::before {
  background: linear-gradient(180deg, #8bd7f4, var(--payment-gem));
}

body[data-page="payment"] .payment-premium-card .payment-package-row::before {
  background: linear-gradient(180deg, #6fd9c9, #d7b65a);
}

body[data-page="payment"] .payment-golden-card .payment-package-row::before {
  background: linear-gradient(180deg, #ffd77a, var(--payment-gold));
}

body[data-page="payment"] .payment-transaction-row .right-align {
  color: #123a35;
  font-weight: 950;
}

body[data-page="payment"] .payment-transactions-card .empty-text {
  min-height: 80px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(42, 91, 83, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.34);
  color: rgba(41, 71, 66, 0.56);
  font-weight: 850;
}

@media (max-width: 1100px) {
  body[data-page="payment"] #paymentPage > section {
    width: min(100%, calc(100vw - 28px));
    padding-top: 14px;
  }

  body[data-page="payment"] .payment-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="payment"] .payment-hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  body[data-page="payment"] .payment-console {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="payment"] .payment-status-card {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  body[data-page="payment"] #paymentPage > section {
    width: min(100%, calc(100vw - 18px));
    padding-bottom: 108px;
  }

  body[data-page="payment"] .payment-hero,
  body[data-page="payment"] .payment-card {
    border-radius: 24px;
    padding: 16px;
  }

  body[data-page="payment"] .payment-hero-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="payment"] .payment-package-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  body[data-page="payment"] .payment-gem-package-row,
  body[data-page="payment"] .payment-membership-package-row,
  body[data-page="payment"] .payment-golden-package-row {
    grid-template-columns: 64px minmax(0, 1fr);
    min-height: 90px;
    padding: 12px 14px;
  }

  body[data-page="payment"] .payment-gem-package-icon,
  body[data-page="payment"] .payment-membership-package-icon,
  body[data-page="payment"] .payment-golden-package-icon,
  body[data-page="payment"] .payment-gem-package-icon img,
  body[data-page="payment"] .payment-membership-package-icon img,
  body[data-page="payment"] .payment-golden-package-icon img {
    height: 58px;
    width: 58px;
  }

  body[data-page="payment"] .payment-gem-package-row button.small,
  body[data-page="payment"] .payment-membership-package-row button.small,
  body[data-page="payment"] .payment-golden-package-row button.small {
    grid-column: 1 / -1;
  }

  body[data-page="payment"] .payment-card button.small {
    width: 100%;
  }
}

@media (prefers-reduced-transparency: reduce) {
  body[data-page="payment"] .payment-hero,
  body[data-page="payment"] .payment-card {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(247, 252, 249, 0.98);
  }
}

/* iOS 27-inspired building upgrade confirmation. Web glass approximation. */
body[data-page="island"] .building-upgrade-confirm-backdrop {
  z-index: calc(var(--global-workbench-modal-z, 5400) + 60);
  top: var(--global-topbar-height);
  bottom: var(--global-bottom-nav-reserve);
  padding: 18px;
  background:
    radial-gradient(circle at 24% 14%, rgba(151, 232, 221, 0.26), transparent 36%),
    radial-gradient(circle at 82% 18%, rgba(255, 226, 146, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(225, 244, 241, 0.52), rgba(247, 242, 225, 0.42)),
    rgba(17, 38, 37, 0.18);
  -webkit-backdrop-filter: blur(26px) saturate(1.36);
  backdrop-filter: blur(26px) saturate(1.36);
}

body[data-page="island"] .building-upgrade-confirm {
  position: relative;
  isolation: isolate;
  width: min(560px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 32px));
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.92), transparent 42%),
    radial-gradient(circle at 86% 18%, rgba(75, 214, 195, 0.23), transparent 38%),
    radial-gradient(circle at 94% 86%, rgba(255, 216, 123, 0.2), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(231, 250, 246, 0.64)),
    rgba(255, 255, 255, 0.52);
  color: #113c36;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(26, 91, 83, 0.08),
    0 30px 86px rgba(20, 67, 63, 0.24),
    0 10px 30px rgba(19, 58, 54, 0.12);
  -webkit-backdrop-filter: blur(28px) saturate(1.42);
  backdrop-filter: blur(28px) saturate(1.42);
}

body[data-page="island"] .building-upgrade-confirm::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1px;
  border-radius: 33px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.56), transparent 36%),
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.52), transparent 24%),
    radial-gradient(circle at 78% 4%, rgba(75, 214, 195, 0.18), transparent 32%);
  pointer-events: none;
}

body[data-page="island"] .building-upgrade-confirm-head {
  align-items: center;
  padding: 24px 26px 18px;
  border-bottom: 1px solid rgba(34, 86, 78, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.12)),
    transparent;
}

body[data-page="island"] .building-upgrade-confirm-head div {
  gap: 8px;
}

body[data-page="island"] .building-upgrade-confirm-head span {
  color: #219f91;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="island"] .building-upgrade-confirm-head strong {
  color: #123b35;
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: 0;
  white-space: normal;
}

body[data-page="island"] .building-upgrade-confirm-head .icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(239, 250, 246, 0.5)),
    rgba(255, 255, 255, 0.48);
  color: rgba(32, 67, 61, 0.82);
  font-size: 28px;
  font-weight: 850;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 26px rgba(21, 72, 66, 0.1);
  text-shadow: none;
}

body[data-page="island"] .building-upgrade-confirm-head .icon-button:hover,
body[data-page="island"] .building-upgrade-confirm-head .icon-button:focus-visible {
  color: #103a34;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(231, 249, 244, 0.62)),
    rgba(255, 255, 255, 0.58);
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .building-upgrade-confirm-body {
  gap: 14px;
  padding: 16px 22px 18px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body[data-page="island"] .building-upgrade-confirm-body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body[data-page="island"] .building-upgrade-panel {
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(237, 250, 246, 0.44)),
    rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 14px 34px rgba(29, 82, 75, 0.09);
}

body[data-page="island"] .building-upgrade-panel h3 {
  color: #123b35;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.1;
}

body[data-page="island"] .building-upgrade-cost-list,
body[data-page="island"] .building-upgrade-benefit-list {
  gap: 10px;
}

body[data-page="island"] .building-upgrade-cost-row {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 74px;
  padding: 9px 14px 9px 9px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(238, 250, 246, 0.42)),
    rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 24px rgba(30, 84, 77, 0.08);
}

body[data-page="island"] .building-upgrade-cost-row.enough {
  border-color: rgba(33, 169, 151, 0.22);
}

body[data-page="island"] .building-upgrade-cost-row.missing {
  border-color: rgba(225, 90, 78, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 238, 233, 0.5)),
    rgba(255, 255, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 24px rgba(132, 45, 38, 0.08);
}

body[data-page="island"] .building-upgrade-cost-row span {
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(235, 249, 245, 0.62)),
    rgba(255, 255, 255, 0.58);
  color: #123b35;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 20px rgba(20, 70, 64, 0.08);
}

body[data-page="island"] .building-upgrade-cost-row .product-icon-image {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

body[data-page="island"] .building-upgrade-cost-row strong {
  color: #123b35;
  font-size: 18px;
  font-weight: 950;
}

body[data-page="island"] .building-upgrade-cost-row em {
  color: #087f73;
  font-size: 21px;
  font-weight: 950;
}

body[data-page="island"] .building-upgrade-cost-row.missing em {
  color: #c24f42;
}

body[data-page="island"] .building-upgrade-benefit-row {
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 6px 14px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(34, 86, 78, 0.1);
}

body[data-page="island"] .building-upgrade-benefit-row:first-child {
  padding-top: 2px;
}

body[data-page="island"] .building-upgrade-benefit-row span {
  color: rgba(41, 72, 66, 0.72);
  font-size: 15px;
  font-weight: 950;
}

body[data-page="island"] .building-upgrade-benefit-row strong {
  color: #143d37;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.16;
}

body[data-page="island"] .building-upgrade-benefit-row small {
  color: rgba(43, 74, 68, 0.62);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.42;
}

body[data-page="island"] .building-upgrade-confirm .block-reasons {
  border: 1px solid rgba(225, 90, 78, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 237, 232, 0.5)),
    rgba(255, 255, 255, 0.36);
  color: #a33e35;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="island"] .building-upgrade-empty {
  min-height: 70px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(34, 86, 78, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.34);
  color: rgba(41, 72, 66, 0.62);
  font-weight: 900;
}

body[data-page="island"] .building-upgrade-confirm-actions {
  gap: 14px;
  padding: 16px 22px 22px;
  border-top: 1px solid rgba(34, 86, 78, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.52)),
    rgba(244, 252, 249, 0.5);
}

body[data-page="island"] .building-upgrade-confirm-actions button {
  min-height: 58px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 12px 24px rgba(13, 91, 82, 0.16);
}

body[data-page="island"] .building-upgrade-confirm-actions button:not(.secondary) {
  border: 1px solid rgba(6, 130, 117, 0.36);
  background:
    linear-gradient(180deg, #28cdb6, #0a9284 52%, #08776c);
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
}

body[data-page="island"] .building-upgrade-confirm-actions button.secondary {
  border: 1px solid rgba(28, 78, 70, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 250, 246, 0.56)),
    rgba(255, 255, 255, 0.48);
  color: #173d37;
  text-shadow: none;
}

body[data-page="island"] .building-upgrade-confirm-actions button:hover:not(:disabled),
body[data-page="island"] .building-upgrade-confirm-actions button:focus-visible:not(:disabled) {
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .building-upgrade-confirm-actions button:active:not(:disabled) {
  transform: translateY(0);
}

body[data-page="island"] .building-upgrade-confirm-actions button:disabled {
  border-color: rgba(38, 73, 67, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(228, 240, 236, 0.32)),
    rgba(255, 255, 255, 0.2);
  color: rgba(38, 73, 67, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
  text-shadow: none;
}

@media (max-width: 640px) {
  body[data-page="island"] .building-upgrade-confirm-backdrop {
    padding: 10px;
  }

  body[data-page="island"] .building-upgrade-confirm {
    width: min(100%, calc(100vw - 16px));
    border-radius: 28px;
  }

  body[data-page="island"] .building-upgrade-confirm::before {
    border-radius: 27px;
  }

  body[data-page="island"] .building-upgrade-confirm-head {
    padding: 20px 18px 14px;
  }

  body[data-page="island"] .building-upgrade-confirm-head .icon-button {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  body[data-page="island"] .building-upgrade-confirm-body {
    padding: 12px;
  }

  body[data-page="island"] .building-upgrade-panel {
    border-radius: 22px;
    padding: 14px;
  }

  body[data-page="island"] .building-upgrade-cost-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  body[data-page="island"] .building-upgrade-cost-row em {
    grid-column: 2;
    justify-self: start;
    font-size: 18px;
  }

  body[data-page="island"] .building-upgrade-benefit-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="island"] .building-upgrade-benefit-row small {
    grid-column: 1;
  }

  body[data-page="island"] .building-upgrade-confirm-actions {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  body[data-page="island"] .building-upgrade-confirm-backdrop,
  body[data-page="island"] .building-upgrade-confirm {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  body[data-page="island"] .building-upgrade-confirm {
    background: rgba(247, 252, 249, 0.98);
  }
}

/* Chat channels: iOS 27 generated bitmap icons. */
:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-button {
  grid-template-columns: 44px minmax(0, 1fr) auto !important;
  gap: 10px !important;
}

:is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-mark {
  width: 44px !important;
  height: 44px !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--chat-teal) !important;
  overflow: visible;
}

.chat-channel-icon-image {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(9, 72, 66, 0.14));
}

.chat-channel-button.locked .chat-channel-icon-image {
  filter: grayscale(0.18) saturate(0.8) opacity(0.82) drop-shadow(0 4px 9px rgba(9, 72, 66, 0.1));
}

.chat-channel-mark-fallback {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(7, 143, 128, 0.12);
  color: var(--chat-teal);
  font-size: 15px;
  font-weight: 950;
}
/* Chat channels: keep long channel subtitles away from status badges. */
.chat-channel-copy small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Alliance policy: match the national policy spectrum layout. */
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-panel {
  overflow: hidden;
  padding: 14px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-routes.alliance-policy-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 12px;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background:
    radial-gradient(circle at 76% 14%, rgba(226, 187, 101, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(231, 247, 243, 0.48)),
    rgba(255, 255, 255, 0.4);
  box-shadow:
    0 18px 40px rgba(45, 75, 68, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(47, 82, 75, 0.08);
  padding: 14px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-hero-copy {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 148px;
  padding: 10px 12px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-hero-copy span {
  color: var(--alliance-jade);
  font-size: 13px;
  font-weight: 950;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-hero-copy h3 {
  margin: 0;
  color: var(--alliance-ink);
  font-size: 56px;
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-hero-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--alliance-muted);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.55;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(232, 247, 243, 0.42)),
    rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
  padding: 14px 16px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score-head,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score-head span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score-head em,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score small,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score-metrics span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-stage-toolbar span,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-lane-head small,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-title small {
  color: var(--alliance-muted);
  font-style: normal;
  font-weight: 900;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score strong {
  color: var(--alliance-ink);
  font-size: 44px;
  font-weight: 950;
  line-height: 1;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score-rail {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(40, 75, 69, 0.12);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score-rail i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--alliance-jade), #66c9b5, var(--alliance-gold));
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score-metrics div {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.36);
  padding: 8px 10px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-score-metrics strong {
  color: var(--alliance-ink);
  font-size: 18px;
  font-weight: 950;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(232, 247, 243, 0.44)),
    rgba(255, 255, 255, 0.38);
  box-shadow:
    0 16px 34px rgba(45, 75, 68, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  padding: 8px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-tab {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 76px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 19px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(235, 249, 245, 0.42)),
    rgba(255, 255, 255, 0.34);
  appearance: none;
  cursor: pointer;
  font: inherit;
  padding: 10px 12px 14px;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-tab:hover,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-tab.selected {
  border-color: rgba(15, 143, 128, 0.42);
  background:
    linear-gradient(145deg, rgba(229, 251, 246, 0.88), rgba(255, 250, 235, 0.56)),
    rgba(255, 255, 255, 0.56);
  box-shadow:
    inset 0 0 0 1px rgba(15, 143, 128, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(15, 143, 128, 0.14);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-tab:active {
  transform: translateY(1px);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-tab > i {
  position: absolute;
  right: 18px;
  bottom: 7px;
  left: 18px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--alliance-jade), var(--alliance-gold));
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--alliance-jade);
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(31, 68, 61, 0.12);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-mark.route-defense {
  color: #0d7f70;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-mark.route-command {
  color: #6f7d88;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-mark.route-trade {
  color: #0f9184;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-copy,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-copy strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-stage-toolbar strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-lane-head strong,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-title strong {
  color: var(--alliance-ink);
  font-weight: 950;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-copy small,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-tab em {
  color: var(--alliance-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-tab b {
  color: var(--alliance-gold);
  font-size: 16px;
  font-weight: 950;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-tab em {
  grid-column: 2 / 4;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-stage {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(231, 247, 243, 0.5)),
    rgba(255, 255, 255, 0.45);
  box-shadow:
    0 20px 44px rgba(45, 75, 68, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(53, 91, 84, 0.12);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.62), rgba(232, 247, 243, 0.4)),
    rgba(255, 255, 255, 0.3);
  padding: 14px 16px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-stage-toolbar > div:first-child {
  display: grid;
  gap: 3px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-filter-tabs button {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 245, 0.46)),
    rgba(255, 255, 255, 0.38);
  color: rgba(34, 62, 58, 0.68);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-filter-tabs button.selected {
  border-color: rgba(15, 143, 128, 0.28);
  background:
    linear-gradient(145deg, rgba(15, 143, 128, 0.86), rgba(9, 105, 95, 0.84)),
    var(--alliance-jade);
  color: #fffdf4;
  box-shadow:
    0 10px 22px rgba(9, 105, 95, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-stage-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid rgba(53, 91, 84, 0.1);
  padding: 12px 16px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-stage-ledger span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(232, 247, 243, 0.34)),
    rgba(255, 255, 255, 0.28);
  padding: 10px 12px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-stage-ledger b {
  color: rgba(34, 62, 58, 0.72);
  font-weight: 950;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-stage-ledger em {
  color: var(--alliance-jade);
  font-style: normal;
  font-weight: 950;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-sections {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-section {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(232, 247, 243, 0.36)),
    rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 12px 28px rgba(38, 70, 64, 0.08);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-section-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(53, 91, 84, 0.1);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.58), rgba(234, 249, 246, 0.42)),
    rgba(255, 255, 255, 0.28);
  padding: 12px 14px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-section-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-section-head strong {
  color: var(--alliance-ink);
  font-size: 21px;
  font-weight: 950;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-section-head small {
  color: var(--alliance-muted);
  font-size: 13px;
  font-weight: 900;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-section-head em {
  color: var(--alliance-jade);
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-lanes {
  position: relative;
  display: grid;
  gap: 0;
  padding: 4px 14px 14px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-lane {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid rgba(53, 91, 84, 0.1);
  padding: 16px 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-lane:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-lane-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  align-items: center;
  min-width: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-lane-head > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(15, 143, 128, 0.26);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--alliance-jade);
  font-weight: 950;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-node-stack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  min-width: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-card.alliance-policy-node {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(235, 249, 245, 0.46)),
    rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 24px rgba(38, 70, 64, 0.08);
  padding: 12px;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-card.alliance-policy-node.active {
  border-color: rgba(15, 143, 128, 0.46);
  background:
    linear-gradient(145deg, rgba(224, 249, 243, 0.86), rgba(255, 250, 236, 0.58)),
    rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(15, 143, 128, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 12px 26px rgba(15, 143, 128, 0.12);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-card.alliance-policy-node.locked {
  opacity: 0.74;
  filter: saturate(0.72);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-status,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-meta span {
  border: 1px solid rgba(53, 91, 84, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: rgba(34, 62, 58, 0.68);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-status.active,
:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-status.upgradeable {
  border-color: rgba(15, 143, 128, 0.22);
  color: var(--alliance-jade);
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-status.locked {
  border-color: rgba(195, 95, 99, 0.16);
  color: #9c5d62;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-card.alliance-policy-node p {
  min-height: 42px;
  margin: 0;
  color: var(--alliance-muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-card.alliance-policy-node .warning-text {
  margin-top: 0;
  color: #ab6a3d;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-card.alliance-policy-node .alliance-action-row {
  margin-top: auto;
}

:is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-empty {
  display: grid;
  min-height: 96px;
  place-items: center;
  border: 1px dashed rgba(53, 91, 84, 0.18);
  border-radius: 18px;
  color: var(--alliance-muted);
  font-weight: 900;
}

@media (max-width: 980px) {
  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-hero,
  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-tabs,
  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-stage-ledger,
  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-lane {
    grid-template-columns: 1fr;
  }

  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-stage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-section-head {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-route-section-head em {
    grid-column: 2;
    white-space: normal;
  }

  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-filter-tabs {
    justify-content: flex-start;
  }

  :is(#alliancePage, #diplomacyModalHost .diplomacy-workbench-body) .alliance-policy-hero-copy h3 {
    font-size: 40px;
  }
}

body[data-page="island"] .island-status-mobile-drag-handle {
  display: none;
}

/* Island mobile shell: map-first layout with thumb-zone controls. */
@media (max-width: 640px) {
  body[data-page="island"] {
    --global-topbar-height: clamp(108px, 29vw, 124px);
    --island-mobile-hud-gap: clamp(3px, 1.05vw, 5px);
    --island-mobile-status-panel-collapsed-height: clamp(64px, 18vw, 74px);
    --island-mobile-status-panel-height: clamp(168px, 22dvh, 188px);
  }

  body[data-page="island"] .topbar {
    display: grid;
    grid-template-columns:
      clamp(98px, 26.8vw, 106px)
      minmax(0, 1fr)
      minmax(0, 1fr)
      clamp(62px, 16.7vw, 68px)
      clamp(35px, 9.6vw, 42px);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.86fr);
    align-items: stretch;
    justify-content: stretch;
    justify-items: stretch;
    gap: var(--island-mobile-hud-gap);
    height: var(--global-topbar-height);
    overflow: visible;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
    border-radius: 0 0 16px 16px;
    background:
      radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.82), transparent 32%),
      radial-gradient(circle at 78% 12%, rgba(255, 244, 207, 0.34), transparent 36%),
      linear-gradient(180deg, rgba(252, 253, 248, 0.96), rgba(238, 248, 246, 0.84)),
      rgba(248, 251, 247, 0.92);
    box-shadow:
      0 12px 30px rgba(24, 42, 40, 0.1),
      inset 0 -1px 0 rgba(93, 134, 126, 0.15);
    backdrop-filter: blur(18px) saturate(1.18);
    -webkit-backdrop-filter: blur(18px) saturate(1.18);
    scrollbar-width: none;
  }

  body[data-page="island"] .topbar::after {
    display: none;
  }

  body[data-page="island"] .topbar::-webkit-scrollbar {
    display: none;
  }

  body[data-page="island"] .global-player-anchor {
    z-index: 3;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    min-height: 0;
  }

  body[data-page="island"] .global-player-anchor .global-player-button {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    grid-template-columns: clamp(30px, 8.2vw, 36px) minmax(0, 1fr);
    gap: clamp(4px, 1.05vw, 6px);
    padding: 3px clamp(7px, 2vw, 10px) 3px 3px;
    border-radius: 999px;
  }

  body[data-page="island"] .global-player-button .player-avatar {
    width: clamp(30px, 8.2vw, 36px);
    height: clamp(30px, 8.2vw, 36px);
  }

  body[data-page="island"] .global-player-text strong {
    font-size: clamp(11px, 2.9vw, 13px);
  }

  body[data-page="island"] .topbar .global-status {
    z-index: 2;
    display: grid;
    grid-column: 1 / 5;
    grid-row: 1 / 3;
    grid-template-columns:
      clamp(98px, 26.8vw, 106px)
      minmax(0, 1fr)
      minmax(0, 1fr)
      clamp(62px, 16.7vw, 68px);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.86fr);
    gap: var(--island-mobile-hud-gap);
    align-items: stretch;
    justify-items: stretch;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    overflow: visible;
    scrollbar-width: none;
  }

  body[data-page="island"] .topbar .global-status .wallet-metric {
    display: grid;
    grid-column: 1 / 4;
    grid-row: 1 / 3;
    align-self: stretch;
    justify-self: stretch;
    grid-template-columns: clamp(98px, 26.8vw, 106px) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.86fr);
    gap: var(--island-mobile-hud-gap);
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 0;
  }

  body[data-page="island"] .topbar .global-status .wallet-slot {
    height: 100%;
    min-height: 0;
    justify-items: center;
    padding: 0 clamp(5px, 1.5vw, 8px) 0 clamp(28px, 7.4vw, 34px);
    border-radius: 999px;
  }

  body[data-page="island"] .topbar .global-status .wallet-cash {
    grid-column: 2 / 4;
    grid-row: 1;
  }

  body[data-page="island"] .topbar .global-status .wallet-gold {
    grid-column: 1;
    grid-row: 2;
  }

  body[data-page="island"] .topbar .global-status .wallet-gems {
    grid-column: 2;
    grid-row: 2;
  }

  body[data-page="island"] .topbar .global-status .wallet-slot i {
    left: clamp(3px, 1.25vw, 6px);
    width: clamp(21px, 6.2vw, 27px);
    height: clamp(21px, 6.2vw, 27px);
  }

  body[data-page="island"] .topbar .global-status .wallet-slot i img {
    width: clamp(21px, 6.2vw, 27px);
    height: clamp(21px, 6.2vw, 27px);
  }

  body[data-page="island"] .topbar .global-status .wallet-slot strong {
    font-size: clamp(13px, 3.6vw, 17px);
  }

  body[data-page="island"] .topbar .global-status > .metric {
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    grid-template-columns: clamp(24px, 7.2vw, 31px) minmax(0, 1fr);
    column-gap: clamp(3px, 0.9vw, 5px);
    padding: 3px clamp(4px, 1.2vw, 7px);
    border-radius: 999px;
  }

  body[data-page="island"] .topbar .global-status > .metric:nth-child(2) {
    grid-column: 4;
    grid-row: 1;
  }

  body[data-page="island"] .topbar .global-status > .metric:nth-child(3) {
    grid-column: 3;
    grid-row: 2;
  }

  body[data-page="island"] .topbar .global-status > .metric:nth-child(4) {
    grid-column: 4;
    grid-row: 2;
  }

  body[data-page="island"] .topbar .global-status .metric i,
  body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i {
    width: clamp(24px, 7.2vw, 31px);
    height: clamp(24px, 7.2vw, 31px);
  }

  body[data-page="island"] .topbar .global-status .metric i img,
  body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i img {
    width: clamp(23px, 6.8vw, 30px);
    height: clamp(23px, 6.8vw, 30px);
  }

  body[data-page="island"] .topbar .global-status .metric span {
    min-width: 0;
    overflow: hidden;
    font-size: clamp(9px, 2.45vw, 11px);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="island"] .topbar .global-status .metric strong {
    min-width: 0;
    overflow: hidden;
    font-size: clamp(12px, 3.35vw, 16px);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="island"] .global-mailbox-anchor {
    z-index: 2;
    grid-column: 5;
    grid-row: 2;
    align-self: stretch;
    min-width: 0;
    min-height: 0;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    gap: 1px;
    padding: 4px;
    border-radius: 16px;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-icon {
    width: clamp(23px, 6.8vw, 30px);
    height: clamp(23px, 6.8vw, 30px);
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-label {
    font-size: clamp(9px, 2.4vw, 11px);
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-badge {
    top: 4px;
    right: 4px;
  }

  body[data-page="island"] .plots {
    height: calc(100dvh - var(--global-topbar-height));
    min-height: calc(100dvh - var(--global-topbar-height));
    padding: 78px 12px calc(var(--global-bottom-nav-reserve) + 218px);
    overflow: auto;
    touch-action: none;
    overscroll-behavior: contain;
    background:
      radial-gradient(circle at 50% 31%, rgba(255, 255, 255, 0.2), transparent 35%),
      radial-gradient(circle at 48% 48%, rgba(59, 150, 163, 0.25), transparent 44%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 26px),
      linear-gradient(180deg, #0d7f88 0%, #075a6c 56%, #043544 100%);
    background-size: auto, auto, 26px 26px, auto;
  }

  body[data-page="island"]:has(.island-status-hud.mobile-collapsed) .plots {
    padding-bottom: calc(var(--global-bottom-nav-reserve) + 102px);
  }

  body[data-page="island"] .plots::before {
    inset: 54px 8px calc(var(--global-bottom-nav-reserve) + 188px) 8px;
    opacity: 0.72;
  }

  body[data-page="island"]:has(.island-status-hud.mobile-collapsed) .plots::before {
    bottom: calc(var(--global-bottom-nav-reserve) + 78px);
  }

  body[data-page="island"] .island-map-shell {
    margin-top: 0;
    margin-bottom: 0;
    translate: clamp(-520px, calc((100vw - 1363px) / 2), -340px) 0;
  }

  body[data-page="island"] .island-status-hud,
  body[data-page="island"] .island-status-hud.custom-positioned {
    position: fixed !important;
    z-index: 5600;
    top: auto !important;
    right: 12px !important;
    bottom: calc(var(--global-bottom-nav-reserve) + 10px) !important;
    left: 12px !important;
    width: auto !important;
    max-width: none !important;
    padding-bottom: 0;
    transform: none !important;
  }

  body[data-page="island"] .island-status-hud:not(.collapsed) .island-status-collapse-button {
    display: none;
  }

  body[data-page="island"] .island-status-hud.collapsed,
  body[data-page="island"] .island-status-hud.collapsed.custom-positioned {
    right: 12px !important;
    bottom: calc(var(--global-bottom-nav-reserve) + 12px) !important;
    left: auto !important;
    width: 54px !important;
  }

  body[data-page="island"] .island-status-hud.collapsed .island-status-collapse-button {
    width: 52px;
    height: 52px;
  }

  body[data-page="island"] .island-status-panel {
    height: var(--island-mobile-status-panel-height);
    max-height: var(--island-mobile-status-panel-height);
    gap: 6px;
    overflow: hidden;
    padding: 12px 8px 8px;
    border-color: rgba(255, 255, 255, 0.48);
    border-radius: 24px 24px 20px 20px;
    background:
      radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.52), transparent 28%),
      radial-gradient(circle at 88% 0%, rgba(102, 227, 208, 0.22), transparent 34%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(226, 248, 243, 0.58) 48%, rgba(255, 246, 218, 0.54)),
      rgba(230, 246, 242, 0.72);
    box-shadow:
      0 -18px 48px rgba(13, 45, 49, 0.2),
      0 0 0 1px rgba(255, 255, 255, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
    color: #123a39;
    scrollbar-width: thin;
    transition:
      height 180ms ease,
      max-height 180ms ease,
      padding 180ms ease,
      box-shadow 180ms ease;
  }

  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-panel {
    height: var(--island-mobile-status-panel-collapsed-height);
    max-height: var(--island-mobile-status-panel-collapsed-height);
    padding: 12px 8px 8px;
    box-shadow:
      0 -12px 34px rgba(13, 45, 49, 0.16),
      0 0 0 1px rgba(255, 255, 255, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }

  body[data-page="island"] .island-status-panel::before {
    inset: 1px;
    border-radius: 23px;
    background:
      linear-gradient(118deg, rgba(255, 255, 255, 0.44), transparent 30%),
      radial-gradient(circle at 82% 18%, rgba(84, 215, 194, 0.18), transparent 24%);
  }

  body[data-page="island"] .island-status-panel::after {
    display: none;
  }

  body[data-page="island"] .island-status-panel-head {
    min-height: 42px;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 6px;
    padding: 7px 9px;
    border-color: rgba(255, 255, 255, 0.62);
    background:
      radial-gradient(circle at 85% 12%, rgba(101, 220, 199, 0.22), transparent 34%),
      linear-gradient(142deg, rgba(255, 255, 255, 0.68), rgba(227, 249, 244, 0.44) 58%, rgba(250, 242, 217, 0.56));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.8),
      0 10px 22px rgba(31, 78, 74, 0.12);
    cursor: default;
  }

  body[data-page="island"] .island-status-mobile-drag-handle {
    position: relative;
    z-index: 5;
    display: grid;
    place-items: center;
    justify-self: center;
    width: 96px;
    height: 22px;
    margin: -8px auto -2px;
    cursor: grab;
    touch-action: none;
  }

  body[data-page="island"] .island-status-mobile-drag-handle span {
    display: block;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: rgba(34, 89, 84, 0.28);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.5),
      0 1px 2px rgba(28, 72, 68, 0.08);
    transition:
      width 160ms ease,
      background 160ms ease,
      transform 160ms ease;
  }

  body[data-page="island"] .island-status-hud.mobile-gesture-active .island-status-mobile-drag-handle {
    cursor: grabbing;
  }

  body[data-page="island"] .island-status-hud.mobile-gesture-active .island-status-mobile-drag-handle span {
    width: 56px;
    background: rgba(15, 118, 110, 0.38);
    transform: translateY(-1px);
  }

  body[data-page="island"] .island-status-panel {
    overflow: visible;
    padding-top: 15px;
  }

  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-panel {
    padding-top: 15px;
  }

  body[data-page="island"] .island-status-details-handle,
  body[data-page="island"] .island-status-hud.details-collapsed .island-status-details-handle {
    position: absolute;
    top: -7px;
    left: 50%;
    z-index: 9;
    display: grid;
    place-items: center;
    width: 118px;
    height: 22px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: translateX(-50%);
    cursor: grab;
    touch-action: none;
  }

  body[data-page="island"] .island-status-details-handle span {
    width: 64px;
    height: 4px;
    background: rgba(34, 89, 84, 0.3);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.55),
      0 1px 2px rgba(28, 72, 68, 0.1);
  }

  body[data-page="island"] .island-status-hud.details-gesture-active .island-status-details-handle span {
    width: 76px;
    background: rgba(15, 118, 110, 0.42);
    transform: translateY(-1px);
  }

  body[data-page="island"] .island-status-title {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  body[data-page="island"] .island-status-name-row {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  body[data-page="island"] .island-status-rename-button {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 9px;
  }

  body[data-page="island"] .island-status-select-face {
    height: 18px;
    min-width: 46px;
    padding: 0 9px;
    font-size: 10px;
  }

  body[data-page="island"] .island-status-island-name {
    max-width: 100%;
    color: #113b39;
    font-size: 20px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.66);
  }

  body[data-page="island"] .island-status-dropdown-button {
    width: 34px;
    height: 36px;
    border-color: rgba(255, 255, 255, 0.7);
    background:
      radial-gradient(circle at 42% 18%, rgba(255, 255, 255, 0.66), transparent 34%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(209, 238, 231, 0.58));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 10px 20px rgba(35, 86, 80, 0.12);
  }

  body[data-page="island"] .island-status-dropdown-button::before,
  body[data-page="island"] .island-status-dropdown-button::after {
    top: 17px;
    background: #315f59;
  }

  body[data-page="island"] .island-status-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    transition:
      opacity 160ms ease,
      transform 160ms ease;
  }

  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-list {
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
  }

  body[data-page="island"] .island-status-card,
  body[data-page="island"] button.island-status-card {
    height: 48px;
    min-height: 48px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
    border-radius: 13px;
    box-shadow:
      0 9px 20px rgba(30, 79, 73, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.94),
      inset 0 -10px 22px rgba(185, 153, 89, 0.06);
  }

  body[data-page="island"] .island-status-card::after {
    right: 8px;
    bottom: 7px;
    left: 46px;
  }

  body[data-page="island"] .island-status-metric-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  body[data-page="island"] .island-status-metric-body {
    gap: 2px;
  }

  body[data-page="island"] .island-status-metric-body > div {
    gap: 5px;
  }

  body[data-page="island"] .island-status-card span,
  body[data-page="island"] .island-status-card small {
    max-width: 100%;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="island"] .island-status-card strong,
  body[data-page="island"] .island-status-card.value-long strong,
  body[data-page="island"] .island-status-card.value-xlong strong {
    font-size: 15px;
    line-height: 1.02;
    overflow-wrap: normal;
    white-space: nowrap;
    word-break: normal;
  }

  body[data-page="island"] .island-status-card.value-long strong {
    font-size: 14px;
  }

  body[data-page="island"] .island-status-card.value-xlong strong {
    font-size: 13px;
  }

  body[data-page="island"] .island-status-track {
    height: 3px;
  }

  body[data-page="island"] .island-status-dropdown {
    top: auto;
    bottom: calc(100% + 8px);
  }

  body[data-page="island"] .island-ship-brief-dock,
  body[data-page="island"] .island-ship-brief-dock.custom-positioned {
    position: fixed !important;
    z-index: 5550;
    top: calc(var(--global-topbar-height) + 10px) !important;
    right: auto !important;
    bottom: auto !important;
    left: 12px !important;
    width: 118px !important;
    max-height: 52px;
    padding: 0;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    background:
      radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.56), transparent 38%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.52), rgba(225, 247, 242, 0.34)),
      rgba(229, 246, 242, 0.68);
    box-shadow:
      0 12px 28px rgba(23, 60, 62, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.76);
    transform: none !important;
  }

  body[data-page="island"] .island-ship-brief-dock.collapsed,
  body[data-page="island"] .island-ship-brief-dock.collapsed.custom-positioned {
    width: 56px !important;
    height: 56px;
    padding: 0;
  }

  body[data-page="island"] .island-side-ship-head {
    min-height: 52px;
    grid-template-columns: minmax(0, 1fr) 24px;
    gap: 4px;
    padding: 7px 7px 7px 8px;
    border-bottom: 0;
    background: transparent;
    cursor: default;
  }

  body[data-page="island"] .island-side-ship-title {
    gap: 4px;
    color: #193f3d;
    font-size: 12px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.64);
  }

  body[data-page="island"] .island-side-ship-head .island-side-ship-title {
    gap: 4px;
    font-size: 13px;
  }

  body[data-page="island"] .island-side-ship-title span {
    min-width: 28px;
    max-width: 38px;
  }

  body[data-page="island"] .island-side-ship-head .island-side-ship-title span {
    font-size: 13px;
  }

  body[data-page="island"] .island-side-ship-title-icon {
    width: 32px;
    height: 32px;
  }

  body[data-page="island"] .island-side-ship-head .island-side-ship-title-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
  }

  body[data-page="island"] .island-side-ship-manage {
    width: 24px;
    height: 24px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.48);
    color: #24554f;
    font-size: 19px;
  }

  body[data-page="island"] .island-side-ship-head .island-side-ship-manage {
    width: 24px;
    height: 24px;
    font-size: 18px;
  }

  body[data-page="island"] .island-side-ship-toggle,
  body[data-page="island"] .island-side-ship-list {
    display: none;
  }

  body[data-page="island"] .island-side-ship-collapsed-icon {
    width: 56px;
    height: 56px;
    margin: 0;
  }

  body[data-page="island"] .island-side-ship-collapsed-image {
    width: 42px;
    height: 42px;
  }

  body[data-page="island"] .island-map-zoom-controls {
    display: none;
  }

  body[data-page="island"] .island-map-zoom-controls::-webkit-scrollbar {
    display: none;
  }

  body[data-page="island"] .island-map-info-toggle {
    top: calc(var(--global-topbar-height) + 62px);
    right: 10px;
    bottom: auto;
    min-height: 34px;
    max-width: 156px;
    gap: 5px;
    padding: 4px 7px;
    font-size: 12px;
  }

  body[data-page="island"] .island-map-info-toggle::before {
    width: 34px;
    height: 20px;
  }

  body[data-page="island"] .island-map-info-toggle::after {
    left: 11px;
    width: 16px;
    height: 16px;
  }

  body[data-page="island"] .island-map-info-toggle.active::after {
    transform: translate(14px, -50%);
  }

  body[data-page="island"] .island-map-info-toggle span {
    min-width: 0;
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="island"] .island-map-info-toggle i {
    min-width: 24px;
    margin-left: 0;
    padding: 2px 6px;
    font-size: 11px;
  }

  body[data-page="island"] .island-map-zoom-button {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  body[data-page="island"] .island-map-center-button {
    display: none;
  }

  body[data-page="island"] .island-map-zoom-value {
    min-width: 42px;
    font-size: 13px;
  }

  body[data-page="island"] .global-primary-nav {
    align-items: stretch;
    height: 72px;
  }

  body[data-page="island"] .global-nav-item {
    display: flex;
  }

  body[data-page="island"] .global-nav-button,
  body[data-page="island"] .global-nav-button.global-nav-button-visual {
    display: grid;
    grid-template-rows: 34px 15px;
    align-content: center;
    justify-items: center;
    width: 100%;
    height: 60px;
    min-height: 60px;
    gap: 3px;
    padding: 5px 4px 4px;
  }

  body[data-page="island"] .global-nav-button.global-nav-button-visual i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    overflow: visible;
  }

  body[data-page="island"] .global-nav-button.global-nav-button-visual i img {
    width: 34px;
    height: 34px;
    max-width: 34px;
    object-fit: contain;
    transform: none;
  }

  body[data-page="island"] .global-nav-button span {
    width: 100%;
    font-size: 11px;
    line-height: 1.05;
    text-align: center;
    white-space: nowrap;
  }

  body[data-page="island"]:has([data-modal-root]) .island-status-hud,
  body[data-page="island"]:has([data-modal-root]) .island-ship-brief-dock,
  body[data-page="island"]:has([data-modal-root]) .island-map-zoom-controls,
  body[data-page="island"]:has([data-modal-root]) .island-map-info-toggle,
  body[data-page="island"]:has([data-modal-root]) .global-primary-nav {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 380px) {
  body[data-page="island"] .island-status-card {
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 58px;
    padding: 7px;
  }

  body[data-page="island"] .island-status-metric-icon {
    width: 36px;
    height: 36px;
  }

  body[data-page="island"] .island-status-card strong,
  body[data-page="island"] .island-status-card.value-long strong,
  body[data-page="island"] .island-status-card.value-xlong strong {
    font-size: 14px;
    white-space: nowrap;
  }

  body[data-page="island"] .island-status-card.value-long strong {
    font-size: 13px;
  }

  body[data-page="island"] .island-status-card.value-xlong strong {
    font-size: 12px;
  }
}

/* Shared mobile HUD for non-map pages: keep the full top status readable without horizontal panning. */
@media (max-width: 640px) {
  body:not([data-page="island"]) {
    --global-topbar-height: clamp(108px, 29vw, 124px);
    --global-mobile-hud-gap: clamp(3px, 1.05vw, 5px);
  }

  body:not([data-page="island"]) .topbar {
    display: grid;
    grid-template-columns:
      clamp(98px, 26.8vw, 106px)
      minmax(0, 1fr)
      minmax(0, 1fr)
      clamp(62px, 16.7vw, 68px)
      clamp(35px, 9.6vw, 42px);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.86fr);
    align-items: stretch;
    justify-content: stretch;
    justify-items: stretch;
    gap: var(--global-mobile-hud-gap);
    height: var(--global-topbar-height);
    overflow: visible;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
    border-radius: 0 0 16px 16px;
    scrollbar-width: none;
  }

  body:not([data-page="island"]) .topbar::-webkit-scrollbar {
    display: none;
  }

  body:not([data-page="island"]) .topbar::after {
    display: none;
  }

  body:not([data-page="island"]) .global-player-anchor {
    z-index: 3;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    min-height: 0;
  }

  body:not([data-page="island"]) .global-player-anchor .global-player-button {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    grid-template-columns: clamp(30px, 8.2vw, 36px) minmax(0, 1fr);
    gap: clamp(4px, 1.05vw, 6px);
    padding: 3px clamp(7px, 2vw, 10px) 3px 3px;
    border-radius: 999px;
  }

  body:not([data-page="island"]) .global-player-button .player-avatar {
    width: clamp(30px, 8.2vw, 36px);
    height: clamp(30px, 8.2vw, 36px);
  }

  body:not([data-page="island"]) .global-player-text strong {
    font-size: clamp(11px, 2.9vw, 13px);
  }

  body:not([data-page="island"]) .topbar .global-status {
    z-index: 2;
    display: grid;
    grid-column: 1 / 5;
    grid-row: 1 / 3;
    grid-template-columns:
      clamp(98px, 26.8vw, 106px)
      minmax(0, 1fr)
      minmax(0, 1fr)
      clamp(62px, 16.7vw, 68px);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.86fr);
    gap: var(--global-mobile-hud-gap);
    align-items: stretch;
    justify-items: stretch;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    scrollbar-width: none;
  }

  body:not([data-page="island"]) .topbar .global-status .wallet-metric {
    display: grid;
    grid-column: 1 / 4;
    grid-row: 1 / 3;
    align-self: stretch;
    justify-self: stretch;
    grid-template-columns: clamp(98px, 26.8vw, 106px) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.86fr);
    gap: var(--global-mobile-hud-gap);
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 0;
  }

  body:not([data-page="island"]) .topbar .global-status .wallet-slot {
    height: 100%;
    min-height: 0;
    justify-items: center;
    padding: 0 clamp(5px, 1.5vw, 8px) 0 clamp(28px, 7.4vw, 34px);
    border-radius: 999px;
  }

  body:not([data-page="island"]) .topbar .global-status .wallet-cash {
    grid-column: 2 / 4;
    grid-row: 1;
  }

  body:not([data-page="island"]) .topbar .global-status .wallet-gold {
    grid-column: 1;
    grid-row: 2;
  }

  body:not([data-page="island"]) .topbar .global-status .wallet-gems {
    grid-column: 2;
    grid-row: 2;
  }

  body:not([data-page="island"]) .topbar .global-status .wallet-slot i {
    left: clamp(3px, 1.25vw, 6px);
    width: clamp(21px, 6.2vw, 27px);
    height: clamp(21px, 6.2vw, 27px);
  }

  body:not([data-page="island"]) .topbar .global-status .wallet-slot i img {
    width: clamp(21px, 6.2vw, 27px);
    height: clamp(21px, 6.2vw, 27px);
  }

  body:not([data-page="island"]) .topbar .global-status .wallet-slot strong {
    min-width: 0;
    overflow: hidden;
    font-size: clamp(13px, 3.45vw, 16px);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not([data-page="island"]) .topbar .global-status > .metric {
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    grid-template-columns: clamp(24px, 7.2vw, 31px) minmax(0, 1fr);
    column-gap: clamp(3px, 0.9vw, 5px);
    padding: 3px clamp(4px, 1.2vw, 7px);
    border-radius: 999px;
  }

  body:not([data-page="island"]) .topbar .global-status > .metric:nth-child(2) {
    grid-column: 4;
    grid-row: 1;
  }

  body:not([data-page="island"]) .topbar .global-status > .metric:nth-child(3) {
    grid-column: 3;
    grid-row: 2;
  }

  body:not([data-page="island"]) .topbar .global-status > .metric:nth-child(4) {
    grid-column: 4;
    grid-row: 2;
  }

  body:not([data-page="island"]) .topbar .global-status .metric i,
  body:not([data-page="island"]) .topbar .global-status .metric.metric-visual-icon i {
    width: clamp(24px, 7.2vw, 31px);
    height: clamp(24px, 7.2vw, 31px);
  }

  body:not([data-page="island"]) .topbar .global-status .metric i img,
  body:not([data-page="island"]) .topbar .global-status .metric.metric-visual-icon i img {
    width: clamp(23px, 6.8vw, 30px);
    height: clamp(23px, 6.8vw, 30px);
  }

  body:not([data-page="island"]) .topbar .global-status .metric span,
  body:not([data-page="island"]) .topbar .global-status .metric strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not([data-page="island"]) .topbar .global-status .metric span {
    font-size: clamp(9px, 2.45vw, 11px);
  }

  body:not([data-page="island"]) .topbar .global-status .metric strong {
    font-size: clamp(12px, 3.35vw, 16px);
  }

  body:not([data-page="island"]) .global-mailbox-anchor {
    z-index: 2;
    grid-column: 5;
    grid-row: 2;
    align-self: stretch;
    min-width: 0;
    min-height: 0;
  }

  body:not([data-page="island"]) .global-mailbox-anchor .mailbox-toggle {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    gap: 1px;
    padding: 4px;
    border-radius: 16px;
  }

  body:not([data-page="island"]) .global-mailbox-anchor .mailbox-toggle-icon {
    width: clamp(23px, 6.8vw, 30px);
    height: clamp(23px, 6.8vw, 30px);
  }

  body:not([data-page="island"]) .global-mailbox-anchor .mailbox-toggle-label {
    font-size: clamp(9px, 2.4vw, 11px);
  }

  body:not([data-page="island"]) .global-mailbox-anchor .mailbox-badge {
    top: 4px;
    right: 4px;
  }
}

/* Mobile comms: replace the desktop side rail with a contained two-column channel picker. */
@media (max-width: 640px) {
  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    min-width: 0;
    overflow: visible;
    padding: 12px;
  }

  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-rail-title,
  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-group {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-group > span {
    grid-column: 1 / -1;
  }

  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-button {
    grid-template-columns: clamp(30px, 8vw, 34px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 56px;
    gap: 5px 7px;
    padding: 7px;
    border-radius: 15px;
  }

  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-mark {
    grid-row: 1 / 3;
    width: clamp(30px, 8vw, 34px);
    height: clamp(30px, 8vw, 34px);
  }

  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-copy {
    align-self: end;
  }

  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-copy small {
    display: none;
  }

  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-channel-badge {
    grid-column: 2;
    justify-self: start;
    min-width: 0;
    padding: 3px 7px;
    font-size: 10px;
  }

  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-panel,
  :is(#chatPage, #diplomacyModalHost .diplomacy-workbench-body) .chat-dossier {
    min-width: 0;
  }
}

/* Mobile leaderboard: turn the wide terminal rows into scan-friendly stat cards. */
@media (max-width: 640px) {
  body[data-page="leaderboard"] .leaderboard-terminal-table {
    overflow-x: visible;
  }

  body[data-page="leaderboard"] .leaderboard-table-row.leaderboard-table-labels {
    display: none;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) {
    grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-items: center;
    min-width: 0;
    min-height: 0;
    gap: 8px 10px;
    margin: 10px;
    padding: 10px;
    border: 1px solid rgba(35, 84, 80, 0.1);
    border-radius: 18px;
    background:
      radial-gradient(circle at 92% 0%, rgba(37, 198, 173, 0.12), transparent 34%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(234, 249, 245, 0.5)),
      rgba(255, 255, 255, 0.48);
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) .leaderboard-table-rank {
    grid-column: 1;
    grid-row: 1 / 4;
    justify-self: center;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) .leaderboard-name-cell {
    grid-column: 2 / 4;
    grid-row: 1;
    min-width: 0;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > strong:nth-child(3),
  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > span:nth-child(4),
  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > strong:nth-child(5),
  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > em {
    min-width: 0;
    text-align: left;
    white-space: nowrap;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > strong:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > span:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > strong:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > em {
    grid-column: 3;
    grid-row: 3;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > strong:nth-child(3)::before,
  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > span:nth-child(4)::before,
  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > strong:nth-child(5)::before,
  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > em::before {
    display: block;
    margin-bottom: 2px;
    color: rgba(28, 61, 59, 0.5);
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > strong:nth-child(3)::before {
    content: "GDP";
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > span:nth-child(4)::before {
    content: "äººå£";
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > strong:nth-child(5)::before {
    content: "äººå‡";
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-table-row:not(.leaderboard-table-labels) > em::before {
    content: "çŠ¶æ€?;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-terminal-self-player {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-width: 0;
    margin: 10px;
    border: 1px solid rgba(35, 84, 80, 0.12);
    border-radius: 18px;
  }

  body[data-page="leaderboard"] .leaderboard-terminal-table-player .leaderboard-terminal-self-player > span:first-child {
    grid-column: 1 / -1;
  }
}

/* Mobile production and statistics matrices: card rows beat desktop-wide tables on touch screens. */
@media (max-width: 640px) {
  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-table,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-table {
    gap: 10px;
    overflow-x: visible;
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row.head,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row.head {
    display: none;
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head),
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    min-width: 0;
    min-height: 0;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    background:
      radial-gradient(circle at 90% 0%, rgba(34, 194, 174, 0.13), transparent 34%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(236, 249, 245, 0.56)),
      rgba(255, 255, 255, 0.56);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.82),
      0 12px 24px rgba(28, 78, 72, 0.07);
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:first-child,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span:first-child {
    grid-column: 1 / 3;
    grid-row: 1;
    align-self: center;
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > button,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > button {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    min-width: 62px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 12px;
    white-space: nowrap;
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(2) {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.5);
    color: #163f3b;
    font-weight: 900;
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(3),
  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(4),
  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(5),
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span:nth-child(n + 2):nth-child(-n + 7) {
    display: grid;
    align-content: center;
    gap: 3px;
    min-height: 50px;
    padding: 8px;
    border: 1px solid rgba(15, 118, 110, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.54);
    color: #123936;
    font-size: 15px;
    font-weight: 950;
    line-height: 1.12;
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(6) {
    grid-column: 1 / 3;
    display: grid;
    align-content: center;
    gap: 3px;
    min-height: 50px;
    padding: 8px;
    border: 1px solid rgba(15, 118, 110, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.54);
    color: #123936;
    font-size: 15px;
    font-weight: 950;
    line-height: 1.12;
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(7) {
    grid-column: 3;
    display: grid;
    align-content: center;
    gap: 3px;
    min-height: 50px;
    padding: 8px;
    border: 1px solid rgba(15, 118, 110, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.54);
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span:nth-child(8) {
    grid-column: 1 / -1;
    display: grid;
    gap: 4px;
    min-height: 46px;
    padding: 8px;
    border: 1px solid rgba(15, 118, 110, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.54);
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-status-pill,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-focus-pill {
    width: 100%;
    min-height: 34px;
    justify-content: center;
    padding: 6px 8px;
    white-space: normal;
    text-align: center;
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(n + 2)::before,
  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span:nth-child(n + 2)::before {
    display: block;
    margin-bottom: 1px;
    color: rgba(30, 68, 64, 0.52);
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(2)::before {
    content: "äº§ä¸š";
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(3)::before {
    content: "å»ºç­‘";
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(4)::before {
    content: "è¿è¡Œ";
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(5)::before {
    content: "ç­‰å¾…";
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(6)::before {
    content: "æœ€è¿?;
  }

  :is(body[data-page="production"], .technology-workbench-shell[data-workbench-tab="production"]) .production-matrix-row:not(.head) > span:nth-child(7)::before {
    content: "çŠ¶æ€?;
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span:nth-child(2)::before {
    content: "GDP";
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span:nth-child(3)::before {
    content: "äººå£";
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span:nth-child(4)::before {
    content: "å¹¸ç¦";
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span:nth-child(5)::before {
    content: "ä»“åº“";
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span:nth-child(6)::before {
    content: "ç”µåŠ›";
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span:nth-child(7)::before {
    content: "ç”Ÿäº§";
  }

  :is(body[data-page="data"], .technology-workbench-shell[data-workbench-tab="data"]) .statistics-matrix-row:not(.head) > span:nth-child(8)::before {
    content: "å…³æ³¨";
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs {
    gap: 5px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px;
  }

  :is(body[data-page="alliance"], body.diplomacy-modal-open) .alliance-section-tabs .alliance-section-tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 36px;
    padding-inline: 7px;
    font-size: 13px;
  }
}

/* Unified mobile bottom navigation: one fixed geometry across island and subpages. */
@media (max-width: 640px) {
  :root {
    --global-nav-bottom: 0px;
    --global-nav-safe-bottom: env(safe-area-inset-bottom, 0px);
    --global-mobile-nav-height: calc(66px + var(--global-nav-safe-bottom));
    --global-bottom-nav-reserve: calc(var(--global-mobile-nav-height) + 8px);
  }

  .global-primary-nav,
  body[data-page="island"] .global-primary-nav {
    right: max(18px, env(safe-area-inset-right)) !important;
    bottom: var(--global-nav-bottom) !important;
    left: max(18px, env(safe-area-inset-left)) !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    justify-items: stretch;
    justify-content: stretch;
    width: auto !important;
    max-width: none !important;
    height: var(--global-mobile-nav-height) !important;
    gap: 3px;
    overflow: visible;
    padding: 7px 4px max(3px, var(--global-nav-safe-bottom));
    border: 1px solid rgba(232, 255, 249, 0.38);
    border-radius: 22px 22px 0 0;
    border-bottom-color: rgba(92, 167, 150, 0.18);
    background:
      radial-gradient(ellipse at 18% 0%, rgba(255, 255, 255, 0.42), transparent 44%),
      radial-gradient(ellipse at 84% 100%, rgba(76, 201, 179, 0.18), transparent 54%),
      linear-gradient(135deg, rgba(227, 255, 248, 0.36), rgba(172, 232, 216, 0.28) 55%, rgba(240, 253, 247, 0.24)),
      rgba(204, 244, 234, 0.26);
    box-shadow:
      0 10px 28px rgba(18, 60, 54, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.52),
      inset 0 -1px 0 rgba(63, 139, 122, 0.12);
    transform: none !important;
    backdrop-filter: blur(30px) saturate(1.28);
    -webkit-backdrop-filter: blur(30px) saturate(1.28);
  }

  .global-primary-nav::before,
  .global-primary-nav::after,
  body[data-page="island"] .global-primary-nav::before,
  body[data-page="island"] .global-primary-nav::after {
    display: none;
  }

  .global-nav-item,
  body[data-page="island"] .global-nav-item {
    display: flex;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
  }

  .global-nav-button,
  .global-nav-button.global-nav-button-visual,
  body[data-page="island"] .global-nav-button,
  body[data-page="island"] .global-nav-button.global-nav-button-visual {
    display: grid !important;
    grid-template-rows: 36px 14px;
    align-content: end;
    justify-items: center;
    align-items: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    gap: 0;
    padding: 5px 3px 2px;
    border: 0;
    border-radius: 19px;
    background: transparent;
    color: rgba(28, 58, 54, 0.78);
    overflow: visible;
    box-shadow: none;
    transform: none;
  }

  .global-nav-button:hover,
  .global-nav-button:focus-visible,
  body[data-page="island"] .global-nav-button:hover,
  body[data-page="island"] .global-nav-button:focus-visible {
    transform: none;
  }

  .global-nav-button.selected,
  .global-nav-item.world-menu-open .global-nav-button[data-page="world"],
  .global-nav-item.government-menu-open .global-nav-button[data-page="government"],
  .global-nav-item.diplomacy-menu-open .global-nav-button[data-page="diplomacy"],
  body[data-page="island"] .global-nav-button.selected,
  body[data-page="island"] .global-nav-item.world-menu-open .global-nav-button[data-page="world"],
  body[data-page="island"] .global-nav-item.government-menu-open .global-nav-button[data-page="government"],
  body[data-page="island"] .global-nav-item.diplomacy-menu-open .global-nav-button[data-page="diplomacy"] {
    background:
      radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.4), transparent 44%),
      linear-gradient(180deg, rgba(191, 231, 218, 0.5), rgba(121, 203, 178, 0.36)),
      rgba(124, 204, 180, 0.3);
    color: #123f36;
    box-shadow:
      0 7px 16px rgba(32, 104, 88, 0.12),
      inset 0 0 0 1px rgba(70, 164, 138, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.54);
  }

  .global-primary-nav:has(.global-nav-item.world-menu-open, .global-nav-item.government-menu-open, .global-nav-item.diplomacy-menu-open) .global-nav-button.selected:not([data-page="world"]):not([data-page="government"]):not([data-page="diplomacy"]),
  body[data-page="island"] .global-primary-nav:has(.global-nav-item.world-menu-open, .global-nav-item.government-menu-open, .global-nav-item.diplomacy-menu-open) .global-nav-button.selected:not([data-page="world"]):not([data-page="government"]):not([data-page="diplomacy"]) {
    background: transparent;
    color: rgba(28, 58, 54, 0.78);
    box-shadow: none;
  }

  .global-nav-button i,
  .global-nav-button.global-nav-button-visual i,
  body[data-page="island"] .global-nav-button i,
  body[data-page="island"] .global-nav-button.global-nav-button-visual i {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 13px;
    background: transparent;
    box-shadow: none;
    filter: drop-shadow(0 6px 8px rgba(43, 69, 62, 0.08));
    overflow: visible;
  }

  .global-nav-button.global-nav-button-visual i img,
  body[data-page="island"] .global-nav-button.global-nav-button-visual i img {
    display: block;
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
    object-fit: contain;
    clip-path: none;
    transform: none;
  }

  .global-nav-button span,
  body[data-page="island"] .global-nav-button span {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 10.5px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
/* Mobile island info toggle: compact switch label only. */
@media (max-width: 640px) {
  body[data-page="island"] .island-map-info-toggle {
    top: var(--global-topbar-height);
    right: 0;
    bottom: auto;
    left: auto;
    display: grid;
    grid-template-rows: 20px 13px;
    place-items: center;
    width: 42px;
    height: auto;
    max-width: none;
    min-height: 0;
    gap: 2px;
    padding: 4px 4px 5px;
    border-radius: 0 0 0 15px;
    color: #315f59;
    font-size: 11.5px;
    font-weight: 1000;
    line-height: 1;
  }

  body[data-page="island"] .island-map-info-toggle::before {
    content: "";
    position: static;
    display: block;
    width: 30px;
    height: 18px;
    border-radius: 999px;
    background: rgba(126, 154, 149, 0.28);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.72),
      0 4px 10px rgba(28, 99, 91, 0.14);
    opacity: 1;
  }

  body[data-page="island"] .island-map-info-toggle::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 8px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 5px rgba(20, 75, 70, 0.22);
    transform: translateX(0);
  }

  body[data-page="island"] .island-map-info-toggle.active::before {
    background: linear-gradient(90deg, #55bdb6, #74d3be);
  }

  body[data-page="island"] .island-map-info-toggle.active::after {
    transform: translateX(12px);
  }

  body[data-page="island"] .island-map-info-toggle span {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    color: #315f59;
    line-height: 1;
    text-overflow: clip;
    white-space: nowrap;
  }

  body[data-page="island"] .island-map-info-toggle i {
    display: none;
  }
}
/* Mobile top HUD ordered rows override. */
@media (max-width: 640px) {
  body[data-page="island"],
  body:not([data-page="island"]) {
    --global-topbar-height: clamp(108px, 29vw, 124px);
    --ordered-mobile-hud-gap: clamp(3px, 1.05vw, 5px);
  }

  body[data-page="island"] .topbar,
  body:not([data-page="island"]) .topbar {
    display: grid;
    grid-template-columns:
      minmax(104px, 1.42fr)
      minmax(72px, 0.92fr)
      minmax(62px, 0.78fr)
      clamp(42px, 11.4vw, 50px);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.9fr);
    align-items: stretch;
    justify-content: stretch;
    justify-items: stretch;
    gap: var(--ordered-mobile-hud-gap);
    height: var(--global-topbar-height);
    overflow: visible;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
    scrollbar-width: none;
  }

  body[data-page="island"] .topbar .global-status,
  body:not([data-page="island"]) .topbar .global-status {
    display: contents;
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  body[data-page="island"] .global-player-anchor,
  body:not([data-page="island"]) .global-player-anchor {
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    justify-self: stretch;
    min-width: 0;
    min-height: 0;
  }

  body[data-page="island"] .global-player-anchor .global-player-button,
  body:not([data-page="island"]) .global-player-anchor .global-player-button {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    grid-template-columns: clamp(30px, 8.2vw, 36px) minmax(0, 1fr);
    gap: clamp(4px, 1.05vw, 6px);
    padding: 3px clamp(7px, 2vw, 10px) 3px 3px;
    border-radius: 999px;
  }

  body[data-page="island"] .global-player-button .player-avatar,
  body:not([data-page="island"]) .global-player-button .player-avatar {
    width: clamp(30px, 8.2vw, 36px);
    height: clamp(30px, 8.2vw, 36px);
  }

  body[data-page="island"] .global-player-text strong,
  body:not([data-page="island"]) .global-player-text strong {
    font-size: clamp(11px, 2.9vw, 13px);
  }

  body[data-page="island"] .topbar .global-status > .metric,
  body:not([data-page="island"]) .topbar .global-status > .metric {
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    grid-template-columns: clamp(23px, 6.8vw, 30px) minmax(0, 1fr) !important;
    grid-template-rows: 1fr !important;
    column-gap: clamp(3px, 0.9vw, 5px);
    justify-content: stretch !important;
    padding: 3px clamp(4px, 1.2vw, 7px);
    border-radius: 999px;
  }

  body[data-page="island"] .topbar .global-status > .metric:nth-child(2),
  body:not([data-page="island"]) .topbar .global-status > .metric:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-page="island"] .topbar .global-status > .metric:nth-child(3),
  body:not([data-page="island"]) .topbar .global-status > .metric:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
  }

  body[data-page="island"] .topbar .global-status .metric i,
  body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i,
  body:not([data-page="island"]) .topbar .global-status .metric i,
  body:not([data-page="island"]) .topbar .global-status .metric.metric-visual-icon i {
    grid-row: auto !important;
    width: clamp(23px, 6.8vw, 30px);
    height: clamp(23px, 6.8vw, 30px);
  }

  body[data-page="island"] .topbar .global-status .metric i img,
  body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i img,
  body:not([data-page="island"]) .topbar .global-status .metric i img,
  body:not([data-page="island"]) .topbar .global-status .metric.metric-visual-icon i img {
    width: clamp(22px, 6.5vw, 29px);
    height: clamp(22px, 6.5vw, 29px);
  }

  body[data-page="island"] .topbar .global-status .metric strong,
  body:not([data-page="island"]) .topbar .global-status .metric strong {
    align-self: center !important;
    min-width: 0;
    overflow: hidden;
    font-size: clamp(12px, 3.35vw, 16px);
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="island"] .global-mailbox-anchor,
  body:not([data-page="island"]) .global-mailbox-anchor {
    grid-column: 4;
    grid-row: 1;
    align-self: stretch;
    justify-self: stretch;
    min-width: 0;
    min-height: 0;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle,
  body:not([data-page="island"]) .global-mailbox-anchor .mailbox-toggle {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    justify-content: center;
    padding: 4px;
    border-radius: 16px;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-icon,
  body:not([data-page="island"]) .global-mailbox-anchor .mailbox-toggle-icon {
    width: clamp(23px, 6.8vw, 30px);
    height: clamp(23px, 6.8vw, 30px);
  }

  body[data-page="island"] .topbar .global-status .wallet-metric,
  body:not([data-page="island"]) .topbar .global-status .wallet-metric {
    display: grid;
    grid-column: 1 / 5;
    grid-row: 2;
    align-self: stretch;
    justify-self: stretch;
    grid-template-columns: minmax(0, 1.78fr) minmax(0, 0.96fr) minmax(0, 0.96fr);
    grid-template-rows: minmax(0, 1fr);
    gap: var(--ordered-mobile-hud-gap);
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    flex: 1 1 auto;
    padding: 0;
  }

  body[data-page="island"] .topbar .global-status .wallet-slot,
  body:not([data-page="island"]) .topbar .global-status .wallet-slot {
    height: 100%;
    min-width: 0;
    min-height: 0;
    justify-items: center;
    padding: 0 clamp(5px, 1.5vw, 8px) 0 clamp(28px, 7.4vw, 34px);
    border-radius: 999px;
  }

  body[data-page="island"] .topbar .global-status .wallet-cash,
  body:not([data-page="island"]) .topbar .global-status .wallet-cash {
    grid-column: 1;
    grid-row: 1;
  }

  body[data-page="island"] .topbar .global-status .wallet-gems,
  body:not([data-page="island"]) .topbar .global-status .wallet-gems {
    grid-column: 3;
    grid-row: 1;
  }

  body[data-page="island"] .topbar .global-status .wallet-gold,
  body:not([data-page="island"]) .topbar .global-status .wallet-gold {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-page="island"] .topbar .global-status .wallet-slot i,
  body:not([data-page="island"]) .topbar .global-status .wallet-slot i {
    left: clamp(3px, 1.25vw, 6px);
    width: clamp(21px, 6.2vw, 27px);
    height: clamp(21px, 6.2vw, 27px);
  }

  body[data-page="island"] .topbar .global-status .wallet-slot i img,
  body:not([data-page="island"]) .topbar .global-status .wallet-slot i img {
    width: clamp(21px, 6.2vw, 27px);
    height: clamp(21px, 6.2vw, 27px);
  }

  body[data-page="island"] .topbar .global-status .wallet-slot strong,
  body:not([data-page="island"]) .topbar .global-status .wallet-slot strong {
    min-width: 0;
    overflow: hidden;
    font-size: clamp(12px, 3.35vw, 16px);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="island"] .topbar .global-status .wallet-cash strong,
  body:not([data-page="island"]) .topbar .global-status .wallet-cash strong {
    font-size: clamp(14px, 3.8vw, 18px);
  }
}
/* Island floating panel top handle override. */
@media (max-width: 640px) {
  body[data-page="island"] .island-status-mobile-drag-handle {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
  }

  body[data-page="island"] .island-status-panel {
    overflow: visible;
    padding-top: 16px;
  }

  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-panel {
    padding-top: 16px;
  }

  body[data-page="island"] .island-status-details-handle,
  body[data-page="island"] .island-status-hud.details-collapsed .island-status-details-handle {
    position: absolute !important;
    top: -8px !important;
    left: 50% !important;
    z-index: 12 !important;
    display: grid !important;
    place-items: center !important;
    width: 118px !important;
    height: 22px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: translateX(-50%) !important;
    cursor: grab;
    touch-action: none;
  }

  body[data-page="island"] .island-status-details-handle span {
    width: 64px;
    height: 4px;
    border-radius: 999px;
    background: rgba(34, 89, 84, 0.32);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.58),
      0 1px 2px rgba(28, 72, 68, 0.1);
  }

  body[data-page="island"] .island-status-hud.details-gesture-active .island-status-details-handle span {
    width: 76px;
    background: rgba(15, 118, 110, 0.42);
    transform: translateY(-1px);
  }
}

/* Final mailbox HUD badge override: unread state is a dot on the icon, never a numbered pill. */
.global-mailbox-anchor .mailbox-toggle,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
  overflow: visible;
}

.global-mailbox-anchor .mailbox-toggle .mailbox-badge,
body[data-page="island"] .global-mailbox-anchor .mailbox-toggle .mailbox-badge {
  position: absolute;
  z-index: 4;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  min-width: 0;
  max-width: 8px;
  min-height: 0;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  background: #d92822;
  color: transparent;
  font-size: 0;
  line-height: 0;
  text-indent: -999px;
  box-shadow:
    0 0 0 1px rgba(217, 40, 34, 0.18),
    0 2px 5px rgba(113, 20, 18, 0.24);
  overflow: hidden;
  pointer-events: none;
}

@media (max-width: 640px) {
  .global-mailbox-anchor .mailbox-toggle .mailbox-badge,
  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle .mailbox-badge {
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    max-width: 7px;
    border-width: 1px;
  }
}
/* Final mobile island info toggle: no container, only switch and text. */
@media (max-width: 640px) {
  body[data-page="island"] .island-map-info-toggle {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body[data-page="island"] .island-map-info-toggle span {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.85);
  }
}
/* Final mobile island info switch knob alignment. */
@media (max-width: 640px) {
  body[data-page="island"] .island-map-info-toggle::after {
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
  }

  body[data-page="island"] .island-map-info-toggle.active::after {
    transform: translateX(12px);
  }
}
/* Final mobile island info switch active knob: align to the right arc. */
@media (max-width: 640px) {
  body[data-page="island"] .island-map-info-toggle.active::after {
    transform: translateX(14px);
  }
}
/* Final mobile bottom nav: edge-hugging slim row with icon beside text. */
@media (max-width: 640px) {
  :root {
    --global-mobile-nav-row-height: clamp(52px, 14.4vw, 60px);
    --global-mobile-nav-height: calc(var(--global-mobile-nav-row-height) + env(safe-area-inset-bottom, 0px));
    --global-bottom-nav-reserve: calc(var(--global-mobile-nav-height) + 2px);
  }

  .global-primary-nav,
  body[data-page="island"] .global-primary-nav {
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    justify-items: stretch;
    width: 100vw !important;
    max-width: 100vw !important;
    height: var(--global-mobile-nav-height) !important;
    min-height: 0 !important;
    gap: clamp(1px, 0.7vw, 4px);
    padding: 6px clamp(10px, 3.3vw, 18px) max(6px, env(safe-area-inset-bottom, 0px));
    border: 1px solid rgba(232, 255, 249, 0.58);
    border-radius: 999px;
    background:
      radial-gradient(ellipse at 16% 0%, rgba(255, 255, 255, 0.58), transparent 48%),
      radial-gradient(ellipse at 88% 100%, rgba(73, 205, 179, 0.2), transparent 52%),
      linear-gradient(135deg, rgba(239, 255, 251, 0.72), rgba(195, 241, 229, 0.54) 58%, rgba(236, 252, 246, 0.64)),
      rgba(222, 249, 241, 0.66);
    box-shadow:
      0 -4px 18px rgba(28, 82, 75, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.72),
      inset 0 -1px 0 rgba(78, 151, 136, 0.16);
    transform: none !important;
    box-sizing: border-box;
  }

  .global-nav-item,
  body[data-page="island"] .global-nav-item {
    align-items: center;
  }

  .global-nav-button,
  .global-nav-button.global-nav-button-visual,
  body[data-page="island"] .global-nav-button,
  body[data-page="island"] .global-nav-button.global-nav-button-visual {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(3px, 1.1vw, 6px);
    height: 100%;
    padding: 3px clamp(2px, 1.3vw, 8px);
    border-radius: 999px;
    text-align: left;
  }

  .global-nav-button.selected,
  .global-nav-item.world-menu-open .global-nav-button[data-page="world"],
  .global-nav-item.government-menu-open .global-nav-button[data-page="government"],
  .global-nav-item.diplomacy-menu-open .global-nav-button[data-page="diplomacy"],
  body[data-page="island"] .global-nav-button.selected,
  body[data-page="island"] .global-nav-item.world-menu-open .global-nav-button[data-page="world"],
  body[data-page="island"] .global-nav-item.government-menu-open .global-nav-button[data-page="government"],
  body[data-page="island"] .global-nav-item.diplomacy-menu-open .global-nav-button[data-page="diplomacy"] {
    background:
      radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.52), transparent 46%),
      linear-gradient(180deg, rgba(194, 236, 224, 0.72), rgba(111, 203, 177, 0.44)),
      rgba(125, 210, 185, 0.34);
  }

  .global-nav-button i,
  .global-nav-button.global-nav-button-visual i,
  body[data-page="island"] .global-nav-button i,
  body[data-page="island"] .global-nav-button.global-nav-button-visual i {
    flex: 0 0 clamp(26px, 8.3vw, 36px);
    width: clamp(26px, 8.3vw, 36px);
    height: clamp(26px, 8.3vw, 36px);
  }

  .global-nav-button.global-nav-button-visual i img,
  body[data-page="island"] .global-nav-button.global-nav-button-visual i img {
    width: clamp(26px, 8.3vw, 36px);
    height: clamp(26px, 8.3vw, 36px);
    max-width: clamp(26px, 8.3vw, 36px);
    max-height: clamp(26px, 8.3vw, 36px);
  }

  .global-nav-button span,
  body[data-page="island"] .global-nav-button span {
    flex: 0 1 auto;
    max-width: calc(100% - 29px);
    font-size: clamp(11px, 3.25vw, 15px);
    line-height: 1.05;
    text-align: left;
  }
}
/* Compact mobile island top HUD alignment override. */
@media (max-width: 640px) {
  body[data-page="island"] {
    --global-topbar-height: clamp(64px, 15.4vw, 68px);
    --ordered-mobile-hud-gap: 3px;
    --island-mobile-hud-gap: 3px;
  }

  body[data-page="island"] .topbar {
    grid-template-columns:
      minmax(102px, 1.42fr)
      minmax(70px, 0.92fr)
      minmax(60px, 0.78fr)
      clamp(38px, 10.4vw, 44px);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.86fr);
    height: var(--global-topbar-height);
    min-height: var(--global-topbar-height);
    padding: max(3px, env(safe-area-inset-top)) 6px 4px;
    border-radius: 0 0 12px 12px;
  }

  body[data-page="island"] .topbar::before {
    inset: 3px max(5px, env(safe-area-inset-right)) 4px max(5px, env(safe-area-inset-left));
  }

  body[data-page="island"] .global-player-anchor .global-player-button,
  body[data-page="island"] .topbar .global-status > .metric,
  body[data-page="island"] .topbar .global-status .wallet-slot,
  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
    min-height: 0 !important;
    height: 100% !important;
    border-radius: 999px;
  }

  body[data-page="island"] .global-player-anchor .global-player-button {
    grid-template-columns: clamp(22px, 5.6vw, 25px) minmax(0, 1fr);
    gap: 4px;
    padding: 2px 7px 2px 2px;
  }

  body[data-page="island"] .global-player-button .player-avatar {
    width: clamp(22px, 5.6vw, 25px);
    height: clamp(22px, 5.6vw, 25px);
  }

  body[data-page="island"] .global-player-text strong {
    font-size: clamp(10px, 2.75vw, 12px);
    line-height: 1;
  }

  body[data-page="island"] .topbar .global-status > .metric,
  body[data-page="island"] .topbar .global-status .wallet-slot {
    position: relative;
    display: grid !important;
    place-items: center !important;
    justify-items: center !important;
    align-items: center !important;
    padding: 0 !important;
  }

  body[data-page="island"] .topbar .global-status > .metric {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
  }

  body[data-page="island"] .topbar .global-status .wallet-slot i,
  body[data-page="island"] .topbar .global-status .metric i,
  body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i {
    position: absolute !important;
    top: 50% !important;
    left: clamp(3px, 1.15vw, 5px) !important;
    z-index: 2;
    width: clamp(17px, 4.5vw, 20px) !important;
    height: clamp(17px, 4.5vw, 20px) !important;
    margin: 0 !important;
    transform: translateY(-50%) !important;
  }

  body[data-page="island"] .topbar .global-status .metric i img,
  body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i img,
  body[data-page="island"] .topbar .global-status .wallet-slot i img {
    width: clamp(16px, 4.25vw, 19px) !important;
    height: clamp(16px, 4.25vw, 19px) !important;
  }

  body[data-page="island"] .topbar .global-status .metric span,
  body[data-page="island"] .topbar .global-status .wallet-slot span {
    display: none !important;
  }

  body[data-page="island"] .topbar .global-status .metric strong,
  body[data-page="island"] .topbar .global-status .wallet-slot strong {
    position: absolute !important;
    inset: 0 !important;
    z-index: 3;
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    min-width: 0;
    max-width: none;
    padding: 0 !important;
    overflow: hidden;
    font-size: clamp(13px, 3.45vw, 16px) !important;
    line-height: 1 !important;
    text-align: center !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: none !important;
  }

  body[data-page="island"] .topbar .global-status .wallet-cash strong {
    font-size: clamp(13px, 3.45vw, 16px) !important;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle {
    display: grid;
    place-items: center;
    padding: 2px !important;
    border-radius: 14px;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-icon {
    width: clamp(20px, 5.1vw, 23px) !important;
    height: clamp(20px, 5.1vw, 23px) !important;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-label {
    display: none !important;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle .mailbox-badge {
    top: 4px;
    right: 5px;
  }

  body[data-page="island"] .plots {
    height: calc(100dvh - var(--global-topbar-height));
    min-height: calc(100dvh - var(--global-topbar-height));
  }
}

/* Final mobile bottom nav label fit: show the full two-character labels. */
@media (max-width: 640px) {
  .global-nav-button,
  .global-nav-button.global-nav-button-visual,
  body[data-page="island"] .global-nav-button,
  body[data-page="island"] .global-nav-button.global-nav-button-visual {
    gap: clamp(2px, 0.75vw, 4px);
    padding: 3px clamp(1px, 0.8vw, 5px);
  }

  .global-nav-button i,
  .global-nav-button.global-nav-button-visual i,
  body[data-page="island"] .global-nav-button i,
  body[data-page="island"] .global-nav-button.global-nav-button-visual i,
  .global-nav-button.global-nav-button-visual i img,
  body[data-page="island"] .global-nav-button.global-nav-button-visual i img {
    flex-basis: clamp(24px, 7.1vw, 32px);
    width: clamp(24px, 7.1vw, 32px);
    height: clamp(24px, 7.1vw, 32px);
    max-width: clamp(24px, 7.1vw, 32px);
    max-height: clamp(24px, 7.1vw, 32px);
  }

  .global-nav-button span,
  body[data-page="island"] .global-nav-button span {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    overflow: visible;
    font-size: clamp(11px, 3vw, 14px);
    text-overflow: clip;
    white-space: nowrap;
  }
}
/* Final mobile island status HUD: sit flush on top of the bottom nav. */
@media (max-width: 640px) {
  body[data-page="island"] .island-status-hud:not(.collapsed),
  body[data-page="island"] .island-status-hud.custom-positioned:not(.collapsed) {
    bottom: calc(var(--global-mobile-nav-height) - 1px) !important;
  }
}
/* Final mobile island status handle: collapse the whole floating panel. */
@media (max-width: 640px) {
  body[data-page="island"] .island-status-hud.mobile-collapsed:not(.collapsed),
  body[data-page="island"] .island-status-hud.mobile-collapsed.custom-positioned:not(.collapsed) {
    bottom: calc(var(--global-mobile-nav-height) - 1px) !important;
    pointer-events: none;
  }

  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-panel {
    display: block;
    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    overflow: visible !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none;
  }

  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-panel::before,
  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-panel::after {
    display: none !important;
  }

  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-panel-head,
  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-list {
    display: none !important;
  }

  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-details-handle {
    top: 0 !important;
    height: 22px !important;
    pointer-events: auto;
    cursor: pointer;
  }

  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-details-handle span {
    width: 76px;
    background: rgba(34, 89, 84, 0.34);
  }
}
/* Final mobile island status handle hit target: prevent tap-through near bottom nav. */
@media (max-width: 640px) {
  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-panel {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
  }

  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-details-handle {
    top: -7px !important;
    width: 168px !important;
    height: 36px !important;
    pointer-events: auto !important;
  }

  body[data-page="island"] .island-status-hud.mobile-collapsed .island-status-details-handle span {
    pointer-events: none;
  }
}
/* Final mobile ship brief dock: top-left PC-style expansion, icon-only collapse. */
@media (max-width: 640px) {
  body[data-page="island"] .island-ship-brief-dock,
  body[data-page="island"] .island-ship-brief-dock.custom-positioned {
    position: fixed !important;
    z-index: 5560;
    top: var(--global-topbar-height) !important;
    right: auto !important;
    bottom: auto !important;
    left: 0 !important;
    width: min(206px, calc(100vw - 12px)) !important;
    max-height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 8px) !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border-radius: 0 20px 20px 0;
    transform: none !important;
  }

  body[data-page="island"] .island-ship-brief-dock.collapsed,
  body[data-page="island"] .island-ship-brief-dock.collapsed.custom-positioned {
    width: 54px !important;
    height: 54px !important;
    max-height: 54px !important;
    overflow: visible !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body[data-page="island"] .island-ship-brief-dock.collapsed::before,
  body[data-page="island"] .island-ship-brief-dock.collapsed::after {
    display: none !important;
  }

  body[data-page="island"] .island-side-ship-head {
    min-height: 54px;
    grid-template-columns: minmax(0, 1fr) 28px 28px;
    gap: 5px;
    padding: 11px 12px 10px;
    cursor: grab;
  }

  body[data-page="island"] .island-side-ship-title {
    gap: 9px;
    font-size: 16px;
  }

  body[data-page="island"] .island-side-ship-title span,
  body[data-page="island"] .island-side-ship-head .island-side-ship-title span {
    min-width: 0;
    max-width: none;
    font-size: 16px;
  }

  body[data-page="island"] .island-side-ship-title-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
  }

  body[data-page="island"] .island-side-ship-title-toggle:hover,
  body[data-page="island"] .island-side-ship-title-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.46);
    outline: none;
  }

  body[data-page="island"] .island-side-ship-title-icon,
  body[data-page="island"] .island-side-ship-head .island-side-ship-title-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
  }

  body[data-page="island"] .island-side-ship-toggle {
    display: inline-grid !important;
  }

  body[data-page="island"] .island-side-ship-list {
    display: grid !important;
    gap: 2px;
    padding: 4px 7px 8px;
  }

  body[data-page="island"] .island-side-ship-collapsed-icon {
    width: 54px !important;
    height: 54px !important;
    margin: 0 !important;
    padding: 6px !important;
    border-radius: 0 18px 18px 0;
    background: transparent !important;
    box-shadow: none !important;
  }

  body[data-page="island"] .island-side-ship-collapsed-image {
    width: 42px !important;
    height: 42px !important;
  }
}
/* Global compact mobile top HUD alignment override. */
@media (max-width: 640px) {
  body[data-page="island"],
  body:not([data-page="island"]) {
    --global-topbar-height: clamp(64px, 15.4vw, 68px);
    --ordered-mobile-hud-gap: 3px;
    --island-mobile-hud-gap: 3px;
  }

  body[data-page="island"] .topbar,
  body:not([data-page="island"]) .topbar {
    display: grid;
    grid-template-columns:
      minmax(102px, 1.42fr)
      minmax(70px, 0.92fr)
      minmax(60px, 0.78fr)
      clamp(38px, 10.4vw, 44px);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.86fr);
    align-items: stretch;
    justify-content: stretch;
    justify-items: stretch;
    gap: var(--ordered-mobile-hud-gap);
    height: var(--global-topbar-height);
    min-height: var(--global-topbar-height);
    padding: max(3px, env(safe-area-inset-top)) 6px 4px;
    border-radius: 0 0 12px 12px;
    overflow: visible;
    scrollbar-width: none;
  }

  body[data-page="island"] .topbar::before,
  body:not([data-page="island"]) .topbar::before {
    inset: 3px max(5px, env(safe-area-inset-right)) 4px max(5px, env(safe-area-inset-left));
  }

  body[data-page="island"] .topbar .global-status,
  body:not([data-page="island"]) .topbar .global-status {
    display: contents;
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  body[data-page="island"] .global-player-anchor,
  body:not([data-page="island"]) .global-player-anchor {
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    justify-self: stretch;
    min-width: 0;
    min-height: 0;
  }

  body[data-page="island"] .global-player-anchor .global-player-button,
  body:not([data-page="island"]) .global-player-anchor .global-player-button {
    width: 100%;
    height: 100% !important;
    min-width: 0;
    min-height: 0 !important;
    grid-template-columns: clamp(22px, 5.6vw, 25px) minmax(0, 1fr);
    gap: 4px;
    padding: 2px 7px 2px 2px;
    border-radius: 999px;
  }

  body[data-page="island"] .global-player-button .player-avatar,
  body:not([data-page="island"]) .global-player-button .player-avatar {
    width: clamp(22px, 5.6vw, 25px);
    height: clamp(22px, 5.6vw, 25px);
  }

  body[data-page="island"] .global-player-text strong,
  body:not([data-page="island"]) .global-player-text strong {
    font-size: clamp(10px, 2.75vw, 12px);
    line-height: 1;
  }

  body[data-page="island"] .topbar .global-status > .metric,
  body:not([data-page="island"]) .topbar .global-status > .metric {
    grid-column: auto;
    grid-row: auto;
    align-self: stretch;
    justify-self: stretch;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    place-items: center !important;
    width: 100%;
    min-width: 0;
    min-height: 0 !important;
    height: 100% !important;
    padding: 0 !important;
    border-radius: 999px;
    position: relative;
  }

  body[data-page="island"] .topbar .global-status > .metric:nth-child(2),
  body:not([data-page="island"]) .topbar .global-status > .metric:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-page="island"] .topbar .global-status > .metric:nth-child(3),
  body:not([data-page="island"]) .topbar .global-status > .metric:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
  }

  body[data-page="island"] .global-mailbox-anchor,
  body:not([data-page="island"]) .global-mailbox-anchor {
    grid-column: 4;
    grid-row: 1;
    align-self: stretch;
    justify-self: stretch;
    min-width: 0;
    min-height: 0;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle,
  body:not([data-page="island"]) .global-mailbox-anchor .mailbox-toggle {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100% !important;
    min-width: 0;
    min-height: 0 !important;
    padding: 2px !important;
    border-radius: 14px;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-icon,
  body:not([data-page="island"]) .global-mailbox-anchor .mailbox-toggle-icon {
    width: clamp(20px, 5.1vw, 23px) !important;
    height: clamp(20px, 5.1vw, 23px) !important;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle-label,
  body:not([data-page="island"]) .global-mailbox-anchor .mailbox-toggle-label {
    display: none !important;
  }

  body[data-page="island"] .global-mailbox-anchor .mailbox-toggle .mailbox-badge,
  body:not([data-page="island"]) .global-mailbox-anchor .mailbox-toggle .mailbox-badge {
    top: 4px;
    right: 5px;
  }

  body[data-page="island"] .topbar .global-status .wallet-metric,
  body:not([data-page="island"]) .topbar .global-status .wallet-metric {
    display: grid;
    grid-column: 1 / 5;
    grid-row: 2;
    align-self: stretch;
    justify-self: stretch;
    grid-template-columns: minmax(0, 1.78fr) minmax(0, 0.96fr) minmax(0, 0.96fr);
    grid-template-rows: minmax(0, 1fr);
    gap: var(--ordered-mobile-hud-gap);
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 0;
  }

  body[data-page="island"] .topbar .global-status .wallet-slot,
  body:not([data-page="island"]) .topbar .global-status .wallet-slot {
    position: relative;
    display: grid !important;
    place-items: center !important;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100% !important;
    min-width: 0;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: 999px;
  }

  body[data-page="island"] .topbar .global-status .wallet-cash,
  body:not([data-page="island"]) .topbar .global-status .wallet-cash {
    grid-column: 1;
    grid-row: 1;
  }

  body[data-page="island"] .topbar .global-status .wallet-gems,
  body:not([data-page="island"]) .topbar .global-status .wallet-gems {
    grid-column: 3;
    grid-row: 1;
  }

  body[data-page="island"] .topbar .global-status .wallet-gold,
  body:not([data-page="island"]) .topbar .global-status .wallet-gold {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-page="island"] .topbar .global-status .wallet-slot i,
  body[data-page="island"] .topbar .global-status .metric i,
  body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i,
  body:not([data-page="island"]) .topbar .global-status .wallet-slot i,
  body:not([data-page="island"]) .topbar .global-status .metric i,
  body:not([data-page="island"]) .topbar .global-status .metric.metric-visual-icon i {
    position: absolute !important;
    top: 50% !important;
    left: clamp(3px, 1.15vw, 5px) !important;
    z-index: 2;
    width: clamp(17px, 4.5vw, 20px) !important;
    height: clamp(17px, 4.5vw, 20px) !important;
    margin: 0 !important;
    transform: translateY(-50%) !important;
  }

  body[data-page="island"] .topbar .global-status .metric i img,
  body[data-page="island"] .topbar .global-status .metric.metric-visual-icon i img,
  body[data-page="island"] .topbar .global-status .wallet-slot i img,
  body:not([data-page="island"]) .topbar .global-status .metric i img,
  body:not([data-page="island"]) .topbar .global-status .metric.metric-visual-icon i img,
  body:not([data-page="island"]) .topbar .global-status .wallet-slot i img {
    width: clamp(16px, 4.25vw, 19px) !important;
    height: clamp(16px, 4.25vw, 19px) !important;
  }

  body[data-page="island"] .topbar .global-status .metric span,
  body[data-page="island"] .topbar .global-status .wallet-slot span,
  body:not([data-page="island"]) .topbar .global-status .metric span,
  body:not([data-page="island"]) .topbar .global-status .wallet-slot span {
    display: none !important;
  }

  body[data-page="island"] .topbar .global-status .metric strong,
  body[data-page="island"] .topbar .global-status .wallet-slot strong,
  body:not([data-page="island"]) .topbar .global-status .metric strong,
  body:not([data-page="island"]) .topbar .global-status .wallet-slot strong {
    position: absolute !important;
    inset: 0 !important;
    z-index: 3;
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    min-width: 0;
    max-width: none;
    padding: 0 !important;
    overflow: hidden;
    font-size: clamp(13px, 3.45vw, 16px) !important;
    line-height: 1 !important;
    text-align: center !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: none !important;
  }

  body[data-page="island"] .plots {
    height: calc(100dvh - var(--global-topbar-height));
    min-height: calc(100dvh - var(--global-topbar-height));
  }
}


/* Final desktop ship brief title icon: the icon button must be larger than the icon itself. */
@media (min-width: 641px) {
  html body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-head {
    grid-template-columns: minmax(0, 1fr) 28px 28px !important;
    min-height: 60px !important;
    padding: 8px 12px 8px 14px !important;
    overflow: visible !important;
  }

  html body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-head strong.island-side-ship-title {
    display: grid !important;
    grid-template-columns: 44px minmax(0, max-content) !important;
    align-items: center !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  html body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-head .island-side-ship-title > .island-side-ship-title-toggle {
    display: grid !important;
    place-items: center !important;
    flex: 0 0 44px !important;
    inline-size: 44px !important;
    block-size: 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
  }

  html body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-head .island-side-ship-title > .island-side-ship-title-toggle > img.island-side-ship-title-icon {
    display: block !important;
    flex: 0 0 42px !important;
    inline-size: 42px !important;
    block-size: 42px !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    object-fit: contain !important;
    transform: none !important;
  }
}
/* Final mobile ship brief title icon: reserve a real icon slot so it cannot be clipped. */
@media (max-width: 640px) {
  body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-head {
    min-height: 66px !important;
    gap: 8px !important;
    padding: 8px 14px 8px 18px !important;
    overflow: visible !important;
  }

  body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-title,
  body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-head .island-side-ship-title {
    display: grid !important;
    grid-template-columns: 56px auto !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-title span,
  body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-head .island-side-ship-title span {
    max-width: none !important;
    overflow: visible !important;
    line-height: 1 !important;
  }

  body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-title-toggle {
    box-sizing: border-box;
    display: grid !important;
    place-items: center !important;
    flex: 0 0 56px !important;
    width: 56px !important;
    min-width: 56px !important;
    height: 56px !important;
    margin: 0 !important;
    padding: 2px !important;
    overflow: visible !important;
  }

  body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-title-icon,
  body[data-page="island"] .island-ship-brief-dock:not(.collapsed) .island-side-ship-head .island-side-ship-title-icon {
    flex: 0 0 50px !important;
    width: 50px !important;
    height: 50px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
  }
}
/* Final mobile ship voyage sheet: compact route-first layout with expandable cargo summary. */
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-sheet-handle,
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-summary {
  display: none;
}

@media (max-width: 760px) {
  body.ship-voyage-modal-open .island-cargo-modal-backdrop:has(.island-ship-voyage-modal),
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-cargo-modal-backdrop:has(.island-ship-voyage-modal) {
    align-items: end;
    bottom: 0;
    display: grid;
    justify-items: stretch;
    left: 0;
    padding: 0;
    place-items: end stretch;
    right: 0;
    top: 0;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal {
    align-self: end;
    border-bottom: 0;
    border-radius: 30px 30px 0 0;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: min(86dvh, calc(100dvh - 10px));
    width: 100vw;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-sheet-handle {
    display: grid;
    left: 50%;
    place-items: center;
    pointer-events: none;
    position: absolute;
    top: 8px;
    transform: translateX(-50%);
    width: 96px;
    z-index: 13;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-sheet-handle span {
    background: rgba(82, 132, 125, 0.32);
    border-radius: 999px;
    box-shadow: inset 0 1px 1px rgba(35, 77, 70, 0.16), 0 1px 0 rgba(255, 255, 255, 0.72);
    display: block;
    height: 5px;
    width: 78px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal > .island-cargo-close {
    height: 42px !important;
    right: 14px !important;
    top: 22px !important;
    width: 42px !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head {
    align-items: center;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 30px 62px 10px 16px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head div {
    max-width: 100%;
    min-width: 0;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head > div > span {
    font-size: 12px;
    letter-spacing: 0;
    transform: none;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-title-row {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-title-row strong {
    display: block;
    font-size: 24px;
    line-height: 1.08;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker {
    min-width: 0;
    width: 100% !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker .exchange-glass-select-button,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker select {
    border-radius: 18px;
    font-size: 24px;
    min-height: 46px;
    padding-left: 16px;
    padding-right: 48px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-ship-picker .exchange-glass-select-chevron {
    height: 34px;
    width: 34px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-cargo-modal-head em {
    display: none;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-body {
    display: grid;
    gap: 10px;
    overflow-y: auto;
    padding: 8px 12px max(12px, env(safe-area-inset-bottom));
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-summary {
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(229, 249, 244, 0.54)), rgba(255, 255, 255, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 26px rgba(42, 72, 66, 0.09);
    color: #173430;
    display: block;
    overflow: hidden;
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    backdrop-filter: blur(24px) saturate(1.3);
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-summary summary {
    cursor: pointer;
    display: grid;
    gap: 8px;
    list-style: none;
    min-height: 76px;
    padding: 11px 12px 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-summary summary::-webkit-details-marker {
    display: none;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-width: 0;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-head strong {
    color: #123733;
    font-size: 16px;
    font-weight: 950;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-head em {
    color: #a66b0c;
    font-size: 15px;
    font-style: normal;
    font-weight: 950;
    white-space: nowrap;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-track {
    background: rgba(26, 60, 53, 0.12);
    border-radius: 999px;
    display: block;
    height: 5px;
    overflow: hidden;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-track b {
    background: linear-gradient(90deg, #55cabd, #8eddd4);
    border-radius: inherit;
    display: block;
    height: 100%;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-chips {
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-chips::-webkit-scrollbar {
    display: none;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-chip {
    align-items: center;
    background: rgba(255, 255, 255, 0.58);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
    color: #244c48;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 5px;
    min-height: 30px;
    padding: 3px 8px 3px 4px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-chip strong {
    font-size: 13px;
    font-weight: 950;
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-chip em {
    color: rgba(38, 61, 57, 0.62);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-chip.more,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-empty {
    color: rgba(38, 61, 57, 0.62);
    font-size: 13px;
    font-weight: 900;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-icon {
    display: grid;
    flex: 0 0 auto;
    height: 26px;
    place-items: center;
    width: 26px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-icon img {
    height: 100%;
    object-fit: contain;
    width: 100%;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-list {
    border-top: 1px solid rgba(34, 61, 57, 0.08);
    display: grid;
    gap: 4px;
    max-height: 180px;
    overflow: auto;
    padding: 8px 10px 10px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-row {
    align-items: center;
    display: grid;
    gap: 7px;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    min-height: 34px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-row strong {
    color: #0b756b;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-row em,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-row small {
    color: rgba(23, 52, 48, 0.72);
    font-size: 13px;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-planner {
    border-radius: 20px;
    padding: 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route {
    gap: 8px;
    grid-template-columns: 1fr;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-origin {
    min-height: 44px;
    padding: 0 12px;
    width: 100%;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-origin strong {
    font-size: 16px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route-arrow {
    font-size: 18px;
    line-height: 18px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-route input {
    font-size: 18px;
    height: 48px;
    padding: 0 16px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-destination-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    margin-top: 2px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-destination-chips::-webkit-scrollbar {
    display: none;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-destination-chips button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats > div:first-child {
    grid-column: 1 / -1;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats > div {
    min-height: 50px;
    padding: 9px 10px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats > div span {
    font-size: 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-stats > div strong {
    font-size: 15px;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-actions {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 34%) !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-start-button {
    font-size: 17px;
    min-height: 50px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode {
    min-height: 50px;
    padding: 5px 7px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode span {
    font-size: 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode-picker .exchange-glass-select-button,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode select {
    border-radius: 14px;
    font-size: 13px;
    min-height: 34px;
    padding-left: 10px;
    padding-right: 30px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-vitals {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital {
    border-radius: 18px;
    gap: 8px;
    min-width: 0;
    padding: 11px 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital strong {
    align-items: start;
    gap: 4px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital strong span {
    font-size: 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital strong em {
    font-size: 17px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action {
    align-items: stretch;
    display: grid;
    gap: 6px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action small {
    font-size: 11px;
    line-height: 1.25;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-vital-action button {
    min-height: 34px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-service-dialog {
    border-radius: 18px;
    padding: 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo {
    border-radius: 20px;
    max-height: 230px;
    min-height: 0;
    overflow: auto;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-panel-head {
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-cargo-head-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-left: 0;
    min-width: 0;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-table-head,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo .island-cargo-row.no-action {
    grid-template-columns: minmax(0, 1fr) 62px 64px;
  }
}
/* Empty plot modal inline header controls. */
body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) {
  grid-template-rows: auto minmax(0, 1fr);
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(132px, 230px) minmax(360px, 960px) minmax(48px, 76px);
  align-items: center;
  gap: 18px;
  padding: 16px 24px 14px;
  background:
    radial-gradient(ellipse at 88% 0%, rgba(85, 222, 204, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(225, 248, 243, 0.12));
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs-shell .empty-plot-tabs {
  width: 100%;
  max-width: none;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-inline-title {
  justify-self: start;
  color: #123b35;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.68);
  white-space: nowrap;
}

body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-inline-close {
  justify-self: end;
}

@media (max-width: 760px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs-shell {
    grid-template-columns: minmax(0, 1fr) 48px;
    grid-template-areas:
      "title close"
      "tabs tabs";
    gap: 10px;
    padding: 12px;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-inline-title {
    grid-area: title;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-tabs-shell .empty-plot-tabs {
    grid-area: tabs;
    width: 100%;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-inline-close {
    grid-area: close;
  }
}
/* Final mobile ship voyage mode order: mode above the primary action. */
@media (max-width: 760px) {
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-actions {
    gap: 8px !important;
    grid-template-columns: 1fr !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode {
    align-items: center;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 46px;
    order: 1;
    padding: 5px 8px 5px 12px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode span {
    font-size: 14px;
    white-space: nowrap;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode .exchange-glass-select {
    justify-self: stretch;
    width: 100%;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode-picker .exchange-glass-select-button,
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mode select {
    min-height: 36px;
    width: 100%;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-start-button {
    order: 2;
    width: 100%;
  }
}
/* Final mobile ship voyage cargo visibility: show hold cargo directly below vitals. */
@media (max-width: 900px) {
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-summary {
    display: block !important;
    margin-top: 0;
    order: 3;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-summary summary {
    cursor: default;
    padding-bottom: 9px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-list {
    max-height: 142px;
    overflow-y: auto;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-row {
    min-height: 38px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo {
    display: none !important;
  }
}
@media (max-width: 900px) {
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-summary summary {
    pointer-events: none;
  }
}
/* Final mobile island status header icon: draw a clear upward arrow, mobile only. */
@media (max-width: 760px) {
  html body[data-page="island"] .island-status-hud .island-status-panel-head .island-status-dropdown-button::before,
  html body[data-page="island"] .island-status-hud .island-status-panel-head .island-status-dropdown-button::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    display: block !important;
    width: 13px !important;
    height: 4px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #315f59 !important;
    transform-origin: center !important;
  }

  html body[data-page="island"] .island-status-hud .island-status-panel-head .island-status-dropdown-button::before {
    left: 8px !important;
    transform: translateY(-50%) rotate(-42deg) !important;
  }

  html body[data-page="island"] .island-status-hud .island-status-panel-head .island-status-dropdown-button::after {
    right: 8px !important;
    transform: translateY(-50%) rotate(42deg) !important;
  }
}
/* Corrected mobile island status header icon: single chevron-up, not an X. */
@media (max-width: 760px) {
  html body[data-page="island"] .island-status-hud .island-status-panel-head .island-status-dropdown-button::before {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    top: 52% !important;
    display: block !important;
    width: 13px !important;
    height: 13px !important;
    border-top: 4px solid #315f59 !important;
    border-left: 4px solid #315f59 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-radius: 2px !important;
    background: transparent !important;
    transform: translate(-50%, -36%) rotate(45deg) !important;
    transform-origin: center !important;
  }

  html body[data-page="island"] .island-status-hud .island-status-panel-head .island-status-dropdown-button::after {
    display: none !important;
    content: none !important;
  }
}
/* Final mobile island status header icon size: smaller chevron-up. */
@media (max-width: 760px) {
  html body[data-page="island"] .island-status-hud .island-status-panel-head .island-status-dropdown-button::before {
    width: 6px !important;
    height: 6px !important;
    border-top-width: 2px !important;
    border-left-width: 2px !important;
    border-radius: 1px !important;
    transform: translate(-50%, -38%) rotate(45deg) !important;
  }
}
/* Task opportunity reset button gem cost. */
.technology-workbench-shell[data-workbench-tab="goals"] button.task-reset-button .task-reset-label,
.technology-workbench-shell[data-workbench-tab="goals"] button.task-reset-button .task-reset-cost,
button.task-reset-button .task-reset-label,
button.task-reset-button .task-reset-cost {
  display: inline-flex;
  align-items: center;
}

.technology-workbench-shell[data-workbench-tab="goals"] button.task-reset-button .task-reset-cost,
button.task-reset-button .task-reset-cost {
  gap: 3px;
  font-size: 0.82em;
  font-weight: 950;
  line-height: 1;
}

.technology-workbench-shell[data-workbench-tab="goals"] button.task-reset-button .task-reset-cost .task-reward-icon,
button.task-reset-button .task-reset-cost .task-reward-icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  background: transparent;
  box-shadow: none;
}

.technology-workbench-shell[data-workbench-tab="goals"] button.task-reset-button .task-reset-cost .task-reward-icon img,
button.task-reset-button .task-reset-cost .task-reward-icon img {
  width: 22px;
  height: 22px;
}
/* Final mobile layout edit top bar: replace ship/info overlays while editing. */
@media (max-width: 640px) {
  html body[data-page="island"].island-layout-editing .island-ship-brief-dock,
  html body[data-page="island"].island-layout-editing .island-ship-brief-dock.custom-positioned,
  html body[data-page="island"].island-layout-editing .island-map-info-toggle {
    display: none !important;
    pointer-events: none !important;
  }

  html body[data-page="island"].island-layout-editing .island-map-layout-edit-actions {
    position: fixed !important;
    z-index: 5585 !important;
    top: calc(var(--global-topbar-height) + 10px) !important;
    right: 0 !important;
    bottom: auto !important;
    left: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    width: min(74vw, 500px) !important;
    min-height: 54px;
    gap: 8px;
    padding: 8px 9px 8px 16px !important;
    border-radius: 28px 0 0 28px !important;
    border: 1px solid rgba(255, 255, 255, 0.58) !important;
    background:
      radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.7), transparent 34%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.54), rgba(211, 248, 240, 0.5) 48%, rgba(154, 235, 219, 0.42)),
      rgba(232, 250, 246, 0.78) !important;
    box-shadow:
      0 12px 28px rgba(28, 74, 74, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(24px) saturate(1.45) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.45) !important;
  }

  html body[data-page="island"].island-layout-editing .island-map-layout-edit-status {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: none !important;
    min-height: 42px;
    padding: 0 14px !important;
    overflow: hidden;
    border-radius: 999px;
    color: #07837d !important;
    font-size: clamp(13px, 3.4vw, 16px) !important;
    font-weight: 1000;
    line-height: 1.05 !important;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  }

  html body[data-page="island"].island-layout-editing .island-map-layout-edit-status.invalid {
    color: #b34a45 !important;
  }

  html body[data-page="island"].island-layout-editing .island-map-layout-cancel-button,
  html body[data-page="island"].island-layout-editing .island-map-layout-save-button {
    min-width: clamp(54px, 15vw, 76px) !important;
    height: 42px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.62) !important;
    font-size: clamp(13px, 3.4vw, 16px) !important;
    font-weight: 1000 !important;
    line-height: 1 !important;
    box-shadow:
      0 7px 14px rgba(27, 84, 83, 0.13),
      inset 0 1px 0 rgba(255, 255, 255, 0.78) !important;
  }

  html body[data-page="island"].island-layout-editing .island-map-layout-cancel-button {
    color: #314546 !important;
    background: rgba(255, 255, 255, 0.72) !important;
  }

  html body[data-page="island"].island-layout-editing .island-map-layout-save-button {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 94, 86, 0.28);
    background: linear-gradient(180deg, #6bd5c8, #1a9e96) !important;
  }
}
/* Desktop island info toggle: hide textual on/off state. */
@media (min-width: 641px) {
  body[data-page="island"] .island-map-info-toggle {
    padding-right: 14px;
  }

  body[data-page="island"] .island-map-info-toggle i {
    display: none;
  }
}
/* Final mobile layout edit status: keep the validation sentence complete. */
@media (max-width: 640px) {
  html body[data-page="island"].island-layout-editing .island-map-layout-edit-actions {
    grid-template-columns: minmax(168px, 1fr) auto auto !important;
    width: min(88vw, 540px) !important;
    gap: 7px !important;
    padding-left: 12px !important;
  }

  html body[data-page="island"].island-layout-editing .island-map-layout-edit-status {
    min-width: 168px !important;
    padding-right: 10px !important;
    padding-left: 10px !important;
    font-size: clamp(12px, 3.15vw, 15px) !important;
    letter-spacing: 0 !important;
  }
}

@media (max-width: 380px) {
  html body[data-page="island"].island-layout-editing .island-map-layout-edit-actions {
    width: calc(100vw - 8px) !important;
    gap: 5px !important;
    padding-right: 6px !important;
    padding-left: 8px !important;
  }

  html body[data-page="island"].island-layout-editing .island-map-layout-edit-status {
    min-width: 156px !important;
    padding-right: 8px !important;
    padding-left: 8px !important;
    font-size: 12px !important;
  }

  html body[data-page="island"].island-layout-editing .island-map-layout-cancel-button,
  html body[data-page="island"].island-layout-editing .island-map-layout-save-button {
    min-width: 50px !important;
    padding-right: 9px !important;
    padding-left: 9px !important;
    font-size: 12px !important;
  }
}
/* Final mobile layout edit shell: centered symmetric pill with lighter glass base. */
@media (max-width: 640px) {
  html body[data-page="island"].island-layout-editing .island-map-layout-edit-actions {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(86vw, 540px) !important;
    border-radius: 999px !important;
    border-color: rgba(255, 255, 255, 0.34) !important;
    background:
      radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.48), transparent 36%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(211, 248, 240, 0.28) 48%, rgba(154, 235, 219, 0.2)),
      rgba(232, 250, 246, 0.42) !important;
    box-shadow:
      0 10px 24px rgba(28, 74, 74, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.56),
      inset 0 -1px 0 rgba(255, 255, 255, 0.18) !important;
  }
}

@media (max-width: 380px) {
  html body[data-page="island"].island-layout-editing .island-map-layout-edit-actions {
    left: 50% !important;
    right: auto !important;
    width: calc(100vw - 18px) !important;
    border-radius: 999px !important;
    transform: translateX(-50%) !important;
  }
}
/* Mobile island top tools drawer: centered handle with info and expansion controls. */
@media (max-width: 640px) {
  body[data-page="island"]:not(.island-layout-editing) .island-map-info-toggle {
    display: none !important;
  }

  html body[data-page="island"].island-mobile-top-controls-expanded .island-ship-brief-dock,
  html body[data-page="island"].island-mobile-top-controls-expanded .island-ship-brief-dock.custom-positioned {
    display: none !important;
    pointer-events: none !important;
  }

  body[data-page="island"] .island-mobile-top-controls {
    position: fixed;
    z-index: 5576;
    top: calc(var(--global-topbar-height) + 2px);
    left: 50%;
    display: grid;
    grid-template-rows: 30px auto;
    justify-items: center;
    width: min(calc(100vw - 40px), 560px);
    transform: translateX(-50%);
    pointer-events: none;
  }

  body[data-page="island"] .island-mobile-top-controls-handle {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: start center;
    width: 166px;
    height: 30px;
    padding: 8px 0 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
  }

  body[data-page="island"] .island-mobile-top-controls-handle span {
    display: block;
    width: 116px;
    height: 5px;
    border-radius: 999px;
    background: rgba(101, 139, 135, 0.36);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.66),
      inset 0 1px 1px rgba(38, 74, 73, 0.16);
  }

  body[data-page="island"] .island-mobile-top-controls-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(76px, auto);
    align-items: center;
    width: 100%;
    min-height: 58px;
    gap: 10px;
    padding: 8px 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    background:
      radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.5), transparent 36%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.38), rgba(211, 248, 240, 0.32) 48%, rgba(154, 235, 219, 0.24)),
      rgba(232, 250, 246, 0.46);
    box-shadow:
      0 10px 24px rgba(28, 74, 74, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.62),
      inset 0 -1px 0 rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(24px) saturate(1.45);
    -webkit-backdrop-filter: blur(24px) saturate(1.45);
    opacity: 1;
    transform: translateY(0) scaleY(1);
    transform-origin: top center;
    transition: opacity 160ms ease, transform 160ms ease, max-height 160ms ease, padding 160ms ease;
    pointer-events: auto;
  }

  body[data-page="island"] .island-mobile-top-controls.collapsed .island-mobile-top-controls-panel {
    max-height: 0;
    margin-top: -8px;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
    opacity: 0;
    transform: translateY(-16px) scaleY(0.88);
    pointer-events: none;
  }

  body[data-page="island"] .island-mobile-top-controls.expanded .island-mobile-top-controls-panel {
    max-height: 76px;
  }

  body[data-page="island"] .island-mobile-top-info-toggle {
    position: relative;
    display: grid;
    grid-template-columns: 42px auto auto;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 42px;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    border-radius: 999px;
    color: #244d4a;
    background: rgba(255, 255, 255, 0.54);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
    font-weight: 1000;
    line-height: 1;
    white-space: nowrap;
  }

  body[data-page="island"] .island-mobile-top-info-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  body[data-page="island"] .island-mobile-top-info-toggle::before {
    content: "";
    display: block;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: rgba(126, 154, 149, 0.28);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.72),
      0 4px 10px rgba(28, 99, 91, 0.12);
  }

  body[data-page="island"] .island-mobile-top-info-toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 12px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 2px 5px rgba(20, 75, 70, 0.22);
    transform: translate(0, -50%);
    transition: transform 140ms ease;
  }

  body[data-page="island"] .island-mobile-top-info-toggle.active::before {
    background: linear-gradient(90deg, #55bdb6, #74d3be);
  }

  body[data-page="island"] .island-mobile-top-info-toggle.active::after {
    transform: translate(18px, -50%);
  }

  body[data-page="island"] .island-mobile-top-info-toggle span,
  body[data-page="island"] .island-mobile-top-info-toggle i {
    font-size: clamp(13px, 3.35vw, 16px);
    font-style: normal;
    letter-spacing: 0;
  }

  body[data-page="island"] .island-mobile-top-info-toggle i {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    min-height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
    color: #335855;
  }

  body[data-page="island"] .island-mobile-top-expand-button {
    display: inline-grid;
    place-items: center;
    min-width: 76px;
    height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(180deg, #6bd5c8, #1a9e96);
    box-shadow:
      0 7px 14px rgba(27, 84, 83, 0.13),
      inset 0 1px 0 rgba(255, 255, 255, 0.78);
    font-size: clamp(13px, 3.35vw, 16px);
    font-weight: 1000;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 94, 86, 0.28);
    cursor: pointer;
    white-space: nowrap;
  }

  body[data-page="island"] .island-mobile-top-expand-button.active {
    color: #214f4b;
    background: rgba(255, 255, 255, 0.72);
    text-shadow: none;
  }

  body[data-page="island"] .island-mobile-top-expand-button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
  }
}

@media (max-width: 380px) {
  body[data-page="island"] .island-mobile-top-controls {
    width: calc(100vw - 18px);
  }

  body[data-page="island"] .island-mobile-top-controls-panel {
    grid-template-columns: minmax(0, 1fr) minmax(62px, auto);
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  body[data-page="island"] .island-mobile-top-info-toggle {
    grid-template-columns: 38px auto auto;
    gap: 5px;
    padding-right: 8px;
    padding-left: 7px;
  }

  body[data-page="island"] .island-mobile-top-info-toggle::before {
    width: 38px;
    height: 22px;
  }

  body[data-page="island"] .island-mobile-top-info-toggle::after {
    left: 10px;
    width: 16px;
    height: 16px;
  }

  body[data-page="island"] .island-mobile-top-info-toggle.active::after {
    transform: translate(17px, -50%);
  }

  body[data-page="island"] .island-mobile-top-info-toggle span,
  body[data-page="island"] .island-mobile-top-info-toggle i,
  body[data-page="island"] .island-mobile-top-expand-button {
    font-size: 12px;
  }

  body[data-page="island"] .island-mobile-top-info-toggle i {
    min-width: 24px;
    padding-right: 6px;
    padding-left: 6px;
  }

  body[data-page="island"] .island-mobile-top-expand-button {
    min-width: 62px;
    padding-right: 11px;
    padding-left: 11px;
  }
}
/* Desktop global feedback toasts: top center instead of top right. */
@media (min-width: 641px) {
  .global-feedback-host {
    right: auto;
    left: 50%;
    width: min(420px, calc(100vw - 56px));
    transform: translateX(-50%);
  }
}
/* Mobile top info switch knob: keep the white knob inside the switch track. */
@media (max-width: 640px) {
  body[data-page="island"] .island-mobile-top-info-toggle::before {
    background:
      radial-gradient(circle at 12px 50%, rgba(255, 255, 255, 0.98) 0 8px, rgba(255, 255, 255, 0) 8.8px),
      rgba(126, 154, 149, 0.28) !important;
    filter: drop-shadow(0 2px 4px rgba(20, 75, 70, 0.18));
  }

  body[data-page="island"] .island-mobile-top-info-toggle.active::before {
    background:
      radial-gradient(circle at calc(100% - 12px) 50%, rgba(255, 255, 255, 0.98) 0 8px, rgba(255, 255, 255, 0) 8.8px),
      linear-gradient(90deg, #55bdb6, #74d3be) !important;
  }

  body[data-page="island"] .island-mobile-top-info-toggle::after {
    display: none !important;
    content: none !important;
  }
}

@media (max-width: 380px) {
  body[data-page="island"] .island-mobile-top-info-toggle::before {
    background:
      radial-gradient(circle at 11px 50%, rgba(255, 255, 255, 0.98) 0 7px, rgba(255, 255, 255, 0) 7.8px),
      rgba(126, 154, 149, 0.28) !important;
  }

  body[data-page="island"] .island-mobile-top-info-toggle.active::before {
    background:
      radial-gradient(circle at calc(100% - 11px) 50%, rgba(255, 255, 255, 0.98) 0 7px, rgba(255, 255, 255, 0) 7.8px),
      linear-gradient(90deg, #55bdb6, #74d3be) !important;
  }
}
/* Mobile top tools handle: match the bottom island status handle exactly. */
@media (max-width: 640px) {
  body[data-page="island"] .island-mobile-top-controls {
    grid-template-rows: 36px auto !important;
  }

  body[data-page="island"] .island-mobile-top-controls-handle {
    display: grid !important;
    place-items: center !important;
    width: 168px !important;
    height: 36px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body[data-page="island"] .island-mobile-top-controls-handle span {
    width: 76px !important;
    height: 4px !important;
    border-radius: 999px !important;
    background: rgba(34, 89, 84, 0.34) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.58),
      0 1px 2px rgba(28, 72, 68, 0.1) !important;
  }
}
/* Final mobile State Affairs shell: unify all government tabs to the Production sheet radius. */
@media (max-width: 760px) {
  .technology-workbench-modal:not(.diplomacy-workbench-modal) {
    align-items: stretch;
    justify-content: center;
    padding: 0;
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) {
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-bottom: 0;
    border-radius: 30px 30px 0 0 !important;
    background:
      radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.62), transparent 34%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(229, 249, 244, 0.72) 52%, rgba(255, 248, 226, 0.72)),
      rgba(239, 249, 246, 0.88);
    box-shadow:
      0 34px 90px rgba(26, 55, 52, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.88),
      inset 0 -1px 0 rgba(117, 159, 152, 0.18);
    -webkit-backdrop-filter: blur(28px) saturate(1.28);
    backdrop-filter: blur(28px) saturate(1.28);
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell)::before {
    border-radius: inherit;
  }

  .technology-workbench-shell:not(.diplomacy-workbench-shell) .technology-workbench-head {
    overflow: hidden;
    border-radius: 30px 30px 0 0;
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(231, 249, 245, 0.62) 58%, rgba(255, 244, 213, 0.58)),
      rgba(255, 255, 255, 0.52);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.62);
  }
}
/* Mobile top handle hidden while ship brief is expanded. */
@media (max-width: 640px) {
  html body[data-page="island"]:not(.island-layout-editing):not(.island-mobile-top-controls-expanded):has(.island-ship-brief-dock:not(.collapsed)) .island-mobile-top-controls {
    display: none !important;
    pointer-events: none !important;
  }
}
/* World sea view target actions: keep enter and voyage buttons aligned. */
#worldSeaViewModalHost .world-sea-view-target-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  justify-self: end;
}

#worldSeaViewModalHost .world-sea-view-target-actions .world-sea-view-destination-button {
  justify-self: auto;
}

@media (max-width: 640px) {
  #worldSeaViewModalHost .world-sea-view-target-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    justify-self: start;
    margin-top: 4px;
  }
}
/* Final mobile profile layout: keep character showcase below the public visibility toggle. */
@media (max-width: 760px) {
  .player-profile-console-self .player-profile-hero-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .player-profile-console-self .player-profile-avatar-stage {
    order: 1;
  }

  .player-profile-console-self .player-profile-hero-copy {
    order: 2;
  }

  .player-profile-console-self .player-profile-nation-identity {
    order: 3;
  }

  .player-profile-console-self .player-profile-visibility-toggle {
    position: static;
    grid-column: 1;
    grid-row: auto;
    order: 4;
    justify-self: start;
    margin-top: 4px;
  }

  .player-profile-console-self .player-profile-character-panel {
    grid-column: 1;
    grid-row: auto;
    order: 5;
    justify-self: stretch;
    width: 100%;
    margin-top: 12px;
  }
}
/* Mobile exchange order book: show five rows per side and scroll for more. */
@media (max-width: 640px) {
  body[data-page="exchange"] .exchange-book-side {
    --exchange-book-row-height: 60px;
    grid-auto-rows: var(--exchange-book-row-height);
    max-height: calc(var(--exchange-book-row-height) * 5);
    min-height: 0 !important;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  body[data-page="exchange"] .exchange-book-row {
    height: var(--exchange-book-row-height);
    min-height: var(--exchange-book-row-height);
    margin-bottom: 0;
  }
}/* Mobile payment page: keep recent payment records at the bottom. */
@media (max-width: 720px) {
  body[data-page="payment"] .payment-console {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="payment"] .payment-main-column,
  body[data-page="payment"] .payment-side-column {
    display: contents;
  }

  body[data-page="payment"] .payment-status-card {
    order: 1;
  }

  body[data-page="payment"] .payment-gems-card {
    order: 2;
  }

  body[data-page="payment"] .payment-premium-card {
    order: 3;
  }

  body[data-page="payment"] .payment-golden-card {
    order: 4;
  }

  body[data-page="payment"] .payment-transactions-card {
    order: 20;
  }
}
/* Desktop guard: island mobile top tools must never render on PC. */
body[data-page="island"] .island-mobile-top-controls {
  display: none !important;
  pointer-events: none !important;
}

@media (max-width: 640px) {
  body[data-page="island"] .island-mobile-top-controls {
    display: grid !important;
    pointer-events: none !important;
  }
}
/* Mobile encyclopedia flow: list first, detail second, with list/back/close controls. */
.encyclopedia-mobile-list-button {
  display: none !important;
}

@media (max-width: 980px) {
  .encyclopedia-header {
    grid-template-columns: minmax(0, 1fr) auto auto auto !important;
    gap: 8px !important;
  }

  .encyclopedia-header .secondary.encyclopedia-mobile-list-button,
  .encyclopedia-header .secondary.encyclopedia-back-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 42px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .encyclopedia-modal[data-mobile-view="list"] .encyclopedia-detail {
    display: none !important;
  }

  .encyclopedia-modal[data-mobile-view="detail"] .encyclopedia-sidebar {
    display: none !important;
  }

  .encyclopedia-modal[data-mobile-view="list"] .encyclopedia-sidebar {
    display: flex !important;
    max-height: none !important;
    border-bottom: 0 !important;
  }

  .encyclopedia-modal[data-mobile-view="detail"] .encyclopedia-detail {
    display: grid !important;
    min-height: 0;
    overflow-y: auto;
  }

  .encyclopedia-modal[data-mobile-view="list"] .encyclopedia-body,
  .encyclopedia-modal[data-mobile-view="detail"] .encyclopedia-body {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .encyclopedia-modal[data-mobile-view="list"] .encyclopedia-sidebar [data-encyclopedia-list] {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .encyclopedia-header {
    padding: 12px !important;
  }

  .encyclopedia-header strong {
    font-size: 20px !important;
  }

  .encyclopedia-header div span {
    width: 28px !important;
    height: 28px !important;
  }

  .encyclopedia-header .secondary.encyclopedia-mobile-list-button,
  .encyclopedia-header .secondary.encyclopedia-back-button {
    min-width: 58px;
    padding: 0 10px;
  }
}
/* Mobile island modal guard: hide top tools behind every dialog. */
@media (max-width: 640px) {
  html body[data-page="island"]:has([data-modal-root="true"]) .island-mobile-top-controls {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
/* Mobile encyclopedia final fit: keep list/detail complete below the fixed HUD. */
@media (max-width: 980px) {
  .encyclopedia-overlay {
    top: var(--global-topbar-height) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    align-items: stretch !important;
    justify-content: center !important;
    padding: 8px max(6px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)) !important;
    overflow: hidden !important;
  }

  .encyclopedia-modal {
    width: min(100%, 560px) !important;
    height: calc(100dvh - var(--global-topbar-height) - 18px) !important;
    max-height: none !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    border-radius: 24px !important;
    overflow: hidden !important;
  }

  .encyclopedia-header {
    min-height: 54px !important;
    grid-template-columns: minmax(0, 1fr) auto auto auto !important;
    gap: 6px !important;
    padding: 8px 10px !important;
  }

  .encyclopedia-header div {
    min-width: 0 !important;
    gap: 8px !important;
  }

  .encyclopedia-header div span {
    width: 28px !important;
    height: 28px !important;
    flex: 0 0 28px !important;
    font-size: 15px !important;
  }

  .encyclopedia-header strong {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: clamp(18px, 4.6vw, 23px) !important;
  }

  .encyclopedia-header .secondary.encyclopedia-mobile-list-button,
  .encyclopedia-header .secondary.encyclopedia-back-button {
    min-width: 50px !important;
    min-height: 36px !important;
    padding: 0 8px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
  }

  .encyclopedia-close {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 14px !important;
    font-size: 24px !important;
  }

  .encyclopedia-body {
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  .encyclopedia-sidebar,
  .encyclopedia-detail {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 10px !important;
    overflow: hidden !important;
  }

  .encyclopedia-modal[data-mobile-view="list"] .encyclopedia-sidebar {
    display: grid !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    gap: 9px !important;
    height: 100% !important;
    max-height: none !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
  }

  .encyclopedia-modal[data-mobile-view="detail"] .encyclopedia-detail {
    display: grid !important;
    gap: 12px !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .encyclopedia-sidebar [data-encyclopedia-list],
  .encyclopedia-list-scroll {
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .encyclopedia-search {
    min-height: 44px !important;
    padding: 0 12px !important;
    border-radius: 18px !important;
  }

  .encyclopedia-search span {
    font-size: 19px !important;
  }

  .encyclopedia-search input {
    min-width: 0 !important;
    font-size: 18px !important;
  }

  .encyclopedia-filters {
    display: grid !important;
    grid-template-columns: minmax(96px, 0.74fr) minmax(0, 1.26fr) !important;
    gap: 8px !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .encyclopedia-filters select {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    padding: 0 30px 0 13px !important;
    border-radius: 17px !important;
    font-size: 17px !important;
  }

  .encyclopedia-tier-tabs {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 4px !important;
    padding: 4px !important;
    overflow: hidden !important;
    border-radius: 17px !important;
  }

  .encyclopedia-tier-tabs button,
  .encyclopedia-tier-tabs button:first-child,
  .encyclopedia-tier-tabs button:last-child {
    min-width: 0 !important;
    min-height: 34px !important;
    padding: 0 !important;
    border-radius: 13px !important;
    font-size: 15px !important;
  }

  .encyclopedia-list-scroll {
    gap: 9px !important;
    padding-right: 0 !important;
  }

  .encyclopedia-list-block {
    min-width: 0 !important;
    padding: 10px !important;
    border-radius: 19px !important;
  }

  .encyclopedia-list-title {
    align-items: center !important;
    min-width: 0 !important;
    font-size: clamp(20px, 6vw, 25px) !important;
    line-height: 1.08 !important;
  }

  .encyclopedia-list-title span {
    font-size: 13px !important;
  }

  .encyclopedia-grid-products,
  .encyclopedia-grid-workforce {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }

  .encyclopedia-entry-products,
  .encyclopedia-entry-workforce {
    min-height: 122px !important;
    grid-template-rows: 74px auto !important;
    gap: 6px !important;
    padding: 9px !important;
    border-radius: 17px !important;
  }

  .encyclopedia-entry-products > span,
  .encyclopedia-entry-workforce > span {
    width: 100% !important;
    height: 74px !important;
    min-height: 74px !important;
    border-radius: 15px !important;
  }

  .encyclopedia-entry .product-icon-image,
  .encyclopedia-entry .workforce-type-icon {
    width: min(70px, 82%) !important;
    height: min(70px, 82%) !important;
    object-fit: contain !important;
  }

  .encyclopedia-entry strong,
  .encyclopedia-entry-products strong,
  .encyclopedia-entry-workforce strong {
    width: 100% !important;
    margin: 0 !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    font-size: clamp(15px, 4.3vw, 18px) !important;
    line-height: 1.08 !important;
  }

  .encyclopedia-grid-buildings {
    grid-template-columns: 1fr !important;
    gap: 9px !important;
  }

  .encyclopedia-entry-buildings {
    min-height: 154px !important;
    padding: 9px !important;
    border-radius: 17px !important;
  }

  .encyclopedia-entry-buildings > span {
    height: 128px !important;
    min-height: 128px !important;
  }

  .encyclopedia-product-card,
  .encyclopedia-product-marketbar,
  .encyclopedia-hero,
  .encyclopedia-section,
  .encyclopedia-product-dossier {
    min-width: 0 !important;
    border-radius: 20px !important;
    padding: 12px !important;
  }

  .encyclopedia-product-card,
  .encyclopedia-product-marketbar,
  .encyclopedia-hero {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .encyclopedia-product-icon,
  .encyclopedia-hero-icon {
    width: 92px !important;
    height: 92px !important;
    margin: 0 auto !important;
  }

  .encyclopedia-product-copy h2,
  .encyclopedia-hero h2 {
    font-size: clamp(26px, 8vw, 36px) !important;
    line-height: 1.06 !important;
  }

  .encyclopedia-product-actions {
    width: 100% !important;
    justify-content: stretch !important;
  }

  .encyclopedia-product-action {
    flex: 1 1 0 !important;
    min-width: 0 !important;
  }
}

@media (max-width: 380px) {
  .encyclopedia-overlay {
    padding-right: 5px !important;
    padding-left: 5px !important;
  }

  .encyclopedia-modal {
    border-radius: 21px !important;
  }

  .encyclopedia-header {
    padding-right: 8px !important;
    padding-left: 8px !important;
  }

  .encyclopedia-filters {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .encyclopedia-entry-products,
  .encyclopedia-entry-workforce {
    min-height: 116px !important;
    grid-template-rows: 68px auto !important;
  }

  .encyclopedia-entry-products > span,
  .encyclopedia-entry-workforce > span {
    height: 68px !important;
    min-height: 68px !important;
  }
}

/* Mobile encyclopedia density pass: show four product cards per row. */
@media (max-width: 980px) {
  .encyclopedia-grid-products,
  .encyclopedia-grid-workforce {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .encyclopedia-entry-products,
  .encyclopedia-entry-workforce {
    min-height: 92px !important;
    grid-template-rows: 54px minmax(24px, auto) !important;
    gap: 5px !important;
    padding: 7px 5px 8px !important;
    border-radius: 15px !important;
  }

  .encyclopedia-entry-products > span,
  .encyclopedia-entry-workforce > span {
    height: 54px !important;
    min-height: 54px !important;
    border-radius: 13px !important;
  }

  .encyclopedia-entry .product-icon-image,
  .encyclopedia-entry .workforce-type-icon {
    width: min(50px, 88%) !important;
    height: min(50px, 88%) !important;
  }

  .encyclopedia-entry strong,
  .encyclopedia-entry-products strong,
  .encyclopedia-entry-workforce strong {
    font-size: clamp(12px, 3.45vw, 15px) !important;
    line-height: 1.08 !important;
    text-align: center !important;
  }
}

@media (max-width: 380px) {
  .encyclopedia-grid-products,
  .encyclopedia-grid-workforce {
    gap: 5px !important;
  }

  .encyclopedia-entry-products,
  .encyclopedia-entry-workforce {
    min-height: 86px !important;
    grid-template-rows: 48px minmax(24px, auto) !important;
    padding: 6px 4px 7px !important;
  }

  .encyclopedia-entry-products > span,
  .encyclopedia-entry-workforce > span {
    height: 48px !important;
    min-height: 48px !important;
  }

  .encyclopedia-entry .product-icon-image,
  .encyclopedia-entry .workforce-type-icon {
    width: min(45px, 88%) !important;
    height: min(45px, 88%) !important;
  }
}

/* Mobile world map gesture stabilization. */
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  body[data-page="world"] {
    overscroll-behavior: none;
  }

  body[data-page="world"] .app,
  body[data-page="world"] .world-command-console,
  body[data-page="world"] .world-command-body {
    overscroll-behavior: contain;
  }

  body[data-page="world"] .world-command-console {
    contain: layout paint;
  }

  body[data-page="world"] .world-command-body {
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: auto;
  }

  body[data-page="world"] .world-map-layout,
  body[data-page="world"] .world-map-board,
  body[data-page="world"] .world-chart-wrap,
  body[data-page="world"] .world-map-field,
  body[data-page="world"] .world-map-grid {
    touch-action: none;
    overscroll-behavior: contain;
  }

  body[data-page="world"] .world-chart-wrap,
  body[data-page="world"] .world-map-grid,
  body[data-page="world"] .world-voyage-routes {
    backface-visibility: hidden;
    transform: translateZ(0);
  }

  body[data-page="world"] .world-chart-wrap.world-map-dragging {
    cursor: grabbing;
  }
}

/* Mobile encyclopedia product icons can use the available card whitespace. */
@media (max-width: 980px) {
  .encyclopedia-entry-products .product-icon-image {
    width: min(58px, 100%) !important;
    height: min(58px, 100%) !important;
  }
}

@media (max-width: 380px) {
  .encyclopedia-entry-products .product-icon-image {
    width: min(52px, 100%) !important;
    height: min(52px, 100%) !important;
  }
}

/* Mobile world map: use an internal two-axis pan viewport instead of page scroll. */
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  html.world-page-scroll-lock,
  html.world-page-scroll-lock body[data-page="world"] {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body[data-page="world"] .app {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding-top: calc(var(--global-topbar-height) + 8px);
    padding-bottom: calc(var(--global-bottom-nav-reserve) + 6px);
  }

  body[data-page="world"] #worldPage,
  body[data-page="world"] #worldPage > section,
  body[data-page="world"] #worldMap {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body[data-page="world"] .world-command-console {
    height: 100%;
    min-height: 0 !important;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr);
  }

  body[data-page="world"] .world-command-body {
    height: 100%;
    min-height: 0;
    overflow: auto !important;
    overscroll-behavior: contain;
    padding-bottom: 10px;
    scrollbar-width: none;
    touch-action: none;
    -webkit-overflow-scrolling: auto;
  }

  body[data-page="world"] .world-command-body::-webkit-scrollbar {
    display: none;
  }

  body[data-page="world"] .world-map-layout {
    justify-content: start;
    min-height: max-content;
  }

  body[data-page="world"] .world-map-board,
  body[data-page="world"] .world-chart-wrap {
    min-height: max-content;
  }
}

/* Production orders modal: output-first card interaction. */
body[data-page="island"] .empty-plot-modal.building-plot-modal.building-production-orders-modal:not(.building-production-automation-modal) {
  width: min(560px, calc(100vw - 24px));
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-controls {
  display: grid;
  gap: 14px;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slot {
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 48%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(229, 250, 245, 0.54)),
    rgba(255, 255, 255, 0.46);
  color: #173b36;
  box-shadow:
    0 8px 18px rgba(18, 86, 76, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slot strong,
body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slot em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slot strong {
  font-size: 15px;
  font-weight: 950;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slot em {
  color: rgba(40, 72, 66, 0.62);
  font-size: 18px;
  font-weight: 950;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slot.filled {
  grid-template-columns: auto minmax(0, 1fr);
  border-color: rgba(7, 143, 128, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(224, 250, 244, 0.64)),
    rgba(255, 255, 255, 0.54);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slot.filled em {
  order: 0;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(7, 143, 128, 0.12);
  color: #08786c;
  font-size: 12px;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slot.filled strong {
  order: 1;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 251, 247, 0.62)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    0 10px 22px rgba(18, 86, 76, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-segmented button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(26, 58, 52, 0.84);
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-segmented button.selected {
  background: linear-gradient(180deg, #1dbfa8, #08786c);
  color: #ffffff;
  box-shadow:
    0 9px 18px rgba(7, 143, 128, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-list {
  display: grid;
  gap: 12px;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card {
  position: relative;
  isolation: isolate;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.76) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(231, 250, 245, 0.58) 58%, rgba(249, 245, 226, 0.3)),
    rgba(255, 255, 255, 0.56) !important;
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  backdrop-filter: blur(24px) saturate(165%);
  box-shadow:
    0 16px 34px rgba(20, 86, 78, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(255, 255, 255, 0.32) !important;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card:hover {
  border-color: rgba(7, 143, 128, 0.4) !important;
  transform: translateY(-1px);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card.selected {
  border-color: rgba(7, 143, 128, 0.62) !important;
  box-shadow:
    0 18px 40px rgba(20, 86, 78, 0.16),
    inset 0 0 0 2px rgba(7, 143, 128, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-main {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-output-hero {
  position: relative;
  height: 136px;
  min-height: 136px;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: 104px 32px;
  align-items: center;
  justify-items: center;
  padding: 0;
  border: 1px solid rgba(26, 88, 78, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(236, 247, 244, 0.78));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-output-hero > span {
  position: absolute;
  top: 0;
  left: 50%;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-output-hero .product-icon-image {
  width: 104px;
  height: 104px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 8px 12px rgba(28, 61, 55, 0.14));
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-output-hero em {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 34px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 0 16px 0 12px;
  background: linear-gradient(180deg, #d5a83b, #ad7c15);
  color: #ffffff;
  font-size: 14px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  box-shadow: -3px 4px 10px rgba(72, 54, 18, 0.16);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-output-hero strong {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 32px;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 0;
  background: rgba(25, 49, 45, 0.94);
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card-body {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card-head strong {
  color: #173b36;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1.05;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card-head span {
  color: rgba(40, 72, 66, 0.62);
  font-size: 14px;
  font-weight: 900;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-produce {
  flex: 0 0 auto;
  min-width: 86px;
  min-height: 42px;
  border: 1px solid rgba(7, 143, 128, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, #1dbfa8, #08786c);
  color: #ffffff;
  font-size: 16px;
  font-weight: 950;
  box-shadow:
    0 10px 18px rgba(7, 143, 128, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  cursor: pointer;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-produce:disabled {
  border-color: rgba(31, 81, 74, 0.12);
  background: rgba(31, 81, 74, 0.08);
  color: rgba(38, 64, 59, 0.45);
  box-shadow: none;
  cursor: not-allowed;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material,
body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip,
body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-expanded-detail span {
  min-width: 0;
  border: 1px solid rgba(26, 88, 78, 0.1);
  background: rgba(255, 255, 255, 0.7);
  box-shadow:
    0 5px 12px rgba(18, 86, 76, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 6px;
  border-radius: 12px;
  color: #173b36;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-style: normal;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material .product-icon-image {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material strong {
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material em {
  color: rgba(26, 58, 52, 0.7);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material.missing {
  border-color: rgba(205, 67, 58, 0.32);
  background: rgba(255, 244, 242, 0.78);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material.more,
body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material.empty {
  padding-inline: 14px;
  color: rgba(41, 72, 66, 0.66);
  font-weight: 950;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.52fr);
  gap: 8px;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 12px;
  color: #173b36;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip.time,
body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip.muted {
  grid-template-columns: auto minmax(0, 1fr);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-style: normal;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip .technology-industry-icon {
  width: 28px;
  height: 28px;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip em,
body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-expanded-detail em {
  color: rgba(40, 72, 66, 0.58);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip strong,
body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-expanded-detail strong {
  min-width: 0;
  color: #173b36;
  font-size: 14px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-expanded-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 105, 92, 0.14);
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-expanded-detail span {
  width: fit-content;
  max-width: 100%;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 12px;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-expanded-detail strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.2;
}

body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-recipe-reasons {
  margin-top: 10px;
  border-radius: 14px;
  background: rgba(205, 67, 58, 0.1);
  color: #96342d;
}

@media (max-width: 760px) {
  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-orders-body .building-modal-body {
    padding: 12px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-controls {
    gap: 10px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slots {
    gap: 7px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slot {
    min-height: 46px;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 15px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slot strong {
    font-size: 16px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-slot.filled em {
    height: 22px;
    padding: 0 7px;
    font-size: 11px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-segmented button {
    min-height: 40px;
    font-size: 16px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-list {
    gap: 10px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card {
    padding: 10px;
    border-radius: 20px !important;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-main {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-output-hero {
    height: 118px;
    min-height: 118px;
    border-radius: 16px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-output-hero > span {
    top: 4px;
    width: 78px;
    height: 82px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-output-hero .product-icon-image {
    width: 76px;
    height: 76px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-output-hero em {
    min-width: 30px;
    height: 24px;
    padding: 0 7px;
    font-size: 13px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-output-hero strong {
    height: 30px;
    font-size: 12px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card-body {
    gap: 8px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card-head {
    gap: 8px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card-head strong {
    font-size: 19px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-card-head span {
    font-size: 13px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-produce {
    min-width: 76px;
    min-height: 38px;
    padding: 0 12px;
    font-size: 14px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-inputs {
    gap: 6px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material {
    min-height: 34px;
    gap: 6px;
    padding: 3px 10px 3px 5px;
    border-radius: 11px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material i,
  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material .product-icon-image,
  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip i,
  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip .technology-industry-icon {
    width: 24px;
    height: 24px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material strong {
    font-size: 14px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-material em {
    font-size: 12px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip {
    width: fit-content;
    max-width: 100%;
    min-height: 34px;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 11px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip strong {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip em,
  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-expanded-detail em {
    font-size: 12px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-meta-chip strong,
  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-expanded-detail strong {
    font-size: 13px;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-expanded-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-expanded-detail .building-production-order-detail-workforce {
    grid-column: 1 / -1;
  }

  body[data-page="island"] .building-production-orders-modal:not(.building-production-automation-modal) .building-production-order-expanded-detail .building-production-order-detail-workforce strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
}
/* Mobile world map compact header: keep info in one line and give space back to the chart. */
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  body[data-page="world"] .world-command-console {
    gap: 5px;
    padding: 6px 8px 7px;
  }

  body[data-page="world"] .world-command-header {
    gap: 5px;
    grid-template-columns: minmax(0, 1fr);
    padding: 0 0 5px;
  }

  body[data-page="world"] .world-command-title {
    gap: 2px;
    min-width: 0;
  }

  body[data-page="world"] .world-command-title h3 {
    font-size: clamp(19px, 4.8vw, 22px);
    line-height: 1;
    white-space: nowrap;
  }

  body[data-page="world"] .world-command-title p {
    font-size: clamp(9px, 2.25vw, 12px);
    line-height: 1.1;
    min-width: 0;
    white-space: nowrap;
  }

  body[data-page="world"] .world-command-metrics {
    gap: 5px;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body[data-page="world"] .world-command-metric {
    align-items: baseline;
    display: flex;
    gap: 3px;
    justify-content: center;
    min-height: 32px;
    min-width: 0;
    padding: 4px 5px;
    white-space: nowrap;
  }

  body[data-page="world"] .world-command-metric span,
  body[data-page="world"] .world-command-metric small {
    display: inline;
    font-size: clamp(8px, 1.95vw, 10px);
    line-height: 1;
  }

  body[data-page="world"] .world-command-metric strong {
    display: inline;
    font-size: clamp(14px, 3.7vw, 18px);
    line-height: 1;
    margin: 0;
  }

  body[data-page="world"] .world-command-body {
    padding-top: 4px;
  }
}

/* Mobile world map metric polish: aligned compact pills, route reads like 0ÕýÔÚº½ÐÐ. */
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  body[data-page="world"] .world-command-metrics {
    align-items: stretch;
    gap: 6px;
  }

  body[data-page="world"] .world-command-metric {
    align-items: center;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
      rgba(15, 31, 39, 0.78);
    border-color: rgba(142, 184, 192, 0.34);
    border-radius: 10px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 5px 12px rgba(0, 0, 0, 0.11);
    gap: 4px;
    justify-content: center;
    min-height: 34px;
    padding: 4px 6px;
    text-align: center;
  }

  body[data-page="world"] .world-command-metric span,
  body[data-page="world"] .world-command-metric small {
    color: rgba(207, 227, 226, 0.76);
    font-weight: 650;
  }

  body[data-page="world"] .world-command-metric strong {
    min-width: max-content;
    text-align: center;
  }

  body[data-page="world"] .world-command-metric.route {
    gap: 0;
  }

  body[data-page="world"] .world-command-metric.route span {
    display: none;
  }

  body[data-page="world"] .world-command-metric.route small {
    margin-left: 0;
  }
}

/* Mobile exchange chart stats drawer. */
.exchange-chart-stats-handle {
  display: none;
}

.exchange-chart-stats-content {
  min-width: 0;
}

@media (max-width: 640px) {
  .exchange-chart-stats-shell {
    display: grid;
    gap: 8px;
    margin-top: 6px;
  }

  .exchange-chart-stats-shell.collapsed .exchange-chart-stats-content {
    display: none;
  }

  .exchange-chart-stats-shell .market-summary {
    margin-top: 0;
  }

  .exchange-chart-stats-handle {
    appearance: none;
    -webkit-appearance: none;
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
    cursor: pointer;
    display: grid;
    height: 28px;
    justify-self: center;
    min-height: 28px;
    padding: 0;
    place-items: center;
    width: min(146px, 42vw);
  }

  .exchange-chart-stats-handle span {
    background: linear-gradient(90deg, #ff6f6c, #ff534f);
    border-radius: 999px;
    box-shadow:
      0 5px 12px rgba(255, 83, 79, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
    display: block;
    height: 6px;
    width: min(108px, 34vw);
  }

  .exchange-chart-stats-shell.expanded .exchange-chart-stats-handle {
    margin-top: 1px;
  }
}
/* Ship voyage modal ship selector arrow fix. */
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-ship-voyage-ship-picker .exchange-glass-select-chevron::before {
  background: transparent !important;
  border: 0 solid currentColor !important;
  border-right-width: 4px !important;
  border-bottom-width: 4px !important;
  border-radius: 2px !important;
  content: "";
  height: 10px !important;
  left: 50% !important;
  opacity: 0.9 !important;
  position: absolute;
  top: 46% !important;
  transform: translate(-50%, -58%) rotate(45deg) !important;
  transform-origin: center !important;
  width: 10px !important;
}

:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-modal .island-ship-voyage-ship-picker .exchange-glass-select-chevron::after {
  content: none !important;
  display: none !important;
}
/* Mobile island warehouse cargo workflow. */
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-tabs,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch {
  display: none;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight {
  display: grid;
  gap: 1px;
  min-width: 0;
  text-align: right;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount small,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight small {
  display: none;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount strong,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight strong {
  color: inherit;
  font: inherit;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer {
  grid-template-columns: 70px minmax(120px, 1fr) 78px 78px 86px 40px 40px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-amount,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-weight {
  display: grid;
  gap: 1px;
  min-width: 0;
  text-align: right;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-amount small,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-weight small {
  overflow: hidden;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-amount strong,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-weight strong {
  color: #123733;
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
}

@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-backdrop {
    align-items: end;
    justify-items: center;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  }

  body[data-page="island"] .island-warehouse-cargo-modal {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    width: min(100%, 620px);
    max-height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 12px);
    border-radius: 28px 28px 8px 8px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal::after {
    content: "";
    position: absolute;
    top: 12px;
    left: 50%;
    width: 86px;
    height: 5px;
    border-radius: 999px;
    background: rgba(54, 100, 94, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    transform: translateX(-50%);
    z-index: 3;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-modal-head {
    min-height: 72px;
    padding: 28px 70px 10px 22px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-modal-head strong {
    font-size: 32px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-close {
    top: 24px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 18px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    align-items: center;
    margin: 0 18px 10px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255,255,255,.76), rgba(231,249,245,.5)), rgba(255,255,255,.34);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 12px 24px rgba(31, 79, 72, 0.08);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target div {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target span,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target small {
    color: rgba(35, 62, 58, 0.58);
    font-size: 12px;
    font-weight: 900;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target strong {
    overflow: hidden;
    color: #123733;
    font-size: 18px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target em {
    justify-self: end;
    color: #0b8f82;
    font-size: 16px;
    font-style: normal;
    font-weight: 950;
    white-space: nowrap;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target small {
    grid-column: 1 / 2;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target i {
    grid-column: 1 / -1;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(29, 76, 68, 0.12);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #25c9b4, #0b8f82);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 18px 10px;
    padding: 5px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 20px;
    background: rgba(255,255,255,.34);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.74);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-tabs button {
    min-height: 44px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: rgba(35, 62, 58, 0.58);
    cursor: pointer;
    font-size: 17px;
    font-weight: 950;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-tabs button.active {
    background: linear-gradient(180deg, rgba(49, 201, 183, 0.94), rgba(9, 139, 129, 0.92));
    color: #fffdf6;
    box-shadow: 0 10px 18px rgba(14, 134, 124, 0.16), inset 0 1px 0 rgba(255,255,255,.36);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0 14px 8px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal.mobile-tab-warehouse .island-cargo-ship-panel,
  body[data-page="island"] .island-warehouse-cargo-modal.mobile-tab-ship .island-cargo-columns > .island-cargo-panel:not(.island-cargo-ship-panel) {
    display: none;
  }

  body[data-page="island"] .island-warehouse-cargo-modal.mobile-tab-ship .island-cargo-mobile-batch {
    display: none;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-select {
    padding: 0 4px 10px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-source-select-wrap {
    padding: 0 4px 10px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head {
    display: grid;
    gap: 10px;
    padding: 8px 6px 10px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head strong {
    font-size: 22px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-actions {
    justify-content: stretch;
    width: 100%;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-actions .island-cargo-capacity,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-actions > span {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 38px;
    font-size: 16px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-actions .island-cargo-bulk-button:not(.unload) {
    display: none;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-track {
    margin: 0 6px 10px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-table-head {
    display: none;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-list,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-cargo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
    overflow: auto;
    padding: 0 4px 10px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row.compact {
    display: grid;
    grid-template-areas:
      "product action"
      "amount action"
      "weight action";
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 6px 8px;
    min-height: 128px;
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(255,255,255,.72), rgba(235,249,245,.48)), rgba(255,255,255,.34);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product {
    grid-area: product;
    gap: 9px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255,255,255,.38);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-icon .product-icon-image {
    width: 44px;
    height: 44px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product strong {
    font-size: 18px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product small {
    font-size: 11px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount {
    grid-area: amount;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight {
    grid-area: weight;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight {
    text-align: left;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount small,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight small {
    display: block;
    color: rgba(35, 62, 58, 0.54);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount strong,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight strong {
    color: #143b37;
    font-size: 15px;
    font-weight: 950;
    line-height: 1.12;
    white-space: nowrap;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-load-controls {
    grid-area: action;
    align-self: center;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-load {
    width: 38px;
    height: 38px;
    border-radius: 15px;
    font-size: 18px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px 44px 44px;
    gap: 8px;
    margin: 2px 0 8px;
    padding: 12px;
    border-radius: 20px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer > span:first-child,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer input[type="range"] {
    grid-column: 1 / -1;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer input[type="number"] {
    width: 72px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-amount,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-weight {
    text-align: left;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-confirm,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-cancel {
    width: 44px;
    height: 40px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin: 0 10px 10px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255,255,255,.82), rgba(229,249,244,.6)), rgba(255,255,255,.42);
    box-shadow: 0 -8px 28px rgba(30, 83, 75, 0.12), inset 0 1px 0 rgba(255,255,255,.92);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch div {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch span,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch small {
    overflow: hidden;
    color: rgba(35, 62, 58, 0.58);
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch strong {
    overflow: hidden;
    color: #123733;
    font-size: 16px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch-primary,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch-secondary {
    border: 0;
    cursor: pointer;
    font-weight: 950;
    white-space: nowrap;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch-primary {
    min-height: 50px;
    padding: 0 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, #39cfbf, #0b9388 62%, #08786f);
    color: #fffdf6;
    font-size: 18px;
    box-shadow: 0 12px 24px rgba(10, 143, 132, 0.22), inset 0 1px 0 rgba(255,255,255,.34);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch-secondary {
    grid-column: 1 / -1;
    min-height: 40px;
    border-radius: 16px;
    background: rgba(255,255,255,.54);
    color: #0b756b;
    font-size: 15px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch-primary:disabled {
    background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(225,239,235,.42));
    color: rgba(35, 62, 58, 0.36);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.74);
    cursor: default;
  }
}

@media (max-width: 430px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-list,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-cargo {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch-primary {
    width: 100%;
  }
}

/* Mobile warehouse correction: cargo list is the primary surface. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-backdrop {
    padding: 6px 8px max(4px, env(safe-area-inset-bottom));
  }

  body[data-page="island"] .island-warehouse-cargo-modal {
    height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 8px);
    max-height: calc(100dvh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 8px);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    border-radius: 24px 24px 8px 8px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-modal-head {
    min-height: 58px;
    padding: 22px 60px 6px 18px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-modal-head strong {
    font-size: 28px;
    line-height: 1;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-close {
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border-radius: 16px;
    font-size: 24px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    margin: 0 14px 6px;
    padding: 8px 10px;
    border-radius: 18px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target div {
    gap: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target span,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target small {
    display: none;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target strong {
    font-size: 18px;
    line-height: 1.1;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target em {
    font-size: 16px;
    line-height: 1.1;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target i {
    height: 4px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-tabs {
    gap: 5px;
    margin: 0 14px 7px;
    padding: 4px;
    border-radius: 18px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-tabs button {
    min-height: 36px;
    border-radius: 14px;
    font-size: 16px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-columns {
    min-height: 0;
    overflow: hidden;
    padding: 0 10px 6px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal.mobile-tab-warehouse .island-cargo-columns > .island-cargo-panel:not(.island-cargo-ship-panel),
  body[data-page="island"] .island-warehouse-cargo-modal.mobile-tab-ship .island-cargo-ship-panel {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-source-select-wrap,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-select {
    padding: 0 2px 6px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-source-select-wrap .exchange-glass-select-button,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-select .exchange-glass-select-button,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-source-select-wrap select,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-select select {
    min-height: 42px;
    height: 42px;
    border-radius: 16px;
    font-size: 16px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head {
    gap: 6px;
    padding: 4px 4px 6px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head strong {
    font-size: 20px;
    line-height: 1.1;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head small {
    font-size: 11px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-actions {
    gap: 6px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-actions .island-cargo-capacity,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-actions > span {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 15px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-track {
    height: 5px;
    margin: 0 4px 7px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-list,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-cargo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 7px;
    min-height: 0;
    overflow-y: auto;
    padding: 0 2px 8px;
    -webkit-overflow-scrolling: touch;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row.compact {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 4px 7px;
    min-height: 98px;
    padding: 9px;
    border-radius: 17px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product {
    gap: 7px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-icon .product-icon-image {
    width: 36px;
    height: 36px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product strong {
    font-size: 16px;
    line-height: 1.1;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product small,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount small,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight small {
    font-size: 10px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount strong,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight strong {
    font-size: 13px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-load {
    width: 34px;
    height: 34px;
    border-radius: 13px;
    font-size: 16px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 0 8px 8px;
    padding: 8px 10px;
    border-radius: 18px;
    box-shadow: 0 -6px 18px rgba(30, 83, 75, 0.1), inset 0 1px 0 rgba(255,255,255,.92);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch div {
    gap: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch span,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch small,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch-secondary {
    display: none;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch strong {
    font-size: 14px;
    line-height: 1.15;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch-primary {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 15px;
    font-size: 15px;
  }
}

@media (max-width: 430px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-list,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-cargo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch-primary {
    width: auto;
  }
}

@media (max-width: 640px) {
  body[data-page="exchange"] .exchange-product-selector-backdrop {
    align-items: start;
    justify-items: center;
    overflow-y: auto;
    padding: calc(var(--global-topbar-height) + 8px) 10px max(12px, env(safe-area-inset-bottom));
    z-index: calc(var(--global-hud-z) + 720);
  }

  body[data-page="exchange"] .exchange-product-selector-modal {
    border-radius: 24px;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    left: auto;
    max-height: calc(100dvh - var(--global-topbar-height) - 22px);
    min-height: min(560px, calc(100dvh - var(--global-topbar-height) - 22px));
    position: relative;
    top: auto;
    transform: none;
    width: min(100%, 560px);
  }

  body[data-page="exchange"] .exchange-product-selector-head {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 48px;
    padding: 22px 18px 14px;
  }

  body[data-page="exchange"] .exchange-product-selector-head > div {
    align-self: center;
    grid-column: 1;
    grid-row: 1;
  }

  body[data-page="exchange"] .exchange-product-selector-head strong {
    font-size: clamp(28px, 7.6vw, 34px);
    line-height: 1.05;
  }

  body[data-page="exchange"] .exchange-product-selector-head .exchange-product-selector-search {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 58px;
  }

  body[data-page="exchange"] .exchange-product-selector-head > span {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    padding-left: 2px;
  }

  body[data-page="exchange"] .exchange-product-selector-close {
    border-radius: 18px;
    grid-column: 2;
    grid-row: 1;
    height: 48px;
    width: 48px;
  }

  body[data-page="exchange"] .exchange-product-selector-toolbar {
    padding: 0 18px 14px;
  }

  body[data-page="exchange"] .exchange-product-selector-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  body[data-page="exchange"] .exchange-product-selector-tabs button {
    flex: 0 0 auto;
    min-height: 42px;
    min-width: 104px;
    padding: 0 13px;
    scroll-snap-align: start;
  }

  body[data-page="exchange"] .exchange-product-selector-table {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 14px 14px;
    scroll-padding-bottom: 14px;
  }

  body[data-page="exchange"] .exchange-product-selector-labels {
    display: none;
  }

  body[data-page="exchange"] .exchange-product-selector-list {
    gap: 10px;
    padding-top: 2px;
  }

  body[data-page="exchange"] .exchange-product-selector-row {
    border: 0;
    border-radius: 18px;
    display: grid;
    gap: 8px 10px;
    grid-template-areas:
      "product price"
      "volume change"
      "stock stock";
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    min-width: 0;
    padding: 12px;
    width: 100%;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(238, 250, 246, 0.48)),
      rgba(255, 255, 255, 0.34);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.82),
      0 8px 18px rgba(42, 72, 66, 0.07);
  }

  body[data-page="exchange"] .exchange-product-selector-row.selected {
    box-shadow:
      inset 4px 0 0 rgba(8, 125, 103, 0.72),
      inset 0 1px 0 rgba(255, 255, 255, 0.82),
      0 8px 18px rgba(42, 72, 66, 0.08);
  }

  body[data-page="exchange"] .exchange-product-selector-product {
    grid-area: product;
    grid-template-columns: 42px minmax(0, 1fr);
  }

  body[data-page="exchange"] .exchange-product-selector-product strong {
    font-size: clamp(15px, 4.15vw, 17px);
    line-height: 1.12;
  }

  body[data-page="exchange"] .exchange-product-selector-price {
    align-self: start;
    font-size: clamp(15px, 4.2vw, 18px);
    grid-area: price;
    justify-self: end;
    white-space: nowrap;
  }

  body[data-page="exchange"] .exchange-product-selector-change,
  body[data-page="exchange"] .exchange-product-selector-volume,
  body[data-page="exchange"] .exchange-product-selector-stock {
    align-items: center;
    background: rgba(255, 255, 255, 0.56);
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    gap: 4px;
    min-height: 28px;
    padding: 4px 9px;
    white-space: nowrap;
  }

  body[data-page="exchange"] .exchange-product-selector-change {
    grid-area: change;
    justify-self: end;
  }

  body[data-page="exchange"] .exchange-product-selector-volume {
    grid-area: volume;
    justify-self: start;
  }

  body[data-page="exchange"] .exchange-product-selector-stock {
    grid-area: stock;
    justify-self: start;
  }
}
/* Mobile warehouse polish: remove duplicate chevrons and keep card facts on one line. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-select::after {
    content: none;
    display: none;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
    text-align: left;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount small,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight small {
    flex: 0 0 auto;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount strong,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight strong {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
  }
}

/* Mobile fleet page: compact command-board layout for phone-sized screens. */
@media (max-width: 700px) {
  body[data-page="ships"] #shipsPage {
    display: block;
  }

  body[data-page="ships"] #shipsPage > section {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  body[data-page="ships"] .fleet-command-page {
    min-height: calc(100svh - var(--global-topbar-height));
    gap: 10px;
    padding: 10px 10px calc(104px + env(safe-area-inset-bottom));
  }

  body[data-page="ships"] .fleet-command-hero {
    min-height: 116px;
    padding: 18px;
    border-radius: 24px;
    background-position: center center;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.22),
      0 14px 30px rgba(25, 73, 82, 0.16);
  }

  body[data-page="ships"] .fleet-command-kicker,
  body[data-page="ships"] .fleet-command-hero p {
    display: none;
  }

  body[data-page="ships"] .fleet-command-hero h3 {
    font-size: clamp(34px, 9.8vw, 46px);
    line-height: 1.04;
  }

  body[data-page="ships"] .fleet-command-layout,
  body[data-page="ships"] .fleet-command-main {
    display: grid;
    gap: 10px;
  }

  body[data-page="ships"] .fleet-command-layout {
    grid-template-columns: 1fr;
  }

  body[data-page="ships"] .fleet-command-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  body[data-page="ships"] .fleet-command-metric {
    min-height: 82px;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 18px;
  }

  body[data-page="ships"] .fleet-command-metric::before {
    width: 30px;
    height: 4px;
  }

  body[data-page="ships"] .fleet-command-metric small,
  body[data-page="ships"] .fleet-command-metric span {
    font-size: 12px;
    line-height: 1.2;
  }

  body[data-page="ships"] .fleet-command-metric strong {
    font-size: clamp(24px, 6.4vw, 32px);
    line-height: 1;
  }

  body[data-page="ships"] .fleet-command-section,
  body[data-page="ships"] .fleet-command-inspector,
  body[data-page="ships"] .fleet-command-drawer,
  body[data-page="ships"] .ship-rental-panel {
    border-radius: 22px;
  }

  body[data-page="ships"] .fleet-command-section {
    gap: 10px;
    padding: 12px;
  }

  body[data-page="ships"] .fleet-command-section-head,
  body[data-page="ships"] .fleet-inspector-header,
  body[data-page="ships"] .ship-rental-panel,
  body[data-page="ships"] .ship-rental-action {
    align-items: center;
    flex-direction: row;
  }

  body[data-page="ships"] .fleet-command-section-head strong {
    font-size: 17px;
  }

  body[data-page="ships"] .fleet-command-section-head .secondary.small {
    width: auto;
    min-height: 38px;
    padding: 0 13px;
  }

  body[data-page="ships"] .fleet-command-table {
    gap: 8px;
  }

  body[data-page="ships"] .fleet-ship-row {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.62fr);
    grid-template-areas:
      "identity route"
      "status gauges"
      "actions actions";
    min-height: 0;
    gap: 9px 10px;
    align-items: center;
    padding: 12px;
    border-radius: 20px;
  }

  body[data-page="ships"] .fleet-ship-identity {
    grid-area: identity;
  }

  body[data-page="ships"] .fleet-ship-route {
    grid-area: route;
    text-align: right;
  }

  body[data-page="ships"] .fleet-ship-status {
    grid-area: status;
    gap: 5px;
  }

  body[data-page="ships"] .fleet-ship-gauges {
    grid-area: gauges;
    gap: 6px;
  }

  body[data-page="ships"] .fleet-ship-actions {
    display: grid;
    grid-area: actions;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    justify-content: stretch;
  }

  body[data-page="ships"] .fleet-ship-actions button {
    min-height: 36px;
    padding: 0 6px;
    border-radius: 13px;
    font-size: 12px;
    white-space: nowrap;
  }

  body[data-page="ships"] .fleet-ship-mark,
  body[data-page="ships"] .fleet-inspector-header > div > span {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  body[data-page="ships"] .fleet-ship-icon-image {
    width: 44px;
    height: 44px;
  }

  body[data-page="ships"] .fleet-ship-identity strong,
  body[data-page="ships"] .fleet-inspector-header strong {
    font-size: 16px;
  }

  body[data-page="ships"] .fleet-ship-route strong {
    font-size: 13px;
  }

  body[data-page="ships"] .fleet-ship-row .fleet-command-gauge div {
    display: none;
  }

  body[data-page="ships"] .fleet-ship-row .fleet-command-gauge i {
    height: 8px;
  }

  body[data-page="ships"] .ship-status {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 12px;
  }

  body[data-page="ships"] .fleet-command-inspector {
    position: static;
    gap: 12px;
    padding: 12px;
  }

  body[data-page="ships"] .fleet-inspector-tabs {
    display: flex !important;
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    border-radius: 999px;
    scrollbar-width: none;
  }

  body[data-page="ships"] .fleet-inspector-tabs::-webkit-scrollbar {
    display: none;
  }

  body[data-page="ships"] .fleet-inspector-tabs button {
    flex: 0 0 auto;
    min-width: 74px;
    min-height: 38px;
    padding: 7px 12px;
    border-radius: 999px;
  }

  body[data-page="ships"] .fleet-spec-grid,
  body[data-page="ships"] .fleet-battle-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-page="ships"] .fleet-current-task,
  body[data-page="ships"] .fleet-mini-panel,
  body[data-page="ships"] .ship-modify-panel,
  body[data-page="ships"] .ship-cargo-panel,
  body[data-page="ships"] .ship-fuel-row,
  body[data-page="ships"] .ship-system-row {
    border-radius: 16px;
    padding: 11px;
  }

  body[data-page="ships"] .ship-rental-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  body[data-page="ships"] .ship-rental-action {
    gap: 10px;
    justify-content: space-between;
  }

  body[data-page="ships"] .fleet-command-drawer summary {
    min-height: 52px;
    padding: 13px 14px;
  }

  body[data-page="ships"] .fleet-voyage-list {
    display: grid;
    gap: 8px;
  }

  body[data-page="ships"] .fleet-voyage-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 6px 10px;
    padding: 11px;
    border: 0;
    border-radius: 16px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 249, 247, 0.46)),
      rgba(255, 255, 255, 0.42);
  }

  body[data-page="ships"] .fleet-voyage-row span:nth-child(4) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  body[data-page="ships"] .fleet-command-page {
    padding-inline: 8px;
  }

  body[data-page="ships"] .fleet-ship-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "identity"
      "route"
      "gauges"
      "status"
      "actions";
  }

  body[data-page="ships"] .fleet-ship-route {
    text-align: left;
  }

  body[data-page="ships"] .fleet-ship-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Mobile warehouse: remove duplicate inner panel title. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head > div > strong {
    display: none;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel-head {
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  body[data-page="exchange"] .exchange-product-selector-tabs button {
    width: auto;
  }
}
/* Mobile warehouse: hide temporary batch-load footer. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-batch {
    display: none !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-columns {
    padding-bottom: 8px;
  }
}

/* Mobile warehouse: hide temporary target ship summary. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-mobile-target {
    display: none !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal {
    grid-template-rows: auto auto minmax(0, 1fr);
  }
}

/* Mobile warehouse: show one cargo product per row. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-list,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-cargo {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row.compact {
    grid-template-areas:
      "product action"
      "amount action"
      "weight action";
    grid-template-columns: minmax(0, 1fr) 40px;
    min-height: 96px;
    padding: 10px 12px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product > div {
    min-width: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Mobile warehouse: single-column rows use desktop-style value columns. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-table-head,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-table-head.compact,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-table-head.no-action {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 58px 74px 42px;
    gap: 8px;
    align-items: center;
    padding: 0 12px 7px;
    border-bottom: 1px solid rgba(34, 61, 57, 0.08);
    color: rgba(38, 61, 57, 0.56);
    font-size: 12px;
    font-weight: 950;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-table-head > span:not(:first-child) {
    text-align: center;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row.compact {
    grid-template-areas: "product amount weight action";
    grid-template-columns: minmax(0, 1fr) 58px 74px 42px;
    align-items: center;
    gap: 8px;
    min-height: 74px;
    padding: 9px 10px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product {
    min-width: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product > div {
    min-width: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product strong {
    font-size: 17px;
    line-height: 1.12;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-product small {
    margin-top: 2px;
    font-size: 11px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight {
    display: block;
    min-width: 0;
    text-align: center;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount small,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight small {
    display: none;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-amount strong,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-weight strong {
    display: block;
    overflow: hidden;
    color: #143b37;
    font-size: 13px;
    font-weight: 950;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-load-controls {
    justify-self: center;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-load {
    width: 38px;
    height: 38px;
    border-radius: 15px;
  }
}

/* Mobile warehouse: give product names more room in PC-style rows. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-table-head,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-table-head.compact,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-table-head.no-action {
    grid-template-columns: minmax(0, 1fr) 52px 66px 38px;
    gap: 6px;
    padding-right: 10px;
    padding-left: 10px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-row.compact {
    grid-template-columns: minmax(0, 1fr) 52px 66px 38px;
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }
}

/* Mobile warehouse: place capacity beside cargo-count meta. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 3px 8px;
    align-items: center;
    justify-content: start;
    padding: 4px 4px 5px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head > div:first-child {
    display: contents;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head > div:first-child > strong {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head > div:first-child > small {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-actions {
    grid-column: 2;
    grid-row: 2;
    width: auto;
    justify-content: start;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-actions .island-cargo-capacity {
    flex: 0 0 auto;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 13px;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
  }
}

/* Mobile warehouse: keep table header clear of the first cargo card. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-table-head {
    min-height: 18px;
    margin: -2px 0 8px;
    padding: 0 10px 3px;
    line-height: 1;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-list {
    padding-top: 2px;
  }
}

/* Mobile warehouse: reserve a real grid row for the cargo table header. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal.mobile-tab-warehouse .island-cargo-columns > .island-cargo-panel:not(.island-cargo-ship-panel),
  body[data-page="island"] .island-warehouse-cargo-modal.mobile-tab-ship .island-cargo-ship-panel {
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-table-head {
    margin: 0 0 6px;
    padding: 0 10px 4px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-list {
    padding-top: 0;
  }
}

/* Mobile warehouse: expose header bulk-load button as the one-tap load action. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head {
    grid-template-columns: auto auto minmax(0, 1fr) 38px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-actions {
    display: contents;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-actions .island-cargo-capacity {
    grid-column: 2;
    grid-row: 2;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-actions .island-cargo-bulk-button:not(.unload) {
    display: grid;
    grid-column: 4;
    grid-row: 2;
    justify-self: end;
    align-self: center;
    width: 38px;
    height: 38px;
    border-radius: 15px;
    font-size: 16px;
  }
}

/* Mobile warehouse: align the close button with the modal title row. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-modal-head {
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: 0 72px 0 22px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-modal-head strong {
    line-height: 1;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-close {
    top: 12px;
    right: 18px;
    display: grid;
    place-items: center;
    line-height: 1;
  }
}

/* Mobile island top tools: attach drawer to HUD and animate the handle below it. */
@media (max-width: 640px) {
  body[data-page="island"] .island-mobile-top-controls {
    top: var(--global-topbar-height) !important;
    grid-template-rows: auto 24px !important;
    align-items: start !important;
    width: min(calc(100vw - 18px), 560px) !important;
    transform: translateX(-50%) translateZ(0) !important;
    --island-top-tools-ease: cubic-bezier(0.2, 0.86, 0.18, 1.06);
  }

  body[data-page="island"] .island-mobile-top-controls-panel {
    grid-row: 1 !important;
    min-height: 58px;
    margin: 0 !important;
    border-radius: 0 0 26px 26px !important;
    transform-origin: top center !important;
    will-change: transform, opacity, clip-path, filter;
    transition:
      opacity 260ms var(--island-top-tools-ease),
      transform 320ms var(--island-top-tools-ease),
      filter 260ms ease,
      max-height 320ms var(--island-top-tools-ease),
      padding 260ms ease,
      border-color 260ms ease;
  }

  body[data-page="island"] .island-mobile-top-controls.expanded .island-mobile-top-controls-panel {
    max-height: 76px;
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
    animation: island-mobile-top-panel-in 360ms var(--island-top-tools-ease) both;
  }

  body[data-page="island"] .island-mobile-top-controls.collapsed .island-mobile-top-controls-panel {
    min-height: 0 !important;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-color: transparent !important;
    opacity: 0;
    filter: blur(7px);
    transform: translateY(-10px) scale(0.96);
    pointer-events: none;
    animation: island-mobile-top-panel-out 240ms cubic-bezier(0.4, 0, 0.2, 1) both;
  }

  body[data-page="island"] .island-mobile-top-controls-handle {
    grid-row: 2 !important;
    align-self: start !important;
    justify-self: center !important;
    height: 24px !important;
    margin-top: -1px !important;
    place-items: center !important;
    transform-origin: top center;
    transition:
      transform 260ms var(--island-top-tools-ease),
      opacity 220ms ease;
    will-change: transform, opacity;
  }

  body[data-page="island"] .island-mobile-top-controls.expanded .island-mobile-top-controls-handle {
    transform: translateY(0) scaleX(0.94);
  }

  body[data-page="island"] .island-mobile-top-controls.collapsed .island-mobile-top-controls-handle {
    transform: translateY(0) scaleX(1);
    animation: island-mobile-top-handle-settle 280ms var(--island-top-tools-ease) both;
  }

  body[data-page="island"] .island-mobile-top-controls-handle span {
    transition:
      width 260ms var(--island-top-tools-ease),
      background-color 220ms ease,
      opacity 220ms ease;
  }
}

@keyframes island-mobile-top-panel-in {
  0% {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(-16px) scale(0.96);
  }
  68% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(2px) scale(1.01);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes island-mobile-top-panel-out {
  0% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(-10px) scale(0.96);
  }
}

@keyframes island-mobile-top-handle-settle {
  0% { transform: translateY(-6px) scaleX(0.92); }
  72% { transform: translateY(1px) scaleX(1.03); }
  100% { transform: translateY(0) scaleX(1); }
}

/* Mobile island top tools: keep the drawer visible while the close animation plays. */
@media (max-width: 640px) {
  html body[data-page="island"].island-mobile-top-controls-closing .island-ship-brief-dock,
  html body[data-page="island"].island-mobile-top-controls-closing .island-ship-brief-dock.custom-positioned {
    display: none !important;
    pointer-events: none !important;
  }

  html body[data-page="island"].island-mobile-top-controls-closing .island-mobile-top-controls {
    display: grid !important;
    pointer-events: none !important;
  }

  html body[data-page="island"].island-mobile-top-controls-closing .island-mobile-top-controls-handle,
  html body[data-page="island"].island-mobile-top-controls-closing .island-mobile-top-controls-panel {
    pointer-events: none !important;
  }
}

/* Mobile island top tools: override the ship-expanded hide rule during closing animation. */
@media (max-width: 640px) {
  html body[data-page="island"].island-mobile-top-controls-closing:not(.island-layout-editing):has(.island-ship-brief-dock:not(.collapsed)) .island-mobile-top-controls {
    display: grid !important;
    visibility: visible !important;
    pointer-events: none !important;
  }
}

/* Mobile technology overview: keep the three point stats on one compact row. */
@media (max-width: 720px) {
  .research-command-panel > .research-point-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .research-command-panel > .research-point-summary span {
    min-height: 72px;
    align-content: center;
    justify-items: start;
    gap: 6px;
    padding: 12px 10px;
  }

  .research-command-panel > .research-point-summary b {
    font-size: 24px;
    line-height: 1;
  }

  .research-command-panel > .research-point-summary small {
    max-width: 100%;
    font-size: 12px;
    line-height: 1.15;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .research-command-panel > .research-point-summary {
    gap: 6px !important;
  }

  .research-command-panel > .research-point-summary span {
    min-height: 66px;
    padding: 10px 7px;
  }

  .research-command-panel > .research-point-summary b {
    font-size: 22px;
  }

  .research-command-panel > .research-point-summary small {
    font-size: 11px;
  }
}

/* Mobile warehouse: keep expanded cargo transfer controls inside their own grid row. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer {
    position: relative;
    z-index: 1;
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 40px 40px !important;
    grid-template-areas:
      "title title title title title"
      "slider slider slider slider slider"
      "number amount weight confirm cancel" !important;
    grid-auto-rows: auto !important;
    align-items: center;
    gap: 9px 7px !important;
    min-height: 132px !important;
    height: auto !important;
    margin: 2px 0 14px !important;
    padding: 12px !important;
    overflow: hidden;
    box-sizing: border-box;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer > span:first-child {
    grid-area: title !important;
    min-width: 0;
    line-height: 1.15;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer input[type="range"] {
    grid-area: slider !important;
    width: 100%;
    min-width: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer input[type="number"] {
    grid-area: number !important;
    width: 100% !important;
    min-width: 0;
    justify-self: stretch;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-amount {
    grid-area: amount !important;
    min-width: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-weight {
    grid-area: weight !important;
    min-width: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-confirm {
    grid-area: confirm !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-cancel {
    grid-area: cancel !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-confirm,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer-cancel {
    justify-self: stretch;
    width: 40px !important;
    height: 40px !important;
  }
}

@media (max-width: 360px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-transfer {
    grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr) 38px 38px !important;
    gap: 8px 6px !important;
    min-height: 126px !important;
    padding: 10px !important;
  }
}

/* Mobile warehouse: push ship capacity and unload action to the right edge. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-cargo-panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 4px 4px 6px;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-cargo-panel-head > div:first-child {
    min-width: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-cargo-panel-actions {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: auto;
    min-width: 0;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-cargo-panel-actions > span {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* Mobile encyclopedia recipe: stack the building icon under its label. */
@media (max-width: 980px) {
  .encyclopedia-recipe-cell.building {
    display: grid;
    align-items: start;
    justify-items: start;
    justify-self: stretch;
    gap: 6px;
  }

  .encyclopedia-recipe-cell.building::before {
    display: block;
  }

  .encyclopedia-recipe-cell.building .encyclopedia-mini-building {
    margin: 0;
  }
}

/* Mobile encyclopedia recipe: left-align technology and output cells. */
@media (max-width: 980px) {
  .encyclopedia-recipe-cell.technology,
  .encyclopedia-recipe-cell.outputs {
    display: grid;
    align-items: start;
    justify-items: start;
    justify-self: stretch;
    gap: 6px;
  }

  .encyclopedia-recipe-cell.technology .encyclopedia-recipe-tech-tile {
    margin: 0;
  }

  .encyclopedia-recipe-cell.outputs,
  .encyclopedia-recipe-cell.outputs .empty-plot-costs {
    justify-content: start;
  }

  .encyclopedia-recipe-cell.outputs .empty-plot-costs {
    align-items: start;
    width: 100%;
  }
}

/* Mobile encyclopedia recipe: center building, technology, and output groups. */
@media (max-width: 980px) {
  .encyclopedia-recipe-cell.building,
  .encyclopedia-recipe-cell.technology,
  .encyclopedia-recipe-cell.outputs {
    justify-items: center;
    text-align: center;
  }

  .encyclopedia-recipe-cell.building::before,
  .encyclopedia-recipe-cell.technology::before,
  .encyclopedia-recipe-cell.outputs::before {
    justify-self: center;
    text-align: center;
  }

  .encyclopedia-recipe-cell.building .encyclopedia-mini-building,
  .encyclopedia-recipe-cell.technology .encyclopedia-recipe-tech-tile {
    justify-self: center;
  }

  .encyclopedia-recipe-cell.outputs,
  .encyclopedia-recipe-cell.outputs .empty-plot-costs {
    justify-content: center;
  }

  .encyclopedia-recipe-cell.outputs .empty-plot-costs {
    align-items: start;
    width: 100%;
  }
}

/* Mobile encyclopedia recipe: center inputs and allow three material tiles per row. */
@media (max-width: 980px) {
  .encyclopedia-recipe-cell.inputs {
    display: grid;
    align-items: start;
    justify-items: center;
    justify-self: stretch;
    gap: 6px;
    text-align: center;
  }

  .encyclopedia-recipe-cell.inputs::before {
    justify-self: center;
    text-align: center;
  }

  .encyclopedia-recipe-cell.inputs .empty-plot-costs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: center;
    justify-items: center;
    align-items: start;
    gap: 8px 6px;
    width: min(100%, 282px);
  }

  .encyclopedia-recipe-cell.inputs .empty-plot-cost-tile.encyclopedia-asset-tile {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto;
  }

  .encyclopedia-recipe-cell.inputs .encyclopedia-asset-tile strong {
    aspect-ratio: 1;
    height: auto;
    min-height: 0;
  }
}

/* Island production overview modal. */
body[data-page="island"] .island-production-overview-backdrop {
  bottom: var(--global-bottom-nav-reserve);
  padding: 24px 28px 20px;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.42), transparent 34%),
    radial-gradient(circle at 16% 76%, rgba(68, 205, 184, 0.24), transparent 36%),
    radial-gradient(circle at 88% 16%, rgba(255, 218, 116, 0.18), transparent 35%),
    linear-gradient(135deg, rgba(203, 226, 224, 0.54), rgba(247, 241, 224, 0.42)),
    rgba(20, 31, 33, 0.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.3);
  backdrop-filter: blur(26px) saturate(1.3);
}

body[data-page="island"] .island-production-overview-modal {
  position: relative;
  isolation: isolate;
  width: min(1120px, calc(100vw - 56px));
  max-height: min(820px, calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 44px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 32px;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.78), transparent 36%),
    radial-gradient(circle at 92% 0%, rgba(255, 222, 126, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(225, 249, 244, 0.72) 54%, rgba(255, 248, 226, 0.74)),
    rgba(242, 250, 247, 0.9);
  color: #123733;
  box-shadow:
    0 34px 92px rgba(25, 54, 51, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(117, 159, 152, 0.16);
  scrollbar-color: rgba(8, 125, 103, 0.28) rgba(255, 255, 255, 0.25);
  scrollbar-width: thin;
  -webkit-backdrop-filter: blur(30px) saturate(1.3);
  backdrop-filter: blur(30px) saturate(1.3);
}

body[data-page="island"] .island-production-overview-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 25%, rgba(255, 255, 255, 0.34) 38%, transparent 52%),
    radial-gradient(circle at 96% 82%, rgba(20, 176, 151, 0.1), transparent 34%);
  opacity: 0.92;
}

body[data-page="island"] .island-production-overview-modal .island-cargo-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 246, 242, 0.62)),
    rgba(255, 255, 255, 0.48);
  color: rgba(31, 62, 58, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 24px rgba(30, 68, 64, 0.14);
  font-size: 28px;
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

body[data-page="island"] .island-production-overview-modal .island-cargo-close:hover,
body[data-page="island"] .island-production-overview-modal .island-cargo-close:focus-visible {
  background: rgba(255, 255, 255, 0.84);
  color: #0f9183;
  outline: 0;
  transform: translateY(-1px);
}

body[data-page="island"] .island-production-overview-head {
  min-height: 120px;
  padding: 24px 86px 22px 28px;
  border-bottom: 1px solid rgba(43, 89, 82, 0.12);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.64), rgba(231, 249, 245, 0.38) 58%, rgba(255, 244, 213, 0.34)),
    rgba(255, 255, 255, 0.18);
}

body[data-page="island"] .island-production-overview-head span {
  color: rgba(15, 111, 103, 0.74);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="island"] .island-production-overview-head strong {
  color: #123733;
  font-size: clamp(30px, 2.8vw, 44px);
  font-weight: 900;
  line-height: 1.04;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

body[data-page="island"] .island-production-overview-head small {
  max-width: 620px;
  color: rgba(35, 62, 58, 0.64);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

body[data-page="island"] .island-production-overview-head em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  min-width: 128px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 6%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(250, 242, 211, 0.5)),
    rgba(255, 255, 255, 0.36);
  color: #0e887b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(120, 84, 20, 0.07),
    0 12px 28px rgba(120, 91, 34, 0.08);
  font-size: 26px;
  font-style: normal;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(1.24);
  backdrop-filter: blur(22px) saturate(1.24);
}

body[data-page="island"] .island-production-overview-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
  color: #123733;
}

body[data-page="island"] .island-production-overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

body[data-page="island"] .island-production-overview-metric,
body[data-page="island"] .island-production-overview-slot,
body[data-page="island"] .island-production-overview-flow,
body[data-page="island"] .island-production-overview-automation-card,
body[data-page="island"] .island-production-overview-job,
body[data-page="island"] .island-production-overview-automation-row,
body[data-page="island"] .island-production-overview-empty,
body[data-page="island"] .island-production-overview-note {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(235, 249, 246, 0.5)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 26px rgba(37, 72, 66, 0.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

body[data-page="island"] .island-production-overview-metric {
  min-height: 98px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 16px 18px;
  border-radius: 20px;
}

body[data-page="island"] .island-production-overview-metric span,
body[data-page="island"] .island-production-overview-section-head span,
body[data-page="island"] .island-production-overview-job-head span,
body[data-page="island"] .island-production-overview-automation-row small,
body[data-page="island"] .island-production-overview-automation-card p {
  color: rgba(35, 62, 58, 0.62);
  font-weight: 850;
}

body[data-page="island"] .island-production-overview-metric strong {
  color: #123733;
  font-size: 32px;
  font-weight: 950;
  line-height: 1;
}

body[data-page="island"] .island-production-overview-metric small {
  color: rgba(35, 62, 58, 0.56);
  font-size: 12px;
  font-weight: 850;
}

body[data-page="island"] .island-production-overview-metric.active {
  box-shadow: inset 4px 0 0 rgba(20, 178, 153, 0.86), inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 26px rgba(37, 72, 66, 0.1);
}

body[data-page="island"] .island-production-overview-metric.pending {
  box-shadow: inset 4px 0 0 rgba(219, 169, 52, 0.82), inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 26px rgba(37, 72, 66, 0.1);
}

body[data-page="island"] .island-production-overview-metric.automation {
  box-shadow: inset 4px 0 0 rgba(82, 170, 222, 0.82), inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 26px rgba(37, 72, 66, 0.1);
}

body[data-page="island"] .island-production-overview-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body[data-page="island"] .island-production-overview-slot {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 18px;
  color: #173b36;
  text-align: left;
  cursor: pointer;
}

body[data-page="island"] .island-production-overview-slot.empty {
  cursor: default;
  opacity: 0.72;
}

body[data-page="island"] .island-production-overview-slot span,
body[data-page="island"] .island-production-overview-slot em {
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(7, 143, 128, 0.12);
  color: #08786c;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

body[data-page="island"] .island-production-overview-slot em {
  background: rgba(219, 169, 52, 0.14);
  color: #9b7016;
}

body[data-page="island"] .island-production-overview-slot strong {
  min-width: 0;
  overflow: hidden;
  color: #173b36;
  font-size: 17px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-production-overview-main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.82fr);
  gap: 14px;
  align-items: start;
}

body[data-page="island"] .island-production-overview-flow,
body[data-page="island"] .island-production-overview-automation-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 26px;
}

body[data-page="island"] .island-production-overview-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body[data-page="island"] .island-production-overview-section-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

body[data-page="island"] .island-production-overview-section-head strong {
  color: #123733;
  font-size: 24px;
  font-weight: 950;
}

body[data-page="island"] .island-production-overview-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 251, 247, 0.62)),
    rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body[data-page="island"] .island-production-overview-tabs button {
  min-height: 42px;
  min-width: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(26, 58, 52, 0.78);
  font-size: 14px;
  font-weight: 950;
  cursor: pointer;
}

body[data-page="island"] .island-production-overview-tabs button.selected {
  background: linear-gradient(180deg, #1dbfa8, #08786c);
  color: #ffffff;
  box-shadow: 0 9px 18px rgba(7, 143, 128, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

body[data-page="island"] .island-production-overview-job-list,
body[data-page="island"] .island-production-overview-automation-list {
  display: grid;
  gap: 12px;
}

body[data-page="island"] .island-production-overview-job {
  min-width: 0;
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 22px;
}

body[data-page="island"] .island-production-overview-job.automated {
  border-color: rgba(82, 170, 222, 0.34);
}

body[data-page="island"] .island-production-overview-output {
  position: relative;
  height: 132px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(26, 88, 78, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(236, 247, 244, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body[data-page="island"] .island-production-overview-output > span {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 96px;
  height: 94px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
}

body[data-page="island"] .island-production-overview-output .product-icon-image {
  width: 94px;
  height: 94px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(28, 61, 55, 0.14));
}

body[data-page="island"] .island-production-overview-output em {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 34px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 0 16px 0 12px;
  background: linear-gradient(180deg, #d5a83b, #ad7c15);
  color: #ffffff;
  font-size: 14px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  box-shadow: -3px 4px 10px rgba(72, 54, 18, 0.16);
}

body[data-page="island"] .island-production-overview-output strong {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  background: rgba(25, 49, 45, 0.94);
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
}

body[data-page="island"] .island-production-overview-job-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

body[data-page="island"] .island-production-overview-job-head,
body[data-page="island"] .island-production-overview-job-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body[data-page="island"] .island-production-overview-job-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

body[data-page="island"] .island-production-overview-job-head strong {
  overflow: hidden;
  color: #123733;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-production-overview-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

body[data-page="island"] .island-production-overview-badge {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(7, 143, 128, 0.12);
  color: #08786c;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

body[data-page="island"] .island-production-overview-badge.pending {
  background: rgba(219, 169, 52, 0.14);
  color: #9b7016;
}

body[data-page="island"] .island-production-overview-badge.automated {
  background: rgba(82, 170, 222, 0.14);
  color: #27799c;
}

body[data-page="island"] .island-production-overview-products {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

body[data-page="island"] .island-production-overview-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 75, 68, 0.12);
  box-shadow: inset 0 1px 2px rgba(20, 58, 52, 0.14);
}

body[data-page="island"] .island-production-overview-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #12ad99, #8bd55c);
  transition: width 0.25s ease;
}

body[data-page="island"] .island-production-overview-job-foot {
  align-items: center;
}

body[data-page="island"] .island-production-overview-job-foot span {
  color: #08786c;
  font-size: 15px;
  font-weight: 950;
}

body[data-page="island"] .island-production-overview-job-foot button,
body[data-page="island"] .island-production-overview-reset {
  min-height: 38px;
  border: 1px solid rgba(7, 143, 128, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, #1dbfa8, #08786c);
  color: #ffffff;
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 10px 18px rgba(7, 143, 128, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  cursor: pointer;
}

body[data-page="island"] .island-production-overview-job-foot button {
  padding: 0 16px;
}

body[data-page="island"] .island-production-overview-reset {
  width: 100%;
  min-height: 46px;
  font-size: 16px;
}

body[data-page="island"] .island-production-overview-reset:disabled {
  border-color: rgba(31, 81, 74, 0.12);
  background: rgba(31, 81, 74, 0.08);
  color: rgba(38, 64, 59, 0.45);
  box-shadow: none;
  cursor: not-allowed;
}

body[data-page="island"] .island-production-overview-automation-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

body[data-page="island"] .island-production-overview-automation-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  color: #123733;
  text-align: left;
  cursor: pointer;
}

body[data-page="island"] .island-production-overview-automation-row > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

body[data-page="island"] .island-production-overview-building-image {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

body[data-page="island"] .island-production-overview-automation-row div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body[data-page="island"] .island-production-overview-automation-row strong,
body[data-page="island"] .island-production-overview-automation-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="island"] .island-production-overview-automation-row strong {
  color: #123733;
  font-size: 16px;
  font-weight: 950;
}

body[data-page="island"] .island-production-overview-automation-row em {
  color: rgba(35, 62, 58, 0.58);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

body[data-page="island"] .island-production-overview-automation-row b {
  min-width: 74px;
  display: inline-flex;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(82, 170, 222, 0.14);
  color: #27799c;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

body[data-page="island"] .island-production-overview-empty {
  padding: 18px;
  border-radius: 18px;
  color: rgba(35, 62, 58, 0.62);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

body[data-page="island"] .island-production-overview-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  color: rgba(35, 62, 58, 0.62);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

@media (max-width: 920px) {
  body[data-page="island"] .island-production-overview-modal {
    width: min(720px, calc(100vw - 20px));
    border-radius: 28px;
  }

  body[data-page="island"] .island-production-overview-head {
    min-height: 104px;
    padding: 20px 74px 18px 22px;
  }

  body[data-page="island"] .island-production-overview-head em {
    display: none;
  }

  body[data-page="island"] .island-production-overview-body {
    padding: 14px;
  }

  body[data-page="island"] .island-production-overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="island"] .island-production-overview-slots,
  body[data-page="island"] .island-production-overview-main {
    grid-template-columns: 1fr;
  }

  body[data-page="island"] .island-production-overview-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="island"] .island-production-overview-job {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  body[data-page="island"] .island-production-overview-output {
    height: 116px;
  }

  body[data-page="island"] .island-production-overview-output > span {
    width: 78px;
    height: 80px;
  }

  body[data-page="island"] .island-production-overview-output .product-icon-image {
    width: 76px;
    height: 76px;
  }

  body[data-page="island"] .island-production-overview-job-head {
    display: grid;
    gap: 8px;
  }

  body[data-page="island"] .island-production-overview-job-head strong {
    font-size: 20px;
  }

  body[data-page="island"] .island-production-overview-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  body[data-page="island"] .island-production-overview-backdrop {
    align-items: end;
    padding: 10px;
  }

  body[data-page="island"] .island-production-overview-modal {
    width: 100%;
    max-height: calc(100vh - var(--global-topbar-height) - var(--global-bottom-nav-reserve) - 18px);
    border-radius: 26px;
  }

  body[data-page="island"] .island-production-overview-head strong {
    font-size: 28px;
  }

  body[data-page="island"] .island-production-overview-metric {
    min-height: 82px;
    padding: 12px;
  }

  body[data-page="island"] .island-production-overview-metric strong {
    font-size: 26px;
  }

  body[data-page="island"] .island-production-overview-job {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  body[data-page="island"] .island-production-overview-output {
    height: 108px;
    border-radius: 16px;
  }

  body[data-page="island"] .island-production-overview-output strong {
    font-size: 12px;
  }

  body[data-page="island"] .island-production-overview-job-foot {
    align-items: stretch;
    display: grid;
  }

  body[data-page="island"] .island-production-overview-automation-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  body[data-page="island"] .island-production-overview-automation-row b {
    grid-column: 1 / -1;
    width: fit-content;
  }
}
/* Mobile warehouse cargo keeps the global bottom menu available. */
@media (max-width: 760px) {
  body[data-page="island"]:has(.island-warehouse-cargo-modal) .global-primary-nav {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* Mobile warehouse modal: remove the non-interactive sheet handle. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal::after {
    content: none !important;
    display: none !important;
  }
}

/* Mobile island status sheet motion: make expand/collapse feel native, not abrupt. */
@media (max-width: 640px) {
  body[data-page="island"] .island-status-hud:not(.collapsed) {
    --island-status-motion-ease: cubic-bezier(0.2, 0.82, 0.2, 1);
    --island-status-motion-settle: cubic-bezier(0.18, 0.9, 0.2, 1.08);
  }

  body[data-page="island"] .island-status-hud:not(.collapsed) .island-status-panel {
    transform-origin: 50% 100%;
    transition:
      height 340ms var(--island-status-motion-ease),
      max-height 340ms var(--island-status-motion-ease),
      padding 340ms var(--island-status-motion-ease),
      box-shadow 340ms var(--island-status-motion-ease),
      opacity 260ms ease,
      filter 260ms ease,
      transform 340ms var(--island-status-motion-ease);
    will-change: height, max-height, transform, opacity, filter;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-panel {
    animation: island-status-mobile-expand 420ms var(--island-status-motion-settle) both;
  }

  body[data-page="island"] .island-status-hud.details-collapsing .island-status-panel {
    animation: island-status-mobile-collapse 320ms var(--island-status-motion-ease) both;
    pointer-events: none;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-panel-head {
    animation: island-status-mobile-head-settle 380ms var(--island-status-motion-settle) 40ms both;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-card {
    animation: island-status-mobile-card-rise 380ms var(--island-status-motion-settle) both;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-card:nth-child(2) {
    animation-delay: 34ms;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-card:nth-child(3) {
    animation-delay: 58ms;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-card:nth-child(4) {
    animation-delay: 82ms;
  }

  body[data-page="island"] .island-status-hud.details-collapsing .island-status-panel-head,
  body[data-page="island"] .island-status-hud.details-collapsing .island-status-list {
    animation: island-status-mobile-content-out 260ms ease both;
    pointer-events: none;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-details-handle span {
    animation: island-status-mobile-handle-pop 360ms var(--island-status-motion-settle) both;
  }
}

@keyframes island-status-mobile-expand {
  0% {
    filter: blur(1.5px) saturate(0.94);
    opacity: 0.52;
    transform: translateY(18px) scale(0.965);
  }

  64% {
    filter: blur(0) saturate(1.02);
    opacity: 1;
    transform: translateY(-3px) scale(1.008);
  }

  100% {
    filter: none;
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes island-status-mobile-collapse {
  0% {
    filter: none;
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    filter: blur(1.6px) saturate(0.92);
    opacity: 0.12;
    transform: translateY(16px) scale(0.965);
  }
}

@keyframes island-status-mobile-head-settle {
  0% {
    opacity: 0.78;
    transform: translateY(7px) scale(0.985);
  }

  72% {
    opacity: 1;
    transform: translateY(-1px) scale(1.004);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes island-status-mobile-card-rise {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  74% {
    opacity: 1;
    transform: translateY(-1px) scale(1.01);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes island-status-mobile-content-out {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(10px) scale(0.965);
  }
}

@keyframes island-status-mobile-handle-pop {
  0% { transform: translateY(4px) scaleX(0.8); }
  70% { transform: translateY(-1px) scaleX(1.08); }
  100% { transform: translateY(0) scaleX(1); }
}

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  body[data-page="island"] .island-status-hud .island-status-panel,
  body[data-page="island"] .island-status-hud .island-status-panel-head,
  body[data-page="island"] .island-status-hud .island-status-card,
  body[data-page="island"] .island-status-hud .island-status-list,
  body[data-page="island"] .island-status-hud .island-status-details-handle span {
    animation: none !important;
    transition-duration: 1ms !important;
  }
}
/* Mobile warehouse modal: attach directly to the bottom navigation. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-backdrop {
    bottom: var(--global-mobile-nav-height, var(--global-bottom-nav-reserve)) !important;
    padding-bottom: 0 !important;
    align-items: stretch !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal {
    align-self: stretch !important;
    height: 100% !important;
    max-height: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
}

/* Desktop island status sheet motion: restrained liquid-glass expand/collapse. */
@media (min-width: 641px) {
  body[data-page="island"] .island-status-hud:not(.collapsed) {
    --island-status-desktop-ease: cubic-bezier(0.2, 0.78, 0.2, 1);
    --island-status-desktop-settle: cubic-bezier(0.18, 0.86, 0.18, 1.04);
  }

  body[data-page="island"] .island-status-hud:not(.collapsed) .island-status-panel {
    transform-origin: 50% 0;
    transition:
      gap 320ms var(--island-status-desktop-ease),
      box-shadow 320ms var(--island-status-desktop-ease),
      transform 320ms var(--island-status-desktop-ease),
      filter 240ms ease;
    will-change: gap, transform, filter;
  }

  body[data-page="island"] .island-status-hud:not(.collapsed) .island-status-list {
    max-height: 520px;
    overflow: hidden;
    opacity: 1;
    transform-origin: 50% 0;
    transition:
      max-height 340ms var(--island-status-desktop-ease),
      opacity 220ms ease,
      transform 320ms var(--island-status-desktop-ease),
      filter 220ms ease;
    will-change: max-height, opacity, transform, filter;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-panel {
    animation: island-status-desktop-shell-expand 360ms var(--island-status-desktop-settle) both;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-list {
    animation: island-status-desktop-list-expand 360ms var(--island-status-desktop-settle) both;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-card {
    animation: island-status-desktop-card-rise 320ms var(--island-status-desktop-settle) both;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-card:nth-child(2) {
    animation-delay: 28ms;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-card:nth-child(3) {
    animation-delay: 50ms;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-card:nth-child(4) {
    animation-delay: 72ms;
  }

  body[data-page="island"] .island-status-hud.details-expanding .island-status-details-handle span {
    animation: island-status-desktop-handle-settle 320ms var(--island-status-desktop-settle) both;
  }

  body[data-page="island"] .island-status-hud.details-collapsing .island-status-panel {
    gap: 6px;
    animation: island-status-desktop-shell-collapse 320ms var(--island-status-desktop-ease) both;
    pointer-events: none;
  }

  body[data-page="island"] .island-status-hud.details-collapsing .island-status-list {
    max-height: 0;
    opacity: 0;
    filter: blur(1px) saturate(0.96);
    transform: translateY(-8px) scaleY(0.96);
    pointer-events: none;
  }
}

@keyframes island-status-desktop-shell-expand {
  0% {
    filter: blur(0.8px) saturate(0.97);
    transform: translateY(-5px) scale(0.988);
  }

  70% {
    filter: none;
    transform: translateY(1px) scale(1.003);
  }

  100% {
    filter: none;
    transform: translateY(0) scale(1);
  }
}

@keyframes island-status-desktop-shell-collapse {
  0% {
    filter: none;
    transform: translateY(0) scale(1);
  }

  100% {
    filter: blur(0.7px) saturate(0.97);
    transform: translateY(-3px) scale(0.99);
  }
}

@keyframes island-status-desktop-list-expand {
  0% {
    max-height: 0;
    opacity: 0;
    filter: blur(1px) saturate(0.96);
    transform: translateY(-10px) scaleY(0.96);
  }

  72% {
    max-height: 520px;
    opacity: 1;
    filter: none;
    transform: translateY(2px) scaleY(1.01);
  }

  100% {
    max-height: 520px;
    opacity: 1;
    filter: none;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes island-status-desktop-card-rise {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.982);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes island-status-desktop-handle-settle {
  0% { transform: translateY(-2px) scaleX(0.86); }
  72% { transform: translateY(1px) scaleX(1.06); }
  100% { transform: translateY(0) scaleX(1); }
}

@media (min-width: 641px) and (prefers-reduced-motion: reduce) {
  body[data-page="island"] .island-status-hud .island-status-panel,
  body[data-page="island"] .island-status-hud .island-status-list,
  body[data-page="island"] .island-status-hud .island-status-card,
  body[data-page="island"] .island-status-hud .island-status-details-handle span {
    animation: none !important;
    transition-duration: 1ms !important;
  }
}
/* Mobile warehouse: keep capacity pill beside the bulk-load button. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head {
    grid-template-columns: auto minmax(0, 1fr) auto 38px !important;
    column-gap: 6px !important;
    align-items: center !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head > div:first-child > small {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-actions {
    display: contents !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-actions .island-cargo-capacity {
    grid-column: 3 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    margin: 0 !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-actions .island-cargo-bulk-button:not(.unload) {
    grid-column: 4 !important;
    grid-row: 2 !important;
    justify-self: end !important;
  }
}

/* Desktop island status handle placement: keep mobile bottom-sheet logic unchanged. */
@media (min-width: 641px) {
  body[data-page="island"] .island-status-panel {
    gap: 0;
  }

  body[data-page="island"] .island-status-panel-head {
    order: 1;
  }

  body[data-page="island"] .island-status-details-handle {
    order: 2;
    width: 112px;
    height: 22px;
    margin: -1px auto 1px;
    cursor: grab;
  }

  body[data-page="island"] .island-status-details-handle span {
    width: 54px;
  }

  body[data-page="island"] .island-status-hud.details-collapsed .island-status-details-handle {
    margin: -1px auto 0;
  }

  body[data-page="island"] .island-status-list {
    order: 3;
    margin-top: 8px;
  }
}
/* Desktop island status handle final placement: expanded handle sits below the detail cards. */
@media (min-width: 641px) {
  body[data-page="island"] .island-status-hud.details-expanded .island-status-list,
  body[data-page="island"] .island-status-hud.details-collapsing .island-status-list {
    order: 2;
    margin-top: 8px;
    margin-bottom: 0;
  }

  body[data-page="island"] .island-status-hud.details-expanded .island-status-details-handle,
  body[data-page="island"] .island-status-hud.details-collapsing .island-status-details-handle {
    order: 3;
    margin: 4px auto -8px;
  }

  body[data-page="island"] .island-status-hud.details-collapsed .island-status-details-handle {
    order: 2;
    margin: -1px auto 0;
  }
}

/* Island warehouse cargo category filter. */
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter {
  display: block;
  flex: 0 0 auto;
  min-width: 106px;
  width: min(132px, 100%);
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter .exchange-glass-select-button,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter select {
  min-height: 36px;
  border-radius: 14px;
  font-size: 13px;
  gap: 8px;
  padding: 0 11px 0 13px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter .exchange-glass-select-chevron {
  width: 8px;
  height: 8px;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter .exchange-glass-select-menu {
  width: max(100%, 190px);
}

@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head {
    grid-template-columns: auto minmax(106px, 132px) auto minmax(0, 1fr);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head > div:first-child {
    display: contents;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-category-filter {
    grid-column: 2;
    grid-row: 2;
    width: min(132px, 32vw);
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-actions {
    grid-column: 3;
  }
}

/* Desktop island status collapse polish: avoid early final-state jump and heavy filter jank. */
@media (min-width: 641px) {
  body[data-page="island"] .island-status-hud:not(.collapsed) {
    --island-status-desktop-collapse-ease: cubic-bezier(0.22, 0.72, 0.22, 1);
  }

  body[data-page="island"] .island-status-hud.details-collapsing .island-status-panel {
    animation: island-status-desktop-shell-collapse-smooth 430ms var(--island-status-desktop-collapse-ease) both;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  body[data-page="island"] .island-status-hud.details-collapsing .island-status-list {
    animation: island-status-desktop-list-collapse-smooth 410ms var(--island-status-desktop-collapse-ease) both;
    filter: none;
    transform-origin: 50% 100%;
    will-change: max-height, opacity, transform;
  }

  body[data-page="island"] .island-status-hud.details-collapsing .island-status-card {
    animation: island-status-desktop-card-collapse-smooth 260ms ease both;
    will-change: opacity, transform;
  }

  body[data-page="island"] .island-status-hud.details-collapsing .island-status-details-handle span {
    animation: island-status-desktop-handle-collapse-smooth 300ms var(--island-status-desktop-collapse-ease) both;
  }
}

@keyframes island-status-desktop-shell-collapse-smooth {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
  }

  100% {
    opacity: 0.98;
    transform: translateY(-2px) scale(0.996) translateZ(0);
  }
}

@keyframes island-status-desktop-list-collapse-smooth {
  0% {
    max-height: 520px;
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }

  62% {
    opacity: 0.42;
    transform: translateY(3px) scaleY(0.985);
  }

  100% {
    max-height: 0;
    opacity: 0;
    transform: translateY(6px) scaleY(0.975);
  }
}

@keyframes island-status-desktop-card-collapse-smooth {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

@keyframes island-status-desktop-handle-collapse-smooth {
  0% { transform: translateY(0) scaleX(1); }
  100% { transform: translateY(-1px) scaleX(0.92); }
}
/* Island warehouse cargo filter final alignment: keep category control beside cargo count. */
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head > div:first-child {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  width: auto !important;
  max-width: min(100%, 260px) !important;
  min-width: 0 !important;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head > div:first-child > small {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter {
  flex: 0 0 118px !important;
  min-width: 118px !important;
  width: 118px !important;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter .exchange-glass-select-button,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter select {
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 10px 0 12px !important;
}

@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head {
    grid-template-columns: auto auto minmax(0, 1fr) auto 38px !important;
    column-gap: 6px !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head > div:first-child {
    grid-column: 1 / 3 !important;
    grid-row: 2 !important;
    justify-self: start !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-category-filter {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 112px !important;
    min-width: 112px !important;
    flex-basis: 112px !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-actions .island-cargo-capacity {
    grid-column: 4 !important;
    grid-row: 2 !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-actions .island-cargo-bulk-button:not(.unload) {
    grid-column: 5 !important;
    grid-row: 2 !important;
  }
}
/* Mobile warehouse: compact the industry filter pill so it does not cover adjacent header content. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head > div:first-child {
    gap: 4px !important;
    max-width: 168px !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter {
    flex: 0 0 clamp(88px, 24vw, 96px) !important;
    width: clamp(88px, 24vw, 96px) !important;
    min-width: clamp(88px, 24vw, 96px) !important;
    max-width: clamp(88px, 24vw, 96px) !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter .exchange-glass-select-button,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter select {
    min-height: 30px !important;
    height: 30px !important;
    gap: 4px !important;
    padding: 0 7px 0 9px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter .exchange-glass-select-value {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter .exchange-glass-select-chevron {
    flex: 0 0 7px !important;
    width: 7px !important;
    height: 7px !important;
    margin-left: 1px !important;
  }
}

/* Mobile warehouse: force the category dropdown itself to stay compact. */
@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-panel:not(.island-cargo-ship-panel) .island-cargo-panel-head > div:first-child {
    max-width: 142px !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter .exchange-glass-select,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter .exchange-glass-select-button,
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter select {
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-category-filter .exchange-glass-select-button {
    grid-template-columns: minmax(0, 1fr) 7px !important;
  }
}

/* Island warehouse ship hold category filter alignment. */
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-ship-cargo-head-meta {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  width: auto !important;
  max-width: min(100%, 360px) !important;
  min-width: 0 !important;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-ship-cargo-head-meta > small,
body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-ship-cargo-type-count {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-ship-cargo-type-count {
  color: rgba(35, 62, 58, 0.58) !important;
  font-size: 13px !important;
  font-weight: 850 !important;
}

body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-ship-cargo-category-filter {
  flex: 0 0 118px !important;
  min-width: 118px !important;
  width: 118px !important;
}

@media (max-width: 760px) {
  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-cargo-panel-head {
    grid-template-columns: minmax(0, 1fr) auto 38px !important;
    column-gap: 6px !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-ship-cargo-head-meta {
    grid-column: 1 !important;
    grid-row: 1 !important;
    max-width: 100% !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-ship-cargo-category-filter {
    width: 112px !important;
    min-width: 112px !important;
    flex-basis: 112px !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-cargo-panel-actions {
    display: contents !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-cargo-panel-actions > span {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
  }

  body[data-page="island"] .island-warehouse-cargo-modal .island-cargo-ship-panel .island-cargo-panel-actions .island-cargo-bulk-button.unload {
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: end !important;
  }
}
.fleet-rename-icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(11, 78, 70, 0.14);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(233, 248, 245, 0.62));
  box-shadow: 0 12px 28px rgba(25, 72, 66, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.fleet-rename-icon-button::before {
  content: "";
  width: 16px;
  height: 5px;
  border-radius: 999px;
  background: #123c36;
  box-shadow: 5px 0 0 rgba(22, 156, 143, 0.9);
  transform: rotate(-42deg) translate(1px, -1px);
}

.fleet-rename-icon-button::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: rgba(18, 60, 54, 0.28);
  transform: rotate(-42deg);
}

.fleet-rename-icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(18, 159, 146, 0.32);
  box-shadow: 0 16px 34px rgba(25, 72, 66, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.fleet-rename-icon-button:focus-visible {
  outline: 3px solid rgba(31, 190, 174, 0.28);
  outline-offset: 3px;
}
/* Mobile exchange warehouse: mirror the compact island warehouse cargo layout. */
@media (max-width: 760px) {
  body[data-page="exchange"] .exchange-desk-cargo {
    gap: 10px !important;
    padding: 10px 8px calc(var(--global-bottom-nav-reserve) + 2px) !important;
  }

  body[data-page="exchange"] .exchange-desk-cargo-panel {
    border-radius: 20px !important;
    padding-bottom: 0 !important;
  }

  body[data-page="exchange"] .exchange-desk-panel-head {
    display: grid !important;
    grid-template-columns: auto 88px minmax(116px, 1fr) 38px !important;
    align-items: center !important;
    column-gap: 6px !important;
    row-gap: 7px !important;
    padding: 10px 10px 8px !important;
  }

  body[data-page="exchange"] .exchange-desk-warehouse-title,
  body[data-page="exchange"] .exchange-desk-ship-title {
    display: contents !important;
  }

  body[data-page="exchange"] .exchange-desk-warehouse-picker,
  body[data-page="exchange"] .exchange-desk-ship-picker,
  body[data-page="exchange"] .exchange-desk-ship-empty-picker {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
  }

  body[data-page="exchange"] .exchange-desk-warehouse-picker .exchange-glass-select-button,
  body[data-page="exchange"] .exchange-desk-ship-picker .exchange-glass-select-button,
  body[data-page="exchange"] .exchange-desk-ship-empty-picker {
    min-height: 46px !important;
    height: 46px !important;
    border-radius: 18px !important;
    font-size: 20px !important;
    padding-left: 14px !important;
  }

  body[data-page="exchange"] .exchange-desk-warehouse-title > small,
  body[data-page="exchange"] .exchange-desk-ship-title > small,
  body[data-page="exchange"] .exchange-desk-ship-location {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: center !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  body[data-page="exchange"] .exchange-desk-warehouse-category-filter,
  body[data-page="exchange"] .exchange-desk-ship-category-filter {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
  }

  body[data-page="exchange"] .exchange-desk-warehouse-category-filter .exchange-glass-select,
  body[data-page="exchange"] .exchange-desk-ship-category-filter .exchange-glass-select,
  body[data-page="exchange"] .exchange-desk-warehouse-category-filter .exchange-glass-select-button,
  body[data-page="exchange"] .exchange-desk-ship-category-filter .exchange-glass-select-button,
  body[data-page="exchange"] .exchange-desk-warehouse-category-filter select,
  body[data-page="exchange"] .exchange-desk-ship-category-filter select {
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
  }

  body[data-page="exchange"] .exchange-desk-warehouse-category-filter .exchange-glass-select-button,
  body[data-page="exchange"] .exchange-desk-ship-category-filter .exchange-glass-select-button,
  body[data-page="exchange"] .exchange-desk-warehouse-category-filter select,
  body[data-page="exchange"] .exchange-desk-ship-category-filter select {
    min-height: 30px !important;
    height: 30px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    gap: 4px !important;
    grid-template-columns: minmax(0, 1fr) 7px !important;
    padding: 0 7px 0 9px !important;
  }

  body[data-page="exchange"] .exchange-desk-warehouse-category-filter .exchange-glass-select-chevron,
  body[data-page="exchange"] .exchange-desk-ship-category-filter .exchange-glass-select-chevron {
    height: 7px !important;
    width: 7px !important;
  }

  body[data-page="exchange"] .exchange-desk-capacity {
    grid-column: 3 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    width: min(136px, 100%) !important;
    min-width: 0 !important;
    min-height: 30px !important;
    height: 30px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    padding: 0 8px !important;
  }

  body[data-page="exchange"] .exchange-desk-arrow {
    grid-column: 4 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    height: 38px !important;
    min-width: 38px !important;
    width: 38px !important;
    border-radius: 14px !important;
    font-size: 20px !important;
    margin-left: 0 !important;
  }

  body[data-page="exchange"] .exchange-desk-track {
    margin: 0 10px 8px !important;
  }

  body[data-page="exchange"] .exchange-desk-table-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 58px 68px 44px !important;
    gap: 6px !important;
    padding: 0 14px 6px 12px !important;
  }

  body[data-page="exchange"] .exchange-desk-list {
    max-height: min(54dvh, 520px) !important;
    padding: 0 8px 0 8px !important;
    scrollbar-gutter: stable !important;
  }

  body[data-page="exchange"] .exchange-desk-row,
  body[data-page="exchange"] .exchange-desk-row.compact {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 58px 68px 44px !important;
    gap: 6px !important;
    min-height: 74px !important;
    padding: 8px 8px 8px 10px !important;
  }

  body[data-page="exchange"] .exchange-desk-row > span {
    align-self: center !important;
    font-size: 13px !important;
    text-align: right !important;
    white-space: nowrap !important;
  }

  body[data-page="exchange"] .exchange-desk-row-actions {
    justify-content: end !important;
  }

  body[data-page="exchange"] .exchange-desk-row-button {
    height: 38px !important;
    min-width: 38px !important;
    width: 38px !important;
    border-radius: 14px !important;
  }

  body[data-page="exchange"] .exchange-desk-product {
    gap: 10px !important;
  }

  body[data-page="exchange"] .exchange-desk-product-icon,
  body[data-page="exchange"] .exchange-desk-product-icon .product-icon-image {
    height: 46px !important;
    width: 46px !important;
  }

  body[data-page="exchange"] .exchange-desk-product strong {
    font-size: 18px !important;
  }

  body[data-page="exchange"] .exchange-desk-product small {
    font-size: 12px !important;
  }
}


/* Exchange desk ship hold category filter. */
body[data-page="exchange"] .exchange-desk-ship-title {
  column-gap: 8px;
  display: grid;
  grid-template-columns: max-content max-content minmax(106px, 132px);
  justify-content: start;
  max-width: 100%;
  min-width: 0;
  row-gap: 6px;
  width: min(420px, 100%);
}

body[data-page="exchange"] .exchange-desk-ship-title .exchange-desk-ship-picker,
body[data-page="exchange"] .exchange-desk-ship-title .exchange-desk-ship-empty-picker {
  grid-column: 1 / -1;
  width: 100%;
}

body[data-page="exchange"] .exchange-desk-ship-title .exchange-desk-ship-location {
  align-self: center;
  grid-column: 1;
  margin-top: 0;
  max-width: 170px;
  width: auto;
}

body[data-page="exchange"] .exchange-desk-ship-title .exchange-desk-ship-location-hint {
  max-width: 260px;
}

body[data-page="exchange"] .exchange-desk-ship-cargo-count {
  align-self: center;
  color: rgba(43, 60, 56, 0.74);
  font-size: 13px;
  font-weight: 850;
  grid-column: 2;
  line-height: 1.1;
  margin-top: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.54);
  white-space: nowrap;
}

body[data-page="exchange"] .exchange-desk-ship-category-filter {
  align-self: center;
  display: block;
  grid-column: 3;
  justify-self: start;
  min-width: 0;
  width: min(132px, 100%);
}

body[data-page="exchange"] .exchange-desk-ship-category-filter .exchange-glass-select-button,
body[data-page="exchange"] .exchange-desk-ship-category-filter select {
  border-radius: 15px;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 12px;
  min-height: 34px;
  padding: 0 10px 0 12px;
}

body[data-page="exchange"] .exchange-desk-ship-category-filter .exchange-glass-select-chevron {
  height: 7px;
  width: 7px;
}

body[data-page="exchange"] .exchange-desk-ship-category-filter .exchange-glass-select-menu {
  width: max(100%, 176px);
}

body[data-page="exchange"] .exchange-desk-ship-category-filter .exchange-glass-select-option {
  border-radius: 12px;
  font-size: 14px;
  min-height: 36px;
}

@media (max-width: 760px) {
  body[data-page="exchange"] .exchange-desk-ship-title {
    grid-template-columns: max-content minmax(96px, 126px);
    width: min(340px, 100%);
  }

  body[data-page="exchange"] .exchange-desk-ship-cargo-count {
    grid-column: 1;
  }

  body[data-page="exchange"] .exchange-desk-ship-category-filter {
    grid-column: 2;
  }
}

body.auth-gate-open {
  overflow: hidden;
}

body.auth-gate-open .app {
  filter: blur(18px) saturate(0.86);
  pointer-events: none;
  transform: scale(0.992);
  transition: filter 220ms ease, transform 220ms ease;
}

.auth-gate-backdrop {
  align-items: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(66, 211, 190, 0.22), transparent 34%),
    radial-gradient(circle at 84% 20%, rgba(246, 210, 112, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(237, 252, 249, 0.88), rgba(248, 249, 238, 0.9));
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 28px;
  position: fixed;
  z-index: 9000;
}

.auth-gate-shell {
  align-items: stretch;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(240, 255, 251, 0.58));
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 34px;
  box-shadow: 0 36px 100px rgba(18, 64, 58, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  color: #123c35;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  max-width: 1040px;
  overflow: hidden;
  padding: 28px;
  width: min(100%, 1040px);
}

@supports (backdrop-filter: blur(28px)) {
  .auth-gate-shell,
  .auth-gate-panel {
    backdrop-filter: blur(28px) saturate(1.18);
  }
}

.auth-gate-copy {
  align-content: end;
  background:
    linear-gradient(145deg, rgba(17, 145, 132, 0.18), rgba(255, 255, 255, 0.32)),
    url("/assets/world/concept-art/player_owned_island_concept.png?v=player-owned-island-concept-20260618-v1") center / cover;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px;
  display: grid;
  min-height: 520px;
  overflow: hidden;
  padding: 34px;
  position: relative;
}

.auth-gate-copy::before {
  background: linear-gradient(180deg, rgba(244, 252, 250, 0.08), rgba(237, 252, 248, 0.84));
  content: "";
  inset: 0;
  position: absolute;
}

.auth-gate-copy > * {
  position: relative;
  z-index: 1;
}

.auth-gate-copy span {
  color: #0f9486;
  font-family: Inconsolata, var(--font-mono, monospace);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.auth-gate-copy h1 {
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.96;
  margin: 14px 0 18px;
}

.auth-gate-copy p {
  color: rgba(36, 78, 72, 0.78);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.65;
  margin: 0;
  max-width: 560px;
}

.auth-gate-panel {
  align-self: stretch;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 44px rgba(21, 80, 72, 0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  padding: 24px;
}

.auth-gate-tabs {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(16, 128, 117, 0.12);
  border-radius: 999px;
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 8px;
  padding: 6px;
}

.auth-gate-tabs button,
.auth-gate-switch {
  background: transparent;
  border: 0;
  color: rgba(39, 78, 72, 0.74);
  cursor: pointer;
  font-weight: 900;
}

.auth-gate-tabs button {
  border-radius: 999px;
  min-height: 46px;
}

.auth-gate-tabs button.active {
  background: linear-gradient(180deg, #19b8a7, #078f82);
  box-shadow: 0 10px 24px rgba(8, 143, 130, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  color: #fff;
}

.auth-gate-field {
  display: grid;
  gap: 8px;
}

.auth-gate-field span {
  color: rgba(34, 76, 69, 0.76);
  font-size: 13px;
  font-weight: 900;
}

.auth-gate-field input {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(14, 119, 109, 0.16);
  border-radius: 18px;
  color: #123c35;
  font-family: Inconsolata, "Microsoft YaHei", sans-serif;
  font-size: 18px;
  font-weight: 800;
  min-height: 54px;
  outline: none;
  padding: 0 16px;
}

.auth-gate-field input:focus {
  border-color: rgba(9, 151, 137, 0.58);
  box-shadow: 0 0 0 4px rgba(21, 189, 171, 0.14);
}

.auth-gate-message {
  border-radius: 16px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
  padding: 12px 14px;
}

.auth-gate-message.error {
  background: rgba(255, 230, 226, 0.72);
  color: #a43b30;
}

.auth-gate-message.info {
  background: rgba(218, 246, 239, 0.78);
  color: #087d72;
}

.auth-gate-submit {
  background: linear-gradient(180deg, #19b8a7, #078f82);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(8, 143, 130, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.44);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 1000;
  min-height: 56px;
}

.auth-gate-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.auth-gate-switch {
  min-height: 38px;
}

@media (max-width: 840px) {
  .auth-gate-backdrop {
    align-items: stretch;
    padding: 16px;
  }

  .auth-gate-shell {
    border-radius: 28px;
    grid-template-columns: 1fr;
    overflow-y: auto;
    padding: 16px;
  }

  .auth-gate-copy {
    min-height: 260px;
    padding: 24px;
  }

  .auth-gate-copy h1 {
    font-size: 40px;
  }
}


/* Keep the exchange ship hold metadata readable on narrow screens. */
@media (max-width: 760px) {
  body[data-page="exchange"] .exchange-desk-ship-title .exchange-desk-ship-location {
    grid-column: 1 / 3 !important;
    grid-row: 2 !important;
    max-width: 100% !important;
    width: auto !important;
  }

  body[data-page="exchange"] .exchange-desk-ship-cargo-count {
    grid-column: 1 !important;
    grid-row: 3 !important;
    margin: 0 !important;
  }

  body[data-page="exchange"] .exchange-desk-ship-category-filter {
    grid-column: 2 !important;
    grid-row: 3 !important;
  }

  body[data-page="exchange"] .exchange-desk-cargo-panel:nth-child(2) .exchange-desk-capacity {
    align-self: center !important;
    grid-row: 2 / 4 !important;
  }

  body[data-page="exchange"] .exchange-desk-cargo-panel:nth-child(2) .exchange-desk-arrow {
    align-self: center !important;
    grid-row: 2 / 4 !important;
  }
}

/* Mobile exchange ship hold: separate location, count, filter, capacity, and unload controls. */
@media (max-width: 760px) {
  body[data-page="exchange"] .exchange-desk-cargo-panel:nth-of-type(2) .exchange-desk-panel-head {
    grid-template-columns: minmax(0, 1fr) 116px 38px !important;
    row-gap: 7px !important;
  }

  body[data-page="exchange"] .exchange-desk-cargo-panel:nth-of-type(2) .exchange-desk-ship-picker,
  body[data-page="exchange"] .exchange-desk-cargo-panel:nth-of-type(2) .exchange-desk-ship-empty-picker {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  body[data-page="exchange"] .exchange-desk-cargo-panel:nth-of-type(2) .exchange-desk-ship-location {
    grid-column: 1 !important;
    grid-row: 2 !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body[data-page="exchange"] .exchange-desk-cargo-panel:nth-of-type(2) .exchange-desk-ship-location > span:last-child {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body[data-page="exchange"] .exchange-desk-cargo-panel:nth-of-type(2) .exchange-desk-ship-cargo-count {
    grid-column: 1 !important;
    grid-row: 3 !important;
    align-self: center !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  body[data-page="exchange"] .exchange-desk-cargo-panel:nth-of-type(2) .exchange-desk-ship-category-filter {
    grid-column: 2 !important;
    grid-row: 3 !important;
    justify-self: end !important;
  }

  body[data-page="exchange"] .exchange-desk-cargo-panel:nth-of-type(2) .exchange-desk-capacity {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    width: 116px !important;
  }

  body[data-page="exchange"] .exchange-desk-cargo-panel:nth-of-type(2) .exchange-desk-arrow.left {
    grid-column: 3 !important;
    grid-row: 2 !important;
    justify-self: end !important;
  }
}

/* World map action menu placement: keep top-row menus clear of chart headers. */
.world-sea-action-menu[data-placement="below"] {
  bottom: auto;
  top: calc(100% + 8px);
}

.world-sea-action-menu[data-placement="below"]::after {
  border-bottom: 0;
  border-left: 1px solid rgba(138, 202, 200, 0.36);
  border-right: 0;
  border-top: 1px solid rgba(138, 202, 200, 0.36);
  bottom: auto;
  top: -5px;
}

.auth-gate-code-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.auth-gate-code-button {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(14, 119, 109, 0.16);
  border-radius: 18px;
  color: #087d72;
  cursor: pointer;
  font-size: 14px;
  font-weight: 1000;
  min-height: 54px;
  padding: 0 16px;
  white-space: nowrap;
}

.auth-gate-code-button:disabled {
  cursor: wait;
  opacity: 0.62;
}
/* Final mobile ship voyage cargo manifest: keep carried goods visible at the sheet bottom. */
@media (max-width: 900px) {
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-body {
    align-content: start;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-summary {
    bottom: 0;
    display: grid !important;
    gap: 0;
    margin-top: 0 !important;
    position: sticky;
    z-index: 4;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-summary summary {
    min-height: 0 !important;
    padding: 10px 12px 8px !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-list {
    gap: 6px !important;
    max-height: 132px !important;
    padding: 0 10px 10px !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-row {
    background: rgba(255, 255, 255, 0.48);
    border-radius: 14px;
    min-height: 40px !important;
    padding: 4px 8px;
  }
}

/* Mobile empty-plot build cards: put meta chips under the building name. */
@media (max-width: 760px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-row {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-main {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-card {
    width: 100% !important;
    max-width: none !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta span {
    flex: 1 1 122px !important;
    min-width: 0 !important;
    min-height: 42px !important;
    border-radius: 15px !important;
    font-size: 14px !important;
    line-height: 1.1 !important;
    padding: 6px 10px !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-power-impact-chip img {
    height: 26px !important;
    width: 26px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-power-impact-chip strong {
    font-size: 18px !important;
  }
}

@media (max-width: 420px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-title {
    font-size: 22px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-building-meta span {
    flex-basis: 108px !important;
    font-size: 13px !important;
  }
}
/* Mobile empty-plot build materials: show required materials in rows of three. */
@media (max-width: 760px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group .empty-plot-requirement-label {
    justify-self: start !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group .empty-plot-requirement-tiles {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    justify-content: stretch !important;
    justify-items: center !important;
    width: 100% !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group .empty-plot-cost-tile.build-asset-tile {
    width: 100% !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group .build-asset-frame {
    width: min(100%, 104px) !important;
    height: 112px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group .empty-plot-cost-tile.build-asset-tile strong {
    height: 78px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group .empty-plot-cost-tile.build-asset-tile small {
    min-height: 34px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 420px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group .empty-plot-requirement-tiles {
    gap: 8px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group .build-asset-frame {
    height: 104px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group .empty-plot-cost-tile.build-asset-tile strong {
    height: 72px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group .empty-plot-cost-tile.build-asset-tile em {
    font-size: 16px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .material-requirement-group .empty-plot-cost-tile.build-asset-tile small {
    min-height: 32px !important;
    font-size: 12px !important;
  }
}
/* Mobile empty-plot build workforce: show population needs in rows of three and place build below. */
@media (max-width: 760px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-requirement-action-row {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group .empty-plot-requirement-label {
    justify-self: start !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group .empty-plot-requirement-tiles {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    justify-content: stretch !important;
    justify-items: center !important;
    width: 100% !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group .empty-plot-cost-tile.build-asset-tile {
    width: 100% !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group .build-asset-frame {
    width: min(100%, 104px) !important;
    height: 112px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group .empty-plot-cost-tile.build-asset-tile strong {
    height: 78px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group .empty-plot-cost-tile.build-asset-tile small {
    min-height: 34px !important;
    font-size: 14px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .empty-plot-build-button {
    grid-column: auto !important;
    justify-self: stretch !important;
    width: 100% !important;
    min-height: 68px !important;
  }
}

@media (max-width: 420px) {
  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group .empty-plot-requirement-tiles {
    gap: 8px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group .build-asset-frame {
    height: 104px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group .empty-plot-cost-tile.build-asset-tile strong {
    height: 72px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group .empty-plot-cost-tile.build-asset-tile em {
    font-size: 16px !important;
  }

  body[data-page="island"] .empty-plot-modal:not(.building-plot-modal) .workforce-requirement-group .empty-plot-cost-tile.build-asset-tile small {
    min-height: 32px !important;
    font-size: 12px !important;
  }
}
/* Mobile warehouse treasury: show products in rows of three. */
@media (max-width: 860px) {
  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card {
    grid-template-rows: minmax(74px, auto) auto auto auto !important;
    min-height: 176px !important;
    border-radius: 16px !important;
    padding: 8px 7px 10px !important;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-icon {
    width: min(100%, 92px) !important;
    max-width: 92px !important;
    aspect-ratio: 1.16 !important;
    border-radius: 13px !important;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-icon .product-icon-image {
    object-fit: contain !important;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card > em {
    top: 7px !important;
    right: 7px !important;
    max-width: calc(100% - 14px) !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    padding: 5px 7px !important;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card > strong {
    margin-top: 6px !important;
    font-size: 15px !important;
    line-height: 1.12 !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card > small {
    font-size: 10px !important;
    line-height: 1.15 !important;
    margin-top: 3px !important;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-meta {
    gap: 4px !important;
    width: 100% !important;
    margin-top: 7px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    padding-top: 7px !important;
  }
}

@media (max-width: 420px) {
  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-grid {
    gap: 8px !important;
    padding: 10px !important;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card {
    min-height: 166px !important;
    padding: 7px 5px 9px !important;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-icon {
    max-width: 82px !important;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-card > strong {
    font-size: 13px !important;
  }

  :is(body[data-page="warehouse"], .technology-workbench-shell[data-workbench-tab="warehouse"]) .warehouse-archive-product-meta {
    font-size: 9px !important;
  }
}
/* Final mobile ship voyage cargo manifest panel: use a normal section instead of details. */
@media (max-width: 900px) {
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-main {
    cursor: default;
    display: grid;
    gap: 8px;
    list-style: none;
    min-height: 0;
    padding: 10px 12px 8px;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-main .island-ship-voyage-mobile-cargo-chips {
    min-height: 30px;
  }
}

/* Touch-device safety for mobile ship voyage cargo manifest. */
@media (pointer: coarse) {
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-summary {
    display: grid !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo {
    display: none !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-main {
    display: grid;
    gap: 8px;
    padding: 10px 12px 8px;
  }
}

/* Final mobile ship voyage layout: keep the cargo manifest visible as a sheet footer. */
:is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-scroll {
  display: contents;
}

@media (max-width: 760px), (pointer: coarse) {
  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-body {
    display: grid !important;
    gap: 10px !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 8px 12px max(10px, env(safe-area-inset-bottom)) !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-scroll {
    display: grid !important;
    gap: 10px !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    padding-right: 0 !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-summary {
    align-self: end !important;
    bottom: auto !important;
    display: grid !important;
    flex: 0 0 auto !important;
    margin-top: 0 !important;
    max-height: 168px !important;
    overflow: hidden !important;
    position: relative !important;
    z-index: 7 !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-main {
    padding: 9px 12px 8px !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-mobile-cargo-list {
    max-height: 82px !important;
  }

  :is(body[data-page="island"], body.ship-voyage-modal-open) .island-ship-voyage-cargo {
    display: none !important;
  }
}
