:root {
    --color-primary-600: hsl(210, 85%, 50%);
    --color-primary-500: hsl(210, 85%, 60%);
    --color-primary-100: hsl(210, 85%, 95%);
    --color-primary-tap: hsl(210, 85%, 40%);
    --color-bg: hsl(220, 20%, 98%);
    --color-bg-alt: hsl(0, 0%, 100%);
    --color-bg-muted: hsl(220, 20%, 94%);
    --color-text: hsl(220, 25%, 20%);
    --color-text-muted: hsl(220, 15%, 50%);
    --color-border: hsl(220, 20%, 90%);
    --color-shadow-light: hsl(220, 30%, 85%);
    --color-success: hsl(140, 65%, 45%);
    --color-error: hsl(350, 75%, 50%);
    --color-bg-alt-translucent: hsla(0, 0%, 100%, 0.85);
    --dark-color-bg: hsl(220, 25%, 10%);
    --dark-color-bg-alt: hsl(220, 25%, 15%);
    --dark-color-bg-muted: hsl(220, 25%, 20%);
    --dark-color-text: hsl(220, 15%, 85%);
    --dark-color-text-muted: hsl(220, 10%, 65%);
    --dark-color-border: hsl(220, 25%, 25%);
    --dark-color-shadow-light: hsl(220, 10%, 5%);
    --dark-color-bg-alt-translucent: hsla(220, 25%, 15%, 0.85);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    --font-heading: var(--font-sans);
    --fs-base: 1rem;
    --fs-sm: 0.875rem;
    --fs-xs: 0.75rem;
    --fs-lg: 1.125rem;
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-bold: 700;
    --line-height-base: 1.6;
    --line-height-heading: 1.3;
    --space-base: 1rem; 
    --space-xxs: calc(var(--space-base) * 0.25); 
    --space-xs: calc(var(--space-base) * 0.5); 
    --space-sm: calc(var(--space-base) * 0.75); 
    --space-md: var(--space-base); 
    --space-lg: calc(var(--space-base) * 1.5); 
    --space-xl: calc(var(--space-base) * 2);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --motion-fast: 150ms ease-out;
    --motion-medium: 300ms ease-out;
    --header-height: 64px;
    --nav-height: 56px;
    --container-width: 1280px;
    --container-padding: var(--space-md);
}
html.dark-theme {
    --color-bg: var(--dark-color-bg);
    --color-bg-alt: var(--dark-color-bg-alt);
    --color-bg-muted: var(--dark-color-bg-muted);
    --color-text: var(--dark-color-text);
    --color-text-muted: var(--dark-color-text-muted);
    --color-border: var(--dark-color-border);
    --color-shadow-light: var(--dark-color-shadow-light);
    --color-bg-alt-translucent: var(--dark-color-bg-alt-translucent);
    #theme-toggle-btn .icon-moon { display: none; }
    #theme-toggle-btn .icon-sun { display: block; }
}
#theme-toggle-btn .icon-sun { display: none; }
#theme-toggle-btn .icon-moon { display: block; }
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}
html {
    font-size: var(--fs-base);
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--nav-height) + var(--space-md));
}
body {
    font-family: var(--font-sans);
    line-height: var(--line-height-base);
    background-color: var(--color-bg);
    color: var(--color-text);
}
main {
    margin-top: var(--space-lg);
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    line-height: var(--line-height-heading);
    margin-bottom: var(--space-sm);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
p {
    margin-bottom: var(--space-md);
}
a {
    color: var(--color-primary-500);
    text-decoration: none;
    transition: color var(--motion-fast);
}
a:hover,
a:focus-visible {
    color: var(--color-primary-600);
    text-decoration: none;
}
ul, ol {
    list-style: none;
}
small {
    font-size: var(--fs-sm);
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}
svg {
    min-width: 1.25em;
    min-height: 1.25em;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
}
button,
input,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
}
button {
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-alt);
    color: var(--color-text);
    transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px var(--color-primary-100);
}
select,
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='hsl(220,25%,20%)' d='M7 10l5 5 5-5H7z'/></svg>");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  background-size: 1em;
  padding-left: 2.5rem;
  cursor: pointer;
  padding-right: 0;
}
html.dark-theme select,
html.dark-theme input[type="date"],
html.dark-theme input[type="time"],
html.dark-theme input[type="datetime-local"],
html.dark-theme input[type="month"],
html.dark-theme input[type="week"] {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='hsl(220,15%,85%)' d='M7 10l5 5 5-5H7z'/></svg>");
}
.container {
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}
.card {
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    transition: background-color var(--motion-medium), border-color var(--motion-medium);
}
.card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-bg-muted);
    flex-wrap: wrap;
}
.card__title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-medium);
    margin: 0;
    display: flex;
    align-items: center;
}
.card__body {
    padding: var(--space-lg);
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--fw-medium);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--motion-fast);
    line-height: 1.15;
}
.button:hover {
    text-decoration: none;
}
.button:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}
.button--primary {
    background-color: var(--color-primary-500);
    color: #ffffff;
}
.button--primary:hover {
    background-color: var(--color-primary-600);
    color: #ffffff;
}
.button--primary:active {
    background-color: var(--color-primary-tap);
}
.button--secondary {
    background-color: var(--color-bg-alt);
    color: var(--color-text);
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}
.button--secondary:hover {
    background-color: var(--color-bg-muted);
    color: var(--color-text);
}
.button--secondary:active {
    background-color: var(--color-border);
}
.button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    position: relative;
    border: 1px solid transparent;
}
.button-icon:hover {
    background-color: var(--color-bg-muted);
    color: var(--color-text);
}
.button-icon:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}
.button-icon svg {
    width: 20px;
    height: 20px;
}
.badge {
    position: absolute;
    top: 4px;
    inset-inline-start: 15px;
    background-color: var(--color-error);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: var(--fw-bold);
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--color-bg-alt);
}
.dropdown {
    position: relative;
}
.dropdown__menu {
    position: absolute;
    top: calc(100% + var(--space-xs));
    inset-inline-end: 0; 
    z-index: 100;
    min-width: 300px;
    background-color: var(--color-bg-alt-translucent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--motion-fast), visibility var(--motion-fast), transform var(--motion-fast);
    overflow: hidden;
}
.dropdown__menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
}
.dropdown__header strong {
    font-weight: var(--fw-medium);
}
.dropdown__content {
    max-height: 170px;
    overflow-y: auto;
}
.dropdown__footer {
    padding: var(--space-xs);
    border-top: 1px solid var(--color-border);
    background-color: var(--color-bg-muted);
}
.dropdown__footer a {
    display: block;
    text-align: center;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    text-decoration: none;
}
.dropdown__footer a:hover {
    background-color: var(--color-border);
}
.dropdown__empty {
    padding: var(--space-lg);
    text-align: center;
    color: var(--color-text-muted);
}
.dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text);
    text-decoration: none;
}
.dropdown__item:hover {
    background-color: var(--color-bg-muted);
    color: var(--color-text);
    text-decoration: none;
}
.dropdown__item svg {
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
}
.dropdown__divider {
    height: 1px;
    background-color: var(--color-border);
    margin: var(--space-xs) 0;
}
.button-link {
    font-size: var(--fs-sm);
    color: var(--color-primary-500);
}
.button-link:hover {
    text-decoration: none;
    color: var(--color-primary-600);
}
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-alt);
    position: relative;
    box-shadow: var(--shadow-md);
    transition: opacity 300ms ease;
}
.alert[data-type="success"] {
    border-color: var(--color-success);
    background-color: hsl(140, 75%, 97%);
}
.alert[data-type="error"] {
    border-color: var(--color-error);
    background-color: hsl(350, 75%, 97%);
}
.alert[data-type="info"] {
    border-color: hsl(205, 80%, 55%);
    background-color: hsl(205, 70%, 96%);
}
.dark-theme .alert[data-type="success"] {
    background-color: hsl(140, 90%, 15%);
}
.dark-theme .alert[data-type="error"] {
    background-color: hsl(350, 90%, 15%);
}
.dark-theme .alert[data-type="info"] {
    background-color: hsl(205, 40%, 20%);
}
.alert__icon {
    flex-shrink: 0;
    margin-top: 2px;
}
.alert[data-type="success"] .alert__icon { color: var(--color-success); }
.alert[data-type="error"] .alert__icon { color: var(--color-error); }
.alert__icon svg { width: 20px; height: 20px; }
.alert__content {
    flex-grow: 1;
    color: var(--color-text);
}
.alert__close {
    position: absolute;
    top: var(--space-sm);
    inset-inline-end: var(--space-sm);
    width: 32px;
    height: 32px;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
}
.alert__close:hover {
    background-color: var(--color-bg-muted);
    color: var(--color-text);
}
.alert__close svg { width: 16px; height: 16px; }
.text-muted {
    color: var(--color-text-muted) !important;
}
.site-header {
    background-color: var(--color-bg-alt);
    height: var(--header-height);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 200;
    transition: background-color var(--motion-medium), border-color var(--motion-medium);
}
.site-header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.site-header__brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.site-header__logo-link {
    display: block;
    text-decoration: none;
}
.site-header__logo {
    height: 40px; 
    max-width: 150px;
    object-fit: contain;
    display: none; 
}
html:not(.dark-theme) .site-header__logo[data-mode="light"] {
    display: block;
}
html.dark-theme .site-header__logo[data-mode="dark"] {
    display: block;
}
html:not(.dark-theme) .site-header__logo[data-mode="dark"]:first-child:last-child {
     display: block; 
}
html.dark-theme .site-header__logo[data-mode="light"]:first-child:last-child {
     display: block; 
}
.site-header__title {
    text-decoration: none;
    color: var(--color-text);
}
.site-header__title h1 {
    font-size: 1.5rem;
    font-weight: var(--fw-bold);
    color: var(--color-text);
    margin: 0;
}
.site-header__title h1 a {
    text-decoration: none;
    color: inherit;
}
.site-header__description {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin: 0;
}
.site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}
#session-desktop-container {
    display: contents; 
}
.user-session,
.guest-session {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}
.notification-item {
    display: block;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item:hover {
    background-color: var(--color-bg-muted);
    text-decoration: none;
}
.notification-item--unread {
    background-color: var(--color-primary-100);
    color: var(--color-text-muted);
}
.dark-theme .notification-item--unread {
    background-color: hsl(210, 85%, 20%);
}
.notification-item p {
    font-size: var(--fs-sm);
    color: var(--color-text);
    margin: 0;
}
.notification-item small {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}
.main-nav {
    background-color: var(--color-bg-alt);
    height: var(--nav-height);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: background-color var(--motion-medium), border-color var(--motion-medium);
}
.main-nav__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.main-nav__links {
    display: flex;
    align-items: center;
    height: 100%;
    gap: var(--space-sm);
}
.main-nav__links a {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    height: 100%;
    padding: 0 var(--space-sm);
    color: var(--color-text);
    font-weight: var(--fw-medium);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color var(--motion-fast), border-color var(--motion-fast);
}
.main-nav__links a:hover {
    color: var(--color-text);
    text-decoration: none;
}
.main-nav__links a.is-active, 
.main-nav__links a:hover {
    border-bottom-color: var(--color-primary-500);
    color: var(--color-primary-500);
}
.main-nav__links a svg {
    width: 18px;
    height: 18px;
}
.search-form {
    display: flex;
    align-items: center;
    width: 250px;
    position: relative;
}
.search-form__input {
    width: 100%;
    height: 40px;
    border-radius: var(--radius-md);
    padding-inline-start: var(--space-md);
    padding-inline-end: 40px; 
    border: 1px solid var(--color-border);
    background-color: var(--color-bg);
}
.search-form__input:focus {
    background-color: var(--color-bg-alt);
}
.search-form__submit {
    position: absolute;
    inset-inline-end: 0; 
    top: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}
.search-form__submit:hover {
    color: var(--color-primary-500);
}
.search-form__submit svg {
    width: 20px;
    height: 20px;
}
.main-nav__new-thread {
    font-size: var(--fs-sm);
    padding: var(--space-xs) var(--space-sm);
}
.main-nav__new-thread svg {
    width: 16px;
    height: 16px;
}
.guest-session.is-mobile {
    display: flex;
    flex-direction: column; 
    gap: var(--space-md);
    width: 100%;
}
.guest-session.is-mobile .button {
    width: 100%;
    justify-content: center; 
}
.user-session.is-mobile {
    display: flex;
    justify-content: space-around; 
    align-items: center;
    width: 100%;
}
.site-footer {
    background-color: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-xl);
    color: var(--color-text-muted);
    transition: background-color var(--motion-medium), border-color var(--motion-medium);
}
.dark-theme .site-footer {
    background-color: var(--dark-color-bg-alt); 
}
.site-footer__main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}
.site-footer__col p {
    font-size: var(--fs-sm);
    line-height: var(--line-height-base);
    max-width: 300px;
}
.site-footer__title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-medium);
    color: var(--color-text);
    margin-bottom: var(--space-md);
}
.site-footer__col.item1,
.site-footer__col.item2,
.site-footer__col.item3 {
  justify-self: center;
}
.social-links {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
}
.social-links a:hover {
    color: var(--color-primary-500);
    background-color: var(--color-bg-muted);
    border-color: var(--color-bg-muted);
}
.social-links a svg {
    width: 20px;
    height: 20px;
}
.site-footer__links {
    display: grid;
}
.site-footer__links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--fs-sm);
}
.site-footer__links a:hover {
    color: var(--color-primary-500);
    text-decoration: none;
}
.site-footer__stats {
    display: grid;
    gap: var(--space-xs);
}
.site-footer__stats li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    gap: var(--space-xs);
}
.site-footer__stats span {
    font-weight: var(--fw-bold);
    color: var(--color-text);
    font-size: 1rem;
}
.site-footer__bottom {
    border-top: 1px solid var(--color-border);
    padding: var(--space-md) 0;
    text-align: center;
    font-size: var(--fs-sm);
}
.toast {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--motion-fast), visibility var(--motion-fast), transform var(--motion-fast);
}
.dark-theme .toast {
}
.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
#cookie-consent-modal {
    position: fixed;
    bottom: var(--space-lg);
    inset-inline-start: var(--space-lg); 
    z-index: 1001;
    max-width: 450px;
    width: calc(100% - (var(--space-lg) * 2));
    direction: rtl;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity var(--motion-medium), visibility var(--motion-medium), transform var(--motion-medium);
}
#cookie-consent-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.cookie-modal-content {
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
#cookie-modal-customize {
    display: none;
}
#cookie-consent-modal.customize-view #cookie-modal-initial {
    display: none;
}
#cookie-consent-modal.customize-view #cookie-modal-customize {
    display: block;
}
.cookie-modal-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-bg-muted);
}
.cookie-modal-header h3 {
    margin: 0;
    font-size: var(--fs-lg);
    color: var(--color-text);
}
.cookie-modal-body {
    padding: var(--space-lg);
    max-height: 40vh;
    overflow-y: auto;
}
.cookie-modal-body p {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}
.cookie-modal-body a {
    color: var(--color-primary-500);
    text-decoration: underline;
}
.cookie-modal-actions {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    background-color: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
}
.cookie-modal-actions .button {
    flex-grow: 1;
}
.cookie-category {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    background: var(--color-bg);
}
.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
}
.cookie-category-header strong {
    color: var(--color-text);
}
.cookie-category-description {
    font-size: var(--fs-xs) !important;
    padding: 0 var(--space-md) var(--space-sm);
    margin: 0;
}
.cookie-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px; 
    height: 24px; 
}
.cookie-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-border);
    transition: var(--motion-fast);
}
.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px; 
    width: 18px; 
    left: 3px; 
    bottom: 3px; 
    background-color: white;
    transition: var(--motion-fast);
}
.cookie-slider.round {
    border-radius: 34px;
}
.cookie-slider.round:before {
    border-radius: 50%;
}
input:checked + .cookie-slider {
    background-color: var(--color-primary-500);
}
input:checked + .cookie-slider:before {
    transform: translateX(20px); 
}
input:disabled + .cookie-slider {
    background-color: var(--color-bg-muted);
    cursor: not-allowed;
}
input:disabled + .cookie-slider:before {
    background-color: var(--color-border);
}
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: hsla(0, 0%, 0%, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--motion-fast), visibility var(--motion-fast);
    backdrop-filter: blur(4px);
    direction: rtl; 
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background-color: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: calc(100% - var(--space-lg));
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    transition: transform var(--motion-fast), opacity var(--motion-fast);
}
.modal-overlay.show .modal-content {
    transform: scale(1);
    opacity: 1;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-bg-muted);
}
.modal-header h3 {
    margin: 0;
    font-size: var(--fs-lg);
}
.modal-header .button-icon {
    position: absolute;
    top: var(--space-sm);
    inset-inline-end: var(--space-sm);
}
.modal-body {
    padding: var(--space-lg);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
    background-color: var(--color-bg-alt);
}
.form-group {
    margin-bottom: var(--space-md);
}
.form-group label {
    display: block;
    font-weight: var(--fw-medium);
    margin-bottom: var(--space-xs);
    font-size: var(--fs-sm);
}
.form-group textarea {
    min-height: 120px;
    resize: vertical;
}
#contact-form-response {
    margin-top: var(--space-md);
    font-size: var(--fs-sm);
}
#contact-turnstile-widget {
    display: flex;
    justify-content: center;
}
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-xs);
    margin: var(--space-lg) 0;
}
.pagination__list {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}
.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-sm);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-alt);
    color: var(--color-text);
    font-weight: var(--fw-medium);
    text-decoration: none;
}
.pagination__link:hover {
    background-color: var(--color-bg-muted);
    text-decoration: none;
}
.pagination__item.current .pagination__link {
    background-color: var(--color-primary-500);
    color: #ffffff;
    border-color: var(--color-primary-500);
    cursor: default;
}
.flex-gap {
    display: flex;
    align-items: center;
    gap: var(--space-xs)
}
.meta-separator {
    margin: 0 var(--space-xs); 
}
@media (max-width: 500px) {
    #cookie-consent-modal {
        bottom: 0;
        right: 0;
        max-width: 100%;
        width: 100%;
        border-radius: 0;
        border-bottom: none;
    }
    .cookie-modal-content {
        border-radius: 0;
    }
    .cookie-modal-body {
        max-height: 50vh;
    }
}
@media (max-width: 767px) {
    .cookie-consent__container {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-consent__text p {
        text-align: center;
        margin-bottom: var(--space-sm);
    }
    .cookie-consent__buttons {
        width: 100%;
        justify-content: space-between;
    }
    .cookie-consent__buttons .button {
        flex-grow: 1; 
    }
}
@media (max-width: 767px) {
    .hide-on-mobile {
        display: none !important;
    }
}
@media (min-width: 768px) {
    .hide-on-desktop {
        display: none !important;
    }
    #session-mobile-container {
        display: none;
    }
}
@media (max-width: 767px) {
    html {
        scroll-padding-top: calc(var(--header-height) + var(--space-md));
    }
    .main-nav {
        position: absolute;
        top: var(--header-height);
        inset-inline-end: 0;
        width: 100%;
        height: auto;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        z-index: 190;
        border-bottom: 1px solid var(--color-border);
        background-color: var(--color-bg-alt-translucent);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: opacity var(--motion-fast), visibility var(--motion-fast), transform var(--motion-fast), backdrop-filter var(--motion-fast);
    }
    .main-nav.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        position: sticky;
        top: var(--header-height);
        z-index: 200;
    }
    .main-nav__container {
        flex-direction: column;
        align-items: stretch;
        height: auto;
    }
    .main-nav__links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        height: auto;
        gap: 0;
        padding: var(--space-md);
        transition: filter var(--motion-fast), opacity var(--motion-fast);
    }
    .main-nav__links a {
        height: auto;
        padding: var(--space-sm) var(--space-xs);
        border-bottom: none;
        border-radius: var(--radius-sm);
    }
    .main-nav__links a:hover {
        background-color: var(--color-bg-muted);
    }
    .main-nav__new-thread {
        display: none;
        transition: filter var(--motion-fast), opacity var(--motion-fast);
    }
    .main-nav.show .main-nav__new-thread {
        display: flex;
        width: 100%;
        margin-top: var(--space-md);
        text-align: center;
    }
    .search-form {
        inset-inline-end: 0;
        width: 100%;
        background-color: var(--color-bg-alt-translucent);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: var(--space-md);
        border-bottom: 1px solid var(--color-border);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: opacity var(--motion-fast), visibility var(--motion-fast), transform var(--motion-fast), backdrop-filter var(--motion-fast);
    }
    .search-form.show {
        display: flex; 
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    #search-mobile-container {
        display: none;
    }
    #search-mobile-container:has(.search-form.show) {
        display: block;
        position: sticky;
        top: var(--header-height);
        z-index: 200;
    }
    .search-form__input {
        width: 100%;
    }
    .search-form__submit {
        top: 50%;
        transform: translateY(-50%);
        left: var(--space-base);
    }
    .main-nav__container > .search-form {
        display: none;
    }
    .dropdown__menu#notifications-dropdown {
        inset-inline-start: 0;
    }
    .main-nav.show:has(.dropdown__menu.show) .main-nav__links,
    .main-nav.show:has(.dropdown__menu.show) .main-nav__new-thread {
        filter: blur(4px);
        opacity: 0.6;
        pointer-events: none; 
    }
    #session-mobile-container {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
        padding: var(--space-md);
    }
    .main-nav.show:has(.dropdown__menu.show) #session-mobile-container {
        filter: none;
        opacity: 1;
        pointer-events: auto;
    }
    .site-footer__main {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "header header"
            "left   right";
        gap: 10px;
    }
    .site-footer__col.item1 {
        grid-area: header;
        border-bottom: 1px solid var(--color-border);
        justify-self: center;
        padding-bottom: 10px;
    }
    .social-links {
        justify-content: center; 
    }
    .site-footer__col.item2 {
        grid-area: left;
        justify-self: center;
    }
    .site-footer__col.item3 {
        grid-area: right;
        justify-self: center;
    }
}