/* HejMap "Create your map" pages (scripts/build-create-pages.mjs, js/create/builder.js).
   Only the page chrome lives here; the poster's look comes from js/create/themes.js
   and sits inside the <svg>, so downloads match the screen. */

.cm-page main { padding-top: calc(var(--nav-h) + 18px); }

/* ── Hero: compact, so the map is on screen straight away ── */
.cm-hero { padding-bottom: 14px; }
.cm-title { margin: 6px 0 6px; font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; color: var(--text); }
.cm-title em { font-style: normal; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cm-lead { max-width: 780px; margin: 0 0 12px; color: var(--text-2); font-size: 15.5px; line-height: 1.5; }
.cm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-chip { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: none; transition: border-color 0.15s, color 0.15s; }
.cm-chip:hover { border-color: var(--line-strong); color: var(--text); }
.cm-chip[aria-current="page"] { border-color: var(--text); background: var(--text); color: var(--surface); }

/* ── Builder: one tall workspace, the map filling it, settings docked beside it ── */
.cm-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  width: min(1680px, calc(100% - 24px));
  height: clamp(560px, calc(100svh - var(--nav-h) - 36px), 1040px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.cm-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--surface-2); }
.cm-poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.cm-stage.is-dragging .cm-poster { cursor: grabbing; }
.cm-poster #cmText, .cm-poster #cmOverlay, .cm-poster #cmLabels { pointer-events: none; }
.cm-app:not(.is-ready) #cmLand { opacity: 0; }
#cmLand { transition: opacity 0.3s; }

.cm-zoom { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; }
.cm-zoom button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text); box-shadow: var(--shadow-sm); cursor: pointer; backdrop-filter: blur(6px); }
.cm-zoom button:hover:not(:disabled) { border-color: var(--line-strong); }
.cm-zoom button:disabled { opacity: 0.4; cursor: default; }
.cm-zoom svg { width: 18px; height: 18px; }

.cm-wheel-hint { position: absolute; left: 50%; bottom: 14px; margin: 0; padding: 7px 14px; border-radius: 999px; background: rgba(11, 18, 32, 0.82); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%, 6px); transition: opacity 0.2s, transform 0.2s; }
.cm-stage.show-hint .cm-wheel-hint { opacity: 1; transform: translate(-50%, 0); }

.cm-tip { position: absolute; top: 0; left: 0; z-index: 2; display: flex; align-items: center; gap: 8px; max-width: 280px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); font-size: 13px; pointer-events: none; white-space: nowrap; }
.cm-tip[hidden] { display: none; }
.cm-tip .hej-flag { width: 20px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.cm-tip span { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.cm-tip span::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

/* ── Panel: scrolls on its own, so the map never moves ── */
.cm-panel { display: flex; flex-direction: column; gap: 16px; min-height: 0; padding: 18px; overflow-y: auto; overscroll-behavior: contain; border-left: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; }
.cm-notice { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 600; line-height: 1.4; }
.cm-notice[hidden] { display: none; }
.cm-stats { margin: 0; font-size: 16px; font-weight: 750; letter-spacing: -0.01em; color: var(--text); }
.cm-block { display: flex; flex-direction: column; gap: 8px; }
.cm-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cm-block-head > span, .cm-block > label, .cm-block-head > label:first-child { color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.cm-check { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.cm-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.cm-input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--canvas); color: var(--text); font-size: 15px; box-sizing: border-box; }
.cm-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.cm-select { padding-right: 36px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; font-weight: 600; cursor: pointer; }
.cm-show { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; border: 0; }
.cm-show legend { width: 100%; margin-bottom: 8px; padding: 0; color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.cm-show .cm-check { font-size: 14px; }
.cm-help { margin: 0; color: var(--text-3); font-size: 13px; line-height: 1.45; }
.cm-help[hidden] { display: none; }
.cm-link-btn { align-self: flex-start; padding: 2px 0; border: 0; background: none; color: var(--blue); font-size: 13px; font-weight: 650; cursor: pointer; }
.cm-link-btn:disabled { color: var(--text-3); cursor: default; }
.cm-link-btn[hidden] { display: none; }

.cm-groups { display: flex; flex-direction: column; gap: 4px; }
.cm-group { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border: 1px solid transparent; border-radius: 11px; }
.cm-groups.is-multi .cm-group { cursor: pointer; }
.cm-groups.is-multi .cm-group.is-active { border-color: var(--line-strong); background: var(--surface-2); }
.cm-group input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.cm-swatch { position: relative; flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); cursor: pointer; }
.cm-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.cm-group-label { flex: 1; min-width: 0; height: 30px; padding: 0 26px 0 6px; border: 1px solid transparent; border-radius: 8px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center / 14px; color: var(--text); font-size: 14px; font-weight: 650; appearance: none; -webkit-appearance: none; cursor: pointer; text-overflow: ellipsis; }
.cm-group-label:hover { border-color: var(--line); }
.cm-group-label:focus { outline: none; border-color: var(--blue); background: var(--surface); }
.cm-group-n { min-width: 22px; color: var(--text-2); font-size: 13px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.cm-icon-btn { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-3); font-size: 17px; line-height: 1; cursor: pointer; }
.cm-icon-btn:hover { background: var(--surface-3); color: var(--text); }

.cm-search { position: relative; }
.cm-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; margin: 6px 0 0; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); list-style: none; }
.cm-results[hidden] { display: none; }
.cm-results li { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.cm-results li[aria-selected="true"] { background: var(--surface-2); }
.cm-results li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-results em { color: var(--text-3); font-size: 12px; font-style: normal; font-weight: 600; }
.cm-results .cm-none { color: var(--text-3); cursor: default; }
.cm-results .hej-flag, .cm-list .hej-flag { width: 20px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }

.cm-list { display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow: auto; }
.cm-list h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 6px; color: var(--text); font-size: 13px; font-weight: 700; }
.cm-list h4 i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cm-list h4 span { color: var(--text-3); font-weight: 600; }
.cm-list ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cm-list li { display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 8px; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 999px; background: var(--canvas); font-size: 13px; font-weight: 600; }
.cm-list li span { display: inline-flex; align-items: center; gap: 6px; }
.cm-list li button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-3); font-size: 15px; cursor: pointer; }
.cm-list li button:hover { background: var(--surface-3); color: var(--text); }
.cm-empty { margin: 0; color: var(--text-3); font-size: 13px; }

.cm-themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cm-theme { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 650; text-align: left; cursor: pointer; }
.cm-theme i { display: block; height: 36px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); }
.cm-theme:hover { border-color: var(--line-strong); color: var(--text); }
.cm-theme[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); color: var(--text); }

.cm-actions .v2-btn { justify-content: center; width: 100%; height: 44px; }
.cm-actions .v2-btn:disabled { opacity: 0.6; cursor: progress; }

/* ── About ── */
.cm-about { padding-top: 56px; }
.cm-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 48px; padding: 0; list-style: none; }
.cm-steps li { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.cm-step-ico { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); }
.cm-step-ico svg { width: 20px; height: 20px; }
.cm-steps h2 { margin: 0 0 6px; font-size: 17px; }
.cm-steps p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.cm-h2 { margin: 0 0 14px; font-size: 24px; letter-spacing: -0.02em; }
.cm-faq { display: flex; flex-direction: column; gap: 8px; margin-bottom: 48px; }
.cm-faq details { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cm-faq summary { font-weight: 650; cursor: pointer; }
.cm-faq p { margin: 10px 0 0; color: var(--text-2); line-height: 1.55; }
.cm-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cm-more-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.cm-more-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.cm-more-card span { color: var(--text-2); font-size: 14px; line-height: 1.45; }

@media (max-width: 1100px) {
  .cm-app { grid-template-columns: minmax(0, 1fr) 320px; }
}
/* Tablets and phones: the map on top, as tall as the screen allows, settings below. */
@media (max-width: 900px) {
  .cm-app { display: block; height: auto; }
  .cm-stage { height: clamp(340px, min(74svh, 118vw), 760px); }
  .cm-panel { overflow: visible; border-left: 0; border-top: 1px solid var(--line); }
  .cm-steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cm-stage { height: clamp(330px, 96vw, 560px); }
  .cm-app { width: 100%; border-left: 0; border-right: 0; border-radius: 0; box-shadow: none; }
  .cm-lead { font-size: 15px; }
  .cm-zoom { top: auto; bottom: 10px; right: 10px; flex-direction: row; gap: 6px; }
  .cm-zoom button { width: 40px; height: 40px; border-radius: 12px; }
  .cm-wheel-hint { display: none; }
}
