/* Satellite barrier planner: full-screen map with floating glass panels. */
.planner-page {
  --glass: rgba(11, 19, 34, .86);
  --glass-2: rgba(255, 255, 255, .06);
  --glass-line: rgba(255, 255, 255, .12);
  --g-text: #e9eef6;
  --g-muted: #9fb0c6;
  --panel-w: 372px;
  --gap: 16px;
  height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #0b1322;
}
.planner { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: #1b2420; }
.planner[data-mode="draw"] #map { cursor: crosshair; }
.glass { background: var(--glass); color: var(--g-text); border: 1px solid var(--glass-line); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }

/* ---------- Address search (shared by intro + top bar) ---------- */
.pl-search { position: relative; }
.pl-search-box { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.pl-search-box svg { flex: none; width: 20px; height: 20px; color: var(--fairway); }
.pl-search-box input { flex: 1; min-width: 0; border: 0; padding: 10px 0; font: 600 1.05rem var(--body); color: var(--ink); background: transparent; box-shadow: none; }
.pl-search-box input:focus { box-shadow: none; outline: none; }
.pl-search-box:focus-within { box-shadow: 0 0 0 3px rgba(227, 196, 141, .7), 0 6px 20px rgba(0, 0, 0, .25); }
.pl-search-go { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--fairway); color: #fff; font-size: 1.3rem; cursor: pointer; display: grid; place-items: center; }
.pl-search-go:hover { background: var(--fairway-2); }
.pl-search.busy .pl-search-go { animation: pl-spin 1s linear infinite; }
@keyframes pl-spin { to { transform: rotate(360deg); } }
.pl-suggest { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 8px); list-style: none; margin: 0; padding: 6px; background: #fff; border-radius: 16px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); max-height: 320px; overflow-y: auto; text-align: left; }
.pl-suggest li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--ink); font-size: .98rem; }
.pl-suggest li::before { content: ''; flex: none; width: 16px; height: 16px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231f5e3b'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E"); }
.pl-suggest li[aria-selected="true"], .pl-suggest li:hover { background: #eef5f0; }
.pl-suggest mark { background: none; color: var(--fairway); font-weight: 700; }
.pl-search-err { margin: 10px 4px 0; color: #ffd6d1; font-size: .92rem; text-align: left; }

/* ---------- Intro overlay ---------- */
.pl-intro { position: absolute; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 30%, rgba(11, 19, 34, .55), rgba(11, 19, 34, .9)); transition: opacity .5s ease, visibility .5s; }
.pl-intro.out { opacity: 0; visibility: hidden; }
.pl-intro .hero-rain { opacity: .3; pointer-events: none; }
.pl-intro-card { position: relative; width: min(620px, 100%); text-align: center; padding: 40px 36px 32px; border-radius: 28px; animation: pl-rise .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pl-rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.pl-intro-card > img { width: 92px; height: 92px; margin: -86px auto 6px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .45)); }
.pl-intro-card .eyebrow { color: var(--sand); }
.pl-intro-card h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); color: #fff; margin-bottom: .25em; }
.pl-intro-card h1 em { font-style: normal; color: var(--sand); }
.pl-intro-card > p { color: var(--g-muted); font-size: 1.1rem; margin: 0 auto 24px; max-width: 44ch; }
.pl-intro-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; }
.pl-intro-links a { color: var(--g-text); font: 600 .98rem var(--body); opacity: .85; text-decoration: none; }
.pl-intro-links a:hover { opacity: 1; color: var(--sand); }
.pl-intro-links button { background: none; border: 0; color: var(--g-text); font: 600 .98rem var(--body); cursor: pointer; opacity: .85; }
.pl-intro-links button:hover { opacity: 1; color: var(--sand); }
.pl-intro-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 22px 0 0; margin: 24px 0 0; border-top: 1px solid var(--glass-line); counter-reset: s; }
.pl-intro-steps li { counter-increment: s; font-size: .9rem; color: var(--g-muted); }
.pl-intro-steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto 6px; border-radius: 50%; background: var(--glass-2); border: 1px solid var(--glass-line); color: var(--sand); font: 800 1.05rem var(--head); }
.pl-intro-steps b { display: block; color: var(--g-text); font-family: var(--head); text-transform: uppercase; letter-spacing: .06em; font-size: 1.05rem; }

/* ---------- Top bar ---------- */
.pl-topbar { position: absolute; z-index: 1000; top: var(--gap); left: calc(var(--panel-w) + var(--gap) * 2); right: var(--gap); display: flex; gap: 12px; align-items: flex-start; pointer-events: none; }
.pl-topbar > * { pointer-events: auto; }
.pl-topbar .pl-search { flex: 1; max-width: 460px; }
.pl-topbar .pl-search-box { padding: 4px 4px 4px 16px; }
.pl-topbar .pl-search-box input { padding: 8px 0; font-size: 1rem; }
.pl-topbar .pl-search-go { width: 38px; height: 38px; font-size: 1.1rem; }
.pl-topbar .pl-search-err { background: var(--glass); padding: 8px 12px; border-radius: 10px; }
.pl-steps { margin-left: auto; display: flex; list-style: none; padding: 6px; border-radius: 999px; gap: 2px; }
.pl-steps li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; font: 700 .92rem var(--head); text-transform: uppercase; letter-spacing: .06em; color: var(--g-muted); white-space: nowrap; transition: background .3s, color .3s; }
.pl-steps li span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid currentColor; font-size: .85rem; }
.pl-steps li.done { color: var(--g-text); }
.pl-steps li.done span { background: var(--fairway-2); border-color: var(--fairway-2); color: #fff; font-size: 0; }
.pl-steps li.done span::before { content: '✓'; font-size: .85rem; }
.pl-steps li.current { background: var(--sand); color: var(--navy); }

/* ---------- Side panel ---------- */
.pl-panel { position: absolute; z-index: 1000; top: var(--gap); left: var(--gap); bottom: var(--gap); width: var(--panel-w); border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; }
.pl-sheet-handle { display: none; }
.pl-panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--glass-line); }
.pl-panel-head img { width: 42px; height: 42px; }
.pl-panel-head h2 { font-size: 1.6rem; margin: 0; color: #fff; }
.pl-panel-head p { margin: 0; font-size: .85rem; color: var(--g-muted); }
.pl-panel-head .count { margin-left: auto; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-line); display: grid; place-items: center; font: 800 1rem var(--head); color: var(--sand); }
.pl-scroll { flex: 1; overflow-y: auto; padding: 14px 14px 6px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }

.pl-empty { text-align: center; padding: 14px 10px 10px; color: var(--g-muted); }
.pl-empty svg { width: 100%; max-width: 280px; margin: 0 auto 14px; border-radius: 14px; }
.pl-empty h3 { color: #fff; font-size: 1.35rem; text-transform: uppercase; margin-bottom: 6px; }
.pl-empty p { font-size: .95rem; margin: 0 0 6px; }
.pl-empty kbd, .pl-keys kbd { font: 600 .78rem var(--body); background: var(--glass-2); border: 1px solid var(--glass-line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--g-text); }
.pl-keys { font-size: .8rem; color: var(--g-muted); margin: 12px 0 0; line-height: 2; }

.pl-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pl-card { border-radius: 14px; background: var(--glass-2); border: 1px solid var(--glass-line); overflow: hidden; transition: border-color .2s, background .2s; animation: pl-pop .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pl-pop { from { opacity: 0; transform: translateY(8px); } }
.pl-card.sel { border-color: var(--c); background: rgba(255, 255, 255, .09); box-shadow: inset 4px 0 0 var(--c); }
.pl-card-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.pl-swatch { flex: none; width: 34px; height: 12px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--sand) 0 9px, #8c6a3c 9px 11px); box-shadow: 0 0 0 3px var(--c); }
.pl-card-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-card-meta { font-size: .88rem; color: var(--g-muted); white-space: nowrap; }
.pl-card-meta b { color: var(--g-text); }
.pl-card-body { padding: 0 14px 14px; }
.pl-field { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--g-muted); margin: 4px 0 12px; }
.pl-field input { margin-top: 6px; background: rgba(255, 255, 255, .08); border: 1px solid var(--glass-line); color: #fff; font-weight: 600; padding: 9px 11px; text-transform: none; letter-spacing: 0; }
.pl-field input:focus { border-color: var(--sand); box-shadow: 0 0 0 3px rgba(227, 196, 141, .25); }
.pl-heights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; margin-top: 6px; border-radius: 12px; background: rgba(0, 0, 0, .25); }
.pl-heights button { border: 0; border-radius: 9px; padding: 8px 0; background: transparent; color: var(--g-muted); font: 800 1.15rem var(--head); cursor: pointer; transition: background .15s, color .15s; }
.pl-heights button:hover { color: #fff; }
.pl-heights button[aria-checked="true"] { background: var(--hc); color: var(--navy); }
.pl-xsec { margin: 12px 0 4px; border-radius: 12px; overflow: hidden; background: linear-gradient(#1a2a40, #22344d); }
.pl-xsec svg { width: 100%; height: auto; }
.pl-xsec-cap { font-size: .86rem; color: var(--g-muted); margin: 8px 0 12px; }
.pl-xsec-cap b { color: var(--g-text); }
.pl-card-actions { display: flex; gap: 8px; }
.pl-card-actions button { flex: 1; padding: 9px; border-radius: 10px; background: rgba(255, 255, 255, .08); border: 1px solid var(--glass-line); color: var(--g-text); font: 600 .92rem var(--body); cursor: pointer; }
.pl-card-actions button:hover { background: rgba(255, 255, 255, .14); }
.pl-card-actions .danger:hover { background: rgba(214, 58, 58, .25); border-color: rgba(214, 58, 58, .6); }
.pl-tip { font-size: .82rem; color: var(--g-muted); margin: 10px 2px 0; }

.pl-total { padding: 16px 18px 18px; border-top: 1px solid var(--glass-line); background: linear-gradient(180deg, rgba(31, 94, 59, .0), rgba(31, 94, 59, .28)); }
.pl-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.pl-stats div { text-align: center; }
.pl-stats b { display: block; font: 800 1.75rem/1 var(--head); color: #fff; font-variant-numeric: tabular-nums; }
.pl-stats .money b { color: var(--sand); }
.pl-stats span { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--g-muted); }
.pl-total .btn { width: 100%; }
.pl-total small { display: block; text-align: center; font-size: .75rem; color: var(--g-muted); margin-top: 8px; }

/* ---------- Floating toolbar ---------- */
.pl-dock { position: absolute; z-index: 1000; bottom: 30px; left: calc(var(--panel-w) + var(--gap) * 2); right: 70px; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.pl-dock > * { pointer-events: auto; }
.pl-hint { padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .95rem; text-align: center; }
.pl-hint b { color: var(--sand); }
.pl-toolbar { display: flex; align-items: center; gap: 6px; padding: 7px; border-radius: 999px; }
.pl-tool { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--g-text); font: 700 1rem var(--head); text-transform: uppercase; letter-spacing: .06em; cursor: pointer; transition: background .15s, transform .12s, opacity .15s; white-space: nowrap; }
.pl-tool svg { width: 20px; height: 20px; flex: none; }
.pl-tool:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.pl-tool:disabled { opacity: .35; cursor: not-allowed; }
.pl-tool.icon { width: 46px; padding: 0; justify-content: center; }
.pl-tool.primary { background: var(--sand); color: var(--navy); padding: 0 22px; font-size: 1.1rem; }
.pl-tool.primary:hover:not(:disabled) { background: #ecd3a5; transform: translateY(-1px); }
.pl-tool.go { background: var(--fairway-2); color: #fff; }
.pl-tool.go:hover:not(:disabled) { background: #33935e; }
.pl-tool.pulse { animation: pl-pulse 1.6s ease-out 3; }
@keyframes pl-pulse { 0% { box-shadow: 0 0 0 0 rgba(227, 196, 141, .8); } 100% { box-shadow: 0 0 0 22px rgba(227, 196, 141, 0); } }
.pl-sep { width: 1px; height: 26px; background: var(--glass-line); margin: 0 4px; }
.planner[data-mode="idle"] [data-when="draw"], .planner[data-mode="draw"] [data-when="idle"] { display: none; }

/* ---------- Toast ---------- */
.pl-toast { position: absolute; z-index: 1300; top: 96px; left: 50%; transform: translate(calc(-50% + var(--panel-w) / 2), -10px); display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px; border-radius: 14px; max-width: min(520px, calc(100% - 32px)); opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility .25s; }
.pl-toast.show { opacity: 1; visibility: visible; transform: translate(calc(-50% + var(--panel-w) / 2), 0); }
.pl-toast button { flex: none; background: none; border: 1px solid var(--sand); color: var(--sand); border-radius: 999px; padding: 5px 14px; font: 700 .9rem var(--head); text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }

/* ---------- Map graphics ---------- */
.sb-glow { animation: sb-glow 1.8s ease-in-out infinite; }
@keyframes sb-glow { 50% { stroke-opacity: .15; } }
.sb-draft { animation: sb-march 0.8s linear infinite; }
@keyframes sb-march { to { stroke-dashoffset: -18; } }
.sb-label { position: absolute; transform: translate(-50%, calc(-100% - 14px)); display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: rgba(11, 19, 34, .9); color: #fff; font: 700 13px/1.1 var(--body); white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); transition: opacity .2s; }
.sb-label i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.sb-label.sel { background: var(--sand); color: var(--navy); }
.sb-label.is-hidden { opacity: 0; }
.sb-vtx { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--navy); box-shadow: 0 2px 6px rgba(0, 0, 0, .5); cursor: grab; transition: transform .12s; }
.sb-vtx:hover { transform: scale(1.25); }
.leaflet-dragging .sb-vtx { cursor: grabbing; }
.sb-mid { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .55); border: 2px solid rgba(20, 33, 61, .8); cursor: copy; display: grid; place-items: center; font: 700 11px/1 var(--body); color: var(--navy); transition: transform .12s, background .12s; }
.sb-mid:hover { transform: scale(1.3); background: #fff; }
.sb-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--fairway-2); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.sb-dot.first { width: 16px; height: 16px; border-color: var(--sand); }
.pl-cursor-tip { position: absolute; z-index: 900; pointer-events: none; padding: 4px 9px; border-radius: 8px; background: rgba(11, 19, 34, .9); color: #fff; font: 700 12px var(--body); white-space: nowrap; transform: translate(14px, 14px); }
.sb-home { position: relative; width: 0; height: 0; }
.sb-home svg { max-width: none; position: absolute; left: -6px; bottom: 0; width: 40px; height: 52px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6)); animation: sb-drop .6s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes sb-drop { from { transform: translateY(-40px); opacity: 0; } }
.sb-home-ring { position: absolute; left: -14px; top: -8px; width: 28px; height: 16px; border-radius: 50%; border: 2px solid var(--sand); animation: sb-ring 2s ease-out infinite; }
@keyframes sb-ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }

/* Leaflet chrome to match */
.planner .leaflet-bar { border: 1px solid var(--glass-line) !important; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.planner .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; background: var(--glass); color: #fff; border-bottom-color: var(--glass-line); backdrop-filter: blur(10px); }
.planner .leaflet-bar a:hover { background: #1d2d50; color: var(--sand); }
.planner .leaflet-control-zoom { margin: 0 var(--gap) 30px 0 !important; }
.planner .leaflet-control-attribution { background: rgba(11, 19, 34, .7); color: #c2cddc; font-size: 10px; border-top-left-radius: 8px; }
.planner .leaflet-control-attribution a { color: #e3c48d; }

@media (prefers-reduced-motion: reduce) {
  .sb-glow, .sb-draft, .sb-home-ring, .pl-tool.pulse, .pl-intro-card, .pl-card { animation: none; }
}

/* ---------- Tablet / phone: panel becomes a bottom sheet ---------- */
@media (max-width: 900px) {
  .planner-page { --sheet: 158px; }
  .planner.sheet-open { --sheet: min(52dvh, 480px); }
  .pl-topbar { left: 10px; right: 10px; top: 10px; }
  .pl-topbar .pl-search { max-width: none; }
  .pl-steps { display: none; }
  .pl-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: var(--sheet); border-radius: 22px 22px 0 0; border-bottom: 0; transition: height .35s cubic-bezier(.2, .8, .2, 1); }
  .pl-sheet-handle { display: block; flex: none; height: 26px; border: 0; background: none; cursor: pointer; position: relative; }
  .pl-sheet-handle::before { content: ''; position: absolute; left: 50%; top: 10px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: rgba(255, 255, 255, .35); }
  .pl-panel-head { padding: 0 18px 10px; }
  .pl-panel-head img { display: none; }
  .planner:not(.sheet-open) .pl-scroll, .planner:not(.sheet-open) .pl-panel-head { display: none; }
  .pl-total { padding: 10px 16px 14px; }
  .pl-stats { margin-bottom: 8px; }
  .pl-stats b { font-size: 1.4rem; }
  .pl-total small { display: none; }
  .pl-dock { left: 10px; right: 10px; bottom: calc(var(--sheet) + 14px); transition: bottom .35s cubic-bezier(.2, .8, .2, 1); }
  .pl-tool { height: 48px; }
  .pl-tool .lbl-long { display: none; }
  .pl-toast { top: 72px; transform: translate(-50%, -10px); }
  .pl-toast.show { transform: translate(-50%, 0); }
  .planner .leaflet-control-zoom { display: none; }
  .planner .leaflet-bottom.leaflet-right { bottom: auto; top: 66px; }
  .planner .leaflet-control-attribution { border-radius: 8px 0 0 8px; max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-vtx { width: 24px; height: 24px; }
  .sb-mid { width: 20px; height: 20px; }
  .pl-intro-steps { font-size: .8rem; }
  .pl-intro-card { padding: 36px 20px 24px; }
}
