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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.google-login-text {
    color: #555;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.google-login-text:hover {
    color: #3347a8;
}

.google-login-text.logged-in {
    color: #3347a8;
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #d8deef;
    border-radius: 50%;
    background: #f8faff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.user-menu-btn:hover {
    border-color: #b9c5ff;
    background: #eef2ff;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-fallback {
    font-size: 0.78em;
    font-weight: 800;
    color: #3347a8;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    border: 1px solid #d8deef;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
    padding: 10px;
    z-index: 15;
}

.user-menu-name {
    margin: 0;
    font-size: 0.9em;
    font-weight: 800;
    color: #1f2937;
}

.user-menu-email {
    margin: 4px 0 10px;
    font-size: 0.82em;
    color: #6b7280;
    word-break: break-all;
}

.user-menu-signout {
    width: 100%;
    border: 1px solid #f2c3c3;
    border-radius: 8px;
    background: #fff5f5;
    color: #b42318;
    font-size: 0.84em;
    font-weight: 700;
    padding: 8px 10px;
    cursor: pointer;
}

.user-menu-signout:hover {
    background: #ffe8e8;
    border-color: #e9aaaa;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-modal.hidden {
    display: none;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 32, 0.58);
    backdrop-filter: blur(10px);
}

.auth-modal-panel {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #f4f6fb;
    color: #445;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
}

.auth-modal-close:hover {
    background: #e8edf8;
}

.auth-modal-eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72em;
    font-weight: 800;
    color: #667eea;
}

.auth-modal-panel h2 {
    margin: 0 0 10px;
    font-size: 1.5em;
    color: #1f2937;
}

.auth-modal-copy {
    margin: 0 0 18px;
    color: #5f6470;
    line-height: 1.5;
    font-size: 0.95em;
}

.auth-provider-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-provider-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d8deef;
    border-radius: 14px;
    background: #f8faff;
    color: #1f2937;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-provider-btn:hover {
    transform: translateY(-1px);
    border-color: #b9c5ff;
    background: #eef2ff;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.12);
}

.auth-provider-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #667eea;
    color: #fff;
    font-size: 0.78em;
    font-weight: 800;
    flex-shrink: 0;
}

.auth-modal-status {
    margin: 16px 0 0;
    min-height: 1.2em;
    font-size: 0.84em;
    color: #6b7280;
}

body.dark-mode .auth-modal-panel {
    background: #141a26;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .auth-modal-close {
    background: #1f2937;
    color: #d8deef;
}

body.dark-mode .auth-modal-close:hover {
    background: #273244;
}

body.dark-mode .auth-modal-panel h2,
body.dark-mode .auth-provider-btn {
    color: #e5e7eb;
}

body.dark-mode .auth-modal-copy,
body.dark-mode .auth-modal-status {
    color: #a8b0c0;
}

body.dark-mode .auth-provider-btn {
    background: #1b2433;
    border-color: #324056;
}

body.dark-mode .auth-provider-btn:hover {
    background: #202b3d;
    border-color: #48597a;
}

body.dark-mode .user-menu-btn {
    border-color: #324056;
    background: #1b2433;
}

body.dark-mode .user-menu-btn:hover {
    border-color: #48597a;
    background: #202b3d;
}

body.dark-mode .user-avatar-fallback {
    color: #d6ddff;
}

body.dark-mode .user-menu-dropdown {
    border-color: #324056;
    background: #1a2230;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

body.dark-mode .user-menu-name {
    color: #e5e7eb;
}

body.dark-mode .user-menu-email {
    color: #a8b0c0;
}

body.dark-mode .user-menu-signout {
    border-color: #7f1d1d;
    background: #321515;
    color: #fecaca;
}

body.dark-mode .user-menu-signout:hover {
    border-color: #b23a3a;
    background: #431818;
}

.settings-menu {
    position: relative;
}

.settings-toggle-btn {
    border: none;
    background: transparent;
    color: #555;
    font-size: 1.5em;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}

.settings-toggle-btn:hover {
    color: #3347a8;
}

.settings-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #d8deef;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    padding: 10px 12px;
    min-width: 130px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.theme-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle-track {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: #d6dbe9;
    border: 1px solid #c6cde2;
    display: inline-flex;
    align-items: center;
    padding: 2px;
    transition: background 0.2s, border-color 0.2s;
}

.theme-toggle-knob {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transform: translateX(0);
    transition: transform 0.2s;
}

.theme-toggle-input:checked + .theme-toggle-track {
    background: #667eea;
    border-color: #667eea;
}

.theme-toggle-input:checked + .theme-toggle-track .theme-toggle-knob {
    transform: translateX(16px);
}

.theme-toggle-label {
    font-size: 0.82em;
    font-weight: 700;
    color: #666;
    min-width: 34px;
}

.settings-action-btn {
    width: 100%;
    margin-top: 10px;
    border: 1px solid #d8deef;
    border-radius: 8px;
    background: #f8faff;
    color: #1f2937;
    font-size: 0.84em;
    font-weight: 700;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.settings-action-btn:hover {
    background: #eef2ff;
    border-color: #b9c5ff;
}

.container {
    display: flex;
    gap: 16px;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 1185px;
    height: 830px;
    max-width: none;
    position: relative;
}

.container-auth-slot {
    position: absolute;
    top: 14px;
    right: 40px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-footer {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    color: #777;
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.1px;
    pointer-events: none;
}

.calendar-section {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 16px;
    height: 720px;
}

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.calendar-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d6d6d6;
    border-radius: 8px;
    background: #f6f6f6;
    color: #555;
    cursor: pointer;
    font-weight: 700;
}

.calendar-nav-btn:hover {
    background: #eceefe;
    border-color: #c2c8ff;
}

.calendar-dates-panel {
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    padding: 10px;
    background: #fafafa;
}

.google-calendar-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    padding: 10px;
    background: #fafafa;
    min-height: 0;
    flex: 1;
}

.google-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.google-calendar-header h3 {
    margin: 0;
    font-size: 0.95em;
    color: #333;
}

.google-calendar-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.google-calendar-btn {
    border: 1px solid #667eea;
    background: #667eea;
    color: #fff;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 700;
    padding: 5px 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.google-calendar-btn:hover {
    background: #5568d3;
    border-color: #5568d3;
}

.google-calendar-btn.secondary {
    border-color: #d6d6d6;
    background: #f6f6f6;
    color: #555;
}

.google-calendar-btn.secondary:hover {
    background: #eceefe;
    border-color: #c2c8ff;
}

.google-calendar-btn.danger {
    border-color: #c62828;
    background: #d32f2f;
}

.google-calendar-btn.danger:hover {
    background: #b71c1c;
    border-color: #b71c1c;
}

.google-calendar-status {
    margin: 0;
    font-size: 0.78em;
    color: #555;
}

.google-calendar-events {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
}

.google-calendar-event {
    border: 1px solid #e3e8ff;
    background: #f5f7ff;
    border-radius: 6px;
    padding: 7px 8px;
}

.google-calendar-event-time {
    display: block;
    font-size: 0.72em;
    font-weight: 700;
    color: #5568d3;
    margin-bottom: 2px;
}

.google-calendar-event-title {
    display: block;
    font-size: 0.82em;
    color: #333;
}

.google-calendar-empty {
    margin: 0;
    font-size: 0.78em;
    color: #777;
}

.hidden {
    display: none !important;
}

.calendar-month-label {
    flex: 1;
    font-weight: 700;
    color: #333;
    text-align: center;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-month-label:hover {
    background: #f0f0f0;
    border-color: #d0d0d0;
}

.calendar-month-label:active {
    background: #e8e8e8;
}

.month-year-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.month-year-picker-overlay.hidden {
    display: none;
}

.month-year-picker {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 320px;
}

.picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.picker-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d6d6d6;
    border-radius: 6px;
    background: #f6f6f6;
    color: #555;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
}

.picker-nav-btn:hover {
    background: #eceefe;
    border-color: #c2c8ff;
}

.picker-year-display {
    font-weight: 700;
    font-size: 1.2em;
    color: #333;
    min-width: 80px;
    text-align: center;
}

.months-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.month-btn {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
    color: #333;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
}

.month-btn:hover {
    background: #f0f0f0;
    border-color: #d0d0d0;
}

.month-btn.selected {
    background: #667eea;
    color: white;
    border-color: #5568d3;
}

.picker-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.picker-btn {
    padding: 8px 16px;
    border: 1px solid #d6d6d6;
    border-radius: 6px;
    background: #f6f6f6;
    color: #555;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.picker-btn:hover {
    background: #eceefe;
    border-color: #c2c8ff;
}

.picker-btn.ok-btn {
    background: #667eea;
    color: white;
    border-color: #5568d3;
}

.picker-btn.ok-btn:hover {
    background: #5568d3;
    border-color: #4a5ab8;
}

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

.calendar-weekdays {
    margin-bottom: 6px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.72em;
    font-weight: 700;
    color: #777;
}

.calendar-date {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.82em;
    color: #333;
    background: #fff;
    border: 1px solid #efefef;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-date:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #ddd;
}

.calendar-date:active:not(:disabled) {
    background: #e8e8e8;
}

.calendar-date.empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
    color: transparent;
}

.calendar-date:disabled {
    cursor: default;
}

.calendar-date.today {
    background: #667eea;
    color: #fff;
    font-weight: 700;
    border-color: #5568d3;
}

.calendar-date.selected {
    border-color: #667eea;
    box-shadow: inset 0 0 0 2px #667eea33;
    font-weight: 700;
}

.calendar-date.today.selected {
    box-shadow: inset 0 0 0 2px #ffffff88;
}

.clock-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Clock title row ── */
.clock-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Pop-out icon button ── */
.pop-out-btn {
    padding: 2px 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
    font-size: 1em;
    color: #aaa;
    line-height: 1;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.pop-out-btn:hover { color: #444; border-color: #999; }

/* ── Floating clock overlay (drag-to-move fallback) ── */
.clock-pip-overlay {
    position: fixed;
    width: 220px;
    top: 72px;
    right: 24px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 36px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.10);
    z-index: 9999;
    overflow: hidden;
    user-select: none;
}
.clock-pip-overlay.hidden { display: none; }

.pip-drag-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #f2f2f5;
    cursor: grab;
    border-bottom: 1px solid #e2e2e2;
}
.pip-drag-handle:active { cursor: grabbing; }
.pip-title { font-size: 0.75em; font-weight: 600; color: #555; }
.pip-close-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9em;
    color: #999;
    padding: 0 2px;
    line-height: 1;
}
.pip-close-btn:hover { color: #333; }
.clock-pip-overlay canvas {
    display: block;
    width: 100%;
    height: auto;
}

.sidebar {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.productivity-panel {
    border: 2px solid #ddd;
    border-radius: 10px;
    height: 720px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #e6e6e6;
    background: #f8f8f8;
}

.sidebar-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: #666;
    font-size: 0.9em;
    font-weight: 700;
    padding: 12px 10px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.sidebar-tab:hover {
    background: #f0f0f0;
    color: #444;
}

.sidebar-tab.active {
    background: #ffffff;
    color: #667eea;
}

.tab-panel {
    display: none;
    flex: 1;
    min-height: 0;
}

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

.tasks-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 16px;
    overflow: hidden;
}

.notes-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 16px;
    overflow: hidden;
}

.notes-section h2 {
    margin-bottom: 15px;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
}

h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.task-date-label {
    font-size: 0.55em;
    font-weight: 600;
    color: #667eea;
}

#clockCanvas {
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 400px;
    margin-bottom: 14px;
}

.focus-progress-card {
    width: 100%;
    max-width: 400px;
    padding: 6px 0;
}

.focus-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #555;
    font-size: 0.82em;
    font-weight: 700;
    margin-bottom: 8px;
}

.focus-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #eeeeee;
    overflow: hidden;
}

.focus-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4CAF50 0%, #4CAF50 100%);
    transition: width 0.35s ease, background 0.25s ease;
}

.time-input,
.color-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-duration-display {
    font-size: 0.85em;
    font-weight: 400;
    color: #aaa;
}

body.dark-mode .time-duration-display { color: #7a8096; }

label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

input[type="time"],
input[type="color"] {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input[type="time"]:focus,
input[type="color"]:focus {
    outline: none;
    border-color: #667eea;
}

input[type="color"] {
    height: 25px;
    width: 65px;
    padding: 0;
    border: none;
    border-radius: 01px;
    background: transparent;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 1px;
}

.current-time {
    font-size: 1.8em;
    font-weight: 600;
    color: #667eea;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    text-align: center;
}

#notes {
    flex: 1;
    min-height: 0;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 0.95em;
    font-family: inherit;
    resize: none;
    overflow-y: auto;
    transition: border-color 0.3s;
}

#notes:focus {
    outline: none;
    border-color: #667eea;
}

.task-input-area {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

#taskInput {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    transition: border-color 0.3s;
}

#taskInput:focus {
    outline: none;
    border-color: #667eea;
}

.color-swatches {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.swatch:hover {
    transform: scale(1.2);
}

.swatch.selected {
    border-color: #bbb;
    transform: scale(1.15);
}

#addTaskBtn {
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.5em;
    font-weight: 300;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#addTaskBtn:hover {
    background: #5568d3;
}

#taskList {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

#taskList::-webkit-scrollbar {
    width: 6px;
}

#taskList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#taskList::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#taskList::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.task-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border-left: 4px solid #2196F3;
    border-radius: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: grab;
}

.task-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.task-item.dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.task-item.drag-over {
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25), 0 6px 14px rgba(0, 0, 0, 0.14);
    transform: translateX(5px) scale(1.01);
}

.task-item.completed {
    opacity: 0.5;
    background: #f0f0f0;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #666;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.task-text {
    flex: 1;
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
    cursor: text;
}

.task-edit-input {
    flex: 1;
    min-width: 0;
    width: 0;
    font-size: 0.95em;
    font-family: inherit;
    font-weight: 500;
    color: #333;
    border: none;
    border-bottom: 2px solid #667eea;
    background: transparent;
    outline: none;
    padding: 0;
    box-sizing: border-box;
}

.task-back,
.task-forward {
    background: transparent;
    color: #8a8a8a;
    border: none;
    width: auto;
    height: auto;
    font-size: 1em;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
    padding: 0 4px;
}

.task-back:hover,
.task-forward:hover {
    color: #555;
}

.task-delete {
    background: transparent;
    color: #8a8a8a;
    border: none;
    border-radius: 0;
    width: auto;
    height: auto;
    font-size: 1em;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
    padding: 0 4px;
}

.task-delete:hover {
    color: #555;
    transform: none;
}

.save-info {
    border-top: 1px solid #ececec;
    padding: 10px 12px;
    color: #888;
    text-align: center;
    font-size: 0.85em;
    background: #fafafa;
}

body.dark-mode {
    background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
}

body.dark-mode .container {
    background: #151c28;
    color: #e5e7eb;
}

body.dark-mode .app-footer {
    color: #98a2b3;
}

body.dark-mode .google-login-text,
body.dark-mode .theme-toggle-label {
    color: #d1d8e5;
}

body.dark-mode .settings-toggle-btn {
    color: #d1d8e5;
}

body.dark-mode .settings-toggle-btn:hover {
    color: #9db3ff;
}

body.dark-mode .settings-dropdown {
    background: #1a2230;
    border-color: #374151;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

body.dark-mode .settings-action-btn {
    background: #1b2433;
    color: #e5e7eb;
    border-color: #324056;
}

body.dark-mode .settings-action-btn:hover {
    background: #202b3d;
    border-color: #48597a;
}

body.dark-mode .google-login-text:hover,
body.dark-mode .google-login-text.logged-in {
    color: #9db3ff;
}

body.dark-mode .calendar-section,
body.dark-mode .productivity-panel,
body.dark-mode .calendar-dates-panel,
body.dark-mode .google-calendar-panel,
body.dark-mode .month-year-picker {
    background: #1e2634;
    border-color: #374151;
}

body.dark-mode .current-time {
    background: #202b3f;
    color: #a8b7ff;
}

body.dark-mode .calendar-month-label,
body.dark-mode .calendar-nav-btn,
body.dark-mode .picker-nav-btn,
body.dark-mode .month-btn,
body.dark-mode .picker-btn,
body.dark-mode .sidebar-tab,
body.dark-mode input[type="time"],
body.dark-mode #taskInput,
body.dark-mode #notes {
    background: #111827;
    color: #e5e7eb;
    border-color: #374151;
}

body.dark-mode .sidebar-tabs,
body.dark-mode .save-info {
    background: #1a2230;
    border-color: #374151;
    color: #98a2b3;
}

body.dark-mode .sidebar-tab.active {
    background: #111827;
    color: #9db3ff;
}

body.dark-mode .calendar-weekdays span,
body.dark-mode label,
body.dark-mode .focus-progress-header,
body.dark-mode .google-calendar-status,
body.dark-mode .google-calendar-empty,
body.dark-mode .google-calendar-event-title,
body.dark-mode .task-text,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode .google-calendar-header h3 {
    color: #d1d5db;
}

body.dark-mode .calendar-date {
    background: #111827;
    color: #e5e7eb;
    border-color: #2f3b4d;
}

body.dark-mode .calendar-date.empty {
    background: transparent;
    border-color: transparent;
}

body.dark-mode .calendar-date:hover:not(:disabled),
body.dark-mode .sidebar-tab:hover,
body.dark-mode .calendar-month-label:hover,
body.dark-mode .calendar-nav-btn:hover,
body.dark-mode .picker-nav-btn:hover,
body.dark-mode .month-btn:hover,
body.dark-mode .picker-btn:hover {
    background: #263247;
    border-color: #475569;
}

body.dark-mode .focus-progress-track {
    background: #2a3446;
}

body.dark-mode #clockCanvas {
    box-shadow: 0 10px 30px rgba(220, 230, 255, 0.35);
}

body.dark-mode .pop-out-btn {
    border-color: #555;
    color: #666;
}
body.dark-mode .pop-out-btn:hover { color: #ddd; border-color: #888; }

body.dark-mode .clock-pip-overlay {
    background: #23263a;
    box-shadow: 0 8px 36px rgba(0,0,0,0.55);
}
body.dark-mode .pip-drag-handle {
    background: #1a1c2d;
    border-color: #333;
}
body.dark-mode .pip-title { color: #aaa; }
body.dark-mode .pip-close-btn { color: #777; }
body.dark-mode .pip-close-btn:hover { color: #ddd; }

body.dark-mode .task-item {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

body.dark-mode .task-item.completed {
    background: linear-gradient(135deg, #2a313f 0%, #1e2531 100%);
}

body.dark-mode .task-item.completed .task-text,
body.dark-mode .task-back,
body.dark-mode .task-forward,
body.dark-mode .task-delete {
    color: #a3acba;
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        height: auto;
        max-width: 100%;
        flex-direction: column;
        padding: 20px;
    }

    .app-footer {
        position: static;
        transform: none;
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    .container-auth-slot {
        position: static;
        width: 100%;
        display: flex;
        justify-content: flex-end;
        margin-bottom: 8px;
    }

    .calendar-section {
        flex: 1;
    }

    .sidebar {
        flex: 1;
    }

    .productivity-panel {
        height: 520px;
    }

    .focus-progress-card {
        max-width: 100%;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    #clockCanvas {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
}
