/* Vilac v2: tap info card, clean tool-panel header, sticky step buttons, and layout fixes found in screenshots. */
#parcelActionSheet { display: none !important; }

.v2-card { pointer-events: auto; position: absolute; z-index: 1150; left: 16px; bottom: 92px; width: min(420px, calc(100vw - 32px));
  padding: 16px 16px 12px; border: 1px solid var(--v2-line); border-radius: 18px; background: var(--v2-paper); color: var(--v2-ink);
  box-shadow: var(--v2-shadow); font: 16px/1.45 Inter, system-ui, sans-serif; }
.v2-card[hidden] { display: none; }
.v2-card-grip { display: none; }
.v2-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; touch-action: none; }
.v2-card-head h2 { margin: 0; font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.v2-card-sub { margin: 2px 0 0; color: var(--v2-muted); font-size: 14px; }
.v2-card-close { flex: 0 0 auto; width: 44px; height: 44px; border: 1px solid var(--v2-line); border-radius: 12px; background: #fff;
  color: var(--v2-ink); font-size: 22px; line-height: 1; cursor: pointer; }
/* Facts as a compact two-column list: label left, value right (no boxes), so the card stays small. */
.v2-card-facts { display: grid; gap: 6px; margin: 10px 0 6px; }
.v2-card-facts div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: baseline; }
.v2-card-facts dt { color: var(--v2-muted); font-size: 14px; }
.v2-card-facts dd { margin: 0; font-size: 16px; line-height: 1.35; }
.v2-card-source { margin: 0 0 10px; color: var(--v2-muted); font-size: 14px; }
.v2-card-status { margin: 6px 0 0; color: var(--v2-green); font-size: 14px; }
.v2-card-status:empty { display: none; }
.v2-warn { color: #9a3412; font-weight: 700; }
.v2-card-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.v2-btn { min-height: 46px; padding: 0 14px; border: 1px solid var(--v2-line); border-radius: 12px; background: #fff; color: var(--v2-ink);
  font: 650 16px Inter, system-ui, sans-serif; cursor: pointer; }
.v2-btn-primary { border-color: var(--v2-green); background: var(--v2-green); color: #fff; }
.v2-card-more { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.v2-card-more[hidden] { display: none; }
.v2-link { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--v2-line); border-radius: 12px;
  background: #fff; color: var(--v2-ink); font: 500 15px Inter, system-ui, sans-serif; text-decoration: none; text-align: left; cursor: pointer; }
.v2-danger { color: #b42318; }
.v2-card-contact { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 2px 0;
  color: var(--v2-muted); font-size: 14px; }
.v2-contact { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--v2-line); border-radius: 12px;
  color: var(--v2-green) !important; font-weight: 700; text-decoration: none; }

/* Tool panel: own header; the old brand block and tab row stay hidden. */
.v2-panel-head { display: grid; gap: 8px; padding: 8px 16px 10px; border-bottom: 1px solid var(--v2-line); background: #fff; }
.v2-panel-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.v2-panel-head h2 { margin: 0; color: var(--v2-ink); font: 750 18px Inter, system-ui, sans-serif; }
.v2-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--v2-line); border-radius: 14px; background: #f3f5f7; }
.v2-seg[hidden] { display: none; }
.v2-seg button { min-height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--v2-ink);
  font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; }
.v2-seg button[aria-selected="true"] { background: var(--v2-green); color: #fff; }
#sidebarPanel > .v2-legacy-hidden { display: none !important; }
#sheetHandle span { display: none; }
/* Estimate steps: a thin strip pinned at the top (step, progress, live range) and only the buttons pinned at the bottom. */
#estimateIntro { display: none !important; }
.v2-step-head { position: sticky; top: -14px; z-index: 6; margin: -14px -14px 10px; padding: 8px 14px 8px; border-bottom: 1px solid var(--v2-line);
  background: rgba(255, 255, 255, .98); }
.v2-step-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 14px; }
.v2-step-row b { color: var(--v2-ink); font-size: 15px; }
.v2-step-row span { color: var(--v2-muted); white-space: nowrap; }
.v2-step-track { height: 4px; margin: 6px 0 4px; border-radius: 99px; background: #e5e9ec; overflow: hidden; }
.v2-step-track > div { height: 100%; background: var(--v2-green); transition: width .15s; }
.v2-step-head .v2-live { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.v2-step-dirty { margin: 4px 0 0; color: #8a5a00; font-size: 14px; font-weight: 600; }
.v2-step-dirty[hidden] { display: none; }
#estimateStepper { position: sticky; bottom: -14px; z-index: 6; margin: 12px -14px -14px; padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--v2-line); background: rgba(255, 255, 255, .98); box-shadow: 0 -6px 18px #1730420f; }
.v2-step-buttons { display: grid; grid-template-columns: 1fr auto 1.4fr; gap: 8px; }
.v2-step-buttons .v2-btn { min-height: 44px; padding: 0 10px; font-size: 15px; }
.v2-step-buttons .v2-btn:disabled { opacity: .45; }
.v2-btn-quiet { border-color: transparent; color: var(--v2-muted); }
#estimateStepError:empty { display: none; }

/* Bottom bar: address may wrap to two lines instead of being cut. */
.v2-address-value { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  max-width: none !important; line-height: 1.25; }
.v2-brand-copy { margin-left: 6px; }

/* Layers popover: basemap switch, readable sizes, a close button. */
.v2-basemap { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--v2-line); border-radius: 14px; background: #f3f5f7; }
.v2-basemap button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--v2-ink); font: 600 16px Inter, system-ui, sans-serif; cursor: pointer; }
.v2-basemap button[aria-pressed="true"] { background: var(--v2-green); color: #fff; }
#legacyOpacityControl { display: none !important; }
#layerMenuContent { display: flex; flex-direction: column; gap: 10px; }
#layerMenuContent button, #layerMenuContent select { min-height: 44px; font-size: 16px; }
#layerMenuContent .text-xs, #layerMenuContent [class*="text-[1"] { font-size: 14px !important; }
.v2-popover-close { position: absolute; top: 8px; right: 8px; }
.v2-popover { padding-top: 14px; }
.v2-popover h2 { min-height: 32px; padding-right: 52px; }
/* Toasts: light surface, readable size, no emoji icon. */
#toastNotification { font-size: 15px !important; background: #fff !important; color: var(--v2-ink) !important; border: 1px solid var(--v2-line) !important; box-shadow: var(--v2-shadow) !important; }
#toastIcon { display: none !important; }
/* Draw tool on a light surface: dark text. */
#drawParcelControls strong, #drawParcelControls p, #drawParcelControls div { color: var(--v2-ink) !important; }
#drawParcelControls p, #drawParcelControls #drawParcelEdges { font-size: 14px !important; color: var(--v2-muted) !important; }
#drawParcelControls button { min-height: 44px; font-size: 16px !important; }
/* Auto-filled fields are marked next to the field itself. */
#panelEstimate label:has([data-auto="1"])::after { content: 'Máy tự điền – bạn sửa được'; display: block; margin-top: 2px; color: var(--v2-green); font-size: 14px; font-weight: 600; }
#panelEstimate [data-auto="1"] { border-color: #d2bd8f !important; background: #faf6ec !important; }
.v2-area-row { display: grid; grid-template-columns: 1fr 96px; gap: 8px; }
#estimateResult.v2-pending { display: none; }
.v2-step-status { margin: 0; padding: 8px 10px; border-radius: 10px; background: #f4ecdb; color: #102c3a; font-size: 15px; font-weight: 700; }
.v2-step-status[hidden], #estimateLive[hidden], #estimateDirtyNote[hidden], #estimateSkip[hidden] { display: none !important; }

/* Layers popover: basemap first, overlays as clear on/off buttons, help lives in the menu. */
#layerMenuContent .v2-basemap { order: -1; }
#layerMenuContent #btnHelp { display: none !important; }
#layerMenuContent .map-tool-button { min-height: 46px; border: 1px solid var(--v2-line) !important; border-radius: 12px !important; background: #fff !important;
  color: var(--v2-ink) !important; font: 600 16px Inter, system-ui, sans-serif !important; box-shadow: none !important; text-align: left; padding: 0 14px !important; }
#layerMenuContent .map-tool-button[aria-pressed="true"] { border-color: var(--v2-green) !important; background: #f4ecdb !important; color: #102c3a !important; }
#layerMenuContent .price-legend { font-size: 14px !important; }

.v2-result-actions .v2-span-2 { grid-column: 1 / -1; }
.v2-result-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.v2-search-empty { margin: 0; padding: 10px 12px; color: var(--v2-muted); font-size: 15px; line-height: 1.45; }
.v2-search-note { color: var(--v2-muted); font-size: 14px; }
.v2-search-result span { min-width: 0; }
.v2-live { margin: 0; color: var(--v2-ink); font-size: 15px; }
.v2-live b { color: #102c3a; }

@media (min-width: 768px) {
  /* Desktop: the tool panel floats under the header and pills instead of covering them. */
  #sidebarPanel.v2-panel-open { top: 150px !important; left: 16px !important; bottom: 16px !important; height: auto !important;
    width: 440px !important; border: 1px solid var(--v2-line) !important; border-radius: 18px !important; overflow: hidden; }
  body:has(#sidebarPanel.v2-panel-open) .v2-bottom { left: 472px; }
}

@media (max-width: 767px) {
  /* Phone: the card is a bottom sheet (≤ 40% of the screen); swipe up or "Thêm" shows the rest. */
  .v2-card { left: 0; right: 0; bottom: 0; width: auto; max-height: 40vh; max-height: 40dvh; overflow: auto; border-radius: 20px 20px 0 0;
    padding: 4px 14px calc(12px + env(safe-area-inset-bottom)); }
  .v2-card.v2-card-expanded { max-height: 82dvh; }
  .v2-card-grip { display: block; width: 100%; height: 18px; margin: 0 0 2px; padding: 0; border: 0; background: transparent; cursor: grab; touch-action: none; }
  .v2-card-grip::before { content: ''; display: block; width: 44px; height: 5px; margin: 6px auto 0; border-radius: 999px; background: #9eafb5; }
  .v2-card-head h2 { font-size: 17px; }
  .v2-card-facts div { grid-template-columns: 86px 1fr; }
  .v2-card-more { grid-template-columns: 1fr; }
  body:has(#v2InfoCard:not([hidden])) .v2-bottom { display: none; }
  body:has(#v2InfoCard:not([hidden])) .v2-rail { bottom: calc(var(--v2-card-h, 300px) + 10px); }
  body:has(#v2InfoCard.v2-card-expanded:not([hidden])) .v2-rail { display: none; }
  body:has(#v2InfoCard:not([hidden])) .leaflet-control-attribution { display: none; }
  /* Header: logo mark only, so the search box gets the room. The tool-panel button is reached from the pills. */
  .v2-brand-copy { display: none !important; }
  #v2OpenPanel { display: none; }
  /* Map attribution: one short line pinned just above the bottom bar on the right, never in the middle of the screen. */
  .leaflet-control-attribution { position: fixed !important; right: 8px; bottom: 76px; margin: 0 !important; max-width: 70vw;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; border-radius: 6px;
    background: rgba(255, 255, 255, .85) !important; }
}

.v2-lead-toggle { width: 100%; margin: 4px 0; border-color: var(--v2-green); color: var(--v2-green); }
.v2-call-btn { width: 100%; margin: 4px 0; font-size: 17px; letter-spacing: .02em; }
.v2-call-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.v2-call-choice[hidden] { display: none; }
#estimateLeadWrap { background: #fff !important; border-color: var(--v2-line) !important; color: var(--v2-ink) !important; }


/* Result card: appraisal-report layout, large figures, no technical boxes. */
.v2-result { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--v2-line); border-radius: 16px; background: #fff; color: var(--v2-ink);
  font: 16px/1.5 Inter, system-ui, sans-serif; }
.v2-result-kicker { margin: 0; color: var(--v2-green); font-size: 14px; font-weight: 700; }
.v2-result-subject { margin: 0; font-size: 18px; font-weight: 750; line-height: 1.35; }
.v2-result-figures { display: grid; gap: 8px; }
.v2-result-figure { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: #f6f1e6; }
.v2-result-figure span { color: var(--v2-muted); font-size: 14px; }
.v2-result-figure b { font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: #102c3a; }
.v2-result-figure small { color: var(--v2-muted); font-size: 14px; }
.v2-result-line { margin: 0; font-size: 16px; }
.v2-result-h { margin: 4px 0 0; font-size: 16px; font-weight: 750; }
.v2-result-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 16px; }
.v2-result-notes { margin: 0; padding: 10px 12px 10px 28px; border-radius: 12px; background: #fff8eb; color: #6b4b10; font-size: 15px; display: grid; gap: 4px; }
.v2-result-based { margin: 0; color: var(--v2-muted); font-size: 14px; }
.v2-result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.v2-result-actions .v2-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.v2-result-actions .v2-btn-primary { grid-column: 1 / -1; }
.v2-result-more summary { cursor: pointer; font-weight: 650; color: var(--v2-green); min-height: 44px; display: flex; align-items: center; }
.v2-result-more p { margin: 4px 0 8px; }
.v2-result-foot { margin: 0; color: var(--v2-muted); font-size: 14px; }
.v2-result-foot a { color: var(--v2-green); font-weight: 650; }
.v2-alert { padding: 12px 14px; border: 1px solid #f3c6b5; border-radius: 14px; background: #fff3ee; color: #7a2e0e; }
.v2-alert b { display: block; margin-bottom: 4px; font-size: 16px; }
.v2-alert p { margin: 0; font-size: 15px; }

/* Consultation block under the result: same visual language as the rest of v2. */
#estimateLeadWrap { padding: 14px !important; border-radius: 16px !important; }
#estimateLeadWrap h3, #estimateLeadWrap h4, #estimateLeadWrap b, #estimateLeadWrap strong { color: var(--v2-ink) !important; font-size: 16px !important; }
#estimateLeadWrap a { display: flex; align-items: center; justify-content: center; min-height: 46px; border: 1px solid var(--v2-line) !important;
  border-radius: 12px !important; background: #fff !important; color: var(--v2-green) !important; font: 650 16px Inter, system-ui, sans-serif !important; opacity: 1 !important; }
#estimateLeadWrap input, #estimateLeadWrap select, #estimateLeadWrap textarea { min-height: 46px; font-size: 16px !important; background: #fff !important;
  color: var(--v2-ink) !important; border: 1px solid var(--v2-line) !important; border-radius: 12px !important; }
#estimateLeadWrap label, #estimateLeadWrap p { color: var(--v2-ink) !important; font-size: 15px !important; }
#estimateLeadForm button[type="submit"], #estimateLeadForm > button:last-of-type { min-height: 46px; border-radius: 12px !important; background: var(--v2-green) !important;
  color: #fff !important; font: 700 16px Inter, system-ui, sans-serif !important; }

/* Owner's choice (27/10): all tool UI drawn about 16% smaller than its design size; the map itself keeps its scale. */
:root { --ui-zoom: .84; }
.v2-header, .v2-pills, .v2-rail, .v2-bottom, .v2-popover, .v2-card, #sidebarPanel, #drawParcelControls, #toastNotification,
.community-dialog, .help-sheet, .leaflet-control-zoom, .leaflet-control-attribution, .qhsdd-notices { zoom: var(--ui-zoom); }
@media (max-width: 767px) {
  :root { --ui-zoom: .8; } /* phones: a little smaller still (owner, 27/10) */
  #sidebarPanel { width: calc(100vw / var(--ui-zoom)) !important; }
}

/* Step 1: the detected commune is confirmed with one tap; the picker only opens on "Chọn lại". */
.v2-unit-confirm { padding: 10px 12px; border: 1px solid #e2d5b8; border-radius: 12px; background: #faf6ec; color: var(--v2-ink); }
.v2-unit-confirm p { margin: 0 0 10px; font-size: 16px; color: var(--v2-ink) !important; }
.v2-unit-confirm b { color: #102c3a !important; }
.v2-unit-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.v2-unit-confirm[hidden], #estimateUnitPicker[hidden], #estimateLocationHint[hidden] { display: none !important; }

.v2-step-note { margin: 0; color: var(--v2-muted) !important; font-size: 14px; line-height: 1.4; }
.v2-field-help { display: block; margin-top: 3px; color: var(--v2-muted); font-size: 13px; line-height: 1.35; }

/* Road-name suggestions shown under the field while typing. */
.v2-road-suggest { display: grid; margin-top: 4px; max-height: 230px; overflow: auto; border: 1px solid var(--v2-line); border-radius: 10px; background: #fff; box-shadow: 0 6px 18px #17304214; }
.v2-road-suggest[hidden] { display: none !important; }
.v2-road-option { min-height: 40px; padding: 8px 12px; border: 0 !important; border-bottom: 1px solid #eef1f3 !important; border-radius: 0 !important; background: #fff !important; color: var(--v2-ink) !important; font-size: 15px; text-align: left; cursor: pointer; }
.v2-road-option:hover, .v2-road-option:focus { background: #f6f0e3 !important; }

/* Location facts grouped like an appraisal report. */
.v2-site-group { margin: 0 0 10px; }
.v2-site-group h5 { margin: 0 0 4px; color: var(--v2-ink) !important; font-size: 15px; font-weight: 750; }
.v2-site-group ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.v2-site-group li { color: var(--v2-ink); font-size: 15px; line-height: 1.45; }
.v2-site-filled { margin: 6px 0 0; color: var(--v2-green) !important; font-size: 14px; }

/* Step 3 shows only the result; the breakdown is in the PDF. */
.v2-result-detail[hidden] { display: none !important; }
.v2-result-cta { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fff8e6; color: #6b4b10; font-size: 16px; font-weight: 800; }
.v2-need-parcel { padding: 10px 12px; border: 1px solid #f3d7a6; border-radius: 12px; background: #fff8eb; }
.v2-need-parcel p { margin: 0 0 8px; color: #6b4b10 !important; font-size: 15px; }
.v2-need-parcel[hidden] { display: none !important; }

/* ---- Owner's layout, Lệnh AI 2 (27/10) ---------------------------------------------------------------------------- */
/* Top: five buttons on a see-through bar (the old header, search box and pills are gone). */
.v2-header, .v2-pills { display: none !important; }
.v2-topbar { position: absolute; z-index: 1100; top: 12px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; pointer-events: none; zoom: var(--ui-zoom); }
.v2-top-btn { pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px;
  border: 1px solid var(--v2-line); border-radius: 999px; background: #fff; color: var(--v2-ink); box-shadow: var(--v2-shadow);
  font: 750 17px Inter, system-ui, sans-serif; text-decoration: none; text-align: center; white-space: nowrap; cursor: pointer; }
.v2-top-btn:hover { background: #f6f0e3; }
.v2-top-btn[aria-expanded="true"] { border-color: var(--v2-green); background: var(--v2-green); color: #fff; }
.v2-top-menu { min-width: 120px; }
.v2-coord-popover { left: 16px; right: auto; top: 82px; width: min(460px, calc(100vw - 32px)); overflow: visible; }
.v2-coord-popover .v2-search-wrap { max-width: none; margin: 0; }
.v2-coord-hint { margin: 8px 2px 0; color: var(--v2-muted); font-size: 14px; line-height: 1.45; }
#v2MenuPopover { top: 82px; }
#toastNotification { top: 84px !important; }

/* Right rail: map controls plus a slider for how strongly the planning or mineral map covers the base map. */
.v2-opacity { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; color: var(--v2-muted); font: 600 12px Inter, system-ui, sans-serif; }
.v2-opacity input { writing-mode: vertical-lr; direction: rtl; width: 30px; height: 130px; margin: 0; accent-color: var(--v2-green); cursor: pointer; }
.v2-opacity input:disabled { opacity: .35; cursor: not-allowed; }
.v2-opacity output { color: var(--v2-ink); font-weight: 700; }

/* Bottom: a small centred box with the pin position and the layer button. */
.v2-bottom { left: 0 !important; right: 0 !important; margin-inline: auto; width: min(460px, calc(100vw - 32px)); min-height: 0;
  flex-direction: column; justify-content: center; gap: 6px; padding: 8px 14px 10px; text-align: center; }
.v2-bottom .v2-address { max-width: 100%; font-size: 15px; line-height: 1.35; }
.v2-bottom .v2-address-label { color: var(--v2-ink); font-size: 15px; font-weight: 750; }
.v2-bottom .v2-address-value { display: inline !important; font-size: 15px; font-weight: 500; }
.v2-layer-btn { min-height: 44px; padding: 0 36px; border: 1px solid var(--v2-green); border-radius: 999px; background: #fff; color: var(--v2-green);
  font: 750 16px Inter, system-ui, sans-serif; cursor: pointer; }
.v2-layer-btn[aria-expanded="true"] { background: var(--v2-green); color: #fff; }
body:has(#drawParcelControls:not([hidden])) .v2-bottom { display: none; }

/* Layer chooser: opens above the bottom box. */
.v2-layer-popover { top: auto; bottom: 110px; left: 0; right: 0; margin-inline: auto; width: min(420px, calc(100vw - 24px)); }
.v2-layer-group { margin: 6px 4px 6px; color: var(--v2-muted); font-size: 14px; font-weight: 650; }
.v2-layer-group small { font-weight: 400; }
.v2-layer-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.v2-layer-option { min-height: 52px; padding: 6px 10px; border: 1px solid var(--v2-line); border-radius: 12px; background: #fff; color: var(--v2-ink);
  font: 650 15px/1.25 Inter, system-ui, sans-serif; cursor: pointer; }
.v2-layer-option[aria-pressed="true"] { border-color: var(--v2-green); background: var(--v2-green); color: #fff; }
.v2-layer-status { margin: 8px 2px 0; color: #8a4b00; font-size: 14px; }
.v2-layer-status:empty { display: none; }
.v2-layer-popover #layerMenuContent { margin-top: 10px; }
.v2-layer-popover #layerMenuContent > * { display: none !important; }
.v2-layer-popover[data-overlay="planning"] #layerMenuContent > .qhsdd-control { display: block !important; }
.v2-layer-popover .qhsdd-control > .qhsdd-heading, .v2-layer-popover .qhsdd-control label:has(.qhsdd-opacity) { display: none !important; }

/* Drawing: numbered corners that can be dragged, edge lengths, and the blinking length box. */
.vilac-vertex span { display: grid; place-items: center; width: 24px; height: 24px; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%;
  background: #f97316; color: #fff; font: 800 11px/1 Inter, system-ui, sans-serif; box-shadow: 0 1px 6px #0007; cursor: move; }
.vilac-edge-label { pointer-events: none; }
.vilac-edge-label span { position: absolute; transform: translate(-50%, -50%); padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.92);
  color: #7c2d12; font: 700 12px/1.4 Inter, system-ui, sans-serif; white-space: nowrap; box-shadow: 0 1px 4px #0004; }
.vilac-length-box { position: absolute; z-index: 650; display: flex; align-items: center; gap: 5px; padding: 4px 8px; border: 2px solid #f97316;
  border-radius: 10px; background: #fff; color: #7c2d12; font: 700 13px Inter, system-ui, sans-serif; box-shadow: 0 4px 14px #0004;
  animation: vilac-blink 1.1s ease-in-out infinite; }
.vilac-length-box[hidden] { display: none; }
.vilac-length-box input { width: 74px; height: 32px; padding: 0 6px; border: 1px solid #fdba74; border-radius: 6px; background: #fff; color: #1f2937;
  font: 700 16px Inter, system-ui, sans-serif; text-align: right; user-select: text; }
.vilac-length-box input:focus { outline: 2px solid #f97316; outline-offset: 0; }
.vilac-length-box small { color: #9a3412; font-weight: 500; }
@media (hover: none) { .vilac-length-box small { display: none; } }
@keyframes vilac-blink { 50% { border-color: #fed7aa; box-shadow: 0 0 0 4px #f9731633; } }
@media (prefers-reduced-motion: reduce) { .vilac-length-box { animation: none; } }
.draw-tip { margin: 4px 0 0; color: var(--v2-muted) !important; font-size: 14px; }

@media (min-width: 768px) {
  #sidebarPanel.v2-panel-open { top: 84px !important; }
  #drawParcelControls { bottom: 16px !important; }
}
@media (max-width: 767px) {
  .v2-topbar { top: 8px; left: 8px; right: 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 6px; }
  .v2-top-btn { min-height: 52px; padding: 4px 8px; border-radius: 14px; font-size: 14px; line-height: 1.15; white-space: normal; }
  .v2-top-menu { min-width: 64px; }
  .v2-coord-popover, #v2MenuPopover { top: 74px; left: 8px; right: 8px; width: auto; }
  #toastNotification { top: 70px !important; }
  .v2-bottom { width: min(420px, calc(100vw - 16px)); bottom: 8px; }
  .v2-layer-popover { bottom: 104px; }
  .v2-opacity input { height: 100px; }
}
.v2-card-gmaps { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
@media (max-width: 767px) { .v2-rail { bottom: 128px; } }

/* Draw tool aids and "Lớp vẽ của tôi". */
.draw-cad-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.draw-cad-tools button { min-height: 40px !important; padding: 0 12px; border: 1px solid var(--v2-line) !important; border-radius: 10px !important;
  background: #fff !important; color: var(--v2-ink) !important; font: 600 14px Inter, system-ui, sans-serif !important; cursor: pointer; }
.draw-cad-tools button[aria-pressed="true"] { border-color: var(--v2-green) !important; background: #f4ecdb !important; color: #102c3a !important; }
.vilac-lot-label span { position: absolute; transform: translate(-50%, -50%); padding: 1px 6px; border-radius: 6px; background: rgba(23,48,66,.82);
  color: #fff; font: 700 12px/1.3 Inter, system-ui, sans-serif; text-align: center; white-space: nowrap; pointer-events: none; }
.vilac-saved-tip { font: 600 13px Inter, system-ui, sans-serif; }
.v2-drawings-popover { left: 16px; right: auto; top: 82px; width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 120px); }
.v2-drawings-note, .v2-drawings-empty { margin: 0 2px 10px; color: var(--v2-muted); font-size: 14px; line-height: 1.45; }
.v2-drawing { display: grid; gap: 6px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--v2-line); border-radius: 14px; background: #f9fafb; }
.v2-drawing-name { min-height: 40px; padding: 0 10px; border: 1px solid var(--v2-line); border-radius: 10px; background: #fff; color: var(--v2-ink); font: 700 16px Inter, system-ui, sans-serif; }
.v2-drawing-meta { margin: 0; color: var(--v2-muted); font-size: 14px; }
.v2-drawing-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.v2-drawing-actions .v2-link { justify-content: center; min-height: 40px; padding: 0 6px; font-size: 14px; }
.v2-drawing-actions .v2-link[aria-expanded="true"] { border-color: var(--v2-green); background: #f4ecdb; }
.v2-split { display: grid; gap: 8px; padding-top: 6px; border-top: 1px dashed var(--v2-line); }
.v2-split label { display: grid; gap: 3px; color: var(--v2-muted); font-size: 13px; }
.v2-split select, .v2-split input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; padding: 0 8px; border: 1px solid var(--v2-line); border-radius: 10px; background: #fff; color: var(--v2-ink); font-size: 15px; }
.v2-split-row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.v2-split-actions { display: flex; gap: 8px; }
.v2-split-actions .v2-btn { min-height: 42px; flex: 1; }
.v2-lots { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.v2-lots li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.v2-lots .v2-link { min-height: 36px; font-size: 13px; white-space: nowrap; }
.v2-drawings-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 767px) { .v2-drawings-popover { top: 74px; left: 8px; right: 8px; width: auto; max-height: 70dvh; } }
/* Owner (27/10, round 2): buttons grouped next to the logo instead of spread across the screen. */
.v2-topbar { justify-content: flex-start; gap: 10px; }
.v2-logo { pointer-events: auto; flex: 0 0 auto; display: flex; align-items: center; padding: 0 6px; border: 1px solid var(--v2-line); border-radius: 18px;
  background: #fff; box-shadow: var(--v2-shadow); }
.v2-logo img { display: block; height: auto; object-fit: contain; }
.v2-logo-full { width: 216px; } /* about 180 px on screen after the UI scale, the logo guide's minimum */
.v2-logo .v2-logo-icon { display: none; width: 40px; }
.v2-top-btn { min-height: 56px; padding: 0 20px; }
.v2-menu-brand { margin: 0 0 6px !important; padding-right: 52px; }
.v2-menu-brand img { display: block; width: 200px; height: auto; }

/* Recall button for a closed pin card or tool panel. */
.v2-recall { pointer-events: auto; position: absolute; z-index: 1140; left: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 6px;
  padding: 18px 10px; border: 0; border-radius: 0 14px 14px 0; background: var(--v2-green); color: #fff; box-shadow: var(--v2-shadow);
  font: 700 15px Inter, system-ui, sans-serif; writing-mode: vertical-rl; cursor: pointer; zoom: var(--ui-zoom); }
.v2-recall[hidden] { display: none; }
.v2-recall svg { width: 18px; height: 18px; fill: none; stroke: var(--v2-gold); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.v2-recall:hover { background: #1d4256; }
@media (max-width: 767px) {
  .v2-topbar { grid-template-columns: 44px repeat(4, minmax(0, 1fr)) auto; gap: 5px; }
  .v2-logo { padding: 0; justify-content: center; border-radius: 14px; }
  .v2-logo .v2-logo-full { display: none; }
  .v2-logo .v2-logo-icon { display: block; width: 36px; }
  .v2-top-btn { min-height: 54px; padding: 4px 5px; font-size: 13.5px; }
  .v2-top-menu { min-width: 56px; }
  .v2-recall { top: auto; bottom: 120px; left: 0; right: 0; margin-inline: auto; width: max-content; transform: none; writing-mode: horizontal-tb;
    padding: 0 18px; min-height: 46px; border-radius: 999px; bottom: 132px; }
  .v2-recall svg { transform: rotate(-90deg); }
}
/* The panel is shown by v2-panel-open alone; the old slide-out class (still set by older code) must not push it off-screen. */
@media (min-width: 768px) { #sidebarPanel.v2-panel-open { transform: none !important; } }

/* Language switch: top bar on desktop, map rail on phones. */
.v2-lang-top { min-width: 64px; font-weight: 800; letter-spacing: .04em; }
.v2-lang-rail { font: 800 14px Inter, system-ui, sans-serif; letter-spacing: .04em; color: var(--v2-ink); }
@media (min-width: 768px) { .v2-lang-rail { display: none; } }
@media (max-width: 767px) { .v2-lang-top { display: none; } }
