/* FlowHearth - Design System
   ============================================================
   Single source of truth for all design tokens.
   All component CSS (global and scoped) should reference these variables.
   ============================================================ */

:root {
    /* ── Colors: Brand ── */
    --color-primary: #482888;
    --color-primary-dark: #371d6a;
    --color-primary-hover: #5a35a0;
    --color-primary-light: #f0e6fa;
    --color-primary-subtle: rgba(72, 40, 136, 0.06);
    --color-secondary: #f06010;

    /* ── Colors: Status / Semantic ── */
    --color-success: #43a047;
    --color-warning: #fb8c00;
    --color-danger: #e53935;
    --color-error: #e53935;
    --color-info: #039be5;

    /* ── Colors: Background ── */
    --color-bg: #f4f6f8;
    --color-surface: #ffffff;
    --bg-primary: #f4f6f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #eef1f5;

    /* ── Colors: Text ── */
    --color-text: #1a1028;
    --color-text-secondary: #64748b;
    --text-primary: #1a1028;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* ── Colors: Border ── */
    --color-border: #e2e8f0;

    /* ── Colors: Nav (dark sidebar) ── */
    --nav-bg: #1c102e;
    --nav-bg-hover: rgba(255, 255, 255, 0.08);
    --nav-text: rgba(255, 255, 255, 0.65);
    --nav-text-active: #ffffff;
    --nav-active-bg: rgba(240, 96, 16, 0.2);
    --nav-border: rgba(255, 255, 255, 0.06);

    /* ── Colors: Member palette (index → color) ── */
    --member-color-0: #1e88e5;
    --member-color-1: #8e24aa;
    --member-color-2: #00acc1;
    --member-color-3: #d81b60;
    --member-color-4: #6d4c41;
    --member-color-5: #78909c;
    --member-color-6: #5e35b1;
    --member-color-7: #f06292;
    --member-color-8: #4dd0e1;
    --member-color-9: #bcaaa4;

    /* ── Colors: Difficulty ── */
    --difficulty-easy: #43a047;
    --difficulty-medium: #fb8c00;
    --difficulty-hard: #e53935;

    /* ── Spacing scale ── */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* ── Border radius ── */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* ── Shadows ── */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);

    /* ── Typography ── */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.8125rem;
    --font-size-base: 0.9375rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.75rem;
    --font-size-4xl: 2rem;

    /* ── Transitions ── */
    --transition-fast: 120ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* ── Touch targets ── */
    --touch-target-min: 44px;

    /* ── Safe area ── */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* ── Bottom nav height (mobile) ── */
    --bottom-nav-height: 0px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    overscroll-behavior: none;
}

/* Loading Screen — Animated Splash */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 1.25rem;
    background: radial-gradient(ellipse at 50% 40%, #2a1650 0%, #1c102e 60%, #110a1e 100%);
    position: relative;
    overflow: hidden;
}

/* Ambient glow behind logo */
.splash-glow {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 96, 16, 0.25) 0%, rgba(72, 40, 136, 0.18) 50%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    animation: splash-glow-pulse 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes splash-glow-pulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -60%) scale(1); }
    50%      { opacity: 1;   transform: translate(-50%, -60%) scale(1.15); }
}

/* Spinning ring around logo */
.splash-logo-ring {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: splash-logo-enter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.splash-logo-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #f06010;
    border-right-color: #482888;
    animation: splash-ring-spin 1.6s linear infinite;
}

@keyframes splash-ring-spin {
    to { transform: rotate(360deg); }
}

@keyframes splash-logo-enter {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}

.splash-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    animation: splash-logo-float 3s ease-in-out infinite;
}

@keyframes splash-logo-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

/* Animated gradient brand text */
.splash-brand {
    font-family: 'Barlow Condensed', 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    animation: splash-text-enter 0.8s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes splash-text-enter {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.splash-flow {
    background: linear-gradient(135deg, #f06010, #ff8a40, #f06010);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: splash-gradient-shift 3s ease-in-out infinite;
}

.splash-hearth {
    background: linear-gradient(135deg, #482888, #7c4dff, #482888);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: splash-gradient-shift 3s ease-in-out infinite 0.5s;
}

@keyframes splash-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* Progress bar */
.splash-bar-track {
    width: 140px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: splash-bar-enter 0.6s 0.6s ease both;
}

@keyframes splash-bar-enter {
    from { opacity: 0; width: 0; }
    to   { opacity: 1; width: 140px; }
}

.splash-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #f06010, #482888, #f06010);
    background-size: 200% 100%;
    animation: splash-bar-slide 1.4s ease-in-out infinite;
}

@keyframes splash-bar-slide {
    0%   { width: 0%;   background-position: 0% 0; }
    50%  { width: 100%; background-position: 100% 0; }
    100% { width: 0%;   background-position: 0% 0; margin-left: 100%; }
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.main-content {
    flex: 1;
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + var(--bottom-nav-height) + var(--safe-bottom));
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Navigation – dark sidebar */
.nav-menu {
    width: 240px;
    background: var(--nav-bg);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.75rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: var(--nav-text-active);
    font-size: var(--font-size-lg);
    font-weight: 700;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
    background: #ffffff;
    border-radius: var(--radius-md);
    transition: box-shadow var(--transition-base), transform var(--transition-fast);
}

.nav-brand a:hover {
    box-shadow: 0 4px 16px rgba(72, 40, 136, 0.2);
    transform: translateY(-1px);
}

.brand-flow {
    color: var(--color-secondary);
}

.brand-hearth {
    color: var(--color-primary);
}

.brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    min-height: var(--touch-target-min);
    text-decoration: none;
    color: var(--nav-text);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-links a:hover {
    background: var(--nav-bg-hover);
    color: var(--nav-text-active);
}

.nav-links a.active {
    background: var(--nav-active-bg);
    color: var(--color-primary-light);
    font-weight: 600;
    position: relative;
}

.nav-links a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--color-secondary);
    animation: nav-indicator-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes nav-indicator-in {
    from { transform: scaleY(0); opacity: 0; }
    to   { transform: scaleY(1); opacity: 1; }
}

.nav-icon {
    font-size: var(--font-size-lg);
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-user {
    border-top: 1px solid var(--nav-border);
    padding-top: 1rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.nav-auth {
    margin-top: auto;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    align-items: stretch;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.25rem 0.5rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 700;
    flex-shrink: 0;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(240, 96, 16, 0.4);
}

.user-name {
    color: var(--nav-text-active);
    font-size: var(--font-size-sm);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    background: none;
    border: 1px solid var(--nav-border);
    padding: 0.4375rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--nav-text);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    border-color: rgba(240, 96, 16, 0.5);
    color: var(--color-primary-light);
    background: rgba(240, 96, 16, 0.1);
}

/* Nav Heart Selector */
.nav-heart-selector select {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--nav-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: var(--nav-text-active);
    cursor: pointer;
    transition: border-color var(--transition-fast);
    appearance: none;
    background-image: url("chevron-down.svg");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-heart-selector select:hover {
    border-color: rgba(240, 96, 16, 0.5);
}

.nav-heart-selector select:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(240, 96, 16, 0.15);
}

.nav-heart-selector select option {
    background: var(--nav-bg);
    color: var(--nav-text-active);
}

/* Language Toggle */
.language-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 0 0.5rem;
}

.lang-btn {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--nav-text);
    font-weight: 600;
    font-size: var(--font-size-xs);
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    color: var(--nav-text-active);
}

.lang-btn.active {
    background: var(--nav-active-bg);
    color: var(--color-primary-light);
}

.lang-separator {
    color: var(--nav-text);
    opacity: 0.3;
    font-weight: 300;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.01em;
    min-height: var(--touch-target-min);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 1px 3px rgba(72, 40, 136, 0.3);
}

@media (hover: hover) {
    .btn-primary:hover:not(:disabled) {
        background: var(--color-primary-hover);
        box-shadow: 0 4px 12px rgba(72, 40, 136, 0.3);
        transform: translateY(-1px);
    }
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:active:not(:disabled) {
    background: var(--color-border);
    transform: scale(0.97);
}

.btn-success {
    background: var(--color-success);
    color: white;
    transition: all var(--transition-fast);
}

@media (hover: hover) {
    .btn-success:hover:not(:disabled) {
        box-shadow: 0 4px 14px rgba(67, 160, 71, 0.35);
        transform: translateY(-1px);
    }
}

.btn-success:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
    transition: all var(--transition-fast);
}

@media (hover: hover) {
    .btn-danger:hover:not(:disabled) {
        box-shadow: 0 4px 14px rgba(229, 57, 53, 0.35);
        transform: translateY(-1px);
    }
}

.btn-danger:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-sm);
}

.btn-icon {
    padding: 0.5rem;
    background: none;
    border: 1px solid var(--color-border);
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
}

.btn-icon.btn-danger {
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.btn-icon.btn-danger:hover {
    background: var(--color-danger);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    min-height: var(--touch-target-min);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background: var(--color-surface);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--color-text-secondary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(72, 40, 136, 0.1);
    animation: input-focus-glow 0.3s ease-out;
}

@keyframes input-focus-glow {
    from { box-shadow: 0 0 0 0 rgba(72, 40, 136, 0.3); }
    to   { box-shadow: 0 0 0 3px rgba(72, 40, 136, 0.1); }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── Shared page-enter keyframes ── */
@keyframes page-enter {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slide-up-stagger {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Dashboard */
.dashboard {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    animation: page-enter 0.4s ease-out both;
}

/* Dashboard toolbar - two-zone layout */
.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    flex-wrap: wrap;
    overflow: hidden;
    animation: slide-up-stagger 0.35s ease-out both;
}

.toolbar-start,
.toolbar-end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--color-border);
    flex-shrink: 0;
}

.week-navigation {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    flex-shrink: 1;
}

.week-navigation .btn-icon {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    transition: all var(--transition-fast);
}

.week-navigation .btn-icon:hover {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

.week-navigation .btn-link {
    font-weight: 600;
    font-size: var(--font-size-base);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    letter-spacing: -0.01em;
}

.week-navigation .btn-link:hover {
    background: var(--bg-hover);
}

/* ============================================================
   Calendar Time Grid
   ============================================================ */
.calendar-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
}

/* Sticky header row: corner spacer + day headers */
.calendar-header {
    display: flex;
    flex-shrink: 0;
    border-bottom: 2px solid var(--color-border);
    background: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 5;
}

.calendar-corner {
    width: 3.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-corner .add-activity-header-btn {
    width: 2rem;
    height: 2rem;
    font-size: var(--font-size-lg);
}

.calendar-header .day-header {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.375rem;
    border-left: 1px solid var(--color-border);
    text-align: center;
    transition: background var(--transition-fast);
}

.calendar-header .day-header.today {
    background: var(--color-primary-subtle, rgba(78, 205, 196, 0.08));
}

.day-header-info {
    flex: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .day-header-info:hover {
        opacity: 0.8;
    }
}

.day-header-info:active {
    opacity: 0.6;
}

.add-activity-header-btn {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: none;
    cursor: pointer;
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

@media (hover: hover) {
    .add-activity-header-btn:hover {
        border-color: var(--color-primary);
        color: var(--color-primary);
        background: var(--color-primary-subtle, rgba(78, 205, 196, 0.1));
    }
}

.add-activity-header-btn:active {
    transform: scale(0.92);
    background: var(--color-primary-subtle, rgba(78, 205, 196, 0.1));
}

/* Scrollable body: time gutter + lanes */
.calendar-body {
    display: flex;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Left-side hour labels */
.calendar-time-gutter {
    width: 3.5rem;
    flex-shrink: 0;
}

.hour-slot {
    height: var(--hour-height, 60px);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0 0.375rem 0 0;
    box-sizing: border-box;
    border-top: 1px solid var(--color-border);
}

.hour-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1;
    transform: translateY(-0.35em);
    user-select: none;
}

/* Grid of day lanes */
.calendar-lanes {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    min-width: 0;
}

.calendar-lane {
    position: relative;
    border-left: 1px solid var(--color-border);
    background-image:
        repeating-linear-gradient(
            to bottom,
            var(--color-border) 0px,
            var(--color-border) 1px,
            transparent 1px,
            transparent var(--hour-height, 60px)
        ),
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent calc(var(--hour-height, 60px) / 2 - 0.5px),
            rgba(0,0,0,0.05) calc(var(--hour-height, 60px) / 2 - 0.5px),
            rgba(0,0,0,0.05) calc(var(--hour-height, 60px) / 2 + 0.5px),
            transparent calc(var(--hour-height, 60px) / 2 + 0.5px),
            transparent var(--hour-height, 60px)
        );
}

.calendar-lane.today {
    background-color: var(--color-primary-subtle, rgba(78, 205, 196, 0.04));
}

/* Activity cards within lanes are positioned absolutely by start/end time */
.calendar-lane .activity-card {
    position: absolute;
    left: 2px;
    right: 2px;
    z-index: 1;
    overflow: hidden;
}

.calendar-lane .activity-card:hover {
    z-index: 2;
}

/* Day mode: single lane, wider */
.calendar-container.day-mode {
    max-width: none;
}

.calendar-container.day-mode .calendar-lanes {
    grid-template-columns: 1fr;
}

.calendar-container.day-mode .day-header-info {
    cursor: default;
}

/* Inline loading overlay */
.calendar-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(245, 245, 245, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius-md);
    animation: fade-in 0.2s ease-out both;
}

/* Day header text */
.day-name {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    text-transform: uppercase;
}

.day-number {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 600;
}



/* Week picker input */
.week-picker-input {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    background: var(--color-surface);
    transition: border-color var(--transition-fast);
}

.week-picker-input:hover {
    border-color: var(--color-primary);
}

/* Date navigation (day mode toolbar) */
.date-navigation {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    flex-shrink: 1;
}

.date-display {
    font-size: var(--font-size-md);
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 14rem;
    text-align: center;
}

.date-picker-input {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
    background: var(--color-surface);
    transition: border-color var(--transition-fast);
}

.today-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    background: var(--color-primary-subtle, rgba(78, 205, 196, 0.12));
    border-radius: 999px;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.date-picker-input:hover {
    border-color: var(--color-primary);
}

.activity-card {
    padding: 0.375rem 0.625rem;
    border-radius: 14px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--card-accent) 25%, #fff5f9) 0%,
        color-mix(in srgb, var(--card-accent) 12%, #fffbf0) 50%,
        color-mix(in srgb, var(--card-accent) 8%, #f0f9ff) 100%);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    border: 1.5px solid color-mix(in srgb, var(--card-accent) 30%, #eee);
    border-left: 4px solid var(--card-accent, #482888);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--card-accent) 12%, transparent);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    animation: card-pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Stagger cards by nth-child for delightful cascade */
.calendar-lane .activity-card:nth-child(1) { animation-delay: 0s; }
.calendar-lane .activity-card:nth-child(2) { animation-delay: 0.06s; }
.calendar-lane .activity-card:nth-child(3) { animation-delay: 0.12s; }
.calendar-lane .activity-card:nth-child(4) { animation-delay: 0.18s; }
.calendar-lane .activity-card:nth-child(5) { animation-delay: 0.24s; }
.calendar-lane .activity-card:nth-child(n+6) { animation-delay: 0.3s; }

@media (hover: hover) {
    .activity-card:hover {
        transform: translateY(-2px) scale(1.01);
        box-shadow: 0 6px 18px color-mix(in srgb, var(--card-accent) 20%, transparent);
    }
}

.activity-card:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-sm);
}

.activity-card.task {
    --card-accent: var(--color-success);
}

.activity-card.appointment {
    --card-accent: var(--color-secondary);
}

.activity-time {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.01em;
}

.activity-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.completed-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--color-success);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: backdrop-fade-in 0.25s ease-out both;
}

@keyframes backdrop-fade-in {
    from { opacity: 0; backdrop-filter: blur(0); }
    to   { opacity: 1; backdrop-filter: blur(4px); }
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modal-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.create-activity-modal {
    max-width: 540px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
}

.close-btn {
    background: none;
    border: none;
    font-size: var(--font-size-2xl);
    cursor: pointer;
    color: var(--color-text-secondary);
    line-height: 1;
    padding: 0.25rem;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.close-btn:hover {
    background: var(--color-bg);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Type Toggle (segmented control) */
.type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 1.25rem;
}

.type-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.type-toggle-btn.active {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    animation: chip-select 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.type-toggle-btn:not(.active):hover {
    color: var(--color-text);
}

.type-toggle-btn:active {
    transform: scale(0.97);
}

.type-icon {
    font-size: var(--font-size-lg);
}

/* Assignee Chips */
.assignee-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.assignee-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
    min-height: var(--touch-target-min);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all 0.15s;
    color: var(--color-text);
}

.assignee-chip:hover {
    border-color: var(--color-primary);
    background: rgba(72, 40, 136, 0.04);
}

.assignee-chip:active {
    transform: scale(0.96);
}

.assignee-chip.selected {
    border-color: var(--color-primary);
    background: rgba(72, 40, 136, 0.08);
    animation: chip-select 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chip-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    flex-shrink: 0;
}

.chip-name {
    font-weight: 500;
}

.chip-check {
    color: var(--color-primary);
    font-size: var(--font-size-xs);
    font-weight: 700;
}

/* Checkbox label */
.checkbox-label {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--color-text) !important;
    font-size: var(--font-size-base) !important;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    accent-color: var(--color-primary);
}

/* Deadline input */
.deadline-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.deadline-input .form-input {
    width: 80px;
    flex-shrink: 0;
}

/* Input with suffix */
.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-with-suffix .form-input {
    flex: 1;
}

.input-suffix {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

/* Form input utility */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(72, 40, 136, 0.1);
}

/* Recurrence Section */
.recurrence-section {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.5rem;
}

.day-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.day-chip {
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all 0.15s;
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-chip:hover {
    border-color: var(--color-primary);
}

.day-chip:active {
    transform: scale(0.93);
}

.day-chip.selected {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    animation: chip-select 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chip-select {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.recurrence-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: rgba(72, 40, 136, 0.1);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-primary);
}

.recurrence-info {
    margin-left: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.recurrence-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

/* Economy Page */
.economy-page {
    max-width: 1000px;
    margin: 0 auto;
    animation: page-enter 0.4s ease-out both;
}

.economy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.coin-balance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-2xl);
    font-weight: 600;
    animation: slide-up-stagger 0.4s ease-out both;
}

.coin-icon {
    font-size: 1.25em;
    animation: coin-shine 2s ease-in-out infinite;
}

@keyframes coin-shine {
    0%, 100% { filter: brightness(1); transform: rotate(0deg); }
    25%      { filter: brightness(1.3); transform: rotate(5deg); }
    50%      { filter: brightness(1); transform: rotate(0deg); }
    75%      { filter: brightness(1.2); transform: rotate(-5deg); }
}

.economy-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    animation: card-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.economy-stats .stat-card:nth-child(1) { animation-delay: 0.05s; }
.economy-stats .stat-card:nth-child(2) { animation-delay: 0.1s; }
.economy-stats .stat-card:nth-child(3) { animation-delay: 0.15s; }
.economy-stats .stat-card:nth-child(4) { animation-delay: 0.2s; }

.stat-value {
    display: block;
    font-size: var(--font-size-4xl);
    font-weight: 600;
    color: var(--color-primary);
    animation: stat-value-pop 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes stat-value-pop {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}

.stat-label {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.economy-sections section {
    margin-bottom: 2rem;
}

.economy-sections h2 {
    margin-bottom: 1rem;
}

.voucher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.voucher-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    animation: card-pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.voucher-grid .voucher-card:nth-child(1) { animation-delay: 0.05s; }
.voucher-grid .voucher-card:nth-child(2) { animation-delay: 0.1s; }
.voucher-grid .voucher-card:nth-child(3) { animation-delay: 0.15s; }
.voucher-grid .voucher-card:nth-child(4) { animation-delay: 0.2s; }
.voucher-grid .voucher-card:nth-child(n+5) { animation-delay: 0.25s; }

@media (hover: hover) {
    .voucher-card:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: var(--shadow-md);
    }
}

.voucher-card.unavailable {
    opacity: 0.6;
}

.voucher-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.voucher-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.voucher-price {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.voucher-stock {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.voucher-card .btn {
    width: 100%;
}

/* Error UI */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    background: var(--color-danger);
    color: white;
    padding: 1rem;
    text-align: center;
    z-index: 9999;
}

#blazor-error-ui.show {
    display: block;
}

/* Error Boundary */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.error-card {
    text-align: center;
    max-width: 420px;
    background: var(--color-surface);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    animation: error-shake 0.5s ease-out both;
}

@keyframes error-shake {
    0%   { transform: translateX(0); opacity: 0; }
    15%  { transform: translateX(-8px); opacity: 1; }
    30%  { transform: translateX(6px); }
    45%  { transform: translateX(-4px); }
    60%  { transform: translateX(2px); }
    75%  { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

.error-card h2 {
    margin: 0 0 0.75rem;
    font-size: var(--font-size-2xl);
}

.error-card p {
    color: var(--color-text-secondary, #666);
    margin: 0 0 1.5rem;
}

.error-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* No-data / empty state */
.no-data-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-secondary, #666);
}

.no-data-message p {
    font-size: var(--font-size-lg);
}

/* Placeholder pages (coming soon) */
.page-placeholder {
    text-align: center;
    padding: 4rem 1rem;
}

.page-placeholder h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: 1rem;
}

.page-placeholder .coming-soon {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary, #666);
}

/* Activity badges on week view cards */
.activity-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.badge-late {
    background: rgba(244, 67, 54, 0.12);
    color: var(--color-danger);
}

.badge-near-deadline {
    background: rgba(255, 152, 0, 0.12);
    color: var(--color-warning);
}

.badge-points {
    background: rgba(76, 175, 80, 0.10);
    color: var(--color-success);
}

/* Status filter */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.filter-bar select,
.heart-selector select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: border-color var(--transition-fast);
    appearance: none;
    background-image: url("chevron-down.svg");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.75rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-bar select:hover,
.heart-selector select:hover {
    border-color: var(--color-primary);
}

.filter-bar select:focus,
.heart-selector select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(72, 40, 136, 0.1);
}

/* Activity card enhancements */
.activity-card.near-deadline {
    --card-accent: var(--color-warning);
}

.activity-card.completed .activity-title {
    text-decoration: line-through;
}

/* Revert button */
.btn-warning {
    background: var(--color-warning);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #e68900;
}

.btn-warning:active:not(:disabled) {
    transform: scale(0.97);
}

/* ============================================================
   Responsive: Tablet Landscape (≤1200px)
   Narrow sidebar → icon-only rail, more room for calendar
   ============================================================ */
@media (max-width: 1200px) {
    .nav-menu {
        width: 72px;
        padding: 1rem 0.5rem;
        align-items: center;
    }

    .nav-brand a {
        padding: 0.375rem;
        justify-content: center;
    }

    .brand-text {
        display: none;
    }

    .nav-label {
        display: none;
    }

    .nav-links a {
        justify-content: center;
        padding: 0.625rem;
    }

    .nav-icon {
        font-size: var(--font-size-xl);
    }

    .nav-user {
        align-items: center;
    }

    .user-name {
        display: none;
    }

    .nav-heart-selector select {
        font-size: var(--font-size-xs);
        padding: 0.25rem 0.375rem;
        padding-right: 1.25rem;
        max-width: 56px;
    }

    .language-toggle {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    .lang-separator {
        display: none;
    }

    .logout-btn {
        font-size: var(--font-size-xs);
        padding: 0.375rem;
        text-align: center;
    }
}

/* ============================================================
   Responsive: Tablet Portrait (≤1024px)
   Calendar columns narrower, toolbar wraps, wider modals,
   larger touch targets for day headers and add buttons.
   ============================================================ */
@media (max-width: 1024px) {
    .main-content {
        padding: 1rem;
        padding-bottom: calc(1rem + var(--bottom-nav-height) + var(--safe-bottom));
    }

    .dashboard-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .toolbar-start,
    .toolbar-end {
        justify-content: center;
        flex-wrap: wrap;
    }

    .toolbar-divider {
        display: none;
    }

    /* Wider modals on tablet to use available space */
    .modal-content {
        width: 94%;
        max-width: 600px;
    }

    /* Day headers: bigger touch targets */
    .calendar-header .day-header {
        padding: 0.625rem 0.5rem;
    }

    .day-header-info {
        min-height: var(--touch-target-min);
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Add-activity button in header: ensure comfortable tap */
    .add-activity-header-btn {
        width: 48px;
        height: 48px;
        font-size: var(--font-size-xl);
    }

    /* Modal footer buttons: touch-sized */
    .modal-footer .btn {
        min-height: var(--touch-target-min);
    }

    .economy-page,
    .stats-page,
    .settings-page {
        padding: var(--spacing-md);
    }
}

/* ============================================================
   Responsive: Mobile (≤768px)
   Bottom tab bar, sidebar hidden, single-column calendar,
   fullscreen modals, stacked form rows.
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --bottom-nav-height: 56px;
    }

    /* Layout: hide sidebar, stack vertically */
    .app-layout {
        flex-direction: column;
    }
    
    .nav-menu {
        /* The sidebar becomes a fixed bottom tab bar */
        width: 100%;
        height: auto;
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        flex-direction: column;
        padding: 0;
        padding-bottom: var(--safe-bottom);
        border-top: 1px solid var(--nav-border);
    }

    .nav-brand {
        display: none;
    }

    .nav-links {
        flex-direction: row;
        justify-content: space-around;
        gap: 0;
        width: 100%;
        padding: 0;
    }

    .nav-links a {
        flex: 1;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.125rem;
        padding: 0.375rem 0;
        min-height: calc(var(--bottom-nav-height) - 2px);
        border-radius: 0;
        font-size: var(--font-size-xs);
    }

    .nav-label {
        display: block;
        font-size: 0.625rem;
        font-weight: 500;
        line-height: 1;
    }

    .nav-icon {
        font-size: 1.25rem;
    }

    .nav-user {
        display: none;
    }

    .nav-auth {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        padding: 0.5rem;
        min-height: calc(var(--bottom-nav-height) - 2px);
    }

    /* Main content accounts for bottom nav */
    .main-content {
        padding: 0.75rem;
        padding-bottom: calc(0.75rem + var(--bottom-nav-height) + var(--safe-bottom));
        padding-top: calc(0.75rem + var(--safe-top));
    }

    /* Dashboard toolbar */
    .dashboard-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.375rem;
        padding: 0.5rem 0.625rem;
        border-radius: var(--radius-md);
    }

    .toolbar-start,
    .toolbar-end {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.375rem;
    }

    .toolbar-divider {
        display: none;
    }

    .date-display {
        font-size: var(--font-size-sm);
    }

    .filter-bar select,
    .heart-selector select {
        max-width: 140px;
        font-size: var(--font-size-sm);
    }

    /* Calendar: single column for week view on mobilephones */
    .calendar-lanes {
        grid-template-columns: 1fr;
    }

    .calendar-header .day-header {
        display: none;
    }

    .calendar-header .day-header.today {
        display: flex;
    }

    .calendar-corner {
        display: none;
    }

    /* ── Mobile card optimizations ── */
    .calendar-lane .activity-card {
        align-content: flex-start;
    }

    .card-inner .activity-title {
        font-size: 0.875rem;
    }

    .week-card-time {
        display: inline;
        flex-shrink: 0;
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--color-text-secondary);
        white-space: nowrap;
    }

    .activity-difficulty {
        font-size: 1.125rem;
    }

    .card-inner .overlap-indicator {
        font-size: 0.7rem;
    }

    /* Forms stack on mobile */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Modals: fullscreen on mobile for better usability */
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
        animation: modal-slide-up 0.25s ease-out;
    }

    @keyframes modal-slide-up {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .modal-header {
        padding: 1rem;
        padding-top: calc(1rem + var(--safe-top));
        position: sticky;
        top: 0;
        background: var(--color-surface);
        z-index: 1;
    }

    .modal-body {
        padding: 1rem;
        flex: 1;
        overflow-y: auto;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + var(--safe-bottom));
        position: sticky;
        bottom: 0;
        background: var(--color-surface);
        z-index: 1;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 0;
        min-height: var(--touch-target-min);
        font-size: var(--font-size-base);
    }

    /* Toast: centered at bottom on mobile */
    .toast {
        left: var(--spacing-md);
        right: var(--spacing-md);
        bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + var(--spacing-md));
        text-align: center;
        border-radius: var(--radius-md);
    }

    /* Pages with max-width constraint */
    .economy-page,
    .stats-page,
    .settings-page {
        padding: var(--spacing-sm);
    }

    /* Economy stat cards stack on small screens */
    .economy-stats {
        grid-template-columns: 1fr 1fr;
    }

    .voucher-grid {
        grid-template-columns: 1fr;
    }

    /* Stats grid adapts */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Pending invites */
    .pending-invite-card {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }

    .invite-buttons {
        justify-content: stretch;
    }

    .invite-buttons .btn {
        flex: 1;
    }

    /* HeartSettings member rows */
    .member-row {
        flex-wrap: wrap;
    }

    .member-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Challenge grid */
    .challenge-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================
   Responsive: Small Mobile (≤480px)
   Further tightening for narrow phones
   ============================================================ */
@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
        padding-bottom: calc(0.5rem + var(--bottom-nav-height) + var(--safe-bottom));
    }

    .dashboard-toolbar {
        padding: 0.375rem 0.5rem;
        border-radius: var(--radius-sm);
    }

    .economy-stats {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }

    .challenge-grid {
        grid-template-columns: 1fr;
    }

    .week-navigation .btn-link,
    .date-display {
        font-size: var(--font-size-sm);
    }

    .stat-tile .stat-value {
        font-size: var(--font-size-lg);
    }

    .calendar-header .day-header.today {
        display: flex;
    }

    .calendar-corner {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Shared layout patterns (used by Settings, HeartSettings, etc.)
   ============================================================ */

/* Settings-style page container */
.settings-page {
    max-width: 640px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    animation: page-enter 0.4s ease-out both;
}

.settings-page h1 {
    margin-bottom: var(--spacing-lg);
}

/* Card-like section */
.settings-section {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
    animation: slide-up-stagger 0.4s ease-out both;
}

.settings-section:nth-child(1) { animation-delay: 0.05s; }
.settings-section:nth-child(2) { animation-delay: 0.1s; }
.settings-section:nth-child(3) { animation-delay: 0.15s; }
.settings-section:nth-child(4) { animation-delay: 0.2s; }
.settings-section:nth-child(n+5) { animation-delay: 0.25s; }

.settings-section h2 {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-xl);
    color: var(--color-text);
}

/* Alerts */
.alert {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
    animation: alert-slide-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes alert-slide-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.12);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.alert-error {
    background-color: rgba(244, 67, 54, 0.12);
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

/* Form actions row */
.form-actions {
    margin-top: var(--spacing-lg);
    display: flex;
    justify-content: flex-end;
}

/* Field hint */
.field-hint {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.field-hint.verified {
    color: var(--color-success);
}

.field-hint.pending {
    color: var(--color-warning);
}

/* Section hint */
.section-hint {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

/* Empty message */
.empty-message {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.status-badge.finalized {
    background: rgba(76, 175, 80, 0.12);
    color: var(--color-success);
}

.status-badge.active {
    background: rgba(33, 150, 243, 0.12);
    color: var(--color-secondary);
}

.status-badge.inactive {
    background: rgba(158, 158, 158, 0.12);
    color: var(--text-muted);
}

/* Leaderboard (shared by Stats + Economy) */
.leaderboard-section {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
    animation: slide-up-stagger 0.4s 0.1s ease-out both;
}

.leaderboard-section h2 {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    animation: slide-up-stagger 0.35s ease-out both;
}

.leaderboard-list .leaderboard-entry:nth-child(1) { animation-delay: 0.05s; }
.leaderboard-list .leaderboard-entry:nth-child(2) { animation-delay: 0.1s; }
.leaderboard-list .leaderboard-entry:nth-child(3) { animation-delay: 0.15s; }
.leaderboard-list .leaderboard-entry:nth-child(4) { animation-delay: 0.2s; }
.leaderboard-list .leaderboard-entry:nth-child(n+5) { animation-delay: 0.25s; }

.leaderboard-entry .rank {
    font-size: var(--font-size-lg);
    min-width: 2rem;
    text-align: center;
}

.leaderboard-entry .name,
.leaderboard-entry .entry-name {
    flex: 1;
    font-weight: 500;
}

.leaderboard-entry .value,
.leaderboard-entry .entry-value {
    font-weight: 600;
    color: var(--color-primary);
}

/* Challenges (shared by Stats + Economy) */
.challenges-section {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
    animation: slide-up-stagger 0.4s 0.15s ease-out both;
}

.challenges-section h2 {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
}

.challenge-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.challenge-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.challenge-name {
    font-weight: 500;
}

.challenge-winner {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.challenge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.challenge-card {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    animation: card-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.challenge-icon {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-sm);
    animation: coin-shine 3s ease-in-out infinite;
}

.winner-name {
    font-weight: 600;
}

.winner-value {
    color: var(--color-primary);
    font-weight: 500;
    margin-left: var(--spacing-xs);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    z-index: 2000;
    animation: toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.success {
    background: var(--color-success);
}

.toast.error {
    background: var(--color-error);
}

/* Dashboard extras */
.no-heart-message {
    text-align: center;
    padding: var(--spacing-xl);
    animation: page-enter 0.5s ease-out both;
}

.no-heart-message h2 {
    margin-bottom: var(--spacing-md);
}

.no-heart-message p {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
}

.heart-selector select {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.pending-invites-banner {
    background: rgba(33, 150, 243, 0.08);
    border: 1px solid var(--color-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    animation: alert-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pending-invites-banner h3 {
    margin: 0 0 var(--spacing-sm);
}

.pending-invite-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}

.invite-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.invite-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.holiday-indicator {
    font-size: var(--font-size-xs);
}

/* Overlap warning (Create/Edit modal) */
.overlap-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-warning);
    margin-top: var(--spacing-sm);
}

.overlap-warning p {
    margin: 0 0 var(--spacing-sm);
    font-weight: 600;
}

.overlap-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.overlap-list li {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(255, 152, 0, 0.08);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: var(--font-size-sm);
}

.overlap-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

/* Subtask row (Create/Edit modal) */
.subtask-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.subtask-row .form-input {
    flex: 1;
}

.subtask-row .btn-icon {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    flex-shrink: 0;
}

/* Recurrence existing display */
.recurrence-existing {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Flex utility for form-group */
.form-group-flex-2 {
    flex: 2;
}

.form-group-flex-1 {
    flex: 1;
}

/* Index / landing page */
.index-container {
    text-align: center;
    padding: var(--spacing-xl);
}

.index-cta {
    margin-top: var(--spacing-xl);
}

.index-cta .btn {
    text-decoration: none;
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: var(--font-size-lg);
}

/* =========================================================
   Card State Indicator (right-side strip via ::after)
   ========================================================= */
.activity-card.state-completed::after,
.activity-card.state-late::after,
.activity-card.state-near-deadline::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    pointer-events: none;
    z-index: 2;
}

.activity-card.state-completed::after {
    background: #66bb6a;
}
.activity-card.state-completed {
    opacity: 0.65;
}
.activity-card.state-late::after {
    background: #ef5350;
}
.activity-card.state-near-deadline::after {
    background: #ffa726;
}

/* Card inner layout — single row: title, star, overlap badge */
.card-inner {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    overflow: hidden;
}
.card-inner .activity-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--color-text);
}

.activity-difficulty {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
    -webkit-text-stroke: 1px #333;
    paint-order: stroke fill;
}
.activity-difficulty.star-bronze {
    color: #cd7f32;
}
.activity-difficulty.star-silver {
    color: #a8a8a8;
}
.activity-difficulty.star-gold {
    color: #ffc800;
    text-shadow: 0 0 4px rgba(255, 200, 0, 0.5);
}
.card-inner .overlap-indicator {
    position: static;
    flex-shrink: 0;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--color-danger);
    line-height: 1;
}

/* Week card time — hidden on desktop (columns too narrow), shown on mobile */
.week-card-time {
    display: none;
}

/* =========================================================
   Transport Segments
   ========================================================= */
.transport-segment {
    position: absolute;
    left: 2px;
    right: 2px;
    z-index: 0;
    background: repeating-linear-gradient(
        -45deg,
        rgba(0,0,0,0.04),
        rgba(0,0,0,0.04) 4px,
        transparent 4px,
        transparent 8px
    );
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    pointer-events: none;
    opacity: 0.7;
}
.transport-segment.transport-pre {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.transport-segment.transport-post {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* =========================================================
   Overlap Badge (legacy – replaced by overlap-indicator)
   ========================================================= */

/* =========================================================
   Overlap Modal
   ========================================================= */
.overlap-modal {
    min-width: 320px;
    max-width: 440px;
}
.overlap-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.overlap-item:hover {
    background: var(--color-surface-hover, rgba(0,0,0,0.04));
}
.overlap-item-time {
    font-size: var(--font-size-sm);
    font-weight: 600;
}
.overlap-item-title {
    font-size: var(--font-size-sm);
}

/* =========================================================
   Now Line — current time indicator
   ========================================================= */
.now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-danger, #e53935);
    z-index: 3;
    pointer-events: none;
}
.now-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-danger, #e53935);
    animation: now-dot-pulse 2s ease-in-out infinite;
}
.now-line::after {
    content: '';
    position: absolute;
    left: -8px;
    top: -7px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(229, 57, 53, 0.25);
    animation: now-dot-pulse 2s ease-in-out infinite;
}

@keyframes now-dot-pulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.4); opacity: 0.5; }
}

/* =========================================================
   Empty Day State
   ========================================================= */
.empty-day-state {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--color-text-secondary);
    z-index: 2;
    white-space: nowrap;
    animation: empty-state-float 0.5s ease-out both;
}

@keyframes empty-state-float {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.empty-day-state p {
    margin-bottom: 0.75rem;
    font-size: var(--font-size-base);
}

/* =========================================================
   Day View — Enhanced Card Content
   ========================================================= */
.day-card-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.day-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-top: 0.15rem;
    flex-wrap: wrap;
}
.day-card-assignee {
    font-weight: 500;
    color: var(--color-text-secondary);
}
.day-card-type {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    background: rgba(0,0,0,0.06);
}
.day-card-subtasks {
    font-weight: 500;
}
.day-card-duration {
    font-weight: 500;
}

/* =========================================================
   Day View — Per-Member Lane Mode
   ========================================================= */
.calendar-container.day-mode.multi-lane .calendar-lanes {
    grid-template-columns: repeat(var(--member-count, 1), 1fr);
}
.calendar-container.day-mode.multi-lane .calendar-header .day-header {
    display: none;
}
.member-lane-headers {
    display: flex;
    flex: 1;
    min-width: 0;
}
.member-lane-header {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.25rem;
    border-left: 1px solid var(--color-border);
    text-align: center;
}
.member-lane-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-lane-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    flex-shrink: 0;
}

/* Lane mode toggle */
.lane-toggle {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 2px;
    border: 1px solid var(--color-border);
}
.lane-toggle-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.lane-toggle-btn.active {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* Unassigned lane */
.unassigned-lane-header .member-lane-avatar {
    background: #43a047 !important;
}
.unassigned-lane-header .member-lane-name {
    color: #43a047;
}
.calendar-lane.unassigned-lane {
    background-image:
        repeating-linear-gradient(to bottom,
            var(--color-border) 0px, var(--color-border) 1px,
            transparent 1px, transparent var(--hour-height, 60px)),
        repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent calc(var(--hour-height, 60px) / 2 - 0.5px),
            rgba(67, 160, 71, 0.05) calc(var(--hour-height, 60px) / 2 - 0.5px),
            rgba(67, 160, 71, 0.05) calc(var(--hour-height, 60px) / 2 + 0.5px),
            transparent calc(var(--hour-height, 60px) / 2 + 0.5px),
            transparent var(--hour-height, 60px));
}
.activity-card.unassigned {
    --card-accent: #43a047;
}

/* Segmented accent for multi-assignee cards in combined view */
.activity-card[style*="--card-accent-gradient"] {
    border-left: none;
    border-image: var(--card-accent-gradient) 1;
    border-left-width: 4px;
    border-left-style: solid;
}

/* =========================================================
   Swipe Container
   ========================================================= */
.swipe-container {
    touch-action: pan-y;
}

/* =========================================================
   Accessibility: Reduced Motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}