html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ============================================================
   Rufus Design System — Phase 1 Foundation
   ============================================================ */

/* Semantic accent palette + gradient tokens */
:root {
    --rufus-color-tasks:      #4f46e5;
    --rufus-color-habits:     #f59e0b;
    --rufus-color-goals:      #10b981;
    --rufus-color-urgent:     #ef4444;
    --rufus-color-ai:         #a855f7;
    --rufus-gradient-navy:    linear-gradient(135deg, #03173d 0%, #0f2d6b 100%);
    --rufus-gradient-indigo:  linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);
    --rufus-gradient-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --rufus-gradient-amber:   linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* ============================================================
   Rufus Animation & Delight System
   ============================================================ */

/* Shared easing curves */
:root {
    --rufus-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --rufus-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --rufus-ease-decel:  cubic-bezier(0, 0, 0.2, 1);
    --rufus-duration-fast: 150ms;
    --rufus-duration-normal: 250ms;
    --rufus-duration-slow: 400ms;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Reminder urgency pulse animation */
@keyframes reminder-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.reminder-urgent-pulse {
    animation: reminder-pulse 1.5s ease-in-out infinite;
}

/* ----------------------------------------------------------
   #1 — Page transition: fade + slide-up on navigation
   ANIM-10: Coordinated enter/exit page transitions
   ---------------------------------------------------------- */
@keyframes rufus-page-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes rufus-page-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}

.rufus-page {
    animation: rufus-page-in 250ms var(--rufus-ease-decel) both;
}

.rufus-page-exit {
    animation: rufus-page-out 120ms var(--rufus-ease-smooth) both;
    pointer-events: none;
}

/* ----------------------------------------------------------
   #2 — Staggered list item entry
   ---------------------------------------------------------- */
@keyframes rufus-item-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rufus-stagger-item {
    animation: rufus-item-in 250ms var(--rufus-ease-decel) both;
}

.rufus-stagger-item:nth-child(1)  { animation-delay: 0ms; }
.rufus-stagger-item:nth-child(2)  { animation-delay: 40ms; }
.rufus-stagger-item:nth-child(3)  { animation-delay: 80ms; }
.rufus-stagger-item:nth-child(4)  { animation-delay: 120ms; }
.rufus-stagger-item:nth-child(5)  { animation-delay: 160ms; }
.rufus-stagger-item:nth-child(6)  { animation-delay: 200ms; }
.rufus-stagger-item:nth-child(7)  { animation-delay: 240ms; }
.rufus-stagger-item:nth-child(8)  { animation-delay: 280ms; }
.rufus-stagger-item:nth-child(9)  { animation-delay: 320ms; }
.rufus-stagger-item:nth-child(10) { animation-delay: 360ms; }
.rufus-stagger-item:nth-child(n+11) { animation-delay: 400ms; }

/* ----------------------------------------------------------
   #3 — Checkbox celebration pop + confetti
   ANIM-6: Checkbox micro-interaction (tactile press feedback)
   ---------------------------------------------------------- */
@keyframes rufus-check-pop {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.5); }
    50%  { transform: scale(0.85); }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes rufus-check-ring {
    0%   { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* ANIM-6: tactile press on checkbox click */
@keyframes rufus-check-press {
    0%   { transform: scale(1); }
    40%  { transform: scale(0.85); }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.rufus-check-celebrate {
    animation: rufus-check-pop 400ms var(--rufus-ease-spring) both;
    position: relative;
}

.rufus-check-celebrate::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #10b981;
    animation: rufus-check-ring 500ms var(--rufus-ease-decel) both;
    pointer-events: none;
}

/* Checkbox press feedback — applied briefly on click via JS/Blazor */
.rufus-check-pressing {
    animation: rufus-check-press 200ms var(--rufus-ease-spring) both;
}

/* All checkboxes get a smooth hover scale */
.mud-checkbox .mud-icon-root {
    transition: transform 100ms var(--rufus-ease-smooth);
}
.mud-checkbox:hover .mud-icon-root {
    transform: scale(1.1);
}
.mud-checkbox:active .mud-icon-root {
    transform: scale(0.88);
}

/* ----------------------------------------------------------
   #4 — FAB spring animation
   ANIM-9: FAB speed dial stagger with spring + rotation
   ---------------------------------------------------------- */
@keyframes rufus-fab-bounce {
    0%   { transform: scale(0) rotate(-45deg); opacity: 0; }
    60%  { transform: scale(1.15) rotate(5deg); opacity: 1; }
    80%  { transform: scale(0.92) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes rufus-speed-dial-in {
    0%   { transform: scale(0) rotate(-90deg); opacity: 0; }
    60%  { transform: scale(1.1) rotate(5deg); opacity: 1; }
    80%  { transform: scale(0.95) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.speed-dial-item {
    transform: scale(0);
    opacity: 0;
}

.speed-dial-item.open {
    animation: rufus-speed-dial-in 350ms var(--rufus-ease-spring) both;
}

.speed-dial-item.open:nth-child(1) { animation-delay: 0ms; }
.speed-dial-item.open:nth-child(2) { animation-delay: 50ms; }
.speed-dial-item.open:nth-child(3) { animation-delay: 100ms; }
.speed-dial-item.open:nth-child(4) { animation-delay: 150ms; }

.quick-add-fab {
    transition: transform 300ms var(--rufus-ease-spring), box-shadow 200ms ease !important;
}

.quick-add-fab:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35) !important;
}

/* ----------------------------------------------------------
   #10 — Card hover lift (ANIM-3)
   ---------------------------------------------------------- */
.mud-card {
    transition: transform 200ms var(--rufus-ease-smooth), box-shadow 200ms var(--rufus-ease-smooth) !important;
}

@media (hover: hover) {
    .mud-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    }
}

/* ANIM-3: Mobile press feedback (active state) */
@media (hover: none) {
    .mud-card:active {
        transform: scale(0.97);
        transition-duration: 80ms;
    }
}

/* Interactive list items (Inbox, reminder rows, etc.) */
.rufus-list-item {
    transition: transform 150ms var(--rufus-ease-smooth), background 150ms ease;
    border-radius: 6px;
}

@media (hover: hover) {
    .rufus-list-item:hover {
        transform: translateY(-1px);
        background: rgba(79, 70, 229, 0.04);
    }
}

@media (hover: none) {
    .rufus-list-item:active {
        transform: scale(0.98);
        transition-duration: 80ms;
    }
}

/* ----------------------------------------------------------
   #11 — Inbox badge pulse
   ---------------------------------------------------------- */
@keyframes rufus-badge-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.2); }
}

.rufus-inbox-pulse .mud-badge-content {
    animation: rufus-badge-pulse 2s ease-in-out infinite;
}

/* ----------------------------------------------------------
   ANIM-4 — Dialog enter/exit animations
   ---------------------------------------------------------- */
@keyframes rufus-dialog-in {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes rufus-dialog-out {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to   { opacity: 0; transform: scale(0.97) translateY(4px); }
}

.mud-dialog {
    animation: rufus-dialog-in 200ms var(--rufus-ease-spring) both !important;
}

.mud-overlay-dialog {
    animation: rufus-overlay-fade-in 150ms ease both;
}

@keyframes rufus-overlay-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ----------------------------------------------------------
   ANIM-5 — Empty state entrance animation
   ---------------------------------------------------------- */
@keyframes rufus-empty-in {
    from { opacity: 0; transform: scale(0.85) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.rufus-empty-state {
    animation: rufus-empty-in 400ms var(--rufus-ease-spring) both;
    animation-delay: 150ms;
    opacity: 0;
}

/* ----------------------------------------------------------
   ANIM-7 — Today page greeting choreography
   ---------------------------------------------------------- */
@keyframes rufus-hero-date-in {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes rufus-hero-stat-in {
    from { opacity: 0; transform: translateY(8px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.rufus-greeting-date {
    animation: rufus-hero-date-in 300ms var(--rufus-ease-decel) both;
}

.rufus-greeting-stat {
    animation: rufus-hero-stat-in 300ms var(--rufus-ease-decel) both;
    opacity: 0;
}

.rufus-greeting-stat:nth-child(1) { animation-delay: 80ms; }
.rufus-greeting-stat:nth-child(2) { animation-delay: 130ms; }
.rufus-greeting-stat:nth-child(3) { animation-delay: 180ms; }

.rufus-greeting-plan {
    animation: rufus-page-in 300ms var(--rufus-ease-decel) both;
    animation-delay: 250ms;
    opacity: 0;
}

/* ----------------------------------------------------------
   ANIM-8 — Stat counter count-up
   ---------------------------------------------------------- */
@keyframes rufus-count-up {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rufus-stat-number {
    animation: rufus-count-up 350ms var(--rufus-ease-decel) both;
    font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------
   ANIM-11 — Skeleton shimmer loading states
   ---------------------------------------------------------- */
@keyframes rufus-skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.rufus-skeleton {
    background: linear-gradient(90deg,
        rgba(0,0,0,0.06) 25%,
        rgba(0,0,0,0.10) 37%,
        rgba(0,0,0,0.06) 63%);
    background-size: 800px 100%;
    animation: rufus-skeleton-shimmer 1.8s ease-in-out infinite;
    border-radius: 6px;
}

.rufus-skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.rufus-skeleton-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rufus-skeleton-line {
    height: 14px;
    border-radius: 4px;
}

.rufus-skeleton-line-short {
    width: 40%;
}

.rufus-skeleton-line-long {
    width: 75%;
}

.rufus-skeleton-line-full {
    width: 100%;
    flex: 1;
}

/* Stagger skeleton rows */
.rufus-skeleton-row:nth-child(1) { opacity: 1; }
.rufus-skeleton-row:nth-child(2) { opacity: 0.85; }
.rufus-skeleton-row:nth-child(3) { opacity: 0.7; }
.rufus-skeleton-row:nth-child(4) { opacity: 0.55; }
.rufus-skeleton-row:nth-child(5) { opacity: 0.4; }

/* ----------------------------------------------------------
   ANIM-12 — Sync success celebration (enhanced)
   ---------------------------------------------------------- */
@keyframes rufus-sync-celebrate {
    0%   { transform: scale(1); color: inherit; }
    25%  { transform: scale(1.3); color: #10b981; }
    50%  { transform: scale(0.9); }
    75%  { transform: scale(1.1); }
    100% { transform: scale(1); color: inherit; }
}

.rufus-sync-just-synced .mud-chip-content {
    animation: rufus-sync-celebrate 500ms var(--rufus-ease-spring) both;
}

.rufus-sync-just-synced .mud-icon-root {
    color: #10b981 !important;
    transition: color 300ms ease;
}

/* ----------------------------------------------------------
   ANIM-2 — Nav active indicator sliding pill
   ---------------------------------------------------------- */
@keyframes rufus-nav-indicator-in {
    from { opacity: 0; transform: scaleY(0.5); }
    to   { opacity: 1; transform: scaleY(1); }
}

/* ----------------------------------------------------------
   #14 — Sync indicator spin
   ---------------------------------------------------------- */
@keyframes rufus-sync-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes rufus-sync-done {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.rufus-sync-spinning .mud-icon-root {
    animation: rufus-sync-spin 1s linear infinite;
}

.rufus-sync-just-synced {
    animation: rufus-sync-done 500ms var(--rufus-ease-spring) both;
}

/* ----------------------------------------------------------
   #5 — Sidebar active indicator slide
   ---------------------------------------------------------- */
.mud-nav-link {
    transition: background 200ms var(--rufus-ease-smooth),
                border-left 200ms var(--rufus-ease-smooth),
                padding-left 200ms var(--rufus-ease-smooth),
                transform 150ms var(--rufus-ease-smooth) !important;
}

/* ----------------------------------------------------------
   #6 — Time-aware greeting gradients
   ---------------------------------------------------------- */
.rufus-greeting-morning {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 40%, #e8985e 100%) !important;
}
.rufus-greeting-afternoon {
    background: linear-gradient(135deg, #03173d 0%, #1a4b8c 50%, #4f88c6 100%) !important;
}
.rufus-greeting-evening {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1040 50%, #2d1b69 100%) !important;
}

/* ----------------------------------------------------------
   #7 — Progress rings
   ---------------------------------------------------------- */
@keyframes rufus-ring-fill {
    from { stroke-dasharray: 0 188.5; }
}

.rufus-progress-ring circle:last-child {
    animation: rufus-ring-fill 800ms var(--rufus-ease-decel) both;
}

/* ----------------------------------------------------------
   #8 — Growing streak flames
   ---------------------------------------------------------- */
@keyframes rufus-flame-flicker {
    0%, 100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
    25%      { transform: scale(1.05) rotate(-2deg); filter: brightness(1.1); }
    50%      { transform: scale(1.1) rotate(1deg); filter: brightness(1.2); }
    75%      { transform: scale(1.03) rotate(-1deg); filter: brightness(1.05); }
}

.rufus-flame-small {
    display: inline-flex;
    animation: rufus-flame-flicker 2s ease-in-out infinite;
    transform-origin: bottom center;
}

.rufus-flame-medium {
    display: inline-flex;
    animation: rufus-flame-flicker 1.5s ease-in-out infinite;
    transform-origin: bottom center;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4));
}

.rufus-flame-large {
    display: inline-flex;
    animation: rufus-flame-flicker 1.2s ease-in-out infinite;
    transform-origin: bottom center;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

.rufus-flame-epic {
    display: inline-flex;
    animation: rufus-flame-flicker 0.8s ease-in-out infinite;
    transform-origin: bottom center;
    filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.7));
}

/* ----------------------------------------------------------
   #9 — Empty state illustrations: gentle float
   ---------------------------------------------------------- */
@keyframes rufus-float {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-6px); }
}

.rufus-empty-illustration {
    animation: rufus-float 3s ease-in-out infinite;
    display: inline-block;
}

/* ----------------------------------------------------------
   #12 — Live clock tick
   ---------------------------------------------------------- */
@keyframes rufus-clock-tick {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

.rufus-clock-separator {
    animation: rufus-clock-tick 1s step-end infinite;
}

/* ----------------------------------------------------------
   #13 — Activity sparkline
   ---------------------------------------------------------- */
.rufus-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 32px;
}

.rufus-sparkline-bar {
    flex: 1;
    border-radius: 2px 2px 0 0;
    background: var(--rufus-color-tasks);
    transition: height 500ms var(--rufus-ease-spring);
    min-width: 6px;
    opacity: 0.7;
}

.rufus-sparkline-bar:hover {
    opacity: 1;
}

.rufus-sparkline-bar.today {
    background: var(--rufus-gradient-indigo);
    opacity: 1;
}

/* ----------------------------------------------------------
   #15 — Motivational quote fade
   ---------------------------------------------------------- */
@keyframes rufus-quote-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rufus-quote {
    animation: rufus-quote-in 500ms var(--rufus-ease-decel) both;
    animation-delay: 300ms;
    font-style: italic;
    opacity: 0;
}

/* ----------------------------------------------------------
   #17 — Weekly progress card shimmer
   ---------------------------------------------------------- */
@keyframes rufus-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.rufus-progress-card {
    position: relative;
    overflow: hidden;
}

.rufus-progress-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(79,70,229,0.3), transparent);
    background-size: 200% 100%;
    animation: rufus-shimmer 3s ease-in-out infinite;
}

/* ----------------------------------------------------------
   Typography utility classes (used across phases 2–4)
   ---------------------------------------------------------- */

/* Section group labels (e.g. "THIS WEEK", "UPCOMING") */
.rufus-section-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.45);
    display: block;
}

/* Large display numbers (stat cards, streaks) */
.rufus-display-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}

/* ----------------------------------------------------------
   Progress bar — animated fill on first render
   ---------------------------------------------------------- */
.mud-progress-linear-bar {
    transition: width 500ms ease-out !important;
}

/* ----------------------------------------------------------
   Detail panel drawers: ensure full viewport height
   ---------------------------------------------------------- */
.task-detail-drawer,
.goal-detail-drawer {
    height: 100vh !important;
    height: 100dvh !important;
    top: 0 !important;
    position: fixed !important;
}

/* ----------------------------------------------------------
   Phase 4 — Mobile page header: stack title + actions vertically
   ---------------------------------------------------------- */
@media (max-width: 600px) {
    .rufus-page-header {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .rufus-page-header > .mud-typography {
        width: 100%;
    }
}

/* ----------------------------------------------------------
   Phase 4 — Mobile bottom nav safe-area padding
   ---------------------------------------------------------- */
@media (max-width: 600px) {
    /* Push page content above the fixed bottom nav (56px) + FAB clearance */
    .mud-main-content {
        padding-bottom: 140px !important;
    }

    /* Push snackbar notifications above the bottom nav */
    .mud-snackbar-location-bottom-right,
    .mud-snackbar-location-bottom-left,
    .mud-snackbar-location-bottom-center {
        bottom: 72px !important;
    }

    /* Ensure drawer nav menu can scroll past the bottom nav */
    .mud-drawer-content .mud-navmenu {
        padding-bottom: 72px !important;
    }

    /* Detail panels: full-width on mobile */
    .task-detail-drawer {
        width: 100% !important;
        max-width: 100% !important;
    }
    .goal-detail-drawer {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Dialogs: constrain to viewport on mobile */
    .mud-dialog {
        margin: 8px !important;
        max-height: calc(100vh - 16px) !important;
    }
    .mud-dialog .mud-dialog-content {
        max-height: calc(100vh - 140px) !important;
        overflow-y: auto !important;
    }
}

/* ----------------------------------------------------------
   Phase 4 — Bottom navigation items (mobile)
   ---------------------------------------------------------- */
.rufus-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--mud-palette-text-secondary);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 4px 0;
    transition: color 150ms ease;
    cursor: pointer;
}

.rufus-bottom-nav-item:hover {
    color: var(--mud-palette-primary);
    text-decoration: none;
}

.rufus-bottom-nav-item.active {
    color: var(--mud-palette-primary);
    font-weight: 700;
}

/* ----------------------------------------------------------
   Phase 4 — Login / Register split-screen
   ---------------------------------------------------------- */
.login-split {
    display: flex;
    min-height: 520px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.login-feature-panel {
    flex: 1;
    background: linear-gradient(135deg, #03173d 0%, #1a3570 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 40px;
}

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--mud-palette-surface);
}

@media (max-width: 700px) {
    .login-feature-panel { display: none; }
    .login-split { box-shadow: none; border-radius: 8px; }
    .login-form-panel { padding: 24px 16px; }
}

/* ----------------------------------------------------------
   Phase 3 — Floating bulk action bar (Tasks page)
   ---------------------------------------------------------- */
@keyframes rufus-bar-in {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0);   opacity: 1; }
}

.rufus-bulk-bar {
    position: fixed;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    border-radius: 14px;
    animation: rufus-bar-in 150ms ease-out both;
    max-width: 92vw;
}

/* ----------------------------------------------------------
   Phase 3 — Logbook timeline line
   ---------------------------------------------------------- */
.rufus-timeline-group {
    position: relative;
    padding-left: 24px;
}

.rufus-timeline-group::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--mud-palette-divider);
    border-radius: 2px;
}

.rufus-timeline-dot {
    position: absolute;
    left: 0;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--mud-palette-primary);
    border: 2px solid var(--mud-palette-surface);
    box-shadow: 0 0 0 1px var(--mud-palette-primary);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

/* ============================================================
   UX Refresh — Whitespace & Density Improvements
   ============================================================ */

/* Increase card content padding for breathing room */
.mud-card > .mud-card-content {
    padding: 16px 20px !important;
}

/* Give list items more vertical space */
.mud-list-item {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* Wider spacing between stat cards */
.rufus-stagger-item .mud-paper {
    padding: 20px !important;
}

/* Calmer section transitions — use whitespace not dividers */
.rufus-section-divider {
    margin: 24px 0 16px 0;
    border: none;
    height: 0;
}

/* Page header breathing room */
.rufus-page-header {
    margin-bottom: 24px !important;
    padding-bottom: 8px;
}

/* Reduce visual noise: limit accent colors on any card */
.mud-card {
    border-radius: 12px !important;
}

/* Softer paper elevations */
.mud-paper {
    border-radius: 10px !important;
}

/* Task/habit cards: slightly more padding */
.habit-card .mud-card-content,
.task-compact-card .mud-card-content {
    padding: 12px 16px !important;
}

/* ============================================================
   UX Refresh — Capacity Bar
   ============================================================ */
.rufus-capacity-bar {
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
}

.rufus-capacity-bar .capacity-fill {
    transition: width 600ms var(--rufus-ease-decel);
    border-radius: 4px;
    height: 8px;
}

/* ============================================================
   UX Refresh — Timeline View
   ============================================================ */
.rufus-timeline-container {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 0;
    position: relative;
}

.rufus-timeline-hour-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    text-align: right;
    padding-right: 12px;
    height: 60px;
    display: flex;
    align-items: flex-start;
    padding-top: 0;
    font-variant-numeric: tabular-nums;
}

.rufus-timeline-hour-line {
    position: absolute;
    left: 54px;
    right: 0;
    height: 1px;
    background: var(--mud-palette-divider);
    opacity: 0.5;
}

.rufus-timeline-task-block {
    border-radius: 8px;
    padding: 8px 12px;
    margin: 2px 4px;
    cursor: pointer;
    transition: transform 150ms var(--rufus-ease-smooth), box-shadow 150ms var(--rufus-ease-smooth);
    overflow: hidden;
    min-height: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rufus-timeline-task-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.rufus-timeline-task-block.completed {
    opacity: 0.5;
}

.rufus-timeline-task-block.completed .timeline-task-title {
    text-decoration: line-through;
}

.rufus-timeline-section-morning {
    background: rgba(59, 130, 246, 0.04);
}

.rufus-timeline-section-afternoon {
    background: rgba(245, 158, 11, 0.04);
}

.rufus-timeline-section-evening {
    background: rgba(79, 70, 229, 0.04);
}

/* ============================================================
   UX Refresh — Streak Rings
   ============================================================ */
@keyframes rufus-ring-draw {
    from { stroke-dashoffset: var(--ring-circumference); }
}

.rufus-streak-ring circle.ring-progress {
    animation: rufus-ring-draw 800ms var(--rufus-ease-decel) both;
    transition: stroke-dasharray 700ms cubic-bezier(0,0,0.2,1);
}

/* ============================================================
   UX Refresh — Quick Add Bar
   ============================================================ */
.rufus-quick-add {
    border-radius: 24px;
    border: 1.5px solid var(--mud-palette-divider);
    padding: 6px 16px;
    background: var(--mud-palette-surface);
    transition: border-color 200ms ease, box-shadow 200ms ease;
    margin-bottom: 16px;
}

.rufus-quick-add:focus-within {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.rufus-quick-add-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 0 2px 0;
    min-height: 0;
    transition: min-height 150ms ease;
}

.rufus-quick-add-tokens:not(:empty) {
    min-height: 28px;
}

/* ============================================================
   UX Refresh — Daily Planning Ritual
   ============================================================ */
.rufus-planning-pill {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1400;
    animation: rufus-pill-in 300ms var(--rufus-ease-spring) both;
}

@keyframes rufus-pill-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes rufus-pill-out {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to   { opacity: 0; transform: translateX(-50%) translateY(-12px); }
}

.rufus-planning-pill.dismissing {
    animation: rufus-pill-out 200ms var(--rufus-ease-smooth) both;
}

@media (max-width: 600px) {
    .rufus-planning-pill {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        display: flex;
        justify-content: center;
        margin-bottom: 8px;
        animation: none;
    }

    .rufus-planning-pill.dismissing {
        animation: rufus-pill-out 200ms var(--rufus-ease-smooth) both;
    }
}

/* ============================================================
   Mobile: hide compact-view pills to keep task titles readable
   ============================================================ */
@media (max-width: 600px) {
    .compact-pill-hide-mobile {
        display: none !important;
    }

    .rufus-eisenhower-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   UX Refresh — Empty State Illustrations
   ============================================================ */
.rufus-empty-state-enhanced {
    animation: rufus-empty-in 400ms var(--rufus-ease-spring) both;
    animation-delay: 150ms;
    opacity: 0;
    padding: 48px 32px !important;
}

.rufus-empty-state-enhanced svg {
    animation: rufus-float 3s ease-in-out infinite;
}

/* ============================================================
   UX Refresh — Progressive Disclosure on Task Cards
   ============================================================ */
.rufus-task-card-collapsed {
    cursor: pointer;
    padding: 10px 14px !important;
}

.rufus-task-card-details {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 250ms var(--rufus-ease-smooth), opacity 200ms ease, padding 200ms ease;
    padding: 0 14px;
}

.rufus-task-card-details.expanded {
    max-height: 500px;
    opacity: 1;
    padding: 8px 14px 12px 14px;
}

/* Priority dot indicators */
.rufus-priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.rufus-priority-dot.urgent { background: #ef4444; }
.rufus-priority-dot.high   { background: #f59e0b; }
.rufus-priority-dot.normal { background: #3b82f6; }
.rufus-priority-dot.low    { background: #94a3b8; }

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}