/* ===== CSS Variables ===== */
:root {
    --color-bg: #0f0f13;
    --color-surface: #1a1a21;
    --color-surface-elevated: #242430;
    --color-border: #2e2e3a;
    --color-text: #f4f4f6;
    --color-text-secondary: #9494a4;
    --color-text-muted: #5a5a6e;
    
    --color-focus: #e85a4f;
    --color-focus-glow: rgba(232, 90, 79, 0.25);
    --color-short: #4ecdc4;
    --color-short-glow: rgba(78, 205, 196, 0.25);
    --color-long: #7c6fff;
    --color-long-glow: rgba(124, 111, 255, 0.25);
    
    --color-success: #4ade80;
    --color-danger: #f87171;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
    
    --accent: var(--color-focus);
    --accent-glow: var(--color-focus-glow);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Modern Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-surface-elevated) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
    border-radius: var(--radius-full);
}

*::-webkit-scrollbar-thumb {
    background: var(--color-surface-elevated);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.5;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input {
    font-family: inherit;
    border: none;
    background: none;
    color: inherit;
}

input:focus, button:focus {
    outline: none;
}

ul {
    list-style: none;
}

.hidden {
    display: none !important;
}

/* ===== App Layout ===== */
.app {
    min-height: 100vh;
    padding: 24px 40px 40px;
}

.main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

@media (max-width: 900px) {
    .app {
        padding: 20px;
    }
    
    .main {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .timer-section {
        order: 1;
    }
    
    .tasks-section {
        order: 2;
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .header {
        gap: 12px;
    }
    
    .btn-feedback span {
        display: none;
    }
    
    .btn-feedback {
        padding: 10px;
    }
    
    .timer-ring {
        width: 260px;
        height: 260px;
    }
    
    .timer-display span {
        font-size: 64px;
    }
    
    .lofi-player {
        max-width: 100%;
    }
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.back-link:hover {
    color: var(--color-text);
    background: var(--color-surface);
}

.back-link svg {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-focus), var(--color-long));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.free-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    background: linear-gradient(135deg, var(--color-success), #22c55e);
    color: #000;
    border-radius: var(--radius-full);
    animation: pulse 2s ease-in-out infinite;
}

.version-tag {
    font-size: 10px;
    font-weight: 500;
    padding: 4px 8px;
    background: var(--color-surface-elevated);
    color: var(--color-text-muted);
    border-radius: var(--radius-full);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-feedback {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-surface-elevated);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-feedback:hover {
    background: var(--color-surface);
    color: var(--color-text);
    transform: translateY(-1px);
}

.btn-feedback svg {
    width: 16px;
    height: 16px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--color-surface-elevated);
    color: var(--color-text);
}

/* ===== Timer Section ===== */
.timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 40px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
}

.mode-tabs {
    display: flex;
    background: var(--color-surface);
    border-radius: var(--radius-full);
    padding: 4px;
    margin-bottom: 32px;
}

.mode-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.mode-tab:hover {
    color: var(--color-text);
}

.mode-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

/* Timer Ring */
.timer-ring {
    position: relative;
    width: 320px;
    height: 320px;
    margin-bottom: 40px;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--color-surface-elevated);
    stroke-width: 8;
}

.progress-ring-circle {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset var(--transition-normal), stroke var(--transition-fast);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.timer-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: baseline;
}

.timer-display span {
    font-family: var(--font-mono);
    font-size: 80px;
    font-weight: 700;
    letter-spacing: -2px;
}

.timer-colon {
    opacity: 1;
    animation: blink 1s step-end infinite paused;
}

.timer-colon.running {
    animation-play-state: running;
}

@keyframes blink {
    50% { opacity: 0.3; }
}

/* Timer Controls */
.timer-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.btn-control {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.btn-secondary {
    width: 48px;
    height: 48px;
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

.btn-secondary:hover {
    background: var(--color-surface-elevated);
    color: var(--color-text);
    transform: scale(1.05);
}

.btn-primary {
    width: 72px;
    height: 72px;
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 32px var(--accent-glow);
}

.btn-primary:active {
    transform: scale(0.98);
}

.session-info {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* Lofi Player Widget */
.lofi-player {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 12px 16px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    max-width: 320px;
}

.lofi-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--color-surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.lofi-toggle:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

.lofi-toggle.playing {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.lofi-info {
    flex: 1;
    min-width: 0;
}

.lofi-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lofi-label::before {
    content: '🎵';
    font-size: 12px;
}

.lofi-status {
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lofi-status.playing {
    color: var(--accent);
}

.lofi-volume-slider {
    width: 60px;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--color-surface-elevated);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
}

.lofi-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.lofi-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.lofi-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
}

/* ===== Tasks Section ===== */
.tasks-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
}

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

.tasks-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.tasks-summary {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Task Form */
.task-form {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.task-form input {
    flex: 1;
    padding: 14px 16px;
    background: var(--color-surface-elevated);
    border-radius: var(--radius-md);
    font-size: 15px;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
}

.task-form input::placeholder {
    color: var(--color-text-muted);
}

.task-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.btn-add-task {
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-add-task:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* Task List */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
}

.task-list::-webkit-scrollbar {
    width: 6px;
}

.task-list::-webkit-scrollbar-track {
    background: transparent;
}

.task-list::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--color-surface-elevated);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    animation: slideIn var(--transition-normal);
}

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

.task-item:hover {
    background: var(--color-border);
}

.task-item.active {
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-text-muted);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.task-checkbox:hover {
    border-color: var(--accent);
}

.task-checkbox.checked {
    background: var(--color-success);
    border-color: var(--color-success);
}

.task-checkbox svg {
    opacity: 0;
    color: white;
    transition: opacity var(--transition-fast);
}

.task-checkbox.checked svg {
    opacity: 1;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-size: 15px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.task-item.completed .task-title {
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.task-pomodoros {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.task-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.task-item:hover .task-actions {
    opacity: 1;
}

.task-actions button {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.task-actions button:hover {
    background: var(--color-surface);
}

.task-actions .btn-task-start:hover {
    color: var(--accent);
}

.task-actions .btn-task-delete:hover {
    color: var(--color-danger);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    color: var(--color-text-muted);
    text-align: center;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: modalIn var(--transition-normal);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
}

.optional-label {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 400;
}

/* Settings Form */
.settings-form,
#feedback-form {
    padding: 24px;
}

.settings-group {
    margin-bottom: 28px;
}

.settings-group:last-of-type {
    margin-bottom: 24px;
}

.settings-group h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.settings-row:has(input[type="text"]),
.settings-row:has(select),
.settings-row:has(textarea) {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.settings-row label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.settings-row input[type="number"] {
    width: 80px;
    padding: 10px 12px;
    background: var(--color-surface-elevated);
    border-radius: var(--radius-sm);
    font-size: 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
}

.settings-row input[type="number"]:focus,
.settings-row input[type="text"]:focus,
.settings-row select:focus,
.settings-row textarea:focus {
    border-color: var(--accent);
}

.settings-row input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.settings-row input[type="text"]:hover {
    border-color: var(--color-text-muted);
}

.settings-row select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.settings-row select:hover {
    border-color: var(--color-text-muted);
}

.settings-row textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    resize: vertical;
    min-height: 120px;
    transition: all var(--transition-fast);
}

.settings-row textarea:hover {
    border-color: var(--color-text-muted);
}

.settings-row textarea::placeholder,
.settings-row input[type="text"]::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 48px;
    height: 28px;
    cursor: pointer;
}

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--color-surface-elevated);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    background: var(--color-text-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

/* Volume Control */
.volume-row {
    display: flex;
    align-items: center;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.volume-control svg {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.volume-control input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--color-surface-elevated);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.volume-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
}

#lofi-volume-value {
    font-size: 13px;
    color: var(--color-text-secondary);
    min-width: 40px;
    text-align: right;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
}

.btn-secondary-text {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.btn-secondary-text:hover {
    color: var(--color-text);
}

.btn-primary-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-primary-solid:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary-solid:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .app {
        padding: 16px 16px 32px;
    }
    
    /* Header mobile */
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 24px;
    }
    
    .back-link {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .back-link span {
        display: none;
    }
    
    .logo {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .logo-icon {
        font-size: 20px;
    }
    
    .free-tag, .version-tag {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .header-actions {
        position: absolute;
        top: 16px;
        right: 16px;
    }
    
    .btn-feedback span {
        display: none;
    }
    
    .btn-feedback {
        padding: 8px;
    }
    
    /* Timer mobile */
    .timer-section {
        padding: 0 8px;
    }
    
    .timer-display span {
        font-size: 52px;
    }
    
    .timer-ring {
        width: 220px;
        height: 220px;
        margin-bottom: 20px;
    }
    
    .mode-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .mode-tab {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .timer-controls {
        gap: 12px;
    }
    
    .btn-primary {
        width: 64px;
        height: 64px;
    }
    
    .btn-secondary {
        width: 42px;
        height: 42px;
    }
    
    /* Lofi player mobile */
    .lofi-player {
        max-width: 100%;
        padding: 10px 12px;
        gap: 10px;
    }
    
    .lofi-toggle {
        width: 36px;
        height: 36px;
    }
    
    .lofi-label {
        font-size: 12px;
    }
    
    .lofi-status {
        font-size: 10px;
    }
    
    .lofi-volume-slider {
        width: 50px;
    }
    
    /* Tasks mobile */
    .tasks-section {
        padding: 20px 16px;
        min-height: auto;
    }
    
    .tasks-header h2 {
        font-size: 18px;
    }
    
    .task-input {
        font-size: 14px;
    }
    
    .task-item {
        padding: 12px;
    }
    
    .task-title {
        font-size: 14px;
    }
    
    .task-actions {
        opacity: 1;
    }
    
    /* Modal mobile */
    .modal-content {
        margin: 16px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .settings-group h3 {
        font-size: 12px;
    }
    
    .settings-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .settings-row.toggle-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .settings-row input[type="number"] {
        width: 100%;
    }
    
    .volume-control {
        width: 100%;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .modal-actions button {
        width: 100%;
        justify-content: center;
    }
    
    /* Welcome modal mobile */
    .welcome-content {
        padding: 24px 20px;
    }
    
    .welcome-header h2 {
        font-size: 22px;
    }
    
    .welcome-icon {
        font-size: 40px;
    }
    
    .feature-item {
        padding: 12px;
        gap: 10px;
    }
    
    .feature-icon {
        font-size: 20px;
        width: 30px;
        height: 30px;
    }
    
    .feature-text h4 {
        font-size: 13px;
    }
    
    .feature-text p {
        font-size: 12px;
    }
    
    .welcome-tips {
        padding: 12px 14px;
        font-size: 12px;
    }
    
    .welcome-actions .btn-primary-solid {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .timer-display span {
        font-size: 44px;
    }
    
    .timer-ring {
        width: 180px;
        height: 180px;
    }
    
    .mode-tab {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .logo-text {
        font-size: 16px;
    }
}

/* ===== Mode-specific colors ===== */
[data-mode="work"] {
    --accent: var(--color-focus);
    --accent-glow: var(--color-focus-glow);
}

[data-mode="short"] {
    --accent: var(--color-short);
    --accent-glow: var(--color-short-glow);
}

[data-mode="long"] {
    --accent: var(--color-long);
    --accent-glow: var(--color-long-glow);
}

/* Feedback Toast */
.feedback-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--color-surface-elevated);
    color: var(--color-text);
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-border);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.feedback-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Welcome Modal */
.welcome-content {
    max-width: 520px;
    text-align: center;
}

.welcome-header {
    margin-bottom: 28px;
}

.welcome-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.welcome-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--color-focus), var(--color-short));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    font-size: 15px;
    color: var(--color-text-secondary);
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast);
}

.feature-item:hover {
    transform: translateX(4px);
}

.feature-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-text h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.feature-text p {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.welcome-tips {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.welcome-tips kbd {
    display: inline-block;
    padding: 3px 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.dont-show-again {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-muted);
    cursor: pointer;
}

.dont-show-again input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.welcome-actions .btn-primary-solid {
    padding: 14px 32px;
    font-size: 15px;
}
