:root {
    --accent-color: #6f42c1;
    --accent-color-dark: #5a33a1;
    --accent-soft: #f4eeff;
    --surface-border: #e8def8;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    padding-bottom: 150px;
    overflow-x: hidden;
}

.google-sync-toast {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translate(-50%, -140%);
    width: min(92vw, 460px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #d9c8f6;
    box-shadow: 0 14px 36px rgba(31, 18, 61, 0.22);
    z-index: 3000;
    transition: transform 0.28s ease, opacity 0.28s ease;
    opacity: 0;
    pointer-events: none;
}
.google-sync-toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}
.google-sync-toast-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--accent-color-dark);
}
.google-sync-toast-title {
    font-weight: 700;
    color: #25124d;
    line-height: 1.2;
}
.google-sync-toast-message {
    font-size: 0.86rem;
    color: #5f5572;
    line-height: 1.25;
}
.google-sync-toast.success .google-sync-toast-icon {
    color: #198754;
}
.google-sync-toast.error .google-sync-toast-icon {
    color: #dc3545;
}

/* Верхняя часть с днями недели */
.week-days {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.day {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s;
    position: relative;
    overflow: visible;
}
.day:hover {
    background-color: #e8e8e8;
}
.day.active {
    font-weight: bold;
    color: #007bff;
}
.day.active-lightning-blue {
    color: #007bff;
}
.day.active-lightning-red {
    color: #ff2b2b;
}

/* Блок задач */
.tasks {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    padding-bottom: 70px; /* чтобы не загораживать кнопку */
}

/* Стиль задач */
.task {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 12px;
    margin-bottom: 5px;
    background-color: #f8fcff;
}

.task-left {
    flex: 0 0 auto;
    margin-right: 6px;
    font-size: 36px;
}

.task-center {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.task-time {
    font-size: 12px;
}

.task-progress-updated-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    color: #5b2f00;
    background: #ffe29a;
    border: 1px solid #f2c14e;
    vertical-align: middle;
    white-space: nowrap;
}

.task-title {
    font-size: 16px;
    font-weight: bold;
    margin-top: -2px;
}

.task-title-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.task-title-row .task-title {
    min-width: 0;
}

.task.expired {
    background-color: #ffe7e7;
    color: #b00000;
}

.task.task.done .task-title {
    text-decoration: line-through;
}

.task.task.done {
    background-color: #c1faeb;
    color: #5d5d5d;
}

.task.task.cancelled {
    background-color: #f2f4f8;
    color: #7a8191;
}

.task.task.cancelled .task-title {
    text-decoration: line-through;
    text-decoration-style: dashed;
}

.task.task.cancelled .cancelled-label {
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.task.task-infinite-goal {
    background-color: #e6f7ff;
}

.task-right {
    flex: 0 0 auto;
    margin: 0 6px;
    cursor: pointer;
    font-size: 35px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-right button {
    height: fit-content;
}

.daily-goal-zone {
    border: 2px dashed #b28af0;
    background: linear-gradient(135deg, #fbf7ff, #f2e8ff);
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 12px;
    box-shadow: 0 6px 16px rgba(111, 66, 193, 0.12);
}

.daily-goal-zone.dragover {
    border-color: #6f42c1;
    background: #efe3ff;
}

.daily-goal-zone-title {
    font-weight: 700;
    color: #4d2f8a;
    margin-bottom: 4px;
}

.daily-goal-zone-subtitle {
    font-size: 0.85rem;
    color: #5f4f80;
    margin-bottom: 10px;
}

/* Нижняя навигация */
.bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    padding: 8px 10px;
    gap: 6px;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}
.nav-button {
    flex: 1;
    text-align: center;
    padding: 8px 0 6px;
    font-weight: bold;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s;
    color: #150b46;
    border-radius: 12px;
    margin: 0 2px;
    min-width: 0;
    height: 50px;
    place-content: center;
}
.nav-button i {
    font-size: 1.08rem;
    line-height: 1.1;
}
.nav-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    font-size: clamp(10px, 2.6vw, 14px);
    line-height: 1.15;
}
.achievement-nav-button span {
    font-size: clamp(0.56rem, 2.3vw, 0.875rem);
    padding: 3px 0 1.3px;
}
.nav-button.active {
    color: var(--accent-color-dark);
    background: var(--accent-soft);
}
.nav-more-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.nav-more-toggle {
    width: 100%;
}
.secondary-nav {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    background: #fff;
    border: 1px solid #e3d9f7;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(44, 22, 77, 0.2);
    padding: 8px;
    width: min(230px, 84vw);
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 1045;
}
.secondary-nav.open {
    display: flex;
}
.secondary-nav .nav-button {
    margin: 0;
    width: 100%;
    flex: 0 0 auto;
    text-align: left;
    padding: 8px 10px;
    font-size: 13px;
    flex-direction: row;
    gap: 8px;
}
.secondary-nav .nav-button i {
    font-size: 1rem;
}
.statistics-panel,
.achievements-panel {
    border: 1px solid #e5d9f8;
    border-radius: 16px;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff, #faf7ff);
}
.statistics-panel {
    margin-bottom: 12px;
}
.achievements-panel {
    margin-bottom: 100px;
}
.achievements-top {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.achievements-top-card {
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    border: 1px solid transparent;
    box-shadow: 0 8px 18px rgba(53, 35, 90, 0.16);
    position: relative;
    overflow: hidden;
}
.achievements-top-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0));
    pointer-events: none;
}
.achievements-top-card.ultra {
    background: linear-gradient(145deg, #ff7f7f, #d91414);
    border-color: #a40f0f;
    color: #fff8f8;
}
.achievements-top-card.platinum {
    background: linear-gradient(145deg, #92dbff, #3b76ff);
    border-color: #2f58cb;
    color: #f5fbff;
}
.achievements-top-card.gold {
    background: linear-gradient(145deg, #ffe184, #d39a13);
    border-color: #a47813;
    color: #fff9eb;
}
.achievements-top-card.ultra .achievements-top-label,
.achievements-top-card.platinum .achievements-top-label,
.achievements-top-card.gold .achievements-top-label {
    color: inherit;
    opacity: 0.95;
}
.achievements-top-value {
    font-size: 1.1rem;
    font-weight: 700;
}
.achievements-top-label {
    font-size: 0.76rem;
    color: #5b4f73;
}
.achievements-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.achievements-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee6fa;
    padding: 6px 2px;
}
.achievements-list-value {
    font-weight: 700;
    color: #4e2f87;
}
.custom-achievements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 8px;
}
.custom-achievements-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: #5f4f80;
}
.custom-achievements-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.custom-achievement-item {
    border: 1px solid #e5d9f8;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 14px rgba(53, 35, 90, 0.08);
}
.custom-achievement-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.custom-achievement-title {
    font-weight: 700;
    color: #2d1d4f;
}
.custom-achievement-meta {
    font-size: 0.78rem;
    color: #5f4f80;
    margin-bottom: 7px;
}
.custom-achievement-progress-wrap {
    height: 10px;
    background: #eee7fb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}
.custom-achievement-progress {
    height: 100%;
    background: linear-gradient(90deg, #7a4ddb, #4ea1ff);
    transition: width 0.2s;
}
.custom-achievement-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.custom-achievement-controls .btn-group .btn {
    min-width: 36px;
}
.custom-achievement-title-row .btn-group .btn,
.custom-achievement-controls .btn-group .btn {
    min-height: 44px;
    padding: 0.45rem 0.7rem;
    font-size: 0.95rem;
}
.custom-achievement-title-row .btn-group .btn {
    min-width: 46px;
}
.custom-achievement-title-row .btn-group {
    gap: 6px;
}
.progress-section-tabs {
    width: min(100%, 520px);
    margin: 0 auto 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.progress-section-tabs .tab-action-btn {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
}
.progress-calendar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}
.progress-calendar-actions .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    white-space: nowrap;
    padding: 0.3rem 0.5rem;
    min-height: 34px;
    font-size: 0.8rem;
}
@media (max-width: 576px) {
    .custom-achievement-title-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .progress-calendar-actions {
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }
    .progress-calendar-actions .btn {
        flex: 1 1 calc(50% - 8px);
        font-size: 0.82rem;
        padding: 0.4rem 0.45rem;
    }
    .custom-achievement-controls {
        align-items: flex-start;
        flex-direction: column;
    }
    .custom-achievement-controls .btn-group {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .custom-achievement-controls .btn-group .btn {
        width: 100%;
    }
}
@media (min-width: 640px) {
    .achievements-top {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .progress-calendar-actions {
        gap: 4px;
    }
    .progress-calendar-actions .btn {
        flex: 0 1 auto;
        min-width: 68px;
        padding: 0.24rem 0.45rem;
        min-height: 30px;
        font-size: 0.74rem;
    }
}

/* Иконки в задачах и навигации */
.icon {
    margin-left: 8px;
    font-size: 1.2em;
}

/* Кнопка + снизу справа */
.add-note-btn {
    position: fixed;
    bottom: 85px; /* чуть выше навигации */
    right: 15px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007bff;
    color: #fff;
    border: none;
    font-size: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: background-color 0.2s;
}
.add-note-btn:hover {
    background-color: #0056b3;
}

.app-sync-indicator {
    position: fixed;
    left: 50%;
    bottom: 78px;
    transform: translate(-50%, 8px);
    z-index: 1025;
    display: flex;
    align-items: center;
    gap: 9px;
    width: max-content;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 16px;
    box-shadow: 0 5px 16px rgba(26, 22, 48, 0.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.finish-day-btn.is-visible + .app-sync-indicator {
    bottom: 125px;
}
.app-sync-indicator.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}
.app-sync-indicator.offline { background: #f0f1f3; border-color: #d9dde2; color: #555d66; }
.app-sync-indicator.pending { background: #fff3df; border-color: #f4d29b; color: #a75b00; }
.app-sync-indicator.syncing { background: #eaf4ff; border-color: #bedcff; color: #1768ac; }
.app-sync-indicator.synced { background: #e9f8ef; border-color: #bde5ca; color: #18713a; }
.app-sync-indicator.authRequired { background: #fff3df; border-color: #f4d29b; color: #8a4b00; }
.app-sync-indicator-icon { flex: 0 0 auto; font-size: 1.2rem; line-height: 1; }
.app-sync-indicator.syncing .app-sync-indicator-icon { animation: app-sync-spin 0.9s linear infinite; }
.app-sync-indicator-title { font-size: 0.82rem; font-weight: 700; line-height: 1.15; }
.app-sync-indicator-subtitle { margin-top: 2px; font-size: 0.7rem; line-height: 1.15; opacity: 0.8; }
.app-sync-indicator-subtitle:empty { display: none; }
@keyframes app-sync-spin { to { transform: rotate(360deg); } }

.finish-day-btn {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 190px;
    z-index: 1030;
    display: none;
    border-radius: 999px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
}

.finish-day-btn.is-visible {
    display: inline-flex;
}

.finish-day-btn.finish-day-btn-gold {
    background: linear-gradient(135deg, #c89618, #8c6200);
    border-color: #7d5600;
    color: #fff3cf;
}

.finish-day-btn.finish-day-btn-silver {
    background: linear-gradient(135deg, #949cac, #656d7f);
    border-color: #586174;
    color: #f4f7ff;
}

.finish-day-btn.finish-day-btn-bronze {
    background: linear-gradient(135deg, #a5673e, #744124);
    border-color: #65371d;
    color: #ffe5d3;
}

.finish-day-btn.finish-day-btn-platinum {
    background: linear-gradient(135deg, #2d7fb0, #2b4ea8);
    border-color: #254693;
    color: #eff8ff;
}

.finish-day-btn.finish-day-btn-ultra {
    background: linear-gradient(135deg, #ff6b6b, #d51f1f);
    border-color: #b11818;
    color: #fff4f4;
    box-shadow: 0 0 18px rgba(236, 58, 58, 0.5);
}

.finish-day-btn.finish-day-btn-participant {
    background: linear-gradient(135deg, #6f6b96, #4f4b78);
    border-color: #46426d;
    color: #f1eeff;
}

.finish-day-btn.finish-day-btn-empty {
    background: linear-gradient(135deg, #8f8f8f, #666666);
    border-color: #5b5b5b;
    color: #fafafa;
}

.completed-toggle-btn {
    display: flex;
    margin: 16px auto 6px;
    border-radius: 999px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.routine-action-btn {
    display: flex;
    margin: 6px auto;
    border-radius: 999px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.completed-toggle-btn i {
    margin-right: 6px;
}

.goal-modal-meta {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f7f7ff;
    border: 1px solid #e7e4ff;
    font-size: 0.92rem;
}

.goal-number-animate {
    animation: goal-number-pop 0.45s ease;
}

@keyframes goal-number-pop {
    0% {
        transform: scale(1);
        background-color: #fff;
    }
    50% {
        transform: scale(1.03);
        background-color: #f4eeff;
    }
    100% {
        transform: scale(1);
        background-color: #fff;
    }
}

.day.day-rated-gold {
    background: transparent;
    border: none;
    box-shadow: none;
}

.day.day-rated-silver {
    background: transparent;
    border: none;
    box-shadow: none;
}

.day.day-rated-bronze {
    background: transparent;
    border: none;
    box-shadow: none;
}

.day.day-rated-platinum {
    background: transparent;
    border: none;
    box-shadow: none;
}

.day.day-rated-ultra {
    background: transparent;
    border: none;
    box-shadow: none;
}

.day.day-rated-participant {
    background: transparent;
    border: none;
    box-shadow: none;
}

.day.day-rated-empty {
    background: transparent;
    border: none;
    box-shadow: none;
}

.day-rating-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.95);
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}

.day-rating-badge.gold {
    background: radial-gradient(circle at 30% 30%, #fffbe0, #ffd24a 58%, #e8b72e);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.4), 0 0 8px rgba(255,210,74,0.55), 0 3px 8px rgba(0,0,0,0.18);
}

.day-rating-badge.silver {
    background: radial-gradient(circle at 30% 30%, #ffffff, #dfe5ef 55%, #bfc7d6);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.45), 0 0 8px rgba(223,229,239,0.65), 0 3px 8px rgba(0,0,0,0.18);
}

.day-rating-badge.bronze {
    background: radial-gradient(circle at 30% 30%, #fff0de, #e49a61 55%, #be7a45);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.35), 0 0 8px rgba(228,154,97,0.5), 0 3px 8px rgba(0,0,0,0.18);
}

.day-rating-badge.platinum {
    background: radial-gradient(circle at 30% 30%, #ffffff, #7fd6ff 55%, #3d7bff);
    border-color: rgba(255,255,255,1);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.45), 0 0 14px rgba(86,176,255,0.95), 0 4px 10px rgba(0,0,0,0.2);
}

.day-rating-badge.ultra {
    background: radial-gradient(circle at 30% 30%, #fff1f1, #ff8c8c 50%, #ff2f2f);
    border-color: rgba(255,255,255,1);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.48), 0 0 18px rgba(255,58,58,1), 0 10px 18px rgba(126, 8, 8, 0.42);
}

.day-rating-badge.participant {
    background: radial-gradient(circle at 30% 30%, #ffb6b6, #a5a5c3);
    border-color: rgb(178 208 185 / 85%);
    opacity: 0.68;
}

.day-rating-badge.empty {
    background: radial-gradient(circle at 30% 30%, rgb(195 195 195 / 80%), rgba(225, 235, 245, 0.35));
    border-color: rgb(218 218 218 / 85%);
    opacity: 0.7;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.day-cancelled-badge {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #ff0000;
}

.day-streak-badge {
    position: absolute;
    bottom: -10px;
    padding-left: 1px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", sans-serif;
    text-shadow: 0 1px 3px rgba(47, 128, 255, 0.35);
    transform: rotate(338deg);
}
.day-rated-platinum .day-streak-badge {
    color: #2b55ff;
}
.day-rated-ultra .day-streak-badge {
    color: #ff2b2b;
}

.notes-footer-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 14px 0 28px;
    flex-wrap: wrap;
}

.archive-toggle-wrap {
    display: flex;
}

.archive-toggle-btn {
    min-width: 180px;
}

.archive-back-btn {
    margin-bottom: 10px;
}

.nav-top {
    background-color: #f7f6ff;
    margin-bottom: 15px;
    border-radius: 16px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
}
.nav-top.disabled {
    pointer-events: none;
}
.nav-top.disabled div, .nav-top.disabled button {
    color: #888888 !important;
}

/* Общий контейнер для папок и заметок */
#inboxContainer, #notesContainer, #routineContainer, #tasksContainer, #allTasksContainer, #projectsContainer, #lifeAreasContainer, #progressContainer, #newsContainer, #profileContainer {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease, max-height 0.5s ease;
}

/* Активный контейнер */
#inboxContainer.show, #notesContainer.show, #routineContainer.show, #tasksContainer.show, #allTasksContainer.show, #projectsContainer.show, #lifeAreasContainer.show, #progressContainer.show, #newsContainer.show, #profileContainer.show {
    opacity: 1;
    max-height: fit-content; /* или другой подходящий максимум, чтобы плавно раскрыть */
    padding-bottom: 12px;
}

#profileContainer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    grid-gap: 10px;
    flex-direction: column;
    align-items: center;
}

#routineContainer,
#tasksContainer {
    min-height: 0;
}

#routineContainer.show,
#tasksContainer.show {
    min-height: calc(100vh - 220px);
}

#profileContainer button {
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    width: 100%;
    margin: 0;
}

.profile-click-settings {
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-click-settings .profile-select-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-click-settings .profile-select-block.week-start-block {
    flex: 1 0 100%;
}
.data-transfer-block {
    margin-top: 12px;
    width: 100%;
    border: 1px solid #e7e4ff;
    border-radius: 12px;
    padding: 12px;
    background: #faf9ff;
}

#deleteAllBtn, #resetToFactoryBtn {
    color: #fff;
}

#languageSelect {
    width: auto;
    display: block;
}

.news-feed {
    width: 100%;
    margin-top: 14px;
    background: linear-gradient(160deg, #fcfaff, #f4eeff);
    border: 1px solid #e4d7ff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(91, 45, 173, 0.08);
}

.news-feed-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    color: #432675;
}

.news-feed-subtitle {
    margin: 3px 0 0;
    color: #675f7d;
    font-size: 0.87rem;
}

.news-feed-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.news-feed-head-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #efe4ff;
    color: #5b2dad;
    font-size: 1.1rem;
}

.news-feed-item {
    background: #fff;
    border: 1px solid #ebe2ff;
    border-radius: 14px;
    padding: 11px 12px;
    box-shadow: 0 4px 14px rgba(75, 35, 142, 0.07);
}

.news-feed-item + .news-feed-item {
    margin-top: 8px;
}

.news-feed-date {
    font-size: 0.74rem;
    color: #5f4d83;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    background: #f3edff;
    border: 1px solid #e3d8ff;
    padding: 3px 9px;
}

.news-feed-item-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #2f1e53;
}

.news-feed-item-description {
    margin: 5px 0 0;
    font-size: 0.9rem;
    color: #2e2e35;
    white-space: pre-line;
}

/* Стиль папки */
.folder, .no-folder {
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Вложенные папки */
.folder .folder {
    margin: 10px 0;
    border: 1px solid #e6e6e6;
}

/* Заголовок папки */
.folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Название папки */
.folder-name {
    font-weight: bold;
    font-size: 1.1em;
    display: flex;
    align-items: center;
}

/* Заметка внутри папки */
.note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    background-color: #fafafa;
    margin-top: 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-top: 1px solid #e7e7ec;
}

.note:hover {
    background-color: #f0f0f0;
}

.sub-notes {
    padding: 0 0 5px 7px;
    margin-bottom: 4px;
}

.sub-notes .full-note {
    margin-right: 3px;
}

.full-note {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.folder-item[draggable="true"],
.full-note[data-note-id][draggable="true"] {
    cursor: grab;
}

.folder-item[draggable="true"]:active,
.full-note[data-note-id][draggable="true"]:active {
    cursor: grabbing;
}

/* Заголовок заметки */
.note-title {
    flex: 1;
    padding: 6px 4px 6px 8px;
    font-size: 1em;
}

/* Иконки действия */
.icon {
    font-size: 1.2em;
    margin-left: 8px;
    cursor: pointer;
    color: #555;
    transition: color 0.2s;
}

.icon:hover {
    color: #000;
}

#nextWeek, #prevWeek {
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    font-weight: 700;
    background-color: #fff;
    color: var(--accent-color-dark);
    width: 44px;
    height: 44px;
    line-height: 1;
    transition: all 0.2s ease;
}

#nextWeek:hover, #prevWeek:hover {
    background-color: var(--accent-soft);
    border-color: #ccb7ef;
}

#fullDateDisplay {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    transition: background-color 0.2s ease;
    font-size: clamp(0.78rem, 3vw, 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 8px;
}

#fullDateDisplay:hover {
    background-color: var(--accent-soft);
}

#weekDays {
    margin-top: 8px;
}

.create-folder-btn {
    min-width: 180px;
    margin: 0;
}

.modal {
    align-content: center;
}

.tab-action-btn {
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    font-weight: 600;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

.tab-action-btn.btn-primary,
.tab-action-btn.btn-success {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-dark));
    border-color: var(--accent-color-dark);
    color: #fff;
}

.tab-action-btn.btn-outline-secondary {
    color: var(--accent-color-dark);
    border-color: #ccb7ef;
    background: #fff;
}

.tab-action-btn.btn-outline-secondary:hover {
    color: var(--accent-color-dark);
    border-color: #b798e7;
    background: var(--accent-soft);
}

.tab-action-btn.btn-danger {
    background: linear-gradient(135deg, #ff6a6a, #cf3131);
    border-color: #b42a2a;
    color: #fff;
}

.tab-action-btn.btn-danger:hover,
.tab-action-btn.btn-primary:hover,
.tab-action-btn.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.form-note-modal .modal-content {
    border: 1px solid var(--surface-border);
    border-radius: 18px;
    overflow: hidden;
}

.form-note-modal .modal-header {
    background: linear-gradient(135deg, #faf7ff, #f2ebff);
    border-bottom: 1px solid var(--surface-border);
}

.form-note-modal .modal-body {
    background: #fcfbff;
    max-height: 70vh;
    overflow-y: auto;
}

.form-section {
    background: #fff;
    border: 1px solid #eee4fb;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(120, 90, 170, 0.08);
}

.form-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #67429b;
    margin-bottom: 10px;
    text-transform: uppercase;
}

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

.quick-add-panel {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.quick-add-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #67429b;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.quick-add-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.quick-add-btn {
    border: 1px solid #d7c5f3;
    background: #fff;
    color: #5b3a8a;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.quick-add-btn:hover {
    background: #f7f1ff;
    border-color: #be9ef0;
}

.quick-add-btn.active {
    border-color: var(--accent-color-dark);
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(105, 67, 170, 0.25);
}

.quick-add-hint {
    margin: 0;
    border-radius: 10px;
    background: #f2ebff;
    border: 1px solid #e0d3f7;
    padding: 8px 10px;
    font-size: 0.85rem;
    color: #5e3f90;
}

.statistics-panel { position: relative; }
#notesContainer,
#notesContainerContent {
    width: 100%;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

#notesContainerContent {
    min-width: 0;
    overflow-x: hidden;
}

.achievements-info-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    border-radius: 999px;
    border: 1px solid #d8c3fb;
    background: linear-gradient(135deg, #f8f1ff, #efe2ff);
    color: #5a2f95;
    font-weight: 700;
}
.note-tags-filter {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
    padding: 6px 2px 10px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.note-tags-filter .badge { cursor: pointer; user-select: none; font-size: .78rem; }
.note-tags-filter .badge.active { background: #6f42c1 !important; color: #fff; }
.notes-notebook-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 10px; }
.note-paper {
    border-radius: 14px; border: 1px solid #eadbff; padding: 12px; cursor: pointer;
    box-shadow: 0 8px 22px rgba(84, 46, 140, 0.12);
    background-image: linear-gradient(to bottom, rgba(255,255,255,.55), rgba(255,255,255,.55)), repeating-linear-gradient(180deg, transparent 0, transparent 23px, rgba(110,66,193,.12) 24px);
}
.note-paper-title { font-weight: 800; margin-bottom: 4px; color: #3d226a; }
.note-paper-body { font-size: .88rem; color: #34323a; }
.note-paper-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.progress-heatmap { display: grid; grid-auto-columns: 12px; grid-auto-flow: column; gap: 3px; overflow-x: auto; padding-bottom: 6px; }
.progress-heatmap-col { display: grid; grid-template-rows: repeat(7, 12px); gap: 3px; }
.progress-heatmap-cell { width: 12px; height: 12px; border-radius: 2px; background: #ebedf0; }
.progress-heatmap-cell.active-1 { background: #c8f5c8; }
.progress-heatmap-cell.active-2 { background: #6edb6e; }
.progress-heatmap-cell.active-3 { background: #1faa49; }
.progress-heatmap-cell.active-4 { background: #8ed8ff; box-shadow: 0 0 3px rgba(142,216,255,.7); }
.progress-heatmap-cell.active-5 { background: #ff2a2a; box-shadow: 0 0 3.5px rgba(255,42,42,.75); }
.progress-calendar-stats { font-size: .85rem; color: #4f4f57; margin: 8px 0; }
.progress-calendar-active { border: 2px solid #6f42c1 !important; box-shadow: 0 0 0 3px rgba(111,66,193,.15); }
.progress-legend { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: .78rem; color: #56565f; }
.progress-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.progress-calendar-grid-wrap { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: start; overflow: overlay; }
.progress-weekday-labels { display: grid; grid-template-rows: repeat(7, 12px); gap: 3px; font-size: .72rem; color: #6a6d78; }
.progress-month-labels { display: grid; grid-auto-columns: 12px; grid-auto-flow: column; gap: 3px; margin-bottom: 4px; font-size: .72rem; color: #6a6d78; }

.planning-hero, .planning-card {
    background: #fff;
    border: 1px solid var(--surface-border);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(62, 35, 104, .08);
    padding: 14px;
    margin-bottom: 12px;
}
.planning-hero {
    background: linear-gradient(135deg, #fbf8ff, #eef8ff);
}
.planning-title { font-weight: 800; color: #2d1854; margin-bottom: 4px; }
.planning-subtitle { color: #6a6177; font-size: .9rem; margin: 0; }
.planning-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 10px; }
.planning-stat { border-radius: 14px; background: #f7f2ff; padding: 10px; }
.planning-stat-value { font-size: 1.35rem; font-weight: 800; color: var(--accent-color-dark); }
.planning-stat-label { font-size: .78rem; color: #6a6177; }
.planning-list { display: grid; gap: 8px; }
.planning-item { border: 1px solid #ece4f8; border-radius: 14px; padding: 10px; background: #fff; cursor: pointer; }
.planning-item:hover { background: #fbf8ff; }
.planning-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.planning-chip { display:inline-flex; align-items:center; gap:4px; border-radius:999px; padding:2px 8px; background:#f1ebfb; color:#4f327a; font-size:.75rem; }
.planning-progress { height: 7px; background:#eee7f8; border-radius:999px; overflow:hidden; margin-top:8px; }
.planning-progress > span { display:block; height:100%; background:var(--accent-color); }
.planning-goal-meta { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.planning-date-chip { display:inline-flex; align-items:center; gap:5px; border:1px solid #ece4f8; background:#fbf8ff; color:#5d4a72; border-radius:999px; padding:3px 9px; font-size:.75rem; }
.planning-date-chip i { color: var(--accent-color-dark); }
.inbox-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; margin-bottom:12px; }
.task-group-title { margin: 14px 0 8px; font-weight: 800; color:#4f327a; font-size:.9rem; }
.task-group-title span { /*background:#f7f2ff; border:1px solid #ece4f8; border-radius:999px;*/ padding:5px 10px; }
.task-filter-chip { display:inline-flex; align-items:center; gap:6px; margin:0 0 10px; border-radius:999px; padding:5px 10px; background:#f1ebfb; color:#4f327a; font-size:.8rem; }
.select2-container--default .select2-selection--multiple { border-color:#dee2e6; border-radius:.375rem; min-height:38px; }
.menu-settings-list { font-size:.78rem; color:#6a6177; line-height:1.5; }
.menu-settings-editor { display:grid; gap:8px; width:100%; }
.menu-settings-row { display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid #ece4f8; background:#fff; border-radius:12px; padding:8px 10px; }
.menu-settings-row-label { display:flex; align-items:center; gap:8px; font-size:.9rem; color:#3f3153; }
.menu-settings-row-actions { display:flex; gap:4px; }
