* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1b1f24;
  color: #e8e8e8;
  font-family: system-ui, sans-serif;
}

#game {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  width: 100%;
  max-width: 1500px;
}

/* Obere Leiste: Werte links, Steuerung rechts */
#topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #262b33;
  padding: 8px 10px;
  border-radius: 6px;
}

#main {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

#left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#board { position: relative; align-self: flex-start; max-width: 100%; }

/* Gegner-Infos unter der Karte */
#enemy-info { display: flex; gap: 12px; align-items: flex-start; }
.info-block { display: flex; flex-direction: column; gap: 6px; }
.wave-block { flex: 1; min-width: 0; }
.stats-block { width: 220px; flex-shrink: 0; }
#wave-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px 14px;
  min-height: 40px;
}

@media (max-width: 900px) {
  #main { flex-direction: column; }
  #left { width: 100%; }
  #main #sidebar { width: 100%; }
  #enemy-info { flex-direction: column; }
  .stats-block { width: 100%; }
}

canvas {
  display: block;
  max-width: 100%;
  /* große Karten auf die Fensterhöhe verkleinern, Seitenverhältnis bleibt */
  max-height: calc(100vh - 110px);
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  cursor: crosshair;
}

#sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

h3 { margin: 6px 0 0; font-size: 15px; color: #aab; }

.stats {
  display: flex;
  gap: 22px;
  font-weight: 600;
  font-size: 17px;
  padding-left: 6px;
}

button {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #3a414c;
  border-radius: 6px;
  background: #2d333d;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
button:hover:not(:disabled) { background: #39414d; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.active { border-color: #ffd54f; background: #3d3a2a; }

#shop { display: flex; flex-direction: column; gap: 6px; }
.shop-item { display: flex; align-items: center; gap: 8px; }
.shop-item .dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.shop-item .cost { margin-left: auto; color: #ffd54f; }
.shop-item small { display: block; color: #99a; font-size: 11px; }

#selection {
  background: #262b33;
  padding: 10px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#sel-stats { font-size: 13px; color: #ccd; line-height: 1.5; }

.controls { display: flex; gap: 6px; flex-wrap: wrap; }
.controls button { width: auto; text-align: center; white-space: nowrap; }
.controls button.primary { background: #2e5d34; border-color: #3f7a46; min-width: 190px; }
.controls button.primary:hover:not(:disabled) { background: #387040; }

.help { font-size: 12px; color: #889; line-height: 1.5; }

.hidden { display: none !important; }

#overlay, .modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
#overlay .box { text-align: center; }
#overlay button { text-align: center; width: auto; padding: 10px 24px; }

.settings-box {
  text-align: left !important;
  background: #262b33;
  padding: 20px 24px;
  border-radius: 8px;
  width: 860px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  overflow-y: auto;
}
.settings-box h2 { margin: 0 0 12px; }
.settings-box .row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  cursor: pointer;
}
.settings-box .row.indent { padding-left: 26px; }
.settings-box .row small { display: block; color: #99a; font-size: 11px; }
.settings-box input[type=checkbox] { width: 16px; height: 16px; flex-shrink: 0; }
.settings-box input[type=range] { flex: 1; }
.settings-box select {
  margin-left: auto;
  background: #2d333d;
  color: inherit;
  border: 1px solid #3a414c;
  border-radius: 4px;
  padding: 4px 8px;
}
.settings-box .row.disabled { opacity: 0.4; pointer-events: none; }
.settings-box .buttons { display: flex; gap: 8px; margin-top: 14px; }
.settings-box .buttons button { text-align: center; }

.panel {
  background: #262b33;
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.enemy-row { display: flex; align-items: center; gap: 8px; }
.enemy-row img { width: 22px; height: 22px; flex-shrink: 0; }
.enemy-row small { display: block; color: #99a; font-size: 11px; }
.enemy-row b { margin-left: auto; }
.stat-line { display: flex; justify-content: space-between; }
/* Festes Raster mit 3 Spalten, damit die Gegner-Icons sauber untereinander stehen */
.stat-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 8px;
  color: #ccd;
  padding: 2px 0 4px;
}
.stat-chip { display: flex; align-items: center; gap: 4px; min-width: 0; }
.stat-chip img { width: 18px; height: 18px; flex-shrink: 0; }
.stat-chip span { font-variant-numeric: tabular-nums; }

.settings-box h3.section {
  margin: 14px 0 4px;
  padding-top: 10px;
  border-top: 1px solid #3a414c;
}
.settings-box .label { width: 50px; }
.settings-box .value { width: 26px; text-align: right; }
.settings-box .presets { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.settings-box .presets button { width: auto; flex: 1; text-align: center; font-size: 13px; padding: 6px 8px; white-space: nowrap; }
.settings-box .apply { text-align: center; margin-top: 4px; }
.settings-box .note { display: block; color: #889; font-size: 11px; margin-top: 4px; }

/* Einstellungen über dem ganzen Fenster, unabhängig von der Kartengröße */
#settings { position: fixed; z-index: 10; border-radius: 0; }
.settings-box .indent-block { padding-left: 26px; }

/* ---------- Forschung ---------- */
#research { position: fixed; z-index: 10; border-radius: 0; }
.research-box {
  background: #262b33;
  padding: 18px 22px;
  border-radius: 8px;
  width: 1140px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  overflow-y: auto;
  text-align: left !important;
}
.research-head { display: flex; justify-content: space-between; align-items: center; }
.research-head h2 { margin: 0; }
.research-head .fp { font-size: 20px; color: #b39ddb; }
.research-box .note { color: #99a; font-size: 12px; margin: 6px 0 12px; min-height: 1em; }
#research-note { color: #ffd54f; }
.research-box .buttons { display: flex; justify-content: flex-end; }
.research-box .buttons button { width: auto; text-align: center; padding: 8px 24px; }

#research-tree {
  display: grid;
  /* Spaltenzahl = sichtbare Zweige, wird per JS gesetzt */
  grid-template-columns: repeat(var(--cols, 5), 1fr);
  gap: 14px;
}
.rbranch { display: flex; flex-direction: column; align-items: stretch; }
.rbranch h3 { margin: 0 0 8px; text-align: center; }
.rlink { width: 2px; height: 14px; background: #4a5260; margin: 0 auto; }

.rnode {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #3a414c;
  background: #2d333d;
  min-height: 96px;
}
.rnode .rname { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.rnode .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.rnode small { color: #aab; font-size: 12px; line-height: 1.35; }
.rnode .rfoot { margin-top: auto; display: flex; justify-content: space-between; font-size: 12px; color: #99a; }
.rnode .rfoot b { color: #b39ddb; }
.rnode.unlock { border-style: dashed; }

.rnode.done { border-color: #43a047; background: #24382a; }
.rnode.done .rfoot span { color: #81c784; }
.rnode.available { border-color: #b39ddb; box-shadow: 0 0 0 1px #b39ddb inset; }
.rnode.available:hover { background: #3a3550; }
.rnode.available .rfoot span { color: #d1c4e9; font-weight: 600; }
.rnode.expensive { opacity: 0.75; }
.rnode.locked { opacity: 0.4; }
.rnode.highlight { outline: 2px solid #ffd54f; outline-offset: 2px; }

@media (max-width: 900px) {
  .research-body { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  #research-tree { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  #research-tree { grid-template-columns: repeat(2, 1fr); }
}

/* Gesperrte Türme im Shop */
.shop-item.locked { opacity: 0.5; }
.shop-item.locked .cost { color: inherit; }

/* Forschungs-Button leuchtet, wenn etwas erforscht werden kann */
#open-research.glow { border-color: #b39ddb; box-shadow: 0 0 8px rgba(179, 157, 219, 0.6); }

/* ---------- Turmwerte ---------- */
.shop-item .tstats { color: #bbc; font-size: 11px; margin-top: 2px; }
.shop-item .tstats span { margin-right: 4px; white-space: nowrap; }
.boost { color: #b39ddb !important; font-weight: 600; }

.stat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stat-table td { padding: 2px 0; }
.stat-table td:nth-child(2) { text-align: right; font-weight: 600; padding-right: 6px; }
.stat-table td.boost { text-align: right; font-size: 11px; width: 52px; }
.stat-table tr.dps td { border-top: 1px solid #3a414c; padding-top: 4px; }
.next-level { margin-top: 6px; font-size: 11px; color: #99a; }
.tower-record {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #3a414c;
  display: flex;
  flex-direction: column;
  font-size: 12px;
}
.tower-record span:first-child { color: #99a; font-size: 11px; }

.dmg-title { margin-top: 6px; padding-top: 6px; border-top: 1px solid #3a414c; }
.dmg-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.dmg-name { width: 78px; flex-shrink: 0; color: #ccd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmg-bar { flex: 1; height: 6px; background: #1b1f24; border-radius: 3px; overflow: hidden; }
.dmg-bar span { display: block; height: 100%; border-radius: 3px; }
.dmg-val { width: 44px; text-align: right; color: #ccd; }

.rnode .rpreview { font-size: 11px; color: #d1c4e9; line-height: 1.4; }

/* ---------- Schwierigkeit ---------- */
.settings-box h3.section.first { margin-top: 0; padding-top: 0; border-top: none; }
#difficulty-options button.active { border-color: #ffd54f; background: #3d3a2a; }
.badge {
  align-self: center;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #3a414c;
}
.badge.easy { background: #2e5d34; }
.badge.hard { background: #8a5a14; }
.badge.nightmare { background: #7f1d1d; }

/* Luft/Boden-Kennzeichnung der Türme */
.tstats .air { color: #f48fb1; }
.tstats .ground-only { color: #8d6e63; font-size: 10px; border: 1px solid #5d4037; border-radius: 3px; padding: 0 3px; }

.tstats .air-only { color: #9fa8da; font-size: 10px; border: 1px solid #3949ab; border-radius: 3px; padding: 0 3px; }

/* Einstellungen zweispaltig, auf schmalen Bildschirmen untereinander */
.settings-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.settings-col { min-width: 0; }
@media (max-width: 760px) {
  .settings-cols { grid-template-columns: 1fr; }
  .settings-col + .settings-col h3.section.first {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #3a414c;
  }
}

/* ---------- Forschung zweispaltig: Baum links, Details rechts ---------- */
.research-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  align-items: start;
}
.research-side { display: flex; flex-direction: column; gap: 12px; }
.rpanel {
  background: #20242b;
  border: 1px solid #3a414c;
  border-radius: 8px;
  padding: 12px 14px;
}
.rpanel h3 { margin: 0 0 8px; }
.research-side #research-note { margin: 8px 0 0; min-height: 0; }

/* kompakte Karten im Baum */
.rnode { min-height: 0; gap: 6px; padding: 8px 10px; cursor: pointer; }
.rnode.selected { outline: 2px solid #fff; outline-offset: 2px; }
.rnode.locked { opacity: 0.45; }

.rd-branch { font-size: 11px; color: #99a; text-transform: uppercase; letter-spacing: 0.04em; }
.rd-name { margin: 4px 0 6px !important; font-size: 17px; color: #e8e8e8; display: flex; align-items: center; gap: 8px; }
.rd-name .dot { width: 14px; height: 14px; border-radius: 50%; }
.rd-desc { margin: 0 0 10px; font-size: 13px; color: #ccd; line-height: 1.45; }
.rd-block { margin-bottom: 10px; }
.rd-label { display: block; font-size: 11px; color: #99a; margin-bottom: 3px; }
.rd-block .rpreview { font-size: 12px; }
.rd-reqs { margin: 0; padding: 0; list-style: none; font-size: 12px; }
.rd-reqs .ok { color: #81c784; }
.rd-reqs .missing { color: #ef9a9a; }
.rd-button { text-align: center; font-weight: 600; margin-top: 2px; }
.rd-button.available { background: #4a3f6b; border-color: #b39ddb; }
.rd-button.available:hover:not(:disabled) { background: #5a4d80; }

.bonus-list { margin: 0; padding: 0; list-style: none; font-size: 12px; color: #ccd; line-height: 1.5; }
.bonus-list li + li { margin-top: 4px; }
.bonus-list b { color: #d1c4e9; font-weight: 600; }
.bonus-list .empty { color: #889; }

/* Baum darf schrumpfen, statt das Fenster waagerecht scrollen zu lassen */
.research-body { grid-template-columns: minmax(0, 1fr) 300px; }
#research-tree { min-width: 0; gap: 10px; }
.rbranch { min-width: 0; }
.rnode { min-width: 0; }
.rnode .rname { font-size: 13px; hyphens: auto; overflow-wrap: break-word; }
.rnode .rfoot { flex-wrap: wrap; gap: 0 6px; }
.rnode .rfoot b { white-space: nowrap; margin-left: auto; }
.rbranch h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1200px) {
  .research-body { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 900px) {
  .research-body { grid-template-columns: 1fr; }
}

.controls button.icon-button { min-width: 40px; padding-left: 8px; padding-right: 8px; }

/* ---------- Game Over & Highscore ---------- */
#overlay { position: fixed; z-index: 9; border-radius: 0; }
.gameover-box, .hs-box {
  background: #262b33;
  padding: 20px 24px;
  border-radius: 8px;
  width: 720px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  overflow-y: auto;
}
.gameover-box h2 { margin: 0 0 6px; font-size: 28px; }
.gameover-box p { margin: 4px 0; color: #ccd; }
.final-score { font-size: 30px; margin: 10px 0 2px; }
.final-score b { color: #ffd54f; }
.rank { font-weight: 600; }
.rank.record { color: #ffd54f; }
.name-row { display: flex; gap: 8px; justify-content: center; margin: 12px 0; }
.name-row input {
  flex: 1;
  max-width: 320px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #3a414c;
  background: #1b1f24;
  color: inherit;
  font: inherit;
}
#overlay .name-row button { padding: 8px 16px; }
.gameover-box .buttons, .hs-box .buttons { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
#overlay .buttons button.primary { background: #2e5d34; border-color: #3f7a46; }

.hs-box { text-align: left; width: 820px; }
.hs-box h2 { margin: 0 0 12px; }
.hs-box .note { color: #889; font-size: 12px; margin: 12px 0 0; line-height: 1.5; }
.hs-box .buttons { justify-content: flex-end; }
.hs-box .buttons button { width: auto; text-align: center; padding: 8px 18px; }
#hs-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
#hs-filter button { width: auto; text-align: center; padding: 6px 14px; }
#hs-filter button.active { border-color: #ffd54f; background: #3d3a2a; }

.hs-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.hs-table th { color: #889; font-weight: 500; font-size: 11px; padding: 4px 6px; border-bottom: 1px solid #3a414c; }
.hs-table td { padding: 6px; border-bottom: 1px solid #2d333d; }
.hs-table .num { text-align: right; }
.hs-table .rank { width: 32px; text-align: center; }
.hs-table .name small { display: block; color: #889; font-size: 10px; }
.hs-table .dim { color: #99a; font-size: 12px; }
.hs-table tr.current td { background: #3d3a2a; }
.hs-table b { color: #ffd54f; }
.hs-empty { color: #889; text-align: center; padding: 16px 0; }
/* Highscore-Fenster über allem, auch über dem Game-Over-Bildschirm */
#highscores { position: fixed; z-index: 11; border-radius: 0; }

/* ---------- Kartenauswahl ---------- */
#maps { position: fixed; z-index: 11; border-radius: 0; }
.maps-box {
  background: #262b33;
  padding: 20px 24px;
  border-radius: 8px;
  width: 980px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  overflow-y: auto;
  text-align: left !important;
}
.maps-box h2 { margin: 0 0 4px; }
.maps-box .note { color: #889; font-size: 12px; margin: 0 0 14px; }
.maps-box .buttons { display: flex; justify-content: flex-end; margin-top: 14px; }
.maps-box .buttons button { width: auto; text-align: center; padding: 8px 18px; }
#map-list, .map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.map-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #3a414c;
}
.map-card:hover { border-color: #6b7686; }
.map-card.active { border-color: #ffd54f; background: #33322a; }
.map-card canvas {
  width: 100%;
  height: 130px;
  object-fit: contain;
  background: #1b1f24;
  border-radius: 4px;
  image-rendering: pixelated;
}
.map-title { font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; }
.map-title small { color: #889; font-weight: 400; }
.map-desc { font-size: 12px; color: #aab; line-height: 1.4; }
.map-best { font-size: 12px; color: #ffd54f; margin-top: auto; }

/* Einstellungen: Abschnitt „Eigene Karte“ gesperrt, wenn eine feste Karte aktiv ist */
#custom-map-settings.locked { opacity: 0.4; pointer-events: none; }
#custom-map-note b { color: #e8e8e8; }

/* Highscore: Filter nach Schwierigkeit und Karte */
.hs-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.hs-filters #hs-filter { margin-bottom: 0; }
#hs-map-filter {
  background: #2d333d;
  color: inherit;
  border: 1px solid #3a414c;
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
}
.hs-table td.dim small { display: block; font-size: 10px; color: #778; }

/* ---------- Kartenauswahl: eigene Karten ---------- */
.map-card { cursor: pointer; background: #2d333d; text-align: left; }
.maps-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.maps-head button { width: auto; text-align: center; }
.maps-section { margin: 18px 0 8px; }
.own-tag { font-size: 10px; font-weight: 600; color: #b39ddb; border: 1px solid #5e548e; border-radius: 4px; padding: 0 4px; }
.map-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.map-edit { width: auto; font-size: 11px; padding: 3px 8px; }
.map-card.new-map {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
  min-height: 200px;
}
.new-map-plus { font-size: 40px; color: #889; }
.map-card.new-map .map-title { justify-content: center; }

/* ---------- Karteneditor ---------- */
#editor { position: fixed; z-index: 12; border-radius: 0; }
.editor-box {
  background: #262b33;
  padding: 18px 22px;
  border-radius: 8px;
  width: 1180px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  overflow-y: auto;
  text-align: left !important;
}
.editor-box h2 { margin: 0; }
.editor-head-buttons { display: flex; gap: 8px; }
.editor-head-buttons select, .editor-side input, .editor-side textarea {
  background: #1b1f24;
  color: inherit;
  border: 1px solid #3a414c;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}
.editor-head-buttons button { width: auto; }
.editor-body { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; margin-top: 14px; align-items: start; }
.editor-canvas-wrap { min-width: 0; }
#editor-canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 260px);
  width: auto;
  height: auto;
  cursor: crosshair;
  touch-action: none;
  border-radius: 6px;
}
.editor-status { margin-top: 8px; font-weight: 600; font-size: 13px; }
.editor-status.ok { color: #81c784; }
.editor-status.error { color: #ef9a9a; }
.editor-canvas-wrap .note, .editor-note { color: #889; font-size: 12px; margin: 6px 0 0; }
.editor-note { color: #ffd54f; min-height: 1em; }
.editor-side { display: flex; flex-direction: column; gap: 8px; }
.editor-side h3 { margin: 8px 0 0; font-size: 13px; }
.editor-side h3 small { color: #889; font-weight: 400; }
.editor-side input, .editor-side textarea { width: 100%; resize: vertical; }
.editor-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.editor-tools button { text-align: left; padding: 7px 8px; }
.editor-tools button.active { border-color: #ffd54f; background: #3d3a2a; }
.editor-size-row { display: flex; align-items: center; gap: 6px; }
.editor-size-row input { width: 64px; }
.editor-size-row button { width: auto; flex: 1; text-align: center; }
.editor-side button.small { font-size: 12px; padding: 5px 8px; text-align: center; }
.editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.editor-actions button { text-align: center; padding: 7px 6px; font-size: 13px; }
.editor-actions button.primary { background: #2e5d34; border-color: #3f7a46; }
.editor-actions button.danger { border-color: #7f1d1d; color: #ef9a9a; }
.editor-share { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.editor-share button { text-align: center; }
.editor-box .buttons { display: flex; justify-content: flex-end; margin-top: 12px; }
.editor-box .buttons button { width: auto; padding: 8px 18px; }
@media (max-width: 900px) {
  .editor-body { grid-template-columns: 1fr; }
}

.editor-share button.wide { grid-column: 1 / -1; }
