/* Act / Section / Rule search window (actsearch.js) — the app's colours from styles.css */

/* the button in the left panel, styled like the other "Search by" rows */
.side-actsec { border-top: 1px solid var(--line); }
.side-actbtn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 10px; margin: 3px 0; border: 0; border-radius: 10px; background: none; cursor: pointer; font: 600 14.5px var(--sans); color: var(--ink-2); text-align: left; }
.side-actbtn:hover { background: var(--surface-2); color: var(--ink); }
.side-actbtn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--brass); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side-actbtn span { flex: 1; }
.side-actbtn .chev { width: 16px; height: 16px; stroke: var(--muted); }

/* the button under the search box, next to Keyword Search: the same pill, in the Bare Acts gold */
.st-act { flex: none; padding: 0; border: 0; background: none; cursor: pointer; scroll-snap-align: start; }
.st-act span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px 7px 12px; border: 1px solid color-mix(in srgb, var(--brass) 45%, var(--line)); border-radius: 999px; background: var(--brass-soft); font: 600 13px var(--sans); color: var(--ink); white-space: nowrap; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: border-color .2s, transform .15s; }
.st-act span svg { width: 16px; height: 16px; fill: none; stroke: var(--brass); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.st-act:hover span { border-color: var(--brass); transform: translateY(-1px); }
.st-act:focus-visible span { outline: 2px solid color-mix(in srgb, var(--brass) 55%, transparent); outline-offset: 2px; }

.as-dlg { width: min(1120px, calc(100vw - 24px)); height: min(820px, calc(100dvh - 24px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 40px 100px -20px rgba(5, 10, 25, .55); overflow: hidden; }
.as-dlg[open] { display: flex; flex-direction: column; animation: as-pop .45s cubic-bezier(.18, 1.2, .4, 1); }
.as-dlg::backdrop { background: rgba(10, 18, 32, .55); backdrop-filter: blur(5px); }
@keyframes as-pop { from { opacity: 0; transform: translateY(26px) scale(.96); } }
.as-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; color: #fff; background: radial-gradient(120% 160% at 0% 0%, #2c5282, #1f3a5f 50%, #12243d); }
.as-logo { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(233, 201, 139, .45); }
.as-logo svg { width: 24px; height: 24px; fill: none; stroke: #e9c98b; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.as-head > div { flex: 1; min-width: 0; }
.as-head h2 { margin: 0; font: 700 20px var(--serif); }
.as-head p { margin: 2px 0 0; font-size: 13px; color: #c9d6ea; }
.as-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 16px; cursor: pointer; transition: transform .25s, background .2s; }
.as-x:hover { transform: rotate(90deg); background: rgba(255, 255, 255, .22); }

.as-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 370px 1fr; }
.as-left { display: flex; flex-direction: column; min-height: 0; padding: 14px; border-right: 1px solid var(--line); background: var(--bg); }
.as-right { min-height: 0; overflow: auto; padding: 18px 22px 24px; }
.as-step { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; font: 700 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.as-step b { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #1f3a5f; color: #e9c98b; font-size: 12px; letter-spacing: 0; }
.as-pick { position: relative; }
.as-find { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.as-find:focus-within { border-color: #2563eb; box-shadow: 0 0 0 4px color-mix(in srgb, #2563eb 14%, transparent); }
.as-find svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; }
.as-find input { flex: 1; min-width: 0; padding: 11px 0; border: 0; background: none; font: 15px var(--sans); color: var(--ink); outline: none; }
.as-sugg { position: absolute; z-index: 5; left: 0; right: 0; top: 48px; max-height: 320px; overflow: auto; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); }
.as-sugg[hidden] { display: none; }
.as-sugg li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font: 14px/1.35 var(--serif); }
.as-sugg li.on, .as-sugg li[data-act]:hover { background: color-mix(in srgb, #2563eb 9%, var(--surface)); }
.as-sugg .as-sugg-wait { cursor: default; color: var(--muted); font: 13.5px var(--sans); }
.as-tag { flex: none; padding: 1px 7px; border-radius: 6px; background: #dbeafe; color: #1e40af; font: 700 10.5px/1.6 var(--sans); text-transform: uppercase; letter-spacing: .04em; }
.as-tag.r { background: #dcfce7; color: #166534; }
.as-tag.n { background: #fef3c7; color: #92400e; }
.as-sugg li.as-notext { opacity: .65; cursor: default; }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.as-chips button, .as-recent button { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: 600 12.5px var(--sans); cursor: pointer; }
.as-chips button:hover, .as-recent button:hover { border-color: #2563eb; color: #1d4ed8; }
.as-recent { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.as-recent:empty { display: none; }
.as-recent > span { width: 100%; font: 700 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.as-recent button { background: var(--brass-soft); border-color: color-mix(in srgb, var(--brass) 35%, transparent); color: var(--ink); }
.as-recent button b { color: var(--brass); }
.as-actcard { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--brass) 40%, transparent); border-radius: 12px; background: var(--brass-soft); }
.as-actcard > div { flex: 1; min-width: 0; }
.as-actcard b { display: block; font: 700 14.5px/1.3 var(--serif); }
.as-actcard small { color: var(--muted); font-size: 12px; }
.as-actcard button { flex: none; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font: 600 12px var(--sans); cursor: pointer; }
.as-actcard button:hover { border-color: #2563eb; color: #1d4ed8; }
.as-secs { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 14px; }
.as-secs[hidden] { display: none; }
.as-secfind { display: flex; gap: 6px; margin-bottom: 8px; }
.as-secfind input { flex: 1; min-width: 0; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font: 14px var(--sans); color: var(--ink); outline: none; }
.as-secfind input:focus { border-color: #2563eb; }
.as-secfind .btn { padding: 8px 14px; }
.as-seclist { flex: 1; min-height: 0; overflow: auto; padding-right: 2px; }
.as-chap p { position: sticky; top: 0; z-index: 1; margin: 6px 0 2px; padding: 6px 8px; border-radius: 8px; background: var(--bg); font: 700 11.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: #1d4ed8; }
.as-chap p small { display: block; font: 600 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.as-chap[hidden] { display: none; }
.as-seclist button { display: flex; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; font: 13.5px/1.35 var(--sans); color: var(--ink-2); }
.as-seclist button b { flex: none; min-width: 40px; color: var(--ink); font-variant-numeric: tabular-nums; }
.as-seclist button:hover { background: var(--surface); color: var(--ink); }
.as-seclist button.on { background: #1f3a5f; color: #fff; }
.as-seclist button.on b { color: #e9c98b; }
.as-seclist button[hidden] { display: none; }

.as-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--muted); }
.as-empty svg { width: 110px; height: 110px; fill: none; }
.as-empty .sp-draw { stroke-width: 3; }
.as-empty b { font: 600 18px var(--serif); color: var(--ink); }
.as-back { display: none; margin-bottom: 10px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 600 13px var(--sans); color: var(--ink-2); cursor: pointer; }
.as-sechead { animation: as-in .35s ease-out; }
@keyframes as-in { from { opacity: 0; transform: translateY(8px); } }
.as-num { display: inline-block; padding: 3px 11px; border-radius: 999px; background: #1f3a5f; color: #e9c98b; font: 700 12px var(--sans); letter-spacing: .04em; }
.as-sechead h3 { margin: 8px 0 2px; font: 700 21px/1.3 var(--serif); }
.as-sechead p { margin: 0; color: var(--muted); font-size: 13.5px; }
.as-eq { margin-top: 8px; padding: 5px 12px; border: 1px dashed #93c5fd; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font: 600 12.5px var(--sans); cursor: pointer; }
.as-eq:hover { background: #dbeafe; }
.as-text { margin: 12px 0; max-height: 130px; overflow: auto; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: 10px; background: var(--bg); font: 14.5px/1.3 "Times New Roman", Times, serif; color: var(--ink); -webkit-user-select: none; user-select: none; }
.as-text p { margin: .1em 0 .35em; text-align: justify; }
.as-text dir { display: block; margin: 0; padding: 0; }
.as-muted { color: var(--muted); font: 13.5px var(--sans) !important; }
.as-opts { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.as-opts-h { margin: 0; padding: 11px 0 8px; font: 700 14px var(--sans); color: var(--ink); }
.as-opts-h small { margin-left: 6px; font-weight: 500; color: var(--muted); }
.as-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 2px 0 14px; }
.as-grid label { display: flex; flex-direction: column; gap: 4px; font: 600 12.5px var(--sans); color: var(--ink-2); }
.as-grid label small { font-weight: 500; color: var(--muted); }
.as-grid .as-wide { grid-column: 1 / -1; }
.as-grid select, .as-grid input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font: 14px var(--sans); color: var(--ink); }
.as-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.as-actions .btn { text-decoration: none; }
.as-go { font-size: 15px; padding: 11px 18px; }
.as-clear { padding: 11px 16px; border: 1px solid var(--line); color: var(--ink-2); }
.as-clear:hover { border-color: var(--danger); color: var(--danger); }
.as-res { margin-top: 16px; animation: as-in .3s ease-out; }
.as-wait { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--brass) 35%, transparent); border-radius: 12px; background: var(--brass-soft); }
.as-wait > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.as-wait b { font: 600 15px var(--serif); }
.as-wait span { font-size: 13px; color: var(--muted); }
.as-bar { display: block; height: 3px; margin-top: 6px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 15%, transparent); overflow: hidden; }
.as-bar i { display: block; width: 35%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--brass)); animation: sp-slide 1.1s ease-in-out infinite; }
.as-spin { display: inline-block; width: 16px; height: 16px; flex: none; border: 2.5px solid color-mix(in srgb, var(--accent) 22%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: as-rot .7s linear infinite; vertical-align: -3px; margin-right: 6px; }
.as-spin.big { width: 26px; height: 26px; border-width: 3px; margin: 0; }
@keyframes as-rot { to { transform: rotate(360deg); } }
.as-count { margin-bottom: 8px; font: 14px var(--sans); color: var(--ink-2); }
.as-count b { font: 700 22px var(--serif); color: #1d4ed8; margin-right: 4px; }
.as-list { margin: 0 0 12px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.as-list li + li { border-top: 1px solid var(--line); }
.as-list button { display: grid; grid-template-columns: 92px 1fr; gap: 2px 12px; width: 100%; padding: 10px 14px; border: 0; background: var(--surface); text-align: left; cursor: pointer; color: var(--ink); }
.as-list button:hover { background: color-mix(in srgb, #2563eb 6%, var(--surface)); }
.as-jd { grid-row: span 2; font: 600 12.5px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.as-list b { font: 700 13.5px/1.35 var(--serif); text-transform: uppercase; }
.as-list small { font: 12px var(--sans); color: var(--muted); }
.as-none { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 13.5px; }
.as-none b { color: var(--ink); font: 600 15px var(--serif); }
.as-toast { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 9px 16px; border-radius: 10px; background: #0f172a; color: #fff; font: 600 13.5px var(--sans); box-shadow: var(--shadow-lg); }
.as-toast[hidden] { display: none; }

/* phones: one column — the Act and its sections, then the chosen section */
@media (max-width: 760px) {
  .as-dlg { width: 100vw; height: 100dvh; border-radius: 0; }
  .as-head { padding: 12px 14px; }
  .as-head p { display: none; }
  .as-body { grid-template-columns: 1fr; }
  .as-left { border-right: 0; }
  .as-right { display: none; }
  .as-dlg.has-sec .as-left { display: none; }
  .as-dlg.has-sec .as-right { display: block; }
  .as-back { display: inline-block; }
  .as-grid { grid-template-columns: 1fr 1fr; }
  .as-list button { grid-template-columns: 1fr; }
  .as-jd { grid-row: auto; }
}

/* the sections and rules as a grid of numbers (the title shows on hover, and in the heading once picked) */
.as-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; padding: 2px 2px 8px; }
.as-seclist .as-nums button { display: block; width: auto; min-height: 36px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); text-align: center; font: 700 13.5px/1.2 var(--sans); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-seclist .as-nums button:hover { border-color: #2563eb; color: #1d4ed8; background: var(--surface); }
.as-seclist .as-nums button.on { background: #1f3a5f; border-color: #1f3a5f; color: #e9c98b; }
.as-note { margin: 12px 0 0; }

/* CPC: the Order & Rule box (shown only for the Civil Procedure Code) */
.as-cpc { margin: 4px 0 14px; padding: 12px; border: 1px solid color-mix(in srgb, #2563eb 30%, var(--line)); border-radius: 12px; background: color-mix(in srgb, #2563eb 5%, var(--surface)); }
.as-cpc .as-step { margin-top: 0; }
.as-cpc-tag { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #2563eb; color: #fff; font: 700 10.5px var(--sans); letter-spacing: .03em; vertical-align: 1px; }
.as-cpc .as-chips { margin-top: 4px; }
.as-cpc .as-chips button { padding: 4px 9px; font-size: 12px; }
.as-cpc-or { margin: 10px 0 0; font: 600 11.5px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.as-alt { display: block; margin: 8px auto 0; font-size: 13px; }
