@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600&family=Bebas+Neue&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
    --bg-base: #060810;
    --bg-surface: rgba(255, 255, 255, 0.04);
    --bg-card: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.09);
    --border-hover: rgba(255, 255, 255, 0.14);

    --primary: #4f9cf9;
    --primary-dim: rgba(79, 156, 249, 0.12);
    --primary-hover: #6aadfb;

    --accent: #e05f3a;
    --accent-dim: rgba(224, 95, 58, 0.1);

    --text-main: #f0ede6;
    --text-muted: #7a7772;
    --text-soft: #a8a49e;

    --card-radius: 16px;
    --item-radius: 10px;
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);

    --font: 'Outfit', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-timer: 'Bebas Neue', cursive;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

/* ── Background ─────────────────────────────────────────────── */
.animated-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    /* Deep midnight base — not pure black, has depth */
    background:
        radial-gradient(ellipse 80% 60% at 15% 10%, rgba(17,28,60,0.95) 0%, transparent 65%),
        radial-gradient(ellipse 60% 50% at 85% 85%, rgba(10,22,50,0.9) 0%, transparent 60%),
        radial-gradient(ellipse 100% 80% at 50% 50%, rgba(8,12,28,1) 0%, transparent 100%),
        #060810;
}

/* Perspective grid floor */
.animated-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(79,156,249,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79,156,249,0.04) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, black 30%, transparent 80%);
    animation: gridDrift 30s linear infinite;
}

/* Subtle scan-line shimmer */
.animated-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(255,255,255,0.007) 3px,
        rgba(255,255,255,0.007) 4px
    );
    pointer-events: none;
}

@keyframes gridDrift {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 52px 52px, 52px 52px; }
}

/* Orbs — deep colour pools, not generic AI blobs */
.orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* Top-left — deep cobalt */
.orb-1 {
    width: 680px;
    height: 680px;
    top: -240px;
    left: -200px;
    background: radial-gradient(circle, rgba(30,70,180,0.28) 0%, rgba(10,30,90,0.12) 55%, transparent 75%);
    filter: blur(60px);
    animation: orb1move 20s ease-in-out infinite alternate;
}

/* Bottom-right — deep violet */
.orb-2 {
    width: 520px;
    height: 520px;
    bottom: -160px;
    right: -140px;
    background: radial-gradient(circle, rgba(80,30,160,0.22) 0%, rgba(40,10,80,0.1) 55%, transparent 75%);
    filter: blur(55px);
    animation: orb2move 25s ease-in-out infinite alternate;
}

/* Centre — faint teal accent */
.orb-3 {
    width: 360px;
    height: 360px;
    top: 40%;
    left: 48%;
    transform: translate(-50%,-50%);
    background: radial-gradient(circle, rgba(0,140,180,0.1) 0%, transparent 70%);
    filter: blur(70px);
    animation: orb3move 35s ease-in-out infinite alternate;
}

@keyframes orb1move {
    0%   { transform: translate(0px, 0px) scale(1); }
    50%  { transform: translate(30px, 50px) scale(1.06); }
    100% { transform: translate(-20px, 30px) scale(0.97); }
}
@keyframes orb2move {
    0%   { transform: translate(0px, 0px) scale(1); }
    50%  { transform: translate(-40px, -30px) scale(1.08); }
    100% { transform: translate(20px, -50px) scale(0.95); }
}
@keyframes orb3move {
    0%   { transform: translate(-50%,-50%) scale(1); }
    50%  { transform: translate(calc(-50% + 40px), calc(-50% - 30px)) scale(1.12); }
    100% { transform: translate(calc(-50% - 20px), calc(-50% + 40px)) scale(0.9); }
}

/* Floating particles */
.orb::before,
.orb::after {
    display: none;
}

/* ── App Container ──────────────────────────────────────────── */
.app-container {
    width: 100%;
    max-width: 520px;
    padding: 2.5rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    position: relative;
    z-index: 1;
}

/* ── Typography ─────────────────────────────────────────────── */
h1 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--primary);
    line-height: 1.1;
}

h2 {
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

h3 {
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 300;
    color: var(--text-soft);
    letter-spacing: 0.02em;
    margin-top: 0.25rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.app-header {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.header-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.2);
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header-titles {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.header-titles h1 {
    line-height: 1.1;
}

.header-titles h3 {
    margin-top: 0;
}

.mood-selector p {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
    font-weight: 500;
}

.mood-options {
    display: flex;
    gap: 0.7rem;
}

.mood-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mood-btn:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-2px);
}

.mood-btn.active {
    background: var(--primary-dim);
    border-color: rgba(79, 156, 249, 0.4);
    box-shadow: 0 0 16px rgba(79, 156, 249, 0.15);
}

/* ── Glass Panel ────────────────────────────────────────────── */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--card-radius);
    padding: 1.4rem;
    transition: border-color var(--transition);
}

.glass-panel:focus-within {
    border-color: var(--border-hover);
}

/* ── Task Input Form ────────────────────────────────────────── */
#task-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 1rem;
    outline: none;
}

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

/* ── Task Title Input — Option 1 design ─────────────────────── */
.task-title-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    transition: border-color var(--transition), background var(--transition);
}

.task-title-input-wrap:focus-within {
    border-color: rgba(79, 156, 249, 0.45);
    background: rgba(0, 0, 0, 0.28);
}

.task-title-icon {
    color: var(--primary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.task-title-input-wrap:focus-within .task-title-icon {
    opacity: 1;
}

.task-title-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.task-title-label {
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    opacity: 0.7;
    transition: opacity var(--transition);
}

.task-title-input-wrap:focus-within .task-title-label {
    opacity: 1;
}

#task-title {
    font-size: 0.95rem;
    font-weight: 400;
    width: 100%;
    letter-spacing: 0.01em;
    padding: 0;
}

#task-title::placeholder {
    color: rgba(168, 164, 158, 0.4);
    font-style: italic;
}

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

/* ── Time Inputs (hr / min spinners) ────────────────────────── */
.time-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}

.time-inputs:focus-within {
    border-color: rgba(79, 156, 249, 0.3);
}

.time-field {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.time-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.spin-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.45rem;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spin-btn:hover {
    color: var(--primary);
    background: var(--primary-dim);
}

.spin-btn:active {
    transform: scale(0.88);
}

.time-field input {
    width: 32px;
    text-align: center;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--text-main);
}

.time-field input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.time-field input::-webkit-outer-spin-button,
.time-field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-field input[type=number] {
    -moz-appearance: textfield;
}

.time-field span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.time-separator {
    color: var(--text-muted);
    font-size: 1rem;
    font-family: var(--font-mono);
    padding: 0 0.1rem;
    opacity: 0.4;
}

.add-btn {
    background: var(--primary);
    color: #0e0e0e;
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.add-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.06);
}

.add-btn:active {
    transform: scale(0.96);
}

/* ── Tasks Section ──────────────────────────────────────────── */
.tasks-section {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.badge {
    background: var(--primary-dim);
    color: var(--primary);
    font-size: 0.66rem;
    font-weight: 500;
    font-family: var(--font-mono);
    padding: 0.15rem 0.6rem;
    border-radius: 100px;
    letter-spacing: 0.06em;
    border: 1px solid rgba(79, 156, 249, 0.2);
}

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 10px;
}

/* ── Task Item ──────────────────────────────────────────────── */
.task-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--item-radius);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    transition: var(--transition);
    cursor: grab;
    position: relative;
    overflow: hidden;
    flex-wrap: nowrap;
}

.task-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: transparent;
    transition: background var(--transition);
    border-radius: 10px 0 0 10px;
}

.task-item:hover::before {
    background: var(--primary);
}

.task-item:active {
    cursor: grabbing;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
}

.task-item.dragging {
    opacity: 0.4;
    transform: scale(0.97);
}

.task-item.completed::before {
    background: var(--text-muted);
    opacity: 0.3;
}

/* ── Checkbox ───────────────────────────────────────────────── */
.checkbox {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 1.5px solid var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

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

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

.checkbox svg {
    opacity: 0;
    transform: scale(0.4);
    transition: var(--transition);
    stroke: #0e0e0e;
}

.checkbox.checked svg {
    opacity: 1;
    transform: scale(1);
}

/* ── Task Content ───────────────────────────────────────────── */
.task-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.task-title {
    font-family: var(--font);
    font-size: 0.93rem;
    font-weight: 400;
    color: var(--text-main);
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.task-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    display: flex;
    gap: 0.5rem;
    letter-spacing: 0.05em;
}

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

/* ── Focus Button ───────────────────────────────────────────── */
.focus-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-size: 0.65rem;
    font-weight: 500;
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.focus-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

/* ── Delete Button ──────────────────────────────────────────── */
.delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 5px;
    transition: var(--transition);
    opacity: 0.35;
    flex-shrink: 0;
}

.task-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

/* ── Collapsible Later Section ──────────────────────────────── */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    padding: 0.4rem 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chevron {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.collapsible-section.open .chevron {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.collapsible-section.open .collapsible-content {
    max-height: 1000px;
    opacity: 1;
    margin-top: 0.8rem;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    letter-spacing: 0.02em;
}

.hidden {
    display: none !important;
}

/* ── Footer ─────────────────────────────────────────────────── */
.app-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.app-footer #motivational-quote {
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    animation: pulse 5s infinite;
}

.footer-credit {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.5;
    letter-spacing: 0.06em;
}

.footer-credit strong {
    color: var(--primary);
    font-weight: 500;
    opacity: 0.8;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 0.9; }
}

/* ── Focus Mode Overlay ─────────────────────────────────────── */
.focus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a0a;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.97);
}

.focus-overlay.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.focus-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

#focus-task-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-soft);
    max-width: 80vw;
    word-wrap: break-word;
    letter-spacing: 0.01em;
}

/* ── Timer Display ──────────────────────────────────────────── */
.timer-display {
    font-size: 9rem;
    font-weight: 400;
    font-family: var(--font-timer);
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    letter-spacing: 6px;
    line-height: 1;
}

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

@keyframes blink {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 0.1; }
}

.timer-labels {
    display: flex;
    justify-content: center;
    gap: 6.5rem;
    margin-top: -2rem;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: var(--font);
}

/* ── Focus Controls ─────────────────────────────────────────── */
.focus-controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    padding: 0.7rem 2rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: var(--font);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.control-btn.primary {
    background: var(--primary);
    color: #0e0e0e;
}

.control-btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.control-btn.secondary:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
    background: var(--bg-card);
}

.icon-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.7rem;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover,
.icon-btn.active {
    color: var(--primary);
    border-color: rgba(79, 156, 249, 0.3);
    background: var(--primary-dim);
}

/* ── Confetti ───────────────────────────────────────────────── */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    top: -10px;
    animation: fall linear forwards;
}

@keyframes fall {
    to { transform: translateY(100vh) rotate(720deg); }
}

/* ── Slide In Animation ─────────────────────────────────────── */
.slide-in {
    animation: slideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.fade-out {
    animation: fadeOut 0.25s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.95); }
}

/* ── Stats / Chart Section ──────────────────────────────────── */
.stats-section {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chart-container {
    display: flex;
    align-items: flex-end;
    gap: 1.2rem;
    height: 140px;
    padding-top: 1.5rem;
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    overflow-x: auto;
}

.bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    flex: 1;
    min-width: 36px;
}

.bar {
    width: 28px;
    background: var(--primary);
    opacity: 0.75;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity var(--transition);
    position: relative;
    height: 0%;
}

.bar:hover {
    opacity: 1;
}

.bar-label {
    font-size: 0.62rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 48px;
}

.bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--primary);
    font-weight: 500;
    white-space: nowrap;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 4px;
}

/* ── Mobile ─────────────────────────────────────────────────── */
/* ── 480px and below (standard mobile) ─────────────────────── */
@media (max-width: 480px) {
    .app-container {
        padding: 1.2rem 0.9rem 3rem;
        gap: 1.4rem;
    }

    h1 { font-size: 1.8rem; }

    .header-logo { width: 42px; height: 42px; }

    .streak-badge { padding: 0.35rem 0.55rem; }
    .streak-count { font-size: 1.3rem; }

    .mood-btn { width: 42px; height: 42px; font-size: 1.2rem; }

    .recur-cards { gap: 0.35rem; }
    .recur-card { padding: 0.45rem 0.3rem; }
    .recur-card-label { font-size: 0.56rem; }
    .recur-icon { width: 15px; height: 15px; }

    .priority-btn { padding: 0.2rem 0.5rem; font-size: 0.62rem; }

    .task-title { font-size: 0.88rem; }
    .task-meta { font-size: 0.65rem; }

    .focus-btn { font-size: 0.6rem; padding: 0.25rem 0.5rem; }
    .resume-btn { font-size: 0.6rem; }

    .timer-display { font-size: 5rem; letter-spacing: 3px; }
    .timer-labels { gap: 4.5rem; }

    .control-btn { padding: 0.6rem 1.1rem; font-size: 0.75rem; }

    .win-title { font-size: 2rem; }
    .win-icon { font-size: 3rem; }

    .social-links { gap: 0.5rem; }
    .social-btn { width: 34px; height: 34px; }
}

/* ── 320px (smallest phones like Galaxy mini) ───────────────── */
@media (max-width: 320px) {
    .app-container {
        padding: 1rem 0.7rem 2.5rem;
        gap: 1.1rem;
    }

    h1 { font-size: 1.5rem; }
    h3 { font-size: 0.78rem; }

    .header-logo { width: 36px; height: 36px; border-radius: 8px; }
    .header-brand { gap: 0.6rem; }
    .streak-badge { padding: 0.3rem 0.45rem; }
    .streak-count { font-size: 1.1rem; }
    .streak-label { font-size: 0.46rem; }

    .mood-btn { width: 38px; height: 38px; font-size: 1.1rem; }
    .mood-options { gap: 0.5rem; }
    .mood-selector p { font-size: 0.7rem; }

    .glass-panel { padding: 1rem 0.85rem; }

    #task-title { font-size: 0.88rem; }
    .task-title-input-wrap { padding: 0.55rem 0.8rem; }
    .task-title-label { font-size: 0.52rem; }

    .priority-row, .recur-row { gap: 0.5rem; }
    .priority-label { font-size: 0.6rem; }
    .priority-btn { padding: 0.18rem 0.4rem; font-size: 0.58rem; }

    .recur-cards { gap: 0.25rem; }
    .recur-card { padding: 0.4rem 0.2rem; }
    .recur-card-label { font-size: 0.5rem; }
    .recur-icon { width: 13px; height: 13px; }

    .time-inputs { padding: 0.3rem 0.6rem; gap: 0.3rem; }
    .time-field input { width: 26px; font-size: 0.8rem; }
    .time-field span { font-size: 0.62rem; }
    .spin-btn { font-size: 0.4rem; padding: 1px 3px; }

    .add-btn { width: 34px; height: 34px; }

    .task-item { padding: 0.7rem 0.75rem; gap: 0.6rem; }
    .task-title { font-size: 0.83rem; }
    .task-meta { font-size: 0.62rem; }
    .checkbox { width: 18px; height: 18px; }

    .priority-badge, .recur-badge { font-size: 0.52rem; padding: 0.08rem 0.35rem; }

    .focus-btn { font-size: 0.55rem; padding: 0.22rem 0.45rem; }
    .note-btn svg { width: 12px; height: 12px; }
    .delete-btn svg { width: 13px; height: 13px; }

    .badge { font-size: 0.6rem; padding: 0.12rem 0.5rem; }

    .timer-display { font-size: 4.2rem; letter-spacing: 2px; }
    .timer-labels { gap: 3.8rem; font-size: 0.55rem; }
    #focus-task-title { font-size: 1.1rem; }
    .focus-task-note { font-size: 0.75rem; max-width: 90vw; }

    .control-btn { padding: 0.5rem 0.9rem; font-size: 0.7rem; }
    .focus-controls { gap: 0.6rem; }

    .win-title { font-size: 1.7rem; }
    .win-icon { font-size: 2.5rem; }
    .win-task-name { font-size: 0.88rem; }
    .win-sub { font-size: 0.72rem; }

    .social-btn { width: 30px; height: 30px; border-radius: 8px; }
    .social-links { gap: 0.4rem; }

    .footer-credit { font-size: 0.65rem; }
    .app-footer #motivational-quote { font-size: 0.72rem; }

    h2 { font-size: 0.65rem; }
    .section-header { gap: 0.5rem; }
}

/* ── Priority Selector ──────────────────────────────────────── */
.priority-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.priority-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.priority-options {
    display: flex;
    gap: 0.4rem;
}

.priority-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    font-size: 0.68rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.priority-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-soft);
}

.priority-btn[data-priority="low"].active {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.35);
    color: #4ade80;
}

.priority-btn[data-priority="medium"].active {
    background: rgba(79, 156, 249, 0.1);
    border-color: rgba(79, 156, 249, 0.35);
    color: var(--primary);
}

.priority-btn[data-priority="high"].active {
    background: rgba(224, 95, 58, 0.1);
    border-color: rgba(224, 95, 58, 0.35);
    color: var(--accent);
}

/* ── Priority Badge on Task Cards ───────────────────────────── */
.task-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.priority-badge {
    font-size: 0.58rem;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: var(--transition);
    flex-shrink: 0;
}

.priority-badge.priority-low {
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    opacity: 0.6;
}

.priority-badge.priority-medium {
    background: rgba(79, 156, 249, 0.08);
    border-color: rgba(79, 156, 249, 0.2);
    color: var(--primary);
    opacity: 0.6;
}

.priority-badge.priority-high {
    background: rgba(224, 95, 58, 0.08);
    border-color: rgba(224, 95, 58, 0.2);
    color: var(--accent);
    opacity: 0.6;
}

/* Glows when it matches the current mood */
.priority-badge.priority-match {
    opacity: 1;
    box-shadow: 0 0 8px currentColor;
}

/* Mood-matched tasks get a subtle left border highlight */
.task-item.mood-match::before {
    background: var(--primary) !important;
    opacity: 1;
}

/* ── Win Screen ─────────────────────────────────────────────── */
.win-screen {
    animation: winPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes winPop {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.win-icon {
    font-size: 4rem;
    color: var(--primary);
    animation: winSpin 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    display: block;
    line-height: 1;
}

@keyframes winSpin {
    from { transform: scale(0) rotate(-180deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg);    opacity: 1; }
}

.win-title {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.win-task-name {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-soft);
    max-width: 80vw;
    text-align: center;
    letter-spacing: 0.01em;
}

.win-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    font-style: italic;
}

/* ── Social Links ────────────────────────────────────────────── */
.social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1rem;
}

.social-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}

.social-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
    transform: translateY(-3px);
}

.social-btn[title="Facebook"]:hover  { border-color: #1877f2; color: #1877f2; background: rgba(24,119,242,0.08); }
.social-btn[title="Instagram"]:hover { border-color: #e1306c; color: #e1306c; background: rgba(225,48,108,0.08); }
.social-btn[title="GitHub"]:hover    { border-color: #f0ede6; color: #f0ede6; background: rgba(240,237,230,0.08); }
.social-btn[title="LinkedIn"]:hover  { border-color: #0a66c2; color: #0a66c2; background: rgba(10,102,194,0.08); }

/* ── Recurrence Selector ────────────────────────────────────── */
.recur-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.recur-cards {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.recur-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.55rem 0.4rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.recur-card:hover {
    border-color: var(--border-hover);
    color: var(--text-soft);
    background: rgba(255,255,255,0.03);
    transform: translateY(-1px);
}

.recur-card.active {
    background: rgba(99, 211, 242, 0.08);
    border-color: rgba(99, 211, 242, 0.4);
    color: #63d3f2;
}

.recur-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.recur-card-label {
    font-size: 0.62rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Recur Badge on Task Cards ──────────────────────────────── */
.recur-badge {
    font-size: 0.58rem;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.08em;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(99, 211, 242, 0.25);
    background: rgba(99, 211, 242, 0.08);
    color: #63d3f2;
    flex-shrink: 0;
}

.recur-badge.recur-weekly {
    border-color: rgba(167, 139, 250, 0.25);
    background: rgba(167, 139, 250, 0.08);
    color: #a78bfa;
}

/* ── Finish Button ───────────────────────────────────────────── */
.control-btn.finish {
    background: transparent;
    border: 1px solid rgba(74, 222, 128, 0.35);
    color: #4ade80;
}

.control-btn.finish:hover {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.6);
    transform: translateY(-1px);
}

/* ── Win Time Spent ──────────────────────────────────────────── */
.win-time-spent {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: #4ade80;
    letter-spacing: 0.06em;
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 8px;
    padding: 0.4rem 1rem;
}

/* ── Resume Button on Task Card ─────────────────────────────── */
.resume-btn {
    background: rgba(79, 156, 249, 0.08) !important;
    border-color: rgba(79, 156, 249, 0.4) !important;
    color: var(--primary) !important;
    animation: resumePulse 2s ease-in-out infinite;
}

.resume-btn:hover {
    background: rgba(79, 156, 249, 0.18) !important;
    border-color: var(--primary) !important;
}

@keyframes resumePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(79, 156, 249, 0); }
    50%       { box-shadow: 0 0 0 4px rgba(79, 156, 249, 0.12); }
}

/* ── Deprioritised tasks (low priority on low/normal mood) ──── */
.task-item.deprioritised {
    opacity: 0.38;
    filter: saturate(0.4);
}

.task-item.deprioritised:hover {
    opacity: 0.6;
    filter: saturate(0.7);
}

.task-item.deprioritised .focus-btn {
    opacity: 0.5;
}

/* ── Focus Button Group (Resume + Restart) ──────────────────── */
.focus-btn-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.restart-btn {
    background: transparent !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
    padding: 0.3rem 0.5rem !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: var(--transition);
    animation: none !important;
    box-shadow: none !important;
}

.restart-btn:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background: var(--accent-dim) !important;
    transform: rotate(-20deg);
}

/* ── Midnight Toast ──────────────────────────────────────────── */
.midnight-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(20, 20, 28, 0.95);
    border: 1px solid rgba(79, 156, 249, 0.25);
    border-radius: 14px;
    padding: 0.9rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    min-width: 240px;
}

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

.midnight-toast-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.midnight-toast strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    font-family: var(--font-heading);
    letter-spacing: 0.01em;
}

.midnight-toast p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
    letter-spacing: 0.02em;
}

/* ── Daily Streak Badge ──────────────────────────────────────── */
.streak-badge {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(79, 156, 249, 0.06);
    border: 1px solid rgba(79, 156, 249, 0.2);
    border-radius: 12px;
    padding: 0.45rem 0.75rem;
    gap: 0.05rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.streak-badge.streak-zero {
    opacity: 0.35;
    border-color: var(--border);
    background: transparent;
}

.streak-badge.streak-hot {
    border-color: rgba(79, 156, 249, 0.5);
    background: rgba(79, 156, 249, 0.1);
    box-shadow: 0 0 16px rgba(79, 156, 249, 0.12);
}

.streak-fire {
    font-size: 1.2rem;
    line-height: 1;
    animation: flamePulse 2s ease-in-out infinite;
}

.streak-badge.streak-zero .streak-fire {
    animation: none;
    filter: grayscale(1);
}

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

.streak-count {
    font-family: var(--font-timer);
    font-size: 1.6rem;
    color: var(--primary);
    line-height: 1;
    letter-spacing: 1px;
}

.streak-badge.streak-zero .streak-count {
    color: var(--text-muted);
}

.streak-label {
    font-size: 0.52rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ── Task Note ───────────────────────────────────────────────── */
.note-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 5px;
    transition: var(--transition);
    opacity: 0.45;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-item:hover .note-btn {
    opacity: 1;
}

.note-btn:hover {
    color: var(--primary);
    background: var(--primary-dim);
}

.note-btn.note-btn-active {
    opacity: 1;
    color: var(--primary);
}

.task-note-area {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    animation: slideIn 0.2s ease forwards;
}

.task-note-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(79, 156, 249, 0.2);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 0.5rem 0.7rem;
    resize: none;
    outline: none;
    min-height: 60px;
    max-height: 140px;
    transition: border-color var(--transition);
    letter-spacing: 0.01em;
}

.task-note-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.task-note-input:focus {
    border-color: rgba(79, 156, 249, 0.45);
}

.note-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note-char-count {
    font-size: 0.6rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-right: auto;
    letter-spacing: 0.04em;
}

.note-save-btn,
.note-delete-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.65rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    transition: var(--transition);
}

.note-save-btn {
    color: var(--primary);
    border-color: rgba(79, 156, 249, 0.3);
}

.note-save-btn:hover {
    background: var(--primary-dim);
    border-color: rgba(79, 156, 249, 0.5);
}

.note-delete-btn {
    color: var(--accent);
    border-color: rgba(224, 95, 58, 0.25);
}

.note-delete-btn:hover {
    background: var(--accent-dim);
    border-color: rgba(224, 95, 58, 0.45);
}

/* ── Note Preview (visible under task meta) ─────────────────── */
.task-note-preview {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: 0.01em;
    line-height: 1.4;
    cursor: pointer;
    padding: 0.15rem 0;
    border-left: 2px solid rgba(79, 156, 249, 0.3);
    padding-left: 0.5rem;
    margin-top: 0.1rem;
    transition: color var(--transition), border-color var(--transition);
}

.task-note-preview:hover {
    color: var(--text-soft);
    border-left-color: var(--primary);
}

/* ── Note in Focus Overlay ──────────────────────────────────── */
.focus-task-note {
    font-family: var(--font);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-soft);
    max-width: 75vw;
    text-align: center;
    line-height: 1.6;
    letter-spacing: 0.02em;
    border: 1px solid rgba(79, 156, 249, 0.2);
    border-left: 3px solid rgba(79, 156, 249, 0.5);
    padding: 0.6rem 1rem;
    border-radius: 0 8px 8px 0;
    background: rgba(79, 156, 249, 0.05);
}

/* ── Note Preview Row with Edit Button ──────────────────────── */
.task-note-preview-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.task-note-preview {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: 0.01em;
    line-height: 1.4;
    border-left: 2px solid rgba(79, 156, 249, 0.3);
    padding-left: 0.5rem;
    flex: 1;
}

.note-edit-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.7;
}

.task-item:hover .note-edit-btn {
    opacity: 1;
}

.note-edit-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

/* Delete button in note actions */
.note-delete-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.note-delete-btn:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background: var(--accent-dim) !important;
}

/* ── Note Preview Action Buttons ────────────────────────────── */
.note-preview-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.5;
    transition: opacity var(--transition);
    flex-shrink: 0;
}

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

.note-delete-preview-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.note-delete-preview-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* Cancel button in note editor */
.note-cancel-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.65rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.note-cancel-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
}

/* ── Mobile touch — always show action buttons (no hover on touch) ── */
@media (hover: none) and (pointer: coarse) {
    .note-btn,
    .note-edit-btn,
    .note-preview-actions,
    .delete-btn {
        opacity: 1 !important;
    }

    .note-btn {
        color: var(--text-muted);
    }

    .delete-btn {
        color: rgba(239, 68, 68, 0.5);
    }
}

/* ── Task Actions Column ─────────────────────────────────────── */
.task-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    flex-shrink: 0;
}

.task-icon-actions {
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

/* On mobile always show icon actions */
@media (max-width: 600px) {
    .task-actions {
        gap: 0.3rem;
    }
    .note-btn,
    .delete-btn {
        opacity: 1 !important;
    }
}

/* ── Chart legend ────────────────────────────────────────────── */
.chart-legend {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-left: auto;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-today    { background: var(--primary); }
.legend-yesterday { background: rgba(168, 164, 158, 0.5); }

.legend-text {
    font-size: 0.62rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ── Chart divider label ─────────────────────────────────────── */
.chart-divider {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.55rem;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.5;
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 0.2rem;
    border-right: 1px solid var(--border);
    margin-right: 0.3rem;
}

/* ── Yesterday bars — muted grey ────────────────────────────── */
.bar-yesterday {
    background: rgba(168, 164, 158, 0.35) !important;
    box-shadow: none !important;
}

.bar-yesterday:hover {
    background: rgba(168, 164, 158, 0.55) !important;
}

.bar-yesterday .bar-value {
    color: var(--text-muted) !important;
}

/* ── Session Selector ───────────────────────────────────────── */
.session-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.session-options {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.session-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0.25rem 0.6rem;
    font-size: 0.65rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.session-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-soft);
}

.session-btn.active[data-session="none"]    { border-color: rgba(255,255,255,0.2); color: var(--text-soft); background: rgba(255,255,255,0.05); }
.session-btn.active[data-session="morning"] { border-color: rgba(79,156,249,0.4);  color: #4f9cf9; background: rgba(79,156,249,0.08); }
.session-btn.active[data-session="noon"]    { border-color: rgba(251,146,60,0.4);  color: #fb923c; background: rgba(251,146,60,0.08); }
.session-btn.active[data-session="night"]   { border-color: rgba(139,92,246,0.4);  color: #8b5cf6; background: rgba(139,92,246,0.08); }

/* ── Session Badge on Task Card ─────────────────────────────── */
.session-badge {
    font-size: 0.58rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.session-badge.session-morning { background: rgba(79,156,249,0.08);  border-color: rgba(79,156,249,0.25);  color: #4f9cf9; }
.session-badge.session-noon    { background: rgba(251,146,60,0.08);  border-color: rgba(251,146,60,0.25);  color: #fb923c; }
.session-badge.session-night   { background: rgba(139,92,246,0.08);  border-color: rgba(139,92,246,0.25);  color: #8b5cf6; }

/* ── Session Toast ──────────────────────────────────────────── */
.session-toast {
    border-color: rgba(139, 92, 246, 0.3);
}

/* ── Schedule Time Row ──────────────────────────────────────── */
.schedule-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.schedule-time-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.3rem 0.7rem;
    transition: border-color var(--transition);
    color: var(--text-muted);
}

.schedule-time-wrap:focus-within {
    border-color: rgba(79,156,249,0.4);
    color: var(--primary);
}

.schedule-time-input {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-main);
    cursor: pointer;
    width: 90px;
}

.schedule-time-input::-webkit-calendar-picker-indicator {
    filter: invert(0.6);
    cursor: pointer;
}

.schedule-time-input:not([value=""]):not(:placeholder-shown) {
    color: var(--text-main);
}

.schedule-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0;
    transition: color var(--transition);
    line-height: 1;
}

.schedule-clear-btn:hover { color: var(--accent); }

/* ── Schedule Badge on Task Card ────────────────────────────── */
.schedule-badge {
    font-size: 0.58rem;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(79,156,249,0.2);
    background: rgba(79,156,249,0.06);
    color: var(--primary);
    flex-shrink: 0;
}

/* ── Schedule placeholder ───────────────────────────────────── */
.schedule-placeholder {
    font-size: 0.78rem;
    font-family: var(--font);
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: 0.02em;
}

/* ── Schedule 12hr Spinner ──────────────────────────────────── */
.sch-clock-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.sch-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.sch-input {
    width: 28px;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 500;
    outline: none;
    -moz-appearance: textfield;
}

.sch-input::-webkit-outer-spin-button,
.sch-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.sch-sep {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    opacity: 0.5;
    align-self: center;
    padding: 0 1px;
    margin-top: 2px;
}

.ampm-toggle-btn {
    background: rgba(79,156,249,0.08);
    border: 1px solid rgba(79,156,249,0.25);
    border-radius: 6px;
    color: var(--primary);
    font-size: 0.65rem;
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    transition: var(--transition);
    align-self: center;
}

.ampm-toggle-btn.ampm-pm {
    background: rgba(139,92,246,0.1);
    border-color: rgba(139,92,246,0.3);
    color: #8b5cf6;
}

.ampm-toggle-btn:hover { opacity: 0.8; }

/* ── Session Banner (Today's Plan) ──────────────────────────── */
.session-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.session-banner.session-banner-morning {
    border-color: rgba(79,156,249,0.3);
    background: rgba(79,156,249,0.06);
}
.session-banner.session-banner-noon {
    border-color: rgba(251,146,60,0.3);
    background: rgba(251,146,60,0.06);
}
.session-banner.session-banner-night {
    border-color: rgba(139,92,246,0.3);
    background: rgba(139,92,246,0.06);
}

.session-banner-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.session-banner-emoji {
    font-size: 1.4rem;
    line-height: 1;
}

.session-banner-name {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.session-banner-time {
    display: block;
    font-size: 0.62rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    margin-top: 0.1rem;
}

.session-banner-countdown {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    letter-spacing: 0.04em;
}

/* ── Focus Overlay Meta Chips ───────────────────────────────── */
.focus-task-meta-info {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: -1rem;
}

.focus-meta-chip {
    font-size: 0.72rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text-soft);
}

/* ── Days Picker ─────────────────────────────────────────────── */
.days-picker {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    padding-left: 0.1rem;
}

.days-picker.hidden { display: none; }

.day-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.2rem 0.45rem;
    font-size: 0.62rem;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
}

.day-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-soft);
}

.day-btn.active {
    background: rgba(99,211,242,0.1);
    border-color: rgba(99,211,242,0.4);
    color: #63d3f2;
}

/* ── Days Badge on Task Card ────────────────────────────────── */
.days-badge {
    font-size: 0.56rem;
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
    padding: 0.08rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(99,211,242,0.2);
    background: rgba(99,211,242,0.06);
    color: #63d3f2;
    flex-shrink: 0;
}

/* ── Weekly Target FAB ──────────────────────────────────────── */
.weekly-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.2rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: rgba(22,22,22,0.96);
    border: 1px solid rgba(79,156,249,0.35);
    border-radius: 14px;
    padding: 0.6rem 0.8rem;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.weekly-fab:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.weekly-fab-label {
    font-size: 0.55rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Weekly Panel ───────────────────────────────────────────── */
.weekly-panel {
    position: fixed;
    bottom: 5.8rem;
    right: 1.2rem;
    z-index: 9000;
    width: min(310px, calc(100vw - 2rem));
    max-height: 75vh;
    overflow-y: auto;
    background: #161616;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    flex-direction: column;
    display: none;
}

.weekly-panel[data-open="true"] {
    display: flex;
}

.weekly-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem 0.7rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: #161616;
    z-index: 1;
}

.weekly-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--primary);
    letter-spacing: 0.02em;
}

.weekly-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.2rem;
    transition: color var(--transition);
}
.weekly-close-btn:hover { color: var(--text-main); }

/* ── Day tracker ────────────────────────────────────────────── */
.weekly-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.3rem;
    padding: 0.9rem 0.8rem;
    border-bottom: 1px solid var(--border);
}

.weekly-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem 0.2rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.weekly-day-name {
    font-size: 0.5rem;
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.weekly-day-num {
    font-size: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-soft);
}

.weekly-day-icon {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.weekly-day-today {
    border-color: rgba(79,156,249,0.3);
    background: rgba(79,156,249,0.06);
}
.weekly-day-today .weekly-day-num { color: var(--primary); }
.weekly-day-today .weekly-day-name { color: var(--primary); opacity: 0.7; }

.weekly-day-done {
    border-color: rgba(74,222,128,0.3);
    background: rgba(74,222,128,0.06);
}
.weekly-day-done .weekly-day-icon { color: #4ade80; }
.weekly-day-done .weekly-day-num  { color: #4ade80; }

.weekly-day-missed .weekly-day-num  { color: var(--text-muted); opacity: 0.5; }
.weekly-day-missed .weekly-day-icon { opacity: 0.3; }

/* ── Weekly Targets ─────────────────────────────────────────── */
.weekly-targets { padding: 0.8rem; }

.weekly-targets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.weekly-section-label {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.weekly-add-btn {
    background: var(--primary-dim);
    border: 1px solid rgba(79,156,249,0.25);
    border-radius: 6px;
    color: var(--primary);
    font-size: 0.62rem;
    font-family: var(--font);
    font-weight: 500;
    padding: 0.2rem 0.55rem;
    cursor: pointer;
    transition: var(--transition);
}
.weekly-add-btn:hover { background: rgba(79,156,249,0.18); }

.weekly-add-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem;
}
.weekly-add-form.hidden { display: none; }

#weekly-target-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.82rem;
    width: 100%;
}
#weekly-target-input::placeholder { color: var(--text-muted); font-style: italic; }

.weekly-form-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }

.weekly-save-btn {
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: #0e0e0e;
    font-size: 0.62rem;
    font-weight: 600;
    font-family: var(--font);
    padding: 0.22rem 0.65rem;
    cursor: pointer;
    transition: var(--transition);
}
.weekly-save-btn:hover { background: var(--primary-hover); }

.weekly-cancel-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-family: var(--font);
    padding: 0.22rem 0.65rem;
    cursor: pointer;
    transition: var(--transition);
}

.weekly-target-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.weekly-empty {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 0.5rem 0;
}

.weekly-target-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    transition: var(--transition);
}

.weekly-target-item:hover { border-color: var(--border-hover); }

.weekly-target-check {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--text-muted);
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.weekly-target-check:hover { border-color: var(--primary); }
.weekly-target-check.checked { background: var(--primary); border-color: var(--primary); }
.weekly-target-check svg { opacity: 0; transition: opacity 0.15s; stroke: #0e0e0e; }
.weekly-target-check.checked svg { opacity: 1; }

.weekly-target-text {
    flex: 1;
    font-size: 0.78rem;
    color: var(--text-main);
    line-height: 1.4;
}

.weekly-target-done .weekly-target-text {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.6;
}

.weekly-target-del {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    transition: var(--transition);
    opacity: 0;
    flex-shrink: 0;
}
.weekly-target-item:hover .weekly-target-del { opacity: 1; }
.weekly-target-del:hover { color: var(--accent); }

/* Mobile: show del always */
@media (hover: none) { .weekly-target-del { opacity: 0.6; } }

/* Mobile adjustments */
@media (max-width: 480px) {
    .weekly-panel { width: calc(100vw - 2rem); right: 1rem; bottom: 5.5rem; z-index: 9000; }
    .weekly-fab   { bottom: 1rem; right: 1rem; z-index: 9001; }
}

/* ── Pick Tasks Button ──────────────────────────────────────── */
.pick-tasks-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    transition: var(--transition);
}

.pick-tasks-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

/* ── Pick Sheet Overlay ─────────────────────────────────────── */
.pick-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.pick-sheet-overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.pick-sheet {
    background: #161616;
    border: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: sheetUp 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
    overflow: hidden;
}

@keyframes sheetUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.pick-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.2rem 0.6rem;
    border-bottom: 1px solid var(--border);
}

.pick-sheet-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--primary);
}

.pick-sheet-close {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 0.85rem; padding: 0.2rem;
    transition: color var(--transition);
}
.pick-sheet-close:hover { color: var(--text-main); }

.pick-sheet-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 0.5rem 1.2rem 0;
    letter-spacing: 0.01em;
}

.pick-sheet-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.7rem 1rem 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    color: var(--text-muted);
    transition: border-color var(--transition);
}
.pick-sheet-search:focus-within { border-color: rgba(79,156,249,0.35); }

#pick-search {
    background: transparent; border: none; outline: none;
    color: var(--text-main); font-family: var(--font);
    font-size: 0.82rem; flex: 1;
}
#pick-search::placeholder { color: var(--text-muted); }

/* ── Pick List ──────────────────────────────────────────────── */
.pick-list {
    list-style: none;
    overflow-y: auto;
    padding: 0.7rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.pick-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.pick-empty strong {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-soft);
    font-style: normal;
}
.pick-empty span {
    font-size: 0.72rem;
    font-style: italic;
    opacity: 0.7;
    max-width: 220px;
}

.pick-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    transition: var(--transition);
}

.pick-item:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.04); }

.pick-item-selected {
    border-color: rgba(79,156,249,0.4);
    background: rgba(79,156,249,0.06);
}

.pick-check {
    width: 18px; height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--text-muted);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.pick-check.checked { background: var(--primary); border-color: var(--primary); }
.pick-check svg { opacity: 0; transition: opacity 0.15s; stroke: #0e0e0e; }
.pick-check.checked svg { opacity: 1; }

.pick-item-info { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }

.pick-item-title {
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.pick-item-meta {
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
}

.pick-item-time {
    font-size: 0.62rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

/* ── Sheet Footer ───────────────────────────────────────────── */
.pick-sheet-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem;
    border-top: 1px solid var(--border);
    background: #161616;
}

.pick-selected-count {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.pick-confirm-btn {
    background: var(--primary);
    border: none; border-radius: 8px;
    color: #0e0e0e;
    font-size: 0.75rem;
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.55rem 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}
.pick-confirm-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

/* ── Flash on newly added tasks ─────────────────────────────── */
@keyframes pickAddedFlash {
    0%   { background: rgba(79,156,249,0.15); border-color: rgba(79,156,249,0.5); }
    100% { background: var(--bg-surface); border-color: var(--border); }
}
.task-item.pick-added {
    animation: pickAddedFlash 1.5s ease forwards;
}

/* ── Task Library ("Tasks" section) ─────────────────────────── */
.library-list {
    gap: 0.5rem;
}

.library-item {
    cursor: default;
}

.library-add-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.library-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

.library-add-btn.added {
    border-color: rgba(74,222,128,0.35);
    color: #4ade80;
    background: rgba(74,222,128,0.08);
    cursor: default;
}

.library-add-btn.added:hover {
    border-color: rgba(74,222,128,0.35);
    color: #4ade80;
    background: rgba(74,222,128,0.08);
}

.library-delete-btn {
    opacity: 0.35;
}

.library-item:hover .library-delete-btn {
    opacity: 1;
}

@media (hover: none) {
    .library-delete-btn { opacity: 0.6; }
}

/* ── My Routine Card ────────────────────────────────────────── */
.routine-card {
    position: fixed;
    top: 2rem;
    left: max(1rem, calc(50vw - 680px));
    width: 260px;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    background: rgba(8,12,28,0.97);
    border: 1px solid rgba(79,156,249,0.18);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 80;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Hide on narrow screens — show only when enough room beside app */


.routine-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem 0.7rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    position: sticky;
    top: 0;
    background: rgba(8,12,28,0.97);
    z-index: 1;
}

.routine-add-fab {
    margin-left: auto;
    background: rgba(79,156,249,0.1);
    border: 1px solid rgba(79,156,249,0.25);
    border-radius: 6px;
    color: var(--primary);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.routine-add-fab:hover { background: rgba(79,156,249,0.2); }

.routine-list {
    list-style: none;
    padding: 0.4rem 0;
    flex: 1;
}

.routine-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    border-left: 2px solid transparent;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.routine-item:hover { background: rgba(255,255,255,0.03); }

.routine-item.routine-current {
    border-left-color: var(--primary);
    background: rgba(79,156,249,0.07);
}
.routine-item.routine-past { opacity: 0.45; }
.routine-item.routine-done .routine-activity { text-decoration: line-through; opacity: 0.5; }

.routine-time-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 62px;
}
.routine-time {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}
.routine-current .routine-time { color: var(--primary); }
.routine-dur {
    font-size: 0.56rem;
    color: var(--text-muted);
    opacity: 0.6;
    font-family: var(--font-mono);
    letter-spacing: 0.03em;
}

.routine-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.routine-activity {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.routine-current .routine-activity { color: var(--primary); font-weight: 600; }
.routine-details {
    font-size: 0.62rem;
    color: var(--text-muted);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.routine-actions { flex-shrink: 0; }

.routine-check {
    width: 16px; height: 16px;
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.routine-check:hover { border-color: var(--primary); }
.routine-check.checked { background: var(--primary); border-color: var(--primary); }
.routine-check svg { opacity: 0; stroke: #0e0e0e; }
.routine-check.checked svg { opacity: 1; }

.routine-empty {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 1.2rem 1rem;
    line-height: 1.6;
}
.routine-add-bottom {
    width: 28px; height: 28px;
    margin: 0.4rem auto 0.7rem;
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 50%;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.routine-add-bottom:hover { border-color: var(--primary); color: var(--primary); background: rgba(79,156,249,0.06); }

/* ── Routine Modal ──────────────────────────────────────────── */
.routine-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.18s ease;
}
.routine-modal-overlay.hidden { display: none; }

.routine-modal {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    width: min(380px, calc(100vw - 2rem));
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    animation: sheetUp 0.22s cubic-bezier(0.34,1.56,0.64,1) forwards;
    overflow: hidden;
}
.routine-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--primary);
}
.routine-modal-close {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 0.85rem; padding: 0.2rem;
    transition: color var(--transition);
}
.routine-modal-close:hover { color: var(--text-main); }

.routine-modal-body {
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.routine-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.routine-field label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.routine-optional {
    font-weight: 400;
    text-transform: none;
    opacity: 0.6;
    letter-spacing: 0;
}
.routine-time-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    transition: border-color var(--transition);
}
.routine-time-wrap:focus-within { border-color: rgba(79,156,249,0.35); }

.routine-field input[type="text"],
.routine-field textarea {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition);
    resize: none;
    width: 100%;
    box-sizing: border-box;
}
.routine-field input[type="text"]:focus,
.routine-field textarea:focus { border-color: rgba(79,156,249,0.4); }
.routine-field input::placeholder,
.routine-field textarea::placeholder { color: var(--text-muted); font-style: italic; }

.routine-duration-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.routine-dur-input {
    width: 52px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0.45rem 0.5rem;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    text-align: center;
    -moz-appearance: textfield;
    transition: border-color var(--transition);
}
.routine-dur-input::-webkit-outer-spin-button,
.routine-dur-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.routine-dur-input:focus { border-color: rgba(79,156,249,0.35); }
.routine-dur-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-right: 0.3rem;
}

.routine-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.routine-save-btn {
    background: var(--primary);
    border: none; border-radius: 8px;
    color: #0e0e0e;
    font-size: 0.8rem; font-weight: 600;
    font-family: var(--font);
    padding: 0.5rem 1.3rem;
    cursor: pointer;
    transition: var(--transition);
}
.routine-save-btn:hover { opacity: 0.88; }
.routine-delete-btn {
    background: rgba(224,95,58,0.1);
    border: 1px solid rgba(224,95,58,0.3);
    border-radius: 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-family: var(--font);
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    margin-right: auto;
}
.routine-delete-btn:hover { background: rgba(224,95,58,0.2); }
.routine-delete-btn.hidden { display: none; }

/* ── Routine Start/End Time Row ─────────────────────────────── */
.routine-times-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}
.routine-field-half { flex: 1; min-width: 0; }
.routine-times-arrow {
    color: var(--text-muted);
    font-size: 1rem;
    padding-bottom: 0.35rem;
    flex-shrink: 0;
}

/* Auto-duration display pill */
.routine-duration-display {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(79,156,249,0.07);
    border: 1px solid rgba(79,156,249,0.2);
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    color: var(--primary);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* End time in routine list card */
.routine-end-time {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--text-muted);
    opacity: 0.7;
    letter-spacing: 0.03em;
}

/* ── Session FAB ─────────────────────────────────────────────── */
.session-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 5.5rem; /* left of weekly-fab */
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: rgba(22,22,22,0.96);
    border: 1px solid rgba(99,211,242,0.35);
    border-radius: 14px;
    padding: 0.6rem 0.8rem;
    color: #63d3f2;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.session-fab:hover { border-color: #63d3f2; transform: translateY(-2px); }
.session-fab-label {
    font-size: 0.55rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Session Panel ───────────────────────────────────────────── */
.session-panel {
    position: fixed;
    bottom: 5.8rem;
    right: 5.5rem;
    z-index: 9000;
    width: min(310px, calc(100vw - 2rem));
    max-height: 75vh;
    overflow-y: auto;
    background: #161616;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    flex-direction: column;
    padding: 0 0 0.8rem;
    display: none;
}

.session-panel[data-open="true"] {
    display: flex;
}

.session-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: sticky; top: 0;
    background: #161616; z-index: 1;
}
.session-panel-title {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.72rem; font-weight: 600;
    font-family: var(--font-heading);
    color: #63d3f2; letter-spacing: 0.04em;
    text-transform: uppercase;
}
.session-panel-close {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 0.78rem; transition: color var(--transition);
}
.session-panel-close:hover { color: var(--text-main); }

.session-panel-hint {
    font-size: 0.66rem;
    color: var(--text-muted);
    padding: 0.4rem 1rem 0.1rem;
    font-style: italic;
}

/* Active indicator bar */
.session-active-indicator {
    display: none;
    align-items: center;
    gap: 0.45rem;
    margin: 0.5rem 1rem;
    padding: 0.4rem 0.7rem;
    background: rgba(99,211,242,0.07);
    border: 1px solid rgba(99,211,242,0.2);
    border-radius: 8px;
    font-size: 0.68rem;
    color: #63d3f2;
    font-family: var(--font-mono);
}
.s-active-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #63d3f2;
    box-shadow: 0 0 6px #63d3f2;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

/* Session row items */
.session-row-item {
    margin: 0.35rem 0.8rem 0;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}
.session-row-morning { border-color: rgba(79,156,249,0.15); }
.session-row-noon    { border-color: rgba(251,146,60,0.15); }
.session-row-night   { border-color: rgba(139,92,246,0.15); }

.session-row-top {
    display: flex; align-items: center; gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.session-row-emoji { font-size: 0.95rem; }
.session-row-name {
    font-size: 0.72rem; font-weight: 600;
    font-family: var(--font-heading);
    color: var(--text-main); letter-spacing: 0.03em;
}
.session-row-active-badge {
    margin-left: auto;
    font-size: 0.55rem; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    background: rgba(99,211,242,0.15);
    border: 1px solid rgba(99,211,242,0.3);
    border-radius: 4px; padding: 0.1rem 0.4rem;
    color: #63d3f2;
}
.session-row-active-badge.hidden { display: none; }

.session-row-times {
    display: flex; align-items: center; gap: 0.4rem;
}
.session-mini-picker {
    display: flex; align-items: center; gap: 0.18rem;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px;
    padding: 0.22rem 0.4rem;
}
.s-inp {
    width: 22px; text-align: center;
    background: transparent; border: none; outline: none;
    color: var(--text-main);
    font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
    -moz-appearance: textfield;
}
.s-inp::-webkit-outer-spin-button,
.s-inp::-webkit-inner-spin-button { -webkit-appearance: none; }
.s-colon { color: var(--text-muted); font-size: 0.78rem; }
.s-ampm {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 0.58rem; font-weight: 600;
    font-family: var(--font);
    color: var(--text-muted);
    padding: 0.08rem 0.3rem;
    cursor: pointer;
    transition: var(--transition);
}
.s-ampm.s-ampm-pm {
    background: rgba(139,92,246,0.12);
    border-color: rgba(139,92,246,0.3);
    color: #a78bfa;
}
.s-ampm:not(.s-ampm-pm) {
    background: rgba(79,156,249,0.1);
    border-color: rgba(79,156,249,0.25);
    color: #4f9cf9;
}
.s-arrow {
    color: var(--text-muted); font-size: 0.75rem;
    flex-shrink: 0;
}

.session-panel-save {
    margin: 0.85rem 0.8rem 0;
    padding: 0.55rem 0;
    width: calc(100% - 1.6rem);
    background: rgba(99,211,242,0.1);
    border: 1px solid rgba(99,211,242,0.3);
    border-radius: 8px;
    color: #63d3f2;
    font-size: 0.75rem; font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.04em;
}
.session-panel-save:hover { background: rgba(99,211,242,0.18); }

/* Mobile */
@media (max-width: 480px) {
    .session-fab   { bottom: 1rem; right: 5rem; }
    .session-panel { right: 1rem; bottom: 5.5rem; width: calc(100vw - 2rem); }
}

/* ── Favorite Quote Card ─────────────────────────────────────── */
.quote-card {
    position: fixed;
    bottom: 1.5rem;
    left: max(1rem, calc(50vw - 680px));
    width: 240px;
    background: rgba(8,12,28,0.97);
    border: 1px solid rgba(79,156,249,0.15);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 80;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
}


.quote-card-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.85rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
}
.quote-edit-btn {
    margin-left: auto;
    background: none; border: none;
    color: var(--text-muted);
    cursor: pointer; padding: 0.15rem;
    display: flex; align-items: center;
    transition: color var(--transition);
}
.quote-edit-btn:hover { color: var(--primary); }

.quote-display { padding: 0.75rem 0.9rem 0.85rem; }
.quote-text {
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--text-soft);
    font-style: italic;
    margin-bottom: 0.4rem;
}
.quote-author {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    text-align: right;
}

.quote-empty {
    padding: 0.9rem 0.9rem;
    text-align: center;
}
.quote-empty p {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.55rem;
    line-height: 1.5;
}
.quote-add-btn {
    background: rgba(79,156,249,0.08);
    border: 1px solid rgba(79,156,249,0.2);
    border-radius: 6px;
    color: var(--primary);
    font-size: 0.65rem;
    font-family: var(--font);
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}
.quote-add-btn:hover { background: rgba(79,156,249,0.15); }

.quote-editor { padding: 0.7rem 0.85rem 0.85rem; display: flex; flex-direction: column; gap: 0.5rem; }
.quote-textarea {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.78rem;
    line-height: 1.5;
    outline: none;
    resize: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--transition);
}
.quote-textarea:focus { border-color: rgba(79,156,249,0.4); }
.quote-textarea::placeholder { color: var(--text-muted); font-style: italic; }

.quote-author-input {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0.4rem 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--transition);
}
.quote-author-input:focus { border-color: rgba(79,156,249,0.3); color: var(--text-main); }
.quote-author-input::placeholder { color: var(--text-muted); opacity: 0.6; }

.quote-editor-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.quote-save-btn {
    background: var(--primary);
    border: none; border-radius: 6px;
    color: #0e0e0e;
    font-size: 0.68rem; font-weight: 600;
    font-family: var(--font);
    padding: 0.32rem 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.quote-save-btn:hover { opacity: 0.88; }
.quote-cancel-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-family: var(--font);
    padding: 0.32rem 0.7rem;
    cursor: pointer;
    transition: var(--transition);
}
.quote-cancel-btn:hover { border-color: var(--border-hover); color: var(--text-soft); }

/* ── Custom Notes Card ──────────────────────────────────────── */
.notes-card {
    position: fixed;
    bottom: calc(1.5rem + 160px); /* sits above quote card */
    left: max(1rem, calc(50vw - 680px));
    width: 240px;
    max-height: 260px;
    display: flex;
    flex-direction: column;
    background: rgba(8,12,28,0.97);
    border: 1px solid rgba(99,211,242,0.15);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 80;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
}


.notes-card-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.85rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #63d3f2;
    flex-shrink: 0;
}
.notes-add-btn {
    margin-left: auto;
    background: rgba(99,211,242,0.1);
    border: 1px solid rgba(99,211,242,0.25);
    border-radius: 5px;
    color: #63d3f2;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.notes-add-btn:hover { background: rgba(99,211,242,0.2); }

.notes-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.4rem 0;
}
.notes-empty {
    padding: 0.85rem 0.9rem;
    text-align: center;
}
.notes-empty p {
    font-size: 0.66rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
}

.note-item {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.15s;
}
.note-item:last-child { border-bottom: none; }
.note-item:hover { background: rgba(99,211,242,0.05); }

.note-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
}
.note-item-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.note-item-date {
    font-size: 0.58rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    flex-shrink: 0;
}
.note-item-body {
    font-size: 0.67rem;
    color: var(--text-muted);
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Notes Modal ────────────────────────────────────────────── */
.notes-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.18s ease;
}
.notes-modal-overlay.hidden { display: none; }

.notes-modal {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    width: min(400px, calc(100vw - 2rem));
    padding: 1.2rem;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    animation: sheetUp 0.22s cubic-bezier(0.34,1.56,0.64,1) forwards;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notes-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: #63d3f2;
}
.notes-modal-close {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 0.85rem; transition: color var(--transition);
}
.notes-modal-close:hover { color: var(--text-main); }

.notes-title-input {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 500;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--transition);
}
.notes-title-input:focus { border-color: rgba(99,211,242,0.35); }
.notes-title-input::placeholder { color: var(--text-muted); }

.notes-body-input {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.82rem;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    min-height: 110px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--transition);
}
.notes-body-input:focus { border-color: rgba(99,211,242,0.35); }
.notes-body-input::placeholder { color: var(--text-muted); font-style: italic; }

.notes-char-count {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: right;
    font-family: var(--font-mono);
    margin-top: -0.4rem;
}

.notes-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}
.notes-save-btn {
    background: #63d3f2;
    border: none; border-radius: 8px;
    color: #0e0e0e;
    font-size: 0.78rem; font-weight: 600;
    font-family: var(--font);
    padding: 0.5rem 1.3rem;
    cursor: pointer;
    transition: var(--transition);
}
.notes-save-btn:hover { opacity: 0.88; }
.notes-delete-btn {
    background: rgba(224,95,58,0.1);
    border: 1px solid rgba(224,95,58,0.3);
    border-radius: 8px;
    color: var(--accent);
    font-size: 0.75rem;
    font-family: var(--font);
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    margin-right: auto;
}
.notes-delete-btn:hover { background: rgba(224,95,58,0.2); }
.notes-delete-btn.hidden { display: none; }

/* ── 7-Day Focus History Chart ───────────────────────────────── */
.week-divider {
    margin-top: 1.2rem;
    color: var(--text-muted) !important;
    font-size: 0.6rem !important;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.week-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.4rem;
    height: 100px;
    margin-top: 0.6rem;
    padding: 0 0.2rem;
}

.week-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    height: 100%;
}

.week-bar {
    width: 100%;
    background: rgba(79,156,249,0.25);
    border-radius: 5px 5px 0 0;
    min-height: 0;
    height: 0;
    transition: height 0.5s cubic-bezier(0.34,1.1,0.64,1);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.week-col-today .week-bar {
    background: rgba(79,156,249,0.7);
    box-shadow: 0 0 10px rgba(79,156,249,0.3);
}

.week-col-empty .week-bar {
    background: rgba(255,255,255,0.04);
    min-height: 3px;
    height: 3px !important;
}

.week-bar-val {
    font-size: 0.5rem;
    font-family: var(--font-mono);
    color: var(--primary);
    opacity: 0.85;
    white-space: nowrap;
    margin-top: 0.25rem;
    position: absolute;
    top: -1rem;
}

.week-col-lbl {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
}

.week-day-name {
    font-size: 0.6rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.week-col-today .week-day-name {
    color: var(--primary);
    font-weight: 600;
}

.week-day-num {
    font-size: 0.58rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    opacity: 0.6;
}

.week-col-today .week-day-num {
    color: var(--primary);
    opacity: 0.8;
}

/* ── 7-Day Single Chart (replaces old week chart) ───────────── */
.week-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    height: 110px;
    padding: 0.5rem 0.2rem 0;
}

.week-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    height: 100%;
    cursor: default;
    transition: opacity 0.2s;
}

.week-bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.week-bar {
    width: 100%;
    background: rgba(79,156,249,0.2);
    border-radius: 5px 5px 0 0;
    height: 0;
    transition: height 0.5s cubic-bezier(0.34,1.1,0.64,1);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.week-col-today .week-bar {
    background: rgba(79,156,249,0.65);
    box-shadow: 0 0 8px rgba(79,156,249,0.25);
}

.week-col-selected .week-bar {
    background: var(--primary);
    box-shadow: 0 0 12px rgba(79,156,249,0.4);
}

.week-col-empty .week-bar {
    background: rgba(255,255,255,0.04);
    min-height: 3px;
    height: 3px !important;
    border-radius: 3px;
}

.week-col[style*="cursor: pointer"]:hover .week-bar {
    opacity: 0.8;
}

.week-bar-val {
    font-size: 0.5rem;
    font-family: var(--font-mono);
    color: var(--primary);
    white-space: nowrap;
    position: absolute;
    top: -1.1rem;
    pointer-events: none;
}
.week-col-selected .week-bar-val { color: var(--primary); font-weight: 600; }

.week-col-lbl {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
}
.week-day-name {
    font-size: 0.58rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.week-day-num {
    font-size: 0.56rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    opacity: 0.55;
}
.week-col-today .week-day-name,
.week-col-today .week-day-num { color: var(--primary); opacity: 1; }
.week-col-selected .week-day-name { color: var(--primary); font-weight: 600; }

/* ── Task Breakdown Panel ────────────────────────────────────── */
.week-breakdown {
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
    background: rgba(79,156,249,0.04);
    border: 1px solid rgba(79,156,249,0.15);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    animation: fadeIn 0.2s ease;
}

.week-breakdown-title {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.week-breakdown-row { display: flex; flex-direction: column; gap: 0.22rem; }

.wb-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}
.wb-title {
    font-size: 0.75rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.wb-time {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--primary);
    flex-shrink: 0;
    letter-spacing: 0.03em;
}
.wb-bar-track {
    height: 4px;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    overflow: hidden;
}
.wb-bar-fill {
    height: 100%;
    background: rgba(79,156,249,0.5);
    border-radius: 4px;
    transition: width 0.45s cubic-bezier(0.34,1.1,0.64,1);
}

.week-chart-hint {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: 0.03em;
    margin-left: auto;
}


/* ═══════════════════════════════════════════════════════════════
   MOBILE — Bottom toolbar + slide-up sheets for all features
   ═══════════════════════════════════════════════════════════════ */

/* Mobile bottom toolbar — only on narrow screens */
.mobile-toolbar { display: none; }

@media (max-width: 1100px) {
    .mobile-toolbar {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 7000;
        background: rgba(8,12,28,0.98);
        border-top: 1px solid rgba(79,156,249,0.15);
        padding: 0.55rem 0 calc(0.55rem + env(safe-area-inset-bottom));
        justify-content: space-around;
        align-items: center;
        backdrop-filter: blur(20px);
    }
    .app-container { padding-bottom: 5rem; }

    /* Lift FABs above toolbar */
    .session-fab {
        bottom: calc(5.2rem + env(safe-area-inset-bottom));
        right: 5.5rem;
    }
    .weekly-fab {
        bottom: calc(5.2rem + env(safe-area-inset-bottom));
        right: 1.2rem;
    }
    .session-panel {
        bottom: calc(9rem + env(safe-area-inset-bottom));
        right: 1rem;
        width: calc(100vw - 2rem);
        z-index: 7500;
    }
    .weekly-panel {
        bottom: calc(9rem + env(safe-area-inset-bottom));
        right: 1rem;
        width: calc(100vw - 2rem);
        z-index: 7500;
    }

    /* Left cards → slide-up bottom sheets */
    .routine-card,
    .notes-card,
    .quote-card {
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: 80vh !important;
        border-radius: 20px 20px 0 0 !important;
        z-index: 7500 !important;
        transform: translateY(110%);
        transition: transform 0.3s cubic-bezier(0.34,1.1,0.64,1);
        display: flex !important;
    }
    .routine-card.panel-open,
    .notes-card.panel-open,
    .quote-card.panel-open {
        transform: translateY(0) !important;
    }
    /* Drag handle */
    .routine-card-header,
    .notes-card-header,
    .quote-card-header {
        position: relative;
        padding-top: 1.4rem !important;
    }
    .routine-card-header::before,
    .notes-card-header::before,
    .quote-card-header::before {
        content: '';
        position: absolute;
        top: 0.5rem; left: 50%;
        transform: translateX(-50%);
        width: 36px; height: 4px;
        background: rgba(255,255,255,0.18);
        border-radius: 2px;
    }
}

/* Overlay behind mobile slide-up sheets */
.mobile-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 7400;
    backdrop-filter: blur(3px);
}
.mobile-panel-overlay.active { display: block; }

/* Toolbar buttons */
.mobile-toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 10px;
    transition: color 0.15s, background 0.15s;
    font-family: var(--font);
    -webkit-tap-highlight-color: transparent;
    min-width: 52px;
}
.mobile-toolbar-btn:active,
.mobile-toolbar-btn.active {
    color: var(--primary);
    background: rgba(79,156,249,0.1);
}
.mobile-toolbar-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}
.mobile-toolbar-btn span {
    font-size: 0.52rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── Daily Target FAB ─────────────────────────────────────── */
.target-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 11.2rem; /* left of session-fab, with gap */
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: rgba(22,22,22,0.96);
    border: 1px solid rgba(74,222,128,0.35);
    border-radius: 14px;
    padding: 0.6rem 0.8rem;
    color: #4ade80;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.target-fab:hover { border-color: #4ade80; transform: translateY(-2px); }
.target-fab-label {
    font-size: 0.55rem;
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.target-fab-badge {
    position: absolute;
    top: -6px; right: -6px;
    font-size: 0.5rem;
    font-family: var(--font-mono);
    font-weight: 700;
    background: var(--primary);
    color: #0e0e0e;
    padding: 0.1rem 0.3rem;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* ── Daily Target Panel ───────────────────────────────────── */
.target-panel {
    position: fixed;
    bottom: 5.8rem;
    right: 11.2rem;
    z-index: 9000;
    width: min(300px, calc(100vw - 2rem));
    max-height: 75vh;
    overflow-y: auto;
    background: #161616;
    border: 1px solid rgba(74,222,128,0.18);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    display: none;
    flex-direction: column;
}
.target-panel[data-open="true"] { display: flex; }

.target-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: sticky; top: 0;
    background: #161616; z-index: 1;
}
.target-panel-title {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.72rem; font-weight: 600;
    font-family: var(--font-heading);
    color: #4ade80; letter-spacing: 0.04em;
    text-transform: uppercase;
}
.target-panel-close {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 0.78rem; transition: color var(--transition);
}
.target-panel-close:hover { color: var(--text-main); }
.target-panel-hint {
    font-size: 0.65rem; color: var(--text-muted);
    padding: 0.4rem 1rem 0; font-style: italic;
}

/* Progress bar */
.target-progress-bar {
    margin: 0.6rem 1rem 0;
    height: 5px;
    background: rgba(255,255,255,0.07);
    border-radius: 10px;
    overflow: hidden;
}
.target-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 0%;
}
.target-progress-label {
    font-size: 0.62rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    padding: 0.3rem 1rem 0;
    letter-spacing: 0.04em;
}

/* Add row */
.target-add-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.7rem 0.8rem 0.4rem;
}
.target-input {
    flex: 1;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.8rem;
    outline: none;
    transition: border-color var(--transition);
}
.target-input:focus { border-color: rgba(74,222,128,0.4); }
.target-input::placeholder { color: var(--text-muted); font-style: italic; }
.target-add-btn {
    background: rgba(74,222,128,0.15);
    border: 1px solid rgba(74,222,128,0.3);
    border-radius: 8px;
    color: #4ade80;
    font-size: 1.1rem;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.target-add-btn:hover { background: rgba(74,222,128,0.25); }

/* Target list */
.target-list {
    list-style: none;
    padding: 0.2rem 0.8rem 0.4rem;
    display: flex; flex-direction: column; gap: 0.35rem;
}
.target-empty {
    font-size: 0.7rem; color: var(--text-muted);
    font-style: italic; text-align: center;
    padding: 0.8rem 0;
}
.target-item {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    transition: var(--transition);
}
.target-item:hover { border-color: rgba(74,222,128,0.2); }
.target-item-done .target-text {
    text-decoration: line-through;
    opacity: 0.45;
}
.target-check {
    width: 17px; height: 17px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: var(--transition);
}
.target-check:hover { border-color: #4ade80; }
.target-check.checked { background: #4ade80; border-color: #4ade80; }
.target-check svg { opacity: 0; stroke: #0e0e0e; }
.target-check.checked svg { opacity: 1; }
.target-text {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-main);
    line-height: 1.4;
}
.target-del {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    padding: 0.15rem; border-radius: 4px;
    opacity: 0; transition: var(--transition);
}
.target-item:hover .target-del { opacity: 1; }
.target-del:hover { color: var(--accent); }
@media (hover: none) { .target-del { opacity: 0.6; } }

/* Clear done button */
.target-clear-btn {
    margin: 0.3rem 0.8rem 0.8rem;
    background: none;
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-family: var(--font);
    padding: 0.35rem 0;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.04em;
}
.target-clear-btn:hover { border-color: rgba(224,95,58,0.35); color: var(--accent); }

/* Mobile adjustments */
@media (max-width: 480px) {
    .target-fab   { bottom: 1rem; right: 10.5rem; }
    .target-panel { right: 1rem; bottom: 5.5rem; width: calc(100vw - 2rem); }
}
