/* ═══════════════════════════════════════════════════════════════════════
   Legal pages (/legal/…): loaded after fibre.css.
   Compact dark header, sticky contents list and document links, readable
   clause layout with linkable clause numbers, label/value rows, print styles.
   ═══════════════════════════════════════════════════════════════════════ */

.lg-hero.lg-hero { padding: 40px 0 52px; }
.lg-hero .fh-hero-bg { background: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 44px 44px, linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 44px 44px, #0a0a0a; }
.lg-hero-row { display: flex; align-items: center; gap: 20px; }
.lg-hero-icon { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, #d82633, #99151c); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 14px 34px rgba(216,38,51,0.35); }
.lg-hero-icon svg { width: 28px; height: 28px; }
.lg-h1 { color: #fff; font-weight: 900; font-size: clamp(30px, 4.4vw, 50px); line-height: 1.08; margin-bottom: 10px; }
.lg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: rgba(255,255,255,0.6); font-size: 14px; }
.lg-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.lg-meta svg { width: 15px; height: 15px; color: #ff4d5a; }
.lg-print { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.18); background: none; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.lg-print:hover { background: rgba(255,255,255,0.08); }

/* ── Layout ── */
.lg-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 56px; align-items: start; }
.lg-side { position: sticky; top: 180px; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 200px); overflow-y: auto; padding-right: 4px; }
.lg-toc { border-radius: 18px; background: #f7f7f8; border: 1px solid #eee; }
.lg-toc summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #111; cursor: pointer; list-style: none; }
.lg-toc summary::-webkit-details-marker { display: none; }
.lg-toc summary svg { width: 16px; height: 16px; color: #d82633; }
.lg-toc .lg-toc-chev { margin-left: auto; color: #9ca3af; transition: transform .25s; }
.lg-toc[open] .lg-toc-chev { transform: rotate(180deg); }
.lg-toc ol { list-style: none; margin: 0; padding: 0 8px 10px; }
.lg-toc a { display: block; padding: 7px 10px; border-radius: 10px; color: #4b5563; font-size: 13.5px; line-height: 1.35; transition: background .15s, color .15s; }
.lg-toc a:hover { background: #fff; color: #111; }
.lg-toc a.is-active { background: #fff; color: #d82633; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.lg-others p { color: #9ca3af; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 8px 6px; }
.lg-others ul { list-style: none; margin: 0; padding: 0; }
.lg-others a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; color: #4b5563; font-size: 14px; font-weight: 600; }
.lg-others a:hover { background: #f7f7f8; color: #111; }
.lg-others a[aria-current] { color: #d82633; background: rgba(216,38,51,0.06); }
.lg-others svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Document ── */
.lg-doc { max-width: 820px; color: #374151; font-size: 15.5px; line-height: 1.75; min-width: 0; overflow-wrap: break-word; }
.lg-doc a { color: #d82633; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.lg-lead { font-size: 18px; color: #4b5563; margin-bottom: 28px; }
.lg-sec { padding: 6px 0 22px; scroll-margin-top: 180px; }
.lg-sec + .lg-sec { border-top: 1px solid #f0f0f0; padding-top: 28px; }
.lg-doc h2 { display: flex; align-items: baseline; gap: 12px; color: #111; font-size: clamp(21px, 2.4vw, 26px); font-weight: 800; line-height: 1.25; margin-bottom: 14px; }
.lg-h-num { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; background: rgba(216,38,51,0.1); color: #d82633; font-size: 16px; font-weight: 800; flex-shrink: 0; transform: translateY(-2px); }
.lg-doc h3 { color: #111; font-size: 18px; font-weight: 800; margin: 22px 0 8px; }
.lg-doc h4 { color: #374151; font-size: 15px; font-weight: 800; margin: 16px 0 6px; }
.lg-doc > .lg-sec > p:not(.lg-clause) { margin-bottom: 12px; }
.lg-clause { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px; margin-bottom: 10px; scroll-margin-top: 190px; border-radius: 10px; }
.lg-clause.d2 { margin-left: 28px; }
.lg-clause.d3 { margin-left: 56px; }
.lg-clause.d2, .lg-clause.d3 { grid-template-columns: 72px minmax(0, 1fr); }
.lg-num { color: #9ca3af; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none !important; padding-top: 2px; }
.lg-num:hover { color: #d82633; }
.lg-clause:target { background: rgba(216,38,51,0.07); box-shadow: 0 0 0 8px rgba(216,38,51,0.07); }
.lg-list { list-style: none; margin: 4px 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lg-list li { position: relative; padding-left: 22px; }
.lg-list li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: #d82633; }
.lg-kv { margin: 6px 0 16px; border-radius: 14px; border: 1px solid #eee; overflow: hidden; }
.lg-kv div { display: grid; grid-template-columns: minmax(150px, 34%) minmax(0, 1fr); gap: 16px; padding: 11px 16px; }
.lg-kv div + div { border-top: 1px solid #f0f0f0; }
.lg-kv div:nth-child(odd) { background: #fafafa; }
.lg-kv dt { color: #111; font-weight: 700; font-size: 14.5px; }
.lg-kv dd { font-size: 14.5px; line-height: 1.6; }
.lg-help { display: flex; align-items: flex-start; gap: 16px; margin-top: 32px; padding: 22px 24px; border-radius: 20px; background: #f7f7f8; border: 1px solid #eee; }
.lg-help h2 { font-size: 18px !important; margin-bottom: 4px !important; }
.lg-help p { font-size: 14.5px; line-height: 1.6; }

/* ── Hub cards ── */
.lg-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lg-card { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: 20px; background: #fff; border: 1px solid #eee; box-shadow: 0 10px 30px rgba(0,0,0,0.05); transition: transform .2s, box-shadow .2s, border-color .2s; }
.lg-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0,0,0,0.09); border-color: rgba(216,38,51,0.3); }
.lg-card-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lg-card-txt strong { color: #111; font-size: 17px; font-weight: 800; }
.lg-card-txt span { color: #6b7280; font-size: 14px; line-height: 1.5; }
.lg-card-go { width: 18px; height: 18px; color: #d82633; flex-shrink: 0; }

/* ── Dark theme ── */
[data-theme="dark"] .lg-doc, [data-theme="dark"] .lg-kv dd, [data-theme="dark"] .lg-lead { color: rgba(255,255,255,0.72); }
[data-theme="dark"] .lg-doc h2, [data-theme="dark"] .lg-doc h3, [data-theme="dark"] .lg-kv dt, [data-theme="dark"] .lg-toc summary, [data-theme="dark"] .lg-card-txt strong { color: #fff; }
[data-theme="dark"] .lg-doc h4 { color: rgba(255,255,255,0.85); }
[data-theme="dark"] .lg-toc, [data-theme="dark"] .lg-help, [data-theme="dark"] .lg-card { background: #16171d; border-color: rgba(255,255,255,0.07); box-shadow: none; }
[data-theme="dark"] .lg-toc a, [data-theme="dark"] .lg-others a, [data-theme="dark"] .lg-card-txt span { color: rgba(255,255,255,0.65); }
[data-theme="dark"] .lg-toc a:hover, [data-theme="dark"] .lg-toc a.is-active, [data-theme="dark"] .lg-others a:hover { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .lg-toc a.is-active, [data-theme="dark"] .lg-others a[aria-current] { color: #ff4d5a; }
[data-theme="dark"] .lg-sec + .lg-sec, [data-theme="dark"] .lg-kv, [data-theme="dark"] .lg-kv div + div { border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .lg-kv div:nth-child(odd) { background: rgba(255,255,255,0.03); }

/* ── Tablets and phones ── */
@media (max-width: 1023px) {
    .lg-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .lg-side { position: static; max-height: none; overflow: visible; padding: 0; }
    .lg-others { display: none; }
    .lg-sec, .lg-clause { scroll-margin-top: 96px; }
    .lg-doc { max-width: none; }
}
@media (max-width: 767px) {
    .lg-hero.lg-hero { padding: 22px 0 32px; }
    .lg-hero-row { align-items: flex-start; gap: 14px; }
    .lg-hero-icon { width: 48px; height: 48px; border-radius: 14px; }
    .lg-hero-icon svg { width: 22px; height: 22px; }
    .lg-h1 { font-size: 28px; }
    .lg-meta { font-size: 13px; }
    .lg-body.py-16 { padding-top: 28px; padding-bottom: 40px; }
    .lg-doc { font-size: 15px; line-height: 1.7; }
    .lg-lead { font-size: 16.5px; }
    .lg-doc h2 { font-size: 20px; gap: 10px; }
    .lg-h-num { min-width: 30px; height: 30px; font-size: 14px; }
    .lg-clause, .lg-clause.d2, .lg-clause.d3 { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .lg-clause.d2 { margin-left: 12px; }
    .lg-clause.d3 { margin-left: 24px; }
    .lg-num { padding: 0; font-size: 12.5px; }
    .lg-kv div { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 11px 14px; }
    .lg-help { padding: 18px; flex-direction: column; gap: 12px; }
    .lg-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .lg-card { padding: 18px; }
}

/* ── Print: just the document ── */
@media print {
    #header, header, footer, #footer, #chat-launcher, .lg-side, .lg-help, .lg-print, .fh-crumbs, .lg-hero-icon { display: none !important; }
    .lg-hero.lg-hero, .lg-hero .fh-hero-bg { background: none !important; padding: 0 0 12px; }
    .lg-h1, .lg-meta { color: #000 !important; }
    .lg-grid { display: block; }
    .lg-doc { max-width: none; font-size: 11pt; color: #000; }
    .lg-sec { break-inside: auto; }
    .lg-clause:target { background: none; box-shadow: none; }
}

/* Light mode: small grey labels darkened to #6b7280 for readable contrast (4.8:1 on white; was 2.5:1). Dark mode unchanged. Page audit, 3 Dec 2026 */
:root:not([data-theme="dark"]) .lg-others p { color: #6b7280; }
