:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F8FAFC;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --input-bg: #FFFFFF;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --shadow-sticky: 0 4px 20px -2px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 0.05) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 0.03) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 0.04) 0, transparent 50%);
    background-attachment: fixed;
    padding-bottom: 80px;
}

/* Nav & Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.hero {
    margin-bottom: 1.5rem;
    text-align: center;
    padding: 2rem 1.5rem 1rem;
    transition: all 0.4s ease;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}

p {
    color: var(--text-muted);
    font-size: 1rem;
}

.subtitle {
    margin-top: -0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.conversational-label {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    margin-bottom: 0.5rem !important;
    display: block;
}

/* Sticky Dashboard */
.sticky-dashboard {
    width: 100%;
    margin: 0 0 1.5rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: sticky;
    top: 1rem;
    z-index: 50;
}

.dashboard-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sticky);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: padding 0.3s ease;
}

.dash-recipe-name-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dash-recipe-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
    cursor: text;
}

.dash-recipe-name-input {
    font-family: inherit;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--primary);
    outline: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 200px;
    text-align: center;
}

.dash-totals-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: 0.5rem;
}

.dash-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-amount {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin: 0.25rem 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    font-variant-numeric: tabular-nums;
}

.dash-mini-breakdown {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-weight: 500;
}

.dash-missing {
    font-size: 0.8rem;
    color: var(--warning);
    text-align: center;
    background: #FFFBEB;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid #FEF3C7;
    margin-top: 0.5rem;
    width: 100%;
}

.dash-output-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.dash-breakdown-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0.2rem;
}

.dash-mini-breakdown {
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.dash-breakdown-btn {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Scrolled state */
.sticky-dashboard.scrolled .dashboard-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
}

.sticky-dashboard.scrolled .dash-recipe-name-container {
    margin-bottom: 0;
}

.sticky-dashboard.scrolled .dash-recipe-name {
    font-size: 1rem;
}

.sticky-dashboard.scrolled .dash-amount {
    font-size: 1.4rem;
    margin: 0;
}

.sticky-dashboard.scrolled .dash-mini-breakdown,
.sticky-dashboard.scrolled .dash-missing {
    display: none;
}

/* App Container & Cards */
.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .app-container {
        flex-direction: row;
        align-items: flex-start;
        gap: 2rem;
    }

    .sticky-dashboard {
        position: sticky;
        top: 2rem;
        width: 300px;
        flex-shrink: 0;
        margin: 0;
    }

    main {
        flex: 1;
        min-width: 0;
    }
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-glass);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.intro-card {
    background: #ffffff;
    border: 2px solid transparent;
    box-shadow: var(--shadow-md);
}

.intro-card:focus-within {
    border-color: rgba(79, 70, 229, 0.3);
}

/* Forms */
.entry-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    background: #F8FAFC;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
    transition: border-color 0.3s ease;
}

.entry-form.edit-mode {
    border-style: solid;
    border-color: var(--warning);
    background: #FFFBEB;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.align-end {
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    position: relative;
}

.full-width {
    width: 100%;
}

.half-width {
    width: 50%;
}

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

input,
select {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--input-bg);
    color: var(--text-main);
    transition: all 0.2s ease;
    width: 100%;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.error-msg {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.input-with-unit,
.input-with-button {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--input-bg);
    overflow: hidden;
    transition: all 0.2s ease;
}

.input-with-unit:focus-within,
.input-with-button:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-with-unit input,
.input-with-unit select,
.input-with-button input,
.input-with-button button {
    border: none;
    border-radius: 0;
    background: transparent;
}

.input-with-unit input:focus,
.input-with-unit select:focus,
.input-with-button input:focus,
.input-with-button button:focus {
    box-shadow: none;
}

.input-with-unit select {
    width: auto;
    padding-left: 0.5rem;
    padding-right: 2rem;
    background-color: #F1F5F9;
    border-left: 1px solid var(--border-color);
    font-weight: 500;
}

/* Buttons */
.btn {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

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

.btn.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn.primary.update {
    background-color: var(--warning);
}

.btn.primary.update:hover {
    background-color: #D97706;
}

.btn.secondary {
    background-color: #E0E7FF;
    color: var(--primary);
}

.btn.secondary:hover {
    background-color: #C7D2FE;
}

.btn.secondary.outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

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

.btn.secondary.outline.update {
    border-color: var(--warning);
    color: var(--warning);
}

.btn.secondary.outline.update:hover {
    background-color: #FFFBEB;
}

.btn.text-btn {
    background: transparent;
    color: var(--primary);
    width: auto;
    padding: 0.5rem 1rem;
}

.btn.text-btn:hover {
    background: rgba(79, 70, 229, 0.05);
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #E2E8F0;
    color: var(--text-main);
}

.icon-btn.pencil-icon:hover {
    color: var(--primary);
}

.icon-btn.trash-icon:hover {
    color: var(--danger);
}

/* Next Actions Section */
.section-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

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

.section-header-editable {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.btn-finish-section {
    width: auto;
}

.skip-btn {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    margin: 0;
}

.horizontal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: auto;
    padding: 0.4rem 1.25rem;
    border-radius: 100px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Animation Phases */
@keyframes popDown {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.list-item.new-item-pop {
    animation: popDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .list-item.new-item-pop {
        animation: none;
    }
}

.fade-out-form {
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.fade-in-summary {
    opacity: 1;
    transition: opacity 0.3s ease 0.3s;
    /* delay so it fades in after form fades out */
}

/* Progressive Sections Flex Layout */
#progressive-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.order-1 {
    order: 1;
    transition: order 0.3s;
}

.order-2 {
    order: 2;
    transition: order 0.3s;
}

.order-3 {
    order: 3;
    transition: order 0.3s;
}

.list-item.inline-edit-mode {
    flex-direction: column;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid var(--primary);
    align-items: stretch;
}

/* Delete Confirmation */
.delete-confirm-overlay {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #FEF2F2;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #FCA5A5;
    font-size: 0.9rem;
}

.delete-confirm-text {
    font-weight: 500;
    color: #7F1D1D;
}

.delete-confirm-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-keep {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-remove {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Progressive Sections Flex Layout */
#progressive-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-1 {
    order: 1;
}

.order-2 {
    order: 2;
}

.order-3 {
    order: 3;
}

.order-4 {
    order: 4;
}

/* Missing Cost Message */
.missing-cost-card {
    background: transparent;
    border: none;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-radius: 0;
    box-shadow: none;
}

.missing-cost-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.missing-cost-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Completed Summary Card */
.completed-summary-card {
    border: 1px solid var(--border-color);
    background: #ffffff;
    box-shadow: none;
}

.completed-summary-card {
    border: 1px solid var(--border-color);
    background: #ffffff;
    box-shadow: none;
}

.completed-summary-card .section-header-editable h2 {
    font-size: 1.2rem;
    color: var(--text-main);
}

/* Lists */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.list-item.editing {
    opacity: 0.5;
    pointer-events: none;
}

.list-item-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.list-item-name {
    font-weight: 500;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.list-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.list-item-cost {
    font-weight: 600;
    color: var(--primary);
    margin-right: 1rem;
}

.list-item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}


/* Final Result */
.final-result {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 2px solid var(--primary);
}

.profit-results {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #F8FAFC;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.result-row:last-of-type {
    margin-bottom: 0;
}

.result-row .amount.highlight {
    color: var(--success);
    font-weight: 700;
}

.margin-warning {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #FEF2F2;
    color: var(--danger);
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    text-align: center;
    line-height: 1.4;
}

/* Teaser Section */
.teaser-section {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, #ffffff, #F8FAFC);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(79, 70, 229, 0.2);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-sm);
}

.teaser-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.teaser-section p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.teaser-section button {
    max-width: 250px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    background: #ffffff;
    position: relative;
    padding: 2rem;
    text-align: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-btn {
    margin-bottom: 1rem;
}

.google-auth {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.google-auth:hover {
    background: #F8FAFC;
}

/* Full Screen Breakdown Modal */
.full-screen-modal .modal-content.breakdown-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
    padding: 2.5rem;
}

.breakdown-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.breakdown-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    flex: 1;
    background: #F8FAFC;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.stat-box.highlight-stat {
    background: #ECFDF5;
    border-color: #A7F3D0;
}

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

.stat-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0.25rem;
}

.stat-box.highlight-stat .stat-label {
    color: #065F46;
}

.stat-box.highlight-stat .stat-val {
    color: var(--success);
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.breakdown-table th,
.breakdown-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.breakdown-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breakdown-table tfoot th {
    font-size: 1.1rem;
    color: var(--text-main);
    border-top: 2px solid var(--border-color);
}

.breakdown-table tbody tr:hover {
    background: #F8FAFC;
}

/* Footer Settings */
#footer-settings {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    z-index: 50;
}

.clean-select {
    border: none;
    background: transparent;
    font-family: inherit;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    outline: none;
    padding: 0;
}

/* Utilities & Animations */
.hidden {
    display: none !important;
}

/* Smooth Reveals instead of sudden popping */
.smooth-reveal {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-reveal.revealed {
    opacity: 1;
    max-height: 2000px;
    /* arbitrary large enough number */
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-width: 1px;
}

.section-actions.smooth-reveal.revealed {
    padding-top: 1rem;
    padding-bottom: 0;
    border-width: 1px 0 0 0;
    margin-bottom: 0;
}

.profit-results.smooth-reveal.revealed {
    border-width: 1px;
}

.fade-transition {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    position: absolute;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .half-width {
        width: 100%;
    }

    .form-row.align-end {
        align-items: flex-start;
    }

    .breakdown-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .full-screen-modal .modal-content.breakdown-content {
        padding: 1.5rem;
    }
}

/* --- Landing Page --- */
.landing-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 3rem 0;
    align-items: center;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.hero-card {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

/* Trust Points */
.trust-points {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 4rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .trust-points {
        grid-template-columns: repeat(3, 1fr);
    }
}

.trust-point {
    text-align: center;
}

.trust-point svg {
    color: var(--primary);
    margin-bottom: 1rem;
}

.trust-point h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.trust-point p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* How It Works */
.how-it-works {
    padding: 4rem 0;
    text-align: center;
}

.how-it-works h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
}

.steps-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .steps-container {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 2rem;
    }
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 200px;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.step p {
    font-weight: 500;
    color: var(--text-main);
}

.step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .step-arrow {
        margin-top: 8px;
        /* align with numbers */
        transform: rotate(-90deg);
        /* point right */
    }
}

/* Example Preview */
.example-preview {
    padding: 4rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, transparent, rgba(79, 70, 229, 0.03) 50%, transparent);
}

.example-preview h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.preview-card {
    width: 100%;
    max-width: 400px;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 1rem;
}

.preview-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding-left: 1rem;
}

.preview-val {
    font-family: monospace;
    font-size: 1.05rem;
}

.preview-strong {
    font-weight: 700;
}

.preview-success {
    color: var(--success);
    font-weight: 700;
}

.preview-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.preview-alert {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Final CTA */
.final-cta {
    padding: 4rem 0 6rem;
    text-align: center;
}

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

}

.breakdown-detail-row td {
    transition: all 0.3s ease;
    opacity: 1;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;

}

.breakdown-detail-row.hidden td {
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: none;
}

/* User Menu & Navigation */
.nav-right {
    display: flex;
    align-items: center;
    position: relative;
}

.user-menu-container {
    position: relative;
}

.user-chip-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem 0.35rem 0.4rem;
    border-radius: 9999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.user-chip-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #818CF8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.user-name {
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chevron-down {
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-chip-btn[aria-expanded="true"] .chevron-down {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 230px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.user-dropdown-header {
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
}

.user-dropdown-header strong {
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.4rem 0;
}

.user-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}

.user-dropdown-item:hover {
    background: #F1F5F9;
    color: var(--primary);
}

.user-dropdown-item.danger:hover {
    background: #FEF2F2;
    color: var(--danger);
}

.badge {
    margin-left: auto;
    background: #EEF2FF;
    color: var(--primary);
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1E293B;
    color: #FFFFFF;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 1;
}

.toast.toast-success {
    background: #065F46;
    border: 1px solid #10B981;
}

.toast.toast-error {
    background: #991B1B;
    border: 1px solid #EF4444;
}

/* My Recipes Page */
.recipes-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.recipes-page-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.recipes-toolbar {
    margin-bottom: 1.5rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    max-width: 400px;
    box-shadow: var(--shadow-sm);
}

.search-box svg {
    color: var(--text-muted);
}

.search-input {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    background: transparent;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.recipe-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-glass);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.08);
    border-color: rgba(79, 70, 229, 0.3);
}

.recipe-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.recipe-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.recipe-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
}

.recipe-card-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    background: #F8FAFC;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    text-align: center;
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0.15rem;
}

.metric-val.profit-val {
    color: var(--success);
}

.margin-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.margin-badge.good {
    background: #D1FAE5;
    color: #065F46;
}

.margin-badge.thin {
    background: #FEF3C7;
    color: #92400E;
}

.margin-badge.loss {
    background: #FEE2E2;
    color: #991B1B;
}

.recipe-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.empty-recipes-card {
    text-align: center;
    padding: 4rem 2rem;
    background: #FFFFFF;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#result-section {
    order: 99 !important;
}

.auth-mode-tabs .active-auth-tab {
    color: var(--primary) !important;
    border-bottom: 2px solid var(--primary) !important;
}