/* TaTasque 2 — PLAN VIEWER module v1 (PLANUI PV1). Copyright Rapid Surveys Pty Ltd. Namespace .tpv-. The card is the request form's plan card (accent edge, icon heading, 44px buttons, accent fill = active).
 * Colours: the host page's tokens (--thf-* on the form, --card / --line / --accent … in the app) with fallbacks; set --tpv-* on an ancestor to override. */
.tpv-card, .tpv-fullsheet {
  --tpv-card: var(--thf-card, var(--card, #fff)); --tpv-ink: var(--thf-ink, var(--ink, #1c2430)); --tpv-muted: var(--thf-muted, var(--muted, #5c6878)); --tpv-line: var(--thf-line, var(--line, #d6dbe2));
  --tpv-accent: var(--thf-accent, var(--accent, #2f6df6)); --tpv-accent-ink: var(--thf-accent-ink, #fff); --tpv-err: var(--thf-err, #c62f2f);
}
.tpv-card { margin: 16px 0 0; padding: 14px 14px 14px 16px; border: 1px solid var(--tpv-line); border-left: 5px solid var(--tpv-accent); border-radius: 10px; background: var(--tpv-card); color: var(--tpv-ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tpv-card *, .tpv-fullsheet *, .tpv-fullsheet *::before, .tpv-fullsheet *::after { box-sizing: border-box; }
.tpv-head { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; }
.tpv-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--tpv-accent); color: var(--tpv-accent-ink); font-size: 16px; line-height: 1; }
.tpv-help { display: block; font-size: 14px; color: var(--tpv-muted); margin: -2px 0 6px; white-space: pre-line; }
.tpv-err { color: var(--tpv-err); }
.tpv-status.tpv-err { margin: 10px 0 0; }
.tpv-btn { width: auto; margin: 0; min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--tpv-line); background: var(--tpv-card); color: inherit; font: inherit; cursor: pointer; }
.tpv-btn:disabled { opacity: .5; cursor: default; }
.tpv-btn:focus-visible, .tpv-stage:focus-visible { outline: 2px solid var(--tpv-accent); outline-offset: 2px; }
/* the two slots: empty = invisible */
.tpv-views, .tpv-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.tpv-views:empty, .tpv-tools:empty { display: none; }
.tpv-pick, .tpv-clear { width: 100%; margin: 8px 0 0; }
.tpv-bar { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 0; }
.tpv-pg { min-width: 44px; padding: 8px 12px; }
.tpv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.tpv-chip { padding: 8px 12px; min-height: 44px; }
.tpv-on, .tpv-tab-on { background: var(--tpv-accent); color: var(--tpv-accent-ink); border-color: var(--tpv-accent); }
.tpv-done { font-weight: 600; }
.tpv-stage { position: relative; margin: 10px 0 0; border: 1px solid var(--tpv-line); border-radius: 8px; overflow: hidden; line-height: 0; background: #fff; touch-action: manipulation; }
.tpv-canvas { display: block; width: 100%; height: auto; cursor: crosshair; }
.tpv-zoom { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.tpv-zb { min-width: 44px; min-height: 44px; padding: 8px 12px; }
.tpv-zfull { margin-left: auto; }
.tpv-sheet { position: relative; width: 100%; margin: 0 auto; }
.tpv-stage.tpv-zoomed { overflow: auto; max-height: 70vh; touch-action: none; overscroll-behavior: contain; cursor: grab; }
.tpv-stage.tpv-pan { cursor: grabbing; user-select: none; }
.tpv-stage.tpv-big { display: flex; max-height: none; flex: 1 1 auto; min-height: 0; margin: 0; }
.tpv-stage.tpv-big .tpv-sheet { flex: none; margin: auto; }
.tpv-fullsheet { position: fixed; inset: 0; z-index: 1000; background: var(--tpv-card); color: var(--tpv-ink); display: flex; flex-direction: column;
  padding: calc(8px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom)); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.tpv-fullbody { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 0; }
.tpv-fullhint { margin: 6px 0 0; font-size: .85rem; }
.tpv-fullbody .tpv-bar, .tpv-fullbody .tpv-chips, .tpv-fullbody .tpv-zoom { margin-top: 0; margin-bottom: 8px; }
.tpv-fullbody .tpv-tabs { margin-top: 0; margin-bottom: 8px; }
html.tpv-noscroll, html.tpv-noscroll body { overflow: hidden; }
.tpv-dot { position: absolute; transform: translate(-50%, -50%); min-width: 26px; height: 26px; padding: 0 4px; border-radius: 13px; background: #2563eb; color: #fff; font: 600 13px/26px sans-serif; text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); pointer-events: none; }
.tpv-dot-on { background: #dc2626; }
.tpv-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.tpv-tab { padding: 8px 12px; min-height: 44px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpv-tail { display: flex; flex-wrap: wrap; gap: 8px; }
.tpv-tail .tpv-clear { flex: 1 1 160px; width: auto; }
.tpv-warn { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tpv-warn p { flex: 1 1 100%; margin: 0; }
.tpv-warn .tpv-btn { width: auto; margin: 0; min-height: 44px; flex: 1 1 140px; }
/* a group's own rows (a switch, a button) */
.tpv-rows { padding: 0 0 8px 8px; display: flex; flex-direction: column; gap: 4px; } .tpv-row { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.tpv-rowbtn { width: 100%; text-align: left; }
.tpv-row-range { flex-wrap: wrap; gap: 4px 8px; } .tpv-rlabel { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; } .tpv-range { flex: 1 1 120px; min-width: 0; min-height: 44px; accent-color: var(--accent, #9E8C5B); }
.tpv-rlabel > .tpv-range { flex: 1 1 60px; } .tpv-rval { flex: 0 0 auto; min-width: 40px; text-align: right; font-size: 13px; } .tpv-rsub { flex: 1 1 100%; }
/* the plan-group list, the cycling buttons, the Tools area */
.tpv-list { margin: 10px 0 0; } .tpv-list:empty { display: none; }
.tpv-none { margin: 0; padding: 6px 0; font-size: 14px; color: var(--tpv-muted); }
.tpv-grp { border-top: 1px solid var(--tpv-line); } .tpv-grp:first-child { border-top: 0; }
.tpv-gline, .tpv-pl { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.tpv-gname { flex: 1 1 auto; min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-align: left; cursor: pointer; border-radius: 8px; }
.tpv-gt { display: block; min-width: 0; overflow-wrap: anywhere; } .tpv-gs { display: block; font-size: 12px; font-weight: 400; color: var(--tpv-muted); }
.tpv-gname .tpv-gt { flex: 1 1 auto; }
.tpv-chev { flex: none; font-size: 22px; line-height: 1; color: var(--tpv-muted); transition: transform .15s; } .tpv-gname[aria-expanded="true"] .tpv-chev { transform: rotate(90deg); }
.tpv-grp-off > .tpv-gline .tpv-gt, .tpv-pl-off .tpv-gt { color: var(--tpv-muted); }
.tpv-plans { list-style: none; margin: 0; padding: 0 0 8px 8px; }
.tpv-pt { flex: 1 1 auto; min-width: 0; font-size: 14px; }
.tpv-go { min-height: 44px; padding: 6px 12px; flex: none; }
.tpv-sw { flex: none; position: relative; width: 52px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.tpv-sw::before { content: ""; position: absolute; left: 4px; top: 10px; width: 44px; height: 24px; border-radius: 12px; background: var(--tpv-line); transition: background .15s; }
.tpv-sw-knob { position: absolute; left: 7px; top: 13px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: left .15s; }
.tpv-sw[aria-pressed="true"]::before { background: var(--tpv-accent); } .tpv-sw[aria-pressed="true"] .tpv-sw-knob { left: 27px; }
.tpv-sw-some::before { background: var(--tpv-accent); opacity: .55; } .tpv-sw-some .tpv-sw-knob { left: 17px; }
.tpv-sw:focus-visible, .tpv-gname:focus-visible { outline: 2px solid var(--tpv-accent); outline-offset: 2px; }
.tpv-toolsbar { margin: 10px 0 0; } .tpv-toolsbar[hidden] { display: none; } .tpv-toolsbtn { width: 100%; }
.tpv-tools[hidden] { display: none; }
.tpv-cycle { flex: 1 1 200px; text-align: left; }
@media (min-width: 900px) { .tpv-btn { min-height: 48px; padding: 12px 20px; font-size: 16px; } }
