/* Game-specific UI on top of the OpenTTD window chrome in ttd-window.css (the prototypes). */
html, body { margin: 0; height: 100%; overflow: hidden; background: #101820; font: 16px/1.3 sans-serif; color: #000; }
#map { display: block; cursor: grab; touch-action: none; }
#chunk-loading-indicators { position: fixed; z-index: 2; inset: 0 0 28px; overflow: hidden; pointer-events: none; }
.chunk-loading-indicator {
  position: absolute;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgb(20 24 28 / 48%);
  border-radius: 50%;
  background: rgb(24 29 34 / 72%);
  color: #fff;
  text-shadow: 1px 1px 2px #111, -1px -1px 2px #111;
  font: 14px/1 "OpenTTD Sans", sans-serif;
}
.chunk-loading-indicator__wheel {
  position: absolute;
  inset: 4px;
  border: 4px solid #42494f;
  border-top-color: #b7bec3;
  border-right-color: #777f85;
  border-radius: 50%;
  animation: chunk-loading-spin 2.8s linear infinite;
}
.chunk-loading-indicator__countdown { position: relative; z-index: 1; min-width: 1.5em; text-align: center; }
@keyframes chunk-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .chunk-loading-indicator__wheel { animation: none; }
}
.crawler-description {
  position: fixed;
  z-index: 1;
  inset: 12px auto auto 12px;
  box-sizing: border-box;
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 16px 20px;
  border: 2px solid #222;
  background: #e7e7e7;
  color: #111;
  box-shadow: 4px 4px 0 #222;
  line-height: 1.45;
}
.crawler-description h1 { margin: 0 0 12px; font-size: 1.35rem; }
.crawler-description h2 { margin: 16px 0 4px; font-size: 1.1rem; }
.crawler-description ul { margin: 0; padding-left: 22px; }
.crawler-description p { margin: 8px 0 0; }

/* ---------- window bodies ------------------------------------------------- */

.ttd-window__body {
  text-shadow: 2px 2px 0 var(--ttd-ink);
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.ttd-window__body .ttd-text-black {
  position: relative;
  top: 1px;
  left: 1px;
}

/* Bevelled panel that holds the window content; contents keep their own padding. */
.ttd-pad { padding: 6px; }
.ttd-window--construction .ttd-pad { padding-bottom: 0; }

.ttd-window__body h4 {
  margin: 6px 0 2px;
  font: inherit;
  line-height: 20px;
  color: var(--ttd-white);
}

.ttd-window__body pre { margin: 0; font: inherit; line-height: 1.5; }
.ttd-window__body input { font: inherit; line-height: 20px; }

.help-window { max-width: calc(100vw - 24px); }
.help-window .ttd-window__body { font-size: 13px; line-height: 1.5; text-shadow: 1px 1px 0 var(--ttd-ink); }
.help-window .ttd-window__body .ttd-pad { display: flex; flex-direction: column; gap: 8px; }
.help-window__welcome, .help-window__video, .help-window__login-note { margin: 0; white-space: normal; }
.help-window__welcome { font-weight: bold; }
.help-window__development-notice { margin: 0; padding: 5px 7px; color: #151515; background: #d4d0c4; border: 1px solid #666; font-weight: bold; white-space: normal; text-shadow: none; }
.help-window__steps { margin: 0; padding-left: 20px; }
.help-window__steps li { padding-left: 2px; }
.help-window__guides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.help-window__guide { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; gap: 6px; min-width: 0; }
.help-window__guide canvas { display: block; }
.help-window__guide strong { display: block; }
.help-window__guide p { margin: 0; white-space: normal; }
.help-window__online-guide { margin: 0; white-space: normal; }
.help-window__online-guide a { color: #151515; text-shadow: none; }
.help-window__video a { color: #151515; text-shadow: none; }
.help-window__login-note { border-top: 1px solid #666; padding-top: 5px; }

.terms-window { max-width: calc(100vw - 24px); }
.terms-window .ttd-window__body {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 8px;
  font-size: 13px;
  line-height: 1.5;
  text-shadow: 1px 1px 0 var(--ttd-ink);
}
.terms-window__text { margin: 0; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }

.transparency-options-window {
  --ttd-company-caption: #536f3f;
  width: 448px;
  min-width: 0;
  background: #617b4b;
}
.transparency-options-window .ttd-titlebtn { background: #617b4b; }
.transparency-options-window .ttd-window__body {
  max-height: none;
  overflow: visible;
  padding: 2px;
  background: #617b4b;
}
.transparency-options__grid { display: flex; width: max-content; gap: 1px; padding: 1px; background: #5b7445; }
.transparency-options__category { display: grid; grid-template-rows: 38px 18px; gap: 1px; min-width: 42px; }
.transparency-options__category-button,
.transparency-options__invisible-button {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0;
  color: #101010;
  background: #718b5b;
  border: 2px solid;
  border-color: #9baa85 #455b38 #455b38 #9baa85;
  cursor: pointer;
}
.transparency-options__category-button canvas { display: block; width: 38px; height: 38px; image-rendering: pixelated; }
.transparency-options__category-button.is-selected,
.transparency-options__invisible-button.is-selected {
  background: #819e6a;
  border-color: #455b38 #9baa85 #9baa85 #455b38;
  box-shadow: inset 1px 1px 0 #536c42;
}
.transparency-options__category-button:disabled,
.transparency-options__invisible-button:disabled { filter: grayscale(1); opacity: .58; cursor: default; }
.transparency-options__category-button:focus-visible,
.transparency-options__invisible-button:focus-visible { outline: 2px dotted #101010; outline-offset: -4px; }
.transparency-options__invisible-spacer { min-width: 0; background: #617b4b; }

.debug-info-window { max-width: calc(100vw - 24px); }
.debug-info-window .ttd-window__body.debug-info-window__body {
  display: flex; min-width: 0; min-height: 0; height: 100%; max-height: none; overflow: hidden;
  padding: 5px; background: #b8b8b8; color: #111; text-shadow: none; font: 10px/1.25 monospace;
}
.debug-info { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; min-width: 0; min-height: 0; width: 100%; }
.debug-info__summary { flex: 0 0 auto; min-width: 0; }
.debug-info__counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px 8px; padding: 3px 5px; background: #d3d3d3; border: 1px solid #777; }
.debug-info__field { display: flex; justify-content: space-between; gap: 4px; min-width: 0; }
.debug-info__label { color: #333; }
.debug-info__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debug-info__database h3, .debug-info__log-area h3 { margin: 4px 0 2px; font: inherit; font-weight: bold; color: #111; text-shadow: none; }
.debug-info__database-status { min-height: 13px; color: #333; }
.debug-info__database-scroll { max-height: 112px; overflow: auto; border: 1px solid #777; background: #c9c9c9; }
.debug-info__table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.debug-info__table th, .debug-info__table td { padding: 1px 4px; border-bottom: 1px solid #aaa; text-align: right; }
.debug-info__sort { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: bold; cursor: pointer; }
.debug-info__sort:hover { text-decoration: underline; }
.debug-info__table th:first-child, .debug-info__table td:first-child { text-align: left; }
.debug-info__table thead { position: sticky; top: 0; background: #a7a7a7; }
.debug-info__empty-row td { color: #444; text-align: left; }
.debug-info__log-area { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.debug-info__log-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.debug-info__log-heading h3 { margin: 4px 0 2px; font: inherit; font-weight: bold; color: #111; }
.debug-info__reset { padding: 1px 6px; border: 1px solid #555; background: #ddd; color: #111; font: inherit; cursor: pointer; }
.debug-info__events { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; padding: 2px 4px; list-style: none; border: 1px solid #777; background: #d3d3d3; }
.debug-info__event { display: grid; grid-template-columns: minmax(0, 1fr) 40px 72px repeat(3, 74px); gap: 5px; padding: 1px 0; border-bottom: 1px solid #bbb; }
.debug-info__event--header { position: sticky; top: 0; background: #a7a7a7; font-weight: bold; }
.debug-info__event > :not(:first-child) { text-align: right; }
.debug-info__duration { color: #333; }
.debug-info__duration--yellow { color: #806000; font-weight: bold; }
.debug-info__duration--orange { color: #bd4d00; font-weight: bold; }
.debug-info__duration--red { color: #b00000; font-weight: bold; }
.debug-info__endpoint { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.debug-info__empty { color: #444; }
.what-is-here-window { max-width: calc(100vw - 24px); }
.what-is-here-window .ttd-window__body.what-is-here-window__body {
  display: flex; min-width: 0; min-height: 0; height: 100%; max-height: none; overflow: hidden;
  padding: 5px; background: #b8b8b8; color: #111; text-shadow: none; font: 11px/1.3 monospace;
}
.what-is-here { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 5px; width: 100%; min-width: 0; min-height: 0; }
.what-is-here__toolbar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.what-is-here__status { flex: 1 1 auto; min-width: 0; color: #333; }
.what-is-here__follow { flex: 0 0 auto; padding: 2px 6px; border: 1px solid #555; background: #ddd; color: #111; font: inherit; }
.what-is-here__follow:disabled { color: #666; }
.what-is-here__content { min-width: 0; min-height: 0; overflow: auto; padding: 4px; background: #d3d3d3; border: 1px solid #777; }
.what-is-here__section { margin-bottom: 6px; padding: 3px 5px; background: #c9c9c9; border: 1px solid #999; }
.what-is-here__section h3, .what-is-here__objects-title { margin: 0 0 3px; font: inherit; font-weight: bold; color: #111; }
.what-is-here__row { display: grid; grid-template-columns: minmax(120px, 42%) minmax(0, 1fr); gap: 7px; padding: 1px 0; border-bottom: 1px solid #bbb; }
.what-is-here__label { color: #333; }
.what-is-here__value {
  display: block; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit;
  font: inherit; font-weight: normal; text-align: left; overflow-wrap: anywhere; cursor: copy;
}
.what-is-here__value:hover { text-decoration: underline; }
.what-is-here__value:focus-visible { outline: 1px dotted #111; outline-offset: 1px; }
.what-is-here__copy-status { flex: 0 0 auto; max-width: 125px; overflow: hidden; color: #333; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.what-is-here__copy-status:empty { display: none; }
.what-is-here__objects-title { margin-top: 6px; }
.what-is-here__object { margin: 3px 0; padding: 3px 5px; border: 1px solid #999; background: #c9c9c9; overflow-wrap: anywhere; }
.what-is-here__object h4 { margin: 0 0 2px; font: inherit; font-weight: bold; }
.what-is-here__empty { color: #444; }
@media (max-width: 580px) {
  .debug-info__counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .debug-info__event { grid-template-columns: minmax(0, 1fr) 30px 52px repeat(3, 50px); gap: 3px; }
  .what-is-here__row { grid-template-columns: minmax(105px, 40%) minmax(0, 1fr); }
}

.game-config-window { max-width: calc(100vw - 24px); }
.game-config-window .ttd-window__body {
  display: flex; min-width: 0; min-height: 0; height: 100%; max-height: none; overflow: hidden;
  padding: 8px; background: #b8b8b8; color: #111; text-shadow: none; font: 12px/1.35 Tahoma, sans-serif;
  container: game-config-pane / inline-size;
}
.game-config { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 7px; width: 100%; min-width: 0; min-height: 0; }
.game-config__notice, .game-config__time, .game-config__warning { padding: 5px 7px; border: 1px solid #777; background: #d3d3d3; }
.game-config__notice { font-weight: bold; }
.game-config__time { color: #333; font-size: 11px; }
.game-config__warning { background: #fff1c7; color: #3d2c00; }
.game-config__warning[hidden] { display: none; }
.game-config__content { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 8px; min-width: 0; min-height: 0; }
.game-config__controls, .game-config__output-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 6px; border: 1px solid #777; background: #c9c9c9; }
.game-config__controls { overflow: auto; }
.game-config__controls h3, .game-config__output-panel h3 { margin: 0 0 5px; font-size: 14px; }
.game-config__section h4 { margin: 7px 0 2px; padding-bottom: 2px; border-bottom: 1px solid #999; font-size: 12px; }
.game-config__table { width: 100%; border: 0; border-collapse: collapse; table-layout: fixed; }
.game-config__table th, .game-config__table td { border: 0; padding: 3px 4px; vertical-align: middle; text-align: left; }
.game-config__table th { width: 150px; font-weight: normal; }
.game-config__bound { width: 54px; color: #444; font-size: 10px; text-align: center !important; }
.game-config__control { min-width: 0; }
.game-config__control input[type="range"] { display: block; width: 100%; min-width: 70px; margin: 1px 0; accent-color: #3b5f35; }
.game-config__proposed, .game-config__active { display: block; color: #333; font-size: 10px; }
.game-config__proposed { font-weight: bold; color: #172f13; }
.game-config__active.is-unsupported { color: #8a1b13; font-weight: bold; }
.game-config__description-row td { padding-top: 0; padding-bottom: 5px; color: #444; font-size: 10px; }
.game-config__choice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.game-config__choice select { min-width: min(230px, 100%); }
.game-config__switch { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; cursor: pointer; }
.game-config__switch input { width: 18px; height: 18px; accent-color: #3b5f35; }
.game-config__output-label { margin-bottom: 3px; font-size: 10px; }
.game-config__output { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 180px; resize: vertical; white-space: pre; overflow: auto; font: 11px/1.4 monospace; }
.game-config__output-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 5px; }
.game-config__message { min-width: 0; color: #24451f; font-size: 11px; }
.game-config__message.is-error { color: #8a1b13; }
.game-config__message:empty { display: none; }
.game-config__output-actions .ttd-btn:disabled { opacity: .6; cursor: default; }
.game-config__table button:focus-visible, .game-config__table input:focus-visible, .game-config__table select:focus-visible,
.game-config__output:focus-visible, .game-config__output-actions button:focus-visible { outline: 2px dotted #101010; outline-offset: 1px; }
@container game-config-pane (max-width: 760px) {
  .game-config__content { grid-template-columns: minmax(0, 1fr); }
  .game-config__controls { max-height: 42vh; }
  .game-config__output { min-height: 220px; }
}
@container game-config-pane (max-width: 480px) {
  .game-config__table th { width: 105px; }
  .game-config__bound { width: 43px; padding-inline: 1px !important; }
  .game-config__control input[type="range"] { min-width: 48px; }
}

.ttd-btn, .ttd-titlebtn { text-shadow: none; }

/* A vertical stack of buttons. */
.ttd-btnrowcol { display: flex; flex-direction: column; gap: 2px; }
.ttd-btnrowcol .ttd-btn { flex: 0 0 auto; width: 100%; }

/* The bevelled panels of the finances window. */
.ttd-fin-ledger { padding: 0 4px 14px; }
.ttd-fin-funds { padding: 0 4px; }
/* Finance sits in a max-content window: fit-content/100% table sizing can feed back into the window's
   intrinsic width in Chromium. Pin its three-period ledger, rent ledger, and funds panel to compact grids. */
.ttd-fin-ledger .ttd-ledger { width: 682px; }
.ttd-fin-ledger .ttd-ledger col.ttd-col-label { width: 190px; }
.ttd-fin-ledger .ttd-ledger col.ttd-col-year { width: 156px; }
.ttd-fin-ledger .ttd-ledger col.ttd-col-gap { width: 12px; }
.ttd-fin-ledger .ttd-ledger th:first-child,
.ttd-fin-ledger .ttd-ledger td:first-child { width: 190px; }
.ttd-fin-rent__table { width: 658px; }
.ttd-fin-rent__table th:first-child,
.ttd-fin-rent__table td:first-child { width: 190px; }
.ttd-fin-funds .ttd-funds { width: 612px; }
.ttd-fin-funds .ttd-funds col.ttd-col-label { width: 164px; }
.ttd-fin-funds .ttd-funds col.ttd-col-value { width: 156px; }
.ttd-fin-funds .ttd-funds col.ttd-col-gap { width: 12px; }
.ttd-fin-funds .ttd-funds col.ttd-col-info { width: 280px; }

/* In-body button bars, styled like the bottom bar of the window. */
.ttd-btnrow { display: flex; flex: 0 0 auto; }
.ttd-btnrow .ttd-btn { flex: 1 1 0; min-width: 0; }

/* A grid of small buttons, e.g. 2x2 metric picker. */
.ttd-btngrid { display: grid; grid: repeat(2, 28px) / repeat(2, 1fr); gap: 2px; }
.ttd-btngrid .ttd-btn { flex: none; }

/* ---------- scrollable lists (towns, stations, vehicles, ...) ------------- */

.ttd-list {
  flex: 0 1 auto;
  max-height: 400px;
  min-height: 24px;
  overflow: auto;
  padding: 2px;
  background: var(--ttd-ink);
  border: 2px solid;
  border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark);
}

.ttd-list .row {
  height: 24px;
  line-height: 20px;
  padding: 0 4px;
  cursor: pointer;
  white-space: nowrap;
}

.ttd-list .row:hover { background: #2f2f2f; }
.ttd-list .row.is-active { background: var(--ttd-gold); color: var(--ttd-ink); text-shadow: none; }

/* OpenTTD-style vehicle directories: a responsive, full-height list of illustrated vehicle cards. */
.vehicle-list-window .ttd-window__body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  padding: 3px;
}
.vehicle-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 2px;
  background: #858585;
  border: 2px solid;
  border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark);
  scrollbar-color: #a8a8a8 #626562;
  scrollbar-width: thin;
}
.vehicle-list__item {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 30px 28px minmax(0, 1fr);
  grid-template-rows: minmax(43px, 1fr) 22px;
  align-items: center;
  gap: 0 4px;
  min-width: 0;
  min-height: 70px;
  padding: 3px 6px 3px 2px;
  color: var(--ttd-ink);
  font: inherit;
  text-align: left;
  text-shadow: none;
  background: #858585;
  border: 0;
  border-bottom: 1px solid #626562;
  cursor: pointer;
}
.vehicle-list__item:hover,
.vehicle-list__item:focus-visible { background: #a0a0a0; }
.vehicle-list__item:focus-visible { outline: 2px dotted var(--ttd-ink); outline-offset: -3px; }
.vehicle-list__number {
  align-self: start;
  grid-row: 1;
  color: #161616;
  font-size: 19px;
  font-weight: bold;
  line-height: 23px;
}
.vehicle-list__profit-icon {
  display: grid;
  grid-row: 1;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  text-shadow: none;
}
.vehicle-list__profit-icon.is-profit { color: #064d08; background: #73cf36; }
.vehicle-list__profit-icon.is-loss { color: #710000; background: #ed3939; }
.vehicle-list__profit-icon.is-neutral { color: #755300; background: #ffd84c; }
.vehicle-list__sprites {
  display: flex;
  grid-column: 3;
  grid-row: 1;
  align-items: center;
  gap: 0;
  min-width: 0;
  min-height: 40px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.vehicle-list__sprites canvas {
  display: block;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  image-rendering: pixelated;
}
.vehicle-list__sprites.is-train canvas {
  flex-basis: 38px;
  width: 38px;
  height: 38px;
}
.vehicle-list__profit {
  grid-column: 2 / -1;
  grid-row: 2;
  min-width: 0;
  overflow: hidden;
  color: #202020;
  font-size: 13px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vehicle-list .ttd-empty { color: #202020; }

.ttd-list .company-directory-row { display: flex; align-items: center; gap: 6px; height: 30px; }
.ttd-list .company-directory-row.is-current { background: #2f2f2f; box-shadow: inset 3px 0 var(--ttd-gold); }
.company-directory-row__presence { flex: 0 0 9px; width: 9px; height: 9px; border: 1px solid #444; border-radius: 50%; }
.company-directory-row__presence.is-online { background: #35ef45; box-shadow: 0 0 3px #23b932; }
.company-directory-row__presence.is-offline { background: #8a8a8a; }
.company-directory-row__color { flex: 0 0 14px; width: 14px; height: 14px; border: 1px solid #ddd; }
.company-directory-row__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.company-directory-row__player-icon { position: relative; display: inline-block; width: 10px; height: 12px; margin: 0 2px; vertical-align: -2px; }
.company-directory-row__player-icon::before { position: absolute; top: 0; left: 3px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; content: ''; }
.company-directory-row__player-icon::after { position: absolute; bottom: 0; left: 1px; width: 8px; height: 7px; border-radius: 4px 4px 1px 1px; background: currentColor; content: ''; }
.company-directory-row .ttd-btn { flex: 0 0 78px; }
.company-directory-row .ttd-btn { height: 28px; padding: 0 4px; }
.company-directory-window .company-directory-row__text { font-size: .8em; }
.company-directory-window .company-directory-row .ttd-btn { flex-basis: 94px; }
.company-directory-window .ttd-window__body { flex: 1 1 0; min-height: 0; overflow: hidden; }
.company-directory { flex: 1 1 0; width: 100%; min-height: 0; max-height: none; }
.company-directory__join { display: flex; flex-direction: column; gap: 4px; min-height: 0; margin-left: 8px; }
.company-directory__join h4 { margin: 2px 0; }
.company-directory__join-search { display: flex; gap: 4px; }
.company-directory__join-search .ttd-input { flex: 1 1 auto; min-width: 0; }
.company-directory__join-search .ttd-btn { flex: 0 0 90px; }
.company-directory__join-search .ttd-btn:last-child { flex-basis: 135px; }
.company-directory__join-results { max-height: 112px; }
.company-directory__join-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; padding: 2px 6px; }
.company-directory__join-row > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.company-directory__join-row .ttd-btn { flex: 0 0 92px; }
.company-directory-window {
  --company-directory-bg: #98845c;
  --ttd-bg: var(--company-directory-bg);
  --company-directory-bevel-light: #d4bc94;
  --company-directory-bevel-dark: #68502c;
  background: var(--company-directory-bg);
  color: var(--ttd-ink);
}
.company-directory-window .ttd-window__caption {
  background: var(--company-directory-bg);
  border-color: var(--company-directory-bevel-light) var(--company-directory-bevel-dark)
                var(--company-directory-bevel-dark) var(--company-directory-bevel-light);
  box-shadow: inset 2px 2px 0 var(--company-directory-bevel-dark),
              inset -2px -2px 0 var(--company-directory-bevel-light);
}
.company-directory-window .ttd-window__body { background: var(--company-directory-bg); color: var(--ttd-ink); text-shadow: none; }
.company-directory-window .ttd-list {
  background: var(--company-directory-bg);
  border-color: var(--company-directory-bevel-dark) var(--company-directory-bevel-light)
                var(--company-directory-bevel-light) var(--company-directory-bevel-dark);
}
.company-directory-window .ttd-list .row:hover { background: #aa966d; }
.company-directory-window .ttd-list .company-directory-row.is-current {
  background: #a38f66;
  box-shadow: inset 3px 0 #68502c;
}
.company-directory-window .company-directory-row .ttd-btn {
  color: var(--ttd-ink);
  background: var(--company-directory-bg);
  border-color: var(--company-directory-bevel-light) var(--company-directory-bevel-dark)
                var(--company-directory-bevel-dark) var(--company-directory-bevel-light);
}
.company-directory-window .company-directory-row .ttd-btn:hover:not(:disabled) { background: #aa966d; }
.company-directory-window .company-directory-row .ttd-btn:disabled { color: #5d513b; }
.company-directory-window .company-directory__join-row .ttd-btn {
  color: var(--ttd-ink);
  background: var(--company-directory-bg);
  border-color: var(--company-directory-bevel-light) var(--company-directory-bevel-dark)
                var(--company-directory-bevel-dark) var(--company-directory-bevel-light);
}
.company-directory-window .company-directory__join-row .ttd-btn:hover:not(:disabled) { background: #aa966d; }

.game-log-window.ttd-window--pinned .ttd-window__titlebar { cursor: default; }
.game-log-window .ttd-window__body { flex: 1 1 auto; min-height: 0; max-height: none; overflow: hidden; background: #424242; }
.game-log-list { flex: 1 1 auto; width: 100%; min-height: 0; max-height: none; font-size: 13px; background: #424242; }
.game-log-entry {
  min-height: 18px;
  padding: 2px 4px;
  line-height: 14px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.game-log-entry + .game-log-entry { border-top: 1px solid #343434; }
.game-log-entry--success { color: var(--ttd-white); }
.game-log-entry--warning { color: var(--ttd-gold); }
.game-log-entry--error { color: #ff7777; }
.game-log-entry.is-clickable { cursor: pointer; }
.game-log-entry.is-clickable:hover,
.game-log-entry.is-clickable:focus-visible { background: #2f2f2f; outline: none; }

.player-notes-window .ttd-window__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 5px;
  padding: 6px;
  color: #111;
  background: #b8b8b8;
  text-shadow: none;
}
.player-notes__editor {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  padding: 6px;
  resize: vertical;
  color: #111;
  font: 12px/1.35 monospace;
  background: #f6f6f6;
  border: 2px solid;
  border-color: #555 #eee #eee #555;
}
.player-notes__editor:disabled { color: #666; background: #ddd; }
.player-notes__footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 8px; color: #222; font-size: 12px; }
.player-notes__count { font-variant-numeric: tabular-nums; }
.player-notes__save { flex: 0 0 82px; height: 28px; }
.player-notes__status { flex: 0 0 auto; min-height: 16px; color: #333; font-size: 11px; overflow-wrap: anywhere; }

.game-chat-window { min-width: 320px; }
.game-chat-window .ttd-window__body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  gap: 4px;
  padding: 4px;
  overflow: hidden;
  background: #424242;
  text-shadow: none;
}
.game-chat-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow: auto;
  color: var(--ttd-white);
  font-size: 13px;
  background: #424242;
  scrollbar-color: #a8a8a8 #626562;
  scrollbar-width: thin;
}
.game-chat-entry {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 3px 4px;
  color: var(--ttd-white);
  line-height: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.game-chat-entry + .game-chat-entry { border-top: 1px solid #343434; }
.game-chat-entry__time { margin-right: 7px; color: #c9c9c9; font-size: 11px; }
.game-chat-entry__sender { color: #fff; }
.chat-message__mention { color: #ffd34e; font-weight: bold; }
.game-chat-composer { display: flex; flex: 0 0 auto; gap: 4px; min-width: 0; }
.game-chat-composer .game-chat-input { flex: 1 1 auto; height: 28px; min-width: 0; border-right: 2px solid; }
.game-chat-composer .game-chat-send { flex: 0 0 82px; height: 28px; }
.game-chat-composer .ttd-input:disabled { color: #969696; }

/* Hint text, e.g. "Your company is being set up…". */
.ttd-empty { padding: 4px; color: var(--ttd-white); }

/* Station details use OpenTTD's wide, compact grey station-management layout. */
.station-window { --ttd-bg: #858585; background: #858585; color: var(--ttd-ink); }
.station-window .ttd-window__body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  background: #858585;
  color: var(--ttd-ink);
  text-shadow: none;
}
.station-window__content { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.station-window__filters { flex: 0 0 56px; }
.station-window__filter-row { display: grid; grid-template-columns: 43% 57%; height: 28px; }
.station-window__filter-button {
  position: relative;
  width: 100%;
  height: 28px;
  flex: 0 0 auto;
  justify-content: center;
  padding: 0 22px 2px 6px;
  color: var(--ttd-ink);
  text-shadow: none;
  font-weight: bold;
}
.station-window__filter-button::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 5px;
  width: 0;
  height: 0;
  border: 7px solid transparent;
  border-top-color: var(--ttd-ink);
  transform: translateY(3px);
}
.station-window__filter-button--value { justify-content: flex-start; }
.station-window__waiting {
  display: flex;
  flex: 1 1 auto;
  min-height: 80px;
  overflow: hidden;
  background: #858585;
  border-top: 2px solid var(--ttd-bevel-dark);
  border-bottom: 2px solid var(--ttd-bevel-light);
}
.station-window__waiting-rows { flex: 1 1 auto; min-width: 0; overflow: auto; padding: 1px 2px; }
.station-window__waiting .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 24px;
  padding: 0 2px;
  color: var(--ttd-white);
  line-height: 20px;
  text-shadow: 2px 2px 0 var(--ttd-ink);
  white-space: nowrap;
}
.station-window__cargo-icons { display: flex; flex: 0 0 auto; gap: 1px; margin-right: 10px; }
.station-window__cargo-sprite { display: block; width: 12px; height: 18px; }
.station-window__cargo-icons--passengers .station-window__cargo-sprite {
  background:
    linear-gradient(#39271f 0 0) 4px 0 / 4px 3px,
    linear-gradient(#e3b68e 0 0) 4px 3px / 4px 3px,
    linear-gradient(var(--station-passenger-shirt, #42739c) 0 0) 2px 6px / 8px 7px,
    linear-gradient(#242424 0 0) 3px 13px / 3px 5px,
    linear-gradient(#242424 0 0) 7px 13px / 3px 5px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.station-window__cargo-icons--passengers .station-window__cargo-sprite:nth-child(4n + 2) { --station-passenger-shirt: #b83b32; }
.station-window__cargo-icons--passengers .station-window__cargo-sprite:nth-child(4n + 3) { --station-passenger-shirt: #d1b43b; }
.station-window__cargo-icons--passengers .station-window__cargo-sprite:nth-child(4n) { --station-passenger-shirt: #637c46; }
.station-window__scrollbar { display: flex; flex: 0 0 26px; flex-direction: column; border-left: 2px solid var(--ttd-bevel-light); }
.station-window__scroll-button { width: 24px; height: 24px; flex: 0 0 24px; padding: 0; font-size: 14px; }
.station-window__scroll-track { flex: 1 1 auto; min-height: 0; border: 2px solid; border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light); }
.station-window__accepts {
  flex: 0 0 62px;
  overflow: auto;
  padding: 2px 4px;
  color: var(--ttd-ink);
  font-weight: bold;
  line-height: 20px;
  text-shadow: none;
}
.station-window__accepts[hidden] { display: none; }
.station-window__ratings-heading { margin-bottom: 2px; }
.station-window__rating-row { display: flex; justify-content: space-between; gap: 12px; padding-left: 20px; }
.station-window .ttd-window__buttons { height: 28px; }
.station-window .ttd-window__buttons .ttd-btn.station-window__mode { flex: 0 0 36px; width: 36px; padding: 0; }
.station-window__mode canvas { width: 22px; height: 22px; image-rendering: pixelated; }

/* ---------- construction tool grids --------------------------------------- */

/* OpenTTD's construction windows use the olive-green build palette; ordinary dialogs and the main toolbar keep the grey chrome. */
.ttd-window--construction {
  --ttd-build-bg: #687c4c;
  --ttd-bg: var(--ttd-build-bg);
  --ttd-build-light: #98af6c;
  --ttd-build-dark: #39542d;
  --ttd-build-hover: #7b8f5a;
  --ttd-build-active: #50643c;
  background: var(--ttd-build-bg);
}
.ttd-window--construction .ttd-window__body { background: var(--ttd-build-bg); }
.ttd-window--construction .ttd-window__caption {
  background: var(--ttd-build-bg);
  border-color: var(--ttd-build-light) var(--ttd-build-dark)
                var(--ttd-build-dark) var(--ttd-build-light);
  box-shadow: inset 2px 2px 0 var(--ttd-build-dark),
              inset -2px -2px 0 var(--ttd-build-light);
}

.ttd-tools { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 2px; width: 372px; }
.ttd-tools .ttd-btn { height: 42px; flex: none; padding: 2px; }
.ttd-tools .ttd-btn.is-active { background: #fcfcfc; }
.ttd-tools canvas { image-rendering: pixelated; }
.ttd-tools canvas.is-flipped-x { transform: scaleX(-1); }
.ttd-tools .ttd-btn.is-pending { filter: grayscale(1); opacity: .55; cursor: not-allowed; }
.ttd-window--construction .ttd-tools:not(.ttd-tools--orient) .ttd-btn {
  background: var(--ttd-build-bg);
  border-color: var(--ttd-build-light) var(--ttd-build-dark)
                var(--ttd-build-dark) var(--ttd-build-light);
}
.ttd-window--construction .ttd-tools:not(.ttd-tools--orient) .ttd-btn:hover { background: var(--ttd-build-hover); }
.ttd-window--construction .ttd-tools:not(.ttd-tools--orient) .ttd-btn:active,
.ttd-window--construction .ttd-tools:not(.ttd-tools--orient) .ttd-btn.is-active {
  background: var(--ttd-build-active);
  border-color: var(--ttd-build-dark) var(--ttd-build-light)
                var(--ttd-build-light) var(--ttd-build-dark);
}

/* Road-stop directions keep the bay compass pair at left and through X/Y at right; depots use 2x2. */
.ttd-tools--orient { width: max-content; grid-template-columns: repeat(3, 82px); grid-auto-rows: 84px; }
.ttd-tools--orient.ttd-tools--orient--depot { grid-template-columns: repeat(2, 82px); }
.ttd-tools--orient.ttd-tools--orient--road-stop { grid-template-columns: repeat(2, 112px) 12px 112px; }
.ttd-tools--orient--road-stop .ttd-btn:nth-child(1) { grid-column: 1; grid-row: 1; }
.ttd-tools--orient--road-stop .ttd-btn:nth-child(2) { grid-column: 2; grid-row: 1; }
.ttd-tools--orient--road-stop .ttd-btn:nth-child(3) { grid-column: 1; grid-row: 2; }
.ttd-tools--orient--road-stop .ttd-btn:nth-child(4) { grid-column: 2; grid-row: 2; }
.ttd-tools--orient--road-stop .ttd-btn:nth-child(5) { grid-column: 4; grid-row: 1; }
.ttd-tools--orient--road-stop .ttd-btn:nth-child(6) { grid-column: 4; grid-row: 2; }
.ttd-tools--orient .ttd-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  width: 82px;
  height: 84px;
  padding: 0;
}
.ttd-tools--orient canvas { display: block; width: 100%; height: 100%; }
.ttd-tools--rail { grid-template-columns: repeat(18, 38px); width: 718px; }
.ttd-tools--rail .ttd-btn { width: 38px; }
.ttd-tools--orient--road-stop .ttd-btn {
  width: 112px;
}


/* ---------- charts and minimaps -------------------------------------------- */

.ttd-window canvas.chart, .ttd-window canvas.minimap {
  display: block;
  background: #000;
  border: 2px solid;
  border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark);
}
.company-graphs-window .ttd-window__body { overflow: auto; }
.company-graphs { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px; }
.company-graphs__canvas { flex: 0 0 auto; }
.company-graphs__metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; width: 964px; }
.company-graphs__legend {
  display: flex; flex: 0 1 auto; flex-wrap: wrap; align-content: flex-start; gap: 2px 12px;
  width: 964px; max-height: 160px; min-height: 24px; overflow: auto; padding: 4px;
  color: var(--ttd-white); background: #101010; border: 2px solid;
  border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark);
}
.company-graphs__legend-item { display: flex; flex: 0 0 220px; align-items: center; gap: 6px; min-width: 0; height: 22px; overflow: hidden; white-space: nowrap; }
.company-graphs__legend-item > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.company-graphs__swatch { flex: 0 0 14px; width: 14px; height: 6px; border: 1px solid #ddd; }
.company-graphs__status { min-height: 20px; color: var(--ttd-white); }
.extra-viewport { width: 480px; height: 300px; border: 2px solid; border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark); }
.extra-viewport__canvas { display: block; width: 100%; height: 100%; cursor: grab; }

/* ---------- ledger values (generic fall-back text colours) ----------------- */

.neg { color: var(--ttd-red); }
.pos { color: var(--ttd-gold); }

/* ---------- main toolbar ---------------------------------------------------- */

#toolbar {
  position: fixed; top: 0; left: 0; right: 0; width: auto; max-width: 100vw; min-height: 48px; z-index: 100000;
  box-sizing: border-box; display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 0; padding: 0 2px;
  background: var(--ttd-bg);
  user-select: none;
}
#toolbar .group { display: flex; flex: 0 0 auto; gap: 2px; }
#toolbar .group + .group { flex: 0 0 auto; border-left: 2px solid #303030; padding-left: 4px; margin-left: 3px; }
/* The actions remain configured and wired; remove this rule to restore the toolbar zoom buttons. */
#toolbar .toolbar-zoom-group { display: none; }
#toolbar button {
  box-sizing: border-box; flex: 0 0 48px; width: 48px; height: 48px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ttd-ink);
  background: var(--ttd-bg);
  border: 2px solid;
  border-color: var(--ttd-bevel-light) var(--ttd-bevel-dark) var(--ttd-bevel-dark) var(--ttd-bevel-light);
  cursor: pointer;
}
#toolbar button.toolbar-toggle { font: bold 22px/1 sans-serif; }
#toolbar button[hidden] { display: none; }
#toolbar.is-collapsed .group { display: none; }
#toolbar button:hover { background: #8b8d8b; }
#toolbar button:active, #toolbar button.active {
  background: #777977;
  border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark);
}
#toolbar button.menu-trigger { position: relative; }
#toolbar button.menu-trigger::after {
  position: absolute; right: 2px; bottom: 2px; width: 0; height: 0;
  border: 4px solid transparent; border-bottom: 0; border-top-color: #101010;
  content: '';
}
#toolbar button.menu-open { background: #777977; border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark); }
#toolbar canvas { image-rendering: pixelated; }
.toolbar-menu {
  position: fixed; top: 46px; z-index: 300000;
  display: flex; flex-direction: column; min-width: 196px; max-width: calc(100vw - 8px);
  max-height: calc(100vh - 50px); overflow-y: auto; padding: 2px;
  color: #101010; background: #c0c0c0; border: 2px solid #303030;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .55);
  font: 20px/20px "OpenTTD Sans", Tahoma, sans-serif; text-shadow: none;
}
.toolbar-menu__item {
  box-sizing: border-box; display: block; flex: 0 0 20px; width: 100%; min-width: 0; height: 20px; padding: 0 4px;
  overflow: hidden; color: #101010; background: transparent; border: 0;
  font: inherit; line-height: 20px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.toolbar-menu__item:hover, .toolbar-menu__item:focus-visible { color: #fff; background: #000; outline: none; }
.toolbar-menu__item:disabled, .toolbar-menu__item:disabled:hover, .toolbar-menu__item:disabled:focus-visible {
  color: #707070; background: transparent; cursor: not-allowed; outline: none;
}
#status {
  color: var(--ttd-white); font: 16px "OpenTTD Sans", Tahoma, sans-serif; line-height: 20px;
  text-shadow: 2px 2px 0 var(--ttd-ink);
  flex: 1 1 0; min-width: 0; padding: 0 6px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%;
}
@media (max-width: 1000px) { #status { flex-basis: auto; max-width: calc(100vw - 300px); } }
@media (max-width: 650px) { #status { max-width: calc(100vw - 240px); padding-inline: 3px; } }

.server-update-notice, .server-update-reminder {
  position: fixed; z-index: 100001; color: #101010; background: #d4d0c4; border: 2px solid #303030;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .4); font: 14px/1.3 "OpenTTD Sans", Tahoma, sans-serif; text-shadow: none;
}
.server-update-notice {
  top: 54px; right: 8px; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 16px); padding: 6px;
}
.server-update-reminder { top: 54px; right: 8px; padding: 6px 10px; cursor: pointer; }
.server-update-notice[hidden], .server-update-reminder[hidden] { display: none; }
.server-update-notice button {
  flex: 0 0 auto; padding: 3px 6px; color: #101010; background: #c0c0c0; border: 1px solid #444; font: inherit; cursor: pointer;
}
.server-update-notice button:hover, .server-update-reminder:hover { background: #eee; }

#game-statusbar {
  position: fixed; right: 0; bottom: 0; left: 0; z-index: 200000;
  display: grid; grid-template-columns: minmax(190px, 20%) minmax(0, 1fr) minmax(160px, 20%);
  box-sizing: border-box; height: 28px; color: var(--ttd-white); background: var(--ttd-bg);
  border: 2px solid; border-color: var(--ttd-bevel-light) var(--ttd-bevel-dark) var(--ttd-bevel-dark) var(--ttd-bevel-light);
  font: 20px/20px "OpenTTD Sans", Tahoma, sans-serif; text-shadow: 2px 2px 0 var(--ttd-ink);
  user-select: none;
}
.game-statusbar__clock, .game-statusbar__funds {
  display: flex; align-items: center; min-width: 0; padding: 0 8px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-statusbar__funds { justify-content: flex-end; border-left: 2px solid #303030; }
.game-statusbar__ticker {
  display: block; min-width: 0; padding: 0 6px 2px; overflow: hidden; color: #c7e7ff;
  font: inherit; text-align: left; text-shadow: 2px 2px 0 #17202a;
  background: transparent; border: 0; border-left: 2px solid var(--ttd-bevel-dark); cursor: pointer;
}
.game-statusbar__ticker:hover { background: #777977; }
.game-statusbar__ticker-clip { display: block; width: 100%; white-space: nowrap; }
.game-statusbar__ticker-text { display: inline-block; min-width: 100%; white-space: nowrap; }
.game-statusbar__ticker-text.is-moving { animation: game-news-scroll 22s linear 1 forwards; }
.game-statusbar__ticker-text.is-moving.is-exiting {
  animation-name: game-news-scroll, game-news-exit;
  animation-duration: 22s, 500ms;
  animation-timing-function: linear, ease-in;
  animation-iteration-count: 1, 1;
  animation-fill-mode: forwards, forwards;
  animation-play-state: paused, running;
}
.game-statusbar__ticker:hover .game-statusbar__ticker-text:not(.is-exiting) { animation-play-state: paused; }
@keyframes game-news-scroll { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
@keyframes game-news-exit {
  from { opacity: 1; translate: 0 0; color: #c7e7ff; text-shadow: 2px 2px 0 #17202a; }
  to { opacity: 0; translate: 0 -100%; color: var(--ttd-bg); text-shadow: 2px 2px 0 var(--ttd-bg); }
}

.game-news-window .ttd-window__body { background: #999; color: #111; }
.game-news-window .game-news-list { max-height: 480px; background: #bdbdbd; }
.game-news-window .game-news-row {
  display: block; width: 100%; height: auto; min-height: 24px; padding: 3px 4px; color: #111;
  font: inherit; line-height: 1.2; text-align: left; text-shadow: none; white-space: normal;
  background: transparent; border: 0;
}
.game-news-window .game-news-row:not(.is-linked) { cursor: default; }
.game-news-window .game-news-row.is-linked { cursor: pointer; }
.game-news-window .game-news-row.is-linked:hover,
.game-news-window .game-news-row.is-linked:focus-visible { background: #e4e4e4; }
.game-news-window .game-news-row:focus-visible { outline: 2px dotted #111; outline-offset: -2px; }

.game-news-popup {
  position: fixed; z-index: 200001; left: 50%; bottom: 36px;
  display: flex; flex-direction: column; width: min(840px, calc(100vw - 32px)); min-height: min(300px, calc(100vh - 56px)); max-height: calc(100vh - 56px);
  overflow: hidden; color: #101010; background: #aaa; border: 2px solid #111; box-shadow: 2px 2px 0 #111;
  opacity: 0; transform: translate(-50%, calc(100% + 24px)); transition: transform 280ms ease-out, opacity 180ms linear;
  pointer-events: none;
}
.game-news-popup[hidden] { display: none; }
.game-news-popup.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.game-news-popup__header {
  position: relative; display: flex; flex: 0 0 auto; min-height: 92px; align-items: center; justify-content: center;
  padding: 24px 42px 12px; background: #f7f7f7; border-bottom: 2px solid #777;
}
.game-news-popup__headline {
  margin: 0; font: bold clamp(26px, 4vw, 42px)/1.05 Georgia, "Times New Roman", serif; text-align: center;
}
.game-news-popup__close {
  position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; padding: 0;
  color: #111; font: bold 24px/20px sans-serif; background: #ddd; border: 1px solid #555; cursor: pointer;
}
.game-news-popup__date { position: absolute; top: 5px; right: 8px; font: 14px "OpenTTD Sans", Tahoma, sans-serif; }
.game-news-popup__illustration { display: grid; flex: 0 0 132px; place-items: center; background: #999; border-bottom: 2px solid #777; }
.game-news-popup__illustration canvas { image-rendering: pixelated; }
.game-news-popup__body { display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; justify-content: center; min-height: 72px; padding: 16px 24px; overflow: auto; text-align: center; font: 20px/1.2 "OpenTTD Sans", Tahoma, sans-serif; }
.game-news-popup__body p { margin: 0; }
.game-news-popup__location { margin-top: 10px; padding: 2px 10px; color: #111; font: inherit; background: #c5c5c5; border: 2px solid; border-color: #eee #555 #555 #eee; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .game-statusbar__ticker-text.is-moving { animation: none; }
  .game-news-popup { transition: none; }
}

@media (max-width: 520px) {
  #game-statusbar { grid-template-columns: minmax(120px, 28%) minmax(0, 1fr) minmax(90px, 24%); font-size: 14px; }
  .game-statusbar__clock, .game-statusbar__funds { padding-right: 4px; padding-left: 4px; }
  .game-news-popup__header { min-height: 72px; padding-right: 34px; padding-left: 34px; }
  .game-news-popup__body { padding: 12px; font-size: 16px; }
  .game-news-popup__illustration { flex-basis: 96px; }
}

.player-options__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.player-option { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.player-option__input {
  box-sizing: border-box; width: 100%; min-width: 0; height: 24px; padding: 0 4px;
  color: var(--ttd-input); font: inherit; line-height: 20px; background: var(--ttd-ink);
  border: 2px solid; border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark);
}
.player-option__value { text-align: right; font-size: 14px; line-height: 16px; }
.player-options__note { margin-top: 6px; font-size: 14px; line-height: 16px; }
.player-options__message { min-height: 20px; font-size: 14px; }
.auth-login-feedback, .auth-registration-feedback { box-sizing: border-box; min-height: 20px; margin: 8px 2px 12px; color: #c00000; font-size: 14px; font-weight: 600; line-height: 18px; }
.ttd-pad > .ttd-input { box-sizing: border-box; width: 100%; margin: 3px 0; border-right: 2px solid var(--ttd-bevel-light); }
.auth-terms { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0; padding: 2px 4px; border-radius: 3px; outline: 2px solid transparent; outline-offset: 2px; font-size: 14px; line-height: 16px; }
.auth-terms input { flex: 0 0 auto; margin: 2px 0 0; }
.auth-terms--attention { animation: auth-terms-blink 240ms ease-in-out 4; }
@keyframes auth-terms-blink {
  0%, 100% { background-color: transparent; outline-color: transparent; }
  50% { background-color: #ffe2e2; outline-color: #c00000; }
}
.auth-google-button { position: relative; display: flex; justify-content: center; min-height: 42px; margin: 6px 0; }
.auth-discord-button, .auth-mojeid-button { min-width: 220px; }
.auth-google-terms-gate {
  position: absolute; z-index: 2; top: 0; left: 50%; width: 280px; max-width: 100%; height: 42px; padding: 0;
  transform: translateX(-50%); border: 0; background: transparent; opacity: 0; cursor: pointer;
}
.auth-google-terms-gate:focus-visible { opacity: 1; color: #111; background: #fff; outline: 2px solid #c00000; font: inherit; }
@media (prefers-reduced-motion: reduce) {
  .auth-terms--attention { animation: none; background-color: #ffe2e2; outline-color: #c00000; }
}

.industry-window {
  --ttd-bg: #c98564;
  color: #160f0b; background: #c98564; font: 16px/18px "OpenTTD Sans", sans-serif; text-shadow: none;
}
.industry-window .ttd-window__body { background: var(--ttd-bg); text-shadow: none; }
.industry-window__preview {
  box-sizing: border-box; height: 176px; margin: 3px; overflow: hidden;
  border: 4px ridge #e3a27e; background: #243a25;
}
.industry-window__map { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.industry-window__details { padding: 0 4px 5px; }
.industry-window__section-title { margin-top: 2px; font-weight: bold; }
.industry-window__cargo-list { display: flex; flex-direction: column; }
.industry-window__cargo { display: flex; align-items: center; gap: 6px; min-height: 20px; color: #ffe46a; font-weight: bold; text-shadow: 1px 1px #332019; }
.industry-window__cargo-mark { width: 12px; height: 12px; flex: 0 0 12px; background: var(--industry-cargo-color); border: 1px solid #44352d; }
.industry-window__production-title { margin-top: 10px; }
.industry-window__production { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.industry-window__production > span { color: #ffe46a; font-weight: bold; text-shadow: 1px 1px #332019; }
.industry-window__empty, .industry-window__error { padding: 3px 0; }
.industry-window__error { color: #651717; }

@media (max-width: 520px) {
  .player-options__grid { grid-template-columns: 1fr; }
}

.route-manager { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.route-manager h4, .route-manager h5 { margin: 4px 0 0; }
.route-manager__form { display: grid; grid-template-columns: minmax(100px, 1.5fr) minmax(66px, .6fr) minmax(100px, 1fr) minmax(100px, 1fr) auto; align-items: end; gap: 5px; }
.route-manager__form label { display: flex; flex-direction: column; gap: 2px; }
.route-manager__list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; }
.route-manager__route { display: flex; flex-direction: column; gap: 4px; padding: 5px; border-top: 1px solid var(--ttd-bevel-dark); }
.route-manager__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.route-manager__title strong { color: var(--ttd-highlight); }
.route-manager__stops { color: var(--ttd-light); }
.route-manager__status { padding: 2px 4px; color: #aaffaa; background: #173817; }
.route-manager__status--waiting_for_lease { color: #ffe28a; background: #493600; }
.route-manager__status--waiting_for_alternative, .route-manager__status--unreachable { color: #ffaaaa; background: #481515; }
.route-manager__access, .route-manager__vehicle, .route-manager__rental { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; padding: 3px 0; }
.route-manager__choice { color: var(--ttd-highlight); }
.route-manager__actions, .route-manager__assign { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.route-manager__assign .ttd-input { flex: 1 1 180px; }
.route-manager__message { min-height: 18px; color: #ffaaaa; }

.route-list-window .ttd-window__body { display: flex; flex-direction: column; gap: 4px; background: #858585; color: #101010; text-shadow: none; }
.route-list__header { display: flex; align-items: center; gap: 8px; padding: 3px 4px; }
.route-list__list { flex: 1 1 auto; min-height: 0; max-height: none; }
.route-list__row { width: 100%; text-align: left; font-size: 50%; }
.route-list__row.is-selected { background: #666; outline: 2px solid #fff; outline-offset: -2px; }
.route-list__meta { flex: 0 0 auto; color: #eee; font-size: 90%; }
.route-list__status { min-height: 18px; color: #651717; }
.route-list__footer { flex: 0 0 auto; padding-top: 3px; border-top: 2px solid var(--ttd-bevel-dark); }
.route-list__assign { width: 100%; }
.route-editor { display: flex; flex-direction: column; gap: 5px; min-height: 0; font-size: 13px; }
.route-editor h4 { margin: 3px 0; }
.route-editor__name { display: flex; align-items: center; gap: 8px; }
.route-editor__name span { flex: 0 0 auto; }
.route-editor__name input { flex: 1 1 auto; min-width: 0; }
.route-editor__summary { color: var(--ttd-highlight); }
.route-editor__stops { max-height: 148px; overflow: auto; }
.route-editor__stop, .route-editor__candidate { display: flex; align-items: center; gap: 4px; min-height: 25px; padding: 1px 3px; }
.route-editor__stop-number { flex: 0 0 24px; text-align: right; }
.route-editor__stop-name, .route-editor__candidate-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-editor__candidates { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-height: 0; }
.route-editor__section { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.route-editor__candidate-list { flex: 1 1 auto; min-height: 80px; max-height: 190px; overflow: auto; }
.route-editor__candidate-source { flex: 0 0 auto; color: #eee; font-size: 85%; }
.route-editor__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-top: 3px; border-top: 2px solid var(--ttd-bevel-dark); }
.route-editor__status { min-height: 18px; color: #651717; }

@media (max-width: 650px) {
  .route-manager__form { grid-template-columns: 1fr 1fr; }
  .route-manager__form > button { grid-column: 1 / -1; }
  .route-editor__candidates { grid-template-columns: 1fr; }
}

/* Directory/map windows use compact, beveled OpenTTD lists rather than the generic black inset panel. */
.open-ttd-directory-window, .subsidy-directory-window {
  --directory-bg: #98845c;
  --ttd-bg: var(--directory-bg);
  --directory-light: #d4bc94;
  --directory-dark: #68502c;
  color: #101010;
  background: var(--directory-bg);
}
.open-ttd-directory-window .ttd-window__body, .subsidy-directory-window .ttd-window__body {
  background: var(--directory-bg);
  color: #101010;
  text-shadow: none;
}
.open-ttd-directory-window .ttd-window__caption, .subsidy-directory-window .ttd-window__caption {
  background: var(--directory-bg);
  border-color: var(--directory-light) var(--directory-dark) var(--directory-dark) var(--directory-light);
  box-shadow: inset 2px 2px 0 var(--directory-dark), inset -2px -2px 0 var(--directory-light);
}
.open-ttd-directory-window .ttd-list, .subsidy-directory-window .ttd-list {
  background: var(--directory-bg);
  border-color: var(--directory-dark) var(--directory-light) var(--directory-light) var(--directory-dark);
}
.open-ttd-directory__sortbar, .station-directory__filterbar, .station-directory__modebar,
.world-map__controls { display: flex; align-items: center; gap: 3px; padding: 2px; }
.open-ttd-directory__sortbar { justify-content: flex-end; }
.open-ttd-directory__sort, .station-directory__filter {
  box-sizing: border-box; min-width: 0; height: 24px; padding: 0 4px;
  color: var(--ttd-ink); background: var(--ttd-bg); border: 2px solid;
  border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark);
  font: inherit;
}
.directory-range {
  border-color: var(--ttd-bevel-light) var(--ttd-bevel-dark) var(--ttd-bevel-dark) var(--ttd-bevel-light);
}
.industry-directory__filterbar {
  position: relative; z-index: 2; display: grid; flex: 0 0 auto; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 2px;
  border-top: 2px solid var(--ttd-bevel-light); border-bottom: 2px solid var(--ttd-bevel-dark);
}
.industry-directory__active-toggle {
  box-sizing: border-box; width: 100%; min-width: 0; height: 25px; overflow: hidden; padding: 0 5px;
  color: var(--ttd-ink); background: var(--ttd-bg); border: 2px solid;
  border-color: var(--ttd-bevel-light) var(--ttd-bevel-dark) var(--ttd-bevel-dark) var(--ttd-bevel-light);
  font: inherit; text-overflow: ellipsis; white-space: nowrap;
}
.industry-directory__filter { position: relative; min-width: 0; }
.industry-directory__filter:focus-within { z-index: 3; }
.industry-directory__filter-button {
  box-sizing: border-box; width: 100%; height: 25px; overflow: hidden; padding: 0 5px;
  color: var(--ttd-ink); background: var(--ttd-bg); border: 2px solid;
  border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark);
  font: inherit; text-align: left; text-overflow: ellipsis; white-space: nowrap;
}
.industry-directory__filter-menu {
  position: absolute; z-index: 30; top: calc(100% + 1px); left: 0; min-width: 100%; width: max-content;
  max-width: min(320px, calc(100vw - 32px)); max-height: min(320px, 50vh); overflow: auto; padding: 2px;
  color: var(--ttd-ink); background: var(--ttd-bg); border: 2px solid;
  border-color: var(--ttd-bevel-light) var(--ttd-bevel-dark) var(--ttd-bevel-dark) var(--ttd-bevel-light);
  box-shadow: 2px 2px 0 #302516;
}
.industry-directory__filter--type .industry-directory__filter-menu { right: 0; left: auto; }
.industry-directory__filter-option {
  display: grid; grid-template-columns: 18px 20px minmax(100px, 1fr); align-items: center; gap: 4px;
  min-height: 25px; padding: 1px 4px; white-space: nowrap; cursor: pointer;
}
.industry-directory__filter-option:hover { color: #fff; background: #6d5b3d; }
.industry-directory__filter-option input { width: 14px; height: 14px; margin: 0; accent-color: #604923; }
.industry-directory__filter-option canvas { width: 20px; height: 20px; image-rendering: pixelated; }
.industry-directory-window .ttd-window__body { flex: 1 1 auto; overflow: hidden; }
.industry-directory__sortbar { flex: 0 0 auto; justify-content: flex-start; }
.industry-directory__sort-direction { flex: 0 0 132px; width: 132px; }
.town-directory__list, .station-directory__list { width: 100%; max-height: min(420px, 55vh); }
.open-ttd-directory-window .town-directory__list .row,
.station-directory-window .station-directory__list .row {
  display: flex; align-items: center; gap: 5px; height: 22px; line-height: 20px; padding: 0 3px;
  white-space: nowrap; cursor: pointer;
}
.open-ttd-directory-window .town-directory__list .row { color: #ffbd43; text-shadow: 1px 1px #332819; }
.open-ttd-directory-window .town-directory__list .row:hover { background: #aa966d; }
.open-ttd-directory-window .industry-directory__list .industry-directory__row {
  box-sizing: border-box; height: auto; min-height: 22px; gap: 10px; padding: 1px 3px;
}
.open-ttd-directory-window .industry-directory__list { position: relative; z-index: 1; flex: 1 1 auto; max-height: none; min-height: 0; }
.industry-directory__production { flex: 0 1 auto; max-width: 72%; overflow: hidden; color: #f3e6aa; text-shadow: 1px 1px #332819; text-overflow: ellipsis; }
.town-directory__name, .station-directory__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.town-directory__population { flex: 0 0 auto; font-weight: bold; }
.town-directory__footer, .station-directory__footer {
  min-height: 22px; padding: 1px 4px; border-top: 2px solid var(--ttd-bevel-dark); font-weight: bold;
}
.station-directory-window { --ttd-bg: #858585; color: #101010; background: #858585; }
.station-directory-window .ttd-window__body { background: #858585; text-shadow: none; }
.station-directory-window .station-directory__list { background: #858585; }
.station-directory-window .station-directory__list .row { color: #fff7a8; text-shadow: 1px 1px #333; }
.station-directory-window .station-directory__list .row:hover { background: #777; }
.route-list-window .station-directory__list .route-list__row { color: #101010; text-shadow: none; }
.route-list-window .station-directory__list .route-list__row:hover { color: #101010; background: #777; text-shadow: none; }
.route-list-window .station-directory__list .route-list__row.is-selected,
.route-list-window .station-directory__list .route-list__row.is-selected:hover { color: #fff; background: #666; text-shadow: none; }
.station-directory__modebar { border-bottom: 2px solid var(--ttd-bevel-dark); }
.station-directory__mode { display: grid; place-items: center; min-width: 34px; height: 30px; padding: 1px 3px; }
.station-directory__mode canvas, .station-directory__icons canvas { image-rendering: pixelated; }
.station-directory__mode.is-active { background: #d2d2a0; }
.station-directory__filterbar { gap: 4px; }
.station-directory__icons { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 1px; }
.station-directory__rating { flex: 0 0 34px; text-align: right; }
.world-map-window .ttd-window__body { background: var(--ttd-bg); }
.world-map__layout { display: flex; flex: 1 1 auto; align-items: stretch; gap: 3px; min-width: 0; min-height: 0; margin: 4px; }
.world-map__viewport {
  box-sizing: border-box; width: 840px; height: 460px; min-width: 0; min-height: 150px; flex: 1 1 auto; margin: 0;
  border: 3px solid; border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark);
  background: #101820;
}
.world-map__canvas { display: block; width: 100%; height: 100%; cursor: crosshair; image-rendering: pixelated; }
.world-map__controls { border-top: 2px solid var(--ttd-bevel-dark); }
.world-map__controls .ttd-btn { flex: 0 0 auto; min-height: 25px; padding-inline: 8px; }
.world-map__layers {
  display: flex; flex: 0 0 52px; flex-direction: column; align-items: center; gap: 2px; min-height: 0; overflow-y: auto;
  padding: 3px 2px; border-left: 2px solid var(--ttd-bevel-dark);
}
.world-map__layer {
  display: grid; flex: 0 0 48px; place-items: center;
  box-sizing: border-box; width: 48px; height: 48px; min-height: 48px; padding: 0; cursor: grab;
}
.world-map__layer canvas { display: block; width: 34px; height: 34px; image-rendering: pixelated; }
.world-map__layer.is-dragging { opacity: .45; }
.world-map__legend {
  display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-start; gap: 3px;
  width: fit-content; max-width: 100%; max-height: min(250px, 38vh); overflow: auto; padding: 2px 3px; background: var(--ttd-bg);
}
.world-map__legend-group { flex: 0 0 auto; min-width: 0; width: fit-content; max-width: 100%; }
.world-map__legend-group + .world-map__legend-group { padding-top: 3px; border-top: 1px solid #605a4e; }
.world-map__legend-items {
  display: grid; grid-auto-flow: column; grid-auto-columns: max-content; gap: 0 4px;
  width: fit-content; max-width: 100%;
}
.world-map__legend-item {
  display: flex; box-sizing: border-box; align-items: center; gap: 4px; min-width: 0; width: max-content; max-width: 240px; height: 24px; padding: 1px 3px;
  overflow: hidden; color: var(--ttd-ink); background: var(--ttd-bg); border: 1px solid transparent;
  font: inherit; text-align: left; text-shadow: none; white-space: nowrap; cursor: pointer;
}
.world-map__legend-item.is-active { border-color: var(--ttd-bevel-dark) var(--ttd-bevel-light) var(--ttd-bevel-light) var(--ttd-bevel-dark); }
.world-map__legend-item canvas { flex: 0 0 22px; image-rendering: pixelated; }
.world-map__legend-swatch { flex: 0 0 18px; width: 18px; height: 18px; background: #4c9a3a; border: 1px solid #274a24; }
.world-map__legend-swatch.is-dotted { background-color: #555 !important; background-image: radial-gradient(#fff 1px, transparent 1.5px); background-size: 4px 4px; }
.world-map__legend-item span { overflow: hidden; text-overflow: ellipsis; }
.world-map__message { min-height: 18px; padding: 0 5px; color: #651717; text-shadow: none; }
.subsidy-directory__content { max-height: min(360px, 55vh); overflow: auto; padding: 4px; }
.subsidy-directory__section h4 { margin: 5px 0 1px; color: #17120b; font-weight: bold; }
.subsidy-directory__row { display: flex; align-items: center; gap: 5px; min-height: 22px; color: #ffbd43; font-weight: bold; text-shadow: 1px 1px #332819; }
.subsidy-directory__row.is-clickable { cursor: pointer; }
.subsidy-directory__row.is-clickable:hover { background: #aa966d; }
.subsidy-directory__cargo {
  display: inline-grid; place-items: center; flex: 0 0 20px; width: 20px; height: 18px;
  color: #101010; background: #e6d181; border: 1px solid #4d422c; font-size: 10px; text-shadow: none;
}
.subsidy-directory__cargo--CO, .subsidy-directory__cargo--IO { background: #858585; }
.subsidy-directory__cargo--PA, .subsidy-directory__cargo--MA { background: #e5e5b0; }
.subsidy-directory__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.subsidy-directory__empty { min-height: 22px; color: #16120b; }

@media (max-width: 760px) {
  .world-map-window { max-width: calc(100vw - 16px); }
  .world-map__viewport { width: min(840px, calc(100vw - 72px)); height: min(460px, 45vh); }
  .station-directory__filterbar { flex-wrap: wrap; }
}

.store-window { max-width: calc(100vw - 16px); }
.store-window .ttd-window__body { background: #858585; }
.store-window__body { display: flex; flex-direction: column; min-height: 0; height: 100%; color: #171717; text-shadow: none; }
.store-window__notice { padding: 5px 7px; color: #17212a; background: #d4d0c4; border-bottom: 1px solid #555; }
.store-window__notice[hidden] { display: none; }
.store-window__tabs { display: flex; gap: 3px; padding: 4px 5px 2px; border-bottom: 2px solid var(--ttd-bevel-dark); }
.store-window__tab { min-width: 94px; }
.store-window__tab[aria-pressed="true"] { background: #d2d2a0; }
.store-window__content { min-height: 0; flex: 1 1 auto; overflow: auto; padding: 5px; }
.store-window__product { display: flex; align-items: center; gap: 9px; min-height: 74px; padding: 6px 4px; border-bottom: 1px solid #5d5d5d; }
.store-window__swatch { flex: 0 0 38px; width: 38px; height: 38px; border: 2px solid; border-color: #dedede #444 #444 #dedede; box-shadow: inset 0 0 0 4px #ffffff26; }
.store-window__product-details { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
.store-window__product-name { font-weight: bold; }
.store-window__product-description { color: #292929; }
.store-window__price { padding-top: 2px; font-weight: bold; }
.store-window__action { flex: 0 0 auto; min-width: 92px; }
.store-window__action:disabled { cursor: default; opacity: .72; }
.store-window__fine-print { margin: 6px 2px 1px; color: #303030; font-size: 12px; }
.store-window__empty { padding: 10px 5px; color: #242424; }
.store-window__history-wrap { overflow: auto; }
.store-window__history { width: 100%; border-collapse: collapse; }
.store-window__history th, .store-window__history td { padding: 4px 5px; border-bottom: 1px solid #626262; text-align: left; white-space: nowrap; }
.store-window__history th { font-weight: bold; background: #777; }
.store-window__history td:last-child { text-transform: capitalize; }

@media (max-width: 600px) {
  .store-window__product { align-items: flex-start; flex-wrap: wrap; }
  .store-window__product-details { flex-basis: calc(100% - 56px); }
  .store-window__action { margin-left: 47px; }
}

.toolbar-heart { display: block; image-rendering: pixelated; }
.store-window { width: 900px; max-width: calc(100vw - 16px); max-height: calc(100vh - 56px); }
.store-window .ttd-window__body { min-height: 0; background: #858585; }
.store-window__body { display: flex; flex-direction: column; min-height: 0; height: 100%; overflow: hidden; padding: 8px; color: #171717; font-size: 15px; line-height: 18px; text-shadow: none; }
.store-window__content { display: block; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 5px; }
.store-window__notice { margin-bottom: 6px; padding: 5px 7px; color: #17212a; font-size: 15px; line-height: 18px; background: #d4d0c4; border-bottom: 1px solid #555; }
.store-window__notice[hidden] { display: none; }
.store-window__summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 4px 6px 8px; border-bottom: 2px solid var(--ttd-bevel-dark); }
.store-window__intro { max-width: 58%; margin: 0; color: #242424; font-size: 15px; line-height: 18px; }
.store-window__intro p { margin: 0 0 4px; }
.store-window__intro p:last-child { margin-bottom: 0; }
.store-window__disclaimer { color: #303030; }
.store-window__summary-label { color: #202020; font-size: 15px; line-height: 18px; font-weight: bold; }
.store-window__balance { padding-top: 3px; color: #8b1f2b; font-size: 18px; line-height: 22px; font-weight: bold; }
.store-window__fine-print { display: block; margin: 5px 0 0; color: #393939; font-size: 10px; line-height: 12px; }
.store-window__availability { margin: 6px 3px 2px; color: #303030; font-size: 10px; line-height: 12px; }
.store-window__section { margin-top: 6px; }
.store-window__section-title { margin: 4px 4px 2px; color: #171717; font-size: 12px; line-height: 15px; font-weight: bold; }
.store-window__support-row { display: grid; grid-template-columns: 30px minmax(160px, 1fr) 150px 150px; align-items: center; gap: 6px; min-height: 36px; padding: 3px 4px; border-bottom: 1px solid #666; font-size: 15px; line-height: 18px; }
.store-window__support-icon { display: grid; place-items: center; font-size: 15px; line-height: 18px; }
.store-window__product-details { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 15px; line-height: 18px; }
.store-window__product-name { font-weight: bold; }
.store-window__product-description { color: #343434; }
.store-window__support-price { text-align: right; white-space: nowrap; }
.store-window__action { min-width: 120px; }
.store-window__action:disabled { cursor: default; opacity: .72; }
.store-window__body .ttd-btn { height: 22px; min-height: 22px; padding: 0 5px 1px; font-size: 15px; line-height: 18px; }
.store-window__tier-select { width: 150px; min-width: 0; height: 22px; padding: 1px 4px; font: inherit; }
.store-window__support-row--high { min-height: 42px; }
.store-window__support-row--high .store-window__product-details { grid-column: 2; }
.store-window__support-row--high .store-window__tier-select { grid-column: 3; }
.store-window__support-row--high .store-window__action { grid-column: 4; }
.store-window__cosmetics { margin-top: 9px; border-top: 1px solid #666; }
.store-window__cosmetic-row .store-window__swatch { flex: 0 0 28px; width: 28px; height: 28px; border: 2px solid #444; }
.store-window__history-wrap { overflow: auto; }
.store-window__history { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 18px; }
.store-window__history th, .store-window__history td { padding: 3px 5px; border-bottom: 1px solid #666; text-align: left; white-space: nowrap; }
.store-window__history th { font-weight: bold; background: #777; }
.store-window__empty { margin: 4px; color: #292929; font-size: 15px; line-height: 18px; }

@media (max-width: 760px) {
  .store-window__summary { align-items: flex-start; flex-direction: column; gap: 5px; }
  .store-window__intro { max-width: none; }
  .store-window__support-row { grid-template-columns: 28px minmax(120px, 1fr) 120px; }
  .store-window__support-price { grid-column: 3; }
  .store-window__support-row > .store-window__action { grid-column: 3; }
  .store-window__support-row--high .store-window__tier-select { grid-column: 2; }
  .store-window__support-row--high .store-window__action { grid-column: 3; }
}

@media (max-width: 600px) {
  .store-window__support-row { grid-template-columns: 30px minmax(0, 1fr); align-items: start; }
  .store-window__action { margin-left: 0; }
  .store-window__support-price,
  .store-window__support-row > .store-window__action,
  .store-window__support-row--high .store-window__product-details,
  .store-window__support-row--high .store-window__tier-select,
  .store-window__support-row--high .store-window__action { grid-column: 2; justify-self: start; }
  .store-window__support-price { text-align: left; }
  .store-window__tier-select { width: min(100%, 180px); }
}
