:root {
            --bg-primary: #0a0a0b;
            --bg-secondary: #111113;
            --bg-tertiary: #1a1a1d;
            --bg-elevated: #222225;
            --text-primary: #f5f5f7;
            --text-secondary: #a1a1a6;
            --text-muted: #6e6e73;
            --border: #2d2d30;
            --accent: #34d399;
            --accent-dim: #059669;
            
            /* Heat map colors - green gradient */
            --heat-0: transparent;
            --heat-10: rgba(52, 211, 153, 0.1);
            --heat-25: rgba(52, 211, 153, 0.25);
            --heat-50: rgba(52, 211, 153, 0.45);
            --heat-75: rgba(52, 211, 153, 0.7);
            --heat-100: rgba(52, 211, 153, 0.95);
        }

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

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

        /* Scrollbar styling */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        ::-webkit-scrollbar-track {
            background: var(--bg-secondary);
        }
        ::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

        .app {
            max-width: 1400px;
            margin: 0 auto;
            padding: 40px 24px;
        }

        /* Header */
        .header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 48px;
            flex-wrap: wrap;
            gap: 24px;
        }

        .header h1 {
            font-size: 2.5rem;
            font-weight: 700;
            letter-spacing: -0.03em;
            background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .header-subtitle {
            color: var(--text-secondary);
            font-size: 1rem;
            margin-top: 4px;
        }

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

        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 18px;
            border-radius: 8px;
            font-family: inherit;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid var(--border);
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .btn:hover {
            background: var(--bg-elevated);
            border-color: var(--text-muted);
        }

        .btn-primary {
            background: var(--accent);
            border-color: var(--accent);
            color: var(--bg-primary);
        }

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

        .btn-danger {
            background: #ef4444;
            border-color: #ef4444;
            color: #0a0a0b;
        }

        .btn-danger:hover {
            background: #dc2626;
            border-color: #dc2626;
        }

        .btn-icon {
            padding: 10px;
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* View Toggle */
        .view-toggle {
            display: flex;
            background: var(--bg-secondary);
            border-radius: 8px;
            padding: 4px;
            border: 1px solid var(--border);
        }

        .view-toggle button {
            padding: 8px 16px;
            border: none;
            background: transparent;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            border-radius: 6px;
            transition: all 0.2s ease;
        }

        .view-toggle button.active {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }

        .view-toggle button:hover:not(.active) {
            color: var(--text-primary);
        }

        /* Top Header */
        .top-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 0;
            margin-bottom: 24px;
            border-bottom: 1px solid var(--border);
            flex-wrap: wrap;
            gap: 12px;
        }

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

        .logo-icon {
            width: 28px;
            height: 28px;
            object-fit: contain;
            display: block;
        }

        .logo-text {
            font-size: 1.4rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .top-header-right {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .local-pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            border-radius: 999px;
            border: 1px solid var(--border);
            background: rgba(52, 211, 153, 0.12);
            color: var(--text-primary);
            font-size: 0.85rem;
            font-weight: 600;
        }

        .local-pill.cloud {
            background: rgba(52, 211, 153, 0.2);
        }

        .local-pill span {
            color: var(--text-secondary);
            font-weight: 500;
        }

        /* Tracker Header */
        .tracker-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-bottom: none;
            border-radius: 12px 12px 0 0;
            gap: 16px;
            flex-wrap: wrap;
        }

        .tracker-header-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .tracker-header-center {
            display: flex;
            align-items: center;
            gap: 12px;
        }

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

        .nav-period {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-primary);
            min-width: 180px;
            text-align: center;
        }

        .nav-btn {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border);
            background: var(--bg-tertiary);
            border-radius: 8px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s ease;
        }

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

        /* Main Grid */
        .tracker-container {
            background: var(--bg-secondary);
            border-radius: 0 0 16px 16px;
            border: 1px solid var(--border);
            border-top: none;
            overflow: hidden;
        }

        .tracker-scroll {
            overflow: auto;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
        }

        .app-footer {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin-top: 18px;
            color: var(--text-muted);
            font-size: 0.85rem;
        }

        .footer-link {
            background: none;
            border: none;
            padding: 4px 0;
            font: inherit;
            color: var(--text-muted);
            cursor: pointer;
            transition: color 0.2s ease;
        }

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

        .footer-sep {
            color: var(--border);
        }

        .tracker-grid {
            display: grid;
            width: max-content;
            min-width: 100%;
        }

        .grid-header {
            display: contents;
        }

        .grid-header-cell {
            padding: 16px 8px;
            text-align: center;
            font-size: 0.75rem;
            font-weight: 500;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            background: var(--bg-tertiary);
            border-bottom: 1px solid var(--border);
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .grid-header-cell.habit-header {
            text-align: left;
            padding-left: 20px;
            min-width: 180px;
            position: sticky;
            left: 0;
            z-index: 20;
            background: var(--bg-tertiary);
        }

        .grid-header-cell .day-name {
            display: block;
            color: var(--text-secondary);
            font-size: 0.7rem;
            margin-bottom: 2px;
        }

        .grid-header-cell .day-num {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem;
            color: var(--text-primary);
        }

        .grid-header-cell.today {
            background: var(--bg-elevated);
        }

        .grid-header-cell.today .day-num {
            color: var(--accent);
        }

        .grid-row {
            display: contents;
        }

        .habit-cell {
            padding: 12px 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border);
            position: sticky;
            left: 0;
            z-index: 5;
            min-width: 180px;
        }

        .habit-name {
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }

        .habit-actions {
            display: flex;
            gap: 4px;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .habit-cell:hover .habit-actions {
            opacity: 1;
        }

        .habit-action-btn {
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            border-radius: 4px;
            transition: all 0.2s ease;
        }

        .habit-action-btn:hover {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }

        .habit-action-btn.delete:hover {
            color: #f87171;
        }

        .value-cell {
            padding: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-bottom: 1px solid var(--border);
            border-right: 1px solid var(--border);
            min-width: 52px;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .value-cell:hover {
            transform: scale(1.05);
            z-index: 2;
        }

        .value-cell.today {
            background: rgba(52, 211, 153, 0.05);
        }

        .value-display {
            width: 36px;
            height: 36px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            font-weight: 600;
            transition: all 0.2s ease;
            position: relative;
        }

        .value-display.empty {
            background: var(--bg-tertiary);
            border: 1px dashed var(--border);
            color: var(--text-muted);
        }

        .value-display.has-note::after {
            content: '';
            position: absolute;
            top: 2px;
            right: 2px;
            width: 6px;
            height: 6px;
            background: var(--accent);
            border-radius: 50%;
        }

        /* Heat colors */
        .value-display.heat-10 { background: var(--heat-10); color: var(--text-secondary); }
        .value-display.heat-25 { background: var(--heat-25); color: var(--text-primary); }
        .value-display.heat-50 { background: var(--heat-50); color: var(--text-primary); }
        .value-display.heat-75 { background: var(--heat-75); color: var(--bg-primary); }
        .value-display.heat-100 { background: var(--heat-100); color: var(--bg-primary); }

        /* Legend */
        .legend {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px 20px;
            border-top: 1px solid var(--border);
            background: var(--bg-tertiary);
            flex-wrap: wrap;
            justify-content: center;
        }

        .legend-label {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

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

        .legend-item {
            width: 24px;
            height: 24px;
            border-radius: 4px;
        }

        /* Modal */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 100;
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s ease;
            padding: 24px;
            overflow-y: auto;
        }

        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .modal-overlay.policy {
            z-index: 120;
        }

        .modal {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 24px;
            width: 100%;
            max-width: 400px;
            transform: scale(0.95);
            transition: transform 0.2s ease;
            max-height: calc(100vh - 48px);
            overflow: auto;
        }

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

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

        .modal-title {
            font-size: 1.2rem;
            font-weight: 600;
        }

        .modal-close {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: var(--bg-tertiary);
            border-radius: 8px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s ease;
        }

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

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

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

        .form-input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-tertiary);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.95rem;
            transition: all 0.2s ease;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
        }

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

        textarea.form-input {
            resize: vertical;
            min-height: 100px;
        }

        /* Slider */
        .slider-container {
            padding: 8px 0;
        }

        .slider-value {
            text-align: center;
            font-family: 'JetBrains Mono', monospace;
            font-size: 2rem;
            font-weight: 700;
            color: var(--accent);
            margin-bottom: 16px;
        }

        .slider {
            width: 100%;
            height: 8px;
            -webkit-appearance: none;
            appearance: none;
            background: var(--bg-tertiary);
            border-radius: 4px;
            outline: none;
        }

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

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

        .slider-labels {
            display: flex;
            justify-content: space-between;
            margin-top: 8px;
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .modal-actions {
            display: flex;
            gap: 12px;
            margin-top: 24px;
        }

        .modal-actions .btn {
            flex: 1;
        }

        /* Stats Cards */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 16px;
        }

        .stat-card {
            background: var(--bg-tertiary);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 20px;
            display: flex;
            align-items: flex-start;
            gap: 16px;
        }

        .stat-icon {
            width: 48px;
            height: 48px;
            border-radius: 10px;
            background: rgba(52, 211, 153, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent);
            flex-shrink: 0;
        }

        .stat-content {
            flex: 1;
        }

        .stat-label {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-bottom: 2px;
        }

        .stat-value {
            font-family: 'JetBrains Mono', monospace;
            font-size: 1.6rem;
            font-weight: 700;
            color: var(--accent);
            line-height: 1.2;
        }

        .stat-subtext {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .stats-period-note {
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px solid var(--border);
            font-size: 0.8rem;
            color: var(--text-muted);
            text-align: center;
        }

        .modal-wide {
            max-width: 560px;
            width: min(100%, 560px);
        }

        .modal-landing {
            max-width: 920px;
            padding: 0;
            overflow: auto;
            width: min(100%, 920px);
        }

        .landing-grid {
            display: grid;
            grid-template-columns: 1.2fr 0.8fr;
        }

        .landing-main {
            padding: 36px 40px;
            background: radial-gradient(circle at top, rgba(52, 211, 153, 0.15), transparent 55%),
                        linear-gradient(135deg, rgba(52, 211, 153, 0.08), transparent 60%);
        }

        .landing-aside {
            padding: 36px 32px;
            border-left: 1px solid var(--border);
            background: var(--bg-tertiary);
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .landing-title {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 12px;
        }

        .landing-lead {
            color: var(--text-secondary);
            font-size: 1rem;
            margin-bottom: 20px;
        }

        .landing-points {
            display: grid;
            gap: 14px;
            margin-bottom: 24px;
        }

        .landing-point {
            padding: 14px 16px;
            border-radius: 12px;
            background: rgba(17, 17, 19, 0.7);
            border: 1px solid var(--border);
        }

        .landing-point-title {
            font-weight: 600;
            margin-bottom: 6px;
        }

        .landing-point-desc {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .landing-warning {
            padding: 12px 14px;
            border-radius: 10px;
            border: 1px dashed var(--border);
            background: rgba(248, 113, 113, 0.08);
            color: var(--text-secondary);
            font-size: 0.85rem;
            margin-bottom: 20px;
        }

        .landing-actions {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }

        .landing-aside h4 {
            font-size: 1rem;
            font-weight: 600;
        }

        .tier-card {
            padding: 14px;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: var(--bg-secondary);
        }

        .tier-card h5 {
            font-size: 0.9rem;
            margin-bottom: 6px;
        }

        .tier-card p {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        /* Auth Modal */
        .modal-auth {
            max-width: 720px;
            padding: 0;
            overflow: hidden;
            width: min(100%, 720px);
        }

        .auth-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
        }

        .auth-benefits {
            background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
            padding: 40px 32px;
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
        }

        .auth-benefits-title {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 8px;
            background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .auth-benefits-subtitle {
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin-bottom: 32px;
        }

        .benefit-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 20px;
            flex: 1;
        }

        .benefit-item {
            display: flex;
            gap: 14px;
            align-items: flex-start;
        }

        .benefit-emoji {
            font-size: 1.5rem;
            line-height: 1;
            flex-shrink: 0;
        }

        .benefit-text {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .benefit-title {
            font-weight: 600;
            font-size: 0.95rem;
            color: var(--text-primary);
        }

        .benefit-desc {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .auth-form-section {
            padding: 40px 32px;
            display: flex;
            flex-direction: column;
        }

        .auth-form-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .auth-form-title {
            font-size: 1.25rem;
            font-weight: 600;
        }

        .auth-connect {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 16px;
            text-align: center;
            flex: 1;
            justify-content: center;
        }

        .auth-connect-text {
            font-size: 0.9rem;
            color: var(--text-secondary);
            max-width: 280px;
        }

        .auth-tabs {
            display: flex;
            background: var(--bg-tertiary);
            border-radius: 8px;
            padding: 4px;
            margin-bottom: 24px;
        }

        .auth-tab {
            flex: 1;
            padding: 10px 16px;
            border: none;
            background: transparent;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            border-radius: 6px;
            transition: all 0.2s ease;
        }

        .auth-tab.active {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }

        .auth-tab:hover:not(.active) {
            color: var(--text-primary);
        }

        .auth-form {
            display: flex;
            flex-direction: column;
            gap: 16px;
            flex: 1;
        }

        .auth-divider {
            display: flex;
            align-items: center;
            gap: 16px;
            margin: 8px 0;
        }

        .auth-divider-line {
            flex: 1;
            height: 1px;
            background: var(--border);
        }

        .auth-divider-text {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .btn-social {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 12px 16px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-social:hover {
            background: var(--bg-elevated);
            border-color: var(--text-muted);
        }

        .auth-field {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .auth-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .auth-input {
            padding: 12px 14px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg-tertiary);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.9rem;
        }

        .auth-input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.2);
        }

        .auth-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
        }

        .auth-link {
            background: transparent;
            border: none;
            color: var(--accent);
            font-size: 0.8rem;
            cursor: pointer;
            padding: 0;
        }

        .auth-link:hover {
            text-decoration: underline;
        }

        .auth-error {
            font-size: 0.8rem;
            color: #fca5a5;
            text-align: center;
            min-height: 1em;
        }

        .hidden {
            display: none;
        }

        .auth-footer {
            margin-top: 16px;
            text-align: center;
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .auth-footer a {
            color: var(--accent);
            text-decoration: none;
        }

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

        .auth-terms {
            font-size: 0.7rem;
            color: var(--text-muted);
            text-align: center;
            margin-top: auto;
            padding-top: 16px;
        }

        .auth-terms a {
            color: var(--text-secondary);
            text-decoration: none;
        }

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

        .policy-content {
            display: flex;
            flex-direction: column;
            gap: 10px;
            color: var(--text-secondary);
            font-size: 0.92rem;
        }

        .policy-content h4 {
            font-size: 0.95rem;
            color: var(--text-primary);
            margin-top: 6px;
        }

        .policy-content ul {
            padding-left: 18px;
        }

        .policy-meta {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            margin-bottom: 4px;
        }

        /* Task selection */
        .task-list {
            display: grid;
            gap: 10px;
            max-height: 240px;
            overflow: auto;
            padding-right: 4px;
        }

        .task-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-radius: 10px;
            border: 1px solid var(--border);
            background: var(--bg-tertiary);
        }

        .task-item input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: var(--accent);
        }

        .task-name {
            flex: 1;
            font-size: 0.9rem;
        }

        .task-count {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-bottom: 12px;
        }

        .task-warning {
            margin-top: 12px;
            padding: 12px;
            border-radius: 10px;
            background: rgba(248, 113, 113, 0.08);
            border: 1px dashed var(--border);
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        .confirm-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 12px;
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        .confirm-row input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: var(--accent);
        }

        .pricing-toggle {
            display: flex;
            gap: 10px;
            padding: 10px;
            border-radius: 14px;
            background: var(--bg-tertiary);
            margin: 10px 0 18px;
        }

        .toggle-btn {
            flex: 1;
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-secondary);
            padding: 10px 12px;
            border-radius: 12px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .toggle-btn.active {
            background: var(--accent);
            color: var(--text-primary);
            border-color: transparent;
            box-shadow: 0 10px 20px rgba(76, 201, 240, 0.25);
        }

        .discount-badge {
            background: rgba(255, 255, 255, 0.18);
            color: inherit;
            font-size: 0.65rem;
            padding: 2px 8px;
            border-radius: 999px;
            font-weight: 700;
        }

        .pricing-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 14px;
            margin-bottom: 16px;
        }

        .pricing-card {
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 18px;
            background: var(--bg-tertiary);
            display: grid;
            gap: 6px;
        }

        .pricing-card.active {
            border-color: var(--accent);
            box-shadow: 0 12px 28px rgba(76, 201, 240, 0.2);
        }

        .pricing-name {
            font-size: 0.9rem;
            color: var(--text-secondary);
            font-weight: 600;
        }

        .pricing-price {
            font-size: 1.6rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .pricing-price span {
            font-size: 0.85rem;
            color: var(--text-muted);
            font-weight: 500;
            margin-left: 4px;
        }

        .pricing-subtext {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .pricing-thanks {
            display: grid;
            gap: 12px;
        }

        @media (max-width: 640px) {
            .auth-container {
                grid-template-columns: 1fr;
            }

            .auth-benefits {
                display: none;
            }

            .modal-auth {
                max-width: 400px;
            }

            .auth-form-section {
                padding: 28px 20px;
            }

            .auth-form-header {
                justify-content: flex-end;
            }

            .auth-connect-text {
                max-width: none;
            }
        }

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: var(--text-secondary);
        }

        .empty-state-icon {
            font-size: 3rem;
            margin-bottom: 16px;
            opacity: 0.5;
        }

        .empty-state-title {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 8px;
        }

        /* Drag handle */
        .drag-handle {
            cursor: grab;
            color: var(--text-muted);
            padding: 4px;
        }

        .drag-handle:active {
            cursor: grabbing;
        }

        /* Toast */
        .toast {
            position: fixed;
            bottom: 24px;
            right: 24px;
            background: var(--bg-elevated);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 12px 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            transform: translateY(100px);
            opacity: 0;
            transition: all 0.3s ease;
            z-index: 200;
        }

        .toast.show {
            transform: translateY(0);
            opacity: 1;
        }

        .toast-icon {
            color: var(--accent);
        }

        /* Responsive */
        @media (max-width: 768px) {
            .app {
                padding: 20px 16px;
            }

            .top-header {
                padding: 12px 0;
            }

            .top-header-right {
                width: 100%;
                justify-content: space-between;
            }

            .logo-text {
                font-size: 1.2rem;
            }

            .tracker-header {
                flex-direction: column;
                gap: 12px;
                padding: 12px 16px;
            }

            .tracker-scroll {
                max-height: 70vh;
            }

            .tracker-header-left,
            .tracker-header-center,
            .tracker-header-right {
                width: 100%;
                justify-content: center;
            }

            .nav-period {
                min-width: auto;
            }

            .habit-cell {
                min-width: 140px;
                padding: 10px 12px;
            }

            .habit-actions {
                opacity: 1;
            }

            .value-cell {
                min-width: 44px;
            }

            .value-display {
                width: 32px;
                height: 32px;
                font-size: 0.7rem;
            }

            .btn {
                padding: 8px 12px;
                font-size: 0.85rem;
            }

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

            .top-header-right .btn span:not(.logo-icon) {
                display: none;
            }

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

            .landing-aside {
                border-left: none;
                border-top: 1px solid var(--border);
            }

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

        @media (max-width: 640px) {
            .modal-overlay {
                padding: 16px;
                align-items: flex-start;
            }

            .modal {
                max-height: calc(100vh - 32px);
            }

            .modal-landing {
                max-height: calc(100vh - 32px);
            }

            .modal-landing .landing-main {
                padding-bottom: 20px;
            }

            .modal-landing .landing-actions {
                position: sticky;
                bottom: 0;
                background: var(--bg-secondary);
                border-top: 1px solid var(--border);
                padding: 12px 0 4px;
                flex-direction: column;
                z-index: 1;
            }

            .nav-btn {
                width: 32px;
                height: 32px;
            }

            .view-toggle button {
                padding: 8px 12px;
                font-size: 0.8rem;
            }

            .habit-cell {
                min-width: 120px;
            }

            .value-cell {
                min-width: 40px;
            }

            .value-display {
                width: 28px;
                height: 28px;
                font-size: 0.65rem;
            }

            .legend {
                gap: 10px;
            }

            .modal-actions {
                flex-direction: column;
            }

            .profile-dropdown {
                max-width: calc(100vw - 32px);
            }

            .toast {
                left: 16px;
                right: 16px;
                bottom: 16px;
            }
        }

        /* Profile Dropdown */
        .profile-dropdown-wrapper {
            position: relative;
        }

        .profile-trigger {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            border-radius: 8px;
            font-family: inherit;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid var(--border);
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .profile-trigger:hover {
            background: var(--bg-elevated);
            border-color: var(--text-muted);
        }

        .profile-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.75rem;
            color: var(--bg-primary);
        }

        .profile-dropdown {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 12px;
            min-width: 220px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-8px);
            transition: all 0.2s ease;
            z-index: 1000;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        }

        .profile-dropdown.active {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .profile-dropdown-header {
            padding: 14px 16px;
            border-bottom: 1px solid var(--border);
        }

        .profile-email {
            font-size: 0.85rem;
            color: var(--text-secondary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .profile-plan {
            font-size: 0.75rem;
            color: var(--accent);
            font-weight: 600;
            margin-top: 2px;
        }

        .profile-dropdown-menu {
            padding: 6px;
        }

        .profile-menu-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-radius: 8px;
            background: transparent;
            border: none;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s ease;
            width: 100%;
            text-align: left;
        }

        .profile-menu-item:hover {
            background: var(--bg-tertiary);
        }

        .profile-menu-item svg {
            flex-shrink: 0;
        }

        .profile-menu-divider {
            height: 1px;
            background: var(--border);
            margin: 6px 0;
        }

        /* Settings Modal */
        .settings-section {
            margin-bottom: 28px;
        }

        .settings-section:last-child {
            margin-bottom: 0;
        }

        .settings-section-title {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 14px;
        }

        .settings-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 14px 16px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border);
            border-radius: 10px;
            margin-bottom: 10px;
        }

        .settings-row:last-child {
            margin-bottom: 0;
        }

        .settings-row-label {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

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

        .settings-label-desc {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .settings-value {
            font-size: 0.9rem;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .settings-preference {
            margin-top: 10px;
            padding: 14px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 10px;
        }

        .settings-preference-options {
            display: grid;
            gap: 10px;
            margin-bottom: 12px;
        }

        .settings-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 10px 12px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border);
            border-radius: 8px;
            cursor: pointer;
        }

        .settings-option-label {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .settings-option input {
            accent-color: var(--accent);
        }

        .settings-option-current {
            font-size: 0.7rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--text-muted);
        }

        .subscription-card {
            padding: 20px;
            background: linear-gradient(135deg, rgba(52, 211, 153, 0.12) 0%, rgba(52, 211, 153, 0.05) 100%);
            border: 1px solid rgba(52, 211, 153, 0.3);
            border-radius: 12px;
            margin-bottom: 14px;
        }

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

        .subscription-plan-name {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--accent);
        }

        .subscription-badge {
            padding: 4px 10px;
            background: rgba(52, 211, 153, 0.2);
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--accent);
        }

        .subscription-features {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .subscription-feature {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        /* Pricing Modal */
        .pricing-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin-bottom: 24px;
        }

        .pricing-card {
            padding: 24px;
            background: var(--bg-tertiary);
            border: 2px solid var(--border);
            border-radius: 12px;
            display: flex;
            flex-direction: column;
            transition: all 0.2s ease;
            cursor: pointer;
        }

        .pricing-card:hover {
            border-color: var(--accent);
            background: var(--bg-elevated);
        }

        .pricing-card.featured {
            border-color: var(--accent);
            background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, var(--bg-tertiary) 100%);
            position: relative;
        }

        .pricing-badge {
            position: absolute;
            top: -10px;
            right: 20px;
            padding: 4px 12px;
            background: var(--accent);
            color: var(--bg-primary);
            font-size: 0.7rem;
            font-weight: 700;
            border-radius: 6px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .pricing-header {
            margin-bottom: 16px;
        }

        .pricing-plan-name {
            font-size: 1.2rem;
            font-weight: 700;
            margin-bottom: 4px;
        }

        .pricing-plan-desc {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .pricing-amount {
            display: flex;
            align-items: baseline;
            gap: 4px;
            margin-bottom: 16px;
        }

        .pricing-currency {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--text-secondary);
        }

        .pricing-price {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .pricing-period {
            font-size: 0.9rem;
            color: var(--text-secondary);
        }

        .pricing-save {
            display: inline-block;
            padding: 4px 8px;
            background: rgba(52, 211, 153, 0.2);
            color: var(--accent);
            font-size: 0.75rem;
            font-weight: 600;
            border-radius: 6px;
            margin-bottom: 16px;
        }

        .pricing-features {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
            flex: 1;
        }

        .pricing-feature {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        .pricing-feature svg {
            flex-shrink: 0;
            margin-top: 2px;
        }

        .pricing-footer {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-align: center;
            margin-top: 20px;
        }

        .tracker-container.loading {
            position: relative;
            min-height: 280px;
        }

        .loading-overlay {
            position: absolute;
            inset: 0;
            background: rgba(248, 250, 252, 0.7);
            backdrop-filter: blur(1px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 3;
        }

        .loading-skeleton {
            width: min(720px, 92%);
        }

        .skeleton-line {
            height: 16px;
            border-radius: 999px;
            background: linear-gradient(90deg, #eceff3 0%, #f6f7f9 45%, #eceff3 100%);
            background-size: 200% 100%;
            animation: shimmer 1.4s ease-in-out infinite;
            margin-bottom: 12px;
        }

        .skeleton-line.short {
            width: 45%;
        }

        .skeleton-line.medium {
            width: 70%;
        }

        .skeleton-line.tall {
            height: 22px;
        }

        @keyframes shimmer {
            0% {
                background-position: 200% 0;
            }
            100% {
                background-position: -200% 0;
            }
        }
