/* Fetal biometry & gestational age calculator */
[x-cloak] { display: none !important; }

/* Mode switch */
.mode-tabs { display: flex; gap: 6px; justify-content: center; margin: 0 0 18px; }
.mode-tabs button {
    background: #1a1a1a; border: 1px solid #444; color: #ddd; padding: 8px 18px; border-radius: 999px; font-size: 0.92rem;
}
.mode-tabs button:hover { border-color: #7cc4ff; background: #222; }
.mode-tabs button[aria-selected="true"] { background: #0066cc; border-color: #0066cc; color: #fff; }

/* Shared top row */
.exam-row { display: flex; flex-wrap: wrap; gap: 10px 15px; align-items: center; justify-content: center; margin-bottom: 16px; }
.exam-row label { color: #eee; font-size: 0.95rem; font-weight: 500; }
.exam-row input[type="date"], .exam-row select {
    padding: 8px 10px; border: 1px solid #444; border-radius: 4px; background: #333; color: #fff; font: inherit; font-size: 0.95rem; color-scheme: dark;
}

/* Prior-report form: a wider label column so "Current biometry (optional)" fits on one line */
.prior-form .form-group label { min-width: 200px; }
.prior-form .form-group label small { font-weight: 400; color: #999; }

/* Measurement rows */
.measure-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.measure-row {
    display: grid; grid-template-columns: 56px 1fr 92px 96px; gap: 10px; align-items: center;
    background: #2a2a2a; border-radius: 6px; padding: 6px 10px; border: 1px solid transparent;
}
.measure-row.is-primary { border-color: #2e7d32; }
.measure-row.is-included { border-color: #0066cc; }
.measure-row.is-excluded { border-color: #a5762b; }
.measure-row label { font-weight: 600; color: #fff; }
.measure-row label small { display: block; font-weight: 400; font-size: 0.7rem; color: #999; }
.measure-row .mm { display: flex; align-items: center; gap: 6px; }
.measure-row input[type="text"] {
    width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid #444; border-radius: 4px; background: #333; color: #fff; font: inherit; font-size: 0.95rem;
}
.measure-row input:focus { outline: none; border-color: #0066cc; box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2); }
.measure-row .unit { color: #999; font-size: 0.85rem; }
.measure-row .est { font-variant-numeric: tabular-nums; color: #fff; font-size: 0.95rem; text-align: right; white-space: nowrap; }
.measure-row .est small { color: #999; font-size: 0.75rem; }
.measure-row .use { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.measure-row .use input[type="checkbox"] { appearance: auto; width: 15px; height: 15px; margin: 0; cursor: pointer; }
.chip { padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; white-space: nowrap; }
.chip.primary { background: #143d1f; color: #8fd18f; }
.chip.included { background: #0d2f52; color: #7cc4ff; }
.chip.excluded { background: #4a3413; color: #ffcc66; }
.chip.unsupported { background: #333; color: #999; }
.measure-note { grid-column: 1 / -1; font-size: 0.8rem; color: #ffcc66; line-height: 1.35; margin: -2px 0 2px; }
.measure-note.muted { color: #999; }
.measure-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.82rem; color: #aaa; margin-bottom: 10px; }

/* Results */
.results { text-align: center; }
.ga-big { font-size: 3rem; line-height: 1; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.ga-unit { font-size: 1.6rem; font-weight: 400; color: #7cc4ff; margin-right: 0.15em; }
.ga-sub { margin-top: 6px; color: #ccc; font-size: 0.95rem; }
.ga-range { margin-top: 4px; color: #aaa; font-size: 0.85rem; }
.ga-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 0; text-align: center; }
.ga-facts div { background: #2a2a2a; border-radius: 6px; padding: 8px 6px; }
.ga-facts dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #999; }
.ga-facts dd { margin: 3px 0 0; font-size: 0.9rem; color: #fff; }
.muted { color: #aaa; }
.warnings { margin: 14px 0 0; padding: 0; list-style: none; text-align: left; }
.warnings li { background: #4a3413; color: #ffe0a3; border-left: 3px solid #ffcc66; border-radius: 4px; padding: 8px 10px; margin: 6px 0; font-size: 0.85rem; line-height: 1.4; }
.compare { margin-top: 14px; padding: 10px 12px; border-radius: 6px; text-align: left; font-size: 0.9rem; line-height: 1.4; }
.compare.ok { background: #143d1f; border-left: 3px solid #2ecc71; color: #d8f5dc; }
.compare.warn { background: #4a1a1a; border-left: 3px solid #ff6b6b; color: #ffd6d6; }
.compare strong { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; opacity: 0.8; }
.placeholder { color: #888; font-size: 0.9rem; text-align: center; margin: 6px 0; }

@media (max-width: 700px) {
    .ga-facts { grid-template-columns: 1fr; }
    .ga-big { font-size: 2.6rem; }
    .measure-row { grid-template-columns: 52px 1fr 80px; }
    .measure-row .use { grid-column: 2 / -1; justify-content: flex-start; }
    .exam-row { justify-content: flex-start; }
}
