/* ================================================
   BodyBalance Track - Stylesheet
   ================================================ */

/* --- Reset & Variables --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #5B8DEF;
    --secondary: #7ED1B2;
    --bg: #FFFFFF;
    --light: #F5F7FA;
    --text: #333333;
    --text-light: #777777;
    --hover: #4A7BE0;
    --error: #E74C3C;
    --error-bg: #FDF0EF;
    --success: #27AE60;
    --success-bg: #EAFAF1;
    --border: #E1E5EB;
    --shadow: 0 2px 16px rgba(91, 141, 239, 0.10);
    --shadow-lg: 0 8px 32px rgba(91, 141, 239, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: "Noto Sans JP", system-ui, sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--hover);
}

/* --- App Wrapper --- */
.app-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* --- Footer --- */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ================================================
   Auth Pages (Login / Register)
   ================================================ */
.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    min-height: calc(100vh - 80px);
}

.auth-card {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo Area */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    display: inline-block;
    font-size: 2.4rem;
    margin-bottom: 8px;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(231, 76, 60, 0.15);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(39, 174, 96, 0.15);
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input::placeholder {
    color: #B0B8C4;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.12);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
    width: 100%;
    margin-top: 4px;
}

.btn-primary:hover {
    background: var(--hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-logout {
    padding: 8px 20px;
    background: transparent;
    color: var(--text-light);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-logout:hover {
    color: var(--error);
    border-color: var(--error);
    background: var(--error-bg);
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    font-size: 0.88rem;
    color: var(--text-light);
}

.auth-footer a {
    font-weight: 600;
}

/* ================================================
   Dashboard
   ================================================ */

/* Nav */
.dashboard-nav {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon-sm {
    font-size: 1.4rem;
}

.nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-greeting {
    font-size: 0.88rem;
    color: var(--text-light);
}

/* Main Area */
.dashboard-main {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

.welcome-section {
    margin-bottom: 32px;
}

.welcome-section h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.welcome-text {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}

.status-active {
    color: var(--secondary);
}

/* Info Card */
.info-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.info-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* ================================================
   Responsive
   ================================================ */

@media (max-width: 600px) {
    .auth-card {
        padding: 36px 24px;
    }

    .dashboard-nav {
        padding: 0 16px;
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .nav-user {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }

    .nav-greeting {
        font-size: 0.82rem;
    }

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

    .dashboard-main {
        padding: 24px 16px;
    }

    .welcome-section h2 {
        font-size: 1.3rem;
    }
}

/* ================================================
   Phase 2 — Additional Styles
   ================================================ */

/* Nav Links */
.nav-brand-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

.nav-link {
    font-size: 0.88rem;
    color: var(--text-light);
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--primary);
    background: var(--light);
}

/* Alert Info */
.alert-info {
    background: #EBF3FE;
    color: #2C6FD1;
    border: 1px solid rgba(91, 141, 239, 0.2);
    line-height: 1.8;
}

.alert-link {
    display: inline-block;
    margin-top: 8px;
    font-weight: 600;
    color: var(--primary);
}

.alert-link:hover {
    color: var(--hover);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
}

.action-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    color: var(--primary);
}

.action-icon {
    font-size: 1.5rem;
}

.action-text {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Section Header */
.section-header {
    margin-bottom: 16px;
    margin-top: 8px;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

/* Grid Variants */
.stats-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stats-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-sub {
    display: inline;
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 400;
}

/* Balance Card */
.balance-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    border-top: 4px solid var(--border);
}

.balance-card.tendency-gain {
    border-top-color: #E74C3C;
}

.balance-card.tendency-loss {
    border-top-color: var(--secondary);
}

.balance-card.tendency-maintain {
    border-top-color: var(--primary);
}

.balance-number {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.balance-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.balance-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.tendency-gain .balance-value {
    color: #E74C3C;
}

.tendency-loss .balance-value {
    color: var(--secondary);
}

.tendency-maintain .balance-value {
    color: var(--primary);
}

.balance-tendency {
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
}

.tendency-gain .balance-tendency {
    background: #FDF0EF;
    color: #E74C3C;
}

.tendency-loss .balance-tendency {
    background: #EAFAF1;
    color: #27AE60;
}

.tendency-maintain .balance-tendency {
    background: #EBF3FE;
    color: var(--primary);
}

/* Form Card */
.form-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}

.form-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.profile-form select,
.profile-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.profile-form select:focus,
.profile-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.12);
}

.profile-form textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.form-hint-inline {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 400;
}

/* Results Section */
.results-section {
    margin-bottom: 32px;
}

.results-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

/* History Table */
.history-section {
    margin-bottom: 32px;
}

.history-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.history-table-wrapper {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border);
    background: var(--light);
}

.history-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover td {
    background: var(--light);
}

.history-table .tendency-gain {
    color: #E74C3C;
    font-weight: 600;
}

.history-table .tendency-loss {
    color: #27AE60;
    font-weight: 600;
}

.history-table .tendency-maintain {
    color: var(--primary);
    font-weight: 600;
}

.table-link {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Button Small */
.btn-sm {
    padding: 10px 20px;
    font-size: 0.88rem;
    width: auto;
    display: inline-flex;
    margin-top: 12px;
}

/* Back Link */
.back-link-container {
    margin-top: 8px;
    padding-top: 16px;
}

.back-link {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.back-link:hover {
    color: var(--primary);
}

/* ================================================
   Phase 2 — Responsive
   ================================================ */

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 24px 20px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .balance-value {
        font-size: 1.5rem;
    }

    .nav-user {
        gap: 8px;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .history-table {
        font-size: 0.82rem;
    }

    .history-table th,
    .history-table td {
        padding: 10px 12px;
    }
}

/* ================================================
   Phase 3 — History, Filters, Weekly Summary
   ================================================ */

/* Weekly Summary Card */
.weekly-summary-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border-left: 4px solid var(--primary);
}

.weekly-summary-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

.weekly-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

.weekly-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weekly-stat-label {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.weekly-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.weekly-stat-value.tendency-gain {
    color: #E74C3C;
}

.weekly-stat-value.tendency-loss {
    color: #27AE60;
}

.weekly-stat-value.tendency-maintain {
    color: var(--primary);
}

.weekly-tendency {
    font-size: 0.88rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 16px;
    display: inline-block;
}

.weekly-tendency.tendency-gain {
    background: #FDF0EF;
    color: #E74C3C;
}

.weekly-tendency.tendency-loss {
    background: #EAFAF1;
    color: #27AE60;
}

.weekly-tendency.tendency-maintain {
    background: #EBF3FE;
    color: var(--primary);
}

/* Filter Card */
.filter-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    background: var(--light);
    border: 1.5px solid var(--border);
    text-decoration: none;
    transition: all var(--transition);
}

.filter-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: #EBF3FE;
}

.filter-btn.active {
    color: #FFFFFF;
    background: var(--primary);
    border-color: var(--primary);
}

.filter-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-custom label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
}

.filter-custom input[type="date"] {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition);
}

.filter-custom input[type="date"]:focus {
    border-color: var(--primary);
}

.filter-separator {
    color: var(--text-light);
    font-size: 0.9rem;
}

.btn-filter {
    padding: 8px 18px;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-filter:hover {
    background: var(--hover);
}

/* Record Count */
.record-count {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

/* Table Date Column */
.td-date {
    white-space: nowrap;
    font-weight: 500;
}

/* Tendency Badge */
.tendency-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.tendency-badge.tendency-gain {
    background: #FDF0EF;
    color: #E74C3C;
}

.tendency-badge.tendency-loss {
    background: #EAFAF1;
    color: #27AE60;
}

.tendency-badge.tendency-maintain {
    background: #EBF3FE;
    color: var(--primary);
}

/* Action Buttons in Table */
.td-actions {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.action-btn {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    border: 1.5px solid transparent;
    font-family: inherit;
    background: none;
}

.action-edit {
    color: var(--primary);
    border-color: var(--primary);
}

.action-edit:hover {
    background: #EBF3FE;
    color: var(--hover);
}

.action-delete {
    color: #E74C3C;
    border-color: #E74C3C;
}

.action-delete:hover {
    background: #FDF0EF;
}

/* ================================================
   Phase 3 — Responsive
   ================================================ */

@media (max-width: 600px) {
    .weekly-stats {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .filter-card {
        padding: 16px;
    }

    .filter-custom {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-custom input[type="date"] {
        width: 100%;
    }

    .td-actions {
        flex-direction: column;
        gap: 4px;
    }

    .td-date {
        font-size: 0.82rem;
    }
}

/* ================================================
   Phase 4 — Breathing Module
   ================================================ */

/* Breathing Header */
.breathing-header {
    text-align: center;
    margin-bottom: 32px;
}

.breathing-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.breathing-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Trigger Grid */
.trigger-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    max-width: 680px;
    margin: 0 auto 32px;
}

.trigger-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.trigger-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.trigger-icon {
    font-size: 2rem;
}

.trigger-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

/* Disclaimer */
.breathing-disclaimer {
    text-align: center;
    padding: 16px;
    max-width: 520px;
    margin: 0 auto;
}

.breathing-disclaimer p {
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* Breathing Session */
.breathing-session {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

/* Progress Bar */
.breathing-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.breathing-progress-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.breathing-cycle-info {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 32px;
    font-weight: 500;
}

/* Breathing Circle */
.breathing-circle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.breathing-circle {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--light);
    border: 4px solid var(--border);
    transition: all 0.8s ease;
}

.breathing-circle.phase-inhale {
    border-color: var(--primary);
    background: #EBF3FE;
    transform: scale(1.08);
}

.breathing-circle.phase-hold {
    border-color: #F0AD4E;
    background: #FFF8EC;
    transform: scale(1.08);
}

.breathing-circle.phase-exhale {
    border-color: var(--secondary);
    background: #EAFAF1;
    transform: scale(1);
}

.breathing-timer {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 8px;
}

.breathing-instruction {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    padding: 0 20px;
}

.phase-inhale .breathing-timer { color: var(--primary); }
.phase-hold .breathing-timer { color: #F0AD4E; }
.phase-exhale .breathing-timer { color: #27AE60; }

.phase-inhale .breathing-instruction { color: var(--primary); }
.phase-hold .breathing-instruction { color: #D4940A; }
.phase-exhale .breathing-instruction { color: #27AE60; }

/* Breathing Buttons */
.btn-breathing-start {
    background: var(--primary);
    color: #FFF;
    padding: 14px 36px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 12px;
}

.btn-breathing-start:hover {
    background: var(--hover);
}

.btn-breathing-cancel {
    background: none;
    color: var(--text-light);
    border: none;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-breathing-cancel:hover {
    color: var(--text);
}

/* Feedback */
.feedback-card {
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

.feedback-complete-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.feedback-card h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.feedback-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.feedback-question {
    margin-bottom: 24px;
}

.feedback-question h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.feedback-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.feedback-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    transition: all var(--transition);
    min-width: 120px;
}

.feedback-btn:hover {
    border-color: var(--primary);
}

.feedback-btn.selected {
    border-color: var(--primary);
    background: #EBF3FE;
    color: var(--primary);
}

.feedback-btn-icon {
    font-size: 1.4rem;
}

.btn-save-feedback {
    margin-top: 20px;
    width: 100%;
}

.btn-save-feedback:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Done Card */
.done-card {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

.done-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.done-card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.done-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.done-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.done-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.done-stat-label {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
}

.done-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    transition: all var(--transition);
    background: none;
}

.btn-secondary-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Dashboard Breathing Card */
.breathing-dashboard-card {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 32px;
}

.breathing-dash-left {
    background: linear-gradient(135deg, #5B8DEF 0%, #7ED1B2 100%);
    padding: 32px 28px;
    display: flex;
    align-items: center;
}

.breathing-dash-cta h4 {
    color: #FFF;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.breathing-dash-cta p {
    color: rgba(255,255,255,0.85);
    font-size: 0.88rem;
    margin-bottom: 16px;
    line-height: 1.6;
}

.btn-breathing-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    background: #FFF;
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

.btn-breathing-cta:hover {
    background: var(--light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: var(--hover);
}

.breathing-dash-right {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.breathing-dash-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.breathing-dash-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.breathing-dash-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

.breathing-dash-stat-label {
    font-size: 0.72rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.breathing-dash-last {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.breathing-dash-history-link {
    font-size: 0.85rem;
    font-weight: 600;
}

.breathing-dash-empty {
    text-align: center;
    padding: 8px 0;
}

.breathing-dash-empty p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* Points Summary Bar */
.points-summary-bar {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px 28px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.points-bar-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.points-bar-label {
    font-size: 0.72rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.points-bar-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

/* History Tags */
.trigger-tag {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--light);
    color: var(--text);
    white-space: nowrap;
}

.feeling-tag {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.feeling-better {
    background: #EAFAF1;
    color: #27AE60;
}

.feeling-same {
    background: #EBF3FE;
    color: var(--primary);
}

.feeling-worse {
    background: #FDF0EF;
    color: #E74C3C;
}

.impulse-tag {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.impulse-yes {
    background: #EAFAF1;
    color: #27AE60;
}

.impulse-no {
    background: #FDF0EF;
    color: #E74C3C;
}

/* ================================================
   Phase 4 — Responsive
   ================================================ */

@media (max-width: 600px) {
    .trigger-grid {
        grid-template-columns: 1fr 1fr;
    }

    .breathing-circle {
        width: 200px;
        height: 200px;
    }

    .breathing-timer {
        font-size: 2.8rem;
    }

    .feedback-options {
        flex-direction: column;
        align-items: center;
    }

    .feedback-btn {
        width: 100%;
        max-width: 260px;
        flex-direction: row;
        justify-content: center;
    }

    .feedback-card {
        padding: 28px 20px;
    }

    .done-card {
        padding: 28px 20px;
    }

    .done-stats {
        gap: 16px;
    }

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

    .breathing-dashboard-card {
        grid-template-columns: 1fr;
    }

    .breathing-dash-left {
        padding: 24px 20px;
    }

    .breathing-dash-right {
        padding: 20px;
    }

    .points-summary-bar {
        gap: 16px;
        padding: 16px 20px;
    }
}

/* ================================================
   Phase 5 — Progress & Charts
   ================================================ */

/* Progress Filter */
.progress-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

/* Chart Card */
.chart-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px 16px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.chart-card canvas {
    display: block;
    width: 100%;
}

.chart-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: var(--text-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-consumed {
    background: #E74C3C;
}

.legend-burned {
    background: var(--secondary);
}

/* Score & Feedback Row */
.score-feedback-row {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* Score Card */
.score-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.score-ring-container {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.score-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.score-max {
    font-size: 0.75rem;
    color: var(--text-light);
}

.score-level {
    font-size: 0.92rem;
    font-weight: 600;
    padding: 4px 16px;
    border-radius: 16px;
    display: inline-block;
    margin-bottom: 16px;
}

.score-excellent {
    background: #EAFAF1;
    color: #27AE60;
}

.score-good {
    background: #EBF3FE;
    color: var(--primary);
}

.score-normal {
    background: #FFF8EC;
    color: #D4940A;
}

.score-low {
    background: #FDF0EF;
    color: #E74C3C;
}

.score-breakdown {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-break-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-light);
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}

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

/* Auto Feedback Card */
.feedback-auto-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.feedback-auto-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.feedback-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    font-size: 0.88rem;
    line-height: 1.6;
}

.feedback-msg:last-child {
    margin-bottom: 0;
}

.feedback-msg-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
}

.feedback-success {
    background: #EAFAF1;
    color: #1E7E46;
}

.feedback-warn {
    background: #FFF8EC;
    color: #9A6C00;
}

.feedback-info {
    background: #EBF3FE;
    color: #2C5FB3;
}

/* Dashboard Progress Card */
.progress-dash-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    align-items: center;
}

.progress-dash-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.progress-dash-score canvas {
    display: block;
}

.progress-dash-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -58%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-dash-score-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.progress-dash-score-label {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
}

.progress-dash-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-dash-mini-chart {
    height: 60px;
    overflow: hidden;
}

.progress-dash-mini-chart canvas {
    display: block;
    width: 100%;
}

.progress-dash-feedback {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feedback-msg-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    padding: 6px 12px;
    border-radius: 6px;
    line-height: 1.5;
}

.progress-dash-empty {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.7;
}

.progress-dash-link {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ================================================
   Phase 5 — Responsive
   ================================================ */

@media (max-width: 700px) {
    .score-feedback-row {
        grid-template-columns: 1fr;
    }

    .progress-dash-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .progress-dash-score {
        margin: 0 auto;
    }

    .progress-dash-feedback {
        align-items: center;
    }

    .feedback-msg-mini {
        justify-content: center;
    }
}

/* ================================================
   Phase 6 — Account Settings
   ================================================ */

.account-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.account-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
}

.account-summary-icon {
    font-size: 1.4rem;
}

.account-summary-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.account-summary-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

/* ================================================
   Dashboard Redesign — Modern SaaS Health App
   ================================================ */

.db-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--light);
}

/* Top Bar */
.db-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.db-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
}

.db-topbar-logo {
    font-size: 1.3rem;
}

.db-topbar-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.db-topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.db-topbar-link {
    font-size: 0.85rem;
    color: var(--text-light);
    text-decoration: none;
    transition: color var(--transition);
}

.db-topbar-link:hover {
    color: var(--primary);
}

/* Main */
.db-main {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

/* Hero */
.db-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.db-hero h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.db-hero-date {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: 4px;
}

.db-streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #FFF8EC;
    border: 1.5px solid #F0D78C;
    border-radius: 20px;
    padding: 6px 14px;
    flex-shrink: 0;
    white-space: nowrap;
}

.db-streak-fire {
    font-size: 1rem;
}

.db-streak-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: #C68A00;
}

.db-streak-text {
    font-size: 0.72rem;
    color: #B07D00;
    font-weight: 500;
}

/* Onboarding */
.db-onboarding {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.db-onboarding-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.db-onboarding h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.db-onboarding p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Buttons */
.db-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
}

.db-btn-primary {
    background: var(--primary);
    color: #FFF;
}

.db-btn-primary:hover {
    background: var(--hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91,141,239,0.3);
    color: #FFF;
}

.db-btn-white {
    background: #FFF;
    color: var(--primary);
}

.db-btn-white:hover {
    background: var(--light);
    color: var(--hover);
}

.db-btn-lg {
    padding: 14px 36px;
    font-size: 1rem;
}

/* Primary CTA */
.db-cta-section {
    margin-bottom: 20px;
}

.db-primary-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--primary);
    color: #FFF;
    padding: 18px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition);
    box-shadow: 0 4px 16px rgba(91,141,239,0.25);
}

.db-primary-cta:hover {
    background: var(--hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(91,141,239,0.3);
    color: #FFF;
}

.db-primary-cta.db-cta-done {
    background: var(--secondary);
    box-shadow: 0 4px 16px rgba(126,209,178,0.25);
}

.db-primary-cta.db-cta-done:hover {
    background: #6BC4A3;
    box-shadow: 0 8px 24px rgba(126,209,178,0.3);
}

.db-cta-icon {
    font-size: 1.3rem;
}

.db-cta-text {
    flex: 1;
}

.db-cta-arrow {
    font-size: 1.2rem;
    opacity: 0.7;
}

/* Balance Hero */
.db-balance-hero {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 4px solid var(--border);
}

.db-balance-hero.tendency-loss {
    border-top-color: var(--secondary);
}

.db-balance-hero.tendency-gain {
    border-top-color: #E74C3C;
}

.db-balance-hero.tendency-maintain {
    border-top-color: var(--primary);
}

.db-balance-header {
    margin-bottom: 8px;
}

.db-balance-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.db-balance-number {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.tendency-loss .db-balance-number {
    color: #27AE60;
}

.tendency-gain .db-balance-number {
    color: #E74C3C;
}

.tendency-maintain .db-balance-number {
    color: var(--primary);
}

.db-balance-unit {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.6;
}

.db-balance-status {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 5px 16px;
    border-radius: 16px;
    display: inline-block;
}

.tendency-loss .db-balance-status {
    background: #EAFAF1;
    color: #27AE60;
}

.tendency-gain .db-balance-status {
    background: #FDF0EF;
    color: #E74C3C;
}

.tendency-maintain .db-balance-status {
    background: #EBF3FE;
    color: var(--primary);
}

/* Balance bars */
.db-balance-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.db-balance-detail {
    display: grid;
    grid-template-columns: 1fr 48px 70px;
    align-items: center;
    gap: 10px;
}

.db-balance-detail-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--light);
    overflow: hidden;
}

.db-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.db-bar-consumed .db-bar-fill {
    background: #F0836D;
}

.db-bar-burned .db-bar-fill {
    background: var(--secondary);
}

.db-balance-detail-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    text-align: left;
}

.db-balance-detail-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

/* Stats Row */
.db-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.db-stat-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.db-stat-mini-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.db-stat-mini-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.db-stat-mini-value small {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-light);
}

.db-stat-mini-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
}

.db-stat-mini-label small {
    font-weight: 400;
}

/* Progress Strip */
.db-progress-strip {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.db-progress-chart-col {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px 16px 4px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.db-progress-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 8px;
}

.db-weight-change {
    font-weight: 700;
    font-size: 0.82rem;
}

.db-sparkline-wrap {
    height: 80px;
    overflow: hidden;
}

.db-sparkline-wrap canvas {
    display: block;
    width: 100%;
}

.db-progress-feedback-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.db-feedback-pill {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Nav Grid */
.db-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.db-nav-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    border: 1.5px solid transparent;
}

.db-nav-tile:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--primary);
}

.db-nav-tile-icon {
    font-size: 1.5rem;
}

.db-nav-tile-label {
    font-size: 0.82rem;
    font-weight: 600;
}

/* Breathing Module */
.db-breathing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.db-breathing-left {
    background: linear-gradient(135deg, #5B8DEF 0%, #7ED1B2 100%);
    padding: 28px 24px;
    color: #FFF;
}

.db-breathing-left h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #FFF;
}

.db-breathing-left p {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-bottom: 16px;
}

.db-breathing-right {
    background: var(--bg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.db-breathing-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.db-breathing-stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.db-breathing-stat-num {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.db-breathing-stat-lbl {
    font-size: 0.68rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.db-breathing-hist-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
}

.db-breathing-empty-msg {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* ================================================
   Dashboard Redesign — Responsive
   ================================================ */

@media (max-width: 640px) {
    .db-main {
        padding: 16px 16px 40px;
    }

    .db-hero {
        flex-direction: column;
        gap: 12px;
    }

    .db-hero h1 {
        font-size: 1.15rem;
    }

    .db-balance-number {
        font-size: 2.2rem;
    }

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

    .db-progress-strip {
        grid-template-columns: 1fr;
    }

    .db-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .db-breathing {
        grid-template-columns: 1fr;
    }

    .db-breathing-left {
        padding: 24px 20px;
    }

    .db-breathing-right {
        padding: 20px;
    }

    .db-topbar {
        padding: 0 16px;
    }

    .db-primary-cta {
        padding: 16px 20px;
        font-size: 0.92rem;
    }

    .db-onboarding {
        padding: 32px 20px;
    }
}

/* ================================================
   Dashboard UI Improvements
   ================================================ */

/* Fade-in stagger animations */
.fade-up {
    opacity: 0;
    transform: translateY(14px);
    animation: fadeUpIn 0.45s ease forwards;
}
.d1 { animation-delay: 0.06s; }
.d2 { animation-delay: 0.12s; }
.d3 { animation-delay: 0.18s; }
.d4 { animation-delay: 0.24s; }
.d5 { animation-delay: 0.30s; }
.d6 { animation-delay: 0.36s; }

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

/* CTA subtitle */
.db-cta-text strong {
    display: block;
    font-size: 1rem;
}

.db-cta-text small {
    display: block;
    font-size: 0.78rem;
    opacity: 0.8;
    font-weight: 400;
    margin-top: 3px;
}

/* Balance Ring Row Layout */
.db-balance-ring-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
}

.db-balance-ring-wrap {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    height: 120px;
}

.db-balance-ring-wrap canvas {
    display: block;
}

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

.db-balance-ring-pct {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.db-balance-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.db-balance-info .db-balance-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.db-balance-info .db-balance-number {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 0;
}

.db-balance-info .db-balance-number small {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.5;
}

.db-balance-info .db-balance-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 3px 14px;
    border-radius: 14px;
    display: inline-block;
    width: fit-content;
    margin: 0;
}

/* Balance Bars */
.db-balance-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.db-bar-row {
    display: grid;
    grid-template-columns: 68px 1fr 56px;
    align-items: center;
    gap: 10px;
}

.db-bar-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
}

.db-bar-track {
    height: 8px;
    border-radius: 4px;
    background: var(--light);
    overflow: hidden;
}

.db-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.db-bar-consumed {
    background: linear-gradient(90deg, #F0836D, #E8665A);
}

.db-bar-burned {
    background: linear-gradient(90deg, #7ED1B2, #5BC49A);
}

.db-bar-val {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

/* ================================================
   Dashboard UI Improvements — Responsive
   ================================================ */

@media (max-width: 640px) {
    .db-balance-ring-row {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .db-balance-info {
        align-items: center;
    }

    .db-balance-info .db-balance-number {
        font-size: 1.8rem;
    }

    .db-bar-row {
        grid-template-columns: 56px 1fr 48px;
        gap: 8px;
    }

    .db-bar-label {
        font-size: 0.72rem;
    }
}

/* ================================================
   Support & Admin
   ================================================ */

/* Support Notice */
.support-notice {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #EBF3FE;
    border: 1px solid rgba(91,141,239,0.2);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.support-notice-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.support-notice-text p {
    font-size: 0.88rem;
    color: #2C6FD1;
    line-height: 1.7;
    margin-bottom: 4px;
}

.support-notice-text p:last-child {
    margin-bottom: 0;
}

/* Ticket List (User) */
.support-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.support-ticket-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.support-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.support-ticket-date {
    font-size: 0.82rem;
    color: var(--text-light);
}

.support-ticket-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 12px;
    white-space: nowrap;
}

.status-open {
    background: #FDF0EF;
    color: #E74C3C;
}

.status-answered {
    background: #EBF3FE;
    color: var(--primary);
}

.status-closed {
    background: #EAFAF1;
    color: #27AE60;
}

.support-msg-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
}

.support-ticket-message p,
.support-ticket-reply p {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text);
}

.support-ticket-reply {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    background: var(--light);
    margin-left: -24px;
    margin-right: -24px;
    margin-bottom: -24px;
    padding: 20px 24px;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Admin Ticket List */
.admin-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-ticket-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.admin-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-ticket-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-ticket-id {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
}

.admin-ticket-user {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.admin-ticket-date {
    font-size: 0.78rem;
    color: var(--text-light);
}

.admin-ticket-message {
    margin-bottom: 16px;
}

.admin-ticket-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.admin-reply-form .form-group {
    margin-bottom: 12px;
}

.admin-reply-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color 0.2s;
}

.admin-reply-form textarea:focus {
    border-color: var(--primary);
}

.admin-reply-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-status-select {
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text);
    background: var(--bg);
    outline: none;
}

.admin-status-select:focus {
    border-color: var(--primary);
}

.admin-close-form {
    display: inline;
}

/* Nav grid 5 columns */
@media (min-width: 641px) {
    .db-nav-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 640px) {
    .support-notice {
        flex-direction: column;
        gap: 10px;
    }

    .admin-ticket-header {
        flex-direction: column;
    }

    .admin-reply-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ================================================
   Category Tags
   ================================================ */

.admin-category-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
    display: inline-block;
    margin-left: 6px;
}

.cat-support {
    background: #EBF3FE;
    color: var(--primary);
}

.cat-billing {
    background: #FFF8EC;
    color: #B07D00;
}

.cat-cancel {
    background: #FDF0EF;
    color: #E74C3C;
}

.cat-bug {
    background: #F3E8FF;
    color: #7C3AED;
}

/* Plan Badge */
.db-plan-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.db-plan-monthly {
    background: var(--primary-light, #EBF3FE);
    color: var(--primary, #5B8DEF);
}

.db-plan-yearly {
    background: linear-gradient(135deg, rgba(91,141,239,0.12), rgba(126,209,178,0.12));
    color: #1E7E46;
}

/* ================================================
   Daily Feedback & Streak
   ================================================ */

.db-daily-feedback-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* Daily Feedback */
.db-daily-fb {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius);
    border-left: 4px solid transparent;
}

.db-daily-fb-good {
    background: #EAFAF1;
    border-left-color: #27AE60;
}

.db-daily-fb-neutral {
    background: #EBF3FE;
    border-left-color: var(--primary);
}

.db-daily-fb-warn {
    background: #FFF8EC;
    border-left-color: #F0AD4E;
}

.db-daily-fb-over {
    background: #FDF0EF;
    border-left-color: #E74C3C;
}

.db-daily-fb-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.db-daily-fb-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.db-daily-fb-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.db-daily-fb-msg {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
}

/* Streak Message */
.db-streak-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.db-streak-msg-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.db-streak-msg-text {
    font-size: 0.85rem;
    color: var(--text);
    flex: 1;
}

.db-streak-msg-count {
    font-size: 0.82rem;
    font-weight: 700;
    color: #C68A00;
    background: #FFF8EC;
    padding: 3px 12px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Empty streak badge */
.db-streak-empty {
    background: var(--light);
    border-color: var(--border);
}

.db-streak-empty .db-streak-text {
    color: var(--text-light);
}

@media (max-width: 640px) {
    .db-daily-fb {
        padding: 14px 16px;
        gap: 10px;
    }

    .db-daily-fb-msg {
        font-size: 0.85rem;
    }

    .db-streak-msg {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ================================================
   Retention: Urgency, Status, Mission
   ================================================ */

/* Urgency Alerts */
.db-urgency-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.db-urgency-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius);
    animation: urgencyPulse 3s ease-in-out infinite;
}

@keyframes urgencyPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.88; }
}

.db-urgency-warn {
    background: #FFF8EC;
    border: 1.5px solid #F0D78C;
}

.db-urgency-time {
    background: #FDF0EF;
    border: 1.5px solid #F2BEB8;
}

.db-urgency-recovery {
    background: #EBF3FE;
    border: 1.5px solid #B8D4F8;
}

.db-urgency-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.db-urgency-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.db-urgency-content strong {
    font-size: 0.9rem;
    color: var(--text);
}

.db-urgency-content span {
    font-size: 0.82rem;
    color: var(--text-light);
}

.db-urgency-cta {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    padding: 6px 16px;
    border: 1.5px solid var(--primary);
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.db-urgency-cta:hover {
    background: var(--primary);
    color: #FFF;
}

/* Status + Mission Row */
.db-status-mission-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

/* Dynamic Status */
.db-dynamic-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    border-left: 4px solid var(--border);
    min-width: 160px;
}

.db-dynamic-status-icon {
    font-size: 1.6rem;
}

.db-dynamic-status-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.db-dynamic-status-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.db-dynamic-status-value {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.db-status-focus { border-left-color: var(--primary); }
.db-status-focus .db-dynamic-status-value { color: var(--primary); }

.db-status-great { border-left-color: #27AE60; }
.db-status-great .db-dynamic-status-value { color: #27AE60; }

.db-status-stable { border-left-color: var(--secondary); }
.db-status-stable .db-dynamic-status-value { color: var(--secondary); }

.db-status-normal { border-left-color: var(--text-light); }
.db-status-normal .db-dynamic-status-value { color: var(--text); }

.db-status-caution { border-left-color: #E74C3C; }
.db-status-caution .db-dynamic-status-value { color: #E74C3C; }

.db-status-pending { border-left-color: #F0AD4E; }
.db-status-pending .db-dynamic-status-value { color: #C68A00; }

/* Daily Mission */
.db-daily-mission {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

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

.db-mission-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.db-mission-progress {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
}

.db-mission-bar {
    height: 6px;
    background: var(--light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 14px;
}

.db-mission-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.6s ease;
}

.db-mission-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.db-mission-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    transition: color 0.2s;
}

.db-mission-item.done {
    color: var(--text);
}

.db-mission-item.done span:last-child {
    text-decoration: line-through;
    opacity: 0.6;
}

.db-mission-check {
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ================================================
   Retention — Responsive
   ================================================ */

@media (max-width: 640px) {
    .db-status-mission-row {
        grid-template-columns: 1fr;
    }

    .db-dynamic-status {
        min-width: auto;
    }

    .db-urgency-alert {
        flex-wrap: wrap;
        gap: 10px;
    }

    .db-urgency-cta {
        width: 100%;
        text-align: center;
    }
}

/* ================================================
   PWA Install Card
   ================================================ */

.db-pwa-card {
    background: linear-gradient(135deg, #F0F6FF 0%, #E8F5EE 100%);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
}

.db-pwa-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.db-pwa-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.db-pwa-content p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 16px;
}

.db-pwa-instructions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.db-pwa-inst-block {
    background: var(--bg);
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.db-pwa-inst-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.db-pwa-inst-text strong {
    font-size: 0.92rem;
    display: block;
    margin-bottom: 8px;
    color: var(--text);
}

.db-pwa-inst-text ol {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 2;
}

.db-pwa-inst-text ol li {
    padding-left: 4px;
}

.db-pwa-share-icon {
    display: inline-block;
    background: var(--primary);
    color: #FFF;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.7rem;
    line-height: 20px;
    vertical-align: middle;
}

.db-pwa-note {
    font-size: 0.78rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 4px;
}

@media (max-width: 640px) {
    .db-pwa-card {
        padding: 20px;
    }

    .db-pwa-inst-block {
        padding: 14px 16px;
    }
}

/* ================================================
   Weight Goal Widget
   ================================================ */

.db-goal-widget {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    border-left: 4px solid var(--primary);
}

.db-goal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.db-goal-icon {
    font-size: 1.4rem;
}

.db-goal-title-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.db-goal-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.db-goal-sub {
    font-size: 0.78rem;
    color: var(--text-light);
}

.db-goal-pct {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
}

.db-goal-bar {
    height: 8px;
    background: var(--light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.db-goal-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.6s;
}

.db-goal-meta {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--text-light);
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.db-goal-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.db-goal-link:hover {
    text-decoration: underline;
}

.db-goal-empty {
    border-left-color: var(--border);
    padding: 0;
}

.db-goal-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.88rem;
    transition: background 0.2s;
    border-radius: var(--radius);
}

.db-goal-cta:hover {
    background: var(--light);
}

@media (max-width: 640px) {
    .db-goal-meta {
        gap: 10px;
    }
}

/* ================================================
   Cookie Consent Banner
   ================================================ */

.bb-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    padding: 0 16px 16px;
    animation: bbCookieSlide 0.4s ease;
}

@keyframes bbCookieSlide {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.bb-cookie-inner {
    background: var(--bg, #FFF);
    border-radius: 14px;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
    padding: 24px 28px;
    max-width: 620px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.bb-cookie-text strong {
    font-size: 0.95rem;
    color: var(--text, #333);
    display: block;
    margin-bottom: 8px;
}

.bb-cookie-text p {
    font-size: 0.82rem;
    color: var(--text-light, #777);
    line-height: 1.8;
    margin: 0;
}

.bb-cookie-buttons {
    display: flex;
    gap: 10px;
}

.bb-cookie-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.bb-cookie-accept {
    background: var(--primary, #5B8DEF);
    color: #FFF;
}

.bb-cookie-accept:hover {
    background: var(--primary-dark, #4A7BE0);
}

.bb-cookie-reject {
    background: var(--light, #F5F7FA);
    color: var(--text-light, #777);
    border: 1.5px solid var(--border, #E1E5EB);
}

.bb-cookie-reject:hover {
    background: #E8EAED;
}

@media (max-width: 480px) {
    .bb-cookie-inner {
        padding: 20px;
    }

    .bb-cookie-buttons {
        flex-direction: column;
    }
}