:root {
  --accent: #0f6fde;
  --accent-dark: #0b57ad;
  --accent-soft: #e7f0fd;
  --green: #1f9d55;
  --green-dark: #187f44;
  --orange: #e8891d;
  --red: #c62828;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #d9dfe6;
  --text: #1b2430;
  --muted: #5d6b7a;
  --ink: #0f1a2a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 "Inter", system-ui, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 12px; line-height: 1.2; }
button:hover { background: #f1f5fa; border-color: #b8c4d0; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
button.primary:hover { background: var(--accent-dark); }
button.go { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }
button.go:hover { background: var(--green-dark); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { background: #eef2f6; color: var(--text); }
button.danger:hover { background: #fdeaea; border-color: #d88; color: var(--red); }
button:disabled { opacity: .55; cursor: wait; }
.btn-lg { padding: 12px 22px; font-size: 16px; border-radius: 10px; }
code { background: #eef1f4; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
pre { background: var(--ink); color: #e8eef4; padding: 14px 16px; border-radius: 10px; white-space: pre-wrap; font: 13px/1.55 ui-monospace, Consolas, "SF Mono", monospace; margin: 8px 0; }
.ok { color: var(--green-dark); }
.err { color: var(--red); }

/* ---------- landing ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -.2px; }
.brand .logo { width: 30px; height: 30px; }
.site-header nav { display: flex; gap: 20px; margin-left: 12px; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-header nav a:hover { color: var(--text); }
.site-header .sp { flex: 1; }
.wrap { width: min(1120px, 100% - 32px); margin: 0 auto; }
.hero { padding: 72px 0 40px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.08; margin: 0 0 18px; letter-spacing: -1px; color: var(--ink); }
.hero h1 span { color: var(--accent); }
.hero p.lead { font-size: 19px; color: var(--muted); margin: 0 0 26px; max-width: 540px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero .fine { font-size: 13px; color: var(--muted); margin-top: 12px; }
.hero-shot { position: relative; }
.hero-shot img { width: 100%; height: auto; border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: #fff; display: block; }
.hero-shot .tag { position: absolute; right: -10px; top: -14px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow); }
.logos { text-align: center; color: var(--muted); font-size: 13px; padding: 8px 0 40px; }
.logos span { display: inline-block; margin: 4px 14px; font-weight: 600; opacity: .8; }

section.block { padding: 64px 0; }
section.block.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { text-transform: uppercase; letter-spacing: 1.4px; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
section.block h2 { font-size: clamp(26px, 3vw, 36px); margin: 0 0 12px; letter-spacing: -.6px; color: var(--ink); }
section.block > .wrap > p.sub { color: var(--muted); font-size: 17px; max-width: 640px; margin: 0 0 36px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin: 10px 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.card .num { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; }
.card .ico { font-size: 26px; }
.usecases .card { padding: 18px; }
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--accent); box-shadow: 0 10px 30px rgba(15,111,222,.18); }
.plan .badge { position: absolute; top: -12px; left: 22px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.plan h3 { font-size: 20px; margin: 4px 0 2px; }
.plan .price { font-size: 36px; font-weight: 800; letter-spacing: -1px; color: var(--ink); margin: 8px 0 2px; }
.plan .price small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan .for { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 18px; flex: 1; }
.plan li { padding: 6px 0 6px 26px; position: relative; font-size: 14.5px; border-top: 1px solid #eef1f4; }
.plan li::before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 700; }
.plan li.no { color: var(--muted); } .plan li.no::before { content: "–"; color: #aab; }
.plan button { width: 100%; }
.waitlist { background: linear-gradient(135deg, #0f6fde, #0b3f86); color: #fff; border-radius: 18px; padding: 40px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: center; }
.waitlist h2 { color: #fff; margin: 0 0 8px; }
.waitlist p { margin: 0; opacity: .9; }
.waitlist form { display: flex; gap: 8px; }
.waitlist input { flex: 1; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; }
.waitlist input::placeholder { color: rgba(255,255,255,.7); }
.waitlist button { background: #fff; color: var(--accent-dark); border-color: #fff; font-weight: 700; padding: 12px 18px; }
.waitlist .msg { margin-top: 10px; font-size: 14px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--muted); margin: 10px 0 0; }
footer.site-footer { padding: 36px 0; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; }
footer a { color: var(--muted); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .grid3, .grid4, .pricing { grid-template-columns: 1fr; }
  .waitlist { grid-template-columns: 1fr; padding: 26px; }
  .site-header nav { display: none; }
}

/* ---------- app ---------- */
body.app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topbar { background: var(--ink); color: #fff; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.topbar .brand { color: #fff; font-size: 16px; }
.topbar .group { display: flex; align-items: center; gap: 6px; padding-left: 12px; border-left: 1px solid #334456; }
.topbar .label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #9fb0c1; margin-right: 2px; }
.topbar select, .topbar input[type=text] { padding: 6px 8px; border-radius: 8px; border: 1px solid #334456; background: #223042; color: #fff; }
.topbar button { background: #223042; color: #fff; border-color: #334456; }
.topbar button:hover { background: #2f4257; }
.topbar button.go { background: var(--green); border-color: var(--green); }
.topbar button.go:hover { background: var(--green-dark); }
.topbar .sp { flex: 1; }
#status { background: #fff; border-bottom: 1px solid var(--line); padding: 4px 12px; font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
#status b { color: var(--text); }
#status .unsaved { color: #b25e00; font-weight: 600; }
#main { flex: 1; display: flex; min-height: 0; }
#side { width: 430px; max-width: 48vw; overflow-y: auto; padding: 10px; border-right: 1px solid var(--line); background: var(--bg); }
#map { flex: 1; }
body.placing #map { cursor: crosshair; }
/* export crop: a frame over the map; the map stays usable (pan/zoom) through the frame */
#cropUi { position: absolute; inset: 0; z-index: 900; pointer-events: none; }
#cropBar { position: absolute; z-index: 2; top: 10px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 20px); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 13px; color: var(--text); box-shadow: var(--shadow-lg); pointer-events: auto; }
#cropFrame { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 0 0 100vmax rgba(10,20,30,.45); box-sizing: border-box; }
#cropFrame::after { content: ""; position: absolute; inset: 0; outline: 1px dashed rgba(255,255,255,.5); outline-offset: -1px; }
.crop-edge, .crop-corner { position: absolute; pointer-events: auto; touch-action: none; }
.crop-edge { cursor: move; }
.crop-edge[data-e=t] { top: -8px; left: 8px; right: 8px; height: 14px; }
.crop-edge[data-e=b] { bottom: -8px; left: 8px; right: 8px; height: 14px; }
.crop-edge[data-e=l] { left: -8px; top: 8px; bottom: 8px; width: 14px; }
.crop-edge[data-e=r] { right: -8px; top: 8px; bottom: 8px; width: 14px; }
.crop-corner { width: 18px; height: 18px; background: #fff; border: 2px solid var(--accent); border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.crop-corner[data-c=tl] { top: -10px; left: -10px; cursor: nwse-resize; }
.crop-corner[data-c=br] { bottom: -10px; right: -10px; cursor: nwse-resize; }
.crop-corner[data-c=tr] { top: -10px; right: -10px; cursor: nesw-resize; }
.crop-corner[data-c=bl] { bottom: -10px; left: -10px; cursor: nesw-resize; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 8px; gap: 8px; }
.side-head h2 { font-size: 15px; margin: 0; }
.empty { text-align: center; background: #fff; border: 2px dashed var(--line); border-radius: 12px; padding: 24px 16px; color: var(--muted); }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; }
.empty .btns { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

.pt { background: #fff; border: 2px solid transparent; border-radius: 12px; padding: 10px; margin-bottom: 10px; box-shadow: var(--shadow); }
.pt.active { border-color: var(--accent); }
.pt .row { display: flex; gap: 6px; margin-bottom: 7px; align-items: center; }
.pt input[type=text], .pt select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; background: #fff; }
.pt input:focus, .pt select:focus { outline: 2px solid #9cc4f2; border-color: var(--accent); }
.pt .name { flex: 1; font-weight: 600; font-size: 15px; }
.pt .loc { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.pt label { font-size: 13px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.swatch { width: 16px; height: 16px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #c5ccd3; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; font-weight: 600; }
.badge.none { background: #f6dede; color: #9a1c1c; }
.msg { font-size: 12.5px; margin: 0 0 7px; padding: 5px 8px; border-radius: 6px; }
.msg.notice { margin-bottom: 10px; padding: 8px 10px; font-size: 13px; }
.msg.notice ul { margin: 4px 0 0 18px; padding: 0; }
.msg.ok { background: #e7f6ea; color: #1b6f30; } .msg.err { background: #fbe6e6; color: #9a1c1c; } .msg.warn { background: #fff4de; color: #7a5000; }
.choices { margin: 0 0 7px; padding: 0; list-style: none; }
.choices li { font-size: 13px; padding: 5px 8px; border: 1px solid #e3d39a; margin-bottom: 3px; cursor: pointer; background: #fffbe8; border-radius: 6px; }
.choices li:hover { background: #ffefb0; }
details.more { margin: 2px 0 6px; border-top: 1px solid #edf0f3; padding-top: 6px; }
details.more summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.links a { font-size: 12.5px; text-decoration: none; color: var(--accent); border: 1px solid #c8daf1; border-radius: 6px; padding: 3px 8px; background: #f5f9fe; }
.links a:hover { background: #e4eefb; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.formats { font-size: 12px; color: #44505c; background: #f3f5f7; padding: 6px 8px; border-radius: 6px; margin: 6px 0; line-height: 1.6; font-family: ui-monospace, Consolas, monospace; }

.cats { background: #fff; border-radius: 12px; padding: 10px; margin-bottom: 12px; box-shadow: var(--shadow); }
.cats h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.cat { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.cat input[type=text] { flex: 1; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.cat input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.cat .n { font-size: 11px; color: var(--muted); width: 22px; text-align: right; }

.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); position: relative; }
.pin::after { content: ""; position: absolute; width: 8px; height: 8px; background: #fff; border-radius: 50%; top: 7px; left: 7px; }
.lbl { white-space: nowrap; font: bold 13px system-ui; color: #222; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; margin: -26px 0 0 18px; }
.leaflet-control-attribution { font-size: 10px; }

dialog { border: 0; border-radius: 14px; padding: 0; max-width: 95vw; box-shadow: var(--shadow-lg); color: var(--text); }
dialog::backdrop { background: rgba(10,20,30,.55); }
dialog .inner { padding: 18px 22px; }
dialog h2 { margin: 0 0 8px; font-size: 20px; }
dialog textarea { width: min(720px, 84vw); height: 230px; font: 12.5px ui-monospace, Consolas, monospace; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
dialog .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
dialog .tabs { display: flex; gap: 4px; margin-bottom: 10px; }
dialog .tabs button { border-radius: 999px; font-size: 13px; }
dialog .tabs button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
.prompt-box { position: relative; }
#dPrompts textarea { width: 100%; box-sizing: border-box; height: 150px; }
.prompt-box pre { max-height: 6.5em; overflow: auto; margin: 0; padding-right: 130px; font-size: 12px; }
.prompt-box button.copy { position: absolute; right: 8px; top: 8px; font-size: 12px; padding: 4px 9px; }
#dExport .inner { width: min(1100px, 95vw); max-height: 92vh; overflow: auto; }
#dExport .opts { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px; margin-bottom: 12px; font-size: 13.5px; }
#dExport .opt-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 9px 0; }
#dExport .opt-row + .opt-row { border-top: 1px solid var(--line); }
#dExport .opt-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; color: var(--muted); width: 48px; flex: none; }
#dExport .opts label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
#dExport .opts select, #dExport .opts input[type=text], #dExport .opts input[type=number] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); font-size: 13.5px; }
#dExport .opts select:focus, #dExport .opts input:focus { outline: 2px solid #9cc4f2; border-color: var(--accent); }
#dExport .tog { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px 5px 8px; cursor: pointer; user-select: none; font-weight: 500; transition: background .12s, border-color .12s; }
#dExport .tog:hover { border-color: #b7c4d3; }
#dExport .tog input { appearance: none; width: 15px; height: 15px; margin: 0; border: 1.5px solid #b7c4d3; border-radius: 4px; background: #fff; display: grid; place-items: center; flex: none; }
#dExport .tog input:checked { background: var(--accent); border-color: var(--accent); }
#dExport .tog input:checked::after { content: ""; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
#dExport .tog:has(input:checked) { background: var(--accent-soft); border-color: #b7d0f2; color: var(--accent-dark); }
#dExport #exTitle { width: 180px; }
#dExport .opt-row:has(#exShowTitle:not(:checked)) #exTitle { opacity: .45; }
#dExport .opt-live { margin-left: auto; display: flex; align-items: center; gap: 10px; }
#dExport .live-hint { font-size: 12px; color: var(--muted); }
#dExport #bRender { font-size: 13px; padding: 5px 10px; }
#dExport #bRender:disabled { opacity: .7; cursor: default; }
#dExport img { max-width: 100%; max-height: 62vh; border: 1px solid #999; display: block; background: #eee; }
#dHelp .inner { width: min(860px, 94vw); max-height: 88vh; overflow-y: auto; }
#dHelp h3 { margin: 18px 0 6px; font-size: 16px; border-bottom: 2px solid var(--accent); padding-bottom: 3px; }
#dHelp .tip { background: #eaf3fd; border-left: 4px solid var(--accent); padding: 8px 12px; border-radius: 0 6px 6px 0; margin: 8px 0; }
#dHelp .warn { background: #fff4de; border-left: 4px solid #e0a020; padding: 8px 12px; border-radius: 0 6px 6px 0; margin: 8px 0; }
#dHelp table { border-collapse: collapse; width: 100%; font-size: 13px; }
#dHelp td, #dHelp th { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
#dHelp th { background: #eef1f4; }
.close-x { float: right; }

#mobile-toggle { display: none; }
@media (max-width: 760px) {
  #main { flex-direction: column; }
  #side { width: 100%; max-width: none; max-height: 50%; border-right: 0; border-bottom: 1px solid var(--line); }
  #side.hidden { display: none; }
  #map { min-height: 45vh; }
  #mobile-toggle { display: inline-block; }
  .topbar .group { border-left: 0; padding-left: 0; flex-wrap: wrap; }
  .topbar { gap: 6px 10px; }
  #status span:last-child { display: none; }
  #dExport .opt-h { width: 100%; }
  #dExport .live-hint { display: none; }
}

/* free-first landing */
.free-band { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px; box-shadow: var(--shadow); }
.free-band h2 { margin: 0 0 8px; }
.free-band p { margin: 0; color: var(--muted); max-width: 640px; }
.more-soon { text-align: center; color: var(--muted); font-size: 13px; margin: 16px 0 0; }
.soon-form { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.soon-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 240px; }

/* map style thumbnails */
.thumbs { display: flex; gap: 6px; }
.topbar button.thumb { position: relative; width: 62px; height: 44px; padding: 0; overflow: hidden; border: 2px solid #334456; border-radius: 8px; background: #223042; }
.topbar button.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topbar button.thumb span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9.5px; line-height: 1.5; padding: 0 2px; background: rgba(15,26,42,.78); color: #fff; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar button.thumb:hover { border-color: #8fb4e8; background: #223042; }
.topbar button.thumb.on { border-color: #4da3ff; box-shadow: 0 0 0 2px rgba(77,163,255,.45); }

/* Map legend = category editor (bottom left) */
.map-legend { background: rgba(255,255,255,.95); color: #222; border: 1px solid #ccc; border-radius: 8px; padding: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.25); width: 230px; max-height: 50vh; overflow-y: auto; }
.map-legend .cat:last-of-type { margin-bottom: 8px; }
.map-legend { box-sizing: border-box; overflow-x: hidden; }
.map-legend .cat input[type=text] { min-width: 0; width: 100%; box-sizing: border-box; }
.map-legend .cat input[type=color] { flex: none; box-sizing: border-box; }
.map-legend .cat .n, .map-legend .cat button { flex: none; }
.map-legend .cat button { padding: 2px 6px; }

/* coordinate system picker */
.crs-sum { margin-left: 6px; font: 12px ui-monospace, Consolas, monospace; color: var(--muted); }

/* colour picker with standard colours */
.cat .sw { flex: none; width: 30px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.color-pop { position: fixed; z-index: 3000; background: #fff; border: 1px solid #ccc; border-radius: 10px; padding: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.25); display: grid; grid-template-columns: repeat(5, 26px); gap: 8px; }
.color-pop .sw-opt { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #c5ccd3; cursor: pointer; }
.color-pop .sw-opt:hover { box-shadow: 0 0 0 2px #7d8b99; }
.color-pop .sw-opt.on { box-shadow: 0 0 0 2px #0f6fde; }
.color-pop .sw-custom { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #44505c; border-top: 1px solid #edf0f3; padding-top: 8px; }
.color-pop .sw-custom input { width: 34px; height: 24px; padding: 0; border: 1px solid #c5ccd3; border-radius: 6px; background: #fff; cursor: pointer; }

/* Privacy */
.privacy-fine { color: var(--ink); }
.privacy-grid { margin-top: 24px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #e8f5ec; color: #1b6f30; border: 1px solid #c4e6cd; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.privacy-pill:hover { background: #dcf0e2; }
.privacy-pill .short { display: none; }
@media (max-width: 1000px) { .privacy-pill .full { display: none; } .privacy-pill .short { display: inline; } }
.site-header .brand, .site-header nav a, .site-header button { white-space: nowrap; }
@media (max-width: 600px) {
  .site-header .wrap { gap: 10px; }
  .privacy-pill { padding: 6px 9px; }
  .privacy-pill .short { display: none; }
  .site-header .brand { font-size: 15px; gap: 8px; }
  .site-header .brand .logo { width: 26px; height: 26px; }
  .site-header button { font-size: 13px; padding: 8px 11px; }
}

/* lines and areas */
.side-head .addbtns { display: flex; gap: 4px; }
.side-head .addbtns button { padding: 6px 9px; font-size: 13px; }
.swatch.line { border-radius: 2px; height: 5px; }
.swatch.area { border-radius: 3px; opacity: .8; }
.lbl.shape { position: absolute; left: 0; top: 0; margin: 0; transform: translate(-50%, -50%); }
.lbl.shape.line { transform: translate(-50%, -26px); }
.vtx { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #0f6fde; box-shadow: 0 1px 3px rgba(0,0,0,.45); cursor: move; box-sizing: border-box; }
.vtx.mid { width: 10px; height: 10px; border-width: 2px; opacity: .8; cursor: copy; }
.arrow { display: block; overflow: visible; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.pt .row label select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }

/* editor: project bar */
.projbar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.projbar .back { color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; }
.projbar .back:hover { color: var(--accent-dark); }
.projbar #projName { flex: 1; min-width: 0; font-size: 22px; font-weight: 700; letter-spacing: -.3px; color: var(--ink); border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; background: transparent; }
.projbar #projName:hover { border-color: var(--line); }
.projbar #projName:focus { outline: none; border-color: var(--accent); background: #fff; }

/* landing page: your maps */
#mymaps { padding: 36px 0 8px; }
#mymaps h2 { font-size: 28px; margin: 0; letter-spacing: -.5px; color: var(--ink); }
#mymaps .head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
#mymaps .head .sp { flex: 1; }
.mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.mapcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.mapcard .pv { position: relative; height: 150px; background: #e6ebf0; overflow: hidden; display: block; }
.mapcard .pv img { position: absolute; width: 256px; height: 256px; max-width: none; }
.mapcard .pv .dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.mapcard .pv .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.mapcard .body { padding: 12px 14px 8px; flex: 1; }
.mapcard h3 { margin: 0 0 4px; font-size: 18px; color: var(--ink); }
.mapcard h3 a { color: inherit; text-decoration: none; }
.mapcard .last { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--green-dark); margin-left: 6px; }
.mapcard .meta { font-size: 13px; color: var(--muted); line-height: 1.5; }
.mapcard .mcats { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 12px; color: var(--text); }
.mapcard .mcats i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.mapcard .acts { display: flex; gap: 6px; padding: 8px 14px 14px; }
.mapcard .acts .sp { flex: 1; }
.mapcard .acts a { text-decoration: none; }
#mymaps .msg { font-size: 14px; margin: 0 0 12px; }
#mymaps .msg.err { color: var(--red); }
@media (max-width: 700px) {
  .projbar { flex-wrap: wrap; gap: 4px 10px; }
  .projbar #projName { order: 3; flex: 1 0 100%; }
}
.emptymaps { margin: 0; padding: 36px 16px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 14px; }
@media (max-width: 600px) { #cropBar span { display: none; } }

/* labels: drag to move; a moved label is centred on its own spot */
.leaflet-marker-draggable .lbl { cursor: move; }
.lbl.moved { position: absolute; left: 0; top: 0; margin: 0; transform: translate(-50%, -50%); }
/* fixed shapes: centre handle, size fields */
path.movable { cursor: move; }
.pt .row.wrap { flex-wrap: wrap; }
.pt .dim { width: 70px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.pt button.small { padding: 3px 8px; font-size: 12px; }
.crstip { margin: -3px 0 7px; }
.crstip code { white-space: nowrap; background: #f3f5f7; padding: 0 4px; border-radius: 4px; }
.projbar .crs-global { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
/* coordinate system picker: the common name large, datum and EPSG code small */
.crs-pick { position: relative; }
#crsGlobal { display: flex; align-items: baseline; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); max-width: 340px; }
#crsGlobal:hover { border-color: #b7c4d3; }
#crsGlobal .caret { color: var(--muted); font-size: 11px; margin-left: 2px; }
.crs-pick .m { font-size: 14px; font-weight: 600; color: var(--ink); }
.crs-pick .s { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
#crsList { position: absolute; right: 0; top: calc(100% + 4px); z-index: 2000; list-style: none; margin: 0; padding: 4px; min-width: 280px; max-height: 60vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 30, 50, .18); }
#crsList li { padding: 7px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
#crsList li:hover, #crsList li:focus { background: var(--accent-soft); outline: none; }
#crsList li[aria-selected="true"] .m { color: var(--accent-dark); }
#crsList li[aria-selected="true"]::before { content: "✓"; color: var(--accent-dark); font-weight: 700; margin-right: 6px; }
.vtx.rot { border-color: #e8891d; cursor: grab; }
