/*
 * AnimeSaturn — Bootstrap 4 / legacy-helper compatibility layer.
 *
 * The redesigned shell no longer loads the legacy 394KB anikoto style.css, but
 * many views and JS-rendered snippets (main.js, comments.js, community, w2g…)
 * still emit Bootstrap 4 markup, and Bootstrap's JS (modal, collapse, tooltip,
 * tab) is still bundled. This file re-implements ONLY the utility and component
 * classes that a scan of resources/views/{frontend,components,layouts,auth} and
 * public/assets/anikoto/js found in use, themed with the --as-* tokens from
 * base.css. Page-specific legacy styles are intentionally not ported.
 */

:root {
    --asc-danger: #ef4444;
    --asc-success: #10b981;
    --asc-warning: #f59e0b;
    --asc-info: #3b82f6;
    --asc-shadow: 0 18px 48px -12px rgba(0, 0, 0, .55);
    --asc-ease: cubic-bezier(.16, 1, .3, 1);
}

[hidden] { display: none !important; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ layout */
.container {
    width: 100%;
    max-width: 1440px;
    margin-inline: auto;
    padding-inline: 24px;
}
@media (max-width: 767.98px) { .container { padding-inline: 14px; } }

.row {
    display: flex;
    flex-wrap: wrap;
    margin-inline: -.5rem;
}
.row > * { position: relative; width: 100%; padding-inline: .5rem; }
.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
.col-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    .offset-sm-3 { margin-left: 25%; }
}
@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .col-md-5 { flex: 0 0 41.6667%; max-width: 41.6667%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-10 { flex: 0 0 83.3333%; max-width: 83.3333%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}
@media (min-width: 992px) {
    .col-lg-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .col-lg-5 { flex: 0 0 41.6667%; max-width: 41.6667%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
}
@media (min-width: 1200px) {
    .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
}

/* ---------------------------------------------------------------- display */
.d-none { display: none !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
}
@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-inline { display: inline !important; }
    .d-md-inline-block { display: inline-block !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}
@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
}

.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-column { flex-direction: column !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-self-center { align-self: center !important; }

.float-left { float: left !important; }
.float-right { float: right !important; }
.float-none { float: none !important; }
.clearfix::after { display: block; clear: both; content: ""; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.overflow-hidden { overflow: hidden !important; }
.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }

.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }
.h-100 { height: 100% !important; }
.mw-100 { max-width: 100% !important; }
.img-fluid { max-width: 100%; height: auto; }

/* ---------------------------------------------------------------- spacing */
.m-0 { margin: 0 !important; }
.mt-0, .my-0 { margin-top: 0 !important; }
.mb-0, .my-0 { margin-bottom: 0 !important; }
.ml-0, .mx-0 { margin-left: 0 !important; }
.mr-0, .mx-0 { margin-right: 0 !important; }
.mt-1, .my-1 { margin-top: .25rem !important; }
.mb-1, .my-1 { margin-bottom: .25rem !important; }
.ml-1, .mx-1 { margin-left: .25rem !important; }
.mr-1, .mx-1 { margin-right: .25rem !important; }
.mt-2, .my-2 { margin-top: .5rem !important; }
.mb-2, .my-2 { margin-bottom: .5rem !important; }
.ml-2, .mx-2 { margin-left: .5rem !important; }
.mr-2, .mx-2 { margin-right: .5rem !important; }
.mt-3, .my-3 { margin-top: 1rem !important; }
.mb-3, .my-3 { margin-bottom: 1rem !important; }
.ml-3, .mx-3 { margin-left: 1rem !important; }
.mr-3, .mx-3 { margin-right: 1rem !important; }
.mt-4, .my-4 { margin-top: 1.5rem !important; }
.mb-4, .my-4 { margin-bottom: 1.5rem !important; }
.ml-4, .mx-4 { margin-left: 1.5rem !important; }
.mr-4, .mx-4 { margin-right: 1.5rem !important; }
.mt-5, .my-5 { margin-top: 3rem !important; }
.mb-5, .my-5 { margin-bottom: 3rem !important; }
.ml-auto, .mx-auto { margin-left: auto !important; }
.mr-auto, .mx-auto { margin-right: auto !important; }
.p-0 { padding: 0 !important; }
.p-1 { padding: .25rem !important; }
.p-2 { padding: .5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }
.pt-0, .py-0 { padding-top: 0 !important; }
.pb-0, .py-0 { padding-bottom: 0 !important; }
.pt-1, .py-1 { padding-top: .25rem !important; }
.pb-1, .py-1 { padding-bottom: .25rem !important; }
.pt-2, .py-2 { padding-top: .5rem !important; }
.pb-2, .py-2 { padding-bottom: .5rem !important; }
.pt-3, .py-3 { padding-top: 1rem !important; }
.pb-3, .py-3 { padding-bottom: 1rem !important; }
.pl-2, .px-2 { padding-left: .5rem !important; }
.pr-2, .px-2 { padding-right: .5rem !important; }
.pl-3, .px-3 { padding-left: 1rem !important; }
.pr-3, .px-3 { padding-right: 1rem !important; }
@media (min-width: 576px) { .mb-sm-0 { margin-bottom: 0 !important; } }
@media (min-width: 768px) {
    .mb-md-0 { margin-bottom: 0 !important; }
    .pt-md-2 { padding-top: .5rem !important; }
}

/* ------------------------------------------------------------- typography */
.h1, .h2, .h3, .h4, .h5, .h6 {
    margin: 0 0 .5rem;
    font-family: "Manrope", "Inter", system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.25;
    color: var(--as-ink);
}
.h1 { font-size: 2rem; } .h2 { font-size: 1.625rem; } .h3 { font-size: 1.375rem; }
.h4 { font-size: 1.175rem; } .h5 { font-size: 1.05rem; } .h6 { font-size: .9375rem; }
.lead { font-size: 1.0625rem; color: var(--as-ink-mute); }
.small, small { font-size: .8125rem; }
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-nowrap { white-space: nowrap !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-muted { color: var(--as-ink-mute) !important; }
.text-gray2 { color: var(--as-ink-dim) !important; }
.text-white { color: #fff !important; }
.text-primary { color: var(--as-brand) !important; }
.text-danger { color: var(--asc-danger) !important; }
.text-success { color: var(--asc-success) !important; }
.text-warning { color: var(--asc-warning) !important; }
.text-info { color: var(--asc-info) !important; }
.font-italic { font-style: italic !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-bold, .fw-bold { font-weight: 700 !important; }
.list-unstyled { padding-left: 0; list-style: none; }
.list-inline { padding-left: 0; list-style: none; }
.list-inline-item { display: inline-block; }
.list-inline-item:not(:last-child) { margin-right: .5rem; }

/* ------------------------------------------------------ borders & surfaces */
.border { border: 1px solid var(--as-border) !important; }
.border-top { border-top: 1px solid var(--as-border) !important; }
.border-bottom { border-bottom: 1px solid var(--as-border) !important; }
.border-left { border-left: 1px solid var(--as-border) !important; }
.border-0 { border: 0 !important; }
.rounded { border-radius: var(--as-r-md) !important; }
.rounded-circle { border-radius: 50% !important; }
.shadow { box-shadow: var(--asc-shadow) !important; }
.bg-secondary { background-color: var(--as-soft) !important; }
.bg-transparent { background-color: transparent !important; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 2.375rem;
    padding: .45rem 1rem;
    font: inherit;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    color: var(--as-ink);
    background: var(--as-soft);
    border: 1px solid var(--as-border);
    border-radius: var(--as-r-md);
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--asc-ease), box-shadow .15s;
}
.btn:hover { color: var(--as-ink); background: var(--as-hover); border-color: var(--as-border-strong); text-decoration: none; }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--as-brand-ring); }
.btn:active { transform: translateY(1px); }
.btn.disabled, .btn:disabled { opacity: .55; pointer-events: none; cursor: default; }
.btn-sm { min-height: 2rem; padding: .3rem .7rem; font-size: .8125rem; border-radius: var(--as-r-sm); }
.btn-lg { min-height: 2.875rem; padding: .65rem 1.4rem; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn-block + .btn-block { margin-top: .5rem; }
.btn-primary, .show > .btn-primary.dropdown-toggle {
    color: #fff;
    background: var(--as-brand);
    border-color: var(--as-brand);
    box-shadow: 0 4px 12px -2px rgba(134, 61, 186, .45);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary.active {
    color: #fff;
    background: var(--as-brand-hover);
    border-color: var(--as-brand-hover);
}
.btn-secondary, .btn-light, .show > .btn-secondary.dropdown-toggle {
    color: var(--as-ink);
    background: var(--as-elev);
    border-color: var(--as-border);
}
.btn-secondary:hover, .btn-light:hover, .btn-secondary.active, .btn-light.active {
    color: var(--as-ink);
    background: var(--as-hover);
    border-color: var(--as-border-strong);
}
.btn-danger { color: #fff; background: var(--asc-danger); border-color: var(--asc-danger); }
.btn-danger:hover { color: #fff; background: #dc2626; border-color: #dc2626; }
.btn-success { color: #fff; background: var(--asc-success); border-color: var(--asc-success); }
.btn-success:hover { color: #fff; filter: brightness(1.08); }
.btn-outline-light { color: var(--as-ink); background: transparent; border-color: var(--as-border-strong); }
.btn-outline-light:hover { color: var(--as-ink); background: var(--as-hover); }
.btn-link { color: var(--as-brand); background: transparent; border-color: transparent; }
.btn-link:hover { color: var(--as-brand-hover); background: transparent; border-color: transparent; }

.close {
    float: right;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    font-size: 1.375rem;
    font-weight: 400;
    line-height: 1;
    color: var(--as-ink-mute);
    background: transparent;
    border: 0;
    border-radius: var(--as-r-sm);
    cursor: pointer;
    opacity: .85;
    transition: background-color .15s, color .15s;
}
.close:hover { color: var(--as-ink); background: var(--as-hover); opacity: 1; }
.close:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--as-brand-ring); }

/* ------------------------------------------------------------------ forms */
.form-group { margin-bottom: 1rem; }
.form-label, .col-form-label {
    display: inline-block;
    margin-bottom: .375rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--as-ink-mute);
}
.col-form-label { padding-top: calc(.5rem + 1px); padding-bottom: calc(.5rem + 1px); margin-bottom: 0; }
.form-text { display: block; margin-top: .3rem; font-size: .78rem; color: var(--as-ink-dim); }
.form-control, .custom-select {
    display: block;
    width: 100%;
    height: 2.5rem;
    padding: .5rem .875rem;
    font: inherit;
    font-size: .875rem;
    line-height: 1.4;
    color: var(--as-ink);
    background-color: var(--as-soft);
    background-clip: padding-box;
    border: 1px solid var(--as-border);
    border-radius: var(--as-r-md);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
    appearance: none;
}
.form-control::placeholder { color: var(--as-ink-dim); opacity: 1; }
.form-control:focus, .custom-select:focus {
    color: var(--as-ink);
    background-color: var(--as-soft);
    border-color: var(--as-brand);
    outline: 0;
    box-shadow: 0 0 0 3px var(--as-brand-ring);
}
.form-control:disabled, .form-control[readonly] { opacity: .7; }
textarea.form-control { height: auto; min-height: 5rem; resize: vertical; }
.form-control-sm { height: 2.125rem; padding: .35rem .7rem; font-size: .8125rem; border-radius: var(--as-r-sm); }
.form-control-lg { height: 2.875rem; padding: .6rem 1rem; font-size: 1rem; }
select.form-control, .custom-select {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23908da0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right .7rem center;
}
select.form-control option, .custom-select option { color: var(--as-ink); background: var(--as-elev); }
.form-control.is-invalid, .is-invalid > .form-control { border-color: var(--asc-danger); }
.invalid-feedback { display: none; width: 100%; margin-top: .3rem; font-size: .78rem; color: var(--asc-danger); }
.is-invalid ~ .invalid-feedback, .was-validated :invalid ~ .invalid-feedback, .invalid-feedback.d-block { display: block; }

.input-group { position: relative; display: flex; flex-wrap: wrap; align-items: stretch; width: 100%; }
.input-group > .form-control { position: relative; flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group-append, .input-group-prepend { display: flex; }
.input-group-append > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }

.form-check { position: relative; display: block; padding-left: 1.5rem; }
.form-check-input { position: absolute; margin-top: .25rem; margin-left: -1.5rem; accent-color: var(--as-brand); }

/* Bootstrap custom checkbox / radio / switch */
.custom-control { position: relative; z-index: 1; display: block; min-height: 1.5rem; padding-left: 1.6rem; }
.custom-control-inline { display: inline-flex; margin-right: 1rem; }
.custom-control-input { position: absolute; left: 0; z-index: -1; width: 1.1rem; height: 1.25rem; opacity: 0; }
.custom-control-label {
    position: relative;
    margin-bottom: 0;
    vertical-align: top;
    font-size: .875rem;
    color: var(--as-ink);
    cursor: pointer;
}
.custom-control-label::before, .custom-control-label::after {
    position: absolute;
    top: .2rem;
    left: -1.6rem;
    display: block;
    width: 1.1rem;
    height: 1.1rem;
    content: "";
}
.custom-control-label::before {
    pointer-events: none;
    background: var(--as-soft);
    border: 1px solid var(--as-border-strong);
    border-radius: .3rem;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.custom-control-label::after { background: no-repeat 50% / 62% 62%; }
.custom-radio .custom-control-label::before { border-radius: 50%; }
.custom-control-input:checked ~ .custom-control-label::before { background: var(--as-brand); border-color: var(--as-brand); }
.custom-control-input:focus-visible ~ .custom-control-label::before { box-shadow: 0 0 0 3px var(--as-brand-ring); }
.custom-control-input:disabled ~ .custom-control-label { opacity: .55; cursor: default; }
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}
.custom-radio .custom-control-input:checked ~ .custom-control-label::after {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><circle r='3' cx='6' cy='6' fill='white'/></svg>");
    background-size: 100% 100%;
}
.custom-switch { padding-left: 2.75rem; }
.custom-switch .custom-control-label::before { left: -2.75rem; width: 2.2rem; border-radius: 999px; pointer-events: all; }
.custom-switch .custom-control-label::after {
    top: calc(.2rem + 3px);
    left: calc(-2.75rem + 3px);
    width: calc(1.1rem - 6px);
    height: calc(1.1rem - 6px);
    background: var(--as-ink-mute);
    border-radius: 999px;
    transition: transform .18s var(--asc-ease), background-color .15s;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::after { background: #fff; transform: translateX(1.1rem); }

/* -------------------------------------------------------------- dropdowns */
.dropdown, .dropup, .dropleft, .dropright { position: relative; }
.dropdown-toggle { white-space: nowrap; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 11rem;
    margin: .375rem 0 0;
    padding: .375rem;
    font-size: .875rem;
    color: var(--as-ink);
    text-align: left;
    list-style: none;
    background: var(--as-elev);
    background-clip: padding-box;
    border: 1px solid var(--as-border);
    border-radius: var(--as-r-lg);
    box-shadow: var(--asc-shadow);
}
.dropdown-menu.show { display: block; }
.dropdown-menu-right { right: 0; left: auto; }
.dropup .dropdown-menu { top: auto; bottom: 100%; margin: 0 0 .375rem; }
.dropright .dropdown-menu { top: 0; left: 100%; margin: 0 0 0 .375rem; }
.dropleft .dropdown-menu { top: 0; right: 100%; left: auto; margin: 0 .375rem 0 0; }
.dropdown-item {
    display: block;
    width: 100%;
    padding: .45rem .75rem;
    clear: both;
    font-weight: 500;
    color: var(--as-ink-mute);
    text-align: inherit;
    white-space: nowrap;
    background: transparent;
    border: 0;
    border-radius: var(--as-r-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background-color .12s, color .12s;
}
.dropdown-item:hover, .dropdown-item:focus { color: var(--as-ink); background: var(--as-hover); text-decoration: none; outline: 0; }
.dropdown-item.active, .dropdown-item:active { color: var(--as-brand); background: var(--as-brand-soft); }
.dropdown-item.disabled, .dropdown-item:disabled { opacity: .5; pointer-events: none; }
.dropdown-divider { height: 0; margin: .375rem 0; overflow: hidden; border-top: 1px solid var(--as-border); }
.dropdown-header { display: block; padding: .4rem .75rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--as-ink-dim); }
.dropdown-backdrop { position: fixed; inset: 0; z-index: 990; }

/* Checkbox / radio option lists inside menus (filters, sort pickers).
   The <input> stays hidden; the label draws a Font Awesome glyph. */
.dropdown-menu li { list-style: none; }
.dropdown-menu li > input { display: none; }
.dropdown-menu li > label {
    display: block;
    margin: 0;
    padding: .4rem .6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .8125rem;
    color: var(--as-ink-mute);
    border-radius: var(--as-r-sm);
    cursor: pointer;
    transition: background-color .12s, color .12s;
}
.dropdown-menu li > label:hover { color: var(--as-ink); background: var(--as-hover); }
.dropdown-menu li > input:checked ~ label, .dropdown-menu .active > label { color: var(--as-ink); background: var(--as-brand-soft); }
.dropdown-menu li > input[type=checkbox] + label::before {
    content: "\f0c8";
    margin-right: .45rem;
    font-family: "Font Awesome 6 Free";
    font-weight: 400;
    color: var(--as-ink-dim);
}
.dropdown-menu li > input[type=checkbox]:checked + label::before { content: "\f14a"; font-weight: 900; color: var(--as-brand); }
.dropdown-menu li > input.exclude[type=checkbox] + label::before { color: var(--asc-danger); }
.dropdown-menu li > input.exclude[type=checkbox]:checked + label { color: var(--asc-danger); background: rgba(239, 68, 68, .12); }
.dropdown-menu li > input.exclude[type=checkbox]:checked + label::before { content: "\f2d3"; font-weight: 900; color: var(--asc-danger); }
.dropdown-menu li > input[type=radio] + label::before {
    content: "\f111";
    margin-right: .45rem;
    font-family: "Font Awesome 6 Free";
    font-weight: 400;
    color: var(--as-ink-dim);
}
.dropdown-menu li > input[type=radio]:checked + label::before { content: "\f192"; font-weight: 400; color: var(--as-brand); }

/* ----------------------------------------------------- collapse / fade / tabs */
.fade { transition: opacity .18s linear; }
.fade:not(.show) { opacity: 0; }
.collapse:not(.show) { display: none; }
.collapsing { position: relative; height: 0; overflow: hidden; transition: height .3s ease; }
@media (prefers-reduced-motion: reduce) { .fade, .collapsing { transition: none; } }

.tab-content > .tab-pane { display: none; }
.tab-content > .active { display: block; }

.nav { display: flex; flex-wrap: wrap; gap: .25rem; padding-left: 0; margin-bottom: 0; list-style: none; }
.nav-link {
    display: block;
    padding: .5rem .9rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--as-ink-mute);
    background: transparent;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: color .15s, background-color .15s, border-color .15s;
}
.nav-link:hover { color: var(--as-ink); text-decoration: none; }
.nav-link.disabled { opacity: .5; pointer-events: none; }
.nav-tabs { gap: 0; border-bottom: 1px solid var(--as-border); }
.nav-tabs .nav-link { margin-bottom: -1px; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: var(--as-brand); border-bottom-color: var(--as-brand); }
.nav-pills .nav-link { border-radius: var(--as-r-md); }
.nav-pills .nav-link:hover { background: var(--as-hover); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { color: #fff; background: var(--as-brand); }

/* ------------------------------------------------------------------ modals */
.modal-open { overflow: hidden; }
.modal-open .modal { overflow-x: hidden; overflow-y: auto; }
.modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
}
.modal-dialog { position: relative; width: auto; margin: .75rem; pointer-events: none; }
.modal.fade .modal-dialog { transform: translateY(-18px) scale(.98); transition: transform .25s var(--asc-ease); }
.modal.show .modal-dialog { transform: none; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 1.5rem); }
.modal-dialog-scrollable { display: flex; max-height: calc(100% - 1.5rem); }
.modal-dialog-scrollable .modal-content { max-height: calc(100vh - 1.5rem); overflow: hidden; }
.modal-dialog-scrollable .modal-body { overflow-y: auto; }
.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    color: var(--as-ink);
    pointer-events: auto;
    background: var(--as-elev);
    background-clip: padding-box;
    border: 1px solid var(--as-border);
    border-radius: var(--as-r-xl);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .65);
    outline: 0;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--as-border);
}
.modal-header .close { margin: -.25rem -.4rem -.25rem auto; }
.modal-title {
    margin: 0;
    font-family: "Manrope", "Inter", system-ui, sans-serif;
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--as-ink);
}
.modal-body { position: relative; flex: 1 1 auto; padding: 1.25rem; }
.modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    padding: .875rem 1.25rem;
    border-top: 1px solid var(--as-border);
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 5, 12, .62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: 1; }
@media (min-width: 576px) {
    .modal-dialog { max-width: 500px; margin: 1.75rem auto; }
    .modal-dialog-centered { min-height: calc(100% - 3.5rem); }
    .modal-dialog-scrollable { max-height: calc(100% - 3.5rem); }
    .modal-dialog-scrollable .modal-content { max-height: calc(100vh - 3.5rem); }
    .modal-sm { max-width: 340px; }
}
@media (min-width: 992px) {
    .modal-lg, .modal-xl { max-width: 800px; }
}
@media (min-width: 1200px) { .modal-xl { max-width: 1140px; } }

/* ------------------------------------------------- Bootstrap tooltip (bs4) */
.tooltip {
    position: absolute;
    z-index: 1070;
    display: block;
    margin: 0;
    font-family: inherit;
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    word-wrap: break-word;
    opacity: 0;
    pointer-events: none;
}
.tooltip.show { opacity: 1; }
.tooltip .arrow { position: absolute; display: block; width: .8rem; height: .4rem; }
.tooltip .arrow::before { position: absolute; content: ""; border-color: transparent; border-style: solid; }
.tooltip-inner {
    max-width: 240px;
    padding: .35rem .6rem;
    color: #f3f1f8;
    text-align: center;
    background: #1d1b26;
    border: 1px solid #2d2c37;
    border-radius: var(--as-r-sm);
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .6);
}
.bs-tooltip-top, .bs-tooltip-auto[x-placement^=top] { padding: .4rem 0; }
.bs-tooltip-top .arrow, .bs-tooltip-auto[x-placement^=top] .arrow { bottom: 0; }
.bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^=top] .arrow::before { top: 0; border-width: .4rem .4rem 0; border-top-color: #1d1b26; }
.bs-tooltip-bottom, .bs-tooltip-auto[x-placement^=bottom] { padding: .4rem 0; }
.bs-tooltip-bottom .arrow, .bs-tooltip-auto[x-placement^=bottom] .arrow { top: 0; }
.bs-tooltip-bottom .arrow::before, .bs-tooltip-auto[x-placement^=bottom] .arrow::before { bottom: 0; border-width: 0 .4rem .4rem; border-bottom-color: #1d1b26; }
.bs-tooltip-right, .bs-tooltip-auto[x-placement^=right] { padding: 0 .4rem; }
.bs-tooltip-right .arrow, .bs-tooltip-auto[x-placement^=right] .arrow { left: 0; width: .4rem; height: .8rem; }
.bs-tooltip-right .arrow::before, .bs-tooltip-auto[x-placement^=right] .arrow::before { right: 0; border-width: .4rem .4rem .4rem 0; border-right-color: #1d1b26; }
.bs-tooltip-left, .bs-tooltip-auto[x-placement^=left] { padding: 0 .4rem; }
.bs-tooltip-left .arrow, .bs-tooltip-auto[x-placement^=left] .arrow { right: 0; width: .4rem; height: .8rem; }
.bs-tooltip-left .arrow::before, .bs-tooltip-auto[x-placement^=left] .arrow::before { left: 0; border-width: .4rem 0 .4rem .4rem; border-left-color: #1d1b26; }

/* ------------------------------------------------------- alerts / toasts */
.alert {
    position: relative;
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    font-size: .875rem;
    color: var(--as-ink);
    background: var(--as-soft);
    border: 1px solid var(--as-border);
    border-radius: var(--as-r-md);
}
.alert-danger { background: color-mix(in srgb, var(--asc-danger) 14%, var(--as-soft)); border-color: color-mix(in srgb, var(--asc-danger) 45%, transparent); }
.alert-success { background: color-mix(in srgb, var(--asc-success) 14%, var(--as-soft)); border-color: color-mix(in srgb, var(--asc-success) 45%, transparent); }
.alert-warning { background: color-mix(in srgb, var(--asc-warning) 14%, var(--as-soft)); border-color: color-mix(in srgb, var(--asc-warning) 45%, transparent); }
.alert-info { background: color-mix(in srgb, var(--as-brand) 14%, var(--as-soft)); border-color: color-mix(in srgb, var(--as-brand) 45%, transparent); }
.alert-danger > i:first-child, .alert-danger > .fa-solid:first-child { color: var(--asc-danger); }
.alert-success > i:first-child { color: var(--asc-success); }
.alert-warning > i:first-child { color: var(--asc-warning); }
.alert-info > i:first-child { color: var(--as-brand); }
.alert-dismissible { padding-right: 3rem; }
.alert-dismissible .close { position: absolute; top: .45rem; right: .5rem; float: none; }

/* main.js Toast → <div id="toast"><div class="alert alert-*">…</div></div> */
#toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    max-width: calc(100vw - 2rem);
}
#toast .alert {
    display: flex;
    align-items: center;
    gap: .25rem;
    min-width: 260px;
    max-width: 420px;
    margin: 0;
    padding: .7rem 2.75rem .7rem .9rem; /* room for the absolutely-placed close X (base.css .alert .close) */
    background: var(--as-elev);
    box-shadow: var(--asc-shadow);
}
#toast .alert .close { float: none; margin-left: auto; width: 1.75rem; height: 1.75rem; }

/* --------------------------------------------------------------- badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25em;
    padding: .25em .55em;
    font-size: .72em;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    color: #fff;
    background: var(--as-brand);
    border-radius: var(--as-r-sm);
}
.badge:empty { display: none; }
.badge-light, .badge-secondary { color: var(--as-ink); background: var(--as-hover); }
.badge-warning { color: #1c1300; background: var(--asc-warning); }
.badge-danger { background: var(--asc-danger); }
.badge-success { background: var(--asc-success); }
.badge-primary { background: var(--as-brand); }

/* ------------------------------------------------------------ breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 0 1rem;
    padding: 0;
    font-size: .8125rem;
    list-style: none;
    color: var(--as-ink-dim);
}
.breadcrumb-item a { color: var(--as-ink-mute); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--as-brand); }
.breadcrumb-item + .breadcrumb-item { padding-left: .5rem; }
.breadcrumb-item + .breadcrumb-item::before { padding-right: .5rem; content: "/"; color: var(--as-ink-dim); }
.breadcrumb-item.active { color: var(--as-ink); }

/* ---------------------------------------------------------- progress bar */
.progress {
    display: flex;
    height: .5rem;
    overflow: hidden;
    font-size: .7rem;
    background: var(--as-hover);
    border-radius: 999px;
}
.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background: var(--as-brand);
    transition: width .5s ease;
}

/* ------------------------------------------------------------- spinners */
@keyframes asc-spin { to { transform: rotate(360deg); } }
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: -.125em;
    border: .22em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: asc-spin .75s linear infinite;
}
.spinner-border-sm { width: 1rem; height: 1rem; border-width: .18em; }

/* Theme spinner: main.js/comments.js inject <div class="loading"></div>. */
.loading {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
    margin: 1.5rem auto;
    border: 3px solid var(--as-border);
    border-top-color: var(--as-brand);
    border-radius: 50%;
    animation: asc-spin .8s linear infinite;
}
.loading > * { display: none; }
.loading-absolute, .loading-relative {
    display: flex;
    align-items: center;
    justify-content: center;
}
.loading-absolute {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: color-mix(in srgb, var(--as-bg) 55%, transparent);
    border-radius: inherit;
}
.loading-absolute .loading, .loading-relative .loading { margin: 0; }
.loading-relative { position: relative; min-height: 80px; }
@media (prefers-reduced-motion: reduce) { .loading, .spinner-border { animation-duration: 2s; } }
