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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffeef8 0%, #fff5e6 50%, #e6f7ff 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

header h1 {
    color: #e91e8c;
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    color: #666;
    font-size: 0.9rem;
}

.timer-widget {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #fff 0%, #fff5f8 100%);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(233, 30, 140, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    border: 2px solid #ffb6d5;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.timer-widget.dragging {
    cursor: grabbing;
    opacity: 0.95;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    transform: scale(1.02);
    transition: box-shadow 0.1s, opacity 0.1s, transform 0.1s;
}

.timer-widget:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(233, 30, 140, 0.3);
}

.timer-icon {
    color: #e91e8c;
    cursor: pointer;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.timer-widget.running .timer-icon {
    animation: none;
    color: #4CAF50;
}

.timer-display {
    font-size: 1.8rem;
    font-weight: bold;
    color: #e91e8c;
    font-family: 'Courier New', monospace;
}

.timer-widget.running .timer-display {
    color: #4CAF50;
}

.timer-controls {
    display: flex;
    gap: 8px;
}

.timer-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#timer-start {
    background: linear-gradient(135deg, #e91e8c 0%, #ff6bb3 100%);
    color: white;
}

#timer-start:hover {
    transform: scale(1.05);
}

.timer-widget.running #timer-start {
    background: linear-gradient(135deg, #f44336 0%, #ff7961 100%);
}

#timer-reset {
    background: #f0f0f0;
    color: #666;
}

#timer-reset:hover {
    background: #e0e0e0;
}

.timer-presets {
    display: flex;
    gap: 6px;
}

.preset-btn {
    padding: 4px 10px;
    border: 1px solid #ffb6d5;
    border-radius: 12px;
    background: white;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn.active {
    background: #ffb6d5;
    color: #e91e8c;
    font-weight: bold;
}

.preset-btn:hover {
    background: #ffe6f0;
}

.ai-callout {
    position: fixed;
    background: linear-gradient(135deg, #e91e8c 0%, #ff6bb3 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(233, 30, 140, 0.4);
    z-index: 1001;
    max-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.ai-callout.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.callout-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #e91e8c;
    transform: rotate(45deg);
}

.ai-callout.arrow-bottom .callout-arrow {
    bottom: -6px;
    left: 50%;
    margin-left: -6px;
}

.ai-callout.arrow-left .callout-arrow {
    left: -6px;
    top: 50%;
    margin-top: -6px;
}

.ai-callout.arrow-right .callout-arrow {
    right: -6px;
    top: 50%;
    margin-top: -6px;
}

.callout-text {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.callout-dismiss {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.callout-dismiss:hover {
    background: rgba(255,255,255,0.3);
}

@media (max-width: 600px) {
    .timer-widget {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
    }
    
    .timer-display {
        font-size: 1.4rem;
    }
}

.planner-container {
    position: relative;
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(233, 30, 140, 0.15);
    overflow-x: auto;
}

.schedule-grid {
    width: 100%;
    min-width: 600px;
}

.grid-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.subject-label-header {
    background: #e91e8c;
    color: white;
    padding: 8px 5px;
    text-align: center;
    font-weight: bold;
    font-size: 11px;
    border-radius: 8px 0 0 0;
}

.day-header-cell {
    background: linear-gradient(135deg, #ff6bb3 0%, #e91e8c 100%);
    color: white;
    padding: 8px 5px 6px;
    text-align: center;
    font-weight: bold;
    font-size: 11px;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.day-header-cell .day-date {
    font-size: 9px;
    font-weight: 500;
    opacity: 0.82;
    letter-spacing: 0.3px;
}

.day-header-cell.today {
    background: linear-gradient(135deg, #fff0 0%, #fff2 100%),
                linear-gradient(135deg, #e91e8c 0%, #ad1457 100%);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.45);
}

.day-header-cell.today::after {
    content: '▲';
    font-size: 6px;
    opacity: 0.7;
    line-height: 0;
    margin-top: 1px;
}

.day-header-cell.clickable-day {
    cursor: pointer;
    transition: all 0.2s;
}

.day-header-cell.clickable-day:hover {
    background: linear-gradient(135deg, #ff85c1 0%, #ff3399 100%);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(233, 30, 140, 0.4);
}

.day-header-cell:last-child {
    border-radius: 0 8px 0 0;
}

#schedule-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.subject-row {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 2px;
}

.subject-label {
    background: linear-gradient(180deg, #fff0f7 0%, #ffe6f0 100%);
    padding: 8px 5px;
    font-weight: bold;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 3px solid #e91e8c;
}

.subject-math { color: #1565C0; border-left-color: #1565C0; }
.subject-english { color: #7B1FA2; border-left-color: #7B1FA2; }
.subject-science { color: #2E7D32; border-left-color: #2E7D32; }
.subject-history { color: #BF360C; border-left-color: #BF360C; }
.subject-art { color: #00838F; border-left-color: #00838F; }
.subject-pe { color: #E65100; border-left-color: #E65100; }
.subject-music { color: #AD1457; border-left-color: #AD1457; }
.subject-default { color: #5D4037; border-left-color: #5D4037; }

.cell-task.ink-math { color: #1565C0; border-left-color: #1565C0; }
.cell-task.ink-english { color: #7B1FA2; border-left-color: #7B1FA2; }
.cell-task.ink-science { color: #2E7D32; border-left-color: #2E7D32; }
.cell-task.ink-history { color: #BF360C; border-left-color: #BF360C; }
.cell-task.ink-art { color: #00838F; border-left-color: #00838F; }
.cell-task.ink-pe { color: #E65100; border-left-color: #E65100; }
.cell-task.ink-music { color: #AD1457; border-left-color: #AD1457; }
.cell-task.ink-default { color: #5D4037; border-left-color: #5D4037; }

.modal-task.ink-math { border-left: 3px solid #1565C0; }
.modal-task.ink-math span { color: #1565C0; }
.modal-task.ink-english { border-left: 3px solid #7B1FA2; }
.modal-task.ink-english span { color: #7B1FA2; }
.modal-task.ink-science { border-left: 3px solid #2E7D32; }
.modal-task.ink-science span { color: #2E7D32; }
.modal-task.ink-history { border-left: 3px solid #BF360C; }
.modal-task.ink-history span { color: #BF360C; }
.modal-task.ink-art { border-left: 3px solid #00838F; }
.modal-task.ink-art span { color: #00838F; }
.modal-task.ink-pe { border-left: 3px solid #E65100; }
.modal-task.ink-pe span { color: #E65100; }
.modal-task.ink-music { border-left: 3px solid #AD1457; }
.modal-task.ink-music span { color: #AD1457; }
.modal-task.ink-default { border-left: 3px solid #5D4037; }
.modal-task.ink-default span { color: #5D4037; }

.subject-label .delete-subject {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.subject-label:hover .delete-subject {
    opacity: 1;
}

.schedule-cell {
    background: #fff9fc;
    border: 1px solid #ffd6eb;
    padding: 5px;
    min-height: 50px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 10px;
}

.schedule-cell:hover {
    background: #fff0f7;
    border-color: #e91e8c;
}

.cell-task {
    background: white;
    border-radius: 4px;
    padding: 3px 5px;
    margin-bottom: 3px;
    font-size: 9px;
    border-left: 2px solid #e91e8c;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cell-task.done {
    opacity: 0.5;
    text-decoration: line-through;
    border-left-color: #4CAF50;
}

.cell-task-count {
    background: #e91e8c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 9px;
    display: inline-block;
}

.add-subject-section {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ffcce6;
}

#new-subject {
    flex: 1;
    max-width: 200px;
    padding: 8px 12px;
    border: 2px solid #ffcce6;
    border-radius: 20px;
    font-size: 12px;
}

#new-subject:focus {
    outline: none;
    border-color: #e91e8c;
}

#add-subject-btn {
    background: linear-gradient(135deg, #ff6bb3 0%, #e91e8c 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: transform 0.2s;
}

#add-subject-btn:hover {
    transform: scale(1.05);
}

.tutor-character {
    position: fixed;
    bottom: 100px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    touch-action: none;
    user-select: none;
    z-index: 500;
}

.tutor-character.dragging {
    cursor: grabbing;
    transform: scale(1.1);
    z-index: 2000;
}

.tutor-character:hover:not(.dragging) {
    transform: scale(1.05);
}

.tutor-body {
    position: relative;
    width: 60px;
    height: 90px;
}

.tutor-head {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
}

.hair {
    position: absolute;
    width: 44px;
    height: 35px;
    background: linear-gradient(180deg, #ff69b4 0%, #ff1493 100%);
    border-radius: 50% 50% 30% 30%;
    top: -5px;
    left: -2px;
    z-index: 1;
}

.hair::before {
    content: "";
    position: absolute;
    width: 10px;
    height: 25px;
    background: #ff69b4;
    border-radius: 0 0 50% 50%;
    bottom: -20px;
    left: 0;
}

.hair::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 25px;
    background: #ff69b4;
    border-radius: 0 0 50% 50%;
    bottom: -20px;
    right: 0;
}

.face {
    position: absolute;
    width: 36px;
    height: 32px;
    background: #ffe4c9;
    border-radius: 50%;
    top: 5px;
    left: 2px;
    z-index: 2;
}

.eyes {
    position: absolute;
    top: 10px;
    left: 5px;
    right: 5px;
    display: flex;
    justify-content: space-between;
}

.eye {
    width: 8px;
    height: 10px;
    background: #2c1810;
    border-radius: 50%;
    position: relative;
    animation: blink 4s infinite;
}

.eye::after {
    content: "";
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
}

@keyframes blink {
    0%, 95%, 100% { transform: scaleY(1); }
    97% { transform: scaleY(0.1); }
}

.mouth {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 4px;
    background: #ff6b6b;
    border-radius: 0 0 10px 10px;
}

.blush {
    position: absolute;
    width: 8px;
    height: 5px;
    background: rgba(255, 150, 150, 0.6);
    border-radius: 50%;
    top: 18px;
}

.blush.left { left: 2px; }
.blush.right { right: 2px; }

.tutor-dress {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 45px;
    background: linear-gradient(180deg, #ff69b4 0%, #ff1493 100%);
    border-radius: 10px 10px 20px 20px;
    z-index: 1;
}

.arm {
    position: absolute;
    width: 8px;
    height: 25px;
    background: #ffe4c9;
    border-radius: 10px;
    top: 42px;
    z-index: 0;
}

.left-arm {
    left: 8px;
    transform: rotate(-15deg);
}

.right-arm {
    right: 8px;
    transform: rotate(15deg);
    transform-origin: top center;
}

.right-arm.pointing {
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(15deg); }
    50% { transform: rotate(-30deg); }
}

.speech-bubble {
    background: white;
    border: 2px solid #e91e8c;
    border-radius: 12px;
    padding: 8px 12px;
    max-width: 150px;
    margin-bottom: 8px;
    position: relative;
    box-shadow: 0 4px 15px rgba(233, 30, 140, 0.2);
}

.speech-bubble::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.speech-bubble::before {
    content: "";
    position: absolute;
    bottom: -11px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #e91e8c;
}

#tutor-text {
    font-size: 10px;
    color: #333;
    line-height: 1.3;
}

.chat-section {
    margin-top: 15px;
    background: white;
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 5px 20px rgba(233, 30, 140, 0.1);
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #ffcce6;
    border-radius: 25px;
    font-size: 13px;
}

#chat-input:focus {
    outline: none;
    border-color: #e91e8c;
}

#chat-send {
    background: linear-gradient(135deg, #ff6bb3 0%, #e91e8c 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: transform 0.2s;
}

#chat-send:hover {
    transform: scale(1.05);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 350px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, #ff6bb3 0%, #e91e8c 100%);
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 14px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

#modal-tasks {
    margin-bottom: 10px;
}

.modal-task {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #fff9fc;
    border-radius: 8px;
    margin-bottom: 8px;
}

.modal-task .checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #e91e8c;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-task.done .checkbox {
    background: #4CAF50;
    border-color: #4CAF50;
}

.modal-task.done .checkbox::after {
    content: "✓";
    color: white;
    font-size: 12px;
}

.modal-task.done span {
    text-decoration: line-through;
    opacity: 0.6;
}

.modal-task .delete-task {
    margin-left: auto;
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 16px;
}

.modal-add {
    display: flex;
    gap: 8px;
}

#modal-task-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ffcce6;
    border-radius: 8px;
    font-size: 13px;
}

#modal-task-input:focus {
    outline: none;
    border-color: #e91e8c;
}

#modal-add-btn {
    background: linear-gradient(135deg, #ff6bb3 0%, #e91e8c 100%);
    color: white;
    border: none;
    width: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
}

.daily-modal-content {
    max-width: 500px;
    width: 95%;
}

.daily-modal-body {
    max-height: 60vh;
}

.priority-legend {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 8px;
    background: #fff9fc;
    flex-wrap: wrap;
}

.priority-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.priority-a {
    background: #ffe0e0;
    color: #c62828;
    border: 2px solid #ef5350;
}

.priority-b {
    background: #fff3e0;
    color: #e65100;
    border: 2px solid #ff9800;
}

.priority-c {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #66bb6a;
}

.daily-task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid #e91e8c;
}

.daily-task-item.priority-A {
    border-left-color: #ef5350;
    background: #fff8f8;
}

.daily-task-item.priority-B {
    border-left-color: #ff9800;
    background: #fffaf5;
}

.daily-task-item.priority-C {
    border-left-color: #66bb6a;
    background: #f8fff8;
}

.daily-task-item.is-break {
    border-left-color: #9c27b0;
    background: #faf5ff;
}

.daily-task-item.done {
    opacity: 0.5;
}

.daily-task-item.done .task-text {
    text-decoration: line-through;
}

.square-checkbox {
    width: 22px;
    height: 22px;
    border: 3px solid #e91e8c;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: white;
    transition: all 0.2s;
}

.square-checkbox:hover {
    background: #fff0f7;
    transform: scale(1.1);
}

.daily-task-item.done .square-checkbox {
    background: #4CAF50;
    border-color: #4CAF50;
}

.daily-task-item.done .square-checkbox::after {
    content: "✓";
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.task-priority-tag {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    flex-shrink: 0;
}

.task-priority-tag.priority-A {
    background: #ffe0e0;
    color: #c62828;
}

.task-priority-tag.priority-B {
    background: #fff3e0;
    color: #e65100;
}

.task-priority-tag.priority-C {
    background: #e8f5e9;
    color: #2e7d32;
}

.task-time {
    font-size: 10px;
    color: #888;
    min-width: 55px;
}

.task-text {
    flex: 1;
    font-size: 13px;
}

.task-delete {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 18px;
    padding: 0 5px;
}

.daily-add-section {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px dashed #ffcce6;
    margin-top: 10px;
}

#daily-task-input {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    border: 2px solid #ffcce6;
    border-radius: 8px;
    font-size: 13px;
}

#daily-task-input:focus {
    outline: none;
    border-color: #e91e8c;
}

#daily-time-select,
#daily-priority-select {
    padding: 8px;
    border: 2px solid #ffcce6;
    border-radius: 8px;
    font-size: 12px;
    background: white;
}

#daily-add-btn {
    background: linear-gradient(135deg, #ff6bb3 0%, #e91e8c 100%);
    color: white;
    border: none;
    width: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
}

.break-buttons {
    display: flex;
    gap: 6px;
    padding: 10px 0;
    flex-wrap: wrap;
    justify-content: center;
    border-bottom: 1px dashed #e1bee7;
    margin-bottom: 10px;
}

.break-btn {
    background: linear-gradient(135deg, #ce93d8 0%, #9c27b0 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.2s;
}

.break-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.4);
}

.break-indicator {
    background: #e1bee7;
    color: #7b1fa2;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

.settings-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: white;
    border: 2px solid var(--primary, #e91e8c);
    color: var(--primary, #e91e8c);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.settings-btn:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--primary, #e91e8c);
    color: white;
}

.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.settings-panel.active {
    display: flex;
}

.settings-content {
    background: white;
    border-radius: 20px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.settings-content h3 {
    text-align: center;
    color: var(--primary, #e91e8c);
    margin-bottom: 20px;
}

.settings-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section h4 {
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
}

.theme-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.theme-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

.theme-btn:hover {
    transform: scale(1.15);
}

.theme-btn.active {
    border-color: #333;
    box-shadow: 0 0 0 3px white, 0 0 0 5px #333;
}

.character-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.character-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.character-option:hover {
    background: #f5f5f5;
}

.character-option.active {
    border-color: var(--primary, #e91e8c);
    background: #fff5f8;
}

.character-option span {
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

.char-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.sakura-preview {
    background: linear-gradient(180deg, #ffb6c1 0%, #ff69b4 100%);
}

.haru-preview {
    background: linear-gradient(180deg, #87ceeb 0%, #4169e1 100%);
}

.yuki-preview {
    background: linear-gradient(180deg, #e6e6fa 0%, #9370db 100%);
}

.kai-preview {
    background: linear-gradient(180deg, #98fb98 0%, #32cd32 100%);
}

.luna-preview {
    background: linear-gradient(180deg, #ffd700 0%, #ff8c00 100%);
}

.char-preview::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ffe4c4;
    border-radius: 50%;
    top: 18px;
    left: 15px;
}

.char-preview::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    top: 22px;
    left: 17px;
    box-shadow: 10px 0 0 #333;
}

body.theme-blue {
    --primary: #1565C0;
    --primary-light: #42A5F5;
    --bg-tint: #e3f2fd;
}

body.theme-green {
    --primary: #2E7D32;
    --primary-light: #66BB6A;
    --bg-tint: #e8f5e9;
}

body.theme-purple {
    --primary: #7B1FA2;
    --primary-light: #BA68C8;
    --bg-tint: #f3e5f5;
}

body.theme-orange {
    --primary: #E65100;
    --primary-light: #FF9800;
    --bg-tint: #fff3e0;
}

body.theme-teal {
    --primary: #00695C;
    --primary-light: #26A69A;
    --bg-tint: #e0f2f1;
}

body.theme-pink {
    --primary: #e91e8c;
    --primary-light: #ff6bb3;
    --bg-tint: #ffeef8;
}

body[class*="theme-"] header h1 { color: var(--primary); }
body[class*="theme-"] .subject-label-header { background: var(--primary); }
body[class*="theme-"] .day-header-cell { background: linear-gradient(135deg, var(--primary-light), var(--primary)); }
body[class*="theme-"] .timer-icon { color: var(--primary); }
body[class*="theme-"] .timer-display { color: var(--primary); }
body[class*="theme-"] #timer-start { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
body[class*="theme-"] .preset-btn.active { background: var(--bg-tint); color: var(--primary); border-color: var(--primary-light); }
body[class*="theme-"] .modal-header { background: linear-gradient(135deg, var(--primary-light), var(--primary)); }
body[class*="theme-"] #modal-add-btn,
body[class*="theme-"] #daily-add-btn { background: linear-gradient(135deg, var(--primary-light), var(--primary)); }
body[class*="theme-"] .ai-callout { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
body[class*="theme-"] .settings-btn { border-color: var(--primary); color: var(--primary); }
body[class*="theme-"] .settings-btn:hover { background: var(--primary); }
body[class*="theme-"] .settings-content h3 { color: var(--primary); }
body[class*="theme-"] .timer-widget { border-color: var(--primary-light); }

body.char-haru .tutor-dress { background: linear-gradient(180deg, #4169e1 0%, #1e90ff 100%); }
body.char-haru .hair { background: linear-gradient(180deg, #4682b4 0%, #1e3a8a 100%); }

body.char-yuki .tutor-dress { background: linear-gradient(180deg, #9370db 0%, #8a2be2 100%); }
body.char-yuki .hair { background: linear-gradient(180deg, #e6e6fa 0%, #dda0dd 100%); }

body.char-kai .tutor-dress { background: linear-gradient(180deg, #32cd32 0%, #228b22 100%); }
body.char-kai .hair { background: linear-gradient(180deg, #2d5016 0%, #1a3409 100%); }

body.char-luna .tutor-dress { background: linear-gradient(180deg, #ff8c00 0%, #ff6347 100%); }
body.char-luna .hair { background: linear-gradient(180deg, #ffd700 0%, #daa520 100%); }

.organize-btn {
    background: linear-gradient(135deg, #8e24aa, #ab47bc);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 10px;
}

.organize-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(142, 36, 170, 0.4);
}

.organize-modal-content {
    max-width: 600px;
    width: 95%;
}

.organize-header {
    background: linear-gradient(135deg, #8e24aa, #ab47bc);
}

.organize-body {
    padding: 20px;
}

.organize-tutor-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.tutor-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffb6c1, #ff69b4);
    position: relative;
    flex-shrink: 0;
}

.tutor-avatar::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ffe4c4;
    border-radius: 50%;
    top: 18px;
    left: 15px;
}

.tutor-avatar::before {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    background: #333;
    border-radius: 50%;
    top: 22px;
    left: 17px;
    box-shadow: 10px 0 0 #333;
    z-index: 1;
}

.message-bubble {
    background: #f3e5f5;
    padding: 12px 16px;
    border-radius: 15px;
    border-top-left-radius: 5px;
    font-size: 14px;
    color: #4a148c;
    flex-grow: 1;
    line-height: 1.4;
}

.organize-subject-indicator {
    background: linear-gradient(135deg, #ede7f6, #e1bee7);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.organize-subject-indicator strong {
    color: #7b1fa2;
    font-size: 16px;
    margin: 0 8px;
}

.organize-section {
    background: #fafafa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.organize-section h4 {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 14px;
}

.organize-list {
    min-height: 50px;
    margin-bottom: 12px;
}

.organize-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.organize-item .item-text {
    flex-grow: 1;
    font-size: 13px;
}

.organize-item .item-due {
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.organize-item .delete-item {
    background: none;
    border: none;
    color: #e53935;
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
}

.organize-add {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.organize-add input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
}

.organize-add input[type="date"] {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 12px;
}

.organize-add button {
    background: linear-gradient(135deg, #8e24aa, #ab47bc);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}

.organize-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.organize-nav-btn {
    background: white;
    border: 2px solid #8e24aa;
    color: #8e24aa;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.organize-nav-btn:hover:not(:disabled) {
    background: #8e24aa;
    color: white;
}

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

.organize-nav-btn.finish-btn {
    background: linear-gradient(135deg, #43a047, #66bb6a);
    border-color: #43a047;
    color: white;
}

.tutor-chat-popup {
    position: fixed;
    bottom: 200px;
    right: 100px;
    width: 320px;
    max-height: 400px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    z-index: 1500;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.tutor-chat-popup.active {
    display: flex;
    animation: popIn 0.3s ease;
}

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

.tutor-chat-header {
    background: linear-gradient(135deg, var(--primary, #e91e8c), var(--primary-light, #ff6bb3));
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutor-chat-header h4 {
    margin: 0;
    font-size: 14px;
}

.tutor-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.tutor-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    max-height: 250px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tutor-msg {
    background: #f3e5f5;
    padding: 10px 14px;
    border-radius: 15px;
    border-top-left-radius: 5px;
    font-size: 13px;
    color: #4a148c;
    align-self: flex-start;
    max-width: 85%;
}

.user-msg {
    background: linear-gradient(135deg, var(--primary, #e91e8c), var(--primary-light, #ff6bb3));
    color: white;
    padding: 10px 14px;
    border-radius: 15px;
    border-top-right-radius: 5px;
    font-size: 13px;
    align-self: flex-end;
    max-width: 85%;
}

.tutor-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee;
}

.tutor-chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
}

.tutor-chat-input-area button {
    background: linear-gradient(135deg, var(--primary, #e91e8c), var(--primary-light, #ff6bb3));
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
}

.tutor-personality-section h4 {
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
}

.personality-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.personality-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.personality-option:hover {
    background: #f5f5f5;
}

.personality-option.active {
    border-color: var(--primary, #e91e8c);
    background: #fff5f8;
}

.personality-icon {
    font-size: 20px;
}

.personality-info {
    flex: 1;
}

.personality-info strong {
    display: block;
    font-size: 13px;
    color: #333;
}

.personality-info small {
    font-size: 11px;
    color: #888;
}

.empty-list-msg {
    color: #999;
    font-size: 12px;
    text-align: center;
    padding: 15px;
    font-style: italic;
}

@media (max-width: 700px) {
    header h1 {
        font-size: 1.2rem;
    }
    
    .grid-header {
        grid-template-columns: 60px repeat(7, 1fr);
    }
    
    .subject-row {
        grid-template-columns: 60px repeat(7, 1fr);
    }
    
    .subject-label {
        font-size: 8px;
        padding: 5px 3px;
    }
    
    .day-header-cell,
    .subject-label-header {
        font-size: 9px;
        padding: 6px 2px;
    }
    
    .schedule-cell {
        min-height: 40px;
        padding: 3px;
    }
    
    .cell-task {
        font-size: 8px;
        padding: 2px 3px;
    }
    
    .tutor-character {
        transform: scale(0.6);
        bottom: 5px;
        right: 5px;
    }
    
    .speech-bubble {
        max-width: 120px;
        padding: 6px 8px;
    }
    
    #tutor-text {
        font-size: 9px;
    }
    
    .daily-add-section {
        flex-direction: column;
    }
    
    #daily-task-input {
        width: 100%;
    }
    
    .priority-legend {
        gap: 5px;
    }
    
    .priority-badge {
        font-size: 9px;
        padding: 3px 6px;
    }
}

/* ===== CAL NAV & VIEW TOGGLE ===== */

.cal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 2px;
    padding-right: 210px;
}

.cal-nav-btn {
    background: white;
    border: 1.5px solid #e91e8c;
    color: #e91e8c;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    flex-shrink: 0;
}

.cal-nav-btn:hover {
    background: #e91e8c;
    color: white;
}

.week-label {
    flex: 1;
    text-align: center;
    font-size: 0.83rem;
    font-weight: 600;
    color: #555;
}

.view-toggle {
    display: flex;
    gap: 2px;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 3px;
}

.view-btn {
    background: none;
    border: none;
    padding: 4px 14px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: #888;
    transition: all 0.18s;
}

.view-btn.active {
    background: white;
    color: #e91e8c;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ===== MONTH VIEW ===== */

.month-view {
    background: white;
    border-radius: 12px;
    padding: 14px 12px 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    margin-bottom: 12px;
}

.month-nav {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

#month-label {
    flex: 1;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: #333;
}

.month-dow-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 5px;
}

.month-dow-header span {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #aaa;
    letter-spacing: 0.5px;
    padding: 2px 0;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.month-day-sq {
    border: 1.5px solid #f0f0f0;
    border-radius: 8px;
    padding: 6px 7px 5px;
    min-height: 76px;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
    background: #fafafa;
    display: flex;
    flex-direction: column;
}

.month-day-sq:hover {
    border-color: #e91e8c;
    background: #fff7fb;
}

.month-day-sq.today {
    border-color: #e91e8c;
    background: #fff0f7;
}

.month-day-sq.other-month {
    opacity: 0.32;
    cursor: default;
}

.month-day-sq.other-month:hover {
    border-color: #f0f0f0;
    background: #fafafa;
}

.month-day-num {
    font-size: 0.78rem;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 5px;
}

.month-day-sq.today .month-day-num {
    color: #e91e8c;
}

.month-task-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: auto;
}

.month-task-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.month-task-label {
    font-size: 0.58rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
    line-height: 1.3;
}

@media (max-width: 600px) {
    .month-day-sq { min-height: 52px; padding: 4px 4px 3px; }
    .month-day-num { font-size: 0.7rem; }
    .month-task-dot { width: 5px; height: 5px; }
    .cal-nav { gap: 5px; padding-right: 0; }
    .week-label { font-size: 0.72rem; }
}

/* ===== SMART FEATURES ===== */

.assessment-strip {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    padding: 0 4px;
    margin-bottom: 10px;
    min-height: 0;
    transition: all 0.3s;
}

.assessment-strip:empty {
    display: none;
}

.assessment-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: white;
    border: 1.5px solid;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.assessment-pill small {
    font-weight: 400;
    opacity: 0.65;
}

.schedule-cell.urgency-today {
    background: #fff8ed;
    border-color: #ffcc80;
}

.schedule-cell.urgency-soon {
    background: #fff5f5;
    border-color: #ffcdd2;
}

.schedule-cell.urgency-assessment {
    box-shadow: inset 0 0 0 2px rgba(239, 83, 80, 0.25);
}

.schedule-cell.urgency-assessment.urgency-today {
    box-shadow: inset 0 0 0 2px rgba(239, 83, 80, 0.5);
    background: #fff3e0;
}

.conflict-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #FFB74D;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}

.toast-rack {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

.toast {
    background: rgba(40, 40, 40, 0.95);
    color: white;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: all;
    animation: toastIn 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.toast-action {
    background: white;
    color: #333;
    border: none;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s;
}

.toast-action:hover { background: #f0f0f0; }

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

@keyframes toastOut {
    to { opacity: 0; transform: translateY(12px); }
}

.time-hint {
    font-size: 0.75rem;
    color: #bbb;
    padding: 3px 2px 0;
    min-height: 18px;
    transition: opacity 0.2s;
    font-style: italic;
}

.modal-prep-hint {
    margin-bottom: 8px;
}

.prep-hint-btn {
    background: none;
    border: 1.5px dashed #e91e8c;
    color: #e91e8c;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    text-align: left;
}

.prep-hint-btn:hover {
    background: #fff0f7;
    border-style: solid;
}

.split-task-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    padding: 0 3px;
    transition: color 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.split-task-btn:hover { color: #7B1FA2; }

.cell-progress {
    background: rgba(233, 30, 140, 0.12);
    color: #e91e8c;
    border-radius: 8px;
    padding: 1px 5px;
    font-size: 9px;
    font-weight: 700;
    display: inline-block;
    margin-top: 2px;
}
