:root {
    /* Dark Muted Purple Theme */
    --bg-primary: #0D0D0F;
    --bg-secondary: #16161A;
    --bg-tertiary: #1E1E24;
    --text-primary: #E8E6EB;
    --text-secondary: #9D9AA5;
    --text-muted: #8B8893;
    --accent: #7B6694;
    --accent-hover: #8E77A8;
    --accent-soft: #3D3350;
    --success: #6B8E7B;
    --break-color: #5B7E8E;
    --pulse-glow: rgba(123, 102, 148, 0.25);
    --shadow: rgba(0, 0, 0, 0.4);
    --border: rgba(255, 255, 255, 0.08);
}

/* Light Theme */
.light-theme {
    --bg-primary: #F5F3F7;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #EBE9ED;
    --text-primary: #2D2A33;
    --text-secondary: #5D5A65;
    --text-muted: #6B6875;
    --accent: #7B6694;
    --accent-hover: #6A5782;
    --accent-soft: #D4CCDF;
    --success: #5B8E6B;
    --break-color: #4B7E8E;
    --pulse-glow: rgba(123, 102, 148, 0.2);
    --shadow: rgba(0, 0, 0, 0.1);
    --border: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    /* Safe area support for notched phones */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Main Layout */
.main-container {
    width: 100%;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Task Queue Section */
.task-queue {
    width: 100%;
    max-width: 450px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin: 1.5rem 0;
}

.task-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
    transition: background-color 0.2s ease;
}

.task-queue-header:hover {
    background: var(--accent-soft);
}

.task-queue-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    flex: 1;
}

.task-queue-toggle-icon {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.task-queue.collapsed .task-queue-toggle-icon {
    transform: rotate(-90deg);
}

.task-queue.collapsed .task-queue-header {
    justify-content: center;
    border-bottom: none;
}

.task-queue-body {
    max-height: 420px;
    overflow-y: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-soft) transparent;
}

.task-queue-body::-webkit-scrollbar {
    width: 4px;
}

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

.task-queue-body::-webkit-scrollbar-thumb {
    background: var(--accent-soft);
    border-radius: 4px;
}

.task-queue.collapsed .task-queue-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.task-queue-body {
    padding: 0.8rem;
}

.task-input-row {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

.task-queue-input {
    flex: 1;
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.task-queue-input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-add-task {
    padding: 0.5rem 0.8rem;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.btn-add-task:hover {
    background: var(--accent-hover);
}

.task-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

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

.task-item.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.task-item.completed {
    border-color: var(--success);
    background: rgba(107, 142, 123, 0.15);
}

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

.task-item.completed::before {
    content: '';
    color: var(--success);
    font-weight: bold;
    margin-right: 0.3rem;
}

.task-item-text {
    flex: 1;
    font-size: 0.85rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.task-item-actions {
    display: flex;
    gap: 0.2rem;
}

.task-btn-mini {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.task-btn-mini:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.task-btn-mini.delete-btn {
    color: #b87373;
}

.task-btn-mini.delete-btn:hover {
    color: #d49090;
    background: var(--bg-tertiary);
}

/* App Container */
.app-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: transform 0.3s ease;
    position: relative;
}

/* Index page: make app container exactly viewport height so info-section is below fold */
/* Using :has() selector - supported in Chrome 105+, Safari 15.4+, Firefox 121+ */
.main-container:has(.info-section) {
    flex-wrap: wrap;
}

.main-container:has(.info-section) .app-container {
    min-height: 100vh;
    flex: 0 0 auto;
    width: 100%;
}

.main-container:has(.info-section) .info-section {
    flex: 0 0 auto;
    width: 100%;
}

.pulse-active {
    animation: gentlePulse 2s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 0 60px var(--pulse-glow);
    }
    50% {
        box-shadow: 0 0 100px var(--pulse-glow);
    }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.mode-tab {
    padding: 0.6rem 1.2rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mode-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.mode-tab.active {
    background: var(--accent);
    color: white;
}

.mode-tab[data-mode="break"].active {
    background: var(--break-color);
}

/* Current Task Display */
.current-task {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-task-text {
    font-size: 1rem;
    color: var(--text-secondary);
}

.current-task-text.has-task {
    color: var(--text-primary);
    font-weight: 500;
}

/* Timer Display with Circular Progress */
.timer-display {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-circle {
    position: relative;
    width: 320px;
    height: 320px;
}

.timer-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.timer-circle-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 4;
}

.timer-circle-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-circle-progress[data-mode="break"] {
    stroke: var(--break-color);
}

.timer-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-time {
    font-size: 4.5rem;
    font-weight: 200;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.timer-time[data-mode="break"] {
    color: var(--break-color);
}

.timer-status {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    min-height: 1.5rem;
}

/* Session Dots */
.session-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.session-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    transition: all 0.3s ease;
}

.session-dot.completed {
    background: var(--accent);
    border-color: var(--accent);
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: var(--accent);
    color: white;
    min-width: 140px;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow);
}

.btn-primary[data-mode="break"] {
    background: var(--break-color);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-skip {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
}

.btn-skip:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
}

/* Sound Controls */
.sound-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sound-section-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.sound-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sound-select-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.sound-select {
    flex: 1;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

.sound-select:focus {
    outline: none;
    border-color: var(--accent);
}

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

.volume-icon {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

/* Settings Panel */
.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.settings-toggle:hover {
    color: var(--text-primary);
}

.settings-panel {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: none;
}

.settings-panel.open {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.settings-input {
    width: 80px;
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
}

.settings-input:focus {
    outline: none;
    border-color: var(--accent);
}

.settings-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Keyboard hint */
.keyboard-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2rem;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow);
    z-index: 100;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Show/hide icons based on theme */
.theme-toggle .sun-icon {
    display: none;
}

.light-theme .theme-toggle .moon-icon {
    display: none;
}

.light-theme .theme-toggle .sun-icon {
    display: block;
}

.keyboard-key {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 4px;
    margin: 0 0.2rem;
}

/* Footer */
.page-footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.page-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.page-footer a:hover {
    color: var(--accent);
}

.app-footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.app-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.app-footer a:hover {
    color: var(--accent);
}

/* Info Modal */
.info-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-modal-overlay.open {
    display: flex !important;
    opacity: 1 !important;
}

.info-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.info-modal-overlay.open .info-modal {
    transform: scale(1);
}

.info-modal h2 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.info-modal .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.info-modal .benefits {
    list-style: none;
    margin-bottom: 1.5rem;
}

.info-modal .benefits li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-modal .benefits li::before {
    content: '✓';
    color: var(--success);
    font-weight: bold;
}

.info-modal .info-btn-large {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.info-modal .info-btn-large:hover {
    background: var(--accent-hover);
}

.info-modal .close-btn {
    width: 100%;
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.5rem;
    margin-top: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

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

/* Responsive */
@media (max-width: 900px) {
    .app-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 1rem;
    }

    .timer-circle {
        width: 260px;
        height: 260px;
    }

    .timer-time {
        font-size: 3.5rem;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .sound-select-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==================== */
/* Index Page Specific Styles */
/* ==================== */

.app-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container-full {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

/* ==================== */
/* Info Section (index.html) */
/* ==================== */

.info-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    width: 100%;
}

/* Intro Section */
.info-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.info-intro h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.info-intro p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 550px;
    margin: 0 auto;
}

/* Info Block - Main content container */
.info-block {
    margin-bottom: 3rem;
}

/* Info Block Title */
.info-block-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.info-block-title h3 {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text-primary);
}

.info-block-title .line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Info Content - Text paragraphs */
.info-content {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
}

.info-content p {
    margin-bottom: 1.2rem;
}

.info-content strong {
    color: var(--text-primary);
    font-weight: 500;
}

.info-content ul {
    margin: 1.2rem 0;
    padding-left: 1.5rem;
}

.info-content li {
    margin-bottom: 0.6rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-content li::marker {
    color: var(--accent);
}

/* Steps List */
.steps-list {
    display: grid;
    gap: 0.75rem;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.step-item:hover {
    border-color: var(--accent-soft);
    background: var(--bg-tertiary);
}

.step-item .step-number {
    min-width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.step-item .step-text {
    color: var(--text-secondary);
    line-height: 1.6;
    padding-top: 0.15rem;
}

/* Sound Grid within Info Block */
.info-block .sound-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.sound-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.sound-item:hover {
    border-color: var(--accent-soft);
    transform: translateY(-2px);
}

.sound-item h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.sound-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Noise Guide Section */
.noise-guide {
    display: grid;
    gap: 1.5rem;
}

.noise-type {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.noise-type h4 {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.noise-type p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.noise-type p:last-child {
    margin-bottom: 0;
}

.noise-type strong {
    color: var(--text-primary);
    font-weight: 500;
}

@media (min-width: 768px) {
    .noise-guide {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Info Footer */
.info-footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ==================== */
/* Enhanced Mobile Styles */
/* ==================== */

@media (max-width: 768px) {
    /* Task queue mobile styles */
    .task-queue {
        max-width: 100%;
        margin: 1rem 0;
    }

    .task-queue-header {
        padding: 0.8rem 1rem;
    }

    .task-queue-body {
        max-height: 200px;
    }

    .task-item {
        padding: 0.6rem 0.7rem;
    }

    .task-item-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .task-input-row {
        margin-bottom: 0.6rem;
        gap: 0.5rem;
    }

    .task-btn-mini {
        min-width: 32px;
        min-height: 32px;
        padding: 0.35rem;
    }

    /* App container adjustments */
    .app-container,
    .app-container-full {
        padding: 1rem;
        padding-top: 0;
    }

    /* Index page mobile: keep app at viewport height */
    .main-container:has(.info-section) .app-container {
        min-height: 100vh;
        height: auto;
    }

    /* Header */
    .header {
        margin-bottom: 1rem;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    /* Mode tabs */
    .mode-tabs {
        gap: 0.3rem;
        margin-bottom: 1rem;
    }

    .mode-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    /* Current task */
    .current-task {
        margin-bottom: 1rem;
        padding: 0.6rem 1rem;
        min-height: 44px;
    }

    .current-task-text {
        font-size: 0.9rem;
    }

    /* Timer circle */
    .timer-circle {
        width: 240px;
        height: 240px;
    }

    .timer-time {
        font-size: 3rem;
    }

    .timer-status {
        font-size: 0.85rem;
    }

    /* Session dots */
    .session-dots {
        margin-bottom: 1rem;
        gap: 0.4rem;
    }

    .session-dot {
        width: 8px;
        height: 8px;
    }

    /* Controls */
    .controls {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .btn {
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .btn-skip {
        padding: 0.9rem 1.2rem;
    }

    /* Sound section */
    .sound-section {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    .sound-section-title {
        font-size: 0.75rem;
        margin-bottom: 0.8rem;
    }

    .sound-select-row {
        flex-direction: column;
        gap: 0.8rem;
    }

    .sound-select {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
        min-height: 48px;
    }

    /* Volume slider */
    .volume-control {
        gap: 0.8rem;
    }

    .volume-slider {
        height: 8px;
    }

    .volume-slider::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
    }

    /* Settings */
    .settings-toggle {
        font-size: 0.85rem;
        padding: 0.6rem;
    }

    .settings-panel {
        padding: 1rem;
        border-radius: 12px;
    }

    .settings-row {
        padding: 0.7rem 0;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .settings-label {
        font-size: 0.9rem;
        flex: 1 1 auto;
    }

    .settings-input {
        width: 70px;
        padding: 0.5rem;
        font-size: 0.9rem;
        min-height: 40px;
    }

    .settings-checkbox {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }

    /* Keyboard hint - hide on very small screens */
    .keyboard-hint {
        font-size: 0.75rem;
        margin-top: 1rem;
    }

    /* Info section mobile */
    .info-section {
        padding: 2rem 1rem;
    }

    .info-intro {
        margin-bottom: 2rem;
    }

    .info-intro h2 {
        font-size: 1.5rem;
    }

    .info-intro p {
        font-size: 0.95rem;
    }

    .info-block {
        margin-bottom: 2rem;
    }

    .info-block-title {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .info-block-title h3 {
        font-size: 1.15rem;
    }

    .info-content {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .info-content p {
        margin-bottom: 1rem;
    }

    .info-content ul {
        padding-left: 1.25rem;
    }

    .step-item {
        padding: 0.85rem 1rem;
    }

    .step-item .step-number {
        min-width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }

    .step-item .step-text {
        font-size: 0.9rem;
    }

    .info-block .sound-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .sound-item {
        padding: 1rem;
    }

    .sound-item h4 {
        font-size: 0.95rem;
    }

    .sound-item p {
        font-size: 0.8rem;
    }

    /* Info modal */
    .info-modal {
        padding: 1.5rem;
        max-width: 340px;
    }

    .info-modal h2 {
        font-size: 1.3rem;
    }

    .info-modal .benefits li {
        font-size: 0.9rem;
    }

    /* Footer */
    .app-footer,
    .page-footer {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .cta-section {
        padding: 2rem 1rem;
    }

    .cta-section h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 380px) {
    /* Extra small phones */
    .timer-circle {
        width: 200px;
        height: 200px;
    }

    .timer-time {
        font-size: 2.5rem;
    }

    .mode-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    /* Info section on very small screens */
    .info-intro h2 {
        font-size: 1.3rem;
    }

    .step-item {
        padding: 0.75rem 0.85rem;
    }

    .step-item .step-text {
        font-size: 0.85rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .task-btn-mini {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 36px;
        min-height: 36px;
    }

    .btn-add-task {
        min-width: 44px;
        min-height: 44px;
    }

    .task-queue-input {
        min-height: 44px;
    }

    /* Disable hover effects on touch devices */
    .task-item:hover,
    .btn:hover,
    .mode-tab:hover {
        transform: none;
    }
}
