/* Bare Acts page (acts.html) — uses the app's colours from styles.css and the table/pager look from library.css */
.ba-hero { padding: 6px 0 18px; }
.ba-hero h1 { margin: 0; font: 700 30px var(--serif); color: var(--ink); }
.ba-hero > p { margin: 4px 0 16px; color: var(--muted); font-size: 14.5px; max-width: 760px; }
.ba-search { display: flex; align-items: center; gap: 10px; max-width: 760px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.ba-search:focus-within { border-color: #2563eb; box-shadow: 0 0 0 4px color-mix(in srgb, #2563eb 15%, transparent); }
.ba-search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; }
.ba-search input { flex: 1; min-width: 0; padding: 14px 0; border: 0; background: none; font: 16px var(--sans); color: var(--ink); outline: none; }
.ba-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.ba-chips button { padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: 600 13px var(--sans); cursor: pointer; transition: transform .15s, border-color .15s; }
.ba-chips button:hover { border-color: #2563eb; color: #1d4ed8; transform: translateY(-1px); }
.ba-recent { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ba-recent > span { font: 700 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ba-recent .ba-chips { margin-top: 0; }
.ba-recent .ba-chips button { background: var(--brass-soft); border-color: color-mix(in srgb, var(--brass) 35%, transparent); color: var(--ink); }
.ba-types { flex-wrap: wrap; }
.ba-az { display: flex; flex-wrap: wrap; gap: 3px; padding: 10px 14px 0; }
.ba-az button { min-width: 30px; padding: 5px 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ink-2); font: 700 13px var(--sans); cursor: pointer; }
.ba-az button:hover { border-color: var(--line); background: var(--surface-2); }
.ba-az button[aria-pressed="true"] { background: #2563eb; color: #fff; }
.ba-list { list-style: none; margin: 6px 0 0; padding: 0; }
.ba-list li { border-top: 1px solid var(--line); }
.ba-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.ba-list button:hover { background: color-mix(in srgb, #2563eb 5%, var(--surface)); }
.ba-list .ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); font: 700 12px var(--sans); }
.ba-list .nm { flex: 1; min-width: 0; font: 600 15px var(--serif); }
.ba-list .nm small { display: block; margin-top: 2px; font: 500 12px var(--sans); color: var(--muted); }
.ba-list .yr { flex: none; font: 600 12.5px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.ba-list .go { flex: none; color: var(--muted); }
.ba-list mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.ba-list li.busy button { opacity: .6; }
.ba-notext button { cursor: default; opacity: .62; }
.ba-notext button:hover { background: none; }
.ba-notext .nm small { color: #b45309; font-weight: 600; }
.ba-skel { height: 58px; margin: 0 16px; border-top: 1px solid var(--line); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--line) 50%, transparent), transparent) 0 0 / 200% 100%; animation: ba-sk 1.2s linear infinite; }
@keyframes ba-sk { to { background-position: -200% 0; } }

/* reader */
.ba-reader { position: fixed; inset: 0; top: var(--top, 64px); z-index: 30; display: flex; flex-direction: column; background: var(--bg); }
.ba-reader[hidden] { display: none; }
.ba-rbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.ba-rtitle { flex: 1 1 260px; min-width: 0; }
.ba-rtitle b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 17px var(--serif); color: var(--ink); }
.ba-rtitle small { color: var(--muted); font-size: 12.5px; }
.ba-goto { display: flex; gap: 4px; }
.ba-goto input, .ba-find input { width: 130px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: 13.5px var(--sans); color: var(--ink); }
.ba-find { display: flex; align-items: center; gap: 4px; }
.ba-find input { width: 170px; }
.ba-find span { min-width: 44px; text-align: center; font: 600 12px var(--sans); color: var(--muted); }
.ba-tools { display: flex; gap: 4px; }
.ba-toc-btn { display: none; }
.ba-body { flex: 1; min-height: 0; display: flex; }
.ba-toc { width: 320px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); }
.ba-toc input { margin: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: 13.5px var(--sans); color: var(--ink); }
.ba-toc nav { flex: 1; overflow: auto; padding: 0 6px 20px; -webkit-user-select: none; user-select: none; }
.ba-toc details { margin: 2px 0; }
.ba-toc summary { padding: 8px 10px; border-radius: 9px; cursor: pointer; font: 700 12.5px var(--sans); color: #1d4ed8; list-style: none; }
.ba-toc summary::-webkit-details-marker { display: none; }
.ba-toc summary::before { content: "▸"; display: inline-block; width: 14px; transition: transform .2s; }
.ba-toc details[open] > summary::before { transform: rotate(90deg); }
.ba-toc summary small { display: block; margin-left: 14px; font: 600 12px var(--sans); color: var(--ink-2); text-transform: none; }
.ba-toc summary:hover { background: var(--surface-2); }
.ba-toc a { display: flex; gap: 8px; padding: 5px 10px 5px 24px; border-radius: 8px; color: var(--ink-2); font: 13px/1.35 var(--sans); text-decoration: none; }
.ba-toc a b { flex: none; min-width: 38px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ba-toc a:hover { background: var(--surface-2); color: var(--ink); }
.ba-toc a.on { background: color-mix(in srgb, #2563eb 12%, var(--surface)); color: #1d4ed8; }
.ba-toc .top-link { padding-left: 10px; }
.ba-text { position: relative; flex: 1; min-width: 0; }
.ba-text iframe { width: 100%; height: 100%; border: 0; background: var(--surface); }
.ba-loading { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--surface); color: var(--muted); }
.ba-loading b { font: 600 17px var(--serif); color: var(--ink); }
.ba-loading[hidden] { display: none; }
.ba-loading { transition: opacity .35s; }
.ba-loading.out { opacity: 0; }
.ba-wait { max-width: 460px; padding: 0 20px; text-align: center; }
.ba-wait .splash-bar { width: 240px; }
.ba-wait-act { max-width: 420px; font: 600 15px/1.4 var(--serif); color: var(--ink-2); opacity: 0; animation: sp-rise .6s ease-out .65s forwards; }
.ba-wait-sec { min-height: 1em; font: 600 12px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.ba-wait-tip { margin-top: 10px; padding: 9px 14px; border-radius: 12px; background: var(--brass-soft); color: var(--ink-2); font: 13px/1.45 var(--sans); opacity: 0; animation: sp-rise .6s ease-out 1.4s forwards; }
.ba-swap { animation: ba-swap .45s ease-out both !important; opacity: 1; }
@keyframes ba-swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ba-loading .spinner { width: 28px; height: 28px; border-width: 3px; color: var(--accent); }
.ba-toast { position: fixed; left: 50%; bottom: 22px; z-index: 90; transform: translateX(-50%); padding: 10px 18px; border-radius: 12px; background: #0f172a; color: #fff; font: 600 14px var(--sans); box-shadow: var(--shadow-lg); animation: fade .2s; }
.ba-toast.bad { background: var(--danger); }
.acts-page.reading { overflow: hidden; }

@media (max-width: 900px) {
  .ba-toc-btn { display: inline-flex; }
  .ba-toc { position: absolute; z-index: 5; top: 0; bottom: 0; left: 0; width: min(330px, 86vw); box-shadow: var(--shadow-lg); transform: translateX(-105%); transition: transform .25s; }
  .ba-toc.open { transform: none; }
  .ba-body { position: relative; }
  .ba-rtitle { order: -1; flex-basis: 100%; }
  .ba-find input { width: 120px; }
  .ba-goto input { width: 110px; }
}
@media (max-width: 560px) {
  .ba-list .yr { display: none; }
  /* the reader's bar in three short rows: title / buttons / go to + find */
  .ba-rbar { gap: 6px; padding: 8px 10px; }
  .ba-rtitle b { font-size: 15.5px; }
  .ba-rbar .lp-btn { padding: 6px 10px; }
  .ba-tools { margin-left: auto; }
  #fullBtn, #printBtn, #copyLink, #smaller, #bigger { display: none; }
  .ba-goto input { width: 84px; }
  .ba-find .lp-btn { padding: 6px 8px; }
  .ba-goto { order: 5; flex: 0 0 auto; }
  .ba-find { order: 6; flex: 1 1 0; min-width: 0; }
  .ba-find input { width: auto; flex: 1; min-width: 0; }
  .ba-find span { min-width: 0; }
  .ba-hero h1 { font-size: 26px; }
}
@media print {
  .topbar, .ba-rbar, .ba-toc, #browse { display: none !important; }
  .ba-reader { position: static; }
}

/* reading tools, as in the judgment reader */
.ba-ts { position: relative; }
.ba-ts-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; }
.ba-ts-pop[hidden] { display: none; }
.ba-text[data-rt="sepia"] iframe, .ba-text[data-rt="sepia"] .ba-loading { background: #f6eedc; }
.ba-text[data-rt="dark"] iframe { background: #161a22; }
.ba-progress { position: absolute; top: 0; left: 0; right: 0; z-index: 3; height: 3px; background: transparent; pointer-events: none; }
.ba-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--brass)); transition: width .15s; }
.ba-top { position: absolute; right: 22px; bottom: 22px; z-index: 3; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: 600 13px var(--sans); box-shadow: var(--shadow); cursor: pointer; }
.ba-top:hover { border-color: #2563eb; color: #1d4ed8; }
.ba-top[hidden] { display: none; }
.ba-reader:fullscreen { top: 0; }

/* "please wait" while a search runs */
.ba-search { position: relative; }
.ba-search.busy::after { content: ""; width: 18px; height: 18px; flex: none; border: 2.5px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: ba-spin .7s linear infinite; }
@keyframes ba-spin { to { transform: rotate(360deg); } }
.ba-swait { display: flex; align-items: center; gap: 16px; margin: 10px 14px; padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--brass) 35%, transparent); border-radius: 14px; background: var(--brass-soft); animation: fade .2s; }
.ba-swait-ic { width: 54px; height: 54px; flex: none; }
.ba-swait-ic .sp-draw { stroke-width: 4; }
.ba-swait > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ba-swait b { font: 600 15.5px var(--serif); color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.ba-swait span { font: 13px var(--sans); color: var(--muted); }
.ba-swait-bar { display: block; height: 3px; margin-top: 6px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 15%, transparent); overflow: hidden; }
.ba-swait-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; }

/* the top bar's "All Acts" (only while an Act is open) and the Translate menu in the reader */
body:not(.reading) .ba-all-top { display: none; }
.topbar-right:has(.ba-all-top) { display: flex; gap: 8px; align-items: center; }
.ba-lang { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 4px 0 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); font: 600 13px var(--sans); }
.ba-lang:hover, .ba-lang:focus-within { border-color: #2563eb; }
.ba-lang > span { color: #1d4ed8; font-size: 14px; }
.ba-lang select { max-width: 150px; height: 30px; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.ba-lang select:disabled { opacity: .55; cursor: progress; }
@media (max-width: 640px) { .ba-lang select { max-width: 104px; font-size: 12px; } .ba-all-top { padding: 6px 10px; font-size: 12px; } }
