/* Page-specific layout on top of the ketchup design system (tokens.css, components.css). */
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
}

#map,
#markers {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#map {
  touch-action: none;
  cursor: grab;
}

#map:active {
  cursor: grabbing;
}

#markers {
  pointer-events: none;
}

.map-panel {
  position: fixed;
  top: var(--sp-3);
  left: var(--sp-3);
  width: min(340px, calc(100vw - var(--sp-6)));
  max-height: calc(100vh - var(--sp-6));
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
}

.map-panel__seed {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-2);
}

.map-panel__seed label {
  grid-column: 1 / -1;
}

.map-panel__seed .field {
  min-width: 0;
  height: 44px;
  padding: 0 var(--sp-3);
  background: var(--bg-inset);
}

.map-panel__actions {
  display: flex;
  gap: var(--sp-2);
}

.map-panel__actions .btn {
  flex: 1 1 auto;
  height: 36px;
  padding: 0 var(--sp-2);
  font-size: 13px;
}

#status {
  margin: 0;
  min-height: 1.5em;
}

progress {
  width: 100%;
  height: 6px;
  accent-color: var(--info);
}

.map-panel__layers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.map-panel__layers-head .btn {
  height: 28px;
  padding: 0 var(--sp-2);
  font-size: 12px;
}

#layers {
  min-height: 0;
  margin: 0 calc(-1 * var(--sp-2));
  overflow-y: auto;
}

.layer-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.layer-row:hover {
  background: var(--bg-elevated);
}

.layer-row--type {
  min-height: 34px;
  padding-left: var(--sp-8);
  color: var(--text-muted);
}

.layer-row .ctl-check {
  width: 20px;
  height: 20px;
}

.layer-row .ctl-check:checked::after {
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
}

.layer-row .ctl-check:indeterminate {
  background: var(--info);
  border-color: var(--info);
}

.layer-row .ctl-check:indeterminate::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  top: 8px;
  height: 2px;
  background: var(--bg);
}

.layer-swatch {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
}

.layer-name {
  flex: 1 1 auto;
  font-family: var(--font-display);
  font-weight: 600;
}

.layer-row--type .layer-name {
  font-family: var(--font-sans);
  font-weight: 400;
}

.layer-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.layer-expand {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out);
}

.layer-expand:hover {
  background: var(--bg-surface);
  color: var(--text);
}

.layer-expand[aria-expanded='true'] {
  transform: rotate(90deg);
}

.layer-expand:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

/* The hosting card as a right-hand rail, stacked the way .host-rail-layout stacks it. */
.map-host {
  position: fixed;
  top: var(--sp-3);
  right: var(--sp-3);
  width: 248px;
}

.map-host .host-card-body {
  padding: var(--sp-3);
}

.map-host .host-card-text {
  font-size: 12.5px;
  line-height: 1.5;
}

.map-host .host-card {
  flex-direction: column;
  align-items: stretch;
  border: 1px solid var(--border);
}

.map-host .host-card-art {
  flex: none;
  width: 100%;
}

@media (max-width: 900px) {
  .map-host {
    display: none;
  }
}

#readout {
  position: fixed;
  right: var(--sp-3);
  bottom: var(--sp-3);
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
}

#readout:empty {
  display: none;
}
