/* Legal-limits tool. Only what the frost-law stylesheet (frost-restrictions/style.css, linked first, worn through the shared class names) and the
   shared map do not already give: the measure setup bar's single field, the detail panel's limit list, the filterable table and the table card.
   Site tokens only: no colour literals. */
.ll.ll { margin: 0 0 24px; }
.ll .setup-bar { max-width: none; }
.ll.frz .setup-bar .vis-field { flex: 1 1 100%; }
.ll.frz .setup-bar .vis-field select { padding-left: 12px; text-overflow: ellipsis; }

/* anchors under the provenance band (the old page's rail) */
.ll-jump { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 16px; font-size: 13px; line-height: 1.5; }
.ll-jump a { display: inline-flex; align-items: center; min-height: 40px; color: var(--accent); text-decoration: none; }
.ll-jump a:hover, .ll-jump a:focus-visible { text-decoration: underline; }
.qtt-tool > .qh-prov { margin-top: 0; }

/* detail panel: every limit, its citation and its two dates (the table's own cell markup) */
.ll-ms { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ll-m { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--surface); }
.ll-m.is-current { border-color: var(--ink); }
.ll-m[data-k="conflict"] { border-color: var(--warn); background: var(--warn-bg); }
.ll-m[data-k="none"], .ll-m[data-k="nodata"] { border-style: dashed; }
.ll-mk { font-size: 12px; line-height: 1.5; color: var(--muted); }
.ll-mv { min-width: 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.ll-mv .qh-v { display: block; color: var(--ink); font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.ll-mv .qh-v.qh-vt { font-weight: 600; }
.ll-mv .qh-v a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--border-strong); }
.ll-mv .qh-v a:hover, .ll-mv .qh-v a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }
.ll-mv .qh-none { color: var(--ink-soft); font-weight: 400; }
.ll-mv .qh-rev { display: block; margin-top: 4px; font-size: 11px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.ll-mv .qh-sched { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.ll-mv .qh-sf { font-weight: 600; color: var(--ink); }
.ll-mv .qh-sf a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--border-strong); }
.ll-mv .qh-sc { display: block; font-size: 11px; line-height: 1.5; color: var(--muted); }
.ll-mv .qh-tier { display: inline-block; margin-left: 8px; padding: 0 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-btn); font-size: 10px; text-transform: uppercase; color: var(--muted); }
.ll .frz-stats .stat strong { font-size: 24px; }

/* directory */
.ll-dir { margin-top: 24px; }
.ll-vchip { max-width: 100%; white-space: normal; text-align: left; }
.ll-nopage { font-size: 12px; line-height: 1.5; color: var(--muted); }

/* the table card wears the tool card's surface */
.ll-card { margin: 0 0 48px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.ll-card-head h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.4; color: var(--ink); text-align: left; }
.ll-card-body p { margin: 0 0 12px; max-width: 820px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.ll-card-body p.qh-sub { color: var(--muted); }
.ll-card-body a { color: var(--accent); }
.ll-card-body .qh-tablewrap { margin-top: 12px; }

/* filters: a tidy wrapping grid */
.ll-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; align-items: end; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.ll-filters[hidden] { display: none; }
.ll-field { display: grid; gap: 4px; min-width: 0; font-size: 11px; line-height: 1.4; color: var(--muted); }
.ll-field[hidden] { display: none; }
.ll-field input, .ll-field select { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-btn); background: var(--surface); color: var(--ink); font-size: 13px; }
.ll-field select:disabled { opacity: 0.6; }
.ll-pair { display: flex; gap: 8px; }
.ll-pair label { position: relative; flex: 1 1 0; min-width: 0; }
.ll-pair i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 11px; color: var(--muted); pointer-events: none; }
.ll-pair input { padding-right: 32px; }
.ll-field input:focus-visible, .ll-field select:focus-visible, .ll-reset:focus-visible, .ll-sort:focus-visible, .ll-linkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ll-reset { min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-btn); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.ll-reset:hover { border-color: var(--ink); }
.ll-count { margin: 12px 0 0 !important; font-size: 13px; font-weight: 600; color: var(--ink) !important; }
.ll-empty { padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-btn); }
.ll-empty[hidden] { display: none; }
.ll-linkbtn { min-height: 40px; padding: 0 4px; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

/* sortable headers and the highlighted measure column */
.ll-table tr[hidden] { display: none; }
.ll-sort { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; white-space: nowrap; }
.ll-sort:hover { color: var(--ink); }
.ll-arrow { font-size: 10px; }
.ll-table[data-hl="width"] [data-key="width"], .ll-table[data-hl="height"] [data-key="height"], .ll-table[data-hl="trailerLength"] [data-key="trailerLength"],
.ll-table[data-hl="overallLength"] [data-key="overallLength"], .ll-table[data-hl="kingpin"] [data-key="kingpin"], .ll-table[data-hl="frontOverhang"] [data-key="frontOverhang"],
.ll-table[data-hl="rearOverhang"] [data-key="rearOverhang"], .ll-table[data-hl="gross"] [data-key="gross"], .ll-table[data-hl="singleAxle"] [data-key="singleAxle"],
.ll-table[data-hl="tandemAxle"] [data-key="tandemAxle"] { box-shadow: inset 0 -2px 0 var(--accent); }
.ll-table.is-enhanced td[data-m] { box-shadow: none; }
.ll-table.is-enhanced td.is-conflict { box-shadow: inset 0 0 0 1px var(--warn); }
.ll-table[data-hl="width"] td[data-m="width"], .ll-table[data-hl="height"] td[data-m="height"], .ll-table[data-hl="trailerLength"] td[data-m="trailerLength"],
.ll-table[data-hl="overallLength"] td[data-m="overallLength"], .ll-table[data-hl="kingpin"] td[data-m="kingpin"], .ll-table[data-hl="frontOverhang"] td[data-m="frontOverhang"],
.ll-table[data-hl="rearOverhang"] td[data-m="rearOverhang"], .ll-table[data-hl="gross"] td[data-m="gross"], .ll-table[data-hl="singleAxle"] td[data-m="singleAxle"],
.ll-table[data-hl="tandemAxle"] td[data-m="tandemAxle"] { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }

@media (max-width: 720px) {
  .ll-card { padding: 16px; }
  .ll-card-head h2 { font-size: 19px; }
  .ll-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ll-filters .ll-field:first-child, .ll-filters .ll-reset { grid-column: 1 / -1; }
  .ll-m { grid-template-columns: minmax(0, 1fr); }
  .ll .frz-stats .stat strong { font-size: 16px; }
}
@media (max-width: 360px) {
  .ll-filters { grid-template-columns: minmax(0, 1fr); }
}

.ll .na-region.is-static text { display: none; }
.ll-jump a, .ll .frz-links a { text-decoration: underline; text-underline-offset: 4px; }
.ll-value { grid-column: span 2; }
.ll-pair input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.ll-pair input::-webkit-inner-spin-button, .ll-pair input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
@media (max-width: 720px) { .ll-filters .ll-value { grid-column: 1 / -1; } }
.ll-card-body .qh-table + p, .ll-card-body .qh-tablewrap + p { margin-top: 12px; }
.ll.frz.frz .setup-bar { display: block; width: 100%; max-width: none; }

.ll-src { margin: 16px 0 0; }
.ll-src > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.ll-src > summary::before { content: '+'; margin-right: 8px; }
.ll-src[open] > summary::before { content: '\2212'; }
.ll-src .qh-prov { margin-top: 4px; }
@media (max-width: 720px) {
  .ll-jump { display: none; }
  .ll-filters .ll-field:nth-child(4) { grid-column: 1 / -1; }
  .ll-pair input { min-width: 64px; font-size: 16px; }
}
.ll-sort { min-width: 40px; }
