:root {
  --paper: #f6f2ea;
  --table: #e9e3d7;
  --ink: #1d1d1b;
  --ink-2: #57544d;
  --line: #d9d2c4;
  --white: #fffdf9;
  --focus: #2e5e83;
  --radius: 10px;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: 1360px; margin: 0 auto; }
.brand { font: 26px/1 var(--serif); text-decoration: none; letter-spacing: .01em; }
.top nav { display: flex; gap: 20px; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--ink-2); }
.top nav a:hover { color: var(--ink); }

.app { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; max-width: 1360px; margin: 0 auto; padding: 0 24px 24px; }
.stage { position: relative; background: var(--table); border-radius: 16px; height: calc(100dvh - 84px); min-height: 560px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.poster { position: relative; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 18px 50px rgba(40,30,10,.22); }
.mapwrap { position: absolute; overflow: hidden; cursor: grab; touch-action: none; }
.mapwrap.dragging { cursor: grabbing; }
.mapinner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.mapinner .maplibregl-canvas { outline: none; }
.over { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.zoom { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.zoom button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); font-size: 22px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.zoom button:hover { background: #fff; }
.hint { position: absolute; left: 16px; bottom: 12px; margin: 0; font-size: 13px; color: var(--ink-2); }

.panel { height: calc(100dvh - 84px); min-height: 560px; overflow-y: auto; padding: 4px 4px 24px; scrollbar-width: thin; }
.panel h1 { font: 36px/1.05 var(--serif); margin: 4px 0 8px; letter-spacing: -.005em; }
.lede { margin: 0 0 20px; color: var(--ink-2); }
.field { margin: 0 0 18px; position: relative; }
.field > label, .field .label, .field.two label { display: block; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 8px; }
input[type=search], input[type=text] { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); font-size: 16px; }
input::placeholder { color: #9a958a; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.results { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 320px; overflow-y: auto; }
.results li { padding: 10px 12px; border-radius: 6px; cursor: pointer; line-height: 1.3; }
.results li small { display: block; color: var(--ink-2); font-size: 13px; }
.results li[aria-selected=true], .results li:hover { background: var(--paper); }

.swatches { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.swatch { aspect-ratio: 3/4; border-radius: 6px; border: 1px solid var(--line); padding: 0; overflow: hidden; position: relative; background: none; }
.swatch svg { display: block; width: 100%; height: 100%; }
.swatch[aria-checked=true] { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.themename { font-size: 13px; color: var(--ink-2); margin-top: 6px; min-height: 20px; }

.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg button { min-height: 44px; border: 1px solid var(--line); background: var(--white); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; padding: 6px 4px; }
.seg button svg { width: 22px; height: 22px; }
.seg button[aria-checked=true] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.seg.small { grid-template-columns: repeat(3, auto); }
.seg.small button { min-height: 40px; padding: 0 14px; font-size: 18px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 44px; border: 1px solid var(--line); background: var(--white); border-radius: 8px; padding: 4px 12px; text-align: left; line-height: 1.2; }
.chips button b { display: block; font-size: 14px; font-weight: 600; }
.chips button small { font-size: 12px; color: var(--ink-2); }
.chips button[aria-checked=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.buy { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.cta { display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 20px; border-radius: 12px; background: var(--ink); color: var(--paper) !important; text-decoration: none; font-weight: 600; font-size: 17px; border: 0; width: 100%; transition: transform .15s ease, background .15s ease; }
.cta:hover { background: #000; }
.cta:active { transform: scale(.98); }
.cta[aria-disabled=true] { opacity: .5; pointer-events: none; }
.fine { font-size: 13px; color: var(--ink-2); margin: 8px 0 12px; text-align: center; }
.ghost { width: 100%; min-height: 46px; border-radius: 12px; border: 1px solid var(--ink); background: transparent; font-weight: 500; }
.ghost:hover { background: var(--white); }
.ghost:disabled { opacity: .5; cursor: progress; }
.license { margin-top: 14px; font-size: 14px; }
.license summary { cursor: pointer; color: var(--ink-2); }
.license form { display: flex; gap: 6px; margin-top: 10px; }
.license input { height: 44px; font-size: 14px; }
.license button { border: 0; border-radius: var(--radius); background: var(--ink); color: var(--paper); padding: 0 16px; font-weight: 600; }
.msg { margin: 8px 0 0; min-height: 1.5em; }
.msg.err { color: #a12a1f; }
.msg.ok { color: #2d6a3e; }

[hidden] { display: none !important; }
.progress { position: fixed; inset: 0; z-index: 100; background: rgba(29,29,27,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.progress .box { background: var(--white); border-radius: 14px; padding: 22px 24px; width: min(360px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.progress p { margin: 0 0 12px; }
.bar { height: 6px; border-radius: 3px; background: var(--table); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s ease; }

.info { max-width: 1000px; margin: 0 auto; padding: 64px 24px 8px; }
.info h2 { font: 40px/1.1 var(--serif); margin: 0 0 24px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 0; margin: 0 0 40px; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; color: var(--ink-2); }
.steps li::before { content: counter(s); display: block; font: 34px/1 var(--serif); color: var(--ink); margin-bottom: 8px; }
.steps b { color: var(--ink); display: block; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: auto; display: block; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 30px rgba(40,30,10,.18); background: var(--table); }
.gallery figcaption { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.plan { border: 1px solid var(--line); border-radius: 16px; padding: 24px; background: var(--white); }
.plan.pro { border-color: var(--ink); }
.plan h3 { margin: 0; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.plan .price { font: 44px/1.1 var(--serif); margin: 6px 0 12px; }
.plan .price span { font: 16px var(--sans); color: var(--ink-2); }
.plan ul { padding-left: 18px; margin: 0 0 20px; color: var(--ink-2); }
.plan li { margin-bottom: 6px; }
#faq details { border-top: 1px solid var(--line); padding: 14px 0; }
#faq summary { cursor: pointer; font-weight: 600; font-size: 17px; }
#faq p { color: var(--ink-2); margin: 10px 0 0; max-width: 70ch; }
.foot { max-width: 1000px; margin: 48px auto 0; padding: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; padding: 0 16px 16px; gap: 20px; }
  .stage { height: min(78dvh, 135vw); min-height: 420px; }
  .panel { height: auto; min-height: 0; overflow: visible; padding: 0; }
  .top { padding: 12px 16px; }
  .top nav { gap: 14px; font-size: 14px; }
  .steps { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; }
  .info { padding: 48px 16px 8px; }
  .hint { display: none; }
}
@media (max-width: 420px) {
  .top nav a:first-child { display: none; }
  .swatches { grid-template-columns: repeat(4, 1fr); }
  .field.two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
