* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg-base: #06080f;
    --bg-elevated: rgba(20, 20, 20, 0.52);
    --text-primary: #e7edf8;
    --text-muted: rgba(231, 237, 248, 0.72);
    --brand-cyan: #8fd1ff;
    --brand-blue: #79aaff;
    --brand-violet: #b6a8ff;
    --stroke-soft: rgba(255, 255, 255, 0.12);
    --shadow-depth: 0 24px 58px rgba(0, 0, 0, 0.48);
    --hero-gradient: linear-gradient(110deg, #f4f9ff 14%, #bde4ff 43%, #c9b9ff 78%, #f4f9ff 96%);
}

body {
    margin: 0;
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
    background-color: var(--bg-base);
    background-image:
        linear-gradient(rgba(6, 9, 14, 0.48), rgba(6, 9, 14, 0.52)),
        radial-gradient(circle at 12% 18%, rgba(82, 121, 182, 0.3), rgba(7, 9, 15, 0.14) 38%, rgba(7, 9, 15, 0.72)),
        radial-gradient(circle at 86% 10%, rgba(132, 164, 248, 0.2), rgba(7, 9, 15, 0.08) 40%, rgba(7, 9, 15, 0.7)),
        url("../professional-bg.png");
    background-size: cover, cover, cover, cover;
    background-position: center, center, center, center;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
    background-attachment: fixed, fixed, fixed, fixed;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
    isolation: isolate;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    width: 34vw;
    height: 34vw;
    min-width: 260px;
    min-height: 260px;
    max-width: 520px;
    max-height: 520px;
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
    opacity: 0.22;
    animation: float-ambient 11s ease-in-out infinite;
}

body::before {
    top: -9vw;
    right: -11vw;
    background: radial-gradient(circle, rgba(139, 206, 255, 0.95), rgba(139, 206, 255, 0));
}

body::after {
    bottom: -12vw;
    left: -13vw;
    background: radial-gradient(circle, rgba(183, 157, 255, 0.85), rgba(183, 157, 255, 0));
    animation-delay: -4.2s;
}

a {
    color: #c2ddff;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

header,
main,
footer {
    position: relative;
    z-index: 1;
}

a:hover {
    color: #e4f2ff;
    text-decoration: none;
}

.container {
    width: min(1120px, 94vw);
    margin: 0 auto;
}

.glass {
    background: linear-gradient(148deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)) border-box, rgba(16, 20, 30, 0.46) padding-box;
    border: 1px solid transparent;
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 16px auto;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.premium-topbar {
    position: sticky;
    border-radius: 16px;
}

.brand {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    min-height: 54px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}

.brand strong a {
    font-family: "Prata", Georgia, serif;
    font-size: clamp(0.9rem, 1.15vw, 1.05rem);
    letter-spacing: 0.01em;
    color: #f2f8ff;
    display: block;
    line-height: 1.2;
    white-space: nowrap;
}

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 86px;
    min-height: 46px;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: clamp(74px, 10vw, 102px);
    height: auto;
    max-height: 36px;
    object-fit: contain;
}

.brand small {
    opacity: 0.84;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.26;
    display: block;
    white-space: nowrap;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.premium-nav-actions {
    justify-content: flex-end;
    flex: 1;
}

.nav-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-auth {
    justify-content: flex-end;
}

.header-variant-minimal .premium-topbar {
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
}

.header-variant-minimal .button {
    border-color: rgba(194, 220, 255, 0.3);
}

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

.button {
    border: 1px solid rgba(195, 223, 255, 0.36);
    background: linear-gradient(145deg, rgba(117, 168, 245, 0.46), rgba(128, 102, 240, 0.32));
    color: #fff;
    border-radius: 11px;
    padding: 9px 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 9px 20px rgba(35, 73, 130, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.26);
    position: relative;
    overflow: hidden;
}

.button:hover {
    transform: translateY(-1px);
    background: linear-gradient(145deg, rgba(136, 186, 255, 0.58), rgba(140, 112, 248, 0.44));
    border-color: rgba(223, 241, 255, 0.75);
    box-shadow: 0 14px 28px rgba(27, 61, 114, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.button.secondary {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.locale-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.locale-dropdown-wrap {
    margin: 0;
}

.locale-dropdown {
    min-height: 44px;
    margin: 0;
    min-width: 92px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #e7edf8;
    padding: 9px 10px;
    cursor: pointer;
    margin-bottom: 0;
}

.locale-pill {
    font-size: 0.78rem;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.locale-pill.active {
    background: rgba(106, 170, 255, 0.25);
}

main {
    padding: 12px 0 64px;
}

.premium-main {
    animation: fade-in-up 0.6s ease both;
}

.grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 18px;
}

.premium-grid .card {
    content-visibility: auto;
    contain-intrinsic-size: 720px;
}

.card {
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.card h1,
.card h2,
.card h3 {
    margin-top: 0;
}

.hero-card {
    margin-bottom: 18px;
    padding: 24px;
}

.hero-title {
    font-family: "Prata", Georgia, serif;
    font-size: clamp(1.62rem, 2.5vw, 2.34rem);
    margin-bottom: 12px;
    line-height: 1.2;
    letter-spacing: 0.01em;
    background: var(--hero-gradient);
    background-size: 140% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: title-shimmer 8.5s linear infinite;
}

.hero-eyebrow {
    margin: 0 0 8px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.64;
}

.hero-text {
    margin: 0;
    max-width: 680px;
    color: rgba(234, 243, 255, 0.84);
    line-height: 1.62;
}

.hero-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-stats {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stat-item {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
}

.premium-hero-card::before {
    content: "";
    position: absolute;
    inset: -20% 44% auto -10%;
    height: 180px;
    background: radial-gradient(circle, rgba(121, 188, 255, 0.2), rgba(121, 188, 255, 0));
    transform: rotate(-8deg);
    pointer-events: none;
}

.premium-hero-card::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: -34px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 24px rgba(255, 255, 255, 0.02);
    opacity: 0.42;
    pointer-events: none;
}

.premium-stat-item {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(196, 221, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 8px 18px rgba(8, 16, 34, 0.16);
}

.stat-item strong {
    display: block;
    font-size: 1.14rem;
}

.stat-item span {
    font-size: 0.8rem;
    opacity: 0.86;
}

.category-item {
    margin-bottom: 12px;
}

.category-item h3 {
    margin: 0 0 6px;
    font-size: 1.06rem;
}

.category-heading {
    margin: 0 0 8px;
    letter-spacing: 0.01em;
}

.section-title {
    font-family: "Prata", Georgia, serif;
    font-size: clamp(1.18rem, 1.8vw, 1.42rem);
    margin-bottom: 16px;
    letter-spacing: 0.01em;
}

.premium-section-card {
    border-color: rgba(197, 226, 255, 0.16);
    padding: 20px;
}

.category-link {
    color: #f2f7ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.category-link:hover {
    color: #b8d7ff;
    text-decoration: none;
}

.premium-category {
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 16px rgba(4, 10, 22, 0.14);
    transition: transform 0.22s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.premium-category:hover {
    transform: translateY(-1px);
    border-color: rgba(187, 221, 255, 0.36);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 22px rgba(5, 12, 28, 0.22);
}

.category-meta {
    margin: 8px 0 12px;
    font-size: 0.88rem;
    opacity: 0.78;
    line-height: 1.5;
}

.subcat-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.subcat-pill {
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.04);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.premium-subcat-pill {
    background: rgba(125, 170, 235, 0.16);
    border-color: rgba(173, 214, 255, 0.26);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: #eef6ff;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 6px 11px;
    transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.premium-subcat-pill:hover {
    border-color: rgba(196, 228, 255, 0.58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 9px 18px rgba(7, 18, 38, 0.2);
    transform: translateY(-1px);
    text-decoration: none;
}

.subcat-icon {
    color: rgba(198, 224, 255, 0.95);
    font-size: 0.7rem;
    line-height: 1;
}

.subcat-pill.active {
    border-color: rgba(195, 226, 255, 0.95);
    background: linear-gradient(150deg, rgba(120, 182, 255, 0.45), rgba(91, 136, 218, 0.34));
    color: #ffffff;
}

.thread-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thread-row {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.premium-thread-row {
    transition: border-color 0.24s ease, transform 0.22s ease, box-shadow 0.24s ease, background 0.24s ease;
    background: rgba(255, 255, 255, 0.045);
}

.premium-thread-row:hover {
    border-color: rgba(160, 205, 255, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(8, 18, 36, 0.2);
}

.thread-title {
    display: block;
    margin-bottom: 8px;
}

.thread-title strong {
    font-weight: 650;
    line-height: 1.45;
}

.admin-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.admin-action-grid form,
.admin-user-form {
    margin: 0;
}

.admin-user-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.bulk-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bulk-toolbar > select {
    max-width: 260px;
    margin: 0;
}

.bulk-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bulk-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.bulk-checkbox label {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 500;
}

.admin-user-form select {
    margin: 0;
}

.report-form {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(140px, 180px) 1fr auto;
    gap: 8px;
    align-items: center;
}

.report-form select,
.report-form input {
    margin: 0;
}

.post-inline-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-inline-actions .button {
    min-height: 38px;
    padding: 8px 12px;
}

.thread-inline-actions {
    margin: 12px 0 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.thread-inline-actions form,
.post-inline-actions form {
    margin: 0;
}

.icon-action {
    gap: 7px;
    min-height: 38px;
    padding: 8px 12px;
    line-height: 1;
}

.icon-action svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    flex: 0 0 auto;
}

.icon-action span {
    line-height: 1.15;
}

.icon-action.danger {
    border-color: rgba(255, 130, 130, 0.48);
    color: #ffd4d4;
    background: linear-gradient(145deg, rgba(180, 65, 65, 0.32), rgba(120, 18, 18, 0.22));
}

.icon-action.danger:hover {
    border-color: rgba(255, 160, 160, 0.8);
    background: linear-gradient(145deg, rgba(212, 82, 82, 0.42), rgba(142, 24, 24, 0.32));
}

.quick-thread-cta-wrap {
    margin-top: 14px;
}

.quick-thread-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quick-thread-cta svg {
    width: 17px;
    height: 17px;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 10px;
}

.rich-editor-toolbar button {
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #e8f2ff;
    padding: 6px 11px;
    cursor: pointer;
    font-size: 0.82rem;
    line-height: 1;
}

.rich-editor-toolbar button:hover {
    border-color: rgba(162, 208, 255, 0.68);
    background: rgba(122, 177, 248, 0.2);
}

.rich-editor-toolbar button.is-active {
    border-color: rgba(162, 208, 255, 0.95);
    background: rgba(122, 177, 248, 0.3);
}

.rich-editor-preview {
    min-height: 210px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(8, 10, 14, 0.75);
    color: #e7edf8;
    padding: 11px 12px;
}

.rich-editor-preview pre,
.thread-body pre {
    margin: 0.75em 0;
    padding: 0.7em 0.85em;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(3, 7, 14, 0.85);
    overflow-x: auto;
}

.rich-editor-preview code,
.thread-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.88em;
    color: #b9e0ff;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
    opacity: 0.84;
}

.meta-chip {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(229, 239, 252, 0.84);
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    margin: 0 0 6px;
}

textarea,
select,
input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(8, 10, 14, 0.75);
    color: #e7edf8;
    padding: 11px 12px;
    margin-bottom: 12px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(125, 186, 255, 0.65);
    box-shadow: 0 0 0 2px rgba(125, 186, 255, 0.2);
}

.auth-card {
    max-width: 640px;
    margin: 0 auto;
}

.auth-subtext {
    margin: -4px 0 14px;
    opacity: 0.8;
    font-size: 0.92rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.thread-body {
    white-space: normal;
    line-height: 1.62;
}

.thread-body--premium {
    max-width: 72ch;
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--text-primary);
}

.thread-op-card {
    padding: 1.35rem 1.5rem;
}

.thread-op-card .thread-body--premium {
    margin-top: 0.75rem;
}

.thread-row--reply {
    padding: 1rem 1.15rem;
}

.thread-row--reply .thread-body--premium {
    margin-top: 0.45rem;
}

.thread-body--premium p {
    margin: 0 0 1em;
}

.thread-body--premium p:last-child {
    margin-bottom: 0;
}

.thread-body--premium p + p {
    margin-top: 0.15em;
}

.thread-body--premium h2,
.thread-body--premium h3 {
    margin: 1.35em 0 0.55em;
    font-family: "Prata", serif;
    font-weight: 400;
    line-height: 1.3;
}

.thread-body--premium h2 { font-size: 1.35rem; }
.thread-body--premium h3 { font-size: 1.15rem; }

.thread-body p {
    margin: 0 0 0.9em;
}

.thread-body ul,
.thread-body ol {
    margin: 0.6em 0 0.9em;
    padding-left: 1.2em;
}

.thread-body blockquote {
    margin: 0.8em 0;
    padding: 0.4em 0.85em;
    border-left: 2px solid rgba(148, 198, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.thread-body a {
    color: #9fd6ff;
    text-decoration: underline;
}

.thread-body img {
    display: block;
    max-width: min(100%, 720px);
    height: auto;
    border-radius: 12px;
    margin: 0.8em 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

textarea[data-rich-editor] {
    min-height: 210px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.section-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.9rem;
}

.notice {
    margin: 8px 0 14px;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(126, 192, 255, 0.5);
    background: rgba(73, 138, 216, 0.22);
}

.notice-inline {
    margin: 0;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(126, 192, 255, 0.4);
    background: rgba(73, 138, 216, 0.18);
}

footer {
    margin-top: 18px;
    padding: 20px;
}

@keyframes float-ambient {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(0, -16px, 0);
    }
}

@keyframes title-shimmer {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 140% center;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@supports not (backdrop-filter: blur(1px)) {
    .glass {
        background: rgba(12, 15, 24, 0.82);
    }
}

@media (max-width: 930px) {
    body {
        background-attachment: scroll, scroll, scroll;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .premium-topbar {
        padding: 13px;
    }

    .premium-nav-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-cluster {
        width: 100%;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .premium-hero-card::after {
        width: 154px;
        height: 154px;
    }

    .admin-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-user-form {
        grid-template-columns: 1fr;
    }

    .report-form {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
