:root {
    /* Основная палитра из ТЗ */
    --primary: #D32F2F;
    /* Красный */
    --primary-dark: #B71C1C;
    --secondary: #757575;
    /* Серый для текста */
    --accent: #FFC107;
    /* Золотой */
    --accent-hover: #FFA000;

    /* Фоны и поверхности */
    --bg-body: #F8F9FA;
    --bg-white: #FFFFFF;
    --bg-light: #EFEFEF;

    /* Тени и эффекты */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 8px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Шрифты */
    --font-heading: 'Open Sans', sans-serif;
    --font-body: 'Roboto', sans-serif;

    /* Цвета по умолчанию (Светлая) */
    --text-main: #333333;
    --text-secondary: #757575;
    --border-color: #eee;
    --bg-slider: #f8f9fa;
}

body.dark-mode {
    --bg-body: #121212;
    --bg-white: #1E1E1E;
    --bg-light: #2C2C2C;
    --text-main: #E0E0E0;
    --text-secondary: #B0B0B0;
    --border-color: #333;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --bg-slider: #000000;
    /* Black for dark mode */
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --bg-slider: #000000;
    /* Black for dark mode */
}

/* Ensure buttons and other elements look good in dark mode */
body.dark-mode .tag.budget {
    background: #1B5E20;
    /* Darker green background */
    color: #E8F5E9;
    /* Lighter text */
}

/* Fix Quick Access Hover in Dark Mode if needed specifically */
body.dark-mode .qa-item:hover {
    background-color: #333;
}

/* Сброс и база */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    display: block;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: var(--font-heading);
    transition: var(--transition);
    gap: 8px;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(211, 47, 47, 0.4);
}

.btn-accent {
    background-color: var(--accent);
    color: #212121;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-text {
    color: var(--primary);
    background: none;
    padding: 0;
}

.btn-text:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* SVG Icon helper */
.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.icon-lg {
    width: 32px;
    height: 32px;
}

/* === HEADER === */
.top-bar {
    background-color: #263238;
    /* Always dark */
    color: #ECEFF1;
    font-size: 0.85rem;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-links {
    display: flex;
    gap: 14px;
    align-items: center;
}

.top-link-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ECEFF1;
}

.top-link-item:hover {
    color: var(--accent);
}

.top-login-link {
    padding: 7px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f2f7ff 0%, #d9e8ff 48%, #bed7ff 100%);
    border: 1px solid rgba(198, 220, 255, 0.9);
    color: #0f2747;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 18px rgba(2, 18, 46, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.top-login-link:hover {
    color: #071a33;
    transform: translateY(-1px);
    filter: saturate(1.08);
    box-shadow: 0 11px 22px rgba(2, 18, 46, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.top-login-icon {
    width: 14px;
    height: 14px;
    flex: none;
    opacity: 0.9;
}

.top-theme-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ECEFF1;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.top-theme-toggle:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.top-notify {
    position: relative;
}

.top-notify-toggle {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ECEFF1;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.top-notify-toggle:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.top-notify-badge {
    position: absolute;
    top: -6px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    border: 1px solid #fff;
    background: #D32F2F;
    color: #fff;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-notify-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(340px, calc(100vw - 24px));
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: 0.2s ease;
    z-index: 1250;
}

.top-notify:hover .top-notify-dropdown,
.top-notify:focus-within .top-notify-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.top-notify-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid #edf1f5;
}

.top-notify-head span {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1f2a3d;
}

.top-notify-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.top-notify-head b {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.73rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.top-notify-mark-all-btn {
    border: 1px solid #d7e1ef;
    background: #fff;
    color: #1f2a3d;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.top-notify-mark-all-btn:hover {
    background: #f3f7fe;
}

.top-notify-tabs {
    display: flex;
    gap: 6px;
    padding: 0 2px 8px;
}

.top-notify-tab {
    border: 1px solid #d6e1ef;
    background: #fff;
    color: #3b4c63;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.top-notify-tab span {
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #eef2f7;
    color: #465971;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.69rem;
}

.top-notify-tab.is-active {
    border-color: #1f2a3d;
    color: #fff;
    background: #1f2a3d;
}

.top-notify-tab.is-active span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.top-notify-list {
    display: grid;
    gap: 6px;
    max-height: 290px;
    overflow-y: auto;
    padding: 0 2px;
}

.top-notify-item-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

.top-notify-item {
    display: grid;
    gap: 3px;
    border: 1px solid #e5ebf4;
    border-radius: 9px;
    padding: 8px 9px;
    text-decoration: none;
    background: #f8fbff;
    flex: 1;
}

.top-notify-item.unread {
    border-color: #fecaca;
    background: #fff7f7;
}

.top-notify-item-wrapper.unread .top-notify-item {
    border-color: #fecaca;
    background: #fff7f7;
}

.top-notify-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.top-notify-topic {
    font-size: 0.72rem;
    font-weight: 700;
    color: #1d4ed8;
    text-transform: uppercase;
}

.top-notify-title {
    font-size: 0.85rem;
    line-height: 1.35;
    color: #1f2937;
    font-weight: 600;
}

.top-notify-text {
    font-size: 0.79rem;
    color: #51657f;
    line-height: 1.35;
}

.top-notify-group-size {
    font-size: 0.7rem;
    font-weight: 700;
    color: #1f2a3d;
    border: 1px solid #d6e0ed;
    border-radius: 999px;
    background: #fff;
    padding: 1px 6px;
}

.top-notify-date {
    font-size: 0.74rem;
    color: #64748b;
}

.top-notify-mark-btn {
    border: none;
    border-left: 1px solid #e4ebf5;
    background: transparent;
    color: #1f2a3d;
    width: 36px;
    min-width: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    font-weight: 800;
}

.top-notify-mark-btn:hover {
    background: #f4f8ff;
}

.top-notify-empty {
    color: #64748b;
    font-size: 0.84rem;
    padding: 8px 10px;
}

.top-notify-all {
    display: block;
    margin-top: 8px;
    border-radius: 8px;
    padding: 8px 10px;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 700;
    color: #b91c1c;
}

.top-notify-all:hover {
    background: #fef2f2;
    color: #991b1b;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 4px 9px 4px 4px;
    cursor: pointer;
    transition: 0.2s ease;
}

.user-menu-toggle:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.13);
}

.user-avatar {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #D32F2F, #FF8F00);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.user-avatar.has-image {
    padding: 0;
    overflow: hidden;
    background: #fff;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-name {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.83rem;
    font-weight: 600;
    color: #fff;
}

.user-caret {
    width: 14px;
    height: 14px;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.user-menu:hover .user-caret,
.user-menu:focus-within .user-caret {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: 0.2s ease;
    z-index: 1200;
}

.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-head {
    padding: 9px 10px 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid #edf1f5;
}

.user-menu-head-name {
    font-size: 0.93rem;
    font-weight: 700;
    color: #1f2a3d;
}

.user-menu-head-role {
    margin-top: 2px;
    font-size: 0.78rem;
    color: #6b7280;
}

.user-menu-item {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
}

.user-menu-item:hover {
    background: #f3f6fb;
    color: #111827;
}

.user-menu-item-danger {
    color: #b91c1c;
}

.user-menu-item-danger:hover {
    background: #fef2f2;
    color: #991b1b;
}

header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-main {
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.logo-img.logo-img-has-image {
    background: #fff;
    border: 1px solid #d8e0ec;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.logo-img-file {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

body.dark-mode .logo-img.logo-img-has-image {
    background: #1f2937;
    border-color: #334155;
    box-shadow: none;
}

.brand-text {
    line-height: 1.2;
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.header-search-form {
    position: relative;
    width: 250px;
}

.header-search-input {
    width: 100%;
    min-height: 42px;
    padding: 10px 44px 10px 14px;
    border: 1px solid #d6dee9;
    border-radius: 999px;
    background: #f8fafd;
    color: #1f2937;
    font-size: 0.92rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search-input::placeholder {
    color: #8c9ab0;
}

.header-search-input:focus {
    outline: none;
    border-color: rgba(211, 47, 47, 0.56);
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.12);
    background: #fff;
}

.header-search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #7b8798;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.header-search-btn .icon {
    width: 18px;
    height: 18px;
}

.header-search-btn:hover {
    color: #1f2937;
    background: rgba(148, 163, 184, 0.15);
}

body.dark-mode .header-search-input {
    border-color: #2a3444;
    background: #111826;
    color: #e5ebf5;
}

body.dark-mode .header-search-input::placeholder {
    color: #7f8ea3;
}

body.dark-mode .header-search-input:focus {
    border-color: rgba(248, 113, 113, 0.62);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.14);
    background: #0f1624;
}

body.dark-mode .header-search-btn {
    color: #90a1b8;
}

body.dark-mode .header-search-btn:hover {
    color: #fff;
    background: rgba(148, 163, 184, 0.2);
}

/* Меню */
.nav-wrap {
    border-top: 1px solid #eee;
}

.main-menu {
    display: flex;
    gap: 5px;
}

.menu-item {
    position: relative;
}

.menu-link {
    display: block;
    padding: 16px 18px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
    border-bottom: 2px solid transparent;
}

.menu-link.active,
.menu-link:hover,
.menu-item:hover .menu-link,
.menu-item:focus-within .menu-link {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: #FFF5F5;
}

.menu-item-has-children > .menu-link {
    position: relative;
    padding-right: 30px;
}

.menu-item-has-children > .menu-link::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-60%) rotate(45deg);
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.menu-item-has-children.open > .menu-link::after {
    transform: translateY(-38%) rotate(-135deg);
}

/* Dropdown */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    min-width: 240px;
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 8px 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    border-top: 2px solid var(--primary);
    z-index: 1200;
    pointer-events: none;
}

.menu-item:hover .dropdown,
.menu-item:focus-within .dropdown,
.menu-item.open .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown a {
    display: block;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-main);
}

.dropdown a:hover {
    background: var(--bg-light);
    color: var(--primary);
    padding-left: 25px;
}

.dropdown a.active {
    background: #fff2f2;
    color: var(--primary);
    font-weight: 700;
}

/* === HERO SECTION === */
.hero {
    position: relative;
    height: 550px;
    background: linear-gradient(135deg, #1f2937 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    color: white;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0.2) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 35px;
    opacity: 0.9;
    font-weight: 300;
}

.hero-btns {
    display: flex;
    gap: 15px;
}

/* Быстрые ссылки (плавающий блок) */
.quick-access {
    margin-top: -60px;
    position: relative;
    z-index: 10;
    margin-bottom: 60px;
}

.qa-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    /* More depth */
    overflow: hidden;
    border: 1px solid var(--border-color);
    /* Subtle border for dark mode definition */
}

.qa-item {
    padding: 30px 20px;
    text-align: center;
    border-right: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-decoration: none;
    /* Ensure link underline doesn't appear */
    color: var(--text-main);
    display: block;
}

.qa-item:last-child {
    border-right: none;
}

.qa-item:hover {
    background-color: var(--bg-light);
    /* color: var(--primary); This was causing dark blue on dark grey */
    transform: translateY(-2px);
    /* Subtle lift */
}

.qa-icon {
    width: 56px;
    /* Slightly larger */
    height: 56px;
    background: var(--bg-light);
    /* Will be slightly lighter than card bg */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: var(--primary);
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.qa-item:hover .qa-icon {
    background: var(--primary);
    color: #fff;
    /* White icon on Blue bg - Great contrast */
    transform: scale(1.1) rotate(5deg);
    /* Playful animation */
    box-shadow: 0 5px 15px rgba(26, 35, 126, 0.3);
}

.qa-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    transition: color 0.3s;
}

.qa-item:hover .qa-title {
    color: var(--primary);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    /* Initially hidden */
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}


/* === SECTIONS === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-main);
    position: relative;
    margin-bottom: 0;
    /* Убрал лишний отступ, если он был причиной наложения */
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary);
    display: block;
    /* Ensure it's a block to avoid inline overlay issues */
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.news-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.news-img-wrap {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.news-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.news-card:hover .news-img {
    transform: scale(1.05);
}

.news-date-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.news-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--text-main);
}

.news-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Home specialties showcase */
.home-specialties {
    position: relative;
    background:
        radial-gradient(circle at 12% 15%, rgba(255, 193, 7, 0.13), transparent 33%),
        radial-gradient(circle at 88% 82%, rgba(211, 47, 47, 0.11), transparent 38%),
        var(--bg-white);
    padding: 90px 0;
    overflow: hidden;
}

.home-specialties::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255, 193, 7, 0.18), rgba(255, 193, 7, 0));
    pointer-events: none;
}

.home-specialties::after {
    content: '';
    position: absolute;
    bottom: -110px;
    left: -100px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(211, 47, 47, 0.18), rgba(211, 47, 47, 0));
    pointer-events: none;
}

.home-specialties .container {
    position: relative;
    z-index: 1;
}

.home-specialties .spec-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.home-specialties .spec-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 26px;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(165deg, #ffffff 0%, #fbfcfe 46%, #f5f8fc 100%);
    box-shadow: 0 10px 28px rgba(31, 41, 55, 0.08);
    overflow: hidden;
    transition: transform 0.32s ease, box-shadow 0.32s ease, border-color 0.32s ease;
}

.home-specialties .spec-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(255, 193, 7, 0.16), rgba(255, 255, 255, 0) 42%, rgba(211, 47, 47, 0.1));
    opacity: 0;
    transition: opacity 0.32s ease;
    pointer-events: none;
}

.home-specialties .spec-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 75%);
}

.home-specialties .spec-card:hover {
    transform: translateY(-7px);
    border-color: rgba(211, 47, 47, 0.32);
    box-shadow: 0 18px 34px rgba(31, 41, 55, 0.16);
}

.home-specialties .spec-card:hover::before {
    opacity: 1;
}

.home-specialties .spec-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.home-specialties .spec-pulse {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--accent), var(--primary));
    box-shadow: 0 0 0 8px rgba(211, 47, 47, 0.12);
    flex-shrink: 0;
}

.home-specialties .spec-code {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(26, 35, 126, 0.07);
    color: #374151;
    font-family: "Roboto Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-specialties .spec-name {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 14px;
    color: #1f2937;
}

.home-specialties .spec-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.home-specialties .tag {
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef2f7;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
}

.home-specialties .tag.budget {
    background: rgba(46, 125, 50, 0.14);
    color: #216a2c;
}

.home-specialties .tag.paid {
    background: rgba(239, 108, 0, 0.16);
    color: #b85500;
}

.home-specialties .spec-description {
    margin-bottom: 24px;
    color: #5b6472;
    font-size: 0.95rem;
    line-height: 1.6;
    min-height: 4.8em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-specialties .spec-btn {
    width: 100%;
    margin-top: auto;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1rem;
    box-shadow: 0 8px 20px rgba(211, 47, 47, 0.3);
}

.home-specialties .spec-btn:hover {
    box-shadow: 0 12px 24px rgba(183, 28, 28, 0.36);
}

body.dark-mode .home-specialties {
    background:
        radial-gradient(circle at 12% 15%, rgba(255, 193, 7, 0.16), transparent 33%),
        radial-gradient(circle at 88% 82%, rgba(211, 47, 47, 0.18), transparent 38%),
        var(--bg-white);
}

body.dark-mode .home-specialties .spec-card {
    background: linear-gradient(165deg, #252525 0%, #1f1f1f 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .home-specialties .spec-code {
    background: rgba(255, 193, 7, 0.16);
    color: #ffe08a;
}

body.dark-mode .home-specialties .spec-name {
    color: #f0f0f0;
}

body.dark-mode .home-specialties .tag {
    background: #363636;
    color: #d3d3d3;
}

body.dark-mode .home-specialties .tag.paid {
    background: rgba(239, 108, 0, 0.3);
    color: #ffd4a6;
}

body.dark-mode .home-specialties .spec-description {
    color: #c7c7c7;
}
/* Call to Action (Admission) */
.cta-section {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(circle at 12% 108%, rgba(255, 170, 64, 0.36) 0%, rgba(255, 170, 64, 0) 40%),
        radial-gradient(circle at 96% 4%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 32%),
        linear-gradient(118deg, #be1822 0%, #98101a 44%, #7c0f18 100%);
    color: #fff;
    padding: clamp(28px, 3.6vw, 52px);
    margin: 80px 0;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 58px rgba(89, 10, 20, 0.34);
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(112deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 42%),
        repeating-linear-gradient(-34deg, rgba(255, 255, 255, 0.06) 0px, rgba(255, 255, 255, 0.06) 1px, transparent 1px, transparent 20px);
    opacity: 0.46;
    pointer-events: none;
}

.cta-section::after {
    content: '';
    position: absolute;
    inset: auto -18% -55% auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.24) 0%, rgba(255, 193, 7, 0) 70%);
    pointer-events: none;
}

.cta-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: clamp(24px, 3vw, 42px);
    align-items: center;
}

.cta-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 8px;
}

.cta-kicker {
    display: inline-flex;
    align-items: center;
    width: max-content;
    margin-bottom: 16px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(12, 20, 34, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.34);
    font-size: 0.81rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cta-title {
    font-size: clamp(2rem, 3.2vw, 2.8rem);
    line-height: 1.1;
    margin-bottom: 16px;
    font-family: var(--font-heading);
}

.cta-text {
    font-size: 1.05rem;
    line-height: 1.58;
    max-width: 620px;
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.94);
}

.cta-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cta-points span {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding: 10px 14px 10px 38px;
    border-radius: 14px;
    background: rgba(14, 21, 34, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.26);
    font-size: 0.89rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.cta-points span::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 193, 7, 0.95);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.24);
    transform: translateY(-50%);
}

.cta-points span::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 50%;
    width: 5px;
    height: 9px;
    border-right: 2px solid #7a1318;
    border-bottom: 2px solid #7a1318;
    transform: translateY(-58%) rotate(45deg);
}

.cta-form-wrap {
    position: relative;
    width: min(100%, 530px);
    margin-left: auto;
    background: linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 22px;
    overflow: hidden;
    padding: clamp(22px, 2.6vw, 30px);
    border: 1px solid #d9e2ee;
    box-shadow:
        0 22px 42px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
    animation: cta-card-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cta-form-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: inherit;
    background: linear-gradient(90deg, #d32f2f 0%, #ef4444 55%, #f97316 100%);
    pointer-events: none;
}

@keyframes cta-card-enter {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

.cta-alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.45;
    border: 1px solid transparent;
}

.cta-alert.success {
    color: #1b5e20;
    background: #e9f7ec;
    border-color: #b9e4c1;
}

.cta-alert.error {
    color: #8a1c21;
    background: #ffeef0;
    border-color: #f4c2c8;
}

.cta-form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.cta-form-head {
    margin-bottom: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.cta-form-title {
    margin: 0;
    font-size: 1.56rem;
    line-height: 1.25;
    color: #0f172a;
    font-family: var(--font-heading);
}

.cta-form-subtitle {
    margin: 6px 0 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #5f6f85;
}

.cta-field {
    display: flex;
    flex-direction: column;
}

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

.cta-label {
    display: block;
    font-size: 0.79rem;
    font-weight: 700;
    color: #2f3f56;
    margin-bottom: 6px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cta-input {
    width: 100%;
    border: 1px solid #c5d1e1;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: #0f172a;
    background: #f9fbfe;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cta-input::placeholder {
    color: #8a97a8;
}

.cta-input:hover {
    border-color: #93a4bb;
    background: #fff;
}

.cta-input:focus {
    outline: none;
    border-color: #c71f28;
    box-shadow:
        0 0 0 4px rgba(199, 31, 40, 0.14),
        0 8px 18px rgba(148, 163, 184, 0.18);
    background: #fff;
}

.cta-textarea {
    min-height: 116px;
    resize: vertical;
    line-height: 1.45;
}

.cta-submit {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-top: 6px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #d32f2f 0%, #a9161d 100%);
    color: #fff;
    border-radius: 12px;
    font-size: 1.01rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 24px rgba(180, 28, 35, 0.28);
}

.cta-submit::after {
    content: '';
    position: absolute;
    top: -140%;
    left: -32%;
    width: 38%;
    height: 380%;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.34) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg);
    transition: transform 0.65s ease;
}

.cta-submit:hover {
    background: linear-gradient(135deg, #c32424 0%, #94131a 100%);
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(165, 24, 32, 0.34);
}

.cta-submit:hover::after {
    transform: translateX(290%) skewX(-20deg);
}

.cta-note {
    margin-top: 10px;
    font-size: 0.79rem;
    color: #5f6f85;
    line-height: 1.45;
}

.cta-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .cta-form-wrap {
        animation: none;
    }

    .cta-submit::after {
        display: none;
    }
}

body.dark-mode .cta-section {
    background:
        radial-gradient(circle at 12% 108%, rgba(251, 146, 60, 0.22) 0%, rgba(251, 146, 60, 0) 42%),
        radial-gradient(circle at 96% 4%, rgba(248, 250, 252, 0.12) 0%, rgba(248, 250, 252, 0) 36%),
        linear-gradient(118deg, #7f1d1d 0%, #63161a 46%, #4b1118 100%);
}

body.dark-mode .cta-section::before {
    opacity: 0.28;
}

body.dark-mode .cta-form-wrap {
    background: linear-gradient(160deg, #1b2432 0%, #111927 100%);
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 20px 38px rgba(2, 6, 23, 0.46);
}

body.dark-mode .cta-form-wrap::before {
    background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
}

body.dark-mode .cta-form-head {
    border-color: rgba(148, 163, 184, 0.28);
}

body.dark-mode .cta-form-title {
    color: #e2e8f0;
}

body.dark-mode .cta-form-subtitle {
    color: #9fb0c8;
}

body.dark-mode .cta-label {
    color: #d2deed;
}

body.dark-mode .cta-points span {
    background: rgba(13, 20, 33, 0.44);
    border-color: rgba(248, 250, 252, 0.26);
}

body.dark-mode .cta-input {
    background: #0f1726;
    border-color: #3a4a60;
    color: #f1f5f9;
}

body.dark-mode .cta-input::placeholder {
    color: #8aa0bb;
}

body.dark-mode .cta-input:hover {
    border-color: #5a6d86;
}

body.dark-mode .cta-input:focus {
    border-color: #ef4444;
    box-shadow:
        0 0 0 3px rgba(239, 68, 68, 0.24),
        0 8px 20px rgba(2, 6, 23, 0.56);
    background: #111b2e;
}

body.dark-mode .cta-note {
    color: #9fb0c8;
}

body.dark-mode .cta-alert.success {
    color: #9ee3a7;
    background: rgba(46, 125, 50, 0.22);
    border-color: rgba(46, 125, 50, 0.5);
}

body.dark-mode .cta-alert.error {
    color: #ffc2c7;
    background: rgba(198, 40, 40, 0.22);
    border-color: rgba(198, 40, 40, 0.5);
}

/* Footer */
.site-footer {
    position: relative;
    background:
        radial-gradient(circle at 8% -8%, rgba(255, 193, 7, 0.18), transparent 34%),
        radial-gradient(circle at 94% 116%, rgba(211, 47, 47, 0.18), transparent 38%),
        linear-gradient(152deg, #0f172a 0%, #0c1324 54%, #080f1e 100%);
    color: #d1dceb;
    padding: 56px 0 0;
    margin-top: auto;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1180px, calc(100% - 48px));
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 193, 7, 0) 0%, rgba(255, 193, 7, 0.46) 18%, rgba(211, 47, 47, 0.5) 50%, rgba(255, 193, 7, 0.46) 82%, rgba(255, 193, 7, 0) 100%);
    opacity: 0.78;
    pointer-events: none;
}

.site-footer::after {
    content: '';
    position: absolute;
    right: -130px;
    bottom: -180px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0) 72%);
    pointer-events: none;
}

.site-footer .container {
    position: relative;
    z-index: 1;
}

.site-footer-main {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding-bottom: 24px;
}

.site-footer-brand,
.site-footer-section {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 22px 20px;
}

.site-footer-brand::before,
.site-footer-section::before {
    display: none;
}

.site-footer-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0;
    line-height: 1.3;
    max-width: 100%;
    width: fit-content;
}

.site-footer-description {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.62;
    color: #c5d3e6;
}

.site-footer-hours {
    margin: 2px 0 0;
    font-size: 0.84rem;
    color: #93a8c4;
}

.site-footer-social {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.site-footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.36);
    background: rgba(15, 23, 42, 0.65);
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.site-footer-social-link:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 193, 7, 0.82);
    background: rgba(255, 193, 7, 0.2);
}

.site-footer-title {
    color: #f8fafc;
    font-size: 1.02rem;
    margin: 0;
    font-weight: 700;
}

.site-footer-list {
    display: grid;
    gap: 11px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer-list li {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
}

.site-footer-list a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #dbe8fb;
    text-decoration: none;
    transition: color 0.22s ease;
}

.site-footer-list a::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 193, 7, 0.75);
    transform: scale(0.62);
    transition: transform 0.22s ease, opacity 0.22s ease;
    opacity: 0.85;
}

.site-footer-list a:hover {
    color: #ffffff;
}

.site-footer-list a:hover::before {
    transform: scale(1);
    opacity: 1;
}

.site-footer-contacts li {
    max-width: 32ch;
    overflow-wrap: anywhere;
    color: #bdcde2;
}

.site-footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, 0.24);
    background: linear-gradient(180deg, rgba(7, 12, 24, 0.74) 0%, rgba(5, 9, 18, 0.9) 100%);
    padding: 16px 0 20px;
}

.site-footer-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.site-footer-copy {
    flex: 1 1 320px;
    min-width: 0;
    font-size: 0.87rem;
    color: #9db1ce;
}

.site-footer-bottom-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin-left: auto;
    flex: 1 1 420px;
}

.site-footer-dev {
    font-size: 0.78rem;
    color: #7e93b3;
    text-align: right;
    letter-spacing: 0.01em;
}

.site-footer-bottom-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 0 0 auto;
    min-width: 0;
    gap: 10px 18px;
}

.site-footer-bottom-links a {
    font-size: 0.88rem;
    font-weight: 500;
    color: #dbe8ff;
    text-decoration: none;
    text-underline-offset: 4px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.site-footer-bottom-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

body.dark-mode .site-footer-brand,
body.dark-mode .site-footer-section {
    background: linear-gradient(165deg, rgba(13, 20, 36, 0.9) 0%, rgba(8, 14, 28, 0.95) 100%);
    border-color: rgba(148, 163, 184, 0.32);
}

/* Адаптив */
@media (max-width: 992px) {
    .top-links {
        gap: 10px;
    }

    .top-link-item[href^="tel"],
    .top-link-item[href^="mailto"] {
        display: none;
    }

    .user-name {
        max-width: 120px;
    }

    .header-search-form {
        width: 220px;
    }

    .qa-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-specialties .spec-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cta-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .cta-content {
        padding-right: 0;
    }

    .cta-form-wrap {
        width: 100%;
        margin-left: 0;
    }

    .site-footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .site-footer-brand {
        grid-column: 1 / -1;
    }

    .site-footer-bottom-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-footer-bottom-links {
        margin-left: 0;
        justify-content: flex-start;
        flex: 1 1 auto;
    }

    .site-footer-bottom-right {
        align-items: flex-start;
        margin-left: 0;
    }

    .site-footer-dev {
        text-align: left;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .top-bar .container {
        justify-content: flex-end;
    }

    .btn-accessible {
        display: none;
    }

    .user-name {
        max-width: 90px;
    }

    .user-menu-dropdown {
        right: -8px;
        width: 230px;
    }

    .top-notify-dropdown {
        right: 0;
    }

    .main-menu {
        display: none;
    }

    .header-search-form {
        width: 190px;
    }

    /* Бургер нужен */
    .qa-grid {
        grid-template-columns: 1fr;
    }

    .home-specialties .spec-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .home-specialties {
        padding: 70px 0;
    }

    .home-specialties .spec-card {
        padding: 22px;
    }

    .cta-section {
        padding: 26px 16px;
        border-radius: 20px;
        margin: 56px 0;
    }

    .cta-form-wrap {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .cta-title {
        font-size: clamp(1.7rem, 8.4vw, 2.16rem);
    }

    .cta-points span {
        width: 100%;
    }

    .cta-form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hero-content {
        text-align: center;
    }

    .hero-btns {
        justify-content: center;
        flex-wrap: wrap;
    }

    .site-footer {
        padding-top: 50px;
    }

    .site-footer-main {
        grid-template-columns: 1fr;
        gap: 12px;
        padding-bottom: 22px;
    }

    .site-footer-brand,
    .site-footer-section {
        padding: 18px;
    }

    .site-footer-bottom {
        padding: 14px 0 18px;
    }

    .site-footer-bottom-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .user-name {
        display: none;
    }

    .user-menu-toggle {
        padding-right: 6px;
    }

    .top-notify-dropdown {
        right: 0;
    }

    .header-main {
        gap: 10px;
    }

    .header-search-form {
        width: 150px;
    }
}

/* --- Contacts Page Styles --- */
.contacts-page {
    position: relative;
}

.contacts-hero {
    margin-bottom: 26px;
    padding: 28px 30px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 14% 18%, rgba(255, 193, 7, 0.2), transparent 36%),
        radial-gradient(circle at 82% 70%, rgba(211, 47, 47, 0.16), transparent 40%),
        linear-gradient(130deg, #ffffff 0%, #f7f9fc 100%);
    border: 1px solid #e8edf4;
}

.contacts-kicker {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(26, 35, 126, 0.08);
    color: #2f3f56;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.contacts-subtitle {
    max-width: 760px;
    margin-top: 16px;
    color: #5b6679;
    font-size: 1rem;
    line-height: 1.65;
}

.contacts-layout {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.contacts-cards {
    display: grid;
    gap: 14px;
}

.contact-card {
    background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e9f1;
    border-radius: 14px;
    padding: 17px;
    box-shadow: 0 8px 24px rgba(26, 38, 60, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(26, 38, 60, 0.12);
    border-color: rgba(211, 47, 47, 0.26);
}

.contact-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.contact-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(211, 47, 47, 0.14), rgba(255, 193, 7, 0.22));
    border: 1px solid rgba(211, 47, 47, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon-badge svg {
    width: 21px;
    height: 21px;
    fill: #912028;
}

.contact-title {
    margin: 0;
    font-size: 1rem;
    color: #1f2937;
}

.contact-hint {
    margin: 2px 0 0;
    color: #7a8597;
    font-size: 0.82rem;
}

.contact-value {
    margin: 0;
    color: #445063;
    font-size: 0.95rem;
    line-height: 1.6;
}

.contact-link {
    color: #1f2937;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed rgba(211, 47, 47, 0.45);
}

.contact-link:hover {
    color: #b71c1c;
    border-bottom-color: #b71c1c;
}

.contacts-main {
    display: grid;
    gap: 20px;
}

.contacts-map-panel {
    background: #ffffff;
    border: 1px solid #e5e9f1;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(26, 38, 60, 0.08);
}

.contacts-map-frame {
    width: 100%;
    height: 355px;
    border: 0;
    display: block;
}

.contacts-map-foot {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #edf1f6;
    color: #5f6b7f;
    font-size: 0.9rem;
}

.contacts-map-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #b71c1c;
    font-weight: 600;
    text-decoration: none;
}

.contacts-map-action:hover {
    color: #8f1111;
}

.contacts-feedback-panel {
    background: linear-gradient(160deg, #ffffff 0%, #f8fafd 100%);
    border: 1px solid #e5e9f1;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 10px 26px rgba(26, 38, 60, 0.08);
}

.contacts-feedback-head h2 {
    margin: 0 0 6px;
    font-size: 1.55rem;
    color: #1f2937;
}

.contacts-feedback-head p {
    margin: 0 0 16px;
    color: #647084;
    line-height: 1.6;
}

.contacts-alert {
    margin-bottom: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.45;
    border: 1px solid transparent;
}

.contacts-alert.success {
    color: #1b5e20;
    background: #e9f7ec;
    border-color: #b9e4c1;
}

.contacts-alert.error {
    color: #8a1c21;
    background: #ffeef0;
    border-color: #f4c2c8;
}

.contacts-feedback-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contacts-feedback-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.contacts-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 4px;
}

.contacts-input {
    width: 100%;
    border: 1px solid #d8dee8;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 0.95rem;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contacts-input:focus {
    outline: none;
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
}

.contacts-textarea {
    min-height: 100px;
    resize: vertical;
}

.contacts-submit-btn {
    width: 100%;
    margin-top: 6px;
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: #fff;
    border-radius: 10px;
    font-size: 1rem;
    box-shadow: 0 8px 18px rgba(183, 28, 28, 0.28);
}

.contacts-submit-btn:hover {
    background: linear-gradient(135deg, #be2424 0%, #9f1414 100%);
}

.contacts-privacy {
    margin-top: 8px;
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.45;
}

body.dark-mode .contacts-hero {
    background:
        radial-gradient(circle at 14% 18%, rgba(255, 193, 7, 0.15), transparent 36%),
        radial-gradient(circle at 82% 70%, rgba(211, 47, 47, 0.22), transparent 40%),
        linear-gradient(130deg, #272727 0%, #1f1f1f 100%);
    border-color: #3a3a3a;
}

body.dark-mode .contacts-kicker {
    background: rgba(255, 193, 7, 0.14);
    color: #ffd67d;
}

body.dark-mode .contacts-subtitle {
    color: #c1c8d5;
}

body.dark-mode .contact-card,
body.dark-mode .contacts-map-panel,
body.dark-mode .contacts-feedback-panel {
    background: linear-gradient(160deg, #262626 0%, #1f1f1f 100%);
    border-color: #3a3a3a;
}

body.dark-mode .contact-title,
body.dark-mode .contacts-feedback-head h2 {
    color: #f0f0f0;
}

body.dark-mode .contact-hint,
body.dark-mode .contact-value,
body.dark-mode .contacts-feedback-head p,
body.dark-mode .contacts-map-foot,
body.dark-mode .contacts-privacy {
    color: #b9c1cd;
}

body.dark-mode .contact-link {
    color: #f5f5f5;
    border-bottom-color: rgba(255, 193, 7, 0.6);
}

body.dark-mode .contact-link:hover {
    color: #ffd67d;
    border-bottom-color: #ffd67d;
}

body.dark-mode .contacts-input {
    background: #1a1a1a;
    border-color: #444;
    color: #efefef;
}

body.dark-mode .contacts-alert.success {
    color: #9ee3a7;
    background: rgba(46, 125, 50, 0.22);
    border-color: rgba(46, 125, 50, 0.5);
}

body.dark-mode .contacts-alert.error {
    color: #ffc2c7;
    background: rgba(198, 40, 40, 0.22);
    border-color: rgba(198, 40, 40, 0.5);
}

@media (max-width: 1100px) {
    .contacts-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .contacts-hero {
        padding: 20px;
        border-radius: 14px;
    }

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

    .contacts-map-frame {
        height: 280px;
    }

    .contacts-map-foot {
        flex-direction: column;
        align-items: flex-start;
    }

    .contacts-feedback-panel {
        padding: 16px;
        border-radius: 12px;
    }

    .contacts-feedback-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
/* --- Gallery Page Styles --- */
.gallery-page,
.gallery-album-page {
    position: relative;
    padding: clamp(42px, 5vw, 74px) 0;
    background:
        radial-gradient(circle at 10% -8%, rgba(211, 47, 47, 0.09), transparent 38%),
        radial-gradient(circle at 90% 105%, rgba(255, 193, 7, 0.14), transparent 44%),
        linear-gradient(180deg, #f4f7fb 0%, #edf2f9 100%);
    overflow: hidden;
}

.gallery-page .container,
.gallery-album-page .container {
    position: relative;
    z-index: 1;
}

.gallery-page .section-title,
.gallery-album-page .section-title {
    margin-bottom: 18px;
}

.gallery-page .section-title::after,
.gallery-album-page .section-title::after {
    width: 74px;
    bottom: -12px;
}

.gallery-page .empty-message,
.gallery-album-page .empty-message {
    margin-top: 24px;
    padding: 34px 24px;
    border-radius: 16px;
    border: 1px dashed rgba(15, 23, 42, 0.2);
    background: rgba(255, 255, 255, 0.82);
    text-align: center;
    color: var(--text-secondary);
}

.gallery-page .empty-message p,
.gallery-album-page .empty-message p {
    margin: 0;
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
    margin-top: 22px;
}

.album-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.album-card:hover {
    transform: translateY(-6px);
    border-color: rgba(211, 47, 47, 0.3);
    box-shadow: 0 20px 36px rgba(15, 23, 42, 0.16);
}

.album-cover {
    position: relative;
    min-height: 190px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 193, 7, 0.3), transparent 46%),
        linear-gradient(135deg, #d32f2f 0%, #8d3f50 44%, #1f2937 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.album-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.46) 0%, rgba(2, 6, 23, 0.04) 56%, rgba(2, 6, 23, 0) 100%);
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease, filter 0.45s ease;
}

.album-card:hover .album-cover img {
    transform: scale(1.08);
    filter: saturate(1.08);
}

.album-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 24% 24%, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 46%),
        linear-gradient(135deg, #d32f2f 0%, #8d3f50 46%, #293241 100%);
}

.album-placeholder::before {
    content: '';
    width: 62px;
    height: 44px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.album-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(2, 6, 23, 0.7);
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    backdrop-filter: blur(2px);
}

.album-card h3 {
    margin: 0;
    padding: 14px 16px 18px;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    color: #1f2937;
}

/* --- Specialties List Page --- */
.specialties-page {
    position: relative;
}

.specialties-page::before,
.specialties-page::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
}

.specialties-page::before {
    width: 340px;
    height: 340px;
    top: 92px;
    left: -180px;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.18), rgba(255, 193, 7, 0));
}

.specialties-page::after {
    width: 360px;
    height: 360px;
    right: -190px;
    bottom: 40px;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.18), rgba(211, 47, 47, 0));
}

.specialties-page .container {
    position: relative;
    z-index: 1;
}

.specialties-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 26px;
    padding: 22px 24px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background:
        radial-gradient(circle at 14% 12%, rgba(255, 193, 7, 0.2), transparent 34%),
        radial-gradient(circle at 90% 82%, rgba(211, 47, 47, 0.14), transparent 36%),
        linear-gradient(165deg, #ffffff 0%, #f8fbff 52%, #f2f7ff 100%);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
}

.specialties-page-kicker {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(211, 47, 47, 0.11);
    border: 1px solid rgba(211, 47, 47, 0.23);
    color: #9f1239;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.specialties-page .section-title {
    margin: 10px 0 0;
    font-size: clamp(1.95rem, 3vw, 2.55rem);
    line-height: 1.15;
}

.specialties-page .section-title::after {
    bottom: -14px;
    width: 72px;
}

.specialties-page .section-subtitle {
    text-align: left;
    margin: 18px 0 0;
    max-width: 58ch;
    color: #5d6d83;
    font-size: 1rem;
}

.specialties-page-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 250px;
}

.specialties-stat-card {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.specialties-stat-card strong {
    display: block;
    color: #0f172a;
    font-size: 1.48rem;
    line-height: 1;
    font-weight: 800;
}

.specialties-stat-card span {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.specialties-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.specialties-page .specialty-card {
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: linear-gradient(160deg, #ffffff 0%, #f9fbff 56%, #f3f7ff 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.specialties-page .specialty-card:hover {
    transform: translateY(-6px);
    border-color: rgba(211, 47, 47, 0.33);
    box-shadow: 0 24px 40px rgba(15, 23, 42, 0.16);
}

.specialties-page .specialty-image {
    position: relative;
    min-height: 192px;
    overflow: hidden;
    background: #eef2f7;
}

.specialties-page .specialty-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.05) 0%, rgba(2, 6, 23, 0.48) 100%);
    pointer-events: none;
}

.specialties-page .specialty-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.38s ease;
}

.specialties-page .specialty-card:hover .specialty-image img {
    transform: scale(1.06);
}

.specialties-page .specialty-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 14% 12%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 34%),
        linear-gradient(140deg, #d32f2f 0%, #a1455d 44%, #475569 100%);
}

.specialties-page .specialty-image-placeholder span {
    width: 66px;
    height: 66px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.52);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.specialties-page .specialty-content {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.specialties-page .specialty-code {
    display: inline-flex;
    align-items: center;
    width: max-content;
    margin-bottom: 12px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(211, 47, 47, 0.2);
    background: rgba(211, 47, 47, 0.1);
    color: #9f1239;
    font-family: "Roboto Mono", monospace;
    font-size: 0.82rem;
    font-weight: 700;
}

.specialties-page .specialty-content h3 {
    margin: 0 0 14px;
    color: #0f172a;
    font-size: 1.43rem;
    line-height: 1.28;
    letter-spacing: -0.01em;
}

.specialties-page .specialty-info {
    display: grid;
    gap: 0;
    flex: 1;
}

.specialties-page .info-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(0, 1.35fr);
    gap: 10px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(15, 23, 42, 0.16);
    font-size: 0.94rem;
    color: #334155;
}

.specialties-page .info-row .label {
    color: #64748b;
    font-weight: 500;
}

.specialties-page .info-row span:last-child {
    color: #0f172a;
    font-weight: 500;
}

.specialties-page .specialty-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.14);
}

.specialties-page .specialty-cost .free {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(46, 125, 50, 0.24);
    background: #e8f5e9;
    color: #1b5e20;
    font-size: 0.85rem;
    font-weight: 700;
}

.specialties-page .specialty-cost .paid {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(245, 124, 0, 0.22);
    background: #fff4e5;
    color: #c2410c;
    font-size: 0.85rem;
    font-weight: 700;
}

.specialties-page .btn-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 122px;
    padding: 0 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #d32f2f 0%, #bf1f1f 100%);
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 16px rgba(211, 47, 47, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.specialties-page .btn-details:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #be2424 0%, #a51616 100%);
    box-shadow: 0 12px 20px rgba(211, 47, 47, 0.38);
    color: #fff;
}

.specialties-page .empty-message {
    border-radius: 16px;
    border: 1px dashed rgba(15, 23, 42, 0.25);
    background: rgba(255, 255, 255, 0.88);
    padding: 30px 24px;
    text-align: center;
    color: #526178;
}

body.dark-mode .specialties-page-head,
body.dark-mode .specialties-page .specialty-card,
body.dark-mode .specialties-page .empty-message {
    background: rgba(20, 27, 40, 0.92);
    border-color: #2a3444;
    box-shadow: none;
}

body.dark-mode .specialties-page .section-title,
body.dark-mode .specialties-page .specialty-content h3,
body.dark-mode .specialties-stat-card strong,
body.dark-mode .specialties-page .info-row span:last-child {
    color: #e5ebf5;
}

body.dark-mode .specialties-page .section-subtitle,
body.dark-mode .specialties-stat-card span,
body.dark-mode .specialties-page .info-row .label,
body.dark-mode .specialties-page .empty-message {
    color: #a8b6cb;
}

body.dark-mode .specialties-page .specialties-stat-card {
    background: rgba(17, 24, 38, 0.86);
    border-color: #2a3444;
}

body.dark-mode .specialties-page .specialty-code {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.32);
    color: #fecaca;
}

body.dark-mode .specialties-page .info-row,
body.dark-mode .specialties-page .specialty-footer {
    border-color: #2a3444;
}

body.dark-mode .specialties-page .specialty-cost .free {
    background: rgba(27, 94, 32, 0.34);
    border-color: rgba(74, 222, 128, 0.38);
    color: #bbf7d0;
}

body.dark-mode .specialties-page .specialty-cost .paid {
    background: rgba(154, 52, 18, 0.28);
    border-color: rgba(251, 146, 60, 0.4);
    color: #fdba74;
}

@media (max-width: 1100px) {
    .specialties-page-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .specialties-page-stats {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 860px) {
    .specialties-list {
        grid-template-columns: 1fr;
    }

    .specialties-page .specialty-content h3 {
        font-size: 1.24rem;
    }
}

@media (max-width: 560px) {
    .specialties-page-head {
        padding: 16px;
    }

    .specialties-page .specialty-content {
        padding: 16px;
    }

    .specialties-page .info-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .specialties-page .specialty-footer {
        flex-wrap: wrap;
    }

    .specialties-page .btn-details {
        width: 100%;
    }
}

/* --- Specialty Detail Page Styles --- */
.specialty-detail-section {
    padding: clamp(44px, 6vw, 72px) 0 clamp(48px, 6vw, 72px);
}

.specialty-detail-section .breadcrumb {
    margin-bottom: clamp(18px, 3vw, 28px);
}

.specialty-header {
    text-align: center;
    margin-bottom: 40px;
}

.specialty-code-large {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.specialty-header h1 {
    font-size: 2rem;
    color: var(--text-main);
    margin: 0;
}

.specialty-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

.specialty-image-large {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    background: #eef2f7;
}

.specialty-image-large img {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
}

.specialty-description {
    line-height: 1.8;
    color: var(--text-main);
}

.specialty-description > :first-child {
    margin-top: 0;
}

.specialty-description > :last-child {
    margin-bottom: 0;
}

.specialty-description h2 {
    color: var(--text-main);
    margin: 0 0 20px;
}

.specialty-description p {
    margin: 0 0 18px;
}

.specialty-sidebar .info-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.specialty-sidebar .info-card h3 {
    margin: 0 0 20px;
    font-size: 1.1rem;
    color: var(--text-main);
}

.info-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.info-item .value {
    font-weight: 500;
    color: var(--text-main);
}

.document-link {
    display: block;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.3s;
}

.document-link:hover {
    background: var(--bg-body);
}

.btn-contact {
    display: block;
    text-align: center;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    margin-top: 15px;
    transition: background 0.3s;
}

.btn-contact:hover {
    background: var(--accent);
}

.btn-back {
    display: inline-flex;
    padding: 12px 24px;
    border: 2px solid var(--primary);
    color: var(--primary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-back:hover {
    background: var(--primary);
    color: #fff;
}

.specialty-page .specialty-footer {
    margin-top: 30px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 900px) {
    .specialty-detail-section {
        padding: 36px 0 56px;
    }

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

    .specialty-image-large img {
        height: 240px;
    }
}

/* --- Fixes for Overlap and Breadcrumbs --- */
.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 10px;
    /* POSITIVE margin to avoid overlap */
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 30px;
    color: var(--text-secondary);
    /* Visible in dark mode */
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .separator {
    margin: 0 5px;
    color: var(--text-secondary);
}

/* --- Gallery Album Page --- */
.gallery-album-page .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.gallery-album-page .breadcrumb .separator {
    margin: 0;
    color: rgba(100, 116, 139, 0.75);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.photo-item {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.11);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
    background: #dde4ef;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.photo-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.4) 0%, rgba(2, 6, 23, 0) 58%);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.photo-item:hover {
    transform: translateY(-4px);
    border-color: rgba(211, 47, 47, 0.32);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

.photo-item:hover img {
    transform: scale(1.08);
}

.photo-item:hover::after {
    opacity: 1;
}

.gallery-back-wrap {
    margin-top: 34px;
}

.album-desc {
    max-width: 72ch;
    margin: 0;
    text-align: left;
    color: var(--text-secondary);
    line-height: 1.72;
}

.gallery-album-page .btn-back {
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 999px;
    border-width: 1px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.gallery-album-page .btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(183, 28, 28, 0.2);
}

@media (max-width: 900px) {
    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }
}

@media (max-width: 640px) {
    .gallery-page,
    .gallery-album-page {
        padding: 34px 0 52px;
    }

    .albums-grid,
    .photos-grid {
        grid-template-columns: 1fr;
    }

    .album-card h3 {
        padding: 12px 14px 16px;
        font-size: 1rem;
    }

    .gallery-page .empty-message,
    .gallery-album-page .empty-message {
        padding: 26px 16px;
    }
}

body.dark-mode .gallery-page,
body.dark-mode .gallery-album-page {
    background:
        radial-gradient(circle at 12% -2%, rgba(255, 193, 7, 0.12), transparent 42%),
        radial-gradient(circle at 92% 104%, rgba(239, 68, 68, 0.14), transparent 46%),
        linear-gradient(180deg, #121a27 0%, #0f1521 100%);
}

body.dark-mode .gallery-page .empty-message,
body.dark-mode .gallery-album-page .empty-message {
    border-color: #2a3444;
    background: rgba(20, 27, 40, 0.78);
    color: #b9c6da;
}

body.dark-mode .album-card {
    background: linear-gradient(180deg, rgba(24, 32, 47, 0.96) 0%, rgba(19, 26, 39, 0.96) 100%);
    border-color: #2a3444;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

body.dark-mode .album-card:hover {
    border-color: rgba(248, 113, 113, 0.45);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.42);
}

body.dark-mode .album-cover {
    border-bottom-color: #2a3444;
}

body.dark-mode .album-card h3 {
    color: #e3eaf8;
}

body.dark-mode .album-count {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(2, 6, 23, 0.8);
}

body.dark-mode .photo-item {
    border-color: #2a3444;
    background: #1a2433;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

body.dark-mode .photo-item:hover {
    border-color: rgba(248, 113, 113, 0.45);
}

body.dark-mode .gallery-album-page .btn-back {
    border-color: #2a3444;
    color: #d7e2f4;
    background: rgba(20, 27, 40, 0.85);
}

body.dark-mode .gallery-album-page .btn-back:hover {
    border-color: rgba(248, 113, 113, 0.5);
    color: #fff;
    background: rgba(211, 47, 47, 0.82);
}

/* --- News Feed (Index) --- */
.news-page {
    position: relative;
    padding: clamp(52px, 7vw, 86px) 0;
    background:
        radial-gradient(circle at 12% 0%, rgba(211, 47, 47, 0.12), transparent 48%),
        radial-gradient(circle at 88% 100%, rgba(255, 193, 7, 0.18), transparent 52%),
        linear-gradient(180deg, #f4f6fb 0%, #eef1f7 100%);
    overflow: hidden;
}

.news-page::before,
.news-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(1px);
}

.news-page::before {
    width: 360px;
    height: 360px;
    top: -220px;
    left: -160px;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.18) 0%, rgba(211, 47, 47, 0) 72%);
}

.news-page::after {
    width: 380px;
    height: 380px;
    right: -160px;
    bottom: -240px;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.24) 0%, rgba(255, 193, 7, 0) 74%);
}

.news-page-container {
    position: relative;
    z-index: 1;
}

.news-page-hero {
    max-width: 760px;
    margin-bottom: 36px;
}

.news-page .section-title {
    margin-bottom: 0;
    font-size: clamp(2rem, 1.6rem + 1.7vw, 3rem);
    letter-spacing: 0.01em;
}

.news-page .section-title::after {
    width: 92px;
    height: 5px;
    bottom: -15px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary) 0%, #ff7358 100%);
}

.news-page .section-subtitle {
    margin: 22px 0 0;
    text-align: left;
    font-size: 1.08rem;
    color: #5b6677;
    max-width: 56ch;
}

.news-page-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.news-page-card {
    position: relative;
    border-radius: 18px;
    border: 1px solid rgba(21, 34, 63, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 253, 255, 0.93) 100%);
    box-shadow: 0 18px 38px rgba(10, 25, 50, 0.08);
}

.news-page-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(211, 47, 47, 0.95), rgba(255, 160, 0, 0.9));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-page-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 22px 44px rgba(10, 25, 50, 0.15);
}

.news-page-card:hover::before {
    opacity: 1;
}

.news-page .news-card-image {
    position: relative;
    height: auto;
    min-height: 220px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #162233;
}

.news-page .news-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.42) 100%);
    pointer-events: none;
}

.news-page .news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.news-page-card:hover .news-card-image img {
    transform: scale(1.07);
}

.news-page .news-card-image--video {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.12), transparent 46%), linear-gradient(160deg, #1c2d45 0%, #0f1727 100%);
}

.news-page .news-card-image--fallback {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 18px;
    background: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.14), transparent 52%), linear-gradient(145deg, #1f2f47 0%, #2f4467 100%);
}

.news-page .news-card-image--fallback::after {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.26) 100%);
}

.news-page .news-card-fallback-label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.36);
}

.news-page .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(14, 21, 34, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: #fff;
    z-index: 2;
    transition: transform 0.3s ease, background 0.3s ease;
}

.news-page-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(211, 47, 47, 0.92);
}


.news-page .date-badge {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #1e2d46;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 6px 14px rgba(12, 20, 36, 0.2);
}

.news-page .news-card-content {
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-grow: 1;
}

.news-page .date-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #5a6474;
}

.news-page .date-badge-inline svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    opacity: 0.8;
}

.news-page .news-card h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 1.08rem + 0.4vw, 1.55rem);
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.news-page .news-card h3 a {
    color: var(--text-main);
}

.news-page .news-card h3 a:hover {
    color: var(--primary);
}

.news-page .news-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.62;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-page .read-more {
    margin-top: auto;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #213252;
    background: #f2f4f9;
    border: 1px solid rgba(33, 50, 82, 0.12);
    gap: 7px;
}

.news-page .read-more:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    gap: 10px;
}

.news-page .news-empty {
    max-width: 720px;
    margin: 0 auto;
    padding: 56px 24px;
    border-radius: 20px;
    border: 1px solid rgba(21, 34, 63, 0.1);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 16px 34px rgba(11, 24, 47, 0.08);
}

.news-page .empty-message .icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 18px;
    opacity: 0.72;
    color: var(--primary);
}

.news-page .empty-message .icon svg {
    width: 100%;
    height: 100%;
}

.news-page .empty-message h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
    color: var(--text-main);
}

.news-page .empty-message p {
    max-width: 52ch;
    margin: 0 auto;
}

body.dark-mode .news-page {
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 167, 38, 0.15), transparent 50%),
        radial-gradient(circle at 88% 100%, rgba(255, 82, 82, 0.16), transparent 52%),
        linear-gradient(180deg, #121820 0%, #10151d 100%);
}

body.dark-mode .news-page .section-subtitle,
body.dark-mode .news-page .date-badge-inline {
    color: #b8c1d0;
}

body.dark-mode .news-page-card {
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(31, 39, 52, 0.96) 0%, rgba(24, 31, 43, 0.96) 100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.38);
}

body.dark-mode .news-page .news-card h3 a {
    color: var(--text-main);
}

body.dark-mode .news-page .news-card p {
    color: var(--text-secondary);
}

body.dark-mode .news-page .read-more {
    color: #d4def0;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}

body.dark-mode .news-page .read-more:hover {
    color: #fff;
}

body.dark-mode .news-page .date-badge {
    background: rgba(16, 22, 31, 0.88);
    color: #eef3ff;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

body.dark-mode .news-page .news-empty {
    background: rgba(28, 35, 48, 0.86);
    border-color: rgba(255, 255, 255, 0.09);
}

@media (max-width: 992px) {
    .news-page {
        padding: 52px 0 60px;
    }

    .news-page-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .news-page {
        padding: 46px 0 54px;
    }

    .news-page::before {
        width: 290px;
        height: 290px;
        top: -190px;
        left: -140px;
    }

    .news-page::after {
        width: 290px;
        height: 290px;
        right: -130px;
        bottom: -180px;
    }

    .news-page .section-title::after {
        width: 72px;
        bottom: -13px;
    }

    .news-page .section-subtitle {
        margin-top: 18px;
        font-size: 1rem;
    }

    .news-page .news-card-content {
        padding: 20px;
        gap: 12px;
    }

    .news-page .news-card-image {
        min-height: 200px;
    }

    .news-page .news-empty {
        padding: 42px 20px;
    }
}

@media (max-width: 480px) {
    .news-page-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .news-page .news-card-image {
        min-height: 184px;
    }

    .news-page .read-more {
        width: 100%;
        justify-content: center;
    }
}

/* --- News Detail Page --- */
.news-detail-page {
    position: relative;
    padding: clamp(34px, 5vw, 58px) 0 clamp(64px, 8vw, 92px);
    background:
        radial-gradient(circle at 8% 0%, rgba(211, 47, 47, 0.12), transparent 42%),
        radial-gradient(circle at 92% 100%, rgba(255, 193, 7, 0.18), transparent 48%),
        linear-gradient(180deg, #f4f7fb 0%, #eef2f8 100%);
    overflow: hidden;
}

.news-detail-page::before,
.news-detail-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.news-detail-page::before {
    width: 340px;
    height: 340px;
    left: -180px;
    top: 120px;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.2), rgba(255, 193, 7, 0));
}

.news-detail-page::after {
    width: 360px;
    height: 360px;
    right: -190px;
    bottom: -130px;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.16), rgba(211, 47, 47, 0));
}

.news-detail-container {
    position: relative;
    z-index: 1;
}

.news-detail-breadcrumb {
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.news-detail-breadcrumb .separator {
    margin: 0;
    color: rgba(100, 116, 139, 0.75);
}

.news-detail-breadcrumb .news-detail-breadcrumb-current {
    min-width: 0;
    overflow-wrap: anywhere;
}

.news-detail-card {
    max-width: 940px;
    margin: 0 auto;
    padding: clamp(20px, 3vw, 34px);
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: linear-gradient(165deg, #ffffff 0%, #fbfdff 52%, #f4f8ff 100%);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
}

.news-detail-head {
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.news-detail-kicker {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(211, 47, 47, 0.11);
    border: 1px solid rgba(211, 47, 47, 0.23);
    color: #9f1239;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.news-detail-head .news-detail-title {
    margin: 14px 0 12px;
    color: #0f172a;
    font-family: var(--font-heading);
    font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.8rem);
    line-height: 1.16;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}

.news-detail-head .news-detail-title.news-detail-title--lg {
    font-size: clamp(1.65rem, 1.2rem + 1.45vw, 2.35rem);
    line-height: 1.14;
}

.news-detail-head .news-detail-title.news-detail-title--xl {
    font-size: clamp(1.45rem, 1.08rem + 1.15vw, 2rem);
    line-height: 1.12;
}

.news-detail-head .news-detail-title.news-detail-title--xxl {
    font-size: clamp(1.28rem, 1.0rem + 0.9vw, 1.72rem);
    line-height: 1.1;
}

.news-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.news-detail-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: #475569;
    font-size: 0.86rem;
    font-weight: 600;
}

.news-detail-meta-item svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.news-detail-slider,
.news-detail-image-wrap,
.news-detail-video {
    margin-top: 24px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #0f172a;
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
}

.news-detail-slide-link {
    display: block;
    width: 100%;
    max-height: 560px;
    background: #0f172a;
}

.news-detail-slide-link img,
.news-detail-image {
    width: 100%;
    max-height: 560px;
    display: block;
    object-fit: contain;
}

.news-detail-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.news-detail-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.news-detail-slider .news-detail-slider-prev,
.news-detail-slider .news-detail-slider-next {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(2, 6, 23, 0.5);
    color: #fff;
    backdrop-filter: blur(4px);
}

.news-detail-slider .news-detail-slider-prev::after,
.news-detail-slider .news-detail-slider-next::after {
    font-size: 16px;
    font-weight: 700;
}

.news-detail-slider .news-detail-slider-pagination {
    bottom: 14px;
}

.news-detail-slider .news-detail-slider-pagination .swiper-pagination-bullet {
    width: 9px;
    height: 9px;
    background: rgba(255, 255, 255, 0.7);
    opacity: 0.95;
}

.news-detail-slider .news-detail-slider-pagination .swiper-pagination-bullet-active {
    background: #ffc107;
}

.news-detail-content {
    margin-top: 30px;
    color: #1e293b;
    font-size: 1.08rem;
    line-height: 1.78;
    overflow-wrap: anywhere;
}

.news-detail-content > :first-child {
    margin-top: 0;
}

.news-detail-content > :last-child {
    margin-bottom: 0;
}

.news-detail-content h2,
.news-detail-content h3,
.news-detail-content h4 {
    margin: 1.6em 0 0.6em;
    color: #0f172a;
    line-height: 1.28;
}

.news-detail-content p {
    margin: 0 0 1.05em;
}

.news-detail-content ul,
.news-detail-content ol {
    margin: 0 0 1.15em;
    padding-left: 1.35em;
}

.news-detail-content li + li {
    margin-top: 0.35em;
}

.news-detail-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.news-detail-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.15em auto;
    border-radius: 12px;
}

.news-detail-gallery {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.news-detail-gallery h2 {
    margin: 0 0 16px;
    color: #0f172a;
    font-size: 1.3rem;
}

.news-detail-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.news-detail-gallery-item {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #d7e0ed;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.news-detail-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.28s ease;
}

.news-detail-gallery-item:hover {
    transform: translateY(-3px);
    border-color: rgba(211, 47, 47, 0.33);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.18);
}

.news-detail-gallery-item:hover img {
    transform: scale(1.05);
}

.news-detail-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.news-detail-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    color: #1f314e;
    background: #f3f6fb;
    border: 1px solid rgba(31, 49, 78, 0.14);
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.news-detail-back-link:hover {
    transform: translateY(-1px);
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

body.dark-mode .news-detail-page {
    background:
        radial-gradient(circle at 8% 0%, rgba(248, 113, 113, 0.15), transparent 44%),
        radial-gradient(circle at 92% 100%, rgba(255, 193, 7, 0.16), transparent 50%),
        linear-gradient(180deg, #121820 0%, #10151d 100%);
}

body.dark-mode .news-detail-card {
    border-color: #2a3444;
    background: linear-gradient(165deg, rgba(27, 34, 47, 0.96) 0%, rgba(22, 29, 41, 0.98) 100%);
    box-shadow: 0 24px 42px rgba(0, 0, 0, 0.35);
}

body.dark-mode .news-detail-head,
body.dark-mode .news-detail-gallery,
body.dark-mode .news-detail-footer {
    border-color: #2a3444;
}

body.dark-mode .news-detail-head .news-detail-title,
body.dark-mode .news-detail-content,
body.dark-mode .news-detail-content h2,
body.dark-mode .news-detail-content h3,
body.dark-mode .news-detail-content h4,
body.dark-mode .news-detail-gallery h2 {
    color: #e5ebf5;
}

body.dark-mode .news-detail-meta-item {
    color: #b8c1d0;
    border-color: #2a3444;
    background: rgba(15, 23, 36, 0.72);
}

body.dark-mode .news-detail-kicker {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

body.dark-mode .news-detail-slider,
body.dark-mode .news-detail-image-wrap,
body.dark-mode .news-detail-video,
body.dark-mode .news-detail-gallery-item {
    border-color: #2a3444;
}

body.dark-mode .news-detail-gallery-item {
    background: #1b2534;
}

body.dark-mode .news-detail-back-link {
    color: #d7e2f4;
    border-color: #2a3444;
    background: rgba(20, 27, 40, 0.85);
}

body.dark-mode .news-detail-back-link:hover {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(211, 47, 47, 0.85);
    color: #fff;
}

@media (max-width: 992px) {
    .news-detail-page {
        padding-top: 34px;
    }

    .news-detail-slider .news-detail-slider-prev,
    .news-detail-slider .news-detail-slider-next {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .news-detail-page {
        padding: 28px 0 56px;
    }

    .news-detail-card {
        border-radius: 18px;
        padding: 18px;
    }

    .news-detail-head {
        padding-bottom: 16px;
    }

    .news-detail-content {
        margin-top: 24px;
        font-size: 1.02rem;
    }

    .news-detail-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .news-detail-breadcrumb {
        font-size: 0.84rem;
    }

    .news-detail-meta-item {
        font-size: 0.8rem;
    }

    .news-detail-gallery-grid {
        grid-template-columns: 1fr;
    }

    .news-detail-footer {
        margin-top: 24px;
        padding-top: 16px;
    }

    .news-detail-back-link {
        width: 100%;
    }
}

/* --- Static Page (page.php) --- */
.page-content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 50px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    line-height: 1.8;
    color: var(--text-main);
}

/* Fix for images inside content */
.page-content-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.page-gallery {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.page-gallery h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.gallery-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
    cursor: zoom-in;
}

.gallery-item img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.gallery-desc {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

@media (max-width: 768px) {
    .page-content-wrapper {
        padding: 25px;
    }
}

/* --- Distance Platform Page --- */
.distance-page {
    padding: 42px 0 72px;
}

.distance-hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
    gap: 18px;
    padding: 26px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 84% 8%, rgba(255, 255, 255, 0.24), transparent 42%),
        linear-gradient(145deg, #1f2937 0%, #111827 100%);
    color: #f3f4f6;
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.25);
}

.distance-kicker {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #f9fafb;
    font-size: 0.77rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.distance-title {
    margin-top: 14px;
    margin-bottom: 12px;
    font-size: clamp(1.8rem, 2.6vw, 2.4rem);
    font-family: var(--font-heading);
    line-height: 1.15;
}

.distance-subtitle {
    max-width: 760px;
    color: rgba(243, 244, 246, 0.86);
}

.distance-actions {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.distance-actions .btn {
    min-height: 44px;
}

.distance-btn-outline {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.distance-btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.distance-btn-muted {
    background: rgba(17, 24, 39, 0.38);
    color: #f3f4f6;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.distance-btn-muted:hover {
    background: rgba(17, 24, 39, 0.58);
    transform: translateY(-2px);
}

.distance-hero-side {
    display: grid;
    gap: 10px;
}

.distance-metric {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px;
}

.distance-metric span {
    display: block;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.74);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.distance-metric strong {
    display: block;
    margin-top: 7px;
    font-size: 1.3rem;
}

.distance-services-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.distance-service-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 10px;
    transition: var(--transition);
}

.distance-service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.distance-service-card h2 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.25;
    font-family: var(--font-heading);
}

.distance-service-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.distance-service-link {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.distance-service-link:hover {
    color: var(--primary-dark);
}

.distance-layout {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
    gap: 12px;
    align-items: start;
}

.distance-layout-single {
    grid-template-columns: minmax(0, 1fr);
}

.distance-board-toolbar {
    margin-top: 16px;
    padding: 14px;
}

.distance-board-toolbar-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
}

.distance-course-switch {
    min-width: 240px;
    display: grid;
    gap: 6px;
}

.distance-course-switch label {
    margin: 0;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.distance-tab-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.distance-tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.84rem;
    transition: var(--transition);
}

.distance-tab-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff4f4;
}

.distance-tab-link.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, #ff6b6b 100%);
    color: #fff;
}

.distance-subtab-nav {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.distance-subtab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.84rem;
    transition: var(--transition);
}

.distance-subtab-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.distance-subtab-link.active {
    border-color: var(--primary);
    background: rgba(228, 58, 58, 0.08);
    color: var(--primary);
}

.distance-selected-course {
    margin: 10px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.distance-panel {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 18px;
}

.distance-panel-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.distance-panel-head h2 {
    margin: 0;
    font-size: 1.2rem;
    font-family: var(--font-heading);
}

.distance-panel-head p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.distance-content-body {
    color: var(--text-main);
    line-height: 1.75;
}

.distance-content-body > * + * {
    margin-top: 10px;
}

.distance-content-body img {
    max-width: 100%;
    border-radius: 10px;
}

.distance-steps-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: var(--text-main);
}

.distance-steps-list li::marker {
    font-weight: 700;
    color: var(--primary);
}

.distance-materials-panel {
    margin-top: 12px;
}

.distance-materials-head {
    margin-bottom: 14px;
}

.distance-empty {
    padding: 20px;
    border-radius: 12px;
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    background: var(--bg-light);
}

.distance-materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.distance-material-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.distance-material-image-link {
    display: block;
    background: var(--bg-light);
}

.distance-material-card img {
    width: 100%;
    height: 148px;
    object-fit: cover;
}

.distance-material-body {
    padding: 12px;
    display: grid;
    gap: 10px;
}

.distance-material-body h3 {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.35;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.distance-material-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.distance-material-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 600;
    background: var(--bg-light);
}

.distance-material-actions a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff4f4;
}

@media (max-width: 1100px) {
    .distance-services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 860px) {
    .distance-hero {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .distance-actions .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .distance-page {
        padding-top: 24px;
    }

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

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

body.dark-mode .distance-hero {
    background:
        radial-gradient(circle at 86% 12%, rgba(255, 255, 255, 0.1), transparent 42%),
        linear-gradient(145deg, #141b28 0%, #0b111b 100%);
}

body.dark-mode .distance-service-card,
body.dark-mode .distance-panel,
body.dark-mode .distance-material-card {
    border-color: #2a3444;
    background: #141b28;
}

body.dark-mode .distance-empty {
    border-color: #2a3444;
    background: #111826;
}

body.dark-mode .distance-material-actions a {
    border-color: #2a3444;
    background: #111826;
    color: #d8e0ee;
}

body.dark-mode .distance-material-actions a:hover {
    border-color: #f87171;
    color: #fca5a5;
    background: #221116;
}

body.dark-mode .distance-subtab-link {
    border-color: #2a3444;
    background: #141b28;
    color: #d8deea;
}

body.dark-mode .distance-subtab-link:hover {
    border-color: #f87171;
    color: #fca5a5;
}

body.dark-mode .distance-subtab-link.active {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}

.distance-flash {
    margin-top: 14px;
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 600;
    border: 1px solid transparent;
}

.distance-flash.success {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.distance-flash.error {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.distance-workspace-panel {
    margin-top: 12px;
}

.distance-workspace-guest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    border: 1px dashed var(--border-color);
    background: var(--bg-light);
}

.distance-workspace-guest p {
    margin: 0;
    color: var(--text-secondary);
}

.distance-assignment-list {
    display: grid;
    gap: 12px;
}

.distance-assignment-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 10px;
}

.distance-assignment-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.distance-assignment-head h3 {
    margin: 0;
    font-size: 1.08rem;
    font-family: var(--font-heading);
}

.distance-assignment-deadline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.distance-assignment-description {
    margin: 0;
    color: var(--text-main);
}

.distance-assignment-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.distance-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.distance-status-badge.pending,
.distance-status-badge.submitted {
    background: #dbeafe;
    color: #1d4ed8;
}

.distance-status-badge.under_review {
    background: #e0e7ff;
    color: #4338ca;
}

.distance-status-badge.revision {
    background: #ffedd5;
    color: #c2410c;
}

.distance-status-badge.approved,
.distance-status-badge.published,
.distance-status-badge.teacher {
    background: #dcfce7;
    color: #166534;
}

.distance-status-badge.rejected,
.distance-status-badge.archived {
    background: #fee2e2;
    color: #b91c1c;
}

.distance-status-badge.draft {
    background: #f3f4f6;
    color: #374151;
}

.distance-status-badge.student {
    background: #e0f2fe;
    color: #075985;
}

.distance-student-last-response {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
}

.distance-student-last-response p {
    margin: 0;
    color: var(--text-main);
}

.distance-student-last-response p + p {
    margin-top: 6px;
}

.distance-submit-form,
.distance-create-assignment-form,
.distance-review-form {
    display: grid;
    gap: 8px;
}

.distance-submit-form label,
.distance-create-assignment-form label,
.distance-review-form label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.distance-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-main);
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

textarea.distance-input {
    resize: vertical;
    min-height: 96px;
}

.distance-input:focus {
    outline: none;
    border-color: rgba(211, 47, 47, 0.45);
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.12);
}

.distance-submit-form small {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

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

.distance-teacher-block {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.distance-teacher-block h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-family: var(--font-heading);
}

.distance-teacher-assignments {
    display: grid;
    gap: 10px;
}

.distance-teacher-assignment-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    background: var(--bg-light);
    display: grid;
    gap: 8px;
}

.distance-teacher-assignment-card h4 {
    margin: 0;
    font-size: 1rem;
}

.distance-teacher-assignment-card p {
    margin: 0;
    color: var(--text-main);
    font-size: 0.92rem;
}

.distance-teacher-assignment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.distance-submissions-block {
    margin-top: 12px;
}

.distance-submissions-list {
    display: grid;
    gap: 10px;
}

.distance-submission-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    background: var(--bg-light);
    display: grid;
    gap: 10px;
}

.distance-submission-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.distance-submission-head h4 {
    margin: 0;
    font-size: 1.02rem;
}

.distance-submission-meta {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.distance-submission-message {
    margin: 0;
    white-space: pre-wrap;
}

.distance-inline-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.distance-role-admin-panel {
    margin-top: 12px;
}

.distance-courses-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 12px;
    margin-bottom: 14px;
}

.distance-course-block {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    background: var(--bg-light);
    display: grid;
    gap: 10px;
}

.distance-course-block h3 {
    margin: 0;
    font-size: 1.03rem;
    font-family: var(--font-heading);
}

.distance-course-list {
    display: grid;
    gap: 10px;
}

.distance-course-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    background: var(--bg-white);
    display: grid;
    gap: 8px;
}

.distance-user-checkboxes {
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    background: var(--bg-white);
    display: grid;
    gap: 6px;
}

.distance-section-separator {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 14px 0;
}

.distance-role-table-wrap {
    overflow-x: auto;
}

.distance-role-table {
    width: 100%;
    border-collapse: collapse;
}

.distance-role-table th,
.distance-role-table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.distance-role-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.distance-role-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.distance-role-form .distance-input {
    min-width: 220px;
}

.distance-role-fixed-note {
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.distance-assignment-file {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.distance-assignment-file a {
    color: var(--primary);
    font-weight: 600;
}

.distance-assignment-file a:hover {
    color: var(--primary-dark);
}

.distance-check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.distance-toolbar-form {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-light);
    margin-bottom: 12px;
}

.distance-toolbar-form label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.distance-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.distance-btn-soft {
    background: var(--bg-light);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.distance-btn-soft:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff4f4;
}

.distance-btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    box-shadow: none;
}

.distance-btn-danger:hover {
    background: #fecaca;
    border-color: #ef4444;
}

.distance-btn-small {
    min-height: 36px;
    padding: 8px 14px;
    font-size: 0.84rem;
}

.distance-assignment-editor {
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 10px;
    background: var(--bg-white);
}

.distance-assignment-editor summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 700;
}

.distance-assignment-editor summary:hover {
    color: var(--primary-dark);
}

.distance-assignment-editor[open] summary {
    margin-bottom: 10px;
}

.distance-assignment-card-actions {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.distance-status-inline-form {
    display: grid;
    gap: 8px;
}

.distance-submission-filters {
    margin-bottom: 14px;
}

.distance-material-file {
    height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-family: var(--font-heading);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.distance-material-inline-btn {
    width: 100%;
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid #fca5a5;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.distance-material-inline-btn:hover {
    background: #fecaca;
    border-color: #ef4444;
}

@media (max-width: 1100px) {
    .distance-teacher-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 860px) {
    .distance-board-toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .distance-course-switch {
        width: 100%;
    }

    .distance-tab-nav {
        width: 100%;
    }

    .distance-tab-link {
        flex: 1 1 auto;
    }

    .distance-inline-fields {
        grid-template-columns: 1fr;
    }

    .distance-workspace-guest {
        flex-direction: column;
        align-items: flex-start;
    }

    .distance-role-form {
        flex-direction: column;
        align-items: stretch;
    }

    .distance-role-form .distance-input {
        min-width: 0;
    }

    .distance-toolbar-actions {
        width: 100%;
    }

    .distance-toolbar-actions .btn,
    .distance-btn-small {
        width: 100%;
    }
}

body.dark-mode .distance-flash.success {
    background: #12351f;
    color: #9fe5b2;
    border-color: #27673c;
}

body.dark-mode .distance-flash.error {
    background: #3b1418;
    color: #ffb1b7;
    border-color: #7d2a34;
}

body.dark-mode .distance-workspace-guest,
body.dark-mode .distance-assignment-card,
body.dark-mode .distance-teacher-block,
body.dark-mode .distance-submission-card,
body.dark-mode .distance-teacher-assignment-card,
body.dark-mode .distance-course-card,
body.dark-mode .distance-course-block {
    border-color: #2a3444;
    background: #141b28;
}

body.dark-mode .distance-input {
    border-color: #2a3444;
    background: #111826;
    color: #e5ebf5;
}

body.dark-mode .distance-input:focus {
    border-color: rgba(248, 113, 113, 0.58);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.16);
}

body.dark-mode .distance-btn-soft {
    border-color: #2a3444;
    background: #111826;
    color: #d8e0ee;
}

body.dark-mode .distance-btn-soft:hover {
    border-color: #f87171;
    background: #221116;
    color: #fca5a5;
}

body.dark-mode .distance-btn-danger {
    background: #3b1418;
    color: #ffb1b7;
    border-color: #7d2a34;
}

body.dark-mode .distance-btn-danger:hover {
    background: #4a1a23;
    border-color: #ef4444;
}

body.dark-mode .distance-assignment-editor,
body.dark-mode .distance-toolbar-form,
body.dark-mode .distance-material-file {
    border-color: #2a3444;
    background: #111826;
    color: #d8e0ee;
}

body.dark-mode .distance-board-toolbar {
    border-color: #2a3444;
    background: #141b28;
}

body.dark-mode .distance-tab-link {
    border-color: #2a3444;
    background: #111826;
    color: #d8e0ee;
}

body.dark-mode .distance-tab-link:hover {
    border-color: #f87171;
    color: #fca5a5;
    background: #221116;
}

body.dark-mode .distance-tab-link.active {
    border-color: #ef4444;
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    color: #fff;
}

body.dark-mode .distance-user-checkboxes {
    border-color: #2a3444;
    background: #111826;
}

body.dark-mode .distance-section-separator {
    border-top-color: #2a3444;
}

body.dark-mode .distance-material-inline-btn {
    background: #3b1418;
    color: #ffb1b7;
    border-color: #7d2a34;
}

body.dark-mode .distance-material-inline-btn:hover {
    background: #4a1a23;
    border-color: #ef4444;
}

body.dark-mode .distance-assignment-file {
    color: #b7c1d3;
}

body.dark-mode .distance-assignment-file a,
body.dark-mode .distance-assignment-editor summary {
    color: #93c5fd;
}

body.dark-mode .distance-assignment-file a:hover,
body.dark-mode .distance-assignment-editor summary:hover {
    color: #bfdbfe;
}

body.dark-mode .distance-role-table th,
body.dark-mode .distance-role-table td {
    border-bottom-color: #2a3444;
}

/* --- Distance Blackboard Theme Override --- */
.distance-page {
    --distance-bb-bg: #eef3fb;
    --distance-bb-surface: #ffffff;
    --distance-bb-surface-soft: #f7f9fe;
    --distance-bb-border: #d7e0ef;
    --distance-bb-text: #16233a;
    --distance-bb-muted: #4e5d79;
    --distance-bb-nav: #1b2437;
    --distance-bb-nav-soft: #27324b;
    --distance-bb-accent: #2f6fed;
    --distance-bb-accent-strong: #1f5cd3;
    --distance-bb-success: #0f8f58;
    --distance-bb-shadow: 0 22px 36px rgba(17, 32, 59, 0.1);
    font-family: "Trebuchet MS", var(--font-body);
    background:
        radial-gradient(circle at 8% 4%, rgba(47, 111, 237, 0.14), transparent 33%),
        radial-gradient(circle at 92% 7%, rgba(33, 121, 178, 0.1), transparent 35%),
        var(--distance-bb-bg);
    padding: 34px 0 70px;
}

.distance-page .container {
    position: relative;
}

.distance-hero {
    position: relative;
    overflow: hidden;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
    gap: 18px;
    padding: 28px;
    border-radius: 18px;
    border: 1px solid rgba(214, 226, 246, 0.44);
    background:
        linear-gradient(112deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0)),
        linear-gradient(132deg, #0f1a33 0%, #1a2952 52%, #24407a 100%);
    box-shadow: 0 24px 44px rgba(15, 28, 54, 0.34);
}

.distance-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(transparent 95%, rgba(255, 255, 255, 0.08) 95%),
        linear-gradient(90deg, transparent 95%, rgba(255, 255, 255, 0.08) 95%);
    background-size: 20px 20px;
    opacity: 0.2;
    pointer-events: none;
}

.distance-hero > * {
    position: relative;
    z-index: 1;
}

.distance-kicker {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
}

.distance-title {
    margin-top: 16px;
    margin-bottom: 10px;
    font-size: clamp(1.85rem, 2.9vw, 2.55rem);
}

.distance-subtitle {
    max-width: 740px;
    color: rgba(240, 245, 255, 0.9);
}

.distance-actions .btn {
    border-radius: 12px;
    padding-left: 18px;
    padding-right: 18px;
}

.distance-page .btn.btn-primary {
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: linear-gradient(135deg, #4d89ff 0%, #2f6fed 56%, #285cd0 100%);
    box-shadow: 0 8px 18px rgba(20, 84, 209, 0.35);
}

.distance-page .btn.btn-primary:hover {
    background: linear-gradient(135deg, #4f8cff 0%, #2e67d6 56%, #2451b6 100%);
    transform: translateY(-1px);
}

.distance-btn-outline {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.4);
}

.distance-btn-muted {
    background: rgba(19, 32, 58, 0.65);
    border-color: rgba(255, 255, 255, 0.24);
}

.distance-hero-side {
    gap: 10px;
}

.distance-metric {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(8, 20, 44, 0.42);
    backdrop-filter: blur(3px);
}

.distance-metric span {
    font-size: 0.7rem;
    color: rgba(229, 237, 253, 0.9);
}

.distance-metric strong {
    font-size: 1.1rem;
    color: #ffffff;
}

.distance-services-grid {
    margin-top: 16px;
    gap: 10px;
}

.distance-service-card {
    position: relative;
    background: var(--distance-bb-surface);
    border: 1px solid var(--distance-bb-border);
    box-shadow: 0 12px 24px rgba(17, 34, 63, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.distance-service-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #3378f6 0%, #1f5cd3 100%);
}

.distance-service-card h2 {
    color: var(--distance-bb-text);
    font-size: 1rem;
}

.distance-service-card p {
    color: var(--distance-bb-muted);
    font-size: 0.88rem;
}

.distance-service-link {
    color: var(--distance-bb-accent-strong);
    font-size: 0.84rem;
    letter-spacing: 0.01em;
}

.distance-service-link:hover {
    color: #1949a8;
}

.distance-flash {
    margin-top: 12px;
    border-radius: 10px;
    box-shadow: 0 10px 18px rgba(17, 34, 63, 0.08);
}

.distance-blackboard-shell {
    margin-top: 16px;
    display: grid;
    grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.distance-blackboard-shell > :not(.distance-board-toolbar) {
    grid-column: 2;
}

.distance-board-toolbar {
    grid-column: 1;
    grid-row: 1 / span 24;
    margin-top: 0;
    position: sticky;
    top: 96px;
    border-radius: 14px;
    border: 1px solid #223252;
    background:
        linear-gradient(165deg, #161f32 0%, #1d2a44 60%, #1f3054 100%);
    box-shadow: 0 20px 32px rgba(16, 26, 45, 0.3);
    color: #eef3ff;
}

.distance-board-toolbar-row {
    display: grid;
    gap: 14px;
}

.distance-course-switch {
    min-width: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 10px;
    gap: 8px;
}

.distance-course-switch label {
    color: rgba(222, 234, 255, 0.9);
    letter-spacing: 0.06em;
    font-size: 0.74rem;
}

.distance-board-toolbar .distance-input {
    border-radius: 9px;
    border-color: rgba(211, 224, 247, 0.28);
    background: rgba(14, 22, 39, 0.58);
    color: #f2f7ff;
}

.distance-board-toolbar .distance-input option {
    color: #16233a;
    background: #ffffff;
}

.distance-board-toolbar .distance-input:focus {
    border-color: rgba(110, 164, 255, 0.78);
    box-shadow: 0 0 0 3px rgba(80, 138, 236, 0.28);
}

.distance-tab-nav {
    display: grid;
    gap: 7px;
}

.distance-tab-link {
    min-height: 40px;
    justify-content: flex-start;
    border-radius: 10px;
    border-color: rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(232, 241, 255, 0.94);
    font-size: 0.84rem;
}

.distance-tab-link:hover {
    border-color: rgba(164, 197, 255, 0.62);
    color: #ffffff;
    background: rgba(53, 95, 171, 0.45);
}

.distance-tab-link.active {
    border-color: #9ec2ff;
    background: linear-gradient(130deg, #3a7af6 0%, #225fd3 100%);
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(27, 72, 157, 0.38);
}

.distance-selected-course {
    margin-top: 12px;
    margin-bottom: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    padding-top: 12px;
    color: rgba(227, 237, 255, 0.92);
    font-size: 0.84rem;
}

.distance-selected-course strong {
    color: #ffffff;
}

.distance-subtab-nav {
    margin-top: 0;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--distance-bb-border);
    background: #edf3ff;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.distance-subtab-link {
    border-radius: 9px;
    min-height: 34px;
    border-color: transparent;
    background: transparent;
    color: #3a4d70;
    font-weight: 700;
}

.distance-subtab-link:hover {
    background: #dde8ff;
    color: #22478a;
    border-color: #ceddf8;
}

.distance-subtab-link.active {
    background: #ffffff;
    border-color: #bfd0ee;
    color: #184290;
    box-shadow: 0 4px 10px rgba(28, 70, 146, 0.14);
}

.distance-panel {
    background: var(--distance-bb-surface);
    border: 1px solid var(--distance-bb-border);
    border-radius: 14px;
    box-shadow: var(--distance-bb-shadow);
}

.distance-panel-head h2 {
    font-size: 1.18rem;
    color: var(--distance-bb-text);
}

.distance-panel-head p {
    color: var(--distance-bb-muted);
}

.distance-empty {
    border: 1px dashed #bfd0ea;
    background: #f5f8ff;
    color: #5a6d8e;
    border-radius: 10px;
}

.distance-assignment-card,
.distance-teacher-assignment-card,
.distance-submission-card,
.distance-teacher-block,
.distance-course-block,
.distance-course-card,
.distance-workspace-guest {
    border-color: #cfdaed;
    border-radius: 11px;
    background: #f8fbff;
}

.distance-assignment-head h3,
.distance-teacher-assignment-card h4,
.distance-submission-head h4,
.distance-course-card h4 {
    color: var(--distance-bb-text);
}

.distance-assignment-description,
.distance-teacher-assignment-card p,
.distance-submission-message {
    color: #24344f;
}

.distance-assignment-meta,
.distance-teacher-assignment-meta,
.distance-submission-meta,
.distance-role-fixed-note,
.distance-assignment-file {
    color: #5a6d8e;
}

.distance-student-last-response,
.distance-toolbar-form,
.distance-assignment-editor,
.distance-material-file {
    border-color: #c9d7ec;
    background: #f0f5ff;
}

.distance-input {
    border-radius: 9px;
    border-color: #c4d3ea;
    background: #ffffff;
}

.distance-input:focus {
    border-color: rgba(38, 103, 229, 0.66);
    box-shadow: 0 0 0 4px rgba(44, 107, 229, 0.12);
}

.distance-material-card {
    border-color: #cfdaed;
    border-radius: 11px;
}

.distance-material-actions a {
    border-color: #c4d5f2;
    border-radius: 8px;
    background: #f4f8ff;
    color: #284067;
}

.distance-material-actions a:hover {
    border-color: #93b2eb;
    color: #184290;
    background: #e8f0ff;
}

.distance-material-inline-btn,
.distance-btn-danger {
    border-color: #ef9ba9;
    background: #ffe5ea;
    color: #9c223c;
}

.distance-material-inline-btn:hover,
.distance-btn-danger:hover {
    border-color: #df6c83;
    background: #ffd6df;
    color: #891834;
}

.distance-btn-soft {
    border-color: #c4d5f2;
    background: #edf3ff;
    color: #284067;
}

.distance-btn-soft:hover {
    border-color: #94b3ea;
    color: #15418f;
    background: #e2ecff;
}

.distance-status-badge {
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.distance-status-badge.approved,
.distance-status-badge.published,
.distance-status-badge.teacher {
    background: #dcf7eb;
    color: #117548;
}

.distance-status-badge.pending,
.distance-status-badge.submitted {
    background: #e8f0ff;
    color: #2b5bb0;
}

.distance-status-badge.under_review {
    background: #ece9ff;
    color: #4f39b8;
}

.distance-status-badge.revision {
    background: #fff0dd;
    color: #b26212;
}

.distance-status-badge.rejected,
.distance-status-badge.archived {
    background: #ffe6ea;
    color: #a93147;
}

.distance-status-badge.draft {
    background: #eef2f9;
    color: #4f5d74;
}

.distance-role-table th,
.distance-role-table td {
    border-bottom-color: #d5e0f1;
}

.distance-role-table th {
    color: #5a6c8e;
}

.distance-panel,
.distance-service-card,
.distance-hero,
.distance-board-toolbar {
    animation: distance-board-rise 0.42s ease both;
}

@keyframes distance-board-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1200px) {
    .distance-blackboard-shell {
        grid-template-columns: 1fr;
    }

    .distance-blackboard-shell > :not(.distance-board-toolbar) {
        grid-column: auto;
    }

    .distance-board-toolbar {
        grid-column: auto;
        grid-row: auto;
        position: static;
    }

    .distance-board-toolbar-row {
        grid-template-columns: 1fr;
    }

    .distance-tab-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .distance-tab-link {
        justify-content: center;
    }
}

@media (max-width: 860px) {
    .distance-page {
        padding: 24px 0 54px;
    }

    .distance-hero {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .distance-actions .btn {
        width: 100%;
    }

    .distance-tab-nav {
        grid-template-columns: 1fr;
    }
}

body.dark-mode .distance-page {
    --distance-bb-bg: #0f1623;
    --distance-bb-surface: #151f31;
    --distance-bb-surface-soft: #1a263d;
    --distance-bb-border: #2d3c57;
    --distance-bb-text: #e5ecfb;
    --distance-bb-muted: #b1c0dc;
    background:
        radial-gradient(circle at 6% 0%, rgba(63, 111, 206, 0.21), transparent 32%),
        radial-gradient(circle at 94% 8%, rgba(29, 85, 166, 0.18), transparent 35%),
        #0f1623;
}

body.dark-mode .distance-hero {
    border-color: rgba(121, 149, 208, 0.28);
    background:
        linear-gradient(112deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
        linear-gradient(132deg, #0f172a 0%, #15203a 56%, #1b315c 100%);
}

body.dark-mode .distance-service-card,
body.dark-mode .distance-panel,
body.dark-mode .distance-material-card,
body.dark-mode .distance-assignment-card,
body.dark-mode .distance-submission-card,
body.dark-mode .distance-teacher-assignment-card,
body.dark-mode .distance-teacher-block,
body.dark-mode .distance-course-block,
body.dark-mode .distance-course-card,
body.dark-mode .distance-workspace-guest {
    background: #161f33;
    border-color: #2d3c57;
    box-shadow: none;
}

body.dark-mode .distance-subtab-nav {
    background: #182338;
    border-color: #2d3c57;
}

body.dark-mode .distance-subtab-link {
    color: #b8c6e0;
}

body.dark-mode .distance-subtab-link:hover {
    background: #223050;
    border-color: #36507d;
    color: #dfebff;
}

body.dark-mode .distance-subtab-link.active {
    background: #213152;
    border-color: #3b5788;
    color: #dfeaff;
}

body.dark-mode .distance-board-toolbar {
    border-color: #2c3f63;
    background: linear-gradient(165deg, #121a2d 0%, #18253f 65%, #1b2d4f 100%);
}

body.dark-mode .distance-board-toolbar .distance-input {
    border-color: #445e8d;
    background: rgba(13, 20, 37, 0.68);
    color: #e7efff;
}

body.dark-mode .distance-empty,
body.dark-mode .distance-toolbar-form,
body.dark-mode .distance-assignment-editor,
body.dark-mode .distance-material-file,
body.dark-mode .distance-student-last-response {
    border-color: #32486f;
    background: #1a2944;
    color: #b9c9e5;
}

body.dark-mode .distance-input {
    border-color: #374f77;
    background: #17253c;
    color: #e5edfb;
}

body.dark-mode .distance-role-table th,
body.dark-mode .distance-role-table td {
    border-bottom-color: #2d3e5d;
}

body.dark-mode .distance-material-actions a,
body.dark-mode .distance-btn-soft {
    border-color: #3a5484;
    background: #1b2a45;
    color: #d2def3;
}

body.dark-mode .distance-material-actions a:hover,
body.dark-mode .distance-btn-soft:hover {
    border-color: #638fd7;
    background: #24385d;
    color: #e8f0ff;
}

body.dark-mode .distance-material-inline-btn,
body.dark-mode .distance-btn-danger {
    border-color: #9f4d60;
    background: #4d1f2f;
    color: #ffccda;
}

body.dark-mode .distance-material-inline-btn:hover,
body.dark-mode .distance-btn-danger:hover {
    border-color: #bc6479;
    background: #5b2738;
    color: #ffe1e9;
}

/* --- Home Search --- */
.home-search-section {
    padding: 12px 0 64px;
}

.home-search-card {
    position: relative;
    padding: 30px;
    border-radius: 22px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background:
        radial-gradient(circle at 8% 18%, rgba(255, 193, 7, 0.22), transparent 32%),
        radial-gradient(circle at 90% 84%, rgba(211, 47, 47, 0.12), transparent 38%),
        linear-gradient(165deg, #ffffff 0%, #f8fbff 46%, #f2f7ff 100%);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.home-search-head {
    max-width: 780px;
}

.home-search-kicker {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(211, 47, 47, 0.1);
    color: #b91c1c;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-search-title {
    margin: 12px 0 10px;
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
    line-height: 1.2;
    color: #1f2937;
    font-family: var(--font-heading);
}

.home-search-text {
    margin: 0;
    color: #5f6c80;
    max-width: 62ch;
}

.home-search-form {
    margin-top: 20px;
}

.home-search-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #1f2937;
}

.home-search-input-wrap {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 12px;
    border-radius: 14px;
    border: 1px solid #d6dfeb;
    background: rgba(255, 255, 255, 0.92);
}

.home-search-icon {
    width: 22px;
    height: 22px;
    fill: #7b8798;
}

.home-search-input-wrap input {
    width: 100%;
    border: none;
    background: transparent;
    color: #1f2937;
    font-size: 0.97rem;
    min-height: 42px;
}

.home-search-input-wrap input:focus {
    outline: none;
}

.home-search-submit {
    min-width: 132px;
    border-radius: 10px;
    min-height: 44px;
}

.home-search-hints {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-search-hint {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.78);
    color: #334155;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
}

.home-search-hint:hover {
    color: #111827;
    border-color: rgba(211, 47, 47, 0.45);
    background: #fff;
}

.home-search-link {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    color: #334155;
    font-weight: 700;
    text-decoration: none;
}

.home-search-link:hover {
    color: var(--primary);
}

/* --- Search Page --- */
.search-page {
    position: relative;
    padding: clamp(44px, 5.4vw, 76px) 0;
    background:
        radial-gradient(circle at 8% 0%, rgba(211, 47, 47, 0.08), transparent 36%),
        radial-gradient(circle at 92% 100%, rgba(255, 193, 7, 0.14), transparent 42%),
        linear-gradient(180deg, #f4f7fb 0%, #edf2f9 100%);
}

.search-page-hero {
    padding: 24px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.search-page-subtitle {
    margin-top: 14px;
    color: #617089;
    max-width: 70ch;
}

.search-page-form {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-page-input-wrap {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid #d7e0ec;
    background: #fff;
}

.search-page-icon {
    width: 22px;
    height: 22px;
    fill: #7b8798;
}

.search-page-input-wrap input {
    width: 100%;
    border: none;
    background: transparent;
    color: #1f2937;
    font-size: 0.97rem;
}

.search-page-input-wrap input:focus {
    outline: none;
}

.search-page-popular {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-page-popular a {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    color: #475569;
    font-size: 0.82rem;
    text-decoration: none;
}

.search-page-popular a:hover {
    color: #111827;
    border-color: rgba(211, 47, 47, 0.45);
}

.search-summary {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.84);
}

.search-summary-note {
    color: #617089;
    font-size: 0.86rem;
    font-weight: 600;
}

.search-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-summary-chip-link {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}

.search-summary-chip-link:hover {
    border-color: rgba(211, 47, 47, 0.34);
    color: #111827;
}

.search-summary-chip-link.is-active {
    background: rgba(211, 47, 47, 0.12);
    color: #9f1239;
    border-color: rgba(211, 47, 47, 0.36);
}

.search-results {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.search-item {
    padding: 18px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.search-item-type {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.search-item-page .search-item-type {
    color: #1d4ed8;
    background: #dbeafe;
}

.search-item-news .search-item-type {
    color: #7c3aed;
    background: #ede9fe;
}

.search-item-specialty .search-item-type {
    color: #065f46;
    background: #d1fae5;
}

.search-item-section .search-item-type {
    color: #92400e;
    background: #ffedd5;
}

.search-item-event .search-item-type {
    color: #0f4c81;
    background: #dbeafe;
}

.search-item-title {
    margin: 10px 0 8px;
    font-size: 1.14rem;
    line-height: 1.35;
}

.search-item-title a {
    color: #1f2937;
    text-decoration: none;
}

.search-item-title a:hover {
    color: var(--primary);
}

.search-item-meta {
    margin: -2px 0 7px;
    color: #475569;
    font-size: 0.84rem;
    font-weight: 600;
}

.search-item-excerpt {
    margin: 0;
    color: #5f6c80;
    line-height: 1.6;
}

.search-item mark {
    padding: 0.08em 0.18em;
    border-radius: 4px;
    background: #fde68a;
    color: #111827;
}

.search-item-link {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.search-item-link:hover {
    color: var(--primary-dark);
}

.search-empty {
    margin-top: 18px;
    padding: 28px 22px;
    border-radius: 14px;
    border: 1px dashed rgba(15, 23, 42, 0.2);
    background: rgba(255, 255, 255, 0.82);
}

.search-empty h3 {
    margin: 0 0 8px;
    color: #1f2937;
}

.search-empty p {
    margin: 0;
    color: #5f6c80;
}

@media (max-width: 920px) {
    .home-search-input-wrap {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .home-search-submit {
        grid-column: 1 / -1;
        width: 100%;
    }

    .search-page-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-page-form .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .home-search-section {
        padding-bottom: 52px;
    }

    .home-search-card {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .home-search-title {
        font-size: 1.35rem;
    }

    .search-page-hero {
        padding: 18px 16px;
        border-radius: 14px;
    }

    .search-item {
        padding: 14px;
    }
}

body.dark-mode .home-search-card {
    border-color: #2a3444;
    background:
        radial-gradient(circle at 8% 18%, rgba(255, 193, 7, 0.15), transparent 32%),
        radial-gradient(circle at 90% 84%, rgba(239, 68, 68, 0.14), transparent 38%),
        linear-gradient(165deg, #151e2d 0%, #111826 48%, #0f1624 100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

body.dark-mode .home-search-kicker {
    background: rgba(248, 113, 113, 0.2);
    color: #fecaca;
}

body.dark-mode .home-search-title {
    color: #e5ebf5;
}

body.dark-mode .home-search-text {
    color: #a8b6cb;
}

body.dark-mode .home-search-label {
    color: #dbe4f3;
}

body.dark-mode .home-search-input-wrap {
    border-color: #2a3444;
    background: #111826;
}

body.dark-mode .home-search-icon {
    fill: #91a2b8;
}

body.dark-mode .home-search-input-wrap input {
    color: #e5ebf5;
}

body.dark-mode .home-search-hint {
    border-color: #2a3444;
    background: rgba(17, 24, 38, 0.85);
    color: #cbd5e1;
}

body.dark-mode .home-search-hint:hover {
    border-color: rgba(248, 113, 113, 0.46);
    color: #fff;
}

body.dark-mode .home-search-link {
    color: #d8e3f6;
}

body.dark-mode .search-page {
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 193, 7, 0.1), transparent 36%),
        radial-gradient(circle at 92% 100%, rgba(239, 68, 68, 0.12), transparent 42%),
        linear-gradient(180deg, #121a27 0%, #0f1521 100%);
}

body.dark-mode .search-page-hero,
body.dark-mode .search-summary,
body.dark-mode .search-item,
body.dark-mode .search-empty {
    border-color: #2a3444;
    background: rgba(20, 27, 40, 0.85);
    box-shadow: none;
}

body.dark-mode .search-page-subtitle,
body.dark-mode .search-item-excerpt,
body.dark-mode .search-empty p {
    color: #a8b6cb;
}

body.dark-mode .search-page-input-wrap {
    border-color: #2a3444;
    background: #111826;
}

body.dark-mode .search-page-icon {
    fill: #91a2b8;
}

body.dark-mode .search-page-input-wrap input {
    color: #e5ebf5;
}

body.dark-mode .search-page-popular a {
    border-color: #2a3444;
    background: #111826;
    color: #cbd5e1;
}

body.dark-mode .search-summary-chip-link {
    background: #1f2b3d;
    color: #d8e3f6;
}

body.dark-mode .search-summary-chip-link:hover {
    border-color: rgba(248, 113, 113, 0.42);
    color: #fff;
}

body.dark-mode .search-summary-chip-link.is-active {
    background: rgba(248, 113, 113, 0.18);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.45);
}

body.dark-mode .search-summary-note,
body.dark-mode .search-item-meta {
    color: #9fb0c8;
}

body.dark-mode .search-item mark {
    background: rgba(251, 191, 36, 0.3);
    color: #fef3c7;
}

body.dark-mode .search-item-title a,
body.dark-mode .search-empty h3 {
    color: #e5ebf5;
}

/* --- Auth Pages --- */
.auth-page {
    min-height: 100vh;
    margin: 0;
    padding: 26px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 14% 16%, rgba(255, 193, 7, 0.14), transparent 36%),
        radial-gradient(circle at 88% 86%, rgba(211, 47, 47, 0.12), transparent 42%),
        linear-gradient(180deg, #f4f6fb 0%, #eef2f8 100%);
}

.auth-shell {
    width: min(1060px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 30px 56px rgba(15, 23, 42, 0.18);
    background: #fff;
}

.auth-side {
    position: relative;
    padding: 36px 38px;
    color: #f8fafc;
    background:
        radial-gradient(circle at 16% 18%, rgba(255, 193, 7, 0.3), transparent 34%),
        radial-gradient(circle at 86% 92%, rgba(255, 255, 255, 0.16), transparent 40%),
        linear-gradient(155deg, #1f2937 0%, #111827 52%, #0f172a 100%);
    display: grid;
    align-content: start;
    gap: 16px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #f8fafc;
    text-decoration: none;
}

.auth-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ef4444, #d32f2f);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.35);
    flex-shrink: 0;
}

.auth-brand-text {
    max-width: 280px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
    color: #dbe7fb;
}

.auth-side-title {
    margin: 8px 0 0;
    font-size: clamp(1.55rem, 2.5vw, 2.1rem);
    line-height: 1.18;
    color: #fff;
    font-family: var(--font-heading);
}

.auth-side-subtitle {
    margin: 0;
    font-size: 0.98rem;
    color: #d6e2f3;
    max-width: 50ch;
}

.auth-side-points {
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.auth-side-points li {
    position: relative;
    padding-left: 18px;
    color: #e2ebfa;
    font-size: 0.92rem;
    line-height: 1.45;
}

.auth-side-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #fbbf24;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.22);
}

.auth-panel {
    padding: 34px 32px 30px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    display: grid;
    align-content: start;
}

.auth-panel-head h2 {
    margin: 12px 0 8px;
    font-size: 1.65rem;
    line-height: 1.2;
    color: #1f2937;
    font-family: var(--font-heading);
}

.auth-panel-head p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
}

.auth-panel-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-alert {
    margin-top: 16px;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 0.89rem;
    line-height: 1.5;
}

.auth-alert-error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b91c1c;
}

.auth-alert-success {
    border-color: #86efac;
    background: #ecfdf3;
    color: #166534;
}

.auth-alert-info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.auth-form {
    margin-top: 18px;
    display: grid;
    gap: 14px;
}

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

.auth-form-group {
    display: grid;
    gap: 7px;
}

.auth-form-group label {
    font-size: 0.86rem;
    font-weight: 700;
    color: #1f2937;
}

.auth-form-group input {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border-radius: 12px;
    border: 1px solid #d6dde8;
    background: #fff;
    color: #111827;
    font-size: 0.95rem;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.auth-form-group input::placeholder {
    color: #9aa4b2;
}

.auth-form-group input:focus {
    outline: none;
    border-color: rgba(211, 47, 47, 0.6);
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.12);
    background: #fff;
}

.auth-submit {
    margin-top: 4px;
    min-height: 48px;
    width: 100%;
    border-radius: 12px;
    font-size: 1rem;
    box-shadow: 0 12px 24px rgba(211, 47, 47, 0.26);
}

.auth-submit:hover {
    box-shadow: 0 16px 30px rgba(183, 28, 28, 0.34);
}

.auth-links {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 12px;
}

.auth-links a {
    color: #334155;
    font-size: 0.87rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.auth-back-link {
    margin-top: 22px;
    display: inline-flex;
    width: max-content;
    color: #6b7280;
    font-size: 0.9rem;
    text-decoration: none;
}

.auth-back-link:hover {
    color: #1f2937;
}

@media (max-width: 980px) {
    .auth-page {
        padding: 18px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 540px;
    }

    .auth-side {
        padding: 24px 24px 18px;
        gap: 12px;
    }

    .auth-brand-text {
        max-width: none;
    }

    .auth-side-points {
        gap: 8px;
    }

    .auth-panel {
        padding: 24px;
    }
}

@media (max-width: 560px) {
    .auth-page {
        padding: 12px;
    }

    .auth-shell {
        border-radius: 20px;
    }

    .auth-side,
    .auth-panel {
        padding: 18px 16px;
    }

    .auth-form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .auth-links {
        flex-direction: column;
    }
}

body.dark-mode.auth-page {
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 193, 7, 0.14), transparent 34%),
        radial-gradient(circle at 90% 88%, rgba(239, 68, 68, 0.13), transparent 40%),
        linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

body.dark-mode .auth-shell {
    border-color: #2a3444;
    background: #141b28;
    box-shadow: 0 28px 52px rgba(0, 0, 0, 0.42);
}

body.dark-mode .auth-side {
    background:
        radial-gradient(circle at 16% 18%, rgba(255, 193, 7, 0.22), transparent 34%),
        radial-gradient(circle at 90% 90%, rgba(255, 255, 255, 0.08), transparent 40%),
        linear-gradient(155deg, #111827 0%, #0c1320 56%, #090f1b 100%);
}

body.dark-mode .auth-panel {
    background: linear-gradient(180deg, #141b28 0%, #111826 100%);
}

body.dark-mode .auth-panel-head h2 {
    color: #e5ebf5;
}

body.dark-mode .auth-panel-head p {
    color: #a8b6cb;
}

body.dark-mode .auth-panel-chip {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

body.dark-mode .auth-form-group label {
    color: #dbe4f3;
}

body.dark-mode .auth-form-group input {
    border-color: #2a3444;
    background: #0f1624;
    color: #e5ebf5;
}

body.dark-mode .auth-form-group input::placeholder {
    color: #7f8ea3;
}

body.dark-mode .auth-form-group input:focus {
    border-color: rgba(248, 113, 113, 0.62);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.16);
}

body.dark-mode .auth-alert-error {
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(127, 29, 29, 0.3);
    color: #fecaca;
}

body.dark-mode .auth-alert-success {
    border-color: rgba(74, 222, 128, 0.42);
    background: rgba(20, 83, 45, 0.34);
    color: #bbf7d0;
}

body.dark-mode .auth-alert-info {
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(30, 58, 138, 0.3);
    color: #bfdbfe;
}

body.dark-mode .auth-links a {
    color: #cbd5e1;
}

body.dark-mode .auth-back-link {
    color: #a8b6cb;
}

body.dark-mode .auth-back-link:hover,
body.dark-mode .auth-links a:hover {
    color: #fff;
}


/* === Home V2 Redesign === */
.homepage-v2 {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-bottom: 40px;
    background:
        radial-gradient(circle at 6% 6%, rgba(255, 193, 7, 0.15), transparent 34%),
        radial-gradient(circle at 94% 0%, rgba(211, 47, 47, 0.12), transparent 35%),
        linear-gradient(180deg, #f8fbff 0%, #f4f7fb 36%, #eef3fa 100%);
}

.homepage-v2::before,
.homepage-v2::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    z-index: -1;
}

.homepage-v2::before {
    width: 420px;
    height: 420px;
    left: -220px;
    top: 380px;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.16), rgba(255, 193, 7, 0));
}

.homepage-v2::after {
    width: 520px;
    height: 520px;
    right: -270px;
    top: 980px;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.14), rgba(211, 47, 47, 0));
}

.homepage-v2 .hp-hero {
    position: relative;
    width: 100%;
    min-height: 520px;
    height: auto;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: #0f172a;
}

.homepage-v2 .hp-hero .swiper-wrapper,
.homepage-v2 .hp-hero .swiper-slide {
    height: auto;
}

.homepage-v2 .hp-hero-slide {
    position: relative;
    overflow: hidden;
    min-height: 520px;
    background-color: #0f172a;
}

.homepage-v2 .hp-hero-slide.no-image {
    background-image:
        radial-gradient(circle at 12% 16%, rgba(255, 193, 7, 0.18), transparent 32%),
        linear-gradient(132deg, #111827 0%, #1f2937 58%, #0f172a 100%);
}

.homepage-v2 .hp-hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Размытая подложка: заполняет кадр целиком, даёт глубину и убирает «пустоту» по краям */
.homepage-v2 .hp-hero-media-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: scale(1.16);
    filter: blur(30px) brightness(0.48) saturate(1.12);
    will-change: transform;
    animation: hpHeroKenburns 26s ease-in-out infinite alternate;
}

/* Основное фото — целиком, без грубой обрезки, с мягкой тенью-«парением» */
.homepage-v2 .hp-hero-media-fg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    filter: drop-shadow(0 22px 46px rgba(2, 6, 23, 0.55));
}

@keyframes hpHeroKenburns {
    from { transform: scale(1.16); }
    to   { transform: scale(1.26); }
}

@media (prefers-reduced-motion: reduce) {
    .homepage-v2 .hp-hero-media-bg {
        animation: none;
    }
}

.homepage-v2 .hp-hero-single .swiper-wrapper {
    transform: none !important;
    display: block;
}

.homepage-v2 .hp-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(98deg, rgba(2, 6, 23, 0.9) 0%, rgba(2, 6, 23, 0.66) 34%, rgba(2, 6, 23, 0.3) 62%, rgba(2, 6, 23, 0.46) 100%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.34) 0%, rgba(2, 6, 23, 0) 30%, rgba(2, 6, 23, 0.58) 100%),
        radial-gradient(130% 90% at 16% 50%, rgba(76, 29, 149, 0.3) 0%, transparent 58%);
}

.homepage-v2 .hp-hero-inner {
    position: relative;
    z-index: 2;
    min-height: 520px;
    display: flex;
    align-items: center;
    width: 100%;
    padding-top: 30px;
    padding-bottom: 56px;
}

.homepage-v2 .hp-hero-content {
    max-width: 760px;
    color: #fff;
}

.homepage-v2 .hp-hero-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f8fafc;
}

.homepage-v2 .hp-hero-content h1 {
    margin: 16px 0 14px;
    font-size: clamp(1.7rem, 3.1vw, 2.6rem);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-family: 'Montserrat', 'Open Sans', sans-serif;
    color: #fff;
}

.homepage-v2 .hp-hero-content p {
    max-width: 58ch;
    margin: 0;
    font-size: clamp(0.93rem, 1.12vw, 1.04rem);
    line-height: 1.56;
    color: rgba(255, 255, 255, 0.9);
}

.homepage-v2 .hp-hero-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.homepage-v2 .hp-hero-btn-main {
    min-height: 50px;
    min-width: 196px;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(255, 193, 7, 0.27);
}

.homepage-v2 .hp-hero-btn-ghost {
    min-height: 50px;
    min-width: 182px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.homepage-v2 .hp-hero-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    transform: translateY(-1px);
}

.homepage-v2 .hp-hero .hp-hero-pagination {
    bottom: 18px;
}

.homepage-v2 .hp-hero .hp-hero-pagination .swiper-pagination-bullet {
    width: 11px;
    height: 11px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.45);
}

.homepage-v2 .hp-hero .hp-hero-pagination .swiper-pagination-bullet-active {
    background: #ffc107;
}

.homepage-v2 .hp-hero .hp-hero-next,
.homepage-v2 .hp-hero .hp-hero-prev {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(2, 6, 23, 0.34);
    color: #fff;
    backdrop-filter: blur(6px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.homepage-v2 .hp-hero .hp-hero-next:hover,
.homepage-v2 .hp-hero .hp-hero-prev:hover {
    background: rgba(2, 6, 23, 0.54);
    transform: scale(1.04);
}

.homepage-v2 .hp-hero .hp-hero-next::after,
.homepage-v2 .hp-hero .hp-hero-prev::after {
    font-size: 18px;
    font-weight: 700;
}

.homepage-v2 .hp-actions-wrap {
    position: relative;
    margin-top: 18px;
    z-index: 8;
}

.homepage-v2 .hp-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.homepage-v2 .hp-action-card {
    min-height: 152px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.46);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 251, 255, 0.9) 100%);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    display: grid;
    align-content: start;
    gap: 12px;
    text-decoration: none;
    color: #1f2937;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.homepage-v2 .hp-action-card:hover {
    transform: translateY(-5px);
    border-color: rgba(211, 47, 47, 0.38);
    box-shadow: 0 24px 36px rgba(15, 23, 42, 0.16);
    color: #111827;
}

.homepage-v2 .hp-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.16), rgba(255, 193, 7, 0.24));
    color: #8b0f1a;
}

.homepage-v2 .hp-action-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.homepage-v2 .hp-action-card strong {
    font-size: 1.08rem;
    line-height: 1.25;
    color: #111827;
}

.homepage-v2 .hp-action-card span {
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.45;
}

.homepage-v2 .hp-search-section {
    padding: 38px 0 16px;
}

.homepage-v2 .hp-search-shell {
    position: relative;
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    padding: 28px;
    background:
        radial-gradient(circle at 10% 14%, rgba(255, 193, 7, 0.22), transparent 34%),
        radial-gradient(circle at 92% 88%, rgba(211, 47, 47, 0.14), transparent 38%),
        linear-gradient(160deg, #ffffff 0%, #f9fbff 52%, #f3f8ff 100%);
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.12);
}

.homepage-v2 .hp-search-head {
    max-width: 760px;
}

.homepage-v2 .hp-search-kicker {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(211, 47, 47, 0.1);
    border: 1px solid rgba(211, 47, 47, 0.18);
    color: #b91c1c;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.homepage-v2 .hp-search-title {
    margin: 11px 0 10px;
    font-size: clamp(1.52rem, 2.3vw, 2.08rem);
    line-height: 1.2;
    color: #0f172a;
    font-family: 'Montserrat', 'Open Sans', sans-serif;
}

.homepage-v2 .hp-search-text {
    margin: 0;
    color: #5f6c80;
    max-width: 60ch;
}

.homepage-v2 .hp-search-form {
    margin-top: 18px;
}

.homepage-v2 .hp-search-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #1e293b;
}

.homepage-v2 .hp-search-input-wrap {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 12px;
    border-radius: 14px;
    border: 1px solid #d6dfeb;
    background: rgba(255, 255, 255, 0.93);
}

.homepage-v2 .hp-search-icon {
    width: 22px;
    height: 22px;
    fill: #7b8798;
}

.homepage-v2 .hp-search-input-wrap input {
    width: 100%;
    border: none;
    background: transparent;
    color: #111827;
    min-height: 42px;
    font-size: 0.97rem;
}

.homepage-v2 .hp-search-input-wrap input:focus {
    outline: none;
}

.homepage-v2 .hp-search-submit {
    min-width: 134px;
    min-height: 44px;
    border-radius: 10px;
}

.homepage-v2 .hp-search-hints {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.homepage-v2 .hp-search-hint {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.85);
    color: #334155;
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
}

.homepage-v2 .hp-search-hint:hover {
    color: #111827;
    border-color: rgba(211, 47, 47, 0.42);
    background: #fff;
}

.homepage-v2 .hp-search-link {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    color: #334155;
    font-weight: 700;
    text-decoration: none;
}

.homepage-v2 .hp-search-link:hover {
    color: var(--primary);
}

.homepage-v2 .hp-news-section,
.homepage-v2 .hp-events-section,
.homepage-v2 .hp-programs-section {
    padding: 44px 0 12px;
}

.homepage-v2 .hp-section-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 22px;
}

.homepage-v2 .hp-section-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.homepage-v2 .hp-section-title {
    margin: 0;
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    line-height: 1.18;
    color: #0f172a;
    font-family: 'Montserrat', 'Open Sans', sans-serif;
}

.homepage-v2 .hp-section-text {
    margin: 10px 0 0;
    max-width: 60ch;
    color: #64748b;
}

.homepage-v2 .hp-section-link {
    white-space: nowrap;
}

.homepage-v2 .hp-news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.homepage-v2 .hp-news-card {
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.09);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.homepage-v2 .hp-news-card:hover {
    transform: translateY(-5px);
    border-color: rgba(211, 47, 47, 0.34);
    box-shadow: 0 20px 34px rgba(15, 23, 42, 0.13);
}

.homepage-v2 .hp-news-media {
    position: relative;
    height: 224px;
    background: linear-gradient(145deg, #111827 0%, #1f2937 100%);
    overflow: hidden;
}

.homepage-v2 .hp-news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.homepage-v2 .hp-news-video-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #020617 0%, #0f172a 100%);
}

.homepage-v2 .hp-news-video-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
}

.homepage-v2 .hp-news-video-badge svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.homepage-v2 .hp-news-date-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    font-size: 0.74rem;
    font-weight: 700;
    z-index: 5;
}

.homepage-v2 .hp-news-body {
    padding: 16px;
    display: grid;
    gap: 10px;
    flex: 1;
}

.homepage-v2 .hp-news-title {
    margin: 0;
    font-size: 1.16rem;
    line-height: 1.34;
}

.homepage-v2 .hp-news-title a {
    color: #111827;
    text-decoration: none;
}

.homepage-v2 .hp-news-title a:hover {
    color: var(--primary);
}

.homepage-v2 .hp-news-excerpt {
    margin: 0;
    color: #607087;
    line-height: 1.56;
}

.homepage-v2 .hp-news-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.homepage-v2 .hp-news-date-inline {
    font-size: 0.82rem;
    color: #64748b;
}

.homepage-v2 .hp-news-link {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.homepage-v2 .hp-news-link:hover {
    color: var(--primary-dark);
}

/* ===== Карусель событий на главной ===== */
.homepage-v2 .hp-events-swiper {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
    padding-bottom: 4px;
}
.homepage-v2 .hp-events-swiper .swiper-slide {
    height: auto;
    display: flex;
}
.homepage-v2 .hp-events-swiper .hp-event-card {
    width: 100%;
}
.homepage-v2 .hp-events-pagination {
    position: static;
    margin-top: 18px;
    text-align: center;
}
.homepage-v2 .hp-events-pagination .swiper-pagination-bullet {
    width: 9px; height: 9px; background: #cbd5e1; opacity: 1; transition: all .2s ease;
}
.homepage-v2 .hp-events-pagination .swiper-pagination-bullet-active {
    background: #dc2626; width: 24px; border-radius: 5px;
}
.homepage-v2 .hp-events-next,
.homepage-v2 .hp-events-prev {
    width: 44px; height: 44px; border-radius: 50%;
    background: #ffffff; color: #dc2626;
    border: 1px solid #e2e8f0; box-shadow: 0 6px 18px rgba(15, 23, 42, .12);
    transition: transform .2s ease, box-shadow .2s ease;
}
.homepage-v2 .hp-events-next:hover,
.homepage-v2 .hp-events-prev:hover { transform: scale(1.06); box-shadow: 0 8px 22px rgba(15, 23, 42, .18); }
.homepage-v2 .hp-events-next::after,
.homepage-v2 .hp-events-prev::after { font-size: 16px; font-weight: 800; }
.homepage-v2 .hp-events-next { right: -8px; }
.homepage-v2 .hp-events-prev { left: -8px; }
@media (max-width: 920px) {
    .homepage-v2 .hp-events-next,
    .homepage-v2 .hp-events-prev { display: none; }
}
body.dark-mode .homepage-v2 .hp-events-next,
body.dark-mode .homepage-v2 .hp-events-prev { background: #1e293b; border-color: #334155; }

.homepage-v2 .hp-events-section {
    position: relative;
    padding-top: 34px;
}

.homepage-v2 .hp-events-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.homepage-v2 .hp-event-card {
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: linear-gradient(160deg, #ffffff 0%, #f9fbff 58%, #f3f8ff 100%);
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
    padding: 14px;
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.homepage-v2 .hp-event-card.has-image {
    grid-template-columns: 74px minmax(0, 1fr) 210px;
}

.homepage-v2 .hp-event-card:hover {
    transform: translateY(-4px);
    border-color: rgba(211, 47, 47, 0.35);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.13);
}

.homepage-v2 .hp-event-date {
    min-height: 100%;
    border-radius: 14px;
    padding: 10px 8px;
    border: 1px solid rgba(211, 47, 47, 0.2);
    background:
        radial-gradient(circle at 30% 14%, rgba(255, 193, 7, 0.2), transparent 52%),
        linear-gradient(165deg, #fff5f5 0%, #ffecec 100%);
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2px;
    text-align: center;
}

.homepage-v2 .hp-event-date strong {
    display: block;
    font-size: 1.5rem;
    line-height: 1;
    color: #9f1239;
}

.homepage-v2 .hp-event-date span {
    display: block;
    color: #b45309;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.homepage-v2 .hp-event-date small {
    display: inline-flex;
    margin-top: 2px;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 700;
}

.homepage-v2 .hp-event-body {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.homepage-v2 .hp-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.homepage-v2 .hp-event-meta span {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.92);
    color: #475569;
    font-size: 0.74rem;
    font-weight: 600;
}

.homepage-v2 .hp-event-title {
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
    line-height: 1.35;
}

.homepage-v2 .hp-event-excerpt {
    margin: 0;
    color: #5f6c80;
    line-height: 1.56;
    font-size: 0.92rem;
}

.homepage-v2 .hp-event-link {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.homepage-v2 .hp-event-link:hover {
    color: var(--primary-dark);
}

.homepage-v2 .hp-event-thumb {
    align-self: stretch;
    border-radius: 12px;
    overflow: hidden;
    background: #eef2f7;
}

.homepage-v2 .hp-event-thumb img {
    width: 100%;
    height: 100%;
    min-height: 150px;
    object-fit: cover;
    display: block;
}

.homepage-v2 .hp-news-media-swiper .swiper-pagination {
    bottom: 10px;
}

.homepage-v2 .hp-news-media-swiper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.76);
    opacity: 0.95;
}

.homepage-v2 .hp-news-media-swiper .swiper-pagination-bullet-active {
    background: #ffc107;
}

.homepage-v2 .hp-news-media-swiper .swiper-button-next,
.homepage-v2 .hp-news-media-swiper .swiper-button-prev {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(2, 6, 23, 0.44);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.homepage-v2 .hp-news-media-swiper .swiper-button-next::after,
.homepage-v2 .hp-news-media-swiper .swiper-button-prev::after {
    font-size: 12px;
    font-weight: 700;
}

.homepage-v2 .hp-programs-section {
    position: relative;
    margin-top: 0;
    padding-top: 52px;
    padding-bottom: 60px;
    background:
        radial-gradient(circle at 10% 18%, rgba(255, 193, 7, 0.15), transparent 34%),
        radial-gradient(circle at 86% 86%, rgba(211, 47, 47, 0.13), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.homepage-v2 .hp-programs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

/* Фото специальности в карточке-виджете */
.homepage-v2 .hp-program-card.has-image { overflow: hidden; }
.homepage-v2 .hp-program-image {
    aspect-ratio: 16 / 9;
    margin: -18px -18px 16px;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    background: #eef2f7;
}
.homepage-v2 .hp-program-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .45s ease;
}
.homepage-v2 .hp-program-card.has-image:hover .hp-program-image img { transform: scale(1.04); }

.homepage-v2 .hp-program-card {
    min-height: 100%;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: linear-gradient(160deg, #ffffff 0%, #f9fbff 56%, #f5f8ff 100%);
    padding: 18px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.homepage-v2 .hp-program-card:hover {
    transform: translateY(-4px);
    border-color: rgba(211, 47, 47, 0.35);
    box-shadow: 0 20px 32px rgba(15, 23, 42, 0.14);
}

.homepage-v2 .hp-program-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.homepage-v2 .hp-program-code {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.78rem;
    font-weight: 700;
}

.homepage-v2 .hp-program-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.homepage-v2 .hp-program-chip.budget {
    background: #dcfce7;
    color: #166534;
}

.homepage-v2 .hp-program-chip.paid {
    background: #fff7ed;
    color: #9a3412;
}

.homepage-v2 .hp-program-name {
    margin: 14px 0 10px;
    font-size: 1.2rem;
    line-height: 1.34;
    color: #0f172a;
}

.homepage-v2 .hp-program-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.homepage-v2 .hp-program-tags span {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
}

.homepage-v2 .hp-program-description {
    margin: 12px 0 16px;
    color: #64748b;
    line-height: 1.58;
    flex: 1;
}

.homepage-v2 .hp-program-btn {
    width: 100%;
    border-radius: 11px;
}

.homepage-v2 .hp-empty-state {
    margin-top: 10px;
    padding: 26px;
    border-radius: 16px;
    border: 1px dashed rgba(15, 23, 42, 0.22);
    background: rgba(255, 255, 255, 0.84);
}

.homepage-v2 .hp-empty-state h3 {
    margin: 0 0 8px;
    color: #0f172a;
}

.homepage-v2 .hp-empty-state p {
    margin: 0;
    color: #64748b;
}

.homepage-v2 .hp-cta-section {
    margin-top: 16px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 28px 48px rgba(15, 23, 42, 0.2);
}

@media (max-width: 1200px) {
    .homepage-v2 .hp-hero,
    .homepage-v2 .hp-hero-slide,
    .homepage-v2 .hp-hero-inner {
        min-height: 430px;
    }

    .homepage-v2 .hp-news-grid,
    .homepage-v2 .hp-events-grid,
    .homepage-v2 .hp-programs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .homepage-v2 .hp-hero,
    .homepage-v2 .hp-hero-slide,
    .homepage-v2 .hp-hero-inner {
        min-height: 400px;
    }

    .homepage-v2 .hp-hero-media-fg {
        object-position: center;
    }

    .homepage-v2 .hp-hero-media-bg {
        filter: blur(22px) brightness(0.5) saturate(1.12);
    }

    .homepage-v2 .hp-hero-inner {
        padding-top: 24px;
        padding-bottom: 46px;
    }

    .homepage-v2 .hp-actions-wrap {
        margin-top: 14px;
    }

    .homepage-v2 .hp-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .homepage-v2 .hp-action-card {
        min-height: 170px;
    }

    .homepage-v2 .hp-section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .homepage-v2 .hp-search-input-wrap {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .homepage-v2 .hp-search-submit {
        grid-column: 1 / -1;
        width: 100%;
    }

    .homepage-v2 .hp-news-grid,
    .homepage-v2 .hp-events-grid,
    .homepage-v2 .hp-programs-grid {
        grid-template-columns: 1fr;
    }

    .homepage-v2 .hp-event-card.has-image {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .homepage-v2 .hp-event-thumb {
        display: none;
    }
}

@media (max-width: 720px) {
    .homepage-v2 {
        padding-bottom: 56px;
    }

    .homepage-v2 .hp-hero,
    .homepage-v2 .hp-hero-slide,
    .homepage-v2 .hp-hero-inner {
        min-height: 340px;
    }

    .homepage-v2 .hp-hero-content h1 {
        font-size: clamp(1.46rem, 7.4vw, 1.98rem);
        line-height: 1.13;
    }

    .homepage-v2 .hp-hero-content p {
        font-size: 0.98rem;
    }

    .homepage-v2 .hp-hero-actions {
        width: 100%;
    }

    .homepage-v2 .hp-hero-btn-main,
    .homepage-v2 .hp-hero-btn-ghost {
        width: 100%;
    }

    .homepage-v2 .hp-hero-media img {
        object-position: center center;
        transform: none;
    }

    .homepage-v2 .hp-hero .hp-hero-next,
    .homepage-v2 .hp-hero .hp-hero-prev {
        display: none;
    }

    .homepage-v2 .hp-actions-wrap {
        margin-top: 10px;
    }

    .homepage-v2 .hp-actions-grid {
        grid-template-columns: 1fr;
    }

    .homepage-v2 .hp-search-section {
        padding-top: 28px;
    }

    .homepage-v2 .hp-search-shell {
        border-radius: 16px;
        padding: 17px 15px;
    }

    .homepage-v2 .hp-programs-section {
        padding-top: 54px;
        padding-bottom: 64px;
    }

    .homepage-v2 .hp-events-section {
        padding-top: 26px;
    }

    .homepage-v2 .hp-event-card {
        padding: 12px;
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 10px;
    }

    .homepage-v2 .hp-event-title {
        font-size: 1rem;
    }
}

body.dark-mode .homepage-v2 {
    background:
        radial-gradient(circle at 8% 6%, rgba(255, 193, 7, 0.12), transparent 34%),
        radial-gradient(circle at 94% 0%, rgba(239, 68, 68, 0.14), transparent 35%),
        linear-gradient(180deg, #101723 0%, #0e1521 36%, #0c121d 100%);
}

body.dark-mode .homepage-v2 .hp-actions-grid .hp-action-card,
body.dark-mode .homepage-v2 .hp-search-shell,
body.dark-mode .homepage-v2 .hp-news-card,
body.dark-mode .homepage-v2 .hp-event-card,
body.dark-mode .homepage-v2 .hp-program-card,
body.dark-mode .homepage-v2 .hp-empty-state {
    border-color: #2a3444;
    background: rgba(20, 27, 40, 0.9);
    box-shadow: none;
}

body.dark-mode .homepage-v2 .hp-action-card strong,
body.dark-mode .homepage-v2 .hp-section-title,
body.dark-mode .homepage-v2 .hp-news-title a,
body.dark-mode .homepage-v2 .hp-event-title,
body.dark-mode .homepage-v2 .hp-program-name,
body.dark-mode .homepage-v2 .hp-empty-state h3 {
    color: #e5ebf5;
}

body.dark-mode .homepage-v2 .hp-action-card span,
body.dark-mode .homepage-v2 .hp-search-text,
body.dark-mode .homepage-v2 .hp-section-text,
body.dark-mode .homepage-v2 .hp-news-excerpt,
body.dark-mode .homepage-v2 .hp-event-excerpt,
body.dark-mode .homepage-v2 .hp-program-description,
body.dark-mode .homepage-v2 .hp-empty-state p,
body.dark-mode .homepage-v2 .hp-news-date-inline {
    color: #a8b6cb;
}

body.dark-mode .homepage-v2 .hp-search-kicker {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

body.dark-mode .homepage-v2 .hp-search-title {
    color: #e5ebf5;
}

body.dark-mode .homepage-v2 .hp-search-input-wrap {
    border-color: #2a3444;
    background: #111826;
}

body.dark-mode .homepage-v2 .hp-search-icon {
    fill: #91a2b8;
}

body.dark-mode .homepage-v2 .hp-search-input-wrap input {
    color: #e5ebf5;
}

body.dark-mode .homepage-v2 .hp-search-hint {
    border-color: #2a3444;
    background: rgba(17, 24, 38, 0.85);
    color: #cbd5e1;
}

body.dark-mode .homepage-v2 .hp-search-link,
body.dark-mode .homepage-v2 .hp-news-link,
body.dark-mode .homepage-v2 .hp-event-link {
    color: #d8e3f6;
}

body.dark-mode .homepage-v2 .hp-section-kicker {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

body.dark-mode .homepage-v2 .hp-program-code {
    background: #1f2b3d;
    color: #dbe4f3;
}

body.dark-mode .homepage-v2 .hp-program-chip.budget {
    background: rgba(22, 101, 52, 0.34);
    color: #bbf7d0;
}

body.dark-mode .homepage-v2 .hp-program-chip.paid {
    background: rgba(154, 52, 18, 0.34);
    color: #fed7aa;
}

body.dark-mode .homepage-v2 .hp-program-tags span {
    border-color: #314158;
    background: #111826;
    color: #cbd5e1;
}

body.dark-mode .homepage-v2 .hp-event-date {
    border-color: rgba(248, 113, 113, 0.34);
    background:
        radial-gradient(circle at 24% 14%, rgba(251, 191, 36, 0.16), transparent 48%),
        linear-gradient(165deg, rgba(127, 29, 29, 0.3) 0%, rgba(69, 10, 10, 0.38) 100%);
}

body.dark-mode .homepage-v2 .hp-event-date strong {
    color: #fecaca;
}

body.dark-mode .homepage-v2 .hp-event-date span {
    color: #fde68a;
}

body.dark-mode .homepage-v2 .hp-event-date small,
body.dark-mode .homepage-v2 .hp-event-meta span {
    border-color: #314158;
    background: #111826;
    color: #cbd5e1;
}

body.dark-mode .homepage-v2 .hp-cta-section {
    border-color: #2a3444;
    box-shadow: none;
}

/* ====== NEW FEEDBACK FORM ====== */
.hp-feedback-section {
    padding: 80px 0;
    background-color: var(--color-bg-secondary, #f8fafc);
    border-top: 1px solid var(--color-border, #e2e8f0);
    border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.hp-feedback-wrap {
    max-width: 800px;
    margin: 0 auto;
}

.hp-feedback-head {
    margin-bottom: 40px;
}

.hp-feedback-kicker {
    display: inline-block;
    color: var(--color-primary, #0d6efd);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.hp-feedback-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text-dark, #1e293b);
    margin-bottom: 16px;
    line-height: 1.2;
}

.hp-feedback-text {
    font-size: 1.125rem;
    color: var(--color-text-muted, #64748b);
    max-width: 600px;
    margin: 0 auto;
}

.hp-feedback-form-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid var(--color-border, #e2e8f0);
}

.hp-feedback-form .form-label {
    font-weight: 600;
    color: var(--color-text-dark, #1e293b);
    display: block;
    margin-bottom: 8px;
    text-align: left;
}

.hp-feedback-form .form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text-dark, #1e293b);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--color-border, #cbd5e1);
    border-radius: 8px;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.hp-feedback-form .form-control:focus {
    border-color: var(--color-primary, #3b82f6);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

body.dark-mode .hp-feedback-section {
    background-color: var(--color-bg, #0f172a);
    border-color: var(--color-border, #334155);
}

body.dark-mode .hp-feedback-title {
    color: #f8fafc;
}

body.dark-mode .hp-feedback-text {
    color: #94a3b8;
}

body.dark-mode .hp-feedback-form-box {
    background: #1e293b;
    border-color: #334155;
    box-shadow: none;
}

body.dark-mode .hp-feedback-form .form-label {
    color: #cbd5e1;
}

body.dark-mode .hp-feedback-form .form-control {
    background-color: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-mode .hp-feedback-form .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

body.dark-mode .hp-feedback-form .form-control::placeholder {
    color: #64748b;
}

@media (max-width: 768px) {
    .hp-feedback-section {
        padding: 60px 0;
    }
    
    .hp-feedback-title {
        font-size: 2rem;
    }
    
    .hp-feedback-form-box {
        padding: 30px 20px;
    }
    
    .hp-feedback-form .form-row {
        flex-direction: column;
        gap: 0 !important;
    }
    
    .hp-feedback-form .form-group {
        width: 100%;
        margin-bottom: 1.5rem;
    }
}


/* ========== BREADCRUMBS ========== */
.breadcrumb-wrap {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 0;
}
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
}
.breadcrumb-item { display: flex; align-items: center; gap: 4px; color: #64748b; }
.breadcrumb-item a { color: #6366f1; text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: #374151; font-weight: 500; }
.breadcrumb-sep { color: #cbd5e1; font-size: 11px; }
body.dark-mode .breadcrumb-wrap { background: #1e293b; border-color: #334155; }
body.dark-mode .breadcrumb-item { color: #94a3b8; }
body.dark-mode .breadcrumb-item a { color: #818cf8; }
body.dark-mode .breadcrumb-item.active { color: #e2e8f0; }

/* ========== NEWS CARD FOOTER (views + link) ========== */
.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}
.news-card-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}

/* ========== SCHEDULE HISTORY PANEL ========== */
.saas-schedule-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.saas-schedule-history-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 13px;
    line-height: 1.45;
}
body.dark-mode .saas-schedule-history-item { background: #1e293b; }
.saas-schedule-history-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.saas-schedule-history-badge--add    { background: #d1fae5; color: #065f46; }
.saas-schedule-history-badge--delete { background: #fee2e2; color: #991b1b; }
.saas-schedule-history-badge--note   { background: #dbeafe; color: #1e40af; }
.saas-schedule-history-badge--default{ background: #f1f5f9; color: #475569; }
body.dark-mode .saas-schedule-history-badge--add    { background: #064e3b; color: #6ee7b7; }
body.dark-mode .saas-schedule-history-badge--delete { background: #450a0a; color: #fca5a5; }
body.dark-mode .saas-schedule-history-badge--note   { background: #1e3a5f; color: #93c5fd; }
.saas-schedule-history-desc {
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.dark-mode .saas-schedule-history-desc { color: #cbd5e1; }
.saas-schedule-history-time {
    color: #94a3b8;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== PAGE FILES BLOCK ========== */
.page-files-block { margin-top: 36px; padding-top: 28px; border-top: 1px solid #e2e8f0; }
.page-files-title { font-size: 18px; font-weight: 600; margin: 0 0 16px; color: #1e293b; }
.page-files-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.page-files-item {}
.page-files-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #1e293b;
    font-size: 14px;
    transition: background 0.15s, border-color 0.15s;
}
.page-files-link:hover { background: #eef2ff; border-color: #a5b4fc; color: #4f46e5; }
.page-files-icon { font-size: 18px; flex-shrink: 0; }
.page-files-name { font-weight: 500; }
.page-files-size { color: #94a3b8; font-size: 12px; margin-left: 4px; }
body.dark-mode .page-files-title { color: #e2e8f0; }
body.dark-mode .page-files-link { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-mode .page-files-link:hover { background: #312e81; border-color: #6366f1; color: #a5b4fc; }

/* ========== NEWS FILTER FORM ========== */
.news-filter-form { margin-bottom: 32px; }
.news-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.news-filter-group { display: flex; flex-direction: column; gap: 5px; }
.news-filter-label { font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.news-filter-select,
.news-filter-input {
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    outline: none;
}
.news-filter-select:focus, .news-filter-input:focus { border-color: #6366f1; }
.news-filter-actions { display: flex; align-items: center; gap: 10px; }
.news-filter-btn {
    height: 38px;
    padding: 0 20px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.news-filter-btn:hover { background: #4338ca; }
.news-filter-reset { font-size: 13px; color: #64748b; text-decoration: none; }
.news-filter-reset:hover { color: #dc2626; }
body.dark-mode .news-filter-row { background: #1e293b; border-color: #334155; }
body.dark-mode .news-filter-select,
body.dark-mode .news-filter-input { background: #0f172a; border-color: #334155; color: #e2e8f0; }

/* ===== TEACHERS ===== */
.teachers-page { padding: 40px 0 64px; }
.teachers-page-head { margin-bottom: 32px; }
.teachers-page-head .section-title { margin: 8px 0 16px; }
.teachers-page-subtitle { color: #64748b; font-size: 15px; margin: 0; line-height: 1.5; }
body.dark-mode .teachers-page-subtitle { color: #94a3b8; }

.teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.teacher-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}
.teacher-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.1); transform: translateY(-2px); }
.teacher-card-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 260px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.teacher-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.teacher-card-initials {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.teacher-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.teacher-card-name { font-size: 16px; font-weight: 700; color: #1e293b; margin: 0; line-height: 1.3; }
.teacher-card-subject { font-size: 13px; color: #64748b; margin: 0 0 4px; }
.teacher-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; }
.teacher-badge {
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.3;
}
.teacher-badge-exp { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.teacher-card-bio { font-size: 13px; color: #64748b; line-height: 1.5; margin: 4px 0 0; }

body.dark-mode .teacher-card { background: #1e293b; border-color: #334155; }
body.dark-mode .teacher-card-photo { background: #0f172a; }
body.dark-mode .teacher-card-name { color: #f1f5f9; }
body.dark-mode .teacher-card-subject { color: #94a3b8; }
body.dark-mode .teacher-badge-exp { background: #0f172a; color: #94a3b8; border-color: #334155; }
body.dark-mode .teacher-card-bio { color: #94a3b8; }

@media (max-width: 640px) {
    .teachers-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
}

/* ===== TEACHERS — исправления карточек ===== */
.teacher-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.teacher-card-link:hover .teacher-card-name { color: #dc2626; }
.teacher-card-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    max-height: none;
}
.teacher-card-photo img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: top center;
    transition: transform .5s ease;
}
/* Лёгкий зум при наведении */
.teacher-card-link:hover .teacher-card-photo img {
    transform: scale(1.05);
}
/* Мягкий нижний градиент — объединяет пёстрые фото и «заземляет» карточку */
.teacher-card-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 55%, rgba(15, 23, 42, 0.2) 100%);
}
/* Тонкая внутренняя обводка фото для аккуратной рамки */
.teacher-card-photo::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.07);
}
body.dark-mode .teacher-card-photo::before {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.teacher-card-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    padding-top: 10px;
    font-size: 13px;
    color: #dc2626;
    font-weight: 600;
    transition: gap .15s ease;
}
.teacher-card-link:hover .teacher-card-more { gap: 8px; }

/* ===== TEACHER PROFILE PAGE ===== */
.teacher-profile {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}
.teacher-profile-aside { position: sticky; top: 24px; }
.teacher-profile-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.teacher-profile-photo img { width:100%; height:100%; object-fit:cover; object-position:top center; }
.teacher-profile-initials {
    width: 100px; height: 100px; border-radius: 50%;
    background: linear-gradient(135deg,#dc2626,#b91c1c);
    color:#fff; font-size:36px; font-weight:700;
    display:flex; align-items:center; justify-content:center;
}
.teacher-profile-quick { display:flex; flex-direction:column; gap:12px; margin-bottom:24px; padding:16px 18px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:12px; }
.teacher-profile-quick-item {
    display:flex; gap:10px; align-items:flex-start;
    font-size:13.5px; color:#475569; line-height:1.45;
}
.tpq-icon { width:18px; height:18px; flex-shrink:0; color:#94a3b8; margin-top:1px; }
body.dark-mode .teacher-profile-quick { background:#0f172a; border-color:#334155; }
body.dark-mode .teacher-profile-quick-item { color:#cbd5e1; }
body.dark-mode .tpq-icon { color:#64748b; }
.teacher-profile-back {
    display:inline-block; font-size:13px; color:#64748b;
    text-decoration:none; padding:8px 0;
}
.teacher-profile-back:hover { color:#dc2626; }
.teacher-profile-name {
    font-size:28px; font-weight:800; color:#1e293b;
    margin:0 0 6px; line-height:1.2;
}
.teacher-profile-role { font-size:16px; color:#64748b; margin:0 0 16px; }
.teacher-profile-badge { display:inline-block; margin-bottom:24px; }
.teacher-profile-section-title {
    font-size:15px; font-weight:700; color:#1e293b;
    margin:0 0 12px; padding-bottom:8px;
    border-bottom:2px solid #f1f5f9;
}
.teacher-profile-bio { margin-bottom:32px; }
.teacher-profile-bio-text { font-size:15px; color:#475569; line-height:1.7; }
.teacher-profile-table { margin-bottom:32px; }
.teacher-profile-table table { width:100%; border-collapse:collapse; }
.teacher-profile-table td {
    padding:10px 12px; font-size:14px;
    border-bottom:1px solid #f1f5f9; vertical-align:top;
}
.teacher-profile-table td:first-child { color:#94a3b8; width:40%; white-space:nowrap; }
.teacher-profile-table td:last-child { color:#1e293b; }

body.dark-mode .teacher-profile-name { color:#f1f5f9; }
body.dark-mode .teacher-profile-photo { background:#0f172a; }
body.dark-mode .teacher-profile-section-title { color:#e2e8f0; border-color:#334155; }
body.dark-mode .teacher-profile-bio-text { color:#94a3b8; }
body.dark-mode .teacher-profile-table td { border-color:#1e293b; }
body.dark-mode .teacher-profile-table td:last-child { color:#e2e8f0; }

@media (max-width:768px) {
    .teacher-profile { grid-template-columns:1fr; gap:24px; }
    .teacher-profile-aside { position:static; }
    .teacher-profile-photo { max-width:200px; margin:0 auto 20px; }
}

/* ===== FEEDBACK FORM ===== */
.ff-form { display: block; }
.ff-honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.ff-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}
.ff-field { display: flex; flex-direction: column; min-width: 0; }
.ff-field-full { grid-column: 1 / -1; }

.ff-label {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ff-label-hint { color: #94a3b8; font-weight: 500; font-size: 12px; }
.ff-req { color: #dc2626; font-weight: 700; }

.ff-input-wrap { position: relative; }
.ff-input-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.ff-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    background: #fff;
    border: 1.5px solid #d8e0ec;
    border-radius: 10px;
    font-size: 14.5px;
    color: #111827;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.ff-input::placeholder { color: #94a3b8; }
.ff-input:focus {
    border-color: #1b3152;
    box-shadow: 0 0 0 3px rgba(27, 49, 82, 0.12);
}
.ff-input.has-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.ff-input.is-valid {
    border-color: #16a34a;
}

.ff-select { padding-left: 14px; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.ff-textarea {
    padding: 12px 14px;
    min-height: 84px;
    resize: vertical;
    line-height: 1.5;
}

.ff-error {
    color: #dc2626;
    font-size: 12.5px;
    margin-top: 5px;
    min-height: 16px;
    line-height: 1.3;
}

.ff-field-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.ff-counter {
    font-size: 11.5px;
    color: #94a3b8;
    white-space: nowrap;
}
.ff-counter.is-near-limit { color: #d97706; }
.ff-counter.is-over { color: #dc2626; font-weight: 600; }

.ff-check {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    align-items: start;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}
.ff-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.ff-check-mark {
    width: 18px;
    height: 18px;
    border: 1.5px solid #c7d5e8;
    border-radius: 5px;
    background: #fff;
    display: block;
    position: relative;
    transition: border-color .15s, background .15s;
    margin-top: 2px;
}
.ff-check input:checked + .ff-check-mark {
    background: #1b3152;
    border-color: #1b3152;
}
.ff-check input:checked + .ff-check-mark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.ff-check input:focus-visible + .ff-check-mark {
    box-shadow: 0 0 0 3px rgba(27, 49, 82, 0.18);
}
.ff-check a { color: #1b3152; text-decoration: underline; }
.ff-check a:hover { color: #dc2626; }

.ff-submit {
    margin-top: 22px;
    width: 100%;
    padding: 14px 24px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background .15s, transform .1s;
}
.ff-submit:hover:not(:disabled) { background: #b91c1c; }
.ff-submit:active:not(:disabled) { transform: translateY(1px); }
.ff-submit:disabled { background: #94a3b8; cursor: wait; }
.ff-submit-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ffSpin .7s linear infinite;
}
.ff-submit.is-loading .ff-submit-spinner { display: inline-block; }
.ff-submit.is-loading .ff-submit-label { opacity: .85; }
@keyframes ffSpin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
    .ff-grid { grid-template-columns: 1fr; gap: 14px; }
}

body.dark-mode .ff-input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}
body.dark-mode .ff-input:focus { border-color: #60a5fa; }
body.dark-mode .ff-label { color: #e2e8f0; }
body.dark-mode .ff-check { color: #cbd5e1; }
body.dark-mode .ff-check-mark { background: #1e293b; border-color: #475569; }
body.dark-mode .ff-counter { color: #64748b; }
body.dark-mode .ff-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }

/* ===== FEEDBACK FAB ===== */
.ff-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 998;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px 14px 16px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.35), 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform .15s, box-shadow .15s, background .15s;
    font-family: inherit;
}
.ff-fab:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.45);
}
.ff-fab:active { transform: translateY(0); }
.ff-fab svg { width: 22px; height: 22px; flex-shrink: 0; }
.ff-fab-label { white-space: nowrap; }

@media (max-width: 560px) {
    .ff-fab { right: 16px; bottom: 16px; padding: 13px; }
    .ff-fab-label { display: none; }
}

/* ===== FEEDBACK MODAL ===== */
.ff-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.ff-modal-backdrop[hidden] { display: none; }
.ff-modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.ff-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    transform: scale(0.96);
    transition: transform .2s ease;
}
.ff-modal-backdrop.is-open .ff-modal { transform: scale(1); }
.ff-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}
.ff-modal-close:hover { background: #e2e8f0; color: #0f172a; }
.ff-modal-close svg { width: 18px; height: 18px; }
.ff-modal-head {
    padding: 24px 28px 4px;
}
.ff-modal-head h3 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}
.ff-modal-head p {
    margin: 0;
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.5;
}
.ff-modal-body { padding: 16px 28px 28px; }

body.dark-mode .ff-modal { background: #1e293b; }
body.dark-mode .ff-modal-head h3 { color: #f1f5f9; }
body.dark-mode .ff-modal-head p { color: #94a3b8; }
body.dark-mode .ff-modal-close { background: #334155; color: #cbd5e1; }
body.dark-mode .ff-modal-close:hover { background: #475569; color: #fff; }

/* ===== FEEDBACK TOAST ===== */
.ff-toast {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 1200;
    display: inline-flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 14px 14px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0,0,0,.2);
    max-width: 380px;
    min-width: 280px;
    border-left: 4px solid;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .25s, transform .25s;
}
.ff-toast.is-visible { opacity: 1; transform: translateX(0); }
.ff-toast-success { border-left-color: #16a34a; }
.ff-toast-error { border-left-color: #dc2626; }
.ff-toast-icon { flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; }
.ff-toast-success .ff-toast-icon { color: #16a34a; }
.ff-toast-error .ff-toast-icon { color: #dc2626; }
.ff-toast-icon svg { width: 100%; height: 100%; }
.ff-toast-text { flex: 1; font-size: 13.5px; line-height: 1.45; color: #1f2937; }
.ff-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    padding: 0 4px;
    margin: -2px 0 0;
}
.ff-toast-close:hover { color: #1f2937; }

@media (max-width: 560px) {
    .ff-toast { left: 16px; right: 16px; max-width: none; }
}

body.dark-mode .ff-toast { background: #1e293b; }
body.dark-mode .ff-toast-text { color: #e2e8f0; }
body.dark-mode .ff-toast-close { color: #64748b; }
body.dark-mode .ff-toast-close:hover { color: #e2e8f0; }

/* ===== Публичная страница событий (/events) ===== */
.events-page { padding: 40px 0 64px; }
.events-page-head { max-width: 760px; margin: 0 auto 36px; text-align: center; }
.events-page-eyebrow {
    display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca;
    padding: 5px 13px; border-radius: 999px; margin-bottom: 14px;
}
.events-page-title {
    font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 800; color: #1e293b;
    margin: 0 0 10px; letter-spacing: -.02em; line-height: 1.15;
}
.events-page-sub { color: #64748b; font-size: 1.04rem; margin: 0; }
.events-empty { text-align: center; padding: 56px 20px; color: #64748b; }
.events-empty h3 { color: #334155; margin: 0 0 8px; }

.events-list { display: flex; flex-direction: column; gap: 24px; max-width: 920px; margin: 0 auto; }
.event-block {
    display: block;
    padding: 24px 26px;
    background: #fff; border: 1px solid #e7ebf2; border-radius: 18px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}
/* Постер обтекается текстом: квадрат слева, текст справа и ниже него */
.event-block-poster {
    float: left;
    width: 200px;
    height: 200px;
    margin: 2px 24px 16px 0;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #eef2f7;
}
.event-block-poster-bg { display: none; }
.event-block-poster-fg {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.event-block-datechip {
    position: absolute; top: 14px; left: 14px; z-index: 1; text-align: center; line-height: 1;
    background: rgba(255, 255, 255, .95); border-radius: 12px; padding: 9px 13px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .22);
}
.event-block-datechip strong { display: block; font-size: 1.55rem; font-weight: 800; color: #dc2626; }
.event-block-datechip span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #475569; font-weight: 700; margin-top: 3px; }
.event-block-datechip small { display: block; font-size: .68rem; color: #94a3b8; margin-top: 2px; }

.event-block-body { padding: 0; }
.event-block-period {
    display: inline-flex; align-items: center; gap: 7px;
    background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
    font-size: .82rem; font-weight: 700; padding: 6px 13px; border-radius: 999px; margin-bottom: 13px;
}
.event-block-period svg { width: 15px; height: 15px; flex: none; }
.event-block-title { font-size: 1.32rem; font-weight: 800; color: #1e293b; margin: 0 0 11px; line-height: 1.25; }
.event-block-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #64748b; font-size: .9rem; margin-bottom: 15px; }
.event-block-meta span { display: inline-flex; align-items: center; gap: 6px; }
.event-block-meta svg { width: 15px; height: 15px; flex: none; color: #94a3b8; }
.event-block-desc { color: #334155; font-size: .96rem; }
/* Простой текст (интро) обтекает картинку справа, а структурные блоки
   уходят под картинку на всю ширину — чтобы не «слипалось» с постером. */
.event-block-desc > div,
.event-block-desc > table,
.event-block-desc > h2,
.event-block-desc > h3,
.event-block-desc > h4,
.event-block-desc > ul,
.event-block-desc > ol,
.event-block-desc > blockquote { clear: left; }

/* Типографика описания события из редактора */
.event-desc { line-height: 1.6; }
.event-desc > :first-child { margin-top: 0; }
.event-desc > :last-child { margin-bottom: 0; }
.event-desc p { margin: .5em 0; }
.event-desc h1, .event-desc h2, .event-desc h3, .event-desc h4 { font-size: 1.05rem; font-weight: 700; color: #1e293b; margin: .8em 0 .4em; }
.event-desc ul, .event-desc ol { padding-left: 1.3em; margin: .5em 0; }
.event-desc li { margin: .25em 0; }
.event-desc a { color: #dc2626; text-decoration: underline; }
.event-desc img { max-width: 100%; height: auto; border-radius: 8px; margin: .5em 0; }
/* Таблицы из редактора: горизонтальная прокрутка, чтобы не вылезали за карточку */
.event-desc table { border-collapse: collapse; display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.event-desc table td, .event-desc table th { padding: 5px 10px; }

@media (max-width: 680px) {
    .event-block { padding: 18px; }
    .event-block-poster { float: none; width: 200px; height: 200px; margin: 0 auto 16px; }
    .event-block-body { padding: 0; }
}

body.dark-mode .events-page-title { color: #f1f5f9; }
body.dark-mode .events-page-sub, body.dark-mode .events-empty { color: #94a3b8; }
body.dark-mode .events-empty h3 { color: #e2e8f0; }
body.dark-mode .event-block { background: #1e293b; border-color: #334155; }
body.dark-mode .event-block-title { color: #f1f5f9; }
body.dark-mode .event-block-desc, body.dark-mode .event-desc { color: #cbd5e1; }
body.dark-mode .event-desc h1, body.dark-mode .event-desc h2,
body.dark-mode .event-desc h3, body.dark-mode .event-desc h4 { color: #e2e8f0; }
body.dark-mode .event-block-datechip { background: rgba(15, 23, 42, .92); }
body.dark-mode .event-block-datechip span { color: #cbd5e1; }
