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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #16a34a;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #2563eb;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
    --chart-bar-total: #2563eb;
    --chart-bar-recent: #a8c5ff;
    --bg-panel-alpha: 0.85;
    --bg-image-blur: 0px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f5fa;
    min-height: 100vh;
    color: var(--text-primary);
}

/* ── Background layer ── */

#bgLayer {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(var(--bg-image-blur));
    z-index: -1;
    pointer-events: none;
}

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

#app {
    display: none;
}

/* ── Header ── */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ── Middle (two‑column) ── */

.middle {
    display: flex;
    gap: 16px;
    position: relative;
    min-height: 520px;
}

/* ── Left panel ── */

.left-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Background image mode ── */

body.has-bg {
    background: transparent;
}

body.has-bg .header,
body.has-bg .next-task-section,
body.has-bg .reminder-section,
body.has-bg .work-stats-section,
body.has-bg .pressure-section,
body.has-bg .right-panel,
body.has-bg .timer-section {
    background: rgba(255, 255, 255, var(--bg-panel-alpha));
}

body.has-bg .next-task-item,
body.has-bg .task-card {
    background: rgba(248, 250, 252, var(--bg-panel-alpha));
}

body.has-bg .task-card.pinned {
    background: var(--chart-bar-recent);
}

body.has-bg .modal-content,
body.has-bg .reminder-panel,
body.has-bg .theme-shop-panel {
    background: rgba(255, 255, 255, var(--bg-panel-alpha));
}

body.has-bg .task-card {
    background: rgba(248, 250, 252, calc(var(--bg-panel-alpha) - 0.05));
}

/* ── Stats row ── */

.stat-tag-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.stat-tag-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

/* ── Reminder section ── */

.reminder-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 4px;
}

.reminder-header {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.reminder-header-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.reminder-subhead {
    font-size: 13px;
    font-weight: 600;
    margin: 8px 0 4px 0;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.reminder-subhead.today {
    background: #fee2e2;
    color: #b91c1c;
}

.reminder-subhead.tomorrow {
    background: #fef3c7;
    color: #b45309;
}

.reminder-chips {
    display: inline;
    line-height: 2;
}

.reminder-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    margin: 2px 6px 2px 0;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    font-size: 12px;
    white-space: nowrap;
    vertical-align: middle;
}

.reminder-chip.chip-done {
    opacity: 0.6;
    background: #f1f5f9;
}

.reminder-chip input[type="checkbox"] {
    width: 13px;
    height: 13px;
    cursor: pointer;
    flex-shrink: 0;
}

.chip-name {
    font-weight: 500;
    color: var(--text-primary);
}

.chip-name.reminder-done {
    text-decoration: line-through;
}

.chip-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.reminder-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}

.reminder-create-btn {
    width: 100%;
    margin-top: 10px;
    font-size: 13px;
    justify-content: center;
}

.reminder-choice-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
}

.reminder-choice-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 15px;
}

.reminder-interval-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-primary);
}

.reminder-interval-row input.inline-input {
    width: 56px;
    padding: 6px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    text-align: center;
}

.reminder-start-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.start-date-display {
    font-size: 14px;
    color: var(--text-primary);
    padding: 8px 0;
}

.date-pick-btn {
    font-size: 12px;
    padding: 6px 12px;
}


/* Top row: next task + chart */

.top-row {
    display: flex;
    gap: 16px;
}

/* Next task section */

.next-task-section {
    width: 65%;
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.work-stats-section {
    flex: 1;
    min-width: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.work-stats-chart canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.work-stats-chart {
    flex: 1;
    min-height: 0;
    width: 100%;
}

.work-stats-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-today-work {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.work-stats-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.stats-tab {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.15s;
}

.stats-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.stats-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.work-stats-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.legend-dot.recent {
    background: var(--chart-bar-recent);
}

.legend-dot.total {
    background: var(--primary-color);
}

.next-task-header {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.next-task-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.next-task-body {
    min-height: 80px;
}

.next-task-body .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    color: var(--text-secondary);
}

.next-task-body .empty-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.next-task-item {
    display: flex;
    position: relative;
    overflow: hidden;
    align-items: stretch;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.next-task-main {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    flex: 1;
    min-width: 0;
}

.next-task-slide {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
    z-index: 2;
    display: flex;
    align-items: stretch;
}

.next-task-item:hover .next-task-slide,
.next-task-item.show-btns .next-task-slide {
    width: 160px;
}

.next-task-slide .slide-btn {
    font-size: 13px;
    min-height: 0;
}

.next-task-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.next-task-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.next-task-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.next-task-actions .task-action-btn {
    width: 32px;
    height: 28px;
    font-size: 12px;
}

/* ── Timer ── */

.timer-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

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

.timer-time {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.timer-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.timer-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.5s linear;
}

.timer-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.timer-btn {
    padding: 8px 18px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.15s;
}

.timer-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.timer-btn-start {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.timer-btn-start:hover {
    background: var(--primary-hover);
    color: white;
}

.timer-btn-stop {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.timer-btn-stop:hover {
    background: var(--danger-color);
    color: white;
}

/* ── Timer end modal ── */

.timer-end-question {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.timer-end-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

.timer-next-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.timer-next-btn {
    width: 100%;
    padding: 14px 20px;
    justify-content: center;
}

.timer-modal-slices {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-primary);
}

.modal-slice-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-slice-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.modal-slice-value {
    font-size: 22px;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
}

/* ── Pressure section ── */

.pressure-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.pressure-header {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.pressure-bar {
    position: relative;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.pressure-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 5px;
    background: linear-gradient(90deg,
        #2563eb 0%,
        #16a34a 33%,
        #d97706 66%,
        #dc2626 100%
    );
    transition: clip-path 0.3s ease;
}

.pressure-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pressure-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.pressure-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Right panel (task list) ── */

.right-panel {
    width: 40%;
    min-width: 240px;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    transition: all 0.35s ease;
    position: relative;
    z-index: 5;
    overflow: hidden;
}

.right-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.right-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Task list items ── */

.task-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-list .empty-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.task-list .empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.task-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.task-main {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    flex: 1;
    min-width: 0;
}

.task-field {
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.task-card:hover .task-field,
.task-card.show-btns .task-field {
    opacity: 0;
    pointer-events: none;
}

.task-slide-btns {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
    z-index: 2;
    display: flex;
    align-items: stretch;
}

.task-card:hover .task-slide-btns,
.task-card.show-btns .task-slide-btns {
    width: 210px;
}

.task-field {
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.task-card:hover .task-field,
.task-card.show-btns .task-field {
    opacity: 0;
    pointer-events: none;
}

.task-card:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.task-card.high-priority {
    border-color: var(--primary-color);
}

.task-card.pinned {
    border-color: var(--primary-color);
    background: var(--chart-bar-recent);
}

.task-card {
    position: relative;
    overflow: hidden;
}

.task-slide-btns {
    display: flex;
    align-items: stretch;
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
    flex-shrink: 0;
}

.task-card:hover .task-slide-btns {
    width: 210px;
}

.slide-btn {
    flex: 1;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 0 4px;
    transition: background 0.15s;
    color: #fff;
    min-height: 48px;
}

.slide-start { background: #2563eb; }
.slide-start:hover { background: #1d4ed8; }
.slide-reset { background: #d97706; }
.slide-reset:hover { background: #b45309; }
.slide-finish { background: #16a34a; }
.slide-finish:hover { background: #15803d; }

.task-rank {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    color: white;
    flex-shrink: 0;
}

.task-pin-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.15s;
    line-height: 1;
    white-space: nowrap;
}

.task-pin-btn:hover {
    background: #ffe4a0;
    border-color: #d97706;
    color: #d97706;
}

.task-card .task-name {
    font-size: 13px;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.task-card .task-name:hover {
    color: var(--primary-color);
}

.task-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
    user-select: none;
    border-radius: 4px;
    transition: background 0.15s;
}

.task-expand-btn:hover {
    background: var(--bg-card-hover);
    color: var(--primary-color);
}

.deadline-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
}

.deadline-tag.deadline-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.deadline-tag.deadline-warn {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* expanded-only content (hidden when collapsed) */




/* ── Buttons (generic) ── */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-secondary {
    background: var(--chart-bar-recent);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--chart-bar-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #b45309;
}

.btn-icon {
    font-size: 18px;
}

/* ── Footer ── */

.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
}

/* ── Settings button ── */

.header-buttons {
    display: flex;
    gap: 6px;
    order: -1;
}

.header .logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: auto;
}

.header-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.settings-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.settings-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.theme-shop-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.theme-shop-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ── Auth ── */

.auth-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-btn {
    width: 100%;
    margin-top: 8px;
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 16px;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-error {
    color: var(--danger-color);
    font-size: 13px;
    text-align: center;
    min-height: 20px;
    margin-bottom: 4px;
}

.header-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 8px;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.logout-btn:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* ── Theme shop panel ── */

.theme-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 20;
}

.theme-overlay.active {
    display: block;
}

.theme-shop-panel {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100%;
    background: var(--bg-card);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 25;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.theme-shop-panel.open {
    left: 0;
}

.theme-shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-shop-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.theme-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #f8fafc;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
}

.theme-btn:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.theme-custom-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    background: #f8fafc;
}

.theme-custom-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.theme-color-picker {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: border-color 0.15s;
}

.theme-color-picker:hover {
    border-color: var(--primary-color);
}

.theme-color-picker:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.theme-bg-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    background: #f8fafc;
}

.bg-blur-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bg-blur-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.bg-blur-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    appearance: none;
    outline: none;
    cursor: pointer;
}

.bg-blur-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.bg-blur-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.theme-shop-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Payment modal ── */

.pay-image {
    width: 200px;
    height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 0 auto;
    display: block;
}

.pay-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 8px 0;
}

.pay-countdown {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0;
}

/* ── Reminder panel ── */

.reminder-overlay,
.settings-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 20;
}

.reminder-overlay.active,
.settings-overlay.active {
    display: block;
}

.reminder-panel {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100%;
    background: var(--bg-card);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 25;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.reminder-panel.open {
    left: 0;
}

.reminder-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.reminder-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.reminder-panel-section {
    margin-bottom: 20px;
}

.reminder-panel-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.reminder-panel-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.reminder-panel-item:hover {
    background: var(--bg-card-hover);
}

.reminder-panel-item .item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reminder-panel-item .item-info {
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: 8px;
}

/* ── Modal ── */

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-content.small-modal {
    max-width: 380px;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 24px;
    transition: background 0.2s;
}

.close-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* ── AI Estimate ── */

.ai-estimate-section {
    margin-top: 12px;
}

.ai-toggle-btn {
    width: 100%;
    font-size: 13px;
    justify-content: center;
}

.ai-estimate-panel {
    margin-top: 12px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.ai-textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s;
    line-height: 1.6;
}

.ai-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ai-textarea::placeholder {
    color: var(--text-secondary);
}

.ai-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.ai-loading {
    font-size: 14px;
    color: var(--text-secondary);
}

.ai-result {
    margin-top: 12px;
    padding: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
}

.ai-result-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-result-disclaimer {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ── Form ── */

.form-group {
    margin-bottom: 16px;
}

.settings-check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.settings-check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ── Responsive: Mobile layout ── */

@media (max-width: 900px) {
    .middle { flex-direction: column; }
    .top-row { flex-direction: column; }
    .next-task-section,
    .work-stats-section { width: 100%; }
    .right-panel { width: 100%; max-width: none; min-width: 0; }
    .right-panel.expanded { position: static; width: 100%; box-shadow: var(--shadow); }
}

/* ── Responsive: Tablet & small screens ── */

@media (max-width: 768px) {
    .container { padding: 12px; }

    .header { flex-wrap: wrap; padding: 10px 14px; }
    .header .logo { font-size: 17px; margin-left: 0; }
    .header-buttons { flex-wrap: wrap; gap: 4px; }
    .logout-btn { font-size: 11px; padding: 2px 8px; }

    .next-task-item { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
    .next-task-name { font-size: 16px; width: 100%; }
    .next-task-meta { font-size: 12px; gap: 6px; flex-wrap: wrap; }
    .next-task-actions { margin-left: 0; width: 100%; justify-content: flex-end; gap: 4px; }

    .task-card { padding: 6px 8px; gap: 4px; }
    .task-card .task-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .task-field { font-size: 11px; }
    /* Disable hover slide on mobile, use click instead */
    .task-card:hover .task-slide-btns { width: 0; }
    .task-card.show-btns .task-slide-btns { width: 210px; }
    .slide-btn { font-size: 12px; }

    .modal-content { max-width: 94vw; margin: 0 auto; }
    .modal-content.small-modal { max-width: 90vw; }
    .form-row { grid-template-columns: 1fr; }

    .theme-shop-panel { width: 85vw; left: -85vw; }
    .reminder-panel { width: 85vw; left: -85vw; }
    .theme-shop-panel.open { left: 0; }
    .reminder-panel.open { left: 0; }
}

/* ── Responsive: Phones ── */

@media (max-width: 480px) {
    .container { padding: 10px; }
    .left-panel { gap: 12px; }

    .header { padding: 8px 10px; }
    .header .logo { font-size: 15px; }
    .header-buttons { gap: 2px; }
    .settings-btn { font-size: 18px; }
    .theme-shop-btn { font-size: 16px; }
    .header-btn { font-size: 16px; }
    .logout-btn { font-size: 10px; padding: 2px 6px; }

    .next-task-section { padding: 14px; }
    .timer-time { font-size: 28px; }
    .timer-btn { padding: 6px 14px; font-size: 13px; }

    .pressure-section { padding: 14px; }
    .pressure-value { font-size: 17px; }
    .pressure-text { font-size: 12px; }

    .btn { padding: 10px 16px; font-size: 14px; }

    .stat-tag-label { font-size: 10px; padding: 2px 6px; }
    .stat-tag-value { font-size: 13px; }

    .modal-content { max-width: 96vw; border-radius: 6px; }
    .modal-body { padding: 16px; }
    .modal-header { padding: 14px 16px; }
    .modal-footer { padding: 14px 16px; flex-direction: column; gap: 8px; }
    .modal-footer .btn { width: 100%; }

    .theme-shop-panel { width: 92vw; left: -92vw; }
    .reminder-panel { width: 92vw; left: -92vw; }
}
