*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #11141b;
  color: #f5f5f5;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #181c24;
  border-bottom: 1px solid #262b37;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.subtitle {
  font-size: 11px;
  opacity: 0.7;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-right {
  display: flex;
  gap: 12px;
}

.header-link {
  font-size: 13px;
  color: #cfd4ff;
  text-decoration: none;
  opacity: 0.8;
}

.header-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Layout */

.page-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 1.4fr);
  gap: 16px;
  padding: 12px 16px 18px;
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Panel */

.panel {
  background: #171b25;
  border-radius: 8px;
  border: 1px solid #272d3b;
  padding: 10px 12px 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.panel-tight {
  padding-bottom: 8px;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.panel-row.sliders {
  flex-wrap: wrap;
  align-items: flex-start;
}

.panel-heading {
  font-size: 15px;
  font-weight: 600;
  margin: 2px 0 6px;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
}

/* Fields */

.field-label {
  min-width: 60px;
  font-size: 13px;
}

.field-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

input[type="text"],
select {
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #3a4256;
  background: #0f1219;
  color: #e6e8f5;
  outline: none;
}

input[type="text"]:focus,
select:focus {
  border-color: #4c8dff;
  box-shadow: 0 0 0 1px rgba(76, 141, 255, 0.4);
}

select {
  min-width: 220px;
}

/* Buttons */

.btn {
  border-radius: 4px;
  border: 1px solid #3a4256;
  background: linear-gradient(180deg, #323a4e, #252b3c);
  color: #e7ebff;
  font-size: 13px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-sm {
  font-size: 12px;
  padding: 3px 8px;
}

.btn:hover {
  background: linear-gradient(180deg, #3a435a, #2a3144);
  border-color: #4c8dff;
}

.btn:active {
  transform: translateY(1px);
}

/* Dimension buttons */

.dim-buttons {
  display: inline-flex;
  gap: 4px;
}

.dim-btn {
  border-radius: 999px;
  border: 1px solid #3a4256;
  background: #111722;
  color: #cfd4ff;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
}

.dim-btn-active {
  background: #2f7cff;
  border-color: #5da2ff;
  color: #ffffff;
}

/* Layers */

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #2b3242;
  background: #101521;
  font-size: 12px;
}

.feature-pill input {
  margin: 0;
}

/* POI toggles */

.poi-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.poi-toggle {
  border-radius: 999px;
  border: 1px solid #394056;
  background: #121927;
  color: #e4e7ff;
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  opacity: 0.6;
}

.poi-toggle.poi-active {
  opacity: 1;
  background: #3d9b4d;
  border-color: #5fd470;
  color: #ffffff;
}

/* Sliders */

.slider-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1;
}

.slider-group label {
  font-size: 12px;
  opacity: 0.8;
}

input[type="range"] {
  width: 100%;
}

/* Map */

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.map-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  opacity: 0.9;
}

.map-container {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #272e3f;
  background: #05070b;
}

#mapCanvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
}

#mapCanvas.dragging {
  cursor: grabbing;
}

/* Map controls row */

.map-controls-row {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.goto-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.group-label {
  font-size: 12px;
  opacity: 0.8;
}

.coord-input {
  width: 80px;
  font-size: 12px;
}

.share-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.share-status {
  font-size: 11px;
  opacity: 0.8;
}

/* Map hint */

.map-hint {
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.8;
}

.map-hint ul {
  margin: 0;
  padding-left: 18px;
}

/* Sidebar text */

.bullet-list {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 13px;
}

.bullet-list li {
  margin-bottom: 4px;
}

.def-list {
  margin: 4px 0 0;
}

.def-list dt {
  margin-top: 6px;
  font-weight: 600;
  font-size: 13px;
}

.def-list dd {
  margin-left: 0;
  font-size: 13px;
  opacity: 0.9;
}

.small-text {
  font-size: 12px;
  opacity: 0.8;
}

/* Responsive */

@media (max-width: 980px) {
  .page-main {
    grid-template-columns: minmax(0, 1fr);
  }
}
