:root {
    --green: #3d7a48;
    --green-dark: #245637;
    --green-soft: #e4efe4;
    --brown: #705d4d;
    --brown-dark: #4e3f34;
    --cream: #f5f0e8;
    --cream-2: #fffaf1;
    --sun: #e9ad0c;
    --sun-dark: #c99100;
    --ink: #1e1f22;
    --muted: #6f716d;
    --line: rgba(46, 40, 34, .12);
    --shadow: 0 22px 55px rgba(36, 33, 28, .14);
    --radius-xl: 2rem;
    --radius-lg: 1.4rem;
    --header-height: 132px;

    /* Высота овала основной навигации и овала профиля в шапке. */
    --header-pill-height: 64px;

    /* Мини-аватар участника внутри компактного текстового чипа. */
    --avatar-size-chip-xs: 24px;
    /* Маленький аватар пользователя внутри обычного чипа. */
    --avatar-size-chip: 28px;
    /* Базовый аватар в шапке, мобильном меню и стандартной заглушке. */
    --avatar-size: 50px;
    /* Аватар участника в обычной карточке. */
    --avatar-size-member: 44px;
    /* Средний аватар в рейтингах, списках команд и панели организатора. */
    --avatar-size-md: 42px;
    /* Большой аватар команды в карточках и модальных окнах. */
    --avatar-size-lg: 75px;
    /* Большой аватар команды на экранах шириной до 768px. */
    --avatar-size-lg-mobile: 64px;
    /* Крупный аватар на странице пользователя или команды. */
    --avatar-size-xl: 96px;
    /* Адаптивный главный аватар в современном личном кабинете. */
    --avatar-size-cabinet-hero: clamp(100px, 10vw, 160px);
    /* Предпросмотр аватара на странице редактирования профиля. */
    --avatar-size-preview: 140px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(233, 173, 12, .08), transparent 28rem),
        linear-gradient(180deg, #faf7f1 0%, #f2eee7 100%);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
}

section[id] {
    scroll-margin-top: calc(var(--header-height) + 24px);
}

::selection {
    color: #fff;
    background: var(--green);
}

.site-header {
    padding: .75rem 0 .9rem;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
    background: rgba(61, 122, 72, .88);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 40px rgba(25, 40, 28, .16);
    z-index: 1020;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-link,
.brand-link:hover {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: .65rem;
    color: #fff;
    text-decoration: none;
}

.brand-symbol {
    display: block;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
}

.brand-mark {
    display: block;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 900;
    line-height: .82;
    letter-spacing: -.08em;
    transform: skew(-8deg);
    text-shadow: 0 8px 20px rgba(0, 0, 0, .16);
}

.brand-tagline {
    margin-top: .4rem;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .9;
}

.desktop-actions {
    align-items: center;
    gap: .75rem;
}

.main-nav {
    justify-content: center;
    align-items: center;
    height: var(--header-pill-height);
    gap: .5rem;
    margin-top: 1rem;
    padding: .72rem;
    border-radius: 999px;
    background: var(--brown);
    box-shadow: 0 18px 45px rgba(31, 24, 18, .18);
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: .55rem 1.05rem;
    border-radius: 999px;
    color: #fff;
    font-size: .9rem;
    font-weight: 800;
    text-decoration: none;
    transition: background-color .2s ease, transform .2s ease, color .2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    color: var(--ink);
    background: var(--sun);
    transform: translateY(-1px);
}

.btn {
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: .01em;
}

.btn-sun,
.btn-primary {
    border-color: var(--sun);
    color: #fff;
    background: var(--sun);
    box-shadow: 0 14px 30px rgba(233, 173, 12, .26);
}

.btn-sun:hover,
.btn-primary:hover,
.btn-sun:focus-visible,
.btn-primary:focus-visible {
    border-color: var(--sun-dark);
    color: #fff;
    background: var(--sun-dark);
    transform: translateY(-1px);
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-dark,
.btn-outline-danger,
.btn-outline-secondary {
    border-width: 1.5px;
    border-color: rgba(36, 86, 55, .28);
    color: var(--green-dark);
    background: rgba(255, 255, 255, .64);
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-dark:hover,
.btn-outline-danger:hover,
.btn-outline-secondary:hover {
    border-color: var(--green);
    color: #fff;
    background: var(--green);
}

.btn-success,
.btn-warning,
.btn-dark {
    border: 0;
    color: #fff;
    background: var(--green);
}

.btn-success:hover,
.btn-warning:hover,
.btn-dark:hover {
    color: #fff;
    background: var(--green-dark);
}

.btn-ghost-light {
    border: 1px solid rgba(255, 255, 255, .55);
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.btn-ghost-light:hover {
    color: var(--ink);
    background: #fff;
}

.btn-cream {
    border-color: var(--cream);
    color: var(--brown-dark);
    background: var(--cream);
}

.btn-outline-cream {
    border: 1.5px solid rgba(255, 255, 255, .72);
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.btn-outline-cream:hover {
    color: var(--brown-dark);
    background: #fff;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    height: var(--header-pill-height);
    gap: .55rem;
    min-height: 42px;
    padding: .35rem .8rem .35rem .4rem;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    font-weight: 800;
}

.user-menu-btn img,
.avatar-placeholder,
.mobile-user-title img {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--sun);
    font-weight: 900;
}

.user-dropdown {
    overflow: hidden;
    padding: .55rem;
    border: 0;
    border-radius: 1.1rem;
    background: var(--cream-2);
}

.user-dropdown .dropdown-item {
    border-radius: .8rem;
    font-weight: 700;
}

.mobile-menu-btn {
    display: inline-grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 50%;
    background: var(--sun);
    box-shadow: 0 16px 30px rgba(0, 0, 0, .18);
}

.mobile-menu-btn span {
    width: 20px;
    height: 2px;
    margin: -5px 0;
    border-radius: 999px;
    background: #fff;
}

.mobile-offcanvas {
    --bs-offcanvas-width: min(82vw, 330px);
    color: #fff;
    background:
        radial-gradient(circle at 80% 0, rgba(233, 173, 12, .24), transparent 16rem),
        var(--brown);
}

.mobile-offcanvas .offcanvas-header {
    align-items: flex-start;
    padding: 1.25rem;
}

.mobile-brand .brand-mark {
    font-size: 2.35rem;
}

.mobile-brand .brand-symbol {
    width: 60px;
    height: 60px;
}

.mobile-nav {
    display: grid;
    gap: .25rem;
    margin-bottom: 2rem;
}

.mobile-nav a {
    padding: .55rem 0;
    color: #fff;
    font-size: clamp(1.55rem, 7vw, 2.25rem);
    font-weight: 950;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -.06em;
}

.mobile-nav a:hover {
    color: var(--sun);
}

.mobile-auth-panel {
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .18);
}

.mobile-user-title {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: 1rem;
    font-weight: 900;
}

.site-main {
    min-height: 65vh;
}

.page-shell {
    padding-top: 2.25rem;
    padding-bottom: 2.25rem;
}

.flash-messages {
    padding-top: 1.25rem;
}

.home-body .flash-messages {
    position: relative;
    z-index: 5;
    margin-bottom: -1.5rem;
}

.home-hero {
    position: relative;
    display: grid;
    min-height: calc(100vh - var(--header-height));
    overflow: hidden;
    color: #fff;
    isolation: isolate;
}

.hero-video-layer,
.hero-shade {
    position: absolute;
    inset: 0;
}

.hero-video-placeholder {
    background:
        radial-gradient(circle at 30% 35%, rgba(255, 255, 255, .16), transparent 14rem),
        linear-gradient(140deg, rgba(45, 94, 52, .78), rgba(46, 32, 24, .72)),
        linear-gradient(35deg, #314b36 0%, #5d7555 35%, #b4823d 64%, #3a603d 100%);
    transform: scale(1.02);
}

.hero-video-real {
    overflow: hidden;
    background: #151915;
}

.hero-video-grid {
    position: absolute;
    inset: 0;
    opacity: .24;
    background-image:
        linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
    background-size: 70px 70px;
    mask-image: linear-gradient(90deg, #000 0%, transparent 82%);
}

.hero-video-placeholder::before,
.hero-video-placeholder::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(4px);
}

.hero-video-placeholder::before {
    width: 48vw;
    height: 28vh;
    left: 34%;
    bottom: 15%;
    background: rgba(255, 255, 255, .22);
    transform: rotate(-9deg);
}

.hero-video-placeholder::after {
    width: 36vw;
    height: 22vh;
    left: 8%;
    top: 18%;
    background: rgba(36, 86, 55, .45);
    transform: rotate(16deg);
}

.hero-video-note {
    position: absolute;
    right: clamp(1rem, 4vw, 4rem);
    bottom: clamp(1rem, 4vw, 4rem);
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    max-width: 340px;
    padding: .9rem 1rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    color: rgba(255, 255, 255, .88);
    background: rgba(0, 0, 0, .2);
    backdrop-filter: blur(12px);
    font-size: .88rem;
    z-index: 2;
}

.play-icon {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    background: var(--sun);
}

.hero-shade {
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .62) 0%, rgba(0, 0, 0, .18) 58%, rgba(0, 0, 0, .45) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, .18) 0%, rgba(0, 0, 0, .5) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    align-items: end;
    gap: 2.2rem;
    padding-top: clamp(0.8rem, 2vw, 1.8rem);
    padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

.hero-copy {
    max-width: 980px;
}

.script-label {
    margin: 0 0 0.5rem;
    color: inherit;
    font-family: "Segoe Print", "Comic Sans MS", cursive;
    font-size: clamp(1.3rem, 3vw, 2.65rem);
    line-height: 1;
    opacity: .95;
    transform: translateY(-1.0rem) rotate(-3deg);
}

.hero-copy h1,
.section-heading h2,
.rules-intro h2,
.final-cta h2 {
    font-size: clamp(2.8rem, 7vw, 6.8rem);
    font-weight: 950;
    line-height: .88;
    letter-spacing: -.08em;
    text-transform: uppercase;
}

.hero-copy h1 {
    max-width: 1060px;
    margin: 0 0 1.35rem;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
}

.hero-lead {
    max-width: 760px;
    margin: 0 0 1rem;
    font-size: clamp(1.08rem, 2vw, 1.55rem);
    font-weight: 760;
    line-height: 1.35;
}

.hero-text {
    max-width: 720px;
    margin: 0;
    color: rgba(255, 255, 255, .9);
    font-size: 1.05rem;
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    margin-top: 2rem;
}

.hero-actions .btn {
    min-width: min(100%, 250px);
    padding: .95rem 1.35rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .9rem;
    max-width: 760px;
}

.hero-stats div {
    padding: 1.05rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 1.3rem;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(13px);
}

.hero-stats strong {
    display: block;
    font-size: clamp(1.75rem, 4vw, 3.2rem);
    line-height: .9;
}

.hero-stats span {
    display: block;
    margin-top: .4rem;
    color: rgba(255, 255, 255, .84);
    font-weight: 750;
}

.polaroid-section {
    overflow: hidden;
    padding: clamp(3rem, 6vw, 6rem) 0 clamp(3rem, 6vw, 6rem);
    color: #fff;
    background:
        radial-gradient(circle at 80% 10%, rgba(233, 173, 12, .16), transparent 22rem),
        var(--green);
}

.section-heading {
    max-width: 820px;
    margin-bottom: 2.4rem;
}

.section-heading.centered {
    max-width: 880px;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.section-heading h2,
.rules-intro h2,
.final-cta h2 {
    margin: 0 0 1rem;
    font-size: clamp(2.25rem, 5.5vw, 5.4rem);
}

.section-heading p:not(.script-label),
.rules-intro p:not(.script-label),
.final-cta p:not(.script-label) {
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.55;
}

.light-heading p:not(.script-label) {
    color: rgba(255, 255, 255, .84);
}

.polaroid-marquee {
    width: 100%;
    overflow: hidden;
    padding: 1.8rem 0 3rem;
    margin: -1rem 0 -1.5rem;
}

.polaroid-track {
    display: flex;
    width: max-content;
    gap: 1.2rem;
    animation: polaroid-scroll 38s linear infinite;
    will-change: transform;
}

.polaroid-marquee:hover .polaroid-track {
    animation-play-state: paused;
}

.polaroid-card {
    flex: 0 0 clamp(210px, 22vw, 330px);
    padding: .9rem .9rem 1.4rem;
    color: var(--brown-dark);
    background: #fff;
    box-shadow: 0 16px 36px rgba(18, 34, 22, .26);
}

.polaroid-photo {
    aspect-ratio: 1 / .86;
    border: 1px solid rgba(0, 0, 0, .04);
    background-size: cover;
    background-position: center;
}

.placeholder-photo {
    position: relative;
    overflow: hidden;
}

.placeholder-photo::after {
    content: "Фото из ЛК";
    position: absolute;
    right: .75rem;
    bottom: .75rem;
    padding: .35rem .6rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, .88);
    background: rgba(0, 0, 0, .32);
    font-size: .78rem;
    font-weight: 800;
}

.photo-one { background: linear-gradient(135deg, #d4e4ef, #5c7c65 48%, #fff6e6); }
.photo-two { background: linear-gradient(135deg, #101820, #eb913d 58%, #43251f); }
.photo-three { background: linear-gradient(135deg, #cfe6ff, #f8fafc 45%, #8aa071); }
.photo-four { background: linear-gradient(135deg, #7ab3f1, #f6c375 50%, #385c4a); }
.photo-five { background: linear-gradient(135deg, #85c6e8, #3e8c6a 48%, #f3e9ce); }
.photo-six { background: linear-gradient(135deg, #d9e2e9, #91b5bf 48%, #f7d37e); }

.polaroid-card p {
    margin: .75rem 0 0;
    font-family: "Segoe Print", "Comic Sans MS", cursive;
    font-size: clamp(1.05rem, 2.3vw, 1.65rem);
    line-height: 1.08;
    text-align: center;
}

.rotate-left { transform: rotate(-1deg); }
.rotate-right { transform: rotate(1.4deg); }
.rotate-left-big { transform: rotate(-5deg); }

@keyframes polaroid-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.schedule-section {
    padding: clamp(3rem, 7vw, 7rem) 0;
    background: var(--cream);
}

.contest-group {
    margin-top: clamp(2rem, 4vw, 3.5rem);
}

.contest-group-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.contest-group-head h3 {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2.3rem);
    font-weight: 950;
    letter-spacing: -.05em;
}

.contest-group-head span {
    color: var(--muted);
    font-weight: 750;
}

.contest-scroll {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.35rem;
}

.contest-card-link,
.contest-card-link:hover {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-xl);
    background: #fff;
    box-shadow: var(--shadow);
    transition: transform .25s ease, box-shadow .25s ease;
}

.contest-card-link:hover {
    transform: translateY(-8px) rotate(-.35deg);
    box-shadow: 0 28px 72px rgba(33, 28, 23, .2);
}

.contest-card-detail-link,
.contest-card-detail-link:hover,
.contest-title-link,
.contest-title-link:hover {
    color: inherit;
    text-decoration: none;
}

.contest-card-detail-link {
    display: block;
}

.contest-card-detail-link:focus-visible,
.contest-title-link:focus-visible,
.contest-registration-button:focus-visible,
.contest-archive-detail-button:focus-visible {
    outline: 3px solid var(--sun);
    outline-offset: 3px;
}

.contest-media {
    position: relative;
    height: 245px;
    overflow: hidden;
    background: var(--green-soft);
}

.compact-tile .contest-media {
    height: 185px;
}

.contest-media img,
.contest-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.contest-card-link:hover .contest-media img,
.contest-card-link:hover .contest-placeholder {
    transform: scale(1.06);
}

.contest-placeholder {
    background:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, .52), transparent 7rem),
        linear-gradient(135deg, #315d42, #9fc08b 46%, #e1ad4f);
}

.contest-placeholder.alt {
    background:
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, .45), transparent 7rem),
        linear-gradient(135deg, #2d4b65, #e0a76d 54%, #634b3c);
}

.contest-placeholder.archive {
    background:
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, .5), transparent 6rem),
        linear-gradient(135deg, #77675c, #b3b9a5 54%, #e9ad0c);
}

.contest-placeholder::after {
    content: "Изображение фотоквеста";
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    padding: .45rem .75rem;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, .28);
    font-size: .82rem;
    font-weight: 800;
}

.pill-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    padding: .45rem .75rem;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, .18);
    backdrop-filter: blur(10px);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.contest-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.35rem;
}

.contest-content h4 {
    margin: 0 0 .65rem;
    font-size: 1.35rem;
    font-weight: 950;
    line-height: 1;
    letter-spacing: -.04em;
    text-transform: uppercase;
}

.contest-date {
    margin-bottom: .65rem;
    color: var(--green-dark);
    font-weight: 850;
}

.contest-content p:not(.contest-date) {
    color: #3c3d3a;
    line-height: 1.45;
}

.contest-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: auto;
    padding-top: 1rem;
}

.contest-footer-row strong {
    font-size: 1.02rem;
}

.contest-footer-row span,
.contest-registration-button {
    display: inline-flex;
    min-width: 120px;
    justify-content: center;
    padding: .68rem 1rem;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--green);
    font: inherit;
    font-weight: 900;
}

.contest-registration-button {
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .2s ease, transform .2s ease;
}

.contest-registration-button:hover {
    color: #fff;
    background: var(--green-dark);
    text-decoration: none;
    transform: translateY(-1px);
}

.contest-archive-detail-button {
    display: inline-flex;
    min-width: 120px;
    align-items: center;
    justify-content: center;
    padding: .68rem 1rem;
    border: 1px solid rgba(46, 40, 34, .22);
    border-radius: 999px;
    color: var(--brown-dark);
    background: rgba(255, 255, 255, .7);
    font-weight: 900;
    text-decoration: none;
}

.contest-archive-detail-button:hover {
    color: var(--brown-dark);
    background: #fff;
    text-decoration: none;
}

.empty-state {
    padding: 1.25rem;
    border: 1px dashed rgba(61, 122, 72, .32);
    border-radius: 1.3rem;
    color: var(--muted);
    background: rgba(255, 255, 255, .58);
    font-weight: 750;
}

.rules-section {
    position: relative;
    overflow: hidden;
    padding: clamp(3rem, 8vw, 7rem) 0;
    color: #fff;
    background:
        radial-gradient(circle at 78% 25%, rgba(233, 173, 12, .2), transparent 18rem),
        var(--brown);
}

.rules-section::before {
    content: "";
    position: absolute;
    inset: 3rem -10vw auto auto;
    width: min(70vw, 900px);
    height: min(55vw, 640px);
    border: 7px dashed rgba(255, 255, 255, .36);
    border-left: 0;
    border-bottom: 0;
    border-radius: 50%;
    transform: rotate(14deg);
    opacity: .55;
}

.rules-intro {
    position: relative;
    max-width: 970px;
    z-index: 1;
}

.rules-intro p:not(.script-label) {
    max-width: 720px;
    color: rgba(255, 255, 255, .86);
}

.rules-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2.4rem;
}

.rule-card {
    min-height: 245px;
    padding: 1.35rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(12px);
    transition: transform .25s ease, background .25s ease;
}

.rule-card:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, .13);
}

.rule-card span {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 1.1rem;
    border-radius: 50%;
    color: var(--brown-dark);
    background: var(--sun);
    font-weight: 950;
}

.rule-card h3 {
    margin-bottom: .65rem;
    font-size: 1.35rem;
    font-weight: 950;
    letter-spacing: -.04em;
    text-transform: uppercase;
}

.rule-card p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, .84);
    line-height: 1.52;
}

.accent-rule {
    background: rgba(233, 173, 12, .18);
}

.rules-note {
    position: relative;
    z-index: 1;
    margin-top: 1.2rem;
    padding: 1.25rem 1.35rem;
    border-radius: 1.35rem;
    color: var(--brown-dark);
    background: var(--cream-2);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .14);
    font-size: 1.05rem;
}

.final-cta {
    padding: clamp(3rem, 7vw, 7rem) 0;
    background:
        linear-gradient(180deg, var(--cream) 0%, #fff 100%);
}

.final-cta-card {
    overflow: hidden;
    max-width: 1040px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem);
    border-radius: 2.4rem;
    color: #fff;
    text-align: center;
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, .18), transparent 14rem),
        linear-gradient(135deg, var(--green), var(--brown));
    box-shadow: var(--shadow);
}

.final-cta-card p:not(.script-label) {
    max-width: 720px;
    margin-right: auto;
    margin-left: auto;
    color: rgba(255, 255, 255, .86);
}

.site-footer {
    padding: 2rem 0;
    color: rgba(255, 255, 255, .74);
    background: var(--brown-dark);
}

.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.footer-logo {
    display: inline-block;
    margin-bottom: .35rem;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 950;
    letter-spacing: -.07em;
    text-decoration: none;
    transform: skew(-8deg);
}

.site-footer p {
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, .78);
    font-weight: 800;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--sun);
}

.floating-actions {
    position: fixed;
    right: clamp(.75rem, 2vw, 1.8rem);
    bottom: clamp(.75rem, 2vw, 1.8rem);
    z-index: 1010;
    display: grid;
    gap: .7rem;
}

.floating-actions a {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 50%;
    color: #fff;
    background: rgba(18, 15, 12, 0.445);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 18px 32px rgba(33, 28, 23, .22);
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.floating-actions a:hover {
    transform: translateY(-3px) rotate(-6deg);
    border-color: rgba(255, 255, 255, .42);
    background: rgba(18, 15, 12, .58);
    box-shadow: 0 22px 38px rgba(33, 28, 23, .28);
}


.card,
.list-group-item,
.alert,
.table,
.form-card,
.member-card {
    border-color: var(--line);
}

.card,
.list-group-item,
.form-card,
.member-card {
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 14px 34px rgba(31, 34, 28, .08);
}

.list-group {
    gap: .85rem;
}

.list-group-item {
    overflow: hidden;
    border: 1px solid var(--line) !important;
}

.card-link {
    color: inherit;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.card-link:hover {
    transform: translateY(-6px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, .1);
}

.contest-card-img,
.archive-photo {
    height: 220px;
    object-fit: cover;
}

.avatar-md,
.avatar-lg,
.avatar-xl,
.user-chip img,
.member-card img {
    object-fit: cover;
    border-radius: 50%;
    background: #f1f3f5;
}

.avatar-md { width: var(--avatar-size-md); height: var(--avatar-size-md); }
.avatar-lg { width: var(--avatar-size-lg); height: var(--avatar-size-lg); }
.avatar-xl { width: var(--avatar-size-xl); height: var(--avatar-size-xl); }

.user-chip {
    display: inline-flex;
    gap: .5rem;
    align-items: center;
    color: #212529;
}

.user-chip img {
    width: var(--avatar-size-chip);
    height: var(--avatar-size-chip);
}

.member-card {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .85rem;
}

.member-card img,
.member-card .avatar-placeholder {
    width: var(--avatar-size-member);
    height: var(--avatar-size-member);
}

.form-card {
    max-width: 760px;
    padding: clamp(1.25rem, 3vw, 2rem);
}

.form-card input,
.form-card textarea,
.form-card select {
    width: 100%;
    max-width: 100%;
}

.form-card input,
.form-card textarea,
.form-card select,
.form-control,
.form-select {
    min-height: 46px;
    border-radius: .95rem;
    border-color: rgba(36, 86, 55, .18);
}

.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 .2rem rgba(61, 122, 72, .16);
}

.qr-img {
    max-width: 260px;
    width: 100%;
}

.task-photo {
    max-height: 520px;
    object-fit: contain;
}

.judge-photo,
.modal-photo {
    max-height: 80vh;
    object-fit: contain;
}

.table-responsive {
    overflow: auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 36px rgba(31, 34, 28, .08);
}

.table {
    overflow: hidden;
    margin-bottom: 0;
    border-radius: var(--radius-lg);
}

.table thead th {
    color: #fff;
    background: var(--green);
    border-color: rgba(255, 255, 255, .14);
}

.badge.text-bg-warning,
.badge.text-bg-light {
    border-radius: 999px;
    color: var(--brown-dark) !important;
    background: rgba(233, 173, 12, .24) !important;
}

.badge.text-bg-warning {
    background: var(--sun) !important;
}

.modal-content {
    border: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

@media (max-width: 1199.98px) {
    :root {
        --header-height: 92px;
    }

    .site-header {
        padding: .75rem 0;
    }
}

@media (max-width: 991.98px) {
    .home-hero {
        min-height: calc(100vh - var(--header-height));
    }

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

    .hero-copy h1 {
        font-size: clamp(2.35rem, 12vw, 4.7rem);
    }

    .hero-video-note {
        display: none;
    }

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

    .contest-group-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .contest-scroll {
        display: grid;
        grid-auto-columns: minmax(285px, 78vw);
        grid-auto-flow: column;
        grid-template-columns: none;
        gap: 1rem;
        margin-right: calc(var(--bs-gutter-x) * -.5);
        margin-left: calc(var(--bs-gutter-x) * -.5);
        padding: .35rem calc(var(--bs-gutter-x) * .5) 1.35rem;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
    }

    .contest-tile {
        scroll-snap-align: start;
    }

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

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

@media (max-width: 767.98px) {
    body {
        background: var(--cream);
    }

    .brand-tagline {
        display: none;
    }

    .brand-mark {
        font-size: 2rem;
    }

    .brand-symbol {
        width: 48px;
        height: 48px;
    }

    .hero-content {
        padding-top: 2.4rem;
        padding-bottom: 2.4rem;
    }

    .hero-copy h1,
    .section-heading h2,
    .rules-intro h2,
    .final-cta h2 {
        letter-spacing: -.065em;
    }

    .hero-lead {
        font-size: 1rem;
    }

    .hero-text {
        display: none;
    }

    .hero-actions {
        width: 100%;
    }

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

    .polaroid-track {
        animation-duration: 28s;
    }

    .polaroid-card {
        flex-basis: 230px;
    }

    .contest-media {
        height: 210px;
    }

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

    .rule-card {
        min-height: auto;
    }

    .floating-actions a {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 576px) {
    .page-shell {
        padding-top: 1.5rem;
    }

    .contest-card-img,
    .archive-photo {
        height: 180px;
    }

    .contest-scroll {
        grid-auto-columns: minmax(270px, 84vw);
    }

    .contest-content {
        padding: 1.1rem;
    }

    .contest-footer-row {
        align-items: stretch;
        flex-direction: column;
    }

    .contest-footer-row span,
    .contest-registration-button,
    .contest-archive-detail-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ===== Дополнительный редизайн: прозрачная шапка, фоновые круги, страницы и мобильный рейтинг ===== */
:root {
    --header-height: 88px;
}

.site-header {
    position: sticky;
    top: 0;
    padding: .72rem 0;
    border-bottom: 0;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
    isolation: isolate;
}

/* Градиент шапка */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0 0 -34px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, .70) 0%,
        rgba(0, 0, 0, .40) 40%,
        rgba(0, 0, 0, .05) 80%,
        rgba(0, 0, 0, 0) 100%
    );
}

.topbar {
    flex-wrap: nowrap;
    min-height: 58px;
}

.brand-link {
    flex: 0 0 auto;
}

.brand-mark {
    font-size: clamp(1.55rem, 2.65vw, 2.45rem);
}

.brand-symbol {
    width: clamp(48px, 4.8vw, 60px);
    height: clamp(48px, 4.8vw, 60px);
}

.brand-tagline {
    margin-top: .25rem;
    font-size: .62rem;
}

.main-nav {
    flex: 1 1 auto;
    margin: 0;
    padding: .42rem;
    gap: .18rem;
    background: rgba(28, 23, 18, .24);
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(16px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .12);
}

.main-nav a {
    min-height: 38px;
    padding: .48rem .78rem;
    font-size: .82rem;
    white-space: nowrap;
}

.desktop-actions {
    flex: 0 0 auto;
}

.user-menu-btn,
.btn-ghost-light {
    background: rgba(28, 23, 18, .24);
    backdrop-filter: blur(16px);
}

.home-hero {
    margin-top: calc(var(--header-height) * -1);
    min-height: 100vh;
    padding-top: var(--header-height);
}

.home-body .flash-messages {
    margin-top: calc(var(--header-height) * -1);
    padding-top: calc(var(--header-height) + 1rem);
}

.content-page {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.content-page::before,
.content-page::after {
    content: "";
    position: fixed;
    z-index: -1;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    pointer-events: none;
    opacity: .18;
    filter: blur(.5px);
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.content-page::before {
    left: -90px;
    top: 22vh;
    background: var(--sun);
    animation: float-circle-wide 9s ease-in-out infinite alternate;
}

.content-page::after {
    right: -120px;
    top: 58vh;
    background: var(--green);
    animation: float-circle-wide 8s ease-in-out infinite alternate-reverse;
}

@keyframes float-circle-wide {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(92px, -54px, 0) scale(1.12); }
}

.schedule-section {
    position: relative;
    overflow: hidden;
}

.animated-bg-dot {
    position: absolute;
    z-index: 0;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    pointer-events: none;
    opacity: .16;
    background: var(--sun);
    will-change: transform;
    animation: floating-dot-fast 7s ease-in-out infinite alternate;
}

.dot-one { left: 4%; top: 9%; width: 72px; height: 72px; }
.dot-two { right: 8%; top: 16%; width: 108px; height: 108px; animation-delay: -2s; background: var(--green); }
.dot-three { left: 18%; bottom: 11%; width: 120px; height: 120px; animation-delay: -3.5s; background: var(--green); }
.dot-four { right: 22%; bottom: 5%; width: 62px; height: 62px; animation-delay: -1.2s; }
.dot-five { left: 44%; top: 3%; width: 54px; height: 54px; animation-delay: -4s; background: var(--brown); }
.dot-six { right: 40%; top: 47%; width: 82px; height: 82px; animation-delay: -5s; }
.animated-bg-line { display: none !important; }

.schedule-section > .container {
    position: relative;
    z-index: 1;
}

@keyframes floating-dot-fast {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(95px, -70px, 0) scale(1.18); }
}

.card-tag-row {
    position: absolute;
    inset: 1rem 1rem auto 1rem;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: flex-end;
}

.card-tag-row span {
    padding: .42rem .66rem;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, .18);
    backdrop-filter: blur(10px);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.contest-kind {
    margin: 0 0 .45rem !important;
    color: var(--green-dark) !important;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.contest-meta-list {
    display: grid;
    gap: .55rem;
    margin: .8rem 0 1rem;
}

.contest-meta-list div {
    padding: .7rem .8rem;
    border-radius: 1rem;
    background: rgba(61, 122, 72, .08);
}

.contest-meta-list span {
    display: block;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.contest-meta-list strong {
    display: block;
    margin-top: .15rem;
    color: var(--ink);
    font-size: .92rem;
    line-height: 1.25;
}

.contest-card-link,
.contest-card-link:hover {
    border-radius: var(--radius-xl) !important;
    transform-origin: center;
}

.contest-card-link:hover {
    overflow: hidden;
}

.contest-card-link:hover .contest-media {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* Общие современные заголовки и карточки */
.eyebrow {
    margin: 0 0 .45rem;
    color: var(--green-dark);
    font-size: .78rem;
    font-weight: 950;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.modern-page-head,
.dashboard-hero,
.cabinet-hero,
.contest-detail-hero,
.team-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: clamp(1.4rem, 4vw, 2.4rem);
    border-radius: clamp(1.6rem, 4vw, 2.6rem);
    color: #fff;
    background:
        radial-gradient(circle at 85% 10%, rgba(233, 173, 12, .28), transparent 18rem),
        linear-gradient(135deg, var(--green), var(--brown));
    box-shadow: var(--shadow);
}

.modern-page-head,
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: clamp(1.4rem, 4vw, 2.4rem);
}

.modern-page-head h1,
.dashboard-hero h1,
.cabinet-hero h1,
.contest-detail-hero h1,
.team-hero h1,
.dashboard-section h2,
.detail-card h2,
.participation-card h2 {
    margin: 0;
    font-weight: 950;
    line-height: .95;
    letter-spacing: -.06em;
}

.modern-page-head h1,
.dashboard-hero h1,
.cabinet-hero h1,
.contest-detail-hero h1,
.team-hero h1 {
    font-size: clamp(2.2rem, 5.2vw, 4.8rem);
}

.modern-page-head p:not(.eyebrow),
.dashboard-hero p:not(.eyebrow),
.cabinet-hero p,
.contest-detail-hero p,
.team-hero p {
    max-width: 820px;
    margin: .65rem 0 0;
    color: rgba(255, 255, 255, .84);
    line-height: 1.55;
}

.modern-page-head .eyebrow,
.dashboard-hero .eyebrow,
.cabinet-hero .eyebrow,
.contest-detail-hero .eyebrow,
.team-hero .eyebrow {
    color: rgba(255, 255, 255, .82);
}

.compact-head {
    max-width: 860px;
}

.lead-text {
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    font-weight: 650;
}

.dashboard-section,
.detail-card,
.participation-card,
.task-card-modern,
.archive-task-section {
    position: relative;
    margin-bottom: 1.25rem;
    padding: clamp(1.15rem, 3vw, 1.65rem);
    border: 1px solid rgba(46, 40, 34, .1);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 16px 44px rgba(31, 34, 28, .09);
    backdrop-filter: blur(14px);
}

.soft-section {
    background: rgba(255, 250, 241, .86);
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-title-row h2,
.detail-card h2,
.participation-card h2 {
    font-size: clamp(1.55rem, 3vw, 2.45rem);
}

/* Кабинет организатора */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.dashboard-stat-card,
.admin-contest-card,
.payment-card {
    border: 1px solid rgba(46, 40, 34, .1);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 14px 36px rgba(31, 34, 28, .08);
}

.dashboard-stat-card {
    padding: 1.15rem;
}

.dashboard-stat-card span {
    color: var(--muted);
    font-weight: 800;
}

.dashboard-stat-card strong {
    display: block;
    margin-top: .4rem;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1;
}

.admin-contest-list {
    display: grid;
    gap: 1rem;
}

.admin-contest-card {
    padding: 1.1rem;
}

.admin-contest-top,
.team-admin-main,
.payment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-contest-top h3,
.payment-card strong,
.team-admin-main strong {
    margin: 0;
    font-weight: 950;
    letter-spacing: -.03em;
}

.admin-contest-top p,
.payment-card span,
.team-admin-main span,
.team-members-row span {
    display: block;
    margin: .2rem 0 0;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 650;
}

.admin-contest-actions,
.team-status-stack,
.task-chip-list,
.member-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.admin-subtitle {
    margin: 1rem 0 .6rem;
    color: var(--brown-dark);
    font-weight: 950;
    letter-spacing: -.02em;
}

.admin-team-list,
.payment-grid {
    display: grid;
    gap: .75rem;
}

.payment-receipt-card {
    padding: 1rem;
}

.payment-receipt-details {
    min-width: 0;
}

.receipt-delivery-form {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: min(100%, 620px);
}

.receipt-delivery-form .form-control {
    min-width: 240px;
}

.team-admin-card {
    padding: .9rem;
    border-radius: 1.2rem;
    background: rgba(61, 122, 72, .06);
}

.team-members-row {
    display: grid;
    gap: .5rem;
    margin-top: .75rem;
}

.member-chips span,
.task-chip,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 850;
}

.member-chips span {
    padding: .42rem .65rem;
    color: var(--green-dark);
    background: rgba(255, 255, 255, .78);
}

.status-pill {
    padding: .42rem .66rem;
    color: var(--brown-dark);
    background: rgba(233, 173, 12, .18);
}

.status-pill.paid,
.status-pill.started {
    color: #fff;
    background: var(--green);
}

.status-pill.unpaid {
    color: #fff;
    background: var(--sun);
}

.muted-pill {
    color: var(--muted);
    background: rgba(46, 40, 34, .08);
}

.task-chip {
    padding: .52rem .75rem;
    color: var(--green-dark);
    text-decoration: none;
    background: rgba(61, 122, 72, .09);
}

.task-chip:hover {
    color: #fff;
    background: var(--green);
}

.task-chip em {
    color: var(--brown-dark);
    font-style: normal;
}

.payment-card {
    padding: 1rem;
}

.admin-users-table {
    box-shadow: none;
}

/* Личный кабинет */
.cabinet-hero,
.team-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: clamp(1.25rem, 4vw, 2.35rem);
}

.cabinet-user-card,
.team-hero-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cabinet-avatar-placeholder {
    flex: 0 0 auto;
    width: var(--avatar-size-xl) !important;
    height: var(--avatar-size-xl) !important;
    font-size: 2rem;
}

.cabinet-actions-panel,
.team-hero-actions,
.detail-actions,
.team-card-actions,
.invite-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.invite-grid,
.cabinet-team-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.invite-card,
.cabinet-team-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    min-height: 220px;
    padding: 1.1rem;
    border: 1px solid rgba(46, 40, 34, .1);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 14px 32px rgba(31, 34, 28, .08);
}

.invite-card h3,
.cabinet-team-card h4,
.team-card-topline h4 {
    margin: .7rem 0 .25rem;
    font-weight: 950;
    letter-spacing: -.04em;
}

.invite-card p,
.cabinet-team-card p,
.team-card-topline p {
    margin: 0;
    color: var(--muted);
    font-weight: 650;
}

.invite-card small {
    color: var(--muted);
    font-weight: 750;
}

.cabinet-team-group {
    margin-top: 1.2rem;
}

.cabinet-team-group-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}

.cabinet-team-group-head h3 {
    margin: 0;
    font-weight: 950;
    letter-spacing: -.04em;
}

.cabinet-team-group-head span {
    color: var(--muted);
    font-weight: 800;
}

.team-card-topline {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.team-card-facts {
    display: grid;
    gap: .45rem;
    margin: .9rem 0;
}

.team-card-facts span {
    padding: .55rem .7rem;
    border-radius: .9rem;
    color: var(--muted);
    background: rgba(61, 122, 72, .07);
    font-size: .9rem;
    font-weight: 750;
}

/* Страница фотоквеста */
.contest-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(420px, 1.18fr);
    gap: clamp(1rem, 3vw, 2rem);
    padding: clamp(1.25rem, 4vw, 2rem);
}

.contest-detail-copy {
    display: flex;
    align-self: stretch;
    flex-direction: column;
    min-width: 0;
    padding: clamp(.5rem, 2vw, 1rem);
}

.contest-detail-page .contest-detail-hero h1 {
    font-size: clamp(2rem, 4.4vw, 4.15rem);
}

.contest-detail-actions {
    margin-top: auto;
    padding-top: clamp(3rem, 8vh, 6rem);
}

.contest-detail-media-card {
    display: flex;
    overflow: visible;
    align-self: center;
    align-items: center;
    justify-content: center;
    min-width: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.contest-cover-fit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: min(64vh, 640px);
    max-height: calc(100vh - var(--header-height) - 70px);
    object-fit: contain;
    background: #fff;
}

.contest-detail-media-card .contest-cover-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: min(80vh, 800px);
    max-height: none;
    aspect-ratio: 3 / 4;
    border-radius: 2rem;
    background: transparent;
    box-shadow: 0 22px 60px rgba(0, 0, 0, .22);
    object-fit: cover;
}

.contest-cover-placeholder {
    flex-direction: column;
    gap: .35rem;
    color: rgba(255, 255, 255, .9);
    text-align: center;
    background:
        radial-gradient(circle at 28% 20%, rgba(255, 255, 255, .35), transparent 10rem),
        linear-gradient(135deg, #315d42, #9fc08b 48%, #e1ad4f);
}

.contest-cover-placeholder span {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 950;
    letter-spacing: -.05em;
}

.contest-cover-placeholder small {
    max-width: 300px;
    font-weight: 750;
}

.detail-facts-grid,
.team-status-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1.25rem;
}

.contest-detail-page .detail-facts-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-facts-grid article,
.team-status-grid article {
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 14px 34px rgba(31, 34, 28, .08);
}

.contest-timeline-card {
    display: grid;
    grid-column: span 2;
    grid-template-columns: minmax(70px, auto) minmax(0, 1fr);
    gap: 1.15rem;
    align-items: center;
}

.contest-timeline-duration {
    max-width: 92px;
    margin: 0 !important;
    color: var(--green-dark) !important;
    font-size: 1rem;
    line-height: 1.15 !important;
    text-align: center;
}

.contest-timeline {
    display: grid;
    gap: 1rem;
}

.contest-timeline-point {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: .65rem;
    align-items: start;
}

.contest-timeline-point:first-child::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 9px;
    right: auto;
    bottom: calc(-1rem - 9px);
    left: 10px;
    width: 3px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(61, 122, 72, .62);
}

.contest-timeline-marker {
    position: relative;
    z-index: 1;
    justify-self: center;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    margin-top: 0;
    border: 4px solid var(--green);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(61, 122, 72, .1);
}

.contest-timeline-point strong {
    font-size: 1rem;
}

@media (min-width: 992px) {
    .contest-detail-page .detail-facts-grid {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: clamp(.45rem, .8vw, .85rem);
    }

    .contest-detail-page .detail-facts-grid > article {
        container-type: inline-size;
        flex: 1 1 max-content;
        min-width: 0;
        min-height: 142px;
        padding: clamp(.7rem, 1vw, 1rem);
    }

    .contest-detail-page .detail-facts-grid > .contest-timeline-card {
        flex-grow: 1.35;
    }

    .contest-detail-page .detail-facts-grid span {
        font-size: .78rem;
    }

    .contest-detail-page .detail-facts-grid strong {
        overflow-wrap: anywhere;
        font-size: 1rem;
    }

    .contest-detail-page .contest-timeline-duration {
        font-size: 1rem;
    }
}

@container (max-width: 145px) {
    .contest-detail-page .detail-facts-grid span {
        font-size: .68rem;
    }

    .contest-detail-page .detail-facts-grid strong,
    .contest-detail-page .contest-timeline-duration {
        font-size: .86rem;
    }
}

.detail-facts-grid span,
.team-status-grid span,
.side-fact-list span,
.submission-info-grid span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.detail-facts-grid strong,
.team-status-grid strong,
.side-fact-list strong,
.submission-info-grid strong {
    display: block;
    margin-top: .25rem;
    color: var(--ink);
    line-height: 1.25;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 1.25rem;
    align-items: start;
}

.detail-side-column {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}

.side-fact-list,
.submission-info-grid {
    display: grid;
    gap: .65rem;
    margin: 1rem 0;
}

.side-fact-list div,
.submission-info-grid div {
    padding: .75rem .85rem;
    border-radius: 1rem;
    background: rgba(61, 122, 72, .08);
}

.archive-task-head h3,
.task-card-head h3 {
    margin: 0 0 .5rem;
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 950;
    letter-spacing: -.04em;
}

.archive-task-head p,
.task-card-head p {
    margin: 0;
    color: var(--muted);
}

.archive-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.archive-photo-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 12px 30px rgba(31, 34, 28, .08);
}

.archive-photo-card > div:not(.empty-state) {
    display: grid;
    gap: .2rem;
    padding: .85rem;
}

.archive-photo-card span {
    color: var(--muted);
    font-size: .9rem;
}

.modern-alert {
    border: 0;
    border-radius: var(--radius-lg);
}

/* Страница команды */
.team-page .team-hero {
    min-height: 204px;
}

.team-page .team-hero-main {
    min-width: 0;
}

.team-contest-cover {
    flex: 0 0 auto;
    width: clamp(96px, 11vw, 136px);
    height: clamp(96px, 11vw, 136px);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    box-shadow: 0 16px 32px rgba(27, 31, 24, .18);
    object-fit: cover;
}

.team-contest-cover-placeholder {
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 2rem;
    font-weight: 950;
}

.team-page .team-hero-actions {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
}

.team-page .team-hero-actions .btn {
    justify-content: center;
}

.team-tasks-main {
    width: 100%;
}

.team-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-layout {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
}

.task-card-modern {
    margin-bottom: 1rem;
    background: #fff;
}

.submission-panel {
    display: grid;
    gap: .9rem;
    margin-top: 1rem;
    padding: .95rem;
    border-radius: var(--radius-lg);
    background: rgba(61, 122, 72, .06);
}

.submission-panel .task-photo {
    justify-self: center;
    width: auto;
    max-width: 100%;
    max-height: 66vh;
    border-radius: var(--radius-lg) !important;
    background: transparent;
    object-fit: contain;
}

.submission-info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-note {
    margin: 0;
    padding: .85rem 1rem;
    border-radius: 1rem;
    font-weight: 850;
}

.success-note { color: #1f6b39; background: rgba(61, 122, 72, .12); }
.danger-note { color: #a63f2c; background: rgba(166, 63, 44, .1); }
.muted-note { color: var(--muted); background: rgba(46, 40, 34, .08); }

.member-stack {
    display: grid;
    gap: .65rem;
}

.members-side-card .member-card {
    width: 100%;
    box-shadow: none;
}

/* Мобильный рейтинг с полосками */
.rating-mobile {
    display: grid;
    gap: .85rem;
}

.rating-bar-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: .85rem;
    align-items: center;
    padding: .9rem;
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 14px 36px rgba(31, 34, 28, .09);
}

.rating-rank {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--sun), var(--green));
    font-size: 1.25rem;
    font-weight: 950;
}

.rating-team-row,
.rating-meta-row,
.rating-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
}

.rating-team-row a {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 950;
    line-height: 1.1;
    text-decoration: none;
}

.rating-team-row strong {
    flex: 0 0 auto;
    color: var(--green-dark);
    font-size: 1.15rem;
}

.rating-bar-track {
    overflow: hidden;
    height: 16px;
    margin: .55rem 0 .45rem;
    border-radius: 999px;
    background: rgba(46, 40, 34, .1);
}

.rating-bar-fill {
    width: clamp(8%, calc(var(--rating-score) * 1%), 100%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--sun), #d64632, var(--green));
    box-shadow: 0 6px 16px rgba(214, 70, 50, .22);
    animation: rating-grow .75s ease both;
    transform-origin: left center;
}

@keyframes rating-grow {
    from { transform: scaleX(.2); opacity: .5; }
    to { transform: scaleX(1); opacity: 1; }
}

.rating-meta-row span {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 750;
}

.rating-details {
    margin-top: .7rem;
}

.rating-details summary {
    cursor: pointer;
    color: var(--green-dark);
    font-weight: 900;
}

.rating-task-list {
    display: grid;
    gap: .55rem;
    margin-top: .7rem;
}

.rating-task-item {
    align-items: flex-start;
    padding: .7rem;
    border-radius: 1rem;
    background: rgba(61, 122, 72, .07);
}

.rating-task-item strong,
.rating-task-item small {
    display: block;
}

.rating-task-item > span {
    flex: 0 0 auto;
    font-weight: 950;
}

/* Красивые файлы и галочки */
.file-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    min-height: 52px;
    padding: .75rem 1.15rem;
    border-radius: 999px;
    color: #fff;
    background: var(--sun);
    box-shadow: 0 14px 30px rgba(233, 173, 12, .26);
    cursor: pointer;
    font-weight: 900;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.file-picker-btn:hover {
    transform: translateY(-2px);
    background: var(--sun-dark);
    box-shadow: 0 18px 36px rgba(233, 173, 12, .34);
}

.file-picker-icon {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    font-size: 1.1rem;
}

input[type="file"] {
    padding: .55rem;
    border: 1px solid rgba(36, 86, 55, .18);
    border-radius: 1rem;
    background: #fff;
}

input[type="file"]::file-selector-button {
    margin-right: .8rem;
    padding: .65rem .95rem;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--sun);
    font-weight: 900;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 1.1rem !important;
    height: 1.1rem !important;
    min-height: auto !important;
    margin-right: .45rem;
    accent-color: var(--green);
    cursor: pointer;
}

.form-card p:has(input[type="checkbox"]),
.modern-form-card p:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.modern-form-card label {
    color: var(--brown-dark);
    font-weight: 850;
}

.modern-form-card .helptext {
    display: block;
    margin-top: .35rem;
    color: var(--muted);
    font-size: .86rem;
}

.auth-page {
    max-width: 920px;
    margin: 0 auto;
}

.auth-link-row a {
    color: var(--green-dark);
    font-weight: 850;
}

@media (max-width: 1199.98px) {
    .main-nav a {
        padding-right: .62rem;
        padding-left: .62rem;
        font-size: .78rem;
    }
}

@media (max-width: 991.98px) {
    :root { --header-height: 80px; }

    .home-hero {
        margin-top: calc(var(--header-height) * -1);
        min-height: 100svh;
        padding-top: var(--header-height);
    }

    .site-header::before {
        bottom: -26px;
    }

    .dashboard-stats-grid,
    .detail-facts-grid,
    .archive-photo-grid,
    .submission-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contest-detail-hero,
    .detail-layout,
    .team-layout {
        grid-template-columns: 1fr;
    }

    .detail-side-column {
        position: static;
    }

    .contest-cover-fit {
        height: min(52vh, 520px);
    }

    .contest-detail-media-card .contest-cover-image {
        width: auto;
        height: min(64vh, 620px);
        max-height: none;
    }

    .contest-detail-page .detail-facts-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contest-detail-actions {
        margin-top: 0;
        padding-top: 2.5rem;
    }

    .invite-grid,
    .cabinet-team-grid {
        grid-template-columns: 1fr;
    }

    .cabinet-hero,
    .team-hero,
    .modern-page-head,
    .dashboard-hero,
    .admin-contest-top,
    .payment-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .receipt-delivery-form {
        align-items: stretch;
        flex-direction: column;
    }

    .receipt-delivery-form .form-control {
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    .site-header {
        padding: .55rem 0;
    }

    .content-page::before,
    .content-page::after {
        width: 180px;
        height: 180px;
    }

    .dashboard-stats-grid,
    .detail-facts-grid,
    .team-status-grid,
    .archive-photo-grid,
    .submission-info-grid {
        grid-template-columns: 1fr;
    }

    .cabinet-user-card,
    .team-hero-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .contest-detail-hero,
    .team-hero,
    .cabinet-hero,
    .modern-page-head {
        border-radius: 1.55rem;
    }

    .contest-cover-fit {
        height: min(46vh, 420px);
    }

    .contest-detail-media-card .contest-cover-image {
        height: min(58vh, 520px);
        max-height: none;
        border-radius: 1.55rem;
    }

    .contest-detail-page .detail-facts-grid {
        grid-template-columns: 1fr;
    }

    .contest-timeline-card {
        grid-column: auto;
    }

    .rating-bar-card {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: .7rem;
        padding: .75rem;
    }

    .rating-rank {
        width: 40px;
        height: 40px;
        font-size: 1.05rem;
    }

    .rating-team-row {
        align-items: flex-start;
    }

    .rating-meta-row {
        align-items: flex-start;
        flex-direction: column;
        gap: .18rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .animated-bg-dot,
    .content-page::before,
    .content-page::after,
    .rating-bar-fill {
        animation: none !important;
    }
}

/* Алиасы для кабинета организатора из текущего шаблона */
.organizer-contest-list {
    display: grid;
    gap: 1rem;
}

.organizer-contest-card {
    padding: 1.1rem;
    border: 1px solid rgba(46, 40, 34, .1);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 14px 36px rgba(31, 34, 28, .08);
}

.organizer-contest-head,
.organizer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.organizer-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.organizer-contest-head h3 {
    margin: 0;
    font-weight: 950;
    letter-spacing: -.04em;
}

.organizer-contest-head p {
    margin: .2rem 0 0;
    color: var(--muted);
    font-weight: 650;
}

.contest-admin-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .65rem;
    margin: 1rem 0;
}

.contest-admin-metrics div {
    padding: .8rem;
    border-radius: 1rem;
    background: rgba(61, 122, 72, .08);
}

.contest-admin-metrics span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.contest-admin-metrics strong {
    display: block;
    margin-top: .25rem;
    font-size: 1.25rem;
    font-weight: 950;
}

@media (max-width: 991.98px) {
    .organizer-contest-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .organizer-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .contest-admin-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .site-header::before {
        bottom: -26px;
    }
}

/* ===== Точечное исправление личного кабинета и профиля =====
   Все селекторы ниже специально привязаны к .cabinet-page-v2 и .profile-page-v2,
   поэтому они не меняют карточки, формы и блоки на остальных страницах фотоквеста. */
.cabinet-page-v2,
.profile-page-v2 {
    position: relative;
    isolation: isolate;
}

.cabinet-page-v2 {
    display: grid;
    gap: clamp(1rem, 2.4vw, 1.35rem);
}

.cabinet-page-v2 .cabinet-hero-v2 {
    position: relative;
    min-height: clamp(270px, 32vw, 390px);
    padding: clamp(1.35rem, 4.5vw, 3.2rem);
    border-radius: clamp(1.65rem, 4vw, 2.7rem);
    color: #fff;
    background:
        radial-gradient(circle at 88% 8%, rgba(233, 173, 12, .36), transparent 13rem),
        radial-gradient(circle at 8% 78%, rgba(255, 255, 255, .13), transparent 12rem),
        linear-gradient(135deg, #3d7a48 0%, #596b47 48%, #705d4d 100%);
    box-shadow: var(--shadow);
}

.cabinet-page-v2 .cabinet-hero-v2 .animated-bg-dot,
.profile-page-v2 .profile-intro-card-v2 .animated-bg-dot {
    z-index: 0;
    opacity: .16;
}

.cabinet-page-v2 .cabinet-user-card-v2 {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.6vw, 1.6rem);
    width: 100%;
}

.cabinet-page-v2 .cabinet-user-card-v2 .avatar-xl,
.cabinet-page-v2 .cabinet-user-card-v2 .cabinet-avatar-placeholder {
    flex: 0 0 auto;
    width: var(--avatar-size-cabinet-hero) !important;
    height: var(--avatar-size-cabinet-hero) !important;
    border: 8px solid var(--sun);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .22);
}

.cabinet-page-v2 .cabinet-user-card-v2 .eyebrow,
.profile-page-v2 .profile-intro-content .eyebrow {
    color: var(--sun);
}

.cabinet-page-v2 .cabinet-user-card-v2 h1 {
    max-width: 1000px;
    margin: 0;
    font-size: clamp(2.15rem, 6.4vw, 5.55rem);
    font-weight: 950;
    line-height: .9;
    letter-spacing: -.075em;
    text-transform: uppercase;
}

.cabinet-page-v2 .cabinet-user-card-v2 p:not(.eyebrow) {
    max-width: 780px;
    margin: .7rem 0 0;
    color: rgba(255, 255, 255, .85);
    font-weight: 750;
}

.cabinet-page-v2 .quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr));
    gap: 1rem;
}

.cabinet-page-v2 .quick-access-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    min-height: 190px;
    padding: clamp(1.15rem, 3vw, 1.6rem);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius-xl);
    color: #fff;
    background:
        radial-gradient(circle at 12% 20%, rgba(233, 173, 12, .18), transparent 10rem),
        linear-gradient(135deg, var(--green), var(--brown));
    box-shadow: var(--shadow);
    transition: transform .24s ease, box-shadow .24s ease;
}

.cabinet-page-v2 .quick-access-card::after {
    content: "";
    position: absolute;
    right: -4rem;
    bottom: -5rem;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    transition: transform .3s ease;
}

.cabinet-page-v2 .quick-access-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 58px rgba(31, 34, 28, .16);
}

.cabinet-page-v2 .quick-access-card:hover::after {
    transform: scale(1.18);
}

.cabinet-page-v2 .quick-profile-card {
    background:
        radial-gradient(circle at 84% 18%, rgba(233, 173, 12, .22), transparent 10rem),
        linear-gradient(135deg, var(--green), #62714d);
}

.cabinet-page-v2 .quick-judge-card {
    background:
        radial-gradient(circle at 12% 18%, rgba(233, 173, 12, .2), transparent 10rem),
        linear-gradient(135deg, #3b3028, #1f2b23);
}

.cabinet-page-v2 .quick-access-icon {
    position: absolute;
    left: 1.15rem;
    top: 1.15rem;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--brown-dark);
    background: var(--sun);
    font-weight: 950;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .18);
}

.cabinet-page-v2 .quick-access-card h2 {
    margin: 0 0 .38rem;
    font-size: clamp(1.28rem, 2.2vw, 1.7rem);
    font-weight: 950;
    letter-spacing: -.04em;
}

.cabinet-page-v2 .quick-access-card p {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-weight: 650;
    line-height: 1.38;
}

.cabinet-page-v2 .quick-access-card > div {
    position: relative;
    z-index: 1;
    padding-top: 3.25rem;
}

.cabinet-page-v2 .quick-access-card > .btn {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
}

.cabinet-page-v2 .dashboard-section {
    border-radius: var(--radius-xl);
}

.profile-page-v2 .profile-layout-v2 {
    display: grid;
    grid-template-columns: minmax(300px, .95fr) minmax(340px, 1fr);
    gap: clamp(1rem, 3vw, 1.4rem);
    align-items: center;
    min-height: clamp(560px, calc(100svh - var(--header-height) - 6rem), 760px);
}

.profile-page-v2 .profile-intro-card-v2 {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: min(56vh, 520px);
    padding: clamp(1.6rem, 4.4vw, 3rem);
    border-radius: var(--radius-xl);
    color: #fff;
    background:
        radial-gradient(circle at 8% 82%, rgba(233, 173, 12, .22), transparent 12rem),
        radial-gradient(circle at 88% 14%, rgba(255, 255, 255, .12), transparent 10rem),
        linear-gradient(135deg, var(--green), #64714d 54%, var(--brown));
    box-shadow: var(--shadow);
}

.profile-page-v2 .profile-intro-card-v2::after {
    content: "";
    position: absolute;
    right: -4.5rem;
    top: -4.5rem;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: rgba(233, 173, 12, .22);
}

.profile-page-v2 .profile-intro-content {
    position: relative;
    z-index: 1;
}

.profile-page-v2 .profile-intro-content h1 {
    margin: 0 0 1rem;
    font-size: clamp(3rem, 8vw, 6.4rem);
    font-weight: 950;
    line-height: .9;
    letter-spacing: -.075em;
    text-transform: uppercase;
}

.profile-page-v2 .profile-intro-content p:not(.eyebrow) {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, .85);
    font-size: clamp(1rem, 1.6vw, 1.18rem);
    line-height: 1.55;
}

.profile-page-v2 .profile-form-card-v2 {
    position: relative;
    overflow: hidden;
    padding: clamp(1.2rem, 3vw, 2rem);
    border: 1px solid rgba(46, 40, 34, .08);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.profile-page-v2 .profile-form-card-v2::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 96% 0%, rgba(233, 173, 12, .09), transparent 12rem);
}

.profile-page-v2 .profile-form-card-v2 > * {
    position: relative;
    z-index: 1;
}

.profile-page-v2 .avatar-edit-card-v2 {
    display: grid;
    grid-template-columns: var(--avatar-size-preview) minmax(0, 1fr);
    gap: 1.15rem;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 0 0, rgba(233, 173, 12, .12), transparent 11rem),
        rgba(61, 122, 72, .06);
}

.profile-page-v2 .avatar-preview-wrap-v2 {
    position: relative;
    width: var(--avatar-size-preview);
    height: var(--avatar-size-preview);
}

.profile-page-v2 .avatar-preview-img,
.profile-page-v2 .avatar-preview-placeholder {
    display: grid;
    place-items: center;
    width: var(--avatar-size-preview);
    height: var(--avatar-size-preview);
    border: 8px solid var(--sun);
    border-radius: 50%;
    color: #fff;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .24), transparent 4rem),
        linear-gradient(135deg, var(--green), var(--brown));
    box-shadow: 0 18px 36px rgba(31, 34, 28, .18);
    font-size: 2.35rem;
    font-weight: 950;
    object-fit: cover;
}

.profile-page-v2 .avatar-preview-badge {
    position: absolute;
    right: -4px;
    bottom: 10px;
    padding: .38rem .58rem;
    border: 3px solid #fff;
    border-radius: 999px;
    color: var(--brown-dark);
    background: var(--sun);
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.profile-page-v2 .avatar-edit-title {
    margin: 0 0 .25rem;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 950;
    letter-spacing: -.02em;
}

.profile-page-v2 .avatar-edit-text {
    margin: 0 0 .85rem;
    color: var(--muted);
    line-height: 1.45;
}

.profile-page-v2 .avatar-action-row-v2 {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
}

.profile-page-v2 .avatar-file-btn,
.profile-page-v2 .avatar-clear-soft-btn,
.profile-page-v2 .profile-save-btn {
    min-height: 48px;
    padding: .7rem 1.1rem;
}

.profile-page-v2 .avatar-clear-soft-btn {
    border: 1.5px solid rgba(112, 93, 77, .18);
    color: var(--brown-dark);
    background: #fff;
    box-shadow: none;
}

.profile-page-v2 .avatar-clear-soft-btn:hover,
.profile-page-v2 .avatar-clear-soft-btn.is-active {
    border-color: rgba(166, 63, 44, .28);
    color: #fff;
    background: #a64b3a;
}

.profile-page-v2 .avatar-selected-name,
.profile-page-v2 .form-help-text {
    margin-top: .65rem;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.4;
}

.profile-page-v2 .field-errors {
    margin-top: .55rem;
    padding: .55rem .7rem;
    border-radius: .85rem;
    color: #a63f2c;
    background: rgba(166, 63, 44, .09);
    font-size: .9rem;
    font-weight: 750;
}

.profile-page-v2 .field-errors ul,
.profile-page-v2 .field-errors li {
    margin-bottom: 0;
}

.profile-page-v2 .profile-fields-grid-v2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}

.profile-page-v2 .modern-field {
    display: grid;
    gap: .38rem;
}

.profile-page-v2 .modern-label {
    color: var(--brown-dark);
    font-weight: 900;
}

.profile-page-v2 .modern-label span {
    color: #a64b3a;
}

.profile-page-v2 .profile-form-card-v2 input:not([type="checkbox"]):not([type="file"]),
.profile-page-v2 .profile-form-card-v2 textarea,
.profile-page-v2 .profile-form-card-v2 select {
    width: 100%;
    min-height: 50px;
    padding: .7rem .85rem;
    border: 1.5px solid rgba(36, 86, 55, .18);
    border-radius: 1rem;
    color: var(--ink);
    background: rgba(255, 255, 255, .88);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.profile-page-v2 .profile-form-card-v2 textarea {
    min-height: 120px;
    resize: vertical;
}

.profile-page-v2 .profile-form-card-v2 input:not([type="checkbox"]):not([type="file"]):focus,
.profile-page-v2 .profile-form-card-v2 textarea:focus,
.profile-page-v2 .profile-form-card-v2 select:focus {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 .22rem rgba(61, 122, 72, .14);
}

.profile-page-v2 .modern-checkbox-line {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .75rem .85rem;
    border-radius: 1rem;
    background: rgba(61, 122, 72, .07);
    cursor: pointer;
    font-weight: 850;
}

.profile-page-v2 .profile-save-btn {
    width: 100%;
    margin-top: 1.1rem;
}

@media (max-width: 991.98px) {
    .profile-page-v2 .profile-layout-v2 {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .profile-page-v2 .profile-intro-card-v2 {
        min-height: 320px;
    }

    .cabinet-page-v2 .cabinet-hero-v2 {
        min-height: 250px;
    }

    .cabinet-page-v2 .quick-access-card {
        min-height: 175px;
    }
}

@media (max-width: 767.98px) {
    .profile-page-v2 .profile-fields-grid-v2 {
        grid-template-columns: 1fr;
    }

    .cabinet-page-v2 .quick-access-card {
        align-items: stretch;
        flex-direction: column;
        min-height: 170px;
    }

    .cabinet-page-v2 .quick-access-card > .btn {
        width: 100%;
    }

    .profile-page-v2 .avatar-edit-card-v2 {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .profile-page-v2 .avatar-action-row-v2 {
        justify-content: center;
    }

    .profile-page-v2 .profile-intro-card-v2,
    .profile-page-v2 .profile-form-card-v2,
    .cabinet-page-v2 .cabinet-hero-v2,
    .cabinet-page-v2 .quick-access-card {
        border-radius: 1.55rem;
    }

    .cabinet-page-v2 .cabinet-user-card-v2 {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .profile-page-v2 .avatar-action-row-v2 .btn {
        width: 100%;
    }

    .profile-page-v2 .avatar-edit-card-v2 {
        padding: .9rem;
    }
}


/* ===== Компонентный слой: общие UI-компоненты и совместимые алиасы =====
   Старые page-specific классы сохранены как алиасы, чтобы не менять внешний вид готовых страниц. */
.ui-page {
    position: relative;
    isolation: isolate;
}

.ui-hero,
.ui-hero--wide,
.ui-hero-panel {
    position: relative;
    overflow: hidden;
}

.ui-hero h1,
.ui-hero-panel h1,
.hero-copy h1,
.section-heading h2,
.rules-intro h2,
.final-cta h2,
.cabinet-page-v2 .cabinet-user-card-v2 h1,
.profile-page-v2 .profile-intro-content h1,
.modern-page-head h1,
.dashboard-hero h1,
.contest-detail-hero h1,
.team-hero h1 {
    font-weight: 900;
    letter-spacing: -.045em;
}

.ui-panel,
.ui-card,
.ui-row-card,
.ui-form-panel {
    border: 1px solid rgba(46, 40, 34, .1);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 16px 44px rgba(31, 34, 28, .09);
    backdrop-filter: blur(14px);
}

.ui-card,
.ui-row-card {
    padding: clamp(1rem, 2.5vw, 1.25rem);
}

.ui-stack {
    display: grid;
    gap: .85rem;
}

.ui-card-grid {
    display: grid;
    gap: 1rem;
}

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

.ui-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
}

.ui-row-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ui-row-card strong,
.ui-row-card span {
    display: block;
}

.ui-row-card strong {
    font-weight: 900;
    letter-spacing: -.02em;
}

.ui-row-card span {
    margin-top: .2rem;
    color: var(--muted);
    font-weight: 650;
}

.ui-section-head,
.ui-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ui-group-head h3,
.ui-section-head h2 {
    margin: 0;
}

.ui-empty {
    border-style: dashed;
}

.ui-form--wide,
.organizer-form-page .form-card {
    max-width: none;
}

.ui-form p {
    margin-bottom: .85rem;
}

.ui-form label:not(.file-picker-btn):not(.modern-checkbox-line) {
    display: block;
    margin-bottom: .28rem;
    color: var(--brown-dark);
    font-weight: 850;
}

.ui-form input:not([type="checkbox"]):not([type="file"]),
.ui-form textarea,
.ui-form select {
    width: 100%;
    min-height: 48px;
    padding: .7rem .85rem;
    border: 1.5px solid rgba(36, 86, 55, .18);
    border-radius: 1rem;
    color: var(--ink);
    background: rgba(255, 255, 255, .88);
    outline: none;
}

.ui-form textarea {
    min-height: 120px;
    resize: vertical;
}

.ui-form input:not([type="checkbox"]):not([type="file"]):focus,
.ui-form textarea:focus,
.ui-form select:focus {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 .22rem rgba(61, 122, 72, .14);
}

.ui-tabs,
.judge-contest-tabs {
    display: grid;
    grid-auto-columns: minmax(240px, 1fr);
    grid-auto-flow: column;
    gap: .85rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    scroll-snap-type: x mandatory;
}

.ui-tab,
.judge-contest-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    min-height: 74px;
    padding: .9rem 1rem;
    border: 1px solid rgba(46, 40, 34, .12);
    border-radius: 1.3rem;
    color: var(--ink);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 12px 30px rgba(31, 34, 28, .07);
    text-decoration: none;
    scroll-snap-align: start;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}

.ui-tab:hover,
.ui-tab.is-active,
.judge-contest-tab:hover,
.judge-contest-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--brown));
    transform: translateY(-2px);
}

.ui-tab span,
.judge-contest-tab span {
    font-weight: 900;
    line-height: 1.1;
}

.ui-tab strong,
.judge-contest-tab strong {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--brown-dark);
    background: var(--sun);
    font-weight: 900;
}

.ui-work-card,
.judge-work-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    gap: 1rem;
    align-items: start;
}

.ui-photo-frame,
.judge-work-photo-wrap {
    display: grid;
    place-items: center;
    overflow: hidden;
    min-height: 360px;
    border-radius: var(--radius-lg);
    background: rgba(46, 40, 34, .07);
}

.judge-work-photo-wrap .judge-photo,
.ui-photo-frame img {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    background: #fff;
}

.judge-work-panel h3,
.quest-review-card h3 {
    margin: 0;
    font-weight: 900;
    letter-spacing: -.03em;
}

.judge-score-form,
.judge-freeze-form {
    display: grid;
    gap: .75rem;
}

.judge-score-grid p,
.judge-freeze-form p {
    margin: 0 0 .65rem;
}

.submission-delete-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem;
    align-items: end;
}

.submission-delete-field {
    min-width: 0;
}

.submission-delete-form textarea {
    min-height: 64px;
    height: 64px;
}

textarea[data-auto-resize] {
    resize: none;
    overflow-y: hidden;
}

.submission-delete-button {
    display: inline-grid;
    place-items: center;
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.15rem;
}

.quest-review-card {
    display: grid;
    gap: 1rem;
}

.quest-review-media {
    min-height: 260px;
}

.quest-review-body {
    display: grid;
    gap: .75rem;
}

.task-list .task-row .badge {
    display: inline-flex;
    width: fit-content;
    margin-top: .35rem;
}

/* Главная: реальные видео и галерея из кабинета организатора */
.hero-video-real {
    background: #151915;
}

.hero-background-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.04);
}

.real-polaroid-photo {
    display: block;
    background: #fff;
}

.real-polaroid-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-media-admin .admin-section-note,
.judge-page .admin-section-note,
.quest-page .admin-section-note {
    margin: .35rem 0 0;
    color: var(--muted);
    font-weight: 650;
}

.home-media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.home-gallery-admin-section {
    display: contents;
}

.home-gallery-admin-section .home-gallery-admin-list {
    grid-column: 1 / -1;
}

.home-media-card {
    display: grid;
    align-content: start;
    align-self: start;
    gap: .85rem;
    padding: 1.1rem;
    border: 1px solid rgba(46, 40, 34, .1);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 14px 34px rgba(31, 34, 28, .08);
}

.home-media-card h3 {
    margin: 0;
    font-weight: 900;
    letter-spacing: -.03em;
}

.home-media-card p:not(.eyebrow) {
    margin: .25rem 0 0;
    color: var(--muted);
    font-weight: 650;
}

.home-video-preview,
.home-video-empty-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, var(--green), var(--brown));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}

.home-video-preview {
    object-fit: cover;
}

.home-video-empty-preview {
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .84);
    font-weight: 900;
}

.home-clear-video-line {
    align-items: center;
    margin: 0;
    padding: .75rem .85rem;
    border-radius: 1rem;
    background: rgba(46, 40, 34, .06);
}

.home-gallery-admin-list {
    display: grid;
    gap: .7rem;
}

.home-gallery-admin-item {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) auto;
    align-items: center;
    gap: .8rem;
    padding: .7rem;
    border: 1px solid rgba(46, 40, 34, .08);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, .82);
}

.home-gallery-admin-item img {
    width: 82px;
    height: 70px;
    object-fit: cover;
    border-radius: .9rem;
}

.home-gallery-admin-item strong,
.home-gallery-admin-item span {
    display: block;
}

.home-gallery-admin-item span {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 700;
}

.team-link-disabled {
    display: inline-flex;
    color: var(--muted);
    font-weight: 900;
    cursor: help;
}

/* Регистрация: обязательные и необязательные поля */
.register-page .field-requirement-note {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: .35rem;
    padding: .28rem .55rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 850;
}

.register-page .field-requirement-note.is-required {
    color: #fff;
    background: var(--green);
}

.register-page .field-requirement-note.is-optional {
    color: var(--brown-dark);
    background: rgba(46, 40, 34, .08);
}

.register-page .modern-label span,
.register-page .modern-checkbox-line em {
    color: #d64632;
    font-style: normal;
    font-weight: 900;
}

.register-file-btn {
    width: fit-content;
}

/* Личный кабинет: карточка сама является кнопкой */
.cabinet-page-v2 .quick-access-card,
.cabinet-page-v2 .quick-access-card:hover {
    color: #fff;
    text-decoration: none;
}

.cabinet-page-v2 .quick-access-card .ui-card-cta {
    display: inline-flex;
    width: fit-content;
    margin-top: 1rem;
    padding: .58rem .9rem;
    border-radius: 999px;
    color: var(--brown-dark);
    background: var(--sun);
    font-size: .9rem;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(233, 173, 12, .22);
}

.cabinet-page-v2 .quick-access-card:focus-visible {
    outline: 3px solid var(--sun);
    outline-offset: 4px;
}

@media (max-width: 991.98px) {
    .ui-card-grid--2,
    .home-media-grid,
    .ui-work-card,
    .judge-work-card {
        grid-template-columns: 1fr;
    }

    .home-gallery-admin-item {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .home-gallery-admin-item form {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    .ui-row-card,
    .ui-section-head,
    .ui-group-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .ui-actions .btn,
    .ui-actions form {
        width: 100%;
    }

    .ui-actions form .btn {
        width: 100%;
    }

    .quest-review-media,
    .ui-photo-frame,
    .judge-work-photo-wrap {
        min-height: 220px;
    }
}

@media (max-width: 576px) {
    .ui-tabs,
    .judge-contest-tabs {
        grid-auto-columns: minmax(260px, 82vw);
    }

    .home-gallery-admin-item {
        grid-template-columns: 1fr;
    }

    .home-gallery-admin-item img {
        width: 100%;
        height: 180px;
    }
}


/* ===== Финальные правки профиля, навигации, расписания и типографики ===== */
.main-nav {
    display: flex;
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
}

.main-nav a {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

.hero-copy h1,
.section-heading h2,
.rules-intro h2,
.final-cta h2,
.ui-hero h1,
.ui-hero-panel h1,
.cabinet-page-v2 .cabinet-user-card-v2 h1,
.profile-page-v2 .profile-intro-content h1,
.modern-page-head h1,
.dashboard-hero h1,
.contest-detail-hero h1,
.team-hero h1 {
    font-weight: 880;
    letter-spacing: -.012em;
}

.brand-mark {
    letter-spacing: -.035em;
}

.contest-card-link .contest-media,
.contest-card-img {
    height: auto;
    aspect-ratio: 3 / 4;
}

.compact-tile .contest-card-link .contest-media {
    height: auto;
    aspect-ratio: 4 / 5;
}

.register-page .field-requirement-note {
    display: none !important;
}

.register-page .modern-label span,
.register-page .modern-checkbox-line em,
.profile-page-v2 .modern-label span {
    color: #d64632;
    font-style: normal;
    font-weight: 950;
}

.email-pending-note {
    margin-top: .55rem;
    padding: .72rem .85rem;
    border-radius: 1rem;
    color: var(--brown-dark);
    background: rgba(233, 173, 12, .16);
    font-size: .9rem;
    font-weight: 750;
    line-height: 1.4;
}

@media (max-width: 1199.98px) {
    .main-nav a {
        padding-right: .42rem;
        padding-left: .42rem;
        font-size: .74rem;
    }
}

@media (max-width: 991.98px) {
    .contest-card-link .contest-media {
        aspect-ratio: 3 / 4;
    }
}

/* ===== Правка карточек фотоквестов и афиши =====
   Единый стиль карточек активных, предстоящих и архивных фотоквестов.
   Фото всегда 3:4, карточка приближается целиком, углы не сбрасываются. */
.contest-card-link,
.contest-card-link:hover,
.compact-tile .contest-card-link,
.compact-tile .contest-card-link:hover {
    overflow: hidden;
    border-radius: var(--radius-xl) !important;
    color: inherit;
    text-decoration: none;
    transform-origin: center;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    will-change: transform, box-shadow;
}

.contest-card-link {
    transform: translateZ(0) scale(1);
    transition: transform .22s ease, box-shadow .22s ease;
}

.contest-card-link:hover {
    transform: translateZ(0) scale(1.025) !important;
    box-shadow: 0 26px 62px rgba(33, 28, 23, .18);
}

.contest-card-link .contest-media,
.contest-card-link:hover .contest-media,
.compact-tile .contest-media,
.compact-tile .contest-card-link .contest-media,
.compact-tile .contest-card-link:hover .contest-media {
    overflow: hidden;
    height: auto !important;
    aspect-ratio: 3 / 4 !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: var(--green-soft);
}

.contest-media img,
.contest-placeholder,
.contest-card-link:hover .contest-media img,
.contest-card-link:hover .contest-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none !important;
}

.contest-placeholder,
.contest-placeholder.alt,
.contest-placeholder.archive {
    background:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, .52), transparent 7rem),
        linear-gradient(135deg, #315d42, #9fc08b 46%, #e1ad4f);
}

.contest-content {
    transform: translateZ(0);
}

@media (max-width: 991.98px) {
    .contest-scroll {
        grid-auto-columns: minmax(250px, 72vw);
    }

    .contest-card-link .contest-media,
    .compact-tile .contest-media {
        aspect-ratio: 3 / 4 !important;
    }
}

@media (max-width: 576px) {
    .contest-scroll {
        grid-auto-columns: minmax(230px, 78vw);
    }
}

/* Страница фотоквеста: убираем белые поля вокруг афиши */
.contest-detail-media-card {
    background: transparent;
    box-shadow: none;
}

.contest-detail-media-card .contest-cover-fit {
    background: transparent;
}


/* ===== Фикс регистрации и профиля: левый блок сверху, ровные пароли, чекбоксы =====
   Патч находится в конце файла и переопределяет только регистрацию/профиль. */
.profile-page-v2 .profile-layout-v2 {
    align-items: flex-start;
}

.profile-page-v2 .profile-intro-card-v2 {
    align-self: flex-start;
    align-items: flex-start;
    justify-content: flex-start;
}

.register-page .profile-intro-card-v2,
.profile-page .profile-intro-card-v2 {
    margin-top: 0;
}

.register-page .register-password-section input[type="password"],
.register-page .register-password-section #id_password1,
.register-page .register-password-section #id_password2 {
    display: block;
    width: 100%;
    min-height: 50px !important;
    height: 50px !important;
    max-height: 50px !important;
    padding: .7rem .85rem;
    border-radius: 1rem;
    line-height: 1.2;
    resize: none;
}

.register-page .register-password-section textarea#id_password1,
.register-page .register-password-section textarea#id_password2 {
    overflow: hidden;
}

.register-page .register-legal-card {
    display: flex !important;
    align-items: flex-start;
    gap: .75rem;
    grid-template-columns: none !important;
}

.register-page .register-legal-card input[type="checkbox"] {
    flex: 0 0 18px;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    margin: .22rem 0 0 0 !important;
}

.register-page .register-legal-card label {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: var(--brown-dark);
    font-weight: 750;
    line-height: 1.45;
}

.register-page .register-legal-card label a {
    overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
    .profile-page-v2 .profile-intro-card-v2 {
        min-height: 280px;
    }
}

@media (max-width: 576px) {
    .register-page .register-legal-card {
        gap: .62rem;
    }
}

/* ===== Фикс страниц юридических документов =====
   Делает одинаковый тёплый фон между hero и документом,
   добавляет внутренние отступы тексту и не влияет на остальные страницы. */
.legal-page {
    display: grid;
    gap: clamp(1rem, 2.4vw, 1.4rem);
    padding-bottom: clamp(2rem, 5vw, 4rem);
    background: transparent;
}

.legal-page::before,
.legal-page::after {
    z-index: -1;
}

.legal-page .modern-page-head,
.legal-page .ui-hero {
    margin-bottom: 0;
}

.legal-page .legal-document,
.legal-page .legal-document.ui-panel {
    overflow: hidden;
    padding: clamp(1.25rem, 3.5vw, 2.25rem);
    border: 1px solid rgba(46, 40, 34, .09);
    border-radius: clamp(1.35rem, 3vw, 2rem);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 18px 48px rgba(31, 34, 28, .09);
    backdrop-filter: blur(12px);
}

.legal-document h1,
.legal-document h2,
.legal-document h3 {
    color: var(--ink);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -.012em;
}

.legal-document h1 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.legal-document h2 {
    margin: 1.7rem 0 .75rem;
    font-size: clamp(1.35rem, 2.6vw, 2rem);
}

.legal-document h3 {
    margin: 1.25rem 0 .6rem;
    font-size: clamp(1.12rem, 2vw, 1.4rem);
}

.legal-document p,
.legal-document li {
    color: #30322f;
    font-size: clamp(.98rem, 1.2vw, 1.06rem);
    line-height: 1.68;
}

.legal-document p {
    margin: 0 0 .95rem;
}

.legal-document ul,
.legal-document ol {
    margin: .65rem 0 1.1rem;
    padding-left: 1.35rem;
}

.legal-document li + li {
    margin-top: .35rem;
}

.legal-document strong {
    color: var(--ink);
    font-weight: 850;
}

.legal-document a {
    color: var(--green-dark);
    font-weight: 850;
    text-decoration-thickness: .08em;
    text-underline-offset: .18em;
}

.legal-document a:hover {
    color: var(--sun-dark);
}

.legal-document .legal-table-wrap {
    width: 100%;
    margin: 1rem 0 1.35rem;
    overflow-x: auto;
    border: 1px solid rgba(46, 40, 34, .18);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(31, 34, 28, .06);
    -webkit-overflow-scrolling: touch;
}

.legal-document table {
    width: 100%;
    min-width: 720px;
    margin: 0;
    border-collapse: collapse;
    table-layout: fixed;
    color: #30322f;
}

.legal-document th,
.legal-document td {
    padding: .9rem 1rem;
    border-right: 1px solid rgba(46, 40, 34, .12);
    border-bottom: 1px solid rgba(46, 40, 34, .12);
    vertical-align: top;
    font-size: clamp(.94rem, 1.1vw, 1.02rem);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.legal-document th {
    color: var(--ink);
    background: rgba(240, 177, 0, .16);
    font-weight: 850;
    text-align: left;
}

.legal-document th:first-child,
.legal-document td:first-child {
    width: 28%;
    font-weight: 750;
}

.legal-document th:last-child,
.legal-document td:last-child {
    border-right: 0;
}

.legal-document tbody tr:last-child td {
    border-bottom: 0;
}

.legal-document tbody tr:nth-child(even) td {
    background: rgba(247, 244, 236, .58);
}

.legal-document .legal-table-wrap:focus-visible {
    outline: 3px solid rgba(240, 177, 0, .38);
    outline-offset: 3px;
}

@media (max-width: 767.98px) {
    .legal-page {
        gap: 1rem;
    }

    .legal-page .legal-document,
    .legal-page .legal-document.ui-panel {
        padding: 1rem;
        border-radius: 1.25rem;
    }

    .legal-document table {
        min-width: 640px;
    }

    .legal-document th,
    .legal-document td {
        padding: .75rem .8rem;
    }
}


/* Регистрация: поля не растягиваются по высоте соседней колонки */
.register-page .profile-fields-grid-v2,
.register-page .ui-form-grid {
    align-items: start !important;
}

.register-page .modern-field,
.register-page .ui-field {
    align-self: start !important;
    align-content: start !important;
    justify-content: start !important;
}

.register-page .profile-form-card-v2 input:not([type="checkbox"]):not([type="file"]),
.register-page .profile-form-card-v2 select {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    line-height: 1.2;
}

.register-page .profile-form-card-v2 textarea {
    min-height: 120px;
    height: auto !important;
}

.contest-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.contest-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.mobile-logout-btn {
    --bs-btn-color: #fff;
    --bs-btn-bg: #dc3545;
    --bs-btn-border-color: #dc3545;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #bb2d3b;
    --bs-btn-hover-border-color: #b02a37;
    --bs-btn-focus-shadow-rgb: 220, 53, 69;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #b02a37;
    --bs-btn-active-border-color: #a52834;
}


.site-toast-container {
    z-index: 1085;
    width: min(520px, calc(100vw - 1.5rem));
}

.site-toast {
    width: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, #f07a2f 0%, #d94a2b 52%, #b93425 100%);
    box-shadow: 0 20px 46px rgba(89, 46, 25, .24);
}

.site-toast + .site-toast {
    margin-top: .75rem;
}

.site-toast .toast-body {
    padding: 1rem 1.15rem;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.45;
}

.site-toast-close {
    flex: 0 0 auto;
    opacity: .8;
    filter: invert(1) grayscale(100%) brightness(200%);
}

.site-toast-close:hover,
.site-toast-close:focus-visible {
    opacity: 1;
}

.site-toast--success {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.site-toast--warning {
    color: var(--brown-dark);
    background: linear-gradient(135deg, #ffd06a 0%, var(--sun) 100%);
}

.site-toast--warning .site-toast-close {
    filter: none;
}

.site-toast--info {
    background: linear-gradient(135deg, #50775a 0%, var(--brown) 100%);
}

@media (max-width: 576px) {
    .site-toast-container {
        right: .75rem !important;
        left: .75rem !important;
        width: auto;
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    .site-toast .toast-body {
        font-size: .95rem;
    }
}


.site-toast-container {
    top: 100px !important;
    right: 16px !important;
    z-index: 1080;
}

@media (max-width: 767.98px) {
    .site-toast-container {
        top: 50px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto;
    }

    .site-toast-container .toast {
        width: 100%;
        max-width: none;
    }
}


/* ===== Профиль: блок безопасности и меню пользователя ===== */
.profile-page-v2 .profile-security-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: .95rem;
    align-items: center;
    margin-top: 1.15rem;
    padding: 1rem;
    border: 1px solid rgba(61, 122, 72, .14);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 0 0, rgba(233, 173, 12, .16), transparent 9rem),
        linear-gradient(135deg, rgba(61, 122, 72, .08), rgba(255, 255, 255, .88));
    box-shadow: 0 14px 32px rgba(31, 34, 28, .07);
}

.profile-page-v2 .profile-security-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: var(--brown-dark);
    background: var(--sun);
    box-shadow: 0 12px 26px rgba(233, 173, 12, .24);
    font-size: 1.25rem;
}

.profile-page-v2 .profile-security-title {
    margin: 0;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: -.02em;
}

.profile-page-v2 .profile-security-text {
    margin: .28rem 0 0;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 650;
    line-height: 1.42;
}

.profile-page-v2 .profile-password-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: .72rem 1.05rem;
    border: 1.5px solid rgba(61, 122, 72, .28);
    color: var(--green-dark);
    background: #fff;
    box-shadow: none;
    white-space: nowrap;
    transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.profile-page-v2 .profile-password-btn:hover,
.profile-page-v2 .profile-password-btn:focus-visible {
    border-color: var(--green);
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--brown));
    box-shadow: 0 14px 30px rgba(61, 122, 72, .2);
    transform: translateY(-1px);
}

.profile-page-v2 .profile-actions-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.profile-page-v2 .profile-actions-row .profile-save-btn {
    width: min(100%, 260px);
    margin-top: 0;
}

.user-dropdown {
    border: 1px solid rgba(46, 40, 34, .08);
    box-shadow: 0 18px 44px rgba(31, 34, 28, .14);
}

.user-dropdown .dropdown-item {
    position: relative;
    padding: .62rem .78rem;
    border-radius: .85rem;
    color: var(--brown-dark);
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.user-dropdown .dropdown-item:hover,
.user-dropdown .dropdown-item:focus {
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--brown));
    box-shadow: 0 10px 22px rgba(61, 122, 72, .18);
    transform: translateX(2px);
}

.user-dropdown .dropdown-item:active {
    color: #fff;
    background: var(--green-dark);
}

.user-dropdown .dropdown-item.text-danger:hover,
.user-dropdown .dropdown-item.text-danger:focus {
    color: #fff !important;
    background: linear-gradient(135deg, #dc3545, #9f2d21);
    box-shadow: 0 10px 22px rgba(220, 53, 69, .18);
}

.user-dropdown .dropdown-divider {
    margin: .45rem .25rem;
    border-color: rgba(46, 40, 34, .1);
}

@media (max-width: 767.98px) {
    .profile-page-v2 .profile-security-card {
        grid-template-columns: 1fr;
        justify-items: stretch;
        text-align: left;
    }

    .profile-page-v2 .profile-security-icon {
        justify-self: start;
    }

    .profile-page-v2 .profile-password-btn,
    .profile-page-v2 .profile-actions-row .profile-save-btn {
        width: 100%;
    }
}

.contest-scroll {
    overflow: visible;
    padding: .8rem .8rem 2rem;
    margin: -.8rem -.8rem -1rem;
}

@media (max-width: 991.98px) {
    .contest-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        padding: .8rem calc(var(--bs-gutter-x) * .5 + .8rem) 2.2rem;
        margin-right: calc(var(--bs-gutter-x) * -.5 - .8rem);
        margin-left: calc(var(--bs-gutter-x) * -.5 - .8rem);
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    .contest-scroll::-webkit-scrollbar {
        display: none;
    }
}


/* ===== Исправление обрезания теней у крупных блоков ===== */


/* ===== Исправление обрезания теней без горизонтальной прокрутки ===== */

body {
    overflow-x: clip;
}

.content-page {
    overflow: visible;
}

.modern-page-head,
.dashboard-hero,
.cabinet-hero,
.contest-detail-hero,
.team-hero,
.dashboard-section,
.detail-card,
.participation-card,
.task-card-modern,
.archive-task-section,
/*
.profile-page-v2 .profile-intro-card-v2,
.profile-page-v2 .profile-form-card-v2,
*/
.cabinet-page-v2 .cabinet-hero-v2,
.cabinet-page-v2 .quick-access-card,
.contest-detail-media-card,
.team-layout,
.detail-layout {
    overflow: visible;
}

.schedule-section,
.rules-section,
.polaroid-section {
    overflow-x: clip;
}

@supports not (overflow: clip) {
    body,
    .schedule-section,
    .rules-section,
    .polaroid-section {
        overflow-x: hidden;
    }
}


.ui-tabs,
.judge-contest-tabs {
    padding: 1.25rem 1.25rem 1.8rem;
    margin: -1.25rem -1.25rem .4rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.ui-tabs::-webkit-scrollbar,
.judge-contest-tabs::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
/* ===== Правки: превью файлов, контакты, аватарки и галерея ===== */
.selected-file-preview {
    display: grid;
    align-items: start;
    justify-items: start;
    align-self: start;
    gap: .55rem;
    width: fit-content;
    max-width: 100%;
    margin-top: .75rem;
}

.selected-file-preview strong {
    max-width: min(100%, 420px);
    color: var(--green-dark);
    font-size: .9rem;
    font-weight: 900;
    word-break: break-word;
}

.selected-file-preview img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, 420px);
    max-height: min(360px, 55vh);
    object-fit: contain;
    object-position: center;
    border-radius: .9rem;
    background: transparent;
    box-shadow: 0 10px 24px rgba(31, 34, 28, .12);
}

.selected-video-file-card {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    max-width: min(100%, 420px);
    padding: .85rem 1rem;
    border: 1px solid rgba(61, 122, 72, .16);
    border-radius: 1rem;
    background: rgba(61, 122, 72, .07);
}

.selected-video-file-icon {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: var(--green);
    font-size: 1.25rem;
}

.selected-video-file-info {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.selected-video-file-info strong {
    color: var(--green-dark);
    font-size: .95rem;
    font-weight: 950;
}

.selected-video-file-info span {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 800;
}

.floating-actions a i,
.footer-links a i {
    line-height: 1;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.home-gallery-admin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
}

.home-gallery-toggle-form .modern-checkbox-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: auto;
    padding: .5rem .75rem;
    border-radius: 999px;
    background: rgba(61, 122, 72, .08);
    color: var(--green-dark);
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
}

.home-gallery-toggle-form .modern-checkbox-line input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0;
}

.home-gallery-toggle-form .modern-checkbox-line span {
    display: inline;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.team-admin-title-row,
.admin-user-cell,
.rating-team-main,
.rating-table-team,
.member-chip-with-avatar {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

.team-admin-title-row {
    display: flex;
}

.team-admin-title-row > div,
.admin-user-cell > div {
    min-width: 0;
}

.team-admin-title-row strong,
.team-admin-title-row span,
.admin-user-cell strong,
.admin-user-cell .small {
    overflow-wrap: anywhere;
}

.member-chip-with-avatar img,
.member-chip-with-avatar em {
    flex: 0 0 auto;
    width: var(--avatar-size-chip-xs);
    height: var(--avatar-size-chip-xs);
    border-radius: 50%;
}

.member-chip-with-avatar img {
    object-fit: cover;
}

.member-chip-with-avatar em {
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: var(--sun);
    font-size: .72rem;
    font-style: normal;
    font-weight: 950;
}

.rating-team-main a,
.rating-table-team a {
    color: var(--ink);
    font-weight: 950;
    text-decoration: none;
}

.rating-team-main .team-link-disabled,
.rating-table-team .team-link-disabled {
    font-weight: 950;
}

.rating-table-team {
    display: flex;
}

@media (max-width: 991.98px) {
    .home-gallery-admin-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .selected-file-preview {
        width: fit-content;
        max-width: 100%;
    }

    .selected-file-preview strong,
    .selected-file-preview img,
    .selected-video-file-card {
        max-width: 100%;
    }

    .selected-file-preview img {
        max-height: min(340px, 55vh);
    }

    .home-gallery-admin-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .home-gallery-admin-actions form,
    .home-gallery-admin-actions button,
    .home-gallery-toggle-form .modern-checkbox-line {
        width: 100%;
    }

    .home-gallery-toggle-form .modern-checkbox-line {
        display: flex;
    }
}

.team-admin-title-row .avatar-placeholder,
.admin-user-cell .avatar-placeholder,
.rating-team-main .avatar-placeholder,
.rating-table-team .avatar-placeholder {
    display: inline-flex;
    flex: 0 0 auto;
    margin: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 950;
}

.home-contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: 1rem;
}

.home-contact-actions a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .58rem .9rem;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    font-weight: 850;
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.home-contact-actions a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .18);
}

.polaroid-track {
    animation-duration: var(--polaroid-duration, 72s);
}

/*
@media (max-width: 767.98px) {
    .polaroid-track {
        animation-duration: 54s;
    }
}
*/

/* ===== HTMX: точечные обновления без перезагрузки ===== */
.is-htmx-loading,
.htmx-request {
    cursor: progress;
}

.is-htmx-loading button,
.htmx-request button,
.htmx-request input,
.htmx-request label {
    pointer-events: none;
}

.htmx-request,
.is-htmx-loading {
    opacity: .72;
}

.htmx-inline-message {
    padding: .75rem .9rem;
    border-radius: .9rem;
    font-size: .92rem;
    font-weight: 850;
}

.htmx-inline-message--success {
    color: var(--green-dark);
    background: rgba(61, 122, 72, .1);
}

.htmx-inline-message--info {
    color: #254a7a;
    background: rgba(69, 128, 197, .12);
}

.htmx-inline-message--warning {
    color: #7a4c00;
    background: rgba(255, 193, 7, .18);
}

.htmx-inline-message--error {
    color: #842029;
    background: rgba(220, 53, 69, .12);
}

.home-gallery-admin-item.htmx-swapping,
.quest-review-card.htmx-swapping,
.payment-card.htmx-swapping {
    opacity: 0;
    transition: opacity .15s ease;
}


.floating-actions a i {
    font-size: 2rem;
    line-height: 1;
}

.footer-links a i {
    line-height: 1;
}




.home-hero {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.home-hero a,
.home-hero button,
.home-hero input,
.home-hero textarea,
.home-hero select,
.home-hero label {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}
/* Командные модальные окна */
.team-modal-content .modal-header {
    align-items: flex-start;
}

.team-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.team-modal-checkbox {
    grid-column: 1 / -1;
}

.team-modal-checkbox .form-check-label {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}

.team-confirm-card,
.team-manage-head,
.team-user-line {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.team-confirm-card {
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .7);
}

.invite-copy-card {
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 1rem;
    background: rgba(0, 0, 0, .025);
}

.team-user-line img,
.team-user-line .avatar-placeholder {
    width: var(--avatar-size-md);
    height: var(--avatar-size-md);
    flex: 0 0 var(--avatar-size-md);
    border-radius: 50%;
    object-fit: cover;
}

.team-user-line div {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.team-user-line span,
.team-user-line small {
    color: var(--bs-secondary-color, #6c757d);
}

.team-search-list,
.team-members-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.team-search-row,
.team-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: .9rem;
    background: #fff;
}

@media (max-width: 768px) {
    .team-modal-grid {
        grid-template-columns: 1fr;
    }

    .team-search-row,
    .team-member-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Улучшенные модальные окна команд: вход, регистрация и управление */
.team-modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 1.6rem;
    background: var(--cream-2);
    box-shadow: var(--shadow);
}

.team-modal-content .modal-header {
    border: 0;
    color: #fff;
    background:
        radial-gradient(circle at 12% 10%, rgba(233, 173, 12, .32), transparent 18rem),
        linear-gradient(135deg, var(--green-dark), var(--green));
}

.team-modal-content .modal-title {
    font-weight: 900;
}

.team-modal-content .modal-body {
    background:
        radial-gradient(circle at 100% 0, rgba(233, 173, 12, .08), transparent 18rem),
        var(--cream-2);
}

.team-modal-content .modal-footer {
    border-top: 1px solid var(--line);
    background: rgba(245, 240, 232, .7);
}

.team-auth-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.team-auth-section {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 12px 28px rgba(36, 33, 28, .06);
}

.team-action-preview {
    border-style: dashed;
    background: rgba(228, 239, 228, .72);
}

.team-auth-section h3,
.team-confirm-card h3,
.team-manage-head h3 {
    margin: 0;
    color: var(--brown-dark);
    font-size: 1.08rem;
    font-weight: 900;
}

.required-mark,
.modern-label span.required-mark,
.modern-label > span,
.register-legal-card em,
.modern-checkbox-line em {
    margin-left: .15rem;
    color: #d23b3b;
    font-style: normal;
    font-weight: 900;
}

.team-modal-content .modern-label {
    display: inline-flex;
    align-items: center;
    margin-bottom: .35rem;
    color: var(--brown-dark);
    font-weight: 850;
}

.team-modal-content .form-control,
.team-modal-content .form-select {
    border: 1px solid rgba(78, 63, 52, .18);
    border-radius: .9rem;
    background-color: #fffdf8;
}

.team-modal-content .form-control:focus,
.team-modal-content .form-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 .22rem rgba(61, 122, 72, .14);
}

.team-modal-content .form-control[readonly] {
    color: var(--brown-dark);
    background: var(--green-soft);
    font-weight: 800;
}

.team-confirm-card--accent {
    border-color: rgba(61, 122, 72, .22);
    background:
        radial-gradient(circle at 100% 0, rgba(233, 173, 12, .12), transparent 14rem),
        #fffdf8;
}

.team-modal-content .register-legal-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.team-modal-content .register-legal-card {
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fffdf8;
}

.team-modal-content .register-legal-card label {
    margin-left: .45rem;
}

.team-modal-content .field-errors {
    margin-top: .35rem;
    color: #b42318;
    font-size: .88rem;
    font-weight: 700;
}

.team-modal-content .form-help-text {
    margin-top: .35rem;
    color: var(--muted);
    font-size: .86rem;
}

.team-modal-content .btn-primary {
    border-color: var(--green);
    background: var(--green);
}

.team-modal-content .btn-primary:hover {
    border-color: var(--green-dark);
    background: var(--green-dark);
}

.team-modal-content .btn-secondary {
    border-color: rgba(78, 63, 52, .12);
    color: var(--brown-dark);
    background: var(--cream);
}

/* Финальная унификация командных модалок */
.team-modal .modal-dialog {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.team-modal-dialog {
    max-width: min(1000px, calc(100vw - 2rem));
}

.team-modal .team-modal-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 2rem);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 1.8rem;
    background: var(--cream-2);
    box-shadow: 0 28px 80px rgba(23, 31, 22, .34);
}

.team-modal-content .team-modal-header {
    position: relative;
    min-height: 7rem;
    padding: 1.7rem 2rem 1.45rem;
    overflow: hidden;
    border: 0;
    color: #fffdf8;
    background:
        radial-gradient(circle at 8% 22%, rgba(241, 177, 0, .45), transparent 10rem),
        radial-gradient(circle at 100% 100%, rgba(255, 255, 255, .16), transparent 13rem),
        linear-gradient(135deg, #476a27 0%, #2f7748 58%, #2b7346 100%);
}

.team-modal-content .team-modal-header::after {
    content: "";
    position: absolute;
    right: -3rem;
    bottom: -5rem;
    width: 14rem;
    height: 14rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    pointer-events: none;
}

.team-modal-title-wrap {
    position: relative;
    z-index: 1;
    max-width: calc(100% - 3.2rem);
}

.team-modal-kicker {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    color: rgba(255, 253, 248, .78);
    font-size: .86rem;
    font-weight: 900;
    letter-spacing: .16em;
    line-height: 1.25;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.team-modal-content .team-modal-title {
    margin: 0;
    color: #fffdf8;
    font-size: clamp(1.55rem, 3vw, 2.25rem);
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: -.04em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .16);
}

.team-modal-close {
    position: relative;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    margin: -.4rem -.45rem 0 1rem;
    border-radius: 999px;
    background-color: rgba(255, 253, 248, .76);
    opacity: 1;
    transition: transform .18s ease, background-color .18s ease;
}

.team-modal-close:hover {
    transform: rotate(90deg);
    background-color: #fffdf8;
}

.team-modal-content .modal-body {
    flex: 1 1 auto;
    padding: 1.35rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background:
        radial-gradient(circle at 100% 0, rgba(233, 173, 12, .09), transparent 20rem),
        var(--cream-2);
}

.team-modal-content .modal-footer {
    flex: 0 0 auto;
    gap: .6rem;
    padding: 1rem 1.35rem;
    border-top: 1px solid rgba(78, 63, 52, .14);
    background: rgba(245, 240, 232, .92);
}

.team-auth-section,
.invite-copy-card,
.team-confirm-card {
    border-color: rgba(78, 63, 52, .12);
    background: rgba(255, 253, 248, .86);
    box-shadow: 0 16px 34px rgba(36, 33, 28, .07);
}

.team-auth-section {
    padding: 1.25rem;
}

.team-auth-section .eyebrow,
.team-confirm-card .eyebrow,
.invite-copy-card .eyebrow,
.team-manage-head .eyebrow {
    color: var(--green-dark);
    font-size: .76rem;
    font-weight: 950;
    letter-spacing: .17em;
}

.team-auth-section h3,
.team-confirm-card h3,
.team-manage-head h3,
.invite-copy-card h3,
.team-message-section h3 {
    color: var(--brown-dark);
    font-size: clamp(1.08rem, 1.7vw, 1.32rem);
    font-weight: 950;
    line-height: 1.1;
    letter-spacing: -.025em;
}

.team-action-preview {
    border: 1px dashed rgba(61, 122, 72, .28);
    background:
        radial-gradient(circle at 100% 0, rgba(233, 173, 12, .1), transparent 12rem),
        rgba(230, 241, 229, .82);
}

.team-success-section {
    border-color: rgba(61, 122, 72, .22);
    background:
        radial-gradient(circle at 100% 0, rgba(233, 173, 12, .14), transparent 12rem),
        rgba(240, 248, 238, .92);
}

.team-message-section {
    border-left: .45rem solid var(--green);
}

.team-message-section--warning {
    border-left-color: #e9ad0c;
}

.team-message-section--error {
    border-left-color: #d23b3b;
}

.team-message-section--info {
    border-left-color: var(--green);
}

.team-modal-content .form-control,
.team-modal-content .form-select {
    min-height: 3.35rem;
    padding: .78rem 1rem;
    border: 1px solid rgba(78, 63, 52, .18);
    border-radius: 1.05rem;
    color: var(--brown-dark);
    background-color: #fffdf8;
    font-weight: 650;
}

.team-modal-content input[type="file"].form-control {
    min-height: auto;
    padding: .65rem;
}

.team-modal-content .form-control::placeholder {
    color: rgba(78, 63, 52, .58);
    font-weight: 500;
}

.team-modal-content .modern-label,
.team-modal-content .form-label {
    display: inline-flex;
    align-items: center;
    margin-bottom: .45rem;
    color: var(--brown-dark);
    font-weight: 900;
}

.team-modal-content .required-mark {
    margin-left: .18rem;
    color: #d23b3b;
    font-size: 1.05em;
    font-weight: 950;
}

.team-modal-content .btn {
    border-radius: 999px;
    font-weight: 900;
}

.team-modal-content .btn-primary {
    border-color: var(--green);
    color: #fffdf8;
    background: var(--green);
    box-shadow: 0 10px 26px rgba(44, 114, 68, .18);
}

.team-modal-content .btn-primary:hover,
.team-modal-content .btn-primary:focus {
    border-color: var(--green-dark);
    background: var(--green-dark);
}

.team-modal-content .btn-secondary {
    border-color: rgba(78, 63, 52, .13);
    color: var(--brown-dark);
    background: rgba(255, 253, 248, .82);
}

.team-modal-content .btn-secondary:hover,
.team-modal-content .btn-secondary:focus {
    color: var(--brown-dark);
    background: #fffdf8;
}

.team-confirm-card {
    align-items: flex-start;
    padding: 1rem;
    border-radius: 1.25rem;
}

.avatar-lg {
    width: var(--avatar-size-lg);
    height: var(--avatar-size-lg);
    flex: 0 0 var(--avatar-size-lg);
    border-radius: 1.35rem;
    object-fit: cover;
}

.team-modal-content .avatar-placeholder.avatar-lg,
.team-modal-content .avatar-lg.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fffdf8;
    background: var(--green);
    font-size: 1.8rem;
    font-weight: 950;
}

@media (max-width: 768px) {
    .team-modal .modal-dialog {
        align-items: stretch;
        max-width: none;
        min-height: calc(100dvh - 1rem);
        margin: .5rem;
    }

    .team-modal .team-modal-content {
        max-height: calc(100dvh - 1rem);
        border-radius: 1.35rem;
    }

    .team-modal-content .team-modal-header {
        min-height: 6.2rem;
        padding: 1.25rem 1.25rem 1.05rem;
    }

    .team-modal-content .modal-body {
        padding: 1rem;
    }

    .team-modal-content .modal-footer {
        align-items: stretch;
        flex-direction: column-reverse;
        padding: .9rem 1rem;
    }

    .team-modal-content .modal-footer .btn,
    .team-modal-content .modal-footer a.btn {
        width: 100%;
    }

    .team-confirm-card {
        flex-direction: column;
    }

    .avatar-lg {
        width: var(--avatar-size-lg-mobile);
        height: var(--avatar-size-lg-mobile);
        flex-basis: var(--avatar-size-lg-mobile);
    }
}

/* Корректная прокрутка длинных командных модалок */
.team-modal {
    --bs-modal-margin: 1rem;
}

.team-modal .modal-dialog-scrollable .modal-content,
.team-modal .team-modal-content {
    max-height: calc(100dvh - 2rem);
}

.team-modal-content > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100dvh - 2rem);
}

.team-modal-content .modal-body,
.team-modal-content .team-auth-modal-body {
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.team-modal-content .team-auth-section,
.team-modal-content .team-confirm-card,
.team-modal-content .invite-copy-card {
    min-width: 0;
}

@media (max-width: 768px) {
    .team-modal {
        --bs-modal-margin: .5rem;
    }

    .team-modal .modal-dialog-scrollable .modal-content,
    .team-modal .team-modal-content,
    .team-modal-content > form {
        max-height: calc(100dvh - 1rem);
    }
}

/* Весёлая страница 404 */
.error-page-body {
    background:
        radial-gradient(circle at 10% 8%, rgba(233, 173, 12, .18), transparent 20rem),
        radial-gradient(circle at 92% 16%, rgba(61, 122, 72, .16), transparent 22rem),
        var(--cream-2);
}

.error-page-wrap {
    display: grid;
    min-height: calc(100dvh - 7rem);
    padding: clamp(2rem, 5vw, 5rem) 1rem;
    place-items: center;
}

.error-card {
    position: relative;
    width: min(880px, 100%);
    padding: clamp(1.4rem, 4vw, 3.4rem);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 2rem;
    color: #fffdf8;
    background:
        radial-gradient(circle at 8% 15%, rgba(241, 177, 0, .45), transparent 12rem),
        radial-gradient(circle at 100% 100%, rgba(255, 255, 255, .18), transparent 15rem),
        linear-gradient(135deg, #476a27 0%, #2f7748 58%, #2b7346 100%);
    box-shadow: 0 28px 80px rgba(23, 31, 22, .28);
}

.error-card::after {
    content: "";
    position: absolute;
    right: -5rem;
    bottom: -7rem;
    width: 18rem;
    height: 18rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    pointer-events: none;
}

.error-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    margin-bottom: 1.2rem;
    border-radius: 1.5rem;
    color: var(--brown-dark);
    background: var(--sun);
    font-size: 1.65rem;
    font-weight: 950;
    box-shadow: 0 16px 34px rgba(36, 33, 28, .18);
}

.error-card .eyebrow {
    color: rgba(255, 253, 248, .78);
}

.error-card h1 {
    max-width: 720px;
    margin: 0 0 1rem;
    color: #fffdf8;
    font-size: clamp(2rem, 6vw, 4.3rem);
    font-weight: 950;
    line-height: .98;
    letter-spacing: -.055em;
}

.error-card .lead-text {
    max-width: 660px;
    color: rgba(255, 253, 248, .86);
    font-size: clamp(1.04rem, 2vw, 1.25rem);
}

.error-hint-card {
    display: grid;
    gap: .2rem;
    max-width: 480px;
    margin: 1.4rem 0 0;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(255, 253, 248, .24);
    border-radius: 1.25rem;
    background: rgba(255, 253, 248, .13);
    backdrop-filter: blur(10px);
}

.error-hint-card span,
.error-hint-card small {
    color: rgba(255, 253, 248, .74);
}

.error-hint-card strong {
    color: #fffdf8;
    font-size: 1.2rem;
    font-weight: 950;
}

.error-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.6rem;
}

.team-action-preview {
    padding: 1rem;
    border-radius: 1.2rem;
}

/* Командные модалки: аккуратный выбор файлов и согласия */
.team-modal-content .team-file-picker {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.team-modal-content .team-file-title {
    margin-bottom: 0;
}

.team-modal-content .team-file-picker input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.team-modal-content .team-file-control {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 3.35rem;
    padding: .45rem .55rem;
    border: 1px solid rgba(78, 63, 52, .18);
    border-radius: 1.05rem;
    background: #fffdf8;
}

.team-modal-content .team-file-button {
    flex: 0 0 auto;
    margin: 0;
    padding: .75rem 1.1rem;
    cursor: pointer;
}

.team-modal-content .team-file-name {
    min-width: 0;
    overflow: hidden;
    color: var(--brown-dark);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-registration-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 48%) auto;
    align-items: center;
    gap: 24px;
}

.quick-registration-progress-meta {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.82rem;
    font-weight: 700;
}

.quick-registration-progress-wrap {
    position: relative;
    z-index: 2;
    padding: 14px 16px 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 20px;
    background: rgba(8, 42, 26, 0.62);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 12px 28px rgba(5, 24, 14, 0.3);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.quick-registration-progress {
    height: 32px;
    padding: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 999px;
    background: rgba(20, 56, 36, 0.32);
    box-shadow:
        inset 0 2px 7px rgba(8, 35, 20, 0.32),
        0 1px 0 rgba(255, 255, 255, 0.28);
}

.quick-registration-progress span {
    display: flex;
    width: var(--progress-end);
    height: 100%;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    color: #111;
    background: #fff;
    box-shadow:
        0 0 14px rgba(255, 255, 255, 0.24),
        inset 0 0 0 1px rgba(0, 0, 0, 0.04);
    animation: quick-registration-progress-fill 0.55s ease-out both;
}

.quick-registration-progress span strong {
    color: #111;
    font-size: .78rem;
    font-weight: 900;
    line-height: 1;
}

@keyframes quick-registration-progress-fill {
    from { width: var(--progress-start); }
    to { width: var(--progress-end); }
}

.quick-registration-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.quick-registration-choice {
    position: relative;
    display: grid;
    gap: 8px;
    min-height: 190px;
    padding: 24px;
    cursor: pointer;
    border: 2px solid #dfe5dc;
    border-radius: 24px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.quick-registration-choice-button {
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
}

.quick-registration-choice-button:focus-visible {
    outline: 4px solid rgba(47, 129, 72, 0.24);
    outline-offset: 3px;
}

.quick-registration-choice:hover {
    transform: translateY(-2px);
    border-color: #3c8b52;
    box-shadow: 0 16px 30px rgba(37, 83, 48, 0.12);
}

.quick-code-resend-form {
    padding: 0 1.35rem 1rem;
    text-align: center;
}

.email-code-input {
    max-width: 16rem;
    font-size: 1.65rem !important;
    font-weight: 850;
    letter-spacing: 0.35em;
    text-align: center;
}

.quick-registration-choice-icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: #2f7748;
    font-size: 1.45rem;
}

.quick-registration-choice strong {
    align-self: end;
    font-size: 1.25rem;
}

.quick-registration-choice small {
    color: #68716a;
    line-height: 1.45;
}

.quick-registration-note {
    padding: 18px 20px;
    border: 1px solid #cfe2c8;
    border-radius: 18px;
    background: #f0f7eb;
    color: #2f5137;
}

.quick-registration-note p,
.quick-registration-note [hidden] {
    margin: 0;
}

.quick-registration-note [hidden] {
    display: none;
}

.quick-registration-success-icon {
    display: grid;
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #2f7748;
    font-size: 2rem;
}

@media (max-width: 767.98px) {
    .quick-registration-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px;
    }

    .quick-registration-progress-wrap {
        display: grid;
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 9px;
        padding: 8px 10px;
        border-radius: 14px;
    }

    .quick-registration-progress-meta {
        margin: 0;
        font-size: .72rem;
        white-space: nowrap;
    }

    .quick-registration-progress {
        height: 23px;
        padding: 2px;
    }

    .quick-registration-progress span strong {
        font-size: .68rem;
    }

    .quick-registration-choice-grid {
        grid-template-columns: 1fr;
    }

    .quick-registration-choice {
        min-height: 150px;
    }
}

.team-modal-content .register-legal-card {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
}

.team-modal-content .register-legal-card input[type="checkbox"] {
    flex: 0 0 auto;
    margin: .18rem 0 0 !important;
}

.team-modal-content .register-legal-card label {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    line-height: 1.35;
}

.register-legal-card--master {
    padding: .85rem 1rem;
    border: 1px solid rgba(61, 122, 72, .24);
    border-radius: 1rem;
    background: rgba(223, 239, 221, .58);
}

.register-legal-card--master label,
.team-modal-content .register-legal-card--master label {
    font-size: 1rem;
    font-weight: 900;
}

.register-legal-card--detail label,
.team-modal-content .register-legal-card--detail label {
    font-size: .86rem;
    font-weight: 650;
    line-height: 1.38;
}

.register-legal-card--detail label a,
.team-modal-content .register-legal-card--detail label a {
    font-size: inherit;
}

@media (max-width: 576px) {
    .team-modal-content .team-file-control {
        align-items: stretch;
        flex-direction: column;
    }

    .team-modal-content .team-file-button {
        width: 100%;
    }
}


/* ===== Архив фотоквеста: фото заполняет карточку и обрезается ===== */

.archive-photo-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.archive-photo-card .photo-preview {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--green-soft);
}

.archive-photo-card .archive-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.archive-photo-card > div:not(.empty-state) {
    flex: 1;
}

/* Профиль: подсказка в соседней колонке не растягивает поле ввода. */
.profile-page-v2 .profile-fields-grid-v2 {
    align-items: start;
}

.profile-page-v2 .profile-fields-grid-v2 .modern-field {
    align-content: start;
    align-self: start;
    grid-auto-rows: max-content;
    width: 100%;
}

.profile-page-v2 .profile-form-card-v2 input:not([type="checkbox"]):not([type="file"]) {
    box-sizing: border-box;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
}

/* Кабинет организатора: вкладки и компактные фотоквесты. */
.organizer-dashboard-hero {
    margin-bottom: 1.25rem;
}

.organizer-dashboard-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
    margin-bottom: 1.25rem;
}

.organizer-dashboard-tab {
    display: grid;
    gap: .25rem;
    min-height: 92px;
    padding: 1rem 1.1rem;
    cursor: pointer;
    border: 1px solid rgba(46, 40, 34, .1);
    border-radius: 1.25rem;
    color: var(--brown-dark);
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 10px 28px rgba(31, 34, 28, .07);
    text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.organizer-dashboard-tab:hover {
    transform: translateY(-2px);
    border-color: rgba(61, 122, 72, .32);
    box-shadow: 0 14px 32px rgba(31, 34, 28, .1);
}

.organizer-dashboard-tab.is-active {
    border-color: var(--green);
    color: #fff;
    background: var(--green-dark);
    box-shadow: 0 16px 34px rgba(36, 86, 55, .2);
}

.organizer-dashboard-tab:focus-visible {
    outline: 4px solid rgba(61, 122, 72, .22);
    outline-offset: 3px;
}

.organizer-dashboard-tab span {
    font-size: 1.02rem;
    font-weight: 900;
}

.organizer-dashboard-tab small {
    align-self: end;
    color: var(--muted);
    font-weight: 700;
}

.organizer-dashboard-tab.is-active small {
    color: rgba(255, 255, 255, .74);
}

.organizer-dashboard-panel[hidden] {
    display: none !important;
}

.organizer-dashboard-panel > .dashboard-section:first-child {
    margin-top: 0;
}

.organizer-section-lead {
    max-width: 680px;
    margin: .4rem 0 0;
    color: var(--muted);
}

.organizer-quest-group + .organizer-quest-group,
.organizer-archive-disclosure {
    margin-top: 1.75rem;
}

.organizer-quest-group-head {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .85rem;
}

.organizer-quest-group-head h3 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    font-weight: 900;
    letter-spacing: -.03em;
}

.organizer-quest-group-head span,
.organizer-archive-count {
    display: inline-grid;
    min-width: 1.8rem;
    min-height: 1.8rem;
    padding: .2rem .5rem;
    place-items: center;
    border-radius: 999px;
    color: var(--green-dark);
    background: rgba(61, 122, 72, .1);
    font-size: .8rem;
    font-weight: 900;
}

.organizer-quest-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .8rem;
}

.organizer-quest-disclosure {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(46, 40, 34, .1);
    border-radius: 1.35rem;
    background: #fff;
    box-shadow: 0 12px 30px rgba(31, 34, 28, .08);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.organizer-quest-disclosure:not([open]):hover {
    transform: translateY(-3px);
    border-color: rgba(61, 122, 72, .28);
    box-shadow: 0 18px 38px rgba(31, 34, 28, .12);
}

.organizer-quest-disclosure[open] {
    grid-column: 1 / -1;
    border-color: rgba(61, 122, 72, .28);
}

.organizer-quest-card {
    display: block;
    cursor: pointer;
    list-style: none;
}

.organizer-quest-card::-webkit-details-marker,
.organizer-archive-toggle::-webkit-details-marker {
    display: none;
}

.organizer-quest-disclosure[open] .organizer-quest-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
}

.organizer-quest-media {
    position: relative;
    min-height: 0;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: var(--green-soft);
}

.organizer-quest-disclosure[open] .organizer-quest-media {
    min-height: 0;
}

.organizer-quest-media img,
.organizer-quest-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.organizer-quest-placeholder {
    display: grid;
    min-height: 0;
    place-items: center;
    color: rgba(255, 255, 255, .86);
    background: var(--green-dark);
    font-size: 3rem;
    font-weight: 900;
}

.organizer-quest-grid--upcoming .organizer-quest-placeholder {
    background: #6a6843;
}

.organizer-quest-grid--archive .organizer-quest-placeholder {
    background: #6b625a;
}

.organizer-quest-status {
    position: absolute;
    top: .7rem;
    left: .7rem;
    max-width: calc(100% - 1.4rem);
    padding: .38rem .58rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    color: #fff;
    background: rgba(19, 31, 23, .66);
    backdrop-filter: blur(8px);
    font-size: .72rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-quest-summary {
    display: flex;
    min-width: 0;
    padding: .72rem;
    flex-direction: column;
}

.organizer-quest-summary p {
    margin: 0 0 .25rem;
    color: var(--green-dark);
    font-size: .62rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.organizer-quest-summary h3 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: .92rem;
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -.025em;
}

.organizer-quest-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    margin: .65rem 0;
}

.organizer-quest-meta div:first-child {
    grid-column: 1 / -1;
}

.organizer-quest-meta div {
    min-width: 0;
    padding: .4rem;
    border-radius: .6rem;
    background: rgba(61, 122, 72, .07);
}

.organizer-quest-meta dt {
    color: var(--muted);
    font-size: .57rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.organizer-quest-meta dd {
    margin: .15rem 0 0;
    overflow: hidden;
    font-size: .72rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-quest-open-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: auto;
    color: var(--green-dark);
    font-size: .7rem;
    font-weight: 850;
}

.organizer-quest-open-label i,
.organizer-archive-toggle i {
    transition: transform .18s ease;
}

.organizer-quest-close-text,
.organizer-archive-hide {
    display: none;
}

.organizer-quest-disclosure[open] .organizer-quest-open-text,
.organizer-archive-disclosure[open] .organizer-archive-show {
    display: none;
}

.organizer-quest-disclosure[open] .organizer-quest-close-text,
.organizer-archive-disclosure[open] .organizer-archive-hide {
    display: inline;
}

.organizer-quest-disclosure[open] .organizer-quest-open-label i,
.organizer-archive-disclosure[open] .organizer-archive-toggle i {
    transform: rotate(180deg);
}

.organizer-quest-details {
    padding: 1.1rem;
    border-top: 1px solid rgba(46, 40, 34, .1);
    background: #fffdf8;
}

.organizer-quest-details-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .9rem;
}

.organizer-quest-details-head h4 {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 900;
}

.organizer-quest-details-head .eyebrow {
    margin-bottom: .2rem;
}

.organizer-team-table-wrap,
.organizer-users-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(46, 40, 34, .1);
    border-radius: 1rem;
    background: #fff;
}

.organizer-team-table,
.organizer-users-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--ink);
    font-size: .88rem;
}

.organizer-team-table {
    min-width: 820px;
}

.organizer-team-table th,
.organizer-team-table td,
.organizer-users-table th,
.organizer-users-table td {
    padding: .75rem .8rem;
    border-bottom: 1px solid rgba(46, 40, 34, .09);
    text-align: left;
    vertical-align: middle;
}

.organizer-team-table th,
.organizer-users-table th {
    color: var(--brown-dark);
    background: rgba(61, 122, 72, .07);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.organizer-team-table tbody tr:last-child td,
.organizer-users-table tbody tr:last-child td {
    border-bottom: 0;
}

.organizer-team-table tbody.organizer-team-group + tbody.organizer-team-group tr:first-child td {
    border-top: 2px solid rgba(61, 122, 72, .18);
}

.organizer-team-name-cell {
    background: rgba(61, 122, 72, .055);
    vertical-align: top !important;
}

.organizer-team-table tr.is-captain > td:not(.organizer-team-name-cell) {
    background: #fff7d6;
}

.organizer-team-table-empty {
    color: var(--muted);
    text-align: center !important;
}

.organizer-archive-toggle {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 46px;
    cursor: pointer;
    border: 1px solid rgba(61, 122, 72, .26);
    border-radius: 999px;
    color: var(--green-dark);
    background: #fff;
    font-weight: 850;
    box-shadow: none;
}

.organizer-archive-toggle:hover {
    border-color: var(--green);
    color: var(--green-dark);
    background: rgba(61, 122, 72, .06);
}

.organizer-archive-disclosure[open] .organizer-quest-group--archive {
    margin-top: 1rem;
}

@media (max-width: 1199.98px) {
    .organizer-quest-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .organizer-dashboard-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .organizer-quest-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .organizer-quest-details-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 767.98px) {
    .organizer-dashboard-tabs {
        display: flex;
        margin-right: calc(var(--bs-gutter-x, 1.5rem) * -.5);
        margin-left: calc(var(--bs-gutter-x, 1.5rem) * -.5);
        padding: .2rem calc(var(--bs-gutter-x, 1.5rem) * .5) .75rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
    }

    .organizer-dashboard-tab {
        min-width: min(74vw, 210px);
        min-height: 82px;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .organizer-quest-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem;
    }

    .organizer-quest-disclosure[open] .organizer-quest-card {
        display: grid;
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .organizer-quest-media,
    .organizer-quest-disclosure[open] .organizer-quest-media {
        min-height: 0;
        max-height: none;
    }

    .organizer-actions {
        width: 100%;
    }

    .organizer-actions .btn {
        flex: 1 1 140px;
    }

    .organizer-team-table-wrap,
    .organizer-users-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .organizer-team-table,
    .organizer-users-table,
    .organizer-team-table tbody,
    .organizer-users-table tbody,
    .organizer-team-table tr,
    .organizer-users-table tr,
    .organizer-team-table td,
    .organizer-users-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .organizer-team-table thead,
    .organizer-users-table thead {
        display: none;
    }

    .organizer-team-table tr,
    .organizer-users-table tr {
        margin-bottom: .8rem;
        overflow: hidden;
        border: 1px solid rgba(46, 40, 34, .1);
        border-radius: 1rem;
        background: #fff;
        box-shadow: 0 8px 22px rgba(31, 34, 28, .06);
    }

    .organizer-team-table tbody.organizer-team-group {
        margin-bottom: .8rem;
        overflow: hidden;
        border: 1px solid rgba(46, 40, 34, .1);
        border-radius: 1rem;
        background: #fff;
        box-shadow: 0 8px 22px rgba(31, 34, 28, .06);
    }

    .organizer-team-table tbody.organizer-team-group tr {
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .organizer-team-table tbody.organizer-team-group tr + tr {
        border-top: 1px solid rgba(46, 40, 34, .09);
    }

    .organizer-team-table tbody.organizer-team-group + tbody.organizer-team-group tr:first-child td {
        border-top: 0;
    }

    .organizer-team-table td,
    .organizer-users-table td {
        display: grid;
        grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
        gap: .65rem;
        padding: .65rem .75rem;
        overflow-wrap: anywhere;
    }

    .organizer-team-table td::before,
    .organizer-users-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: .7rem;
        font-weight: 850;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .organizer-team-table .organizer-team-name-cell {
        display: grid;
        grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
        background: rgba(61, 122, 72, .09);
    }

    .organizer-team-table tr.is-captain > td:not(.organizer-team-name-cell) {
        background: #fff7d6;
    }

    .organizer-team-table-empty {
        display: block !important;
    }

    .organizer-team-table-empty::before {
        display: none;
    }

    .organizer-users-table .admin-user-cell {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .organizer-archive-toggle {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 359.98px) {
    .organizer-quest-grid {
        grid-template-columns: 1fr;
    }
}



.cabinet-page-v2 .cabinet-hero-v2,
.cabinet-page-v2 .quick-access-card {
    overflow: hidden;
}

.site-toast-content {
    flex: 1 1 auto;
    min-width: 0;
}

.site-toast-action {
    display: inline-flex;
    margin: 0 1.15rem 1rem;
    color: inherit;
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.site-toast-action:hover,
.site-toast-action:focus-visible {
    color: inherit;
    text-decoration-thickness: .14em;
}

/* ===== Т-Бизнес: быстрая оплата и история покупок ===== */
.tbank-payment-actions { display: grid; gap: .7rem; width: 100%; margin-top: 1rem; }
.tbank-sbp-widget, .tbank-sbp-container { width: 100%; min-width: 0; }
.tbank-sbp-container:empty {
    min-height: 54px;
    border-radius: 14px;
    background: linear-gradient(90deg, #edf2eb 25%, #f8faf7 50%, #edf2eb 75%);
    background-size: 200% 100%;
    animation: tbank-payment-loading 1.2s linear infinite;
}
@keyframes tbank-payment-loading { to { background-position: -200% 0; } }
.tbank-payment-fallback-form { margin: 0; }
.tbank-payment-caption, .tbank-payment-error, .tbank-payment-status {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
    text-align: center;
}
.tbank-payment-error { color: #9e342b; font-weight: 750; }
.tbank-payment-status { color: var(--green-dark); font-weight: 750; }
.quick-registration-payment-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
    padding: .9rem 1rem;
    border: 1px solid rgba(61, 122, 72, .18);
    border-radius: 1rem;
    background: rgba(61, 122, 72, .07);
    text-align: left;
}
.quick-registration-payment-summary strong, .payment-side-price {
    color: var(--green-dark);
    font-size: 1.35rem;
    font-weight: 900;
    white-space: nowrap;
}
.payment-side-price { margin: .5rem 0 0; }
.cabinet-dashboard-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cabinet-unpaid-section { border-color: rgba(221, 174, 47, .3); }
.purchase-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.purchase-card, .purchase-history-card {
    padding: 1.1rem;
    border: 1px solid rgba(46, 40, 34, .1);
    border-radius: 1.2rem;
    background: #fff;
    box-shadow: 0 10px 26px rgba(31, 34, 28, .06);
}
.purchase-card--unpaid { border-color: rgba(221, 174, 47, .34); background: #fffdf5; }
.purchase-card-head, .purchase-history-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.purchase-card-head p, .purchase-history-main p { margin: 0; color: var(--muted); font-size: .84rem; }
.purchase-card-head h3, .purchase-history-main h3 { margin: .2rem 0; font-size: 1.15rem; font-weight: 900; }
.purchase-card-head > strong, .purchase-history-main > strong {
    color: var(--green-dark);
    font-size: 1.2rem;
    font-weight: 900;
    white-space: nowrap;
}
.purchase-list { display: grid; gap: .85rem; }
.purchase-history-card.is-paid { border-color: rgba(61, 122, 72, .3); }
.purchase-history-card.is-failed { border-color: rgba(170, 61, 51, .25); }
.purchase-status-pill {
    display: inline-flex;
    margin-bottom: .35rem;
    padding: .3rem .58rem;
    border-radius: 999px;
    color: var(--green-dark);
    background: rgba(61, 122, 72, .1);
    font-size: .72rem;
    font-weight: 900;
}
.purchase-meta, .payment-result-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .6rem;
    margin: 1rem 0;
}
.purchase-meta div, .payment-result-facts div {
    min-width: 0;
    padding: .65rem;
    border-radius: .75rem;
    background: rgba(61, 122, 72, .055);
}
.purchase-meta dt, .payment-result-facts dt {
    color: var(--muted);
    font-size: .67rem;
    font-weight: 800;
    text-transform: uppercase;
}
.purchase-meta dd, .payment-result-facts dd {
    margin: .2rem 0 0;
    overflow-wrap: anywhere;
    font-size: .82rem;
    font-weight: 800;
}
.purchase-history-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .7rem;
    flex-wrap: wrap;
}
.purchase-history-actions form { margin: 0; }
.purchase-receipt-note { margin-right: auto; color: var(--green-dark); font-size: .84rem; font-weight: 750; }
.purchase-error { margin: .7rem 0; color: #9e342b; font-size: .85rem; }
.payment-result-page { max-width: 780px; }
.payment-result-card { padding: clamp(1.5rem, 5vw, 3rem); text-align: center; }
.payment-result-card h1 { margin: .35rem 0 .7rem; font-weight: 950; }
.payment-result-pending-icon {
    display: grid;
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 50%;
    color: #4d4829;
    background: #f4df87;
    font-size: 2rem;
}
.payment-result-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: left; }

@media (max-width: 767.98px) {
    .cabinet-dashboard-tabs { display: flex; }
    .purchase-grid, .purchase-meta, .payment-result-facts { grid-template-columns: 1fr; }
    .purchase-card-head, .purchase-history-main { align-items: flex-start; flex-direction: column; }
    .purchase-history-actions { align-items: stretch; flex-direction: column; }
    .purchase-history-actions .btn, .purchase-history-actions form, .purchase-history-actions button { width: 100%; }
}

/* ===== Единая компактная карточка фотоквеста ===== */
.contest-card-link--modern .contest-placeholder::after {
    display: none;
}

.contest-card-link--modern {
    width: 100%;
    height: auto;
}

.contest-content--modern {
    height: 19.75rem;
    flex: 0 0 19.75rem;
    padding: 1.2rem 1.25rem 1.15rem;
}

.contest-content--modern h4 {
    display: -webkit-box;
    min-height: 2em;
    margin-bottom: .7rem;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.contest-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr);
    gap: .8rem;
    align-items: start;
    margin-bottom: .75rem;
}

.contest-availability {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    padding-top: .05rem;
    color: #3c3d3a;
    font-size: .84rem;
    line-height: 1.3;
}

.contest-availability > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.contest-availability-dot {
    width: .6rem;
    height: .6rem;
    flex: 0 0 .6rem;
    margin-top: .15rem;
    border-radius: 50%;
    background: var(--green);
}

.contest-availability--archive {
    color: var(--muted);
    font-size: .78rem;
}

.contest-availability--archive .contest-availability-dot {
    background: var(--muted);
}

.contest-timeline {
    position: relative;
    display: grid;
    gap: .52rem;
    min-width: 0;
    margin: 0;
}

.contest-timeline-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: .51rem;
    left: .37rem;
    width: 1px;
    height: calc(100% + .52rem);
    background: rgba(61, 122, 72, .72);
}

.contest-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: .8rem minmax(0, 1fr);
    gap: .65rem;
    align-items: start;
}

.contest-timeline-marker {
    position: relative;
    z-index: 1;
    width: .78rem;
    height: .78rem;
    margin-top: .12rem;
    border: 2px solid var(--green);
    border-radius: 50%;
    background: #fff;
}

.contest-timeline-label {
    display: block;
    margin-bottom: .08rem;
    color: var(--green);
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .04em;
    line-height: 1.2;
    text-transform: uppercase;
}

.contest-timeline time {
    display: block;
    color: #3c3d3a;
    font-size: .8rem;
    font-weight: 550;
    line-height: 1.25;
}

.contest-location {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    min-width: 0;
    margin-bottom: .7rem;
    color: #3c3d3a;
}

.contest-location > i {
    flex: 0 0 auto;
    margin-top: .08rem;
    color: var(--green);
    font-size: 1rem;
    line-height: 1.25;
}

.contest-content--modern .contest-location p {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: .86rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contest-location strong {
    font-weight: 550;
}

.contest-content--modern .contest-description-compact {
    display: -webkit-box;
    min-height: calc(1.4em * 2);
    margin: 0;
    overflow: hidden;
    color: #3c3d3a;
    font-size: .88rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.contest-footer-row--modern {
    align-items: center;
    flex-direction: row;
    margin-top: auto;
    padding-top: .8rem;
}

.contest-footer-row--modern > strong {
    flex: 0 0 auto;
    white-space: nowrap;
}

.contest-card-link--modern .contest-registration-button,
.contest-card-link--modern .contest-archive-detail-button {
    min-width: 0;
    padding: .62rem .95rem;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
    .contest-card-link--modern:hover,
    .compact-tile .contest-card-link--modern:hover {
        transform: translate3d(0, -4px, 0) !important;
    }
}

@media (max-width: 991.98px) {
    .contest-scroll,
    .contest-scroll.compact-scroll {
        grid-auto-columns: clamp(250px, 72vw, 360px);
    }
}

@media (max-width: 576px) {
    .contest-scroll,
    .contest-scroll.compact-scroll {
        grid-auto-columns: clamp(230px, 78vw, 320px);
    }

    .contest-content--modern {
        padding: 1rem;
    }

    .contest-footer-row--modern {
        gap: .5rem;
        align-items: center;
        flex-direction: row;
    }

    .contest-footer-row--modern > strong {
        font-size: .9rem;
    }

    .contest-card-link--modern .contest-registration-button,
    .contest-card-link--modern .contest-archive-detail-button {
        width: auto;
        padding: .58rem .72rem;
        font-size: .78rem;
    }
}

@media (max-width: 360px) {
    .contest-content--modern {
        height: 21rem;
        flex-basis: 21rem;
    }
}

@media (hover: none), (pointer: coarse) {
    .contest-card-link--modern:hover,
    .compact-tile .contest-card-link--modern:hover {
        transform: translateZ(0) !important;
        box-shadow: var(--shadow);
    }
}

/* ===== Фото задания: локальный предпросмотр и серверный черновик ===== */
.submission-workspace {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.submission-workspace--split {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    align-items: start;
}

.submission-server-panel,
.submission-draft-form,
.submission-score-panel {
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(36, 86, 55, .13);
    border-radius: 1.35rem;
}

.submission-server-panel {
    margin-top: 0;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(244, 250, 245, .96));
    box-shadow: 0 18px 48px rgba(29, 75, 47, .09);
}

.submission-draft-form,
.submission-score-panel {
    background:
        linear-gradient(145deg, rgba(255, 249, 229, .94), rgba(255, 255, 255, .98));
    border-style: dashed;
    border-color: rgba(233, 173, 12, .38);
}

.submission-score-caption {
    margin: -.25rem 0 .9rem;
    color: #74766c;
    font-size: .86rem;
    line-height: 1.4;
}

.submission-score-chip {
    flex: 0 0 auto;
    padding: .38rem .62rem;
    border-radius: 999px;
    color: #7b5b00;
    background: rgba(248, 196, 48, .18);
    font-size: .72rem;
    font-weight: 900;
}

.submission-score-chip.is-complete {
    color: #fff;
    background: var(--green);
}

.submission-score-list {
    display: grid;
    gap: .55rem;
    margin: 0;
}

.submission-score-list > div {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem .8rem;
    border: 1px solid rgba(81, 72, 43, .08);
    border-radius: .9rem;
    background: rgba(255, 255, 255, .76);
}

.submission-score-list dt {
    color: #4b5048;
    font-weight: 800;
}

.submission-score-list dd {
    flex: 0 0 auto;
    margin: 0;
    color: var(--green-dark);
    font-weight: 950;
}

.submission-score-list dd > span:not(.submission-score-empty) {
    color: #7c817a;
    font-size: .78rem;
    font-weight: 750;
}

.submission-score-list .submission-score-total {
    border-color: rgba(61, 122, 72, .18);
    background: rgba(61, 122, 72, .09);
}

.submission-score-total dt,
.submission-score-total dd {
    color: var(--green-dark);
}

.submission-score-empty {
    color: #a3a69f;
}

.submission-score-progress {
    display: flex;
    gap: .55rem;
    align-items: center;
    margin-top: .8rem;
    padding: .7rem .8rem;
    border-radius: .9rem;
    color: #775a07;
    background: rgba(248, 196, 48, .12);
    font-size: .82rem;
    font-weight: 800;
}

.submission-score-progress.is-complete {
    color: var(--green-dark);
    background: rgba(61, 122, 72, .1);
}

.submission-score-progress i {
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.submission-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .8rem;
    margin-bottom: .9rem;
}

.submission-panel-heading h4 {
    margin: .15rem 0 0;
    font-size: 1.08rem;
    font-weight: 950;
}

.submission-panel-kicker {
    display: block;
    color: var(--green-dark);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.submission-status-chip,
.submission-local-chip {
    flex: 0 0 auto;
    padding: .38rem .62rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 900;
}

.submission-status-chip--draft {
    color: #735400;
    background: rgba(248, 196, 48, .2);
}

.submission-status-chip--pending,
.submission-status-chip--scored {
    color: #fff;
    background: var(--green);
}

.submission-local-chip {
    color: #7b5b00;
    background: rgba(248, 196, 48, .18);
}

.submission-server-photo-wrap {
    display: flex;
    overflow: visible;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: transparent;
}

.submission-panel .submission-server-photo {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(66vh, 620px);
    border-radius: 1.35rem !important;
    background: transparent;
    box-shadow: 0 14px 34px rgba(29, 75, 47, .12);
    object-fit: contain;
}

.submission-server-actions {
    display: grid;
    gap: .75rem;
    margin-top: 1rem;
    padding: .9rem;
    border-radius: 1rem;
    background: rgba(36, 134, 70, .08);
}

.submission-server-actions p,
.submission-locked-note {
    margin: 0;
    color: var(--green-dark);
    font-size: .9rem;
    font-weight: 750;
}

.submission-confirm-form {
    margin: 0;
}

.submission-confirm-button {
    width: 100%;
    min-height: 48px;
    border-radius: 999px;
    font-weight: 900;
}

.submission-locked-note {
    margin-top: 1rem;
    padding: .8rem .9rem;
    border-radius: .9rem;
    background: rgba(36, 86, 55, .08);
}

.submission-local-preview {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: .85rem;
    align-items: center;
    margin-bottom: .9rem;
    padding: .7rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 12px 30px rgba(88, 68, 12, .08);
}

.submission-local-preview img,
.submission-local-fallback {
    width: 92px;
    height: 92px;
    border-radius: .8rem;
    object-fit: cover;
}

.submission-local-fallback {
    display: grid;
    place-items: center;
    color: var(--green);
    background: rgba(36, 134, 70, .09);
    font-size: 2rem;
}

.submission-local-meta {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.submission-local-meta strong,
.submission-local-meta span,
.submission-local-meta small {
    overflow-wrap: anywhere;
}

.submission-local-meta span {
    color: var(--green-dark);
    font-size: .82rem;
    font-weight: 850;
}

.submission-local-meta small {
    color: #6c756f;
    line-height: 1.35;
}

.submission-local-empty {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    margin-bottom: .9rem;
    padding: .8rem;
    border-radius: 1rem;
    color: #5f654f;
    background: rgba(255, 255, 255, .68);
    font-size: .87rem;
    line-height: 1.45;
}

.submission-local-empty i {
    flex: 0 0 auto;
    color: var(--sun-dark);
    font-size: 1.35rem;
}

.submission-local-controls {
    display: flex;
    gap: .65rem;
    align-items: stretch;
}

.submission-file-picker,
.submission-save-button,
.submission-save-submit-button {
    flex: 1 1 0;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: 56px;
    min-height: 56px;
    padding: .7rem 1rem;
    line-height: 1.15;
    text-align: center;
}

.submission-save-submit-button {
    border-radius: 999px;
    font-weight: 900;
}

.submission-local-controls [hidden] {
    display: none !important;
}

.submission-save-button:disabled,
.submission-save-submit-button:disabled {
    cursor: not-allowed;
    filter: grayscale(.35);
    opacity: .5;
}

.submission-upload-progress {
    margin-top: .85rem;
}

.submission-upload-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .35rem;
    color: var(--green-dark);
    font-size: .8rem;
    font-weight: 850;
}

.submission-upload-progress progress {
    display: block;
    width: 100%;
    height: 9px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: rgba(36, 86, 55, .12);
}

.submission-upload-progress progress::-webkit-progress-bar {
    border-radius: 999px;
    background: rgba(36, 86, 55, .12);
}

.submission-upload-progress progress::-webkit-progress-value,
.submission-upload-progress progress::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sun), var(--green));
}

.submission-inline-error {
    margin-top: .8rem;
    padding: .72rem .8rem;
    border-radius: .85rem;
    color: #8e2525;
    background: rgba(190, 48, 48, .1);
    font-size: .86rem;
    font-weight: 800;
}

.submission-draft-form.is-uploading .submission-local-controls {
    opacity: .68;
}

.submission-draft-form.is-uploading .submission-file-picker {
    display: none;
}

@media (max-width: 991.98px) {
    .submission-workspace--split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .submission-server-panel,
    .submission-draft-form,
    .submission-score-panel {
        padding: .85rem;
        border-radius: 1.1rem;
    }

    .submission-panel-heading {
        align-items: center;
    }

    .submission-local-controls {
        flex-direction: column;
    }

    .submission-local-preview {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .submission-local-preview img,
    .submission-local-fallback {
        width: 76px;
        height: 76px;
    }
}
