.msa-app {
  --msa-accent: #FF7A00;
  --msa-accent-dark: #db6900;
  --msa-ink: #20293A;
  --msa-muted: #6b7580;
  --msa-line: #e4e8ec;
  --msa-soft: #f6f7f8;
  --msa-surface: #ffffff;
  --msa-map-height: 720px;
  width: 100%;
  max-width: 1600px;
  margin: 24px auto;
  color: var(--msa-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  text-align: right;
}

.msa-app,
.msa-app * {
  box-sizing: border-box;
}

.msa-app button,
.msa-app input,
.msa-app select {
  font: inherit;
}

.msa-app button {
  cursor: pointer;
}

.msa-app button:focus-visible,
.msa-app input:focus-visible,
.msa-app select:focus-visible,
.msa-app summary:focus-visible,
.msa-app .msa-map-stage:focus-visible {
  outline: 3px solid rgba(244, 122, 31, 0.24);
  outline-offset: 2px;
}

.msa-shell {
  overflow: hidden;
  border: 1px solid var(--msa-line);
  border-radius: 20px;
  background: var(--msa-surface);
  box-shadow: 0 18px 55px rgba(23, 32, 42, 0.09);
}

.msa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 88px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--msa-line);
  background: var(--msa-surface);
}

.msa-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.msa-brand h2 {
  margin: 0;
  color: var(--msa-ink);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.35;
}

.msa-brand p {
  margin: 4px 0 0;
  color: var(--msa-muted);
  font-size: 12px;
}

.msa-brand-icon {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, 13px);
  grid-template-rows: repeat(2, 13px);
  gap: 3px;
  width: 38px;
  height: 38px;
  padding: 4px;
  border: 2px solid #202b36;
  border-radius: 10px;
  background: #fff;
}

.msa-brand-icon i {
  display: block;
  border-radius: 3px;
  background: #202b36;
}

.msa-brand-icon i:first-child {
  background: var(--msa-accent);
}

.msa-engine-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid #dfe4e8;
  border-radius: 999px;
  color: #4f5c68;
  background: #fbfcfc;
  font-size: 11px;
  font-weight: 700;
}

.msa-engine-badge span,
.msa-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #24a865;
  box-shadow: 0 0 0 3px rgba(36, 168, 101, 0.13);
}

.msa-engine-badge.is-loading span {
  background: #e4a11b;
  box-shadow: 0 0 0 3px rgba(228, 161, 27, 0.14);
}

.msa-engine-badge.is-error span {
  background: #d64545;
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.14);
}

.msa-seed-controls {
  display: grid;
  grid-template-columns: minmax(230px, 2.2fr) minmax(130px, 1fr) minmax(125px, 1fr) minmax(86px, 0.65fr) auto;
  align-items: end;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--msa-line);
  background: #fafbfb;
}

.msa-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.msa-field > span {
  color: #58636e;
  font-size: 11px;
  font-weight: 750;
}

.msa-field input,
.msa-field select,
.msa-jump-controls input {
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #d9dee3;
  border-radius: 9px;
  color: #1d2731;
  background: #fff;
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.msa-field input:hover,
.msa-field select:hover,
.msa-jump-controls input:hover {
  border-color: #bbc3ca;
}

.msa-field input:focus,
.msa-field select:focus,
.msa-jump-controls input:focus {
  border-color: var(--msa-accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(244, 122, 31, 0.11);
}

.msa-seed-input {
  direction: ltr;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important;
}

.msa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.msa-load-save {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
}

.msa-button,
.msa-icon-button {
  min-height: 40px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #d8dde2;
  border-radius: 9px;
  color: #28333e;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  box-shadow: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.msa-button:hover,
.msa-icon-button:hover {
  border-color: #afb8c0;
  background: #f4f6f7;
}

.msa-button:active,
.msa-icon-button:active {
  transform: translateY(1px);
}

.msa-button-primary {
  min-width: 108px;
  border-color: var(--msa-accent);
  color: #fff;
  background: var(--msa-accent);
}

.msa-button-primary:hover {
  border-color: var(--msa-accent-dark);
  color: #fff;
  background: var(--msa-accent-dark);
}

.msa-button[disabled],
.msa-icon-button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.msa-workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 620px;
  direction: rtl;
}

.msa-sidebar {
  overflow: auto;
  max-height: calc(var(--msa-map-height) + 99px);
  border-left: 1px solid var(--msa-line);
  background: #fff;
  scrollbar-width: thin;
}

.msa-side-section {
  margin: 0;
  padding: 18px;
  border: 0;
  border-bottom: 1px solid var(--msa-line);
  background: #fff;
}

.msa-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.msa-section-title h3,
.msa-side-section summary {
  margin: 0;
  color: #28323c;
  font-size: 12px;
  font-weight: 800;
}

.msa-location-card {
  background: #fbfcfc;
}

.msa-coordinate-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.msa-coordinate-readout b {
  overflow: hidden;
  padding: 9px 10px;
  border: 1px solid #e0e4e7;
  border-radius: 8px;
  color: #394550;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msa-biome-readout {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.msa-biome-swatch {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  border-radius: 8px;
  background: #dce1e4;
  box-shadow: 0 0 0 1px #cfd5da;
}

.msa-biome-readout strong,
.msa-biome-readout small {
  display: block;
}

.msa-biome-readout strong {
  color: #202a34;
  font-size: 12px;
}

.msa-biome-readout small {
  margin-top: 1px;
  color: var(--msa-muted);
  direction: ltr;
  font-size: 10px;
  text-align: right;
}

.msa-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 7px 0;
  cursor: pointer;
}

.msa-toggle + .msa-toggle {
  border-top: 1px solid #f0f2f3;
}

.msa-toggle > span {
  min-width: 0;
}

.msa-toggle b,
.msa-toggle small {
  display: block;
}

.msa-toggle b {
  color: #35414c;
  font-size: 11px;
  font-weight: 750;
}

.msa-toggle small {
  margin-top: 1px;
  color: #8a939c;
  font-size: 9px;
}

.msa-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.msa-toggle i {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 35px;
  height: 20px;
  border: 1px solid #cbd2d8;
  border-radius: 999px;
  background: #e8ebee;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.msa-toggle i::after {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 32, 42, 0.2);
  content: "";
  transition: transform 150ms ease;
}

.msa-toggle input:checked + i {
  border-color: var(--msa-accent);
  background: var(--msa-accent);
}

.msa-toggle input:checked + i::after {
  transform: translateX(-15px);
}

.msa-side-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
}

.msa-side-section summary::-webkit-details-marker {
  display: none;
}

.msa-side-section summary::before {
  order: 3;
  color: #858f98;
  content: "+";
  font-size: 17px;
  line-height: 1;
}

.msa-side-section[open] summary::before {
  content: "−";
}

.msa-side-section summary span {
  margin-right: auto;
  padding-left: 9px;
  color: #969ea6;
  font-size: 9px;
  font-weight: 500;
}

.msa-structure-list {
  display: grid;
  gap: 4px;
  margin-top: 13px;
}

.msa-structure-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 35px;
  padding: 5px 7px;
  border-radius: 7px;
  color: #47535e;
  cursor: pointer;
  font-size: 10px;
  transition: background-color 140ms ease;
}

.msa-structure-list label:hover {
  background: #f5f7f8;
}

.msa-structure-list label[hidden] {
  display: none;
}

.msa-structure-list input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--msa-accent);
}

.msa-structure-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  color: #fff;
  background: #55616d;
  font-size: 9px;
  font-weight: 900;
}

.msa-symbol-village { background: #a06b32; }
.msa-symbol-outpost { background: #4d5a63; }
.msa-symbol-portal { background: #7650a7; }
.msa-symbol-ancient { background: #126d78; }
.msa-symbol-trail { background: #7a694d; }
.msa-symbol-trial { background: #388377; }
.msa-symbol-fortress { background: #873c3c; }
.msa-symbol-bastion { background: #5d3e36; }
.msa-symbol-end { background: #77793a; }

.msa-structure-note {
  margin: 12px 0 0;
  padding: 9px 10px;
  border: 1px solid #eceff1;
  border-radius: 8px;
  color: #7f8992;
  background: #fafbfb;
  font-size: 8.5px;
  line-height: 1.8;
}

.msa-shortcuts {
  color: #69747e;
  font-size: 10px;
}

.msa-shortcuts p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 5px 0;
}

.msa-shortcuts kbd {
  padding: 2px 6px;
  border: 1px solid #d8dde1;
  border-bottom-width: 2px;
  border-radius: 5px;
  color: #44505a;
  background: #fafbfb;
  font: 9px Tahoma, sans-serif;
}

.msa-map-card {
  min-width: 0;
  overflow: hidden;
  background: #f8f9fa;
}

.msa-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--msa-line);
  background: #fff;
}

.msa-jump-controls,
.msa-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.msa-jump-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #68737e;
  font: 10px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.msa-jump-controls input {
  width: 95px;
  height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.msa-icon-button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 10px;
}

.msa-map-stage {
  position: relative;
  height: var(--msa-map-height);
  min-height: 520px;
  max-height: 1000px;
  overflow: hidden;
  direction: ltr;
  background: #dbe1e4;
  cursor: grab;
  isolation: isolate;
  touch-action: none;
  user-select: none;
}

.msa-map-stage.is-dragging {
  cursor: grabbing;
}

.msa-biome-canvas,
.msa-overlay-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.msa-biome-canvas {
  z-index: 1;
  background: #dbe1e4;
  image-rendering: pixelated;
}

.msa-overlay-canvas {
  z-index: 2;
}

.msa-map-loader,
.msa-map-error {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-width: 240px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 13px;
  color: #26313b;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 38px rgba(22, 31, 39, 0.2);
  text-align: center;
  transform: translate(-50%, -50%);
}

.msa-map-loader[hidden],
.msa-map-error[hidden] {
  display: none;
}

.msa-map-loader b {
  margin-top: 10px;
  font-size: 11px;
}

.msa-map-loader small {
  margin-top: 2px;
  color: #7b858e;
  font-size: 8px;
}

.msa-loader-cube {
  display: grid;
  grid-template-columns: repeat(2, 9px);
  grid-template-rows: repeat(2, 9px);
  gap: 2px;
  width: 24px;
  height: 24px;
  animation: msa-cube-turn 1.3s steps(4, end) infinite;
}

.msa-loader-cube::before,
.msa-loader-cube::after {
  display: block;
  grid-area: 1 / 1 / 2 / 2;
  width: 9px;
  height: 9px;
  background: var(--msa-accent);
  box-shadow: 11px 0 0 #28343f, 0 11px 0 #88929b, 11px 11px 0 #c9d0d5;
  content: "";
}

.msa-loader-cube::after {
  display: none;
}

@keyframes msa-cube-turn {
  to { transform: rotate(360deg); }
}

.msa-map-error {
  max-width: 430px;
  border-color: #ecc6c6;
  color: #842e2e;
  background: #fffafa;
  font-size: 11px;
}

.msa-tooltip {
  position: absolute;
  z-index: 9;
  max-width: 230px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  color: #fff;
  background: rgba(22, 30, 38, 0.9);
  font-size: 9px;
  line-height: 1.7;
  pointer-events: none;
  white-space: nowrap;
}

.msa-tooltip[hidden] {
  display: none;
}

.msa-tooltip b,
.msa-tooltip small {
  display: block;
}

.msa-tooltip small {
  color: #d3d9dd;
  direction: ltr;
}

.msa-axis-hud {
  position: absolute;
  z-index: 5;
  color: #fff;
  font: 8px ui-monospace, SFMono-Regular, Consolas, monospace;
  pointer-events: none;
}

.msa-axis-hud span {
  position: absolute;
  display: block;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(20, 28, 35, 0.68);
  white-space: nowrap;
}

.msa-axis-top {
  top: 6px;
  right: 0;
  left: 0;
  height: 20px;
}

.msa-axis-top span {
  transform: translateX(-50%);
}

.msa-axis-left {
  top: 0;
  bottom: 0;
  left: 6px;
  width: 60px;
}

.msa-axis-left span {
  transform: translateY(-50%);
}

.msa-map-zoom {
  position: absolute;
  right: 12px;
  bottom: 50px;
  z-index: 6;
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(30, 41, 50, 0.25);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(20, 28, 35, 0.16);
}

.msa-map-zoom button {
  width: 34px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  color: #34404b;
  background: #fff;
  font-size: 18px;
  line-height: 1;
}

.msa-map-zoom button + button {
  border-top: 1px solid #e1e5e8;
}

.msa-map-zoom button:hover {
  background: #f1f3f4;
}

.msa-map-scale {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 24px;
  padding: 3px 7px;
  border-radius: 6px;
  color: #fff;
  background: rgba(22, 30, 38, 0.76);
  font: 8px ui-monospace, SFMono-Regular, Consolas, monospace;
  pointer-events: none;
}

.msa-map-scale span {
  display: block;
  width: 65px;
  height: 7px;
  border-right: 1px solid #fff;
  border-bottom: 2px solid #fff;
  border-left: 1px solid #fff;
}

.msa-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 7;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

.msa-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--msa-accent);
  transition: width 180ms ease;
}

.msa-map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 41px;
  padding: 8px 13px;
  border-top: 1px solid var(--msa-line);
  color: #69747e;
  background: #fff;
  font-size: 9px;
}

.msa-status-text::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: #24a865;
  content: "";
}

.msa-status-text.is-busy::before {
  background: #e4a11b;
}

.msa-status-text.is-error::before {
  background: #d64545;
}

.msa-world-summary {
  overflow: hidden;
  max-width: 50%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msa-disclaimer {
  padding: 12px 20px;
  border-top: 1px solid var(--msa-line);
  color: #7c8790;
  background: #fafbfb;
  font-size: 9px;
  line-height: 1.9;
}

.msa-disclaimer strong {
  color: #5c6770;
}

.msa-map-card:fullscreen,
.msa-map-card:-webkit-full-screen {
  display: flex;
  width: 100vw;
  height: 100vh;
  flex-direction: column;
  background: #fff;
}

.msa-map-card:fullscreen .msa-map-stage,
.msa-map-card:-webkit-full-screen .msa-map-stage {
  max-height: none;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

@media (max-width: 1100px) {
  .msa-seed-controls {
    grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(100px, 1fr));
  }

  .msa-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .msa-workspace {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .msa-app {
    margin: 14px auto;
  }

  .msa-shell {
    border-radius: 14px;
  }

  .msa-header {
    padding: 15px 16px;
  }

  .msa-brand p {
    display: none;
  }

  .msa-engine-badge {
    display: none;
  }

  .msa-seed-controls {
    grid-template-columns: 1fr 1fr;
    padding: 13px;
  }

  .msa-seed-field,
  .msa-actions {
    grid-column: 1 / -1;
  }

  .msa-y-field {
    display: none;
  }

  .msa-actions .msa-button-primary {
    flex: 1 1 auto;
  }

  .msa-workspace {
    display: flex;
    flex-direction: column;
  }

  .msa-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: visible;
    max-height: none;
    border-bottom: 1px solid var(--msa-line);
    border-left: 0;
  }

  .msa-side-section {
    border-left: 1px solid var(--msa-line);
  }

  .msa-structures,
  .msa-shortcuts {
    display: none;
  }

  .msa-map-stage {
    height: 620px;
    min-height: 520px;
  }

  .msa-toolbar-actions .msa-home {
    display: none;
  }
}

@media (max-width: 520px) {
  .msa-app {
    width: calc(100% + 20px);
    margin-right: -10px;
    margin-left: -10px;
  }

  .msa-shell {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .msa-brand h2 {
    font-size: 17px;
  }

  .msa-brand-icon {
    transform: scale(0.88);
  }

  .msa-seed-controls {
    grid-template-columns: 1fr 1fr;
  }

  .msa-seed-field,
  .msa-actions {
    grid-column: 1 / -1;
  }

  .msa-sidebar {
    grid-template-columns: 1fr;
  }

  .msa-side-section {
    border-left: 0;
  }

  .msa-sidebar .msa-side-section:nth-child(2) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .msa-sidebar .msa-side-section:nth-child(2) .msa-section-title {
    grid-column: 1 / -1;
    margin-bottom: 3px;
  }

  .msa-sidebar .msa-side-section:nth-child(2) .msa-toggle {
    min-height: 43px;
  }

  .msa-map-toolbar {
    align-items: stretch;
  }

  .msa-jump-controls {
    min-width: 0;
    flex: 1 1 auto;
  }

  .msa-jump-controls label {
    min-width: 0;
    flex: 1 1 0;
  }

  .msa-jump-controls input {
    min-width: 0;
    width: 100%;
  }

  .msa-toolbar-actions {
    flex: 0 0 auto;
  }

  .msa-fullscreen {
    width: 42px;
    overflow: hidden;
    padding: 0 5px;
    color: #33404b;
    font-size: 9px;
  }

  .msa-map-stage {
    height: 560px;
    min-height: 500px;
  }

  .msa-axis-left {
    display: none;
  }

  .msa-map-footer,
  .msa-disclaimer {
    padding-right: 11px;
    padding-left: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .msa-app *,
  .msa-app *::before,
  .msa-app *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Version 1.1 responsive layout and feature rail */
.msa-app {
  width: min(70%, 1180px);
  max-width: calc(100% - 32px);
  min-width: 0;
  margin: 24px auto;
  overflow-x: hidden;
  overflow-x: clip;
}

.msa-app [hidden] {
  display: none !important;
}

.msa-app,
.msa-app .msa-shell,
.msa-app .msa-workspace,
.msa-app .msa-map-card,
.msa-app .msa-map-toolbar,
.msa-app .msa-map-stage,
.msa-app .msa-layer-panel,
.msa-app .msa-seed-controls {
  min-width: 0;
  max-width: 100%;
}

.msa-page-intro {
  margin: 0 auto 18px;
  text-align: center;
}

.msa-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #e4e8ec;
  border-radius: 999px;
  color: #66727e;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}

.msa-page-intro h1 {
  max-width: 850px;
  margin: 12px auto 6px;
  color: #17202a;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 900;
  line-height: 1.45;
}

.msa-page-intro p {
  max-width: 720px;
  margin: 0 auto;
  color: #69747e;
  font-size: 13px;
  line-height: 2;
}

.msa-map-summary {
  display: grid;
  grid-template-columns: auto minmax(190px, .8fr) minmax(220px, 1.2fr);
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--msa-line);
  background: #fff;
}

.msa-summary-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #34404b;
  font-size: 11px;
  white-space: nowrap;
}

.msa-map-summary .msa-coordinate-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.msa-map-summary .msa-biome-readout {
  min-width: 0;
  min-height: 38px;
}

.msa-map-summary .msa-biome-swatch {
  width: 30px;
  height: 30px;
}

.msa-layer-panel {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--msa-line);
  background: #f8fafb;
}

.msa-layer-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.msa-layer-panel-head h3 {
  margin: 0;
  color: #27323c;
  font-size: 13px;
  font-weight: 850;
}

.msa-layer-panel-head p {
  margin: 2px 0 0;
  color: #7a858f;
  font-size: 10px;
}

.msa-layer-bulk-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.msa-plain-button,
.msa-more-features,
.msa-highlight-status button,
.msa-search-foot button,
.msa-read-toggle {
  margin: 0;
  border: 0;
  color: #52606c;
  background: transparent;
  box-shadow: none;
  font-size: 10px;
  font-weight: 800;
}

.msa-plain-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #dde3e7;
  border-radius: 7px;
  background: #fff;
}

.msa-feature-rail {
  overflow: hidden;
  max-height: 1000px;
  transition: max-height 480ms cubic-bezier(.2,.75,.25,1);
}

.msa-feature-rail.is-collapsed {
  max-height: 96px;
}

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

.msa-feature-chip {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  gap: 8px;
  padding: 6px 9px;
  overflow: hidden;
  border: 1px solid #dde3e7;
  border-radius: 9px;
  color: #4b5965;
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.msa-feature-chip:hover {
  border-color: #bbc5cc;
  transform: translateY(-1px);
}

.msa-feature-chip.is-active {
  border-color: rgba(244, 122, 31, .5);
  color: #7d3a0b;
  background: #fff8f2;
  box-shadow: inset 0 0 0 1px rgba(244, 122, 31, .08);
}

.msa-feature-chip.is-disabled {
  cursor: not-allowed;
  opacity: .48;
}

.msa-feature-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.msa-feature-chip b {
  overflow: hidden;
  min-width: 0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msa-chip-icon {
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: #5c6974;
  font-size: 10px;
  font-weight: 900;
}

.msa-feature-chip.is-active .msa-chip-icon {
  background: var(--msa-accent);
}

.msa-symbol-desert { background: #b86a27; }
.msa-symbol-jungle { background: #4f722a; }
.msa-symbol-witch { background: #56683d; }
.msa-symbol-igloo { background: #71889a; }
.msa-symbol-ocean { background: #277d8c; }
.msa-symbol-ship { background: #785a3e; }
.msa-symbol-monument { background: #3c8f83; }
.msa-symbol-mansion { background: #4d392d; }

.msa-more-features {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border-top: 1px solid #e3e8eb;
}

.msa-more-features i,
.msa-read-toggle i {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms ease;
}

.msa-more-features[aria-expanded="true"] i,
.msa-read-toggle[aria-expanded="true"] i {
  transform: rotate(225deg) translate(-1px, -1px);
}

.msa-highlight-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid #f2d1b9;
  border-radius: 8px;
  color: #7d3a0b;
  background: #fff8f2;
  font-size: 10px;
}

.msa-highlight-status button,
.msa-search-foot button {
  color: #b2500e;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.msa-workspace {
  display: block;
  min-height: 0;
  direction: rtl;
}

.msa-map-card {
  min-width: 0;
  background: #fff;
}

.msa-map-stage {
  height: var(--msa-map-height);
  min-height: 500px;
  max-height: 900px;
}

.msa-map-corner-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(30, 41, 50, .25);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(20, 28, 35, .16);
}

.msa-map-tool {
  display: grid;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: #34404b;
  background: #fff;
}

.msa-map-tool + .msa-map-tool {
  border-left: 1px solid #e1e5e8;
}

.msa-map-tool:hover,
.msa-map-tool.is-active {
  color: var(--msa-accent-dark);
  background: #fff5ed;
}

.msa-map-tool svg,
.msa-search-head svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.msa-search-panel {
  position: absolute;
  top: 56px;
  right: 12px;
  z-index: 12;
  display: flex;
  width: min(360px, calc(100% - 24px));
  max-height: min(520px, calc(100% - 72px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #b7c6d1;
  border-radius: 12px;
  color: #27323c;
  background: rgba(250, 252, 253, .98);
  box-shadow: 0 18px 42px rgba(15, 32, 46, .25);
  direction: rtl;
}

.msa-search-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 7px 9px;
  border-bottom: 1px solid #dde5ea;
  background: #fff;
}

.msa-search-head svg {
  flex: 0 0 auto;
  width: 16px;
  color: #6b7b88;
}

.msa-search-input {
  min-width: 0;
  width: 100%;
  height: 32px;
  padding: 0;
  border: 0 !important;
  outline: 0;
  color: #25313b;
  background: transparent;
  box-shadow: none !important;
  font-size: 12px;
}

.msa-search-close {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: #5e6c77;
  background: transparent;
  font-size: 20px;
}

.msa-search-close:hover {
  background: #eef2f4;
}

.msa-search-results {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 7px;
  overscroll-behavior: contain;
}

.msa-search-group > b {
  display: block;
  padding: 7px 7px 4px;
  color: #7b8994;
  font-size: 9px;
  letter-spacing: .04em;
}

.msa-search-group button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  gap: 10px;
  margin: 0 0 3px;
  padding: 6px 7px;
  border: 0;
  border-radius: 8px;
  color: #33404b;
  background: transparent;
  text-align: right;
}

.msa-search-group button:hover,
.msa-search-group button:focus-visible {
  background: #eaf1f5;
}

.msa-search-group button > span:last-child {
  display: block;
  min-width: 0;
}

.msa-search-group button b,
.msa-search-group button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msa-search-group button b {
  font-size: 11px;
}

.msa-search-group button small {
  color: #7b8994;
  font-size: 9px;
  direction: ltr;
  text-align: right;
}

.msa-search-color,
.msa-search-symbol {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 7px;
}

.msa-search-symbol {
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.msa-search-empty {
  padding: 24px 10px;
  color: #7b8994;
  font-size: 11px;
  text-align: center;
}

.msa-search-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid #dde5ea;
  background: #fff;
}

.msa-search-foot small {
  color: #89949d;
  font-size: 8px;
}

.msa-seo-content {
  display: grid;
  gap: 18px;
  margin: 30px auto 0;
}

.msa-info-section,
.msa-image-section,
.msa-faq {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid #e1e6e9;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(23, 32, 42, .055);
}

.msa-info-section h2 {
  margin: 0 0 12px;
  color: #1e2a34;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.7;
}

.msa-expandable {
  --msa-expanded-height: 520px;
  position: relative;
  max-height: 8.6em;
  overflow: hidden;
  transition: max-height 520ms cubic-bezier(.2,.75,.25,1);
}

.msa-expandable::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 70px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 82%);
  content: "";
  pointer-events: none;
  transition: opacity 180ms ease;
}

.msa-info-section.is-expanded .msa-expandable {
  max-height: var(--msa-expanded-height);
}

.msa-info-section.is-expanded .msa-expandable::after {
  opacity: 0;
}

.msa-expandable h3 {
  margin: 0 0 7px;
  color: #394752;
  font-size: 14px;
}

.msa-expandable p {
  margin: 0 0 9px;
  color: #65717b;
  font-size: 12px;
  line-height: 2.1;
}

.msa-read-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-top: 8px;
  padding: 0;
  color: #c15a11;
}

.msa-section-heading {
  color: #1e2a34;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 900;
}

.msa-image-section > p {
  margin: 7px 0 16px;
  color: #6e7983;
  font-size: 11px;
  line-height: 2;
}

.msa-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.msa-image-placeholder {
  display: grid;
  aspect-ratio: 16 / 9;
  min-height: 180px;
  place-content: center;
  border: 2px dashed #cfd8de;
  border-radius: 13px;
  color: #65727c;
  background:
    linear-gradient(135deg, rgba(244,122,31,.05), rgba(47,95,143,.05)),
    #f8fafb;
  text-align: center;
}

.msa-image-placeholder b,
.msa-image-placeholder span {
  display: block;
}

.msa-image-placeholder b {
  font-size: 13px;
}

.msa-image-placeholder span {
  margin-top: 5px;
  color: #8a959d;
  font: 10px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.msa-faq details {
  border-bottom: 1px solid #e5e9ec;
}

.msa-faq details:last-child {
  border-bottom: 0;
}

.msa-faq summary {
  padding: 15px 0;
  color: #34414c;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.msa-faq p {
  margin: -4px 0 15px;
  color: #68747e;
  font-size: 11px;
  line-height: 2;
}

.msa-map-card:fullscreen .msa-map-corner-tools,
.msa-map-card:-webkit-full-screen .msa-map-corner-tools {
  top: 14px;
  right: 14px;
}

@media (max-width: 1100px) {
  .msa-app {
    width: 90%;
    max-width: 90%;
    margin: 18px auto;
  }

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

  .msa-map-stage {
    height: min(var(--msa-map-height), 650px);
  }

  .msa-image-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .msa-app {
    width: 90%;
    max-width: 90%;
    margin: 14px auto;
  }

  .msa-page-intro h1 {
    font-size: clamp(22px, 6vw, 30px);
  }

  .msa-header {
    min-height: 72px;
  }

  .msa-map-summary {
    grid-template-columns: 1fr 1fr;
  }

  .msa-summary-title {
    grid-column: 1 / -1;
  }

  .msa-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .msa-layer-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .msa-map-stage {
    height: 580px;
    min-height: 500px;
  }

  .msa-toolbar-actions .msa-home {
    display: inline-flex;
  }
}

@media (max-width: 560px) {
  .msa-app {
    width: 90%;
    max-width: 90%;
    margin-right: auto;
    margin-left: auto;
    overflow-x: hidden;
    overflow-x: clip;
  }

  .msa-shell {
    border-right: 1px solid var(--msa-line);
    border-left: 1px solid var(--msa-line);
    border-radius: 14px;
  }

  .msa-page-intro {
    margin-bottom: 14px;
  }

  .msa-page-intro p {
    font-size: 11px;
  }

  .msa-seed-controls {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .msa-map-summary {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .msa-summary-title,
  .msa-map-summary .msa-coordinate-readout,
  .msa-map-summary .msa-biome-readout {
    grid-column: auto;
  }

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

  .msa-feature-rail.is-collapsed {
    max-height: 96px;
  }

  .msa-feature-chip {
    padding-right: 7px;
    padding-left: 7px;
  }

  .msa-layer-bulk-actions {
    width: 100%;
  }

  .msa-layer-bulk-actions .msa-plain-button {
    flex: 1 1 0;
  }

  .msa-map-toolbar {
    flex-wrap: wrap;
    gap: 7px;
  }

  .msa-jump-controls {
    width: 100%;
  }

  .msa-toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .msa-map-stage {
    height: 520px;
    min-height: 480px;
  }

  .msa-search-panel {
    top: 54px;
    right: 8px;
    width: calc(100% - 16px);
    max-height: calc(100% - 64px);
    border-radius: 10px;
  }

  .msa-map-corner-tools {
    top: 8px;
    right: 8px;
  }

  .msa-map-zoom {
    right: 8px;
  }

  .msa-map-scale {
    right: 8px;
  }

  .msa-info-section,
  .msa-image-section,
  .msa-faq {
    border-radius: 13px;
  }

  .msa-image-placeholder {
    min-height: 150px;
  }
}

/* Seed Atlas 1.2 — requested functional update */
.msa-app {
  --msa-accent: #FF7A00;
  --msa-accent-dark: #dc6900;
  --msa-ink: #20293A;
  --msa-map-height: 610px;
  width: min(84%, 1380px);
  max-width: 1380px;
  font-family: inherit;
}

.msa-app button,
.msa-app input,
.msa-app select,
.msa-app textarea {
  font-family: inherit;
}

.msa-app button:focus-visible,
.msa-app input:focus-visible,
.msa-app select:focus-visible,
.msa-app summary:focus-visible,
.msa-app .msa-map-stage:focus-visible {
  outline-color: rgba(255, 122, 0, .26);
}

.msa-seed-controls {
  grid-template-columns: minmax(220px, 2.15fr) minmax(125px, .9fr) minmax(125px, .9fr) minmax(115px, .86fr) minmax(82px, .58fr) auto;
}

.msa-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 12px;
  padding-left: 38px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2320293A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 14px;
}

.msa-field input:focus,
.msa-field select:focus,
.msa-jump-controls input:focus {
  box-shadow: 0 0 0 3px rgba(255, 122, 0, .11);
}

.msa-feature-grid {
  align-items: stretch;
}

.msa-feature-chip {
  min-height: 70px;
  gap: 9px;
}

.msa-feature-chip b {
  min-width: 0;
  line-height: 1.45;
}

.msa-feature-chip b small {
  display: block;
  margin-top: 2px;
  color: #89929a;
  font-size: 8px;
  font-weight: 650;
}

.msa-chip-icon {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 7px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e2e6e9;
  border-radius: 10px;
  color: #20293A;
  background: #fff;
}

.msa-chip-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.msa-fallback-symbol {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  font-weight: 900;
}

.msa-feature-chip.is-active .msa-chip-icon {
  border-color: rgba(255, 122, 0, .56);
  color: #20293A;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 122, 0, .08);
}

.msa-feature-chip.is-active {
  border-color: rgba(255, 122, 0, .42);
  background: rgba(255, 122, 0, .045);
}

.msa-feature-chip.is-unsupported {
  cursor: not-allowed;
  opacity: .58;
  filter: grayscale(.25);
}

.msa-feature-chip.is-unsupported input {
  pointer-events: none;
}

.msa-biome-selector {
  margin-top: 12px;
  border-top: 1px solid #e7eaed;
  padding-top: 12px;
}

.msa-biome-drawer-toggle {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #dfe4e8;
  border-radius: 12px;
  color: #20293A;
  background: #fff;
  text-align: right;
}

.msa-biome-drawer-toggle > span:nth-child(2) {
  display: grid;
  flex: 1 1 auto;
  gap: 1px;
}

.msa-biome-drawer-toggle b {
  font-size: 12px;
}

.msa-biome-drawer-toggle small {
  color: #77818a;
  font-size: 9px;
}

.msa-biome-drawer-toggle > i,
.msa-more-features i,
.msa-read-toggle i {
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 160ms ease;
}

.msa-biome-drawer-toggle[aria-expanded="true"] > i {
  transform: rotate(225deg);
}

.msa-biome-drawer {
  margin-top: 9px;
  padding: 11px;
  border: 1px solid #e1e5e8;
  border-radius: 12px;
  background: #fafbfc;
}

.msa-biome-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.msa-biome-drawer-head b {
  color: #20293A;
  font-size: 11px;
}

.msa-biome-drawer-head button {
  border: 0;
  color: #7a838b;
  background: transparent;
  font-size: 9px;
}

.msa-biome-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 190px);
  grid-template-rows: repeat(2, minmax(48px, auto));
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 1px 8px;
  scrollbar-width: thin;
}

.msa-biome-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid #e0e4e7;
  border-radius: 10px;
  color: #20293A;
  background: #fff;
  text-align: right;
}

.msa-biome-option:hover {
  border-color: #c6ccd1;
}

.msa-biome-option.is-selected {
  border-color: #FF7A00;
  box-shadow: 0 0 0 2px rgba(255, 122, 0, .11);
}

.msa-biome-option-color {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #d6dade;
}

.msa-biome-option > span:last-child {
  display: grid;
  min-width: 0;
}

.msa-biome-option b,
.msa-biome-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msa-biome-option b {
  font-size: 10px;
}

.msa-biome-option small {
  direction: ltr;
  color: #7a848d;
  font-size: 8px;
  text-align: right;
}

.msa-map-stage {
  height: min(var(--msa-map-height), 610px);
  min-height: 470px;
  touch-action: none;
}

.msa-map-stage canvas {
  transition: filter 140ms ease;
}

.msa-map-stage.is-zooming canvas {
  filter: saturate(1.04) contrast(1.015);
}

.msa-map-corner-tools-left {
  right: auto;
  left: 12px;
}

.msa-map-corner-tools-left .msa-map-tool[aria-pressed="true"] {
  border-color: #FF7A00;
  color: #fff;
  background: #FF7A00;
}

.msa-map-corner-tools-left .msa-map-tool[aria-pressed="true"] svg {
  stroke: #fff;
}

.msa-app.is-map-locked .msa-map-stage {
  cursor: default;
}

.msa-marker-label {
  position: absolute;
  z-index: 8;
  width: max-content;
  max-width: 190px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 122, 0, .62);
  border-radius: 8px;
  color: #fff;
  background: rgba(32, 41, 58, .9);
  box-shadow: 0 7px 20px rgba(0, 0, 0, .16);
  pointer-events: none;
  transform: translate(-50%, -100%);
  backdrop-filter: blur(8px);
}

.msa-marker-label b,
.msa-marker-label span {
  display: block;
}

.msa-marker-label b {
  font-size: 9px;
}

.msa-marker-label span {
  margin-top: 1px;
  font: 8px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.msa-tooltip {
  z-index: 11;
  min-width: 150px;
  max-width: 205px;
  color: #fff;
  background: rgba(32, 41, 58, .92);
  backdrop-filter: blur(8px);
}

.msa-tooltip b,
.msa-tooltip span {
  display: block;
}

.msa-tooltip span {
  margin-top: 2px;
  font: 9px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.msa-tooltip.is-pinned {
  border-color: rgba(255, 122, 0, .75);
  box-shadow: 0 0 0 1px rgba(255, 122, 0, .16), 0 10px 26px rgba(0, 0, 0, .18);
}

.msa-terrain-control {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0 6px;
  min-height: 36px;
  padding: 4px 9px;
  border: 1px solid #e0e4e7;
  border-radius: 9px;
  color: #65707a;
  background: #f7f8f9;
  cursor: pointer;
}

.msa-terrain-control input {
  grid-row: 1 / span 2;
  margin: 0;
}

.msa-terrain-control span {
  font-size: 9px;
  font-weight: 800;
}

.msa-terrain-control small {
  color: #929aa1;
  font-size: 7px;
}

.msa-terrain-control:has(input:checked) {
  border-color: rgba(255, 122, 0, .55);
  color: #20293A;
  background: rgba(255, 122, 0, .06);
}

.msa-terrain-control:has(input:disabled) {
  cursor: not-allowed;
  opacity: .55;
}

.msa-axis-left {
  display: block !important;
}

.msa-info-section-unified {
  padding: 18px 20px;
}

.msa-info-section-unified .msa-expandable {
  max-height: 8.2em;
  overflow: hidden;
}

.msa-info-section-unified.is-expanded .msa-expandable {
  max-height: none;
}

.msa-info-block {
  padding: 0 0 15px;
  border-bottom: 1px solid #e8ebee;
}

.msa-info-block + .msa-info-block {
  padding-top: 15px;
}

.msa-info-block:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.msa-info-section-unified .msa-expandable::after {
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 78%);
}

.msa-page-intro {
  margin-bottom: 16px;
}

@media (max-width: 1100px) {
  .msa-app {
    width: 92%;
    max-width: 92%;
  }

  .msa-seed-controls {
    grid-template-columns: minmax(210px, 2fr) repeat(3, minmax(110px, 1fr)) minmax(80px, .7fr);
  }

  .msa-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .msa-map-stage {
    height: 545px;
    min-height: 445px;
  }
}

@media (max-width: 820px) {
  .msa-seed-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .msa-seed-field,
  .msa-actions {
    grid-column: 1 / -1;
  }

  .msa-map-stage {
    height: 500px;
    min-height: 420px;
  }

  .msa-biome-list {
    grid-auto-columns: minmax(145px, 175px);
  }
}

@media (max-width: 560px) {
  .msa-app {
    width: 94%;
    max-width: 94%;
  }

  .msa-feature-chip {
    min-height: 64px;
  }

  .msa-chip-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    padding: 6px;
  }

  .msa-map-stage {
    height: 455px;
    min-height: 390px;
  }

  .msa-map-corner-tools-left {
    top: 8px;
    left: 8px;
  }

  .msa-axis-left {
    left: 2px;
    max-width: 46px;
    font-size: 7px;
  }

  .msa-axis-left span {
    padding: 1px 3px;
  }

  .msa-terrain-control {
    margin-left: auto;
  }

  .msa-biome-list {
    grid-template-rows: repeat(2, minmax(46px, auto));
  }

  .msa-marker-label {
    max-width: 160px;
  }
}

/* 1.3.0 — stable viewport rendering and refreshed controls */
.msa-biome-canvas {
  filter: saturate(1.045) contrast(1.018);
}

.msa-map-stage.is-loading-view::after {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: rgba(244, 247, 249, .2);
  pointer-events: none;
  content: "";
  backdrop-filter: blur(.6px);
}

.msa-map-loader {
  z-index: 9;
  min-width: min(280px, calc(100% - 32px));
  border-color: rgba(255, 122, 0, .22);
  box-shadow: 0 14px 42px rgba(30, 39, 48, .18), 0 0 0 4px rgba(255, 122, 0, .06);
}

.msa-map-corner-tools-left {
  display: block !important;
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  flex: 0 0 38px !important;
  overflow: hidden;
  box-sizing: border-box;
}

.msa-map-corner-tools-left .msa-map-tool,
.msa-map-corner-tools-left .msa-lock-map {
  display: grid !important;
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  flex: 0 0 36px !important;
  padding: 0 !important;
  place-items: center;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}

.msa-map-corner-tools-left .msa-map-tool svg {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px;
}

.msa-layer-bulk-actions {
  gap: 8px;
}

.msa-layer-bulk-actions .msa-plain-button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #ffd2ae;
  border-radius: 9px;
  color: #a94505;
  background: #fff8f2;
  text-decoration: none;
  font-weight: 800;
}

.msa-layer-bulk-actions .msa-plain-button:hover,
.msa-layer-bulk-actions .msa-plain-button:focus-visible {
  border-color: #ff9b4e;
  color: #fff;
  background: #ff7a00;
}

.msa-search-panel {
  width: min(370px, calc(100% - 24px));
  border: 1px solid #ffb778;
  border-radius: 14px;
  background: #fffaf6;
  box-shadow: 0 20px 48px rgba(75, 39, 13, .25);
}

.msa-search-head {
  min-height: 50px;
  padding: 8px 10px;
  border-bottom: 1px solid #ffe0c5;
  color: #b34c05;
  background: #fff;
}

.msa-search-input {
  height: 34px;
  color: #3b2b20;
  font-size: 12px;
}

.msa-search-input::placeholder {
  color: #9c7558;
}

.msa-search-close {
  color: #a94b0a;
}

.msa-search-close:hover {
  color: #fff;
  background: #ff7a00;
}

.msa-search-results {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
  background: #fffaf6;
}

.msa-search-results > button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 54px;
  gap: 10px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid #ffd3b0;
  border-radius: 11px;
  color: #4a3425;
  background: #fff;
  text-align: right;
  box-shadow: 0 3px 10px rgba(104, 58, 23, .05);
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.msa-search-results > button:hover,
.msa-search-results > button:focus-visible {
  border-color: #ff8b2d;
  outline: 0;
  color: #7f3605;
  background: #fff3e9;
  box-shadow: 0 7px 18px rgba(255, 122, 0, .14);
  transform: translateY(-1px);
}

.msa-search-results > button > span:last-child,
.msa-search-results > button b,
.msa-search-results > button small {
  display: block;
  min-width: 0;
}

.msa-search-results > button b,
.msa-search-results > button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msa-search-results > button b {
  color: inherit;
  font-size: 11px;
  line-height: 1.7;
}

.msa-search-results > button small {
  margin-top: 1px;
  color: #9a6f50;
  font-size: 9px;
  line-height: 1.6;
  direction: rtl;
  text-align: right;
}

.msa-search-results .msa-search-color,
.msa-search-results .msa-search-symbol {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 0 1px #ffc998, 0 3px 8px rgba(90, 44, 11, .12);
}

.msa-search-results .msa-search-symbol {
  color: #fff;
  background: linear-gradient(145deg, #ff9b43, #ec6500);
  font-size: 12px;
  font-weight: 900;
}

.msa-search-foot {
  padding: 9px 11px;
  border-top-color: #ffe0c5;
  background: #fff;
}

.msa-search-foot button {
  flex: 0 0 auto;
  color: #b34c05;
  font-weight: 800;
}

.msa-search-foot small {
  color: #9a755a;
  line-height: 1.7;
}

.msa-guide-figure {
  width: min(100%, 1120px);
  margin: 18px auto 0;
  overflow: hidden;
  border: 1px solid #e6e9ec;
  border-radius: 14px;
  background: #f4f6f7;
  box-shadow: 0 12px 32px rgba(25, 34, 43, .09);
  aspect-ratio: 16 / 6;
}

.msa-guide-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 820px) {
  .msa-guide-figure {
    width: calc(100% - 8px);
    border-radius: 11px;
  }

  .msa-search-panel {
    width: calc(100% - 16px);
  }
}

@media (max-width: 560px) {
  .msa-guide-figure {
    width: calc(100% - 4px);
    margin-top: 14px;
    border-radius: 9px;
  }

  .msa-search-results {
    gap: 6px;
    padding: 8px;
  }

  .msa-search-results > button {
    min-height: 50px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 6px 8px;
  }

  .msa-search-results .msa-search-color,
  .msa-search-results .msa-search-symbol {
    width: 32px;
    height: 32px;
  }
}

.msa-personal-marker-icon {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: #ff7a00;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 2px rgba(36, 28, 22, .18));
}

.msa-personal-marker-icon circle {
  fill: #fff;
  stroke: none;
}

.msa-personal-marker-icon .msa-personal-marker-dot {
  fill: #ff7a00;
}

.msa-map-zoom button:disabled {
  color: #adb4ba;
  background: #f5f6f7;
  cursor: not-allowed;
}

/* 1.3.1 — progressive map loading, bilingual labels and header alignment */
.msa-biome-canvas {
  filter: none;
}

.msa-map-stage.is-loading-view::after {
  display: none;
  content: none;
  backdrop-filter: none;
}

.msa-brand-icon {
  direction: ltr;
  display: grid;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 4px;
  place-content: center;
  align-self: center;
  transform: none !important;
}

.msa-brand-icon i {
  width: 10px;
  height: 10px;
  border-radius: 2.5px;
}

.msa-feature-chip {
  min-height: 74px;
  align-items: center;
}

.msa-chip-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 1px;
  line-height: 1.3;
}

.msa-feature-chip .msa-chip-copy b,
.msa-feature-chip .msa-chip-copy small,
.msa-feature-chip .msa-chip-copy em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msa-feature-chip .msa-chip-copy b {
  font-size: 10px;
  line-height: 1.45;
}

.msa-feature-chip .msa-chip-copy small {
  margin: 0;
  color: #7e8992;
  font-size: 8px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.35;
  direction: ltr;
  text-align: left;
}

.msa-feature-chip .msa-chip-copy em {
  margin-top: 1px;
  color: #b45a18;
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.3;
}

.msa-feature-chip.is-active .msa-chip-copy small {
  color: #a75b24;
}

.msa-biome-readout-en {
  direction: ltr;
  color: #7b8690 !important;
  font-size: 9px !important;
  text-align: right;
}

.msa-tooltip .msa-tooltip-en,
.msa-marker-label small {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, .72);
  font-size: 8px;
  font-weight: 650;
  line-height: 1.35;
  direction: ltr;
  text-align: left;
}

.msa-search-results > button small[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

.msa-search-results > button em {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: #a78368;
  font-size: 8px;
  font-style: normal;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msa-image-section .msa-guide-figure {
  margin-top: 0;
}

@media (max-width: 520px) {
  .msa-brand-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    grid-template-columns: repeat(2, 9px);
    grid-template-rows: repeat(2, 9px);
    gap: 4px;
  }

  .msa-brand-icon i {
    width: 9px;
    height: 9px;
  }

  .msa-feature-chip {
    min-height: 70px;
  }
}

.msa-map-stage canvas,
.msa-map-stage.is-zooming canvas {
  filter: none;
  transition: none;
}
