:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e7edf5;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --accent-hover: #5ba3ff;
  --load-folder: #22c55e;
  --load-folder-hover: #16a34a;
  --load-explorer: #a855f7;
  --load-explorer-hover: #9333ea;
  --db-register: #2dd4bf;
  --db-register-muted: #14b8a6;
  --warn-bg: #3d2a1f;
  --warn-border: #8b5a3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.hero h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-page {
  margin-bottom: 0.25rem;
}

.hero-page .lede a {
  color: var(--accent);
}

.nav-back {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.nav-back a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.nav-back a:hover {
  text-decoration: underline;
}

.cards-pages--home {
  margin-top: 1.25rem;
}

@media (min-width: 960px) {
  .cards-pages--home {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

.page-card-body--cta {
  padding-top: 0.5rem;
}

.card-home-detail {
  margin: 0 0 1rem;
}

.btn-card-go {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 0.65rem 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
}

.page-card--solo {
  margin-top: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.page-card--solo.page-card-create {
  border-top: 4px solid var(--accent);
}

.page-card--solo.page-card-load {
  border-top: 4px solid var(--load-explorer);
}

.page-card--solo .page-card-body {
  padding: 1rem 1.35rem 1.5rem;
}

.panel-server-fs {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
  border-left: 4px solid #f59e0b;
}

.server-fs-root {
  margin-top: 0.75rem;
}

.server-fs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.65rem;
}

.server-fs-auto-label {
  font-size: 0.85rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.server-fs-breadcrumb {
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
  line-height: 1.6;
}

.server-fs-crumb {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.server-fs-crumb-sep {
  color: var(--muted);
  text-decoration: none;
}

.server-fs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(40vh, 360px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.server-fs-item {
  border-bottom: 1px solid var(--border);
}

.server-fs-item:last-child {
  border-bottom: none;
}

.server-fs-item-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.server-fs-item-btn:hover {
  background: rgba(61, 139, 253, 0.12);
}

.server-fs-item--dir .server-fs-item-btn {
  font-weight: 500;
}

.server-fs-size {
  color: var(--muted);
  font-size: 0.8em;
}

.server-fs-fullpath {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88rem;
  word-break: break-all;
}

.server-fs-empty {
  padding: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Grelha (dbgrid) — colunas alinhadas, tipo Buscar */
.server-fs-list--dbgrid {
  max-height: min(36vh, 380px);
}

.server-fs-list--dbgrid .server-fs-grid-btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.25rem 4.75rem;
  gap: 0.45rem 0.65rem;
  align-items: center;
  text-align: left;
  padding: 0.5rem 0.65rem;
}

.server-fs-list--dbgrid .server-fs-grid-path {
  min-width: 0;
}

.server-fs-list--dbgrid .server-fs-grid-type {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: right;
}

.server-fs-list--dbgrid .server-fs-grid-size {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: ui-monospace, Consolas, monospace;
  text-align: right;
}

.server-fs-item.is-selected {
  background: rgba(61, 139, 253, 0.16);
}

.server-fs-item.is-selected .server-fs-grid-btn:hover {
  background: rgba(61, 139, 253, 0.08);
}

@media (max-width: 420px) {
  .server-fs-list--dbgrid .server-fs-grid-btn {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .server-fs-list--dbgrid .server-fs-grid-type,
  .server-fs-list--dbgrid .server-fs-grid-size {
    text-align: left;
  }
}

.server-fs-msg--err {
  color: #fca5a5;
}

.save-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.save-actions-row .btn-create-submit {
  flex: 1;
  min-width: 140px;
}

.server-save-path-input {
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 0.88rem;
}

.panel-alert-global {
  margin-top: 1.25rem;
}

.cards-pages {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (min-width: 960px) {
  .cards-pages {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.page-card-create {
  border-top: 4px solid var(--accent);
}

.page-card-load {
  border-top: 4px solid var(--load-explorer);
}

.page-card-db {
  border-top: 4px solid var(--db-register);
}

.page-card--solo.page-card-db {
  border-top: 4px solid var(--db-register);
}

.page-card-head {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}

.page-card-title {
  margin: 0 0 0.45rem;
  font-size: 1.12rem;
  font-weight: 600;
}

.page-card-lede {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.page-card-body {
  padding: 0.35rem 1.35rem 1.35rem;
}

.card-section {
  padding: 1rem 0;
}

.card-section:first-of-type {
  padding-top: 0.85rem;
}

.card-section-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.card-section-title-scenario {
  color: #5eead4;
}

.card-section-intro {
  margin: 0 0 1rem;
}

.card-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.panel-create-inner {
  border-left: 3px solid var(--accent);
  padding-left: 0.85rem;
  margin-left: -0.15rem;
}

.panel-load-inner {
  border-left: 3px solid var(--load-folder);
  padding-left: 0.85rem;
  margin-left: -0.15rem;
}

.panel-db-inner {
  border-left: 3px solid var(--db-register-muted);
  padding-left: 0.85rem;
  margin-left: -0.15rem;
}

.registro-flash {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.registro-flash--ok {
  border: 1px solid rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.12);
}

.registro-flash--err {
  border: 1px solid rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.1);
}

.registro-form .row {
  margin-bottom: 0.65rem;
}

.registro-form select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: inherit;
}

.panel-scenario-inner {
  border-left: 3px solid #14b8a6;
  padding-left: 0.85rem;
  margin-left: -0.15rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
  margin-top: 1.25rem;
}

.panel h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.panel-scenario-inner .scenario-placeholder {
  margin-top: 0.65rem;
}

.file-preview-block--in-card {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.html-page-preview-wrap--in-card:not([hidden]) {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.file-preview-block {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.file-preview-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.file-preview-hint {
  margin: 0;
}

.file-preview-box {
  margin-top: 0.65rem;
}

.file-preview-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.html-page-preview-wrap {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.html-page-preview-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.html-page-preview-lede {
  margin: 0 0 0.75rem;
}

.html-page-preview-actions {
  margin-bottom: 0.65rem;
}

.btn-html-tab {
  font-weight: 600;
}

.html-page-frame {
  display: block;
  width: 100%;
  min-height: 280px;
  height: min(50vh, 420px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.file-preview-body {
  margin: 0;
  padding: 0.85rem 1rem;
  max-height: min(55vh, 520px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  tab-size: 2;
}

.scenario-placeholder {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(20, 184, 166, 0.06);
}

.scenario-placeholder-text {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.scenario-editor-root {
  margin-top: 0.75rem;
}

.scenario-root .row {
  margin-bottom: 0.85rem;
}

.scenario-meta.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .scenario-meta.grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.scenario-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.65rem;
}

.scenario-bar-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.scenario-cenas-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.scenario-chip {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.scenario-chip:hover:not(:disabled) {
  border-color: var(--muted);
}

.scenario-chip.is-active {
  border-color: #14b8a6;
  background: rgba(20, 184, 166, 0.18);
  color: #ccfbf1;
}

.panel-inner {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-top: 0.35rem;
}

.scenario-opcoes-head {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.9rem;
}

.scenario-opcao-row {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 160px) auto;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

@media (max-width: 560px) {
  .scenario-opcao-row {
    grid-template-columns: 1fr;
  }
}

.scenario-detail-actions {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.btn-sm {
  padding: 0.38rem 0.65rem;
  font-size: 0.82rem;
}

.btn-danger {
  border-color: #b45309;
  background: rgba(180, 83, 9, 0.15);
  color: #fed7aa;
}

.btn-danger:hover:not(:disabled) {
  border-color: #ea580c;
  background: rgba(234, 88, 12, 0.22);
}

.btn-icon {
  width: 2rem;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

select {
  width: 100%;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.row {
  margin-bottom: 1rem;
}

.row label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

input[type="text"],
textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.btn {
  padding: 0.55rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  border-color: var(--muted);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-create-submit {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.65rem 1rem;
  font-weight: 600;
}

.load-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.btn-load-folder {
  width: 100%;
  padding: 0.65rem 1rem;
  font-weight: 600;
  border-color: var(--load-folder);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.btn-load-folder:hover:not(:disabled) {
  border-color: var(--load-folder-hover);
  background: rgba(34, 197, 94, 0.22);
}

.btn-load-explorer {
  width: 100%;
  padding: 0.65rem 1rem;
  font-weight: 600;
  border-color: var(--load-explorer);
  background: rgba(168, 85, 247, 0.14);
  color: #e9d5ff;
}

.btn-load-explorer:hover:not(:disabled) {
  border-color: var(--load-explorer-hover);
  background: rgba(168, 85, 247, 0.24);
}

.muted {
  color: var(--muted);
  margin: 0.65rem 0 0;
}

.muted.small {
  font-size: 0.85rem;
}

.warn {
  margin: 0;
  padding: 0.85rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  font-size: 0.9rem;
}

code {
  font-size: 0.85em;
  background: var(--bg);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

.wrap--fluid {
  max-width: 1400px;
}

.map-db-banner {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.map-db-banner--ok {
  border: 1px solid rgba(20, 184, 166, 0.5);
  background: rgba(20, 184, 166, 0.12);
}

.map-db-banner--err {
  border: 1px solid rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.1);
}

.map-inv-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

.map-inv-modal[hidden] {
  display: none !important;
}

.map-inv-modal-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(15, 23, 42, 0.62);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.map-inv-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  background: var(--surface);
  border: none;
  border-radius: 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35);
  align-self: stretch;
}

.map-inv-modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  padding-top: max(0.65rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.map-inv-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.map-inv-modal-close {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.map-inv-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.map-inv-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 0.85rem 1rem;
}

.map-inv-modal-lede {
  margin: 0.75rem 0 0.65rem !important;
}

@media (min-width: 640px) {
  .map-inv-modal {
    align-items: center;
    padding: 1rem;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
      max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  }

  .map-inv-modal-panel {
    width: 100%;
    max-width: 440px;
    height: auto;
    max-height: min(88vh, 680px);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    align-self: center;
  }

  .map-inv-modal-head {
    padding-top: 0.75rem;
    border-radius: 12px 12px 0 0;
  }
}

.map-inv-open-btn {
  border-color: rgba(20, 184, 166, 0.55) !important;
  background: rgba(20, 184, 166, 0.14) !important;
  color: #99f6e4 !important;
}

.map-inv-open-btn:hover:not(:disabled) {
  border-color: var(--db-register-muted) !important;
  background: rgba(20, 184, 166, 0.22) !important;
}

.map-inv-cancel-full {
  width: 100%;
  margin-top: 0.75rem;
}

.map-inv-panel .map-inv-filter-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.map-inv-select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: inherit;
}

.map-inv-pending {
  margin: 0.35rem 0 0.5rem;
  min-height: 1.25em;
}

.map-inv-list-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  max-height: 220px;
  overflow: auto;
}

.map-inv-modal .map-inv-list-ul {
  max-height: none;
  min-height: 120px;
}

.map-inv-list-li {
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 0.2rem;
  border: 1px solid transparent;
}

.map-inv-list-li:hover {
  background: rgba(61, 139, 253, 0.1);
}

.map-editor-hero {
  margin-bottom: 0.5rem;
}

.map-editor-app {
  margin-top: 0.5rem;
}

.map-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.map-editor-path-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 200px;
  flex: 1 1 220px;
}

.map-editor-path-input {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
}

.map-editor-sep {
  width: 1px;
  height: 1.5rem;
  background: var(--border);
  margin: 0 0.25rem;
}

.map-editor-mini {
  font-size: 0.8rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.map-editor-mini input {
  width: 5rem;
  padding: 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.map-mode-btn.is-active {
  border-color: var(--accent);
  background: rgba(61, 139, 253, 0.2);
  color: #bfdbfe;
}

.map-editor-status {
  flex: 1 1 100%;
  margin: 0;
}

@media (min-width: 720px) {
  .map-editor-status {
    flex: 1 1 auto;
    text-align: right;
  }
}

.map-editor-body {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 960px) {
  .map-editor-body {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  }
}

.map-editor-fs-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem 1rem;
  border-left: 4px solid #f59e0b;
}

.map-editor-fs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.map-editor-fs-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.map-editor-fs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
}

.map-editor-fs-hint {
  margin: 0 0 0.5rem !important;
}

.map-server-fs-root {
  margin-top: 0.25rem;
}

.map-server-fs-msg {
  margin-top: 0.5rem !important;
  margin-bottom: 0 !important;
}

@media (min-width: 960px) {
  .map-editor-fs-panel {
    position: sticky;
    top: 0.35rem;
    max-height: calc(100vh - 5rem);
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .map-editor-fs-panel .map-server-fs-root {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .map-editor-fs-panel .server-fs-list--dbgrid {
    flex: 1 1 auto;
    min-height: 200px;
    max-height: none;
    overflow: auto;
  }
}

.map-editor-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .map-editor-main {
    grid-template-columns: 1fr;
  }
}

.map-editor-canvas-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
}

#map-editor-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  cursor: crosshair;
  background: #1e3a2a;
}

.map-editor-hint {
  margin: 0.5rem 0 0;
}

.map-editor-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  max-height: 80vh;
  overflow: auto;
}

.map-editor-side-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.map-editor-side-title:not(:first-child) {
  margin-top: 1.25rem;
}

.map-selection-form .row {
  margin-bottom: 0.65rem;
}

.map-editor-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.map-list-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.map-list-li {
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
}

.map-list-li:hover {
  background: rgba(61, 139, 253, 0.1);
}

.map-list-li.is-active {
  border-color: var(--accent);
  background: rgba(61, 139, 253, 0.15);
}

.map-editor-cta {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid #14b8a6;
  background: rgba(20, 184, 166, 0.1);
}

.map-editor-cta p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

input[type="color"] {
  width: 100%;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  background: var(--bg);
}
