/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5em;
    color: #333;
    background-color: #f5f5f5;
}

/* Support for user text spacing preferences (WCAG 1.4.12) */
* {
    line-height: inherit;
}

/* Ensure text can be resized up to 200% without loss of functionality */
html {
    font-size: 100%;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Skip Link for Keyboard Navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible Styles for Keyboard Navigation */
*:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

/* Required Field Indicator */
.required-indicator {
    color: #d32f2f;
    font-weight: bold;
    margin-left: 4px;
}

/* Error Message */
.error-message {
    display: block;
    color: #d32f2f;
    font-size: 14px;
    margin-top: 4px;
    min-height: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
.page-header {
    background-color: #fff;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: -10px;
}

.header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
}

.header-left {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sf-logo {
    height: 2.5em;
    width: auto;
    max-height: 50px;
    flex-shrink: 0;
    object-fit: contain;
}

.header-left h1 {
    font-size: 27px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.5em;
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.department-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Language Selector Styles */
.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.lang-btn {
    background: none;
    border: none;
    color: #B85000;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
    letter-spacing: 0.3px;
    writing-mode: horizontal-tb;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    color: #964000;
    text-decoration: underline;
}

.lang-btn.active {
    color: #1a1a1a;
    cursor: default;
}

.lang-btn.active:hover {
    text-decoration: none;
}

.lang-btn:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Google Translate Widget Styles */
.translate-widget {
    display: inline-block;
}

/* Keep the Google Translate gadget in the DOM (so its <select> initializes)
   but visually hidden off-screen. Using display:none can prevent the combo
   from being created in some browsers, which breaks the language buttons. */
#google_translate_element {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Suppress the Google Translate top banner and the page push-down it causes. */
/* Hide iframe that contains the banner */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame {
    display: none !important;
    visibility: hidden !important;
}
/* Prevent body from being pushed down by the banner */
body {
    top: 0 !important;
}
/* Hide the top frame that Google Translate injects */
body > .skiptranslate {
    display: none !important;
}
/* Hide the hover tooltip/balloon Google injects over translated text. */
/* Additional selectors to ensure banner is hidden */
.goog-te-banner-frame.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-tooltip:hover {
    display: none !important;
}

.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}

/* Style the Google Translate dropdown to match SF Planning design */
#google_translate_element select {
    background-color: white;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s;
}

#google_translate_element select:hover {
    border-color: #999;
}

#google_translate_element select:focus {
    outline: none;
    border-color: #0066cc;
}

/* Hide the Google Translate branding text */
.goog-te-gadget {
    color: transparent !important;
    font-size: 0;
}

.goog-te-gadget .goog-te-combo {
    margin: 0;
}

/* Style the powered by Google text */
.goog-logo-link {
    display: none !important;
}

.goog-te-gadget span {
    display: none !important;
}

/* Keep only the dropdown visible */
.goog-te-gadget > span > a {
    display: none !important;
}

.goog-te-gadget .goog-te-combo {
    display: inline-block !important;
}

.effective-date {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.logo-section {
    margin-bottom: 20px;
}

.logo-placeholder {
    display: inline-block;
    width: 100px;
    height: 100px;
    background-color: #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
}

.department-name {
    font-size: 18px;
    color: #666;
}

/* Action Bar */
.action-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    background-color: #f8f8f8;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.logo-placeholder-small {
    width: 30px;
    height: 30px;
    background-color: #d0d0d0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #666;
}

.print-btn {
    padding: 10px 16px;
    background-color: white;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
}

.print-btn:hover {
    background-color: #f0f0f0;
}

.print-btn:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.external-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    min-height: 28px;
}

.external-link:hover {
    text-decoration: underline;
}

.external-link:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Internal Links */
.internal-link {
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
    padding: 2px 0;
}

.internal-link:hover {
    text-decoration: underline;
}

.internal-link:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Fee Name Links */
.fee-name a {
    color: #1a1a1a;
    text-decoration: none;
    border-bottom: 1px dotted #666;
    transition: color 0.2s, border-color 0.2s;
}

.fee-name a:hover {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

.fee-name a:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Effective Date - removed duplicate, kept in header */

/* Tab Navigation */
.tab-navigation {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 30px;
    background-color: #fff;
}

.tab-btn {
    padding: 16px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
    margin-bottom: -2px;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.tab-btn.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

.tab-btn:hover {
    color: #0066cc;
}

.tab-btn:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: -3px;
}

/* Content Section */
.content-section {
    padding: 30px;
}

/* Important Information */
.important-info {
    margin-bottom: 30px;
}

.important-info h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.info-block {
    margin-bottom: 25px;
}

.info-block h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.info-block p {
    font-size: 15px;
    line-height: 1.5em;
    color: #555;
}

/* Fixed Fees Section */
.fixed-fees {
    margin-top: 20px;
}

.fixed-fees h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.expand-all-btn {
    display: block;
    margin: 16px 0 20px 0;
    padding: 10px 16px;
    background-color: white;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    min-height: 44px;
}

.expand-all-btn:hover {
    background-color: #f0f0f0;
}

.expand-all-btn:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

/* Accordion */
.accordion-section {
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background-color: #f8f8f8;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    min-height: 48px;
}

.accordion-header:hover {
    background-color: #f0f0f0;
}

.accordion-header:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: -3px;
}

.accordion-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 14px;
    color: #B85000;
    transition: transform 0.2s;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(90deg);
}

.accordion-header h3 {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.accordion-content {
    display: none;
    padding: 0;
    background-color: white;
}

.accordion-header[aria-expanded="true"] + .accordion-content {
    display: block;
}

/* Fee List Styling */
.fee-list {
    padding: 0;
    list-style: none;
    margin: 0;
}

.fee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 24px;
    border-bottom: 1px solid #c8c8c8;
    transition: background-color 0.2s;
}

.fee-item:last-child {
    border-bottom: none;
}

.fee-item:hover {
    background-color: #fafafa;
}

.fee-subsection-header {
    background-color: #f0f0f0 !important;
    padding: 12px 24px !important;
    border-bottom: 1px solid #e0e0e0;
}

.fee-subsection-header:hover {
    background-color: #f0f0f0 !important;
}

.fee-subsection-title {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 14px;
    margin: 0;
    letter-spacing: 0.5px;
}

.fee-subsection-header + .fee-item {
    margin-top: 0;
}

.fee-name {
    font-size: 15px;
    color: #333;
    flex: 1;
}

.fee-amount {
    font-size: 15px;
    font-weight: 600;
    color: #B85000;
    text-align: right;
    margin-left: 20px;
    white-space: nowrap;
}

/* Footer / Site Footer */
.site-footer {
    background-color: #5a5a5a;
    padding: 40px 50px;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    gap: 40px;
}

.footer-left {
    flex-shrink: 0;
}

.sf-seal {
    width: 120px;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.footer-copyright {
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 400;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.footer-links a {
    color: #d9e4eb;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s, text-decoration 0.2s;
    border-bottom: 1px dotted #b8d4e8;
    line-height: 1.5em;
}

.footer-links a:hover {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

.footer-links a:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .site-footer {
        padding: 30px 20px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
    }

    .sf-seal {
        width: 90px;
    }

    .footer-right {
        align-items: center;
    }

    .footer-links {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .sf-seal {
        width: 70px;
    }

    .footer-copyright {
        font-size: 14px;
    }

    .footer-links a {
        font-size: 13px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
        box-shadow: none;
    }

    .page-header {
        padding: 16px 20px;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding-top: 12px;
        border-top: 1px solid #e0e0e0;
    }

    .header-left {
        gap: 12px;
        width: 100%;
    }

    .sf-logo {
        height: 2em;
        max-height: 35px;
    }

    .header-left h1 {
        font-size: 18px;
    }

    .header-right {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .language-selector {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .lang-btn {
        font-size: 12px;
        padding: 8px 10px;
        min-height: 40px;
    }

    .translate-widget {
        width: 100%;
    }

    #google_translate_element select {
        width: 100%;
        max-width: 200px;
    }

    .action-bar {
        flex-wrap: wrap;
        padding: 15px 20px;
    }

    .content-section {
        padding: 20px;
    }

    .tab-navigation {
        overflow-x: auto;
        padding: 0 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 14px 20px;
        flex-shrink: 0;
    }
    
    .accordion-header {
        padding: 14px 16px;
    }
    
    .accordion-footnote {
        padding: 16px 16px;
    }
    
    .accordion-footnote p {
        font-size: 12px;
    }
    
    .fee-item {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .fee-amount {
        text-align: left;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 16px;
    }

    .sf-logo {
        height: 1.8em;
        max-height: 30px;
    }

    .print-btn,
    .external-link {
        font-size: 13px;
    }
    
    .tab-btn {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .info-block h3 {
        font-size: 16px;
    }
    
    .info-block p,
    .info-block ul li {
        font-size: 14px;
    }
}

/* Tab Content Wrapper */
.tab-content-wrapper {
    position: relative;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Fee Calculator Styles */
.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 30px;
    background-color: #fff;
}

.calculator-section,
.breakdown-section {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
}

.calculator-header,
.breakdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.calculator-icon,
.breakdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.calculator-icon svg,
.breakdown-icon svg {
    width: 24px;
    height: 24px;
}

.calculator-empty-icon svg {
    opacity: 0.3;
}

.calculator-header h2,
.breakdown-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.calculator-subtitle,
.breakdown-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background-color: white;
    transition: border-color 0.2s;
    min-height: 48px;
}

.form-input:focus {
    outline: none;
    border-color: #B85000;
    box-shadow: 0 0 0 3px rgba(184, 80, 0, 0.1);
}

.form-input[aria-invalid="true"] {
    border-color: #d32f2f;
}

.form-input[aria-invalid="true"]:focus {
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.calculate-btn {
    flex: 1;
    padding: 14px 24px;
    background-color: #B85000;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 48px;
}

.calculate-btn:hover {
    background-color: #964000;
}

.calculate-btn:active {
    background-color: #7a3400;
}

.calculate-btn:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.clear-btn {
    flex: 0 0 auto;
    padding: 14px 24px;
    background-color: white;
    color: #555;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
    white-space: nowrap;
}

.clear-btn:hover {
    background-color: #f5f5f5;
    border-color: #999;
    color: #1a1a1a;
}

.clear-btn:active {
    background-color: #e8e8e8;
}

.clear-btn:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.breakdown-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.calculator-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.breakdown-empty-text {
    font-size: 14px;
    color: #999;
    max-width: 280px;
}

.breakdown-results {
    /* Will be styled when results are shown */
}

.breakdown-results {
    padding: 20px 0;
}

.fee-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid #e0e0e0;
}

.fee-breakdown-label {
    flex: 1;
    padding-right: 20px;
}

.fee-breakdown-label strong {
    font-size: 15px;
    color: #1a1a1a;
    display: block;
    margin-bottom: 6px;
}

.fee-breakdown-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5em;
    margin-top: 4px;
}

.fee-breakdown-rate {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.fee-breakdown-value {
    font-size: 16px;
    font-weight: 600;
    color: #B85000;
    text-align: right;
    white-space: nowrap;
}

.fee-breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-top: 12px;
    background-color: #fef3e2;
    border-radius: 6px;
}

.fee-breakdown-total .fee-breakdown-label strong {
    font-size: 16px;
    margin: 0;
}

.fee-breakdown-total-value {
    font-size: 24px;
    font-weight: 700;
    color: #B85000;
}

.fee-breakdown-note {
    margin-top: 20px;
    padding: 16px;
    background-color: #f8f8f8;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    line-height: 1.5em;
}

.fee-breakdown-note p {
    margin-bottom: 12px;
}

.fee-breakdown-note p:last-child {
    margin-bottom: 0;
}

.fee-note-disclaimer {
    font-style: italic;
    color: #666;
    margin-top: 12px;
}

@media (max-width: 968px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }
    
    .fee-breakdown-item {
        flex-direction: column;
        gap: 8px;
    }
    
    .fee-breakdown-value {
        text-align: left;
    }
    
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .calculate-btn,
    .clear-btn {
        flex: 1;
        width: 100%;
    }
}

/* Accordion Footnote Styling */
.accordion-footnote {
    padding: 16px 24px;
    margin-top: 16px;
    border-top: 1px solid #e0e0e0;
    background-color: #fafafa;
}

.accordion-footnote p {
    font-size: 13px;
    color: #555;
    line-height: 1.5em;
    margin: 0;
}

.accordion-footnote a {
    color: #0066cc;
    text-decoration: underline;
}

.accordion-footnote a:hover {
    color: #004499;
}

.accordion-footnote a:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Payment Methods List Styling */
.info-block ul {
    list-style-type: disc;
    margin-left: 40px;
    margin-top: 12px;
    padding-left: 0;
}

.info-block ul li {
    font-size: 15px;
    line-height: 1.5em;
    color: #555;
    margin-bottom: 10px;
    padding-left: 8px;
}

.info-block ul li:last-child {
    margin-bottom: 0;
}

/* Multilingual Info Styling */
.multilingual-info {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
    line-height: 1.5em;
}

.multilingual-info a {
    color: #0066cc;
    text-decoration: none;
}

.multilingual-info a:hover {
    text-decoration: underline;
}

.multilingual-info a:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Print Styles */
@media print {
    .skip-link,
    .language-selector,
    .print-btn,
    .tab-navigation,
    .button-group,
    .site-footer,
    #google_translate_element {
        display: none !important;
    }
    
    /* Only print the tab that is currently open */
    .tab-content {
        display: none !important;
    }

    .tab-content.active {
        display: block !important;
        page-break-inside: avoid;
    }

    /* Within a printed tab, expand any accordion content */
    .accordion-content {
        display: block !important;
    }

    .accordion-header[aria-expanded="false"] + .accordion-content {
        display: block !important;
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 90%;
        color: #666;
    }
    
    .fee-item {
        page-break-inside: avoid;
    }
    
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .lang-btn,
    .tab-btn,
    .accordion-header,
    .calculate-btn,
    .clear-btn {
        border: 2px solid currentColor;
    }
    
    .form-input:focus {
        outline: 3px solid currentColor;
    }
}

/* Forced Colors Mode (Windows High Contrast) */
@media (forced-colors: active) {
    .lang-btn:focus,
    .tab-btn:focus,
    .accordion-header:focus,
    .calculate-btn:focus,
    .clear-btn:focus,
    .form-input:focus {
        outline: 3px solid;
    }
}

/* =========================================================
   City of Alameda Planning Fee Calculator (Fee Calculator tab)
   Scoped under .alameda-calc so it does not affect the
   SF-style Fee Schedule / Payment tabs.
   ========================================================= */
.alameda-calc {
    --al-brand-soft: #fef3e2;
    --al-text: #333;
    --al-heading: #1a1a1a;
    --al-muted: #666;
    --al-border: #e0e0e0;
    --al-panel: #fafafa;
    --al-accent: #B85000;
}

/* Two-column layout: activity selection wider than summary */
.alameda-calc.calculator-container {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
}

.alameda-calc .calculator-header h2,
.alameda-calc .breakdown-header h2 {
    color: var(--al-heading);
}

.alameda-calc .calculator-subtitle,
.alameda-calc .breakdown-subtitle {
    font-size: 14px;
    color: var(--al-muted);
    margin-bottom: 24px;
}

.alameda-calc h3 {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--al-heading);
    margin: 0;
}

.alameda-calc h4 {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--al-heading);
    margin: 0;
}

.alameda-calc p {
    color: #555;
    font-size: 15px;
    line-height: 1.5em;
    margin: 0;
}

.alameda-calc .field-group {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.alameda-calc .field-label {
    display: block;
}

.alameda-calc .field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 16px;
    color: var(--al-text);
    margin-top: 0.5rem;
}

.alameda-calc input[type="number"],
.alameda-calc input[type="text"] {
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #767676;
    padding: 12px 14px;
    color: var(--al-text);
    font-size: 16px;
    min-width: 0;
    width: 100%;
    max-width: 320px;
}

.alameda-calc input[type="number"]::placeholder,
.alameda-calc input[type="text"]::placeholder {
    color: var(--al-muted);
}

.alameda-calc input[type="number"]:focus,
.alameda-calc input[type="text"]:focus {
    outline: none;
    border-color: var(--al-accent);
    box-shadow: 0 0 0 3px rgba(184, 80, 0, 0.1);
}

.alameda-calc .helper-text {
    color: var(--al-muted);
    margin-top: 0.25rem;
    font-size: 14px;
    line-height: 1.5em;
}

/* Activity selection list */
.alameda-calc .fee-list {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
    max-height: 55vh;
    overflow: auto;
    border-radius: 6px;
    border: 1px solid var(--al-border);
    background: #fff;
}

.alameda-calc .fee-section {
    border-bottom: 1px solid var(--al-border);
}

.alameda-calc .fee-section:last-child {
    border-bottom: none;
}

.alameda-calc .fee-section-toggle {
    width: 100%;
    text-align: left;
    background: #f8f8f8;
    border: none;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--al-heading);
    cursor: pointer;
    font-family: inherit;
    min-height: 0;
}

.alameda-calc .fee-section-toggle:hover {
    background: #f0f0f0;
}

.alameda-calc .fee-section-title {
    flex: 1;
    color: var(--al-heading);
}

.alameda-calc .fee-section-indicator {
    font-size: 14px;
    margin-left: 0.5rem;
    transition: transform 0.15s ease;
    color: var(--al-accent);
}

.alameda-calc .fee-section-panel {
    list-style: none;
    margin: 0;
    padding: 0;
}

.alameda-calc .fee-section-open .fee-section-indicator {
    transform: rotate(180deg);
}

.alameda-calc .fee-item {
    display: flex;
    gap: 0.6rem;
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    border-bottom: none;
    align-items: flex-start;
    justify-content: flex-start;
}

.alameda-calc .fee-item:hover {
    background-color: #fafafa;
}

.alameda-calc .fee-item input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--al-accent);
}

.alameda-calc .fee-item-main {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.alameda-calc .fee-item-name {
    display: block;
    font-size: 15px;
    color: var(--al-text);
    line-height: 1.5em;
}

.alameda-calc .fee-item-amounts {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 0.25rem;
    font-size: 13px;
    color: var(--al-muted);
    gap: 0.5rem;
}

.alameda-calc .fee-amount-label {
    color: var(--al-muted);
}

.alameda-calc .fee-amount-value {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-weight: 600;
    color: var(--al-accent);
}

/* Fee estimate summary */
.alameda-calc .fee-summary-card {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
}

.alameda-calc .totals-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 0.45rem 0.75rem;
    font-size: 15px;
    margin-top: 0.75rem;
}

.alameda-calc .totals-label {
    color: var(--al-text);
}

.alameda-calc .totals-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--al-accent);
}

.alameda-calc .totals-grand {
    margin-top: 0.75rem;
    padding: 16px 20px;
    background-color: #fef3e2;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.alameda-calc .totals-grand-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--al-heading);
}

.alameda-calc .totals-grand-value {
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--al-accent);
}

.alameda-calc .badge-soft {
    display: inline-block;
    font-size: 12px;
    padding: 0.15rem 1rem;
    border-radius: 999px;
    background: var(--al-brand-soft);
    color: var(--al-accent);
}

.alameda-calc .selected-activities {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--al-border);
    max-height: 180px;
    overflow-y: auto;
}

.alameda-calc .selected-activities-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--al-heading);
    margin-bottom: 0.35rem;
}

.alameda-calc .selected-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 13px;
    color: var(--al-text);
}

.alameda-calc .selected-list li + li {
    margin-top: 0.1rem;
}

.alameda-calc .activity-list {
    grid-column: 1 / -1;
    margin: 4px 0 4px 8px;
    padding-left: 10px;
    border-left: 1px solid var(--al-border);
    font-size: 13px;
    max-height: 180px;
    overflow-y: auto;
}

.alameda-calc .activity-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 3px;
}

.alameda-calc .activity-name {
    flex: 1;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--al-text);
}

.alameda-calc .activity-amt {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--al-accent);
}

.alameda-calc .activity-empty {
    color: var(--al-muted);
    font-style: italic;
}

.alameda-calc .notes-list {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    font-size: 15px;
    color: #555;
}

.alameda-calc .notes-list li + li {
    margin-top: 0.15rem;
}

@media (max-width: 968px) {
    .alameda-calc.calculator-container {
        grid-template-columns: 1fr;
    }
    .alameda-calc .fee-summary-card {
        position: static;
    }
}

/* Verbose base/variable fee explanation in the Fee Estimate selected list */
.alameda-calc .selected-list li {
    margin-bottom: 8px;
}

.alameda-calc .selected-main {
    color: var(--al-text);
}

.alameda-calc .fee-breakdown-detail {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.5em;
    color: var(--al-muted);
    font-style: italic;
}

/* Nested sub-list under the Important Information notes (Fee Calculator tab) */
.alameda-calc .notes-list .notes-sublist {
    list-style: disc;
    margin: 0.35rem 0 0.35rem 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--al-text);
}

.alameda-calc .notes-list .notes-sublist li {
    margin-top: 0.15rem;
    font-variant-numeric: tabular-nums;
}

/* Slightly smaller action buttons on the Fee Calculator tab.
   Kept at 44px min height/width to satisfy WCAG 2.1 target-size guidance. */
.alameda-calc .button-group .calculate-btn,
.alameda-calc .button-group .clear-btn {
    padding: 9px 18px;
    font-size: 14px;
    min-height: 44px;
}

/* Conditional note box (shown when Change in Use / Alteration is selected) */
.alameda-calc .conditional-note {
    margin-top: 16px;
    padding: 14px 16px;
    border: 2px solid #B85000;
    border-radius: 6px;
    background-color: #fef3e2;
}

.alameda-calc .conditional-note p {
    font-size: 13px;
    line-height: 1.5em;
    color: #333;
}

.alameda-calc .conditional-note p + p {
    margin-top: 10px;
}

.alameda-calc .conditional-note a {
    color: #0066cc;
    text-decoration: underline;
}
