/* Habits Tab Styles */

.habits-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Hero title for empty state */
.habits-hero-title {
    font-size: 2rem;
    font-weight: 500;
    color: var(--bs-body-color);
    margin-bottom: 2rem;
}

/* Regular title when habits exist */
.habits-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--bs-body-color);
}

/* ========== HABIT CARDS ROW ========== */

.habits-cards-row {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.habit-card {
    flex: 1;
    min-height: 160px;
    border-radius: 16px;
    transition: all 0.2s ease;
}

/* Empty card style (dashed) */
.habit-card-empty {
    border: 2px dashed var(--bs-border-color);
    background: transparent;
}

/* First card in empty state - clickable */
.habit-card-first {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover handled in later section */

.first-step-content {
    text-align: center;
    padding: 1rem;
}

.add-icon-large {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--bf-accent);
    color: white;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 300;
    margin: 0 auto 1rem auto;
}

.first-step-text {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--bs-body-color);
}

/* Filled habit card */
.habit-card.filled {
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.habit-card.filled:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.habit-card-body {
    margin-bottom: 0.75rem;
}

.habit-statement {
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0;
    color: var(--bs-body-color);
    line-height: 1.4;
}

.habit-action-text {
    font-weight: 500;
}

.habit-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--bs-border-color);
    padding-top: 0.75rem;
}

.habit-streak {
    font-size: 0.8rem;
    color: var(--bf-accent);
    font-weight: 500;
}



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

.habit-actions .btn-link {
    padding: 0.25rem;
    color: var(--bs-secondary-color);
}

.habit-actions .btn-link:hover {
    color: var(--bs-primary);
}

.habit-actions .btn-link.text-danger:hover {
    color: var(--color-red);
}

.habit-completed-badge {
    font-size: 0.85rem;
    color: var(--color-green);
    font-weight: 500;
}

.habit-skipped-badge {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
}

/* Add icon for empty slots when has some habits */
.add-habit-trigger.habit-card-empty:not(.habit-card-first) {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover handled in later section */

.add-icon {
    font-size: 2rem;
    color: var(--bs-secondary-color);
}

/* Icon color handled by parent hover */

/* ========== WIZARD MODAL ========== */

#habitWizardModal .modal-dialog {
    max-width: 600px;
}

.wizard-modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

.wizard-orange-bar {
    height: 6px;
    background: var(--bf-accent);
}

.wizard-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.habit-wizard-body {
    padding: 2rem;
}

/* Wizard title and subtitle */
.wizard-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--bf-text);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.wizard-subtitle {
    font-size: 0.9rem;
    color: var(--bf-muted-2);
    margin: 0 0 1.25rem 0;
}

/* Featured habits cards */
.wizard-featured-habits {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.featured-habit-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--bf-border);
    border-radius: 12px;
    background: var(--bf-surface-2);
    cursor: pointer;
    transition: all 0.15s ease;
}

.featured-habit-card:hover {
    border-color: var(--bf-accent-border-light);
    background: var(--bf-accent-lighter);
}

.featured-habit-card.selected {
    border-color: var(--bf-accent);
    background: var(--bf-accent-lighter);
}

.featured-habit-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.featured-habit-content {
    flex: 1;
}

.featured-habit-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--bf-text);
    margin-bottom: 0;
}

.featured-habit-desc {
    font-size: 0.8rem;
    color: var(--bf-muted-2);
    margin-top: 2px;
}

/* More ideas section */
.wizard-more-ideas {
    margin-bottom: 0.75rem;
}

/* More ideas dropdown */
.wizard-more-ideas {
    margin-bottom: 0.75rem;
}

.more-ideas-select {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bf-muted);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    padding: 0.6rem 0.75rem;
    background-color: var(--bf-surface);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.more-ideas-select:hover {
    border-color: var(--bf-accent-border-light);
}

.more-ideas-select:focus {
    border-color: var(--bf-accent);
    box-shadow: 0 0 0 2px var(--bf-accent-lighter);
    outline: none;
}

.more-ideas-select option {
    font-weight: 500;
    color: var(--bf-text);
}

/* Create own habit */
.wizard-create-own {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--bf-border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 0;
}

.wizard-create-own:hover {
    border-color: var(--bf-accent);
    background: var(--bf-accent-lighter);
}

.wizard-create-own.active {
    border-color: var(--bf-accent);
    border-style: solid;
    background: var(--bf-accent-lighter);
}

.create-own-icon {
    color: var(--bf-accent);
    font-size: 1rem;
    font-weight: 500;
}

.create-own-text {
    font-size: 0.875rem;
    color: var(--bf-text-secondary);
}

/* Custom input */
.wizard-custom-input {
    margin-bottom: 1rem;
}

.wizard-custom-input input {
    border-radius: var(--bf-radius-sm);
    padding: 0.75rem 1rem;
    border: 1px solid var(--bf-border);
    width: 100%;
}

.wizard-custom-input input:focus {
    border-color: var(--bf-accent);
    box-shadow: var(--bf-accent-focus);
}

/* Option buttons (for step 2 & 3) */
.wizard-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.wizard-option-btn {
    padding: 0.625rem 1.25rem;
    border: 1px solid var(--bf-border);
    border-radius: 8px;
    background: white;
    color: var(--bs-body-color);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.wizard-option-btn:hover {
    border-color: var(--bf-accent);
    background: var(--bf-accent-lighter);
}

.wizard-option-btn.active {
    background: var(--bf-accent);
    border-color: var(--bf-accent);
    color: white;
}

/* Summary */
.wizard-summary {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--color-green-light);
    border-radius: 8px;
    border-left: 4px solid var(--color-green);
}

.wizard-summary p {
    margin: 0;
    font-size: 1rem;
}

/* Footer */
.habit-wizard-footer {
    border-top: 1px solid var(--bf-surface-3);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: center;
}

.wizard-next-btn {
    background: var(--bf-accent);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 48px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wizard-next-btn:hover {
    background: var(--bf-accent-hover);
    color: white;
}

.wizard-back-btn {
    border-radius: 50px;
    padding: 14px 24px;
    margin-right: 1rem;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .habits-cards-row {
        flex-direction: column;
    }

    .habit-card {
        min-height: 120px;
    }

    .habit-wizard-body {
        padding: 1.5rem;
    }

    .wizard-title {
        font-size: 1.5rem;
    }

    /* Stack sidebar and content on mobile */
    .wizard-layout {
        flex-direction: column;
        gap: 1rem;
        min-height: auto;
    }

    .wizard-category-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: auto;
        padding-right: 0;
        padding-bottom: 0.75rem;
        border-right: none;
        border-bottom: 1px solid var(--bf-border);
        gap: 0.35rem;
    }

    .wizard-category-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .wizard-category-btn .category-icon {
        font-size: 0.95rem;
    }

    .wizard-category-btn .category-label {
        font-size: 0.75rem;
    }

    .habit-wizard-footer {
        padding: 1rem 1.5rem;
    }
}

/* ===== Byteflavor habit UI refresh (matches mock) ===== */
/* Note: All --bf-* variables are defined in colors.css */

/* ---------- Habits page ---------- */

.habits-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
}

.habits-header {
    margin-bottom: 1.75rem;
}

.habits-header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.5rem;
}

.habits-hero-title {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--bf-text);
    margin-bottom: 0.5rem;
}

.habits-subtitle {
    font-size: 0.95rem;
    color: var(--bf-muted);
    margin: 0 0 0.75rem 0;
}

/* Week-start day picker */
.week-start-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--bf-muted);
}

.week-start-label {
    margin: 0;
    white-space: nowrap;
}

.week-start-select {
    appearance: auto;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.35rem;
    padding: 0.15rem 0.4rem;
    font-size: 0.82rem;
    color: var(--bf-text);
    background: var(--bs-body-bg, #fff);
    cursor: pointer;
}

.week-start-select:focus {
    outline: none;
    border-color: var(--bs-primary, #6c63ff);
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.15);
}

.habits-tip {
    font-size: 0.9rem;
    color: var(--bf-muted);
    margin: 0;
}

.habits-info-icon {
    position: relative;
    display: inline-block;
    margin-left: 0.25rem;
    cursor: pointer;
    color: var(--bf-muted);
}

.habits-info-icon i {
    font-size: 0.85rem;
    transition: color 0.15s ease;
}

.habits-info-icon:hover i,
.habits-info-icon:focus i {
    color: var(--bf-accent);
}

.habits-info-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: var(--bf-text);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--bf-border);
    line-height: 1.4;
}

.habits-info-tooltip span {
    display: block;
}

.habits-info-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: white;
}

.habits-info-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 9px solid transparent;
    border-bottom-color: var(--bf-border);
}

.habits-info-icon:hover .habits-info-tooltip,
.habits-info-icon:focus .habits-info-tooltip {
    opacity: 1;
    visibility: visible;
}

.habits-cards-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.habit-card {
    flex: 1;
    min-height: 170px;
    border-radius: var(--bf-radius-lg);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

/* Empty card = cleaner dashed */
.habit-card-empty {
    border: 1.5px dashed var(--bf-border);
    background: var(--bf-bg);
}

.habit-card-first,
.habit-card-add {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.habit-card-first:hover,
.habit-card-add:hover,
.add-habit-trigger.habit-card-empty:hover {
    border-color: var(--bf-accent-border);
    background: var(--bf-accent-lighter);
}

.add-icon-large {
    width: 56px;
    height: 56px;
    border-radius: var(--bf-radius-full);
    background: var(--bf-accent);
    color: var(--bs-white);
    font-size: 2rem;
    font-weight: 300;
    box-shadow: var(--bf-shadow-accent);
}

.first-step-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bf-text);
}

/* Filled habit card = soft surface */
.habit-card.filled {
    position: relative;
    border: 1px solid var(--bf-border);
    background: var(--bf-surface);
    padding: 1.25rem;
    box-shadow: var(--bf-shadow-md);
    display: flex;
    flex-direction: column;
}

.habit-card.filled:hover {
    box-shadow: var(--bf-shadow-lg);
    border-color: var(--bf-accent-medium);
}

/* Top right icons */
.habit-card-icons {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.habit-card-icons .btn {
    padding: 0.25rem;
    font-size: 0.75rem;
    color: var(--bf-muted);
    opacity: 0.6;
}

.habit-card-icons .btn:hover {
    opacity: 1;
}

.habit-card-icons .text-danger:hover {
    color: var(--bs-danger) !important;
}

/* Habit title and trigger */
.habit-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bf-text);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.habit-trigger {
    font-size: 0.85rem;
    color: var(--bf-muted);
    margin: 0;
}

.habit-card-body {
    margin-bottom: 1rem;
    padding-right: 2rem;
}

/* Progress section */
.habit-progress {
    margin-bottom: 0;
}

.progress-label {
    display: block;
    font-size: 0.85rem;
    color: var(--bf-muted);
    margin-bottom: 0.4rem;
}

.progress-dots {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.progress-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bf-border);
}

.progress-dot.filled {
    background: #22c55e;
}

.progress-dot.extra {
    background: #a3e635;
    border: 1.5px dashed #16a34a;
}

/* Habit actions */
.habit-card-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-top: 1px solid var(--bf-border-light);
    padding-top: 0.8rem;
    gap: 1.1rem;
    margin-top: auto;
}

.habit-streak {
    font-size: 0.82rem;
    color: var(--bf-accent);
    font-weight: 500;
}

/* Habit actions — full-width at the bottom of the card */
.habit-actions {
    width: 100%;
    align-self: stretch;
}

.habit-actions .btn,
.habit-completed-badge,
.habit-skipped-badge {
    display: block;
    width: 100%;
    text-align: center;
    border-radius: 10px;
}

.complete-habit-btn {
    background: #22c55e;
    border: none;
    color: var(--bs-white);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.complete-habit-btn:hover {
    background: #16a34a;
    color: var(--bs-white);
}

.habit-completed-badge {
    background: #dcfce7;
    color: #16a34a;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 10px;
}

.habit-skipped-badge {
    background: var(--bf-surface-2);
    color: var(--bf-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 10px;
}

.skip-habit-btn {
    border-color: var(--bf-border);
    color: var(--bf-muted);
}

.skip-habit-btn:hover {
    border-color: var(--bf-accent-border-light);
    color: var(--bf-text);
    background: var(--bf-accent-lighter);
}

.habit-actions .btn-link {
    color: var(--bf-muted-2);
}

.habit-actions .btn-link:hover {
    color: var(--bf-text);
}

/* ---------- Wizard modal ---------- */

#habitWizardModal .modal-dialog {
    max-width: 600px;
}

.wizard-modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bf-bg);
    box-shadow: var(--bf-shadow);
}

/* Replace orange bar with a subtle accent line */
.wizard-top-accent {
    height: 3px;
    background: linear-gradient(90deg, var(--bf-accent), transparent);
}

.wizard-orange-bar {
    height: 3px;
    background: var(--bf-accent);
    opacity: 0.85;
}

.wizard-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    opacity: 0.7;
}

.wizard-close-btn:hover {
    opacity: 1;
}

.habit-wizard-body {
    padding: 28px 26px 18px 26px;
}

/* Header typography: closer to mock */
.wizard-title {
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--bf-text);
    margin: 0 0 0.35rem 0;
}

.wizard-subtitle {
    font-size: 0.9rem;
    color: var(--bf-muted);
    margin: 0 0 1.1rem 0;
}

/* Two-column wizard layout */
.wizard-layout {
    display: flex;
    gap: 1.25rem;
    min-height: 320px;
}

/* Category sidebar (left) */
.wizard-category-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 120px;
    padding-right: 1rem;
    border-right: 1px solid var(--bf-border);
}

.wizard-category-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--bf-radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--bf-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wizard-category-btn:hover {
    background: var(--bf-accent-lighter);
    color: var(--bf-text);
}

.wizard-category-btn.active {
    background: var(--bf-accent-lighter);
    border-color: var(--bf-accent-border);
    color: var(--bf-text);
}

.wizard-category-btn .category-icon {
    font-size: 1.1rem;
}

.wizard-category-btn .category-label {
    font-size: 0.85rem;
}

/* Habits content (right) */
.wizard-habits-content {
    flex: 1;
    min-width: 0;
}

/* Featured cards: white surface + subtle border */
.wizard-featured-habits {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.featured-habit-card {
    background: var(--bf-surface);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
    transition: border-color var(--bf-transition-fast), box-shadow var(--bf-transition-fast), transform var(--bf-transition-fast);
}

.featured-habit-card:hover {
    border-color: var(--bf-accent-border-light);
    background: var(--bf-accent-lighter);
}

.featured-habit-card.selected {
    border-color: var(--bf-accent-border-strong);
    background: var(--bf-accent-lighter);
}

.featured-habit-icon {
    font-size: 1.1rem;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--bf-accent-subtle);
}

.featured-habit-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bf-text);
    line-height: 1.2;
}

.featured-habit-desc {
    font-size: 0.86rem;
    color: var(--bf-muted);
    margin-top: 2px;
}

/* More ideas dropdown - Byteflavor refresh */
.wizard-more-ideas {
    margin-bottom: 0.5rem;
}

.more-ideas-select {
    width: 100%;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--bf-muted);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    padding: 10px 12px;
    background-color: var(--bf-surface);
    cursor: pointer;
    transition: border-color var(--bf-transition);
}

.more-ideas-select:hover {
    border-color: var(--bf-accent-border-light);
}

.more-ideas-select:focus {
    border-color: var(--bf-accent);
    box-shadow: 0 0 0 2px var(--bf-accent-lighter);
    outline: none;
}

.more-ideas-select option {
    font-weight: 500;
    color: var(--bf-text);
    padding: 8px;
}

/* Create own: full-width row */
.wizard-create-own {
    margin-top: 14px;
    border: 1px solid var(--bf-border-light);
    border-radius: var(--bf-radius-md);
    padding: 10px 12px;
    background: var(--bf-surface);
    display: flex;
    gap: 10px;
    align-items: center;
}

.wizard-create-own:hover {
    border-color: var(--bf-accent-border-light);
    background: var(--bf-accent-lighter);
}

.wizard-create-own.active {
    border-color: var(--bf-accent-border-strong);
    background: var(--bf-accent-light);
}

.create-own-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: var(--bf-accent-light);
    color: var(--bf-accent);
    font-weight: 500;
    font-size: 0.9rem;
}

.create-own-text {
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--bf-text);
}

/* Inputs */
.wizard-custom-input input {
    border-radius: var(--bf-radius-md);
    border: 1px solid var(--bf-border);
    padding: 12px 14px;
    font-size: 0.9rem;
    font-weight: 500;
}

.wizard-custom-input input:focus {
    border-color: var(--bf-accent-border);
    box-shadow: var(--bf-accent-focus);
}

/* Field labels for step 2 sections */
.wizard-field-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bf-text);
    margin-bottom: 0.5rem;
}

.wizard-field-label.mt-3 {
    margin-top: 1rem;
}

/* Step 2/3 option chips: calmer + more "pill" */
.wizard-options {
    gap: 10px;
}

.wizard-option-btn {
    border-radius: var(--bf-radius-full);
    padding: 10px 14px;
    border: 1px solid var(--bf-border);
    background: var(--bf-surface);
    color: var(--bf-text);
    font-weight: 500;
}

.wizard-option-btn:hover {
    border-color: var(--bf-accent-border-light);
    background: var(--bf-accent-lighter);
}

.wizard-option-btn.active {
    background: var(--bf-accent);
    border-color: var(--bf-accent);
    color: var(--bs-white);
}

/* Summary: less "green callout", more neutral */
.wizard-summary {
    margin-top: 16px;
    padding: 14px 14px;
    border-radius: var(--bf-radius-lg);
    border: 1px solid var(--bf-border);
    background: var(--bf-surface-2);
}

.wizard-summary p {
    margin: 0;
    font-size: 1rem;
    color: var(--bf-text);
}

/* Footer: big CTA */
.habit-wizard-footer {
    border-top: 1px solid var(--bf-border-light);
    padding: 14px 18px 18px 18px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.wizard-back-btn {
    border-radius: var(--bf-radius-full);
    padding: 12px 16px;
    border: 1px solid var(--bf-border);
    background: var(--bf-surface);
    color: var(--bf-text);
    font-weight: 500;
}

.wizard-next-btn {
    flex: 1;
    border-radius: var(--bf-radius-full);
    padding: 12px 18px;
    background: var(--bf-accent);
    border: 1px solid var(--bf-accent);
    color: var(--bs-white);
    font-weight: 500;
    font-size: 0.88rem;
}

.wizard-next-btn:hover {
    background: var(--bf-accent-hover);
    border-color: var(--bf-accent-hover);
}

/* Mobile: stack cards + full-width footer */
@media (max-width: 768px) {
    .habits-cards-row {
        flex-direction: column;
    }

    .habit-wizard-body {
        padding: 22px 18px 14px 18px;
    }

    .wizard-title {
        font-size: 1.25rem;
    }

    .habit-wizard-footer {
        padding: 12px 14px 14px 14px;
    }

    /* Mobile sidebar layout */
    .wizard-layout {
        flex-direction: column;
        gap: 1rem;
        min-height: auto;
    }

    .wizard-category-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: auto;
        padding-right: 0;
        padding-bottom: 0.75rem;
        border-right: none;
        border-bottom: 1px solid var(--bf-border);
        gap: 0.35rem;
    }

    .wizard-category-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .wizard-category-btn .category-icon {
        font-size: 0.95rem;
    }

    .wizard-category-btn .category-label {
        font-size: 0.75rem;
    }
}

/* ===== Edit Habit Modal ===== */
.edit-frequency-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.edit-freq-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--bf-radius-full);
    transition: all 0.15s ease;
}

.edit-freq-btn:hover {
    border-color: var(--bf-accent);
    background: var(--bf-accent-light);
    color: var(--bf-text);
}

.edit-freq-btn.active {
    background: var(--bf-accent);
    border-color: var(--bf-accent);
    color: white;
}

#editHabitModal .form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bf-text);
}

#editHabitModal .form-control {
    font-size: 0.9rem;
    border-radius: var(--bf-radius-md);
}

#editHabitModal .btn-accent {
    background: var(--bf-accent);
    border-color: var(--bf-accent);
    color: white;
}

#editHabitModal .btn-accent:hover {
    background: var(--bf-accent-hover);
    border-color: var(--bf-accent-hover);
}

/* ===== Agent Band (Bob's daily message / weekly check-in) ===== */

.agent-band {
    background: var(--bf-accent-lighter, #f0f6ff);
    border: 1px solid var(--bf-accent-border-light, #d0e0f0);
    border-radius: var(--bf-radius-lg, 16px);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.agent-band-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.agent-band-left {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.agent-band-avatar {
    flex-shrink: 0;
    width: 40px;
    /* circle size */
    height: 40px;
    /* circle size */
    border-radius: 50%;
    background: var(--bf-surface, #fff);
    border: 1px solid var(--bf-border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--bf-accent, #4f46e5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.agent-band-avatar svg {
    width: 28px;
    /* icon size inside the circle */
    height: 28px;
    /* icon size inside the circle */
}

.agent-band-content {
    flex: 1;
    min-width: 0;
}

.agent-band-message {
    font-size: 0.9rem;
    color: var(--bf-text, #1e293b);
    line-height: 1.5;
    margin: 0;
}

.agent-band-question {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bf-text, #1e293b);
    margin-bottom: 0.5rem;
}

.agent-band-tips {
    list-style: none;
    margin: 0.5rem 0 0 0;
    padding: 0;
    font-size: 0.85rem;
    color: var(--bf-muted, #64748b);
    line-height: 1.6;
}

.agent-band-tips li::before {
    content: "•";
    margin-right: 0.4rem;
    color: var(--bf-accent, #e8772e);
}

/* Previous week summary (shown during weekly check-in) */
.agent-band-week-summary {
    background: rgba(59, 130, 246, 0.06);
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
}

.week-summary-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.week-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
    font-size: 0.88rem;
    color: #1e293b;
}

.week-summary-habit {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.week-summary-stat {
    flex-shrink: 0;
    font-weight: 600;
    margin-left: 0.75rem;
    color: #64748b;
}

.week-summary-stat.week-summary-hit {
    color: #10b981;
}

/* Mood pill buttons */
.agent-band-moods {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.mood-pill {
    padding: 0.4rem 1rem;
    border: 1px solid var(--bf-border, #e2e8f0);
    border-radius: 999px;
    background: var(--bf-surface, #fff);
    color: var(--bf-text, #1e293b);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.mood-pill:hover {
    border-color: var(--bf-accent-border, #e8772e);
    background: var(--bf-accent-lighter, #fef3eb);
}

.mood-pill.selected {
    border-color: var(--bf-accent, #e8772e);
    background: var(--bf-accent-light, #fde8d8);
    color: var(--bf-text, #1e293b);
    font-weight: 600;
}

.mood-pill.selected::after {
    content: "✕";
    font-size: 0.7rem;
    margin-left: 0.25rem;
    opacity: 0.6;
}

/* Note input row */
.agent-band-note-row {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.agent-band-reflect-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--bf-accent, #e8772e);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.agent-band-reflect-link:hover {
    color: var(--bf-accent-hover, #d0681f);
    text-decoration: underline;
}

/* Action pills (keep same / modify / choose different) */
.agent-band-action-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.action-pill {
    padding: 0.4rem 1rem;
    border: 1px solid var(--bf-border, #e2e8f0);
    border-radius: 999px;
    background: var(--bf-surface, #fff);
    color: var(--bf-text, #1e293b);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-pill:hover {
    border-color: var(--bf-accent-border, #e8772e);
    background: var(--bf-accent-lighter, #fef3eb);
}

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

.action-pill--primary {
    background: var(--bf-accent, #e8772e);
    color: #fff;
    border-color: var(--bf-accent, #e8772e);
}

.action-pill--primary:hover {
    background: #d46a28;
    border-color: #d46a28;
}

.action-pill--danger {
    color: #dc2626;
    border-color: #fecaca;
}

.action-pill--danger:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

.agent-band-note {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bf-border, #e2e8f0);
    border-radius: var(--bf-radius-md, 10px);
    font-size: 0.85rem;
    background: var(--bf-surface, #fff);
    color: var(--bf-text, #1e293b);
    transition: border-color 0.15s ease;
}

.agent-band-note:focus {
    outline: none;
    border-color: var(--bf-accent, #e8772e);
    box-shadow: 0 0 0 2px var(--bf-accent-lighter, #fef3eb);
}

.agent-band-note::placeholder {
    color: var(--bf-muted, #94a3b8);
}

/* Right side – chat link */
.agent-band-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.agent-band-action-sep {
    color: var(--bf-text-muted, #94a3b8);
    font-size: 0.85rem;
}

.agent-band-secondary-link {
    font-size: 0.9rem;
    color: var(--bf-text-secondary, #64748b);
    text-decoration: none;
}

.agent-band-secondary-link:hover {
    color: var(--bf-accent, #e8772e);
    text-decoration: underline;
}

.agent-band-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 0.25rem;
}

.agent-band-chat-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--bf-accent, #e8772e);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.agent-band-chat-link:hover {
    color: var(--bf-accent-hover, #d0681f);
    text-decoration: underline;
}

/* Divider between band and cards */
.agent-band-divider {
    border: none;
    border-top: 1px solid var(--bf-border-light, #f1f5f9);
    margin: 0 0 1.25rem 0;
}

/* Submitted state */
.agent-band-thanks {
    font-size: 0.9rem;
    color: var(--bf-accent, #e8772e);
    font-weight: 500;
}

/* ── Agent Band Responsive ── */
@media (max-width: 768px) {
    .agent-band-inner {
        flex-direction: column;
        gap: 0.75rem;
    }

    .agent-band-right {
        align-self: flex-end;
    }

    .agent-band-moods {
        flex-wrap: wrap;
    }

    .agent-band-note {
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════
   Apple Calendar – monthly view inside habits tab
   ═══════════════════════════════════════════════════ */

/* Calendar view header (back-button + title) */
.habits-calendar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.habits-calendar-header .habits-hero-title {
    margin: 0;
    font-size: 1.35rem;
}

/* Container */
.apple-cal {
    background: var(--bf-bg-primary, #ffffff);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 0 0 1px var(--bf-border-light, #e2e8f0);
}

/* ── Navigation row ── */
.apple-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.apple-cal-nav-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bf-text-secondary, #64748b);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 0.95rem;
}

.apple-cal-nav-btn:hover {
    background: var(--bf-bg-secondary, #f1f5f9);
    color: var(--bf-accent, #e8772e);
}

.apple-cal-month-label {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--bf-text-primary, #1e293b);
    margin: 0;
    letter-spacing: -0.01em;
}

/* ── Grid ── */
.apple-cal-grid {
    display: flex;
    flex-direction: column;
}

/* Day-name headers */
.apple-cal-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.apple-cal-day-name {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--bf-text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 0;
}

/* Week row */
.apple-cal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* ── Day cell ── */
.apple-cal-day {
    position: relative;
    min-height: 56px;
    padding: 4px 3px 4px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1px;
    transition: background 0.12s;
    overflow: hidden;
}

.apple-cal-day:hover {
    background: var(--bf-bg-secondary, #f8fafc);
}

.apple-cal-day.other-month {
    opacity: 0.35;
}

.apple-cal-day.today {
    background: var(--bf-bg-secondary, #f1f5f9);
}

/* Day number */
.apple-cal-day-number {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--bf-text-primary, #334155);
    line-height: 1;
    text-align: center;
    margin-bottom: 2px;
}

.apple-cal-day-number.today-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bf-accent, #e8772e);
    color: #fff;
    font-weight: 600;
    margin: 0 auto;
}

.apple-cal-day.other-month .apple-cal-day-number {
    color: var(--bf-text-muted, #94a3b8);
}

/* ── Event text labels inside day cell ── */
.apple-cal-events {
    display: flex;
    flex-direction: column;
    gap: 0px;
    min-width: 0;
}

.apple-cal-event-pill {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.2;
    background: none !important;
    padding: 0 1px;
    border-radius: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    transition: font-size 0.18s ease;
    cursor: default;
    /* color is set via inline style */
}

/* Hover: magnify the pill text */
.apple-cal-day:hover .apple-cal-event-pill {
    font-size: 0.78rem;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

/* When the whole day is hovered, let the events area expand on top */
.apple-cal-day:hover .apple-cal-events {
    gap: 1px;
}

.apple-cal-empty {
    text-align: center;
    color: var(--bf-text-muted, #94a3b8);
    font-size: 0.9rem;
    margin: 1.5rem 0 0.5rem;
}

/* ── Responsive tweaks ── */
@media (max-width: 480px) {
    .apple-cal {
        padding: 0.85rem;
        border-radius: 12px;
    }
    .apple-cal-day {
        min-height: 48px;
        padding: 3px 1px 3px;
    }
    .apple-cal-day-number {
        font-size: 0.7rem;
    }
    .apple-cal-event-pill {
        font-size: 0.52rem;
    }
    .apple-cal-day:hover .apple-cal-event-pill {
        font-size: 0.68rem;
    }
}

/* ── Habit History Screen (full-page Apple-style) ── */
.habit-history-screen {
    max-width: 520px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 80vh;
}

.habit-history-nav {
    margin-bottom: 1.5rem;
}

.habit-history-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--bf-text-secondary, #64748b);
    text-decoration: none;
}

.habit-history-back:hover {
    color: var(--bf-accent, #e8772e);
}

.habit-history-header {
    margin-bottom: 2rem;
}

.habit-history-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--bf-text-primary, #1e293b);
    margin: 0 0 0.25rem;
}

.habit-history-subtitle {
    font-size: 0.95rem;
    color: var(--bf-text-muted, #94a3b8);
    margin: 0;
}

.habit-history-calendar {
    background: var(--bf-bg-secondary, #f8fafc);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.habit-calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 300px;
}

.habit-history-screen .habit-calendar-header-row {
    margin-bottom: 0.5rem;
}

.habit-history-screen .habit-calendar-row {
    display: grid;
    grid-template-columns: 3rem repeat(7, 1fr);
    gap: 0.35rem;
    align-items: center;
}

.habit-history-screen .habit-calendar-day-header {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--bf-text-muted, #94a3b8);
    text-align: center;
}

.habit-history-screen .habit-calendar-week-label {
    font-size: 0.75rem;
    color: var(--bf-text-muted, #94a3b8);
}

.habit-history-screen .habit-calendar-cell {
    aspect-ratio: 1;
    max-width: 36px;
    max-height: 36px;
    margin: 0 auto;
    border-radius: 6px;
    background: var(--bf-border-light, #e2e8f0);
}

.habit-history-screen .habit-calendar-cell.done {
    background: var(--bf-accent, #e8772e);
}

.habit-history-screen .habit-calendar-cell.future {
    background: transparent;
    opacity: 0.25;
}

.habit-history-screen .habit-calendar-legend {
    font-size: 0.8rem;
    color: var(--bf-text-muted, #94a3b8);
    margin: 1.25rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.habit-history-screen .habit-calendar-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background: var(--bf-border-light, #e2e8f0);
}

.habit-history-screen .habit-calendar-legend-dot.done {
    background: var(--bf-accent, #e8772e);
}

.habit-history-empty {
    font-size: 1rem;
    color: var(--bf-text-muted, #94a3b8);
    margin: 2rem 0;
}

/* ── Habit History Panel (inline, deprecated – kept for compatibility) ── */
.habit-history-panel {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bf-bg-secondary, #f8fafc);
    border-radius: 12px;
    border: 1px solid var(--bf-border-light, #e2e8f0);
}

.habit-history-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--bf-text-primary, #334155);
}

/* Apple-style calendar grid */
.habit-calendar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.habit-calendar-headers {
    display: grid;
    grid-template-columns: 2.5rem repeat(7, 1fr);
    gap: 0.25rem;
    align-items: center;
    margin-bottom: 0.25rem;
}

.habit-calendar-day-header {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--bf-text-muted, #94a3b8);
    text-align: center;
}

.habit-calendar-headers .habit-calendar-week-label {
    visibility: hidden;
}

.habit-calendar-row {
    display: grid;
    grid-template-columns: 2.5rem repeat(7, 1fr);
    gap: 0.25rem;
    align-items: center;
}

.habit-calendar-week-label {
    font-size: 0.7rem;
    color: var(--bf-text-muted, #94a3b8);
}

.habit-calendar-cell {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 4px;
    background: var(--bf-border-light, #e2e8f0);
}

.habit-calendar-cell.done {
    background: var(--bf-accent, #e8772e);
}

.habit-calendar-cell.future {
    background: transparent;
    opacity: 0.3;
}

.habit-calendar-legend {
    font-size: 0.75rem;
    color: var(--bf-text-muted, #94a3b8);
    margin: 0.75rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.habit-calendar-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--bf-border-light, #e2e8f0);
}

.habit-calendar-legend-dot.done {
    background: var(--bf-accent, #e8772e);
}

.habit-history-empty {
    font-size: 0.9rem;
    margin: 0;
}

.history-toggle-btn.active {
    background: var(--bf-accent, #e8772e);
    color: white;
    border-color: var(--bf-accent, #e8772e);
}

/* Celebration toast (streak milestones) */
.celebration-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--bf-accent, #e8772e), #f59e0b);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(232, 119, 46, 0.4);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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