/* Configurator. Same tokens as the rest of gramaps.com. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #F7F7F7; --ink: #0A0A0A; --muted: #6B6B6B; --line: #E2E2E2; --card: #FFFFFF;
  --stage: #ECEAE5; --soft: #F1EFEA; --ok: #2F6B3A; --warn: #8A5A00; --bad: #A33B33;
  --radius: 10px; --nav: 64px; --panel: 420px;
  --shadow: 0 2px 20px rgba(0,0,0,.07);
}
html, body { height: 100%; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* nav */
.cfg-nav { position: fixed; inset: 0 0 auto 0; height: var(--nav); z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: rgba(247,247,247,.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.cfg-logo { font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 600; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.cfg-logo img { height: 34px; width: auto; }
.cfg-nav-right { display: flex; align-items: center; gap: 18px; font-size: .85rem; color: var(--muted); }
.cfg-nav-right a { text-decoration: none; }
.cfg-nav-right a:hover { color: var(--ink); }

/* layout */
.cfg { position: fixed; inset: var(--nav) 0 0 0; display: grid; grid-template-columns: 1fr var(--panel); }
.stage { position: relative; background: var(--stage); overflow: hidden; }
.panel { background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-body { flex: 1; overflow-y: auto; padding: 26px 28px 20px; }
.panel-foot { border-top: 1px solid var(--line); padding: 16px 28px 20px; background: var(--card); }

/* steps */
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps button { flex: 1; border: 0; background: none; text-align: left; cursor: pointer; padding: 0; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.steps button::before { content: ''; display: block; height: 3px; border-radius: 2px; background: var(--line); margin-bottom: 8px; transition: background .25s; }
.steps button.done::before, .steps button.on::before { background: var(--ink); }
.steps button.on { color: var(--ink); font-weight: 600; }
.steps button:disabled { cursor: default; }
h1.cfg-title { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 1.65rem; line-height: 1.2; margin-bottom: 8px; }
.lead { color: var(--muted); font-size: .92rem; margin-bottom: 22px; }
.step { display: none; }
.step.on { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.field { margin-bottom: 22px; }
.field > label, .label { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 9px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 7px; }

/* search */
.search { position: relative; }
.search input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 44px 0 42px; background: #fff; font-size: .98rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.search input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.search svg { position: absolute; left: 14px; top: 15px; color: var(--muted); }
.search .locate { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.search .locate:hover { background: var(--soft); color: var(--ink); }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: 52px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: none; }
.suggest.on { display: block; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 11px 14px; cursor: pointer; font-size: .92rem; }
.suggest button small { display: block; color: var(--muted); font-size: .78rem; }
.suggest button:hover, .suggest button.hl { background: var(--soft); }

/* option cards */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 13px 14px; cursor: pointer; text-align: left; transition: border-color .2s, box-shadow .2s; }
.choice:hover { border-color: #bdbdbd; }
.choice.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.choice b { display: block; font-size: .98rem; font-weight: 600; }
.choice span { display: block; font-size: .82rem; color: var(--muted); }
.choice .shape { position: absolute; right: 13px; top: 14px; border: 1.5px solid currentColor; border-radius: 2px; color: #9a9a9a; }
.choice.on .shape { color: var(--ink); }
.seg { display: inline-grid; grid-auto-flow: column; background: var(--soft); border-radius: 9px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 7px; cursor: pointer; font-size: .86rem; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); font-weight: 500; }

/* detail indicator */
.detail { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--soft); font-size: .86rem; }
.detail .dots { display: flex; gap: 4px; }
.detail .dots i { width: 7px; height: 7px; border-radius: 50%; background: #cfcac0; }
.detail .dots i.on { background: var(--ink); }
.detail b { font-weight: 600; }
.detail span { color: var(--muted); }

/* text inputs */
.input { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; background: #fff; outline: none; font-size: .96rem; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
textarea.input { height: 84px; padding: 11px 14px; resize: vertical; line-height: 1.45; }
.counter { float: right; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.title-preview { margin-top: 10px; padding: 12px; border-radius: var(--radius); background: var(--soft); text-align: center; font-family: 'Times New Roman', Tinos, serif; font-weight: 700; letter-spacing: .14em; font-size: .95rem; line-height: 1.5; }
.title-preview small { display: block; font-size: .82rem; letter-spacing: .12em; }

/* pins */
.pin-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.pin-tools button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px 8px 10px; cursor: pointer; display: flex; align-items: center; gap: 7px; font-size: .86rem; }
.pin-tools button.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.pin-tools button:disabled { opacity: .45; cursor: default; }
.pin-list { list-style: none; margin-top: 10px; display: grid; gap: 6px; }
.pin-list li { display: flex; align-items: center; gap: 10px; font-size: .86rem; padding: 7px 10px; border-radius: 8px; background: var(--soft); }
.pin-list li span { flex: 1; color: var(--muted); }
.pin-list button { border: 0; background: none; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--muted); padding: 2px 6px; }

/* summary */
.summary { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; margin-bottom: 20px; }
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; font-size: .9rem; border-bottom: 1px solid var(--line); }
.summary div:last-child { border-bottom: 0; }
.summary dt { color: var(--muted); }
.summary dd { text-align: right; }
.preview-note { font-size: .82rem; color: var(--muted); background: #f6f4ef; border-radius: var(--radius); padding: 10px 14px; margin: -8px 0 20px; line-height: 1.45; }
.trust { list-style: none; display: grid; gap: 8px; margin: 18px 0 4px; font-size: .84rem; color: var(--muted); }
.trust li { display: flex; gap: 9px; align-items: flex-start; }
.trust svg { flex: none; margin-top: 3px; color: var(--ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* buttons */
.cta { width: 100%; height: 52px; border: 0; border-radius: var(--radius); background: var(--ink); color: #fff; font-weight: 600; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .2s, transform .1s; }
.cta:hover { background: #2b2b2b; }
.cta:active { transform: scale(.99); }
.cta:disabled { background: #bdbdbd; cursor: default; }
.foot-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: .9rem; }
.foot-row b { font-size: 1.05rem; }
.link { border: 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); font-size: .86rem; }
.link:hover { color: var(--ink); }
.msg { margin-top: 10px; font-size: .84rem; color: var(--bad); min-height: 1em; }

/* stage: map + frame + 3D */
#map, #view { position: absolute; inset: 0; }
#view { opacity: 0; pointer-events: none; transition: opacity .35s; }
.stage.three #view { opacity: 1; pointer-events: auto; }
.stage.three #map, .stage.three .frame, .stage.three .frame .ped { visibility: hidden !important; }
.frame { position: absolute; pointer-events: none; outline: 2px solid var(--ink); box-shadow: 0 0 0 9999px rgba(236,234,229,.72); border-radius: 2px; transition: width .25s, height .25s, left .25s, top .25s; }
.frame .ped { position: absolute; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,.92); border: 1px solid rgba(0,0,0,.12); display: grid; place-items: center; text-align: center; font-family: 'Times New Roman', Tinos, serif; font-weight: 700; letter-spacing: .12em; line-height: 1.25; color: var(--ink); overflow: hidden; white-space: nowrap; }
.frame .logo { position: absolute; opacity: .55; }
.frame .tag { position: absolute; left: 0; top: -30px; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.stage-hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(10,10,10,.82); color: #fff; font-size: .8rem; padding: 8px 14px; border-radius: 999px; pointer-events: none; transition: opacity .3s; white-space: nowrap; }
.stage-hint.off { opacity: 0; }
.stage-switch { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 5; display: none; }
.stage.has3d .stage-switch { display: inline-grid; }
.stage-switch.seg { background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.busy { position: absolute; inset: 0; display: none; place-items: center; z-index: 6; background: rgba(236,234,229,.6); backdrop-filter: blur(2px); }
.busy.on { display: grid; }
.busy-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 22px 26px; width: min(320px, 86%); text-align: center; }
.busy-card b { display: block; font-weight: 600; margin-bottom: 4px; }
.busy-card span { font-size: .84rem; color: var(--muted); }
.bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 14px; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s ease; }
.marker { width: 30px; height: 30px; cursor: grab; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.marker svg { display: block; width: 100%; height: 100%; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-group { border-radius: 8px !important; box-shadow: var(--shadow) !important; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: .86rem; transition: all .25s; z-index: 100; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.nojs { padding: 120px 24px; text-align: center; }

/* phones and small tablets: map on top, panel below */
/* Phones and small tablets: an app-like screen that never scrolls as a
   whole. The map sits on top at a fixed share of the screen, the panel below
   scrolls on its own, and the map steps back while the customer types. Using
   svh units and a fixed container keeps the browser bar from resizing (and
   re-zooming) the map while scrolling. */
@media (max-width: 900px) {
  :root { --nav: 52px; }
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  .cfg-nav { padding: 0 14px; }
  .cfg-logo { font-size: 1.15rem; }
  .cfg-logo img { height: 28px; }
  .cfg-nav-right .hide-sm { display: none; }
  .cfg { position: fixed; inset: var(--nav) 0 0 0; height: calc(100svh - var(--nav)); display: flex; flex-direction: column; --stage: 50%; }
  .cfg[data-step="2"] { --stage: 46%; }
  .cfg[data-step="3"] { --stage: 44%; }
  .cfg.typing { --stage: 24%; }
  .stage { position: relative; top: auto; flex: 0 0 var(--stage); height: auto; min-height: 0; z-index: 2; transition: flex-basis .28s ease; }
  .panel { flex: 1 1 auto; min-height: 0; border-left: 0; border-top: 1px solid var(--line); }
  .panel-body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 16px 10px; }
  .panel-foot { position: static; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0,0,0,.05); }
  .steps { margin-bottom: 12px; }
  .steps button { font-size: .66rem; }
  .steps button::before { margin-bottom: 6px; }
  h1.cfg-title { font-size: 1.2rem; margin-bottom: 10px; }
  .lead { display: none; }
  .field { margin-bottom: 16px; }
  .search input { height: 46px; }
  .choice { padding: 10px 12px; }
  .detail { padding: 10px 12px; font-size: .82rem; }
  .title-preview { display: none; }
  .foot-row { margin-bottom: 8px; font-size: .86rem; }
  .cta { height: 48px; font-size: .96rem; }
  .msg { margin-top: 6px; min-height: 0; }
  .frame .tag { display: none; }
  .stage-hint { bottom: 40px; font-size: .74rem; padding: 7px 12px; }
  .stage-switch { top: 10px; }
  .maplibregl-ctrl-top-right { transform: scale(.88); transform-origin: right top; }
  .maplibregl-ctrl-bottom-right { transform: scale(.88); transform-origin: right bottom; }
  .busy-card { padding: 16px 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
