*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    --lg-canvas: #f4f4f5;
    --lg-surface: #ffffff;
    --lg-field: #f3f4f6;
    --lg-accent: var(--primary, #4d5e3f);
    --lg-accent-rgb: var(--primary-rgb, 77, 94, 63);
    --lg-notch-r: 2.25rem;
    font-family: var(--font-app, Alexandria, Tajawal, Cairo, sans-serif);
    background: var(--lg-canvas);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] body {
    --lg-canvas: #0c0c10;
    --lg-surface: #16161b;
    --lg-field: #212128;
}

.lg-page {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lg-shell {
    width: 100%;
    max-width: 78rem;
    min-height: min(52rem, calc(100svh - 2rem));
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
    gap: 2.5rem;
    padding: 2.75rem;
    background: var(--lg-surface);
    border-radius: 2rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 24px 60px -32px rgba(16, 24, 40, .18);
}

.lg-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem .5rem;
}
.lg-form-wrap { width: 100%; max-width: 27rem; min-width: 0; }

.lg-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .875rem;
    margin-bottom: 2.25rem;
}
.lg-brand-mark {
    width: 3.75rem;
    height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lg-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.lg-brand-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: var(--lg-accent);
    color: #fff;
    font-size: 1.625rem;
    font-weight: 800;
}
.lg-brand-name {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--lg-accent);
}
:root[data-theme="dark"] .lg-brand-name { color: var(--foreground); }

.lg-head { text-align: center; margin-bottom: 2rem; }
.lg-title {
    margin: 0 0 .5rem;
    font-size: clamp(1.75rem, 2.6vw, 2.375rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
    color: var(--foreground);
}
.lg-sub { margin: 0; font-size: .9375rem; color: var(--muted-foreground); }

.lg-alert { margin-bottom: 1.25rem; }

.lg-form { display: flex; flex-direction: column; gap: 1rem; }

.lg-fld {
    position: relative;
    display: block;
    background: var(--lg-field);
    border: 1px solid transparent;
    border-radius: .625rem;
    padding: .625rem 1rem .5rem;
    cursor: text;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.lg-fld:focus-within {
    background: var(--lg-surface);
    border-color: var(--lg-accent);
    box-shadow: 0 0 0 3px rgba(var(--lg-accent-rgb), .14);
}
.lg-fld.is-invalid { border-color: var(--destructive, #dc2626); }
.lg-fld-label {
    display: block;
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--muted-foreground);
}
.lg-fld input {
    display: block;
    width: 100%;
    margin: .125rem 0 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: .9375rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--foreground);
}
.lg-fld input::placeholder { color: var(--muted-foreground); opacity: .55; font-weight: 400; }
.lg-fld input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 40px var(--lg-field) inset;
    -webkit-text-fill-color: var(--foreground);
}
.lg-fld:focus-within input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--lg-surface) inset; }
.lg-fld-pw input { padding-inline-end: 2.25rem; }
.lg-pw-toggle {
    position: absolute;
    inset-inline-end: .75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: .5rem;
    background: none;
    color: var(--muted-foreground);
    cursor: pointer;
}
.lg-pw-toggle:hover { color: var(--foreground); }
.lg-pw-toggle svg { width: 1.125rem; height: 1.125rem; }

.lg-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: -.125rem;
}
.lg-remember {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--foreground);
}
.lg-remember label { cursor: pointer; user-select: none; }
.lg-forgot {
    font-size: .875rem;
    font-weight: 500;
    color: var(--foreground);
    text-decoration: underline;
    text-underline-offset: 4px;
}
.lg-forgot:hover { color: var(--lg-accent); }

.lg-submit {
    height: 3.125rem;
    margin-top: .5rem;
    border: 0;
    border-radius: .625rem;
    background: var(--lg-accent);
    color: var(--primary-foreground, #fff);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s ease, box-shadow .15s ease, transform .1s ease;
}
.lg-submit:hover { filter: brightness(1.08); box-shadow: 0 10px 24px -12px rgba(var(--lg-accent-rgb), .7); }
.lg-submit:active { transform: translateY(1px); }
.lg-submit:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(var(--lg-accent-rgb), .3); }

.lg-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.lg-submit svg { width: 1.125rem; height: 1.125rem; }
.lg-submit:disabled { opacity: .7; cursor: progress; filter: none; box-shadow: none; }
.lg-spin { animation: lg-spin 1s linear infinite; }
@keyframes lg-spin { to { transform: rotate(360deg); } }

.lg-note {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    font-size: .8125rem;
    line-height: 1.7;
    color: var(--muted-foreground);
}
.lg-note svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    margin-top: .1875rem;
    color: var(--lg-accent);
}
:root[data-theme="dark"] .lg-note svg { color: var(--foreground); }

.lg-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin: -.75rem 0 1.75rem;
}
.lg-step {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--muted-foreground);
}
.lg-step b {
    width: 1.375rem;
    height: 1.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--lg-field);
    font-size: .6875rem;
    font-weight: 600;
}
.lg-step.is-current { color: var(--foreground); }
.lg-step.is-current b { background: var(--lg-accent); color: var(--primary-foreground, #fff); }
.lg-step-sep { width: 1.25rem; height: 1px; background: var(--border); }

.lg-sub-strong {
    display: inline-block;
    font-weight: 600;
    color: var(--foreground);
}
.lg-step.is-done b { background: rgba(var(--lg-accent-rgb), .14); color: var(--lg-accent); }
:root[data-theme="dark"] .lg-step.is-done b { color: var(--foreground); }

.lg-otp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    direction: ltr;
}
.lg-otp-cell {
    flex: 1 1 0;
    min-width: 0;
    max-width: 3.5rem;
    height: 3.75rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: .75rem;
    background: var(--lg-field);
    color: var(--foreground);
    font: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    outline: 0;
    caret-color: var(--lg-accent);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.lg-otp-cell:focus {
    background: var(--lg-surface);
    border-color: var(--lg-accent);
    box-shadow: 0 0 0 3px rgba(var(--lg-accent-rgb), .14);
}
.lg-otp-cell.is-filled { background: var(--lg-surface); border-color: rgba(var(--lg-accent-rgb), .45); }
.lg-otp-cell.is-error { border-color: var(--destructive, #dc2626); animation: lg-shake .35s ease; }
.lg-otp-sep { flex: 0 0 .625rem; height: 2px; border-radius: 2px; background: var(--border); }
@keyframes lg-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.lg-timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}
.lg-timer {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}
.lg-timer svg { width: 1rem; height: 1rem; color: var(--lg-accent); }
:root[data-theme="dark"] .lg-timer svg { color: var(--foreground); }
.lg-timer.is-expired, .lg-timer.is-expired svg { color: var(--destructive, #dc2626); }
.lg-textbtn {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    color: var(--foreground);
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}
.lg-textbtn:hover:not(:disabled) { color: var(--lg-accent); }
.lg-textbtn:disabled { color: var(--muted-foreground); text-decoration: none; cursor: not-allowed; opacity: .7; }

.lg-dev {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border: 1px dashed var(--border);
    border-radius: .625rem;
    font-size: .8125rem;
    color: var(--muted-foreground);
    direction: ltr;
}
.lg-dev b { color: var(--foreground); letter-spacing: .25em; font-variant-numeric: tabular-nums; }

.lg-strength { display: flex; align-items: center; gap: .75rem; margin-top: -.375rem; min-height: 1.25rem; }
.lg-strength-bar { flex: 1; height: 4px; border-radius: 4px; background: var(--lg-field); overflow: hidden; }
.lg-strength-fill { width: 0; height: 100%; border-radius: inherit; transition: width .25s ease, background-color .25s ease; }
.lg-strength-label { margin: 0; flex-shrink: 0; font-size: .75rem; font-weight: 600; }
.lg-match { margin: -.375rem 0 0; min-height: 1.125rem; font-size: .75rem; font-weight: 600; }
.lg-match:empty { display: none; }

.lg-foot {
    margin-top: 1.75rem;
    text-align: center;
    font-size: .9375rem;
    color: var(--foreground);
}
.lg-foot a {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    color: var(--lg-accent);
    font-weight: 500;
    text-decoration: none;
}
:root[data-theme="dark"] .lg-foot a { color: var(--foreground); }
.lg-foot a:hover { text-decoration: underline; text-underline-offset: 4px; }
.lg-foot svg { width: 1rem; height: 1rem; }
.lg-copy { margin: .75rem 0 0; font-size: .75rem; color: var(--muted-foreground); }

.lg-hero {
    position: relative;
    min-height: 36rem;
    isolation: isolate;
}
.lg-hero-media {
    position: absolute;
    inset: 0;
    border-radius: var(--lg-notch-r);
    border-start-start-radius: 0;
    border-end-end-radius: 0;
    overflow: hidden;
    background:
        radial-gradient(60% 50% at 30% 20%, rgba(255, 255, 255, .18), transparent 70%),
        linear-gradient(160deg, rgba(var(--lg-accent-rgb), .85), rgba(var(--lg-accent-rgb), 1));
}
.lg-hero-pattern {
    position: absolute;
    inset: 0;
    background-size: 320px 320px;
    opacity: .14;
    filter: brightness(3);
}
.lg-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    z-index: 0;
}
.lg-hero-media::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(10, 12, 10, .7) 0%, rgba(10, 12, 10, .22) 26%, transparent 42%);
    pointer-events: none;
}
.lg-hero-caption {
    position: absolute;
    z-index: 2;
    inset-inline-start: 2.25rem;
    inset-inline-end: calc(var(--lg-notch-w2) + 1.5rem);
    bottom: 2.25rem;
    color: #fff;
}
.lg-hero-caption h2 {
    margin: 0 0 .5rem;
    font-size: clamp(1.25rem, 1.9vw, 1.75rem);
    font-weight: 700;
    line-height: 1.45;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
.lg-hero-caption p {
    margin: 0;
    font-size: .9375rem;
    line-height: 1.7;
    opacity: .88;
}

.lg-hero {
    --lg-notch-w1: 8rem;
    --lg-notch-h1: 6.5rem;
    --lg-notch-w2: 8.25rem;
    --lg-notch-h2: 6rem;
}
.lg-notch {
    position: absolute;
    z-index: 3;
    background: var(--lg-surface);
}
.lg-notch::before,
.lg-notch::after {
    content: '';
    position: absolute;
    width: var(--lg-notch-r);
    height: var(--lg-notch-r);
}
.lg-notch-top {
    top: -2px;
    inset-inline-start: -2px;
    width: calc(var(--lg-notch-w1) + 2px);
    height: calc(var(--lg-notch-h1) + 2px);
    border-end-end-radius: var(--lg-notch-r);
}
.lg-notch-top::before {
    top: 0;
    inset-inline-start: 100%;
    background: radial-gradient(circle at var(--lg-in-end) 100%, transparent calc(var(--lg-notch-r) - .5px), var(--lg-surface) var(--lg-notch-r));
}
.lg-notch-top::after {
    top: 100%;
    inset-inline-start: 0;
    background: radial-gradient(circle at var(--lg-in-end) 100%, transparent calc(var(--lg-notch-r) - .5px), var(--lg-surface) var(--lg-notch-r));
}
.lg-notch-bottom {
    bottom: -2px;
    inset-inline-end: -2px;
    width: calc(var(--lg-notch-w2) + 2px);
    height: calc(var(--lg-notch-h2) + 2px);
    border-start-start-radius: var(--lg-notch-r);
}
.lg-notch-bottom::before {
    bottom: 0;
    inset-inline-end: 100%;
    background: radial-gradient(circle at var(--lg-in-start) 0, transparent calc(var(--lg-notch-r) - .5px), var(--lg-surface) var(--lg-notch-r));
}
.lg-notch-bottom::after {
    bottom: 100%;
    inset-inline-end: 0;
    background: radial-gradient(circle at var(--lg-in-start) 0, transparent calc(var(--lg-notch-r) - .5px), var(--lg-surface) var(--lg-notch-r));
}
[dir="rtl"] .lg-hero { --lg-in-start: 100%; --lg-in-end: 0; }
[dir="ltr"] .lg-hero { --lg-in-start: 0; --lg-in-end: 100%; }

@media (max-width: 1100px) {
    .lg-shell { gap: 1.75rem; padding: 2rem; }
    .lg-hero { --lg-notch-w1: 6.5rem; --lg-notch-h1: 5.25rem; --lg-notch-w2: 6.5rem; --lg-notch-h2: 5rem; --lg-notch-r: 1.75rem; }
}

@media (max-width: 900px) {
    .lg-page { padding: 0; align-items: stretch; }
    .lg-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        min-height: 100svh;
        padding: 1rem 1rem 2rem;
        border-radius: 0;
        box-shadow: none;
    }
    .lg-hero {
        order: -1;
        min-height: 13rem;
        max-height: 30svh;
    }
    .lg-hero-media { border-radius: 1.5rem; }
    .lg-notch, .lg-hero-caption p { display: none; }
    .lg-hero-caption { inset-inline: 1.25rem; bottom: 1rem; }
    .lg-hero-caption h2 { margin: 0; font-size: 1.125rem; }
    .lg-side { padding: 1.75rem 0 0; }
    .lg-brand { margin-bottom: 1.5rem; }
    .lg-brand-mark { width: 3rem; height: 3rem; }
    .lg-brand-name { font-size: 1.125rem; }
    .lg-head { margin-bottom: 1.5rem; }
}

.lg-channels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .25rem;
    padding: .25rem;
    border-radius: .75rem;
    background: var(--lg-field);
}
.lg-channel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-width: 0;
    height: 2.75rem;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.lg-channel input { position: absolute; opacity: 0; pointer-events: none; }
.lg-channel svg { width: 1.0625rem; height: 1.0625rem; flex-shrink: 0; }
.lg-channel span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-channel:hover { color: var(--foreground); }
.lg-channel:has(input:checked) {
    background: var(--lg-surface);
    color: var(--foreground);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
}
.lg-channel:has(input:checked) svg { color: var(--lg-accent); }
:root[data-theme="dark"] .lg-channel:has(input:checked) svg { color: var(--foreground); }
.lg-channel:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(var(--lg-accent-rgb), .3); }

.lg-altbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 2.75rem;
    border: 1px solid var(--border);
    border-radius: .625rem;
    background: transparent;
    color: var(--foreground);
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.lg-altbtn:hover:not(:disabled) { background: var(--lg-field); }
.lg-altbtn:disabled { color: var(--muted-foreground); cursor: not-allowed; opacity: .7; }
.lg-altbtn svg { width: 1rem; height: 1rem; color: var(--lg-accent); }
:root[data-theme="dark"] .lg-altbtn svg { color: var(--foreground); }

.ac-wrap {
    width: 100%;
    max-width: 31rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.ac-wrap .lg-brand { margin-bottom: 1.5rem; }

.ac-card {
    position: relative;
    background: var(--lg-surface);
    border-radius: 1.75rem;
    padding: 2.25rem 2rem 1.75rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 24px 60px -32px rgba(16, 24, 40, .18);
}
:root[data-theme="dark"] .ac-card { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }

.ac-hero { text-align: center; margin-bottom: 1.75rem; }
.ac-hero .lg-title { font-size: clamp(1.5rem, 4.5vw, 1.875rem); }

.ac-status {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.375rem;
    background: var(--lg-field);
    color: var(--destructive, #dc2626);
}
.ac-status svg { width: 2rem; height: 2rem; }

.ag {
    --ag-size: 4.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.25rem .5rem;
    padding: .5rem 0 0;
}
.ag-item {
    position: relative;
    margin: 0;
    width: 6rem;
    animation: ag-in .45s cubic-bezier(.34, 1.56, .64, 1) both;
    animation-delay: calc(var(--i, 0) * 60ms);
}
.ag-item.is-hidden { display: none; }
.ag-item.is-revealed { animation-delay: calc((var(--i, 0) - 3) * 60ms); }
.ag-item > button { width: 100%; }
.ag-item > button, a.ag-item, button.ag-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .625rem;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}
.ag-item :focus-visible, .ag-item:focus-visible { outline: 0; }

.ag-face {
    position: relative;
    width: var(--ag-size);
    height: var(--ag-size);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: transparent;
    color: var(--lg-accent);
    box-shadow: inset 0 0 0 1px var(--border);
    font-size: 1rem;
    font-weight: 700;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease;
}
.ag-face img { width: 100%; height: 100%; object-fit: cover; }
.ag-face svg { width: 1.625rem; height: 1.625rem; }
:root[data-theme="dark"] .ag-face { color: var(--foreground); }

.ag-item:hover .ag-face,
.ag-item:focus-within .ag-face,
.ag-item:focus-visible .ag-face {
    transform: translateY(-.25rem) scale(1.06);
    box-shadow: inset 0 0 0 1.5px rgba(var(--lg-accent-rgb), .6);
}
.ag-item.is-current .ag-face { box-shadow: inset 0 0 0 2px var(--lg-accent); }

.ag-check {
    position: absolute;
    top: calc(var(--ag-size) - 1.375rem);
    inset-inline-start: calc(50% + var(--ag-size) / 2 - 1.375rem);
    width: 1.375rem;
    height: 1.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--lg-accent);
    color: #fff;
    box-shadow: 0 0 0 2px var(--lg-surface);
    pointer-events: none;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.ag-check svg { width: .8125rem; height: .8125rem; stroke-width: 3; }
.ag-item.is-current:hover .ag-check, .ag-item.is-current:focus-visible .ag-check { transform: translateY(-.25rem); }

.ag-more .ag-face {
    color: var(--muted-foreground);
    letter-spacing: .02em;
    direction: ltr;
}
.ag-more:hover .ag-face { color: var(--foreground); }

.ag-label {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .0625rem;
    text-align: center;
    line-height: 1.4;
}
.ag-label b { font-size: .875rem; font-weight: 600; color: var(--foreground); }
.ag-label small {
    max-width: 100%;
    font-size: .75rem;
    color: var(--muted-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ag-label em {
    margin-top: .125rem;
    font-style: normal;
    font-size: .6875rem;
    font-weight: 600;
    color: var(--lg-accent);
}
:root[data-theme="dark"] .ag-label em { color: var(--foreground); }
.ag-item:hover .ag-label b, .ag-item:focus-within .ag-label b { color: var(--lg-accent); }
:root[data-theme="dark"] .ag-item:hover .ag-label b { color: var(--foreground); }

.ag.is-busy .ag-item { pointer-events: none; }
.ag.is-busy .ag-item:not(.is-loading) .ag-face { opacity: .45; }
.ag-spin {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    color: #fff;
}

.ag-hint {
    margin: .875rem 0 0;
    text-align: center;
    font-size: .8125rem;
    color: var(--muted-foreground);
}

@keyframes ag-in {
    from { opacity: 0; transform: translateY(.5rem) scale(.8); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ag-item, .ag-face, .ag-check { animation: none; transition: none; }
}

.ac-facts {
    margin: 0 0 1.25rem;
    padding: .25rem 1.125rem;
    border-radius: 1rem;
    background: var(--lg-field);
}
.ac-fact {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .875rem 0;
    font-size: .875rem;
}
.ac-fact + .ac-fact { border-top: 1px solid var(--border); }
.ac-fact dt {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--muted-foreground);
}
.ac-fact dt svg { width: 1rem; height: 1rem; color: var(--lg-accent); }
:root[data-theme="dark"] .ac-fact dt svg { color: var(--foreground); }
.ac-fact dd {
    margin: 0;
    min-width: 0;
    font-weight: 600;
    color: var(--foreground);
    text-align: end;
    line-height: 1.7;
    overflow-wrap: anywhere;
}
.ac-fact-block { flex-direction: column; gap: .375rem; }
.ac-fact-block dd { text-align: start; font-weight: 500; }

.ac-outline {
    width: 100%;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 1px solid var(--border);
    border-radius: .625rem;
    background: var(--lg-surface);
    color: var(--foreground);
    font: inherit;
    font-size: .9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}
.ac-outline:hover { background: var(--lg-field); }
.ac-outline svg { width: 1.125rem; height: 1.125rem; }

.ac-divider { height: 1px; margin: 1.5rem 0 1.25rem; background: var(--border); }
.ac-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}
.ac-card-foot .lg-note { flex: 1 1 14rem; }
.ac-link {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--foreground);
    text-decoration: none;
    white-space: nowrap;
}
.ac-link:hover { color: var(--destructive, #dc2626); }
.ac-link svg { width: 1rem; height: 1rem; }

.ac-copy { margin-top: 1.25rem; text-align: center; }

@media (max-width: 480px) {
    .lg-page:has(.ac-wrap) { align-items: flex-start; padding: 1.25rem 1rem; }
    .ac-card { padding: 1.75rem 1.125rem 1.375rem; border-radius: 1.375rem; }
    .ag { --ag-size: 3.75rem; gap: 1rem .5rem; }
    .ag-item { width: 5.25rem; }
    .ac-fact { flex-wrap: wrap; }
}
