:root {
    --color-accent-a-bg: #d4edda;
    --color-accent-b-bg: #fff3cd;
    --border-accent-a-color: #9bc7a5;
    --border-accent-b-color: #ffe28c;

    --time-end-color: #aaa;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --table-border-color: #dee2e696;

    --primary-color: #0A264A;
    --primary-light: #3498DB;
    --today-bg: #f0f7ff;
    --today-border: #3498DB;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #f5f5f5;
    min-height: 100vh;
}

/* ========== HEADER ========== */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1370px;
    margin: 0 auto;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    width: 42px;
    height: 42px;
    filter: brightness(0) invert(1);
}

.header-text h1 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.group-badge {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.85;
}

.test-badge {
    display: inline-block;
    background: #ff4444;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: .5px;
    font-family: var(--font-mono);
}


/* ========== HEADER FILTERS ========== */
.header-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    /* position: absolute; */
    /* left: 50%; */
    /* transform: translateX(-50%); */
}

.filter-group {
    display: flex;
    gap: 0.2rem;
    background: rgba(255, 255, 255, 0.12);
    padding: 3px;
    border-radius: 8px;
}

.filter-btn {
    padding: 0.35rem 0.65rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.filter-btn.active {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
}

.filter-btn.subgroup-a.active {
    background: var(--color-accent-a-bg);
    color: #1a5928;
}

.filter-btn.subgroup-b.active {
    background: var(--color-accent-b-bg);
    color: #856404;
}

/* Точка-индикатор текущей недели */
.filter-btn.is-current-week::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-light);
}

/* ========== MOBILE DAY NAV ========== */
.mobile-day-nav {
    display: none;
    flex-direction: column;
    padding: 1rem 1rem 0.75rem;
    background: white;
    gap: 0.4rem;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 40px;
    z-index: 80;
}

.mobile-week-label {
    min-height: 20px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #888;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.mobile-week-label.inside {
    padding: 0.5rem 0.9rem;
    justify-content: flex-start;
}

.mobile-day-buttons {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 8px 14px;
    border: 2px solid transparent;
    background: #f5f5f5;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #515151;
    gap: 6px;
    white-space: nowrap;
}

.tab-btn.selected,
.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.day-btn {
    flex: 1;
    min-width: 48px;
    min-height: 52px;
    padding: 0.5rem 0.25rem;
    flex-direction: column;
    gap: 2px;
}


.day-btn.selected .day-short,
.day-btn.selected .day-date {
    color: white;
}

.mobile-day-buttons.all-weeks .day-short {
    font-size: 1rem;
}

.day-btn.today {
    background: var(--today-bg);
    border-color: var(--today-border);
}

.day-btn.today .day-short,
.day-btn.today .day-date {
    color: var(--primary-light);
}

.day-btn.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.day-btn.selected .day-short,
.day-btn.selected .day-date {
    color: white;
}

.day-btn.today.selected {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.day-btn.past-day {
    opacity: 0.3;
}

.day-btn.past-day.selected {
    opacity: 0.6;
}

/* ========== WEEK TITLE ========== */
.week-container {
    max-width: 1400px;
    padding: 0.8rem 1rem 0.5rem 1rem;
    padding-bottom: 20px;
    margin: 0 auto;
}

.week-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #888;
    margin: 0.75rem 0 0.75rem 0;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.current-week-badge,
.next-week-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    padding: 0.0625rem 0.5rem 0.125rem 0.5rem;
    border-radius: 10px;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

.current-week-badge {
    background: var(--primary-light);
}

.next-week-badge {
    background: #999;
}

/* ========== DESKTOP TABLE ========== */
.table-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.schedule-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
    text-align: center;
    vertical-align: top;
    border: 1px solid var(--table-border-color);
    padding: 0.25rem;
}

.schedule-table thead th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.6rem 0.25rem;
}

.time-header {
    width: 85px;
}

.day-header {
    position: relative;
}

.day-name {
    display: block;
    font-weight: 600;
}

.day-header-date {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 1px;
}

.day-header.today-header {
    background: var(--primary-light) !important;
}


.time-cell {
    background: #fafafa;
    vertical-align: middle !important;
}

.time-start {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: #333;
    padding-top: 3px;
}

.time-end {
    display: block;
    color: var(--time-end-color);
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.2;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.lesson-cell {
    height: 60px;
}

.today-column {
    background: var(--today-bg);
}

/* ========== LESSON BLOCKS ========== */
.lesson-block {
    border-radius: 0.6rem;
    padding: 0.4rem;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    text-align: left;
    border-style: solid;
    border-width: 2px;
}

.lesson-block:last-child {
    margin-bottom: 0;
}



.lesson-g {
    background-color: #fff;
    border-color: #e5e5e5;
}

.lesson-a {
    background-color: var(--color-accent-a-bg);
    border-color: var(--border-accent-a-color);
}

.lesson-b {
    background-color: var(--color-accent-b-bg);
    border-color: var(--border-accent-b-color);
}

.lesson-block strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 2px;
    font-weight: 600;
    color: #222;
}

.lesson-details {
    font-size: 0.80rem;
    color: #666;
}

.teacher-link {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    cursor: pointer;
}

.lesson-info {
    font-family: var(--font-mono);
    word-spacing: -0.2em;
}

.teacher-info {
    font-weight: 600;
}

/* ========== MOBILE SCHEDULE ========== */
.mobile-schedule {
    display: none;

    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.mobile-day-schedule {
    background: white;
    border-radius: 16px;
    overflow: hidden;
}

.mobile-time-slot {
    display: flex;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    gap: 0.75rem;
    overflow: visible;
}

.time-slot-wrapper:last-child .mobile-time-slot {
    border-bottom: none;
}

.mobile-time {
    min-width: 55px;
    max-width: 55px;
    text-align: center;
    padding-top: 0.25rem;
}

.time-left-num {
    display: block;
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1;
    font-family: var(--font-mono);
    color: var(--primary-light);
    text-align: center;
    padding-top: 4px;
}

.time-left-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--primary-color);
    opacity: 0.5;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}



.current-lesson-slot .mobile-time {
    cursor: pointer;
    user-select: none;
}

.mobile-lessons {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-lessons .lesson-block {
    margin-bottom: 0;
}

.no-lessons {
    padding: 3rem 2rem;
    text-align: center;
    color: #aaa;
    font-size: 1rem;
}

.no-lessons::before {
    content: '😴';
    display: block;
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.no-lessons.holiday::before {
    content: '🎉';
}

.header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.header-author {
    font-size: 0.6rem;
    opacity: 0.35;
}

.header-version {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: end;
}

/* ========== CURRENT LESSON HIGHLIGHT ========== */
.current-lesson-cell {
    background: #37afff4f !important;
}

.current-lesson-slot {
    background: #3498db2e !important;
}

/* ========== PAST LESSON (прошедшие пары) ========== */
.past-lesson-slot,
.past-lesson-cell {
    opacity: 0.8;
}

.past-lesson-slot .lesson-block.lesson-g,
.past-lesson-cell .lesson-block.lesson-g {
    border-color: #ddd !important;
}

.past-lesson-slot .lesson-block.lesson-a,
.past-lesson-cell .lesson-block.lesson-a {
    background-color: #e8f0ea !important;
    border-color: #c5d8ca !important;
}

.past-lesson-slot .lesson-block.lesson-b,
.past-lesson-cell .lesson-block.lesson-b {
    background-color: #f5f0e0 !important;
    border-color: #e0d5b5 !important;
}

.past-lesson-slot .lesson-block strong,
.past-lesson-cell .lesson-block strong {
    color: #888;
}

.past-lesson-slot .lesson-details,
.past-lesson-cell .lesson-details {
    color: #aaa;
}

.past-lesson-slot .mobile-time .time-start {
    color: #aaa;
}

.past-lesson-slot .mobile-time .time-end {
    color: #ccc;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 901px) {
    .notes-overlay {
        display: none !important;
    }

    .note-badge {
        display: none !important;
    }

    .lesson-block {
        cursor: default !important;
        pointer-events: none;
    }

    .lesson-block .teacher-link {
        pointer-events: auto;
    }
}

@media (max-width: 900px) {

    .week-container {
        margin: 0;
    }

    html,
    body {
        height: 100%;
    }

    body {
        overflow: hidden;
        height: 100vh;
        height: 100dvh;
    }

    #app {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }


    .mobile-bottom-bar {
        display: flex !important;
    }

    .header-filters {
        display: none;
    }

    .desktop-schedule {
        display: none;
    }

    .mobile-day-nav {
        display: flex;
        flex-shrink: 0;
        z-index: 80;
    }

    .mobile-schedule {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        padding-bottom: 10rem;
        overscroll-behavior: contain;
    }

    .header {
        padding: 0.5rem 1rem;
        flex-shrink: 0;
    }

    .header-content {
        gap: 0.5rem;
    }

    .header-logo {
        width: 27px;
        height: 27px;
    }

    .header-text h1 {
        display: none;
    }

    .header-text {
        display: flex;
        flex-direction: column;
    }

    .header-text .group-badge {
        font-size: 0.7rem;
    }

    .header-meta {
        display: flex;
    }

    .header-version {
        display: block;
        font-size: 0.6rem;
        color: rgba(255, 255, 255, 0.4);
    }
}

@media (max-width: 480px) {
    .header-filters {
        gap: 0.35rem;
    }

    .filter-btn {
        padding: 0.3rem 0.45rem;
        font-size: 0.78rem;
    }

    .filter-group {
        gap: 0.15rem;
        padding: 2px;
    }

    .day-btn {
        min-width: 44px;
        padding: 0.4rem 0.2rem;
    }

    .day-btn .day-short {
        font-size: 0.7rem;
    }

    .day-btn .day-date {
        font-size: 0.9rem;
    }
}

/* ========== PWA INSTALL DIALOG ========== */
.pwa-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

@keyframes pwa-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pwa-dialog {
    background: #fff;
    border-radius: 20px;
    padding: 1.75rem;
    max-width: 320px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: pwa-slide-up 0.25s ease;
}

@keyframes pwa-slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

.pwa-dialog-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.pwa-dialog h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 0.5rem;
}

.pwa-dialog p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 1.25rem;
}

.pwa-dialog-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.pwa-btn-primary {
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--primary-color);
    color: #fff;
    transition: all 0.2s;
    width: 100%;
}

.pwa-btn-secondary {
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: #f0f0f0;
    color: #666;
    transition: all 0.2s;
    width: 100%;
}

.pwa-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #999;
    cursor: pointer;
    user-select: none;
}

.pwa-checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.dialog-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #aaa;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.dialog-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.dialog-action-btn.btn-rasp {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e5e5e5;
}

.dialog-action-btn.btn-rasp:active {
    background: #eee;
}

.dialog-action-btn i {
    font-size: 1rem;
    color: #888;
}

.dialog-action-btn.btn-rasp:hover {
    background: #eee;
    border-color: #ddd;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.shake {
    animation: shake 0.3s ease;
}

/* ========== MOBILE BOTTOM BAR ========== */
.floating-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px;
    background: rgba(10, 38, 74, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
}

.mobile-bottom-bar {
    display: none;
    bottom: 2.3rem;
    z-index: 90;
    gap: 4px;
    white-space: nowrap;
}

.bottom-filter-group {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.07);
    padding: 3px;
    border-radius: 15px;
}

.bottom-btn {
    min-width: 38px;
    min-height: 30px;
    padding: 0.4rem 0.85rem;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    color: rgba(255, 255, 255, 0.55);
    position: relative;
    white-space: nowrap;
}

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

.bottom-btn.active {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
}

.bottom-btn.subgroup-a.active {
    background: var(--color-accent-a-bg);
    color: #1a5928;
}

.bottom-btn.subgroup-b.active {
    background: var(--color-accent-b-bg);
    color: #856404;
}

.bottom-btn.is-current-week::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-light);
}

.now-btn {
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    transition: all 0.25s ease;
}

.now-btn:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.92);
}

.now-icon {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: all 0.25s ease;
}

.now-btn:active .now-icon {
    opacity: 1;
    transform: scale(1.1);
}

.lesson-gap {
    background-color: #0a264a0a;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #bbb;
    padding: 0.5rem 0;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #eee;
}

/* ========== BREAK PROGRESS BAR ========== */
.break-bar-wrapper {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #f0f7ff 0%, #f8fbff 100%);
}

.break-bar-label {
    display: flex;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
    text-align: center;
    margin-bottom: 0.35rem;
    justify-content: center;
}

.bar-text {
    letter-spacing: 0.02em;
    font-family: var(--font-main);
}

.bar-time {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.break-bar-track {
    height: 4px;
    background: rgba(52, 152, 219, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.break-bar-fill {
    height: 100%;
    background: var(--primary-light);
    border-radius: 2px;
    transition: width 1s linear;
}

.update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    animation: slide-down 0.3s ease;
}

.update-banner button {
    background: white;
    color: var(--primary-light);
    border: none;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

@keyframes slide-down {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* ===== iOS Tutorial Carousel ===== */
.pwa-carousel {
    width: 100%;
    overflow: hidden;
    margin: 12px 0;
}

.pwa-carousel-track {
    display: flex;
    transition: transform 0.3s ease;
}

.pwa-carousel-slide {
    min-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
}

.pwa-carousel-slide img {
    width: 100%;
    max-width: 200px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .12);
}

.pwa-carousel-text {
    font-size: 14px;
    text-align: center;
    margin: 0;
    line-height: 1.4;
    color: #666;
}

.pwa-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 6px;
}

.pwa-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(39 39 39 / 25%);
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.pwa-dot.active {
    background: var(--primary-color, #6c5ce7);
    transform: scale(1.3);
}

/* ===== Circular Progress ===== */
.time-progress-ring {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.time-progress-ring svg {
    position: absolute;
    width: 65px;
    height: 65px;
    left: 50%;
    top: 57%;
    transform: translate(-50%, -50%);
}

.ring-bg {
    fill: none;
    stroke: #8b8b8b21;
    stroke-width: 3;
}

.ring-fill {
    fill: none;
    stroke: var(--primary-light);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 106.8;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 1s linear;
}

.time-progress-ring .time-left-num {
    position: relative;
    z-index: 1;
}

.time-progress-ring .time-left-label {
    position: relative;
    z-index: 1;
}

.group-select {
    margin-top: 2px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.group-select option {
    background: #1a1a2e;
    color: #fff;
}

/* ===== Notes Screen ===== */
.notes-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: none;
}

.notes-screen-header {
    min-height: 45.2px;
    background: var(--primary-color);
    color: #fff;
    flex-shrink: 0;
}

.notes-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

.notes-back-btn {
    height: 27px;
    width: 27px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notes-back-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.notes-back-icon {
    width: 22px;
    height: 22px;
}

.notes-header-title {
    flex: 1;
    min-width: 0;
}

.notes-header-title h1 {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notes-header-actions {
    display: flex;
    gap: 6px;
}

.notes-action-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notes-action-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Tabs */
.notes-tabs-wrap {
    background: #fff;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.notes-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem .65rem;
    max-width: 600px;
    margin: 0 auto;
    scrollbar-width: none;
}

.notes-tabs::-webkit-scrollbar {
    display: none;
}

.notes-tab {
    flex-shrink: 0;
}

.notes-tab-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
}

.notes-tab.active .notes-tab-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Body */
.notes-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 0.75rem 1rem 6rem;
    overscroll-behavior: contain;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notes-empty {
    text-align: center;
    color: #bbb;
    padding: 4rem 2rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.notes-empty::before {
    content: '📝';
    display: block;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Note Card */
.note-card {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
}

.note-card.note-archived {
    opacity: 0.5;
}

.note-content {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.note-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: all 0.25s ease;
    color: #fff;
}

.note-check.checked {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.note-body {
    flex: 1;
    min-width: 0;
}

.note-text {
    font-size: 0.9rem;
    color: #222;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 4px;
}

.note-text-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-expand {
    display: block;
    background: none;
    border: none;
    color: var(--primary-light);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0;
    margin-top: 2px;
}

.note-link {
    color: var(--primary-light);
    text-decoration: underline;
    word-break: break-all;
}

.note-link:active {
    opacity: 0.7;
}

.note-subject-label {
    display: block;
    width: fit-content;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary-light);
    background: rgba(74, 139, 255, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 4px;
}

.note-subject-label:active {
    background: rgba(74, 139, 255, 0.15);
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.note-context {
    font-size: 0.7rem;
    color: #aaa;
}

.note-edited {
    font-size: 0.68rem;
    color: #bbb;
    font-style: italic;
    cursor: pointer;
}

.note-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    padding-left: 32px;
}

.note-btn {
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    color: #888;
    font-family: var(--font-main);
    transition: transform 0.05s ease, opacity 0.05s ease, background 0.05s ease;
}

.note-btn-del {
    color: #bbb;
}

.note-btn-icon {
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-btn-svg {
    width: 14px;
    height: 14px;
    opacity: 0.4;
}

.note-btn-danger {
    background: #fee;
    color: #c0392b;
}

.note-btn:active {
    transform: scale(0.92);
    opacity: 0.7;
}

.note-btn-icon:active .note-btn-svg {
    opacity: 0.8;
}

.note-btn-danger:active {
    background: #fcc;
}

/* Bottom Input */

.notes-bottom-fixed {
    bottom: 1.5rem;
    z-index: 210;
    max-width: 568px;
    width: 95%;
}

.notes-edit-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 14px;
    background: rgba(10, 38, 74, 0.95);
    border-radius: 15px 15px 15px 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
}

.notes-edit-cancel {
    background: none;
    border: none;
    color: var(--primary-light);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
}

.notes-bottom-input {
    display: flex;
    gap: 4px;
    align-items: flex-end;
}

.notes-edit-hint+.notes-bottom-input .notes-input {
    border-radius: 0 0 15px 15px;
}

.notes-bottom-input .notes-input {
    flex: 1;
    min-height: 36px;
    min-width: 200px;
    max-height: 120px;
    resize: none;
    padding: 0.4rem 0.85rem;
    border: none;
    border-radius: 15px;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.9);
    outline: none;
    scrollbar-width: none;
}

.notes-bottom-input .notes-input::-webkit-scrollbar {
    display: none;
}

.notes-bottom-input .notes-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.notes-bottom-input .notes-input:focus {
    background: rgba(255, 255, 255, 0.12);
}

.notes-send-btn {
    min-width: 42px;
    min-height: 36px;
    padding: 0.4rem;
    border: none;
    border-radius: 15px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.notes-send-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.notes-send-btn:not(:disabled) {
    background: var(--primary-light);
}

.notes-send-btn:not(:disabled):active {
    transform: scale(0.92);
}

.notes-send-icon {
    width: 20px;
    height: 20px;
}

.note-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--primary-light);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    float: right;
}

/* === Transition: Notes Screen === */
.notes-fade-enter-active,
.notes-fade-leave-active {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.notes-fade-enter-from,
.notes-fade-leave-to {
    opacity: 0;
    transform: translateY(16px);
}

/* === Transition: Dialogs === */
.dialog-fade-enter-active,
.dialog-fade-leave-active {
    transition: opacity 0.15s ease;
}

.dialog-fade-enter-active .pwa-dialog,
.dialog-fade-leave-active .pwa-dialog {
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.dialog-fade-enter-from,
.dialog-fade-leave-to {
    opacity: 0;
}

.dialog-fade-enter-from .pwa-dialog,
.dialog-fade-leave-to .pwa-dialog {
    transform: scale(0.92);
    opacity: 0;
}

/* === PWA Install Dialog transitions === */
#pwa-install-dialog {
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

#pwa-install-dialog .pwa-dialog {
    transition: transform 0.15s ease, opacity 0.15s ease;
}

#pwa-install-dialog.pwa-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#pwa-install-dialog.pwa-hidden .pwa-dialog {
    transform: scale(0.92);
    opacity: 0;
}

.notes-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

/* === Holiday Toggle === */

.header-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    width: 32.2px;
    height: 32.2px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    transition: all 0.2s ease;
}

.header-toggle:has(input:checked) {
    background: rgba(255, 255, 255, 0.2);
}

.header-toggle input {
    display: none;
}

.toggle-icon {
    width: 18px;
    height: 18px;
    opacity: 0.4;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.header-toggle:has(input:checked) .toggle-icon {
    opacity: 1;
}

.filter-toggles {
    gap: 4px;
}

.holiday-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.holiday-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-light);
    cursor: pointer;
}

.holiday-toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.holiday-toggle input:checked+.holiday-toggle-label {
    color: rgba(255, 255, 255, 1);
}

.holiday-slot-wrapper {
    padding: 0.5rem 0;
}

.holiday-time {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
}

.holiday-emoji {
    width: 36px;
    opacity: 0.8;
}

.holiday-card {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.holiday-card>span {
    color: rgba(255, 255, 255, 0.773)
}

.holiday-card>strong {
    color: var(--today-bg);
}

.holiday-label {
    font-size: 0.8rem;
    color: #b8860b;
    font-weight: 500;
    padding: 8px;
    text-align: center;
}

.day-header-holiday {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--today-bg);
    margin-top: 4px;
    border-radius: 6px;
    background: var(--primary-light);
    padding: 2px 8px;
}

.header-text-row {
    display: flex;
    align-items: center;
    gap: 8px;
    align-items: flex-end;
}

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

@media (max-width: 900px) {
    .desktop-only {
        display: none;
    }

    .mobile-only {
        height: 27.2px;
        width: 27.2px;
        display: flex;
    }

    .mobile-only .toggle-icon {
        width: 16px;
        height: 16px;
    }

    .notes-body,
    .mobile-schedule {
        scrollbar-width: none;
    }

    .notes-body::-webkit-scrollbar,
    .mobile-schedule::-webkit-scrollbar {
        display: none;
    }
}

.notes-action-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.notes-export-btn {
    align-items: center;
    justify-content: center;
    display: flex;
    background: rgba(155, 89, 182, 0.3);
}

.notes-import-btn {
    align-items: center;
    justify-content: center;
    display: flex;
    background: rgba(46, 204, 113, 0.3);
}

.migrate-text {
    text-align: left;
    font-size: 0.82rem;
    line-height: 1.6;
}

.migrate-purple {
    color: #9b59b6;
    font-weight: 700;
}

.migrate-green {
    color: #2ecc71;
    font-weight: 700;
}

.toast {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    backdrop-filter: blur(12px);
    color: #fff;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 300;
    text-align: center;
    width: 100%;
    max-width: 300px;
    line-height: 1.5;
    animation: toast-in 0.2s ease;
}

.toast a {
    color: var(--primary-light);
    text-decoration: underline;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.migrate-text a {
    color: var(--primary-light);
    text-decoration: underline;
}