/* dls.mapmatics.co - Mapmatics theme, ported verbatim per Section 9.5.
   Sources, copied in rather than linked (both siblings are separate deploys
   with their own cache lifetimes):
     1. Mapmatics Dashboard  dashboard/static/dashboard/css/app.css  - tokens,
        topbar, KPI strip, cards, tables, leaflet popup restyle, responsive.
     2. Haynesville Operator Map  hvmap/static/hvmap/css/app.css  - pills,
        fm-toggle, layer-toggles, legend rows, #side-detail, row-flag.
     3. Mapmatics/08252026/concepts/01-gridframe.html - the hero contour
        field and the corner plus-marks (.pm), the public-site treatment.
   No DLS palette. The DLS identity here is the logo plus the two name
   strings; everything else is the Mapmatics system unchanged. */

:root {
  --paper: #F7F6F2;
  --card: #FDFCFA;
  --ink: #111311;
  --slate: #686E68;
  --line: #CECDC5;
  --pm: #969892;
  --forest: #304A3A;
  --forest-2: #263B2E;
  --cream: #F5F0D6;
  --ef: #96684A;        /* Eagle Ford formation badge */
  --pb: #5A6E83;
  --ac: var(--pb);      /* Austin Chalk badge - same hex, named for its use here */
  --amber: #A66B2E;
  --pad: clamp(20px, 3vw, 40px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* the three county colors (9.8) */
  --c-lavaca: var(--forest);
  --c-fayette: var(--amber);
  --c-lee: var(--slate);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
::selection { background: var(--forest); color: var(--cream); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--forest); color: var(--cream); padding: 10px 16px;
  font-size: 13.5px; font-weight: 550; border-radius: 0 0 3px 0;
}
.skip-link:focus { left: 0; }

/* ---- top bar ---- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 500;
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 var(--pad);
  display: flex; align-items: center; gap: 28px; height: 58px;
}
.topbar-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar-logo img { height: 26px; display: block; }
.topbar-logo .word { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.topbar-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--pm); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 2px; margin-left: 2px;
}
.topbar-nav { display: flex; gap: 4px; margin-left: 10px; flex: 1; }
.topbar-link {
  text-decoration: none; font-size: 13.5px; font-weight: 500; color: var(--slate);
  padding: 6px 11px; border-radius: 3px; transition: color .18s, background .18s;
  white-space: nowrap;
}
.topbar-link:hover { color: var(--ink); }
.topbar-link.active { color: var(--ink); background: rgba(48, 74, 58, .09); }

/* ---- page scaffolding ---- */
.page { max-width: 1280px; margin: 0 auto; padding: 30px var(--pad) 70px; }

.kicker {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--forest);
  display: flex; align-items: center; gap: 8px;
}
.kicker::before { content: ""; width: 18px; height: 1px; background: var(--forest); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { font-size: 27px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; }
.page-lead { font-size: 14px; color: var(--slate); max-width: 76ch; margin-top: 10px; }

.btn {
  display: inline-block; text-decoration: none; font: inherit; font-size: 13.5px; font-weight: 550;
  padding: 8px 16px; border-radius: 3px; cursor: pointer; transition: background .18s, color .18s;
}
.btn-primary { background: var(--forest); color: var(--cream); border: 1px solid var(--forest); }
.btn-primary:hover { background: var(--forest-2); }
.btn-ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--slate); }
.btn-small { font-size: 12.5px; padding: 5px 11px; }

/* ---- gridframe: hero contour band + corner plus-marks ---- */
.hero {
  position: relative; border-bottom: 1px solid var(--line);
  background: var(--card); overflow: hidden;
}
#heroTopo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-copy { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto;
             padding: clamp(26px, 3.4vw, 44px) var(--pad); }
.hero-copy h1 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 650; letter-spacing: -.025em; margin-top: 8px; }
.hero-copy .lead { max-width: 62ch; margin-top: 12px; color: var(--slate); font-size: 14.5px; }
.pm { position: absolute; width: 15px; height: 15px; pointer-events: none; z-index: 3; }
.pm::before, .pm::after { content: ""; position: absolute; background: var(--pm); }
.pm::before { left: 6px; top: 0; width: 3px; height: 15px; }
.pm::after { left: 0; top: 6px; width: 15px; height: 3px; }
.pm.tr { top: -8px; right: -8px; }
.pm.bl { bottom: -8px; left: -8px; }

/* ---- kpi strip: rules, not boxes ---- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.kpi { padding: 18px 20px 16px 0; border-right: 1px solid var(--line); }
.kpi + .kpi { padding-left: 20px; }
.kpi:last-child { border-right: none; }
.kpi .num { font-family: var(--mono); font-size: 30px; font-weight: 500; line-height: 1.1; }
.kpi .lbl { font-size: 12.5px; color: var(--slate); margin-top: 3px; }
.kpis-6 { grid-template-columns: repeat(6, 1fr); }
.kpis-6 .kpi .num { font-size: 26px; }

/* ---- cards & sections ---- */
.section { margin-bottom: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-head h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.section-head .more { font-size: 12.5px; color: var(--slate); text-decoration: none; }
.section-head .more:hover { color: var(--ink); }
.section-head .dim { font-size: 12px; color: var(--slate); margin-top: 3px; max-width: 62ch; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 4px; }
.card-pad { padding: 18px 20px; }

/* Panel footnote (9.12). */
.attrib {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--pm); margin-top: 8px;
}

/* ---- tables ---- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 4px; }
.tbl th {
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .13em;
  text-transform: uppercase; color: var(--pm); text-align: left;
  padding: 9px 14px; border-bottom: 1px solid var(--ink); white-space: nowrap;
}
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th[data-sort]:hover { color: var(--ink); }
.tbl th[aria-sort="ascending"]::after { content: " \2191"; color: var(--forest); }
.tbl th[aria-sort="descending"]::after { content: " \2193"; color: var(--forest); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(48, 74, 58, .035); }
.tbl a.rowlink { font-weight: 550; text-decoration: none; }
.tbl a.rowlink:hover { text-decoration: underline; }
.tbl .mono, .mono { font-family: var(--mono); font-size: 12.5px; }
.tbl .dim { color: var(--slate); }
.tbl .num { font-family: var(--mono); font-size: 12.5px; text-align: right; }
.tbl th.num { text-align: right; }
.row-flag td { background: rgba(166, 107, 46, .06); }

.rowcount { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
            text-transform: uppercase; color: var(--pm); margin: 0 0 10px; }

.empty {
  border: 1px dashed var(--line); border-radius: 4px; background: none;
  padding: 34px 20px; text-align: center; color: var(--slate); font-size: 13.5px;
}
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

/* ---- chips ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550;
  padding: 2px 9px; border-radius: 20px; border: 1px solid var(--line); white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--slate); }
.chip-play { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.chip-ef { color: var(--ef); border-color: rgba(150, 104, 74, .40); }
.chip-ac { color: var(--ac); border-color: rgba(90, 110, 131, .40); }
.chip-flag { color: var(--amber); border-color: rgba(166, 107, 46, .40); }

/* ---- filter bar ---- */
.filterbar { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; align-items: center; }
.filterbar select, .filterbar input[type="text"], .filterbar input[type="search"] {
  font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 3px; background: var(--card); color: var(--ink);
}
.filterbar input[type="search"] { min-width: 210px; }
.filterbar input:focus, .filterbar select:focus { outline: 2px solid var(--forest); outline-offset: 1px; }

/* ---- toggles (county tabs, formation tabs) ---- */
.fm-toggle { display: flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; margin: 14px 0 10px; }
.fm-toggle button { flex: 1; font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
    padding: 8px 0; background: var(--card); color: var(--slate); border: none; cursor: pointer; }
.fm-toggle button + button { border-left: 1px solid var(--line); }
.fm-toggle button.active { background: var(--forest); color: var(--cream); }
.fm-toggle button:focus-visible { outline: 2px solid var(--forest); outline-offset: -3px; }

.layer-toggles { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--slate);
    padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.layer-toggles label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }

/* ---- as-of and health strips (9.11) ---- */
.asof {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 9px 0; margin-bottom: 22px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--pm);
}
.asof .run { color: var(--forest); }
.asof .warn { color: var(--amber); }
.asof a { color: inherit; }

.pill {
  display: inline-block; font-family: var(--mono); font-size: 10.5px;
  font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 2px; border: 1px solid transparent;
}
.pill-ok { background: rgba(48, 74, 58, .09); color: var(--forest); border-color: rgba(48, 74, 58, .28); }
.pill-warn { background: rgba(166, 107, 46, .10); color: var(--amber); border-color: rgba(166, 107, 46, .32); }
.pill-bad { background: rgba(122, 59, 46, .10); color: #7A3B2E; border-color: rgba(122, 59, 46, .32); }

.health { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 22px; }
.health-row { display: flex; align-items: center; gap: 10px; padding: 7px 0;
              border-bottom: 1px solid var(--line); font-size: 13px; }
.health-row .src { flex: 1; }
.health-row .when { font-family: var(--mono); font-size: 11px; color: var(--pm); }

/* ---- watchlist (Today) ---- */
.watch { border-top: 1px solid var(--ink); }
.watch-row { display: grid; grid-template-columns: 132px 1fr; gap: 16px; padding: 11px 0;
             border-bottom: 1px solid var(--line); font-size: 13.5px; }
.watch-row .kind { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
                   text-transform: uppercase; color: var(--forest); padding-top: 3px; }
.watch-row .what .note { color: var(--slate); }

/* ---- map ---- */
.map-shell { display: grid; grid-template-columns: 1fr 300px; gap: 0;
             border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--card); }
/* The three counties stack north-south, so the bounds are taller than they
   are wide; a short map forces fitBounds down a zoom level and leaves the
   AOI floating in empty basemap. */
#dls-map { height: 560px; background: var(--paper); }
.map-side { border-left: 1px solid var(--line); background: var(--card); padding: 16px 18px; overflow-y: auto; }
.map-legend-col { border-top: 1px solid var(--ink); }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 5px 0;
              border-bottom: 1px solid var(--line); font-size: 12.5px; }
.legend-row i { width: 13px; height: 13px; border-radius: 2px; flex: none; border: 1px solid rgba(17, 19, 17, .15); }
.legend-row .n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--pm); }
.side-count { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
              text-transform: uppercase; color: var(--pm); margin-bottom: 10px; }

.leaflet-container { font-family: "Inter Tight", sans-serif; }
.leaflet-popup-content-wrapper { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 6px 24px rgba(17, 19, 17, .16); }
.leaflet-popup-content { margin: 12px 14px; font-family: "Inter Tight", sans-serif; font-size: 13px; line-height: 1.45; }
.leaflet-popup-tip { background: var(--card); border: 1px solid var(--line); }
.pop-job { font-weight: 650; font-size: 13.5px; }
.pop-client { color: var(--slate); font-size: 12px; margin-bottom: 5px; }
.pop-meta { font-family: var(--mono); font-size: 10.5px; color: var(--pm); margin-bottom: 8px; }
.pop-links a { font-size: 12.5px; font-weight: 550; color: var(--forest); margin-right: 10px; }

/* ---- prose blocks ---- */
.prose { max-width: 74ch; }
.prose h2 { font-size: 17px; font-weight: 650; margin: 30px 0 8px; }
.prose h3 { font-size: 14.5px; font-weight: 650; margin: 20px 0 6px; }
.prose p { margin-bottom: 12px; font-size: 14.5px; }
.prose ul { margin: 0 0 14px 20px; font-size: 14.5px; }
.prose li { margin-bottom: 5px; }
.callout { border-left: 3px solid var(--forest); background: var(--card);
           padding: 14px 18px; margin: 0 0 20px; font-size: 14px; }
.callout p + p { margin-top: 10px; }

.app-footer { border-top: 1px solid var(--line); padding: 16px var(--pad);
              display: flex; align-items: center; justify-content: center; gap: 10px;
              font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
              text-transform: uppercase; color: var(--pm); text-align: center; }
.app-footer img { height: 14px; opacity: .7; }
.app-footer a { color: inherit; }

/* ---- responsive (ported verbatim, DLS additions after it) ---- */
@media (max-width: 980px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .topbar-nav { order: 3; width: 100%; overflow-x: auto; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(2) { border-right: none; }
  .kpi:nth-child(3) { border-top: 1px solid var(--line); padding-left: 0; }
  .kpi:nth-child(4) { border-top: 1px solid var(--line); }
  .map-shell { grid-template-columns: 1fr; }
  .map-side { border-left: none; border-top: 1px solid var(--line); }
}

@media (max-width: 980px) {
  .kpis-6 { grid-template-columns: repeat(2, 1fr); }
  .kpis-6 .kpi { border-right: 1px solid var(--line); padding-left: 0; padding-right: 16px; }
  .kpis-6 .kpi:nth-child(even) { border-right: none; padding-left: 16px; }
  .kpis-6 .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .watch-row { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
