/* TaTasque - Map layers panel (public/shared/maplayers/v1). Copyright Rapid Surveys Pty Ltd. Own CSS prefix .thml-. App tokens only. */
.thml-ctl button { display:flex; align-items:center; justify-content:center; }
.thml-ctl svg { width:20px; height:20px; }
.thml-panel { position:absolute; left:56px; top:56px; z-index:1100; width:min(340px, calc(100% - 72px)); max-height:calc(100% - 140px); overflow:auto; box-sizing:border-box; padding:10px 12px 12px;
  background:var(--card, #fff); color:var(--ink, #111); border:1px solid var(--line, #d1d5db); border-radius:12px; box-shadow:0 4px 16px rgba(20,28,40,.18); font-size:14px; }
.thml-panel[hidden] { display:none; }
.thml-head { display:flex; align-items:center; gap:8px; margin:0 0 6px; }
.thml-head h3 { margin:0; flex:1 1 auto; font-size:15px; }
.thml-panel .thfp-x { flex:none; width:44px; min-width:44px; height:44px; min-height:44px; padding:0; }
.thml-rows { list-style:none; margin:0; padding:0; }
.thml-row { border-top:1px solid var(--line, #d1d5db); }
.thml-row:first-child { border-top:0; }
.thml-line { display:flex; align-items:stretch; gap:2px; }
.thml-eye, .thml-name, .thml-pick { font:inherit; color:var(--ink, #111); cursor:pointer; }
.thml-eye { flex:none; width:44px; min-height:44px; padding:0; border:0; border-radius:8px; background:none; display:flex; align-items:center; justify-content:center; }
.thml-eye svg { width:22px; height:22px; fill:currentColor; }
.thml-eye[aria-pressed="false"] { color:var(--muted, #6b7280); }
.thml-eye[aria-pressed="mixed"] { opacity:.65; }
.thml-name { flex:1 1 auto; min-width:0; min-height:44px; padding:0 8px; border:0; border-radius:8px; background:none; display:flex; align-items:center; gap:8px; text-align:left; font-weight:600; }
.thml-name .thml-t { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.thml-name .thml-n { flex:none; color:var(--muted, #6b7280); font-weight:400; font-variant-numeric:tabular-nums; }
.thml-name .thml-chev { flex:none; width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; transition:transform .15s; }
.thml-name[aria-expanded="true"] .thml-chev { transform:rotate(90deg); }
.thml-name.thml-flat { cursor:default; }
.thml-row.thml-off .thml-t { color:var(--muted, #6b7280); }
.thml-sub { padding:0 0 8px 46px; }
.thml-sub[hidden] { display:none; }
.thml-items { list-style:none; margin:0; padding:0; }
.thml-item { display:flex; align-items:stretch; gap:2px; border-radius:8px; }
.thml-item.thml-sel { background:var(--hover, #f3f4f6); }
.thml-item .thml-eye { width:44px; }
.thml-pick { flex:1 1 auto; min-width:0; min-height:44px; padding:2px 6px; border:0; border-radius:8px; background:none; text-align:left; display:flex; flex-direction:column; justify-content:center; font-weight:400; }
.thml-pick[disabled] { cursor:default; color:var(--ink, #111); }
.thml-it { font-size:14px; overflow-wrap:anywhere; }
.thml-is { font-size:12px; color:var(--muted, #6b7280); font-variant-numeric:tabular-nums; }
.thml-item.thml-off .thml-it { color:var(--muted, #6b7280); text-decoration:line-through; }
.thml-none { margin:0; padding:6px 0; color:var(--muted, #6b7280); font-size:13px; }
.thml-panel button:focus-visible { outline:2px solid var(--accent, #2563eb); outline-offset:2px; }
/* the Plans view choice (shared/plan-frame.css is dark-panel styled): light, in this panel */
.thml-sub .thpf-seg button, .thml-sub .thpf-bsw { background:var(--card, #fff); color:var(--ink, #111); border-color:var(--line, #d1d5db); }
.thml-sub .thpf-seg button[aria-checked="true"], .thml-sub .thpf-bsw[aria-checked="false"] { background:var(--accent, #2563eb); border-color:var(--accent, #2563eb); color:var(--accent-ink, #fff); }
.thml-sub .thpf-seg button:focus-visible, .thml-sub .thpf-bsw:focus-visible { outline:2px solid var(--accent, #2563eb); outline-offset:2px; }
/* a module's own button now lives in this panel (THMapLayers.away): the whole control goes, or just its button (its panel stays, opened by a click on the button from the row) */
.leaflet-container [data-thml-gone] { display:none !important; }
.leaflet-container [data-thml-away] { width:0 !important; min-width:0 !important; height:0 !important; min-height:0 !important; padding:0 !important; border:0 !important; background:none !important; box-shadow:none !important; overflow:visible; }
.leaflet-container [data-thml-away] > [data-thml-away-btn] { display:none !important; }
/* a bare section (Base map, Tasks): a heading and its controls, no eye */
.thml-bare { padding:6px 0 8px; }
.thml-bt { margin:0 0 4px; font-size:14px; font-weight:600; }
.thml-bare > .thml-sub { padding:0; }
.thml-seg { display:flex; gap:6px; }
.thml-seg button { flex:1 1 0; min-height:44px; padding:0 10px; border:1px solid var(--line, #d1d5db); border-radius:8px; background:var(--card, #fff); color:var(--ink, #111); font:inherit; font-weight:600; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px; }
.thml-seg button svg { width:20px; height:20px; flex:none; }
.thml-seg button[aria-pressed="true"] { background:var(--accent, #2563eb); border-color:var(--accent, #2563eb); color:var(--accent-ink, #fff); }
/* a row's own small controls (the Tasks row: colour by, pin size, colour key) */
.thml-ctl2 { display:flex; flex-direction:column; gap:6px; padding:4px 0 2px; }
.thml-fld { display:flex; align-items:center; gap:8px; min-height:44px; }
.thml-fld > label, .thml-fld > .thml-fl { flex:1 1 auto; min-width:0; margin:0; font-weight:600; font-size:14px; color:var(--ink, #111); }
.thml-fld select { flex:0 1 150px; min-width:0; min-height:44px; }
.thml-fld output { min-width:3.2em; text-align:center; font-variant-numeric:tabular-nums; }
.thml-panel .thml-step { flex:none; width:44px; height:44px; min-height:44px; padding:0; border:1px solid var(--line, #d1d5db); border-radius:8px; background:var(--card, #fff); color:var(--ink, #111); font:700 20px/1 system-ui, sans-serif; cursor:pointer; }
.thml-panel .thml-step:disabled { opacity:.4; cursor:default; }
.thml-btn2 { min-height:44px; padding:0 12px; border:1px solid var(--line, #d1d5db); border-radius:8px; background:var(--card, #fff); color:var(--ink, #111); font:inherit; font-weight:600; cursor:pointer; text-align:left; }
.thml-btn2[aria-pressed="true"] { background:var(--accent, #2563eb); border-color:var(--accent, #2563eb); color:var(--accent-ink, #fff); }
.thml-note2 { margin:0; color:var(--muted, #6b7280); font-size:13px; }
/* an item's small action buttons (Open, Task ...) on their own line under its name */
.thml-item { flex-wrap:wrap; }
.thml-item > .thml-pick { flex:1 1 0; }   /* the name takes the rest of the line beside the eye; only the action buttons wrap below */
.thml-acts { flex:1 0 100%; display:flex; flex-wrap:wrap; gap:6px; padding:0 0 6px 46px; }
.thml-panel .thml-act { flex:0 0 auto; width:auto; min-height:44px; padding:0 12px; border:1px solid var(--line, #d1d5db); border-radius:8px; background:var(--card, #fff); color:var(--ink, #111); font:inherit; cursor:pointer; }
.thml-panel select:focus-visible, .thml-panel .thml-seg button:focus-visible, .thml-panel .thml-btn2:focus-visible, .thml-panel .thml-act:focus-visible, .thml-panel .thml-step:focus-visible { outline:2px solid var(--accent, #2563eb); outline-offset:2px; }
@media (max-width: 767px) {
  .thml-panel { left:0; right:0; top:auto; bottom:0; width:auto; max-height:min(70%, 460px); border-radius:14px 14px 0 0; border-bottom:0; padding-bottom:max(84px, env(safe-area-inset-bottom));   /* clear of the round + (fixed, bottom right) */ z-index:1300; box-shadow:0 -4px 16px rgba(20,28,40,.2); }
}
.thml-offscr { margin-top:6px; min-height:36px; padding:0 10px; border:1px solid var(--line, #d1d5db); border-radius:6px; background:var(--card, #fff); color:var(--ink, #111); font:inherit; font-size:13px; cursor:pointer; }
.thml-offscr-note:empty { display:none; }
