#rules-top-sheet .google-style-modal {
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
}

/* Google-style Modal */
.google-style-modal {
  max-width: 500px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: modal-fade-in 0.2s ease-out;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.google-style-modal .modal-close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 32px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background-color 0.2s;
}

.google-style-modal .modal-close-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.google-header {
  background-color: #1a73e8;
  color: white;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
}

.google-content {
  padding: 0;
  background-color: #fff;
  flex-grow: 1;
  overflow-y: auto;
}

.google-section {
  padding: 16px 24px;
  border-bottom: 1px solid #dadce0;
}

.google-section:last-child {
  border-bottom: none;
}

.google-section-title {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  margin: 0 0 16px 0;
}

.google-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.google-card {
  /* background-color: #f8f9fa; */
  border-radius: 8px;
  /* padding: 16px; */
  padding: 0px;
}

.google-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.google-category {
  display: flex;
  flex-direction: column;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8eaed;
}

.google-category:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.google-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.google-category-name {
  color: #202124;
  font-size: 14px;
  font-weight: 500;
}

.google-category-counts {
  font-size: 14px;
  display: flex;
  align-items: center;
}

.google-category-current {
  color: #1a73e8;
  font-weight: 500;
}

.google-category-separator {
  color: #5f6368;
  margin: 0 2px;
}

.google-category-goal {
  color: #5f6368;
}

.google-progress-container {
  height: 8px;
  background-color: #e8eaed;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.google-progress-bar {
  height: 100%;
  background-color: #34a853; /* Google green */
  border-radius: 4px;
  transition: width 0.3s ease;
}

.google-category-description {
  color: #5f6368;
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.4;
}

.google-category-with-goal {
  position: relative;
}

.google-progress-overview {
  margin-bottom: 16px;
  text-align: center;
}

.google-progress-text {
  color: #5f6368;
  font-size: 14px;
  margin: 0;
}

.google-help-card {
  color: #202124;
  font-size: 14px;
  line-height: 1.5;
}

.google-help-list {
  margin: 12px 0 0 0;
  padding-left: 24px;
}

.google-help-list li {
  margin-bottom: 8px;
  color: #5f6368;
}

.google-help-list li:last-child {
  margin-bottom: 0;
}

.google-section-collapsible {
  width: 100%;
}

.google-collapsible-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.google-collapsible-header:hover .google-section-title {
  color: #4285f4;
}

.google-collapsible-icon {
  color: #5f6368;
  font-size: 14px;
  transition: transform 0.2s;
}

.google-collapsible-content {
  display: none;
  overflow: hidden;
  margin-top: 12px;
  transition: max-height 0.3s ease-out;
}

.google-category-name {
  color: #5f6368;
  font-size: 14px;
}

.google-category-value {
  color: #202124;
  font-weight: 500;
  font-size: 14px;
}

.google-empty-message {
  color: #5f6368;
  font-size: 14px;
  text-align: center;
  padding: 12px 0;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); z-index: 9998; /* Increased z-index */
    display: none; /* Hidden by default */
    justify-content: center; align-items: center; /* Center modal content */
}
/* JS adds 'active' class to show the overlay */
.modal-overlay.active { display: flex; }

.modal {
    background-color: #fff; padding: 0; border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); z-index: 9999; /* Increased z-index */
    width: 90%; max-width: 450px; /* Default max width for auth/list */
    position: relative; display: flex; flex-direction: column; /* Restored position: relative */
    max-height: 85vh; overflow: hidden; /* Prevent modal exceeding viewport height */
    /* Removed margin: auto; */
}
.modal-header {
    width: 100%;
    text-align: center;
    font-size: 1.3em;
    font-weight: 600;
    color: #fff;
    background:#2563EB;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Specific styling for shopping list header */
#shopping-list-inline-content .modal-header {
    font-size: 1.4em;
    font-weight: 700;
    color: #1f2937;
    padding: 12px 20px;
    margin-bottom: 5px;
}
.modal-content {
    width: 100%; color: #333; font-size: 1em;
    flex-grow: 1; overflow-y: auto; /* Allow content scrolling */
    padding: 20px 25px; 
    box-sizing: border-box;
}

.modal-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.8em;
    line-height: 0;
    color: #aaa;
    cursor: pointer;
    padding: 5px;
    z-index: 1051;
}

.modal-close-button:hover {
    color: #333;
}
/* Removed .modal-content.shopping-list-content rule */



/* --- Image Modal Specific Styles --- */
#image-modal {
    /* Override default modal size constraints */
    width: auto; height: auto; max-width: 100vw; max-height: 85vh;
    padding: 20px; /* Add padding around the image */
    background-color: rgba(255, 255, 255, 0.95); /* Slightly transparent background */
    flex-direction: row; /* Align image/button */
    justify-content: center; /* Center content horizontally */
    align-items: center; /* Center content vertically */
    border: 0px solid red; /* For debugging */
    margin: auto; /* Attempt to center with margin */
    margin: 15px;
}
.search-result-details .search-result-price-per-unit { /* Increased specificity */
    font-size: 0.85em !important; /* Adjust to be clearly smaller but legible, added !important */
    color: #6b7280; /* Gray color */
}
/* Removed extra closing brace that was here */
#expanded-image {
    display: block; max-width: 100%; max-height: calc(85vh - 60px); /* Max height considering padding */
    object-fit: contain; border-radius: 4px;
}
#image-modal-close-button {
    /* Style close button for image modal */
    top: 8px; right: 10px; background-color: rgba(0, 0, 0, 0.3); color: white;
    border-radius: 50%; width: 30px; height: 30px; font-size: 1.5em;
    line-height: 0px; text-align: center; transition: background-color 0.2s ease;
}
#image-modal-close-button:hover { background-color: rgba(0, 0, 0, 0.6); }

/* --- Auth Specific Styles in Modal --- */
#auth-status { /* Container for status messages/spinner */
    min-height: 24px; margin-top: 10px; margin-bottom: 15px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-icon { width: 20px; height: 20px; } /* Generic icon size */

.auth-message { font-size: 0.9em; text-align: center; }
.auth-message.error { color: #ef4444; } /* Red for errors */
.auth-message.success { color: #10b981; } /* Green for success */
/* Input validation styles (optional, can be added by JS) */
/* input.invalid { border-color: #ef4444; } */
/* input.valid { border-color: #10b981; } */

/* --- Upload Progress Bar Styling (in Auth Modal) --- */
#upload-progress-bar {
    height: 8px; appearance: none; -webkit-appearance: none;
    border: none; border-radius: 4px; overflow: hidden; width: 100%;
}
/* Track */
#upload-progress-bar::-webkit-progress-bar { background-color: #e5e7eb; border-radius: 4px; }
/* Value */
#upload-progress-bar::-webkit-progress-value { background-color: #10b981; border-radius: 4px; transition: width 0.3s ease-out; }
/* Firefox */
#upload-progress-bar::-moz-progress-bar { background-color: #10b981; border-radius: 4px; transition: width 0.3s ease-out; }

/* Styling for status text/icons within the upload area */
#upload-status-text .auth-message { font-size: 0.9em; vertical-align: middle; }
#upload-status-text .auth-message.error { color: #ef4444; }
#upload-status-text .auth-message.success { color: #10b981; }
#upload-status-text .spinner.small { display: inline-block; vertical-align: middle; margin-right: 8px; }
#upload-status-text .auth-icon { display: inline-block; vertical-align: middle; margin-right: 8px; width: 20px; height: 20px; }

/* --- Welcome Modal Icon Styling --- */
.modal-icon-button {
    display: inline-flex; /* Use inline-flex for alignment */
    width: 32px;         /* Smaller size for inline */
    height: 32px;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1); /* Subtle shadow */
    align-items: center;
    justify-content: center;
    vertical-align: middle; /* Align with text */
    margin-right: 10px;     /* Space between icon and text */
    flex-shrink: 0;       /* Prevent shrinking */
}

.modal-icon-button img {
    width: 18px;          /* Smaller icon size */
    height: 18px;
    filter: none;
}
/* --- Welcome Modal Feature Explanation Layout --- */
.feature-explanation {
    display: flex;         /* Arrange children (icon span, text div) horizontally */
    align-items: center;   /* Vertically center icon and text block */
    margin-bottom: 1.25rem; /* Keep existing bottom margin (mb-5 equivalent) */
}

.feature-explanation > div {
    /* Allow the text div to grow and fill remaining space if needed */
    flex-grow: 1;
}
/* --- Upload Modal Expandable Image Styling --- */
.modal-expandable-image {
    max-width: 33%; /* Adjust as needed */
    height: auto;
    border: 1px solid #cbd5e1; /* gray-300 */
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-expandable-image:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* --- Correction Modal Styles --- */
#correction-modal .form-field {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #e0e0e0; /* Light border for separation */
    border-radius: 8px;
    background-color: #f9f9f9; /* Slightly off-white background */
}

#correction-modal label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #333;
    font-size: 0.9em;
}

#correction-modal .current-value {
    font-size: 0.85em;
    color: #555; /* Darker grey for current value */
    margin-bottom: 8px;
    padding-left: 5px;
    border-left: 3px solid #ccc; /* Subtle indicator */
}

#correction-modal input[type="text"],
#correction-modal input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    font-size: 0.95em;
}

#correction-modal input::placeholder {
    color: #999;
    font-style: italic;
}

#correction-modal .form-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
    display: none; /* Hidden by default */
}

#correction-modal .form-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#correction-modal .form-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#correction-modal .form-status.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

#correction-modal .form-status.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Inherit google-button styles if available, or define basic ones */
#correction-modal .submit-button {
    /* Assuming .google-button styles exist */
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    font-size: 1em;
    cursor: pointer;
    color: #fff;
    background-color: #0078d7;
}

#correction-modal .submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Ensure modal content scrolls if needed */
#correction-modal .modal-content {
    max-height: 70vh; /* Adjust as needed */
    overflow-y: auto;
}

/* --- Camera Modal --- */
.camera-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    flex-direction: column;
    z-index: 1051;
    touch-action: manipulation; /* Disable double-tap to zoom */
}

.camera-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.camera-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.camera-viewfinder {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This will fill the screen, cropping as needed */
}

.camera-status-overlay {
    position: absolute;
    top: 60px; /* Moved from bottom */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    z-index: 5;
}

.camera-controls {
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between; /* Changed to space-between */
    align-items: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.capture-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    /* The button itself is in the center, so no need for margin auto */
}

.capture-button-outer {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: transparent;
    border: 4px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: border-color 0.2s;
}

.capture-button-inner {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background-color: white;
    transition: background-color 0.2s;
}

.capture-button:hover:not(:disabled) .capture-button-inner {
    background-color: #e0e0e0;
}

.capture-button:disabled .capture-button-outer {
    border-color: #777;
    cursor: not-allowed;
}

.capture-button:disabled .capture-button-inner {
    background-color: #555;
}

.camera-action-button {
    background-color: #4CAF50; /* Green */
    color: white;
    border: none;
    padding: 12px 0; /* Adjusted padding */
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    width: 70px; /* Make width consistent */
    font-weight: bold;
    transition: background-color 0.2s;
}

.camera-action-button:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
}

.camera-progress-container {
    position: absolute;
    bottom: 100px; /* Position it above the controls */
    width: calc(100% - 40px);
    left: 20px;
    display: flex;
    flex-direction: column; /* Stack label on top of bar */
    align-items: flex-end; /* Center items */
    gap: 5px; /* Space between label and bar */
    z-index: 10;
}

#camera-rules-button {
    margin-bottom: 10px;
    width: 100%;
    width: -webkit-fill-available;
    width: fill-available;
    padding: 12px 20px;
    box-sizing: border-box;
}

#camera-progress-label {
    color: white;
    font-size: 1em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

#camera-progress-bar {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
}

/* Styling for progress bar track */
#camera-progress-bar::-webkit-progress-bar {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* Styling for progress bar value */
#camera-progress-bar::-webkit-progress-value {
    background-color: #4CAF50;
    border-radius: 4px;
    transition: width 0.3s ease;
}

#camera-progress-bar::-moz-progress-bar {
    background-color: #4CAF50;
    border-radius: 4px;
    transition: width 0.3s ease;
}

#camera-permission-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15; /* Higher than other camera elements */
    text-align: center;
    color: white;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.8); /* Slightly darker for emphasis */
    border-radius: 10px;
    width: 80%; /* Responsive width */
    max-width: 400px; /* Max width */
    box-sizing: border-box;
}

.unique-frontpage-modal-container {
    text-align: center;
    position: relative;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.unique-frontpage-modal-icon-container {
    margin-bottom: 20px;
    position: relative;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.unique-frontpage-modal-icon {
    position: absolute;
    opacity: 0;
    transform: scale(0.8);
}

.unique-frontpage-modal-icon-1 {
    animation: uniqueFrontpageModalIconAnimation 9s infinite;
}

.unique-frontpage-modal-icon-2 {
    animation: uniqueFrontpageModalIconAnimation 9s infinite 3s;
}

.unique-frontpage-modal-icon-3 {
    animation: uniqueFrontpageModalIconAnimation 9s infinite 6s;
}

@keyframes uniqueFrontpageModalIconAnimation {
    0%, 100% {
        opacity: 0;
        transform: scale(0.8);
    }
    10%, 30% {
        opacity: 1;
        transform: scale(1);
    }
    40% {
        opacity: 0;
        transform: scale(0.8);
    }
}

.unique-frontpage-modal-icon svg {
    width: 80px;
    height: 80px;
    fill: #0071e3;
}

.unique-frontpage-modal-message-container {
    position: relative;
    height: 70px;
    overflow-y: hidden;
    overflow-x: hidden;
}

.unique-frontpage-modal-message {
    position: absolute;
    width: 100%;
    font-size: 1.4rem;
    font-weight: 300;
    color: #1d1d1f;
    opacity: 0;
    transform: translateY(20px);
    letter-spacing: -0.5px;
    line-height: 1.2;
    box-sizing: border-box;
}

.unique-frontpage-modal-message.en {
    animation: uniqueFrontpageModalFadeInOut 9s infinite;
}

.unique-frontpage-modal-message.de {
    animation: uniqueFrontpageModalFadeInOut 9s infinite 3s;
}

.unique-frontpage-modal-message.fr {
    animation: uniqueFrontpageModalFadeInOut 9s infinite 6s;
}

@keyframes uniqueFrontpageModalFadeInOut {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    10% {
        opacity: 1;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(0);
    }
    40% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@media (max-width: 768px) {
    .unique-frontpage-modal-message {
        font-size: 1.4rem;
    }
    
    .unique-frontpage-modal-icon svg {
        width: 60px;
        height: 60px;
    }
}

/* Toggle Switch styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-bottom: 10px;
}

.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;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}

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

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}
.earning-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.earning-matrix-table th,
.earning-matrix-table td {
    border: 1px solid #dadce0;
    padding: 8px;
    text-align: left;
}

.earning-matrix-table th {
    background-color: #e8eaed;
    font-weight: 500;
    color: #202124;
}

.earning-matrix-table tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}

#rules-top-sheet .google-style-modal,
#rules-top-sheet .google-section {
    box-shadow: none !important;
}