/* #region Сброс и базовые стили */

:root {
    --font-base: 'Inter', sans-serif;
    --color-bg: #1a1a1a;
    --color-bg-panel: #1c1c1c;
    --color-surface: #262626;
    --color-border: #2d2d2d;
    --color-text: #ffffff;
    --color-text-muted: #aaa;
    --color-accent: #4778eb;
    --bg-gradient-main: linear-gradient(150deg, #1f1f1f, #161616, #1f1f1f, #1a1a1a);
    --space-page: 34px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--color-bg);
}

body {
    font-family: var(--font-base);
    background-color: var(--color-bg);
    background: url('../images/back.png'), var(--bg-gradient-main);
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    background-attachment: fixed;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.no-bg-image {
    background-image: none;
    background: var(--bg-gradient-main);
    background-attachment: fixed;
}

body.mobile-drag-active {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.new_back {
    background: url('../images/back2.png'), var(--bg-gradient-main);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.slim-back {
    background: url('../images/slim-back.png'), var(--bg-gradient-main);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}


/* #endregion */


/* #region Главная: modern minimal */

.index-page {
    background: url('../images/back.png'), var(--bg-gradient-main);
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    background-attachment: fixed;
}

.index-page .header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.index-page .app-header,
.index-page .new_block,
.index-page .block,
.index-page .achievement-item {
    background-color: var(--color-bg-panel);
    opacity: 1;
}


.index-page .card-filters {
    gap: 8px;
    margin-bottom: 14px;
}

.index-page .filter {
    background: #1f1f1f;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 7px 13px;
    color: #cfcfcf;
    text-decoration: none;
}

.index-page .filter:hover {
    background: #2a2a2a;
    color: #ffffff;
}

.index-page .filter.active {
    color: #d6e2ff;
    border-color: rgba(71, 120, 235, 0.65);
    background: rgba(71, 120, 235, 0.2);
    text-decoration: none;
}

.index-page .icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.index-page .icon-btn img {
    width: 22px;
    height: 22px;
}

/* #endregion */


/* #region Шапка (Header) */

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    height: 48px;
    position: relative;
    z-index: 30;
}

.burger-menu {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.burger-menu span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--color-text);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-backdrop {
    display: none;
}

body.nav-menu-open {
    /* CHECK: Might be used via JS */
    overflow: hidden;
}

.nav-items {
    display: flex;
    width: 100%;
    height: 100%;
    padding-left: var(--space-page);
    padding-right: var(--space-page);
}

.nav-items ul {
    width: 100%;
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-items li {
    font-size: 14px;
    cursor: pointer;
    position: relative;
    padding: 8px 24px;
    border-radius: 4px;
    color: #e6e6e6;
    text-decoration: none;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-items a {
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.nav-items li.active-nav-item {
    color: var(--color-text);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 17px;
}

.nav-items li:hover {
    color: var(--color-text);
}

.main-nav > ul > a > li,
.main-nav .nav-end.nav-items > a > li {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.main-nav > ul > a > li:hover,
.main-nav .nav-end.nav-items > a > li:hover {
    background-color: var(--color-border);
    color: var(--color-text);
}

.logout-btn a {
    color: rgb(170, 170, 170);
    text-decoration: none;
}

.logout-btn:hover a {
    background-color: transparent;
    color: var(--color-text);
    text-decoration: none;
}

.nav-mobile-only {
    display: none !important;
}

.nav-user-menu {
    display: flex;
    align-items: center;
    position: relative;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.nav-user-menu:hover {
    background-color: #2d2d2d;
}


.nav-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    border-radius: inherit;
    padding: 8px 10px;
    height: 100%;
    cursor: pointer;
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.nav-user-chevron {
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.78);
    transition: transform 0.2s ease;
}

.nav-user-menu.is-open .nav-user-chevron {
    /* CHECK: Might be used via JS */
    transform: rotate(180deg);
}

.nav-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 300px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #262626;
    overflow: visible;
    display: none;
    flex-direction: column;
    z-index: 60;
}

.nav-user-menu.is-open .nav-user-dropdown {
    /* CHECK: Might be used via JS */
    display: flex;
}

.nav-user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 14px 12px;
    gap: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-user-profile-avatar {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.nav-user-profile-name {
    color: #ffffff;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;
}

.nav-user-profile-username {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.nav-user-menu-list {
    display: flex;
    flex-direction: column;
    padding: 6px;
    gap: 4px;
}

.nav-user-dropdown .nav-user-item {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    border: 0;
    background: transparent;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.nav-user-dropdown .nav-user-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-theme-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.nav-theme-trigger {
    gap: 6px;
}

.nav-theme-label {
    font-weight: 500;
}

.nav-theme-current-value {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.64);
}

.nav-theme-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    top: 100%;
    right: 10px;
    width: 189px;
    margin: 0;
    padding: 8px;
    border-radius: 14px;
    border: 0;
    background: var(--color-surface);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
    z-index: 8;
}

.nav-user-menu.is-open .nav-theme-options {
    display: none;
}

.nav-theme-group.is-open .nav-theme-options {
    /* CHECK: Might be used via JS */
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-user-menu.is-open .nav-theme-group.is-open .nav-theme-options {
    display: flex;
}

.nav-theme-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}

.nav-theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-theme-option.is-active {
    color: #ffffff;
}

.nav-theme-option-label {
    flex: 1;
}

.nav-theme-check {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-theme-check-icon {
    width: 14px;
    height: 14px;
    display: block;
    color: var(--color-accent);
}

.nav-theme-option.is-active .nav-theme-check {
    opacity: 1;
    transform: scale(1);
}

.nav-settings-link {
    width: auto !important;
}

li.nav-settings-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* border-radius: 10px; */
    /* border: 1px solid rgba(255, 255, 255, 0.22); */
    /* background: rgba(255, 255, 255, 0.06); */
}

.nav-settings-icon {
    width: 18px;
    height: 18px;
}

.nav-settings-link:hover .nav-settings-btn {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.12);
}

.nav-settings-btn.is-active {
    color: #fff;
    border-color: rgba(71, 120, 235, 0.9);
    background: rgba(71, 120, 235, 0.24);
}


/* #endregion */


/* #region app-header */

.app-header {
    margin: var(--space-page);
    margin-bottom: 0;
    border-radius: 10px;
    display: flex;
    padding-left: var(--space-page);
    gap: 30px;
    border: 1px solid #2d2d2d;
}


/* #endregion */


/* #region Контейнер и сетка */

.container {
    padding-left: var(--space-page);
    padding-right: var(--space-page);
    width: 100%;
    margin: 32px auto;
    display: flex;
    gap: 24px;
}

/* Desktop: swipe-track is layout-transparent */
.swipe-track {
    display: contents;
}

/* Desktop column order (DOM: habits, tasks, stats — display: tasks, habits, stats) */
@media (min-width: 769px) {
    .swipe-track > .tasks  { order: 1; }
    .swipe-track > .habits { order: 2; }
    .swipe-track > .stats  { order: 3; }
}


/* #endregion */


/* #region Общие стили блоков */

.new_block {
    background: var(--color-bg-panel);
    /* border: 1px solid rgba(255, 255, 255, 0.1); */
    width: 33%;
    padding: 24px 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    border-radius: 4px;
    font-size: 17px;
    min-height: 100px;
    box-shadow: none;
    transition: box-shadow 0.2s;
}

.block {
    background: var(--color-bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    border-radius: 10px;
    font-size: 17px;
    min-height: 100px;
    box-shadow: none;
    transition: box-shadow 0.2s;
}

.block-head {
    padding: 24px 10px;
    width: 100%;
}

.block.card {
    position: relative;
    width: 33%;
}

.card-head {
    padding: 10px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.icon-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    color: var(--color-text);
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn img {
    width: 28px;
    height: 28px;
}


/* #endregion */


/* #region Профиль: аватар и никнейм */

.avatar-upload-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 12px;
    cursor: pointer;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    box-shadow: 0 0 0 2px #060606;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.avatar-upload-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.avatar-edit-icon {
    color: #ffffff;
    width: 32px;
    height: 32px;
}

.avatar {
    padding-left: 50px;
}

.nickname {
    font-size: 34px;
    font-weight: 600;
    color: var(--color-text);
    /* margin-bottom: 4px; */
}

.username {
    font-size: 16px;
    color: var(--color-text-muted);
}

.editable-field {
    position: relative;
    cursor: pointer;
    padding: 3px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.editable-field:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.field-edit-icon {
    opacity: 0;
    transition: opacity 0.2s ease;
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}

.editable-field:hover .field-edit-icon {
    opacity: 1;
}

.confirm-editing {
    padding: 20px;
}

.edit-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edit-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}


/* #endregion */


/* #region Рейтинг */

.rating-title {
    font-size: 20px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating {
    display: flex;
    justify-content: center;
}

.icon {
    width: 22px;
    height: 22px;
    vertical-align: middle;
}

.rating-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 8px;
}

.rating-bar {
    width: 30%;
    height: 8px;
    background: #2d2d2d;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.rating-bar-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 4px;
    transition: width 0.3s;
}

.league-inline-meta {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 2px;
}

.league-inline-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 0;
}

.league-open-link {
    color: #6b9fff;
    font-size: 14px;
    font-weight: 600;
}

.league-points-value {
    font-size: 34px;
    font-weight: 800;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: 0;
}

.league-card-inline {
    align-items: stretch;
    gap: 10px;
    text-align: left;
}

.league-inline-top {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.league-inline-head {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.league-inline-name-label {
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.league-name-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.league-points-row {
    width: 100%;
    border: 1px solid rgba(71, 120, 235, 0.4);
    border-radius: 10px;
    background: rgba(71, 120, 235, 0.12);
    padding: 8px 10px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}

.league-inline-points-label {
    font-size: 12px;
    color: rgba(209, 225, 255, 0.85);
}

.league-inline-meta-item {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.league-inline-meta-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.35px;
}

.league-inline-meta-item strong {
    font-size: 15px;
    color: #ffffff;
}


/* #endregion */


/* #region Достижения */

.section-title {
    font-size: 20px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.achievement-item {
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 10px;
}

.achievement-title {
    font-weight: 600;
    color: #4778eb;
}

.achievement-desc {
    font-size: 15px;
    color: #ccc;
    margin-left: 8px;
}


/* #endregion */


/* #region Стрик в статистике */

.stats {
    width: 33%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.stats-card-head {
    width: auto;
    padding-bottom: 0;

}

.habits-completion-card {
    padding: 18px 18px 14px;
    padding-top: 24px;
    /* margin-bottom: 16px; */
    /* background: linear-gradient(165deg, rgba(16, 20, 42, 0.82), rgba(12, 16, 30, 0.86)); */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 34px rgba(0, 0, 0, 0.24);
}

.habits-completion-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
}

.habits-completion-head .section-title {
    min-width: 0;
}

.habits-completion-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    flex: 0 1 auto;
    max-width: min(100%, 260px);
}

.habits-completion-badge-title {
    font-size: 13px;
    color: rgba(214, 223, 245, 0.85);
    white-space: nowrap;
}

.habits-completion-badge-value {
    font-size: 35px;
    font-weight: 800;
    color: #6da2ff;
    line-height: 1;
}

.habits-completion-badge-meta {
    font-size: 11px;
    color: rgba(192, 205, 230, 0.82);
    line-height: 1.25;
    text-align: right;
}

.habits-completion-chart-wrap {
    width: 100%;
    overflow: hidden;
}

.habits-completion-chart {
    width: 100%;
    min-width: 0;
    height: clamp(136px, 24vw, 220px);
    display: block;
}

.habits-completion-grid line {
    stroke: rgba(154, 180, 235, 0.14);
    stroke-width: 1;
}

.habits-completion-area {
    fill: url(#habitsCompletionAreaGradient);
}

.habits-completion-line {
    fill: none;
    stroke: #5f93ff;
    stroke-width: 4;
    filter: drop-shadow(0 0 8px rgba(95, 147, 255, 0.35));
}

.habits-completion-point {
    fill: #5f93ff;
    stroke: rgba(218, 232, 255, 0.8);
    stroke-width: 2;
    filter: drop-shadow(0 0 10px rgba(95, 147, 255, 0.5));
}

.habits-completion-x-labels {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(2px, 0.8vw, 8px);
    margin-top: 6px;
    padding: 0 3px;
    min-width: 0;
}

.habits-completion-x-label {
    text-align: center;
    font-size: clamp(11px, 1.3vw, 17px);
    font-weight: 500;
    color: rgba(214, 223, 245, 0.66);
}


.stats-streak-header {
    padding: 20px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-streak-title {
    font-size: 18px;
    font-weight: 700;
    color: #f2f6ff;
    margin-bottom: 8px;
    line-height: 1.1;
}

.stats-streak-text {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #ffffff;
    font-weight: 600;
    font-size: 40px;
    line-height: 1;
}

#stats-streak-value {
    font-size: clamp(40px, 6vw, 58px);
    font-weight: 800;
    letter-spacing: -0.5px;
}

#stats-streak-word {
    font-size: clamp(22px, 3.2vw, 32px);
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.2px;
}

.stats-streak-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(2px, 0.8vw, 8px);
    padding: 16px clamp(8px, 1.6vw, 16px) 14px;
}

.stats-streak-day-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(4px, 0.7vw, 8px);
    min-width: 0;
}

.stats-streak-day-icon {
    width: 100%;
    height: clamp(34px, 5vw, 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(20px, 3.8vw, 50px);
    line-height: 1;
}

.stats-streak-day-item.is-active .stats-streak-day-icon {
    filter: drop-shadow(0 0 10px rgba(255, 142, 46, 0.5));
}

.stats-streak-day-dot {
    width: clamp(16px, 2.7vw, 34px);
    height: clamp(16px, 2.7vw, 34px);
    max-width: 100%;
    max-height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.stats-streak-day-label {
    font-size: 17px;
    font-weight: 500;
    color: rgba(214, 223, 245, 0.66);
}

.stats-streak-day-item.is-active .stats-streak-day-label {
    color: rgba(255, 236, 214, 0.95);
}

.stats-streak-best {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 20px 16px;
    color: rgba(216, 224, 242, 0.68);
    font-size: 18px;
    line-height: 1.2;
}

.stats-streak-best strong {
    color: #ffffff;
    font-weight: 800;
}

@media (max-width: 900px) {
    .habits-completion-card {
        padding: 14px 12px 12px;
    }

    .habits-completion-head {
        margin-bottom: 8px;
    }

    .habits-completion-badge {
        border-radius: 10px;
        padding: 7px 10px;
    }

    .habits-completion-badge-title {
        font-size: 12px;
    }

    .habits-completion-badge-value {
        font-size: 28px;
    }

    .habits-completion-chart {
        height: clamp(132px, 23vw, 170px);
    }

    .habits-completion-x-label {
        font-size: 14px;
    }

    .stats-streak-header {
        padding: 16px 14px 12px;
    }

    .stats-streak-title {
        font-size: 17px;
    }

    .stats-streak-week {
        padding: 14px 10px 10px;
        gap: 4px;
    }

    .stats-streak-day-label {
        font-size: 14px;
    }

    .stats-streak-best {
        padding: 10px 14px 12px;
        font-size: 18px;
    }
}

@media (max-width: 640px) {
    .stats {
        width: 100%;
    }

    .habits-completion-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .habits-completion-badge {
        align-items: flex-start;
        max-width: 100%;
    }

    .habits-completion-badge-title {
        white-space: normal;
    }

    .habits-completion-badge-meta {
        text-align: left;
    }

    .habits-completion-chart {
        height: clamp(126px, 29vw, 150px);
    }

    .habits-completion-x-label {
        font-size: 13px;
    }

    .stats-streak-card {
        border-radius: 12px;
    }

    .stats-streak-text {
        gap: 6px;
    }

    #stats-streak-value {
        font-size: clamp(32px, 11vw, 44px);
    }

    #stats-streak-word {
        font-size: clamp(18px, 6vw, 26px);
    }

    .stats-streak-week {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 12px 10px 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .stats-streak-day-item {
        min-width: 44px;
        flex: 0 0 44px;
        gap: 6px;
    }

    .stats-streak-day-icon {
        height: 42px;
        font-size: 30px;
    }

    .stats-streak-day-dot {
        width: 26px;
        height: 26px;
    }

    .stats-streak-day-label {
        font-size: 13px;
    }

    .stats-streak-best {
        font-size: 16px;
    }
}

@media (max-width: 420px) {
    .habits-completion-card {
        padding: 12px 8px 10px;
    }

    .habits-completion-badge {
        padding: 7px 8px;
    }

    .habits-completion-badge-title {
        font-size: 11px;
    }

    .habits-completion-badge-value {
        font-size: 24px;
    }

    .habits-completion-chart {
        height: 132px;
    }

    .habits-completion-x-label {
        font-size: 12px;
    }

    .stats-streak-header {
        padding: 12px 10px 10px;
    }

    .stats-streak-title {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .stats-streak-week {
        padding-left: 8px;
        padding-right: 8px;
    }

    .stats-streak-day-item {
        min-width: 40px;
        flex-basis: 40px;
    }

    .stats-streak-day-icon {
        height: 36px;
        font-size: 26px;
    }

    .stats-streak-day-label {
        font-size: 12px;
    }

    .stats-streak-best {
        padding: 9px 10px 10px;
        font-size: 15px;
    }
}


/* #endregion */


/* #region Задачи и привычки (общие стили) */

.tasks-list,
.habits-list {
    list-style: none;
    width: 100%;
    padding: 0;
    margin: 0;
    margin-bottom: 5px;
}

.task-item,
.habit-item {

    background: #1c1c1c;
    /* border: 1px solid #2d2d2d; */
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 2px;

    border: 1px solid #2d2d2d;
    border-radius: 10px;
    margin-bottom: 10px;
    -webkit-user-select: none;
    user-select: none;

}

.task-item {
    cursor: grab;
}

.habit-item {
    cursor: grab;
}

.task-item:active {
    cursor: grabbing;
}

.task-item.is-dragging-task {
    /* CHECK: Might be used via JS */
    opacity: 0.55;
    border-color: rgba(71, 120, 235, 0.7);
    background: #232a3c;
}

.habit-item.is-dragging-habit {
    /* CHECK: Might be used via JS */
    opacity: 0.55;
    border-color: rgba(71, 120, 235, 0.7);
    background: #232a3c;
}

@media (hover: none) and (pointer: coarse) {
    .task-item,
    .habit-item {
        position: relative;
        overflow: hidden;
    }

    .task-item.is-touch-drag-arming,
    .habit-item.is-touch-drag-arming {
        /* CHECK: Might be used via JS */
        border-color: rgba(95, 140, 230, 0.78);
        box-shadow: 0 0 0 1px rgba(95, 140, 230, 0.32);
        -webkit-touch-callout: none;
        user-select: none;
    }

    .task-item.is-touch-drag-arming::before,
    .habit-item.is-touch-drag-arming::before {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        height: 3px;
        width: 100%;
        transform-origin: left center;
        transform: scaleX(0);
        background: linear-gradient(90deg, #6f9eff, #8db4ff);
        animation: touchDragHoldProgress 260ms linear forwards;
        z-index: 2;
    }

    .task-item.is-touch-drag-ready,
    .habit-item.is-touch-drag-ready {
        /* CHECK: Might be used via JS */
        border-color: rgba(111, 158, 255, 0.95);
        box-shadow: 0 0 0 2px rgba(111, 158, 255, 0.35);
        -webkit-touch-callout: none;
        user-select: none;
    }

}

@keyframes touchDragHoldProgress {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

.tasks ul.tasks-list.drag-over {
    /* CHECK: Might be used via JS */
    border: 1px dashed rgba(71, 120, 235, 0.65);
    border-radius: 10px;
    background: rgba(71, 120, 235, 0.08);
}

.habits ul.habits-list.drag-over {
    /* CHECK: Might be used via JS */
    border: 1px dashed rgba(71, 120, 235, 0.65);
    border-radius: 10px;
    background: rgba(71, 120, 235, 0.08);
}

.task-item:hover,
.habit-item:hover {
    background: #2d2d2d;
}

.task-wrapper,
.habit-wrapper {
    display: flex;
    align-items: stretch;
    padding: 12px;
    gap: 12px;
}

.task-left-control,
.habit-left-control {
    display: flex;
    align-items: center;
    align-self: stretch;
}


.task-content,
.habit-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.task-edit-trigger {
    padding: 2px 2px 4px;
    border-radius: 8px;
    transition: background 0.18s ease;
}


.task-title,
.habit-title {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    margin: 0 0 6px 0;
    line-height: 1.4;
    word-break: break-word;
}

.task-notes,
.habit-notes {
    font-size: 13px;
    color: #aaa;
    margin: 6px 0;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.task-meta,
.habit-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.task-subtasks-preview {
    margin-top: 16px;
    margin-bottom: 20px;
    /* border: 1px solid rgba(71, 120, 235, 0.35); */
    /* background: linear-gradient(180deg, rgba(37, 43, 56, 0.82), rgba(30, 34, 44, 0.92)); */
    /* border-radius: 10px; */
    /* padding: 8px 10px; */
}

.task-subtasks-head {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 6px;
}


.task-subtasks-progress {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #d9e5ff;
    background: rgba(71, 120, 235, 0.22);
    border: 1px solid rgba(71, 120, 235, 0.45);
    border-radius: 999px;
    padding: 2px 8px;
}

.task-subtasks-progress-icon {
    line-height: 1;
    opacity: 0.95;
}

.task-subtasks-progress-count {
    line-height: 1;
}

.task-subtasks-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-subtask-item {
    min-height: 32px;
    display: flex;
    align-items: flex-start;
    color: #e6eaf3;
    font-size: 13px;
}

.task-subtask-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    min-width: 0;
    position: relative;
}

.task-subtask-checkbox {
    position: absolute;
    opacity: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.task-subtask-checkmark {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin-top: 1px;
    cursor: pointer;
}

.task-subtask-checkbox:focus-visible ~ .task-subtask-checkmark {
    box-shadow: 0 0 0 2px rgba(71, 120, 235, 0.35);
}

.task-subtask-title {
    display: block;
    flex: 1;
    color: #d9dee8;
    line-height: 1.3;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.task-subtask-completed {
    text-decoration: line-through;
    opacity: 0.65;
}

.task-actions,
.habit-actions {
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-item:hover .task-actions,
.habit-item:hover .habit-actions {
    opacity: 1;
}

.task-menu-btn,
.habit-menu-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-menu-btn:hover,
.habit-menu-btn:hover {
    background: #2d2d2d;
}

.habit-inactive {
    background: #1d1d1d !important;
    color: #666 !important;
    opacity: 0.7;
    cursor: not-allowed;
}


/* #endregion */


/* #region Специфичные стили задач и привычек */

.tasks,
.habits {
    min-height: 200px;
    align-items: flex-start;
}

.tasks {
    grid-area: tasks;
}

.task-difficulty,
.habit-difficulty,
.task-deadline,
.habit-streak-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #2d2d2d;
    color: #bbb;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: brightness(0) invert(1);
}

.task-difficulty-trivial,
.habit-difficulty-trivial {
    background: #2a5c2a;
    color: #aaffaa;
}

.task-difficulty-easy,
.habit-difficulty-easy {
    background: #2a4a5c;
    color: #aaffff;
}

.task-difficulty-medium,
.habit-difficulty-medium {
    background: #5c4a2a;
    color: #ffffaa;
}

.task-difficulty-hard,
.habit-difficulty-hard {
    background: #5c2a3a;
    color: #ffaaff;
}


/* #endregion */


/* #region Селектор дней недели */

.days-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.day-toggle {
    width: 40px;
    height: 40px;
    border: 2px solid #2d2d2d;
    border-radius: 8px;
    background: #1d1d1d;
    color: #ddd;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
}

.day-toggle:hover {
    border-color: #4778eb;
    background: #2d2d2d;
}

.day-toggle.active {
    background: #4778eb;
    border-color: #4778eb;
    color: white;
}

.day-toggle:focus-visible {
    outline: 2px solid #4778eb;
    outline-offset: 2px;
}


/* #endregion */


/* #region Кнопки и элементы управления */

.btn-delete {
    width: 100%;
    background: #1d1d1d;
    color: #dc3545;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-delete svg {
    display: block;
}

.btn-delete svg path {
    fill: currentColor;
    transition: fill 0.2s ease;
}

.btn-delete:hover {
    background: #dc3545;
    color: #fff;
}


/* #endregion */


/* #region Чекбокс (кастомный) */

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 45px;
    margin-top: 0;
    cursor: pointer;

}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark,
.task-subtask-checkmark {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #262626;
    border: 2px solid #4778eb;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.checkmark-icon {
    width: 12px;
    height: 12px;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 34px;
    width: 34px;
}

.task-subtask-checkmark {
    position: relative;
    left: auto;
}

.task-subtask-checkmark .checkmark-icon {
    width: 10px;
    height: 10px;
}


.checkbox-container input:checked~.checkmark,
.task-subtask-checkbox:checked~.task-subtask-checkmark {
    background-color: #4778eb;
}

.checkbox-container input:checked~.checkmark .checkmark-icon,
.task-subtask-checkbox:checked~.task-subtask-checkmark .checkmark-icon {
    opacity: 1;
    transform: scale(1);
}


/* #endregion */


/* #region Фильтры */

.card-filters {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: start;
    align-items: start;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.filter {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    color: #bbb;
}

.filter:hover {
    background-color: #2d2d2d;
    color: #fff;
}

.filter.active {
    color: #4778eb;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 10px;
    text-decoration-thickness: 2px;
}

.filter:focus {
    outline: 2px solid #4778eb;
    outline-offset: 2px;
}


/* #endregion */


/* #region Подвал (Footer) */

.footer {
    display: flex;
    justify-content: end;
    margin-top: auto;
    background: transparent;
    color: #fff;
    text-align: center;
    padding: 7px 0;
    padding-right: 34px;
    font-size: 14px;
    letter-spacing: 1px;
}

.mobile-bottom-nav {
    display: none;
}

/* ── Rewards card ── */
.rewards-card {
    width: 100%;
    background-color: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 16px;
}

.rewards-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 16px;
    opacity: 0.5;
}

.rewards-empty-icon {
    font-size: 48px;
}

.rewards-empty p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Mobile-only rating panel (hidden on desktop, shown via mobile-panel toggle) */
.mobile-rating-panel {
    display: none;
}

.mobile-rating-card {
    background-color: var(--color-bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mobile-rating-card .rating-value {
    text-align: center;
}

.mobile-rating-card .rating-bar {
    width: 100%;
}

/* ── FAB picker popup ── */
.fab-picker-backdrop {
    display: none;
}

.fab-picker {
    display: none;
}

@media (max-width: 768px) {
    body.index-page .app-header {
        display: none !important;
    }

    body.index-page {
        padding-bottom: 0;
        overflow: hidden;
        overscroll-behavior-x: none;
        touch-action: pan-y pinch-zoom;
    }

    /* ── Bottom nav bar ── */
    body.index-page .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 35;
        display: grid;
        grid-template-columns: 1fr 1fr 56px 1fr 1fr;
        align-items: end;
        padding: 0 0 env(safe-area-inset-bottom);
        background: rgba(26, 26, 26, 0.97);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(12px);
        transition: opacity 0.2s ease;
    }

    body.nav-menu-open.index-page .mobile-bottom-nav {
        opacity: 0.3;
        pointer-events: none;
    }

    /* ── Nav buttons ── */
    body.index-page .mobile-bottom-nav-btn {
        border: none;
        background: transparent;
        border-radius: 0;
        padding: 8px 4px 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 52px;
        cursor: pointer;
    }

    body.index-page .mobile-bottom-nav-icon {
        width: 22px;
        height: 22px;
        stroke: rgba(255, 255, 255, 0.4);
        transition: stroke 0.2s ease;
    }

    body.index-page .mobile-bottom-nav-btn.is-active .mobile-bottom-nav-icon {
        stroke: #4778eb;
    }

    body.index-page .mobile-bottom-nav-label {
        font-size: 10px;
        letter-spacing: 0.3px;
        color: rgba(255, 255, 255, 0.4);
        transition: color 0.2s ease;
    }

    body.index-page .mobile-bottom-nav-btn.is-active .mobile-bottom-nav-label {
        color: #4778eb;
    }

    /* ── FAB center button ── */
    .mobile-bottom-nav-fab-spacer {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    body.index-page .mobile-bottom-nav-fab {
        position: absolute;
        bottom: 8px;
        width: 52px;
        height: 52px;
        border-radius: 16px;
        border: none;
        background: #2fbd59;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 16px rgba(47, 189, 89, 0.35);
        cursor: pointer;
        transition: transform 0.25s ease, background 0.2s ease;
        z-index: 36;
    }

    body.index-page .mobile-bottom-nav-fab:active {
        transform: scale(0.92);
    }

    body.index-page .mobile-bottom-nav-fab.is-open {
        transform: rotate(45deg);
        background: #e05252;
        box-shadow: 0 4px 16px rgba(224, 82, 82, 0.35);
    }

    /* ── FAB picker popup ── */
    body.index-page .fab-picker-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 34;
        background: rgba(0, 0, 0, 0.4);
    }

    body.index-page .fab-picker {
        display: flex;
        flex-direction: column;
        gap: 8px;
        position: fixed;
        bottom: calc(72px + env(safe-area-inset-bottom) + 8px);
        left: 50%;
        transform: translateX(-50%);
        z-index: 37;
        animation: fabPickerIn 0.18s ease;
    }

    @keyframes fabPickerIn {
        from { opacity: 0; transform: translateX(-50%) translateY(12px); }
        to   { opacity: 1; transform: translateX(-50%) translateY(0); }
    }

    body.index-page .fab-picker-btn {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 24px;
        border: none;
        border-radius: 14px;
        background: rgba(40, 42, 48, 0.97);
        color: #fff;
        font-size: 15px;
        font-weight: 500;
        white-space: nowrap;
        cursor: pointer;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(8px);
        transition: background 0.15s ease;
    }

    body.index-page .fab-picker-btn:active {
        background: rgba(60, 64, 72, 0.97);
    }

    body.index-page .fab-picker-btn svg {
        stroke: #4778eb;
        flex-shrink: 0;
    }

    /* ── Swipe carousel ── */
    body.index-page .container {
        overflow: hidden;
        padding: 0;
        margin: 0;
        gap: 0;
        flex-direction: row;
        height: 100dvh;
        height: calc(100vh - 72px - env(safe-area-inset-bottom));
        overscroll-behavior-x: none;
        touch-action: pan-y pinch-zoom;
    }

    body.index-page .swipe-track {
        display: flex !important;
        flex-direction: row;
        flex-wrap: nowrap;
        width: 100%;
        height: 100%;
        will-change: transform;
        touch-action: pan-y pinch-zoom;
    }

    body.index-page .swipe-track > [data-mobile-panel] {
        flex: none;
        width: 100vw;
        min-width: 0;
        height: 100%;
        box-sizing: border-box;
        padding: 16px;
        display: block !important;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    body.index-page .swipe-track > [data-mobile-panel="stats"] {
        display: flex !important;
        flex-direction: column;
        gap: 16px;
    }

    body.index-page .swipe-track > [data-mobile-panel="rating"] {
        display: flex !important;
        flex-direction: column;
        gap: 16px;
    }

    /* Mobile rating panel — always visible inside swipe track */
    body.index-page .swipe-track .mobile-rating-panel {
        display: flex !important;
    }
}

/* ── Light theme overrides ── */
@media (max-width: 768px) {
    body.light-theme.index-page .mobile-bottom-nav {
        background: rgba(236, 238, 242, 0.97);
        border-top-color: rgba(173, 184, 202, 0.5);
    }

    body.light-theme.index-page .mobile-bottom-nav-icon {
        stroke: rgba(40, 50, 70, 0.4);
    }

    body.light-theme.index-page .mobile-bottom-nav-btn.is-active .mobile-bottom-nav-icon {
        stroke: #4778eb;
    }

    body.light-theme.index-page .mobile-bottom-nav-label {
        color: rgba(40, 50, 70, 0.45);
    }

    body.light-theme.index-page .mobile-bottom-nav-btn.is-active .mobile-bottom-nav-label {
        color: #4778eb;
    }

    body.light-theme .rewards-empty p {
        color: rgba(30, 40, 60, 0.5);
    }

    body.light-theme .mobile-rating-card {
        background: #ffffff;
        border-color: #dce1e6;
    }

    body.light-theme.index-page .fab-picker-btn {
        background: rgba(236, 238, 242, 0.97);
        color: #1e2028;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    }

    body.light-theme.index-page .fab-picker-btn:active {
        background: rgba(220, 224, 232, 0.97);
    }
}


/* #endregion */


/* #region Модальные окна */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(36, 38, 42, 0.8);
    z-index: 1000;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1d1d1d;
    border-radius: 12px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3), 0 10px 10px rgba(0, 0, 0, 0.3);
    z-index: 1010;
    min-width: 500px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: inherit;
    min-height: 0;
}

.modal-header {
    background: #3a60b8;
    color: #fff;
    padding: 24px 28px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2d2d2d;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.modal-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.modal-body {
    padding: 28px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.field-edit-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: -8px;
    padding: 8px 12px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.25);
}

.guest-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-surface, #1e1e2e);
    color: var(--color-text, #fff);
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-accent, #7c5cfc);
    z-index: 10000;
    animation: toastIn 0.3s ease;
    pointer-events: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.subtasks-list {
    border: 1px solid rgba(118, 111, 132, 0.45);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(37, 43, 56, 0.82), rgba(30, 34, 44, 0.92));
    padding: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.subtasks-list:empty {
    display: none;
}

.subtasks-list:empty + .subtask-add-btn {
    margin-top: 0;
}

.subtasks-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.subtasks-group-hint {
    font-size: 11px;
    color: #9aa6bf;
}

.subtask-row {
    display: grid;
    grid-template-columns: 16px 20px 1fr 28px;
    gap: 10px;
    align-items: center;
    padding: 8px 6px;
    border-bottom: 1px solid rgba(86, 98, 122, 0.28);
}

.subtask-row.is-dragging-subtask,
.subtask-edit-row.is-dragging-subtask {
    /* CHECK: Might be used via JS */
    opacity: 0.6;
    border-radius: 8px;
    background: rgba(88, 121, 182, 0.12);
}

.subtasks-list.is-subtask-drag-over {
    /* CHECK: Might be used via JS */
    border-color: rgba(103, 142, 220, 0.72);
}

.subtask-drag-handle {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    border: none;
    background: transparent;
    color: #8fa4ce;
    cursor: grab;
    padding: 0;
    line-height: 1;
    touch-action: none;
}

.subtask-drag-handle:active {
    cursor: grabbing;
}

.subtask-drag-handle:focus-visible {
    outline: 2px solid rgba(103, 142, 220, 0.85);
    outline-offset: 2px;
    border-radius: 4px;
}

.subtask-drag-icon {
    width: 12px;
    height: 12px;
    display: block;
    opacity: 0.92;
}

.subtask-checkbox {
    align-self: center;
}

.subtask-row:last-child {
    border-bottom: none;
}

.subtask-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    display: block;
    accent-color: #4778eb;
}

.subtask-input {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(86, 103, 139, 0.45);
    border-radius: 8px;
    color: #eef2fb;
    font-size: 14px;
    padding: 6px 8px;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.subtask-input:focus {
    border-color: #4778eb;
    background: rgba(255, 255, 255, 0.04);
}

.subtask-remove-btn {
    background: transparent;
    border: none;
    color: #97a8cf;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
}

.subtask-remove-btn:hover {
    color: #e7efff;
}

.subtask-add-btn {
    margin-top: 10px;
    background: rgba(71, 120, 235, 0.14);
    border: 1px dashed rgba(71, 120, 235, 0.55);
    border-radius: 9px;
    color: #d3e2ff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 10px;
    width: 100%;
    text-align: left;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.subtask-add-btn:hover {
    background: rgba(71, 120, 235, 0.22);
    border-color: rgba(117, 153, 241, 0.8);
}

.form-input::placeholder {
    color: #777;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

select.form-input {
    cursor: pointer;
    background: #1d1d1d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23fff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 12px;
    padding-right: 40px;
    appearance: none;
    color: #fff;
}

.modal-btn {
    background: #1d1d1d;
    color: #4778eb;
    border: 2px solid #4778eb;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.modal-btn:hover {
    background: #4778eb;
    color: #fff;
    transform: translateY(-1px);
}

.modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-btn-secondary {
    background: transparent;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}


/* #endregion */


/* #region Авторизация */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh);
    height: 100%;
    width: 100%;
    padding: 32px 0;
}

.auth-card {
    background-color: rgb(38, 38, 38);
    border-radius: 10px;
    padding: 40px;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px 0px;
    max-width: 400px;
    width: 100%;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 32px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    height: 35px;
    padding: 5px 16px;
    border-radius: 5px;
    border: 1px solid rgba(230, 230, 230, 0.2);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
    background-color: transparent;
    color: #fff;
}

.form-input option {
    background-color: #2a2a2a;
    color: #ffffff;
}

.floating-input {
    position: relative;
}

.floating-label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    pointer-events: none;
    color: #aaa;
    font-size: 14px;
    transition: 0.2s ease;
    background-color: #262626;
    padding: 2px 5px;
}

.form-input:focus+.floating-label,
.form-input:not(:placeholder-shown)+.floating-label {
    font-weight: normal;
    top: -10px;
    left: 12px;
    transform: translateY(0);
    font-size: 10px;
    color: #fff;
}

.form-input:focus+.floating-label {
    color: #4778eb;
}

.form-input:focus {
    outline: none;
    border-color: #4778eb;
    background-color: transparent;
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #2a2a2a inset !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

.auth-btn {
    width: 100%;
    background: #4778eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 24px;
}

.auth-btn:hover {
    background: #4778eb;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.auth-link a {
    color: #4778eb;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

body.light-theme .auth-card {
    background: #ffffff;
    border: 1px solid #dce1e6;
    box-shadow: 0 8px 26px rgba(30, 51, 82, 0.12);
}

body.light-theme .auth-title {
    color: #1f2d3d;
}

body.light-theme .auth-link {
    color: #6f8198;
}

body.light-theme .auth-link a {
    color: #3f6ea0;
}

body.light-theme .auth-note {
    background: rgba(74, 118, 168, 0.12);
    border-color: rgba(74, 118, 168, 0.45);
    color: #3b5677;
}

.auth-note {
    background: rgba(71, 120, 235, 0.12);
    border: 1px solid rgba(71, 120, 235, 0.4);
    color: #cdd8ff;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 18px;
}

.error-message {
    background: #ffe0e0;
    color: #d00;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.field-error {
    color: #ff4444;
    font-size: 13px;
    margin-top: 6px;
    display: none;
    animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-input.input-error {
    border-color: #ff4444;
}

.form-input.input-error:focus {
    border-color: #ff4444;
}


/* #endregion */


/* #region Страница "О нас" */

.about-container {
    max-width: 1422px;
    margin: 40px auto;
    padding: 0 20px;
}

.about-hero {
    animation: aboutHeroIn 0.8s ease both;
}

.about-logo img {
    animation: aboutLogoFloat 4s ease-in-out infinite;
}

.about-logo {
    margin-bottom: 24px;
}

.about-logo img {
    width: 120px;
    /* height: 120px; */
}

.about-title {
    text-transform: uppercase;
    font-size: 120px;
    font-weight: 400;
    color: #fff;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff, #a6c8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-subtitle {
    font-size: 40px;
    color: #aaa;
    font-weight: 400;
}

.section-heading {
    text-align: center;
    font-size: 40px;
    font-weight: 600;
    color: #fff;
    /* margin-bottom: 4px; */
    padding-bottom: 12px;
    /* border-bottom: 2px solid #4778eb; */
}

.section-out-heading {
    text-align: center;
    font-size: 40px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    padding-bottom: 12px;
}

.section-out-heading {
    animation: aboutFadeUp 0.7s ease both;
    animation-delay: 0.15s;
}

.about-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.about-reveal.is-visible {
    /* CHECK: Might be used via JS */
    opacity: 1;
    transform: translateY(0);
}

.nav-end {
    display: flex;
    justify-content: flex-end;
    padding: 0;
}

.about-text {
    font-size: 20px;
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 16px;
}

.about-text strong {
    color: #fff;
    font-weight: 600;
}

.features-grid {
    display: flex;
    gap: 32px;
    margin-top: 32px;
    justify-content: center;
    align-items: stretch;
}

@media (max-width: 900px) {
    .features-grid,
    .custom-features-grid {
        flex-direction: column;
        gap: 18px;
    }
    .features-col {
        flex-direction: row;
        gap: 18px;
        justify-content: center;
    }
    .feature-item {
        min-width: 220px;
        max-width: 320px;
        margin: 0 auto;
        padding: 18px;
    }
    .feature-title {
        font-size: 20px;
    }
    .feature-desc {
        font-size: 15px;
    }
    .feature-icon img {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 600px) {
    .features-grid,
    .custom-features-grid {
        flex-direction: column;
        gap: 12px;
    }
    .features-col {
        flex-direction: column;
        gap: 12px;
    }
    .feature-item {
        min-width: 0;
        max-width: 100%;
        padding: 12px;
    }
    .feature-title {
        font-size: 16px;
    }
    .feature-desc {
        font-size: 13px;
    }
    .feature-icon img {
        width: 28px;
        height: 28px;
    }
    .about-title {
        font-size: 28px;
    }
    .about-subtitle {
        font-size: 14px;
    }
    .about-logo img {
        width: 60px;
    }
    .about-section {
        padding: 14px;
    }
    .section-heading {
        font-size: 18px;
    }
    .section-out-heading {
        font-size: 18px;
    }
    .about-text {
        font-size: 14px;
    }
    .team-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .team-member {
        padding: 12px;
    }
    .member-photo {
        height: 120px;
        margin-bottom: 10px;
    }
    .member-name {
        font-size: 16px;
    }
    .member-role {
        font-size: 10px;
        padding: 4px 8px;
    }
    .member-username {
        font-size: 12px;
    }
    .member-description {
        font-size: 12px;
        margin-bottom: 8px;
    }
    .contact-badge {
        font-size: 10px;
        padding: 4px 8px;
        gap: 4px;
    }
    .contact-badge svg {
        width: 12px;
        height: 12px;
    }
}

.custom-features-grid {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.features-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex: 1 1 0;
}

.feature-item {
    background-color: rgba(150, 150, 150, 0.25);
    border: 2px solid rgba(150, 150, 150, 0.3);
    padding: 24px;
    border-radius: 12px;
    transition: transform 0.2s ease, background 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.feature-item,
.tech-category,
.team-member {
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
    background: rgba(150, 150, 150, 0.3);
}

.feature-header {
    display: flex;
    width: 100%;
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature-title {
    word-break: normal;
    font-size: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    vertical-align: center;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.feature-desc {
    font-size: 20px;
    line-height: 1.6;
    color: #cecece;
}

.tech-stack {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-top: 32px;
}

.tech-category {
    background-color: rgba(150, 150, 150, 0.25);
    border: 2px solid rgba(150, 150, 150, 0.3);
    padding: 24px;
    border-radius: 12px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.tech-category:hover {
    transform: translateY(-4px);
    background: rgba(150, 150, 150, 0.3);
}

.tech-category-title {
    font-size: 30px;
    font-weight: 600;
    color: #4778eb;
    margin-bottom: 16px;
}

.tech-list {
    list-style: none;
    padding: 0;
}

.tech-list li {
    font-size: 20px;
    color: #ccc;
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.tech-list li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #4778eb;
    font-weight: bold;
}

.contact-info {
    margin-top: 20px;
    font-size: 16px;
    line-height: 2;
}

.contact-info p {
    color: #ccc;
}

.contact-link {
    color: #4778eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-link:hover {
    color: #6b9fff;
    text-decoration: underline;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.team-member {
    background: rgba(255, 255, 255, 0.03);
    padding: 28px;
    border-radius: 12px;
    border: 1px solid rgba(71, 120, 235, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}


/* 
.team-member::before {
  content: '';
  position: absolute;
  top: 0;https://i.imgur.com/7G9dF0B.png
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4778eb, #6b9fff);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
} */

.team-member:hover {
    border-color: rgba(71, 120, 235, 0.5);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(71, 120, 235, 0.15);
}

.team-member:hover::before {
    transform: scaleX(1);
}

.member-photo {
    width: 100%;
    height: 280px;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(71, 120, 235, 0.1) 0%, rgba(139, 69, 255, 0.1) 100%);
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.team-member:hover .member-photo img {
    transform: scale(1.05);
}

.member-role {
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    color: #4778eb;
    background: rgba(71, 120, 235, 0.15);
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.member-name {
    font-size: 30px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.member-username {
    font-size: 23px;
    color: #4778eb;
    margin-bottom: 16px;
    font-weight: 500;
}

.member-description {
    font-size: 20px;
    line-height: 1.7;
    color: #bbb;
    margin-bottom: 16px;
}

.member-contacts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.contact-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-badge:hover {
    transform: translateY(-2px);
}

@keyframes aboutFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes aboutHeroIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes aboutLogoFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .about-hero,
    .about-logo img,
    .section-out-heading,
    .about-reveal,
    .feature-item,
    .tech-category,
    .team-member,
    .contact-badge {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .about-reveal {
        opacity: 1;
    }
}

.contact-badge svg {
    flex-shrink: 0;
}

.contact-badge.tg {
    background: linear-gradient(135deg, rgba(42, 171, 238, 0.1) 0%, rgba(42, 171, 238, 0.05) 100%);
    color: #2aabee;
    border-color: rgba(42, 171, 238, 0.2);
}

.contact-badge.tg:hover {
    background: linear-gradient(135deg, rgba(42, 171, 238, 0.2) 0%, rgba(42, 171, 238, 0.1) 100%);
    border-color: rgba(42, 171, 238, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 171, 238, 0.2);
}

.contact-badge.vk {
    background: linear-gradient(135deg, rgba(0, 119, 255, 0.1) 0%, rgba(0, 119, 255, 0.05) 100%);
    color: #0077ff;
    border-color: rgba(0, 119, 255, 0.2);
}

.contact-badge.vk:hover {
    background: linear-gradient(135deg, rgba(0, 119, 255, 0.2) 0%, rgba(0, 119, 255, 0.1) 100%);
    border-color: rgba(0, 119, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 119, 255, 0.2);
}

.contact-badge.github {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.contact-badge.github:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.contact-badge.portfolio {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.contact-badge.portfolio:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}


/* #endregion */

.dark-borders {
    border: 2px solid #282828;
}


/* #region Адаптивность */

@media (max-width: 1048px) {
    .card-filters {
        gap: 8px;
        justify-content: flex-start;
    }
    .filter {
        padding-right: 3px;
        padding-left: 3px;
    }
}

@media (max-width: 768px) {
    .header {
        z-index: 60;
    }

    .header {
        height: 56px;
        justify-content: flex-start;
        padding: 8px 16px;
    }
    .burger-menu {
        display: flex;
    }
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 270px;
        height: 100vh;
        background: #2d2d2d;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 65;
        /* padding: 20px 16px; */
        overflow-y: auto;
    }

    .nav-items{
        padding: 0;
    }

    .header.nav-open .main-nav {
        /* CHECK: Might be used via JS */
        transform: translateX(0);
    }
    .main-nav ul {
        gap: 0;
        flex-direction: column;
        align-items: stretch;
        min-height: 100%;
    }
    .main-nav a {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
        display: flex;
        align-items: center;
    }
    .main-nav li,
    .main-nav .logout-btn a {
        font-size: 14px;
        width: 100%;
    }

    .main-nav .nav-end.nav-items {
        width: 100%;
        padding: 0;

        flex-direction: column;
        flex: 1;
    }

    .main-nav .nav-mobile-only {
        display: flex !important;
    }

    .main-nav .nav-user-menu {
        display: none !important;
    }

    .main-nav .mobile-end {
        margin-top: auto;
    }

    .main-nav .nav-settings-link {
        width: 100% !important;
        justify-content: flex-start;
    }

    .main-nav .nav-settings-btn {
        width: 100%;
        height: 40px;
        border: none;
        background: transparent;
        border-radius: 0;
        justify-content: flex-start;
        padding: 8px 12px;
    }

    .main-nav .nav-settings-btn.is-active {
        border: none;
        background: #575757;
    }

    .nav-items li {
        height: 40px;
        display: flex;
        align-items: center;
        border-radius: 0;
    }

    .nav-items li.active-nav-item {
        text-decoration: none;
        color: #fff;
        height: 40px;
        background: #575757;
    }
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 64;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    .header.nav-open .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    .app-header {
        margin: 16px;
        flex-direction: column;
        gap: 20px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .stats {
        width: 100%;
    }
    .avatar.card,
    .rating.card {
        width: 100% !important;
        padding: 20px;
        text-align: center;
    }
    .avatar-upload-wrapper {
        width: 150px;
        height: 150px;
        margin: 0 auto 12px;
    }
    .avatar-img {
        width: 132px;
        height: 132px;
    }
    .nickname {
        font-size: 20px;
    }
    .rating-title {
        justify-content: center;
    }
    .league-card-inline {
        text-align: left;
    }

    .league-inline-top {
        padding: 8px;
        gap: 8px;
    }

    .league-inline-icon {
        width: 36px;
        height: 36px;
    }

    .league-name-value {
        font-size: 24px;
    }

    .league-points-row {
        padding: 8px;
    }

    .league-points-value {
        font-size: 30px;
    }

    .league-inline-meta {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .league-inline-meta-item {
        padding: 8px;
    }

    .rating-bar {
        max-width: 200px;
        margin-left: 2px;
    }
    .container {
        flex-direction: column;
        padding-left: 16px;
        padding-right: 16px;
        gap: 16px;
        margin: 16px auto;
    }
    .block.card {
        width: 100% !important;
    }
    .card-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .section-title {
        font-size: 18px;
    }
    .card-filters {
        flex-wrap: wrap;
        gap: 8px;
    }
    .filter {
        padding: 6px 12px;
        font-size: 13px;
    }
    .task-wrapper,
    .habit-wrapper {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) 36px;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
    }

    

    .task-content,
    .habit-content {
        width: 100%;
    }

    .task-title,
    .habit-title {
        font-size: 14px;
        line-height: 1.35;
        margin-bottom: 4px;
    }

    .task-notes,
    .habit-notes {
        margin: 4px 0;
        font-size: 12px;
    }

    .task-meta,
    .habit-meta {
        gap: 6px;
        margin-top: 6px;
    }

    .task-actions,
    .habit-actions {
        opacity: 1;
        margin-top: 0;
        align-self: center;
        justify-self: end;
    }
    .task-menu-btn,
    .habit-menu-btn {
        padding: 6px;
    }
    .checkbox-container {
        padding-left: 34px;
        margin-top: 0;
    }
    .checkmark {
        width: 30px;
        height: 30px;
    }
    .modal {
        min-width: 90%;
        max-width: 95%;
        padding: 0;
    }
    .modal.confirm-editing {
        padding: 14px;
    }
    .modal.confirm-editing .edit-content {
        gap: 12px;
    }
    .modal.confirm-editing .modal-actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
    }
    .modal-header {
        padding: 14px 14px;
        gap: 8px;
        flex-wrap: nowrap;
        align-items: center;
    }
    .modal-header h2 {
        font-size: 20px;
        line-height: 1.2;
        min-width: 0;
        flex: 1 1 auto;
        margin-bottom: 0;
    }
    .modal-header-actions {
        width: auto;
        margin-left: auto;
        justify-content: flex-start;
        gap: 6px;
        flex-shrink: 0;
    }
    .modal-header-actions .modal-btn,
    .modal-header-actions .modal-btn-secondary {
        padding: 8px 10px;
        font-size: 14px;
        line-height: 1.1;
    }
    .modal-body {
        padding: 20px 24px;
    }

    @media (max-width: 420px) {
        .modal-header {
            flex-wrap: wrap;
            align-items: flex-start;
        }

        .modal-header h2 {
            flex: 1 1 100%;
            margin-bottom: 2px;
        }

        .modal-header-actions {
            width: 100%;
            margin-left: 0;
            justify-content: flex-end;
            flex-shrink: 1;
        }
    }
    .form-input {
        font-size: 16px;
    }
    select.form-input {
        font-size: 16px;
    }
    .days-selector {
        gap: 6px;
    }
    .day-toggle {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    .footer {
        padding-right: 16px;
        font-size: 13px;
    }
    /* Страница "О нас" - адаптив для планшетов */
    .about-container {
        margin: 24px auto;
        padding: 0 16px;
    }
    .about-hero {
        display: flex;
        padding: 40px 24px;
        margin-bottom: 32px;
    }
    .about-logo img {
        width: 100px;
        height: 100px;
    }
    .about-title {
        font-size: 36px;
    }
    .about-subtitle {
        font-size: 18px;
    }
    .about-section {
        padding: 24px;
    }
    .section-heading {
        font-size: 24px;
    }
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
        row-gap: 24px;
    }
    .tech-stack {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    /* Команда - адаптив для планшетов */
    .team-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    .team-member {
        padding: 24px;
    }
    .member-name {
        font-size: 20px;
    }
    .member-description {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    .auth-card {
        padding: 24px 16px;
    }
    /* Страница "О нас" - адаптив для мобильных */
    .about-container {
        margin: 16px auto;
        padding: 0 12px;
    }
    .about-hero {
        padding: 32px 20px;
        margin-bottom: 32px;
    }
    .about-logo img {
        width: 80px;
        height: 80px;
    }
    .about-title {
        font-size: 28px;
    }
    .about-subtitle {
        font-size: 16px;
    }
    .about-section {
        padding: 20px;
    }
    .section-heading {
        font-size: 20px;
    }
    .features-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .feature-title {
        font-size: 20px;
    }
    .feature-desc {
        font-size: 14px;
    }
    .tech-category-title {
        font-size: 20px;
    }
    .tech-list li {
        font-size: 16px;
    }
    .tech-stack {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .feature-item {
        padding: 20px;
    }
    .contact-info {
        font-size: 14px;
    }
    /* Команда - адаптив для мобильных */
    .team-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .team-member {
        padding: 20px;
    }
    .member-photo {
        height: 220px;
        margin-bottom: 16px;
    }
    .member-role {
        font-size: 11px;
        padding: 5px 10px;
    }
    .member-name {
        font-size: 18px;
    }
    .member-username {
        font-size: 14px;
    }
    .member-description {
        font-size: 13px;
        line-height: 1.6;
        margin-bottom: 14px;
    }
    .contact-badge {
        font-size: 12px;
        padding: 6px 10px;
        gap: 5px;
    }
    .contact-badge svg {
        width: 14px;
        height: 14px;
    }
}

.modal-header h2 {
    font-size: 20px;
}

.btn-delete,
.modal-btn {
    font-size: 14px;
    padding: 8px 16px;
}

.task-title,
.habit-title {
    font-size: 14px;
}

.task-notes,
.habit-notes {
    font-size: 12px;
}

/* #endregion */


/* #region Страница рейтинга */

.rating-container {
    padding-top: 34px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    max-width: 800px;
    margin: 0 auto;
}

.rating-notice {
    background: #1f2634;
    border: 1px solid rgba(71, 120, 235, 0.4);
    padding: 14px 18px;
    border-radius: 10px;
    color: #d9e2ff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rating-notice-title {
    font-size: 15px;
    font-weight: 600;
}

.rating-notice-actions {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.rating-notice-actions a {
    color: #6b9fff;
    font-weight: 600;
}

.leaderboard {
    width: 100%;
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 10px;
}

.wide-block {
    width: 100%;
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 34px;
}

.about-hero {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    text-align: center;
    padding: 60px 40px;
    margin-bottom: 100px;
    background-color: transparent;
}

.about-section {
    padding: 50px;
    margin-bottom: 24px;
}

.transperant-block {
    background-color: transparent;
    box-shadow: none;
    border: none;
}
.leaderboard {
    padding: 10px;
}


.leaderboard-list {
    list-style: none;
    width: 100%;
    padding: 0;
    margin: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
    border: 2px solid transparent;
    min-width: 0;
}

.leaderboard .card-head {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(78, 78, 255, 0.3);
}

.leaderboard-item.clickable-profile {
    cursor: pointer;
}

.leaderboard-item[data-top="1"] {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.4);
}

.leaderboard-item[data-top="2"] {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(192, 192, 192, 0.05));
    border-color: rgba(192, 192, 192, 0.4);
}

.leaderboard-item[data-top="3"] {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(205, 127, 50, 0.05));
    border-color: rgba(205, 127, 50, 0.4);
}

.leaderboard-rank {
    font-size: 24px;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
    color: #a0a0ff;
}

.leaderboard-avatar {
    margin: 0 16px;
}

.leaderboard-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(78, 78, 255, 0.3);
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.leaderboard-nickname {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-username {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-league {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    width: fit-content;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(71, 120, 235, 0.4);
    background: rgba(71, 120, 235, 0.14);
    font-size: 12px;
    font-weight: 600;
    color: rgba(221, 232, 255, 0.95);
    overflow: hidden;
}

.leaderboard-league-icon {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    object-fit: contain;
    flex: 0 0 16px;
}

.leaderboard-league-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-rating {
    font-size: 24px;
    font-weight: 700;
    color: #4e4eff;
    min-width: 80px;
    text-align: right;
    flex-shrink: 0;
}

.rating-container .leaderboard-item {
    display: grid;
    grid-template-columns: 60px 50px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
}

.rating-container .leaderboard-avatar {
    margin: 0;
}

.rating-container .leaderboard-rating {
    min-width: 64px;
    margin-left: 8px;
}

.leagues-layout {
    max-width: 1240px;
    margin: 32px auto;
    align-items: flex-start;
}

.leagues-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.leagues-sidebar {
    width: 320px;
    background: #1c1c1c;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
}

.league-top-banner {
    width: 100%;
    background: #1c1c1c;
    border: 2px solid rgba(71, 120, 235, 0.45);
    border-radius: 10px;
    padding: 18px 20px;
}

.league-banner-title {
    font-size: 34px;
    font-weight: 700;
    color: #4e4eff;
}

.league-banner-subtitle {
    margin-top: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
}

.league-current-card {
    width: 100%;
    background: #1c1c1c;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
}

.league-current-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.league-current-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    color: rgba(255, 255, 255, 0.85);
}

.league-group {
    width: 100%;
    background: #1c1c1c;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    overflow: hidden;
}

.league-group-title {
    font-size: 38px;
    line-height: 1;
    font-weight: 700;
    text-align: center;
    padding: 14px;
}

.league-group-note {
    padding: 10px 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.league-group .leaderboard-list {
    padding: 10px;
}

.league-group .leaderboard-item {
    border-radius: 8px;
    margin-bottom: 8px;
}

.league-group-champion .league-group-title,
.league-group-champion .league-group-note {
    background: #4b3f12;
}

.league-group-winners .league-group-title,
.league-group-winners .league-group-note {
    background: #5a3e2b;
}

.league-group-members .league-group-title,
.league-group-members .league-group-note {
    background: #2b2b2b;
}

.league-group-laggards .league-group-title,
.league-group-laggards .league-group-note {
    background: #2a2f52;
}

.league-current-name-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.league-title-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.league-title-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.league-meta-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.league-card-head {
    width: 100%;
}

.league-zones {
    display: flex;
    gap: 14px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.league-score-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    margin-left: 10px;
}

.league-rating-total {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

.league-current-user-row {
    border-color: rgba(71, 120, 235, 0.45);
}

.league-empty,
.league-my-row-hint {
    width: 100%;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 14px 14px;
}

.leagues-sidebar-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leagues-sidebar-item {
    border: 2px solid rgba(71, 120, 235, 0.35);
    background: #21324f;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leagues-sidebar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.league-zones-inline {
    white-space: nowrap;
}

.league-players-count {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ffffff;
    font-weight: 600;
}

.league-players-icon {
    width: 12px;
    height: 12px;
    fill: currentColor;
    color: #ffffff;
    opacity: 1;
}

.league-sidebar-current {
    background: linear-gradient(135deg, #355a9d, #294675);
    border-color: rgba(111, 158, 255, 0.95);
    padding: 16px;
    transform: scale(1.04);
    box-shadow: 0 0 0 2px rgba(111, 158, 255, 0.35);
}

.league-sidebar-current .league-title-with-icon {
    font-size: 18px;
    font-weight: 700;
}

.league-sidebar-current .league-title-icon {
    width: 32px;
    height: 32px;
}

.league-sidebar-current .leagues-sidebar-meta {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.league-sidebar-dim {
    background: #141721;
    border-color: rgba(52, 61, 86, 0.9);
}

.league-sidebar-dim .league-title-with-icon {
    color: rgba(255, 255, 255, 0.74);
}

.league-sidebar-dim .leagues-sidebar-meta {
    color: rgba(255, 255, 255, 0.5);
}

.league-sidebar-dim .league-players-count {
    color: #ffffff;
}

/* Scoped redesign for leagues page: calmer typography and tighter hierarchy. */
body.leagues-page .leagues-layout {
    max-width: 1160px;
    gap: 18px;
}

body.leagues-page .leagues-main {
    gap: 12px;
}

body.leagues-page .league-top-banner {
    padding: 16px 18px;
    border-radius: 12px;
}

body.leagues-page .league-banner-title {
    font-size: clamp(19px, 1.9vw, 24px);
    line-height: 1.2;
    letter-spacing: 0.2px;
}

body.leagues-page .league-banner-subtitle {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
}

body.leagues-page #league-week-reset-countdown {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

body.light-theme.leagues-page #league-week-reset-countdown {
    color: #355a83;
}

body.leagues-page .league-current-card {
    padding: 14px 16px;
    border-radius: 12px;
}

body.leagues-page .league-current-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    font-size: 13px;
}

body.leagues-page .league-current-title {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

body.leagues-page .league-group {
    border-radius: 12px;
}

body.leagues-page .league-group-title {
    font-size: clamp(16px, 1.3vw, 20px);
    line-height: 1.15;
    letter-spacing: 0.35px;
    text-transform: none;
    padding: 11px 12px;
}

body.leagues-page .league-group-note {
    font-size: 11px;
    line-height: 1.45;
    padding: 8px 12px;
}

body.leagues-page .league-group .leaderboard-list {
    padding: 8px;
}

body.leagues-page .league-group .leaderboard-item {
    border-radius: 10px;
    margin-bottom: 7px;
    padding: 10px 12px;
}

body.leagues-page .leaderboard-rank {
    min-width: 44px;
    font-size: 16px;
}

body.leagues-page .leaderboard-avatar {
    margin: 0 10px;
}

body.leagues-page .leaderboard-avatar img {
    width: 42px;
    height: 42px;
}

body.leagues-page .leaderboard-nickname {
    font-size: 15px;
    margin-bottom: 2px;
}

body.leagues-page .leaderboard-username {
    font-size: 12px;
}

body.leagues-page .leaderboard-rating {
    min-width: 64px;
    font-size: 17px;
}

body.leagues-page .league-rating-total {
    font-size: 10px;
}

body.leagues-page .league-sidebar-title {
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

body.leagues-page .leagues-sidebar {
    width: 300px;
    border-radius: 12px;
    padding: 14px;
}

body.leagues-page .leagues-sidebar-list {
    gap: 8px;
    margin-top: 10px;
}

body.leagues-page .leagues-sidebar-item {
    border-radius: 10px;
    padding: 10px;
}

body.leagues-page .league-title-with-icon {
    gap: 8px;
}

body.leagues-page .league-title-icon {
    width: 22px;
    height: 22px;
}

body.leagues-page .leagues-sidebar-meta {
    font-size: 11px;
}

body.leagues-page .league-sidebar-current {
    transform: none;
    padding: 12px;
    box-shadow: 0 0 0 2px rgba(111, 158, 255, 0.24);
}

body.leagues-page .league-sidebar-current .league-title-with-icon {
    font-size: 15px;
}

body.leagues-page .league-sidebar-current .league-title-icon {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    body.leagues-page .leagues-layout {
        gap: 10px;
    }

    body.leagues-page .league-banner-title {
        font-size: 18px;
    }

    body.leagues-page .league-current-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    body.leagues-page .league-group-title {
        font-size: 15px;
        padding: 9px 10px;
    }

    body.leagues-page .league-group-note {
        font-size: 10px;
        padding: 7px 10px;
    }

    body.leagues-page .leaderboard-rank {
        min-width: 34px;
        font-size: 14px;
    }

    body.leagues-page .leaderboard-avatar img {
        width: 34px;
        height: 34px;
    }

    body.leagues-page .leaderboard-nickname {
        font-size: 13px;
    }

    body.leagues-page .leaderboard-rating {
        min-width: 50px;
        font-size: 14px;
    }

    body.leagues-page .league-current-title {
        font-size: 16px;
    }

    body.leagues-page .league-sidebar-title {
        font-size: 15px;
    }

    body.leagues-page .leagues-sidebar {
        width: 100%;
    }
}

.profile-layout {
    max-width: 1240px;
    margin: 26px auto;
    flex-direction: column;
    gap: 18px;
}

.settings-layout {
    max-width: 880px;
    margin: 26px auto;
    flex-direction: column;
    gap: 18px;
}

.no-border {
    border: none;
}

.subtask-edit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(86, 98, 122, 0.28);
}

.subtask-edit-row:last-child {
    border-bottom: none;
}

.subtask-edit-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

/* Higher specificity to avoid collisions with generic form/button styles. */
.subtasks-list .subtask-edit-row {
    display: grid;
    grid-template-columns: 16px 16px minmax(0, 1fr) 28px;
    align-items: center;
    column-gap: 10px;
}

.subtask-edit-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #4778eb;
}

.subtask-edit-input-done {
    text-decoration: line-through;
    opacity: 0.55;
}

.subtasks-list .subtask-edit-input {
    width: 100%;
    margin: 0;
}

.subtasks-list .subtask-remove-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    justify-self: center;
}

.profile-guest-banner {
    width: 100%;
    background: linear-gradient(135deg, #355a9d, #294675);
    border: 2px solid rgba(111, 158, 255, 0.8);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.profile-guest-banner-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
}

.profile-guest-banner-text strong {
    color: #ffffff;
}

.profile-guest-cta {
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 14px;
}

.profile-guest-cta:hover {
    background: rgba(255, 255, 255, 0.22);
}

.profile-avatar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-avatar-wrapper {
    width: 132px;
    height: 132px;
    margin-bottom: 0;
}

.profile-avatar-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.62);
    text-align: center;
}

.profile-identity-col {
    min-width: 0;
}

.profile-name {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-username {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.64);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-joined {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.profile-league-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #262626;
    border-radius: 999px;
    padding: 6px 11px;
    margin-bottom: 12px;
}

.profile-league-chip img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.profile-league-chip span {
    font-size: 13px;
    font-weight: 600;
}

.profile-rating-block {
    width: 100%;
}

.profile-rating-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.profile-rating-top span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.profile-rating-top strong {
    font-size: 28px;
    color: #4e4eff;
    line-height: 1;
}

.profile-rating-bar {
    margin: 0;
    width: 210px;
}

.profile-stat-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-stat-group {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #212121;
    border-radius: 12px;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.profile-stat-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.profile-stat-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #252525;
    border-radius: 10px;
    padding: 12px;
}

.profile-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.profile-stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.58);
}

.profile-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.profile-card {
    width: 100%;
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
}

.profile-card-wide {
    grid-column: 1 / -1;
}

.profile-card-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.2px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-field span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.56);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.profile-field input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #121212;
    color: #ffffff;
    border-radius: 10px;
    font-size: 14px;
    padding: 11px 12px;
    outline: none;
}

.profile-field input:focus {
    border-color: rgba(71, 120, 235, 0.75);
    box-shadow: 0 0 0 1px rgba(71, 120, 235, 0.3);
}

.profile-btn {
    border: 1px solid rgba(71, 120, 235, 0.72);
    background: rgba(71, 120, 235, 0.16);
    color: #ffffff;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.2px;
}

.profile-btn:hover {
    background: rgba(71, 120, 235, 0.26);
}

.profile-btn:disabled,
.profile-field input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.profile-status {
    min-height: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
}

.profile-status.success {
    color: #7adf93;
}

.profile-status.error {
    color: #ff7f8e;
}

.profile-guest-hint {
    margin-bottom: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
}

.profile-league-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.profile-league-meta-grid div {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: #252525;
    padding: 10px;
}

.profile-league-meta-grid span {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.56);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.profile-league-meta-grid strong {
    font-size: 17px;
}

.profile-league-points-value {
    color: #4778eb;
    font-weight: 700;
}

.profile-open-link {
    display: inline-flex;
    margin-top: 12px;
    color: #aac8ff;
    font-size: 13px;
}

.profile-open-link:hover {
    color: #d5e5ff;
}

.profile-achievements-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.profile-achievements-list li {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #252525;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.profile-achievements-list strong {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-achievements-list span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.66);
}

.profile-empty {
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
}

.profile-shell {
    width: 100%;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.profile-sidebar {
    position: static;
}

.profile-main {
    min-width: 0;
}

.profile-summary-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-identity-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-summary-card .profile-rating-block {
    margin-top: 8px;
}

.profile-summary-card .profile-stat-col {
    margin-top: 4px;
}

.profile-main .profile-grid {
    margin: 0;
}

.settings-page .profile-layout {
    max-width: 980px;
    gap: 12px;
}

.settings-page .settings-head {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(71, 120, 235, 0.35);
    background: linear-gradient(135deg, #2d4977, #253b62);
}

.settings-page .settings-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.settings-page .settings-subtitle {
    margin: 6px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}

.settings-page .settings-groups {
    display: grid;
    gap: 12px;
}

.settings-page .settings-group-card {
    border-radius: 14px;
    padding: 20px;
    background: var(--color-bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-page .settings-group-head {
    margin-bottom: 16px;
}

.settings-page .settings-group-head h2 {
    margin: 0;
    font-size: 17px;
    color: #ffffff;
}

.settings-page .settings-group-head p {
    margin: 4px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.settings-page .settings-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.settings-page .settings-card,
.settings-page .settings-security-card {
    padding: 14px;
    border-radius: 12px;
    background: var(--color-surface);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.settings-page .settings-card-inner {
    padding: 0;
}

.settings-page .profile-card-title {
    font-size: 15px;
    margin-bottom: 10px;
}

.settings-page .profile-form {
    gap: 10px;
}

.settings-page .profile-field span {
    font-size: 10px;
}

.settings-page .profile-field input {
    font-size: 13px;
    padding: 10px 11px;
}

.settings-page .profile-btn {
    width: fit-content;
    min-width: 170px;
    padding: 10px 12px;
    font-size: 12px;
}

.settings-page .profile-status {
    min-height: 18px;
    font-size: 12px;
}

.theme-settings-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 6px 0;
}

.settings-group-card > .theme-toggle-row:first-of-type {
    margin-top: 0;
}

.settings-group-card > .theme-toggle-divider {
    margin: 0;
}

.theme-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.theme-toggle-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.theme-toggle-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(71, 120, 235, 0.12);
    color: var(--color-accent);
}

.theme-toggle-divider {
    height: 1px;
    margin: 0 20px;
    background: var(--color-border);
}

.theme-toggle-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.theme-toggle-hint {
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.65);
}

.theme-switch {
    position: relative;
    width: 56px;
    height: 32px;
    flex: 0 0 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch-track {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #2c3650;
    border: 1px solid rgba(111, 158, 255, 0.45);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-switch-thumb {
    position: absolute;
    left: 5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.theme-switch input:checked ~ .theme-switch-track {
    background: rgba(71, 120, 235, 0.45);
    border-color: rgba(71, 120, 235, 0.75);
}

.theme-switch input:checked ~ .theme-switch-thumb {
    transform: translateX(24px);
}

.theme-switch input:focus-visible ~ .theme-switch-track {
    box-shadow: 0 0 0 3px rgba(71, 120, 235, 0.3);
}

.theme-switch-disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ──────── Light-theme: CSS variable overrides ──────── */
html.light-theme {
    --color-bg: #f5f6f8;
    --color-bg-panel: #ffffff;
    --color-surface: #ffffff;
    --color-border: #dce1e6;
    --color-text: #1f2d3d;
    --color-text-muted: #6f8198;
    --color-accent: #4a76a8;
    --bg-gradient-main: linear-gradient(180deg, #f5f6f8 0%, #eceef2 45%, #eceef2 100%);
}

html.light-theme,
body.light-theme,
body.light-theme.index-page,
body.light-theme.new_back,
body.light-theme.slim-back {
    color: #1f2d3d;
    background: linear-gradient(180deg, #f5f6f8 0%, #eceef2 45%, #eceef2 100%);
    background-attachment: fixed;
}

html.light-theme body,
html.light-theme body.index-page,
html.light-theme body.new_back,
html.light-theme body.slim-back {
    color: #1f2d3d;
    background: linear-gradient(180deg, #f5f6f8 0%, #eceef2 45%, #eceef2 100%);
    background-attachment: fixed;
}

html.light-theme .header,
body.light-theme .header {
    background: #ffffff;
    border-bottom: 1px solid #dce1e6;
    color: #1f2d3d;
}

body.light-theme .burger-menu span {
    background: #4f5d73;
}

body.light-theme .nav-items li,
body.light-theme .logout-btn a,
body.light-theme .nav-user-dropdown .nav-user-item,
body.light-theme .nav-user-profile-name,
body.light-theme .nav-user-profile-username,
body.light-theme .nav-user-chevron {
    color: #2a3546;
}

body.light-theme .main-nav > ul > a > li:hover,
body.light-theme .main-nav .nav-end.nav-items > a > li:hover,
body.light-theme .nav-user-menu:hover {
    background-color: #eef2f7;
    color: #1f2d3d;
}

body.light-theme .nav-items li.active-nav-item {
    color: #3f6ea0;
}

body.light-theme .nav-user-dropdown {
    background: #ffffff;
    border: 1px solid #dce1e6;
    box-shadow: 0 8px 24px rgba(36, 64, 104, 0.1);
}

body.light-theme .nav-user-profile {
    border-bottom-color: #edf1f6;
}

body.light-theme .nav-user-dropdown .nav-user-item:hover {
    background: #f3f6fb;
}

body.light-theme .nav-theme-current-value {
    color: #5c6f83;
}

body.light-theme .nav-theme-options {
    border: 0;
    box-shadow: 0 8px 24px rgba(36, 64, 104, 0.1);
}

body.light-theme .nav-theme-option {
    color: #2a3546;
}

body.light-theme .nav-theme-option:hover {
    background: #eef3fa;
}

body.light-theme .nav-theme-option.is-active {
    color: #1e2d41;
}

body.light-theme .nav-theme-option.is-active .nav-theme-check {
    background: transparent;
}

body.light-theme .app-header,
body.light-theme .new_block,
body.light-theme .block,
body.light-theme .profile-card,
body.light-theme.settings-page .settings-group-card,
body.light-theme.settings-page .settings-card,
body.light-theme.settings-page .settings-security-card,
body.light-theme .leagues-sidebar,
body.light-theme .league-group,
body.light-theme .league-current-card,
body.light-theme .league-top-banner,
body.light-theme .achievement-item {
    background: #ffffff;
    border-color: #dce1e6;
    color: #1f2d3d;
    box-shadow: 0 1px 0 rgba(17, 33, 58, 0.03);
}

body.light-theme .section-title,
body.light-theme .task-title,
body.light-theme .habit-title,
body.light-theme .profile-name,
body.light-theme.settings-page .settings-title,
body.light-theme.settings-page .settings-group-head h2,
body.light-theme .leaderboard-nickname,
body.light-theme .league-banner-title,
body.light-theme .league-group-title,
body.light-theme .profile-card-title,
body.light-theme .nickname {
    color: #1d2f45;
}

body.light-theme .username,
body.light-theme .task-notes,
body.light-theme .habit-notes,
body.light-theme.settings-page .settings-subtitle,
body.light-theme.settings-page .settings-group-head p,
body.light-theme .theme-toggle-hint,
body.light-theme .leaderboard-username,
body.light-theme .league-rating-total,
body.light-theme .league-group-note,
body.light-theme .league-empty,
body.light-theme .profile-stat-label,
body.light-theme .profile-guest-hint {
    color: #61748b;
}

body.light-theme .icon-btn,
body.light-theme .task-menu-btn,
body.light-theme .habit-menu-btn {
    color: #5c6f86;
}

body.light-theme .task-menu-btn:hover,
body.light-theme .habit-menu-btn:hover {
    background: #eef2f7;
}

body.light-theme .task-item,
body.light-theme .habit-item {
    background: #ffffff;
    border-color: #dce1e6;
}

body.light-theme .task-item:hover,
body.light-theme .habit-item:hover {
    background: #f6f8fb;
}

body.light-theme .habit-inactive {
    background: #f3f5f8 !important;
    color: #8c9bb0 !important;
}

body.light-theme .rating-bar {
    background: #dfe6ef;
}

body.light-theme .rating-value,
body.light-theme .league-points-value,
body.light-theme .leaderboard-rating,
body.light-theme .league-open-link {
    color: #4a76a8;
}

body.light-theme .profile-btn,
body.light-theme .theme-switch input:checked ~ .theme-switch-track,
body.light-theme.settings-page .profile-btn {
    background: #4a76a8;
    border-color: #4a76a8;
    color: #ffffff;
}

body.light-theme .profile-btn:hover,
body.light-theme.settings-page .profile-btn:hover {
    background: #406892;
    border-color: #406892;
}

body.light-theme .profile-field input,
body.light-theme .auth-form input,
body.light-theme .auth-form select,
body.light-theme .modal-content input,
body.light-theme .modal-content textarea,
body.light-theme .modal-content select,
body.light-theme .search-input {
    background: #f8fafc;
    border-color: #dce1e6;
    color: #1f2d3d;
}

body.light-theme .profile-field input::placeholder,
body.light-theme .auth-form input::placeholder,
body.light-theme .search-input::placeholder {
    color: #8ea0b5;
}

body.light-theme .modal-content {
    background: #ffffff;
    border-color: #dce1e6;
    color: #1f2d3d;
}

body.light-theme .task-difficulty,
body.light-theme .habit-difficulty,
body.light-theme .task-deadline,
body.light-theme .habit-streak-badge {
    background: #edf2f8;
    color: #546a82;
}

body.light-theme .league-inline-top {
    border-color: #dce1e6;
    background: #f7f9fc;
}

body.light-theme .league-points-row,
body.light-theme .task-subtasks-progress,
body.light-theme .habits-completion-badge {
    background: rgba(74, 118, 168, 0.1);
    border-color: rgba(74, 118, 168, 0.45);
    color: #345982;
}

body.light-theme .leagues-sidebar-item {
    border-color: #dce1e6;
    background: #ffffff;
}

body.light-theme .league-sidebar-current {
    background: linear-gradient(135deg, rgba(74, 118, 168, 0.18), rgba(74, 118, 168, 0.08));
    border-color: rgba(74, 118, 168, 0.55);
    box-shadow: 0 0 0 2px rgba(74, 118, 168, 0.18);
}

body.light-theme .league-sidebar-dim {
    background: #f8fafc;
    border-color: #dce1e6;
}

body.light-theme .league-sidebar-dim .league-title-with-icon,
body.light-theme .league-sidebar-dim .leagues-sidebar-meta {
    color: #6f8198;
}

body.light-theme .main-nav .nav-settings-btn.is-active {
    background: rgba(74, 118, 168, 0.14);
    color: #3f6ea0;
}

body.light-theme .filter {
    background: #f2f5f9;
    border-color: #dce1e6;
    color: #5a6f86;
}

body.light-theme .filter:hover {
    background: #eaf0f6;
    color: #2f4258;
}

body.light-theme .filter.active {
    background: rgba(74, 118, 168, 0.14);
    border-color: rgba(74, 118, 168, 0.55);
    color: #3f6ea0;
}

body.light-theme .rating-notice {
    background: rgba(74, 118, 168, 0.08);
    border-color: rgba(74, 118, 168, 0.35);
    color: #3e5a79;
}

body.light-theme .rating-notice-title {
    color: #2b4058;
}

body.light-theme .rating-notice-actions {
    color: #6f8198;
}

body.light-theme .rating-notice-actions a {
    color: #3f6ea0;
}

body.light-theme .rating-notice-actions a:hover,
body.light-theme .rating-notice-actions a:focus-visible {
    color: #2f5d8f;
    text-decoration: underline;
}

body.light-theme .profile-status.success {
    color: #2d7a45;
}

body.light-theme .profile-status.error {
    color: #b04444;
}

body.light-theme.settings-page .settings-head {
    border-color: rgba(74, 118, 168, 0.35);
    background: linear-gradient(135deg, rgba(74, 118, 168, 0.14), rgba(74, 118, 168, 0.06));
}

body.light-theme.settings-page .profile-field span,
body.light-theme .profile-field span,
body.light-theme .profile-rating-top span,
body.light-theme .profile-stat-group-title,
body.light-theme .profile-league-meta-grid span,
body.light-theme .profile-joined,
body.light-theme .profile-avatar-hint,
body.light-theme .profile-username {
    color: #6f8198;
}

body.light-theme .profile-stat-group,
body.light-theme .profile-stat-card,
body.light-theme .profile-league-chip,
body.light-theme .profile-league-meta-grid div,
body.light-theme .profile-achievements-list li,
body.light-theme .league-inline-meta-item,
body.light-theme .profile-guest-banner {
    background: #f7f9fc;
    border-color: #dce1e6;
}

body.light-theme .profile-stat-value,
body.light-theme .profile-league-meta-grid strong,
body.light-theme .profile-achievements-list strong,
body.light-theme .profile-achievements-list span,
body.light-theme .profile-empty,
body.light-theme .profile-league-chip span {
    color: #2c4058;
}

body.light-theme .profile-open-link {
    color: #3f6ea0;
}

body.light-theme .profile-open-link:hover,
body.light-theme .profile-open-link:focus-visible {
    color: #2f5d8f;
    text-decoration: underline;
}

body.light-theme .profile-guest-banner {
    background: linear-gradient(135deg, rgba(74, 118, 168, 0.14), rgba(74, 118, 168, 0.06));
    border-color: rgba(74, 118, 168, 0.35);
}

body.light-theme .profile-guest-banner-text {
    color: #4b627d;
}

body.light-theme .profile-guest-banner-text strong {
    color: #2b4058;
}

body.light-theme .profile-guest-cta {
    background: #4a76a8;
    border-color: #4a76a8;
    color: #ffffff;
}

body.light-theme .profile-guest-cta:hover {
    background: #406892;
    border-color: #406892;
}

body.light-theme .league-inline-meta-label,
body.light-theme .league-inline-points-label,
body.light-theme .league-inline-name-label {
    color: #6f8198;
}

body.light-theme .league-name-value,
body.light-theme .league-inline-meta-item strong {
    color: #2b4058;
}

body.light-theme .stats-block,
body.light-theme .habits-completion-card,
body.light-theme .stats-streak-card,
body.light-theme .rewards-card {
    background: #ffffff;
    border-color: #dce1e6;
    box-shadow: none;
}

body.light-theme .habits-completion-badge {
    background: #f7f9fc;
    border-color: #dce1e6;
}

body.light-theme .habits-completion-badge-title,
body.light-theme .habits-completion-badge-meta,
body.light-theme .habits-completion-x-label {
    color: #6f8198;
}

body.light-theme .habits-completion-badge-value,
body.light-theme .habits-completion-line,
body.light-theme .habits-completion-point {
    color: #4a76a8;
    stroke: #4a76a8;
}

body.light-theme .habits-completion-grid line {
    stroke: rgba(74, 118, 168, 0.16);
}

body.light-theme .stats-streak-header,
body.light-theme .stats-streak-best {
    border-color: #dce1e6;
}

body.light-theme .stats-streak-title,
body.light-theme .stats-streak-text,
body.light-theme #stats-streak-value,
body.light-theme #stats-streak-word,
body.light-theme .stats-streak-best strong {
    color: #2b4058;
}

body.light-theme .stats-streak-day-label,
body.light-theme .stats-streak-best {
    color: #6f8198;
}

body.light-theme .stats-streak-day-item.is-active .stats-streak-day-label {
    color: #4a76a8;
}

body.light-theme .stats-streak-day-dot {
    border-color: #cfd9e4;
    background: radial-gradient(circle at 35% 30%, rgba(74, 118, 168, 0.18), rgba(74, 118, 168, 0.06));
    box-shadow: none;
}

body.light-theme .stats-streak-day-item.is-active .stats-streak-day-icon {
    filter: drop-shadow(0 0 8px rgba(74, 118, 168, 0.3));
}

body.light-theme .modal {
    background: #ffffff;
    border: 1px solid #dce1e6;
    box-shadow: 0 18px 42px rgba(30, 51, 82, 0.2);
}

body.light-theme .modal-overlay {
    background: rgba(25, 38, 54, 0.36);
}

body.light-theme .modal-header {
    background: #edf3fb;
    color: #2b4058;
    border-bottom-color: #dce1e6;
}

body.light-theme .modal-header h2,
body.light-theme .modal-body,
body.light-theme .form-group label,
body.light-theme .modal-btn-secondary,
body.light-theme .subtasks-group-hint,
body.light-theme .subtask-remove-btn,
body.light-theme .task-subtask-item,
body.light-theme .task-subtask-title {
    color: #2b4058;
}

body.light-theme .subtasks-list {
    border-color: #dce1e6;
    background: #f8fafd;
}

body.light-theme .subtask-row,
body.light-theme .subtask-edit-row {
    border-bottom-color: #dce1e6;
}

body.light-theme .subtask-row.is-dragging-subtask {
    background: rgba(74, 118, 168, 0.14);
}

body.light-theme .subtasks-list.is-subtask-drag-over {
    border-color: rgba(74, 118, 168, 0.65);
}

body.light-theme .subtask-drag-handle {
    color: #6d84a2;
}

body.light-theme .subtask-input {
    background: #ffffff;
    border-color: #d2dbe6;
    color: #24364b;
}

body.light-theme .subtask-edit-input {
    background: #ffffff;
    border-color: #d2dbe6;
    color: #24364b;
}

body.light-theme .subtask-input:focus {
    border-color: #4a76a8;
    background: #ffffff;
}

body.light-theme .subtask-edit-input:focus {
    border-color: #4a76a8;
    background: #ffffff;
}

body.light-theme .subtask-remove-btn:hover {
    color: #4a76a8;
}

body.light-theme .subtask-add-btn {
    background: rgba(74, 118, 168, 0.08);
    border-color: rgba(74, 118, 168, 0.45);
    color: #3d628a;
}

body.light-theme .subtask-add-btn:hover {
    background: rgba(74, 118, 168, 0.14);
}

body.light-theme .form-input,
body.light-theme select.form-input,
body.light-theme textarea.form-input,
body.light-theme .auth-card .form-input {
    background-color: #ffffff;
    border-color: #d2dbe6;
    color: #24364b;
}

body.light-theme select.form-input {
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23546b84' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
}

body.light-theme .floating-label {
    background-color: #ffffff;
    color: #7b8fa7;
}

body.light-theme .form-input:focus + .floating-label,
body.light-theme .form-input:not(:placeholder-shown) + .floating-label {
    color: #4a76a8;
}

body.light-theme .form-input:-webkit-autofill,
body.light-theme .form-input:-webkit-autofill:hover,
body.light-theme .form-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #24364b !important;
}

body.light-theme .modal-btn {
    background: #ffffff;
    border-color: #4a76a8;
    color: #4a76a8;
}

body.light-theme .modal-btn:hover {
    background: #4a76a8;
    color: #ffffff;
}

body.light-theme .modal-btn-secondary:hover {
    background: #eef3fa;
    color: #35567a;
}

body.light-theme .task-subtask-completed {
    color: #6f8198;
}

body.light-theme .checkmark,
body.light-theme .task-subtask-checkmark {
    background-color: #ffffff;
    border-color: #b8c7d9;
}

body.light-theme .checkbox-container input:focus-visible ~ .checkmark,
body.light-theme .task-subtask-checkbox:focus-visible ~ .task-subtask-checkmark {
    box-shadow: 0 0 0 3px rgba(74, 118, 168, 0.22);
    border-color: #4a76a8;
}

body.light-theme .checkbox-container input:checked ~ .checkmark,
body.light-theme .task-subtask-checkbox:checked ~ .task-subtask-checkmark {
    background-color: #4a76a8;
    border-color: #4a76a8;
}

body.light-theme .day-toggle {
    border-color: #c7d3e2;
    background: #ffffff;
    color: #3a4f68;
}

body.light-theme .day-toggle:hover {
    border-color: #7ea0c6;
    background: #f3f7fc;
    color: #2f445f;
}

body.light-theme .day-toggle.active {
    background: #4a76a8;
    border-color: #4a76a8;
    color: #ffffff;
}

body.light-theme .day-toggle:focus-visible {
    outline-color: #4a76a8;
}

body.light-theme .btn-delete {
    background: #ffffff;
    color: #c13f4a;
    border-color: #e4a7ae;
}

body.light-theme .btn-delete:hover {
    background: #d84f5b;
    border-color: #d84f5b;
    color: #ffffff;
}

body.light-theme input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
    opacity: 0.8;
}

/* Stronger light-theme overrides for remaining leagues/settings contrast issues. */
body.light-theme.settings-page .settings-group-card,
body.light-theme.settings-page .settings-card,
body.light-theme.settings-page .settings-security-card,
body.light-theme.settings-page .profile-card {
    background: #ffffff !important;
    border-color: #dce1e6 !important;
    color: #24364b !important;
}

body.light-theme.settings-page .settings-title,
body.light-theme.settings-page .settings-group-head h2,
body.light-theme.settings-page .profile-card-title,
body.light-theme.settings-page .profile-field input,
body.light-theme.settings-page .profile-status,
body.light-theme.settings-page .theme-toggle-copy {
    color: #24364b;
}

body.light-theme.settings-page .profile-btn,
body.light-theme.settings-page .profile-btn:hover,
body.light-theme.settings-page .profile-btn:focus-visible {
    color: #ffffff !important;
}

body.light-theme.settings-page .settings-subtitle,
body.light-theme.settings-page .settings-group-head p,
body.light-theme.settings-page .profile-field span,
body.light-theme.settings-page .theme-toggle-hint {
    color: #6f8198 !important;
}

body.light-theme.settings-page .profile-field input {
    background: #f8fafc !important;
    border-color: #d2dbe6 !important;
}

body.light-theme.settings-page .theme-switch-track {
    background: #e6edf5;
    border-color: #c5d2e2;
}

body.light-theme .leagues-sidebar,
body.light-theme .league-top-banner,
body.light-theme .league-current-card,
body.light-theme .league-group,
body.light-theme .leagues-sidebar-item,
body.light-theme .league-sidebar-dim {
    background: #ffffff !important;
    border-color: #dce1e6 !important;
}

body.light-theme .league-group-note {
    border-top-color: #dce1e6;
    border-bottom-color: #dce1e6;
}

body.light-theme .league-group-champion .league-group-title,
body.light-theme .league-group-champion .league-group-note {
    background: #f7efd3;
}

body.light-theme .league-group-winners .league-group-title,
body.light-theme .league-group-winners .league-group-note {
    background: #f8e8df;
}

body.light-theme .league-group-members .league-group-title,
body.light-theme .league-group-members .league-group-note {
    background: #eef3f9;
}

body.light-theme .league-group-laggards .league-group-title,
body.light-theme .league-group-laggards .league-group-note {
    background: #e9eefc;
}

body.light-theme .leaderboard-item[data-top="1"] {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.16), rgba(255, 215, 0, 0.06));
    border-color: rgba(201, 164, 28, 0.45);
}

body.light-theme .leaderboard-item[data-top="2"] {
    background: linear-gradient(135deg, rgba(165, 177, 191, 0.18), rgba(165, 177, 191, 0.08));
    border-color: rgba(137, 150, 165, 0.5);
}

body.light-theme .leaderboard-item[data-top="3"] {
    background: linear-gradient(135deg, rgba(196, 132, 90, 0.2), rgba(196, 132, 90, 0.08));
    border-color: rgba(160, 102, 64, 0.45);
}

body.light-theme .league-current-grid,
body.light-theme .league-meta-label,
body.light-theme .league-zones,
body.light-theme .league-banner-subtitle,
body.light-theme .league-group-note,
body.light-theme .league-empty,
body.light-theme .league-my-row-hint,
body.light-theme .leaderboard-username,
body.light-theme .league-rating-total,
body.light-theme .leagues-sidebar-meta,
body.light-theme .league-zones-inline {
    color: #6f8198 !important;
}

body.light-theme .league-banner-title,
body.light-theme .league-group-title,
body.light-theme .leaderboard-nickname,
body.light-theme .leaderboard-rank,
body.light-theme .league-title-with-icon,
body.light-theme .section-title,
body.light-theme .league-current-grid div,
body.light-theme .league-current-grid span {
    color: #24364b !important;
}

body.light-theme .league-players-count,
body.light-theme .league-players-icon {
    color: #4f6580 !important;
}

body.light-theme .league-sidebar-current {
    background: linear-gradient(135deg, rgba(74, 118, 168, 0.16), rgba(74, 118, 168, 0.07)) !important;
    border-color: rgba(74, 118, 168, 0.5) !important;
}

body.light-theme .leaderboard-league {
    border-color: rgba(74, 118, 168, 0.42);
    background: rgba(74, 118, 168, 0.12);
    color: #3d628a;
}

body.light-theme .leaderboard-league-name {
    color: #355a83;
}

body.light-theme .leaderboard-league-icon {
    filter: none;
    opacity: 0.98;
}

@media (max-width: 768px) {
    body.light-theme .main-nav {
        background: #ffffff;
        border-right: 1px solid #dce1e6;
        box-shadow: 10px 0 28px rgba(31, 52, 79, 0.14);
    }

    body.light-theme .main-nav li,
    body.light-theme .main-nav .logout-btn a {
        color: #2a3546;
    }

    body.light-theme .main-nav .logout-btn a {
        color: #5e7288;
    }

    body.light-theme .main-nav > ul > a > li:hover,
    body.light-theme .main-nav .nav-end.nav-items > a > li:hover,
    body.light-theme .main-nav .logout-btn:hover a,
    body.light-theme .main-nav .nav-settings-btn:hover {
        background: #f2f6fb;
        color: #1f2d3d;
    }

    body.light-theme .main-nav .nav-settings-btn {
        color: #2a3546;
    }

    body.light-theme .main-nav .nav-settings-btn.is-active,
    body.light-theme .nav-items li.active-nav-item {
        background: #e8f0fa;
        color: #3f6ea0;
    }

    body.light-theme .nav-backdrop {
        background: rgba(33, 48, 66, 0.22);
    }
}

/* ──────── Additional light-theme: hardcoded dark values ──────── */

body.light-theme .avatar-img {
    box-shadow: 0 0 0 2px #c5d0dc;
}

body.light-theme .editable-field:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .league-inline-name-label,
body.light-theme .league-inline-points-label,
body.light-theme .league-inline-meta-label {
    color: #6f8198;
}

body.light-theme .league-name-value,
body.light-theme .league-inline-meta-item strong {
    color: #24364b;
}

body.light-theme .league-inline-meta-item {
    border-color: #dce1e6;
    background: #f7f9fc;
}

body.light-theme .league-points-row {
    border-color: rgba(74, 118, 168, 0.4);
    background: rgba(74, 118, 168, 0.08);
}

body.light-theme .league-inline-top {
    border-color: #dce1e6;
    background: #f7f9fc;
}

body.light-theme .block {
    border-color: #dce1e6;
}

body.light-theme .nav-items li {
    color: #4a5568;
}

body.light-theme .logout-btn a {
    color: #6f8198;
}

body.light-theme .auth-btn {
    color: #ffffff;
}

body.light-theme .guest-btn {
    background: #e8eef4;
    color: #3d628a;
    border-color: #c5d2e2;
}

body.light-theme .guest-btn:hover {
    background: #d9e3ee;
}

@media (max-width: 1200px) {
    .about-title {
        font-size: 72px;
    }
    .about-subtitle {
        font-size: 30px;
    }
}

@media (max-width: 768px) {
    .leagues-layout {
        flex-direction: column;
        margin: 16px auto;
        gap: 12px;
        padding-left: 12px;
        padding-right: 12px;
    }
    .leagues-main {
        width: 100%;
        gap: 10px;
    }
    .leagues-sidebar {
        width: 100%;
        padding: 12px;
    }
    .league-sidebar-current {
        transform: none;
    }
    .league-top-banner {
        padding: 12px;
    }
    .league-banner-title {
        font-size: 24px;
        line-height: 1.1;
    }
    .league-banner-subtitle {
        font-size: 13px;
        line-height: 1.35;
    }
    .league-current-card {
        padding: 12px;
    }
    .league-current-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .league-group-title {
        font-size: 24px;
        padding: 10px;
    }
    .league-group-note {
        font-size: 12px;
        padding: 8px 10px;
    }
    .league-group .leaderboard-list {
        padding: 8px;
    }
    .leaderboard-item {
        padding: 10px 12px;
        gap: 8px;
    }
    .leaderboard-rank {
        font-size: 18px;
        min-width: 40px;
    }
    .leaderboard-avatar {
        margin: 0 2px;
    }
    .leaderboard-avatar img {
        width: 34px;
        height: 34px;
    }
    .leaderboard-nickname {
        font-size: 14px;
    }
    .leaderboard-username {
        font-size: 11px;
    }
    .leaderboard-rating {
        font-size: 16px;
        min-width: 52px;
    }
    .rating-container .leaderboard-item {
        grid-template-columns: 40px 34px minmax(0, 1fr) auto;
        column-gap: 8px;
    }
    .rating-container .leaderboard-rating {
        min-width: 52px;
        margin-left: 4px;
    }
    .league-current-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        font-size: 13px;
    }
    .league-zones {
        gap: 8px;
        font-size: 12px;
    }
    .league-rating-total {
        display: none;
    }
    .about-title {
        font-size: 40px;
    }
    .about-subtitle {
        font-size: 20px;
    }
    .nav-items a {
        min-width: 50px;
        height: auto;
    }
    .nav-items li {
        font-size: 12px;
        padding: 25px 8px;
        padding-left: 20px;
    }
    .leagues-sidebar-list {
        gap: 8px;
    }
    .leagues-sidebar-item {
        padding: 10px;
    }
    .leagues-sidebar-meta {
        font-size: 11px;
    }
    .profile-layout {
        margin: 16px auto;
        padding-left: 12px;
        padding-right: 12px;
        gap: 12px;
    }
    .profile-shell {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .profile-sidebar {
        position: static;
    }
    .profile-guest-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    .profile-summary-card {
        padding: 14px;
    }
    .profile-avatar-col {
        width: 100%;
        align-items: center;
        justify-content: center;
    }
    .profile-avatar-wrapper {

        /* padding-top: 30px; */
        margin-top: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
    }
    .profile-avatar-wrapper .avatar-img {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
    .profile-name {
        font-size: 26px;
    }
    .profile-username {
        font-size: 15px;
    }
    .profile-stat-group {
        padding: 8px;
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .profile-achievements-list {
        grid-template-columns: 1fr;
    }

    .settings-page .settings-group-grid {
        grid-template-columns: 1fr;
    }

    .settings-page .settings-title {
        font-size: 21px;
    }
}

@media (max-width: 480px) {
    .task-wrapper,
    .habit-wrapper {
        grid-template-columns: 34px minmax(0, 1fr) 32px;
        gap: 8px;
        padding: 9px 10px;
    }

    .checkbox-container {
        padding-left: 30px;
    }

    .checkmark {
        width: 28px;
        height: 28px;
    }

    .task-title,
    .habit-title {
        font-size: 13px;
    }

    .task-meta,
    .habit-meta {
        gap: 5px;
        margin-top: 5px;
    }

    .leagues-layout {
        margin: 10px auto;
        gap: 8px;
        padding-left: 8px;
        padding-right: 8px;
    }
    .league-top-banner {
        padding: 10px;
    }
    .league-banner-title {
        font-size: 20px;
    }
    .league-banner-subtitle {
        font-size: 12px;
    }
    .league-title-with-icon {
        gap: 6px;
    }
    .league-title-icon {
        width: 20px;
        height: 20px;
    }
    .league-name-value {
        font-size: 20px;
    }

    .league-points-value {
        font-size: 24px;
    }

    .league-points-row {
        padding: 7px 8px;
    }
    .section-title {
        font-size: 17px;
    }
    .league-group-title {
        font-size: 20px;
    }
    .leaderboard-item {
        padding: 8px 10px;
    }
    .leaderboard-rank {
        min-width: 30px;
        font-size: 16px;
    }
    .leaderboard-avatar img {
        width: 30px;
        height: 30px;
    }
    .leaderboard-nickname {
        font-size: 13px;
    }
    .leaderboard-rating {
        font-size: 14px;
        min-width: 44px;
    }
    .rating-container .leaderboard-item {
        grid-template-columns: 30px 30px minmax(0, 1fr) auto;
        column-gap: 6px;
    }
    .rating-container .leaderboard-rating {
        min-width: 44px;
        margin-left: 2px;
    }
    .league-current-grid {
        font-size: 12px;
    }
    .league-zones {
        font-size: 11px;
    }
    .leagues-sidebar-meta {
        flex-wrap: wrap;
        row-gap: 4px;
    }
    .league-players-count {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
    .about-title {
        font-size: 32px;
    }
    .about-subtitle {
        font-size: 16px;
    }
    .profile-layout {
        margin: 10px auto;
        padding-left: 8px;
        padding-right: 8px;
    }
    .profile-card {
        padding: 10px;
    }
    .profile-summary-card {
        padding: 10px;
    }
    .profile-name {
        font-size: 22px;
    }
    .profile-stat-col {
        gap: 8px;
    }
    .profile-league-meta-grid {
        grid-template-columns: 1fr;
    }
    .profile-rating-top strong {
        font-size: 24px;
    }

    .settings-page .settings-head,
    .settings-page .settings-group-card,
    .settings-page .settings-card,
    .settings-page .settings-security-card {
        padding: 10px;
    }

    .settings-page .settings-title {
        font-size: 19px;
    }

    .settings-page .settings-subtitle {
        font-size: 12px;
    }

    .settings-page .profile-btn {
        min-width: 0;
        width: 100%;
    }

    .about-hero {
        flex-direction: column;
        padding: 32px 20px;
        gap: 20px;
    }
    .about-hero img {
        width: 80px;
        height: auto;
    }
    #about-logo-2 {
        display: none;
    }
}

/* layout for task columns
.columns-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 0;
} */
/* .task-column {
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 4px;
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
} */

/* #endregion */
