
/* page style: map-viewer */
body[data-site-layout='flow'] map-viewer {
  display: block;
}

body[data-site-layout='flow'] .map-article,
body[data-site-layout='flow'] .map-article-head,
body[data-site-layout='flow'] .map-prose {
  display: grid;
}

body[data-site-layout='flow'] .map-article {
  gap: var(--space-xl);
}

body[data-site-layout='flow'] .map-article-head {
  gap: var(--space-sm);
}

body[data-site-layout='flow'] .map-prose {
  gap: var(--space-md);
}

body[data-site-layout='flow'] .map-article-head .summary,
body[data-site-layout='flow'] .map-prose p,
body[data-site-layout='flow'] .map-prose ol {
  margin: 0;
}

body[data-site-layout='flow'] .map-prose {
  margin-top: 0;
}

body[data-site-layout='flow'] .map-prose ol {
  display: grid;
  gap: var(--space-sm);
  padding-left: 1.3rem;
}

body[data-site-layout='flow'] .map-prose code,
body[data-site-layout='flow'] .map-source-note kbd {
  font: 0.86em/1.4 var(--mono);
}

body[data-site-layout='flow'] .map-source-note kbd {
  border: 1px solid var(--line);
  padding: 1px 4px;
}

body[data-site-layout='flow'] .map-app {
  display: grid;
  gap: 0;
  margin-top: 0;
  padding-block: var(--space-md);
}

body[data-site-layout='flow'] .map-query-form {
  align-items: end;
  display: grid;
  gap: var(--space-md);
  grid-template-columns: minmax(260px, 1fr) auto;
  padding-bottom: var(--space-md);
}

body[data-site-layout='flow'] .map-query-form label {
  display: grid;
  gap: 5px;
  font: 12px/1.4 var(--mono);
}

body[data-site-layout='flow'] .map-request-input,
body[data-site-layout='flow'] .map-generate-button {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  color: var(--fg);
  font: var(--text-size)/1 var(--sans);
  min-height: 46px;
  padding: 0 13px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

body[data-site-layout='flow'] .map-request-input {
  appearance: none;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  font: 15px/1.2 var(--sans);
  width: 100%;
}

body[data-site-layout='flow'] .map-request-input:focus {
  border-color: var(--accent);
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

body[data-site-layout='flow'] .map-generate-button {
  cursor: pointer;
}

body[data-site-layout='flow'] .map-generate-button:hover {
  background: var(--surface-soft);
  border-color: var(--fg);
}

body[data-site-layout='flow'] .map-app-head {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding-bottom: 12px;
}

body[data-site-layout='flow'] .map-app-head > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 180px;
}

body[data-site-layout='flow'] .map-app-head h2 {
  margin: 0;
}

body[data-site-layout='flow'] .map-canvas-help,
body[data-site-layout='flow'] .map-attribution,
body[data-site-layout='flow'] .map-source-note,
body[data-site-layout='flow'] .map-status,
body[data-site-layout='flow'] .map-source-grid > label {
  color: var(--muted);
  font: 12px/1.45 var(--mono);
}

body[data-site-layout='flow'] .map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

body[data-site-layout='flow'] .map-toolbar button,
body[data-site-layout='flow'] .map-toolbar output,
body[data-site-layout='flow'] .map-file-control,
body[data-site-layout='flow'] .map-load-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  color: var(--fg);
  display: inline-flex;
  font: 13px/1 var(--sans);
  justify-content: center;
  min-height: 36px;
  padding: 0 11px;
}

body[data-site-layout='flow'] .map-toolbar button,
body[data-site-layout='flow'] .map-file-control,
body[data-site-layout='flow'] .map-load-button,
body[data-site-layout='flow'] .map-source-panel summary {
  cursor: pointer;
}

body[data-site-layout='flow'] .map-toolbar button:hover:not(:disabled),
body[data-site-layout='flow'] .map-file-control:hover,
body[data-site-layout='flow'] .map-load-button:hover {
  background: var(--surface-soft);
  border-color: var(--fg);
}

body[data-site-layout='flow'] .map-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

body[data-site-layout='flow'] .map-file-control input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

body[data-site-layout='flow'] .map-file-control:focus-within {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

body[data-site-layout='flow'] .map-source-panel {
  border-top: 1px solid var(--line);
  padding: 0;
}

body[data-site-layout='flow'] .map-source-panel summary {
  font: 600 14px/1.4 var(--sans);
  padding: 12px 0;
}

body[data-site-layout='flow'] .map-source-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: 8px;
}

body[data-site-layout='flow'] .map-source-grid > label {
  grid-column: 1 / -1;
}

body[data-site-layout='flow'] .map-source-grid textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--fg);
  font: 13px/1.55 var(--mono);
  min-height: 118px;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}

body[data-site-layout='flow'] .map-load-button {
  align-self: end;
}

body[data-site-layout='flow'] .map-source-note {
  margin: 0 0 12px;
}

body[data-site-layout='flow'] .map-canvas-layout {
  display: grid;
}

body[data-site-layout='flow'] .map-canvas-shell {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: grab;
  height: min(67svh, 650px);
  min-height: 480px;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

body[data-site-layout='flow'] .map-canvas-shell[data-dragging='true'] {
  cursor: grabbing;
}

body[data-site-layout='flow'] .map-canvas-shell canvas {
  display: block;
  height: 100%;
  width: 100%;
}

body[data-site-layout='flow'] .map-canvas-help {
  background: color-mix(in oklab, var(--surface-raised), transparent 6%);
  bottom: 10px;
  left: 12px;
  margin: 0;
  padding: 5px 7px;
  pointer-events: none;
  position: absolute;
}

body[data-site-layout='flow'] .map-attribution {
  background: color-mix(in oklab, var(--surface-raised), transparent 6%);
  bottom: 10px;
  margin: 0;
  padding: 5px 7px;
  position: absolute;
  right: 12px;
}

body[data-site-layout='flow'] .map-attribution a {
  color: inherit;
}

body[data-site-layout='flow'] .map-status {
  margin: 8px 0 0;
}

body[data-site-layout='flow'] .map-status[data-state='error'] {
  color: #b8493f;
}

body[data-site-layout='flow'] .map-status[data-state='success'] {
  color: #3d7650;
}

@media (max-width: 860px) {
  body[data-site-layout='flow'] .map-app-head {
    align-items: start;
    display: grid;
  }

  body[data-site-layout='flow'] .map-toolbar {
    justify-content: flex-start;
  }

  body[data-site-layout='flow'] .map-query-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 560px) {
  body[data-site-layout='flow'] .map-query-form {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-site-layout='flow'] .map-canvas-help {
    bottom: auto;
    top: var(--space-sm);
  }

  body[data-site-layout='flow'] .map-source-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-site-layout='flow'] .map-load-button {
    justify-self: start;
  }

  body[data-site-layout='flow'] .map-canvas-shell {
    height: 58svh;
    min-height: 380px;
  }
}
