/* ─── legal.css: terms.php and privacy.php ───────────────────────────────────
   Desktop: teal header, then a sticky contents list beside the text.
   Phone: teal header with a rounded bottom, a sticky "Contents" bar that opens a bottom sheet. */

.lg-hero {
    position: relative; overflow: hidden;
    background: var(--grad-hero); color: #fff;
    padding: calc(var(--header-h, 68px) + 48px) 0 72px;
}
.lg-hero::after {
    content: ''; position: absolute; width: 480px; height: 480px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.08); inset-inline-end: -140px; top: -180px; pointer-events: none;
}
.lg-hero-in { position: relative; z-index: 1; max-width: 1100px; }
.lg-eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: 99px; margin-bottom: 14px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
    font-size: 13px; font-weight: 700; color: #F6B48C;
}
.lg-hero h1 { font-size: clamp(1.9rem, 4.4vw, 2.75rem); font-weight: 800; line-height: 1.2; letter-spacing: -.4px; color: #fff; margin: 0 0 8px; }
.lg-updated { font-size: 14px; color: rgba(255,255,255,.7); margin: 0 0 14px; }
.lg-intro { font-size: 16px; line-height: 1.85; color: rgba(255,255,255,.88); margin: 0; max-width: 720px; }
.lg-switch { display: inline-flex; gap: 4px; padding: 4px; margin-top: 22px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); }
.lg-switch a { padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 700; color: rgba(255,255,255,.85); text-decoration: none; transition: background .15s, color .15s; }
.lg-switch a:hover { background: rgba(255,255,255,.12); color: #fff; }
.lg-switch a[aria-current="page"] { background: #fff; color: var(--teal-700); }

.lg-page { background: var(--surface-2); padding: 0 0 72px; }
.lg-layout {
    max-width: 1100px;
    display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start;
}

/* Contents (desktop) */
.lg-side { position: sticky; top: calc(var(--header-h, 68px) + 20px); margin-top: 28px; }
.lg-toc {
    background: var(--surface); border-radius: 20px; box-shadow: var(--e1);
    border: 1px solid rgba(13,55,64,.06);
    padding: 16px 10px; max-height: calc(100vh - var(--header-h, 68px) - 48px); overflow-y: auto;
}
.lg-toc h2 { font-size: 13px; font-weight: 800; color: #66777D; margin: 0 10px 8px; }
.lg-toc ol, .lg-sheet-list { list-style: none; margin: 0; padding: 0; }
.lg-toc a, .lg-sheet-list a {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 10px; border-radius: 10px;
    font-size: 14px; line-height: 1.5; font-weight: 600; color: #3F5157; text-decoration: none;
    transition: background .15s, color .15s;
}
.lg-toc a span, .lg-sheet-list a span {
    flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; margin-top: 0;
    display: grid; place-items: center; background: var(--surface-2); color: #66777D;
    font-size: 11.5px; font-weight: 800;
}
.lg-toc a:hover, .lg-sheet-list a:hover { background: var(--surface-2); color: var(--ink); }
.lg-toc a.is-active, .lg-sheet-list a.is-active { background: var(--teal-50); color: var(--teal-700); }
.lg-toc a.is-active span, .lg-sheet-list a.is-active span { background: var(--teal-500); color: #fff; }

/* Text */
.lg-article {
    margin-top: -40px; position: relative; z-index: 2;
    background: var(--surface); border-radius: 24px; box-shadow: var(--e2);
    padding: 12px 40px 36px;
}
.lg-toc-btn { display: none; }
.lg-sec { padding: 28px 0 4px; border-bottom: 1px solid rgba(13,55,64,.07); scroll-margin-top: calc(var(--header-h, 68px) + 20px); }
.lg-sec:last-child { border-bottom: 0; }
.lg-sec h2 { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; font-weight: 800; color: var(--ink); margin: 0 0 12px; line-height: 1.4; }
.lg-num {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--orange-50); color: var(--orange-d); font-size: 14px; font-weight: 800;
}
.lg-sec p, .lg-sec li { font-size: 15.5px; line-height: 1.9; color: #2C4047; }
.lg-sec p { margin: 0 0 14px; }
.lg-sec ul { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 8px; }
.lg-sec li { position: relative; padding-inline-start: 22px; }
.lg-sec li::before { content: ''; position: absolute; inset-inline-start: 4px; top: .8em; width: 7px; height: 7px; border-radius: 2px; background: var(--teal-500); }
.lg-sec a { color: var(--teal-600); font-weight: 700; }

.lg-sec--contact { background: var(--teal-50); border-radius: 18px; padding: 22px; margin-top: 24px; border: 0; }
.lg-contact { margin-top: 6px; }
.lg-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 0 20px; border-radius: 14px;
    background: #1DA851; color: #fff !important; font-size: 15px; font-weight: 700; text-decoration: none;
    box-shadow: 0 6px 16px rgba(29,168,81,.28); transition: filter .15s, transform .12s;
}
.lg-btn:hover { filter: brightness(1.06); }
.lg-btn:active { transform: scale(.97); }

.lg-page a:focus-visible, .lg-hero a:focus-visible, .lg-toc-btn:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; border-radius: 6px; }

/* Bottom sheet list spacing (sheet styles come from app.css) */
.lg-sheet-list a { padding: 11px 10px; font-size: 15px; }
.lg-sheet .sheet-handle + h3 { margin-top: 0; }

/* ── Phone ─────────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .lg-layout { grid-template-columns: minmax(0, 1fr); }
    .lg-side { display: none; }
}
@media (max-width: 768px) {
    .lg-hero { padding: calc(var(--appbar-h, 56px) + 24px) 0 64px; border-radius: 0 0 28px 28px; }
    .lg-intro { font-size: 15px; }
    .lg-switch { display: flex; margin-top: 18px; }
    .lg-switch a { flex: 1; text-align: center; }
    .lg-page { padding-bottom: 32px; }
    .lg-layout { padding: 0 12px; }
    .lg-article { margin-top: -36px; padding: 0 18px 22px; border-radius: 20px; }

    .lg-toc-btn {
        position: sticky; top: calc(var(--appbar-h, 56px) + 8px); z-index: 5;
        display: flex; align-items: center; gap: 8px; width: calc(100% + 16px);
        margin: -24px -8px 0; padding: 0 14px; min-height: 48px;
        background: var(--surface); border: 1px solid rgba(13,55,64,.08); border-radius: 14px;
        box-shadow: var(--e2);
        font: inherit; font-size: 14px; font-weight: 800; color: var(--teal-700); cursor: pointer;
    }
    .lg-toc-btn b { flex: 1; min-width: 0; font-weight: 600; color: #5A6B71; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: start; }
    .lg-toc-btn b:not(:empty)::before { content: '·'; margin-inline-end: 6px; color: #A0AEB2; }
    .lg-toc-chev { margin-inline-start: auto; flex-shrink: 0; }
    .lg-toc-btn:active { transform: scale(.98); }
    .lg-sec:first-of-type { padding-top: 18px; }
    .lg-sec { scroll-margin-top: calc(var(--appbar-h, 56px) + 72px); padding-top: 22px; }
    .lg-sec h2 { font-size: 1.1rem; }
    .lg-sec p, .lg-sec li { font-size: 15px; line-height: 1.85; }
    .lg-sec--contact { padding: 18px; }
    .lg-btn { width: 100%; }
}

@media print {
    .lg-hero { background: none; color: #000; padding: 0; }
    .lg-hero h1, .lg-intro, .lg-updated { color: #000; }
    .lg-switch, .lg-side, .lg-toc-btn, .lg-contact, .lg-sheet, .lg-sheet-bd { display: none !important; }
    .lg-article { box-shadow: none; margin: 0; padding: 0; }
}
