:root {
  color-scheme: light;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #eef2f4;
  color: #18242d;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid #126d62;
  border-radius: 6px;
  background: #126d62;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 34px;
  padding: 7px 11px;
}

button:disabled {
  background: #d9e0e6;
  border-color: #d9e0e6;
  color: #71808e;
  cursor: not-allowed;
}

.button-secondary {
  background: #fff;
  border-color: #cfd8df;
  color: #40505e;
}

.dem-app {
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  height: 100vh;
}

.app-header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #d4dbe1;
  display: flex;
  gap: 18px;
  min-width: 0;
  padding: 0 18px;
  z-index: 2;
}

.home-link {
  color: #126d62;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.title-block {
  min-width: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
}

.title-block p {
  color: #607080;
  font-size: 0.82rem;
  line-height: 1.35;
  margin-top: 2px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  min-height: 0;
}

.dem-app--resizable .workspace {
  grid-template-columns: minmax(280px, var(--side-panel-width, 380px)) 7px minmax(0, 1fr);
}

.workspace.is-side-panel-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.dem-app--resizable .workspace.is-side-panel-collapsed {
  grid-template-columns: 0 0 minmax(0, 1fr);
}

.dem-app--resizable .side-panel {
  grid-column: 1;
}

.dem-app--resizable .workspace-resizer {
  grid-column: 2;
}

.dem-app--resizable .map-panel {
  grid-column: 3;
}

.side-panel {
  background: #fff;
  border-right: 1px solid #d4dbe1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.dem-app--resizable .side-panel {
  grid-template-rows:
    minmax(132px, var(--current-panel-height, 32%))
    7px
    minmax(118px, var(--points-panel-height, 1fr))
    7px
    minmax(132px, auto);
}

.workspace.is-side-panel-collapsed .side-panel {
  border-right: 0;
  pointer-events: none;
  visibility: hidden;
}

.tool-section {
  border-bottom: 1px solid #e2e7eb;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.section-resizer,
.workspace-resizer {
  background: #eef2f4;
  position: relative;
}

.section-resizer {
  border-bottom: 1px solid #d4dbe1;
  border-top: 1px solid #d4dbe1;
  cursor: row-resize;
}

.workspace-resizer {
  border-left: 1px solid #d4dbe1;
  border-right: 1px solid #d4dbe1;
  cursor: col-resize;
}

.section-resizer::before,
.workspace-resizer::before {
  background: #9eabb6;
  border-radius: 999px;
  content: "";
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.section-resizer::before {
  height: 2px;
  width: 34px;
}

.workspace-resizer::before {
  height: 34px;
  width: 2px;
}

.section-resizer:hover,
.section-resizer:focus-visible,
.workspace-resizer:hover,
.workspace-resizer:focus-visible {
  background: #dce8e5;
  outline: none;
}

.workspace.is-side-panel-collapsed .workspace-resizer {
  opacity: 0;
  pointer-events: none;
}

.tool-section h2 {
  color: #41505e;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading span {
  color: #607080;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.current-point {
  border: 1px solid #d9e0e6;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.empty-state {
  color: #667482;
  font-size: 0.9rem;
  line-height: 1.45;
}

.empty-state[data-kind="loading"] {
  color: #126d62;
  font-weight: 700;
}

.empty-state[data-kind="error"] {
  color: #b3261e;
}

.point-details {
  display: grid;
  gap: 0;
}

.point-details div {
  border-top: 1px solid #edf0f2;
  display: grid;
  gap: 3px;
  padding: 8px 0;
}

.point-details div:first-child {
  border-top: 0;
  padding-top: 0;
}

.point-details dt {
  color: #667482;
  font-size: 0.76rem;
  font-weight: 700;
}

.point-details dd {
  font-size: 0.94rem;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.toolbar {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.points-section {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.point-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  min-height: 0;
  overflow: auto;
}

.point-item {
  border: 1px solid #d9e0e6;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.point-item.is-active {
  border-color: #126d62;
  box-shadow: inset 3px 0 0 #126d62;
}

.point-item-header {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.point-index {
  align-items: center;
  background: #126d62;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 7px;
}

.point-title {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.point-remove {
  background: #fff;
  border-color: #cfd8df;
  color: #40505e;
  min-height: 30px;
  padding: 4px 8px;
}

.point-meta {
  color: #526171;
  font-size: 0.82rem;
  line-height: 1.45;
}

.point-item-meta-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.point-item-meta-container .point-meta {
  margin-top: 0;
}

.point-item-meta-container .map-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.point-item-meta-container .map-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  transition: transform 0.2s, opacity 0.2s;
}

.point-item-meta-container .map-links a:hover {
  transform: scale(1.1);
  opacity: 0.85;
}


.style-controls {
  display: grid;
  gap: 12px;
}

.style-controls label {
  color: #41505e;
  display: grid;
  font-size: 0.88rem;
  gap: 6px;
}

.style-controls select,
.style-controls input[type="range"] {
  width: 100%;
}

.map-panel {
  min-height: 0;
  position: relative;
}

#map {
  height: 100%;
  width: 100%;
}

.map-status {
  background: rgb(255 255 255 / 92%);
  border: 1px solid #d9e0e6;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgb(20 31 40 / 14%);
  color: #40505e;
  font-size: 0.84rem;
  left: 58px;
  max-width: min(380px, calc(100% - 72px));
  padding: 8px 10px;
  position: absolute;
  top: 14px;
  z-index: 1;
}

.side-panel-toggle {
  align-items: center;
  background: rgb(255 255 255 / 95%);
  border: 1px solid #cfd8df;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgb(20 31 40 / 14%);
  color: #126d62;
  cursor: pointer;
  display: flex;
  font-size: 1.1rem;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  left: 14px;
  line-height: 1;
  padding: 0;
  position: absolute;
  top: 14px;
  width: 34px;
  z-index: 2;
}

.side-panel-toggle:hover,
.side-panel-toggle:focus-visible {
  background: #e8f3f0;
  outline: none;
}

.zoom-level {
  background: rgb(255 255 255 / 95%);
  border: 1px solid #cfd8df;
  border-radius: 6px;
  bottom: 18px;
  box-shadow: 0 8px 22px rgb(20 31 40 / 14%);
  color: #40505e;
  font-size: 0.84rem;
  font-weight: 700;
  left: 14px;
  line-height: 1.2;
  padding: 8px 10px;
  position: absolute;
  z-index: 1;
}

.is-hidden {
  display: none !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #8ac4ff;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .dem-app {
    grid-template-rows: 56px minmax(0, 1fr);
  }

  .app-header {
    gap: 12px;
    padding: 0 12px;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(300px, 42vh);
  }

  .dem-app--resizable .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(300px, 42vh);
  }

  .workspace.is-side-panel-collapsed {
    grid-template-rows: minmax(0, 1fr) 0;
  }

  .dem-app--resizable .workspace.is-side-panel-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 0;
  }

  .workspace-resizer {
    display: none;
  }

  .dem-app--resizable .map-panel {
    grid-column: 1;
  }

  .dem-app--resizable .side-panel {
    grid-column: 1;
  }

  .map-panel {
    grid-row: 1;
  }

  .side-panel {
    border-right: 0;
    border-top: 1px solid #d4dbe1;
    grid-row: 2;
  }

  .dem-app--resizable .side-panel {
    grid-template-rows:
      minmax(120px, var(--current-panel-height, 34%))
      7px
      minmax(112px, var(--points-panel-height, 1fr))
      7px
      minmax(120px, auto);
  }

  .tool-section {
    padding: 12px;
  }
}
