/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* CMS Content Width Override - Forces 1170px container */
.c-matter--article .c-matter__body {
    max-width: 1170px;
    width: 1170px;
}

@media (max-width: 950px) {
    .c-matter--article .c-matter__body {
        width: 100%;
        max-width: 750px;
        padding: 0;
    }
}
@media (max-width: 750px) {
    .c-matter--article .c-matter__body {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: .5rem;
        border-radius: 8px;
    }
}

/* Container and layout */
.dic-container {
    max-width: 1170px;
    margin: 2rem auto 4rem auto;
    padding: 0 2rem;
    background: transparent;
    box-sizing: border-box;
}

/* Two-column layout for desktop */
.dic-calculator-layout {
    display: grid;
    grid-template-columns: 48% 52%;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    align-items: start; /* Align both columns to top */
    /* Chrome-specific fixes */
    -webkit-align-items: start;
    grid-template-rows: auto;
}

.dic-form-column {
    /* Form takes up left column */
    background: #f7fafc;
    border: 2px solid #f3f4f6;
    border-radius: var(--radius-lg);
    padding: 24px;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    /* Chrome alignment fix */
    align-self: start;
    -webkit-align-self: start;
}

.dic-results-column {
    /* Results take up right column */
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    /* Chrome alignment fix */
    align-self: start;
    -webkit-align-self: start;
}

.dic-results-column * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Header */
.dic-header {
    text-align: left;
    margin-bottom: 32px;
    padding-bottom: 0;
}

/* Placeholder content styles */
.dic-placeholder {
    background: #f7fafc;
    border: 2px solid #f3f4f6;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: none;
    text-align: left;
}

.dic-placeholder__icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Form sections */
.dic-input-section {
    margin-bottom: 1rem;
    padding: 0;
    background: transparent;
    border: none;
}

.dic-section-heading h3 {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

/* Input groups */
.dic-input-group {
    margin-bottom: 20px;
}

.dic-input-label {
    display: block;
    margin-bottom: 8px;
    position: relative;
}

/* Input wrapper for currency and percent symbols */
.dic-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.dic-input-prefix {
    position: absolute !important;
    left: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-weight: 400 !important;
    z-index: 1 !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    font-family: inherit !important;
    pointer-events: none !important;
    color: #6b7280 !important;
}

.dic-input-suffix {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 500;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 2;
}

/* Input styles */
.dic-input {
    width: 100%;
    padding: 14px 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
    font-family: inherit;
    font-weight: 400;
    
    /* Input spinners/arrows for numeric fields */
    -webkit-appearance: auto; /* Show Chrome/Safari spinners */
    -moz-appearance: number-input; /* Show Firefox spinners */
    appearance: auto; /* Show spinners in other browsers */
}

/* Placeholder styling - 55% opacity as per rules */
.dic-input::placeholder {
    opacity: 0.55;
    color: inherit; /* Use input text color with opacity */
    font-style: normal;
}

.dic-input::-webkit-input-placeholder {
    opacity: 0.55;
    color: inherit;
}

.dic-input::-moz-placeholder {
    opacity: 0.55;
    color: inherit;
}

.dic-input::-webkit-outer-spin-button,
.dic-input::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button;
    opacity: 1;
}

.dic-input[type="number"]::-webkit-outer-spin-button,
.dic-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button;
    opacity: 1;
    height: auto;
}

/* Placeholder text opacity */
.dic-input::placeholder {
    opacity: 0.55;
    color: inherit;
    transition: opacity 0.2s ease;
}

.dic-input:focus::placeholder {
    opacity: 0;
}

/* Currency inputs need extra left padding */
.dic-input-wrapper .dic-input-prefix + .dic-input {
    padding-left: 32px !important;
}

/* Percentage inputs need right padding for % symbol */
.dic-input-wrapper input[type="text"]:has(+ .dic-input-suffix) {
    padding-right: 45px !important;
}

.dic-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgb(16 185 129 / 0.08);
}

.dic-input:hover {
    border-color: #9ca3af;
}

/* Error messages */
.dic-error-message {
    font-size: 0.8125rem;
    margin-top: 4px;
    font-weight: 400;
    display: none;
}

.dic-error-message.show {
    display: block;
}

.dic-input-group.error .dic-input {
    box-shadow: 0 0 0 3px rgb(239 68 68 / 0.1);
}

/* Required field styling */
.dic-input-group.dic-required-empty .dic-input {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgb(239 68 68 / 0.1) !important;
}

.dic-input-group.dic-required-empty .dic-input-label::after {
    content: " *";
    color: #ef4444;
    font-weight: 600;
}

/* Required field animation */
.dic-input-group.dic-required-empty .dic-input {
    animation: dic-required-pulse 2s ease-in-out;
}

@keyframes dic-required-pulse {
    0%, 100% { border-color: #ef4444; }
    50% { border-color: #f87171; }
}

/* Button styles */
.dic-calculate-btn {
    margin-top: 1rem;
    align-self: flex-start;
}

.dic-calculate-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: auto !important;
    background: #d1d5db !important;
    color: #9ca3af !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
}

.dic-calculate-btn:disabled:hover {
    background: #d1d5db !important;
    color: #9ca3af !important;
    border-color: #d1d5db !important;
    transform: none !important;
}

/* Sticky mobile button */
.dic-sticky-button {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    display: none;
}

.dic-sticky-button.dic-sticky-button--visible {
    transform: translateY(0);
}

.dic-sticky-button__inner {
    max-width: 1170px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.dic-sticky-button .dic-calculate-btn {
    /* Let website handle all button styling, only override layout */
    margin: 0 !important;
    width: 100% !important;
    max-width: 400px !important;
}

/* Sticky Edit/Reset Actions */
.dic-sticky-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    display: none; /* Hidden by default */
}

.dic-sticky-actions.dic-sticky-actions--visible {
    transform: translateY(0);
}

.dic-sticky-actions__inner {
    max-width: 1170px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.dic-sticky-actions .c-btn {
    /* Let website handle button styling */
    margin: 0 !important;
    flex: 1;
    max-width: 200px;
}

/* Example values text styling */
.dic-example-text {
    font-size: 0.8125rem;
    line-height: 1.4;
    margin-top: 8px;
    margin-bottom: 24px; /* Add more space before first input */
    font-style: italic;
    opacity: 0.75;
}

/* Clear values link styling */
.dic-clear-link {
    color: #3b82f6;
    text-decoration: underline;
    font-style: italic; /* Make it italic like the text */
    font-weight: normal; /* Use normal weight, not 500 */
    font-size: inherit; /* Use same font size as parent text */
    cursor: pointer;
    transition: color 0.2s ease;
}

.dic-clear-link:hover {
    color: #1d4ed8;
    text-decoration: none;
}

/* Show sticky buttons only on mobile */
@media (max-width: 991px) {
    .dic-sticky-button {
        display: block;
    }
    
    .dic-sticky-actions {
        display: block;
    }
}

/* Results section */
.dic-results {
    background: #f7fafc;
    border: 2px solid #f3f4f6;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 0;
    max-width: 100%;
    overflow: hidden;
    box-shadow: none;
}

/* Desktop Edit/Reset buttons */
.dic-desktop-actions {
    display: none; /* Hidden by default */
    gap: 12px;
    margin: 20px 0;
    justify-content: flex-start;
}

.dic-desktop-actions.dic-visible {
    display: flex !important; /* Show after calculation - override the none */
}

.dic-desktop-actions .c-btn {
    /* Let website handle button styling */
    flex: 0 0 auto;
    min-width: 100px;
}

.dic-results h3 {
    text-align: center;
    margin-bottom: 32px;
}

.dic-result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
}

.dic-result-card {
    background: #ffffff;
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f3f4f6;
    transition: all 0.2s ease;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.dic-result-card:hover {
    box-shadow: var(--shadow-md);
}

.dic-result-card__label {
    font-size: 0.875rem;
    margin-bottom: 16px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dic-result-card__value {
    font-size: 1.5rem !important;
    font-weight: 500;
    letter-spacing: -0.02em;
    word-break: break-all;
}

.dic-result-card--primary {
    border-left: 3px solid #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.02), rgba(16, 185, 129, 0.05));
}

/* Chart section */
.dic-chart-section {
    background: #ffffff;
    padding: 16px 12px;
    border-radius: var(--radius-lg);
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f3f4f6;
    max-width: 100%;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.dic-chart-section h4 {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
    letter-spacing: -0.01em;
}

.dic-chart-container {
    position: relative;
    height: 280px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.dic-chart-container canvas {
    max-width: 100%;
    height: auto !important;
}

/* Results actions */
.dic-results-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dic-results-actions button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: background-color 0.18s ease;
}

.dic-results-actions button:hover,
.dic-results-actions button:focus {
    background-color: rgba(0, 106, 133, 0.1);
}

/* Slider styles - hidden on desktop, visible on mobile */
.dic-slider {
    margin-top: 0.75rem;
    display: none;
}

.dic-slider input[type="range"] {
    width: 100%;
    appearance: none;
    height: 4px;
    border-radius: 4px;
    background-color: rgba(0, 106, 133, 0.2);
}

.dic-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #006a85;
    cursor: pointer;
    border: none;
    transition: transform 0.18s ease;
}

.dic-slider input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

.dic-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #006a85;
    cursor: pointer;
    border: none;
}

.dic-slider__value {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: rgba(0, 55, 69, 0.7);
}

/* Tooltip styles */
.dic-tooltip {
    position: relative;
}

.dic-tooltip__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    color: #666;
    padding: 0.2rem;
    border-radius: 4px;
}

.dic-tooltip__trigger:hover {
    background-color: rgba(0, 106, 133, 0.1);
    color: #006a85;
}

.dic-tooltip__trigger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 106, 133, 0.2);
}

.dic-tooltip__panel {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(260px, 70vw);
    padding: 1rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 5;
}

.dic-tooltip:hover .dic-tooltip__panel,
.dic-tooltip:focus-within .dic-tooltip__panel,
.dic-tooltip.dic-tooltip--open .dic-tooltip__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hidden elements */
.dic-hidden {
    display: none !important;
}

/* Standard Breakpoints */
@media (max-width: 950px) {
    .dic-container {
        max-width: 750px;
        padding: 0 1.5rem;
        margin: 1.5rem auto 3rem auto;
    }
}

@media (max-width: 750px) {
    .dic-container {
        max-width: 100%;
        margin: 0.5rem auto 1rem auto;
        padding: 0 0.5rem;
    }
    
    /* Stack vertically on mobile */
    .dic-calculator-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dic-results-column {
        position: static;
    }
    
    .dic-header p {
        font-size: 1rem;
    }
    
    .dic-form-column {
        padding: 16px;
    }
    
    .dic-placeholder, 
    .dic-results {
        padding: 16px;
    }
    
    .dic-calculate-btn {
        width: 100%;
    }
    
    .dic-input-group {
        margin-bottom: 16px;
    }
    
    .dic-result-cards {
        grid-template-columns: 1fr;
    }
    
    .dic-result-card__value {
        font-size: 1.5rem;
    }
    
    .dic-results-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .dic-results-actions button {
        width: 100%;
        justify-content: center;
    }
    
    /* Show sliders on mobile */
    .dic-slider {
        display: block;
        margin: 1rem 0 2rem; /* Much more space between input and slider */
        padding: 8px 0; /* Additional touch area around slider */
    }
    
    /* Mobile slider improvements for better touch targets */
    .dic-slider input[type="range"] {
        height: 8px; /* Taller track for easier touch */
        border-radius: 6px;
    }
    
    .dic-slider input[type="range"]::-webkit-slider-thumb {
        width: 28px; /* Larger thumb for better touch target */
        height: 28px;
    }
    
    .dic-slider input[type="range"]::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }
    
    /* Add visual separation between input groups on mobile */
    .dic-input-group {
        /*margin-bottom: 24px;*/
        /*padding-bottom: 12px;*/
        border-bottom: 1px solid #f3f4f6; /* Subtle divider */
    }
    
    .dic-input-group:last-child {
        border-bottom: none; /* Remove border from last input group */
    }
}

@media (max-width: 480px) {
    .dic-form-column {
        padding: 12px;
    }
    
    .dic-placeholder, 
    .dic-results {
        padding: 12px;
    }
    
    .dic-result-card {
        padding: 16px 12px;
    }
    
    .dic-chart-section {
        padding: 16px;
        margin: 16px 0;
    }
    
    .dic-chart-section h4 {
        margin-bottom: 16px;
    }
    
    .dic-chart-container {
        height: 280px;
    }
}

/* Simple, clean print styles */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Hide non-essential elements for clean print */
    .dic-form-column,
    .dic-placeholder,
    .dic-desktop-actions,
    .dic-sticky-button,
    .dic-sticky-actions,
    button,
    .c-btn {
        display: none !important;
    }
    
    /* Clean up layout for print */
    .dic-calculator-layout {
        display: block !important;
        grid-template-columns: none !important;
    }
    
    .dic-results-column {
        width: 100% !important;
        position: static !important;
    }
    
    /* Style results for professional print appearance */
    .dic-results {
        background: white !important;
        border: 1pt solid #e5e7eb !important;
        padding: 20pt !important;
        margin: 0 !important;
        font-family: 'Helvetica', Arial, sans-serif !important;
        font-size: 11pt !important;
        line-height: 1.4 !important;
        page-break-inside: avoid;
    }
    
    .dic-results h2 {
        font-size: 16pt !important;
        font-weight: bold !important;
        margin: 0 0 15pt 0 !important;
        border-bottom: 1pt solid #e5e7eb !important;
        padding-bottom: 8pt !important;
    }
    
    .dic-result-summary {
        background: #f8f9fa !important;
        border: 1pt solid #dee2e6 !important;
        padding: 15pt !important;
        margin: 15pt 0 !important;
        page-break-inside: avoid;
    }
    
    .dic-summary-headline {
        font-size: 18pt !important;
        font-weight: bold !important;
        margin: 0 0 8pt 0 !important;
    }
    
    .dic-summary-subtitle {
        font-size: 12pt !important;
        margin: 0 !important;
    }
    
    .dic-result-card {
        background: white !important;
        border: 1pt solid #dee2e6 !important;
        padding: 12pt !important;
        margin: 8pt 0 !important;
        page-break-inside: avoid;
    }
    
    .dic-result-card h3 {
        font-size: 10pt !important;
        font-weight: normal !important;
        margin: 0 0 4pt 0 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5pt !important;
    }
    
    .dic-result-value {
        font-size: 14pt !important;
        font-weight: bold !important;
        margin: 0 !important;
    }
    
    .dic-chart-section {
        background: #f8f9fa !important;
        border: 1pt solid #dee2e6 !important;
        padding: 15pt !important;
        margin: 15pt 0 !important;
        text-align: center !important;
        page-break-inside: avoid;
    }
    
    .dic-chart-section h4 {
        font-size: 12pt !important;
        font-weight: bold !important;
        margin: 0 0 10pt 0 !important;
    }
    
    .dic-chart-section canvas {
        display: none !important;
    }
    
    .dic-chart-section::after {
        content: "Chart available in digital version";
        display: block !important;
        font-style: italic;
        font-size: 10pt !important;
        color: #6c757d !important;
        margin-top: 10pt;
    }
    
    /* Page settings */
    @page {
        margin: 0.75in;
        size: letter;
    }
}


