/* --- Brand Colors (shared across all TBV tools) --- */
:root {
    --primary: #1a365d;
    --primary-light: #2b6cb0;
    --accent: #e53e3e;
    --accent-gold: #C4A55A;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-light: #ffffff;
    --bg-page: #edf2f7;
    --bg-surface: #f7fafc;
    --bg-card: #ffffff;
    --border-color: #cbd5e0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --green: #276749;
    --green-light: #38a169;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    margin: 0;
    padding: 24px;
}

/* --- Header --- */
.header-container { text-align: center; margin-bottom: 32px; max-width: 1200px; margin-left: auto; margin-right: auto; }
.brand-header { margin-bottom: 8px; position: relative; }

.home-btn {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    display: inline-block; padding: 8px 20px;
    background-color: var(--primary); color: var(--text-light);
    text-decoration: none; font-weight: 600; font-size: 0.85em;
    border-radius: var(--radius-sm); letter-spacing: 0.03em;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.home-btn:hover { background-color: var(--primary-light); box-shadow: var(--shadow-sm); }

.brand-name { font-size: 1.6em; font-weight: 800; letter-spacing: -0.02em; }
.brand-the, .brand-better { color: var(--primary); }
.brand-veteran { color: var(--accent-gold); }

h1 { text-align: center; color: var(--primary); margin-bottom: 8px; font-size: 1.8em; letter-spacing: -0.02em; }
.tool-subtitle { font-size: 1em; color: var(--text-secondary); margin: 0; }

h2 {
    color: var(--primary); border-bottom: 2px solid var(--primary-light);
    padding-bottom: 12px; margin-top: 0; font-size: 1.1em; letter-spacing: -0.01em;
}

.section-subtitle { font-size: 0.9em; color: var(--text-secondary); margin: -8px 0 16px 0; font-style: italic; }
.section-footnote { font-size: 0.82em; color: var(--text-secondary); margin-top: 16px; line-height: 1.5; }
.section-footnote a { color: var(--primary-light); text-decoration: underline; }

/* --- Dashboard Layout --- */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.dash-row {
    margin-bottom: 24px;
}

/* ROW 1: Calculator (left) + Criteria Lookup (right) */
.dash-row-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.dash-calculator { min-width: 0; }
.dash-criteria { min-width: 0; }
.dash-criteria .section-container { margin-bottom: 0; }
.dash-criteria #results-section { margin-top: 24px; }

/* Scrollable criteria result */
.criteria-result-scroll {
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
.criteria-result-scroll::-webkit-scrollbar { width: 6px; }
.criteria-result-scroll::-webkit-scrollbar-track { background: transparent; }
.criteria-result-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color); border-radius: 3px;
}
.criteria-result-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* --- Calculator Inputs --- */
#calculator-container {
    margin: 0 auto;
}

.input-group-wrapper {
    background-color: var(--bg-surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); overflow: hidden; margin-bottom: 16px;
}

.input-group-header {
    padding: 16px 24px 0;
}
.input-group-header h2 { margin: 0; padding: 0; border: none; font-size: 0.95em; }

.input-group-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 16px 24px; background: none; border: none; cursor: pointer; text-align: left;
}
.input-group-toggle h2 { margin: 0; padding: 0; border: none; font-size: 0.95em; }
.toggle-indicator { font-size: 0.7em; color: var(--text-secondary); transition: transform 0.2s ease; }

.input-group {
    padding: 0 24px 24px; display: flex; flex-direction: column; gap: 10px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 2000px; opacity: 1; overflow: hidden;
}
.input-group.collapsed { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }

label { font-weight: 600; font-size: 0.8em; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }

select, input[type="number"], input[type="text"] {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 1em;
    background-color: var(--bg-card); color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select:focus, input[type="number"]:focus, input[type="text"]:focus {
    outline: none; border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.input-hint {
    font-size: 0.78em; color: var(--text-secondary); line-height: 1.4;
    margin: 2px 0 0 0; font-style: italic; text-transform: none;
    letter-spacing: normal; font-weight: 400;
}

.checkbox-row {
    display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.checkbox-row input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--primary);
    cursor: pointer; flex-shrink: 0;
}
.checkbox-label {
    font-weight: 600; font-size: 0.88em; color: var(--text-primary);
    text-transform: none; letter-spacing: normal; cursor: pointer;
}

/* --- Condition Rows --- */
.conditions-list {
    display: flex; flex-direction: column; gap: 10px;
}

.condition-row {
    display: flex; gap: 10px; align-items: center;
    padding: 12px 16px; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.condition-row:hover { border-color: var(--primary-light); }
.condition-row.bilateral-active { border-left: 3px solid var(--accent-gold); }

.condition-name {
    flex: 2; padding: 8px 12px; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 0.9em;
    background: var(--bg-surface); color: var(--text-primary);
}
.condition-name:focus { outline: none; border-color: var(--primary-light); }

.condition-rating {
    flex: 0 0 100px; padding: 8px 10px; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 0.9em;
    background: var(--bg-surface); color: var(--text-primary);
}
.condition-rating:focus { outline: none; border-color: var(--primary-light); }

.condition-bodypart {
    flex: 0 0 140px; padding: 8px 10px;
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    font-size: 0.82em; background: var(--bg-surface); color: var(--text-primary);
}
.condition-bodypart:focus { outline: none; border-color: var(--primary-light); }

.remove-condition-btn {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid var(--border-color); background: none;
    color: var(--text-secondary); cursor: pointer; font-size: 0.9em;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.2s ease; line-height: 1;
}
.remove-condition-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

.add-condition-btn {
    width: 100%; padding: 12px; border: 2px dashed var(--border-color);
    background: none; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-weight: 600; font-size: 0.88em;
    cursor: pointer; transition: all 0.2s ease;
}
.add-condition-btn:hover { border-color: var(--primary-light); color: var(--primary); background: rgba(26, 54, 93, 0.04); }

/* --- Section Containers --- */
.section-container {
    background-color: var(--bg-surface); color: var(--text-primary);
    padding: 32px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); margin-bottom: 24px; text-align: center;
}

/* --- Hero Card --- */
.hero-value-card {
    padding: 32px 24px; background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
    border-radius: var(--radius-lg); text-align: center; box-shadow: var(--shadow-lg);
}
.hero-value-card .hero-label {
    font-size: 0.82em; color: rgba(255,255,255,0.85);
    text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 10px 0;
}
.hero-value-card .hero-amount {
    font-size: 3em; font-weight: 800; color: var(--text-light); margin: 0; letter-spacing: -0.02em;
}
.hero-value-card .hero-detail {
    font-size: 0.92em; color: rgba(255,255,255,0.8); margin: 10px 0 0 0;
}
.hero-value-card .hero-detail strong { color: #fff; }

.hero-comp-breakdown {
    margin: 12px auto 0; padding: 12px 0 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    max-width: 320px;
}
.hero-comp-line {
    display: flex; justify-content: space-between; padding: 4px 0;
    font-size: 0.82em; color: rgba(255,255,255,0.75);
}
.hero-comp-line.hero-comp-total {
    border-top: 1px solid rgba(255,255,255,0.25);
    margin-top: 4px; padding-top: 8px;
    font-weight: 700; color: #fff;
}

#live-hero { margin-bottom: 16px; }

/* --- Benefit Breakdown Grid --- */
.benefit-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px; margin-top: 16px;
}
.benefit-card {
    padding: 24px; border-radius: var(--radius-md); background-color: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.06); box-shadow: var(--shadow-sm); text-align: left;
}
.benefit-card h3 {
    margin: 0 0 8px 0; font-size: 0.82em; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
}
.benefit-card .benefit-amount {
    font-size: 1.6em; font-weight: 800; color: var(--green); margin: 0 0 8px 0; line-height: 1.2;
}
.benefit-card .benefit-period {
    font-size: 0.45em; font-weight: 500; color: var(--text-secondary); margin-left: 4px;
}
.benefit-card .benefit-desc {
    font-size: 0.82em; color: var(--text-secondary); line-height: 1.5; margin: 0;
}
.benefit-card .benefit-tag {
    display: inline-block; margin-top: 8px; padding: 2px 8px; border-radius: 3px;
    font-size: 0.7em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.benefit-tag.tax-free { background: rgba(39, 103, 73, 0.1); color: var(--green); }

/* --- Math Breakdown Card --- */
.math-card {
    max-width: 560px; margin: 16px auto; background: var(--bg-card);
    border-radius: var(--radius-md); border: 1px solid rgba(0,0,0,0.06); overflow: hidden;
}
.math-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; font-size: 0.88em; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.math-row:last-child { border-bottom: none; }
.math-row.step-header {
    background: var(--bg-surface); font-weight: 600; font-size: 0.82em;
    color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em;
}
.math-row.total {
    background: var(--bg-surface); font-weight: 700; font-size: 0.95em;
}
.math-row.total-highlight {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
    font-weight: 700; font-size: 1em; color: white;
}
.math-label { color: var(--text-secondary); text-align: left; flex: 1; }
.math-value { font-weight: 600; color: var(--text-primary); text-align: right; white-space: nowrap; }
.math-formula { font-size: 0.8em; color: var(--text-secondary); font-style: italic; display: block; margin-top: 2px; }
.total-highlight .math-label,
.total-highlight .math-value { color: white; }

.math-next-steps {
    padding: 10px 20px; border-top: 1px solid rgba(0,0,0,0.06);
    background: rgba(196, 165, 90, 0.05); font-size: 0.72em;
    color: var(--text-secondary); line-height: 1.5; text-align: center;
}
.math-next-steps p { margin: 2px 0; }
.math-next-steps h4 {
    margin: 0 0 4px 0; font-size: 1em; color: var(--text-secondary);
    font-weight: 600; text-transform: none; letter-spacing: 0;
}
.math-next-steps a {
    font-weight: 600; color: var(--primary); text-decoration: underline;
}
.math-next-steps a:hover { color: var(--primary-light); }

.bilateral-badge-wrap {
    position: relative; display: inline-block; margin-left: 6px;
}
.bilateral-badge {
    display: inline-block; padding: 1px 6px; border-radius: 3px;
    font-size: 0.7em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
    background: rgba(196, 165, 90, 0.15); color: var(--accent-gold);
    cursor: help;
}
.bilateral-tooltip {
    display: none; position: fixed; width: 340px; padding: 16px;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    z-index: 1000; text-align: left; font-size: 12px; line-height: 1.5;
    color: var(--text-primary);
}
.bilateral-tooltip.visible { display: block; }
.bilateral-tooltip strong {
    display: block; font-size: 13px; color: var(--primary);
    margin-bottom: 8px; font-style: normal; text-transform: none; letter-spacing: normal;
}
.bt-row {
    display: flex; justify-content: space-between; padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-weight: 400; font-style: normal; text-transform: none; letter-spacing: normal;
}
.bt-row:last-of-type { border-bottom: none; }
.bt-row.bt-total {
    font-weight: 700; color: var(--green);
    border-top: 1px solid var(--primary-light); margin-top: 4px; padding-top: 6px;
}
.bt-note {
    margin: 8px 0 0; font-size: 11px; color: var(--text-secondary);
    font-style: italic; font-weight: 400; text-transform: none; letter-spacing: normal;
}

/* --- SMC Section --- */
.smc-compact {
    display: flex; flex-direction: column; gap: 12px;
}
.smc-compact-row {
    display: flex; align-items: center; gap: 10px;
}
.smc-level-label {
    text-transform: none; font-size: 0.88em; white-space: nowrap;
}
.smc-level-select {
    flex: 1; padding: 10px 12px; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 0.9em; background: var(--bg-card);
    color: var(--text-primary); cursor: pointer;
}
.smc-level-select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1); }

.smc-summary {
    font-size: 0.8em; font-weight: 600; color: var(--green);
}

.smc-k-row {
    display: flex; align-items: center; gap: 10px;
}
.smc-k-row label { text-transform: none; font-size: 0.88em; }
.smc-k-count {
    width: 60px; padding: 6px 8px; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 0.9em; text-align: center;
}

.smc-badge {
    display: inline-block; padding: 2px 8px; border-radius: 3px;
    font-size: 0.7em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    background: rgba(26, 54, 93, 0.1); color: var(--primary);
}

/* --- Compensation Breakdown --- */
.comp-summary {
    display: flex; flex-direction: column; gap: 8px;
    max-width: 480px; margin: 16px auto;
}
.comp-line {
    display: flex; justify-content: space-between; padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 0.9em;
}
.comp-line:last-child { border-bottom: none; }
.comp-line.comp-total { font-weight: 700; font-size: 1.05em; padding-top: 12px; border-top: 2px solid var(--primary-light); }
.comp-line-label { color: var(--text-secondary); }
.comp-line-value { font-weight: 600; color: var(--text-primary); }
.comp-line.comp-total .comp-line-value { color: var(--green); }

/* --- Common Combinations Table --- */
.combo-table {
    width: 100%; max-width: 560px; margin: 16px auto;
    border-collapse: collapse; font-size: 0.88em;
}
.combo-table th {
    padding: 10px 16px; background: var(--primary);
    color: var(--text-light); font-weight: 600; font-size: 0.85em;
    text-transform: uppercase; letter-spacing: 0.04em; text-align: left;
}
.combo-table td {
    padding: 10px 16px; border-bottom: 1px solid rgba(0,0,0,0.06);
    color: var(--text-primary);
}
.combo-table tr:nth-child(even) td { background: var(--bg-surface); }
.combo-table .combo-result { font-weight: 700; color: var(--green); }

/* --- Email Results Form --- */
#email-results-container {
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(26, 54, 93, 0.15) 100%);
    border: 1px solid var(--primary);
    text-align: center;
}
.email-form-row {
    display: flex; gap: 10px; justify-content: center;
    max-width: 480px; margin: 0 auto;
}
.email-form-row input[type="email"] {
    flex: 1; padding: 12px 16px; border: 2px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm); background: var(--bg-card);
    color: var(--text-primary); font-size: 0.95em;
}
.email-form-row input[type="email"]:focus {
    outline: none; border-color: var(--accent);
}
.email-form-row button { white-space: nowrap; }
.email-status { margin-top: 10px; font-size: 0.9em; min-height: 1.4em; }
.email-status.email-success { color: var(--green); font-weight: 600; }
.email-status.email-error { color: var(--accent); font-weight: 600; }

/* --- Action Bar --- */
.action-bar { display: flex; justify-content: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.action-btn {
    padding: 12px 24px; border: 2px solid var(--primary); background: var(--primary);
    color: var(--text-light); border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.88em; cursor: pointer; transition: all 0.2s ease;
}
.action-btn:hover { background: var(--primary-light); border-color: var(--primary-light); }
.action-btn-secondary { background: none; color: var(--primary); }
.action-btn-secondary:hover { background: rgba(26, 54, 93, 0.08); }

/* --- Footer --- */
footer { text-align: center; padding: 0 20px; color: var(--text-secondary); max-width: 1200px; margin: 40px auto 0; }
footer p { margin: 0 auto; font-size: 0.78em; line-height: 1.7; }
footer a { color: var(--primary-light); text-decoration: underline; }
.footer-sources { margin-top: 8px; font-style: italic; }

/* --- More Tools --- */
.more-tools { margin: 2rem auto; padding: 1.5rem 2rem; text-align: center; border-top: 1px solid rgba(255,255,255,0.1); }
.more-tools h3 { font-size: 1rem; color: #999; margin-bottom: 0.75rem; font-weight: 500; }
.more-tools .tools-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.more-tools .tools-links a { color: #C5A55A; text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.more-tools .tools-links a:hover { color: #e0c675; text-decoration: underline; }

/* --- Back Pay Estimator --- */
.backpay-inputs-stacked {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
    margin-top: 16px;
}
.backpay-inputs-stacked .backpay-field label { display: block; margin-bottom: 4px; }
.backpay-inputs-stacked .backpay-field select,
.backpay-inputs-stacked .backpay-field input[type="date"] {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 0.95em;
    background-color: var(--bg-card); color: var(--text-primary);
}
.backpay-inputs-stacked .backpay-field select:focus,
.backpay-inputs-stacked .backpay-field input[type="date"]:focus {
    outline: none; border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}
.backpay-inputs-inline {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px;
    max-width: 700px; margin: 16px auto; text-align: left;
}
.backpay-field label { display: block; margin-bottom: 4px; }
.backpay-field input[type="date"],
.backpay-field select {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 0.95em;
    background-color: var(--bg-card); color: var(--text-primary);
}
.backpay-field input[type="date"]:focus,
.backpay-field select:focus {
    outline: none; border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}
.backpay-result-card {
    margin: 20px auto; padding: 24px;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
    border-radius: var(--radius-md); text-align: center; color: white;
}
.backpay-result-card .backpay-amount {
    font-size: 2.2em; font-weight: 800; margin: 8px 0; letter-spacing: -0.02em;
}
.backpay-result-card .backpay-detail {
    font-size: 0.88em; color: rgba(255,255,255,0.8); margin: 4px 0 0 0;
}
.backpay-result-card .backpay-detail strong { color: white; }
.backpay-disclaimer {
    font-size: 0.78em; color: var(--text-secondary); margin-top: 12px;
    font-style: italic; line-height: 1.5;
}

/* --- VA Math Explainer --- */
.va-math-intro {
    text-align: left; max-width: 700px; margin: 0 auto 24px;
    font-size: 0.92em; line-height: 1.7; color: var(--text-primary);
}
.va-math-intro p { margin: 0 0 12px 0; }
.va-math-example {
    max-width: 560px; margin: 0 auto 24px;
    background: var(--bg-card); border-radius: var(--radius-md);
    border: 1px solid rgba(0,0,0,0.06); overflow: hidden;
}
.va-math-example-title {
    padding: 12px 20px; background: var(--primary);
    color: white; font-weight: 600; font-size: 0.88em;
    text-transform: uppercase; letter-spacing: 0.03em;
}
.va-math-step {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; font-size: 0.88em;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.va-math-step:last-child { border-bottom: none; }
.va-math-step-label { color: var(--text-secondary); text-align: left; flex: 1; }
.va-math-step-label .step-formula {
    font-size: 0.82em; font-style: italic; display: block; margin-top: 2px;
}
.va-math-step-value { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.va-math-step.step-result {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
    color: white; font-weight: 700;
}
.va-math-step.step-result .va-math-step-label,
.va-math-step.step-result .va-math-step-value { color: white; }
.va-math-takeaways {
    text-align: left; max-width: 700px; margin: 24px auto;
    font-size: 0.88em; line-height: 1.6;
}
.va-math-takeaways h3 {
    font-size: 0.95em; color: var(--primary); margin: 0 0 8px 0;
}
.va-math-takeaways ul { padding-left: 20px; margin: 0; }
.va-math-takeaways li { margin-bottom: 6px; color: var(--text-secondary); }

/* --- Criteria Lookup --- */
.criteria-controls {
    max-width: 600px; margin: 0 auto 20px;
}
.criteria-search-wrapper {
    position: relative; margin-bottom: 12px;
}
.criteria-search {
    width: 100%; padding: 12px 16px; border: 2px solid var(--border-color);
    border-radius: var(--radius-md); font-size: 1em;
    background: var(--bg-card); color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.criteria-search:focus {
    outline: none; border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}
.criteria-search::placeholder { color: var(--text-secondary); font-size: 0.9em; }
.criteria-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; z-index: 50;
}
.criteria-dropdown-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; cursor: pointer; font-size: 0.9em;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: background 0.15s ease;
}
.criteria-dropdown-item:last-child { border-bottom: none; }
.criteria-dropdown-item:hover { background: rgba(26, 54, 93, 0.06); }
.criteria-dropdown-item.no-results {
    color: var(--text-secondary); font-style: italic; cursor: default;
    justify-content: center;
}
.criteria-item-name { font-weight: 600; color: var(--text-primary); }
.criteria-item-meta { font-size: 0.8em; color: var(--text-secondary); white-space: nowrap; margin-left: 12px; }
.criteria-filters {
    display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
}
.criteria-filter-btn {
    padding: 5px 12px; border: 1px solid var(--border-color);
    border-radius: 20px; background: var(--bg-card); color: var(--text-secondary);
    font-size: 0.78em; font-weight: 600; cursor: pointer;
    transition: all 0.2s ease;
}
.criteria-filter-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.criteria-filter-btn.active {
    background: var(--primary); color: white; border-color: var(--primary);
}
.criteria-prompt {
    color: var(--text-secondary); font-style: italic; margin: 24px 0;
}

/* Criteria result card */
.criteria-card {
    margin: 0; text-align: left;
    background: var(--bg-card); border-radius: var(--radius-md);
    border: 1px solid rgba(0,0,0,0.06); overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.criteria-header {
    padding: 16px 20px; background: var(--primary); color: white;
}
.criteria-header h3 { margin: 0 0 4px 0; font-size: 1.05em; color: white; border: none; padding: 0; }
.criteria-dc { font-size: 0.78em; color: rgba(255,255,255,0.75); }
.criteria-note {
    padding: 12px 20px; background: rgba(196, 165, 90, 0.08);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 0.82em; color: var(--text-secondary); line-height: 1.5;
}
.criteria-ratings { padding: 0; }
.criteria-rating-row {
    display: flex; gap: 16px; padding: 14px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    align-items: flex-start;
}
.criteria-rating-row:last-child { border-bottom: none; }
.criteria-rating-row.rating-100 { background: rgba(39, 103, 73, 0.06); }
.criteria-rating-row.rating-0 { background: rgba(0,0,0,0.02); }
.criteria-percent {
    flex: 0 0 70px; font-weight: 800; font-size: 1.1em;
    color: var(--primary); text-align: center; padding-top: 2px;
}
.criteria-rating-row.rating-100 .criteria-percent { color: var(--green); }
.criteria-text {
    flex: 1; font-size: 0.88em; line-height: 1.6; color: var(--text-primary);
}
.quick-add-btn {
    background: var(--green); color: #fff; border: none; border-radius: 6px;
    padding: 4px 10px; font-size: 0.75em; font-weight: 600; cursor: pointer;
    white-space: nowrap; flex-shrink: 0; transition: background 0.15s, transform 0.1s;
    align-self: center;
}
.quick-add-btn:hover { background: var(--green-light); transform: scale(1.05); }
.quick-add-btn:active { transform: scale(0.97); }

@keyframes rowFlash {
    0% { background-color: rgba(0, 91, 148, 0.2); }
    100% { background-color: transparent; }
}
.row-flash { animation: rowFlash 1.2s ease-out; }

.criteria-legend {
    padding: 10px 20px; font-size: 0.78em; color: var(--text-secondary);
    font-style: italic; margin: 0; border-top: 1px solid rgba(0,0,0,0.06);
}

/* Criteria header layout for C&P tips badge */
.criteria-header-top {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

/* C&P Exam Tips badge + tooltip */
.cp-tips-badge-wrap { position: relative; }
.cp-tips-badge {
    display: inline-block; padding: 3px 10px; border-radius: 4px;
    font-size: 0.7em; font-weight: 700; cursor: pointer;
    background: rgba(255,255,255,0.2); color: white;
    border: 1px solid rgba(255,255,255,0.3);
    white-space: nowrap; transition: background 0.15s;
}
.cp-tips-badge:hover { background: rgba(255,255,255,0.35); }
.cp-tips-tooltip {
    display: none; position: fixed; z-index: 1000;
    width: 360px; max-width: 90vw; padding: 16px 20px;
    background: var(--primary); color: white; border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3); font-size: 0.85em; line-height: 1.6;
}
.cp-tips-tooltip.visible { display: block; }

/* Secondary conditions section */
.secondary-conditions {
    padding: 16px 20px; border-top: 2px solid rgba(196, 165, 90, 0.3);
    background: rgba(196, 165, 90, 0.04);
}
.secondary-conditions h4 {
    margin: 0 0 6px 0; font-size: 0.85em; color: var(--primary);
    text-transform: uppercase; letter-spacing: 0.03em;
}
.secondary-note {
    font-size: 0.78em; color: var(--text-secondary); line-height: 1.5;
    margin: 0 0 10px 0;
}
.secondary-list { display: flex; flex-wrap: wrap; gap: 8px; }
.secondary-link {
    display: inline-block; padding: 5px 14px; border-radius: 20px;
    font-size: 0.82em; font-weight: 600; cursor: pointer;
    background: var(--bg-surface); color: var(--primary);
    border: 1.5px solid var(--primary); transition: all 0.15s;
    text-decoration: none;
}
.secondary-link:hover {
    background: var(--primary); color: white; transform: scale(1.03);
}

/* --- Info Tooltip --- */
.info-tip {
    display: inline-block; width: 16px; height: 16px; border-radius: 50%;
    background: var(--border-color); color: var(--bg-card); font-size: 0.7em;
    font-weight: 700; text-align: center; line-height: 16px; cursor: help;
    margin-left: 4px; position: relative;
}
.info-tip:hover::after {
    content: attr(data-tip); position: absolute; bottom: 100%; left: 50%;
    transform: translateX(-50%); padding: 8px 12px; background: var(--text-primary);
    color: var(--text-light); font-size: 11px; border-radius: var(--radius-sm);
    white-space: normal; width: 220px; text-align: left; font-weight: 400;
    font-style: normal; text-transform: none; letter-spacing: normal;
    z-index: 10; box-shadow: var(--shadow-md);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .dash-row-top { grid-template-columns: 1fr; }

}
@media (max-width: 768px) {
    body { padding: 12px; }
    h1 { font-size: 1.3em; }
    .benefit-grid { grid-template-columns: 1fr; }
    .backpay-inputs-inline { grid-template-columns: 1fr; }
    .home-btn { position: static; transform: none; display: block; text-align: center; margin-bottom: 12px; }
    .condition-row { flex-wrap: wrap; }
    .condition-name { flex: 1 1 100%; }
    .condition-rating { flex: 1 1 auto; }
    .condition-bodypart { flex: 1 1 auto; }
    .math-row { padding: 8px 14px; font-size: 0.82em; }
    .email-form-row { flex-direction: column; }
    .email-form-row button { width: 100%; }
    .combo-table { font-size: 0.8em; }
    .combo-table th, .combo-table td { padding: 8px 10px; }
}

/* --- Print --- */
@media print {
    body { padding: 0; background: white; }
    .no-print, .action-bar, #email-results-container, .input-group-toggle .toggle-indicator { display: none !important; }
    .dash-row-top { grid-template-columns: 1fr; }

    .criteria-result-scroll { max-height: none; overflow-y: visible; }
    .section-container { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; page-break-inside: avoid; }
    #calculator-container { display: none; }
    .hero-value-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    footer { margin-top: 20px; }
}
