* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8fafc;
    color: #2d3748;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #1a202c;
    font-size: 28px;
    margin-bottom: 8px;
}

.header p {
    color: #718096;
    font-size: 16px;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 600px;
}
.input-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.preview-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.tab-navigation {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
    background: #f7fafc;
    border-radius: 12px 12px 0 0;
    gap: 2px;
    padding: 4px 4px 0 4px;
}

.tab-button {
    flex: 0 1 auto;
    padding: 8px 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #718096;
    transition: all 0.2s;
    border-radius: 6px 6px 0 0;
    font-size: 12px;
    white-space: nowrap;
}

.tab-button.active {
    background: white;
    color: #2d3748;
    border-bottom: 2px solid #4f46e5;
}

.tab-button:hover:not(.active) {
    background: #edf2f7;
    color: #4a5568;
}

.tab-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
    border-radius: 0 0 12px 12px;
    gap: 8px;
}

.nav-button {
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}
.nav-button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.preview-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.preview-content h2 {
    color: #1a202c;
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    text-align: center;
}

.comparison-table td:first-child {
    font-weight: 500;
    background: #f9fafb;
}

.comparison-table td:nth-child(2) {
    text-align: center;
    background: #f0f9ff;
}

.comparison-table td:nth-child(3) {
    text-align: center;
    background: #faf5ff;
}

.summary-box {
    background: #f0f9ff;
    border: 1px solid #0284c7;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.summary-box h3 {
    color: #0369a1;
    margin-bottom: 8px;
    font-size: 16px;
}

.summary-box p {
    margin-bottom: 4px;
    font-size: 14px;
}

.warning-box {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.warning-box h3 {
    color: #92400e;
    margin-bottom: 8px;
    font-size: 16px;
}

.recommendations {
    background: #f0fdf4;
    border: 1px solid #16a34a;
    border-radius: 8px;
    padding: 16px;
}

.recommendations h3 {
    color: #15803d;
    margin-bottom: 8px;
    font-size: 16px;
}

.recommendations ul {
    margin-left: 16px;
}

.recommendations li {
    margin-bottom: 4px;
    font-size: 14px;
}

.highlighted-text {
    background-color: #fff9c4;
    display: inline-block;
    padding: 2px 0;
    animation: highlight 2s;
}

@keyframes highlight {
    0% { background-color: #ffeb3b; }
    100% { background-color: #fff9c4; }
}
.amount {
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
}

.positive {
    color: #16a34a;
}

.negative {
    color: #dc2626;
}

.neutral {
    color: #6b7280;
}

.info-box {
    background: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
    font-size: 13px;
    color: #1e40af;
}

/* Help Tooltip Styles */
.help-tip-wrapper {
    position: relative;
    display: inline-flex;
    margin-left: 6px;
}

.help-tip-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    border: none;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.help-tip-btn:hover {
    background: #2563eb;
}

.help-tip-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    width: 280px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    margin-bottom: 8px;
}

.help-tip-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

/* Tab description text */
.tab-description {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.tab-panel h3 {
    color: #1e293b;
    font-size: 18px;
    margin-bottom: 8px;
}

/* Form group wide variant */
.form-group.wide {
    grid-column: span 2;
}

/* Checkbox row */
.checkbox-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.checkbox-group label {
    display: inline;
    margin-bottom: 0;
}

/* Action buttons */
.nav-button.action-btn {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.nav-button.action-btn:hover {
    background: #4338ca;
    border-color: #4338ca;
}

.nav-button.action-btn.primary {
    background: #2563eb;
    border-color: #2563eb;
}

.nav-button.action-btn.primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.nav-button.action-btn.consult {
    background: #16a34a;
    border-color: #16a34a;
}

.nav-button.action-btn.consult:hover {
    background: #15803d;
    border-color: #15803d;
}

/* Info box highlight */
.info-box.highlight {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

/* Warning box in calc */
.tab-panel .warning-box {
    margin-top: 16px;
}

/* Mini comparison table */
.comparison-mini {
    margin-top: 20px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
}

.comparison-mini h4 {
    font-size: 14px;
    color: #374151;
    margin-bottom: 12px;
}

.comparison-mini table {
    width: 100%;
    font-size: 13px;
}

.comparison-mini td {
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-mini td:last-child {
    text-align: right;
    font-family: 'SF Mono', monospace;
}

/* Total row highlight */
.total-row {
    background: #f0f9ff !important;
}

.total-row td {
    background: inherit !important;
}

/* Big number summary */
.summary-box .big-number {
    font-size: 32px;
    font-weight: 700;
    color: #0369a1;
    margin: 8px 0;
}

.summary-box .big-number .label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    margin-top: 4px;
}

.summary-box.positive {
    background: #f0fdf4;
    border-color: #16a34a;
}

.summary-box.positive h3,
.summary-box.positive h4,
.summary-box.positive .big-number {
    color: #15803d;
}

.summary-box.negative {
    background: #fef2f2;
    border-color: #dc2626;
}

.summary-box.negative h3,
.summary-box.negative h4,
.summary-box.negative .big-number {
    color: #dc2626;
}

/* Details grid */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.detail-box h4 {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}

.detail-box .amount {
    font-size: 20px;
    color: #1e293b;
}

.detail-box .subtext {
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group.wide {
        grid-column: span 1;
    }

    .navigation-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-button {
        font-size: 12px;
        padding: 8px 12px;
    }

    .help-tip-popup {
        width: 220px;
        left: auto;
        right: 0;
        transform: none;
    }

    .help-tip-popup::after {
        left: auto;
        right: 10px;
        transform: none;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-row {
        flex-direction: column;
        gap: 12px;
    }
}

/* ============================================
   EXTENSIVE HELP SYSTEM STYLES
============================================ */

/* Schedule Summary Stats */
.schedule-summary {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.schedule-stat {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.schedule-stat.highlight {
    background: #f0fdf4;
    border-color: #16a34a;
}

.schedule-stat .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    font-family: 'SF Mono', 'Monaco', monospace;
}

.schedule-stat.highlight .stat-value {
    color: #16a34a;
}

.schedule-stat .stat-label {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Retirement Info Stats */
.retirement-info {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.retirement-stat {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.retirement-stat.highlight {
    background: #f0fdf4;
    border-color: #16a34a;
}

.retirement-stat .stat-label {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.retirement-stat .stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    font-family: 'SF Mono', 'Monaco', monospace;
}

.retirement-stat.highlight .stat-value {
    color: #16a34a;
}

/* Contextual Help Panel */
.contextual-help {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #3b82f6;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.contextual-help h3 {
    color: #1e40af;
    font-size: 16px;
    margin-bottom: 8px;
}

.contextual-help .help-intro {
    color: #1e40af;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.contextual-help .help-tips {
    margin: 0;
    padding-left: 20px;
}

.contextual-help .help-tips li {
    color: #1e40af;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Focused Field Help */
.focused-field-help {
    background: #fefce8;
    border: 1px solid #eab308;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.focused-field-help h4 {
    color: #a16207;
    font-size: 14px;
    margin-bottom: 6px;
}

.focused-field-help p {
    color: #713f12;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* Smart Insights */
.smart-insights {
    margin-bottom: 16px;
}

.smart-insights h4 {
    color: #374151;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
}

.insight {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.insight.info {
    background: #eff6ff;
    border: 1px solid #3b82f6;
}

.insight.info .insight-text {
    color: #1e40af;
}

.insight.warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
}

.insight.warning .insight-text {
    color: #92400e;
}

.insight.success {
    background: #f0fdf4;
    border: 1px solid #22c55e;
}

.insight.success .insight-text {
    color: #166534;
}

.insight-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.insight-text {
    flex: 1;
}

/* Expandable Comparison Table */
.comparison-table.expandable {
    font-size: 13px;
}

.expandable-row {
    cursor: pointer;
    transition: background 0.2s;
}

.expandable-row:hover {
    background: #f1f5f9 !important;
}

.expandable-row td:first-child {
    position: relative;
}

.expand-hint {
    font-size: 10px;
    color: #94a3b8;
    margin-left: 6px;
}

.explanation-row {
    background: #f8fafc !important;
}

.explanation-row td {
    padding: 12px 16px !important;
    font-size: 12px;
    line-height: 1.5;
    color: #475569;
    border-bottom: 2px solid #e2e8f0 !important;
    background: #f8fafc !important;
    font-style: italic;
}

.explanation-row.highlight td {
    background: #fef3c7 !important;
    color: #92400e;
}

.table-hint {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

/* Tab Panel Styling */
.tab-panel h3 {
    color: #1e293b;
    font-size: 18px;
    margin-bottom: 8px;
}

.tab-description {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Warning box in tabs */
.tab-panel .warning-box h4 {
    color: #92400e;
    font-size: 14px;
    margin-bottom: 8px;
}

.tab-panel .warning-box p {
    color: #78350f;
    font-size: 13px;
    line-height: 1.5;
}

.tab-panel .warning-box ul {
    margin: 0;
    padding-left: 20px;
}

.tab-panel .warning-box li {
    color: #78350f;
    font-size: 13px;
    margin-bottom: 6px;
}

/* Help tip popup positioning variants */
.help-tip-popup.bottom {
    bottom: auto;
    top: 100%;
    margin-top: 8px;
    margin-bottom: 0;
}

.help-tip-popup.bottom::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #1e293b;
}

/* Mobile Responsive for Help System */
@media (max-width: 768px) {
    .schedule-summary,
    .retirement-info {
        flex-direction: column;
    }

    .schedule-stat .stat-value,
    .retirement-stat .stat-value {
        font-size: 20px;
    }

    .contextual-help {
        padding: 12px;
    }

    .contextual-help h3 {
        font-size: 14px;
    }

    .insight {
        padding: 8px 10px;
        font-size: 12px;
    }

    .comparison-table.expandable {
        font-size: 12px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .comparison-table td:first-child {
        font-size: 11px;
    }

    .explanation-row td {
        font-size: 11px;
        padding: 10px 12px !important;
    }

    .tab-navigation {
        flex-wrap: wrap;
        gap: 3px;
        padding: 4px;
    }

    .tab-button {
        font-size: 11px;
        padding: 6px 8px;
        flex: 0 1 auto;
    }

    .tab-content {
        padding: 16px;
    }

    .preview-content {
        padding: 16px;
    }

    .summary-box .big-number {
        font-size: 24px;
    }

    .detail-box .amount {
        font-size: 16px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .tab-button {
        font-size: 10px;
        padding: 5px 6px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 6px 4px;
        font-size: 11px;
    }

    .expand-hint {
        display: none;
    }

    .smart-insights h4 {
        font-size: 13px;
    }

    .insight {
        font-size: 11px;
        padding: 6px 8px;
    }

    .info-box {
        font-size: 12px;
        padding: 10px;
    }
}

/* ============================================
   MOBILE TOUCH FIXES
============================================ */

/* Ensure all buttons are clickable on mobile */
button,
.nav-button,
.tab-button,
.cta-button,
.unlock-button {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* Prevent double-tap zoom on buttons */
button {
    touch-action: manipulation;
}

/* Ensure calculator container is above any site nav */
.calculator-container,
#root {
    position: relative;
    z-index: 10;
}

/* Navigation buttons on mobile */
@media (max-width: 480px) {
    .navigation-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 12px;
    }

    .nav-button {
        flex: 1 1 45%;
        min-width: 80px;
        justify-content: center;
        font-size: 11px;
        padding: 10px 8px;
    }

    .nav-button svg,
    .nav-button i {
        display: none;
    }
}

/* ============================================
   CHILD SUPPORT SPECIFIC STYLES
============================================ */

/* Custody Visual */
.custody-visual {
    margin: 16px 0;
}

/* State Details Card */
.state-details {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.state-details strong {
    color: #374151;
}

/* Breakdown Section */
.breakdown-section {
    margin-top: 16px;
}

.breakdown-section h4 {
    color: #374151;
    margin-bottom: 12px;
}

/* Support Direction Badge */
.support-direction {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #22c55e;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #166534;
}

/* Range Display */
.range-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-top: 16px;
}

.range-display .range-label {
    font-size: 12px;
    color: #64748b;
}

.range-display .range-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    font-family: 'SF Mono', monospace;
}
