 
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/roboto-cyrillic.woff2') format('woff2');
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/roboto-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

 
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --search-panel-height: calc(env(safe-area-inset-top) + 76px);
    --text-primary: #263145;
    --text-secondary: #3a4559;
    --text-muted: #888;
    --accent: #dbbd7d;
    --accent-strong: #b89a4f;
    --accent-soft: rgba(219, 189, 125, 0.18);
    --on-accent: #263145;
    --btn-primary: #263145;
    --btn-primary-text: #fff;
    --btn-grad-text: #fff;
    --popup-bg: #263145;
    --popup-text: #fff;
     
    --bld-1: #ef4444;
    --bld-2: #f59e0b;
    --bld-3: #22c55e;
    --bld-4: #3b82f6;
    --bld-5: #a855f7;
     
    --bld-o1: #0ea5e9;
    --bld-o2: #14b8a6;
    --bld-o3: #84cc16;
    --bld-o4: #eab308;
    --bld-o5: #f97316;
    --bld-o6: #db2777;
    --bld-o7: #7c3aed;
    --surface: #fff;
    --surface-soft: rgba(255, 255, 255, 0.55);
    --surface-strong: rgba(255, 255, 255, 0.85);
    --card: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.06);
    --border: rgba(38, 49, 69, 0.12);
    --border-soft: rgba(38, 49, 69, 0.06);
    --border-strong: rgba(38, 49, 69, 0.24);
    --hover: rgba(38, 49, 69, 0.07);
    --hover-strong: rgba(38, 49, 69, 0.1);
    --shadow: rgba(38, 49, 69, 0.35);
    --shadow-soft: rgba(38, 49, 69, 0.15);
    --btn-grad: linear-gradient(135deg, #263145, #3a4a6b);
    --danger: #c0392b;
    --danger-soft: rgba(192, 57, 43, 0.15);
    --teal: #3f8278;
    --teal-soft: rgba(63, 130, 120, 0.15);
    --input-bg: rgba(245, 246, 250, 0.9);
    --header-bg: rgba(255, 255, 255, 0.85);
    --header-border: rgba(0, 0, 0, 0.06);
     
    --table-bg: whitesmoke;
    --table-cell: transparent;
    --table-lesson: rgba(255, 255, 255, 0.92);
    --page-grad:
        radial-gradient(1200px 600px at 15% -5%, rgba(219, 189, 125, 0.18), transparent 60%),
        radial-gradient(1000px 500px at 85% 110%, rgba(38, 49, 69, 0.12), transparent 60%),
        linear-gradient(160deg, #f3eee1 0%, #e8ecf4 50%, #dbe1ef 100%);
    --body-grad:
        linear-gradient(180deg, #f3eee1 0%, #e8ecf4 50%, #dbe1ef 100%);
    --video-overlay: rgba(245, 246, 250, 0.35);
}

[data-theme="dark"] {
    color-scheme: dark;
    --text-primary: #e7eaf1;
    --text-secondary: #aab4c8;
    --text-muted: #cacbd7;
    --accent: #dbbd7d;
    --accent-strong: #e0c88f;
    --accent-soft: rgba(219, 189, 125, 0.14);
    --on-accent: #263145;
    --btn-primary: #e7eaf1;
    --btn-primary-text: #1b2130;
    --btn-grad-text: #fff;
    --popup-bg: #2a3550;
    --popup-text: #e7eaf1;
    --surface: #1e2635;
    --surface-soft: rgba(255, 255, 255, 0.06);
    --surface-strong: rgba(30, 38, 53, 0.9);
    --card: rgba(30, 38, 53, 0.82);
    --card-border: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.12);
    --border-soft: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.18);
    --hover: rgba(255, 255, 255, 0.07);
    --hover-strong: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.5);
    --shadow-soft: rgba(0, 0, 0, 0.4);
    --btn-grad: linear-gradient(135deg, #2a3550, #3a4a6b);
    --danger: #e07b6d;
    --danger-soft: rgba(224, 123, 109, 0.16);
    --teal: #56b3a6;
    --teal-soft: rgba(86, 179, 166, 0.18);
    --input-bg: rgba(20, 27, 40, 0.6);
    --header-bg: rgba(22, 28, 40, 0.85);
    --header-border: rgba(255, 255, 255, 0.08);
     
    --table-bg: rgba(0, 0, 0, 0.25);
    --table-cell: rgba(255, 255, 255, 0.04);
    --table-lesson: rgba(255, 255, 255, 0.1);
    --page-grad:
        radial-gradient(1200px 600px at 15% -5%, rgba(219, 189, 125, 0.12), transparent 60%),
        radial-gradient(1000px 500px at 85% 110%, rgba(219, 189, 125, 0.05), transparent 60%),
        linear-gradient(160deg, #141820 0%, #181e2b 50%, #12151d 100%);
    --body-grad:
        linear-gradient(180deg, #141820 0%, #181e2b 50%, #12151d 100%);
    --video-overlay: rgba(8, 10, 16, 0.85);
}

body {
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    overflow-x: hidden;
}

 
.video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--video-overlay);
}

 
body.no-video .video-bg video {
    display: none;
}

body.no-video .video-bg {
    background: var(--page-grad);
}

body.no-video .video-bg::after {
    background: none;
}

 
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem 2rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

.hero-logo {
    width: 100px;
    height: 140px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 20px var(--accent-soft));
    animation: fadeIn 0.8s ease-out;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    animation: fadeIn 0.8s ease-out 0.1s both;
    cursor: pointer;
}

.hero-title strong {
    font-weight: 700;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.6rem;
    max-width: 520px;
    line-height: 1.6;
    font-weight: 300;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.hero-subtitle .date-line {
    display: block;
    margin-bottom: 0.4rem;
}
.datelink {
    text-decoration: none;
    color: var(--text-primary);
}

.hero-subtitle .date-line .week-badge {
    background: var(--accent);
    color: var(--text-primary);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.85em;
}

 
.landing-search {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 560px;
    margin-bottom: 1.6rem;
    animation: fadeIn 0.8s ease-out 0.25s both;
    transition: max-height 0.35s ease, opacity 0.35s ease, margin-bottom 0.35s ease;
}

.landing-search .search-box {
    max-width: 560px;
    margin: 0 auto;
}

.landing-search .search-input {
    font-size: 1rem;
    padding: 0.95rem 5.6rem 0.95rem 2.9rem;
}

.search-box {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 520px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-primary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.85rem 3rem 0.85rem 2.8rem;
    border: 2px solid var(--border);
    border-radius: 16px;
    font-size: 0.95rem;
    font-family: 'Roboto', sans-serif;
    background: var(--input-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    color: var(--text-primary);
}

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--hover);
    color: var(--text-muted);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, color 0.2s ease;
}

.search-clear:hover {
    background: var(--hover-strong);
    color: var(--text-primary);
}

.search-clear:active {
    background: var(--border-strong);
}

.search-clear[hidden] {
    display: none;
}

 
.search-box .fav-toolbar-link,
.search-box .fav-toolbar-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--accent-strong);
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease, background 0.2s ease;
}

.search-box .fav-toolbar-link:hover,
.search-box .fav-toolbar-btn:hover {
    background: var(--hover);
    color: var(--accent-strong);
}

.search-box .fav-toolbar-btn.on {
    color: var(--accent-strong);
}

 
.search-box:has(.search-clear:not([hidden])) .fav-toolbar-link,
.search-box:has(.search-clear:not([hidden])) .fav-toolbar-btn {
    right: 44px;
}

.search-box:has(.search-clear:not([hidden])) .search-input {
    padding-right: 5.2rem;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 8px 30px var(--shadow-soft);
    z-index: 500;
}

@media (max-width: 900px) {
    body.search-focused .search-dropdown {
        max-height: calc(100svh - 150px);
    }
}

.search-dropdown.hidden {
    display: none;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--card-border);
    text-align: left;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: var(--accent-soft);
}

.search-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.search-item-icon.group {
    background: var(--hover-strong);
    color: var(--text-primary);
}

.search-item-icon.teacher {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.search-item-icon.classroom {
    background: var(--teal-soft);
    color: var(--teal);
}

.search-item-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-item-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
}

 
.digest {
    width: 100%;
    max-width: 1200px;
    background: var(--surface-strong);
    border-radius: 24px;
    padding: 1.4rem 1.6rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    animation: slideUp 0.6s ease-out 0.15s both;
    box-sizing: border-box;
    text-align: left;
}

.digest-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.digest-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}

.digest-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.digest-link {
    font-size: 0.78rem;
    color: var(--accent-strong);
    text-decoration: none;
    white-space: nowrap;
}

.digest-link:hover {
    text-decoration: underline;
}

.digest-actions {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

 
.digest-ai-btn {
    padding: 0.2rem 0.7rem;
    border: 1px solid var(--accent);
    border-radius: 9999px;
    background: var(--accent-soft);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.digest-ai-btn:hover {
    background: var(--accent);
    color: var(--on-accent);
}

.digest-ai-btn[disabled] {
    opacity: 0.6;
    cursor: default;
}

 
.digest-ai {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.digest-ai-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

 
.digest-ai-narrator {
    margin-bottom: 0.7rem;
    padding: 0.5rem 0.7rem;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 8px;
}

.digest-ai-narrator-name {
    font-weight: 700;
    color: var(--text-primary);
}

.digest-ai-narrator-who {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.digest-ai-narrator-quote {
    margin-top: 0.3rem;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.digest-ai-sub {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.2rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.digest-ai-p {
    margin: 0 0 0.6rem;
}

 
.digest-ai-line {
    display: block;
}

 
.digest-ai-hl-time {
    padding: 0 0.25rem;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 600;
}

 
.digest-ai-notes {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    padding-left: 0.75rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-style: italic;
}

 
.digest-ai-day + .digest-ai-day {
    margin-top: 1rem;
}

.digest-ai-body + .digest-ai-day {
    margin-top: 0.9rem;
}

 
.digest-ai-day.digest-ai-today {
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 0.5rem 0.7rem;
    margin: 1.2rem -10px;
}

.digest-ai-today .digest-ai-sub {
    color: var(--accent-strong);
    margin-bottom: 0.3rem;
}

.digest-ai-today-badge {
    padding: 0.05rem 0.4rem;
    border-radius: 9999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

.digest-ai-today .digest-ai-p:last-child {
    margin-bottom: 0;
}

.digest-ai-p:last-child {
    margin-bottom: 0;
}

.digest-ai-cursor {
    color: var(--accent-strong);
    animation: digest-ai-blink 1s step-end infinite;
}

.digest-ai-disclaimer {
    margin-top: 0.7rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

@keyframes digest-ai-blink {
    50% { opacity: 0; }
}

.digest-ai-wait {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 2rem 1rem;
    min-height: 190px;
    text-align: center;
    color: var(--text-muted);
}

.digest-ai-wait-art {
    width: 64px;
    height: 64px;
    color: var(--accent-strong);
}

.digest-ai-wait-art svg {
    display: block;
    width: 100%;
    height: 100%;
}

.digest-ai-wait-text {
    max-width: 26rem;
    min-height: 2.6em;
    font-size: 0.9rem;
    line-height: 1.4;
}

.wa-ring {
    opacity: 0.4;
    transform-box: view-box;
    transform-origin: 32px 32px;
    animation: wa-rotate 9s linear infinite;
}

.wa-orbit {
    transform-box: view-box;
    transform-origin: 32px 32px;
    animation: wa-rotate 1.7s linear infinite;
}

.wa-core {
    transform-box: view-box;
    transform-origin: 32px 32px;
    animation: wa-pulse 1.7s ease-in-out infinite;
}

@keyframes wa-rotate {
    to { transform: rotate(360deg); }
}

@keyframes wa-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.72); }
    50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .wa-ring, .wa-orbit, .wa-core { animation: none; }
}

.digest-offline {
    margin-top: 0.6rem;
    font-size: 0.72rem;
    color: var(--danger);
    font-weight: 600;
}

body.digest-active .hero-subtitle .hint {
    display: none;
}

body.digest-active .landing-favs {
    order: 3;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
}

body.digest-active .platforms {
    order: 4;
    margin-top: 0;
    margin-bottom: 0.4rem;
}

body.digest-active .digest {
    order: 2;
}

body.digest-active .landing-search {
    order: 1;
    margin-bottom: 1.2rem;
    max-width: 480px;
}

body.digest-active .landing-search .search-input {
    font-size: 0.9rem;
    padding: 0.6rem 2.8rem 0.6rem 2.5rem;
    border-radius: 12px;
}

.landing-search.search-collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

body.digest-active .landing-search.search-collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

body.digest-active .hero {
    justify-content: center;
    padding-top: 2rem;
}

 
@media (display-mode: standalone) {
    .hero {
        padding-top: calc(env(safe-area-inset-top) + 3rem);
    }

    body.digest-active .hero {
        padding-top: calc(env(safe-area-inset-top) + 2rem);
    }
}

body.digest-active .hero-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    width: 100%;
    max-width: 1200px;
    padding-right: 48px;
    box-sizing: border-box;
    margin-bottom: 1.4rem;
    flex-direction: column;
}

body.digest-active .hero-logo {
    width: 48px;
    height: 67px;
    margin: 0;
    flex-shrink: 0;
}

body.digest-active .hero-text {
    flex: 1;
    min-width: 0;
}

body.digest-active .hero-title {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

body.digest-active .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.digest-groups {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    line-height: 1.35;
    font-weight: 500;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    body.digest-active .hero {
        padding-top: 1rem;
    }

    body.digest-active .hero-heading {
        gap: 0.7rem;
         
        padding-right: 90px;
        flex-direction: row;
    }

    body.digest-active .hero-logo {
        width: 40px;
        height: 56px;
    }

    body.digest-active .hero-title {
        font-size: 1.2rem;
    }

    body.digest-active .hero-subtitle {
        font-size: 0.85rem;
    }

    .digest-groups {
        font-size: 0.74rem;
    }
}

@media (max-width: 640px) {
    .digest {
        padding: 1rem 1rem;
        border-radius: 18px;
    }

    .digest-title {
        font-size: 1.05rem;
    }

    .digest-item {
        grid-template-columns: 32px 1fr;
        gap: 0.7rem;
    }
}

.digest-body {
    margin-top: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.digest-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 0.9rem;
    padding: 0.55rem 0.7rem;
    background: var(--hover);
    border-radius: 12px;
    transition: opacity 0.25s ease;
    margin-top: 0.4rem;
}

.digest-item.past {
    opacity: 0.42;
    filter: grayscale(0.5);
}

.digest-item.current {
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

.digest-item-time {
    display: flex;
    flex-direction: column;
    font-size: 0.76rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.25;
}

.digest-item-time span:last-child {
    color: var(--text-muted);
    font-weight: 500;
}

.digest-item-main {
    min-width: 0;
}

.digest-item.parallel {
    align-items: stretch;
}

.digest-day-parallel {
    display: flex;
    flex-direction: column;
 
    gap: 0.4rem;
    min-width: 0;
}

.digest-day-parallel-item {
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
}

.digest-item-subject {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.digest-item-meta {
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.digest-note {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-top: 0.3rem;
    padding: 0.12rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.35;
}

 
.wn-now {
    display: inline-block;
    padding: 0 0.4em;
    border-radius: 9px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
}

.digest-badge {
    background: var(--accent);
    color: var(--on-accent);
    border-radius: 6px;
    padding: 0.05rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
}

.digest-subgroup {
    font-weight: 600;
    color: var(--accent-strong);
    font-size: small;
}

.digest-empty {
    font-size: 0.95rem;
    color: var(--text-muted);
    padding: 0.4rem 0;
}

.digest-days {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.digest-days.two {
    margin-top: 0.2rem;
}

.digest-day {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.digest-day-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.digest-day-title {
    color: var(--text-primary);
}

.digest-day-mode {
    background: var(--btn-grad);
    color: var(--btn-primary-text);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.15rem 0.6rem;
    white-space: nowrap;
}

.digest-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.digest-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.2s ease, width 0.2s ease;
}

.digest-dot.active {
    width: 14px;
    border-radius: 999px;
    background: var(--accent);
}

@media (max-width: 899.98px) {
    .digest-days.two {
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-snap-stop: always;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
    }

    .digest-days.two::-webkit-scrollbar {
        display: none;
    }

    .digest-days.two .digest-day {
        flex: 0 0 100%;
        min-width: 100%;
        scroll-snap-align: start;
    }
}

@media (min-width: 900px) {
    .digest-days.two {
        flex-direction: row;
        align-items: stretch;
        gap: 1.25rem;
    }

    .digest-days.two .digest-day {
        flex: 1 1 0;
    }

    .digest-dots {
        display: none;
    }
}

.platforms {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    width: 100%;
    animation: fadeIn 0.8s ease-out 0.3s both;
    padding-top: 1rem;
}

.platform {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.98rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.platform:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.platform-sep {
    color: var(--text-muted);
    font-size: 0.9rem;
    user-select: none;
}

 
.landing-favs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 1.2rem;
    animation: fadeIn 0.8s ease-out 0.28s both;
}

.landing-favs[hidden] {
    display: none;
}

.landing-favs-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.15rem;
    text-decoration: none;
    cursor: pointer;
}

.landing-favs-label:hover {
    color: var(--text-primary);
}

.landing-favs-chips {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.landing-favs .fav-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 9999px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.82rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.landing-favs .fav-chip:hover {
    background: var(--accent-soft);
}

.landing-favs .fav-chip-remove {
    color: var(--accent-strong);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 0.15rem;
}

.landing-favs .fav-chip-remove:hover {
    color: var(--accent-strong);
}

 
.fav-page-lead {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.1rem;
}

.fav-page-box {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.8rem;
    margin: 0 auto 1.5rem;
}

.fav-page-card {
    position: relative;
    background: var(--surface-soft);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.fav-page-card:hover {
    background: var(--surface);
    border-color: var(--accent);
}

.fav-page-card-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.9rem 2.6rem 0.9rem 1rem;
    border-radius: 12px;
    text-decoration: none;
}

.fav-page-card-name {
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.15s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fav-page-card:hover .fav-page-card-name {
    color: var(--accent-strong);
}

.fav-page-card-type {
    font-size: 0.85rem;
    color: var(--accent-strong);
}

.fav-page-card-extra {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fav-page-card-extra.hidden {
    display: none;
}

.fav-page-card-remove {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 1;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--accent-strong);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease;
}

.fav-page-card-remove:hover {
    background: var(--hover);
}

.fav-page-empty {
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    max-width: 720px;
    text-align: center;
    padding: 2.5rem 1rem;
    background: var(--surface-strong);
    border: 1px solid var(--card-border);
    border-radius: 14px;
}

.fav-page-empty p {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.fav-page-empty-link {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border-radius: 9999px;
    background: var(--btn-grad);
    color: var(--btn-grad-text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

 
.footer {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
    position: relative;
    z-index: 2;
    line-height: 1.6;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--text-primary);
}

.app-meta {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

 
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

 
body.page-leaving {
    opacity: 0;
    transition: opacity 0.25s ease;
}

 
@media (max-width: 768px) {
    .hero {
        padding: 2rem 1rem 1.5rem;
    }

    body.digest-active .hero {
        justify-content: flex-start;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.2rem;
    }

    .landing-search {
        max-width: 100%;
    }

    .hero-logo {
        width: 72px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.88rem;
    }
}

 
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 0.75rem 1.5rem;
        justify-content: center;
        gap: 0.75rem;
    }

    .hero-heading {
        display: flex;
        align-items: center;
        gap: 1.25rem;
        text-align: left;
    }

    .hero-logo {
        width: 56px;
        height: 78px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

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

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.15rem;
    }

     
    .hero-subtitle {
        font-size: 0.85rem;
        margin-bottom: 0;
        line-height: 1.3;
    }

    .hero-subtitle .date-line {
        margin-bottom: 0.2rem;
    }

    .hero-subtitle .hint {
        display: none;
    }

     
    body.digest-active .hero {
        padding: 0.6rem 1rem 0;
        justify-content: flex-start;
    }

    body.digest-active .hero-heading {
        flex-direction: row;
        gap: 0.7rem;
        padding-right: 90px;
        margin-bottom: 0.7rem;
    }

    body.digest-active .hero-logo {
        width: 40px;
        height: 56px;
    }

    body.digest-active .hero-title {
        font-size: 1.2rem;
    }

    body.digest-active .hero-subtitle {
        font-size: 0.85rem;
    }

    .platforms {
        gap: 0.6rem;
        max-width: 100%;
    }

    .platform {
        font-size: 0.9rem;
    }

    .footer {
        padding: 0.75rem;
        line-height: 1.4;
        font-size: 0.72rem;
    }
}

@media (min-height: 800px) {
    .hero {
        justify-content: center;
    }
}

 
.toast-stack {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: calc(100vw - 24px);
    z-index: 1300;
    pointer-events: none;
}

.toast {
    position: relative;
    box-sizing: border-box;
    width: max-content;
    max-width: calc(100vw - 24px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.35;
    box-shadow: 0 12px 40px var(--shadow-soft);
    pointer-events: auto;
    animation: toast-in 0.3s ease-out both;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.toast--out {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
}

.toast.toast--info {
    background: var(--popup-bg);
    color: var(--popup-text);
}

.toast.toast--prompt,
.toast.toast--progress {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--accent-soft);
}

.toast-text {
    flex: 1 1 auto;
    min-width: 0;
}

.toast-action {
    all: unset;
    cursor: pointer;
    flex-shrink: 0;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    border-radius: 8px;
    padding: 6px 14px;
    white-space: nowrap;
}

.toast-action:hover {
    background: var(--accent-strong);
}

.toast-close {
    all: unset;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--text-muted);
    padding: 2px 4px;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-progress-bar {
    flex-basis: 100%;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--surface-soft);
}

.toast-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.2s ease;
}

.toast--progress.indeterminate .toast-progress-fill {
    width: 40%;
    animation: sync-progress-slide 1.2s ease-in-out infinite;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

 
.about-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.about-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.about-lead {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

.about-list {
    margin: 0.3rem 0 0;
    padding-left: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.about-list li {
    margin: 0.15rem 0;
}

 
.room-legend {
    list-style: none;
    margin: 0.55rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.room-legend li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.room-legend-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--room-color, var(--text-muted));
}

.room-legend-map {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--border-strong);
}

.room-legend-map:hover {
    color: var(--accent-strong);
    border-bottom-color: var(--accent);
}

.about-email {
    color: var(--text-secondary);
    line-height: 1.7;
}

.about-email a {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
}

.about-email a:hover {
    text-decoration: underline;
}

.about-rights a {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
}

.about-rights a:hover {
    text-decoration: underline;
}

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

.about-grid .info-section {
    margin-bottom: 0;
}

.about-wide {
    grid-column: 1 / -1;
}

.about-grid [id] {
    scroll-margin-top: 1rem;
}

.about-hero {
    grid-column: 1 / -1;
    padding: 1.5rem 1rem 0.5rem;
    text-align: center;
}

.about-hero-title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.about-hero-lead {
    max-width: 48ch;
    margin: 0 auto;
    color: var(--text-secondary);
    line-height: 1.6;
}

.about-hero-actions {
    margin-top: 1.1rem;
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.about-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    background: var(--btn-primary);
    color: var(--btn-primary-text);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.about-cta:hover {
    opacity: 0.88;
}

.about-anchors {
    margin-top: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.about-anchor {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.about-anchor:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
}

.about-subtitle {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.about-contacts {
    display: grid;
    gap: 1rem;
}

.about-contact-block + .about-contact-block {
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-soft);
}

.about-rooms-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
    margin-top: 0.6rem;
}

.about-rooms-col {
    padding: 0.9rem 1rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: var(--surface-soft);
}

@media (max-width: 900px) {
    .about-grid,
    .about-rooms-grid {
        grid-template-columns: 1fr;
    }
}

[data-theme="dark"] .hero-logo {
    filter: brightness(0) invert(1) drop-shadow(0 4px 20px var(--accent-soft));
}

 
.search-hint {
    display: none;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.35rem 0.5rem 0.2rem;
}

 
@media (max-width: 900px) {
    body.search-focused .hero-heading,
    body.search-focused .landing-favs {
        display: none;
    }

    body.search-focused .landing-search {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 400;
        max-width: none;
        margin: 0;
        padding: calc(env(safe-area-inset-top) + 0.75rem) 1rem 0.75rem;
        background: var(--surface);
        box-shadow: 0 12px 28px var(--shadow);
    }

    body.search-focused .landing-search .search-box {
        max-width: none;
    }

    body.search-focused .landing-search .search-box .fav-toolbar-link {
        display: none;
    }

    body.search-focused .landing-search .search-input {
        padding-right: 3.1rem;
    }
}

 
@media (max-width: 900px) {
    body.search-focused .search-icon {
        display: none;
    }

    body.search-focused .search-input {
        padding-left: 1rem;
        font-size: 1rem;
    }

    body.search-focused .search-dropdown {
        position: fixed;
        top: var(--search-panel-height);
        left: 0;
        right: 0;
        height: calc(100svh - var(--search-panel-height));
        max-height: none;
        border-radius: 0;
        overflow-y: auto;
        z-index: 500;
    }

    body.search-focused .search-hint {
        display: block;
    }
}

 
#view-landing,
#view-schedule,
#view-info,
#view-about,
#view-favorites {
    display: none;
}

body.route-landing #view-landing {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    position: relative;
}

body.route-schedule #view-schedule,
body.route-info #view-info,
body.route-about #view-about,
body.route-favorites #view-favorites {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    position: relative;
}

 
.dev-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2200;
    box-sizing: border-box;
    padding: 5px 12px;
    background: #b45309;
    color: #fff;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.01em;
}

.dev-banner-logout {
    margin-left: 8px;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}
