/* ===================================
   Try Swiss Knife - Exam Planner
   Design System Compliant Styles
   =================================== */

/* CSS Variables - Design System */
:root {
    /* Primary Colors */
    --color-primary: #003d5c;
    --color-accent: #00a8e8;
    --color-accent-hover: #0096c7;
    
    /* Neutral Colors */
    --color-white: #ffffff;
    --color-background: #f5f5f5;
    --color-border: #e0e0e0;
    
    /* Text Colors */
    --color-text-dark: #1a1a1a;
    --color-text-medium: #666666;
    --color-text-light: #999999;
    
    /* Status Colors */
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    
    /* Priority Colors */
    --color-priority-high: #ef4444;
    --color-priority-medium: #f59e0b;
    --color-priority-regular: #22c55e;
    
    /* Font Sizes */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ===================================
   Global Styles
   =================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--font-size-base);
    color: var(--color-text-dark);
    background: linear-gradient(to bottom, #f0f4f8 0%, #e2e8f0 100%);
    line-height: 1.6;
    min-height: 100vh;
}

.main-content {
    flex: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 1.5rem 0;
}

@media (max-width: 768px) {
    .container { padding: 16px 1rem 0; }
}

@media (max-width: 480px) {
    .container { padding: 12px 0.75rem 0; }
}

/* ===================================
   Header
   =================================== */

.header {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.header-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.header-logo-link:hover {
    opacity: 0.85;
}

.logo-image {
    width: 85px;
    height: 85px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.tool-name-btn {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a2332;
    white-space: nowrap;
    line-height: 1.2;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
}

.tool-name-btn:hover { color: #00a8e8; }

.header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
}

.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
    font-family: inherit;
}

.header-icon-btn:hover {
    border-color: #00a8e8;
    background: #f7fafc;
    color: #00a8e8;
}

.header-icon-btn svg {
    width: 20px;
    height: 20px;
}

.lang-short {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a202c;
    letter-spacing: 0.02em;
}

.header-icon-btn:hover .lang-short { color: #00a8e8; }

/* Language Selector */
.language-selector {
    position: relative;
}

.language-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    z-index: 1001;
    overflow: hidden;
}

.language-dropdown.active {
    display: block;
    animation: langSlideDown 0.2s ease;
}

@keyframes langSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
    color: #1a202c;
    transition: background 0.15s;
    font-family: inherit;
}

.lang-option:hover { background: #f7fafc; }
.lang-option.active { background: rgba(0, 168, 232, 0.08); color: #00a8e8; }
.lang-check { font-size: 0.75rem; opacity: 0; transition: opacity 0.15s; }
.lang-option.active .lang-check { opacity: 1; }

@media (max-width: 768px) {
    .header-inner { padding: 0.5rem 1rem; }
    .logo-image { width: 70px; height: 70px; }
    .tool-name-btn { font-size: 1.25rem; }
    .header-icons { gap: 6px; }
    .header-icon-btn { width: 36px; height: 36px; }
    .header-icon-btn svg { width: 18px; height: 18px; }
    .lang-short { font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .header-inner { padding: 0.4rem 0.75rem; }
    .logo-image { width: 60px; height: 60px; }
    .tool-name-btn { font-size: 1.25rem; }
}

/* ===================================
   Setup Section (Welcome Page)
   =================================== */

.setup-section {
    margin: var(--spacing-2xl) auto;
}

.setup-card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
}

.setup-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-sm);
}

.title-underline {
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--color-accent), transparent);
    margin-bottom: var(--spacing-xl);
}

.form-label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
}

/* Setup Buttons */
.setup-buttons {
    display: flex;
    gap: var(--spacing-md);
    margin: var(--spacing-xl) 0;
    flex-wrap: wrap;
}

.btn-setup {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-setup-primary {
    background-color: #2c3e50;
    color: var(--color-white);
    flex: 1;
    min-width: 200px;
}

.btn-setup-primary:hover {
    background-color: #1a252f;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-setup-secondary {
    background-color: var(--color-accent);
    color: var(--color-white);
    flex: 1;
    min-width: 200px;
}

.btn-setup-secondary:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-setup-execute {
    background-color: #22c55e;
    color: var(--color-white);
    flex: 1;
    min-width: 200px;
}

.btn-setup-execute:hover {
    background-color: #16a34a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.file-accept-hint {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    font-style: italic;
    margin-top: calc(var(--spacing-sm) * -1);
    margin-bottom: var(--spacing-lg);
}

/* ════════════════════════════════════════
   ABOUT / HELP SECTION
════════════════════════════════════════ */
.about-section {
    margin-bottom: 1.75rem;
}

.about-toggle {
    width: 100%;
    background: linear-gradient(135deg, #e3f2fd 0%, #e1f5fe 100%);
    border: 1.5px solid #4fc3f7;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    color: #01579b;
    text-align: left;
    font-family: inherit;
}

.about-toggle:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #b3e5fc 100%);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 168, 232, 0.15);
}

.about-icon { font-size: 1.2rem; flex-shrink: 0; }
.about-title { flex: 1; }

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.about-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.about-content {
    background: #fff;
    border: 1.5px solid #e3f2fd;
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 1.75rem;
    margin-top: -8px;
    animation: aboutSlideDown 0.3s ease;
}

@keyframes aboutSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.about-content h2 {
    color: var(--color-primary);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.about-content h3 {
    color: var(--color-primary);
    font-size: 1.05rem;
    margin-top: 1.5rem;
    margin-bottom: 0.875rem;
    font-weight: 600;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    margin-bottom: 1.75rem;
}

.about-column ul,
.about-column ol {
    margin: 0.875rem 0;
    padding-left: 1.5rem;
}

.about-column li {
    margin-bottom: 0.6rem;
    line-height: 1.6;
    color: var(--color-text-dark);
}

.about-column li strong { color: var(--color-primary); }

.how-to-steps {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
}

.how-to-steps li {
    counter-increment: step-counter;
    margin-bottom: 1.25rem;
    padding-left: 2.75rem;
    position: relative;
}

.how-to-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0; top: 0;
    background: var(--color-accent);
    color: white;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.how-to-steps li strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--color-primary);
}

.how-to-steps li p {
    margin: 0;
    line-height: 1.6;
    color: var(--color-text-medium);
}

.features-section {
    background: var(--color-background);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 0.875rem;
}

.feature-item {
    background: #fff;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-accent);
}

.feature-item strong {
    display: block;
    color: var(--color-primary);
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.feature-item p {
    margin: 0;
    font-size: 0.83rem;
    line-height: 1.5;
    color: var(--color-text-medium);
}

.use-cases-section { margin-top: 1.5rem; }

.use-cases-section ul {
    margin-top: 0.875rem;
    padding-left: 1.5rem;
}

.use-cases-section li {
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

.use-cases-section li strong { color: var(--color-primary); }

.keywords-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-light);
}

.keywords-section p { margin: 0; line-height: 1.6; }

@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .about-content { padding: 1.25rem; }
    .features-grid { grid-template-columns: 1fr; }
    .about-toggle { font-size: 0.9rem; padding: 0.875rem 1rem; }
}

/* Sample hint */
.sample-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--color-text-light);
    margin: 0.5rem 0 1rem;
}
.sample-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.15s;
}
.sample-link:hover { opacity: 0.75; text-decoration: underline; }
.sample-sep { color: var(--color-border); }

/* Cache Refresh Hint */
.cache-refresh-hint {
    background-color: #fff8e1;
    border: 1px solid #fbbf24;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: #92400e;
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.cache-refresh-hint strong {
    padding: 2px 6px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: var(--font-size-xs);
    display: inline-block;
}

/* Saved Draft Section */
.draft-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.draft-label {
    font-size: 0.85rem;
    color: var(--color-text-medium);
    margin-bottom: 10px;
    font-weight: 500;
}

.draft-container {
    /* Container for draft card */
}

.draft-card {
    background: var(--color-background);
    border: 1.5px solid var(--color-border);
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    max-width: 500px;
}

.draft-card:hover {
    border-color: var(--color-accent);
    background: #e6f7ff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.draft-card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.draft-card-info {
    flex: 1;
}

.draft-card-name {
    font-weight: 600;
    color: var(--color-text-dark);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.draft-card-time {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.draft-card-delete {
    background: var(--color-error);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.draft-card:hover .draft-card-delete {
    opacity: 1;
}

.draft-card-delete:hover {
    background: #a02020;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .draft-card-delete {
        opacity: 1;
    }
}

/* Info Banner */
.info-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.info-icon {
    font-size: var(--font-size-xl);
    color: #1976d2;
}

.info-text {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--color-text-dark);
}

.info-text strong {
    display: block;
    margin-bottom: var(--spacing-xs);
}

.info-close {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: none;
    border: none;
    font-size: var(--font-size-2xl);
    color: var(--color-text-medium);
    cursor: pointer;
    padding: var(--spacing-xs);
    line-height: 1;
    transition: color 0.2s ease;
}

.info-close:hover {
    color: var(--color-text-dark);
}

/* About Section Toggle */
.about-section {
    margin: var(--spacing-lg) 0;
}

.about-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.about-toggle:hover {
    background-color: var(--color-background);
}

.about-icon {
    font-size: var(--font-size-xl);
}

.about-title {
    flex: 1;
    font-weight: 600;
    color: var(--color-primary);
}

.toggle-icon {
    transition: transform 0.2s ease;
}

.about-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.about-content {
    padding: var(--spacing-lg);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Mobile Responsive Styles for Setup Section */
@media (max-width: 768px) {
    .draft-card-delete {
        opacity: 1;
    }
    
    .setup-card {
        padding: var(--spacing-lg);
    }
    
    .setup-buttons {
        flex-direction: column;
    }
    
    .btn-setup {
        width: 100%;
        min-width: auto;
    }
}

/* ===================================
   Wizard Section
   =================================== */

.wizard-section {
    margin: var(--spacing-2xl) auto;
}

/* Progress Bar */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg); /* Reduced from 2xl */
    padding: 0 var(--spacing-sm); /* Reduced from md */
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px; /* Reduced from sm (8px) */
    flex: 0 0 auto;
}

.progress-step.completed {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.progress-step.completed:hover {
    transform: translateY(-2px);
}

.progress-step.completed:hover .step-number {
    box-shadow: 0 2px 8px rgba(0, 168, 232, 0.3);
}

.step-number {
    width: 32px; /* Reduced from 40px */
    height: 32px; /* Reduced from 40px */
    border-radius: var(--radius-full);
    background-color: var(--color-background);
    color: var(--color-text-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem; /* Smaller number */
    border: 2px solid var(--color-border);
    transition: all 0.3s ease;
}

.progress-step.active .step-number,
.progress-step.completed .step-number {
    background-color: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

.step-label {
    font-size: 0.75rem; /* Smaller from xs */
    color: var(--color-text-medium);
    text-align: center;
    max-width: 70px; /* Reduced from 80px */
    line-height: 1.2;
}

.progress-step.active .step-label {
    color: var(--color-primary);
    font-weight: 600;
}

.progress-line {
    flex: 1;
    height: 2px;
    background-color: var(--color-border);
    margin: 0 var(--spacing-xs); /* Reduced from sm */
}

.progress-step.completed ~ .progress-line {
    background-color: var(--color-accent);
}

@media (max-width: 768px) {
    .wizard-progress {
        overflow-x: auto;
        padding-bottom: var(--spacing-md);
    }
    .step-label {
        display: none;
    }
    .step-number {
        width: 32px;
        height: 32px;
        font-size: var(--font-size-sm);
    }
}

/* Wizard Card */
.wizard-card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
}

.schedule-header-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-medium);
    font-weight: 500;
}

.schedule-header-name {
    font-size: var(--font-size-base);
    color: var(--color-accent);
    font-weight: 700;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.step-title {
    font-size: var(--font-size-2xl);
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.step-description {
    font-size: var(--font-size-base);
    color: var(--color-text-medium);
    margin-bottom: var(--spacing-xl);
}

/* ===================================
   Form Elements
   =================================== */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-dark);
}

.form-input {
    width: 100%;
    padding: 0.625rem var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.1);
}

.form-input.error {
    border-color: var(--color-error);
}

.error-message {
    color: var(--color-error);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.info-message {
    color: var(--color-text-medium);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: #f0f9ff;
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-sm);
}

/* ===================================
   Buttons
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--color-white);
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-background);
    border-color: var(--color-accent);
}

.btn-large {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===================================
   Step 2: Study Type Cards
   =================================== */

.study-type-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.study-type-card {
    background-color: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.study-type-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.study-type-card.selected {
    border-color: var(--color-accent);
    background-color: #f0f9ff;
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.1);
}

.type-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.study-type-card h3 {
    font-size: var(--font-size-xl);
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.study-type-card p {
    color: var(--color-text-medium);
    font-size: var(--font-size-sm);
}

.exam-dates-section,
.general-dates-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--color-border);
}

.date-inputs-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 768px) {
    .date-inputs-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===================================
   Step 3: Time Configuration
   =================================== */

.time-config-section {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background-color: var(--color-background);
    border-radius: var(--radius-lg);
}

.time-config-section h3 {
    font-size: var(--font-size-lg);
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.section-hint {
    color: var(--color-text-medium);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
}

.time-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.block-duration-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.block-option {
    background-color: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.block-option:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.block-option.active {
    border-color: var(--color-accent);
    background-color: #f0f9ff;
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.1);
}

.block-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.block-option.disabled:hover {
    border-color: var(--color-border);
    transform: none;
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.option-label {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--color-primary);
}

.option-badge {
    font-size: var(--font-size-xs);
    padding: 2px 8px;
    background-color: var(--color-background);
    color: var(--color-text-medium);
    border-radius: var(--radius-full);
}

.option-badge-recommended {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.block-option p {
    font-size: var(--font-size-sm);
    color: var(--color-text-medium);
}

/* ===================================
   Step 4: Subjects
   =================================== */

.subjects-container {
    display: grid;
    gap: var(--spacing-md);
}

.subject-field {
    display: grid;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.subject-inputs {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-md);
}

.short-code-input {
    text-transform: uppercase;
}

.remove-subject-btn {
    padding: 0.625rem var(--spacing-md);
    background-color: var(--color-error);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.remove-subject-btn:hover {
    background-color: #dc2626;
}

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

/* ===================================
   Step 5: Subject Weightage
   =================================== */

.weightage-guide-compact {
    background-color: #f0f9ff;
    border-left: 3px solid #0ea5e9;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.guide-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.guide-text {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-text-medium);
}

.guide-text strong {
    color: var(--color-text-dark);
    font-weight: 600;
}

.weightage-assignment-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.weightage-assignment-item {
    background-color: var(--color-background);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.weightage-assignment-item:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.weightage-subject-info {
    flex: 1;
}

.weightage-subject-name {
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-xs);
}

.weightage-subject-code {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    background-color: var(--color-white);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.weightage-select-wrapper {
    min-width: 200px;
}

.weightage-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background-color: var(--color-white);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.weightage-select:hover {
    border-color: var(--color-accent);
}

.weightage-select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.1);
}

/* Color code options by weightage level */
.weightage-select option[value="5"] {
    background-color: #fee2e2;
    font-weight: 600;
}

.weightage-select option[value="4"] {
    background-color: #fef3c7;
    font-weight: 600;
}

.weightage-select option[value="3"] {
    background-color: #dbeafe;
}

.weightage-select option[value="2"] {
    background-color: #e0f2fe;
}

.weightage-select option[value="1"] {
    background-color: #f0f9ff;
}

@media (max-width: 768px) {
    .weightage-assignment-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .weightage-select-wrapper {
        width: 100%;
        min-width: auto;
    }
    
    .weightage-guide-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
}

/* Summary Preview */
.summary-preview {
    background-color: var(--color-background);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.summary-preview h3 {
    font-size: var(--font-size-xl);
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.summary-section {
    margin-bottom: var(--spacing-md);
}

.summary-section:last-child {
    margin-bottom: 0;
}

.summary-label {
    font-weight: 600;
    color: var(--color-text-medium);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xs);
}

.summary-value {
    color: var(--color-text-dark);
    font-size: var(--font-size-base);
}

.summary-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* ===================================
   Wizard Navigation
   =================================== */

.wizard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--color-border);
}

/* Save button lives in the schedule name header bar */
.wizard-schedule-header {
    background: linear-gradient(135deg, #e6f7ff 0%, #f0f9ff 100%);
    border: 1px solid #0ea5e9;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-header-save {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    min-height: 48px;
    padding: 0.3rem 0.2rem;
    gap: 3px;
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-white);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    font-family: inherit;
}

.btn-header-save:hover {
    background: #f0f4f8;
    border-color: var(--color-accent);
}

.btn-header-save-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.btn-header-save-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--color-text-medium);
    text-align: center;
    line-height: 1.2;
}

/* Also apply ghost save to mode-selection-actions */
.mode-selection-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

@media (max-width: 768px) {
    .wizard-card {
        padding: var(--spacing-lg);
    }
    .wizard-navigation {
        /* keep row layout — Previous left, Next right */
    }
    .wizard-navigation .btn {
        flex: 1;
    }
}

/* ===================================
   Footer
   =================================== */

.app-footer {
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: 20px;
    text-align: center;
    margin-top: 40px;
    border-radius: 8px 8px 0 0;
}

.app-footer p {
    margin: 0;
    color: var(--color-text-medium);
    font-size: 0.9rem;
}

.app-footer p + p {
    margin-top: 8px;
}

.footer-separator {
    margin: 0 8px;
    color: var(--color-text-light);
}

.footer-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.footer-link:hover {
    color: var(--color-accent-hover);
    border-bottom-color: var(--color-accent-hover);
}

.version-badge {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-text-medium);
    font-size: 0.9rem;
    font-family: inherit;
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
    text-decoration: none;
}

.version-badge:hover {
    opacity: 1;
    color: var(--color-accent);
}

/* Privacy Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    margin: var(--spacing-md);
}

.privacy-modal-content h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-lg);
}

.privacy-section {
    margin-bottom: var(--spacing-lg);
}

.privacy-section h4 {
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-sm);
}

.privacy-section ul {
    margin-left: var(--spacing-lg);
    margin-top: var(--spacing-sm);
}

.privacy-note {
    font-size: var(--font-size-sm);
    color: var(--color-text-medium);
    font-style: italic;
    margin-top: var(--spacing-sm);
}

.privacy-footer {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* ===================================
   Toast Notifications
   =================================== */

.toast-container {
    position: fixed;
    top: 80px;
    right: var(--spacing-md);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background-color: var(--color-white);
    color: var(--color-text-dark);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid var(--color-success);
}

.toast-error {
    border-left: 4px solid var(--color-error);
}

.toast-warning {
    border-left: 4px solid var(--color-warning);
}

@media (max-width: 768px) {
    .toast-container {
        right: var(--spacing-sm);
        left: var(--spacing-sm);
    }
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* ===================================
   Utility Classes
   =================================== */

.text-center {
    text-align: center;
}

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

/* ===================================
   Step 5: Configuration Complete
   =================================== */

.config-complete-section {
    text-align: center;
    padding: 0; /* No padding */
}

.complete-icon {
    font-size: 2.5rem; /* Further reduced */
    color: var(--color-success);
    margin-bottom: 8px; /* Minimal margin */
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.config-complete-section h3 {
    color: var(--color-text-dark);
    font-size: 1.375rem; /* Even smaller */
    margin-bottom: 4px; /* Minimal margin */
}

.config-complete-section > p {
    color: var(--color-text-medium);
    margin-bottom: var(--spacing-sm); /* Further reduced */
    font-size: 0.875rem; /* Smaller text */
}

.config-summary-box {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm); /* Further reduced */
    margin: var(--spacing-sm) auto; /* Minimal margins */
    max-width: 500px;
    text-align: left;
}


.summary-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

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

.summary-label {
    font-weight: 600;
    color: var(--color-text-medium);
}

.summary-value {
    color: var(--color-text-dark);
    font-weight: 500;
}

.config-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin: var(--spacing-xl) 0;
}

.btn-large {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 200px;
    justify-content: center;
}

.btn-large span:first-child {
    font-size: 1.5rem;
}

.config-note {
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-lg);
}

.summary-subject-list-container {
    margin: var(--spacing-md) auto; /* Center it */
    max-width: 600px; /* Constrain width */
}

.summary-subject-list-container h4 {
    color: var(--color-text-dark);
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-sm); /* Reduced from md */
    font-weight: 600;
}

.summary-subject-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 300px;
    overflow-y: auto;
}

.summary-subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.summary-subject-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.summary-subject-name {
    font-weight: 600;
    color: var(--color-text-dark);
}

.summary-subject-code {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    background-color: var(--color-white);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.summary-subject-weightage {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.weightage-stars {
    color: #fbbf24;
    font-size: 0.875rem;
}

.weightage-number {
    font-weight: 700;
    color: var(--color-accent);
    font-size: var(--font-size-lg);
}

@media (max-width: 768px) {
    .config-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-large {
        width: 100%;
    }
}

/* ===================================
   Step 6: Scheduling Mode Selection
   =================================== */

.mode-help-note {
    background-color: #e6f7ff;
    border: 1px solid #0ea5e9;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.help-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.help-text strong {
    display: block;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-xs);
}

.help-text p {
    color: var(--color-text-medium);
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.mode-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.mode-card {
    position: relative;
}

.mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-card label {
    display: block;
    background-color: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
}

.mode-card label:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.mode-card input[type="radio"]:checked + label {
    border-color: var(--color-accent);
    background-color: #e6f7ff;
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.1);
}

.mode-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.mode-icon {
    font-size: 2rem;
}

.mode-header h3 {
    color: var(--color-text-dark);
    font-size: var(--font-size-lg);
    margin: 0;
}

.mode-description {
    color: var(--color-text-medium);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
    min-height: 60px;
}

.mode-tags {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.mode-tag {
    background-color: var(--color-background);
    color: var(--color-text-dark);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.mode-card input[type="radio"]:checked + label .mode-tag {
    background-color: var(--color-accent);
    color: white;
}

.mode-best-for {
    font-size: var(--font-size-sm);
    color: var(--color-text-medium);
    margin: 0;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
}

.mode-best-for strong {
    color: var(--color-text-dark);
}

@media (max-width: 768px) {
    .mode-selection-grid {
        grid-template-columns: 1fr;
    }
    
    .mode-description {
        min-height: auto;
    }
}


/* Mode Selection Actions — defined in wizard-navigation section above */

@media (max-width: 768px) {
    .mode-selection-actions .btn {
        flex: 1;
    }
}

.option-note {
    font-size: 0.75rem;
    color: var(--color-text-light);
    font-style: italic;
    margin-top: 4px;
    margin-bottom: 0;
}


/* ===================================
   Pre-Configuration Screen
   =================================== */

/* Full-width page header card (above the two-column layout) */
.preconfig-page-header {
    margin: 0 auto var(--spacing-md);
    padding: var(--spacing-lg) var(--spacing-xl) !important;
}

/* Schedule name + save bar — mirrors the wizard header bar */
.preconfig-name-bar {
    background: linear-gradient(135deg, #e6f7ff 0%, #f0f9ff 100%);
    border: 1px solid #0ea5e9;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.preconfig-mode-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: var(--color-white);
    padding: 6px var(--spacing-md);
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    width: 100%;
    box-sizing: border-box;
}

/* Two-column layout — sidebar is fixed, main scrolls */
.preconfig-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--spacing-lg);
    align-items: start;
    margin: 0 auto;
}

/* Sticky sidebar — align-self: start is the critical rule that makes sticky work in a grid */
.preconfig-sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.available-time-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 61, 92, 0.07);
    overflow: hidden;
}

.available-time-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-white);
}

.available-time-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.available-time-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-medium);
    margin-bottom: 2px;
}

.available-time-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.1;
}

/* 7-day grid inside sidebar card — scrollable if viewport is short */
.available-time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    overflow-y: auto;
}

.time-day-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 7px;
    padding: 4px 2px;
    text-align: center;
}

.time-day-chip.chip-weekend {
    border-color: #c8e6c9;
    background: #f1f8e9;
}

.time-day-chip.chip-zero {
    opacity: 0.38;
}

.chip-day {
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-medium);
}

.chip-hours {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--color-accent);
    white-space: nowrap;
}

.chip-zero-days {
    font-size: 0.52rem;
    color: var(--color-text-light);
}

/* Scrollable sections wrapper */
.preconfig-sections-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Individual section card */
.preconfig-section {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--spacing-md) var(--spacing-lg);
}

/* Section header: icon + title stacked & centered */
.preconfig-section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.preconfig-section-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.preconfig-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin: 0;
}

.preconfig-section-subtitle {
    font-size: 0.76rem;
    color: var(--color-text-medium);
    margin: 0;
}

/* Add button below items */
.btn-add-item {
    background: none;
    color: var(--color-accent);
    border: 1.5px dashed var(--color-accent);
    border-radius: 8px;
    padding: 6px var(--spacing-md);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: var(--spacing-sm);
    text-align: center;
}

.btn-add-item:hover {
    background: rgba(0, 168, 232, 0.07);
    border-style: solid;
}

/* School Hours Grid */
.school-hours-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.school-day-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: var(--spacing-xs) var(--spacing-md);
    flex-wrap: wrap;
}

.school-day-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 130px;
}

.day-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-dark);
    transition: color 0.2s;
    min-width: 80px;
}

.day-label.day-disabled {
    color: var(--color-text-light);
}

.school-day-times {
    flex: 1;
    transition: opacity 0.2s;
}

.school-day-times.times-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--color-border);
    border-radius: 20px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    top: 3px;
    background: var(--color-white);
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider { background: var(--color-accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Time Range Row */
.time-range-inputs {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.time-separator {
    font-size: 0.78rem;
    color: var(--color-text-light);
    flex-shrink: 0;
}

.time-input {
    width: 108px !important;
    min-width: 88px;
    padding: 5px 8px !important;
    font-size: 0.85rem !important;
}

/* Items list (breaks / activities / skips) */
.items-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: var(--spacing-xs) var(--spacing-md);
    flex-wrap: wrap;
    transition: border-color 0.2s;
}

.schedule-item:hover { border-color: var(--color-accent); }

.item-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.item-fields {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
}

.item-label {
    flex: 1;
    min-width: 110px;
    max-width: 200px;
    padding: 5px 8px !important;
    font-size: 0.85rem !important;
}

.item-day {
    width: 100px !important;
    padding: 5px 6px !important;
    font-size: 0.82rem !important;
}

.skip-item { align-items: flex-start; }

.skip-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.skip-row-1,
.skip-row-2 {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
}

.skip-row-1 .skip-label { flex: 1; min-width: 0; }

.skip-row-2 .form-input {
    padding: 0.25rem 0.5rem;
    height: 32px;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.skip-row-2 .item-day {
    width: 80px;
    flex-shrink: 0;
}

.skip-row-2 .skip-date {
    width: 150px;
    flex-shrink: 0;
}

.skip-row-2 .time-range-inputs { flex-shrink: 0; }

.skip-repeat-radios {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.skip-radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--color-text-medium);
    cursor: pointer;
    white-space: nowrap;
}

.skip-radio-label input[type="radio"] {
    accent-color: var(--color-accent);
    cursor: pointer;
    margin: 0;
}

.btn-remove-item {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-medium);
    border-radius: 6px;
    width: 26px;
    height: 26px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    align-self: center;
}

.btn-remove-item:hover {
    background: var(--color-error);
    border-color: var(--color-error);
    color: var(--color-white);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--color-text-light);
    font-size: 0.8rem;
    font-style: italic;
    border-radius: 8px;
    border: 1px dashed var(--color-border);
    background: var(--color-background);
}

/* ===================================
   Mobile FAB + Overlay
   =================================== */
.time-fab {
    display: none; /* shown only on mobile via media query */
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 200;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 50px;
    padding: 10px 16px;
    gap: 6px;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,61,92,0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.time-fab:active {
    transform: scale(0.96);
}

.time-fab-icon {
    font-size: 1rem;
}

.time-fab-value {
    font-size: 0.88rem;
}

/* Overlay backdrop */
.time-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    align-items: flex-end;
    justify-content: center;
}

.time-overlay.show {
    display: flex;
}

.time-overlay-content {
    background: var(--color-white);
    border-radius: 20px 20px 0 0;
    padding: var(--spacing-lg);
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease;
}

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

.time-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

.time-overlay-close {
    background: var(--color-background);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-medium);
    flex-shrink: 0;
}

/* Mobile overlay grid: 7 across */
.time-overlay .available-time-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.time-overlay .chip-hours {
    font-size: 0.6rem;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 720px) {
    /* Single column on mobile */
    .preconfig-layout {
        grid-template-columns: 1fr;
    }

    /* Hide desktop sidebar on mobile */
    .preconfig-sidebar {
        display: none;
    }

    /* Show FAB instead — raised above the shared feedback button */
    .time-fab {
        display: flex;
        bottom: 80px;
    }

    .preconfig-page-header {
        padding: var(--spacing-md) !important;
    }

    /* Preconfig name bar: wrap so long names don't overflow */
    .preconfig-name-bar {
        flex-wrap: wrap;
        row-gap: 4px;
    }
    .preconfig-name-bar .schedule-header-name {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .preconfig-name-bar .preconfig-date-range {
        flex-basis: 100%;
        margin-left: 0;
        order: 3;
    }
    .preconfig-name-bar .btn-header-save {
        order: 2;
    }

    .preconfig-section {
        padding: var(--spacing-md);
    }

    .school-day-toggle {
        min-width: 110px;
    }

    .time-input {
        width: 94px !important;
    }

    .item-label {
        min-width: 90px;
        max-width: 100%;
    }

    .item-day {
        width: 88px !important;
    }

    /* Skip blocks: wrap row 2 so date/time don't overflow the card */
    .skip-row-1,
    .skip-row-2 {
        height: auto;
        flex-wrap: wrap;
        row-gap: 6px;
    }
    .skip-row-2 .skip-date {
        width: 100%;
        flex: 1 1 auto;
    }
    .skip-row-2 .time-range-inputs {
        flex: 1 1 auto;
    }
    .skip-repeat-radios {
        flex-wrap: wrap;
    }
}

/* ============================================
   STEP 1 — Duration selector & plan end preview
   ============================================ */
.date-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}
@media (max-width: 480px) {
    .date-inputs-row { grid-template-columns: 1fr; }
}

.duration-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.duration-tile {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 2px solid var(--color-border);
    background: var(--color-background);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-medium);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.duration-tile:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(0,168,232,0.05);
}
.duration-tile.active {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: #fff;
}

.plan-end-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: var(--spacing-md);
    padding: 10px 14px;
    background: rgba(0,168,232,0.07);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-accent);
    font-size: 0.875rem;
    color: var(--color-text-medium);
}
.plan-end-preview strong {
    color: var(--color-primary);
}

/* ============================================
   MODE SELECTION — disabled cards & badges
   ============================================ */
.mode-card-disabled {
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
}
.mode-card-disabled label {
    cursor: default;
}
.mode-soon-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--color-text-light);
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: auto;
    flex-shrink: 0;
}
.mode-coming-soon-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-light);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 0;
}
.mode-coming-soon-divider::before,
.mode-coming-soon-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}
.mode-tag-recommended {
    background: rgba(0,168,232,0.12);
    color: var(--color-accent);
    border: 1px solid rgba(0,168,232,0.3);
}

/* ============================================
   SCHOOL HOURS — 7-day grid, weekend styling, period dates
   ============================================ */
.school-day-weekend {
    background: rgba(0,0,0,0.018);
    border-radius: var(--radius-md);
}
.day-weekend-tag {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    background: var(--color-border);
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
}

.school-period-dates {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-background);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}
.school-period-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}
.school-period-hint {
    margin-top: var(--spacing-sm);
    font-size: 0.8rem;
    color: var(--color-text-medium);
    line-height: 1.4;
}
.form-label-sm {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-medium);
    display: block;
    margin-bottom: 4px;
}
.form-input-sm {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
}

/* ============================================
   SUBJECTS STEP — exam dates question & toggle
   ============================================ */
.exam-dates-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}
.exam-dates-question-text {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.exam-dates-q-icon { font-size: 1.4rem; flex-shrink: 0; }
.exam-dates-q-label { font-size: 0.875rem; font-weight: 700; color: var(--color-text-dark); }
.exam-dates-q-hint  { font-size: 0.78rem; color: var(--color-text-medium); margin-top: 2px; }

.exam-dates-toggle-group {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.exam-dates-opt {
    border: 1.5px solid var(--color-border);
    background: #fff;
    border-radius: var(--radius-md);
    padding: 6px 14px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-medium);
    cursor: pointer;
    transition: all 0.15s ease;
}
.exam-dates-opt:hover { border-color: var(--color-accent); color: var(--color-accent); }
.exam-dates-opt.active {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: #fff;
}

/* Subject inputs with 3 columns when exam date shown */
.subject-inputs-with-date {
    grid-template-columns: 1fr auto 1fr !important;
}
@media (max-width: 600px) {
    .subject-inputs-with-date { grid-template-columns: 1fr !important; }
    .exam-dates-question { flex-direction: column; align-items: flex-start; }
}

/* Planning date range in pre-config header */
.preconfig-date-range {
    font-size: 0.8rem;
    color: var(--color-text-medium);
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 3px 10px;
    margin-left: 4px;
    white-space: nowrap;
}

/* School hours — disable all / reset row */
.school-toggle-all-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: var(--spacing-sm);
}
.btn-toggle-all-school {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border);
    background: #fff;
    color: var(--color-text-medium);
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-toggle-all-school:hover {
    border-color: #e53e3e;
    color: #e53e3e;
    background: #fff5f5;
}
.btn-enable-weekdays:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: #f0f4ff;
}

/* Subject count warning hint */
.subject-count-hint {
    margin-top: var(--spacing-sm);
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #f6ad55;
    border-radius: var(--radius-md);
    font-size: 0.83rem;
    color: #92400e;
    line-height: 1.5;
}

/* Study window line in available time card */
.available-time-window {
    font-size: 0.78rem;
    color: var(--color-text-medium);
    margin: 4px 0 8px 0;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   SCHEDULE SCREEN
════════════════════════════════════════════════════════════ */

.sch-app {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
  background: var(--color-background);
}

/* Small screen banner */
.sch-small-banner {
  background: #fffbeb;
  border-bottom: 1px solid #f6ad55;
  padding: 8px 16px;
  font-size: .8rem;
  color: #92400e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.sch-banner-dismiss {
  background: none;
  border: 1px solid #f6ad55;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 600;
  color: #92400e;
  cursor: pointer;
  white-space: nowrap;
}

/* Topbar */
.sch-topbar {
  height: 56px;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  flex-shrink: 0;
  z-index: 50;
}
.sch-tb-logo  { height: 52px; width: 64px; object-fit: contain; flex-shrink: 0; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.sch-tb-div   { width: 1px; height: 18px; background: rgba(255,255,255,.2); }
.sch-tb-title { flex: 1; color: rgba(255,255,255,.7); font-size: .78rem; }
.sch-tb-name  { color: #fff; font-weight: 700; }
.sch-tb-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 64px; min-height: 52px; padding: 0.35rem 0.2rem; gap: 3px;
  border: 1.5px solid rgba(255,255,255,0.25); border-radius: 12px;
  background: rgba(255,255,255,0.1);
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0; font-family: inherit;
}
.sch-tb-btn:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.5); }
.sch-tb-btn-icon { font-size: 1.2rem; line-height: 1; }
.sch-tb-btn-label { font-size: 0.6rem; font-weight: 600; color: rgba(255,255,255,0.85); text-align: center; line-height: 1.2; }
.sch-tb-btn.sch-locked { background: rgba(255,200,0,0.15); border-color: rgba(255,200,0,0.5); }
.sch-tb-btn.sch-locked .sch-tb-btn-label { color: #ffd600; }
.sch-tb-reconfig { border-color: rgba(255,160,0,0.4); }
.sch-tb-reconfig .sch-tb-btn-label { color: #ffcc44; }
.sch-tb-reconfig:hover { background: rgba(255,160,0,0.18); border-color: rgba(255,160,0,0.7); }

/* Sticky bar */
.sch-sticky-bar {
  display: none; align-items: center; gap: 10px;
  padding: 7px 16px; flex-shrink: 0;
  border-bottom: 2px solid transparent;
  animation: schSlideDown .2s ease;
}
.sch-sticky-bar.active { display: flex; }
@keyframes schSlideDown { from{transform:translateY(-100%);opacity:0} to{transform:translateY(0);opacity:1} }
.sch-sticky-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.sch-sticky-text { font-size: .78rem; font-weight: 700; flex: 1; }
.sch-sticky-hint { font-size: .7rem; font-weight: 400; opacity: .75; margin-left: 4px; }
.sch-sticky-cancel {
  display: flex; align-items: center; gap: 6px;
  border: 1.5px solid rgba(0,0,0,.15); background: rgba(0,0,0,.06);
  border-radius: 20px; padding: 4px 12px;
  font-family: inherit; font-size: .72rem; font-weight: 700;
  cursor: pointer; transition: all .2s; color: inherit; white-space: nowrap;
}
.sch-sticky-cancel:hover { background: rgba(0,0,0,.12); }

/* Week nav strip */
.sch-week-nav {
  background: var(--color-white);
  border-bottom: 2px solid var(--color-border);
  display: flex; align-items: center; flex-shrink: 0;
  overflow: hidden; z-index: 9;
}
.sch-week-nav-scroll {
  flex: 1; display: flex; overflow-x: auto; scrollbar-width: none; gap: 2px; padding: 6px 8px;
}
.sch-week-nav-scroll::-webkit-scrollbar { display: none; }
.sch-wpill {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer; border: none;
  background: none; font-family: inherit; flex-shrink: 0; min-width: 72px;
  transition: background .15s;
}
.sch-wpill:hover  { background: var(--color-background); }
.sch-wpill.current { background: var(--color-primary); }
.sch-wpill.current .sch-wp-label { color: #fff; }
.sch-wpill.current .sch-wp-dates { color: rgba(255,255,255,.6); }
.sch-wp-label { font-size: .68rem; font-weight: 700; color: var(--color-text-dark); }
.sch-wp-dates { font-size: .56rem; color: var(--color-text-light); font-family: monospace; }
.sch-wp-bar   { width: 100%; height: 7px; border-radius: 4px; display: flex; overflow: hidden; gap: 1px; background: var(--color-background); }
.sch-bar-seg  { height: 100%; min-width: 2px; border-radius: 2px; }
.sch-bar-empty { width: 100%; height: 7px; border-radius: 4px; background: var(--color-border); opacity: .5; }
.sch-overview-btn {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  border: none; border-left: 1px solid var(--color-border); background: none;
  color: var(--color-text-medium); font-family: inherit; font-size: .7rem; font-weight: 600;
  padding: 0 14px; height: 100%; cursor: pointer; transition: all .2s; white-space: nowrap;
}
.sch-overview-btn:hover { background: var(--color-background); color: var(--color-primary); }

/* Main layout */
.sch-main {
  flex: 1; display: flex; min-height: 0;
}

/* Desktop week grid */
.sch-week-view {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}
.sch-day-hdrs {
  display: grid;
  grid-template-columns: 58px repeat(7,1fr);
  border-bottom: 2px solid var(--color-border);
  background: var(--color-white); flex-shrink: 0; z-index: 10;
}
.sch-dh { padding: 8px 6px; text-align: center; border-left: 1px solid var(--color-border); }
.sch-dh-name { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-medium); }
.sch-dh-num  { font-size: .95rem; font-weight: 700; color: var(--color-text-dark); margin-top: 1px; }
.sch-wknd .sch-dh-name { color: var(--color-accent); }
.sch-grid-scroll { flex: 1; overflow-y: auto; scrollbar-width: thin; }
.sch-grid-scroll::-webkit-scrollbar { width: 4px; }
.sch-grid-scroll::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }
.sch-grid-body {
  display: grid;
}
.sch-tlabel {
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 6px 6px 0 0;
  color: var(--color-text-light); font-size: .6rem; font-family: monospace;
  border-bottom: 1px solid var(--color-border);
}
.sch-dcell {
  border-left: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  position: relative; padding: 3px; overflow: visible; z-index: 2;
}

/* Blocks */
.sch-blk {
  position: absolute; inset: 3px;
  border-radius: 8px; padding: 6px 8px;
  display: flex; flex-direction: column;
  overflow: hidden; cursor: pointer;
  transition: filter .15s, transform .1s;
  user-select: none;
}
.sch-blk:hover { filter: brightness(.92); transform: scale(1.015); }

.sch-blk-activity { justify-content: flex-start; position: relative; }
.sch-act-label { font-size: .65rem; font-weight: 700; line-height: 1.1; }
.sch-act-icon  { position: absolute; bottom: 4px; right: 6px; font-size: .85rem; opacity: .65; }

.sch-blk-study { flex-direction: column; justify-content: center; }
.sch-blk-code  { font-family: monospace; font-size: .6rem; font-weight: 500; opacity: .7; line-height: 1; }
.sch-blk-name  { font-size: .75rem; font-weight: 700; line-height: 1.2; margin-top: 2px; }

.sch-blk-empty {
  background: none; border: 1.5px dashed #cdd5e0;
  align-items: center; justify-content: center; gap: 4px;
  color: var(--color-text-light); flex-direction: row;
  font-size: .7rem; font-weight: 600;
  transition: border-color .2s, background .2s, color .2s;
}
.sch-blk-empty:hover { border-color: var(--color-accent); background: rgba(0,168,232,.05); color: var(--color-accent); }
.sch-em-ico { font-size: .95rem; }
.sch-em-lbl { font-size: .65rem; }

.sch-blk-flex {
  background: repeating-linear-gradient(
    45deg, #f9fafb, #f9fafb 4px, #f0f2f5 4px, #f0f2f5 8px
  );
  border: 1px dashed #d1d5db;
  align-items: center; justify-content: center;
  cursor: default !important;
}
.sch-blk-flex:hover { filter: none; transform: none; }
.sch-flex-label { font-size: .6rem; color: #9ca3af; font-weight: 600; }

/* Out-of-plan days */
.sch-blk-out-of-plan {
  background: repeating-linear-gradient(
    135deg, #f3f4f6, #f3f4f6 4px, #e9eaec 4px, #e9eaec 10px
  );
  border: none;
  cursor: default !important;
  opacity: 0.5;
}
.sch-blk-out-of-plan:hover { filter: none; transform: none; }
.sch-dh-out { opacity: 0.35; }
.sch-dpill-out { opacity: 0.4; pointer-events: none; }
.sch-out-msg {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.85rem;
  font-style: italic;
}

/* Tracker sidebar */
.sch-tracker {
  width: 200px; flex-shrink: 0;
  border-left: 1px solid var(--color-border);
  background: var(--color-white);
  display: flex; flex-direction: column; overflow: hidden;
}
.sch-tr-hd { padding: 12px 12px 8px; border-bottom: 1px solid var(--color-border); flex-shrink: 0; }
.sch-tr-lbl { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-medium); }
.sch-tr-total { font-size: .95rem; font-weight: 800; color: var(--color-primary); margin-top: 2px; }
.sch-tr-total small { font-size: .65rem; font-weight: 400; color: var(--color-text-medium); }
.sch-tr-body { flex: 1; overflow-y: auto; padding: 8px 12px; scrollbar-width: thin; }
.sch-tr-foot { padding: 8px 12px 12px; border-top: 1px solid var(--color-border); flex-shrink: 0; }
.sch-srow { margin-bottom: 11px; }
.sch-srow-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.sch-sdot  { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.sch-sname { flex: 1; font-size: .7rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sch-shrs  { font-size: .62rem; font-family: monospace; font-weight: 700; color: var(--color-text-medium); flex-shrink: 0; }
.sch-tgt   { font-weight: 400; color: var(--color-text-light); }
.sch-exam-date { font-size: .58rem; color: var(--color-text-light); margin-bottom: 2px; padding-left: 14px; }
.sch-prog  { height: 5px; background: var(--color-background); border-radius: 3px; overflow: hidden; }
.sch-prog-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.sch-leg-title { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-light); margin-bottom: 4px; }
.sch-leg-row   { display: flex; align-items: center; gap: 5px; font-size: .65rem; color: var(--color-text-medium); margin-bottom: 3px; }
.sch-leg-dot   { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }

/* Mobile day view */
.sch-day-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--color-background); }
.sch-mob-week-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--color-white); border-bottom: 1px solid var(--color-border);
  padding: 6px 12px; flex-shrink: 0;
}
.sch-mob-week-btn {
  background: none; border: 1.5px solid var(--color-border);
  border-radius: 8px; width: 32px; height: 32px; font-size: 1.2rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--color-text-medium); transition: all .15s;
}
.sch-mob-week-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.sch-mob-week-label { font-size: .75rem; font-weight: 700; color: var(--color-text-dark); }
.sch-day-strip {
  background: var(--color-white); border-bottom: 1px solid var(--color-border);
  display: flex; align-items: stretch; padding: 4px 4px 0; gap: 2px;
  overflow-x: auto; scrollbar-width: none; flex-shrink: 0;
}
.sch-day-strip::-webkit-scrollbar { display: none; }
.sch-dpill {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 10px 8px; border-radius: 10px 10px 0 0;
  cursor: pointer; border: none; background: none; font-family: inherit;
  flex-shrink: 0; transition: background .15s; min-width: 42px; gap: 2px;
}
.sch-dpill:hover  { background: var(--color-background); }
.sch-dpill.active { background: var(--color-primary); }
.sch-dp-n  { font-size: .55rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-medium); }
.sch-dpill.active .sch-dp-n { color: rgba(255,255,255,.65); }
.sch-dp-d  { font-size: .95rem; font-weight: 800; color: var(--color-text-dark); }
.sch-dpill.active .sch-dp-d { color: #fff; }
.sch-dp-dots { display: flex; gap: 2px; height: 5px; align-items: center; margin-top: 1px; }
.sch-dp-dot  { width: 5px; height: 5px; border-radius: 50%; }
.sch-day-card-area { flex: 1; overflow-y: auto; }
.sch-day-card { padding: 12px 12px 16px; scrollbar-width: thin; }
.sch-mitem { display: flex; gap: 10px; margin-bottom: 8px; align-items: stretch; }
.sch-mtc   { width: 44px; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; padding-top: 4px; }
.sch-mt    { font-size: .6rem; font-family: monospace; color: var(--color-text-light); line-height: 1; }
.sch-ml    { flex: 1; width: 1px; background: var(--color-border); margin-top: 4px; }
.sch-mcard {
  flex: 1; border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; justify-content: center;
  cursor: pointer; transition: filter .15s, transform .1s;
  -webkit-tap-highlight-color: transparent; position: relative; overflow: hidden;
}
.sch-mcard:active { transform: scale(.98); }
.sch-mempty {
  background: #fff; border: 1.5px dashed var(--color-border);
  flex-direction: row; align-items: center; gap: 10px; color: var(--color-text-light);
}
.sch-mempty:active { border-color: var(--color-accent); color: var(--color-accent); }
.sch-mflex {
  background: repeating-linear-gradient(45deg,#f9fafb,#f9fafb 4px,#f0f2f5 4px,#f0f2f5 8px);
  border: 1px dashed #d1d5db; cursor: default;
}
.sch-mactivity { cursor: default; }
.sch-mc-ico-br { position: absolute; bottom: 5px; right: 9px; font-size: .85rem; opacity: .6; }
.sch-mc-code { font-size: .6rem; font-family: monospace; font-weight: 500; opacity: .75; }
.sch-mc-name { font-size: .85rem; font-weight: 700; margin-top: 2px; line-height: 1.2; }
.sch-mc-dur  { font-size: .62rem; opacity: .6; margin-top: 2px; }
.sch-mc-plus { font-size: .95rem; }
.sch-mc-hint { font-size: .76rem; font-weight: 600; }
.sch-msummary {
  flex-shrink: 0;
  background: var(--color-white); border-top: 1px solid var(--color-border);
  padding: 8px 12px 14px; z-index: 30;
  box-shadow: 0 -4px 20px rgba(0,0,0,.07);
}
.sch-msum-lbl { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-medium); }
.sch-mchips { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-top: 4px; }
.sch-mchips::-webkit-scrollbar { display: none; }
.sch-mchip {
  display: flex; align-items: center; gap: 4px;
  background: var(--color-background); border-radius: 20px; padding: 4px 9px 4px 5px;
  flex-shrink: 0; font-size: .68rem; font-weight: 600; color: var(--color-text-dark);
}
.sch-mchip-dot { width: 7px; height: 7px; border-radius: 2px; }
.sch-mchip-h { font-family: monospace; font-weight: 700; font-size: .62rem; color: var(--color-text-medium); margin-left: 2px; }

/* Picker */
.sch-pick-ov {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.4); backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
}
.sch-pick-ov.show { display: flex; }
@media(max-width:768px) {
  .sch-pick-ov { align-items: flex-end; }
  .sch-pick-box { border-radius: 20px 20px 0 0 !important; width: 100% !important; max-width: 100% !important; animation: schSlideUp .25s ease !important; }
}
@keyframes schSlideUp { from{transform:translateY(40px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes schPopIn   { from{transform:scale(.92);opacity:0} to{transform:scale(1);opacity:1} }
.sch-pick-box {
  background: var(--color-white); border-radius: 16px; padding: 20px;
  width: 360px; max-width: 95vw;
  box-shadow: 0 8px 36px rgba(0,0,0,.2); animation: schPopIn .2s ease;
}
.sch-pick-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.sch-pick-title { font-size: .85rem; font-weight: 700; color: var(--color-primary); }
.sch-pick-info  { font-size: .68rem; color: var(--color-text-medium); margin-bottom: 12px; }
.sch-pick-close {
  border: none; background: var(--color-background); border-radius: 50%;
  width: 28px; height: 28px; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--color-text-medium);
}
.sch-pick-section-lbl {
  font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--color-text-light); margin-bottom: 6px; margin-top: 12px;
}
.sch-pick-section-lbl:first-of-type { margin-top: 0; }
.sch-pick-restore {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--color-border); border-radius: 10px; padding: 10px 12px;
  cursor: pointer; transition: all .15s; background: none; font-family: inherit;
  width: 100%; text-align: left; margin-bottom: 2px;
}
.sch-pick-restore:hover { border-color: var(--color-primary); background: var(--color-background); }
.sch-pick-restore-ico  { font-size: .95rem; flex-shrink: 0; }
.sch-pick-restore-name { font-size: .76rem; font-weight: 600; color: var(--color-text-dark); }
.sch-pick-restore-sub  { font-size: .62rem; color: var(--color-text-medium); }
.sch-sticky-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; border: 2px solid var(--color-border);
  cursor: pointer; margin-bottom: 10px; transition: all .2s; user-select: none;
}
.sch-sticky-toggle:hover { border-color: var(--color-accent); background: rgba(0,168,232,.03); }
.sch-sticky-toggle.on   { border-color: var(--color-accent); background: rgba(0,168,232,.07); }
.sch-sticky-toggle-check {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--color-border);
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: .72rem; flex-shrink: 0; transition: all .2s;
}
.sch-sticky-toggle.on .sch-sticky-toggle-check { background: var(--color-accent); border-color: var(--color-accent); }
.sch-sticky-toggle-label { font-size: .76rem; font-weight: 700; color: var(--color-text-dark); display: block; }
.sch-sticky-toggle-hint  { font-size: .63rem; color: var(--color-text-medium); display: block; margin-top: 1px; }
.sch-pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.sch-pick-subj {
  border: 2px solid var(--color-border); border-radius: 10px; padding: 8px 10px;
  cursor: pointer; transition: all .15s; display: flex; align-items: center; gap: 8px;
  background: none; font-family: inherit; text-align: left;
}
.sch-pick-subj:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.sch-pick-sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sch-pick-sn { font-size: .72rem; font-weight: 600; color: var(--color-text-dark); }
.sch-pick-sc { font-size: .58rem; color: var(--color-text-medium); font-family: monospace; }
.sch-pick-section-lbl-act { border-top: 1px solid var(--color-border); padding-top: 10px; }
.sch-pick-act-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.sch-pick-act {
  border: 2px solid var(--color-border); border-radius: 10px; padding: 7px 10px;
  cursor: pointer; transition: all .15s; display: flex; align-items: center; gap: 8px;
  background: none; font-family: inherit; text-align: left;
}
.sch-pick-act:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.sch-pick-aw {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .8rem;
  opacity: 0.85;
}
.sch-pick-an { font-size: .72rem; font-weight: 600; color: var(--color-text-dark); }
.sch-pick-clear {
  width: 100%; border: 1.5px dashed var(--color-border); border-radius: 10px;
  padding: 8px; cursor: pointer; background: none; font-family: inherit;
  font-size: .74rem; color: var(--color-text-medium); transition: all .15s;
}
.sch-pick-clear:hover { border-color: #ef4444; color: #ef4444; background: #fff5f5; }

/* Overview panel */
.sch-ov-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.3); backdrop-filter: blur(2px);
}
.sch-ov-overlay.show { display: block; }
.sch-ov-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 95vw;
  background: var(--color-white); box-shadow: -8px 0 32px rgba(0,0,0,.15);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s ease; z-index: 301;
}
.sch-ov-overlay.show .sch-ov-panel { transform: translateX(0); }
@media(max-width:768px) {
  .sch-ov-panel {
    top: auto; left: 0; right: 0; width: 100%; max-width: 100%;
    bottom: 0; height: 85vh; border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .sch-ov-overlay.show .sch-ov-panel { transform: translateY(0); }
}
.sch-ov-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--color-border); flex-shrink: 0;
}
.sch-ov-title { font-size: .9rem; font-weight: 800; color: var(--color-primary); }
.sch-ov-close {
  border: none; background: var(--color-background); border-radius: 50%;
  width: 28px; height: 28px; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--color-text-medium);
}
.sch-ov-scroll { flex: 1; overflow-y: auto; padding: 14px 16px 24px; scrollbar-width: thin; }
.sch-ov-section    { margin-bottom: 22px; }
.sch-ov-sec-title  { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-light); margin-bottom: 10px; }
.sch-ov-srow       { margin-bottom: 14px; }
.sch-ov-srow-top   { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sch-ov-sdot       { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.sch-ov-sname      { flex: 1; font-size: .78rem; font-weight: 700; }
.sch-ov-shrs       { font-size: .7rem; font-family: monospace; font-weight: 700; color: var(--color-text-medium); }
.sch-ov-shrs .tgt  { font-weight: 400; color: var(--color-text-light); }
.sch-ov-week-dots  { display: flex; gap: 3px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.sch-ov-wdot       { width: 18px; height: 5px; border-radius: 3px; }
.sch-ov-prog       { height: 5px; background: var(--color-background); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.sch-ov-prog-fill  { height: 100%; border-radius: 3px; transition: width .5s ease; }
.sch-ov-exam-list  { display: flex; flex-direction: column; gap: 6px; }
.sch-ov-exam-row   { display: flex; align-items: center; gap: 10px; background: var(--color-background); border-radius: 8px; padding: 7px 10px; }
.sch-ov-exam-dot   { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.sch-ov-exam-name  { flex: 1; font-size: .74rem; font-weight: 600; }
.sch-ov-exam-date  { font-size: .65rem; font-family: monospace; color: var(--color-text-medium); }
.sch-ov-exam-countdown { font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.sch-ov-exam-countdown.urgent { background: #fef2f2; color: #dc2626; }
.sch-ov-exam-countdown.soon   { background: #fffbeb; color: #d97706; }
.sch-ov-exam-countdown.ok     { background: #f0fdf4; color: #16a34a; }

/* Desktop/mobile visibility */
.sch-desk-only { display: flex; }
.sch-mob-only  { display: none !important; }
@media(max-width:900px) {
  .sch-desk-only { display: none !important; }
  .sch-mob-only  { display: flex !important; }
  .sch-topbar { padding: 0 10px; gap: 6px; }
  .sch-tb-title { display: none; }
  .sch-week-nav { border-top: 1px solid var(--color-border); border-bottom: none; order: 10; }
  .sch-ov-label { display: none; }
}

/* ── Overview: collapsible per-week sections ── */
.sch-ov-week-section {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.sch-ov-week-hdr {
  width: 100%; background: var(--color-background);
  border: none; cursor: pointer; font-family: inherit;
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: background .15s;
}
.sch-ov-week-hdr:hover { background: #e8edf2; }
.sch-ov-week-hdr.current { background: #eef4fb; }
.sch-ov-week-hdr-left  { display: flex; align-items: center; gap: 8px; }
.sch-ov-week-hdr-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sch-ov-week-badge {
  font-size: .65rem; font-weight: 800; padding: 2px 7px;
  border-radius: 20px; background: var(--color-border); color: var(--color-text-medium);
  white-space: nowrap;
}
.sch-ov-week-badge.current {
  background: var(--color-primary); color: #fff;
}
.sch-ov-week-dates {
  font-size: .72rem; font-weight: 600; color: var(--color-text-dark);
}
.sch-ov-week-hrs {
  font-size: .7rem; font-weight: 700; color: var(--color-text-dark);
  font-family: monospace; white-space: nowrap;
}
.sch-ov-week-avail { font-weight: 400; color: var(--color-text-light); }
.sch-ov-week-bar {
  width: 48px; height: 5px; background: var(--color-border);
  border-radius: 3px; overflow: hidden; flex-shrink: 0;
}
.sch-ov-week-bar-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.sch-ov-week-chevron {
  font-size: .7rem; color: var(--color-text-light); flex-shrink: 0; width: 10px;
}
.sch-ov-week-body {
  padding: 10px 14px 4px;
  border-top: 1px solid var(--color-border);
  background: var(--color-white);
}

/* ── Overview: collapsible section headers ── */
.sch-ov-collapse-hdr {
  width: 100%; background: none; border: none; cursor: pointer;
  font-family: inherit; padding: 0 0 8px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.sch-ov-collapse-hdr:hover .sch-ov-week-chevron { color: var(--color-primary); }
