.calculator-wrapper {
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: flex-start;
          min-height: 100vh;
          padding: 2rem 1rem;
          width: 100%;
        }
        h1, h2, h3 {
          font-weight: bold;
          color: #1a202c;
        }
        h1{
          width: 100%;
          display: inline-block;
          text-align: center;
          margin-top: 0px;
          font-size: 1.75rem;
        }
        h2 {
            font-size: 1.5rem;
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid #e2e8f0;
        }
        h3 {
             font-size: 1.125rem;
             margin-bottom: 0.5rem;
        }
        p {
            margin-top: 0;
            margin-bottom: 1rem;
            color: #4a5568;
            line-height: 1.6;
        }
        ul, ol, dl{
          line-height: 1.5;
        }
        .hidden {
          display: none;
        }
        .visually-hidden {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        main {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2rem;
            width: 100%;
            max-width: 480px;
        }

        .content-wrapper {
            display: flex;
            flex-direction: column;
            gap: 2rem;
            width: 100%;
        }

        /* --- calculators.css --- */
        .card {
            background-color: var(--color-white);
            border-radius: 16px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.08);
            padding: 2rem;
            width: 100%;
        }
        label {
            display: block;
            font-size: 0.875rem;
            font-weight: bold;
            color: #4a5568;
            margin-bottom: 0.5rem;
        }
        legend {
            font-size: 0.875rem;
            font-weight: bold;
            color: #4a5568;
            margin-bottom: 0.5rem;
            padding: 0;
        }
        input[type="number"], input[type="text"] {
            width: 100%;
            padding: 0.75rem;
            border: 2px solid #e2e8f0;
            border-radius: 0.5rem;
            box-shadow: inset 0 1px 2px 0 rgba(0,0,0,0.05);
            font-size: 1.125rem;
            font-family: Arial, Helvetica, sans-serif;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        input:focus {
            outline: none;
            border-color: var(--main-color);
            box-shadow: 0 0 0 3px rgba(26, 72, 238, 0.4);
        }
        
        /* --- Custom Styles for Tip Calculator --- */
        
        /* General Layout */
        .calculator-header {
            text-align: center;
            margin-bottom: 2rem;
        }
        .calculator-header p {
            font-size: 1rem;
            color: #6b7280;
        }

        /* Form Groups and Inputs with Icons */
        .form-group {
            margin-bottom: 1.5rem;
            border: none;
            padding: 0;
        }
        .input-wrapper {
            position: relative;
        }
        .input-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: #6b7280; /* Darkened for better contrast */
            pointer-events: none;
        }
        input.with-icon {
            padding-left: 2.5rem;
        }

        /* Hide number input spinners */
        input[type=number]::-webkit-inner-spin-button,
        input[type=number]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        input[type=number] {
            appearance: textfield;
            -moz-appearance: textfield;
        }

        /* Tip Selection Grid */
        .tip-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.5rem;
        }
        .tip-button {
            background-color: var(--main-background);
            color: var(--main-color);
            border: none;
            border-radius: 8px;
            padding: 0.75rem 0.5rem;
            font-weight: bold;
            font-size: 1rem;
            cursor: pointer;
            transition: background-color 0.2s, color 0.2s;
        }
        .tip-button:hover {
            background-color: #dbeafe; /* Lighter blue */
        }
        .tip-button.active {
            background-color: var(--main-color);
            color: var(--color-white);
        }
        .custom-tip-group {
            margin-top: 0.75rem;
        }
        .custom-tip-group label {
            font-size: 0.8rem;
            margin-bottom: 0.25rem;
        }
        #customTip {
            text-align: center;
        }
        
        /* Split Method Toggle Switch */
        .toggle-switch-fieldset {
            border: none;
            padding: 0;
            margin: 0;
        }
        .toggle-switch-fieldset legend {
            padding: 0;
            margin-left: 0;
        }
        .radio-toggle-group {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
        }
        .radio-toggle-group input[type="radio"] {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }
        .toggle-button {
            padding: 0.75rem;
            border-radius: 8px;
            border: none;
            background-color: var(--main-background);
            font-weight: bold;
            color: var(--main-color);
            cursor: pointer;
            transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
            text-align: center;
        }
        /* Add this to prevent Firefox transition-on-load bug */
        .preload .toggle-button {
            transition: none !important;
        }
        .radio-toggle-group input[type="radio"]:focus-visible + .toggle-button {
            outline: 2px solid var(--main-color);
            outline-offset: 2px;
        }
        .radio-toggle-group input[type="radio"]:checked + .toggle-button {
            background-color: var(--main-color);
            color: var(--color-white);
        }
        
        /* Results Section */
        #resultsContainer {
            background-color: #D1FAE5; /* Pale green background */
            color: #065F46; /* Dark green text */
            padding: 1.5rem;
            border-radius: 12px;
            min-height: 140px;
        }
        
        /* Itemized Split Section */
        #itemizedSplitSection {
            margin-top: 1rem;
            margin-bottom: 1.5rem;
        }
        .people-container {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }
        .person-entry {
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 1rem;
        }
        .person-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 0;
        }
        .person-name-group {
            flex-grow: 1;
            margin-right: 1rem;
        }
         .person-name-group label {
            margin-bottom: 0.25rem;
            font-size: 0.875rem;
        }
        .remove-person-btn {
             color: var(--color-error-dark);
             background: none;
             border: none;
             cursor: pointer;
             font-weight: bold;
             font-size: 0.875rem;
             padding-top: 0.25rem;
        }
        .items-fieldset {
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 0.75rem;
            margin-top: 0.75rem;
        }
        .items-fieldset legend {
            font-size: 0.8rem;
            font-weight: bold;
            color: #4a5568;
            padding: 0 0.25rem;
            margin-left: 0.5rem;
        }
        .items-container {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .item-entry {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .item-cost {
            flex-grow: 1;
        }
        .add-item-btn, #addPersonBtn {
            margin-top: 0.75rem;
            width: 100%;
            background-color: var(--main-background);
            color: var(--main-color);
            border: none;
            font-weight: bold;
            padding: 0.75rem;
            border-radius: 8px;
            cursor: pointer;
            transition: background-color 0.2s;
        }
        .add-item-btn {
            font-size: 0.875rem;
            padding: 0.5rem;
        }
        .add-item-btn:hover, #addPersonBtn:hover {
             background-color: #dbeafe;
        }
         .remove-item-btn {
            background: none; border: none; cursor: pointer; color: #9ca3af; padding: 4px; line-height: 0;
        }
        .remove-item-btn:hover { color: var(--color-error-dark); }
        
        /* Unified Results Styling */
        .itemized-result-person {
            padding: 0.5rem 0;
            border-bottom: 1px solid rgba(4, 120, 87, 0.2); /* Dark green border */
        }
        .itemized-result-person:last-of-type { border-bottom: none; }
        .itemized-result-person .main-line { display: flex; justify-content: space-between; align-items: center; }
        .itemized-result-person .main-line .name { font-weight: bold; }
        .itemized-result-person .main-line .total { font-size: 1.25rem; font-weight: bold; }
        .itemized-result-person .sub-line { display: flex; justify-content: space-between; font-size: 0.8rem; color: #047857; /* Medium-dark green for secondary text */ }
        .grand-total { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(4, 120, 87, 0.3); /* Dark green border */ display: flex; justify-content: space-between; font-weight: bold; font-size: 1.125rem; }

        /* Action Buttons */
        .button-group {
             margin-top: 1.5rem;
        }
        #resetButton {
            width: 100%;
            background-color: var(--main-color);
            color: var(--color-white);
            font-weight: bold;
            padding: 0.875rem;
            border: none;
            border-radius: 0.5rem;
            box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
            transition: background-color 0.3s;
            cursor: pointer;
            font-size: 1.125rem;
        }
        #resetButton:hover {
            background-color: var(--secondary-color);
        }
        #resetButton:disabled {
            background-color: #d1d5db;
            color: #1f2937; /* Darkened for AA contrast on disabled state */
            cursor: not-allowed;
        }
        
        /* Rich Content Sections */
        .rich-content-card {
            margin-top: 0;
        }
        .rich-content-card ul {
            list-style-type: disc;
            list-style-position: inside;
            padding-left: 0;
            color: #4a5568;
        }
        .rich-content-card li + li {
            margin-top: 0.5rem;
        }
        .disclaimer {
            font-size: 0.75rem;
            color: #6b7280;
            margin-top: 1.5rem;
            padding-top: 1.5rem;
            border-top: 1px solid #e2e8f0;
        }

        /* Ad Placeholder */
        .ad-placeholder {
            width: 100%;
            min-height: 90px;
            /* The AdSense ad will fill this container */
        }

        /* Animation */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .fade-in {
            animation: fadeIn 0.3s ease-out forwards;
        }

        /* Desktop Layout */
        @media (min-width: 992px) {
            main {
                max-width: 1000px;
            }
            .content-wrapper {
                flex-direction: row;
                align-items: flex-start;
            }
            .card {
                flex: 1;
            }
        }