* {
            box-sizing: border-box;
        }
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 16px;
            background: #f9f9f9;
        }
        h1 {
            font-size: 1.5rem;
            margin-bottom: 16px;
        }
        .controls {
            background: white;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
        }
        .controls select, .controls input, .controls button {
            padding: 8px 12px;
            font-size: 14px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        .controls button {
            background: #0073aa;
            color: white;
            border: none;
            cursor: pointer;
        }
        .controls button:hover {
            background: #005a87;
        }
        .print-btn {
            background: #28a745;
        }
        .print-btn:hover {
            background: #1e7e34;
        }
        .teacher-link {
            text-decoration: underline;
            text-decoration-style: dotted;
            color: #0073aa;
            font-weight: 500;
        }
        .teacher-link:hover {
            text-decoration: underline;
            text-decoration-style: solid;
            color: #005a87;
        }
        .table-wrapper {
            overflow-x: auto;
            margin: 0 -8px;
            padding: 0 8px;
            -webkit-overflow-scrolling: touch;
        }
        .schedule-table {
            min-width: 600px;
            border-collapse: collapse;
            width: 100%;
            background: white;
            box-shadow: 0 0 10px rgba(0,0,0,0.05);
        }
        .schedule-table th, .schedule-table td {
            border: 1px solid #ddd;
            padding: 10px 8px;
            text-align: center;
            vertical-align: top;
            font-size: 1rem;
        }
        .schedule-table th:first-child,
        .schedule-table td:first-child {
            position: sticky;
            left: 0;
            background-color: white;
            z-index: 2;
            font-weight: bold;
        }
        .schedule-table thead tr th {
            position: sticky;
            top: 0;
            background-color: #f2f2f2;
            z-index: 1;
        }
        .schedule-table thead tr th:first-child {
            z-index: 3;
        }
        .vertical-view {
            display: none;
        }
        .vertical-day {
            background: white;
            border-radius: 12px;
            margin-bottom: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            overflow: hidden;
        }
        .vertical-day-header {
            background: #0073aa;
            color: white;
            padding: 12px 16px;
            font-weight: bold;
            font-size: 1.1rem;
        }
        .vertical-lesson {
            border-bottom: 1px solid #eee;
            padding: 12px 16px;
            display: flex;
            flex-wrap: wrap;
        }
        .vertical-lesson:last-child {
            border-bottom: none;
        }
        .vertical-lesson-time {
            width: 80px;
            font-weight: bold;
            color: #0073aa;
        }
        .vertical-lesson-content {
            flex: 1;
        }
        .vertical-lesson-subject {
            font-weight: bold;
        }
        .vertical-lesson-details {
            font-size: 0.85em;
            color: #666;
            margin-top: 4px;
        }
        .empty-lesson {
            color: #999;
            font-style: italic;
        }
        @media (max-width: 768px) {
            .table-wrapper {
                display: none;
            }
            .vertical-view {
                display: block;
            }
            .controls {
                flex-direction: column;
                align-items: stretch;
            }
            .controls select, .controls input, .controls button {
                width: 100%;
            }
            .autocomplete-container {
                width: 100%;
            }
            .autocomplete-container input {
                width: 100% !important;
            }
        }
        @media (min-width: 769px) {
            .table-wrapper {
                display: block;
            }
            .vertical-view {
                display: none;
            }
        }
        small {
            font-size: 0.7em;
            color: #555;
        }
        a {
            color: #0073aa;
            text-decoration: none;
        }
        a:hover {
            text-decoration: underline;
        }
        @media print {
            body {
                background: white;
                padding: 0;
                margin: 0;
            }
            .controls {
                display: none;
            }
            .table-wrapper {
                display: block !important;
            }
            .vertical-view {
                display: none !important;
            }
            .schedule-table th:first-child,
            .schedule-table td:first-child {
                position: static;
            }
            .schedule-table thead tr th {
                position: static;
            }
        }
        .autocomplete-container {
            position: relative;
            display: inline-block;
        }
        .autocomplete-list {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background-color: white;
            border: 1px solid #ddd;
            border-top: none;
            max-height: 200px;
            overflow-y: auto;
            z-index: 1000;
            border-radius: 0 0 4px 4px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .autocomplete-item {
            padding: 8px 12px;
            cursor: pointer;
            border-bottom: 1px solid #eee;
        }
        .autocomplete-item:hover {
            background-color: #f0f0f0;
        }
        .info-message {
            text-align: center;
            padding: 40px;
            background: white;
            border-radius: 8px;
            color: #666;
        }
        .legend {
            margin-top: 20px;
            font-size: 12px;
            color: #666;
            text-align: center;
            background: #f0f0f0;
            padding: 8px 12px;
            border-radius: 20px;
            display: inline-block;
            width: auto;
        }
        .legend-container {
            text-align: center;
        }