/* --- Core Styles --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    padding-top: 80px;
    /* Added padding to account for fixed header */
    background-color: #f0f2f5;

    /* Sticky Footer Setup */
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    /* Ensure padding doesn't affect min-height calc issues */
}

/* --- Header Styles --- */
#app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #f0f2f5;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.header-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    height: 32px !important;
    width: auto !important;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
}

.logo-icon path {
    fill: #327DD9;
}

.navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navigation li {
    margin-left: 20px;
}

.navigation a {
    text-decoration: none;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.2s ease;
    position: relative;
}

.navigation a:hover {
    color: #007bff;
}

.navigation a.active {
    color: #007bff;
}

.navigation a.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #007bff;
}

/* --- List Item Styles (mimicking ListTile) --- */
.list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.list-item:hover {
    background-color: #f5f5f5;
}

.list-item-leading {
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-container {
    width: 44px;
    height: 44px;
    background-color: #f0f2f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tab Avatar: letter-based group icon */
.tab-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.icon {
    width: 20px;
    height: 20px;
    fill: #555;
}


.receipt-title {
    font-weight: bold;
    font-size: 20px;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    line-height: 1.3;
}

.list-item-subtitle {
    font-size: 12px;
    color: #888;
    line-height: 1.2;
    margin-top: 2px;
}

.list-item-date {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

.unassigned-label {
    color: #6750A4; /* Brand purple */
    font-style: italic;
    font-weight: 500;
    margin-left: 4px;
}

.list-item-trailing {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    flex-shrink: 0;
}

.list-item-amount {
    font-weight: bold;
    font-size: 12px;
    color: #000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

/* Base currency amount (top line) in multi-currency expenses */
.expense-amount-base {
    font-weight: 700;
    font-size: 12px;
    color: #000;
}

/* Original expense currency (bottom line) in multi-currency expenses */
.expense-original-currency {
    font-weight: 400;
    font-size: 11px;
    color: #9370DB;
    letter-spacing: 0.1px;
}

/* Prominent amount for home-page tab cards */
.list-item-amount-large {
    font-weight: 700;
    font-size: 16px;
    color: #1a1a2e;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

/* Chevron on home-page tab cards */
.list-item-goto {
    font-size: 20px;
    color: #c4c4c4;
    line-height: 1;
    margin-left: 2px;
    flex-shrink: 0;
}

.menu-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: 8px;
}

.menu-icon {
    width: 24px;
    height: 24px;
    fill: #888;
}

/* --- Pagination Controls Styles --- */
#pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    padding: 4px 0 8px;
}

.pagination-arrow {
    background: none;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #888;
    transition: background-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.pagination-arrow svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.pagination-arrow:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.pagination-arrow:not(:disabled):hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: #444;
}

.pagination-label {
    font-size: 13px;
    font-weight: 500;
    color: #888;
    min-width: 60px;
    text-align: center;
    user-select: none;
}

/* --- Receipt View Styles --- */
/* --- Receipt View Styles --- */
#receipt-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: transparent;
    padding: 0;
    box-shadow: none;
}

.receipt-card {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Soft shadow */
    overflow: hidden;
    padding-bottom: 20px;
}

/* Header */
.receipt-header {
    padding: 0px 12px 12px;
    text-align: center;
}

.receipt-description {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.receipt-date {
    font-size: 14px;
    color: #888;
    margin-bottom: 16px;
}

.clickable-header {
    cursor: pointer;
    transition: color 0.2s ease;
}

.clickable-header:hover {
    color: #007bff;
}

.receipt-instruction {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.tap-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Items List */
.receipt-items-list {
    display: flex;
    flex-direction: column;
}

.receipt-item {
    display: flex;
    align-items: center;
    padding: 12px 12px;
    transition: background-color 0.15s ease;
    min-height: 48px;
}

.receipt-item.additional-charge {
    padding: 0px 12px 6px;
    min-height: 24px;
}

.receipt-item.selected {
    background-color: rgba(33, 150, 243, 0.05);
}

.receipt-item.clickable:hover {
    background-color: #fafafa;
    cursor: pointer;
}

.receipt-item.empty-state {
    justify-content: center;
    color: #888;
    font-style: italic;
    padding: 30px;
}

/* Left Column: Quantity */
.receipt-item-left {
    width: 40px;
    min-width: 40px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 15px;
    color: #333;
}

.status-check {
    color: #4CAF50;
    /* Green check */
    font-weight: bold;
    font-size: 18px;
}

.status-qty {
    font-weight: 500;
}

.selected-count {
    color: #007bff;
    font-weight: 800;
}

.total-qty {
    color: #999;
    font-size: 0.85em;
    font-weight: 500;
}

/* Middle Column: Details */
.receipt-item-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 12px;
}

.item-name {
    font-size: 15px;
    font-weight: 500;
    color: #222;
    line-height: 1.4;
    margin-bottom: 4px;
}

.assignee-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.assignee-badge {
    background-color: #b2dfdb;
    /* Teal 100 */
    color: #00695c;
    /* Teal 800 */
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Right Column: Price */
.receipt-item-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.item-price {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.item-price .currency {
    font-size: 12px;
    color: #888;
    font-weight: 400;
    margin-left: 2px;
}

.item-menu-dots {
    color: #757575;
    /* Darker gray for better visibility */
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: -6px;
    /* Pull closer to the right edge */
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.item-menu-dots:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Footer Section */
.receipt-footer {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.add-item-row {
    color: #666;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
}

.total-label {
    font-size: 18px;
    font-weight: 800;
    font-style: italic;
    color: #222;
}

.total-amount {
    font-size: 20px;
    font-weight: 800;
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
}

.currency-trigger {
    font-size: 13px;
    color: #6a5acd;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
}

.paid-by-row {
    text-align: right;
    font-size: 13px;
    color: #666;
}

.payer-link {
    color: #6a5acd;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* Assign Button (Floating or fixed) */
/* Assign Button (Floating or fixed) */
#assign-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.assign-btn {
    background-color: #6750A4;
    /* M3 Purple */
    color: white;
    border: none;
    border-radius: 100px;
    /* Pill shape */
    padding: 10px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    /* Subtle shadow */
}

.assign-btn:hover {
    background-color: #5F4996;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.context-menu {
    display: none;
    position: fixed;
    top: 64px;
    /* Slightly lower */
    right: 20px;
    background-color: #F7F2FA;
    /* Surface Container Low (Light Purple Tint) */
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    z-index: 1000;
    padding: 8px 0;
    overflow: hidden;
}

.context-menu.show {
    display: block;
}

.context-menu-header {
    padding: 12px 16px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    color: #333;
    font-size: 14px;
}

.context-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    color: #1D1B20;
    /* Dark text */
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    /* Space between icon and text */
}

.context-menu-item:hover {
    background-color: rgba(103, 80, 164, 0.08);
    /* Purple tint hover */
}

.context-menu-icon {
    width: 24px;
    height: 24px;
    color: #49454F;
    /* Icon color */
    flex-shrink: 0;
}

.context-menu-divider {
    height: 1px;
    background-color: #eee;
    margin: 8px 0;
}

/* --- Expense Details Styles --- */
.expense-details-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.expense-details-header {
    margin-bottom: 20px;
    position: relative;
}

.expense-details-header h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 20px;
}

.expense-amount {
    font-weight: bold;
    font-size: 18px;
    color: #000;
    margin-bottom: 5px;
}

.expense-date {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.expense-type-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #e0f0ff;
    color: #0056b3;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: bold;
}

.expense-section {
    margin-bottom: 20px;
}

.expense-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.expense-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.expense-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.participant-name {
    font-size: 14px;
    color: #333;
}

.participant-amount {
    font-size: 14px;
    font-weight: bold;
    color: #000;
}

.back-button {
    background-color: transparent;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    transition: background-color 0.2s ease, transform 0.1s ease;
    padding: 0;
}

.back-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.back-button:active {
    transform: scale(0.95);
}

.back-button svg {
    display: block;
}

/* --- App Spinner Styles --- */
.app-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 200000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-text {
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    min-height: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Modal Styles --- */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-container.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 400px;
    padding: 20px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-container.show .modal-content {
    transform: translateY(0);
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}


/* --- Header Action Buttons --- */
.header-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    margin-left: 8px;
}

/* Receipt icon sits on the left side, opposite the delete (trash) icon */
.receipt-icon-btn {
    margin-left: 0;
    margin-right: 8px;
}

.header-icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.header-icon-btn svg {
    width: 24px;
    height: 24px;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-button {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.modal-button.cancel-button {
    background-color: #f0f2f5;
    border: none;
    color: #333;
}

.modal-button.cancel-button:hover {
    background-color: #e0e0e0;
}

.modal-button.add-button {
    background-color: #007bff;
    border: none;
    color: white;
}

.modal-button.add-button:hover {
    background-color: #0056b3;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #333;
}

/* Add participant form styles */
.add-participant-form {
    display: flex;
    flex-direction: column;
}

.participant-name-input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}

.participant-name-input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.participant-name-input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* --- Share & QR Code Styles --- */
.share-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
    margin-top: 20px;
}

.qr-wrapper {
    background: transparent;
    padding: 0;
    margin-bottom: 5px;
}

.qr-wrapper svg {
    display: block;
    width: 150px;
    height: 150px;
}

.qr-wrapper rect {
    fill: transparent;
    /* Default all to transparent */
}

/* Target the modules (the actual code squares) */
.qr-wrapper rect:not(:first-child),
.qr-wrapper rect[fill="#000000"] {
    fill: #6750A4;
}

/* Explicitly ensure the background is transparent */
.qr-wrapper rect:first-child,
.qr-wrapper rect[fill="#ffffff"] {
    fill: transparent;
}

.share-link-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    color: #6750A4;
    border: 1.5px solid #6750A4;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-link-btn:hover {
    background-color: rgba(103, 80, 164, 0.08);
    transform: translateY(-1px);
}

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

.share-link-btn svg {
    width: 18px;
    height: 18px;
}

/* --- Store Badges --- */
.store-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 0;
    margin-top: 10px;
    flex-wrap: wrap;
}

.store-badge {
    height: 40px;
    transition: transform 0.2s ease;
}

.store-badge:hover {
    transform: scale(1.05);
}

.store-badge img {
    height: 100%;
    display: block;
}

/* --- Mobile Smart CTA --- */
.mobile-get-app-container {
    display: flex;
    justify-content: center;
    padding: 30px 20px;
    width: 100%;
    box-sizing: border-box;
}

.mobile-cta-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6750A4;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 10px;
}

.mobile-cta-link span {
    font-weight: 800;
}

.mobile-cta-link:active {
    opacity: 0.7;
    transform: scale(0.98);
}

.mobile-cta-link svg {
    transition: transform 0.2s ease;
}

#app-container {
    padding-bottom: 20px;
    flex: 1;
    /* Push footer to bottom */
    width: 100%;
    /* Ensure it takes full width of flex parent */
}

.mobile-cta-link:hover svg {
    transform: translate(2px, -2px);
}

/* --- Receipt Image Section --- */
.receipt-image-section {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.receipt-visibility-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #2e2e2e;
    color: white;
    padding: 16px;
    border-radius: 16px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.receipt-visibility-toggle .toggle-label {
    font-weight: 600;
    font-size: 16px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.receipt-visibility-toggle .toggle-description {
    font-size: 12px;
    color: #aaa;
    line-height: 1.4;
    max-width: 80%;
}

.receipt-image-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.receipt-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 4px;
    /* Thin line style like in screenshot? No, standard is better first */
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #6a5acd;
    /* Primary Purple */
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* --- Floating Action Button --- */
.receipt-fab {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a1a1a;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    z-index: 1500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

.receipt-fab:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.receipt-fab:active {
    transform: translateX(-50%) scale(0.98);
}

/* --- Bottom Sheet --- */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bottom-sheet-overlay.show {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet-content {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 600px;
    background-color: #ffffff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.1, 0.7, 0.1, 1);
    z-index: 2001;
    color: #333;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
}

.sheet-header-section {
    flex-shrink: 0;
    padding: 24px 16px 16px 16px;
    background-color: #ffffff;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.sheet-header-section .modal-title {
    flex: 1;
    padding-bottom: 0;
    border-bottom: none;
    font-size: 20px;
    margin: 0;
}

.sheet-scroll-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 40px 16px;
    position: relative;
    overscroll-behavior-y: contain;
}

.bottom-sheet-overlay.show .bottom-sheet-content {
    transform: translateX(-50%) translateY(0);
}

.sheet-handle-bar {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
}

.sheet-back-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
    margin-left: -8px;
    color: #333;
    align-items: center;
    justify-content: center;
}

.header-action-text-btn {
    background: none;
    border: none;
    color: #6750A4;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
    margin-left: 8px;
    margin-right: -8px;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-action-text-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Currency Picker --- */
.currency-picker-sheet {
    height: 85dvh;
}

.currency-picker-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    padding: 0 16px 12px;
    letter-spacing: -0.2px;
}

.currency-picker-search-wrapper {
    position: relative;
    margin: 0 16px 8px;
}

.currency-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.currency-picker-search {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px 10px 38px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #f7f7f9;
    outline: none;
    color: #1a1a1a;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.currency-picker-search:focus {
    border-color: #6750A4;
    background: #fff;
}

.currency-picker-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 40px;
    overscroll-behavior-y: contain;
    min-height: 300px;
}

.currency-section-header {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.currency-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-radius: 0;
}

.currency-picker-row:hover {
    background-color: rgba(103, 80, 164, 0.06);
}

.currency-picker-row.selected {
    background-color: rgba(103, 80, 164, 0.08);
}

.currency-row-symbol {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0edf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #6750A4;
    flex-shrink: 0;
    text-align: center;
    line-height: 1;
}

.currency-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.currency-row-code {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.currency-row-name {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.currency-row-check {
    color: #6750A4;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.currency-picker-empty {
    text-align: center;
    color: #aaa;
    font-size: 14px;
    padding: 40px 16px;
}

/* Currency button in the expense form (makes it look tappable) */
.currency-select-btn {
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: 1.5px solid transparent;
    color: #1a1a1a;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.currency-select-btn:hover {
    background-color: #ede7f6;
    border-color: #6750A4;
    color: #6750A4;
}

.currency-select-btn:active {
    background-color: #d1c4e9;
}

.currency-select-btn .currency-chevron {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.currency-select-btn:hover .currency-chevron {
    opacity: 1;
}

/* --- Footer --- */
.app-footer {
    text-align: center;
    color: #aaa;
    font-size: 0.8rem;
    margin-top: auto;
}

.app-footer strong {
    color: #888;
}

/* --- Welcome Page Styles --- */
.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: calc(100dvh - 200px);
    text-align: center;
}

.welcome-heading {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px 0;
    letter-spacing: -0.3px;
}

.welcome-description {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 40px 0;
    max-width: 480px;
}

.welcome-button {
    background-color: #6750A4;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(103, 80, 164, 0.3);
    margin-bottom: 64px;
}

.welcome-button:hover {
    background-color: #5F4996;
    box-shadow: 0 4px 12px rgba(103, 80, 164, 0.4);
    transform: translateY(-2px);
}

.welcome-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(103, 80, 164, 0.3);
}

#welcome-store-badges {
    margin-top: 0;
}

/* Responsive Design */
@media (max-width: 600px) {
    .welcome-heading {
        font-size: 28px;
    }

    .welcome-description {
        font-size: 15px;
        padding: 0 16px;
    }

    .welcome-button {
        padding: 14px 40px;
        font-size: 16px;
    }
}

/* Mobile Modal Styles */
@media (max-width: 600px) {
    .bottom-sheet-content {
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        bottom: 0;
    }
    
    .sheet-handle-bar {
        display: none;
    }
    
    .sheet-header-section {
        padding: 16px;
    }
    
    .sheet-back-btn {
        display: flex;
    }
    
    .header-icon-btn, .header-action-text-btn {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
    }
}