/* Petroleum and mineral evidence within the private land workspace. */

#petroleum-controls, #petroleum-status, #map-evidence { min-width: 0; max-width: 100%; }
#petroleum-controls:empty, #petroleum-status:empty, #map-evidence:empty { display: none; }
#petroleum-controls[hidden], #petroleum-status[hidden], #map-evidence[hidden] { display: none; }

.petro-controls {
  min-width: 0;
  padding: 17px 20px 18px;
  border-top: 1px solid #e0e5d6;
  border-bottom: 1px solid #dae2ce;
  background: #f3f6ec;
}
.petro-controls h2, .petro-controls h3 { margin: 0 0 10px; }
.petro-controls h2 { font-size: 23px; }
.petro-controls h3 { color: var(--forest); font-size: 12px; }
.petro-controls .eyebrow { margin-bottom: 9px; }
.petro-controls-head { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
.petro-controls-head > div:first-child { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.petro-controls-head strong { color: var(--forest); font-size: 14px; }
.petro-province { color: #6d7f60; font-size: 10px; }
.petro-controls-head .petro-mode { margin: 0; }
.petro-mode-help { margin: 10px 0; color: #617352; font-size: 11px; line-height: 1.6; }
.petro-inspecting, .petro-inspecting .leaflet-interactive { cursor: crosshair; }
.petro-toggle .petro-swatch { display: inline-block; flex: 0 0 10px; width: 10px; height: 10px; margin: 3px 0 0; border-radius: 50%; background: #185747; }
.petro-toggle .petro-swatch.licensed { background: #c17810; border-radius: 50%; }
.petro-toggle .petro-swatch.cancelled { background: #cad0d2; border: 1px solid #626d74; }
.petro-toggle .petro-swatch.pools { border: 2px solid #a84978; background: #a8497820; border-radius: 2px; }
.petro-toggle .petro-swatch.tenure { border: 2px dashed #725399; background: #72539920; border-radius: 1px; }
.petro-toggle .petro-swatch.freehold { border: 2px solid #d4931e; background: transparent; }
.petro-cluster { display: flex; justify-content: center; align-items: center; border: 2px solid white; border-radius: 50%; color: #fff; background: #185747; box-shadow: 0 1px 5px #153e3540; font: 600 10px/1 system-ui,sans-serif; }
.petro-cluster.has-planned { box-shadow: 0 0 0 2px #c17810, 0 1px 6px #153e3540; }
.petro-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 14px;
  padding: 5px;
  border: 1px solid #cdd9be;
  border-radius: 9px;
  background: #e7eeda;
}
.petro-mode > span, .petro-mode > label { padding: 0 7px; color: #5a714b; font-size: 10px; font-weight: 600; }
.petro-mode button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #48653d;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}
.petro-mode button:hover:not(:disabled) { background: #f4f7ec; }
.petro-mode button[aria-pressed='true'], .petro-mode button.active, .petro-mode button.is-active {
  color: #fffef9;
  background: var(--forest);
  border-color: var(--forest);
  box-shadow: 0 2px 6px rgb(21 62 53 / 10%);
}
.petro-mode button[aria-pressed='true']:hover, .petro-mode button.active:hover { background: #245849; }
.petro-mode .icon { width: 16px; height: 16px; flex-basis: 16px; }
.petro-toggles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 13px; }
.petro-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 11px 10px;
  border: 1px solid #d5dfc8;
  border-radius: 7px;
  background: #fafcf5;
  color: #4d6740;
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
}
.petro-toggle:hover { border-color: #aabb96; background: #f0f6e7; }
.petro-toggle.active, .petro-toggle.is-on, .petro-toggle:has(input:checked) { color: #355a30; background: #e8f0dc; border-color: #aabd95; }
.petro-toggle input { flex: 0 0 15px; width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--forest); }
.petro-toggle > span, .petro-toggle > div { min-width: 0; }
.petro-toggle strong { display: block; font-size: 11px; font-weight: 650; }
.petro-toggle small { display: block; margin-top: 3px; color: #6f805f; font-size: 10px; line-height: 1.5; }
.petro-toggle:has(input:disabled), .petro-toggle.disabled { color: #77816f; background: #eff2e8; border-color: #e0e5d8; cursor: not-allowed; }
.petro-toggle:has(input:disabled) small { color: #7c8773; }
.petro-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; margin: 9px 0 0; color: #5f7551; font-size: 10px; line-height: 1.5; }
.petro-legend > span, .petro-legend > div { display: inline-flex; align-items: center; gap: 6px; }
.petro-legend i, .petro-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: currentColor; }
.petro-legend .petro-swatch { display: inline-block; width: 17px; height: 11px; flex: 0 0 17px; border: 1.5px solid currentColor; border-radius: 2px; background: color-mix(in srgb, currentColor 13%, transparent); }
.petro-legend .drilled, .petro-dot.drilled { color: #277251; }
.petro-legend .licensed, .petro-legend .planned, .petro-dot.licensed, .petro-dot.planned { color: #af7c2e; }
.petro-legend .cancelled, .petro-legend .unknown, .petro-dot.cancelled, .petro-dot.unknown { color: #7b8272; }
.petro-legend .pool, .petro-dot.pool { color: #47838b; }
.petro-legend .freehold, .petro-dot.freehold { color: #8a6a8d; }
.petro-legend .disposition, .petro-dot.disposition { color: #997945; }
.petro-count, .petro-chip { display: inline-flex; align-items: center; min-width: 20px; padding: 3px 7px; border-radius: 4px; background: #e7eddd; color: #527044; font-size: 10px; line-height: 1.4; font-variant-numeric: tabular-nums; }

.petro-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; margin: 15px 0 0; }
.petro-search label { color: #557047; font-size: 11px; font-weight: 600; }
.petro-search > label:not(.sr-only) { flex-basis: 100%; }
.petro-search > div { display: flex; flex: 1; flex-wrap: wrap; gap: 8px; width: 100%; min-width: 0; }
.petro-search input, .petro-search select {
  flex: 1 1 200px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cad7bb;
  border-radius: 7px;
  background: #fffef9;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}
.petro-search input::placeholder { color: #7c8b71; }
.petro-search select { flex: 0 1 180px; }
.petro-search button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 15px;
  border: 1px solid var(--forest);
  border-radius: 7px;
  background: var(--forest);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.petro-search button:hover:not(:disabled) { background: #245849; border-color: #245849; }
.petro-search-results { display: grid; gap: 0; max-height: 285px; min-width: 0; margin: 10px 0 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #d5e0c9; border-radius: 8px; background: #fffef9; list-style: none; scrollbar-width: thin; scrollbar-color: #b9c9a9 #f1f6e8; }
.petro-search-results:empty { display: none; }
.petro-search-results > p { margin: 10px 12px; font-size: 11px; line-height: 1.6; }
.petro-search-results .petro-record-list { max-height: none; margin: 0; padding: 8px; overflow: visible; }
.petro-search-results > button, .petro-search-results > li > button { display: block; width: 100%; min-height: 48px; padding: 12px 14px; border-bottom: 1px solid #e4ebda; color: #375d31; background: #fffef9; font-size: 12px; line-height: 1.6; text-align: left; overflow-wrap: anywhere; }
.petro-search-results > button:last-child, .petro-search-results > li:last-child > button { border-bottom: 0; }
.petro-search-results button:hover { background: #edf4e1; }
.petro-search-results strong { display: block; font-size: 12px; }
.petro-search-results small { display: block; margin-top: 3px; color: #6a7e5c; font-size: 10px; }
.petro-status { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 13px; padding: 10px 18px; border-bottom: 1px solid #dbe3d1; background: #eef3e6; color: #557046; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.petro-status:empty { display: none; }
.petro-status p { margin: 0; }
.petro-status strong { color: #3e6234; }
.petro-status.error, .petro-status.is-error { border-color: #e6ccbc; background: #f6eae1; color: #8a4c34; }
.petro-status.loading, .petro-status.is-loading { border-color: #e4dac0; background: #f5efdf; color: #786438; }
.petro-status button { min-height: 35px; padding: 6px 9px; border: 1px solid currentColor; border-radius: 5px; font-size: 10px; }
.petro-status a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Evidence is a full-width reading area below the map, without a text viewport. */
#map-evidence:not(:empty) { padding: 25px; border-top: 1px solid #d7dfcc; background: #fafcf4; }
.petro-evidence { min-width: 0; max-width: 100%; color: var(--ink); }
.petro-evidence-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 21px; }
.petro-evidence-head > div { flex: 1; min-width: 0; }
.petro-evidence-head .eyebrow { margin-bottom: 8px; color: #668157; }
.petro-evidence-head h2 { font-size: 29px; line-height: 1.2; margin: 5px 0 9px; overflow-wrap: anywhere; }
.petro-evidence-head h3 { font-size: 19px; line-height: 1.4; margin: 4px 0 8px; color: var(--forest); overflow-wrap: anywhere; }
.petro-evidence-head p { color: #667b59; font-size: 12px; line-height: 1.7; margin: 5px 0 0; }
.petro-evidence-head > button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid #cfdcc1; border-radius: 7px; background: #fffef9; color: #58744a; font-size: 11px; }
.petro-evidence-head > button:hover { background: #eaf2de; }
.petro-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; margin: 15px 0 22px; padding: 0; }
.petro-fields > div { min-width: 0; padding: 13px 0; border-top: 1px solid #e0e7d5; }
.petro-fields > .wide, .petro-fields > .full { grid-column: 1 / -1; }
.petro-fields dt { color: #6e8060; font-size: 10px; line-height: 1.5; font-weight: 500; margin: 0 0 5px; }
.petro-fields dd { color: #375931; font-size: 13px; line-height: 1.65; font-weight: 550; margin: 0; overflow-wrap: anywhere; }
.petro-fields dd small { color: #748669; font-size: 10px; font-weight: 400; }
.petro-fields a { color: #27634c; text-decoration: underline; text-underline-offset: 3px; }
.petro-record-list { display: flex; flex-direction: column; gap: 8px; max-height: 380px; margin: 16px 0 22px; padding: 2px; overflow-y: auto; overscroll-behavior: contain; list-style: none; scrollbar-width: thin; scrollbar-color: #b9c9a9 #f1f6e8; }
.petro-record-list:empty { display: none; }
.petro-record-list > button, .petro-record-list > li, .petro-record-list > article { min-width: 0; padding: 13px 15px; border: 1px solid #d5e0c8; border-radius: 8px; background: #f0f5e8; color: #486b3b; font-size: 12px; line-height: 1.65; text-align: left; overflow-wrap: anywhere; }
.petro-record-list > li > button { display: block; width: 100%; min-height: 44px; color: inherit; text-align: left; }
.petro-record-list > button:hover, .petro-record-list > li:has(button):hover { border-color: #abc394; background: #e5f0d8; }
.petro-record-list > button[aria-pressed='true'] { border-color: #486b3b; box-shadow: inset 3px 0 #486b3b; }
.petro-record-list > button > span { display: block; color: #617650; font-size: 10px; margin-top: 4px; }
.petro-record-list strong { display: block; color: #365d2e; font-size: 12px; }
.petro-record-list small { display: block; color: #718664; font-size: 10px; margin-top: 4px; }
.petro-record-list p { margin: 6px 0 0; color: #647c56; font-size: 11px; }
.petro-note { padding: 14px 16px; margin: 16px 0; border: 1px solid #e1d8ba; border-radius: 8px; background: #f5efdf; color: #796339; font-size: 11px; line-height: 1.75; overflow-wrap: anywhere; }
.petro-note strong { color: #70582b; }
.petro-note summary { cursor: pointer; font-weight: 600; }
.petro-note a { color: #275a44; text-decoration: underline; text-underline-offset: 2px; }
.petro-evidence > p { font-size: 12px; line-height: 1.8; color: #586e49; }
#petro-record-detail h4 { color: var(--forest); font-size: 16px; line-height: 1.5; margin: 18px 0 12px; overflow-wrap: anywhere; }
#petro-record-detail > button { min-height: 44px; margin-top: 18px; padding: 10px 14px; border: 1px solid #cbd9bf; border-radius: 7px; background: #eaf1df; color: var(--forest); font-size: 12px; }
.petro-note p { margin: 6px 0 0; font-size: inherit; }
.petro-note > :first-child { margin-top: 0; }
.petro-note > :last-child { margin-bottom: 0; }
.petro-controls .petro-note { padding: 10px 12px; margin: 12px 0 0; font-size: 10px; }
.petro-source { margin: 16px 0 0; padding-top: 15px; border-top: 1px solid #dfe7d4; color: #718366; font-size: 10px; line-height: 1.8; overflow-wrap: anywhere; }
.petro-source p { margin-bottom: 7px; }
.petro-source > :last-child { margin-bottom: 0; }
.petro-source a { color: #2c684b; text-decoration: underline; text-underline-offset: 3px; }
.petro-source a:hover { color: #153e35; }
.petro-source strong { color: #526d43; }
.petro-empty { min-height: 145px; padding: 20px 10px; color: #6d825d; font-size: 12px; line-height: 1.75; }
.petro-empty h2 { font-size: 26px; }
.petro-empty p { max-width: 580px; margin-bottom: 10px; }
.petro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 16px 0; }
.petro-actions button, .petro-actions a { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 10px 14px; border: 1px solid #d0dec0; border-radius: 7px; background: #eef4e4; color: #416738; font-size: 11px; font-weight: 600; }
.petro-actions button:hover, .petro-actions a:hover { background: #e3efd5; }
.petro-controls :focus-visible, .petro-search-results button:focus-visible, .petro-evidence :focus-visible, .petro-status :focus-visible { outline: 3px solid #ae792c; outline-offset: 3px; }

@media (max-width: 1190px) {
  .petro-controls { padding: 15px 16px; }
  .petro-toggles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .petro-toggle { padding: 10px; }
  #map-evidence:not(:empty) { padding: 23px; }
}
@media (min-width: 651px) and (max-width: 930px) {
  .petro-toggles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .petro-controls { padding: 15px 13px; }
  .petro-mode { width: 100%; margin-bottom: 12px; gap: 5px; }
  .petro-mode > span, .petro-mode > label { flex-basis: 100%; padding: 4px 7px; }
  .petro-mode button { flex: 1; min-height: 45px; padding: 10px 9px; font-size: 11px; }
  .petro-toggles { gap: 7px; }
  .petro-toggle { min-height: 49px; padding: 10px 8px; font-size: 11px; }
  .petro-toggle strong { font-size: 11px; }
  .petro-toggle small { font-size: 9px; }
  .petro-legend { gap: 7px 12px; font-size: 9px; }
  .petro-search { gap: 7px; }
  .petro-search input { flex-basis: 150px; font-size: 16px; padding: 10px; }
  .petro-search input::placeholder { font-size: 11px; }
  .petro-search select { flex-basis: 100%; font-size: 16px; }
  .petro-search button { padding: 10px 12px; }
  .petro-search-results { max-height: 265px; }
  .petro-search-results > button, .petro-search-results > li > button { padding: 12px; }
  .petro-status { padding: 10px 13px; font-size: 10px; }
  .petro-status button { min-height: 44px; }
  #map-evidence:not(:empty) { padding: 22px 17px; }
  .petro-evidence-head { gap: 11px; margin-bottom: 17px; }
  .petro-evidence-head h2 { font-size: 27px; }
  .petro-evidence-head h3 { font-size: 18px; }
  .petro-evidence-head p { font-size: 11px; }
  .petro-fields { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 12px; }
  .petro-fields > div { padding: 12px 0; }
  .petro-fields dt { font-size: 10px; }
  .petro-fields dd { font-size: 13px; }
  .petro-record-list { max-height: 360px; }
  .petro-note { padding: 13px 14px; font-size: 11px; }
  .petro-source { font-size: 10px; }
  .petro-actions button, .petro-actions a { min-height: 46px; }
}
@media (max-width: 370px) {
  .petro-mode button { font-size: 10px; }
  .petro-toggles { grid-template-columns: minmax(0, 1fr); }
  .petro-search input { flex-basis: 125px; }
  .petro-search button { padding-left: 9px; padding-right: 9px; }
}
@media print {
  #petroleum-controls, .petro-search, .petro-search-results,
  .petro-mode, .petro-toggles, .petro-actions,
  .petro-evidence-head > button { display: none !important; }
  #map-evidence:not(:empty) { padding: 16px 0; background: white; }
  .petro-evidence-head h2 { font-size: 20pt; }
  .petro-evidence-head h3 { font-size: 14pt; }
  .petro-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .petro-fields > div { break-inside: avoid; }
  .petro-fields dt { font-size: 8pt; }
  .petro-fields dd { font-size: 9pt; }
  .petro-record-list { max-height: none; overflow: visible; }
  .petro-record-list > * { break-inside: avoid; }
  .petro-source, .petro-note, .petro-status { font-size: 8pt; }
}
