/*
 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 * DO NOT EDIT THIS FILE — IT IS AUTO-GENERATED AND WILL BE OVERWRITTEN.
 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 *
 * Source files: app/static/css/src/  (edit those instead)
 * Build order:  app/static/css/src/manifest.json
 * Rebuild:      cd frontend && npm run build:css
 */

/* ── base/reset.css ── */

: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;
}

:focus:not(:focus-visible) {
    outline: none;
}

button,
a,
input,
select,
textarea,
[tabindex] {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

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;
}

body.mobile-drag-active .swipe-track > [data-mobile-panel] {
    overflow-y: 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;
}

/* ── pages/home.css ── */

.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;
}

/* ── components/header.css ── */

.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: flex;
    flex-direction: column;
    z-index: 60;
}

.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);
}

/* ── components/app-header.css ── */

.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;
}

/* ── layout/grid.css ── */

.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, actions — display: tasks, habits, actions) */
@media (min-width: 769px) {
    .swipe-track > .tasks   { order: 1; }
    .swipe-track > .habits  { order: 2; }
    .swipe-track > .actions { order: 3; }
}

/* ── layout/blocks.css ── */

.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;
    align-items: center;
    margin-bottom: 12px;
}

.card-head-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.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;
}

/* ── pages/profile.css ── */

.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;
}

.profile-avatar-emoji-btn {
    margin-top: 8px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #c0c0cc;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.profile-avatar-emoji-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
}

body.light-theme .profile-avatar-emoji-btn {
    background: #f0f4f8;
    border-color: #d0dae4;
    color: #4a5a6a;
}

body.light-theme .profile-avatar-emoji-btn:hover {
    background: #e2eaf3;
    color: #2b3d52;
}

/* ── components/rating-widgets.css ── */

.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;
}

@keyframes ratingBarFill {
    from { width: 0%; }
    to   { width: var(--bar-width, 0%); }
}

.rating-bar-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 4px;
    animation: ratingBarFill 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.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;
}

/* ── pages/achievements.css ── */

.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;
}

/* ─── Превью достижений в профиле (иконка + текст) ─────────────────────────── */
/* Повышенная специфичность: базовый .profile-achievements-list li (rating-page.css)
   идёт позже в манифесте и иначе перебил бы строчную раскладку. */
.profile-card .profile-achievements-list li {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.profile-achievement-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}
.profile-achievement-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ─── Страница достижений (React, /achievements) ──────────────────────────── */
.ach-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 40px;
}

.ach-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 12px;
}
.ach-h1 { font-size: 24px; font-weight: 600; margin: 0; color: var(--color-text); }
.ach-count { font-size: 15px; color: var(--color-text-muted); }
.ach-count strong { color: var(--color-accent); font-size: 18px; }

.ach-section { display: flex; flex-direction: column; gap: 12px; }
.ach-section-title { font-size: 18px; font-weight: 500; margin: 0; color: var(--color-text); }

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

.ach-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.ach-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-accent);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.ach-card:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
.ach-card.ach-done { border-color: var(--color-accent); }

/* Секретные — отличающийся hover: не приподнимаются, а мистически подсвечиваются фиолетовым. */
.ach-secret { opacity: 0.65; }
.ach-secret:hover {
    transform: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
    opacity: 0.9;
    cursor: help;
    animation: ach-wiggle 0.4s ease;
}
@keyframes ach-wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-1.5deg); }
    75% { transform: rotate(1.5deg); }
}

.ach-icon-wrap { position: relative; flex-shrink: 0; }
.ach-icon { width: 52px; height: 52px; object-fit: contain; display: block; }
.ach-icon-empty,
.ach-icon-lock {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--color-surface);
    border-radius: 10px;
    color: var(--color-text-muted);
}
.ach-card:not(.ach-done) .ach-icon { filter: grayscale(0.55); opacity: 0.85; }

.ach-check {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    font-weight: 700;
}

.ach-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ach-title-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ach-title-main { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ach-title { font-weight: 600; color: var(--color-text); font-size: 15px; }
.ach-tier-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1px 6px;
    flex-shrink: 0;
    white-space: nowrap;
}
.ach-desc { font-size: 13px; color: var(--color-text-muted); line-height: 1.35; }

.ach-tier-pips { display: inline-flex; gap: 3px; flex-shrink: 0; }
.ach-pip {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}
.ach-pip.on { background: var(--color-accent); border-color: var(--color-accent); }

.ach-progress { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ach-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--color-surface);
    overflow: hidden;
}
.ach-bar-fill { height: 100%; border-radius: 3px; background: var(--color-accent); transition: width 0.4s ease; }
.ach-progress-text { font-size: 12px; color: var(--color-text-muted); flex-shrink: 0; white-space: nowrap; }

.ach-reward {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-accent);
    background: var(--color-surface);
    border-radius: 6px;
    padding: 1px 6px;
    flex-shrink: 0;
}

.ach-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.ach-empty {
    color: var(--color-text-muted);
    font-size: 15px;
    padding: 24px 4px;
}

/* ─── Тулбар: фильтры + сортировка ────────────────────────────────────────── */
.ach-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.ach-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ach-chip {
    border: 1px solid var(--color-border);
    background: var(--color-bg-panel);
    color: var(--color-text-muted);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ach-chip:hover { color: var(--color-text); }
.ach-chip.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}
.ach-sort-btn {
    border: 1px solid var(--color-border);
    background: var(--color-bg-panel);
    color: var(--color-text-muted);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.ach-sort-btn:hover { color: var(--color-text); }
.ach-sort-btn.active { color: var(--color-accent); border-color: var(--color-accent); }

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

/* ─── Модалка разблокировки ───────────────────────────────────────────────── */
.ach-unlock-modal { text-align: center; }
.ach-unlock-list {
    list-style: none;
    margin: 14px 0 4px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ach-unlock-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-accent);
    border-radius: 12px;
    text-align: left;
}
.ach-unlock-icon { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.ach-unlock-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ach-unlock-name { font-weight: 600; color: var(--color-text); font-size: 15px; }
.ach-unlock-desc { font-size: 13px; color: var(--color-text-muted); line-height: 1.35; }
.ach-unlock-reward { font-size: 13px; color: var(--color-accent); font-weight: 600; }

/* ─── Модалка деталей достижения ──────────────────────────────────────────── */
/* Панель на базе .confirm-dialog: шире и с левым выравниванием (двойной класс — чтобы
   перебить .confirm-dialog{max-width:400;text-align:center} независимо от порядка). */
.confirm-dialog.ach-detail-modal {
    max-width: 460px;
    text-align: left;
}
.ach-detail { display: flex; flex-direction: column; gap: 14px; }
.ach-detail-head { display: flex; gap: 14px; align-items: center; }
.ach-detail-icon-wrap { flex-shrink: 0; }
.ach-detail-icon { width: 72px; height: 72px; object-fit: contain; display: block; }
.ach-detail-icon-wrap:not(.done) .ach-detail-icon { filter: grayscale(0.5); opacity: 0.85; }
.ach-detail-lock {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    background: var(--color-surface);
    border-radius: 14px;
    color: var(--color-text-muted);
}
.ach-detail-title { font-size: 20px; font-weight: 600; color: var(--color-text); }
.ach-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ach-detail-tag {
    font-size: 12px;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 2px 8px;
}
.ach-detail-tag--done { color: var(--color-accent); border-color: var(--color-accent); }
.ach-detail-desc { color: var(--color-text-muted); font-size: 14px; line-height: 1.4; margin: 0; }
.ach-detail-progress { display: flex; align-items: center; gap: 10px; }
.ach-detail-reward { font-size: 14px; color: var(--color-text-muted); }
.ach-detail-reward strong { color: var(--color-accent); }

.ach-ladder { border-top: 1px solid var(--color-border); padding-top: 12px; }
.ach-ladder-title { font-size: 13px; color: var(--color-text-muted); margin-bottom: 8px; }
.ach-ladder-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ach-ladder-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--color-surface);
    border: 1px solid transparent;
    font-size: 13px;
    color: var(--color-text-muted);
}
.ach-ladder-row.current { border-color: var(--color-accent); }
.ach-ladder-row.done .ach-ladder-name { color: var(--color-text); }
.ach-ladder-tier { font-weight: 600; flex-shrink: 0; }
.ach-ladder-name { flex: 1; min-width: 0; }
.ach-ladder-meta { flex-shrink: 0; white-space: nowrap; }
.ach-detail-actions { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ── pages/streak-stats.css ── */

.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;
    }
}

/* ── pages/tasks-habits-shared.css ── */

.tasks-list,
.habits-list,
.actions-list {
    list-style: none;
    width: 100%;
    padding: 0;
    margin: 0;
    margin-bottom: 5px;
}

@keyframes itemFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.task-item,
.habit-item,
.action-item {
    background: #1c1c1c;
    transition: background 0.15s ease, border-color 0.15s ease,
                transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    border: 1px solid #2d2d2d;
    border-radius: 10px;
    margin-bottom: 10px;
    -webkit-user-select: none;
    user-select: none;
    animation: itemFadeIn 0.25s ease backwards;
}

.habit-item:nth-child(1), .task-item:nth-child(1), .action-item:nth-child(1) { animation-delay: 0s; }
.habit-item:nth-child(2), .task-item:nth-child(2), .action-item:nth-child(2) { animation-delay: 0.05s; }
.habit-item:nth-child(3), .task-item:nth-child(3), .action-item:nth-child(3) { animation-delay: 0.10s; }
.habit-item:nth-child(4), .task-item:nth-child(4), .action-item:nth-child(4) { animation-delay: 0.15s; }
.habit-item:nth-child(5), .task-item:nth-child(5), .action-item:nth-child(5) { animation-delay: 0.18s; }
.habit-item:nth-child(n+6), .task-item:nth-child(n+6), .action-item:nth-child(n+6) { animation-delay: 0.20s; }

.task-item,
.habit-item,
.action-item {
    cursor: grab;
}

.task-item:active,
.habit-item:active,
.action-item:active {
    cursor: grabbing;
}

.task-item.is-dragging-task,
.habit-item.is-dragging-habit,
.action-item.is-dragging-action {
    /* CHECK: Might be used via JS */
    /* Disable the itemFadeIn entrance animation while dragging: each touchmove
       re-inserts this node in the DOM, which restarts the animation and makes the
       opacity flicker between the keyframe (0->1) and the .55 drag state. */
    animation: none;
    opacity: 0.55;
    border-color: rgba(71, 120, 235, 0.7);
    background: #232a3c;
}


@media (hover: none) and (pointer: coarse) {
    .task-item,
    .habit-item,
    .action-item {
        position: relative;
        overflow: hidden;
    }

    .task-item:hover,
    .habit-item:hover,
    .action-item:hover {
        transform: none;
        box-shadow: none;
        border-color: #2d2d2d;
    }

    .task-item.is-touch-drag-arming,
    .habit-item.is-touch-drag-arming,
    .action-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,
    .action-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,
    .action-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);
}

.actions ul.actions-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,
.action-item:hover {
    background: #2d2d2d;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
    border-color: rgba(71, 120, 235, 0.35);
}

.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;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    margin-bottom: 6px;
}

.subtasks-bar {
    height: 3px;
    width: 100%;
    background: rgba(71, 120, 235, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.subtasks-bar-fill {
    height: 100%;
    width: var(--w, 0%);
    background: var(--color-accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}


.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;
}

.subtask-collapse-btn {
    display: block;
    margin-top: 5px;
    background: none;
    border: none;
    padding: 2px 0;
    font-size: 12px;
    color: var(--color-text-muted);
    cursor: pointer;
    text-align: left;
    transition: color 0.15s;
}

.subtask-collapse-btn:hover {
    color: var(--color-accent);
}

.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 {
    opacity: 0.65;
    color: #999;
}

/* ── Окрас карточек в цвет тега (настройки → Внешний вид) ───────────────────
   Заливка реализована полупрозрачным background-image поверх собственного
   background-color карточки — поэтому корректно работает и в тёмной, и в
   светлой теме без отдельных значений цвета. */

/* Цвет первого тега — равномерная заливка */
.task-item.card-tint-first,
.habit-item.card-tint-first,
.action-item.card-tint-first {
    background-image: linear-gradient(0deg,
        color-mix(in srgb, var(--card-color) 5%, transparent),
        color-mix(in srgb, var(--card-color) 5%, transparent));
    border-color: color-mix(in srgb, var(--card-color) 24%, #2d2d2d);
}

/* Градиент по всем тегам (--card-gradient строится в helpers.js).
   Собственный бордер карточки прозрачный — рамку рисует <GradientBorder>
   (кольцо-оверлей с mask-composite, см. .gradient-border ниже). */
.task-item.card-tint-gradient,
.habit-item.card-tint-gradient,
.action-item.card-tint-gradient {
    position: relative;
    background-image: var(--card-gradient);
    border-color: transparent;
}

/* Кольцо градиентного бордера: слой с градиентом, у которого маской вырезана
   середина — остаётся только рамка. Уважает border-radius. */
.gradient-border {
    position: absolute;
    inset: 0;
    border-radius: var(--gb-radius, 10px);
    padding: var(--gb-width, 1.5px);
    background: var(--gb-gradient);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

/* Сохраняем заливку на hover: базовый :hover задаёт background-шорткатом и
   сбрасывает background-image, поэтому переопределяем явно. */
.task-item.card-tint-first:hover,
.habit-item.card-tint-first:hover,
.action-item.card-tint-first:hover {
    background-color: #2d2d2d;
    background-image: linear-gradient(0deg,
        color-mix(in srgb, var(--card-color) 8%, transparent),
        color-mix(in srgb, var(--card-color) 8%, transparent));
}

.task-item.card-tint-gradient:hover,
.habit-item.card-tint-gradient:hover,
.action-item.card-tint-gradient:hover {
    background-color: #2d2d2d;
    background-image: var(--card-gradient);
    border-color: transparent;
}

/* Полоска из всех тегов — левый сегментированный бар (--card-stripe) */
.task-item.card-stripe,
.habit-item.card-stripe,
.action-item.card-stripe {
    position: relative;
}

/* Оверлей во всю карточку с тем же скруглением (10px), цветная полоса нарисована
   фоном только в левых 4px. Скругление углов карточки обрезает полосу по дуге —
   она следует закруглению карточки, а не скругляется отдельным радиусом. */
.task-item.card-stripe::after,
.habit-item.card-stripe::after,
.action-item.card-stripe::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: var(--card-stripe) left center / 4px 100% no-repeat;
    pointer-events: none;
    z-index: 1;
}

/* Светлая тема: заливка полупрозрачная и адаптируется сама, но базовое правило
   светлой темы задаёт background-шорткатом и сбрасывает background-image —
   переопределяем с более высокой специфичностью. */
body.light-theme .task-item.card-tint-first,
body.light-theme .habit-item.card-tint-first,
body.light-theme .action-item.card-tint-first {
    background-color: #ffffff;
    background-image: linear-gradient(0deg,
        color-mix(in srgb, var(--card-color) 7%, transparent),
        color-mix(in srgb, var(--card-color) 7%, transparent));
    border-color: color-mix(in srgb, var(--card-color) 26%, #dce1e6);
}

body.light-theme .task-item.card-tint-gradient,
body.light-theme .habit-item.card-tint-gradient,
body.light-theme .action-item.card-tint-gradient {
    background-color: #ffffff;
    background-image: var(--card-gradient);
    border-color: transparent;
}

body.light-theme .task-item.card-tint-first:hover,
body.light-theme .habit-item.card-tint-first:hover {
    background-color: #f6f8fb;
}

body.light-theme .task-item.card-tint-gradient:hover,
body.light-theme .habit-item.card-tint-gradient:hover {
    background-color: #f6f8fb;
}

/* ── pages/tasks-habits-specific.css ── */

.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;
}

/* ── Actions (countable: +/−) ── */
/* Базовые стили списка/карточки и весь drag-and-drop (.actions-list, .action-item,
   .is-dragging-action, touch-drag, .drag-over) — общие с задачами/привычками,
   см. tasks-habits-shared.css. Здесь только специфика действий. */
.actions {
    min-height: 200px;
    align-items: flex-start;
}

.action-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.action-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.action-btn:active {
    transform: scale(0.92);
}

.action-btn.positive:disabled,
.action-btn.negative:disabled {
    color: #555;
    border-color: rgba(255, 255, 255, 0.08);
    cursor: default;
    opacity: 0.6;
}

.action-btn.positive:disabled:hover,
.action-btn.negative:disabled:hover {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
}

.action-btn:disabled:active {
    transform: none;
}

.action-btn.positive {
    color: #6fd06f;
    border-color: rgba(95, 170, 95, 0.35);
}

.action-btn.positive:hover {
    background: rgba(95, 170, 95, 0.15);
    border-color: rgba(95, 170, 95, 0.6);
}

.action-btn.negative {
    color: #ff7676;
    border-color: rgba(255, 118, 118, 0.35);
}

.action-btn.negative:hover {
    background: rgba(255, 118, 118, 0.15);
    border-color: rgba(255, 118, 118, 0.6);
}

.action-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.action-title {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    color: #fff;
}

.action-notes {
    font-size: 13px;
    color: #aaa;
    margin-top: 2px;
}

.action-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.action-count-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #2d2d2d;
    font-weight: 600;
}

.action-count-positive {
    color: #aaffaa;
    background: #234a23;
}

.action-count-negative {
    color: #ffbcbc;
    background: #4a2330;
}

.action-actions {
    flex: none;
}

/* Переключатель направления действия в модалке создания/редактирования */
.action-polarity-toggle {
    display: flex;
    gap: 8px;
}

.action-polarity-option {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: #bbb;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.action-polarity-option.positive.is-active {
    color: #aaffaa;
    background: rgba(95, 170, 95, 0.18);
    border-color: rgba(95, 170, 95, 0.6);
}

.action-polarity-option.negative.is-active {
    color: #ffbcbc;
    background: rgba(255, 118, 118, 0.16);
    border-color: rgba(255, 118, 118, 0.6);
}

/* Профиль: ячейки с перенесённым графиком/стриком занимают всю ширину сетки */
.profile-stats-cell {
    width: 100%;
}

.profile-stats-cell .stats-block {
    margin: 0;
}

/* ── components/days-selector.css ── */

.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;
}

/* ── components/buttons.css ── */

.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;
}

/* ── components/checkbox.css ── */

.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;
}

@keyframes checkmarkPop {
    0%   { transform: scale(0.5);  opacity: 0; }
    60%  { transform: scale(1.35); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

@keyframes checkmarkBgPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.checkmark,
.task-subtask-checkmark {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #262626;
    border: 2px solid #4778eb;
    border-radius: 2px;
    transition: background-color 0.2s ease, border-color 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;
    animation: checkmarkBgPop 0.22s ease forwards;
}

.checkbox-container input:checked~.checkmark .checkmark-icon,
.task-subtask-checkbox:checked~.task-subtask-checkmark .checkmark-icon {
    animation: checkmarkPop 0.28s cubic-bezier(0.34, 1.5, 0.64, 1) forwards;
}

/* While a card is being dragged it gets re-inserted in the DOM on every move,
   which restarts the checkmark pop animation on completed items. Freeze it. */
.task-item.is-dragging-task .checkmark,
.task-item.is-dragging-task .checkmark-icon,
.habit-item.is-dragging-habit .checkmark,
.habit-item.is-dragging-habit .checkmark-icon {
    animation: none !important;
}

/* ── components/filters.css ── */

.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;
}

/* ── layout/footer.css ── */

.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%;
        z-index: 37;
    }

    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: calc(100vh - 72px - env(safe-area-inset-bottom));
        height: calc(100dvh - 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;
        min-height: 0;
        height: 100%;
        box-sizing: border-box;
        padding: 16px 16px calc(80px + env(safe-area-inset-bottom)) 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);
    }
}

/* ── components/modals.css ── */

.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%;
    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%;
    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;
    pointer-events: none;
}

.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;
}

.subtasks-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.subtask-add-btn {
    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;
    flex: 1;
    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);
}

.subtask-ai-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(139, 92, 246, 0.14);
    border: 1px dashed rgba(139, 92, 246, 0.5);
    border-radius: 9px;
    color: #d8b4fe;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    white-space: nowrap;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.subtask-ai-btn:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.24);
    border-color: rgba(167, 139, 250, 0.8);
}

.subtask-ai-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.subtask-ai-error {
    font-size: 12px;
    color: #f87171;
    margin-top: 6px;
}

.subtask-guest-banner {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 10px;
    background: rgba(251, 191, 36, 0.07);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subtask-guest-banner-text {
    font-size: 13px;
    color: #fde68a;
    line-height: 1.45;
}

.subtask-guest-banner-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.subtask-guest-banner-close {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 7px;
    color: #aaa;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 12px;
    transition: background 0.15s, color 0.15s;
}

.subtask-guest-banner-close:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ddd;
}

.subtask-guest-banner-register {
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.5);
    border-radius: 7px;
    color: #fde68a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 12px;
    transition: background 0.15s;
}

.subtask-guest-banner-register:hover {
    background: rgba(251, 191, 36, 0.32);
}

/* AI suggestions panel */
.subtask-suggestions {
    margin-top: 10px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 10px;
    padding: 12px;
    background: rgba(139, 92, 246, 0.07);
}

.subtask-suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.subtask-suggestions-title {
    font-size: 12px;
    font-weight: 600;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.subtask-suggestions-regen {
    background: none;
    border: none;
    font-size: 12px;
    color: #a78bfa;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.subtask-suggestions-regen:hover:not(:disabled) {
    color: #c4b5fd;
}

.subtask-suggestions-regen:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.subtask-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.subtask-suggestion-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.subtask-suggestion-input {
    flex: 1;
    font-size: 13px;
    padding: 6px 10px;
}

.subtask-suggestions-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.subtask-suggestions-cancel {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 7px;
    color: #aaa;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 14px;
    transition: background 0.15s, color 0.15s;
}

.subtask-suggestions-cancel:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.07);
    color: #ddd;
}

.subtask-suggestions-confirm {
    background: rgba(139, 92, 246, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 7px;
    color: #e9d5ff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 14px;
    transition: background 0.15s;
}

.subtask-suggestions-confirm:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.38);
}

.subtask-suggestions-confirm:disabled,
.subtask-suggestions-cancel:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.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);
}

/* ── pages/auth.css ── */

.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;
}

/* ── pages/about.css ── */

.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;
}

/* ── layout/responsive.css ── */

@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;
        height: 100dvh;
        box-sizing: border-box;
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 12px);
        background: #2d2d2d;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 65;
        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;
}

/* ── pages/rating-page.css ── */

.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;
}

/* ── Заголовок «Вокруг меня» + плашка с местом ── */
.leaderboard .card-head {
    flex-direction: column;
    gap: 6px;
}

.rating-my-rank {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.rating-my-rank strong {
    font-size: 16px;
    color: #6b9fff;
    font-weight: 700;
}

.rating-my-rank-total {
    color: rgba(255, 255, 255, 0.5);
}

/* ── Затемнение списка сверху и снизу ── */
.leaderboard-fade {
    position: relative;
    width: 100%;
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 40px,
        #000 calc(100% - 40px),
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 40px,
        #000 calc(100% - 40px),
        transparent 100%
    );
}

/* ── Компактные карточки игроков ── */
.leaderboard-list-compact {
    padding: 28px 0;
}

.rating-container .leaderboard-list-compact .leaderboard-item {
    grid-template-columns: 40px 38px minmax(0, 1fr) auto;
    column-gap: 10px;
    padding: 9px 14px;
    margin-bottom: 8px;
    border-radius: 10px;
}

.leaderboard-list-compact .leaderboard-rank {
    min-width: 40px;
    font-size: 18px;
}

.leaderboard-list-compact .leaderboard-avatar img {
    width: 38px;
    height: 38px;
}

.leaderboard-list-compact .leaderboard-nickname {
    font-size: 15px;
    margin-bottom: 2px;
}

.leaderboard-list-compact .leaderboard-username {
    font-size: 12px;
}

.leaderboard-list-compact .leaderboard-league {
    margin-top: 4px;
    padding: 2px 7px;
    font-size: 11px;
}

.leaderboard-list-compact .leaderboard-rating {
    font-size: 19px;
    min-width: 56px;
}

/* ── Выделение собственной строки ── */
.leaderboard-item-me {
    background: linear-gradient(135deg, rgba(71, 120, 235, 0.22), rgba(71, 120, 235, 0.08));
    border-color: rgba(111, 158, 255, 0.85);
    box-shadow: 0 0 0 1px rgba(111, 158, 255, 0.35), 0 6px 18px rgba(71, 120, 235, 0.2);
}

.leaderboard-item-me:hover {
    border-color: rgba(111, 158, 255, 0.95);
}

.leaderboard-self-badge {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #dbe8ff;
    background: rgba(71, 120, 235, 0.35);
    border: 1px solid rgba(111, 158, 255, 0.6);
    vertical-align: middle;
}

.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-tabs {
    display: flex;
    gap: 8px;
    max-width: 1240px;
    margin: 24px auto 0;
    padding: 0 4px;
}

.league-tab {
    flex: 0 0 auto;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.league-tab:hover {
    color: rgba(255, 255, 255, 0.85);
}

.league-tab-active {
    color: #fff;
    background: rgba(71, 120, 235, 0.18);
    border-color: rgba(71, 120, 235, 0.55);
}

.league-daily-last {
    width: 100%;
    background: #1c1c1c;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.league-daily-bonus {
    color: #4ade80;
    font-weight: 600;
}

/* ── Горизонтальная лента истории дневных лиг (вариант B) ── */
.league-history-strip {
    width: 100%;
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
}

.league-history-strip-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
}

.league-history-track {
    list-style: none;
    margin: 0;
    padding: 2px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.league-history-tile {
    flex: 0 0 auto;
    min-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    scroll-snap-align: start;
}

.league-history-tile-date {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
}

.league-history-tile-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.league-history-tile-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.league-history-tile-place-label {
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

.league-history-tile-bonus {
    font-size: 12px;
    font-weight: 700;
    color: #4ade80;
}

.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: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
    transition: transform 0.18s ease, filter 0.18s ease;
}

/* Парадная иконка лиги в карточке текущей лиги */
.league-current-header .league-title-icon {
    width: 52px;
    height: 52px;
    padding: 6px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 62%),
        rgba(255, 255, 255, 0.04);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 4px 14px rgba(0, 0, 0, 0.45);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
    animation: league-icon-float 4.5s ease-in-out infinite;
}

@keyframes league-icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .league-current-header .league-title-icon {
        animation: none;
    }
}

.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;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.leagues-sidebar-item:hover {
    transform: translateY(-2px);
    border-color: rgba(111, 158, 255, 0.7);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.leagues-sidebar-item:hover .league-title-icon {
    transform: scale(1.12);
    filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.55));
}

.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: 38px;
    height: 38px;
    padding: 4px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 65%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 3px 10px rgba(0, 0, 0, 0.4);
}

.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;
    min-height: 52px;
}

/* На десктопе сундук иначе наследует базовые 58px и вылезает за band'а
   (~45px). Уменьшаем до размера, который умещается в зону с запасом. */
body.leagues-page .league-group-chest-wrap {
    width: 46px;
    height: 46px;
}

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: 26px;
    height: 26px;
}

/* Парадная иконка лиги — крупный геральдический герб */
body.leagues-page .league-current-header .league-title-icon {
    width: 46px;
    height: 46px;
}

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: 32px;
    height: 32px;
}

@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-chest-wrap {
        left: 8px;
        width: 44px;
        height: 44px;
    }

    body.leagues-page .league-group-chest-wrap + .league-group-title-text {
        padding: 0 46px;
    }

    body.leagues-page .league-group-chest-badge {
        min-width: 20px;
        height: 19px;
        font-size: 11px;
        right: -7px;
    }

    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-select {
    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;
    cursor: pointer;
    appearance: auto;
}

.profile-select:focus {
    border-color: rgba(71, 120, 235, 0.75);
    box-shadow: 0 0 0 1px rgba(71, 120, 235, 0.3);
}

/* ── Timezone combobox ─────────────────────────────────── */

.tz-select {
    position: relative;
    width: 100%;
}

.tz-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #121212;
    color: #ffffff;
    border-radius: 10px;
    font-size: 14px;
    padding: 11px 12px;
    outline: none;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tz-select-trigger:hover,
.tz-select-trigger.open {
    border-color: rgba(71, 120, 235, 0.75);
    box-shadow: 0 0 0 1px rgba(71, 120, 235, 0.3);
}

.tz-select-trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tz-select-arrow {
    flex-shrink: 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    transition: transform 0.18s ease;
    display: inline-block;
}

.tz-select-arrow.open {
    transform: rotate(180deg);
}

.tz-select-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: #1d1d1d;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    z-index: 300;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.tz-select-search-wrap {
    padding: 10px 10px 0;
}

.tz-select-search {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    color: #ffffff;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.tz-select-search::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.tz-select-search:focus {
    border-color: rgba(71, 120, 235, 0.6);
}

.tz-select-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.tz-select-group-label {
    padding: 8px 14px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.35);
    user-select: none;
}

.tz-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.12s;
    gap: 8px;
}

.tz-select-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tz-select-option.selected {
    background: rgba(71, 120, 235, 0.16);
}

.tz-select-option-label {
    font-size: 13px;
    color: #e8e8e8;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tz-select-option.selected .tz-select-option-label {
    color: #6b9aff;
}

.tz-select-option-msk {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.tz-select-option.selected .tz-select-option-msk {
    color: rgba(107, 154, 255, 0.75);
}

.tz-select-option-utc {
    color: rgba(255, 255, 255, 0.25);
}

.tz-select-option.selected .tz-select-option-utc {
    color: rgba(107, 154, 255, 0.45);
}

.tz-select-empty {
    padding: 16px 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
}

.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 {
    color: #8c9bb0;
}

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 .tag-badge,
body.light-theme .tag-filter-chip,
body.light-theme .tag-chip {
    background: color-mix(in srgb, var(--tag-color, #888888) 18%, #edf2f8);
    color: color-mix(in srgb, var(--tag-color, #333333) 55%, #546a82);
}

body.light-theme .tag-filter-chip:hover {
    background: color-mix(in srgb, var(--tag-color, #888888) 26%, #edf2f8);
}

body.light-theme .tag-filter-chip.active {
    background: color-mix(in srgb, var(--tag-color, #888888) 32%, #e2e9f2);
    color: color-mix(in srgb, var(--tag-color, #222222) 65%, #2b4258);
}

body.light-theme .tag-chip-remove {
    color: #7a92a8;
}

body.light-theme .tag-chip-remove:hover {
    color: #2b4258;
}

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 .league-history-strip {
    background: #ffffff;
    border-color: #dce1e6;
}

body.light-theme .league-history-strip-title {
    color: #6f8198;
}

body.light-theme .league-history-tile {
    background: #f8fafc;
    border-color: #dce1e6;
}

body.light-theme .league-history-tile-date {
    color: #2f3b4a;
}

body.light-theme .league-history-tile-place {
    color: #1f2937;
}

body.light-theme .league-history-tile-place-label {
    color: #8595a8;
}

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 .rating-my-rank {
    color: #61748b;
}

body.light-theme .rating-my-rank strong {
    color: #3f6ea0;
}

body.light-theme .rating-my-rank-total {
    color: #8ea0b5;
}

body.light-theme .leaderboard-item-me {
    background: linear-gradient(135deg, rgba(74, 118, 168, 0.18), rgba(74, 118, 168, 0.07));
    border-color: rgba(74, 118, 168, 0.6);
    box-shadow: 0 0 0 1px rgba(74, 118, 168, 0.25), 0 6px 18px rgba(74, 118, 168, 0.15);
}

body.light-theme .leaderboard-self-badge {
    color: #2f5d8f;
    background: rgba(74, 118, 168, 0.16);
    border-color: rgba(74, 118, 168, 0.5);
}

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 .subtask-ai-btn {
    background: rgba(109, 40, 217, 0.07);
    border-color: rgba(109, 40, 217, 0.35);
    color: #6d28d9;
}

body.light-theme .subtask-ai-btn:hover:not(:disabled) {
    background: rgba(109, 40, 217, 0.13);
}

body.light-theme .subtask-ai-error {
    color: #dc2626;
}

body.light-theme .subtask-guest-banner {
    background: rgba(217, 119, 6, 0.06);
    border-color: rgba(217, 119, 6, 0.3);
}

body.light-theme .subtask-guest-banner-text {
    color: #92400e;
}

body.light-theme .subtask-guest-banner-close {
    border-color: rgba(0, 0, 0, 0.18);
    color: #555;
}

body.light-theme .subtask-guest-banner-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #222;
}

body.light-theme .subtask-guest-banner-register {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.4);
    color: #92400e;
}

body.light-theme .subtask-guest-banner-register:hover {
    background: rgba(217, 119, 6, 0.18);
}

body.light-theme .subtask-suggestions {
    background: rgba(109, 40, 217, 0.05);
    border-color: rgba(109, 40, 217, 0.25);
}

body.light-theme .subtask-suggestions-title {
    color: #7c3aed;
}

body.light-theme .subtask-suggestions-regen {
    color: #7c3aed;
}

body.light-theme .subtask-suggestions-regen:hover:not(:disabled) {
    color: #5b21b6;
}

body.light-theme .subtask-suggestions-cancel {
    border-color: rgba(0, 0, 0, 0.2);
    color: #555;
}

body.light-theme .subtask-suggestions-cancel:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    color: #222;
}

body.light-theme .subtask-suggestions-confirm {
    background: rgba(109, 40, 217, 0.12);
    border-color: rgba(109, 40, 217, 0.4);
    color: #5b21b6;
}

body.light-theme .subtask-suggestions-confirm:hover:not(:disabled) {
    background: rgba(109, 40, 217, 0.2);
}

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,
body.light-theme.settings-page .profile-select {
    background: #f8fafc !important;
    border-color: #d2dbe6 !important;
    color: #1a2233 !important;
}

body.light-theme .tz-select-trigger {
    background: #f8fafc;
    border-color: #d2dbe6;
    color: #1a2233;
}

body.light-theme .tz-select-trigger:hover,
body.light-theme .tz-select-trigger.open {
    border-color: rgba(71, 120, 235, 0.6);
}

body.light-theme .tz-select-arrow {
    color: rgba(26, 34, 51, 0.45);
}

body.light-theme .tz-select-panel {
    background: #ffffff;
    border-color: #d2dbe6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body.light-theme .tz-select-search {
    background: #f1f4f9;
    border-color: #d2dbe6;
    color: #1a2233;
}

body.light-theme .tz-select-search::placeholder {
    color: rgba(26, 34, 51, 0.4);
}

body.light-theme .tz-select-group-label {
    color: rgba(26, 34, 51, 0.4);
}

body.light-theme .tz-select-option:hover {
    background: rgba(71, 120, 235, 0.06);
}

body.light-theme .tz-select-option-label {
    color: #1a2233;
}

body.light-theme .tz-select-option-msk {
    color: rgba(26, 34, 51, 0.45);
}

body.light-theme .tz-select-option-utc {
    color: rgba(26, 34, 51, 0.3);
}

body.light-theme .tz-select-empty {
    color: rgba(26, 34, 51, 0.4);
}

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;
    }
    .league-group-chest-wrap {
        left: 8px;
        width: 42px;
        height: 42px;
    }
    .league-group-chest-wrap + .league-group-title-text {
        padding: 0 44px;
    }
    .league-group-chest-badge {
        min-width: 20px;
        height: 19px;
        font-size: 11px;
        right: -7px;
    }
    .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 */

/* ════════════════════════════════════════════════════════════════════════
   Награды дневной лиги: сундуки на зонах, info-модалка лута, карточка-сундук
   вчерашнего приза, значок вкладки. Все анимации — под reduced-motion ниже.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Пилюля-награда в шапке зоны (живая таблица дневной лиги) ── */
.league-group-title {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* ── Сундук-награда слева в шапке зоны (золотой — чемпион, серебряный — повышение).
      Контейнер позиционируется абсолютно слева по центру band'а; внутри — картинка
      сундука и счётчик-бейдж с суммой приза, висящий на углу. ── */
.league-group-chest-wrap {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 58px;
    height: 58px;
    pointer-events: none;
    z-index: 1;
}

.league-group-chest {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Счётчик-бейдж «+N» на углу сундука. Тёмный чип с тёплым текстом читается
   и на золотом, и на серебряном сундуке; цвет окантовки — по зоне. */
.league-group-chest-badge {
    position: absolute;
    right: -20px;
    bottom: 6px;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #181c26;
    color: #ffe08a;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    border: 1.5px solid rgba(255, 224, 138, 0.55);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.league-group-chest-badge-winners {
    color: #e9eef5;
    border-color: rgba(220, 228, 240, 0.55);
}

.league-group-chest-badge-participants {
    color: #e8c79a;
    border-color: rgba(202, 160, 105, 0.55);
}

/* Симметричные поля держат заголовок по центру и гарантируют, что длинный
   текст («Зона повышения») не наедет на сундук слева. */
.league-group-chest-wrap + .league-group-title-text {
    padding: 0 64px;
}

/* Кнопка «i» рядом с заголовком на тёмном band'е (открывает состав награды). */
.league-reward-info {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    margin-left: 9px;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
}

.league-reward-info:hover {
    background: rgba(255, 255, 255, 0.26);
}

/* ── Карточки лута в info-модалке ── */
.loot-card-list {
    list-style: none;
    margin: 16px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.loot-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--loot-accent, #4e4eff);
}

.loot-card-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
}

.loot-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.loot-card-title {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.loot-card-amount {
    font-size: 18px;
    font-weight: 800;
    color: var(--loot-accent, #4e4eff);
}

/* ── Карточка-сундук вчерашнего приза (вкладка «Дневная») ──
   Транзиентна: тап → оверлей-празднование → награда улетает в плитку истории →
   карточка схлопывается. Постоянного «Получено» нет (дом награды — плитка). */
.daily-reward-chest {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 10px;
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Закрытая карточка должна читаться как КНОПКА, а не инфо-секция:
   акцентный фон зоны + бейдж + CTA + подъём на hover + вдавливание на :active. */
.daily-reward-chest.is-closed {
    position: relative;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease,
        box-shadow 0.18s ease, background 0.18s ease;
}

.daily-reward-chest-champion.is-closed {
    background: linear-gradient(135deg, rgba(244, 183, 64, 0.16), rgba(28, 28, 28, 0.5) 62%);
}

.daily-reward-chest-winners.is-closed {
    background: linear-gradient(135deg, rgba(179, 188, 201, 0.16), rgba(28, 28, 28, 0.5) 62%);
}

.daily-reward-chest-participants.is-closed {
    background: linear-gradient(135deg, rgba(202, 160, 105, 0.16), rgba(28, 28, 28, 0.5) 62%);
}

.daily-reward-chest.is-closed:hover {
    transform: translateY(-2px);
}

.daily-reward-chest-champion.is-closed:hover {
    border-color: rgba(244, 183, 64, 0.95);
    box-shadow: 0 8px 22px rgba(244, 183, 64, 0.28);
}

.daily-reward-chest-winners.is-closed:hover {
    border-color: rgba(179, 188, 201, 0.95);
    box-shadow: 0 8px 22px rgba(179, 188, 201, 0.24);
}

.daily-reward-chest-participants.is-closed:hover {
    border-color: rgba(202, 160, 105, 0.95);
    box-shadow: 0 8px 22px rgba(202, 160, 105, 0.24);
}

.daily-reward-chest.is-closed:active {
    transform: translateY(0) scale(0.99);
}

.daily-reward-chest.is-closed:focus-visible {
    outline: 2px solid rgba(255, 220, 130, 0.8);
    outline-offset: 2px;
}

/* Награда уже забрана (полёт идёт) → карточка гаснет перед схлопыванием. */
.daily-reward-chest.is-claimed {
    pointer-events: none;
    opacity: 0.45;
}

.daily-reward-chest.is-claimed .daily-reward-badge {
    display: none;
}

.daily-reward-chest-champion {
    border-color: rgba(244, 183, 64, 0.5);
}

.daily-reward-chest-winners {
    border-color: rgba(179, 188, 201, 0.5);
}

.daily-reward-chest-participants {
    border-color: rgba(202, 160, 105, 0.5);
}

/* Пульсирующая красная точка «не забрано» (как значок на вкладке) */
.daily-reward-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 2px #1c1c1c;
    animation: tab-badge-pulse 1.6s ease-in-out infinite;
}

/* CTA-«кнопка» справа — главный сигнал нажимаемости */
.daily-reward-cta {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #1c1c1c;
    white-space: nowrap;
    transition: filter 0.18s ease;
}

.daily-reward-chest-champion .daily-reward-cta {
    background: linear-gradient(135deg, #ffe08a, #f4b740);
}

.daily-reward-chest-winners .daily-reward-cta {
    background: linear-gradient(135deg, #eef1f6, #c2cad6);
}

.daily-reward-chest-participants .daily-reward-cta {
    background: linear-gradient(135deg, #e0b985, #b07f3f);
}

.daily-reward-chest.is-closed:hover .daily-reward-cta {
    filter: brightness(1.08);
}

.daily-reward-art-img {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    object-fit: contain;
}

.daily-reward-chest.is-closed:not(.is-claimed) .daily-reward-art-img {
    animation: chest-shimmer 2s ease-in-out infinite;
}

.daily-reward-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.daily-reward-amount {
    font-size: 20px;
    font-weight: 800;
    color: #4ade80;
}

.daily-reward-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* ── Оверлей-празднование (открытие сундука) ── */
.reward-celebrate {
    text-align: center;
    max-width: 340px;
    padding: 26px 28px 22px;
}

.reward-celebrate-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 132px;
    margin-bottom: 8px;
}

.reward-celebrate-chest {
    width: 104px;
    height: 104px;
    object-fit: contain;
}

.reward-celebrate-chest-champion {
    filter: drop-shadow(0 8px 22px rgba(244, 183, 64, 0.55));
}

.reward-celebrate-chest-winners {
    filter: drop-shadow(0 8px 22px rgba(179, 188, 201, 0.5));
}

.reward-celebrate-chest-participants {
    filter: drop-shadow(0 8px 22px rgba(202, 160, 105, 0.5));
}

.reward-celebrate-amount {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    color: #4ade80;
}

.reward-celebrate-sub {
    margin-top: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.reward-celebrate-btn {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
}

/* Конфетти: частицы absolute-центрированы в сцене, разлёт задаёт framer (x/y). */
.reward-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.reward-confetti-piece {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    margin: -4px 0 0 -4px;
    border-radius: 2px;
}

/* Летящая в плитку истории монета (portal, fixed; позицию задаёт inline-style) */
.reward-fly-coin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    color: #1c1c1c;
    pointer-events: none;
}

.reward-fly-coin-champion {
    background: radial-gradient(circle at 35% 30%, #ffe08a, #f4b740);
    box-shadow: 0 0 16px rgba(244, 183, 64, 0.8);
}

.reward-fly-coin-winners {
    background: radial-gradient(circle at 35% 30%, #eef1f6, #c2cad6);
    box-shadow: 0 0 16px rgba(179, 188, 201, 0.7);
}

.reward-fly-coin-participants {
    background: radial-gradient(circle at 35% 30%, #e0b985, #b07f3f);
    box-shadow: 0 0 16px rgba(202, 160, 105, 0.7);
}

/* Плитка «вчера» вспыхивает, когда награда приземлилась */
.league-history-tile-landed {
    animation: tile-land 0.7s ease-out;
}

/* ── Значок «новая награда» на вкладке «Дневная» ── */
.league-tab {
    position: relative;
}

.league-tab-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 2px #1c1c1c;
    animation: tab-badge-pulse 1.6s ease-in-out infinite;
}

@keyframes chest-shimmer {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.06); filter: brightness(1.25); }
}

@keyframes tile-land {
    0% { transform: scale(1); }
    35% { transform: scale(1.16); box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.6); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

@keyframes tab-badge-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.7; }
}

/* ── Светлая тема ── */
body.light-theme .daily-reward-chest {
    background: #ffffff;
    border-color: #dce1e6;
    color: #1f2d3d;
}

body.light-theme .daily-reward-chest-champion {
    border-color: rgba(201, 164, 28, 0.5);
}

body.light-theme .daily-reward-chest-winners {
    border-color: rgba(137, 150, 165, 0.5);
}

body.light-theme .daily-reward-chest-participants {
    border-color: rgba(168, 130, 80, 0.5);
}

body.light-theme .daily-reward-chest-champion.is-closed {
    background: linear-gradient(135deg, rgba(244, 183, 64, 0.2), #ffffff 62%);
}

body.light-theme .daily-reward-chest-winners.is-closed {
    background: linear-gradient(135deg, rgba(179, 188, 201, 0.22), #ffffff 62%);
}

body.light-theme .daily-reward-chest-participants.is-closed {
    background: linear-gradient(135deg, rgba(202, 160, 105, 0.22), #ffffff 62%);
}

body.light-theme .daily-reward-badge {
    box-shadow: 0 0 0 2px #ffffff;
}

body.light-theme .daily-reward-hint {
    color: #6f8198;
}

body.light-theme .reward-celebrate-sub {
    color: #6f8198;
}

body.light-theme .reward-fly-coin {
    color: #1f2d3d;
}

body.light-theme .league-tab {
    color: #6f8198;
    background: #f4f7fb;
    border-color: #dce1e6;
}

body.light-theme .league-tab:hover {
    color: #2b4258;
}

body.light-theme .league-tab-active {
    color: #2b4258;
    background: rgba(71, 120, 235, 0.12);
    border-color: rgba(71, 120, 235, 0.45);
}

body.light-theme .league-tab-badge {
    box-shadow: 0 0 0 2px #ffffff;
}

body.light-theme .loot-card {
    background: #f4f7fb;
    border-color: #dce1e6;
    border-left-color: var(--loot-accent, #4e4eff);
}

body.light-theme .loot-card-title {
    color: #24364b;
}

/* ── Reduced motion: гасим мерцание/вспышку/пульсацию (открытие сундука уже
   пропускается во фронте через useReducedMotion) ── */
@media (prefers-reduced-motion: reduce) {
    .daily-reward-chest.is-closed .daily-reward-art-img,
    .daily-reward-badge,
    .league-history-tile-landed,
    .league-tab-badge {
        animation: none !important;
    }
}

/* ── components/tags.css ── */

/* ─── Tags ─────────────────────────────────────────────────────────────────── */

/* Badge shown on habit/task cards (read-only) */
.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  background: color-mix(in srgb, var(--tag-color, #888) 14%, #1e1e1e);
  color: color-mix(in srgb, var(--tag-color, #ccc) 80%, #e8e8e8);
  border: 1px solid color-mix(in srgb, var(--tag-color, #888) 30%, transparent);
}

.tag-badge::before {
  content: '';
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tag-color, #888);
}

/* Chip shown in TagSelector field for selected tags */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 6px 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  background: color-mix(in srgb, var(--tag-color, #888) 18%, #222);
  color: color-mix(in srgb, var(--tag-color, #ccc) 80%, #e8e8e8);
  border: 1px solid color-mix(in srgb, var(--tag-color, #888) 38%, transparent);
}

.tag-chip::before {
  content: '';
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tag-color, #888);
}

/* Chip variant used inside filter dropdowns */
.tag-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  background: color-mix(in srgb, var(--tag-color, #888) 14%, #1e1e1e);
  color: color-mix(in srgb, var(--tag-color, #ccc) 80%, #e8e8e8);
  border: 1px solid color-mix(in srgb, var(--tag-color, #888) 30%, transparent);
}

/* Tags row inside habit-meta / task-meta stays inline */
.habit-meta .item-tags,
.task-meta .item-tags,
.action-meta .item-tags {
  display: contents;
}

/* ─── Tag Filter Button ──────────────────────────────────────────────────────── */

.tag-filter-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tag-filter-active-badge {
  cursor: default;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-filter-menu-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #777;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.tag-filter-menu-btn:hover,
.tag-filter-menu-btn.is-open {
  color: #d0d0d0;
  background: rgba(255, 255, 255, 0.07);
}

.tag-filter-menu-btn.is-active {
  color: #7aabff;
}

.tag-filter-menu-btn.is-active::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4778eb;
  box-shadow: 0 0 0 1.5px #1c1c1c;
}

.tag-filter-menu-icon {
  display: block;
}

@keyframes tagPanelAppear {
  from { opacity: 0; transform: translateY(-5px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tag-filter-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  min-width: 188px;
  max-width: min(280px, calc(100vw - 24px));
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 10px;
  background: #191919;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
  animation: tagPanelAppear 0.15s ease-out;
}

.tag-filter-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #aaa;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.tag-filter-menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #e8e8e8;
}

.tag-filter-menu-item.is-active {
  background: rgba(71, 120, 235, 0.16);
  color: #99bfff;
}

.tag-filter-menu-item--all {
  color: #888;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px 7px 0 0;
  padding-bottom: 10px;
  margin-bottom: 4px;
}

.tag-filter-menu-item--all:hover {
  color: #e0e0e0;
}

.tag-filter-menu-item--all.is-active {
  color: #99bfff;
}

.tag-filter-menu-item-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tag-color, #888);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tag-color, #888) 22%, transparent);
}

.tag-filter-menu-item--all .tag-filter-menu-item-dot {
  display: none;
}

.tag-filter-menu-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Серый счётчик использования тега (×N) — общий для селектора и фильтра */
.tag-usage-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: #5f5f5f;
  font-variant-numeric: tabular-nums;
}

.tag-filter-menu-item.is-active .tag-usage-count {
  color: #7f9bd0;
}

body.light-theme .tag-usage-count {
  color: #a0aebc;
}

/* ─── Empty state when a tag filter matches nothing ──────────────────────────── */

.tag-filter-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 32px 20px;
  text-align: center;
  animation: tagPanelAppear 0.2s ease-out;
}

.tag-filter-empty-icon {
  font-size: 30px;
  line-height: 1;
  opacity: 0.6;
  filter: grayscale(0.3);
}

.tag-filter-empty-text {
  margin: 0;
  font-size: 13.5px;
  color: #888;
  max-width: 260px;
}

.tag-filter-empty-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid rgba(71, 120, 235, 0.4);
  border-radius: 8px;
  background: rgba(71, 120, 235, 0.12);
  color: #99bfff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tag-filter-empty-reset:hover {
  background: rgba(71, 120, 235, 0.2);
  border-color: rgba(71, 120, 235, 0.6);
  color: #bcd4ff;
}

body.light-theme .tag-filter-empty-text {
  color: #7a8aa0;
}

body.light-theme .tag-filter-empty-reset {
  border-color: rgba(71, 120, 235, 0.35);
  background: rgba(71, 120, 235, 0.08);
  color: #3a6aaa;
}

body.light-theme .tag-filter-empty-reset:hover {
  background: rgba(71, 120, 235, 0.14);
  color: #2a549e;
}

/* ─── TagSelector Component ──────────────────────────────────────────────────── */

.tag-selector {
  position: relative;
  width: 100%;
}

.tag-selector-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 5px 10px;
  background: var(--input-bg, #252525);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tag-selector-field:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.tag-selector.is-open .tag-selector-field {
  border-color: rgba(71, 120, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(71, 120, 235, 0.1);
}

.tag-selector-field--ai-loading {
  opacity: 0.7;
  pointer-events: none;
}

.tag-ai-hint {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: var(--color-text-muted, #777);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-ai-hint--applied {
  color: #8b5cf6;
}

.tag-ai-hint--applied::before {
  content: '✦';
  font-size: 9px;
  opacity: 0.9;
}

/* Догоняющие AI-теги/сложность: одноразовая «вспышка» на свежеобработанной карточке */
@keyframes aiBadgeFlash {
  0%   { transform: scale(0.55); opacity: 0; box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
  35%  { transform: scale(1.08); opacity: 1; box-shadow: 0 0 10px 2px rgba(139, 92, 246, 0.55); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.tag-badge.ai-just-applied,
.task-difficulty.ai-just-applied,
.habit-difficulty.ai-just-applied {
  animation: aiBadgeFlash 1.1s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .tag-badge.ai-just-applied,
  .task-difficulty.ai-just-applied,
  .habit-difficulty.ai-just-applied {
    animation: none;
  }
}

.tag-selector-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

@keyframes tagChipIn {
  from { opacity: 0; transform: scale(0.55); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes tagChipOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.55); }
}

.tag-chip--selected {
  transform-origin: center;
  animation: tagChipIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: grab;
  touch-action: none; /* перетаскивание чипа касанием не прокручивает страницу */
}

.tag-chip--selected:active {
  cursor: grabbing;
}

/* Чип во время перетаскивания (порядок задаёт цвет/последовательность карточки) */
.tag-chip--dragging {
  opacity: 0.45;
}

.tag-chip--exiting {
  pointer-events: none;
  animation: tagChipOut 0.16s ease-in forwards;
}

@media (prefers-reduced-motion: reduce) {
  .tag-chip--selected,
  .tag-chip--exiting {
    animation: none;
  }
}

.tag-chip-text {
  line-height: 1;
}

.tag-chip-remove {
  background: none;
  border: none;
  color: color-mix(in srgb, var(--tag-color, #888) 60%, #777);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
}

.tag-chip-remove:hover {
  color: #ff6b6b;
  background: rgba(255, 80, 80, 0.18);
}

.tag-selector-placeholder {
  font-size: 13px;
  color: #555;
  padding: 1px 0;
}

.tag-selector-toggle {
  flex-shrink: 0;
  color: #555;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease, color 0.15s;
}

.tag-selector.is-open .tag-selector-toggle {
  transform: rotate(180deg);
  color: #888;
}

.tag-selector-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  background: #191919;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px 0;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  max-height: 320px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  animation: tagPanelAppear 0.14s ease-out;
}

.tag-selector-empty {
  padding: 10px 14px;
  font-size: 13px;
  color: #555;
  font-style: italic;
}

/* ─── Search inside dropdown ─────────────────────────────────────────────────── */

.tag-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 4px 8px 8px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tag-search-icon {
  position: absolute;
  left: 18px;
  width: 14px;
  height: 14px;
  color: #555;
  pointer-events: none;
}

.tag-search-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  color: #e0e0e0;
  font-size: 13px;
  padding: 7px 28px 7px 32px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tag-search-input::placeholder {
  color: #555;
}

.tag-search-input:focus {
  outline: none;
  border-color: rgba(71, 120, 235, 0.5);
  box-shadow: 0 0 0 2px rgba(71, 120, 235, 0.1);
}

.tag-search-clear {
  position: absolute;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #999;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}

.tag-search-clear:hover {
  color: #e8e8e8;
  background: rgba(255, 255, 255, 0.16);
}

.tag-selector-item {
  display: flex;
  align-items: center;
  padding-right: 6px;
  transition: background 0.1s;
}

.tag-selector-item + .tag-selector-item {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.tag-selector-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tag-selector-item.is-selected {
  background: rgba(71, 120, 235, 0.12);
}

/* Клик по строке выбирает/снимает тег — без чекбокса.
   Это button (а не label), чтобы не ловить .form-group label из модалки. */
.tag-selector-option {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px 9px 12px;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.tag-selector-option:focus-visible {
  outline: 2px solid var(--color-accent, #4778eb);
  outline-offset: -2px;
  border-radius: 6px;
}

.tag-selector-check {
  margin-left: auto;
  display: flex;
  align-items: center;
  color: #4778eb;
  flex-shrink: 0;
}

.tag-selector-check svg {
  width: 15px;
  height: 15px;
}

.tag-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--tag-color, #888) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tag-color, #888) 22%, transparent);
}

.tag-selector-name {
  color: #d0d0d0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-selector-item.is-selected .tag-selector-name {
  color: #fff;
}

.tag-delete-btn {
  background: none;
  border: none;
  color: #4a4a4a;
  font-size: 15px;
  cursor: pointer;
  padding: 3px 5px;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 5px;
  opacity: 0;
  transition: color 0.15s, background 0.15s, opacity 0.15s;
}

.tag-selector-item:hover .tag-delete-btn,
.tag-selector-item:hover .tag-edit-btn {
  opacity: 1;
}

.tag-delete-btn:hover {
  color: #ff5555;
  background: rgba(255, 70, 70, 0.12);
}

.tag-edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 5px;
  opacity: 0;
  transition: color 0.15s, background 0.15s, opacity 0.15s;
}

.tag-edit-btn svg {
  width: 13px;
  height: 13px;
}

.tag-edit-btn:hover {
  color: #7aabff;
  background: rgba(71, 120, 235, 0.14);
}

/* ─── Inline tag edit row ───────────────────────────────────────────────────── */

.tag-selector-item--editing {
  background: rgba(71, 120, 235, 0.08);
}

.tag-selector-item--editing:hover {
  background: rgba(71, 120, 235, 0.08);
}

.tag-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px 6px 12px;
}

.tag-edit-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 6px;
  color: #e8e8e8;
  font-size: 13px;
  padding: 5px 8px;
  outline: none;
}

.tag-edit-input:focus {
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.tag-edit-palette {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.tag-edit-palette .tag-palette-dot {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border-width: 2px;
}

.tag-edit-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.tag-edit-save,
.tag-edit-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 5px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.tag-edit-save {
  color: #4778eb;
}

.tag-edit-save svg {
  width: 14px;
  height: 14px;
}

.tag-edit-save:hover:not(:disabled) {
  background: rgba(71, 120, 235, 0.16);
}

.tag-edit-save:disabled {
  color: #444;
  cursor: not-allowed;
}

.tag-edit-cancel {
  color: #777;
  font-size: 16px;
  line-height: 1;
}

.tag-edit-cancel:hover {
  color: #ff6b6b;
  background: rgba(255, 80, 80, 0.14);
}

/* ─── Inline tag creation form ───────────────────────────────────────────────── */

.tag-create-form {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.tag-create-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  color: #e0e0e0;
  font-size: 13px;
  padding: 7px 10px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tag-create-input::placeholder {
  color: #4a4a4a;
}

.tag-create-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.tag-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 4px;
}

.tag-palette-dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  flex-shrink: 0;
  outline: none;
}

.tag-palette-dot:hover {
  transform: scale(1.2);
}

.tag-palette-dot--active {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  transform: scale(1.12);
}

.tag-create-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.tag-create-btn {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.tag-create-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.tag-create-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.tag-create-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Light theme ────────────────────────────────────────────────────────────── */

body.light-theme .tag-badge {
  background: color-mix(in srgb, var(--tag-color, #888) 12%, #f5f5f5);
  color: color-mix(in srgb, var(--tag-color, #555) 90%, #222);
  border-color: color-mix(in srgb, var(--tag-color, #888) 28%, rgba(0, 0, 0, 0.06));
}

body.light-theme .tag-chip {
  background: color-mix(in srgb, var(--tag-color, #888) 14%, #f0f0f0);
  color: color-mix(in srgb, var(--tag-color, #555) 90%, #222);
  border-color: color-mix(in srgb, var(--tag-color, #888) 32%, rgba(0, 0, 0, 0.08));
}

body.light-theme .tag-filter-menu-btn {
  color: #5a7494;
}

body.light-theme .tag-filter-menu-btn:hover,
body.light-theme .tag-filter-menu-btn.is-open {
  color: #2c4a66;
  background: rgba(50, 100, 160, 0.09);
}

body.light-theme .tag-filter-menu-btn.is-active {
  color: #3a6aaa;
}

body.light-theme .tag-filter-menu-btn.is-active::after {
  background: #4778eb;
  box-shadow: 0 0 0 1.5px #eef2f8;
}

body.light-theme .tag-filter-menu-panel {
  background: #fff;
  border-color: #dde3ea;
  box-shadow: 0 10px 28px rgba(20, 40, 70, 0.13);
}

body.light-theme .tag-filter-menu-item {
  color: #5a7494;
}

body.light-theme .tag-filter-menu-item:hover {
  background: #eef3f9;
  color: #2c4258;
}

body.light-theme .tag-filter-menu-item.is-active {
  background: rgba(71, 120, 235, 0.1);
  color: #2a549e;
}

body.light-theme .tag-filter-menu-item--all {
  border-bottom-color: #e4e8ee;
}

body.light-theme .tag-selector-field {
  background: #fff;
  border-color: #d8dfe8;
}

body.light-theme .tag-selector-field:hover {
  border-color: #b0bfd0;
}

body.light-theme .tag-selector.is-open .tag-selector-field {
  border-color: rgba(71, 120, 235, 0.5);
  box-shadow: 0 0 0 3px rgba(71, 120, 235, 0.09);
}

body.light-theme .tag-selector-placeholder {
  color: #a0b0c0;
}

body.light-theme .tag-selector-toggle {
  color: #a0b0c0;
}

body.light-theme .tag-selector.is-open .tag-selector-toggle {
  color: #6a8aaa;
}

body.light-theme .tag-selector-dropdown {
  background: #fff;
  border-color: #dde3ea;
  box-shadow: 0 10px 28px rgba(20, 40, 70, 0.12);
}

body.light-theme .tag-selector-item:hover {
  background: #f4f7fb;
}

body.light-theme .tag-selector-name {
  color: #2c4258;
}

body.light-theme .tag-selector-item.is-selected {
  background: rgba(71, 120, 235, 0.1);
}

body.light-theme .tag-selector-item.is-selected .tag-selector-name {
  color: #1f3a5f;
}

body.light-theme .tag-selector-empty {
  color: #9aacbc;
}

body.light-theme .tag-search-wrap {
  border-bottom-color: #eef1f5;
}

body.light-theme .tag-search-icon {
  color: #a8bbcc;
}

body.light-theme .tag-search-input {
  background: #f8fafc;
  border-color: #d4dce8;
  color: #2c4258;
}

body.light-theme .tag-search-input::placeholder {
  color: #a8bbcc;
}

body.light-theme .tag-search-input:focus {
  border-color: rgba(71, 120, 235, 0.45);
  box-shadow: 0 0 0 2px rgba(71, 120, 235, 0.09);
}

body.light-theme .tag-search-clear {
  background: rgba(20, 40, 70, 0.08);
  color: #6a7a8a;
}

body.light-theme .tag-search-clear:hover {
  background: rgba(20, 40, 70, 0.16);
  color: #2c4258;
}

body.light-theme .tag-delete-btn {
  color: #b0bfcf;
}

body.light-theme .tag-delete-btn:hover {
  color: #e53e3e;
  background: rgba(220, 50, 50, 0.08);
}

body.light-theme .tag-edit-btn {
  color: #b0bfcf;
}

body.light-theme .tag-edit-btn:hover {
  color: #3a6aaa;
  background: rgba(71, 120, 235, 0.1);
}

body.light-theme .tag-selector-item--editing,
body.light-theme .tag-selector-item--editing:hover {
  background: rgba(71, 120, 235, 0.07);
}

body.light-theme .tag-edit-input {
  background: #f8fafc;
  border-color: rgba(99, 102, 241, 0.5);
  color: #2c4258;
}

body.light-theme .tag-edit-cancel {
  color: #8a9db0;
}

body.light-theme .tag-chip-remove:hover {
  color: #e53e3e;
  background: rgba(220, 50, 50, 0.1);
}

body.light-theme .tag-create-form {
  border-top-color: #e4e8ee;
}

body.light-theme .tag-create-input {
  background: #f8fafc;
  border-color: #d4dce8;
  color: #2c4258;
}

body.light-theme .tag-create-input::placeholder {
  color: #a8bbcc;
}

body.light-theme .tag-create-input:focus {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

body.light-theme .tag-palette-dot--active {
  border-color: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

body.light-theme .tag-ai-hint {
  color: #8a9db0;
}

/* ─────────────────────────────────────────────────────────────────────────────── */

/* ── components/tags-manager.css ── */

/* ─── Tags manager (Settings) ────────────────────────────────────────────────── */

.tags-manager-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.tags-manager-count {
  font-size: 13px;
  color: #888;
  font-weight: 500;
}

.tags-manager-sort {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tags-manager-sort-label {
  font-size: 12.5px;
  color: #777;
}

.tags-manager-sort-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #aaa;
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.tags-manager-sort-btn:hover {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.08);
}

.tags-manager-sort-btn.is-active {
  color: #99bfff;
  background: rgba(71, 120, 235, 0.14);
  border-color: rgba(71, 120, 235, 0.4);
}

.tags-manager-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.tags-manager-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  transition: background 0.12s;
}

.tags-manager-row + .tags-manager-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tags-manager-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tags-manager-row.is-editing {
  background: rgba(71, 120, 235, 0.07);
}

.tags-manager-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--tag-color, #888);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-color, #888) 20%, transparent);
}

.tags-manager-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: #e0e0e0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tags-manager-usage {
  flex-shrink: 0;
  font-size: 12px;
  color: #6a6a6a;
  font-variant-numeric: tabular-nums;
}

.tags-manager-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tags-manager-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  color: #888;
  transition: color 0.15s, background 0.15s;
}

.tags-manager-btn svg {
  width: 15px;
  height: 15px;
}

.tags-manager-btn--edit:hover {
  color: #7aabff;
  background: rgba(71, 120, 235, 0.14);
}

.tags-manager-btn--delete {
  font-size: 19px;
  line-height: 1;
}

.tags-manager-btn--delete:hover {
  color: #ff5555;
  background: rgba(255, 70, 70, 0.12);
}

.tags-manager-btn--save {
  color: #4778eb;
}

.tags-manager-btn--save:hover:not(:disabled) {
  background: rgba(71, 120, 235, 0.16);
}

.tags-manager-btn--save:disabled {
  color: #444;
  cursor: not-allowed;
}

.tags-manager-btn--cancel {
  font-size: 19px;
  line-height: 1;
}

.tags-manager-btn--cancel:hover {
  color: #ff6b6b;
  background: rgba(255, 80, 80, 0.12);
}

/* edit row layout */
.tags-manager-edit-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tags-manager-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 7px;
  color: #e8e8e8;
  font-size: 13.5px;
  padding: 7px 10px;
  min-width: 140px;
  flex: 1;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tags-manager-input:focus {
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.tags-manager-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.tags-manager-palette .tag-palette-dot {
  width: 20px;
  height: 20px;
}

/* create row */
.tags-manager-create {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.tags-manager-create .tags-manager-input {
  border-color: rgba(255, 255, 255, 0.12);
}

.tags-manager-create .tags-manager-input:focus {
  border-color: rgba(99, 102, 241, 0.6);
}

.tags-manager-add-btn {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
}

.tags-manager-add-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.tags-manager-add-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.tags-manager-empty {
  padding: 22px 14px;
  text-align: center;
  font-size: 13.5px;
  color: #666;
  font-style: italic;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

/* ─── Light theme ────────────────────────────────────────────────────────────── */

body.light-theme .tags-manager-count,
body.light-theme .tags-manager-sort-label {
  color: #7a8aa0;
}

body.light-theme .tags-manager-sort-btn {
  border-color: #d8dfe8;
  background: #f6f8fb;
  color: #5a7494;
}

body.light-theme .tags-manager-sort-btn:hover {
  color: #2c4258;
  background: #eef3f9;
}

body.light-theme .tags-manager-sort-btn.is-active {
  color: #2a549e;
  background: rgba(71, 120, 235, 0.1);
  border-color: rgba(71, 120, 235, 0.35);
}

body.light-theme .tags-manager-list {
  border-color: #e4e8ee;
}

body.light-theme .tags-manager-row + .tags-manager-row {
  border-top-color: #eef1f5;
}

body.light-theme .tags-manager-row:hover {
  background: #f6f8fb;
}

body.light-theme .tags-manager-row.is-editing {
  background: rgba(71, 120, 235, 0.06);
}

body.light-theme .tags-manager-name {
  color: #2c4258;
}

body.light-theme .tags-manager-usage {
  color: #9aacbc;
}

body.light-theme .tags-manager-btn {
  color: #8a9db0;
}

body.light-theme .tags-manager-input {
  background: #f8fafc;
  color: #2c4258;
}

body.light-theme .tags-manager-create {
  border-color: #d8dfe8;
}

body.light-theme .tags-manager-empty {
  color: #9aacbc;
  border-color: #e4e8ee;
}

/* ── components/confirm-dialog.css ── */

.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1010;
    background: #1d1d1d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px 28px 24px;
    min-width: 300px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.confirm-dialog-title {
    font-size: 16px;
    font-weight: 600;
    color: #f0f0f0;
    margin-bottom: 10px;
    line-height: 1.3;
}

.confirm-dialog-message {
    font-size: 14px;
    color: #a0a0b0;
    line-height: 1.55;
    margin-bottom: 24px;
}

.confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.confirm-dialog-btn {
    padding: 9px 20px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    line-height: 1;
}

.confirm-dialog-btn--cancel {
    background: rgba(255, 255, 255, 0.06);
    color: #c0c0cc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.confirm-dialog-btn--cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f0f0f0;
}

.confirm-dialog-btn--danger {
    background: #c0392b;
    color: #fff;
}

.confirm-dialog-btn--danger:hover {
    background: #e74c3c;
}

.confirm-dialog-btn--primary {
    background: #4778eb;
    color: #fff;
}

.confirm-dialog-btn--primary:hover {
    background: #5a8aff;
}

body.light-theme .confirm-dialog {
    background: #ffffff;
    border-color: #dce1e6;
    box-shadow: 0 24px 60px rgba(30, 50, 80, 0.18);
}

body.light-theme .confirm-dialog-title {
    color: #1a2a3a;
}

body.light-theme .confirm-dialog-message {
    color: #5a6a7a;
}

body.light-theme .confirm-dialog-btn--cancel {
    background: #f0f4f8;
    color: #4a5a6a;
    border-color: #d0dae4;
}

body.light-theme .confirm-dialog-btn--cancel:hover {
    background: #e2eaf3;
    color: #2b3d52;
}

/* ── Avatar modal (emoji picker) ─────────────────────────────────────────── */
.avatar-modal {
    max-width: 440px;
}

.avatar-modal-preview {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    margin: 4px auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-modal-preview-emoji {
    font-size: 52px;
    line-height: 1;
}

.avatar-modal-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a8a98;
    margin: 14px 0 8px;
}

.avatar-modal-bg-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.avatar-modal-bg-swatch {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.12s, border-color 0.12s;
}

.avatar-modal-bg-swatch:hover {
    transform: scale(1.1);
}

.avatar-modal-bg-swatch.is-selected {
    border-color: #4778eb;
}

.avatar-modal-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.avatar-modal-emoji-cell {
    aspect-ratio: 1;
    font-size: 22px;
    border-radius: 8px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    padding: 0;
    transition: background 0.12s, border-color 0.12s;
}

.avatar-modal-emoji-cell:hover {
    background: rgba(255, 255, 255, 0.1);
}

.avatar-modal-emoji-cell.is-selected {
    border-color: #4778eb;
    background: rgba(71, 120, 235, 0.18);
}

.avatar-modal .confirm-dialog-actions {
    margin-top: 20px;
    justify-content: space-between;
}

body.light-theme .avatar-modal-emoji-cell {
    background: #f0f4f8;
}

body.light-theme .avatar-modal-emoji-cell:hover {
    background: #e2eaf3;
}

/* ── components/item-menu.css ── */

/* Мини-меню действий на карточке задачи/привычки.
   Кнопка-кебаб живёт в .task-actions/.habit-actions, панель — в portal (body). */

/* Контейнер кнопки в карточке: прижимаем кебаб к верху, рядом с заголовком. */
.task-actions,
.habit-actions {
    display: flex;
    align-items: flex-start;
}

.item-menu {
    display: inline-flex;
}

.item-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #9aa0aa;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.item-menu-btn:hover,
.item-menu-btn.is-open {
    background: #2d2d2d;
    color: #e7e9ee;
}

/* Панель меню (portal → body, position: fixed) */
.item-menu-panel {
    position: fixed;
    z-index: 1000;
    min-width: 184px;
    padding: 6px;
    border-radius: 10px;
    background: #191919;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
    animation: itemMenuAppear 0.14s ease-out;
}

@keyframes itemMenuAppear {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.item-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #d9dee8;
    font-size: 14px;
    line-height: 1;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.item-menu-item svg {
    flex-shrink: 0;
    color: #9aa0aa;
}

.item-menu-item:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.07);
}

.item-menu-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.item-menu-item--danger {
    color: #ec5b5b;
}

.item-menu-item--danger svg {
    color: #ec5b5b;
}

.item-menu-item--danger:hover:not(:disabled) {
    background: rgba(236, 91, 91, 0.12);
}

.item-menu-sep {
    height: 1px;
    margin: 5px 4px;
    background: rgba(255, 255, 255, 0.08);
}

/* На тач-устройствах ховера нет — кнопку показываем всегда. */
@media (hover: none) and (pointer: coarse) {
    .task-actions,
    .habit-actions {
        opacity: 1;
    }
}

