/* =====================================================================
   Components
   ===================================================================== */

/* ---------- Card ---------- */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 6px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.02rem; }
.card-head a { font-size: .88rem; font-weight: 600; }
.card-body { padding: 8px 16px 16px; }
.card + .card { margin-top: 16px; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 10px; }
.section-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 12px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.5rem; }
.page-head p { margin: 4px 0 0; color: var(--c-text-2); }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--c-surface-3); --b-fg: var(--c-text); --b-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg); font-weight: 650; font-size: .93rem; white-space: nowrap;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
  user-select: none; text-decoration: none !important;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { --b-bg: var(--c-primary); --b-fg: var(--c-on-primary); box-shadow: 0 2px 6px rgba(24, 119, 242, .25); }
.btn-primary:hover { --b-bg: var(--c-primary-600); filter: none; }
.btn-soft { --b-bg: var(--c-primary-50); --b-fg: var(--c-primary); }
.btn-outline { --b-bg: transparent; --b-bd: var(--c-border-strong); }
.btn-outline:hover { --b-bg: var(--c-surface-2); }
.btn-ghost { --b-bg: transparent; }
.btn-ghost:hover { --b-bg: var(--c-surface-3); filter: none; }
.btn-danger { --b-bg: var(--c-error); --b-fg: #fff; }
.btn-danger-soft { --b-bg: var(--c-error-50); --b-fg: var(--c-error); }
.btn-success { --b-bg: var(--c-success); --b-fg: #fff; }
.btn-premium { --b-bg: transparent; background: var(--g-premium); color: #fff; box-shadow: 0 4px 14px rgba(124, 58, 237, .32); }
.btn-premium:hover { filter: brightness(1.05); }
.btn-sm { height: 32px; padding: 0 12px; font-size: .85rem; border-radius: var(--r-xs); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 1rem; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn.is-loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: .86rem; font-weight: 600; color: var(--c-text); }
.field .hint { font-size: .8rem; color: var(--c-text-2); }
.field .error, .field-error { font-size: .8rem; color: var(--c-error); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast); font-size: .95rem;
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--c-primary); box-shadow: var(--ring); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--c-error); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .input { flex: 1; }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--c-border-strong); background: var(--c-surface-3); color: var(--c-text-2); font-weight: 600; }
.input-group .addon:first-child { border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .addon:first-child + .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-group .input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.input-lg { min-height: 50px; font-size: 1rem; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .92rem; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--c-primary); flex: none; }
.radio-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.radio-card { position: relative; border: 1.5px solid var(--c-border-strong); border-radius: var(--r); padding: 12px 14px; cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.radio-card input { position: absolute; opacity: 0; }
.radio-card:has(input:checked) { border-color: var(--c-primary); background: var(--c-primary-50); }
.radio-card:has(input:focus-visible) { box-shadow: var(--ring); }
.otp-inputs { display: flex; gap: 8px; justify-content: center; }
.otp-inputs input { width: 48px; height: 56px; text-align: center; font-size: 1.4rem; font-weight: 700; border-radius: var(--r); border: 1.5px solid var(--c-border-strong); background: var(--c-surface); }
.otp-inputs input:focus { border-color: var(--c-primary); box-shadow: var(--ring); }
@media (max-width: 380px) { .otp-inputs input { width: 42px; height: 50px; } }
.pw-meter { height: 5px; border-radius: 4px; background: var(--c-surface-3); overflow: hidden; }
.pw-meter > i { display: block; height: 100%; width: 0; background: var(--c-error); transition: width var(--t), background var(--t); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 24px; background: var(--c-border-strong); position: relative; transition: background var(--t-fast); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--t) var(--ease); }
.switch input:checked + .track { background: var(--c-primary); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--c-border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .meta { min-width: 0; }
.setting-row .meta strong { display: block; font-weight: 600; }
.setting-row .meta span { font-size: .85rem; color: var(--c-text-2); }

/* ---------- Avatars ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--c-surface-3); flex: none; display: block; }
.avatar-xs { width: 24px; height: 24px; } .avatar-sm { width: 32px; height: 32px; } .avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; } .avatar-xl { width: 96px; height: 96px; } .avatar-2xl { width: 168px; height: 168px; }
.avatar-ring { padding: 2px; background: var(--c-surface); box-shadow: 0 0 0 2px var(--c-primary); }
.avatar-wrap { position: relative; display: inline-block; flex: none; }
.presence { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--c-success); border: 2px solid var(--c-surface); }
.avatar-stack { display: flex; } .avatar-stack .avatar { border: 2px solid var(--c-surface); margin-left: -8px; } .avatar-stack .avatar:first-child { margin-left: 0; }
.verified { display: inline-flex; color: var(--c-primary); vertical-align: -3px; margin-left: 3px; }
.verified .ico { width: 16px; height: 16px; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-full); font-size: .74rem; font-weight: 700; background: var(--c-surface-3); color: var(--c-text-2); white-space: nowrap; }
.badge-primary { background: var(--c-primary-50); color: var(--c-primary); }
.badge-success { background: var(--c-success-50); color: var(--c-success); }
.badge-warning { background: var(--c-warning-50); color: #B45309; }
:root[data-theme="dark"] .badge-warning { color: var(--c-warning); }
.badge-error { background: var(--c-error-50); color: var(--c-error); }
.badge-premium { background: var(--g-premium); color: #fff; }
.badge-outline { background: transparent; border: 1px solid var(--c-border-strong); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-full); background: var(--c-surface-3); color: var(--c-text); font-weight: 600; font-size: .88rem; border: 1px solid transparent; transition: background var(--t-fast); white-space: nowrap; }
.chip:hover { background: var(--c-border); text-decoration: none; }
.chip.active { background: var(--c-primary); color: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 12px 14px; font-weight: 650; color: var(--c-text-2); white-space: nowrap; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.tab:hover { color: var(--c-text); background: var(--c-surface-2); text-decoration: none; }
.tab.active { color: var(--c-primary); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--c-primary); }
.tab .count { font-size: .78rem; color: var(--c-text-3); margin-left: 4px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--c-surface-3); border-radius: var(--r-sm); }
.seg button, .seg a { padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: .86rem; color: var(--c-text-2); }
.seg .active { background: var(--c-surface); color: var(--c-text); box-shadow: var(--sh-1); }

/* ---------- Menus / dropdowns ---------- */
.menu { position: absolute; z-index: 80; min-width: 220px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r); box-shadow: var(--sh-3); padding: 6px; animation: pop var(--t) var(--ease); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm); color: var(--c-text); font-size: .93rem; font-weight: 500; text-align: left; }
.menu-item:hover { background: var(--c-surface-3); text-decoration: none; }
.menu-item .ico { width: 19px; height: 19px; color: var(--c-text-2); }
.menu-item.danger, .menu-item.danger .ico { color: var(--c-error); }
.menu-sep { height: 1px; background: var(--c-border); margin: 6px 4px; }
.menu-head { padding: 8px 10px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Modal / sheet ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: var(--c-overlay); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade var(--t) ease; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--c-surface); border-radius: var(--r-xl); box-shadow: var(--sh-3); animation: rise var(--t) var(--ease); overflow: hidden; }
.modal-lg { max-width: 760px; } .modal-sm { max-width: 400px; } .modal-xl { max-width: 1000px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--c-border); }
.modal-head h2 { margin: 0; font-size: 1.1rem; flex: 1; text-align: center; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--c-border); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; padding-bottom: var(--safe-b); animation: sheet var(--t) var(--ease); }
  .modal.modal-full-mobile { height: 100vh; max-height: 100vh; border-radius: 0; }
  .modal-head::before { content: ""; position: absolute; left: 50%; top: 6px; transform: translateX(-50%); width: 38px; height: 4px; border-radius: 4px; background: var(--c-border-strong); }
  .modal-head { position: relative; padding-top: 18px; }
  .menu.as-sheet { position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 12px 10px calc(12px + var(--safe-b)); animation: sheet var(--t) var(--ease); min-width: 0; }
  .menu.as-sheet .menu-item { padding: 13px 12px; font-size: 1rem; }
}
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; z-index: 300; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--c-ink); color: var(--c-surface); box-shadow: var(--sh-3); font-weight: 500; font-size: .93rem; animation: rise var(--t) var(--ease); }
:root[data-theme="dark"] .toast { background: #F1F5F9; color: #0F172A; }
.toast .ico { width: 20px; height: 20px; }
.toast.success .ico { color: #4ADE80; } .toast.error .ico { color: #F87171; } .toast.warning .ico { color: #FBBF24; }
.toast a { color: inherit; font-weight: 700; text-decoration: underline; margin-left: auto; }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: all var(--t); }

/* ---------- Alerts / callouts ---------- */
.alert, .callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: .92rem; border: 1px solid transparent; }
.alert .ico, .callout .ico { width: 20px; height: 20px; margin-top: 1px; }
.alert-info, .callout-info { background: var(--c-info-50); color: var(--c-text); border-color: color-mix(in srgb, var(--c-info) 25%, transparent); }
.alert-success, .callout-success { background: var(--c-success-50); border-color: color-mix(in srgb, var(--c-success) 25%, transparent); }
.alert-warning, .callout-warning { background: var(--c-warning-50); border-color: color-mix(in srgb, var(--c-warning) 30%, transparent); }
.alert-error, .callout-error { background: var(--c-error-50); border-color: color-mix(in srgb, var(--c-error) 25%, transparent); }
.alert-info .ico { color: var(--c-info); } .alert-success .ico { color: var(--c-success); } .alert-warning .ico { color: var(--c-warning); } .alert-error .ico { color: var(--c-error); }
.callout { display: block; margin-bottom: 16px; }

/* ---------- Empty / skeleton ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--c-text-2); }
.empty-ico { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--c-primary-50); color: var(--c-primary); }
.empty-ico .ico { width: 30px; height: 30px; }
.empty h3 { color: var(--c-text); margin-bottom: 6px; }
.skeleton { position: relative; overflow: hidden; background: var(--c-surface-3); border-radius: var(--r-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); animation: shimmer 1.3s infinite; }
:root[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; margin: 8px 0; } .sk-circle { border-radius: 50%; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--c-primary-100); border-top-color: var(--c-primary); animation: spin .8s linear infinite; margin: 20px auto; }
.load-more-sentinel { height: 1px; }

/* ---------- People / list rows ---------- */
.row-item { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--r); color: var(--c-text); min-width: 0; }
a.row-item:hover, .row-item.hoverable:hover { background: var(--c-surface-3); text-decoration: none; }
.row-item .meta { flex: 1; min-width: 0; }
.row-item .name { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text); }
.row-item .sub { font-size: .83rem; color: var(--c-text-2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card { text-align: center; padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.person-card .avatar { width: 84px; height: 84px; margin-bottom: 4px; }
.person-card .name { font-weight: 700; color: var(--c-text); }
.person-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.list-divided > * + * { border-top: 1px solid var(--c-border); }

/* ---------- Stats ---------- */
.stat { padding: 16px; }
.stat-label { font-size: .82rem; color: var(--c-text-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; color: var(--c-text); }
.stat-delta { font-size: .8rem; font-weight: 700; margin-top: 2px; }
.stat-delta.up { color: var(--c-success); } .stat-delta.down { color: var(--c-error); }
.stat-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--c-primary-50); color: var(--c-primary); }
.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-text-2); font-weight: 700; padding: 10px 12px; background: var(--c-surface-2); border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--c-surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pagination { display: flex; gap: 6px; justify-content: center; padding: 14px; flex-wrap: wrap; }

/* ---------- Charts (inline SVG) ---------- */
.chart { width: 100%; height: 220px; }
.chart .grid-line { stroke: var(--c-border); stroke-width: 1; }
.chart .axis-label { fill: var(--c-text-3); font-size: 11px; }
.chart .area { fill: var(--c-primary); opacity: .12; }
.chart .line { fill: none; stroke: var(--c-primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.alt { stroke: var(--c-premium); }
.chart .bar { fill: var(--c-primary); }
.chart .bar.alt { fill: var(--c-premium); }
.chart .dot { fill: var(--c-surface); stroke: var(--c-primary); stroke-width: 2; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--c-text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.meter { height: 8px; background: var(--c-surface-3); border-radius: 8px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--c-primary); border-radius: 8px; }

/* ---------- Stepper (registration) ---------- */
.stepper { display: flex; gap: 6px; margin-bottom: 22px; }
.stepper i { flex: 1; height: 5px; border-radius: 5px; background: var(--c-surface-3); transition: background var(--t); }
.stepper i.done { background: var(--c-primary); }
.stepper i.current { background: linear-gradient(90deg, var(--c-primary) 50%, var(--c-primary-100) 50%); }
.step-label { font-size: .8rem; font-weight: 700; color: var(--c-primary); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Divider with text ---------- */
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--c-text-3); font-size: .82rem; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }

/* ---------- Social buttons ---------- */
.btn-social { --b-bg: var(--c-surface); --b-bd: var(--c-border-strong); font-weight: 600; }
.btn-social svg { width: 18px; height: 18px; }

/* ---------- Tooltip ---------- */
[data-tip] { position: relative; }
[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--c-ink); color: var(--c-surface); font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 90; pointer-events: none; }
@media (hover: none) { [data-tip]:hover::after { display: none; } }

/* ---------- Cookie banner ---------- */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 250; max-width: 560px; margin: 0 auto; padding: 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cookie-banner p { margin: 0; flex: 1 1 260px; font-size: .9rem; color: var(--c-text-2); }
body.has-bottombar .cookie-banner { bottom: calc(var(--bottombar-h) + var(--safe-b) + 12px); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(0, 0, 0, .94); display: flex; align-items: center; justify-content: center; animation: fade var(--t); }
.lightbox img, .lightbox video { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lightbox .lb-close, .lightbox .lb-prev, .lightbox .lb-next { position: absolute; color: #fff; background: rgba(255, 255, 255, .12); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.lightbox .lb-close { top: calc(16px + var(--safe-t)); right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; top: calc(22px + var(--safe-t)); left: 50%; transform: translateX(-50%); color: #fff; font-weight: 600; font-size: .9rem; }
