/* Map Overlay Toolkit */
:root {
    --bg: #f6f7f9; --panel: #ffffff; --panel-2: #f1f3f6; --line: #e2e6eb; --line-2: #cfd6de;
    --text: #0f172a; --muted: #64748b; --accent: #2563eb; --accent-2: #1d4ed8; --accent-soft: #dbeafe;
    --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --bad: #b91c1c; --bad-soft: #fee2e2;
    --violet: #7c3aed; --violet-soft: #ede9fe; --teal: #0f766e; --teal-soft: #ccfbf1;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .08);
    --radius: 8px; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b1017; --panel: #121923; --panel-2: #1a2330; --line: #243041; --line-2: #33435a;
        --text: #e5e9f0; --muted: #94a3b8; --accent: #60a5fa; --accent-2: #93c5fd; --accent-soft: #1e3a5f;
        --ok: #4ade80; --ok-soft: #12321f; --warn: #fbbf24; --warn-soft: #3a2c0b; --bad: #f87171; --bad-soft: #3b1414;
        --violet: #a78bfa; --violet-soft: #2a1f47; --teal: #2dd4bf; --teal-soft: #0f2f2c;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0b1017; --panel: #121923; --panel-2: #1a2330; --line: #243041; --line-2: #33435a;
    --text: #e5e9f0; --muted: #94a3b8; --accent: #60a5fa; --accent-2: #93c5fd; --accent-soft: #1e3a5f;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); overflow: hidden; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; }
h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.warn { color: var(--warn); }
[hidden] { display: none !important; }

/* ── buttons & inputs ───────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line-2);
    background: var(--panel); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.primary.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; border: 1px solid transparent; background: transparent; cursor: pointer; font-size: 14px; }
.icon-btn:hover { background: var(--panel-2); border-color: var(--line); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.xs { width: 22px; height: 22px; font-size: 11px; }
.icon-btn svg, .tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.link { background: none; border: 0; padding: 3px 0; cursor: pointer; text-align: left; color: var(--accent); display: flex; align-items: center; gap: 6px; width: 100%; }
.link.selected { font-weight: 700; }
.input { width: 100%; padding: 6px 9px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; }
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.input.sm { padding: 4px 7px; font-size: 12px; width: auto; }
textarea.input { resize: vertical; }
.color { width: 38px; height: 26px; padding: 0 2px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--panel); cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 3px; margin: 0 0 8px; font-size: 12px; }
.field > span { color: var(--muted); font-weight: 600; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline > span { width: 84px; flex: none; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 4px 0; cursor: pointer; }
.range { display: flex; align-items: center; gap: 6px; flex: 1; }
.range input { flex: 1; min-width: 60px; }
.range output { width: 34px; text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--panel-2); }
.row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.tight { gap: 4px; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr 90px 120px; gap: 10px; }
.btn-grid { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── top bar ────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; z-index: 1100; }
.brand { display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; font-weight: 800; font-size: 15px; padding: 4px 6px; border-radius: 6px; }
.brand:hover { background: var(--panel-2); }
.project-name { border: 1px solid transparent; background: transparent; font: 600 14px var(--font); color: var(--text); padding: 5px 8px; border-radius: 6px; min-width: 120px; max-width: 360px; flex: 0 1 300px; }
.project-name:hover, .project-name:focus { border-color: var(--line-2); background: var(--panel); outline: none; }
.save-state { font-size: 12px; color: var(--muted); }
.save-state.bad { color: var(--bad); font-weight: 700; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* ── layout ─────────────────────────────────────────────────────── */
.layout { flex: 1; display: grid; grid-template-columns: 320px 1fr 300px; min-height: 0; }
.sidebar, .inspector { background: var(--panel); min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.sidebar { border-right: 1px solid var(--line); }
.inspector { border-left: 1px solid var(--line); overflow-y: auto; padding-bottom: 20px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; padding: 10px 6px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; background: var(--panel-2); border-radius: 9px; padding: 0 6px; margin-left: 3px; }
.tabs .count:empty { display: none; }
.tab-panel { display: none; flex: 1; min-height: 0; overflow-y: auto; flex-direction: column; }
.tab-panel.active { display: flex; }
.panel-tools { display: flex; gap: 6px; padding: 10px 10px 6px; }
.panel-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 12px 4px; display: flex; gap: 8px; align-items: baseline; }
.list { padding: 0 6px 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; font-size: 11px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); cursor: pointer; }
.chip.active { border-color: var(--accent); background: var(--accent-soft); }
.stats { font-size: 12px; color: var(--muted); padding: 6px 12px; }
.stats b.ok { color: var(--ok); } .stats b.warn { color: var(--warn); } .stats b.shared { color: #d97706; }
.empty { padding: 18px 12px; text-align: center; }
.empty p { margin: 0 0 8px; }
.empty .row { justify-content: center; }
.swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }

.item-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: grab; border: 1px solid transparent; }
.item-row:hover, .item-row.hover { background: var(--panel-2); }
.item-row.selected { background: var(--accent-soft); border-color: var(--accent); }
.item-row:focus-visible { outline: 2px solid var(--accent); }
.item-row .info { flex: 1; min-width: 0; }
.item-row .name, .ov-row .name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row .meta, .ov-row .meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 9.5px; font-weight: 800; letter-spacing: .03em; padding: 2px 6px; border-radius: 8px; flex: none; }
.badge.unplaced { background: var(--warn-soft); color: var(--warn); }
.badge.placed { background: var(--ok-soft); color: var(--ok); }
.badge.shared { background: #fde68a; color: #92400e; }
.badge.shaped { background: var(--violet-soft); color: var(--violet); }
.badge.linked { background: var(--teal-soft); color: var(--teal); }
.badge.adjusted { background: var(--accent-soft); color: var(--accent); }
.ov-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.ov-row:hover { background: var(--panel-2); }
.ov-row.selected { background: var(--accent-soft); border-color: var(--accent); }
.ov-row .info { flex: 1; min-width: 0; }
.ov-row .ord { display: flex; flex-direction: column; }
.layer-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; }
.layer-row.active { background: var(--panel-2); }
.layer-row.active .name { font-weight: 700; }
.layer-row .name { flex: 1; color: var(--text); }
.layer-items { padding: 2px 8px 6px 30px; font-size: 12px; }

/* ── map ────────────────────────────────────────────────────────── */
.map-wrap { position: relative; min-width: 0; min-height: 0; }
#map { position: absolute; inset: 0; background: #e5e7eb; }
#map.mo-blank-base { background: #fff; }
.leaflet-container { font: 12px var(--font); }
.mo-float { position: absolute; z-index: 1000; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.search { top: 10px; left: 64px; width: min(440px, calc(100% - 290px)); padding: 0; }
.search .input { border: 0; padding: 8px 11px; }
.search .results { border-top: 1px solid var(--line); max-height: 280px; overflow-y: auto; }
.search .result { display: block; width: 100%; text-align: left; padding: 7px 11px; border: 0; background: none; cursor: pointer; font-size: 12px; }
.search .result:hover { background: var(--panel-2); }
.basemaps { top: 10px; right: 10px; display: flex; padding: 3px; gap: 2px; }
.basemaps button { border: 0; background: none; padding: 5px 9px; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.basemaps button.active { background: var(--accent); color: #fff; }
.toolbar { top: 10px; left: 10px; display: flex; flex-direction: column; padding: 4px; gap: 4px; }
.tool-group { display: flex; flex-direction: column; gap: 2px; }
.tool-group + .tool-group { border-top: 1px solid var(--line); padding-top: 4px; }
.tool { width: 38px; height: 34px; display: grid; place-items: center; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--text); }
.tool:hover { background: var(--panel-2); }
.tool.active { background: var(--accent); color: #fff; }
.mo-banner { position: absolute; z-index: 1001; left: 50%; bottom: 34px; transform: translateX(-50%); max-width: min(760px, calc(100% - 40px));
    background: #0f172a; color: #f8fafc; padding: 8px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow); }
.mo-banner .muted { color: #94a3b8; }
.mo-banner .btn { background: #1e293b; color: #fff; border-color: #475569; margin-left: 4px; }
.drop-hint { position: absolute; z-index: 1200; inset: 14px; border: 3px dashed var(--accent); border-radius: 12px; background: rgba(37, 99, 235, .08);
    display: grid; place-items: center; font-size: 18px; font-weight: 700; color: var(--accent); pointer-events: none; }
.statusbar { position: absolute; z-index: 999; right: 52px; bottom: 0; display: flex; gap: 16px; font: 11px var(--mono); color: #334155;
    background: rgba(255, 255, 255, .85); padding: 2px 8px; border-radius: 6px 6px 0 0; pointer-events: none; }
.statusbar span:empty { display: none; }
.legend-pane { top: 100px; right: 10px; width: 280px; max-height: calc(100% - 120px); display: flex; flex-direction: column; }
.legend-pane .head { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.legend-pane .body { overflow-y: auto; padding: 4px; }
.legend-row { display: flex; gap: 8px; padding: 4px 6px; border-radius: 5px; font-size: 12px; }
.legend-row.has { cursor: pointer; }
.legend-row.has:hover { background: var(--warn-soft); }
.legend-row .k { font: 700 11px var(--mono); min-width: 28px; }
.legend-row .dot { color: var(--teal); margin-left: auto; }

/* leaflet bits */
.mo-item-marker { background: none; border: 0; }
.mo-item-marker.hover svg, .mo-item-marker.selected svg { filter: drop-shadow(0 0 3px rgba(37, 99, 235, .9)); }
.mo-item-label { background: rgba(255, 255, 255, .92); border: 0; box-shadow: none; padding: 1px 5px; font-weight: 600; color: #0f172a; }
.mo-item-label::before { display: none; }
.mo-symbol { background: none; border: 0; }
.mo-symbol.mo-selected svg, .mo-text-icon.mo-selected .mo-text-label { filter: drop-shadow(0 0 4px #2563eb) drop-shadow(0 0 2px #2563eb); }
.leaflet-interactive.mo-selected { filter: drop-shadow(0 0 3px #2563eb); }
.mo-text-icon { background: none; border: 0; width: auto !important; height: auto !important; }
.mo-text-label { position: absolute; transform: translate(-50%, -50%); white-space: pre; line-height: 1.2; text-align: center; font-family: var(--font); }
.mo-text-label.bold { font-weight: 700; }
.mo-text-label.halo { text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff; }
.mo-text-label.boxed { background: rgba(255, 255, 255, .92); border: 1.5px solid; border-radius: 4px; padding: 2px 6px; }
.mo-ann-label { background: rgba(255, 255, 255, .92); border: 1px solid rgba(15, 23, 42, .2); box-shadow: none; padding: 2px 6px; font-weight: 600; color: #0f172a; line-height: 1.25; }
.mo-ann-label::before { display: none; }
.mo-ann-label .msr { font-weight: 500; color: #334155; font-variant-numeric: tabular-nums; }
.mo-overlay-img.mo-selected-overlay { outline: 2px dashed #2563eb; outline-offset: -1px; }
.mo-handle { background: #fff; border: 2px solid #2563eb; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); cursor: nwse-resize; }
.mo-handle.rotate { border-radius: 50%; background: #2563eb; cursor: grab; }

/* ── inspector ──────────────────────────────────────────────────── */
.insp-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.insp-head h2 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-sec { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.insp-sec h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 2px 0 8px; }
.insp-sec p { margin: 0 0 8px; }
.insp-sec details summary { cursor: pointer; font-size: 12px; color: var(--muted); margin: 6px 0; }
.measure { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; background: var(--panel-2); border-radius: 6px; padding: 6px 8px; margin: 6px 0 10px; font-size: 13px; }
.measure .check { margin: 0; font-size: 12px; }
.symbol-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 4px 0 8px; }
.sym { height: 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; display: grid; place-items: center; }
.sym.active { border-color: var(--accent); background: var(--accent-soft); }
.hint { background: var(--warn-soft); color: var(--warn); padding: 6px 8px; border-radius: 6px; font-size: 12px; }
dl.kv { display: grid; grid-template-columns: 90px 1fr; gap: 3px 8px; margin: 0 0 8px; font-size: 12px; }
dl.kv dt { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ── modals ─────────────────────────────────────────────────────── */
.mo-modal-backdrop { position: fixed; inset: 0; z-index: 5000; background: rgba(15, 23, 42, .5); display: grid; place-items: center; padding: 20px; }
.mo-modal { background: var(--panel); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.mo-modal.wide { width: min(980px, 100%); }
.mo-modal.full { width: calc(100vw - 30px); height: calc(100vh - 30px); max-height: none; }
.mo-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mo-modal-head h2 { font-size: 16px; }
.mo-modal-body { padding: 14px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.mo-modal-body h3 { font-size: 13px; margin: 14px 0 8px; }
.mo-modal-foot { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); align-items: center; }
.mo-msg { margin: 0; white-space: pre-line; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; border: 2px dashed var(--line-2); border-radius: 10px; cursor: pointer; margin: 10px 0; }
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.preview { margin-top: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 700; padding: 5px 6px; border-bottom: 2px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.table td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table.compact td { padding: 3px 6px; }
.table tr.sel td { background: var(--accent-soft); }
.table tr.bad td { color: var(--bad); }
.table-scroll { max-height: 48vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; margin: 8px 0; }
.legend-box { margin-top: 10px; }

/* projects */
.new-proj { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.card h3 { margin: 0; font-size: 14px; }
.card p { margin: 0; }
.card .btn { justify-content: center; }
.proj-list { display: flex; flex-direction: column; gap: 4px; }
.proj-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.proj-row.current { border-color: var(--accent); }
.proj-row .info { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* export */
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.export-card { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; }
.export-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.export-card .fmt { font: 700 10px var(--mono); color: var(--accent); align-self: center; }
.export-card .desc { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

/* help */
.help-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.help-cols p { margin: 0 0 6px; }

/* pin editor */
.pe-help { font-size: 13px; margin-bottom: 8px; color: var(--muted); }
.pe-help strong { color: var(--text); }
.mo-modal.full .mo-modal-body { display: flex; flex-direction: column; }
.pe-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; min-height: 260px; }
.pe-pane { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-height: 0; }
.pe-pane-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 6px 10px; background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: 12px; }
.pe-pane-head .inline { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.pe-map { flex: 1; min-height: 200px; background: #f8fafc; cursor: crosshair; }
.pe-map.pe-await { box-shadow: inset 0 0 0 3px #db2777; }
.pe-map .leaflet-grab, .pe-map.leaflet-container { cursor: crosshair; }
.pe-pin { background: none; border: 0; }
.pe-pin span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #db2777; color: #fff;
    font: 800 12px var(--font); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.pe-pin span { transform: none; border-radius: 50%; }
.pe-pin.sel span { background: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .35); }
.pe-pin.ghost span { background: transparent; color: #db2777; border: 2px dashed #db2777; box-shadow: none; }
.pe-bottom { display: grid; grid-template-columns: 300px 1fr; gap: 12px; margin-top: 10px; height: 170px; }
.pe-side { font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.pe-table { overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.pe-table tr { cursor: pointer; }

/* toasts */
#mo-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 9000; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.mo-toast { padding: 10px 14px; border-radius: 8px; background: #0f172a; color: #f8fafc; box-shadow: var(--shadow); font-size: 13px; transition: opacity .3s, transform .3s; border-left: 4px solid #60a5fa; }
.mo-toast.ok { border-left-color: #4ade80; }
.mo-toast.err { border-left-color: #f87171; }
.mo-toast.out { opacity: 0; transform: translateY(8px); }

/* ── responsive ─────────────────────────────────────────────────── */
@media (max-width: 1100px) { .layout { grid-template-columns: 280px 1fr 260px; } }
@media (max-width: 860px) {
    body { overflow: auto; }
    .layout { grid-template-columns: 1fr; grid-template-rows: 60vh auto auto; }
    .map-wrap { grid-row: 1; min-height: 60vh; }
    .sidebar { grid-row: 2; max-height: 50vh; border-right: 0; border-top: 1px solid var(--line); }
    .inspector { grid-row: 3; border-left: 0; border-top: 1px solid var(--line); }
    .topbar { flex-wrap: wrap; height: auto; padding: 6px 10px; }
    .top-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
    .project-name { flex: 1; }
    .search { left: 60px; right: 10px; width: auto; top: 54px; }
    .new-proj, .grid3, .help-cols, .pe-bottom { grid-template-columns: 1fr; }
    .pe-panes { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
    .pe-bottom { height: auto; }
}
.swatches { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sw { width: 26px; height: 22px; border-radius: 5px; border: 1px solid var(--line-2); cursor: pointer; font: 700 10px var(--font); background: var(--panel); padding: 0; }
.sw.active { outline: 2px solid var(--accent); outline-offset: 1px; }
.bm-select { border: 0; background: none; font: 600 12px var(--font); color: var(--muted); padding: 4px; cursor: pointer; max-width: 150px; }
.prov-row { display: grid; grid-template-columns: 1fr 340px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prov-row .row { margin: 0; }
.mo-google .leaflet-control-attribution::before { content: 'Google'; font: 700 11px var(--font); margin-right: 6px; color: #5f6368; }
@media (max-width: 860px) { .prov-row { grid-template-columns: 1fr; } }
.grid4b { display: grid; grid-template-columns: 1fr 1fr 1fr 1.3fr; gap: 10px; align-items: end; } @media (max-width: 860px) { .grid4b { grid-template-columns: 1fr 1fr; } }
.export-card.disabled { opacity: .5; cursor: not-allowed; }
#account { display: inline-flex; align-items: center; gap: 6px; }
.cloud-chip { border: 1px solid var(--line-2); background: var(--panel); border-radius: 14px; padding: 3px 10px; font: 600 12px var(--font); color: var(--ok); cursor: pointer; }
.cloud-chip.warn { color: var(--warn); } .cloud-chip.bad { color: var(--bad); border-color: var(--bad); }
.avatar { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font: 700 13px var(--font); cursor: pointer; }
.cloud-box { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* field mode */
.locate { top: 52px; right: 10px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--text); padding: 0; }
.locate svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.locate.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.field-bar { left: 50%; transform: translateX(-50%); bottom: 34px; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; align-items: center; max-width: calc(100% - 120px); justify-content: center; }
.field-bar .fb { min-height: 40px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); font: 600 13px var(--font); cursor: pointer; color: var(--text); }
.field-bar .fb.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.field-bar .fb.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.fb-status { font: 700 13px var(--mono); padding: 0 8px; }
.fb-status.good { color: var(--ok); } .fb-status.ok { color: var(--warn); } .fb-status.poor { color: var(--bad); } .fb-status.wait { color: var(--muted); }
.mo-me { background: none; border: 0; }
.mo-me span { display: block; width: 18px; height: 18px; margin: 2px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(37,99,235,.35), 0 1px 4px rgba(0,0,0,.4); }
.audit-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.audit { padding: 4px 8px; border-radius: 14px; border: 1.5px solid; background: var(--panel); font: 700 11.5px var(--font); cursor: pointer; }
.photos { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.photos .ph { position: relative; }
.photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; cursor: zoom-in; display: block; }
.photos .ph .icon-btn { position: absolute; top: 2px; right: 2px; background: rgba(255,255,255,.9); }
.badge.gps { background: var(--accent-soft); color: var(--accent); }
.audit-filter { margin: 0 0 4px; }
@media (max-width: 860px) {
    .field-bar { left: 8px; right: 8px; transform: none; max-width: none; bottom: 8px; }
    .field-bar .fb { flex: 1 1 calc(33% - 6px); min-height: 46px; font-size: 14px; }
    .locate { width: 48px; height: 48px; }
}

/* shape library */
.lib-list { padding: 0 8px 12px; }
.lib-cat { display: flex; align-items: center; gap: 4px; width: 100%; border: 0; background: none; padding: 8px 4px; font: 700 12px var(--font); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); cursor: pointer; }
.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 4px; }
.lib-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; text-align: center; min-height: 96px; }
.lib-card:hover { border-color: var(--accent); }
.lib-card.active { border-color: var(--accent); background: var(--accent-soft); }
.lib-name { font-size: 11px; font-weight: 600; line-height: 1.2; }
.lib-kind { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lib-svg svg { display: block; }
.lib-params { margin: 0 10px 8px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); }
.lib-params .field.inline > span { width: 130px; }
.tabs button { font-size: 13px; padding: 10px 4px; }

.fb-run { font: 600 13px var(--font); padding: 0 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-list { display: flex; flex-direction: column; gap: 8px; }
.match-row { display: grid; grid-template-columns: 76px 1fr 320px; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.match-row .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.match-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; cursor: zoom-in; display: block; }
.match-act { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 860px) { .match-row { grid-template-columns: 64px 1fr; } .match-act { grid-column: 1 / -1; } }
/* plans & account */
.card.current { border-color: var(--accent); }
.plan-price strong { font-size: 20px; }
.avatar.paid { box-shadow: 0 0 0 2px var(--accent); }
.row.form { flex-wrap: wrap; }
.row.form .input { flex: 1; min-width: 140px; }
.signin-quick { display: grid; gap: 8px; margin: 6px 0 4px; }
.signin-quick .btn { justify-content: center; padding: 10px; }
.btn.passkey { background: var(--text); color: var(--panel); border-color: var(--text); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 12px 0 4px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.code-input { font: 600 18px ui-monospace, Menlo, monospace; letter-spacing: 4px; max-width: 200px; }
.welcome-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin: 6px 0 10px; }
.welcome-account .row { margin: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .welcome-account { background: rgba(37, 99, 235, .12); } }
:root[data-theme="dark"] .welcome-account { background: rgba(37, 99, 235, .12); }

/* ── phone layout (body.phone, set by mobile.js below 640px) ─────────── */
.m-only, .m-nav { display: none; }
body.phone {
    --m-top: calc(48px + env(safe-area-inset-top));
    --m-nav: calc(60px + env(safe-area-inset-bottom));
    overflow: hidden; height: 100dvh; font-size: 15px;
}
body.phone .m-only { display: revert; }
/* top bar: logo, project name, account, menu */
body.phone .topbar { height: var(--m-top); padding: env(safe-area-inset-top) 8px 0; gap: 6px; flex-wrap: nowrap; }
body.phone .brand span, body.phone #btn-new, body.phone #btn-proj-list, body.phone #save-state,
body.phone .top-actions > :not(#account):not(.m-more) { display: none; }
body.phone .project-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; }
body.phone .top-actions { width: auto; flex-wrap: nowrap; gap: 6px; margin-left: 0; }
body.phone #account { display: flex; gap: 6px; align-items: center; }
body.phone #account > .btn { display: none; }
body.phone #account > .btn.primary { display: inline-flex; padding: 6px 10px; }
body.phone .cloud-chip { font-size: 11px; padding: 3px 8px; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.phone .m-more { width: 40px; height: 40px; }
body.phone .m-more svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
/* the map fills everything between the bars */
body.phone .layout { display: block; position: relative; flex: none; height: calc(100dvh - var(--m-top) - var(--m-nav)); }
body.phone .map-wrap { position: absolute; inset: 0; min-height: 0; }
body.phone .statusbar, body.phone .leaflet-control-zoom { display: none; }
body.phone .leaflet-control-attribution { font-size: 9px; max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* search: an icon that opens a full-width box */
body.phone .m-search-btn { top: 10px; left: 10px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: var(--text); }
body.phone .m-search-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; }
body.phone .search { display: none; }
body.phone.m-search .search { display: block; top: 10px; left: 62px; right: 10px; width: auto; z-index: 1200; }
body.phone .search .input { height: 44px; font-size: 16px; }
body.phone .basemaps { top: 10px; right: 10px; transform: scale(1.05); transform-origin: top right; }
body.phone.m-search .basemaps { display: none; }
body.phone .basemaps .bm-select { display: none; }
body.phone .locate { top: auto; bottom: 14px; right: 12px; width: 52px; height: 52px; border-radius: 50%; }
body.phone.m-sheet-sidebar .locate, body.phone.m-sheet-inspector .locate, body.phone.m-draw .locate { display: none; }
body.phone .field-bar { left: 8px; right: 72px; bottom: 10px; transform: none; max-width: none; }
body.phone .field-bar .fb { flex: 1 1 calc(50% - 6px); min-height: 48px; font-size: 15px; }
body.phone .mo-banner { top: 62px; bottom: auto; left: 10px; right: 10px; transform: none; max-width: none; font-size: 13.5px; padding: 8px 12px; }
/* drawing tools: one scrolling strip above the tab bar, only while drawing */
body.phone .toolbar { display: none; }
body.phone.m-draw .toolbar { display: flex; flex-direction: row; top: auto; bottom: 10px; left: 8px; right: 8px; overflow-x: auto; gap: 4px; padding: 6px; scrollbar-width: none; }
body.phone.m-draw .toolbar .tool-group { flex-direction: row; flex: none; }
body.phone.m-draw .toolbar .tool { width: 44px; height: 44px; }
body.phone .m-done { height: 44px; padding: 0 16px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; font: 700 15px var(--font); }
body.phone.m-draw .field-bar { display: none; }
/* bottom tab bar */
body.phone .m-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--m-nav); padding-bottom: env(safe-area-inset-bottom);
    background: var(--panel); border-top: 1px solid var(--line); z-index: 1300; }
.m-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font: 600 11px var(--font); padding: 0; cursor: pointer; }
.m-tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m-tab.on { color: var(--accent); }
.m-tab[data-m="add"] svg { width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--accent); color: #fff; stroke: #fff; stroke-width: 2.4; box-sizing: border-box; }
/* panels as bottom sheets */
body.phone .sidebar, body.phone .inspector {
    position: fixed; left: 0; right: 0; bottom: var(--m-nav); height: 58dvh; max-height: calc(100dvh - var(--m-top) - var(--m-nav));
    border: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 28px rgba(15, 23, 42, .22);
    transform: translateY(calc(100% + var(--m-nav) + 10px)); transition: transform .26s cubic-bezier(.2, .8, .2, 1), height .2s; z-index: 1250; display: flex; flex-direction: column;
}
body.phone .inspector { z-index: 1260; overflow-y: auto; padding-bottom: 24px; }
body.phone.m-sheet-sidebar .sidebar, body.phone.m-sheet-inspector .inspector { transform: none; }
body.phone .sidebar.m-full, body.phone .inspector.m-full { height: calc(100dvh - var(--m-top) - var(--m-nav)); border-radius: 0; }
body.phone .m-handle { display: flex; justify-content: center; align-items: center; height: 22px; flex: none; cursor: grab; touch-action: none; position: sticky; top: 0; background: var(--panel); z-index: 2; }
body.phone .m-handle span { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); }
body.phone .m-sheet-close { position: absolute; top: 8px; right: 8px; z-index: 3; width: 36px; height: 36px; }
body.phone .tabs button { padding: 12px 4px; font-size: 14px; }
body.phone .sidebar .list { overflow-y: auto; }
body.phone .item-row, body.phone .ov-row { min-height: 52px; }
body.phone .input, body.phone select.input, body.phone textarea { font-size: 16px; min-height: 42px; }
body.phone .btn { min-height: 40px; }
body.phone .icon-btn { min-width: 36px; min-height: 36px; }
/* dialogs: full screen with fixed header and footer */
body.phone .mo-modal-backdrop { align-items: stretch; padding: 0; }
body.phone .mo-modal, body.phone .mo-modal.wide, body.phone .mo-modal.full { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; display: flex; flex-direction: column; }
body.phone .mo-modal-head { padding: calc(10px + env(safe-area-inset-top)) 14px 10px; position: sticky; top: 0; }
body.phone .mo-modal-head h2 { font-size: 18px; }
body.phone .mo-modal-body { flex: 1; overflow-y: auto; padding: 14px; -webkit-overflow-scrolling: touch; }
body.phone .mo-modal-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; gap: 8px; }
body.phone .mo-modal-foot .btn { flex: 1; justify-content: center; min-height: 46px; }
body.phone .mo-modal-foot .spacer { display: none; }
body.phone .proj-row { flex-wrap: wrap; }
body.phone .proj-row .info { flex-basis: 100%; }
body.phone .proj-row .btn { flex: 1; justify-content: center; }
body.phone .new-proj { grid-template-columns: 1fr; }
body.phone .welcome-account { flex-direction: column; align-items: stretch; }
body.phone .welcome-account .row .btn { flex: 1; justify-content: center; min-height: 44px; }
body.phone .signin-quick .btn { min-height: 50px; font-size: 16px; }
body.phone .row.form { flex-direction: column; align-items: stretch; }
body.phone .row.form .btn { min-height: 46px; justify-content: center; }
/* action sheets (Add, menu) */
.m-action-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 8500; display: flex; align-items: flex-end; animation: m-fade .15s; }
.m-actions { width: 100%; max-height: 86dvh; overflow-y: auto; background: var(--panel); border-radius: 18px 18px 0 0; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); animation: m-up .22s cubic-bezier(.2, .8, .2, 1); }
.m-actions h3 { margin: 0 4px 6px; font-size: 17px; }
.m-action-label { font: 700 11px var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 6px 6px; }
.m-action { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; border: 0; background: none; border-radius: 10px; padding: 8px 8px; text-align: left; color: var(--text); font: 15px var(--font); cursor: pointer; }
.m-action:active { background: var(--panel-2); }
.m-action-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.m-action-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m-action-text { display: flex; flex-direction: column; min-width: 0; }
.m-action-text small { color: var(--muted); font-size: 12.5px; }
.m-action.cancel { justify-content: center; font-weight: 700; margin-top: 8px; background: var(--panel-2); }
@keyframes m-up { from { transform: translateY(100%); } }
@keyframes m-fade { from { opacity: 0; } }
/* toasts at the top, clear of the tab bar and thumbs */
body.phone #mo-toasts { top: calc(var(--m-top) + 8px); bottom: auto; left: 10px; right: 10px; max-width: none; }
/* phone: precise placement crosshair + point controls */
.m-reticle { display: none; }
body.phone.m-reticle-on .m-reticle { display: block; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; z-index: 1150; pointer-events: none; }
.m-reticle i { position: absolute; inset: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(15, 23, 42, .65), inset 0 0 0 1.5px rgba(15, 23, 42, .65); }
.m-reticle b::before, .m-reticle b::after { content: ''; position: absolute; background: #ef4444; box-shadow: 0 0 0 1px #fff; }
.m-reticle b::before { left: 50%; top: 6px; bottom: 6px; width: 2px; margin-left: -1px; }
.m-reticle b::after { top: 50%; left: 6px; right: 6px; height: 2px; margin-top: -1px; }
.m-drawbar { display: none; }
body.phone.m-draw.m-reticle-on .m-drawbar { display: flex; position: absolute; left: 8px; right: 8px; bottom: 74px; gap: 8px; z-index: 1150; }
.m-db { flex: 1; min-height: 50px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 700 15px var(--font); box-shadow: var(--shadow); }
.m-db.primary { flex: 1.6; background: var(--accent); color: #fff; border-color: var(--accent); }
.m-db:disabled { opacity: .5; }
body.phone.m-draw .toolbar .m-done-wrap { position: sticky; right: 0; background: var(--panel); padding-left: 4px; }
/* phone: big, easy-to-grab handles; hit area ~44px, and a crosshair ring
   around a point while it's dragged (it rides above the finger) */
body.phone .leaflet-marker-draggable::after { content: ''; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; }
body.phone .marker-icon { width: 16px !important; height: 16px !important; margin-left: -8px !important; margin-top: -8px !important; border-width: 2px; box-shadow: 0 0 0 4px rgba(37, 99, 235, .25); }
body.phone .marker-icon.marker-icon-middle { width: 12px !important; height: 12px !important; margin-left: -6px !important; margin-top: -6px !important; opacity: .8; }
body.phone .leaflet-drag-target::before { content: ''; position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; pointer-events: none;
    border: 2px solid #fff; box-shadow: 0 0 0 1.5px rgba(15, 23, 42, .7); background:
    linear-gradient(#ef4444, #ef4444) center / 2px 70% no-repeat, linear-gradient(#ef4444, #ef4444) center / 70% 2px no-repeat; }
/* phone field card (GPS on / work list) */
body.phone .field-bar.m-fieldcard { left: 8px; right: 8px; bottom: 8px; display: block; padding: 10px 12px 12px; border-radius: 16px; max-width: none; }
body.phone.m-run .locate { display: none; }
.m-fieldcard .fc-progress { height: 4px; border-radius: 2px; background: var(--panel-2); overflow: hidden; margin: -2px 0 8px; }
.m-fieldcard .fc-progress i { display: block; height: 100%; background: var(--ok); }
.m-fieldcard .fc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.m-fieldcard .fc-count { font: 700 13px var(--font); }
.m-fieldcard .fc-acc { font: 700 12.5px var(--font); padding: 4px 9px; border-radius: 12px; background: var(--panel-2); }
.m-fieldcard .fc-acc.good { color: var(--ok); background: var(--ok-soft); } .m-fieldcard .fc-acc.ok { color: var(--warn); background: var(--warn-soft); } .m-fieldcard .fc-acc.poor { color: var(--bad); background: var(--bad-soft); }
.m-fieldcard .fc-chip { margin-left: auto; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); border-radius: 14px; padding: 5px 12px; font: 600 13px var(--font); }
.m-fieldcard .fc-chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.m-fieldcard .fc-chip + .fc-x { margin-left: 0; }
.m-fieldcard .fc-x { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--panel-2); color: var(--muted); font-size: 15px; }
.m-fieldcard .fc-title { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; background: none; padding: 0; text-align: left; color: var(--text); margin-bottom: 6px; }
.m-fieldcard .fc-title strong { font-size: 19px; line-height: 1.2; }
.m-fieldcard .fc-title small { color: var(--muted); font-size: 12.5px; }
.m-fieldcard .fc-need { font: 800 10.5px var(--font); text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; margin-bottom: 4px; }
.m-fieldcard .fc-need.verify { background: var(--accent-soft); color: var(--accent); } .m-fieldcard .fc-need.locate { background: var(--warn-soft); color: var(--warn); }
.m-fieldcard .fc-guide { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; min-height: 30px; }
.m-fieldcard .fc-guide b { font-size: 22px; color: var(--text); }
.m-fieldcard .fc-arrow { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #f59e0b; color: #111827; font: 900 18px var(--font); transition: transform .4s; }
.m-fieldcard .fc-row { display: flex; gap: 8px; margin-top: 8px; }
.m-fieldcard .fc-btn { flex: 1; min-height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 700 14.5px var(--font); }
.m-fieldcard .fc-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; flex: 2; }
.m-fieldcard .fc-btn.big { min-height: 56px; font-size: 17px; }
.m-fieldcard .fc-btn.sm { min-height: 40px; font-size: 13px; font-weight: 600; }
.m-fieldcard .fc-btn.warn { color: var(--bad); border-color: var(--bad); }
.m-fieldcard .fc-row.icons { gap: 6px; }
.m-fieldcard .fc-ico { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 54px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: 600 11.5px var(--font); justify-content: center; }
.m-fieldcard .fc-ico b { font-size: 19px; line-height: 1; }
body.phone.m-run.m-reticle-on .m-reticle { top: 32%; }
/* extra points (item) */
.points-block { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.point-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.point-row .input { flex: 1; min-height: 30px; }
.point-dot { width: 10px; height: 10px; transform: rotate(45deg); background: var(--accent); flex: none; }
.mo-ptmark { width: 12px; height: 12px; transform: rotate(45deg); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, .5); }
/* building levels */
.level-switch { right: 10px; top: 100px; display: flex; flex-direction: column; padding: 3px; gap: 2px; }
.level-switch .lv { min-width: 38px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--text); font: 700 12.5px var(--font); cursor: pointer; padding: 0 6px; }
.level-switch .lv:hover { background: var(--panel-2); }
.level-switch .lv.on { background: var(--accent); color: #fff; }
.level-switch .lv.all { font-weight: 600; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; }
.level-switch .lv.all.on { color: #fff; }
.level-row .lv-code { min-width: 34px; height: 24px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--panel); font: 700 11px var(--font); color: var(--text); cursor: pointer; }
.level-row.active .lv-code { background: var(--accent); color: #fff; border-color: var(--accent); }
.level-row .lv-z { width: 58px; }
.level-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 8px 0; }
body.phone .level-switch { right: auto; left: 10px; top: 62px; }
body.phone .level-switch .lv { min-width: 44px; height: 38px; font-size: 14px; }
body.phone.m-search .level-switch { display: none; }
