/* Task Helper — plan overlays (job-intake.md §3.1 2d; slices 2d-1 + 2d-2). Namespace: .tho-
 * Uses the app's tokens (--card, --ink, --muted, --line, --accent, --err, --hover). Selectors are
 * class + element so they win over index.html's bare button/input rules (loaded after this file).
 * Accessibility as §14.7: visible :focus-visible ring, ≥ 44 px targets on touch screens. */
@import url('/overlay/maptools.css');   /* the ONE style for every map tool (BRIEF-872) — must stay the first rule */


/* The plan image: warped by a matrix3d from its top-left corner. */
.leaflet-container img.tho-plan { position:absolute; left:0; top:0; transform-origin:0 0; max-width:none; max-height:none;
                                  user-select:none; -webkit-user-select:none; pointer-events:none; }

/* Plans control: its button's look (size, border, badge, where the panel opens) is maptools.css — nothing per control here. */

/* Panel */
.tho-panel { background:var(--card); color:var(--ink); border:1px solid var(--line); border-radius:12px;
             box-shadow:0 6px 24px rgba(20,28,40,.25); padding:10px 12px 12px; font-size:14px; line-height:1.4; cursor:auto; }
.tho-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.tho-head h2 { margin:0; font-size:16px; }
.tho-panel button.tho-close { width:36px; height:36px; padding:0; font-size:16px; background:transparent; color:var(--muted);
                              border:0; border-radius:8px; }
.tho-panel button.tho-close:hover { background:var(--hover); color:var(--ink); }
.tho-list { list-style:none; margin:0; padding:0; }
.tho-row { padding:8px 0; border-top:1px solid var(--line); }
.tho-row:first-child { border-top:0; }
.tho-line { display:flex; align-items:center; gap:6px; }
.tho-panel input.tho-name { flex:1 1 auto; min-width:0; width:auto; padding:6px 8px; font-size:14px; border-radius:7px; }
.tho-panel button.tho-eye { flex:none; width:36px; height:36px; padding:0; display:inline-flex; align-items:center; justify-content:center;
                            background:transparent; color:var(--accent); border:1px solid var(--line); border-radius:8px; }
.tho-panel button.tho-eye[aria-pressed="false"] { color:var(--muted); }
.tho-panel button.tho-eye svg { width:20px; height:20px; fill:currentColor; }
.tho-panel button.tho-mini { flex:none; width:auto; padding:7px 9px; font-size:13px; font-weight:600;
                             background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:8px; }
.tho-panel button.tho-mini:hover { background:var(--hover); }
.tho-panel button.tho-del { color:var(--err); }
.tho-op { display:flex; align-items:center; gap:8px; margin:6px 0 0; font-size:12px; color:var(--muted); }
.tho-op input[type="range"] { flex:1 1 auto; width:auto; padding:0; border:0; background:none; accent-color:var(--accent); }
.tho-pct { flex:none; width:36px; text-align:right; font-variant-numeric:tabular-nums; }
.tho-empty { color:var(--muted); padding:6px 0; }
.tho-sum { margin:0 0 6px; font-size:12px; color:var(--muted); }
.tho-sum:empty { display:none; }
.tho-meta { margin-top:4px; font-size:12px; color:var(--muted); }
.tho-acts { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.tho-name-ro { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; }
.tho-add { margin-top:10px; }
.tho-panel button.tho-addbtn { width:100%; padding:10px; font-size:14px; }
.tho-hint { margin:8px 0 0; font-size:12px; color:var(--muted); }
.tho-status { margin:6px 0 0; font-size:13px; min-height:1em; }
.tho-status:empty { display:none; }
.tho-status.tho-err { color:var(--err); font-weight:600; }

.tho-panel button:focus-visible, .tho-panel input:focus-visible, .tho-panel select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

@media (pointer: coarse) {
  .tho-panel button.tho-close, .tho-panel button.tho-eye { width:44px; height:44px; }
  .tho-panel button.tho-mini { min-height:44px; min-width:44px; }
  .tho-panel input.tho-name { min-height:44px; }
  .tho-line { gap:8px; }
  .tho-op input[type="range"] { min-height:44px; }
}

/* ── Line up screen (2d-2) — full screen, above every app layer ─────────────── */
html.tho-fit-open, html.tho-fit-open body { overflow:hidden; }
.tho-fit { position:fixed; inset:0; z-index:3000; display:flex; flex-direction:column; background:var(--bg); color:var(--ink);
           padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
html.th-under .tho-fit.th-sheet { padding-top:0; } html.th-above .tho-fit.th-sheet { padding-bottom:0; }   /* BRIEF-1307: between the bars, which carry the safe areas */
.tho-fit-head { display:flex; align-items:center; gap:8px; padding:8px 10px; background:var(--ink); color:#fff; }
.tho-fit-head h2 { flex:1 1 auto; min-width:0; margin:0; font-size:16px; letter-spacing:0; text-transform:none; color:#fff;
                   overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tho-fit-name { color:#fff; font-weight:700; }
.tho-fit-k { font-weight:400; color:#c8d0da; }
.tho-fit button.tho-fit-save { width:auto; padding:0 16px; height:40px; font-size:15px; }
.tho-fit button.tho-fit-x { width:40px; height:40px; padding:0; font-size:16px; background:rgba(255,255,255,.12); color:#fff; border:1px solid rgba(255,255,255,.25); }
.tho-fit button.tho-fit-x:focus-visible, .tho-fit button.tho-fit-save:focus-visible { outline-color:#fff; }
.tho-fit-panes { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; gap:6px; padding:6px; }
.tho-pane { position:relative; flex:1 1 0; min-height:0; min-width:0; border:3px solid var(--line); border-radius:10px; overflow:hidden; background:#dfe4ea; }
.tho-pane.tho-active { border-color:var(--accent); }
.tho-leaf { position:absolute; inset:0; isolation:isolate; z-index:0; background:#eef1f4; }
.tho-cross { position:absolute; left:50%; top:50%; width:44px; height:44px; margin:-22px 0 0 -22px; z-index:600; pointer-events:none;
             background:
               linear-gradient(#fff,#fff) center/2px 44px no-repeat,
               linear-gradient(#fff,#fff) center/44px 2px no-repeat;
             filter:drop-shadow(0 0 1.5px #000) drop-shadow(0 0 1px #000); }
.tho-cross::after { content:''; position:absolute; left:50%; top:50%; width:14px; height:14px; margin:-7px 0 0 -7px;
                    border:2px solid #e0245e; border-radius:50%; }
.tho-pane-tag { position:absolute; left:8px; bottom:8px; z-index:600; padding:2px 8px; border-radius:6px; font-size:12px; font-weight:700;
                background:rgba(20,28,40,.72); color:#fff; pointer-events:none; }
.tho-pane.tho-active .tho-pane-tag { background:var(--accent); }
.tho-fit-foot { flex:0 0 auto; max-height:44vh; overflow:auto; padding:8px 12px 12px; background:var(--card); border-top:1px solid var(--line); font-size:14px; }
.tho-fit-step { margin:0 0 8px; font-weight:600; }
.tho-fit-actions { display:flex; gap:8px; }
.tho-fit button.tho-fit-go { flex:1 1 auto; width:auto; padding:11px 12px; font-size:15px; }
.tho-fit button.tho-fit-cancel, .tho-fit button.tho-fit-undo { flex:0 0 auto; width:auto; padding:11px 14px; font-size:15px;
             background:var(--bg); color:var(--ink); border:1px solid var(--line); }
.tho-fit-acc { margin:8px 0 4px; font-weight:600; }
.tho-fit-acc:empty { display:none; }
.tho-fit-pairs { list-style:none; margin:0; padding:0; }
.tho-fit-pairs li { display:flex; align-items:center; gap:6px; padding:5px 0; border-top:1px solid var(--line); }
.tho-fit-err { flex:1 1 auto; min-width:7.5em; font-variant-numeric:tabular-nums; white-space:nowrap; }
.tho-fit button.tho-mini { flex:none; width:auto; padding:7px 10px; font-size:13px; font-weight:600;
                          background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:8px; }
.tho-fit button.tho-mini:hover { background:var(--hover); }
.tho-fit button.tho-del { color:var(--err); }
.tho-fit-stretch { display:flex; align-items:center; gap:8px; margin:8px 0 0; font-size:14px; color:var(--ink); }
.tho-fit-stretch input { width:20px; height:20px; margin:0; }
.tho-fit-stretch.tho-dim { color:var(--muted); }
.tho-fit-why { color:var(--muted); font-size:12px; }
.tho-fit-status { margin:6px 0 0; font-size:13px; }
.tho-fit-status:empty { display:none; }
.tho-fit-status.tho-err, .tho-fit-acc.tho-err { color:var(--err); }
/* Accuracy bands — colour AND a word (good / fair / poor), never colour alone */
/* "check this pair?" (BRIEF-987 G2): the point the others disagree with */
.tho-fit-sus { box-shadow:inset 3px 0 0 #c0392b; }
.tho-fit-check { color:#c0392b; font-weight:700; }
.tho-fit-sus .tho-fit-err { white-space:normal; }
.tho-band-good { color:#1b7a44; }
.tho-band-fair { color:#8a5300; }
.tho-band-poor { color:#c0392b; }
/* Numbered point markers */
.tho-num-wrap { background:none; border:0; }
.tho-num { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50%;
           font:700 13px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; box-shadow:0 1px 3px rgba(0,0,0,.45); flex:none; }
.tho-num-set { background:var(--accent); color:#fff; border:2px solid #fff; }
.tho-num-active { background:#e0245e; color:#fff; border:2px solid #fff; }
.tho-num-pending { background:#fff; color:var(--accent); border:2px dashed var(--accent); }
.tho-num-ghost { background:rgba(255,255,255,.7); color:#1b2430; border:2px dashed #1b2430; }
.tho-fit button:focus-visible, .tho-fit input:focus-visible, .tho-fit .leaflet-container:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
/* Wide screens: plan and map side by side */
@media (min-width: 768px) {
  .tho-fit-panes { flex-direction:row; }
  .tho-fit-foot { max-height:36vh; }
}
@media (pointer: coarse) {
  .tho-fit button.tho-fit-save, .tho-fit button.tho-fit-x { height:44px; min-width:44px; }
  .tho-fit button.tho-fit-go, .tho-fit button.tho-fit-cancel, .tho-fit button.tho-fit-undo { min-height:44px; }
  .tho-fit-pairs .tho-mini { min-height:44px; min-width:44px; }
  .tho-fit-stretch { min-height:44px; }
}

/* ── PDF page chooser (2d-3) ───────────────────────────────────────────────── */
.tho-pdf { position:fixed; inset:0; z-index:3000; display:flex; align-items:flex-start; justify-content:center; background:rgba(20,28,40,.55);
           padding:max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
.tho-pdf-box { width:min(760px, 100%); max-height:100%; display:flex; flex-direction:column; background:var(--card); color:var(--ink);
               border-radius:14px; box-shadow:0 10px 40px rgba(20,28,40,.35); padding:12px 14px 14px; }
.tho-pdf-head { display:flex; align-items:center; gap:8px; }
.tho-pdf-head h2 { flex:1 1 auto; min-width:0; margin:0; font-size:17px; letter-spacing:0; text-transform:none; color:var(--ink); }
.tho-pdf button.tho-pdf-x { flex:none; width:40px; height:40px; padding:0; font-size:16px; background:transparent; color:var(--muted); border:0; }
.tho-pdf button.tho-pdf-x:hover { background:var(--hover); color:var(--ink); }
.tho-pdf-sub { margin:4px 0 10px; font-size:13px; color:var(--muted); overflow-wrap:anywhere; }
.tho-pdf-pages { list-style:none; margin:0; padding:2px; display:grid; grid-template-columns:repeat(auto-fill, minmax(132px, 1fr)); gap:10px;
                 overflow:auto; flex:1 1 auto; min-height:0; }
.tho-pdf button.tho-pdf-page { width:100%; padding:8px; display:flex; flex-direction:column; align-items:center; gap:6px;
                               background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:10px; font-size:13px; font-weight:600; }
.tho-pdf button.tho-pdf-page:hover { background:var(--hover); border-color:var(--accent); }
.tho-pdf-thumb { display:flex; align-items:center; justify-content:center; width:100%; min-height:110px; background:#fff; border:1px solid var(--line); border-radius:6px; }
.tho-pdf-canvas { max-width:100%; max-height:170px; height:auto; width:auto; display:block; }
.tho-pdf-status { margin:10px 0 0; font-size:13px; color:var(--muted); }
.tho-pdf button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* ── Adjust corners (2d-4) ─────────────────────────────────────────────────── */
.tho-adj-handle { background:none; border:0; display:flex; align-items:center; justify-content:center; cursor:grab; touch-action:none; }   /* 44 px hit area */
.tho-adj-handle span { width:20px; height:20px; border-radius:50%; background:#fff; border:3px solid #e0245e; box-shadow:0 1px 4px rgba(0,0,0,.5); }
.tho-adj-handle:active { cursor:grabbing; }
.tho-adj-handle:focus-visible { outline:2px solid var(--accent); outline-offset:-6px; border-radius:50%; }
.tho-adj-bar { position:absolute; left:50%; bottom:28px; transform:translateX(-50%); z-index:1000; width:min(420px, calc(100% - 20px));
               background:var(--card); color:var(--ink); border:1px solid var(--line); border-radius:12px; box-shadow:0 6px 24px rgba(20,28,40,.3);
               padding:10px 12px; font-size:14px; line-height:1.4; cursor:auto; }
/* Phones: the app's floating "+" button sits bottom-right — keep Save/Cancel clear of it. */
@media (max-width: 767px) { .tho-adj-bar { bottom:96px; } }
.tho-adj-text { margin:0 0 6px; }
.tho-adj-status { margin:0 0 6px; font-size:13px; }
.tho-adj-status:empty { display:none; }
.tho-adj-status.tho-err { color:var(--err); font-weight:600; }
.tho-adj-actions { display:flex; gap:8px; }
.tho-adj-bar button.tho-adj-save { flex:1 1 0; width:auto; padding:10px; font-size:15px; }
.tho-adj-bar button.tho-adj-cancel { flex:1 1 0; width:auto; padding:10px; font-size:15px; background:var(--bg); color:var(--ink); border:1px solid var(--line); }
.tho-adj-bar button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (pointer: coarse) {
  .tho-pdf button.tho-pdf-x { width:44px; height:44px; }
  .tho-adj-bar button.tho-adj-save, .tho-adj-bar button.tho-adj-cancel { min-height:44px; }
}

/* ── Set scale (2d-5) ─────────────────────────────────────────────────────── */
.tho-scale .tho-fit-panes { flex-direction:column; }                 /* one pane: the plan */
.tho-scale-len { display:block; margin:10px 0 0; font-size:13px; color:var(--muted); }
.tho-scale input.tho-scale-m { display:block; width:100%; max-width:220px; margin-top:4px; padding:10px 12px; font-size:16px; }
.tho-scale-effect { margin:8px 0 0; font-size:13px; color:var(--muted); }
.tho-scale-prec { margin:4px 0 0; font-size:13px; color:var(--muted); }
.tho-scale-prec.tho-warn { color:#8a5300; font-weight:600; }
.tho-scale button.tho-scale-clear { width:auto; margin-top:10px; padding:9px 14px; font-size:14px; background:var(--bg); color:var(--err); border:1px solid var(--line); }
.tho-fit-scale { margin:8px 0 0; font-size:13px; color:var(--muted); }
.tho-fit-scale.tho-warn { color:#8a5300; font-weight:600; }
.tho-meta-scale { color:var(--ink); }
@media (pointer: coarse) {
  .tho-scale input.tho-scale-m, .tho-scale button.tho-scale-clear { min-height:44px; }
}

/* ── Page bearing (2d-6) ──────────────────────────────────────────────────── */
.tho-bear { margin-top:12px; padding-top:10px; border-top:1px solid var(--line); }
.tho-bear .tho-scale-len { margin-top:0; }
.tho-scale input.tho-bear-deg { display:block; width:100%; max-width:220px; margin-top:4px; padding:10px 12px; font-size:16px; }
.tho-bear-refl { display:flex; align-items:center; gap:8px; margin:8px 0 0; font-size:13px; color:var(--muted); }
.tho-bear-ref { flex:0 1 auto; padding:8px 10px; font-size:15px; border:1px solid var(--line); border-radius:8px; background:#fbfcfd; color:var(--ink); }
.tho-bear-note { margin:6px 0 0; font-size:13px; font-weight:600; }
/* 2d-8: the plan's own map grid + zone, and a local meridian's offset — label above, control full width (phones) */
.tho-grid { margin-top:10px; }
.tho-grid .tho-bear-refl { display:block; }
.tho-grid select { display:block; width:100%; max-width:100%; margin-top:4px; box-sizing:border-box; padding:8px 10px; font-size:15px; border:1px solid var(--line); border-radius:8px; background:#fbfcfd; color:var(--ink); }
.tho-scale input.tho-bear-off { display:block; width:100%; max-width:220px; margin-top:4px; padding:10px 12px; font-size:16px; }
@media (pointer: coarse) { .tho-grid select, .tho-scale input.tho-bear-off { min-height:44px; } }
.tho-bear-note:empty { display:none; }
.tho-bear-note.tho-err { color:var(--err); }
.tho-scale button.tho-bear-clear { width:auto; margin-top:10px; padding:9px 14px; font-size:14px; background:var(--bg); color:var(--err); border:1px solid var(--line); }
.tho-scale select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (pointer: coarse) {
  .tho-scale input.tho-bear-deg, .tho-bear-ref, .tho-scale button.tho-bear-clear { min-height:44px; }
}

/* ── 2d-7: the job chooser; ONE LINE per plan that opens to the rest; order numbers ───────── */
.tho-job { display:flex; align-items:center; gap:8px; margin:0 0 8px; font-size:13px; font-weight:600; color:var(--ink); }
.tho-panel select.tho-jobsel, .tho-panel select.tho-pjob, .tho-panel button.tho-jobsel, .tho-panel button.tho-pjob { flex:1 1 auto; min-width:0; width:auto; padding:7px 8px; font-size:14px;
  border:1px solid var(--line); border-radius:8px; background:#fbfcfd; color:var(--ink); }
/* PLANSCOPE: the Folder choice is a button that opens the tree picker (overlay-folderpick.js) */
.tho-panel button.tho-jobsel, .tho-panel button.tho-pjob { display:block; text-align:left; font-weight:400; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tho-panel button.tho-jobsel:hover, .tho-panel button.tho-pjob:hover { background:var(--hover); }
.tho-where { margin:0 0 2px 44px; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.tho-row .tho-line { gap:6px; }
.tho-panel button.tho-rowbtn { flex:1 1 auto; min-width:0; width:auto; display:flex; align-items:center; gap:6px; padding:6px 8px;
  font-size:14px; font-weight:600; text-align:left; background:transparent; color:var(--ink); border:1px solid transparent; border-radius:8px; }
.tho-panel button.tho-rowbtn:hover { background:var(--hover); }
.tho-rowname { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* §26: a live share link on this plan (BRIEF-929) */
.tho-linkon { flex:none; padding:1px 6px; font-size:11px; font-weight:600; color:var(--muted); border:1px solid var(--line); border-radius:999px; white-space:nowrap; }
.tho-chev { flex:none; width:14px; height:14px; color:var(--muted); transition:transform .15s; }
.tho-row-open .tho-chev { transform:rotate(180deg); }
.tho-panel input.tho-ord { flex:none; width:58px; padding:6px 6px; font-size:14px; text-align:center; border-radius:7px; font-variant-numeric:tabular-nums; }
.tho-ord-ro { flex:none; min-width:36px; padding:4px 8px; font-size:13px; font-weight:600; text-align:center; color:var(--muted);
  border:1px solid var(--line); border-radius:7px; font-variant-numeric:tabular-nums; }
.tho-det { margin:6px 0 2px 42px; }
.tho-detrow { display:flex; align-items:center; gap:8px; margin:0 0 6px; font-size:12px; color:var(--muted); }
.tho-detrow input.tho-name { flex:1 1 auto; }
.tho-det .tho-acts { margin-top:4px; }
.tho-panel button.tho-addbtn:disabled { opacity:.55; cursor:not-allowed; }
.tho-panel button:focus-visible, .tho-panel select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (pointer: coarse) {
  .tho-panel button.tho-rowbtn, .tho-panel input.tho-ord, .tho-ord-ro, .tho-panel select.tho-jobsel, .tho-panel select.tho-pjob, .tho-panel button.tho-jobsel, .tho-panel button.tho-pjob, .tho-panel button.tho-addbtn { min-height:44px; }
  .tho-ord-ro { display:inline-flex; align-items:center; justify-content:center; }
  .tho-det { margin-left:0; }
}

/* §19 D-1: the drawing-set import (the PDF page chooser's box, with a name field and a progress bar) */
.tho-set .tho-set-body { padding-top:6px; }
.tho-set-l { display:block; margin:8px 0 4px; font-size:13px; font-weight:600; color:var(--ink); }
.tho-set-l input { display:block; width:100%; box-sizing:border-box; margin-top:4px; padding:10px 12px; font-size:16px; border:1px solid var(--line); border-radius:8px; }
.tho-set-acts { display:flex; gap:8px; margin-top:12px; }
.tho-set-acts button { width:auto; padding:10px 14px; font-size:15px; }
.tho-set-what { margin:6px 0 8px; font-size:14px; }
.tho-set-bar { height:10px; border-radius:6px; background:var(--line); overflow:hidden; }
.tho-set-bar span { display:block; height:100%; width:0; background:var(--accent); transition:width .2s; }
@media (pointer: coarse) { .tho-set-acts button, .tho-set-l input { min-height:44px; } }
.tho-panel button.tho-setbtn { margin-top:6px; }

/* §19 D-2: a drawing set's row (‹ › beside the name), its own controls */
.tho-panel button.tho-pg { flex:none; width:30px; height:30px; padding:0; font-size:18px; line-height:1; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:7px; }
.tho-panel button.tho-pg:disabled { opacity:.4; cursor:default; }
.tho-own { align-items:flex-start; }
.tho-own input { width:18px; height:18px; margin:2px 0 0; flex:none; }
.tho-panel select.tho-spage { flex:1 1 auto; min-width:0; padding:7px 8px; font-size:14px; border:1px solid var(--line); border-radius:8px; background:#fbfcfd; color:var(--ink); }
@media (pointer: coarse) {
  .tho-panel button.tho-pg { width:44px; height:44px; }
}

/* §19 D-3: a task's drawing — the field in the task panel, */
.tho-td .tho-td-row { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.tho-td select { flex:1 1 140px; min-width:0; padding:7px 8px; font-size:14px; border:1px solid var(--line); border-radius:8px; background:#fbfcfd; color:var(--ink); }
.tho-td select.tho-td-page { flex:0 1 120px; }
.tho-td button.tho-td-show { flex:none; width:auto; padding:7px 10px; font-size:13px; font-weight:600; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:8px; }
.tho-td .tho-td-ro { font-size:14px; }
.tho-td .tho-td-msg { margin:4px 0 0; font-size:12px; color:var(--muted); }
.tho-td .tho-td-msg.tho-err { color:var(--err); }
@media (pointer: coarse) { .tho-td select, .tho-td button.tho-td-show { min-height:44px; } }

/* Gary's phone polish (D-2): minimise the panel to the pager; the pager's ⌃ re-opens it; per-page actions wrap, 44 px */
.tho-head { gap:4px; }
.tho-head h2 { flex:1 1 auto; }
.tho-setrow .tho-acts .tho-mini { white-space:normal; text-align:left; }
@media (pointer: coarse) {
}

/* §19 D-4: zoomed in past the background tiles — a plain background, the drawing keeps scaling */
.leaflet-container.tho-plain { background:#f4f4f1; }

/* L-1 (Gary): Line up keeps the map in view — on a phone a pane's tag shows it full height (the other folds away), the set's
   other pages faint + labelled. On a computer the tags are plain labels (both panes are always side by side). */
.tho-fit button.tho-pane-tag { border:0; font:inherit; cursor:default; }
@media (max-width: 767px) {
  .tho-fit button.tho-pane-tag { min-width:44px; min-height:44px; padding:0 12px; font-size:13px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:6px; pointer-events:auto; z-index:1000; width:auto; max-width:calc(100% - 16px); }
  .tho-fit.tho-v-plan .tho-pane[data-side="map"], .tho-fit.tho-v-map .tho-pane[data-side="plan"] { display:none; }
}
@media (min-width: 768px) { .tho-fit button.tho-pane-tag { pointer-events:none; } .tho-fit button.tho-pane-tag span { display:none; } }

/* M-1: MEASURE — the crosshair, the sheet at the bottom of the map, the points, the legs and the live (rubber-band) leg */
.thom-cross { position:absolute; left:50%; top:50%; width:34px; height:34px; margin:-17px 0 0 -17px; z-index:650; pointer-events:none;
  background:linear-gradient(var(--accent),var(--accent)) center/2px 100% no-repeat, linear-gradient(var(--accent),var(--accent)) center/100% 2px no-repeat;
  filter:drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff); }
.thom-sheet { position:absolute; left:8px; right:8px; bottom:24px; z-index:850; max-height:45%; overflow:auto; padding:8px 10px; box-sizing:border-box;
  background:var(--card); color:var(--ink); border:1px solid rgba(0,0,0,.2); border-radius:12px; box-shadow:0 2px 10px rgba(20,28,40,.3); font-size:13px; }
@media (min-width: 768px) { .thom-sheet { left:auto; width:380px; } }
.thom-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:4px; }
.thom-head strong { font-size:15px; }
.thom-sheet button { width:auto; padding:7px 12px; font-size:14px; font-weight:600; border-radius:9px; border:1px solid var(--line); background:var(--bg); color:var(--ink); }
.thom-sheet button.thom-add { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.thom-sheet button:disabled { opacity:.45; }
.thom-live { margin:2px 0 0; font-size:15px; font-weight:700; }
.thom-live2, .thom-legs small, .thom-prec, .thom-note { margin:2px 0; font-size:12px; color:var(--muted); }
.thom-legs { margin:6px 0 0; padding:0 0 0 2px; list-style:none; }
.thom-legs li { padding:3px 0; border-top:1px solid var(--line); }
.thom-legs small { display:block; }
.thom-lab { font-weight:700; color:var(--muted); }
.thom-total { margin:4px 0 0; font-weight:700; }
.thom-total:empty, .thom-live2:empty, .thom-msg:empty { display:none; }
.thom-acts { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 4px; }
.thom-pt { background:none; border:0; }
.thom-pt span { display:flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; background:var(--accent); color:var(--accent-ink);
  font:700 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; border:2px solid #fff; box-shadow:0 1px 3px rgba(0,0,0,.4); box-sizing:border-box; }
path.thom-line { stroke:var(--accent); stroke-width:3; fill:none; }
path.thom-band { stroke:var(--accent); stroke-width:2.5; stroke-dasharray:6 5; fill:none; }
@media (pointer: coarse) { .thom-sheet button { min-height:44px; min-width:44px; } }
.thom-more summary { cursor:pointer; font-size:12px; color:var(--muted); padding:4px 0; }
.thom-legs { max-height:72px; overflow:auto; }   /* the sheet stays low: the aimer at the map's centre is never under it */
@media (max-width: 767px) { .thom-sheet { max-height:38%; } }

/* M-2: "Measure on the map" in Scale & bearing — the map pane under the plan while measuring, the step box */
.tho-scale .tho-pane[hidden] { display:none; }
.tho-scale button.tho-mm-start { width:auto; margin-top:8px; padding:9px 14px; font-size:14px; font-weight:600; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:9px; }
.tho-mm { margin-top:8px; padding:8px; border:1px solid var(--accent); border-radius:10px; }
.tho-mm-step { margin:0 0 4px; font-size:13px; font-weight:600; }
.tho-mm-live { margin:0 0 6px; font-size:15px; font-weight:700; }
.tho-mm-live:empty { display:none; }
.tho-mm-acts { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.tho-mm-acts button { width:auto; padding:9px 12px; font-size:14px; font-weight:600; border-radius:9px; border:1px solid var(--line); background:var(--bg); color:var(--ink); white-space:normal; text-align:left; }
.tho-mm-acts button.tho-mm-go, .tho-mm-acts button.tho-mm-use { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.tho-mm-acts button[hidden] { display:none; }
.tho-scale input.tho-mm-angle { display:block; width:100%; max-width:160px; margin-top:4px; padding:10px 12px; font-size:16px; }
@media (pointer: coarse) { .tho-scale button.tho-mm-start, .tho-mm-acts button, .tho-scale input.tho-mm-angle { min-height:44px; } }
@media (max-width: 767px) {   /* M-2 on a phone: only the pane being aimed, full height */
  .tho-scale.tho-mm-map .tho-pane[data-side="plan"], .tho-scale.tho-mm-draw .tho-pane[data-side="map"] { display:none; }
}

/* M-3: Line up one point (in Scale & bearing) and the Plans panel's 30-second Undo */
.tho-scale button.tho-one { width:auto; margin-top:8px; padding:9px 14px; font-size:14px; font-weight:600; background:var(--accent); color:var(--accent-ink); border:0; border-radius:9px; }
.tho-scale button.tho-one[hidden] { display:none; }
.tho-status button.tho-undo { width:auto; margin-left:6px; padding:4px 10px; font-size:13px; font-weight:700; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:8px; }
@media (pointer: coarse) { .tho-scale button.tho-one, .tho-status button.tho-undo { min-height:44px; } }

/* ── T-2: a drawing set's Pages grid (overlay-pages.js) — as many ≥ 76 px columns as the panel fits (3 in the side panel / a phone) ── */
.tho-pages { margin-top:6px; }
.tho-panel button.tho-pages-btn { display:inline-flex; align-items:center; gap:4px; }
.tho-pages-btn[aria-expanded="true"] .tho-chev { transform:rotate(180deg); }
.tho-pts { list-style:none; margin:6px 0 0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(76px, 1fr)); gap:6px; }
.tho-pt { position:relative; min-width:0; }
.tho-panel button.tho-pt-go { display:block; width:100%; padding:0; margin:0; background:#fff; color:var(--ink); border:1px solid var(--line);
                              border-radius:6px; overflow:hidden; cursor:pointer; text-align:left; }
.tho-pt-go img, .tho-pt-none { display:block; width:100%; height:auto; aspect-ratio:24 / 17; object-fit:contain; background:#fff; }
.tho-pt-none { display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:600; color:var(--muted); background:var(--bg); }
/* the caption strip: "p3 ◆" on the left, ⋯ (managers) sits over its right end — never over the preview */
.tho-pt-n { display:flex; align-items:center; height:26px; padding:0 30px 0 6px; font-size:12px; font-weight:600; border-top:1px solid var(--line); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tho-pt-own { font-weight:400; color:var(--accent); font-size:10px; margin-left:3px; }
.tho-pt-on .tho-pt-go { border:2px solid var(--accent); box-shadow:0 0 0 2px var(--accent); }
.tho-panel button.tho-pt-go:hover { border-color:var(--accent); }
.tho-panel button.tho-pt-more { position:absolute; bottom:1px; right:1px; width:26px; height:26px; padding:0; font-size:15px; line-height:1;
                                background:transparent; color:var(--ink); border:0; border-radius:6px; }
.tho-panel button.tho-pt-more:hover { background:var(--hover); }
.tho-panel button.tho-pt-more[aria-expanded="true"] { background:var(--accent); color:#fff; }
.tho-pt-acts { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:6px; padding:6px; border:1px solid var(--line); border-radius:8px; }
.tho-pt-what { font-weight:600; }
@media (pointer: coarse) {
  .tho-pt-n { height:44px; padding-right:48px; font-size:13px; }
  .tho-panel button.tho-pt-more { width:44px; height:44px; bottom:0; right:0; font-size:18px; }
  .tho-panel button.tho-pages-btn { min-height:44px; }
}

/* HF-1: on a phone the Plans panel reaches the map's right edge — the ruler (top right) would sit on its ✕, so it hides while the panel is open */
@media (max-width: 767px) { .tho-panel-on .thom-ctl { display:none; } }

/* ── 1177 P-1: an opened row starts with its LINE UP buttons, then the tools, then Remove / Delete ── */
.tho-panel .tho-acts-lu button.tho-mini { border-color:var(--accent); }
.tho-det .tho-acts-del { margin-top:2px; }
.tho-det .tho-pages { margin-top:4px; }

/* ── 1177 P-2: the labelled background switch "Satellite | Street" (top right of every map; data-mt-own = not a map-tools square) ── */
.leaflet-container .tho-basesw { display:flex; clear:both; margin:8px 8px 0 0; padding:0; border:1px solid rgba(0,0,0,.25); border-radius:8px; overflow:hidden;
                                 box-shadow:0 1px 5px rgba(0,0,0,.25); background:#fff; }
.leaflet-container .tho-basesw > button { flex:none; box-sizing:border-box; width:auto; min-width:0; height:32px; margin:0; padding:0 10px; white-space:nowrap;
                                          font:600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background:#fff; color:#222;
                                          border:0; border-radius:0; box-shadow:none; cursor:pointer; }
.leaflet-container .tho-basesw > button + button { border-left:1px solid rgba(0,0,0,.2); }
.leaflet-container .tho-basesw > button:hover:not([aria-pressed="true"]) { background:var(--hover, #eef1f4); }
.leaflet-container .tho-basesw > button[aria-pressed="true"] { background:var(--accent, #2563eb); color:#fff; }
.leaflet-container .tho-basesw > button:focus-visible { outline:2px solid var(--accent, #2563eb); outline-offset:-2px; }
@media (pointer: coarse) { .leaflet-container .tho-basesw > button { height:44px; padding:0 12px; font-size:14px; } }
/* on a phone the open Plans panel reaches the right edge — the switch hides under it, like the ruler (HF-1) */
@media (max-width: 767px) { .leaflet-container.tho-panel-on .tho-basesw { display:none; } }

/* ── 1177 P-3: Move — the map stops panning; dragging anywhere moves the plan (bar = .tho-adj-bar) ── */
.leaflet-container.tho-move-on, .leaflet-container.tho-move-on .leaflet-interactive { cursor:move; }

/* ── D-6a: private sketch notes (overlay-sketch.js) ── */
/* the Notes sheet: a bottom sheet on a phone, a side panel on a computer */
.tho-sk-sheet { position:fixed; z-index:2500; left:0; right:0; bottom:0; max-height:70vh; overflow:auto; box-sizing:border-box; padding:12px 14px 16px;
                background:var(--card); color:var(--ink); border-top:1px solid var(--line); border-radius:14px 14px 0 0; box-shadow:0 -6px 24px rgba(20,28,40,.25); font-size:14px; }
@media (min-width: 768px) { .tho-sk-sheet { left:auto; top:72px; bottom:auto; right:16px; width:360px; max-height:calc(100vh - 100px); border:1px solid var(--line); border-radius:12px; } }
.tho-sk-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.tho-sk-head h2 { margin:0; font-size:16px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tho-sk-sheet button { font:inherit; color:inherit; }
.tho-sk-sheet button.tho-sk-x { flex:none; width:40px; height:40px; padding:0; background:transparent; border:0; border-radius:8px; color:var(--muted); font-size:16px; }
.tho-sk-hint { margin:2px 0 8px; color:var(--muted); font-size:13px; }
.tho-sk-list { list-style:none; margin:0; padding:0; }
.tho-sk-row { display:flex; flex-wrap:wrap; align-items:center; gap:4px; padding:4px 0; border-top:1px solid var(--line); }
.tho-sk-row.tho-sk-on .tho-sk-name { font-weight:700; }
.tho-sk-sheet .tho-sk-row > button { flex:none; min-width:40px; height:40px; padding:0 6px; background:transparent; border:0; border-radius:8px; cursor:pointer; }
.tho-sk-sheet .tho-sk-row > button:hover { background:var(--hover); }
.tho-sk-sheet .tho-sk-row > button.tho-sk-name { flex:1 1 auto; min-width:0; text-align:left; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; overflow:hidden; }
.tho-sk-n { font-size:12px; font-weight:400; color:var(--muted); }
.tho-sk-sheet .tho-sk-act[aria-pressed="true"] { color:var(--accent); font-size:20px; }
.tho-sk-name-in { flex:1 1 auto; min-width:0; height:36px; padding:0 8px; font:inherit; border:1px solid var(--accent); border-radius:8px; background:var(--bg); color:var(--ink); }
.tho-sk-menu { flex-basis:100%; display:flex; gap:6px; padding:0 0 4px 84px; }
.tho-sk-menu button { padding:6px 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); }
.tho-sk-menu button.tho-del { color:var(--err); }
.tho-sk-empty { color:var(--muted); margin:8px 0; }
.tho-sk-acts { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.tho-sk-sheet button.tho-sk-draw { padding:9px 14px; font-weight:700; background:var(--accent); color:var(--accent-ink, #fff); border:0; border-radius:9px; }
.tho-sk-msg { margin:8px 0 0; font-size:13px; }
.tho-sk-msg.tho-err { color:var(--err); }
@media (pointer: coarse) { .tho-sk-sheet .tho-sk-row > button, .tho-sk-sheet .tho-sk-acts button, .tho-sk-menu button { min-height:44px; min-width:44px; } }
/* draw mode: the map is the paper; the page flicker hides; the bar holds the pen */
.leaflet-container.tho-draw-on { cursor:crosshair; }
.tho-sk-tools { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:4px 0; }
.tho-sk-swatches, .tho-sk-widths { display:flex; gap:6px; }
.tho-draw-bar button.tho-sk-sw { width:32px; height:32px; padding:0; border-radius:50%; background:var(--sw); border:3px solid #fff; box-shadow:0 0 0 1px var(--line); }
.tho-draw-bar button.tho-sk-sw[aria-pressed="true"] { box-shadow:0 0 0 3px var(--ink); }
.tho-draw-bar .tho-sk-widths button { height:32px; padding:0 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--ink); font-weight:600; }
.tho-draw-bar .tho-sk-widths button[aria-pressed="true"] { background:var(--ink); color:#fff; }
@media (pointer: coarse) { .tho-draw-bar button.tho-sk-sw { width:44px; height:44px; } .tho-draw-bar .tho-sk-widths button { height:44px; } }
/* any other button on the map's action bar (Move's Undo, the pen's Undo / Clear / Retry) looks like Cancel — Save / Done is the one filled */
.tho-adj-bar .tho-adj-actions button:not(.tho-adj-save):not(.tho-adj-cancel) { flex:1 1 0; width:auto; padding:10px; font-size:15px; background:var(--bg); color:var(--ink); border:1px solid var(--line); }
@media (pointer: coarse) { .tho-adj-bar .tho-adj-actions button { min-height:44px; } }
/* Move's choice (Gary: move all pages together, or only one): two big segmented buttons; the filled one is chosen */
.tho-adj-bar .tho-mv-scope { display:flex; gap:0; margin:2px 0 6px; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.tho-adj-bar .tho-mv-scope button { flex:1 1 0; width:auto; padding:9px 8px; font-size:14px; font-weight:600; border:0; border-radius:0; background:var(--bg); color:var(--ink); cursor:pointer; }
.tho-adj-bar .tho-mv-scope button + button { border-left:1px solid var(--line); }
.tho-adj-bar .tho-mv-scope button.tho-mv-on { background:var(--ink); color:#fff; }
.tho-adj-bar .tho-mv-note { margin:0 0 6px; font-size:13px; color:var(--muted); }
@media (pointer: coarse) { .tho-adj-bar .tho-mv-scope button { min-height:44px; } }
/* the pen bar stays low and compact on a phone: title + tip on one line, colours + line on one row, then the actions */
.tho-draw-bar .tho-sk-title { margin:0 0 2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tho-draw-bar .tho-sk-tip { font-size:12px; color:var(--muted); }
.tho-draw-bar .tho-sk-tools { flex-wrap:nowrap; justify-content:space-between; gap:6px; margin:2px 0; }
.tho-draw-bar .tho-adj-status:empty { display:none; }
@media (max-width: 767px) { .tho-draw-bar { padding:8px 10px; } }   /* height stays .tho-adj-bar's (clear of the + button) */
/* the sheet's own controls: the app's general button / heading styles must not stretch or shout */
.tho-sk-sheet h2 { text-transform:none; letter-spacing:normal; color:var(--ink); font-weight:700; }
.tho-sk-sheet button { width:auto; display:inline-flex; align-items:center; justify-content:center; box-shadow:none; }
.tho-sk-sheet .tho-sk-row > button { background:transparent; color:var(--ink); border:0; }
.tho-sk-sheet .tho-sk-row > button.tho-sk-name { justify-content:center; }
.tho-sk-sheet .tho-sk-eye { font-size:18px; }
.tho-sk-sheet .tho-sk-acts button.tho-mini { padding:9px 12px; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:9px; font-weight:600; }

/* ── BRIEF-1186: Line up's map side shows ONE thing — PDF = one other page of the set on a plain background, ‹ p3 › to step ── */
.leaflet-container.tho-pdf-on { background:#eef0f3; }
.leaflet-container.tho-pdf-on .leaflet-tile-pane { display:none; }
.leaflet-container .tho-refpg { display:flex; align-items:center; clear:both; margin:0 8px 6px 0; border:1px solid rgba(0,0,0,.25); border-radius:8px; overflow:hidden;
                                box-shadow:0 1px 5px rgba(0,0,0,.25); background:#fff; color:#222; }
.leaflet-container .tho-refpg[hidden] { display:none; }
.leaflet-container .tho-refpg > button { flex:none; width:34px; height:32px; margin:0; padding:0; font:700 18px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
                                         background:#fff; color:#222; border:0; border-radius:0; box-shadow:none; cursor:pointer; }
.leaflet-container .tho-refpg > button:disabled { opacity:.35; cursor:default; }
.leaflet-container .tho-refpg-n { padding:0 6px; font:600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; white-space:nowrap; }
.leaflet-container .tho-refpg-n small { font-weight:400; color:#666; }
@media (pointer: coarse) { .leaflet-container .tho-refpg > button { width:44px; height:44px; } }

/* ── 1191: the old layers icon shows only what isn't a background (the labelled switch does those); hidden when that's nothing ── */
/* ── 1192: a FINE crosshair cursor (1 px, white halo, exact centre) wherever a spot is being picked; the hand only while dragging ── */
.leaflet-container { --tho-fine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25'%3E%3Cpath d='M12.5 0v25M0 12.5h25' stroke='%23fff' stroke-width='3'/%3E%3Cpath d='M12.5 0v25M0 12.5h25' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E") 12 12, crosshair; }
.leaflet-container.thom-on, .leaflet-container.thom-on.leaflet-grab,
.tho-fit .leaflet-container, .tho-fit .leaflet-container.leaflet-grab,
.leaflet-container.tho-pick-map, .leaflet-container.tho-pick-map.leaflet-grab,
.leaflet-container.tho-draw-on, .leaflet-container.tho-draw-on.leaflet-grab { cursor:var(--tho-fine); }
.leaflet-dragging .leaflet-container.thom-on.leaflet-grab, .leaflet-dragging .tho-fit .leaflet-container.leaflet-grab,
.leaflet-dragging .leaflet-container.tho-pick-map.leaflet-grab { cursor:grabbing; }
/* the app's round + button never sits on a tool's sheet / bar (Measure, Move, Adjust corners, Draw) */
body.tho-tool-open .fab, body.tho-tool-open .nb-plus { display:none !important; }   /* the + (classic .fab, and the bottom bar's .nb-plus) */

/* ── D-6b: notes shared with me (read-only) + the share view ── */
.tho-sk-h3 { margin:12px 0 2px; font-size:13px; font-weight:700; color:var(--muted); text-transform:none; letter-spacing:normal; }
.tho-sk-sheet .tho-sk-ro { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; padding:0 6px; overflow:hidden; }
.tho-sk-share { display:flex; flex-direction:column; gap:2px; margin:6px 0; }
.tho-sk-pick { display:flex; align-items:center; gap:10px; min-height:40px; padding:0 4px; border-top:1px solid var(--line); cursor:pointer; }
.tho-sk-pick input { width:20px; height:20px; margin:0; accent-color:var(--accent); }
.tho-sk-share button[data-sk="share-all"] { align-self:flex-start; margin-top:6px; }
@media (pointer: coarse) { .tho-sk-pick { min-height:44px; } }
/* a long layer name shrinks (…) instead of pushing ⋯ onto its own line */
.tho-sk-sheet .tho-sk-row > button.tho-sk-name, .tho-sk-sheet .tho-sk-row > .tho-sk-ro { flex:1 1 0; min-width:0; }
.tho-sk-sheet .tho-sk-name, .tho-sk-sheet .tho-sk-ro { white-space:nowrap; }
.tho-sk-sheet .tho-sk-name > *, .tho-sk-sheet .tho-sk-ro > * { max-width:100%; overflow:hidden; text-overflow:ellipsis; }
/* ── the shared pen's TOOLS (sketch-pen.js; Gary 2026-10-27 part 2): pen · line · arrow · box · circle · dimension · note · edit ── */
.tho-draw-bar .tho-sk-toolrow { display:flex; flex-wrap:wrap; gap:4px; margin:4px 0; }
.tho-draw-bar .tho-sk-toolrow button { flex:0 0 auto; width:auto; display:inline-flex; align-items:center; gap:4px; height:34px; padding:0 8px; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--ink); font-weight:600; font-size:13px; }
.tho-draw-bar .tho-sk-toolrow button span[aria-hidden] { font-size:15px; line-height:1; }
.tho-draw-bar .tho-sk-toolrow button[aria-pressed="true"] { background:var(--ink); color:#fff; border-color:var(--ink); }
.tho-draw-bar .tho-sk-toolrow button[data-dims] { margin-left:auto; }
@media (max-width: 520px) { .tho-draw-bar .tho-sk-toolrow button[data-dims] { margin-left:0; } }
.tho-draw-bar .tho-sk-toolrow button:focus-visible, .tho-draw-bar .tho-sk-form button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (max-width: 520px) { .tho-draw-bar .tho-sk-toolrow { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:thin; -webkit-overflow-scrolling:touch; } .tho-draw-bar .tho-sk-toolrow .tho-sk-tl { display:none; } .tho-draw-bar .tho-sk-toolrow button { min-width:38px; justify-content:center; } .tho-draw-bar .tho-sk-toolrow button[data-dims] .tho-sk-tl { display:none; } }
@media (pointer: coarse) { .tho-draw-bar .tho-sk-toolrow button { height:42px; min-width:42px; } }
.tho-draw-bar .tho-sk-form { display:flex; flex-direction:column; gap:6px; }
.tho-draw-bar .tho-sk-fl { display:flex; flex-direction:column; gap:3px; font-size:13px; font-weight:600; color:var(--muted); }
.tho-draw-bar .tho-sk-fl textarea, .tho-draw-bar .tho-sk-fl input { font:inherit; font-size:15px; font-weight:400; color:var(--ink); padding:6px 8px; border:1px solid var(--line); border-radius:8px; background:var(--card); width:100%; box-sizing:border-box; }
.tho-draw-bar .tho-sk-photo button, .tho-draw-bar .tho-sk-fl + .tho-adj-actions button { width:auto; }
.tho-draw-bar .tho-sk-photo { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:14px; }
.tho-draw-bar .tho-sk-addphoto { display:inline-flex; align-items:center; min-height:40px; padding:0 12px; border:1px dashed var(--accent); border-radius:8px; color:var(--accent); font-weight:600; cursor:pointer; }
.tho-draw-bar .tho-sk-addphoto input { position:absolute; width:1px; height:1px; opacity:0; }
.tho-draw-bar .tho-sk-addphoto:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.tho-draw-bar .tho-sk-pn { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:60%; }
.tho-draw-bar button.tho-del { color:var(--err, #d23f3f) !important; }
/* a phone's "Hide tools" (sketch-pen.js; remembered on the device): only the title, Undo and Done stay */
.tho-draw-bar .tho-sk-head { display:flex; align-items:center; gap:8px; }
.tho-draw-bar .tho-sk-head .tho-sk-title { flex:1 1 auto; min-width:0; }
.tho-draw-bar button.tho-sk-mini { display:none; flex:0 0 auto; width:auto; height:32px; padding:0 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--ink); font-weight:600; font-size:13px; }
@media (max-width: 520px) { .tho-draw-bar button.tho-sk-mini { display:inline-flex; align-items:center; } .tho-draw-bar.tho-sk-min .tho-sk-tip { display:none; } }
@media (max-width: 520px) and (pointer: coarse) { .tho-draw-bar button.tho-sk-mini { height:40px; } }
@media (max-width: 520px) { .tho-draw-bar.tho-sk-min .tho-sk-toolrow, .tho-draw-bar.tho-sk-min .tho-sk-tools, .tho-draw-bar.tho-sk-min .tho-sk-clear, .tho-draw-bar.tho-sk-min .tho-sk-retry { display:none; } }

/* ── PLANSCOPE: the Folder tree picker + task search (overlay-folderpick.js) ───────────────── */
.thofp-body { display:flex; flex-direction:column; min-height:0; flex:1 1 auto; gap:8px; margin-top:8px; }
.thofp-list { list-style:none; margin:0; padding:0; overflow:auto; flex:1 1 auto; min-height:0; max-height:min(60vh, 520px); border:1px solid var(--line); border-radius:10px; }
.thofp-list li + li { border-top:1px solid var(--line); }
.thofp button.thofp-node, .thofp button.thofp-task { display:block; width:100%; min-height:44px; padding:8px 10px; text-align:left; font-size:14px; font-weight:600;
  background:transparent; color:var(--ink); border:0; border-radius:0; overflow-wrap:anywhere; }
.thofp button.thofp-task { border:1px solid var(--line); border-radius:10px; background:var(--bg); }
.thofp button.thofp-node:hover, .thofp button.thofp-task:hover { background:var(--hover); }
.thofp button.thofp-node[aria-current], .thofp button.thofp-task[aria-current] { box-shadow:inset 3px 0 0 var(--accent); }
.thofp button.thofp-off { color:var(--muted); font-weight:400; cursor:default; }
.thofp-path { display:block; font-size:12px; font-weight:400; color:var(--muted); }
.thofp-find { display:flex; flex-direction:column; gap:4px; font-size:13px; font-weight:600; color:var(--ink); }
.thofp-find input { width:100%; padding:8px; font-size:14px; border:1px solid var(--line); border-radius:8px; background:#fbfcfd; color:var(--ink); }
.thofp button:focus-visible, .thofp input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* Scale & bearing: which pages Save changes, and "Draw a line on the plan" (Gary 2026-11-04) */
.tho-scale-scope { margin:6px 0 0; font-size:13px; color:var(--muted); }
.tho-scale button.tho-ln-start { width:auto; margin-top:8px; margin-right:6px; padding:9px 14px; font-size:14px; font-weight:600; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:9px; }
.tho-ln { margin-top:8px; }
.tho-ln[hidden], .tho-ln-have[hidden], .tho-scale button.tho-ln-start[hidden] { display:none; }
.tho-ln-step { margin:0 0 4px; font-size:13px; font-weight:600; }
.tho-ln button[hidden] { display:none; }
.tho-ln .tho-mm-acts button.tho-ln-go, .tho-ln .tho-mm-acts button.tho-ln-use { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.tho-scale input.tho-ln-deg { display:block; width:100%; max-width:160px; margin-top:4px; padding:10px 12px; font-size:16px; }
.tho-ln-arrow-wrap { background:none; border:0; }
.tho-ln-arrow { width:26px; height:26px; fill:#e0245e; stroke:#fff; stroke-width:1.5; }
@media (pointer: coarse) { .tho-scale button.tho-ln-start, .tho-ln .tho-mm-acts button, .tho-scale input.tho-ln-deg { min-height:44px; } }
.tho-scale.tho-ln-on .tho-fit-step, .tho-scale.tho-ln-on .tho-fit-actions { display:none; }   /* while drawing the bearing line the scale's own Set buttons step aside */

/* Changed <date> + sort / age filter (Gary 2026-11-04) · several pages on the map (eye on each tile + own opacity) */
.tho-changed { margin-top:0; }
.tho-sortrow { display:flex; flex-wrap:wrap; gap:8px; margin:6px 0; font-size:12px; color:var(--muted); }
.tho-sortrow select { font-size:13px; padding:4px 6px; max-width:100%; border:1px solid var(--line); border-radius:8px; background:#fbfcfd; color:var(--ink); }   /* PHONE2: not the browser's bare select */
@media (pointer: coarse) { .tho-sortrow select { min-height:44px; font-size:16px; } }
.tho-panel button.tho-pt-eye { position:absolute; top:1px; right:1px; width:26px; height:26px; padding:0; font-size:15px; line-height:1; border-radius:6px; border:1px solid var(--line); background:var(--bg); color:var(--accent); }
.tho-panel button.tho-pt-eye[aria-pressed="true"] { background:var(--accent); color:#fff; }
.tho-panel button.tho-pt-eye:disabled { opacity:.85; cursor:default; }
@media (pointer: coarse) { .tho-panel button.tho-pt-eye { width:44px; height:44px; font-size:18px; } }
.tho-pt-ops { display:flex; flex-wrap:wrap; gap:8px; margin:6px 0; align-items:center; font-size:12px; }
.tho-pt-op input[type=range] { width:110px; vertical-align:middle; }

/* ── Show only… (PLANCLIP, overlay-clip.js) ─────────────────────────────────── */
.tho-clip .tho-fit-panes { flex-direction:column; }
.tho-clip-acts { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.tho-clip-acts .tho-mini[hidden] { display:none; }
.tho-clip-pt { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:50%; background:#fff; color:#1b2430;
               border:3px solid var(--accent); box-shadow:0 1px 4px rgba(0,0,0,.55); font:700 13px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; }
.tho-clip-pt.tho-clip-first { background:var(--accent); color:#fff; border-color:#fff; }
.tho-clip-pt.tho-clip-sel { background:#e0245e; color:#fff; border-color:#fff; }
.tho-fit-step.tho-err { color:var(--err); }
.tho-meta-clip { color:var(--ink); }
@media (pointer: coarse) {
  .tho-clip-acts .tho-mini { min-height:44px; min-width:44px; }
}

/* the way back from a task's drawing, in the Plans panel (the floating pager chip was removed — Gary 2026-11-05) */
.tho-tmbar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:6px 0; font-size:12px; font-weight:700; color:var(--accent); }
.tho-tmbar[hidden] { display:none; }
@media (pointer: coarse) { .tho-tmbar .tho-mini { min-height:44px; } }

/* ── PLANBAR (Gary 2026-11-05): compact rows + ONE toolbar for the active plan, docked at the top of the panel ── */
.tho-bar { position:sticky; top:0; z-index:5; margin:0 -4px 6px; padding:6px 4px 6px; background:var(--card); border-bottom:1px solid var(--line); }
.tho-bar-head { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.tho-bar-head .tho-offscr-btn { order:2; flex:1 1 100%; min-height:36px; }   /* PLANSALL: its own line under Tools / Select plans */
.tho-bar-title { flex:1 1 auto; min-width:0; font-weight:700; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* the selected plan is shown by its row's highlight (.plt-sel, shared/plan-tree.css); .tho-active only marks the file's row for the code */
.tho-panel button.tho-detbtn { flex:none; width:30px; height:30px; padding:0; display:inline-flex; align-items:center; justify-content:center; background:transparent; border:1px solid var(--line); border-radius:7px; }
.tho-lockico { flex:none; font-size:12px; }
.tho-row .tho-op { margin:2px 0 0 42px; }
.tho-row .tho-changed { margin-left:42px; }
.tho-row .tho-where { margin-left:42px; }
.leaflet-container path.tho-hl { pointer-events:none; }
@media (pointer: coarse) {
  .tho-panel button.tho-detbtn { width:44px; height:44px; }
  .tho-row .tho-op, .tho-row .tho-changed, .tho-row .tho-where { margin-left:0; }
}
.tho-bar-title { white-space:normal; overflow-wrap:anywhere; line-height:1.25; }
.tho-row .tho-line { flex-wrap:wrap; }
.tho-panel button.tho-rowbtn { flex:1 1 130px; }

/* ── Snap to a point (PLANBAR, overlay-snap.js): the bar is Move's bar; four small buttons wrap ── */
.tho-snap-acts { flex-wrap:wrap; }
.tho-snap-bar button[hidden] { display:none; }
.tho-snap-bar .tho-snap-undo, .tho-snap-bar .tho-snap-two { background:var(--bg); color:var(--ink); border:1px solid var(--line); }
@media (pointer: coarse) { .tho-snap-bar button { min-height:44px; } }

/* ── PAGEEYE: a set's pages as compact always-visible sub-rows, each with its own eye + see-through ── */
.tho-pgrows { list-style:none; margin:2px 0 0 42px; padding:0; }
.tho-pgrow { display:flex; align-items:center; gap:6px; padding:2px 0; }
.tho-pgrow-cur .tho-pgname { font-weight:700; color:var(--ink); }
.tho-panel button.tho-pgeye { width:30px; height:30px; }
.tho-panel button.tho-pgeye svg { width:17px; height:17px; }
.tho-panel button.tho-pgname { flex:1 1 90px; min-width:0; text-align:left; background:transparent; border:0; padding:4px 2px; font-size:13px; color:var(--muted); cursor:pointer; overflow-wrap:anywhere; }
@media (pointer: coarse) {
  .tho-pgrows { margin-left:0; }
  .tho-pgnote { margin-left:0; }
  .tho-panel button.tho-pgeye { width:40px; height:40px; }
  .tho-panel button.tho-pgname { min-height:40px; }
}

/* ── SLIM LIST + Info & settings (Gary 2026-11-06): the list is just eye · name · lock; the toolbar carries the rest ── */
.tho-row .tho-npages { color:var(--muted); font-weight:400; font-size:12px; }
.tho-pgnote { margin:2px 0 0 42px; }
.tho-bar .tho-bar-info { margin-top:8px; padding-top:6px; border-top:1px solid var(--line); max-height:42vh; overflow:auto; }
.tho-bar-head .tho-bar-title { flex:1 1 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* the Map's Tools (maptoolsmenu): the Satellite | Street switch shows icons, not words */
.tho-basesw .tho-bw { display:inline; }
.tho-basesw button svg { display:none; width:20px; height:20px; }
.leaflet-container.thtm-on .tho-basesw button svg { display:block; }
.leaflet-container.thtm-on .tho-basesw .tho-bw { display:none; }
.leaflet-container.thtm-on .tho-basesw > button { display:flex; align-items:center; justify-content:center; width:var(--mt-size, 36px); min-width:var(--mt-size, 36px); height:var(--mt-size, 36px); padding:0; }

/* the Map's Plans list: each row is eye · name · Go to (Gary 2026-11-07); a page of a drawing set is its own row with the same three */
.tho-panel button.tho-rowgo { flex:none; width:auto; min-height:36px; padding:0 10px; }
@media (max-width: 767px) { .tho-panel button.tho-rowgo { min-height:44px; min-width:44px; } }

/* ── PLANSGROUP (Gary 2026-11-07): the Map's Plans list is the grouped list of shared/plan-tree.css; the toolbar is replaced by a TOOLS dropdown at the top of the panel ── */
.tho-bar-head { gap:8px; }
.tho-bar-none { color:var(--muted); font-weight:400; }
.tho-panel button.tho-toolsbtn { flex:none; width:auto; padding:6px 12px; font-weight:600; }
.tho-menu { margin-top:6px; max-height:46vh; overflow-y:auto; border:1px solid var(--line); border-radius:8px; background:var(--card); }
.tho-menu[hidden] { display:none; }
.tho-menu-add { border-top:1px solid var(--line); }
.tho-menu-add[hidden] { display:none; }
.tho-panel button.tho-mi { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; width:100%; min-height:40px; margin:0; padding:6px 12px; text-align:left; font:inherit; font-size:14px; border:0; border-radius:0; background:transparent; color:var(--ink); cursor:pointer; }
.tho-panel button.tho-mi:hover:not(:disabled) { background:var(--hover); }
.tho-panel button.tho-mi:disabled { color:var(--muted); opacity:.65; cursor:not-allowed; }
.tho-panel button.tho-mi.tho-del { color:var(--err); }
.tho-panel button.tho-mi:disabled.tho-del { color:var(--muted); }
.tho-mi-why { font-size:11px; color:var(--muted); }
.tho-panel button.tho-menu-add .tho-addbtn, .tho-panel .tho-menu-add button.tho-addbtn { width:100%; padding:6px 12px; font-size:14px; }
.tho-panel .tho-menu-add button.tho-addbtn[hidden] { display:none; }
.tho-bar .tho-bar-info { margin-top:8px; }
.tho-row.tho-active { background:none; box-shadow:none; }
@media (pointer: coarse) { .tho-panel button.tho-mi { min-height:44px; } .tho-panel button.tho-toolsbtn { min-height:44px; } }
.tho-list { overflow-x:hidden; }

/* PLANEDIT S1 — the Edit plan screen is Line up's screen with split-screen chrome: Source | Destination, four tabs (only Point pairs works yet).
   Phone: a two-button toggle above ONE visible pane (the tags are plain labels); computer: both panes always, the toggle is hidden. */
.tho-fit.tho-edit button.tho-pane-tag { pointer-events:none; cursor:default; }
.tho-fit.tho-edit .tho-pane-tag { right:auto; max-width:calc(100% - 16px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tho-pe-tog { display:none; gap:6px; padding:6px 6px 0; }
.tho-fit .tho-pe-tog button { flex:1 1 0; min-width:0; min-height:44px; padding:4px 8px; font-size:14px; font-weight:700; line-height:1.15; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:10px; }
.tho-fit .tho-pe-tog button[aria-pressed="true"] { background:var(--accent); color:#fff; border-color:var(--accent); }
@media (max-width: 767px) { .tho-pe-tog { display:flex; } }
.tho-pe-tabs { display:flex; gap:6px; margin:0 0 8px; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.tho-pe-tabs::-webkit-scrollbar { display:none; }
.tho-fit .tho-pe-tabs button { flex:none; width:auto; min-height:40px; padding:0 14px; font-size:14px; font-weight:700; white-space:nowrap; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:10px; }
.tho-fit .tho-pe-tabs button[aria-selected="true"] { background:var(--ink); color:#fff; border-color:var(--ink); }
@media (pointer: coarse), (max-width: 767px) { .tho-fit .tho-pe-tabs button { min-height:44px; } }
.tho-pe-soon, .tho-pe-lock { margin:0 0 8px; font-size:14px; }
.tho-pe-soon[hidden] { display:none; }
.tho-pe-lock { font-weight:700; color:#8a5300; }
.tho-fit[data-tab]:not([data-tab="pairs"]) :is(.tho-fit-step, .tho-fit-actions, .tho-fit-acc, .tho-fit-pairs, .tho-fit-scale, .tho-fit-stretch) { display:none; }
/* PLANEDIT S2 — Type a place: the pair list + accuracy stay (typed and clicked pairs mix), the step + main button give way to the tab's own panel. */
.tho-fit.tho-edit:is([data-tab="place"], [data-tab="rot"]) :is(.tho-fit-acc, .tho-fit-pairs, .tho-fit-scale, .tho-fit-stretch) { display:block; }
.tho-fit.tho-edit:is([data-tab="place"], [data-tab="rot"]) .tho-fit-pairs { display:flex; }
.tho-pe-place[hidden], .tho-pe-place [hidden] { display:none !important; }
.tho-pe-pl-step { margin:0 0 8px; font-weight:700; font-size:14px; }
.tho-pe-pl-row, .tho-pe-pl-act { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 8px; }
.tho-pe-pl-row > button, .tho-pe-pl-act button { min-height:38px; padding:0 14px; border-radius:10px; border:1px solid var(--line); background:var(--bg); color:var(--ink); }
.tho-fit .tho-pe-pl-row > button.tho-pe-pl-set, .tho-fit .tho-pe-pl-act button { width:auto; }
.tho-pe-pl-set { flex:0 1 auto; background:var(--accent) !important; color:#fff !important; border-color:var(--accent) !important; }
.tho-pe-pl-use { flex:1 1 200px; background:var(--accent) !important; color:#fff !important; border-color:var(--accent) !important; }
.tho-pe-place button:disabled { opacity:.5; }
.tho-pe-seg { display:inline-flex; margin:0; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.tho-pe-seg button { min-height:38px; padding:0 14px; font-size:14px; font-weight:700; background:var(--bg); color:var(--ink); border:0; }
.tho-pe-seg button[aria-pressed="true"] { background:var(--ink); color:#fff; }
.tho-pe-pl-fields { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 8px; }
.tho-pe-f { display:flex; flex-direction:column; gap:2px; flex:1 1 140px; min-width:0; font-size:12px; color:var(--muted, #5b6672); }
.tho-pe-f input, .tho-pe-f select { min-height:38px; padding:0 10px; font-size:16px; color:var(--ink); background:var(--card); border:1px solid var(--line); border-radius:8px; width:100%; box-sizing:border-box; }
.tho-pe-pl-grid, .tho-pe-pl-same, .tho-pe-pl-msg { margin:0 0 6px; font-size:13px; overflow-wrap:anywhere; }
.tho-pe-pl-same { font-variant-numeric:tabular-nums; }
.tho-pe-pl-msg.tho-err { color:#b3261e; font-weight:700; }
.tho-pe-pl-msg.tho-note { color:#8a5300; font-weight:700; }
.tho-pe-pl-msg.tho-ok { color:#1b7a3a; font-weight:700; }
.leaflet-container .tho-refpg-sel { flex:1 1 auto; min-width:0; max-width:46vw; height:32px; margin:0; padding:0 4px; font:600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; border:0; background:#fff; color:#1b2430; }
@media (pointer: coarse) { .leaflet-container .tho-refpg-sel { height:44px; } }
.tho-fit.tho-edit .leaflet-container .tho-refpg { max-width:calc(100% - 16px); }
.tho-fit.tho-edit .leaflet-container .tho-refpg { margin-bottom:40px; }   /* clear of the pane's name tag along the bottom */
.leaflet-container .tho-refpg-sel { min-width:150px; }
.tho-fit-step:empty { display:none; }

@media (pointer: coarse), (max-width: 767px) { .tho-pe-pl-row > button, .tho-pe-pl-act button, .tho-pe-seg button, .tho-pe-f input, .tho-pe-f select { min-height:44px; } .tho-pe-pl-set { flex:1 1 100%; } .tho-pe-f { flex-basis:120px; } }
/* PLANEDIT S3 — Rotate & scale: the typed turn / size panel (the pair list + accuracy stay: the result is two ordinary points). */
.tho-pe-rot[hidden], .tho-pe-rot [hidden] { display:none !important; }
.tho-pe-rs-now, .tho-pe-rs-res { margin:0 0 6px; font-size:13px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.tho-pe-rs-held, .tho-pe-rs-ratio { margin:0 0 8px; font-size:13px; font-weight:700; color:#8a5300; overflow-wrap:anywhere; }
.tho-pe-rs-ratio { font-weight:400; color:var(--muted, #5b6672); }
.tho-pe-rs-row, .tho-pe-rs-grp { display:flex; flex-wrap:wrap; align-items:flex-end; gap:8px; margin:0 0 8px; }
.tho-pe-rs-row > button { min-height:38px; padding:0 14px; border-radius:10px; border:1px solid var(--line); background:var(--bg); color:var(--ink); }
.tho-fit .tho-pe-rs-row > button { width:auto; }
.tho-pe-rs-grp .tho-pe-seg { flex:0 0 auto; max-width:100%; flex-wrap:wrap; }
.tho-pe-rs-msg { margin:0 0 6px; font-size:13px; overflow-wrap:anywhere; }
.tho-pe-rs-msg.tho-err { color:#b3261e; font-weight:700; }
.tho-pe-rs-msg.tho-note { color:#8a5300; font-weight:700; }
.tho-pe-rs-msg.tho-ok { color:#1b7a3a; font-weight:700; }
.tho-pe-rot button:disabled { opacity:.5; }
.tho-pe-rs-apply { flex:1 1 200px; background:var(--accent) !important; color:#fff !important; border-color:var(--accent) !important; }
.tho-fit .tho-pe-pl-act button.tho-pe-rs-apply { width:auto; }
.tho-pe-pivot-wrap { background:none; border:0; }
.tho-pe-pivot { display:block; width:22px; height:22px; border-radius:50%; border:3px solid #d97800; background:rgba(255,255,255,.55); box-sizing:border-box; position:relative; }
.tho-pe-pivot::after { content:''; position:absolute; left:50%; top:50%; width:6px; height:6px; margin:-3px 0 0 -3px; border-radius:50%; background:#d97800; }
@media (pointer: coarse), (max-width: 767px) { .tho-pe-rs-row > button { min-height:44px; } }
.tho-fit .tho-pe-rs-grp .tho-pe-seg { flex-wrap:nowrap; }
.tho-fit .tho-pe-rs-grp .tho-pe-seg button { width:auto; flex:none; white-space:nowrap; padding:0 12px; }
.tho-pe-rs-grp .tho-pe-f { flex:1 1 150px; }
.tho-pe-rs-row .tho-pe-f { flex:1 1 200px; }
@media (max-width: 420px) { .tho-fit .tho-pe-rs-grp .tho-pe-seg { flex:1 1 100%; } .tho-fit .tho-pe-rs-grp .tho-pe-seg button { flex:1 1 auto; padding:0 6px; font-size:13px; } }
/* wide screens: pivot | turn | size side by side so Apply stays in view under the panes */
@media (min-width: 900px) {
  .tho-pe-rs-body:not([hidden]) { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); gap:0 14px; align-items:start; }
  .tho-pe-rs-body > .tho-pe-pl-act, .tho-pe-rs-body > p { grid-column:1 / -1; }
  .tho-pe-rs-row { flex-direction:column; align-items:stretch; }
  .tho-pe-rs-grp { flex-direction:column; align-items:stretch; }
}
@media (min-width: 900px) {
  .tho-pe-rs-body > .tho-pe-rs-row { grid-column:1; grid-row:1; }
  .tho-pe-rs-body > .tho-pe-pl-act { grid-column:1; grid-row:2; align-self:start; }
  .tho-pe-rs-body > [data-g="rot"] { grid-column:2; grid-row:1 / span 2; }
  .tho-pe-rs-body > [data-g="sc"] { grid-column:3; grid-row:1 / span 2; }
  .tho-pe-rs-body > .tho-pe-pl-act .tho-pe-rs-apply { flex:1 1 120px; }
}
@media (min-width: 900px) { .tho-pe-rs-row .tho-pe-f, .tho-pe-rs-grp .tho-pe-f { flex:0 0 auto; } }   /* a column: a flex-basis would become a HEIGHT */

/* ── PLANEDIT OV1-OV4 — Overlay view + locks (overlay-ovl.js). Namespaced .tho-ovl / .tho-pe-mode / .tho-pe-lk. ── */
.tho-pe-mode { display:inline-flex; flex:none; border:1px solid rgba(255,255,255,.35); border-radius:10px; overflow:hidden; }
.tho-fit .tho-pe-mode button { width:auto; min-height:40px; padding:0 14px; font-size:14px; font-weight:700; background:transparent; color:#fff; border:0; border-radius:0; }
.tho-fit .tho-pe-mode button[aria-pressed="true"] { background:var(--accent); color:#fff; }
.tho-pe-mode[hidden] { display:none; }
.tho-fit.tho-ovl .tho-pane[data-side="plan"] { display:none !important; }
.tho-fit.tho-ovl .tho-pane[data-side="map"] { display:block !important; border-color:var(--accent); }
.tho-fit.tho-ovl .tho-pe-tog { display:none !important; }
.tho-ovl-card { position:absolute; top:8px; right:8px; z-index:1000; display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:6px 10px; max-width:calc(100% - 16px); padding:6px 10px; border-radius:12px; background:rgba(255,255,255,.94); color:var(--ink); box-shadow:0 1px 5px rgba(0,0,0,.35); font-size:13px; font-weight:700; }
.tho-ovl-op { display:flex; align-items:center; gap:8px; margin:0; }
.tho-ovl-op input[type="range"] { width:120px; min-height:30px; margin:0; accent-color:var(--accent); }
.tho-ovl-op output { min-width:3.2em; text-align:right; font-variant-numeric:tabular-nums; }
.tho-fit .tho-ovl-move { width:auto; min-height:36px; padding:0 12px; font-size:13px; font-weight:700; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:9px; }
.tho-fit .tho-ovl-move[aria-pressed="true"] { background:var(--ink); color:#fff; border-color:var(--ink); }
.tho-fit .tho-ovl-move:disabled { opacity:.5; }
.tho-ovl-chip { position:absolute; left:8px; bottom:40px; z-index:1000; max-width:calc(100% - 16px); padding:4px 10px; border-radius:8px; background:rgba(20,28,40,.82); color:#fff; font-size:13px; font-weight:600; pointer-events:none; font-variant-numeric:tabular-nums; }
.tho-ovl-chip[hidden] { display:none; }
.tho-ovl-moving { cursor:move; touch-action:none; }
.tho-ovl-h { background:none; border:0; }
.tho-ovl-hd { display:flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:50%; cursor:grab; touch-action:none; }
.tho-ovl-h-anchor .tho-ovl-hd { box-shadow:0 0 0 3px #fff inset; border:2px solid #fff; box-sizing:border-box; background:rgba(255,255,255,.25); }
.tho-ovl-h-inv .tho-ovl-hd { border:2px dashed #e0245e; box-sizing:border-box; background:rgba(224,36,94,.15); }
.tho-ovl-h:focus-visible .tho-ovl-hd, .tho-ovl-h:focus .tho-ovl-hd { outline:3px solid var(--accent); outline-offset:1px; }
.tho-ovl-ab { background:#e0245e; color:#fff; border:2px solid #fff; }
.tho-pe-lk[hidden], .tho-pe-lk [hidden] { display:none !important; }
.tho-lk-h { margin:0 0 8px; font-weight:700; font-size:14px; }
.tho-lk-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:8px; margin:0 0 8px; }
.tho-fit .tho-lk-grid button { width:100%; min-height:44px; padding:4px 8px; font-size:14px; font-weight:700; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:10px; }
.tho-fit .tho-lk-grid button[aria-pressed="true"] { background:var(--accent); color:#fff; border-color:var(--accent); }
.tho-fit .tho-lk-grid button:disabled { opacity:.5; }
.tho-lk-note, .tho-lk-why { margin:0 0 6px; font-size:13px; color:var(--muted, #5b6672); overflow-wrap:anywhere; }
.tho-lk-why { color:#8a5300; }
.tho-lk-why:empty { display:none; }
.tho-lk-two { margin:10px 0 0; padding:8px 0 0; border-top:1px solid var(--line); }
.tho-lk-two h3 { margin:0 0 4px; font-size:14px; letter-spacing:0; text-transform:none; color:var(--ink); }
.tho-lk-two p { margin:0 0 6px; font-size:13px; }
.tho-lk-row { display:flex; flex-wrap:wrap; align-items:flex-end; gap:8px; margin:0 0 8px; }
.tho-fit .tho-lk-row button { width:auto; min-height:40px; padding:0 14px; font-size:14px; font-weight:700; background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:10px; }
.tho-fit .tho-lk-row button.tho-lk-go { background:var(--accent); color:#fff; border-color:var(--accent); }
.tho-lk-ab { font-size:13px; color:var(--muted, #5b6672); align-self:center; }
.tho-lk-msg { min-height:0; }
.tho-lk-msg.tho-err { color:#b3261e; font-weight:700; }
.tho-lk-msg.tho-ok { color:#1b7a3a; font-weight:700; }
@media (max-width: 767px) {
  .tho-fit-head { flex-wrap:wrap; }
  .tho-fit .tho-pe-mode { order:5; flex:1 1 100%; border-color:var(--line); background:var(--bg); }
  .tho-fit .tho-pe-mode button { flex:1 1 0; min-height:44px; color:var(--ink); }
  .tho-fit .tho-pe-mode button[aria-pressed="true"] { background:var(--accent); color:#fff; }
  .tho-fit.tho-ovl .tho-pane-tag { display:none; }
  .tho-fit.tho-ovl .tho-ovl-card { top:auto; bottom:8px; left:8px; right:8px; justify-content:space-between; }
  .tho-fit.tho-ovl .tho-ovl-chip { display:none; }
  .tho-ovl-op input[type="range"] { width:90px; min-height:44px; }
  .tho-fit .tho-ovl-move { min-height:44px; }
  .tho-fit .tho-lk-grid { grid-template-columns:repeat(2, minmax(0,1fr)); }
  .tho-fit .tho-lk-row button { min-height:44px; }
}
@media (pointer: coarse) { .tho-fit .tho-lk-grid button, .tho-fit .tho-pe-mode button { min-height:44px; } }
.tho-fit.tho-ovl .leaflet-top.leaflet-right { right:auto; left:52px; }   /* the Satellite | Street | Another plan switch moves left: the see-through card owns the top right */
@media (pointer: coarse) { .tho-fit.tho-ovl .leaflet-top.leaflet-right { left:62px; } }
@media (max-width: 767px) { .tho-fit.tho-ovl .leaflet-top.leaflet-right { max-width:calc(100% - 66px); } }
@media (max-width: 420px) { .tho-ovl-op > span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); } .tho-ovl-op input[type="range"] { width:clamp(90px, 38vw, 160px); } .tho-fit.tho-ovl .tho-ovl-card { flex-wrap:nowrap; } }
@media (max-width: 767px) { .tho-fit.tho-ovl .leaflet-container .tho-basesw > button { padding:0 7px; font-size:13px; } }
.tho-fit:not(.tho-ovl) :is(.tho-ovl-card, .tho-ovl-chip) { display:none; }   /* Side by side has no ghost, so no see-through card */
/* PLANRENAME: Tools → Rename… */
.tho-bar .tho-rename { margin-top:8px; padding:8px; border:1px solid var(--line); border-radius:8px; display:flex; flex-direction:column; gap:6px; }
.tho-rename .tho-rename-l { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-weight:600; min-width:0; }
.tho-rename .tho-rename-l strong { font-weight:600; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tho-rename .tho-rename-r { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.tho-panel .tho-rename input.tho-rename-i { flex:1 1 140px; min-width:0; width:auto; padding:6px 8px; font-size:14px; border-radius:7px; }
@media (max-width:767px) { .tho-panel .tho-rename input.tho-rename-i, .tho-rename .tho-mini, .tho-rename select { min-height:44px; } }
