/* ==================== AI Coach Mini App — Premium Dark Theme ==================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 35, 0.8);
    --bg-glass: rgba(30, 30, 50, 0.6);

    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-success: #00cec9;
    --accent-warning: #fdcb6e;
    --accent-danger: #ff7675;
    --accent-info: #74b9ff;

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    --border-glass: rgba(255, 255, 255, 0.08);
    --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    --font: 'Inter', -apple-system, sans-serif;

    --nav-height: 72px;
}

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

html,
body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-top: env(safe-area-inset-top);
}

body {
    padding-bottom: calc(var(--nav-height) + 20px);
    background: linear-gradient(180deg, #0a0a1a 0%, #0d0d1f 50%, #0a0a15 100%);
}

/* ==================== PAGES ==================== */

.page {
    display: none;
    padding: 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    animation: fadeIn 0.3s ease;
    max-width: 480px;
    margin: 0 auto;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== NAVIGATION ==================== */

#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(12, 12, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    z-index: 100;
}

.nav-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.nav-icon {
    font-size: 22px;
    transition: transform 0.3s ease;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.nav-btn.active .nav-label {
    color: var(--accent-primary);
}

.nav-btn.active .nav-icon {
    transform: scale(1.15);
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 0 0 4px 4px;
}

/* ==================== HEADER ==================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 4px 0;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(253, 203, 110, 0.12);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(253, 203, 110, 0.2);
}

.streak-fire {
    font-size: 16px;
}

.streak-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-warning);
}

.streak-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==================== CARDS ==================== */

.card {
    margin-bottom: 12px;
}

.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(108, 92, 231, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 15px rgba(108, 92, 231, 0.1);
}

.task-input-card {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(30, 30, 50, 0.6));
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.task-input-card:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.2);
}

.card-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
    word-wrap: break-word;
    max-width: 100%;
}

/* ==================== GOAL CARD ==================== */

.goal-card {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(162, 155, 254, 0.05));
    border: 1px solid rgba(108, 92, 231, 0.2);
}

#main-goal-card {
    position: relative;
    z-index: 2;
    margin-top: 6px;
}

.goal-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
}

/* ==================== PHILOSOPHY CARD ==================== */

.philosophy-card {
    background: linear-gradient(135deg, rgba(0, 206, 201, 0.08), rgba(108, 92, 231, 0.08));
    border: 1px solid rgba(0, 206, 201, 0.2);
}

.philosophy-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ==================== STATUS BADGES ==================== */

.status-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(0, 206, 201, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(0, 206, 201, 0.2);
}

.status-badge.paused {
    background: rgba(253, 203, 110, 0.12);
    color: var(--accent-warning);
    border: 1px solid rgba(253, 203, 110, 0.2);
}

.status-badge.deleted,
.status-badge.archived {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
}

.goal-item.active {
    border-color: rgba(0, 206, 201, 0.4);
    background: linear-gradient(135deg, rgba(0, 206, 201, 0.05), rgba(108, 92, 231, 0.05));
}

/* ==================== MICRO ACTIONS ==================== */

.ma-check {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid var(--accent-primary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ma-check.done {
    background: var(--accent-success);
    border-color: var(--accent-success);
}

.focus-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(108, 92, 231, 0.2);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-secondary);
}

/* ==================== PRIORITY CARD ==================== */

.priority-card {
    background: linear-gradient(135deg, rgba(0, 206, 201, 0.1), rgba(0, 206, 201, 0.02));
    border: 1px solid rgba(0, 206, 201, 0.15);
}

.priority-task {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-success);
    line-height: 1.4;
}

/* ==================== METRICS GRID ==================== */

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.metric-card {
    padding: 14px;
    text-align: center;
}

.metric-value {
    font-size: clamp(20px, 8vw, 28px);
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-label {
    font-size: clamp(9px, 3vw, 11px);
    color: var(--text-muted);
    margin: 4px 0 8px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
    border-radius: 2px;
    transition: width 1s ease;
}

.metric-fill.emotional {
    background: linear-gradient(90deg, var(--accent-info), var(--accent-primary));
}

/* ==================== DAY STATUS ==================== */

.day-status-container {
    display: flex;
    gap: 16px;
    align-items: center;
}

.day-progress-ring {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.day-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 8;
}

.ring-fill {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.7;
    stroke-dashoffset: 326.7;
    transition: stroke-dashoffset 1.5s ease;
}

.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.ring-sub {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.today-tasks-mini {
    flex: 1;
}

.mini-task {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.mini-task.done {
    text-decoration: line-through;
    color: var(--text-muted);
}

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

.mini-task-dot.todo {
    background: var(--accent-warning);
}

.mini-task-dot.done {
    background: var(--accent-success);
}

.mini-task-dot.skipped {
    background: var(--accent-danger);
}

/* ==================== HEATMAP ==================== */

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 3px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.3s ease;
}

.heatmap-cell.success {
    background: var(--accent-success);
    opacity: 0.9;
}

.heatmap-cell.partial {
    background: var(--accent-warning);
    opacity: 0.7;
}

.heatmap-cell.fail {
    background: var(--accent-danger);
    opacity: 0.5;
}

.heatmap-cell.pending {
    background: rgba(255, 255, 255, 0.04);
}

/* ==================== SCENARIO ALERT ==================== */

.scenario-alert {
    background: linear-gradient(135deg, rgba(255, 118, 117, 0.12), rgba(253, 203, 110, 0.08));
    border: 1px solid rgba(255, 118, 117, 0.25);
    text-align: center;
}

.alert-emoji {
    font-size: 32px;
    margin-bottom: 8px;
}

.alert-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* ==================== BUTTONS ==================== */

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #5b4cdb);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font);
}

.btn-primary:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.btn-primary.full-width {
    width: 100%;
    margin-top: 12px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: rgba(255, 118, 117, 0.12);
    color: var(--accent-danger);
    border: 1px solid rgba(255, 118, 117, 0.3);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font);
}

.btn-danger:active {
    background: rgba(255, 118, 117, 0.2);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-icon:active {
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon.loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

.task-add-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
}

.task-add-btn:active {
    background: rgba(255, 255, 255, 0.12);
}

/* ==================== SECTIONS ==================== */

.section {
    margin-bottom: 16px;
}

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

.section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ==================== GOALS LIST ==================== */

.goal-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.goal-item:active {
    transform: scale(0.98);
}

.goal-item-title {
    font-size: 14px;
    font-weight: 600;
}

.goal-item-category {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.goal-item-arrow {
    color: var(--text-muted);
    font-size: 18px;
}

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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.modal-actions button {
    flex: 1;
}

/* ==================== INPUTS ==================== */

.input-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: var(--font);
    margin-bottom: 12px;
    transition: border-color 0.3s ease;
    outline: none;
}

.input-field:focus {
    border-color: var(--accent-primary);
}

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

select.input-field {
    appearance: none;
    cursor: pointer;
}

/* ==================== SLIDERS ==================== */

.slider-group {
    margin-bottom: 14px;
}

.slider-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.4);
}

.mood-range.energy::-webkit-slider-thumb {
    background: var(--accent-success);
    box-shadow: 0 0 10px rgba(0, 206, 201, 0.4);
}

.mood-range.stress::-webkit-slider-thumb {
    background: var(--accent-danger);
    box-shadow: 0 0 10px rgba(255, 118, 117, 0.4);
}

/* ==================== MOOD CARD ==================== */

.mood-sliders {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mood-slider-group label {
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.mood-slider-group label span {
    font-weight: 700;
    color: var(--accent-primary);
}

.identity-row {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.identity-row label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== TASK LIST ==================== */

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.task-item.done {
    opacity: 0.5;
    border-color: rgba(0, 206, 201, 0.2);
}

.task-item.recommendation {
    border-color: rgba(0, 206, 201, 0.25);
    background: linear-gradient(135deg, rgba(0, 206, 201, 0.06), rgba(255, 255, 255, 0.02));
}

.task-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.task-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.task-check.done {
    background: var(--accent-success);
    border-color: var(--accent-success);
}

.rec-dismiss {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    border-radius: 8px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0;
}

.rec-dismiss:active {
    transform: scale(0.96);
}

.task-check.done::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.task-title {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.task-item.done .task-title {
    text-decoration: line-through;
}

.task-type-badge {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.task-type-badge.strategic {
    background: rgba(108, 92, 231, 0.2);
    color: var(--accent-primary);
}

.task-type-badge.support {
    background: rgba(0, 206, 201, 0.15);
    color: var(--accent-success);
}

.task-type-badge.system {
    background: rgba(116, 185, 255, 0.15);
    color: var(--accent-info);
}

/* ==================== AI SUGGESTION ==================== */

.ai-suggestion {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(0, 206, 201, 0.05));
    border: 1px solid rgba(108, 92, 231, 0.15);
}

/* ==================== PSYCHOLOGIST ==================== */

.mode-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(108, 92, 231, 0.12);
    border-radius: 20px;
    font-size: 12px;
}

.mode-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-success);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.mode-text {
    color: var(--accent-secondary);
    font-weight: 500;
}

.quick-states {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.state-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font);
}

.state-btn:active {
    background: rgba(108, 92, 231, 0.2);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

/* ==================== CHAT ==================== */

.chat-container {
    height: calc(100vh - 280px);
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg.user {
    align-self: flex-end;
    background: var(--accent-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
    align-self: flex-start;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    border-bottom-left-radius: 4px;
}

.chat-msg.typing {
    color: var(--text-muted);
    font-style: italic;
}

.chat-input-area {
    position: fixed;
    bottom: var(--nav-height);
    left: 0;
    right: 0;
    padding: 10px 16px;
    background: rgba(12, 12, 20, 0.95);
    backdrop-filter: blur(16px);
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid var(--border-glass);
    display: none;
    /* Hidden until psychologist page is active */
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: var(--font);
    outline: none;
}

.chat-input:focus {
    border-color: var(--accent-primary);
}

.voice-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    font-size: 18px;
}

.voice-btn.recording {
    background: rgba(255, 118, 117, 0.2);
    animation: pulse 1s infinite;
}

.send-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border-radius: 50%;
    font-size: 18px;
    color: white;
}

/* ==================== ANALYTICS ==================== */

.metrics-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.metric-big {
    text-align: center;
    padding: 20px 14px;
}

.metric-big-value {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-big-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.metric-trend {
    font-size: 12px;
    margin-top: 6px;
    font-weight: 600;
}

.metric-trend.up {
    color: var(--accent-success);
}

.metric-trend.down {
    color: var(--accent-danger);
}

.full-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-glass);
}

.fm-row:last-child {
    border-bottom: none;
}

.fm-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.fm-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
}

.fm-value.sabotage {
    color: var(--accent-danger);
}

.chart-container {
    height: 160px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 10px 0;
}

.chart-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: height 1s ease;
}

.chart-bar.mood {
    background: var(--accent-primary);
}

.chart-bar.energy {
    background: var(--accent-success);
}

.chart-bar.stress {
    background: var(--accent-danger);
}

/* ==================== PATTERNS ==================== */

.pattern-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-glass);
}

.pattern-item:last-child {
    border-bottom: none;
}

.pattern-type {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-warning);
    margin-bottom: 4px;
}

.pattern-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==================== EMOTION MAP ==================== */

.emotion-map {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.emotion-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border-glass);
}

.emotion-tag.calm {
    background: rgba(0, 206, 201, 0.12);
    color: var(--accent-success);
    border-color: rgba(0, 206, 201, 0.2);
}

.emotion-tag.anxiety {
    background: rgba(255, 118, 117, 0.12);
    color: var(--accent-danger);
    border-color: rgba(255, 118, 117, 0.2);
}

.emotion-tag.frustration {
    background: rgba(253, 203, 110, 0.12);
    color: var(--accent-warning);
    border-color: rgba(253, 203, 110, 0.2);
}

.emotion-tag.motivation {
    background: rgba(108, 92, 231, 0.12);
    color: var(--accent-primary);
    border-color: rgba(108, 92, 231, 0.2);
}

/* ==================== TOASTS ==================== */

.toast-container {
    position: fixed;
    bottom: calc(var(--nav-height) + 16px);
    left: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 4000;
    pointer-events: none;
}

.toast {
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.toast.success {
    border-color: rgba(0, 206, 201, 0.3);
}

.toast.error {
    border-color: rgba(255, 118, 117, 0.4);
}

.toast.warning {
    border-color: rgba(253, 203, 110, 0.4);
}

.toast.info {
    border-color: rgba(116, 185, 255, 0.4);
}

/* ==================== EMPTY STATE ==================== */

.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ==================== MODE INDICATOR VARIATIONS ==================== */

.mode-indicator.support .mode-dot {
    background: var(--accent-success);
}

.mode-indicator.analytical .mode-dot {
    background: var(--accent-info);
}

.mode-indicator.confront .mode-dot {
    background: var(--accent-danger);
}

/* ==================== UTILITY ==================== */

.hidden {
    display: none !important;
}

.day-date {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.today-active-goal {
    font-size: 11px;
    color: var(--text-secondary);
    max-width: 220px;
    text-align: right;
    word-wrap: break-word;
}

/* ==================== LOADING ==================== */

.loading-dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '';
    }

    40% {
        content: '.';
    }

    60% {
        content: '..';
    }

    80%,
    100% {
        content: '...';
    }
}

/* ==================== SCROLL ==================== */

::-webkit-scrollbar {
    width: 4px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* ==================== WHEEL OF LIFE ==================== */

.balance-card {
    padding-bottom: 24px;
}

.wheel-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

#wheel-of-life {
    width: 240px;
    height: 240px;
    filter: drop-shadow(0 0 20px rgba(108, 92, 231, 0.2));
}

.wheel-guide {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 1;
}

.wheel-axis {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
    stroke-dasharray: 4;
}

.wheel-fill {
    fill: rgba(108, 92, 231, 0.3);
    stroke: var(--accent-primary);
    stroke-width: 2;
    transition: all 1s ease;
}

.wheel-emoji {
    font-size: 14px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.wheel-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
    padding: 0 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-item b {
    color: var(--accent-primary);
    margin-left: auto;
}

/* ==================== HINT SYSTEM ==================== */

.hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s ease;
}

.hint-icon:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.hint-popover {
    position: fixed;
    z-index: 3000;
    max-width: 240px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    animation: popIn 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.glass-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: var(--font);
    outline: none;
}

.glass-input:focus {
    border-color: var(--accent-primary);
}

.select-input {
    background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.6) 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.6) 50%, transparent 50%),
        linear-gradient(to right, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08));
    background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px), 100% 0;
    background-size: 6px 6px, 6px 6px, 40px 100%;
    background-repeat: no-repeat;
    padding-right: 44px;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== MANUAL TASK FORM ==================== */

.manual-task-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.manual-task-form input.glass-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: white;
    font-size: 14px;
    outline: none;
}

.manual-task-form input.glass-input:focus {
    border-color: var(--accent-primary);
}

.task-scope-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.scope-pill {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}

.scope-pill input {
    width: 14px;
    height: 14px;
    margin: 0;
}

.task-scope-meta {
    width: 100%;
}

.scope-select .input-field {
    margin: 0;
}

/* ==================== GOAL CLARIFIER ==================== */

.goal-clarify-block {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
}

.goal-clarify-messages {
    max-height: 240px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.15);
}

.goal-clarify-msg {
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    font-size: 13px;
    line-height: 1.4;
}

.goal-clarify-msg.user {
    align-self: flex-end;
    background: rgba(111, 131, 255, 0.10);
}

.goal-clarify-msg.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.04);
}

.goal-clarify-input-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.goal-clarify-result {
    margin-top: 12px;
}

.goal-clarify-text {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
}

.goal-clarify-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ==================== BUTTON LOADING ==================== */

.btn-primary.loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

/* ==================== CHECKIN BUTTONS ROW ==================== */

.checkin-buttons-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.checkin-buttons-row .btn-secondary {
    flex: 1;
    font-size: 11px;
    padding: 8px;
}

/* ==================== PROFILE MINI BUTTON ==================== */

.btn-profile-mini {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-profile-mini:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

/* ==================== FORM ROW REFINEMENT ==================== */

.form-row.full-width {
    width: 100%;
    display: flex;
    align-items: center;
}

.form-row.full-width input.glass-input {
    flex: 1;
    margin-right: 8px;
}

/* ==================== INFO CONTENT ==================== */

.info-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.info-content h3 {
    color: var(--text-primary);
    margin: 16px 0 8px;
    font-size: 16px;
}

.info-content ul,
.info-content ol {
    padding-left: 20px;
    margin-bottom: 16px;
}

.info-content li {
    margin-bottom: 8px;
}

/* ==================== FORM SCROLLABLE ==================== */

.form-scrollable {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 16px;
    scrollbar-width: thin;
}

.form-scrollable::-webkit-scrollbar {
    width: 4px;
}

.form-scrollable::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}

/* ==================== RECOMMENDATIONS ==================== */

.ai-recommendations {
    margin: 16px 0;
    padding: 16px;
    background: linear-gradient(135deg, rgba(85, 239, 196, 0.05), rgba(30, 30, 50, 0.6));
    border: 1px solid rgba(85, 239, 196, 0.1);
    border-radius: var(--radius-lg);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0;
}

.rec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
}

.rec-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.rec-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--accent-success);
    border-radius: 4px;
    flex-shrink: 0;
}

.rec-item.selected .rec-check {
    background: var(--accent-success);
}

.recommendations-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* ==================== MODAL FIXES ==================== */

.modal-content {
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}

/* ==================== MICRO-ACTIONS ==================== */

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.micro-actions-list {
    margin-top: 8px;
    padding-left: 2px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.micro-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.ma-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.micro-action-item.done {
    color: var(--accent-success);
    opacity: 0.8;
}

.micro-action-item.done .ma-dot {
    background: var(--accent-success);
}

/* ==================== GLASSMORPHISM ENHANCEMENTS ==================== */

.glass-card {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* ==================== SPINNER ==================== */

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-primary .spinner {
    margin-right: 8px;
}

.btn-secondary .spinner,
.btn-danger .spinner {
    margin-right: 8px;
}

/* ==================== DECOMPOSITION MODAL ==================== */

.decomposition-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.decomp-option {
    display: flex;
    flex-direction: column;
    /* This puts checkbox and text on separate lines as requested */
    gap: 6px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.decomp-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-primary);
}

.decomp-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.decomp-option span {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* ==================== HINT POPOVER REFINEMENT ==================== */

.hint-popover {
    border: 1px solid var(--accent-primary);
}

.hint-popover b {
    color: var(--accent-primary);
    display: block;
    margin-bottom: 4px;
}
