:root {
  color-scheme: dark;
  --page: #0e141c;
  --panel: #151e29;
  --panel-2: #1c2835;
  --line: #2d3a49;
  --muted: #9cabb9;
  --text: #f2f6fa;
  --cyan: #83eaff;
  --cyan-dark: #14313b;
  --gold: #f6c967;
  --red: #ff806f;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button, label.button { -webkit-tap-highlight-color: transparent; }
.topbar { min-height: 72px; padding: 12px clamp(16px, 3vw, 40px); border-bottom: 1px solid #25303c; display:flex; align-items:center; justify-content:space-between; gap:16px; background:#111923; }
.brand { display:flex; align-items:center; gap:11px; }
.brand-mark { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; background:#1d3442; color:var(--cyan); font-size:24px; }
.brand strong { display:block; font-size:16px; letter-spacing:.2px; }
.brand small { display:block; color:var(--muted); font-size:12px; }
.top-actions { display:flex; gap:8px; }
.workspace { width:min(1600px, 100%); margin:0 auto; padding:18px clamp(12px, 2vw, 28px) 32px; display:grid; grid-template-columns:minmax(0,1fr) 376px; gap:18px; align-items:start; }
.map-column { min-width:0; position:sticky; top:12px; }
.map-toolbar { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; }
.tool-switch { display:flex; padding:4px; gap:3px; background:var(--panel); border:1px solid var(--line); border-radius:12px; overflow:auto; }
.tool { color:#bac6d1; background:transparent; border:0; border-radius:8px; padding:9px 12px; white-space:nowrap; font-weight:650; cursor:pointer; }
.tool.active { color:#07151a; background:var(--cyan); }
.drawing-actions { display:flex; gap:7px; align-items:center; }
.icon-button { width:40px; height:40px; display:grid; place-items:center; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--text); font-size:25px; cursor:pointer; }
.button { display:inline-flex; align-items:center; justify-content:center; border:1px solid transparent; border-radius:10px; padding:10px 14px; font-weight:700; color:var(--text); background:var(--panel-2); cursor:pointer; text-decoration:none; white-space:nowrap; }
.button:hover:not(:disabled) { filter:brightness(1.1); }
.button:disabled { opacity:.42; cursor:not-allowed; }
.button.primary { background:var(--cyan); color:#07171c; }
.button.secondary { background:#1a2934; border-color:#334552; color:#e9f7fb; }
.button.quiet { background:transparent; border-color:#3a4856; color:#dce6ee; }
.button.small { padding:8px 11px; font-size:13px; }
.import-button, label.button { position:relative; overflow:hidden; }
input[type=file] { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.map-frame { position:relative; min-height:360px; height:min(77vh, 1100px); display:grid; place-items:center; overflow:hidden; overscroll-behavior:contain; touch-action:none; border:1px solid #293745; border-radius:15px; background:radial-gradient(ellipse at center,#1b2732 0,#111923 72%); }
.map { display:block; width:100%; max-height:100%; touch-action:none; user-select:none; }
.map[hidden] { display:none; }
.map image { pointer-events:none; }
.overlay-shape { vector-effect:non-scaling-stroke; }
.empty-state { max-width:420px; padding:28px; text-align:center; }
.empty-state h1 { margin:8px 0; font-size:23px; }
.empty-state p { color:var(--muted); margin:8px 0 18px; }
.empty-icon { color:var(--cyan); font-size:40px; }
.empty-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:9px; }
.privacy-hint { margin-top:20px!important; font-size:12px; }
.map-footer { display:flex; justify-content:space-between; gap:8px; padding:9px 3px; color:var(--muted); font-size:12px; }
.control-panel { min-width:0; border:1px solid #293745; border-radius:15px; background:var(--panel); overflow:hidden; }
.panel-section { padding:16px; border-bottom:1px solid #283542; } .map-layer[hidden] { display:none; } .layers-section .helper { margin:0 0 10px; } .layer-count { display:grid; place-items:center; min-width:25px; height:25px; border-radius:50%; background:#22323f; color:var(--cyan); font-size:12px; font-weight:800; } .layer-list { display:grid; gap:6px; } .layer-row { display:grid; grid-template-columns:40px minmax(0,1fr); gap:7px; align-items:center; padding:4px; border:1px solid #2d3a49; border-radius:10px; background:#101821; } .layer-visibility { display:grid; place-items:center; width:40px; height:40px; border:1px solid #3a4856; border-radius:8px; background:#18232d; color:#b8c8d2; font-size:18px; cursor:pointer; } .layer-visibility[aria-pressed="false"] { color:#6e7d89; } .layer-select { width:100%; min-width:0; min-height:42px; display:flex; align-items:center; gap:10px; padding:5px 9px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--text); text-align:left; cursor:pointer; } .layer-select.selected { border-color:#4c7d88; background:#1a323c; box-shadow:inset 3px 0 0 var(--cyan); } .layer-select:disabled { cursor:default; opacity:.85; } .layer-label { min-width:0; display:flex; flex-direction:column; line-height:1.25; } .layer-label b { font-size:12px; } .layer-label small { margin-top:3px; color:#91a1ae; font-size:10px; font-weight:500; } .layer-swatch { flex:none; width:12px; height:12px; border:1px solid #d8e7ee99; border-radius:3px; } .photo-swatch { background:linear-gradient(135deg,#788996 0 45%,#2e4753 46% 100%); } .boundary-swatch { background:#78edff; } .zones-swatch { background:#ff927e; } .scale-swatch { background:#f7c967; } .stars-swatch { background:#82eaff; border-radius:50%; } .layer-lock { margin-left:auto; color:#9aabb6; font-size:12px; }
.section-title { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:11px; }
.section-title h2 { margin:2px 0 0; font-size:17px; line-height:1.2; }
.eyebrow { color:#8ea0af; font-size:10px; font-weight:800; letter-spacing:1.25px; }
.step-dot { width:25px; height:25px; display:grid; place-items:center; border-radius:50%; background:#22323f; color:var(--cyan); font-weight:800; font-size:12px; }
.helper { color:#a9b6c2; font-size:12px; line-height:1.5; margin:8px 0 0; }
.guide-row { display:flex; gap:9px; align-items:flex-start; margin:9px 0; color:#bfccd7; font-size:12px; }
.guide-number { flex:none; width:20px; height:20px; display:grid; place-items:center; border:1px solid #48616d; border-radius:6px; color:var(--cyan); font-weight:800; font-size:10px; }
.pill-row { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.pill { border:1px solid #354451; background:#1b2732; color:#c4d2dc; border-radius:999px; padding:5px 9px; font-size:11px; }
.text-button { border:0; background:transparent; color:#a8eafa; padding:9px 0 0; font-size:12px; cursor:pointer; }
.field { min-width:0; display:flex; flex-direction:column; gap:5px; color:#bac7d2; font-size:12px; font-weight:650; }
.field input, .field select, .unit-input { width:100%; min-height:40px; border:1px solid #3a4856; border-radius:9px; color:var(--text); background:#101821; }
.field input, .field select { padding:8px 10px; outline:none; }
.field input:focus, .field select:focus, .unit-input:focus-within { border-color:#6fdcf2; box-shadow:0 0 0 2px #83eaff22; }
.unit-input { display:flex; align-items:center; overflow:hidden; }
.unit-input input { min-width:0; border:0; background:transparent; box-shadow:none!important; }
.unit-input span { padding:0 10px; color:#8da0ae; font-size:12px; }
.field-hint { color:#91a1ae; font-size:11px; margin-top:9px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:11px 9px; }
.lettering-field { grid-column:1 / -1; }
.quadrant-summary { margin-top:10px; padding:10px 11px; border:1px solid #33424f; border-radius:10px; background:#111a23; font-size:12px; color:#d8e7ee; }
.quadrant-summary > strong { display:block; margin-bottom:7px; }
.quadrant-summary > div { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.quadrant-summary > div span { display:flex; justify-content:space-between; gap:8px; padding:6px 8px; border-radius:7px; background:#1b2935; color:#aebfcb; }
.quadrant-summary b { color:var(--cyan); font-variant-numeric:tabular-nums; }
.quadrant-summary small { display:block; margin-top:7px; color:#8295a3; font-size:10px; }
.generate-button { width:100%; margin-top:14px; min-height:44px; }
.count-summary { margin-top:11px; padding:10px 11px; border:1px solid #33424f; border-radius:10px; color:var(--cyan); font-weight:750; font-size:13px; }
.count-summary span { display:block; margin-top:3px; color:#91a1ae; font-size:11px; font-weight:500; }
.count-summary.warn { color:var(--gold); }
.count-summary.error { color:var(--red); }
.export-buttons { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.export-buttons .button { font-size:12px; padding:10px 8px; }
.privacy-card { display:flex; align-items:flex-start; gap:10px; margin:13px; padding:11px; border:1px solid #31434b; border-radius:11px; background:#142a30; color:#aebfc7; font-size:11px; line-height:1.45; }
.privacy-card b { color:#e2faff; }
.lock-icon { color:var(--cyan); font-size:18px; }
.toast { position:fixed; z-index:10; left:50%; bottom:20px; transform:translate(-50%, 20px); opacity:0; pointer-events:none; padding:11px 16px; border:1px solid #516473; border-radius:11px; background:#17232d; color:#f2f6fa; box-shadow:0 8px 35px #0008; transition:.2s ease; max-width:calc(100% - 28px); text-align:center; }
.toast.show { opacity:1; transform:translate(-50%, 0); }
@media (max-width: 960px) {
  .workspace { grid-template-columns:1fr; }
  .map-column { position:static; }
  .map-frame { height:min(67vh, 850px); }
  .control-panel { display:grid; grid-template-columns:1fr 1fr; }
  .privacy-card { grid-column:1 / -1; }
}
@media (max-width: 600px) {
  .topbar { min-height:60px; padding:9px 12px; }
  .brand-mark { width:34px; height:34px; }
  .brand small { font-size:10px; }
  .top-actions { gap:5px; }
  .top-actions .button { padding:8px 9px; font-size:11px; }
  .workspace { padding:10px 9px 24px; gap:10px; }
  .map-toolbar { align-items:stretch; flex-direction:column; }
  .tool-switch { width:100%; }
  .tool { flex:1; padding:8px 7px; font-size:11px; }
  .drawing-actions { justify-content:flex-end; }
  .map-frame { min-height:320px; height:58vh; border-radius:11px; }
  .control-panel { grid-template-columns:1fr; }
  .panel-section { padding:14px; }
  .privacy-card { grid-column:auto; }
  .map-footer { font-size:10px; }
}
@media print {
  @page { size: landscape; margin: 8mm; }
  body { background:white; color:#111; }
  .topbar, .control-panel, .map-toolbar, .map-footer, .toast { display:none!important; }
  .workspace, .map-column { display:block; padding:0; margin:0; position:static; }
  .map-frame { height:auto; min-height:0; border:0; background:#fff; overflow:visible; }
  .map { width:100%; max-height:none; }
}
