/* Pilot car & escort requirements matrix: the input bar, a full-width map, the hover pill, the side panel and the compliance page. Site tokens only. */
.esc.esc { margin: 0 0 24px; color: var(--ink); background: var(--paper); text-align: left; }
.esc [hidden] { display: none; }
.esc .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.esc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 0 16px; }
.axc.esc-barwrap .esc-field input[type="number"], .axc.esc-barwrap .esc-field select { padding-left: 60px; font-size: 13px; }
.esc .esc-field { position: relative; display: inline-flex; align-items: center; margin: 0; }
.esc .esc-field input[type="number"] { width: 180px; max-width: 100%; box-sizing: border-box; }
.esc .esc-field select { min-width: 190px; padding-left: 60px; }
.esc-clear { min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-btn); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px; cursor: pointer; }
.esc-clear:hover { border-color: var(--ink); }

/* THE MAP: the whole width of the page; the panel opens over its right-hand side. */
.esc-stage { position: relative; display: grid; gap: 8px; }
.esc-mapwrap { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 8px; overflow: clip; }
.esc-map { display: block; width: 100%; height: auto; max-height: 720px; }
.esc-region { cursor: pointer; outline: none; }
.esc-region path { stroke: var(--surface); stroke-width: 1.2; vector-effect: non-scaling-stroke; fill: var(--surface-3); transition: opacity 0.15s, fill 0.2s; }
.esc-region.is-static { cursor: default; }
.esc-region text { font-size: 14px; font-weight: 700; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
/* strictness: green = higher thresholds, amber = standard, red = strict, grey = no numeric trigger on file */
[data-level="lenient"] { --esc-c: color-mix(in srgb, var(--success) 42%, var(--surface)); }
[data-level="standard"] { --esc-c: color-mix(in srgb, var(--warn) 55%, var(--surface)); }
[data-level="strict"] { --esc-c: color-mix(in srgb, var(--error) 62%, var(--surface)); }
[data-level="open"] { --esc-c: var(--surface-3); }
/* for a typed load: none = green, one = amber, two or more = red, review = grey, unknown = pale */
[data-mine="ok"] { --esc-m: color-mix(in srgb, var(--success) 42%, var(--surface)); }
[data-mine="one"] { --esc-m: color-mix(in srgb, var(--warn) 55%, var(--surface)); }
[data-mine="many"] { --esc-m: color-mix(in srgb, var(--error) 62%, var(--surface)); }
[data-mine="review"] { --esc-m: color-mix(in srgb, var(--ink) 18%, var(--surface)); }
[data-mine="unknown"] { --esc-m: var(--surface-3); }
.esc-map[data-mode="level"] .esc-region path { fill: var(--esc-c, var(--surface-3)); }
.esc-map[data-mode="mine"] .esc-region path { fill: var(--esc-m, var(--surface-3)); }
.esc-region:hover path, .esc-region:focus-visible path { stroke: var(--ink); stroke-width: 2.5; }
.esc-region[data-selected] path { stroke: var(--ink); stroke-width: 3; }
.esc-map.is-hovering .esc-region:not(:hover):not([data-selected]) { opacity: 0.78; }

/* THE HOVER PILL */
.esc-pill { position: absolute; z-index: 6; max-width: 300px; padding: 8px 12px; border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow-md); font-size: 12px; line-height: 1.5; pointer-events: none; }
.esc-pill strong { display: block; font-size: 13px; margin-bottom: 4px; }
.esc-pill dl { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; margin: 0; }
.esc-pill dt { opacity: 0.75; }
.esc-pill dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.esc-pill p { margin: 4px 0 0; opacity: 0.9; }
.esc-rv { margin: 8px 0 0; font-size: 12px; line-height: 1.5; }
.esc-pill .esc-rv { opacity: 1; }
.esc-panel .esc-rv { margin: 0 0 12px; color: var(--ink-soft); }
.esc-head .esc-rv { flex: 1 1 100%; margin: 0; color: var(--ink-soft); }

.esc-legends { display: block; }
.esc-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.esc-legend li { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--surface); font-size: 12px; color: var(--ink-soft); }
.esc-legend strong { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.esc-sw { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--esc-c, var(--esc-m, var(--surface-3))); display: inline-block; }

/* THE SIDE PANEL */
.esc-panel { position: absolute; z-index: 5; top: 8px; right: 8px; width: min(380px, calc(100% - 16px)); max-height: calc(100% - 100px); overflow-y: auto; padding: 16px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); }
.esc-panel h2 { margin: 0; font-size: 18px; }
.esc-ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.esc-x { flex: none; width: 32px; height: 32px; padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 18px; line-height: 1.4; cursor: pointer; }
.esc-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 9999px; border: 1px solid var(--border-strong); background: var(--esc-c, var(--surface-3)); font-size: 12px; font-weight: 600; color: var(--ink); }
.esc-trig { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.esc-trig > div { padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
.esc-trig dt { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.esc-trig dd { margin: 4px 0 0; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.esc-mine { margin: 0 0 12px; padding: 12px; border-radius: 8px; background: var(--esc-m, var(--surface-3)); font-size: 13px; line-height: 1.5; }
.esc-mine p { margin: 0; }
.esc-mine .esc-big { font-size: 15px; font-weight: 700; }
.esc-open { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius-btn); background: var(--accent); color: var(--accent-ink, var(--surface)); font-weight: 600; font-size: 14px; text-decoration: none; }
.esc-open:hover { filter: brightness(1.05); }

.esc-all { margin-top: 24px; }
.esc-dir-sum { cursor: pointer; font-weight: 600; font-size: 15px; min-height: 44px; display: flex; align-items: center; }
.esc-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.esc-card a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; }
.esc-card a:hover { border-color: var(--accent); }
.esc-card .esc-chip { font-size: 11px; }

/* THE COMPLIANCE PAGE */
.esc-page { display: grid; gap: 16px; }
.esc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.esc-head .esc-trig { flex: 1 1 360px; margin: 0; }
.esc-sec { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.esc-sec h2 { margin: 0 0 12px; font-size: 16px; }
.esc-sec p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.esc-note, .esc-empty { color: var(--muted); font-size: 13px; }
.esc-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.esc-tbl th { text-align: left; padding: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.esc-tbl td { padding: 8px; border-top: 1px solid var(--border); vertical-align: top; }
.esc-sub { margin: 16px 0 8px; font-size: 14px; }
.esc-rules, .esc-src { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.esc-rule { padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 3%, var(--surface)); }
.esc-rule p { margin: 0 0 4px; }
.esc-rule-o { font-weight: 600; font-size: 13px; }
.esc-rule-s { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.esc-rule-s a, .esc-src a { color: var(--accent); }
@media (max-width: 720px) {
  .esc-panel { position: static; width: auto; max-height: none; margin-top: 0; }
  .esc .esc-field input[type="number"], .esc .esc-field select { width: 100%; }
  .esc .esc-field { flex: 1 1 140px; }
}
