/* =============================================
   Plan PUM — Liquid Glass UI
   PUM brand: clean white, charcoal, red accent
   ============================================= */

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

/* === Color Tokens === */
[data-theme="dark"] {
    --bg-solid: #121218;
    --text: #eaeaf0;
    --text-secondary: #8888a0;
    --accent: #e02020;
    --accent-hover: #f03030;
    --accent-subtle: rgba(224,32,32,0.10);
    --accent-glow: rgba(224,32,32,0.25);
    --danger: #f85149;
    --success: #3fb950;

    --glass-bg: rgba(255,255,255,0.03);
    --glass-bg-heavy: rgba(255,255,255,0.05);
    --glass-border: rgba(255,255,255,0.08);
    --glass-border-light: rgba(255,255,255,0.12);
    --glass-shine-top: rgba(255,255,255,0.09);
    --glass-shine-bottom: rgba(255,255,255,0.02);
    --glass-hover: rgba(255,255,255,0.07);
    --glass-input: rgba(255,255,255,0.04);
    --glass-dropdown-bg: rgba(30,30,42,0.92);
    --glass-blur: 32px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.35);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.45);
    --shadow-glow: 0 0 40px rgba(224,32,32,0.12);
    --ring: rgba(224,32,32,0.30);

    --type-w: #e02020;
    --type-s: #5ba8ff;
    --type-cw: #3dd068;

    --mesh-1: radial-gradient(ellipse 600px 400px at 15% 20%, rgba(224,32,32,0.07) 0%, transparent 100%);
    --mesh-2: radial-gradient(ellipse 500px 500px at 85% 80%, rgba(91,168,255,0.05) 0%, transparent 100%);
    --mesh-3: radial-gradient(ellipse 400px 300px at 50% 50%, rgba(61,208,104,0.03) 0%, transparent 100%);
}

[data-theme="light"] {
    --bg-solid: #f2f2f7;
    --text: #1c1c2e;
    --text-secondary: #6e6e80;
    --accent: #c00000;
    --accent-hover: #a50000;
    --accent-subtle: rgba(192,0,0,0.06);
    --accent-glow: rgba(192,0,0,0.15);
    --danger: #cf222e;
    --success: #1a7f37;

    --glass-bg: rgba(255,255,255,0.45);
    --glass-bg-heavy: rgba(255,255,255,0.60);
    --glass-border: rgba(255,255,255,0.55);
    --glass-border-light: rgba(255,255,255,0.75);
    --glass-shine-top: rgba(255,255,255,0.80);
    --glass-shine-bottom: rgba(255,255,255,0.30);
    --glass-hover: rgba(255,255,255,0.70);
    --glass-input: rgba(255,255,255,0.50);
    --glass-dropdown-bg: rgba(255,255,255,0.88);
    --glass-blur: 32px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.10), 0 0 1px rgba(0,0,0,0.10);
    --shadow-glow: 0 0 40px rgba(192,0,0,0.06);
    --ring: rgba(192,0,0,0.18);

    --type-w: #c00000;
    --type-s: #2563eb;
    --type-cw: #16a34a;

    --mesh-1: radial-gradient(ellipse 600px 400px at 15% 20%, rgba(192,0,0,0.05) 0%, transparent 100%);
    --mesh-2: radial-gradient(ellipse 500px 500px at 85% 80%, rgba(37,99,235,0.04) 0%, transparent 100%);
    --mesh-3: radial-gradient(ellipse 400px 300px at 50% 50%, rgba(22,163,74,0.03) 0%, transparent 100%);
}

/* === Global === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-solid);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.4s, color 0.4s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Mesh gradient background - colorful blobs behind everything */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        var(--mesh-1),
        var(--mesh-2),
        var(--mesh-3);
    pointer-events: none;
    animation: meshShift 20s ease-in-out infinite alternate;
}

@keyframes meshShift {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* PUM accent stripe */
body::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, transparent 10%, var(--accent) 50%, transparent 90%);
    position: sticky;
    top: 0;
    z-index: 101;
}

/* === Liquid Glass base helper === */

/* ========================================
   Header — frosted glass bar
   ======================================== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 var(--glass-shine-top), var(--shadow-sm);
    transition: background 0.4s;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--accent);
    white-space: nowrap;
}

.current-info {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 600px;
    padding: 5px 14px;
    background: var(--glass-bg);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.current-info:empty {
    display: none;
}

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

.header-right button {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
    position: relative;
    overflow: hidden;
}

.header-right button:hover {
    color: var(--text);
    background: var(--glass-hover);
    border-color: var(--glass-border-light);
    box-shadow: inset 0 1px 0 var(--glass-shine-top), var(--shadow-sm);
}

/* Edge-detect glow animation */
@keyframes tf-edge-pulse {
    0%, 100% { opacity: 0.4; filter: blur(2px); }
    50%      { opacity: 1;   filter: blur(0.5px); }
}
@keyframes tf-edge-shift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.schools-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: rgba(96,165,250,0.08);
    border: 1px solid rgba(96,165,250,0.2);
    border-radius: 10px;
    color: #60a5fa;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}

.schools-link:hover {
    background: rgba(96,165,250,0.15);
    border-color: rgba(96,165,250,0.35);
}

[data-theme="light"] .schools-link {
    background: rgba(59,130,246,0.06);
    border-color: rgba(59,130,246,0.2);
    color: #3b82f6;
}

.taskforge-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-radius: 12px;
    color: #e85d04;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

/* Edge-detect style border — sharp scanning gradient */
.taskforge-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(232,93,4,0.15) 20%,
        rgba(255,160,60,0.7) 40%,
        #fff 50%,
        rgba(255,160,60,0.7) 60%,
        rgba(232,93,4,0.15) 80%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: tf-edge-shift 3s linear infinite, tf-edge-pulse 2.5s ease-in-out infinite;
    z-index: 0;
}

/* Interior cover */
.taskforge-link::after {
    content: '';
    position: absolute;
    inset: 1.5px;
    border-radius: 10.5px;
    background: var(--bg-solid);
    z-index: 1;
    transition: background 0.2s;
}

/* Keep text/icon above the covers */
.taskforge-link > * {
    position: relative;
    z-index: 2;
}

.taskforge-link:hover::before {
    animation: tf-edge-shift 1.2s linear infinite;
    opacity: 1;
    filter: blur(0px);
}
.taskforge-link:hover::after {
    background: linear-gradient(135deg, rgba(232,93,4,0.18), rgba(232,93,4,0.08));
}
@media (max-width: 480px) {
    .taskforge-link span { display: none; }
    .taskforge-link { padding: 7px 10px; }
}

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ========================================
   Filter Warning Banner
   ======================================== */
.filter-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 28px;
    background: rgba(248,81,73,0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(248,81,73,0.12);
    font-size: 0.82rem;
    color: var(--danger);
    animation: slideDown 0.3s ease-out;
}

.filter-warning svg { flex-shrink: 0; }
.filter-warning span { flex: 1; }

.filter-warning-close {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.filter-warning-close:hover { opacity: 1; }

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#settings-btn.settings-pulse {
    animation: settingsPulse 1.5s ease-in-out infinite;
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}

@keyframes settingsPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248,81,73,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(248,81,73,0); }
}

/* ========================================
   Week Navigation
   ======================================== */
.week-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 28px 8px;
}

.week-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 var(--glass-shine-top), inset 0 -1px 0 var(--glass-shine-bottom);
}

.week-nav button:hover {
    color: var(--text);
    background: var(--glass-hover);
    border-color: var(--glass-border-light);
    box-shadow:
        inset 0 1px 0 var(--glass-shine-top),
        inset 0 -1px 0 var(--glass-shine-bottom),
        var(--shadow-sm);
}

#prev-week, #next-week {
    width: 38px;
    height: 38px;
}

#today-btn {
    padding: 9px 20px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#week-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    min-width: 240px;
    text-align: center;
}

/* ========================================
   Now & Next Bar — glass panels
   ======================================== */
#now-next-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0 28px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.now-card {
    position: relative;
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(48px) saturate(180%);
    -webkit-backdrop-filter: blur(48px) saturate(180%);
    border: 1px solid var(--glass-border-light);
    border-radius: 18px;
    padding: 22px 26px;
    transition: all 0.3s;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 var(--glass-shine-top),
        inset 0 -1px 0 var(--glass-shine-bottom),
        var(--shadow-md);
    z-index: 0;
}

.now-card:first-child {
    border-radius: 18px 0 0 18px;
    border-right: none;
}

.now-card:last-child {
    border-radius: 0 18px 18px 0;
    border-left: none;
}

/* Floating ambient orbs — Samsung Music style */
.now-card::before,
.now-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
}

/* Orb 1 — large, top-left drift */
.now-card::before {
    width: 180px;
    height: 180px;
    top: -40px;
    left: -30px;
    animation: orbFloat1 7s ease-in-out infinite alternate;
}

/* Orb 2 — medium, bottom-right drift */
.now-card::after {
    width: 140px;
    height: 140px;
    bottom: -30px;
    right: -20px;
    animation: orbFloat2 9s ease-in-out infinite alternate;
}

/* "Teraz" card — red/warm orbs */

.now-card:first-child::before {
    background: radial-gradient(circle, rgba(224,32,32,0.55) 0%, rgba(224,32,32,0) 70%);
    opacity: 1;
}

.now-card:first-child::after {
    background: radial-gradient(circle, rgba(255,120,80,0.40) 0%, rgba(255,120,80,0) 70%);
    opacity: 1;
}

/* "Następne" card — blue/cool orbs */
.now-card:last-child::before {
    background: radial-gradient(circle, rgba(91,168,255,0.50) 0%, rgba(91,168,255,0) 70%);
    opacity: 1;
}

.now-card:last-child::after {
    background: radial-gradient(circle, rgba(61,208,104,0.35) 0%, rgba(61,208,104,0) 70%);
    opacity: 1;
}

@keyframes orbFloat1 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(30px, 20px) scale(1.1); }
    66%  { transform: translate(-10px, 35px) scale(0.95); }
    100% { transform: translate(20px, 5px) scale(1.05); }
}

@keyframes orbFloat2 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(-25px, -15px) scale(1.15); }
    66%  { transform: translate(15px, -30px) scale(0.9); }
    100% { transform: translate(-20px, -10px) scale(1.1); }
}

/* Extra floating orb via inner div */
.now-card .orb-extra {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    filter: blur(45px);
    z-index: -1;
    pointer-events: none;
    top: 50%;
    left: 50%;
    animation: orbFloat3 11s ease-in-out infinite alternate;
}

.now-card:first-child .orb-extra {
    background: radial-gradient(circle, rgba(255,180,60,0.40) 0%, transparent 70%);
}

.now-card:last-child .orb-extra {
    background: radial-gradient(circle, rgba(140,100,255,0.35) 0%, transparent 70%);
}

@keyframes orbFloat3 {
    0%   { transform: translate(-50%, -50%) translate(0, 0) scale(1); }
    25%  { transform: translate(-50%, -50%) translate(-20px, 25px) scale(1.2); }
    50%  { transform: translate(-50%, -50%) translate(25px, -10px) scale(0.85); }
    75%  { transform: translate(-50%, -50%) translate(10px, 20px) scale(1.1); }
    100% { transform: translate(-50%, -50%) translate(-15px, -15px) scale(1); }
}

/* Light theme — softer orb colors */
[data-theme="light"] .now-card:first-child::before {
    background: radial-gradient(circle, rgba(192,0,0,0.25) 0%, transparent 70%);
}
[data-theme="light"] .now-card:first-child::after {
    background: radial-gradient(circle, rgba(255,120,80,0.20) 0%, transparent 70%);
}
[data-theme="light"] .now-card:first-child .orb-extra {
    background: radial-gradient(circle, rgba(255,180,60,0.20) 0%, transparent 70%);
}
[data-theme="light"] .now-card:last-child::before {
    background: radial-gradient(circle, rgba(37,99,235,0.22) 0%, transparent 70%);
}
[data-theme="light"] .now-card:last-child::after {
    background: radial-gradient(circle, rgba(22,163,74,0.18) 0%, transparent 70%);
}
[data-theme="light"] .now-card:last-child .orb-extra {
    background: radial-gradient(circle, rgba(140,100,255,0.18) 0%, transparent 70%);
}

.now-card-label {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent);
    margin-bottom: 14px;
}

.now-card-label.next-label {
    color: var(--type-s);
    opacity: 0.85;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(63,185,80,0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(63,185,80,0); }
}

.now-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.now-empty {
    font-size: 0.92rem;
    color: var(--text-secondary);
    padding: 8px 0;
}

.now-lesson-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.now-lesson-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.now-lesson-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.now-lesson-time {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 8px;
}

.now-lesson-countdown {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 600;
    margin-top: 4px;
}

.now-type-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ========================================
   Schedule Container
   ======================================== */
#schedule-container {
    padding: 0 28px 48px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

/* ========================================
   Schedule Grid — frosted glass table
   ======================================== */
#schedule-grid {
    display: grid;
    grid-template-columns: 56px repeat(5, 1fr);
    gap: 1px;
    background: var(--glass-border);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

.grid-header {
    background: var(--glass-bg-heavy);
    padding: 14px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.grid-header.today-header {
    color: var(--accent);
    background: var(--accent-subtle);
}

.grid-header .date-num {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 3px;
}

.grid-header.today-header .date-num {
    color: var(--accent);
}

.time-label {
    background: var(--glass-bg-heavy);
    padding: 8px 4px;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 60px;
    font-variant-numeric: tabular-nums;
}

.day-column {
    background: var(--glass-bg);
    position: relative;
    min-height: 60px;
}

/* ========================================
   Lesson Blocks — glass pills
   ======================================== */
.lesson-block {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: 10px;
    padding: 6px 8px;
    font-size: 0.73rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1;
    border-left: 3px solid;
}

/* Subtle floating orb on lesson blocks */
.lesson-block::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    top: -15px;
    right: -15px;
    background: radial-gradient(circle, var(--lesson-orb-color, rgba(255,255,255,0.12)) 0%, transparent 70%);
    filter: blur(18px);
    pointer-events: none;
    animation: lessonOrb 6s ease-in-out infinite alternate;
    opacity: 0.7;
}

.lesson-block:hover {
    transform: scale(1.04) translateY(-1px);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.lesson-block:hover::before {
    opacity: 1;
}

@keyframes lessonOrb {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-8px, 10px) scale(1.15); }
    100% { transform: translate(5px, 3px) scale(0.9); }
}

.lesson-title {
    font-weight: 600;
    font-size: 0.73rem;
    line-height: 1.3;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-info {
    font-size: 0.63rem;
    opacity: 0.8;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-type {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 5px;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ========================================
   Status / Empty / Error
   ======================================== */
.status-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 24px;
    min-height: calc(100vh - 200px);
    color: var(--text-secondary);
}

.status-message p {
    font-size: 1rem;
    margin-top: 16px;
}

.empty-welcome {
    gap: 12px;
}

.empty-welcome svg {
    opacity: 0.25;
    color: var(--accent);
}

.empty-welcome p {
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.empty-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 0.9rem;
    margin-top: 8px;
    border-radius: 14px;
    transition: all 0.25s;
}

.empty-settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow), var(--shadow-glow);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ========================================
   Modal — heavy frosted glass panel
   ======================================== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    position: relative;
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(48px) saturate(180%);
    -webkit-backdrop-filter: blur(48px) saturate(180%);
    border: 1px solid var(--glass-border-light);
    border-radius: 22px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow:
        inset 0 1px 0 var(--glass-shine-top),
        inset 0 -1px 0 var(--glass-shine-bottom),
        var(--shadow-lg);
    animation: modalIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalIn {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.close-btn:hover {
    background: var(--glass-hover);
    color: var(--text);
}

.modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
}

.setting-group {
    margin-bottom: 18px;
}

.setting-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.setting-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
}

/* === Selected groups chip summary === */
.selected-groups-summary {
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--glass-input, rgba(255,255,255,0.04));
    border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
    border-radius: 10px;
    font-size: 0.78rem;
    line-height: 1.5;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.selected-groups-label {
    color: var(--text-secondary);
    font-weight: 600;
}
.selected-group-chip {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent, #ff7a00);
    color: #fff;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.74rem;
    letter-spacing: 0.2px;
}

/* === Disable-animations toggle === */
.setting-toggle-row {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.08));
}
.setting-toggle {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 6px !important;
}
.setting-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent, #ff7a00);
    cursor: pointer;
    flex-shrink: 0;
}
.setting-toggle span {
    font-weight: 600;
    font-size: 0.9rem;
}

body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    transition-delay: 0s !important;
}
body.no-animations .grid-particle-canvas {
    display: none !important;
}

/* === Glass selects === */
.modal-body select,
.group-category-select {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--glass-input);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: all 0.25s;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 32px;
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
}

.modal-body select:focus,
.group-category-select:focus {
    border-color: var(--accent);
    box-shadow:
        inset 0 1px 0 var(--glass-shine-top),
        0 0 0 3px var(--ring);
}

.modal-body select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.modal-body select option,
.group-category-select option {
    background: var(--bg-solid);
    color: var(--text);
    padding: 8px;
}

/* === Custom Glass Select (replaces native <select>) === */
.glass-select {
    position: relative;
    width: 100%;
}

.glass-select > select {
    display: none !important;
}

.glass-select-trigger {
    width: 100%;
    padding: 10px 14px;
    padding-right: 34px;
    background-color: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.glass-select-trigger:hover {
    border-color: var(--glass-border-light);
    box-shadow: inset 0 1px 0 var(--glass-shine-top), var(--shadow-sm);
}

.glass-select-trigger.placeholder {
    color: var(--text-secondary);
}

.glass-select-trigger.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.glass-select.open .glass-select-trigger {
    border-color: var(--accent);
    box-shadow: inset 0 1px 0 var(--glass-shine-top), 0 0 0 3px var(--ring);
}

.glass-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--glass-dropdown-bg);
    backdrop-filter: blur(48px) saturate(200%);
    -webkit-backdrop-filter: blur(48px) saturate(200%);
    border: 1px solid var(--glass-border-light);
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 var(--glass-shine-top),
        inset 0 -1px 0 var(--glass-shine-bottom),
        var(--shadow-lg);
    z-index: 50;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
    animation: glassDropIn 0.15s ease;
}

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

.glass-select-option {
    padding: 9px 14px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.glass-select-option:hover {
    background: var(--glass-hover);
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
}

.glass-select-option.selected {
    color: var(--accent);
    font-weight: 600;
    background: var(--accent-subtle);
}

/* === Load groups button === */
.btn-load-groups {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 16px;
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
}

.btn-load-groups:hover:not(:disabled) {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-subtle);
    box-shadow: inset 0 1px 0 var(--glass-shine-top), 0 0 12px var(--accent-glow);
}

.btn-load-groups:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === Glass buttons === */
.btn-primary {
    padding: 11px 22px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.20),
        0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.25),
        0 8px 24px var(--accent-glow),
        var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    padding: 10px 22px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--danger);
    border: 1px solid rgba(248,81,73,0.15);
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    width: 100%;
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
}

.btn-danger:hover {
    background: rgba(248,81,73,0.08);
    border-color: rgba(248,81,73,0.3);
}

.saved-msg {
    color: var(--success);
    font-weight: 600;
    font-size: 0.85rem;
}

/* ========================================
   Tooltip — glass popup
   ======================================== */
.lesson-tooltip {
    position: fixed;
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(48px) saturate(200%);
    -webkit-backdrop-filter: blur(48px) saturate(200%);
    border: 1px solid var(--glass-border-light);
    border-radius: 18px;
    padding: 18px;
    z-index: 300;
    box-shadow:
        inset 0 1px 0 var(--glass-shine-top),
        inset 0 -1px 0 var(--glass-shine-bottom),
        var(--shadow-lg);
    max-width: 320px;
    animation: tooltipIn 0.15s ease;
}

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

.lesson-tooltip h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.lesson-tooltip .detail-row {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.lesson-tooltip .detail-label {
    color: var(--text-secondary);
    min-width: 60px;
    font-weight: 500;
}

/* ========================================
   Multi-Select — glass dropdown
   ======================================== */
.multiselect {
    position: relative;
    width: 100%;
}

.multiselect-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 44px;
    padding: 8px 12px;
    background-color: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s;
    align-items: center;
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
}

.multiselect-selected:hover {
    border-color: var(--glass-border-light);
    box-shadow:
        inset 0 1px 0 var(--glass-shine-top),
        var(--shadow-sm);
}

.multiselect-placeholder {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.multiselect-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-size: 0.73rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20);
}

.chip-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.chip-remove:hover { color: #fff; }

.multiselect-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--glass-dropdown-bg);
    backdrop-filter: blur(48px) saturate(200%);
    -webkit-backdrop-filter: blur(48px) saturate(200%);
    border: 1px solid var(--glass-border-light);
    border-radius: 16px;
    box-shadow:
        inset 0 1px 0 var(--glass-shine-top),
        inset 0 -1px 0 var(--glass-shine-bottom),
        var(--shadow-lg);
    z-index: 50;
    max-height: 260px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.multiselect-search {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--glass-input);
    border: none;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    outline: none;
    transition: background 0.2s;
}

.multiselect-search::placeholder {
    color: var(--text-secondary);
}

.multiselect-search:focus {
    background-color: var(--glass-hover);
}

.multiselect-options {
    overflow-y: auto;
    flex: 1;
    padding: 4px 0;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.15s;
    border-radius: 0;
}

.multiselect-option:hover {
    background: var(--glass-hover);
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
}

.multiselect-option input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.multiselect-section-header {
    padding: 7px 14px 5px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent);
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
}

.multiselect-empty {
    padding: 20px 12px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.label-optional {
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* === Glass input === */
#custom-groups-input {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.25s;
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
}

#custom-groups-input:focus {
    border-color: var(--accent);
    box-shadow:
        inset 0 1px 0 var(--glass-shine-top),
        0 0 0 3px var(--ring);
}

#custom-groups-input::placeholder {
    color: var(--text-secondary);
}

/* === Group selects grid === */
#group-selects-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

#group-selects-container .setting-group {
    margin-bottom: 0;
}

.sync-status-text {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 14px;
}

/* ========================================
   Mobile Cards — glass panels
   ======================================== */
#schedule-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-card {
    position: relative;
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 var(--glass-shine-top),
        inset 0 -1px 0 var(--glass-shine-bottom),
        var(--shadow-sm);
}

.day-card-today {
    border-color: rgba(224,32,32,0.25);
    box-shadow:
        inset 0 1px 0 var(--glass-shine-top),
        inset 0 -1px 0 var(--glass-shine-bottom),
        0 0 24px rgba(224,32,32,0.05);
}

.day-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.day-card-header:hover {
    background: var(--glass-hover);
}

.day-card-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.day-card-today .day-card-name {
    color: var(--accent);
}

.day-card-date {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.day-card-count {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
    border: 1px solid var(--glass-border);
}

.day-card-chevron {
    color: var(--text-secondary);
    transition: transform 0.25s;
    flex-shrink: 0;
}

.day-card.collapsed .day-card-chevron {
    transform: rotate(-90deg);
}

.day-card-body {
    padding: 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-card-empty {
    padding: 16px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.lesson-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 14px;
    padding: 14px 16px;
    border-left: 3px solid;
    transition: all 0.2s;
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
    overflow: hidden;
}

.lesson-card::before {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    top: -20px;
    right: -20px;
    background: radial-gradient(circle, var(--lesson-orb-color, rgba(255,255,255,0.10)) 0%, transparent 70%);
    filter: blur(20px);
    pointer-events: none;
    animation: lessonOrb 6s ease-in-out infinite alternate;
    opacity: 0.6;
}

.lesson-card:active {
    transform: scale(0.98);
}

.lesson-card-time {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.lesson-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 8px;
}

.lesson-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.73rem;
    color: var(--text-secondary);
    align-items: center;
}

.lesson-card-type {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========================================
   Footer — Coffee + Powered by
   ======================================== */
.site-footer {
    text-align: center;
    padding: 24px 28px 36px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-support {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-support-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 340px;
    line-height: 1.5;
}

.footer-powered {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

.footer-powered-text {
    letter-spacing: 0.02em;
}

.footer-tf-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(232,93,4,0.8);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    transition: color 0.2s, opacity 0.2s;
}

.footer-tf-link:hover {
    color: #e85d04;
    opacity: 1;
}

.footer-tf-link svg {
    flex-shrink: 0;
}

/* Secondary ghost button (e.g. Odrabianie zajęć) */
.btn-ghost-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border-light);
    color: var(--text-secondary);
    box-shadow: inset 0 1px 0 var(--glass-shine-top);
}

.btn-ghost-secondary:hover {
    background: var(--glass-hover);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: inset 0 1px 0 var(--glass-shine-top), 0 0 12px var(--accent-glow);
    transform: translateY(-2px);
}

/* Powered by TaskForge — modal footer */
.modal-powered-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.55;
}

.modal-tf-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(232,93,4,0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.72rem;
    transition: opacity 0.2s;
}

.modal-tf-link:hover { opacity: 1; }

/* WIP Badge */
.wip-badge {
    display: inline-block;
    background: rgba(232,93,4,0.12);
    border: 1px solid rgba(232,93,4,0.3);
    color: #e85d04;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coffee-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #ffdd57;
    background: rgba(255,221,87,0.08);
    border: 1px solid rgba(255,221,87,0.2);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.25s;
}

.coffee-link:hover {
    background: rgba(255,221,87,0.15);
    border-color: rgba(255,221,87,0.4);
    box-shadow: 0 0 16px rgba(255,221,87,0.1);
}

.coffee-link svg {
    color: #ffdd57;
}

[data-theme="light"] .coffee-link {
    color: #b8860b;
    background: rgba(184,134,11,0.06);
    border-color: rgba(184,134,11,0.2);
}

[data-theme="light"] .coffee-link:hover {
    background: rgba(184,134,11,0.12);
    border-color: rgba(184,134,11,0.35);
}

[data-theme="light"] .coffee-link svg {
    color: #b8860b;
}

.footer-contact {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.04));
}

.footer-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-tertiary, #64748b);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contact-link:hover {
    color: var(--accent, #e85d04);
}

.footer-contact-link svg {
    opacity: 0.7;
}

/* ========================================
   Selection
   ======================================== */
::selection {
    background: var(--accent-glow);
    color: var(--text);
}

/* ========================================
   Dev Banner
   ======================================== */
.dev-banner {
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    padding: 8px 28px;
    position: sticky;
    top: 3px;
    z-index: 99;
}

.dev-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dev-banner-content svg {
    flex-shrink: 0;
    color: var(--accent);
    opacity: 0.8;
}

.dev-banner-content span {
    flex: 1;
}

.dev-banner-feedback-btn {
    flex-shrink: 0;
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid var(--accent-glow);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    white-space: nowrap;
}

.dev-banner-feedback-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--text);
}

/* ========================================
   Announcement Banner
   ======================================== */
.announcement-banner {
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(59,130,246,0.03));
    border-bottom: 1px solid rgba(59,130,246,0.15);
    padding: 7px 28px;
    cursor: pointer;
    transition: background 0.25s;
}

.announcement-banner:hover {
    background: linear-gradient(135deg, rgba(59,130,246,0.14), rgba(59,130,246,0.06));
}

.announcement-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: #3b82f6;
    font-weight: 500;
}

.announcement-banner-content svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.announcement-banner-content span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   Feedback Modal
   ======================================== */
.feedback-modal textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.feedback-modal textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--ring);
}

.feedback-modal textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.feedback-char-count {
    display: block;
    text-align: right;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.feedback-status-text {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 10px;
    min-height: 1.2em;
}

.feedback-status-text.success {
    color: var(--success);
}

.feedback-status-text.error {
    color: var(--danger);
}

/* ========================================
   Survey Modal — Liquid Glass
   ======================================== */
.survey-modal {
    max-width: 440px;
}

.survey-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(232,93,4,0.12), rgba(232,93,4,0.04));
    border: 1px solid rgba(232,93,4,0.15);
    color: var(--accent);
    flex-shrink: 0;
}

.survey-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.survey-modal .modal-header h2 {
    flex: 1;
}

.survey-intro {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--glass-border);
}

.survey-field-group {
    margin-bottom: 14px;
}

.survey-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.survey-textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.survey-textarea:focus {
    outline: none;
    border-color: rgba(232,93,4,0.4);
    box-shadow: 0 0 0 3px rgba(232,93,4,0.08);
}

.survey-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.survey-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-size: 0.85rem;
    color: var(--text);
}

.survey-checkbox-label:hover {
    border-color: rgba(232,93,4,0.25);
    background: var(--glass-hover);
}

.survey-checkbox {
    display: none;
}

.survey-checkbox-mark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--glass-border-light);
    background: var(--glass-bg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.survey-checkbox:checked + .survey-checkbox-mark {
    background: var(--accent);
    border-color: var(--accent);
}

.survey-checkbox:checked + .survey-checkbox-mark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* Survey floating action button */
.survey-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border: 1px solid var(--glass-border-light);
    border-radius: 14px;
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    animation: survey-fab-in 0.4s ease both;
    transition: transform 0.2s, box-shadow 0.2s;
}

.survey-fab:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 6px 20px rgba(232,93,4,0.15);
}

@keyframes survey-fab-in {
    from { transform: translateY(20px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ========================================
   Announcement Modal
   ======================================== */
.announcement-modal {
    max-width: 480px;
}

.announcement-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.04));
    border: 1px solid rgba(59,130,246,0.15);
    color: #3b82f6;
    flex-shrink: 0;
    margin-right: 12px;
}

/* Frosted-glass title — orbs of colour drift ONLY through the letter shapes */
.announcement-title-wrap {
    display: inline-flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    margin: 0;
}

.announcement-title-text {
    background-image:
        /* 4 drifting color orbs on top */
        radial-gradient(ellipse 80% 130% at 50% 50%, rgba(0, 120, 255, 1) 0%, rgba(0, 120, 255, 0) 70%),
        radial-gradient(ellipse 80% 130% at 50% 50%, rgba(220, 50, 230, 1) 0%, rgba(220, 50, 230, 0) 70%),
        radial-gradient(ellipse 80% 130% at 50% 50%, rgba(0, 220, 120, 1) 0%, rgba(0, 220, 120, 0) 70%),
        radial-gradient(ellipse 80% 130% at 50% 50%, rgba(255, 60, 110, 1) 0%, rgba(255, 60, 110, 0) 70%),
        /* Flowing colorful base — guarantees no dead zones */
        linear-gradient(
            110deg,
            #0078ff 0%,
            #a02ac0 20%,
            #dc32e6 40%,
            #ff3c6e 60%,
            #6040d0 80%,
            #0078ff 100%
        );
    background-size:
        50% 220%,
        50% 220%,
        50% 220%,
        50% 220%,
        400% 100%;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.01em;
    animation: orbsThroughText 5s linear infinite;
    will-change: background-position;
}

@keyframes orbsThroughText {
    0% {
        background-position:
            -30% 50%,
             40% 20%,
             70% 90%,
            130% 50%,
             0% 50%;
    }
    25% {
        background-position:
            120% 20%,
            -10% 80%,
            130% 40%,
             30% 70%,
            100% 50%;
    }
    50% {
        background-position:
             40% 90%,
            130% 10%,
            -20% 60%,
            100% 30%,
            200% 50%;
    }
    75% {
        background-position:
            130% 60%,
             20% 40%,
             70% -10%,
            -30% 90%,
            300% 50%;
    }
    100% {
        background-position:
            -30% 50%,
             40% 20%,
             70% 90%,
            130% 50%,
            400% 50%;
    }
}


/* Close confirmation dialog */
.announcement-confirm-modal {
    max-width: 360px;
}

.btn-glass-secondary {
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    background: var(--glass-bg-heavy, rgba(255,255,255,0.06));
    border: 1px solid var(--glass-border-light, rgba(255,255,255,0.12));
    border-radius: 10px;
    cursor: pointer;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: all 0.2s;
}

.btn-glass-secondary:hover {
    background: var(--glass-bg-hover, rgba(255,255,255,0.1));
    border-color: var(--glass-border, rgba(255,255,255,0.2));
}

/* ========================================
   Current Time Indicator
   ======================================== */
.time-indicator-wrapper {
    position: absolute;
    pointer-events: none;
    z-index: 20;
    height: 0;
}

.time-indicator-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    opacity: 0.7;
    box-shadow: 0 0 6px var(--accent-glow);
}

/* Glass dot at left edge */
.time-indicator-dot {
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
}

/* Time label */
.time-indicator-label {
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0.85;
}

/* Ambient particle canvas — covers full grid */
.grid-particle-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    body::before {
        position: fixed;
        width: 100%;
    }

    .empty-settings-btn {
        align-self: center;
        margin-left: auto;
        margin-right: auto;
    }

    .status-message {
        align-items: center;
        text-align: center;
    }

    .dev-banner {
        padding: 6px 16px;
    }

    .dev-banner-content {
        font-size: 0.72rem;
        gap: 8px;
    }

    .dev-banner-feedback-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .announcement-banner {
        padding: 6px 16px;
    }

    .announcement-banner-content {
        font-size: 0.72rem;
        gap: 8px;
    }

    header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 16px;
    }

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

    .current-info {
        max-width: 140px;
        font-size: 0.68rem;
    }

    .week-nav {
        padding: 14px 16px 6px;
        gap: 6px;
    }

    #week-label {
        font-size: 0.78rem;
        min-width: auto;
    }

    #now-next-bar {
        grid-template-columns: 1fr;
        padding: 10px 16px 16px;
        gap: 1px;
    }

    .now-card {
        padding: 20px 22px;
    }

    .now-card:first-child {
        border-radius: 18px 18px 0 0;
        border-right: 1px solid var(--glass-border-light);
        border-bottom: none;
    }

    .now-card:last-child {
        border-radius: 0 0 18px 18px;
        border-left: 1px solid var(--glass-border-light);
        border-top: none;
    }

    .now-lesson-title {
        font-size: 1rem;
    }

    #schedule-container {
        padding: 0 12px 24px;
    }

    #schedule-grid {
        display: none !important;
    }

    .modal {
        width: 95%;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        overflow-y: auto;
        flex: 1;
    }

    .multiselect-dropdown {
        max-height: 200px;
    }

    #group-selects-container {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1400px) {
    .week-nav {
        max-width: 1200px;
        margin: 0 auto;
        width: 100%;
    }
}

/* === Liquid Glass Loading Animation === */
.loading-glass {
    gap: 16px;
}

.liquid-glass-loader {
    position: relative;
    width: 120px;
    height: 120px;
}

.glass-orb {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        rgba(224, 32, 32, 0.4),
        rgba(224, 32, 32, 0.1) 60%,
        transparent 70%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(224, 32, 32, 0.15);
    box-shadow:
        0 0 30px rgba(224, 32, 32, 0.15),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    animation: orbFloat1 3s ease-in-out infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.glass-orb-2 {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.15),
        rgba(255, 255, 255, 0.03) 60%,
        transparent 70%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 20px rgba(255, 255, 255, 0.08),
        inset 0 0 15px rgba(255, 255, 255, 0.03);
    animation: orbFloat2 3s ease-in-out infinite;
}

.glass-orb-3 {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 30% 30%,
        rgba(224, 32, 32, 0.3),
        rgba(224, 32, 32, 0.05) 60%,
        transparent 70%);
    border: 1px solid rgba(224, 32, 32, 0.1);
    box-shadow:
        0 0 15px rgba(224, 32, 32, 0.1),
        inset 0 0 10px rgba(255, 255, 255, 0.03);
    animation: orbFloat3 3s ease-in-out infinite;
}

.glass-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90px;
    height: 90px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1.5px solid rgba(224, 32, 32, 0.12);
    background: transparent;
    box-shadow:
        0 0 40px rgba(224, 32, 32, 0.06),
        inset 0 0 40px rgba(224, 32, 32, 0.03);
    animation: ringPulse 3s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(-50%, -50%) translate(0, 0) scale(1); }
    25% { transform: translate(-50%, -50%) translate(18px, -12px) scale(1.1); }
    50% { transform: translate(-50%, -50%) translate(-8px, -20px) scale(0.95); }
    75% { transform: translate(-50%, -50%) translate(-16px, 8px) scale(1.05); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(-50%, -50%) translate(0, 0) scale(1); }
    25% { transform: translate(-50%, -50%) translate(-20px, 10px) scale(1.15); }
    50% { transform: translate(-50%, -50%) translate(12px, 18px) scale(0.9); }
    75% { transform: translate(-50%, -50%) translate(18px, -14px) scale(1.1); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(-50%, -50%) translate(0, 0) scale(1); }
    25% { transform: translate(-50%, -50%) translate(14px, 16px) scale(0.9); }
    50% { transform: translate(-50%, -50%) translate(-18px, -6px) scale(1.15); }
    75% { transform: translate(-50%, -50%) translate(6px, -20px) scale(0.95); }
}

@keyframes ringPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
}

.loading-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    animation: textFade 2.5s ease-in-out infinite;
}

.loading-subtext {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: -8px;
    animation: textFade 2.5s ease-in-out infinite 0.3s;
}

@keyframes textFade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ══════════════════════════════════════════
   News Carousel (v1.2.2)
   ══════════════════════════════════════════ */

.news-carousel-wrap {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    overflow: hidden;
    padding-bottom: 2px;
}

.news-carousel-inner {
    overflow: hidden;
    cursor: grab;
    user-select: none;
    padding: 8px 10px 4px;
}

.news-carousel-inner:active { cursor: grabbing; }

.news-carousel-track {
    display: flex;
    gap: 12px;
    will-change: transform;
}

/* Slim card — nearly full width, compact height */
.news-card {
    flex: 0 0 100%; /* fills inner content width (inner has 10px padding each side) */
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border-light);
    border-radius: 10px;
    padding: 7px 10px;
    box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-shine-top);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.news-card-date {
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}

.news-card-cat {
    font-size: 0.5rem;
    font-weight: 700;
    background: var(--accent-subtle);
    color: var(--accent);
    border-radius: 4px;
    padding: 1px 4px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.news-card-rt {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.5rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-left: auto;
}

.news-card-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-excerpt {
    font-size: 0.58rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-read-btn {
    align-self: flex-start;
    margin-top: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.58rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-light);
    color: var(--text);
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.news-read-btn:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

/* Dots */
.news-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 7px 0 3px;
    position: relative;
    z-index: 3;
}

.news-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--glass-border-light);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s, width 0.3s, border-radius 0.3s;
}

.news-dot-active {
    width: 18px;
    border-radius: 3px;
    background: var(--accent);
}

/* News Article Modal */
.news-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.news-modal-box {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    background: var(--glass-dropdown-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border-light);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Reading progress bar */
.news-read-progress-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--glass-border);
    z-index: 10;
}

.news-read-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

.news-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 11;
}

.news-modal-close:hover { background: var(--glass-hover); color: var(--text); }

.news-modal-body {
    overflow-y: auto;
    padding: 24px 22px 20px;
    flex: 1;
}

.news-modal-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.news-modal-header {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--glass-border);
}

.news-modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* Article content — rich formatting */
.news-modal-content {
    position: relative;
}

.news-modal-content p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.85;
    margin-bottom: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    animation: news-p-fade 0.4s ease both;
}

.news-modal-content p:last-of-type {
    border-bottom: none;
}

/* Stagger paragraph fade-in */
.news-modal-content p:nth-child(1)  { animation-delay: 0.05s; }
.news-modal-content p:nth-child(2)  { animation-delay: 0.1s; }
.news-modal-content p:nth-child(3)  { animation-delay: 0.15s; }
.news-modal-content p:nth-child(4)  { animation-delay: 0.2s; }
.news-modal-content p:nth-child(5)  { animation-delay: 0.25s; }
.news-modal-content p:nth-child(n+6) { animation-delay: 0.3s; }

@keyframes news-p-fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Lead paragraph — first paragraph stands out */
.news-modal-content p:first-of-type {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.75;
    padding: 16px 16px;
    margin-bottom: 4px;
    background: linear-gradient(135deg, rgba(232,93,4,0.06), rgba(232,93,4,0.02));
    border: 1px solid rgba(232,93,4,0.1);
    border-radius: 10px;
    border-bottom: 1px solid rgba(232,93,4,0.1);
}

[data-theme="dark"] .news-modal-content p:first-of-type {
    background: linear-gradient(135deg, rgba(255,140,60,0.08), rgba(255,140,60,0.02));
    border-color: rgba(255,140,60,0.12);
}

/* Drop cap on first paragraph */
.news-modal-content p:first-of-type::first-letter {
    float: left;
    font-size: 2.4em;
    font-weight: 800;
    line-height: 1;
    margin-right: 6px;
    margin-top: 2px;
    color: var(--accent);
}

/* Paragraph numbering via counter */
.news-modal-content {
    counter-reset: news-para;
}

.news-modal-content p:not(:first-of-type) {
    counter-increment: news-para;
    padding-left: 12px;
}

.news-modal-content p:not(:first-of-type)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 2.5px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent), transparent);
    opacity: 0.25;
}

.news-modal-content p:not(:first-of-type):hover::before {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.news-modal-content p:not(:first-of-type):hover {
    background: var(--glass-bg);
    border-radius: 6px;
}

.news-modal-img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 10px;
    margin: 14px 0;
    opacity: 0.92;
}

/* Hero image — top of article */
.news-modal-hero {
    display: block;
    width: calc(100% + 44px);
    margin: -24px -22px 18px -22px;
    max-height: 220px;
    object-fit: cover;
    opacity: 0.9;
    border-radius: 0;
    animation: news-hero-fade 0.5s ease both;
}

@keyframes news-hero-fade {
    from { opacity: 0; transform: scale(1.03); }
    to   { opacity: 0.9; transform: scale(1); }
}

.news-modal-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(232,93,4,0.08), rgba(232,93,4,0.03));
    border: 1px solid rgba(232,93,4,0.15);
    border-radius: 10px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.news-modal-source:hover {
    background: linear-gradient(135deg, rgba(232,93,4,0.15), rgba(232,93,4,0.06));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232,93,4,0.12);
}

.news-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.news-modal-error {
    text-align: center;
    padding: 32px 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
}

.news-modal-error a { color: var(--accent); }

@media (max-width: 600px) {
    .news-card { flex: 0 0 100%; }
    .news-modal-body { padding: 20px 18px; }
    .news-modal-title { font-size: 1rem; }
}
