:root {
  --page: #101612;
  --page-2: #172032;
  --ink: #f5f0dc;
  --paper: #efe1b8;
  --paper-2: #d5be7d;
  --charcoal: #172017;
  --panel: rgba(24, 35, 29, .88);
  --panel-2: rgba(31, 43, 35, .92);
  --line: rgba(245, 240, 220, .14);
  --line-strong: rgba(245, 240, 220, .28);
  --muted: #b8c1aa;
  --green: #59d987;
  --gold: #f0c85b;
  --blue: #72bfff;
  --red: #e86f58;
  --purple: #b38cff;
  --shadow: 0 26px 70px rgba(0, 0, 0, .42);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(125deg, rgba(89, 217, 135, .12), transparent 29%),
    linear-gradient(250deg, rgba(114, 191, 255, .12), transparent 34%),
    linear-gradient(180deg, var(--page), var(--page-2));
}

button,
input {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(245, 240, 220, .08);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
}

button:hover {
  border-color: rgba(89, 217, 135, .50);
  background: rgba(245, 240, 220, .13);
}

button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.ge-app {
  width: min(1380px, calc(100% - 26px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 15px 0 34px;
}

.ge-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 2px 14px;
}

.ge-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.ge-brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(240, 200, 91, .45);
  border-radius: 999px;
  color: #1a1406;
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,.58), transparent 28%),
    linear-gradient(145deg, #f4d66b, #9e6f25);
  box-shadow: 0 0 0 4px rgba(240, 200, 91, .10), inset 0 -8px 0 rgba(0,0,0,.16);
  font-size: 13px;
  font-weight: 1000;
}

.ge-brand strong,
.ge-brand em {
  display: block;
}

.ge-brand strong {
  font-size: 19px;
  line-height: 1;
}

.ge-brand em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.ge-top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ge-ledger {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.ge-ledger div,
.ge-market-card,
.ge-trade-card,
.ge-panel,
.ge-map-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(245, 240, 220, .07), rgba(245, 240, 220, .028)), var(--panel);
  box-shadow: var(--shadow);
}

.ge-ledger div {
  min-width: 0;
  padding: 10px 11px;
  box-shadow: 0 12px 32px rgba(0,0,0,.26);
}

.ge-ledger span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.ge-ledger strong {
  display: block;
  min-width: 0;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.ge-map-card {
  position: relative;
  overflow: hidden;
  min-height: 166px;
  margin: 10px 0;
  background:
    linear-gradient(180deg, rgba(114, 191, 255, .10), rgba(89, 217, 135, .07)),
    #111a18;
}

.ge-map-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 44%, rgba(89, 217, 135, .15), transparent 17%),
    radial-gradient(circle at 78% 28%, rgba(179, 140, 255, .15), transparent 17%),
    repeating-linear-gradient(0deg, rgba(245,240,220,.045) 0 1px, transparent 1px 9px);
  opacity: .95;
  pointer-events: none;
}

.ge-map-art {
  position: absolute;
  inset: 18px 18px 54px;
}

.sigil {
  position: absolute;
  display: block;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(245, 240, 220, .18);
  border-radius: 999px;
  background: rgba(8, 12, 10, .36);
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.20), 0 0 30px rgba(89,217,135,.12);
}

.sigil::before,
.sigil::after {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 4px;
  background: currentColor;
}

.sigil::after {
  inset: 22px;
  background: rgba(255,255,255,.60);
}

.sigil.ore {
  left: 6%;
  top: 18%;
  color: #93a4b5;
  transform: rotate(28deg);
}

.sigil.rune {
  left: 42%;
  top: 0;
  color: var(--purple);
  transform: rotate(45deg);
}

.sigil.fish {
  right: 11%;
  top: 22%;
  color: var(--blue);
}

.sigil.herb {
  left: 68%;
  bottom: 2%;
  color: var(--green);
  transform: rotate(12deg);
}

.ge-routes {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  padding: 100px 12px 12px;
}

.ge-routes button {
  min-height: 46px;
  border-radius: var(--radius);
  background: rgba(4, 9, 7, .56);
  padding: 8px 9px;
  text-align: left;
}

.ge-routes button.active {
  border-color: rgba(240, 200, 91, .78);
  background: rgba(240, 200, 91, .15);
  box-shadow: 0 0 0 3px rgba(240, 200, 91, .10), 0 14px 30px rgba(0,0,0,.28);
}

.ge-routes strong,
.ge-routes span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ge-routes strong {
  font-size: 12px;
}

.ge-routes span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.ge-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .48fr) minmax(310px, .58fr);
  gap: 10px;
  align-items: start;
}

.ge-market-card,
.ge-trade-card,
.ge-panel {
  min-width: 0;
}

.ge-market-card {
  overflow: hidden;
}

.ge-trade-card,
.ge-panel {
  padding: 14px;
}

.ge-side {
  display: grid;
  gap: 10px;
}

.ge-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
}

.ge-card-head.compact {
  padding: 0 0 10px;
}

.ge-kicker {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.ge-goal,
.ge-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(240, 200, 91, .35);
  border-radius: 999px;
  background: rgba(240, 200, 91, .12);
  color: var(--gold);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 1000;
}

.ge-news,
.ge-price-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}

.ge-news {
  min-height: 36px;
}

.ge-news span,
.ge-price-guide span {
  border: 1px solid rgba(114, 191, 255, .25);
  border-radius: 999px;
  background: rgba(114, 191, 255, .08);
  color: #dceeff;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 850;
}

.ge-price-guide {
  padding-top: 0;
}

.ge-price-guide span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: var(--line);
  background: rgba(245, 240, 220, .05);
  color: var(--muted);
  font-weight: 900;
}

.ge-price-guide i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(245, 240, 220, .07);
}

.ge-price-guide i.bargain {
  background: var(--green);
}

.ge-price-guide i.costly {
  background: var(--gold);
}

.ge-table-wrap {
  overflow-x: auto;
}

.ge-market-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.ge-market-table th,
.ge-market-table td {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  text-align: left;
}

.ge-market-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.ge-market-table tbody tr {
  transition: background .16s ease;
}

.ge-market-table tbody tr:hover,
.ge-market-table tbody tr.selected {
  background: rgba(89, 217, 135, .085);
}

.ge-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.ge-item-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,.24);
  color: var(--icon, var(--gold));
  font-size: 15px;
  font-weight: 1000;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.16);
}

.ge-item strong,
.ge-item span {
  display: block;
}

.ge-item strong {
  font-size: 14px;
}

.ge-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.ge-price {
  font-size: 16px;
  font-weight: 1000;
}

.ge-price.bargain {
  color: var(--green);
}

.ge-price.costly {
  color: var(--gold);
}

.ge-signal {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(245, 240, 220, .05);
  color: var(--muted);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
}

.ge-signal.bargain {
  border-color: rgba(89, 217, 135, .34);
  color: var(--green);
}

.ge-signal.costly {
  border-color: rgba(240, 200, 91, .34);
  color: var(--gold);
}

.ge-market-table button {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.ge-selected {
  min-height: 100px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.ge-selected span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.ge-quantity {
  display: grid;
  gap: 6px;
  margin: 14px 0 10px;
}

.ge-quantity span,
.ge-service-row label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.ge-quantity input,
.ge-service-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .24);
  color: var(--ink);
  padding: 0 11px;
  font-weight: 900;
  outline: none;
}

.ge-quantity input:focus,
.ge-service-row input:focus {
  border-color: rgba(89, 217, 135, .55);
  box-shadow: 0 0 0 3px rgba(89, 217, 135, .10);
}

.ge-trade-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ge-trade-actions button:nth-child(1) {
  color: #06110a;
  background: var(--green);
}

.ge-trade-actions button:nth-child(2) {
  color: #151005;
  background: var(--gold);
}

.ge-contract-active,
.ge-inventory,
.ge-services,
.ge-contracts,
.ge-rivals,
.ge-log {
  display: grid;
  gap: 8px;
}

.ge-contract-active {
  margin-top: 14px;
}

.ge-inventory {
  margin-top: 14px;
}

.ge-empty,
.ge-inv-row,
.ge-service-row,
.ge-contract-row,
.ge-rival-row,
.ge-log p,
.ge-active-contract {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(245, 240, 220, .045);
}

.ge-empty {
  margin: 0;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.ge-inv-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 10px;
  font-size: 12px;
}

.ge-inv-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ge-inv-row span {
  color: var(--muted);
  font-weight: 900;
}

.ge-service-row,
.ge-contract-row,
.ge-active-contract {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.ge-service-row strong,
.ge-contract-row strong,
.ge-active-contract strong {
  font-size: 13px;
}

.ge-service-row p,
.ge-contract-row p,
.ge-active-contract p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 760;
}

.ge-service-row label {
  display: grid;
  gap: 5px;
}

.ge-service-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.ge-service-buttons button,
.ge-contract-row button,
.ge-active-contract button {
  min-height: 34px;
  padding: 0 9px;
  font-size: 12px;
}

.ge-contract-row footer,
.ge-active-contract footer {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.ge-rival-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
}

.ge-rival-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--rival, var(--purple));
  color: #11150f;
  font-size: 12px;
  font-weight: 1000;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.16);
}

.ge-rival-row strong,
.ge-rival-row span,
.ge-rival-row em {
  display: block;
}

.ge-rival-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.ge-rival-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.ge-rival-row em {
  color: var(--gold);
  font-size: 12px;
  font-style: normal;
  font-weight: 1000;
}

.ge-log {
  max-height: 300px;
  overflow: auto;
}

.ge-log p {
  margin: 0;
  padding: 9px 10px;
  color: #ebe5cd;
  font-size: 12px;
  line-height: 1.35;
}

.ge-log p b {
  color: var(--gold);
}

.ge-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 35;
  width: min(540px, calc(100vw - 26px));
  margin: 0;
  border: 1px solid rgba(89, 217, 135, .35);
  border-radius: var(--radius);
  background: rgba(12, 18, 14, .94);
  color: var(--ink);
  padding: 12px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 870;
  box-shadow: 0 20px 54px rgba(0, 0, 0, .45);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.ge-toast[hidden] {
  display: none;
}

.ge-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 4, .70);
  padding: 18px;
  backdrop-filter: blur(10px);
}

.ge-modal[hidden] {
  display: none;
}

.ge-modal-card {
  position: relative;
  width: min(560px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(245, 240, 220, .08), rgba(245, 240, 220, .03)),
    #18221b;
  padding: 20px;
  box-shadow: 0 28px 86px rgba(0, 0, 0, .56);
}

.ge-modal-card h2 {
  font-size: 25px;
}

.ge-modal-card p:not(.ge-kicker) {
  color: #e7dfc2;
  line-height: 1.5;
}

.ge-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.ge-close {
  position: absolute;
  right: 12px;
  top: 12px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

.ge-guide-grid,
.ge-final-score {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.ge-guide-grid div,
.ge-final-score div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(245, 240, 220, .05);
  padding: 10px;
}

.ge-guide-grid strong,
.ge-guide-grid span,
.ge-final-score span,
.ge-final-score strong {
  display: block;
}

.ge-guide-grid strong,
.ge-final-score strong {
  font-size: 14px;
}

.ge-guide-grid span,
.ge-final-score span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 760;
}

.ge-final-score strong {
  margin-top: 4px;
  font-size: 17px;
}

@media (max-width: 1180px) {
  .ge-ledger {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ge-routes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ge-board {
    grid-template-columns: minmax(0, 1fr) minmax(270px, .48fr);
  }

  .ge-side {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .ge-app {
    width: min(100% - 18px, 1380px);
    padding-top: 10px;
  }

  .ge-top {
    align-items: flex-start;
  }

  .ge-brand em {
    display: none;
  }

  .ge-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ge-routes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 92px;
  }

  .ge-map-card {
    min-height: 254px;
  }

  .ge-board,
  .ge-side,
  .ge-guide-grid,
  .ge-final-score {
    grid-template-columns: 1fr;
  }

  .ge-market-table th,
  .ge-market-table td {
    padding: 11px 12px;
  }
}

@media (max-width: 520px) {
  .ge-top {
    display: grid;
  }

  .ge-top-actions {
    justify-content: flex-start;
  }

  .ge-card-head {
    display: grid;
  }

  .ge-trade-actions,
  .ge-service-buttons {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 981px) {
  html,
  body {
    overflow: hidden;
  }
}

.ge-app {
  width: min(1440px, calc(100% - 24px));
  height: 100vh;
  min-height: 0;
  padding: 10px 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
}

.ge-top {
  min-height: 44px;
  padding: 0;
}

.ge-brand-mark {
  width: 40px;
  height: 40px;
}

.ge-brand strong {
  font-size: 17px;
}

.ge-brand em {
  font-size: 11px;
}

.ge-top-actions button {
  min-height: 36px;
}

.ge-ledger {
  grid-template-columns: .7fr 1.08fr repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.ge-ledger div {
  min-height: 50px;
  padding: 8px 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
}

.ge-ledger span {
  font-size: 9px;
}

.ge-ledger strong {
  margin-top: 3px;
  font-size: 14px;
}

.ge-map-card {
  min-height: 68px;
  height: 68px;
  margin: 0;
  box-shadow: 0 12px 30px rgba(0,0,0,.24);
}

.ge-map-art {
  display: none;
}

.ge-routes {
  height: 100%;
  padding: 7px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.ge-routes button {
  min-height: 0;
  height: 54px;
  padding: 7px 8px;
  box-shadow: none;
}

.ge-routes strong {
  font-size: 11px;
}

.ge-routes span {
  font-size: 9px;
}

.ge-board {
  min-height: 0;
  height: 100%;
  grid-template-columns: minmax(0, 1fr) 270px 318px;
  gap: 8px;
  align-items: stretch;
}

.ge-market-card,
.ge-trade-card,
.ge-side {
  height: 100%;
  min-height: 0;
}

.ge-market-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.ge-card-head {
  padding: 10px 12px 7px;
}

.ge-card-head.compact {
  padding: 0 0 8px;
}

h1 {
  font-size: 20px;
}

h2 {
  font-size: 16px;
}

.ge-goal {
  padding: 6px 9px;
  font-size: 11px;
}

.ge-news,
.ge-price-guide {
  padding: 0 12px 7px;
  gap: 5px;
}

.ge-news {
  min-height: 27px;
}

.ge-news span,
.ge-price-guide span {
  padding: 5px 8px;
  font-size: 10px;
}

.ge-table-wrap {
  min-height: 0;
  overflow: hidden;
}

.ge-market-table {
  min-width: 0;
  table-layout: fixed;
}

.ge-market-table th,
.ge-market-table td {
  padding: 7px 10px;
}

.ge-market-table th {
  font-size: 9px;
}

.ge-market-table th:nth-child(1),
.ge-market-table td:nth-child(1) {
  width: 42%;
}

.ge-market-table th:nth-child(2),
.ge-market-table td:nth-child(2) {
  width: 18%;
}

.ge-market-table th:nth-child(3),
.ge-market-table td:nth-child(3) {
  width: 10%;
}

.ge-market-table th:nth-child(4),
.ge-market-table td:nth-child(4) {
  width: 15%;
}

.ge-market-table th:nth-child(5),
.ge-market-table td:nth-child(5) {
  width: 15%;
}

.ge-item {
  gap: 8px;
}

.ge-item .ge-item-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  line-height: 1;
  text-align: center;
}

.ge-item strong {
  font-size: 13px;
}

.ge-item div span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.ge-price {
  font-size: 14px;
}

.ge-signal {
  min-height: 24px;
  padding: 0 8px;
  font-size: 10px;
}

.ge-market-table button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.ge-trade-card {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  padding: 10px;
  overflow: hidden;
}

.ge-selected {
  min-height: 0;
  padding-bottom: 9px;
}

.ge-selected span {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
}

.ge-quantity {
  margin: 9px 0 8px;
}

.ge-quantity input,
.ge-service-row input {
  min-height: 36px;
}

.ge-trade-actions {
  gap: 7px;
}

.ge-trade-actions button {
  min-height: 35px;
}

.ge-contract-active {
  margin-top: 10px;
}

.ge-inventory {
  min-height: 0;
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
  overflow: hidden;
}

.ge-empty,
.ge-inv-row,
.ge-service-row,
.ge-contract-row,
.ge-rival-row,
.ge-log p,
.ge-active-contract {
  border-radius: 7px;
}

.ge-empty {
  padding: 8px;
  font-size: 11px;
}

.ge-inv-row {
  padding: 7px 8px;
  gap: 6px;
  font-size: 11px;
}

.ge-side {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
}

.ge-dock-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.ge-dock-tabs button {
  min-height: 34px;
  padding: 0 6px;
  font-size: 11px;
  box-shadow: none;
}

.ge-dock-tabs button.active {
  border-color: rgba(240, 200, 91, .62);
  background: rgba(240, 200, 91, .14);
  color: var(--gold);
}

.ge-panel {
  display: none;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
}

.ge-panel.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.ge-services,
.ge-contracts,
.ge-rivals,
.ge-log {
  min-height: 0;
  align-content: start;
  overflow: hidden;
  gap: 7px;
}

.ge-service-row,
.ge-contract-row,
.ge-active-contract {
  gap: 6px;
  padding: 9px;
}

.ge-service-row p,
.ge-contract-row p,
.ge-active-contract p {
  font-size: 11px;
  line-height: 1.28;
}

.ge-service-buttons {
  gap: 6px;
}

.ge-service-buttons button,
.ge-contract-row button,
.ge-active-contract button {
  min-height: 31px;
  font-size: 11px;
}

.ge-rival-row {
  padding: 8px;
}

.ge-log {
  max-height: none;
}

.ge-log p {
  padding: 8px;
  font-size: 11px;
}

.ge-modal-card.setup {
  width: min(780px, 100%);
}

.ge-modal-card {
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.ge-preset-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 16px 0 12px;
}

.ge-preset-grid button {
  min-height: 38px;
  padding: 0 8px;
  box-shadow: none;
}

.ge-preset-grid button.active {
  border-color: rgba(240, 200, 91, .62);
  background: rgba(240, 200, 91, .14);
  color: var(--gold);
}

.ge-setup-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.ge-setup-form label {
  display: grid;
  gap: 5px;
}

.ge-setup-form label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.ge-setup-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .24);
  color: var(--ink);
  padding: 0 10px;
  font-weight: 900;
  outline: none;
}

.ge-setup-form .ge-check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(245, 240, 220, .045);
  padding: 0 10px;
}

.ge-setup-form .ge-check input {
  width: 16px;
  min-height: 16px;
}

.ge-setup-form .ge-check span {
  text-transform: none;
  font-size: 12px;
}

.ge-setup-form button[type="submit"] {
  grid-column: 1 / -1;
  min-height: 42px;
  color: #06110a;
  background: var(--green);
}

@media (max-width: 1180px) {
  .ge-app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .ge-board {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .ge-market-card,
  .ge-trade-card,
  .ge-side {
    height: auto;
  }

  .ge-side {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
}

@media (max-width: 760px) {
  .ge-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ge-routes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ge-map-card {
    height: auto;
    min-height: 0;
  }

  .ge-market-table {
    min-width: 620px;
  }

  .ge-table-wrap {
    overflow-x: auto;
  }

  .ge-setup-form,
  .ge-preset-grid {
    grid-template-columns: 1fr;
  }
}

/* v3 board redesign */
.ge-kicker {
  letter-spacing: 0;
}

@media (min-width: 981px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .ge-app {
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }
}

.ge-board {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  min-height: 0;
  height: auto;
}

.ge-side {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  height: 132px;
  min-height: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(245, 240, 220, .07), rgba(245, 240, 220, .028)), var(--panel);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .26);
  overflow: hidden;
}

.ge-dock-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 6px;
}

.ge-dock-tabs button {
  min-height: 32px;
  border-radius: 7px;
  box-shadow: none;
}

.ge-side .ge-panel {
  min-height: 0;
  height: auto;
  padding: 7px 0 0;
  overflow: hidden;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ge-side .ge-panel.active {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.ge-side .ge-card-head.compact {
  display: block;
  padding: 0;
}

.ge-side .ge-card-head.compact h2 {
  font-size: 14px;
}

.ge-side .ge-card-head.compact .ge-kicker {
  margin-bottom: 3px;
  font-size: 9px;
}

.ge-services,
.ge-contracts,
.ge-rivals,
.ge-log {
  display: grid;
  min-height: 0;
  max-height: 82px;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.ge-services {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.ge-contracts,
.ge-rivals {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
}

.ge-log {
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
}

.ge-service-row,
.ge-contract-row,
.ge-active-contract {
  gap: 5px;
  padding: 7px 8px;
}

.ge-service-row {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.ge-service-row strong,
.ge-contract-row strong,
.ge-active-contract strong {
  font-size: 12px;
}

.ge-service-row p,
.ge-contract-row p,
.ge-active-contract p {
  font-size: 10px;
  line-height: 1.2;
}

.ge-service-row label {
  gap: 3px;
}

.ge-service-row label span {
  font-size: 9px;
}

.ge-service-row input,
.ge-service-row button,
.ge-contract-row button,
.ge-active-contract button {
  min-height: 27px;
  font-size: 10px;
}

.ge-service-buttons {
  gap: 5px;
}

.ge-rival-row {
  grid-template-columns: 31px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px 8px;
}

.ge-rival-row > .ge-rival-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  line-height: 1;
  text-align: center;
}

.ge-rival-row strong {
  font-size: 11px;
}

.ge-rival-row div span {
  font-size: 10px;
}

.ge-rival-row em {
  font-size: 11px;
}

.ge-log p {
  min-height: 0;
  margin: 0;
  padding: 7px 8px;
  font-size: 10px;
  line-height: 1.2;
}

.ge-market-card {
  grid-column: 1;
  grid-row: 2;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.ge-card-head {
  padding: 9px 12px 6px;
}

.ge-news,
.ge-price-guide {
  padding: 0 12px 6px;
}

.ge-news {
  min-height: 25px;
}

.ge-table-wrap {
  min-height: 0;
  padding-bottom: 8px;
  overflow: visible;
}

.ge-market-table {
  min-width: 0;
  table-layout: fixed;
}

.ge-market-table th,
.ge-market-table td {
  padding: 5px 10px;
}

.ge-market-table th {
  font-size: 9px;
}

.ge-market-table tbody tr:last-child td {
  border-bottom: 1px solid var(--line);
}

.ge-market-table th:nth-child(1),
.ge-market-table td:nth-child(1) {
  width: 44%;
}

.ge-market-table th:nth-child(2),
.ge-market-table td:nth-child(2) {
  width: 16%;
}

.ge-market-table th:nth-child(3),
.ge-market-table td:nth-child(3) {
  width: 9%;
}

.ge-market-table th:nth-child(4),
.ge-market-table td:nth-child(4) {
  width: 14%;
}

.ge-market-table th:nth-child(5),
.ge-market-table td:nth-child(5) {
  width: 17%;
}

.ge-market-table .ge-item-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  line-height: 1;
  text-align: center;
}

.ge-item {
  gap: 8px;
}

.ge-item strong {
  font-size: 12px;
}

.ge-item div span {
  font-size: 9px;
}

.ge-price {
  font-size: 13px;
}

.ge-signal {
  min-height: 23px;
  padding: 0 8px;
  font-size: 10px;
}

.ge-market-table button {
  min-height: 25px;
  padding: 0 10px;
  font-size: 10px;
}

.ge-trade-card[hidden] {
  display: none !important;
}

.ge-trade-card {
  position: absolute;
  z-index: 20;
  top: 140px;
  right: 10px;
  display: grid;
  width: min(318px, calc(100% - 20px));
  height: auto;
  max-height: calc(100% - 150px);
  padding: 12px;
  overflow: auto;
  box-shadow: 0 20px 54px rgba(0, 0, 0, .48);
}

.ge-trade-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 7px;
  box-shadow: none;
}

.ge-selected {
  padding-right: 34px;
}

.ge-inventory {
  overflow: auto;
}

@media (min-width: 981px) and (max-height: 760px) {
  .ge-side {
    height: 118px;
  }

  .ge-services,
  .ge-contracts,
  .ge-rivals,
  .ge-log {
    max-height: 68px;
  }

  .ge-trade-card {
    top: 126px;
  }
}

@media (max-width: 1180px) {
  .ge-side {
    height: auto;
    max-height: none;
  }

  .ge-side .ge-panel.active {
    grid-template-columns: 1fr;
  }

  .ge-services,
  .ge-contracts,
  .ge-rivals,
  .ge-log {
    max-height: 220px;
  }
}

@media (max-width: 760px) {
  .ge-dock-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ge-table-wrap {
    overflow-x: auto;
  }

  .ge-market-table {
    min-width: 640px;
  }

  .ge-trade-card {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: 72vh;
  }
}

/* v3 fit pass */
@media (min-width: 1181px) {
  .ge-side {
    height: 116px;
  }

  .ge-side .ge-panel.active {
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .ge-services,
  .ge-contracts,
  .ge-rivals,
  .ge-log {
    max-height: 66px;
  }

  .ge-services {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .ge-service-row {
    grid-template-columns: minmax(0, 1fr) minmax(76px, .45fr) minmax(128px, .7fr);
    align-items: center;
  }

  .ge-service-row p {
    display: none;
  }

  .ge-service-row label {
    grid-column: 2;
  }

  .ge-service-row label span {
    display: none;
  }

  .ge-service-buttons {
    grid-column: 3;
  }

  .ge-card-head {
    padding: 8px 12px 5px;
  }

  .ge-news,
  .ge-price-guide {
    padding-bottom: 5px;
  }

  .ge-market-table th,
  .ge-market-table td {
    padding: 2px 10px;
  }

  .ge-market-table .ge-item-icon {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  .ge-item strong {
    font-size: 11px;
    line-height: 1.05;
  }

  .ge-item div span {
    font-size: 8px;
    line-height: 1.05;
  }

  .ge-price {
    font-size: 12px;
  }

  .ge-signal {
    min-height: 20px;
    font-size: 9px;
  }

  .ge-market-table button {
    min-height: 22px;
    font-size: 10px;
  }

  .ge-trade-card {
    top: 238px;
    max-height: calc(100% - 248px);
    border-color: rgba(245, 240, 220, .24);
    background: linear-gradient(180deg, rgba(245, 240, 220, .08), rgba(245, 240, 220, .035)), #1b2a22;
  }
}

/* v4 dock expansion: show every card's details without nested scrollbars */
.ge-side {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  align-self: stretch;
}

.ge-side .ge-panel {
  height: auto !important;
  overflow: visible !important;
}

.ge-side .ge-panel.active {
  grid-template-rows: auto !important;
  align-items: start !important;
  height: auto !important;
  overflow: visible !important;
}

.ge-services,
.ge-contracts,
.ge-rivals,
.ge-log {
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0 !important;
  align-content: start;
}

.ge-services {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)) !important;
}

.ge-contracts {
  grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)) !important;
}

.ge-rivals {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
}

.ge-log {
  grid-auto-flow: row !important;
  grid-auto-columns: auto !important;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
}

.ge-service-row p,
.ge-contract-row p,
.ge-active-contract p {
  display: block !important;
}

@media (min-width: 1181px) {
  .ge-side {
    height: auto !important;
  }

  .ge-side .ge-panel.active {
    grid-template-columns: 140px minmax(0, 1fr) !important;
  }

  .ge-service-row {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    align-content: start !important;
    min-height: 72px;
  }

  .ge-service-row p {
    display: block !important;
    min-height: 24px;
    font-size: 10px;
    line-height: 1.22;
  }

  .ge-service-row label,
  .ge-service-buttons {
    grid-column: auto !important;
  }

  .ge-service-row label span {
    display: block !important;
  }

  .ge-service-row input,
  .ge-service-row button,
  .ge-contract-row button,
  .ge-active-contract button {
    min-height: 28px;
  }

  .ge-contract-row,
  .ge-active-contract {
    min-height: 74px;
  }
}

@media (max-width: 1180px) {
  .ge-side .ge-panel.active {
    grid-template-columns: 1fr !important;
  }
}

/* Random event details can include exact outcome lines. */
[data-event-copy] {
  white-space: pre-line;
}

/* New charter cargo controls. */
.ge-modal-card.setup {
  width: min(860px, 100%);
}

.ge-setup-form input:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.ge-service-row strong::first-letter {
  text-transform: uppercase;
}
