#mf-prontuario-root,
[data-mf-prontuario-root] {
    --mf-primary: #123763;
    --mf-primary-2: #0f9ea8;
    --mf-primary-hover: #0d2d52;
    --mf-accent: #0ea5e9;
    --mf-text: #152334;
    --mf-muted: #64748b;
    --mf-border: #dce5ee;
    --mf-soft: #f5f8fb;
    --mf-soft-2: #eef4f8;
    --mf-white: #fff;
    --mf-success: #15803d;
    --mf-success-bg: #ecfdf3;
    --mf-danger: #b42318;
    --mf-danger-bg: #fff1f0;
    --mf-warning: #9a6700;
    --mf-warning-bg: #fffbeb;
    --mf-shadow: 0 12px 32px rgba(18, 55, 99, .08);
    --mf-radius: 16px;
    color: var(--mf-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

[data-mf-prontuario-root] *, [data-mf-prontuario-root] *::before, [data-mf-prontuario-root] *::after { box-sizing: border-box; }
[data-mf-prontuario-root] [hidden] { display: none !important; }
[data-mf-prontuario-root] svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.mf-gp-wrap { width: min(100% - 36px, 1080px); margin-inline: auto; }

.mf-gp-hero {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    position: relative;
    overflow: hidden;
    padding: 48px 0 42px;
    color: #fff;
    background:
        radial-gradient(700px 360px at 92% -8%, rgba(15,158,168,.34), transparent 60%),
        radial-gradient(520px 320px at 4% 115%, rgba(115,154,195,.18), transparent 64%),
        linear-gradient(135deg, #123763 0%, #0d294b 55%, #081a31 100%);
}
.mf-gp-hero::after { content: ""; position: absolute; right: -130px; top: -130px; width: 430px; height: 430px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.018); pointer-events: none; }
.mf-gp-hero .mf-gp-wrap { position: relative; z-index: 2; }
.mf-gp-kicker { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.09); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.mf-gp-hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr); gap: 34px; align-items: end; margin-top: 18px; }
.mf-gp-hero h1 { margin: 0; max-width: 720px; color: #fff; font-size: clamp(34px, 5vw, 58px); line-height: 1.02; letter-spacing: -.035em; font-weight: 780; }
.mf-gp-hero p { max-width: 760px; margin: 17px 0 0; color: rgba(255,255,255,.82); font-size: 16px; line-height: 1.65; }
.mf-gp-hero-note { padding: 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.075); backdrop-filter: blur(8px); }
.mf-gp-hero-note strong, .mf-gp-hero-note span { display: block; }
.mf-gp-hero-note strong { color: #fff; font-size: 14px; margin-bottom: 5px; }
.mf-gp-hero-note span { color: rgba(255,255,255,.72); font-size: 12.5px; line-height: 1.5; }

.mf-gp-browser { margin-top: 30px; padding: 16px; border: 1px solid rgba(255,255,255,.15); border-radius: 18px; background: rgba(3,17,31,.22); backdrop-filter: blur(10px); }
.mf-gp-search-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; }
.mf-gp-search { position: relative; display: flex; align-items: center; }
.mf-gp-search > svg { position: absolute; left: 15px; color: rgba(255,255,255,.72); pointer-events: none; }
.mf-gp-search input { width: 100%; height: 50px; border: 1px solid rgba(255,255,255,.22); border-radius: 12px; padding: 0 46px 0 46px; color: #fff; background: rgba(255,255,255,.09); outline: none; font: inherit; font-size: 15px; }
.mf-gp-search input::placeholder { color: rgba(255,255,255,.62); }
.mf-gp-search input:focus { border-color: rgba(255,255,255,.66); box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.mf-gp-search-clear { position: absolute; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 9px; color: #fff; background: rgba(255,255,255,.1); cursor: pointer; font-size: 21px; }
.mf-gp-count { min-width: 106px; color: rgba(255,255,255,.7); font-size: 12.5px; text-align: right; }
.mf-gp-filter-label { margin: 14px 0 8px; color: rgba(255,255,255,.66); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.mf-gp-filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mf-gp-filter-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 7px 10px 7px 12px; color: #fff; background: rgba(255,255,255,.06); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; }
.mf-gp-filter-chip small { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: rgba(255,255,255,.11); font-size: 10px; }
.mf-gp-filter-chip.active { color: var(--mf-primary); background: #fff; border-color: #fff; }
.mf-gp-filter-chip.active small { background: #eaf2f8; }
.mf-gp-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 13px; }
.mf-gp-disease-card { width: 100%; min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 68px; padding: 13px 15px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; color: #fff; background: rgba(255,255,255,.07); text-align: left; cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.mf-gp-disease-card:hover { transform: translateY(-1px); background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); }
.mf-gp-disease-card strong, .mf-gp-disease-card small { display: block; }
.mf-gp-disease-card strong { font-size: 14px; }
.mf-gp-disease-card small { margin-top: 3px; color: rgba(255,255,255,.62); font-size: 11.5px; }
.mf-gp-disease-card svg { flex: 0 0 auto; color: rgba(255,255,255,.76); }
.mf-gp-empty, .mf-gp-loading { grid-column: 1/-1; padding: 13px 14px; border: 1px dashed rgba(255,255,255,.18); border-radius: 11px; color: rgba(255,255,255,.72); font-size: 12.5px; }
.mf-gp-loading { display: flex; align-items: center; gap: 10px; }
.mf-gp-loading span { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: mfspin .7s linear infinite; }
@keyframes mfspin { to { transform: rotate(360deg); } }

.mf-gp-main { padding: 32px 0 42px; }
.mf-gp-intro { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.mf-gp-intro-card { display: flex; gap: 13px; align-items: flex-start; padding: 18px; border: 1px solid var(--mf-border); border-radius: 14px; background: #fff; box-shadow: 0 5px 20px rgba(18,55,99,.04); }
.mf-gp-step { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; color: var(--mf-primary); background: #e9f2f8; font-weight: 800; font-size: 13px; }
.mf-gp-intro-card strong { display: block; font-size: 14px; }
.mf-gp-intro-card p { margin: 4px 0 0; color: var(--mf-muted); font-size: 12.5px; }

.mf-gp-workspace, .mf-gp-result { border: 1px solid var(--mf-border); border-radius: 18px; background: #fff; box-shadow: var(--mf-shadow); padding: 22px; }
.mf-gp-workspace-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.mf-gp-selected { text-align: right; }
.mf-gp-selected span, .mf-gp-selected strong { display: block; }
.mf-gp-selected span { color: var(--mf-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.mf-gp-selected strong { color: var(--mf-primary); font-size: 14px; }

.mf-gp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 750; transition: .18s ease; }
.mf-gp-btn:hover { transform: translateY(-1px); }
.mf-gp-btn-primary { color: #fff; background: var(--mf-primary); border-color: var(--mf-primary); }
.mf-gp-btn-primary:hover { background: var(--mf-primary-hover); }
.mf-gp-btn-secondary { color: var(--mf-primary); background: #fff; border-color: var(--mf-border); }
.mf-gp-btn-small { min-height: 34px; padding: 0 11px; font-size: 11.5px; }
.mf-gp-btn-safe { color: var(--mf-success); background: var(--mf-success-bg); border-color: #bbf7d0; }
.mf-gp-btn-ghost { color: var(--mf-muted); background: var(--mf-soft); border-color: var(--mf-border); }

.mf-gp-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; padding: 5px; border: 1px solid var(--mf-border); border-radius: 12px; background: var(--mf-soft-2); margin-bottom: 20px; }
.mf-gp-tab { min-height: 42px; border: 1px solid transparent; border-radius: 9px; color: #607287; background: transparent; cursor: pointer; font: inherit; font-size: 13px; font-weight: 750; }
.mf-gp-tab.active { color: var(--mf-primary); background: #fff; border-color: #d7e2ec; box-shadow: 0 2px 7px rgba(18,55,99,.06); }
.mf-gp-tab-pane { display: none; }
.mf-gp-tab-pane.active { display: block; animation: mffade .18s ease; }
@keyframes mffade { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.mf-gp-module-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 2px 2px 14px; }
.mf-gp-module-heading span { display: block; color: var(--mf-primary-2); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.mf-gp-module-heading h2 { margin: 2px 0 4px; color: var(--mf-text); font-size: 21px; line-height: 1.2; }
.mf-gp-module-heading p { margin: 0; color: var(--mf-muted); font-size: 12.5px; }
.mf-gp-safety-status { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; padding: 9px 11px; border-radius: 10px; border: 1px solid; }
.mf-gp-safety-status.pending { color: var(--mf-warning); background: var(--mf-warning-bg); border-color: #fde68a; }
.mf-gp-safety-status.ok { color: var(--mf-success); background: var(--mf-success-bg); border-color: #bbf7d0; }
.mf-gp-safety-status strong, .mf-gp-safety-status small { display: block; }
.mf-gp-safety-status strong { font-size: 11.5px; }
.mf-gp-safety-status small { opacity: .82; font-size: 10.5px; }

.mf-gp-section-card { margin-bottom: 13px; padding: 16px; border: 1px solid var(--mf-border); border-radius: 13px; background: #fff; }
.mf-gp-section-card h3 { margin: 0 0 13px; color: var(--mf-text); font-size: 14px; }
.mf-gp-section-help { margin: -7px 0 12px; color: var(--mf-muted); font-size: 11.5px; }
.mf-gp-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.mf-gp-field { min-width: 0; }
.mf-gp-field label { display: block; margin-bottom: 6px; color: #334155; font-size: 12px; font-weight: 750; }
.mf-gp-input, .mf-gp-select, .mf-gp-textarea { width: 100%; min-width: 0; min-height: 43px; border: 1px solid var(--mf-border); border-radius: 9px; padding: 9px 11px; color: var(--mf-text); background: #fff; outline: none; font: inherit; font-size: 13px; }
.mf-gp-textarea { min-height: 90px; resize: vertical; }
.mf-gp-input:focus, .mf-gp-select:focus, .mf-gp-textarea:focus { border-color: #7db8d9; box-shadow: 0 0 0 3px rgba(14,165,233,.10); }
.mf-gp-duration { display: grid; grid-template-columns: minmax(90px,.8fr) minmax(120px,1.2fr); gap: 8px; }
.mf-gp-choice-row { display: flex; flex-wrap: wrap; gap: 7px; }
.mf-gp-choice { min-height: 39px; border: 1px solid var(--mf-border); border-radius: 9px; padding: 7px 11px; color: #475569; background: #fff; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 700; }
.mf-gp-choice.selected { color: var(--mf-primary); border-color: #8ab4cf; background: #edf6fb; }

.mf-gp-state-list-wrap { grid-column: 1/-1; min-width: 0; }
.mf-gp-state-list-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.mf-gp-state-list-head strong { font-size: 12px; }
.mf-gp-state-list-head span { color: var(--mf-muted); font-size: 10.5px; }
.mf-gp-state-actions { display: flex; gap: 7px; margin-bottom: 9px; }
.mf-gp-state-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.mf-gp-state-row { display: flex; justify-content: space-between; gap: 9px; align-items: center; min-height: 46px; padding: 7px 8px 7px 11px; border: 1px solid var(--mf-border); border-radius: 10px; background: #fff; }
.mf-gp-state-row[data-state="nega"] { border-color: #b7e3c3; background: #fbfffc; }
.mf-gp-state-row[data-state="presente"] { border-color: #f3b7b1; background: #fffafa; }
.mf-gp-state-label { min-width: 0; color: #334155; font-size: 11.5px; line-height: 1.35; }
.mf-gp-state-controls { display: flex; flex: 0 0 auto; gap: 4px; }
.mf-gp-state-btn { min-height: 30px; border: 1px solid var(--mf-border); border-radius: 7px; padding: 4px 7px; background: #fff; color: var(--mf-muted); cursor: pointer; font: inherit; font-size: 10px; font-weight: 800; }
.mf-gp-state-btn.negative.selected { color: var(--mf-success); border-color: #86d99c; background: var(--mf-success-bg); }
.mf-gp-state-btn.positive.selected { color: var(--mf-danger); border-color: #f0aaa3; background: var(--mf-danger-bg); }
.mf-gp-alarm-card { border-color: #d9e5ef; background: #fbfdff; }

.mf-gp-preview-title { margin: 18px 0 6px; color: var(--mf-primary); font-size: 10.5px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.mf-gp-preview, .mf-gp-section-preview { white-space: pre-wrap; border: 1px solid #dbe5ee; border-left: 4px solid #90b7d2; border-radius: 9px; padding: 13px 14px; color: #334155; background: #f3f7fa; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.6; }
.mf-gp-section-preview { margin: 10px 0; font-size: 10.5px; }
.mf-gp-preview-empty { color: var(--mf-muted); font-family: inherit; }
.preview-seg { padding: 1px 2px; border-radius: 3px; transition: background .15s; }
.preview-seg.active-focus { background: #fef3c7; color: #1e293b; }

.mf-gp-inline-check { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--mf-border); border-radius: 10px; color: #334155; background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.mf-gp-inline-check input { width: 17px; height: 17px; accent-color: var(--mf-primary); }
#mf-gp-exame { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.mf-gp-exam-card { min-width: 0; border: 1px solid var(--mf-border); border-radius: 11px; overflow: hidden; background: #fff; }
.mf-gp-exam-card:has(.mf-gp-exam-body:not([hidden])) { grid-column: 1/-1; }
.mf-gp-exam-head { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; padding: 10px 13px; color: #334155; background: var(--mf-soft); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 800; text-align: left; }
.mf-gp-exam-head small { color: var(--mf-muted); font-size: 10px; }
.mf-gp-exam-body { padding: 12px; border-top: 1px solid var(--mf-border); }
.mf-gp-exam-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.mf-gp-extra { margin-top: 6px; }

.mf-gp-conduta-info { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid #b9ddf1; border-radius: 10px; color: #0b5f8d; background: #edf8fe; }
.mf-gp-conduta-info strong { font-size: 12px; }
.mf-gp-conduta-info span { font-size: 11px; opacity: .86; }
.mf-gp-conduta-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.mf-gp-conduta-card { border: 1px solid var(--mf-border); border-radius: 11px; background: #fff; overflow: hidden; }
.mf-gp-conduta-card > label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; cursor: pointer; }
.mf-gp-conduta-card > label input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--mf-primary); }
.mf-gp-conduta-card > label span { min-width: 0; }
.mf-gp-conduta-card > label strong, .mf-gp-conduta-card > label small { display: block; }
.mf-gp-conduta-card > label strong { color: #334155; font-size: 12px; }
.mf-gp-conduta-card > label small { margin-top: 3px; color: var(--mf-muted); font-size: 10.5px; line-height: 1.4; }
.mf-gp-conduta-sub { padding: 0 12px 12px; }
.mf-gp-conduta-sub .mf-gp-input { margin-top: 8px; }

.mf-gp-validation { margin: 15px 0 0; padding: 12px 14px; border: 1px solid #f0c6a0; border-radius: 10px; color: #8a4b0f; background: #fff8ed; font-size: 12px; }
.mf-gp-validation ul { margin: 6px 0 0 18px; padding: 0; }
.mf-gp-generate { width: 100%; margin-top: 15px; min-height: 48px; }

.mf-gp-result { margin-top: 20px; }
.mf-gp-result-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; }
.mf-gp-result-head span { color: var(--mf-primary-2); font-size: 10.5px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.mf-gp-result-head h2 { margin: 1px 0 0; font-size: 20px; }
.mf-gp-result pre { margin: 0; max-height: 560px; overflow: auto; white-space: pre-wrap; padding: 17px; border: 1px solid var(--mf-border); border-radius: 11px; color: #26384b; background: #f5f8fb; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.mf-gp-result-actions { display: flex; gap: 9px; margin-top: 12px; }

.mf-gp-footer-info { width: 100vw; margin-left: calc(50% - 50vw); padding: 34px 0; color: #fff; background: linear-gradient(135deg,#081a31,#0e2a4d 65%,#123763); }
.mf-gp-footer-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.mf-gp-footer-grid > div { padding: 15px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.055); }
.mf-gp-footer-grid strong, .mf-gp-footer-grid span { display: block; }
.mf-gp-footer-grid strong { font-size: 12.5px; }
.mf-gp-footer-grid span { margin-top: 4px; color: rgba(255,255,255,.68); font-size: 11px; line-height: 1.5; }

.mf-gp-error { color: #ffd7d2; border-color: rgba(255,164,154,.35); }

@media (max-width: 820px) {
    .mf-gp-hero-grid { grid-template-columns: 1fr; gap: 18px; }
    .mf-gp-hero-note { max-width: 620px; }
    .mf-gp-intro { grid-template-columns: 1fr; }
    .mf-gp-form-grid, .mf-gp-state-list, #mf-gp-exame, .mf-gp-conduta-grid { grid-template-columns: 1fr; }
    .mf-gp-exam-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .mf-gp-footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .mf-gp-wrap { width: min(100% - 24px, 1080px); }
    .mf-gp-hero, .mf-gp-footer-info { width: 100%; margin-left: 0; }
    .mf-gp-hero { padding: 34px 0 28px; }
    .mf-gp-hero h1 { font-size: clamp(31px, 11vw, 44px); }
    .mf-gp-hero p { font-size: 14px; }
    .mf-gp-search-row, .mf-gp-results { grid-template-columns: 1fr; }
    .mf-gp-count { text-align: left; }
    .mf-gp-filter-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
    .mf-gp-filter-chip { flex: 0 0 auto; }
    .mf-gp-search input, .mf-gp-input, .mf-gp-select, .mf-gp-textarea { font-size: 16px; }
    .mf-gp-workspace, .mf-gp-result { padding: 14px; border-radius: 14px; }
    .mf-gp-workspace-top, .mf-gp-module-heading, .mf-gp-result-head { align-items: stretch; flex-direction: column; }
    .mf-gp-selected { text-align: left; }
    .mf-gp-tabs { gap: 3px; padding: 4px; }
    .mf-gp-tab { font-size: 11px; padding-inline: 5px; }
    .mf-gp-safety-status { width: 100%; }
    .mf-gp-state-row { align-items: flex-start; flex-direction: column; }
    .mf-gp-state-controls { width: 100%; }
    .mf-gp-state-btn { flex: 1; }
    .mf-gp-exam-grid { grid-template-columns: 1fr; }
    .mf-gp-result-actions { flex-direction: column; }
    .mf-gp-result-actions .mf-gp-btn, .mf-gp-result-head .mf-gp-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    [data-mf-prontuario-root] * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================
   AJUSTES DE INTERFACE — revisão modular 2
   ========================================================== */

.mf-gp-search-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.mf-gp-search > svg {
    z-index: 3;
    width: 19px;
    height: 19px;
}

.mf-gp-search input,
.mf-gp-search input:focus,
.mf-gp-search input:active {
    -webkit-appearance: none;
    appearance: none;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff;
    background-color: rgba(255,255,255,.09) !important;
    background-image: none !important;
}

.mf-gp-search input:-webkit-autofill,
.mf-gp-search input:-webkit-autofill:hover,
.mf-gp-search input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #183b61 inset !important;
    box-shadow: 0 0 0 1000px #183b61 inset !important;
    transition: background-color 9999s ease-out 0s;
}

.mf-gp-filter-toggle {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    color: rgba(255,255,255,.88);
    background: rgba(255,255,255,.07);
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    font-weight: 750;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.mf-gp-filter-toggle:hover { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.27); }
.mf-gp-filter-toggle.active { color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.32); }
.mf-gp-filter-toggle svg { width: 16px; height: 16px; }

.mf-gp-filter-panel {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 13px;
    background: rgba(4,20,37,.18);
}
.mf-gp-filter-panel .mf-gp-filter-label { margin: 0 0 9px; }

.mf-gp-results-category {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}
.mf-gp-results-category .mf-gp-disease-card {
    min-height: 54px;
    gap: 7px;
    padding: 9px 10px;
    border-radius: 10px;
}
.mf-gp-results-category .mf-gp-disease-card strong { font-size: 11.5px; line-height: 1.25; }
.mf-gp-results-category .mf-gp-disease-card small { font-size: 9.5px; }
.mf-gp-results-category .mf-gp-disease-card svg { width: 14px; height: 14px; }

.mf-gp-disease-card:hover {
    transform: none;
    background: rgba(255,255,255,.095);
    border-color: rgba(255,255,255,.21);
}

/* Área inicial com 6 etapas */
.mf-gp-intro {
    display: block;
    min-height: 350px;
    padding: 28px;
    border: 1px solid var(--mf-border);
    border-radius: 18px;
    background:
        radial-gradient(520px 180px at 100% 0%, rgba(15,158,168,.07), transparent 65%),
        #fff;
    box-shadow: var(--mf-shadow);
}
.mf-gp-intro-head { max-width: 720px; margin-bottom: 22px; }
.mf-gp-intro-head > span {
    color: var(--mf-primary-2);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.mf-gp-intro-head h2 { margin: 5px 0 7px; color: var(--mf-text); font-size: clamp(22px, 3vw, 30px); line-height: 1.15; }
.mf-gp-intro-head p { margin: 0; color: var(--mf-muted); font-size: 13.5px; line-height: 1.6; }
.mf-gp-intro-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.mf-gp-intro-card {
    min-height: 112px;
    padding: 17px;
    border-radius: 13px;
    box-shadow: none;
    background: #fbfdff;
}
.mf-gp-step { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }
.mf-gp-intro-card strong { font-size: 14.5px; line-height: 1.3; }
.mf-gp-intro-card p { margin-top: 6px; font-size: 12.5px; line-height: 1.5; }

/* Hovers mais suaves */
.mf-gp-btn { transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
.mf-gp-btn:hover { transform: none; box-shadow: 0 3px 10px rgba(18,55,99,.06); }
.mf-gp-btn-primary:hover { background: #183f6d; border-color: #183f6d; }
.mf-gp-btn-secondary:hover { background: #f8fafc; border-color: #ccd9e5; }
.mf-gp-btn-safe:hover { background: #e7f9ed; border-color: #a8dfb7; }
.mf-gp-btn-ghost:hover { background: #f3f6f9; border-color: #d2dde7; }
.mf-gp-choice:hover:not(.selected),
.mf-gp-state-btn:hover:not(.selected),
.mf-gp-multi-option:hover:not(.selected) {
    color: #42566d;
    background: #fafcfd;
    border-color: #cdd9e4;
}
.mf-gp-choice.selected:hover,
.mf-gp-state-btn.selected:hover,
.mf-gp-multi-option.selected:hover { filter: none; }

/* Cabeçalhos e cards internos */
.mf-gp-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.mf-gp-section-title h3 { margin: 0; font-size: 14.5px; }
.mf-gp-section-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 31px;
    height: 31px;
    border-radius: 9px;
    color: var(--mf-primary);
    background: #eaf2f8;
}
.mf-gp-section-icon svg { width: 16px; height: 16px; }
.mf-gp-section-icon.alarm { color: #9a6700; background: #fff7df; }
.mf-gp-field-full { grid-column: 1 / -1; }
.mf-gp-field-help { display: block; margin: -2px 0 7px; color: var(--mf-muted); font-size: 10.5px; }

.mf-gp-preset-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #d7e5ef;
    border-radius: 11px;
    color: #36536c;
    background: #f6fafc;
}
.mf-gp-preset-note > svg { flex: 0 0 auto; margin-top: 1px; color: var(--mf-primary-2); }
.mf-gp-preset-note strong, .mf-gp-preset-note span { display: block; }
.mf-gp-preset-note strong { font-size: 12.5px; }
.mf-gp-preset-note span { margin-top: 2px; color: var(--mf-muted); font-size: 11.5px; line-height: 1.5; }

/* Revisão pendente */
.mf-gp-safety-status {
    min-width: 225px;
    padding: 12px 13px;
    border-radius: 12px;
    box-shadow: 0 5px 14px rgba(18,55,99,.04);
}
.mf-gp-safety-status > svg { flex: 0 0 auto; width: 20px; height: 20px; }
.mf-gp-safety-status.pending {
    color: #8a5a08;
    background: linear-gradient(135deg,#fffaf0,#fff6dc);
    border-color: #f0d898;
}
.mf-gp-safety-status.ok {
    background: linear-gradient(135deg,#f3fff7,#eaf9ef);
    border-color: #b8e2c3;
}
.mf-gp-safety-status strong { font-size: 12px; }
.mf-gp-safety-status small { margin-top: 1px; font-size: 10.5px; }
.mf-gp-safety-track {
    display: block;
    width: 100%;
    height: 5px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(100,116,139,.16);
}
.mf-gp-safety-track > i { display: block; height: 100%; border-radius: inherit; background: currentColor; transition: width .2s ease; }

/* Exame físico */
.mf-gp-exam-head-title { display: inline-flex; align-items: center; gap: 9px; }
.mf-gp-exam-head .mf-gp-section-icon { width: 28px; height: 28px; }
.mf-gp-multi-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.mf-gp-multi-option {
    min-height: 34px;
    border: 1px solid var(--mf-border);
    border-radius: 8px;
    padding: 6px 9px;
    color: #52657a;
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 10.5px;
    font-weight: 700;
}
.mf-gp-multi-option.selected { color: var(--mf-primary); border-color: #91b8d0; background: #eef6fb; }
.mf-gp-exam-free { grid-column: 1 / -1; padding: 13px; }
.mf-gp-exam-free-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mf-gp-exam-free-head strong, .mf-gp-exam-free-head small { display: block; }
.mf-gp-exam-free-head strong { font-size: 12.5px; }
.mf-gp-exam-free-head small { margin-top: 2px; color: var(--mf-muted); font-size: 10.5px; font-weight: 500; }

/* Conduta */
.mf-gp-conduta-info {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px 15px;
    border-color: #c8ddea;
    color: #244b67;
    background: linear-gradient(135deg,#f5fbfe,#edf7fb);
}
.mf-gp-conduta-info-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #0c7595;
    background: #dff2f8;
}
.mf-gp-conduta-info strong { font-size: 13px; }
.mf-gp-conduta-info span { font-size: 11.5px; line-height: 1.5; }
.mf-gp-conduta-card { transition: border-color .16s ease, background .16s ease; }
.mf-gp-conduta-card.selected { border-color: #9fbfd3; background: #fbfdff; }
.mf-gp-conduta-card > label { align-items: center; min-height: 66px; }
.mf-gp-conduta-card > label input { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; }
.mf-gp-conduta-card > label strong { font-size: 12.5px; }
.mf-gp-conduta-card > label small { font-size: 11px; }
.mf-gp-conduta-sub .mf-gp-textarea { margin-top: 4px; min-height: 86px; }

/* Hero e cards finais */
.mf-gp-footer-info { padding: 52px 0 48px; }
.mf-gp-footer-hero { max-width: 720px; margin: 0 auto 27px; text-align: center; }
.mf-gp-footer-hero > span { color: #79d7df; font-size: 11px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.mf-gp-footer-hero h2 { margin: 7px 0 8px; color: #fff; font-size: clamp(24px,3.4vw,34px); line-height: 1.15; }
.mf-gp-footer-hero p { margin: 0; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.6; }
.mf-gp-footer-grid > div {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    text-align: center;
}
.mf-gp-footer-grid > div > svg {
    width: 32px;
    height: 32px;
    margin-bottom: 15px;
    color: #79d7df;
}
.mf-gp-footer-grid strong { font-size: 15px; }
.mf-gp-footer-grid span { max-width: 280px; margin-top: 8px; font-size: 12.5px; line-height: 1.6; }

@media (max-width: 900px) {
    .mf-gp-results-category { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .mf-gp-intro-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .mf-gp-footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .mf-gp-footer-grid > div:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
    .mf-gp-search-row { grid-template-columns: minmax(0,1fr) auto; }
    .mf-gp-search { grid-column: 1 / -1; }
    .mf-gp-filter-toggle { min-height: 42px; }
    .mf-gp-count { align-self: center; text-align: right; }
    .mf-gp-results { grid-template-columns: 1fr; }
    .mf-gp-results-category { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .mf-gp-results-category .mf-gp-disease-card { min-height: 58px; }
    .mf-gp-intro { min-height: 0; padding: 20px 15px; }
    .mf-gp-intro-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
    .mf-gp-intro-card { min-height: 145px; display: block; padding: 13px; }
    .mf-gp-intro-card .mf-gp-step { margin-bottom: 10px; }
    .mf-gp-intro-card strong { font-size: 13px; }
    .mf-gp-intro-card p { font-size: 11.5px; }
    .mf-gp-safety-status { min-width: 0; }
    .mf-gp-section-title { align-items: flex-start; }
    .mf-gp-conduta-info { padding: 12px; }
    .mf-gp-footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
    .mf-gp-footer-grid > div { min-height: 190px; padding: 18px 12px; }
    .mf-gp-footer-grid > div:nth-child(3) { grid-column: 1 / -1; min-height: 165px; }
    .mf-gp-footer-grid strong { font-size: 13.5px; }
    .mf-gp-footer-grid span { font-size: 11.5px; }
}

/* ==========================================================
   AJUSTES DE INTERFACE — revisão modular 3
   ========================================================== */

/* Resultados do filtro só ocupam espaço quando realmente visíveis */
.mf-gp-results[hidden] { display: none !important; }

/* Área inicial: composição mais alta, quase quadrada e integrada ao tema escuro */
.mf-gp-intro {
    width: min(100%, 900px);
    min-height: 760px;
    aspect-ratio: 1.16 / 1;
    margin-inline: auto;
    padding: clamp(30px, 5vw, 52px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(520px 320px at 100% 0%, rgba(15,158,168,.22), transparent 64%),
        radial-gradient(420px 300px at 0% 100%, rgba(76,118,167,.18), transparent 68%),
        linear-gradient(145deg,#0d2b4d 0%,#0a223d 58%,#07182c 100%);
    box-shadow: 0 22px 55px rgba(8,26,49,.18);
}
.mf-gp-intro::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -150px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 0 0 55px rgba(255,255,255,.018), 0 0 0 110px rgba(255,255,255,.012);
    pointer-events: none;
}
.mf-gp-intro-head,
.mf-gp-intro-grid { position: relative; z-index: 2; }
.mf-gp-intro-head { max-width: 700px; margin: 0 auto 30px; text-align: center; }
.mf-gp-intro-head > span { color: #83dce1; }
.mf-gp-intro-head h2 { margin-top: 8px; color: #fff; font-size: clamp(27px,3.3vw,36px); }
.mf-gp-intro-head p { max-width: 650px; margin-inline: auto; color: rgba(255,255,255,.72); font-size: 14.5px; }
.mf-gp-intro-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.mf-gp-intro-card {
    min-height: 142px;
    padding: 21px;
    gap: 15px;
    align-items: flex-start;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 16px;
    color: #fff;
    background: rgba(5,23,42,.58);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.mf-gp-intro-card strong { color: #fff; font-size: 15px; }
.mf-gp-intro-card p { color: rgba(255,255,255,.68); font-size: 12.8px; line-height: 1.58; }
.mf-gp-step {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(126,222,228,.20);
    color: #b9f2f4;
    background: #123a5f;
    box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

/* Ícones internos: fundo escuro + ícone claro */
.mf-gp-section-icon {
    color: #e8fbfc;
    background: linear-gradient(145deg,#16436e,#0d2d4f);
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 5px 12px rgba(8,26,49,.10);
}
.mf-gp-section-icon.alarm {
    color: #fff3cf;
    background: linear-gradient(145deg,#7a550d,#5c3f08);
}

/* Cards informativos escuros */
.mf-gp-preset-note {
    color: #fff;
    border-color: #214d73;
    background: linear-gradient(135deg,#123763,#0d2b4d);
}
.mf-gp-preset-note > svg { color: #8be3e7; }
.mf-gp-preset-note strong { color: #fff; }
.mf-gp-preset-note span { color: rgba(255,255,255,.70); }

.mf-gp-safety-status.pending {
    color: #fff4d4;
    border-color: #85641c;
    background: linear-gradient(135deg,#6b4b08,#493205);
}
.mf-gp-safety-status.ok {
    color: #e9fff0;
    border-color: #286a45;
    background: linear-gradient(135deg,#175b38,#103d29);
}
.mf-gp-safety-status small { color: rgba(255,255,255,.74); }
.mf-gp-safety-track { background: rgba(255,255,255,.18); }

/* Conduta: informativo alinhado e cards independentes em altura */
.mf-gp-conduta-info {
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    color: #fff;
    border-color: #214d73;
    background: linear-gradient(135deg,#123763,#0c2b4b);
}
.mf-gp-conduta-info > div { min-width: 0; display: block; }
.mf-gp-conduta-info-icon {
    width: 40px;
    height: 40px;
    color: #dffbfc;
    background: #0f566a;
    border: 1px solid rgba(255,255,255,.10);
}
.mf-gp-conduta-info strong,
.mf-gp-conduta-info span { display: block; }
.mf-gp-conduta-info strong { margin: 0 0 4px; color: #fff; line-height: 1.25; }
.mf-gp-conduta-info span { color: rgba(255,255,255,.70); }
.mf-gp-conduta-grid { align-items: start; }
.mf-gp-conduta-card { align-self: start; }

/* Campos livres específicos do exame */
.mf-gp-exam-section-free {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--mf-border);
}
.mf-gp-exam-section-free .mf-gp-textarea { min-height: 84px; }

/* Prévias e resultado editáveis */
.mf-gp-preview-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 7px;
}
.mf-gp-preview-head .mf-gp-preview-title { margin: 0; }
.mf-gp-preview-actions,
.mf-gp-result-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.mf-gp-edit-badge,
.mf-gp-final-edit-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 5px 8px;
    border: 1px solid #d7a72f;
    border-radius: 999px;
    color: #7a5200;
    background: #fff7dc;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}
.mf-gp-edit-badge svg,
.mf-gp-final-edit-status svg { width: 13px; height: 13px; }
.mf-gp-final-edit-status { margin-top: 6px; }
.mf-gp-preview-reset {
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid var(--mf-border);
    border-radius: 8px;
    color: #52657a;
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 10.5px;
    font-weight: 750;
}
.mf-gp-preview-reset:hover { color: var(--mf-primary); border-color: #b9cddd; background: #f8fbfd; }
.mf-gp-preview[contenteditable="true"],
#mf-gp-result-text[contenteditable="true"] {
    cursor: text;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.mf-gp-preview[contenteditable="true"]:focus,
#mf-gp-result-text[contenteditable="true"]:focus {
    border-color: #78a9c6;
    box-shadow: 0 0 0 3px rgba(18,55,99,.08);
    background: #fff;
}
.mf-gp-preview.mf-gp-user-edited,
#mf-gp-result-text.mf-gp-user-edited {
    border-color: #d7a72f;
    border-left-color: #b77b00;
    box-shadow: inset 0 0 0 1px rgba(215,167,47,.08);
    background: #fffdf6;
}
.mf-gp-result-head-actions .mf-gp-btn { white-space: nowrap; }

/* Cards finais: reforço de contraste */
.mf-gp-footer-grid > div {
    border-color: rgba(132,199,221,.14);
    background: linear-gradient(145deg,rgba(14,48,79,.92),rgba(8,31,55,.94));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.mf-gp-footer-grid > div > svg {
    width: 52px;
    height: 52px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    color: #a4edf0;
    background: #123a5f;
}
.mf-gp-footer-grid strong { color: #fff; }
.mf-gp-footer-grid span { color: rgba(255,255,255,.70); }

@media (max-width: 900px) {
    .mf-gp-intro { width: 100%; min-height: 720px; aspect-ratio: auto; }
}

@media (max-width: 620px) {
    .mf-gp-intro {
        min-height: 760px;
        padding: 26px 16px;
        border-radius: 18px;
    }
    .mf-gp-intro-head { margin-bottom: 22px; }
    .mf-gp-intro-head h2 { font-size: 27px; }
    .mf-gp-intro-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
    .mf-gp-intro-card { min-height: 165px; padding: 14px; display: block; }
    .mf-gp-intro-card .mf-gp-step { margin-bottom: 11px; }
    .mf-gp-preview-head { align-items: flex-start; flex-direction: column; }
    .mf-gp-preview-actions { width: 100%; justify-content: flex-start; }
    .mf-gp-result-head-actions { width: 100%; justify-content: stretch; }
    .mf-gp-result-head-actions .mf-gp-btn,
    .mf-gp-result-head-actions .mf-gp-preview-reset { flex: 1; }
}


/* ==========================================================
   AJUSTES PONTUAIS — revisão modular 4
   ========================================================== */

/* Sinais de alarme: vermelho com texto branco, revisado em verde com texto branco */
.mf-gp-alarm-card {
    border-color: #efc0c4;
    background: linear-gradient(180deg,#fffafb,#fff6f7);
}
.mf-gp-section-icon.alarm {
    color: #fff;
    background: linear-gradient(145deg,#cf4758,#9f2437);
    border-color: rgba(255,255,255,.06);
}
.mf-gp-safety-status.pending {
    color: #fff;
    border-color: #c24a58;
    background: linear-gradient(135deg,#d14d5d,#9f2437);
}
.mf-gp-safety-status.ok {
    color: #fff;
    border-color: #2f8b59;
    background: linear-gradient(135deg,#2f8b59,#1d5d3b);
}
.mf-gp-safety-status.pending small,
.mf-gp-safety-status.ok small,
.mf-gp-safety-status.pending strong,
.mf-gp-safety-status.ok strong,
.mf-gp-safety-status.pending svg,
.mf-gp-safety-status.ok svg { color: #fff; }
.mf-gp-safety-track { background: rgba(255,255,255,.22); }
.mf-gp-safety-track > i { background: rgba(255,255,255,.96); }

/* Conduta: informativo bem alinhado e com contraste correto */
.mf-gp-conduta-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    color: #fff;
    border-color: #214d73;
    background: linear-gradient(135deg,#123763,#0c2b4b);
}
.mf-gp-conduta-info > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.mf-gp-conduta-info-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #e7feff;
    background: linear-gradient(145deg,#0f6a7d,#0b4f61);
    border: 1px solid rgba(255,255,255,.10);
    align-self: center;
}
.mf-gp-conduta-info strong {
    margin: 0 0 4px;
    color: #fff;
    line-height: 1.25;
}
.mf-gp-conduta-info span {
    color: rgba(255,255,255,.78);
    line-height: 1.5;
}

/* Conduta: impedir que um card aberto estique o outro */
.mf-gp-conduta-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}
.mf-gp-conduta-card {
    flex: 0 0 calc(50% - 5px);
    align-self: flex-start;
    height: auto;
}
.mf-gp-conduta-card > label {
    min-height: 74px;
}
.mf-gp-conduta-card > label strong {
    line-height: 1.25;
}
.mf-gp-conduta-card > label span {
    min-width: 0;
}

/* Anamnese: distribuição mais organizada e compacta */
.mf-gp-form-grid {
    align-items: start;
    gap: 12px 14px;
}
.mf-gp-form-grid > .mf-gp-field:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}
.mf-gp-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.mf-gp-field label {
    line-height: 1.35;
    margin-bottom: 7px;
}
.mf-gp-field-help {
    margin: -1px 0 7px;
    line-height: 1.35;
}
.mf-gp-duration {
    grid-template-columns: minmax(130px, .75fr) minmax(110px, 1.25fr);
}
.mf-gp-choice-row {
    align-items: flex-start;
}
.mf-gp-section-card {
    overflow: hidden;
}

/* Mobile */
@media (max-width: 620px) {
    .mf-gp-conduta-card {
        flex-basis: 100%;
    }
    .mf-gp-form-grid > .mf-gp-field:last-child:nth-child(odd) {
        grid-column: auto;
    }
}

/* ==========================================================
   PERFIL DE CONDUTA — revisão modular 5
   ========================================================== */
.mf-gp-conduta-disposition {
    margin-bottom: 14px;
    padding: 15px;
    border: 1px solid #d6e2ec;
    border-radius: 13px;
    background: #fbfdff;
}
.mf-gp-conduta-disposition-head {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 12px;
}
.mf-gp-conduta-disposition-head > div { min-width: 0; }
.mf-gp-conduta-disposition-head strong,
.mf-gp-conduta-disposition-head span { display: block; }
.mf-gp-conduta-disposition-head strong { color: #20374e; font-size: 13px; }
.mf-gp-conduta-disposition-head span { margin-top: 2px; color: #66788b; font-size: 11.5px; line-height: 1.45; }
.mf-gp-disposition-options {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 9px;
}
.mf-gp-disposition-card {
    min-height: 76px;
    padding: 12px 13px;
    border: 1px solid #d6e2ec;
    border-radius: 11px;
    text-align: left;
    color: #334155;
    background: #fff;
    cursor: pointer;
    font: inherit;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.mf-gp-disposition-card:hover {
    border-color: #a7c5d8;
    background: #f8fbfd;
}
.mf-gp-disposition-card.selected {
    color: #fff;
    border-color: #123763;
    background: linear-gradient(135deg,#123763,#0c2b4b);
    box-shadow: 0 8px 18px rgba(18,55,99,.12);
}
.mf-gp-disposition-card strong,
.mf-gp-disposition-card span { display: block; }
.mf-gp-disposition-card strong { font-size: 12.5px; }
.mf-gp-disposition-card span { margin-top: 4px; color: #66788b; font-size: 10.8px; line-height: 1.42; }
.mf-gp-disposition-card.selected span { color: rgba(255,255,255,.74); }
@media (max-width:620px) {
    .mf-gp-disposition-options { grid-template-columns: 1fr; }
}

/* Temperatura com unidade fixa */
.mf-gp-input-suffix {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: stretch;
}
.mf-gp-input-suffix .mf-gp-input {
    border-radius: 9px 0 0 9px;
    border-right: 0;
}
.mf-gp-input-suffix > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 0 11px;
    border: 1px solid var(--mf-border);
    border-radius: 0 9px 9px 0;
    color: #475569;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 800;
}
.mf-gp-input-suffix:focus-within .mf-gp-input,
.mf-gp-input-suffix:focus-within > span {
    border-color: #7db8d9;
}

/* ==========================================================
   REVISÃO MODULAR 6 — ajustes do uso real no plantão
   ========================================================== */

/* ---------- Hero: área de busca e filtros em branco ---------- */
.mf-gp-browser {
    border: 1px solid rgba(255,255,255,.65);
    background: #fff;
    backdrop-filter: none;
    box-shadow: 0 18px 40px rgba(3,17,31,.28);
}
.mf-gp-search > svg { color: #5b708a; }
.mf-gp-search input,
.mf-gp-search input:focus,
.mf-gp-search input:active {
    color: var(--mf-text) !important;
    -webkit-text-fill-color: var(--mf-text) !important;
    caret-color: var(--mf-primary);
    border-color: #d3dee9 !important;
    background-color: #f7fafc !important;
}
.mf-gp-search input::placeholder { color: #8394a8; -webkit-text-fill-color: #8394a8; }
.mf-gp-search input:focus { border-color: #7fb0cf !important; background-color: #fff !important; box-shadow: 0 0 0 4px rgba(18,55,99,.08); }
.mf-gp-search input:-webkit-autofill,
.mf-gp-search input:-webkit-autofill:hover,
.mf-gp-search input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--mf-text) !important;
    -webkit-box-shadow: 0 0 0 1000px #f7fafc inset !important;
    box-shadow: 0 0 0 1000px #f7fafc inset !important;
}
.mf-gp-search-clear { color: #52657a; background: #eaf0f5; }
.mf-gp-search-clear:hover { background: #dde6ee; }

.mf-gp-filter-toggle {
    color: var(--mf-primary);
    border-color: #d3dee9;
    background: #fff;
    white-space: nowrap;
}
.mf-gp-filter-toggle:hover { color: var(--mf-primary); background: #f3f7fa; border-color: #bccddd; }
.mf-gp-filter-toggle.active { color: #fff; background: var(--mf-primary); border-color: var(--mf-primary); }
.mf-gp-myrx-toggle { color: #0b6a78; border-color: #b7dfe3; background: #effafb; }
.mf-gp-myrx-toggle:hover { color: #075663; background: #e2f5f7; border-color: #97d0d6; }
.mf-gp-count { color: #64748b; }

.mf-gp-filter-panel { border-color: #e1e9f0; background: #f7fafc; }
.mf-gp-filter-label { color: #64748b; }
.mf-gp-filter-chip { color: #334155; border-color: #d3dee9; background: #fff; }
.mf-gp-filter-chip small { color: #52657a; background: #eef3f7; }
.mf-gp-filter-chip:hover { border-color: #b7c9d9; background: #f8fbfd; }
.mf-gp-filter-chip.active { color: #fff; background: var(--mf-primary); border-color: var(--mf-primary); }
.mf-gp-filter-chip.active small { color: var(--mf-primary); background: #fff; }

.mf-gp-disease-card { color: var(--mf-text); border-color: #dce5ee; background: #f8fbfd; }
.mf-gp-disease-card:hover { color: var(--mf-primary); background: #eef5fa; border-color: #b9cfe0; }
.mf-gp-disease-card small { color: #64748b; }
.mf-gp-disease-card svg { color: var(--mf-primary-2); }
.mf-gp-browser .mf-gp-empty,
.mf-gp-browser .mf-gp-loading { color: #52657a; border-color: #d3dee9; background: #f8fbfd; }
.mf-gp-browser .mf-gp-loading span { border-color: #d3dee9; border-top-color: var(--mf-primary); }
.mf-gp-browser .mf-gp-error { color: #9f2437; border-color: #efc0c4; background: #fff6f7; }

/* ---------- Anamnese: Nega/Presente com cores intensas ---------- */
.mf-gp-state-btn { min-width: 64px; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.mf-gp-state-btn.negative.selected {
    color: #fff;
    border-color: #1d5d3b;
    background: linear-gradient(135deg,#2f8b59,#1d5d3b);
    box-shadow: 0 3px 8px rgba(29,93,59,.22);
}
.mf-gp-state-btn.positive.selected {
    color: #fff;
    border-color: #9f2437;
    background: linear-gradient(135deg,#d14d5d,#9f2437);
    box-shadow: 0 3px 8px rgba(159,36,55,.22);
}
.mf-gp-state-btn.selected:hover { color: #fff; }
.mf-gp-state-row[data-state="nega"] { border-color: #7cc49a; background: #f1fbf5; }
.mf-gp-state-row[data-state="presente"] { border-color: #e7959f; background: #fff3f4; }
.mf-gp-state-label { display: flex; flex-direction: column; gap: 3px; }
.mf-gp-sign-tag {
    width: fit-content;
    padding: 1px 6px;
    border: 1px solid #c9d8e6;
    border-radius: 999px;
    color: #36536c;
    background: #eef4f9;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* ---------- Outros sinais específicos ---------- */
.mf-gp-context-signs {
    margin-top: 14px;
    padding: 13px;
    border: 1px dashed #d6b8bd;
    border-radius: 12px;
    background: #fff;
}
.mf-gp-context-head { margin-bottom: 10px; }
.mf-gp-context-head strong, .mf-gp-context-head span { display: block; }
.mf-gp-context-head strong { color: #7a2433; font-size: 12.5px; }
.mf-gp-context-head span { margin-top: 2px; color: var(--mf-muted); font-size: 11px; line-height: 1.45; }

/* ---------- Outras condições associadas ---------- */
.mf-gp-assoc-card { overflow: visible; }
.mf-gp-assoc-tools { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 10px; }
.mf-gp-assoc-search { position: relative; }
.mf-gp-assoc-search > svg { position: absolute; left: 12px; top: 13px; width: 17px; height: 17px; color: #6b7f95; pointer-events: none; }
.mf-gp-assoc-search .mf-gp-input { padding-left: 38px; }
.mf-gp-assoc-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow: auto;
    padding: 5px;
    border: 1px solid #d3dee9;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(18,55,99,.14);
}
.mf-gp-assoc-option {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    color: var(--mf-text);
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.mf-gp-assoc-option:hover, .mf-gp-assoc-option:focus { background: #eef5fa; outline: none; }
.mf-gp-assoc-option strong, .mf-gp-assoc-option small { display: block; }
.mf-gp-assoc-option strong { font-size: 12.5px; }
.mf-gp-assoc-option small { margin-top: 2px; color: var(--mf-muted); font-size: 10.8px; line-height: 1.4; }
.mf-gp-assoc-empty { padding: 10px; color: var(--mf-muted); font-size: 11.5px; }
.mf-gp-assoc-manual { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.mf-gp-assoc-manual .mf-gp-btn { min-height: 43px; }
.mf-gp-assoc-list { display: grid; gap: 8px; margin-top: 12px; }
.mf-gp-assoc-item { padding: 10px; border: 1px solid #d6e2ec; border-radius: 10px; background: #f8fbfd; }
.mf-gp-assoc-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.mf-gp-assoc-item-head strong { color: var(--mf-primary); font-size: 12px; }
.mf-gp-assoc-text { min-height: 58px; font-size: 12.5px; background: #fff; }
.mf-gp-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid #e3c4c8;
    border-radius: 8px;
    color: #9f2437;
    background: #fff;
    cursor: pointer;
}
.mf-gp-icon-btn:hover { background: #fff3f4; }
.mf-gp-icon-btn svg { width: 15px; height: 15px; }

/* ---------- Conduta: exames ---------- */
.mf-gp-exam-picker { margin-top: 10px; }
.mf-gp-exam-picker .mf-gp-multi-choice { gap: 5px; }
.mf-gp-multi-option.suggested:not(.selected) { border-color: #9fd3d8; background: #f1fbfc; color: #0b6a78; }
.mf-gp-multi-option.selected { color: #fff; border-color: var(--mf-primary); background: var(--mf-primary); }
.mf-gp-exam-picker + .mf-gp-input { margin-top: 8px; }

/* ---------- Resultado: blocos independentes ---------- */
.mf-gp-result-sub { margin: 4px 0 0; color: var(--mf-muted); font-size: 12px; }
.mf-gp-result-head-actions .mf-gp-preview-reset { min-height: 42px; display: inline-flex; align-items: center; gap: 6px; }
.mf-gp-preview-reset svg { width: 13px; height: 13px; }
.mf-gp-preview-reset { display: inline-flex; align-items: center; gap: 5px; }
.mf-gp-final-blocks { display: grid; gap: 11px; }
.mf-gp-final-block { border: 1px solid var(--mf-border); border-radius: 12px; background: #fff; overflow: hidden; }
.mf-gp-final-block > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--mf-border);
    background: var(--mf-soft);
}
.mf-gp-final-block > header strong { color: var(--mf-primary); font-size: 12.5px; letter-spacing: .02em; text-transform: uppercase; }
.mf-gp-final-block-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.mf-gp-result .mf-gp-final-block pre {
    max-height: 380px;
    border: 0;
    border-left: 4px solid #90b7d2;
    border-radius: 0;
    background: #fff;
    outline: none;
}
.mf-gp-result .mf-gp-final-block pre:focus { background: #fbfdff; box-shadow: inset 0 0 0 2px rgba(18,55,99,.10); }
.mf-gp-result .mf-gp-final-block pre.mf-gp-user-edited { border-left-color: #b77b00; background: #fffdf6; }
.mf-gp-copy-part {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--mf-primary);
    border-radius: 8px;
    color: #fff;
    background: var(--mf-primary);
    cursor: pointer;
    font: inherit;
    font-size: 10.8px;
    font-weight: 800;
}
.mf-gp-copy-part:hover { background: #183f6d; }
.mf-gp-copy-part svg { width: 13px; height: 13px; }
.mf-gp-copy-part.copied, .mf-gp-btn.copied { background: #1d5d3b; border-color: #1d5d3b; color: #fff; }

/* ---------- Sugestão de prescrição ---------- */
.mf-gp-rx {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #b7dfe3;
    border-radius: 14px;
    background: linear-gradient(180deg,#f5fcfd,#fff 120px);
}
.mf-gp-rx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.mf-gp-rx-title { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.mf-gp-rx-title .mf-gp-section-icon { background: linear-gradient(145deg,#0f7f8c,#0b5a66); }
.mf-gp-rx-title span:not(.mf-gp-section-icon) { display: block; color: #0b6a78; font-size: 10.5px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.mf-gp-rx-title h3 { margin: 1px 0 2px; color: var(--mf-text); font-size: 17px; line-height: 1.25; }
.mf-gp-rx-title p { margin: 0; color: var(--mf-muted); font-size: 11.5px; line-height: 1.45; }
.mf-gp-rx-actions { display: flex; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.mf-gp-rx-actions .mf-gp-btn-small { min-height: 38px; }
.mf-gp-rx-source { display: flex; flex-direction: column; gap: 3px; }
.mf-gp-rx-source span { color: #52657a; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.mf-gp-rx-source .mf-gp-select { min-height: 38px; max-width: 260px; padding: 6px 9px; font-size: 12px; }
.mf-gp-rx-text {
    margin: 0;
    max-height: 520px;
    overflow: auto;
    white-space: pre-wrap;
    padding: 15px 16px;
    border: 1px solid #cfe5e8;
    border-left: 4px solid #0f7f8c;
    border-radius: 10px;
    color: #1f3346;
    background: #fff;
    outline: none;
    font: 12.2px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.mf-gp-rx-text:focus { box-shadow: 0 0 0 3px rgba(15,127,140,.12); }
.mf-gp-rx-text.mf-gp-user-edited { border-left-color: #b77b00; background: #fffdf6; }
.mf-gp-rx-empty { padding: 14px; border: 1px dashed #b7dfe3; border-radius: 10px; color: #36536c; background: #fff; font-size: 12px; }
.mf-gp-rx-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; color: #52657a; font-size: 11px; }
.mf-gp-rx-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.mf-gp-rx-foot svg { width: 15px; height: 15px; flex: 0 0 auto; color: #0b6a78; }
.mf-gp-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 2px;
    border: 0;
    color: #0b6a78;
    background: none;
    cursor: pointer;
    font: inherit;
    font-size: 11.5px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.mf-gp-link-btn svg { width: 14px; height: 14px; }

.mf-gp-rx-optionals { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.mf-gp-rx-optionals > span { color: #52657a; font-size: 11px; font-weight: 800; }
.mf-gp-rx-optional {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid #d3dee9;
    border-radius: 999px;
    color: #334155;
    background: #fff;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 700;
}
.mf-gp-rx-optional input { width: 15px; height: 15px; margin: 0; accent-color: #9f2437; }
.mf-gp-rx-optional.selected { color: #7a1d2b; border-color: #e7959f; background: #fff3f4; }

.mf-gp-rx-table-wrap { overflow-x: auto; border: 1px solid #d6e2ec; border-radius: 11px; background: #fff; }
.mf-gp-rx-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 11.8px; }
.mf-gp-rx-table thead th {
    position: sticky;
    top: 0;
    padding: 9px 10px;
    border-bottom: 1px solid #d6e2ec;
    color: #fff;
    background: var(--mf-primary);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}
.mf-gp-rx-table thead th:first-child { width: 38px; text-align: center; }
.mf-gp-rx-table tr.mf-gp-rx-cat th {
    padding: 7px 10px;
    border-top: 1px solid #d6e2ec;
    color: #0b5a66;
    background: #e8f6f7;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .05em;
    text-align: left;
    text-transform: uppercase;
}
.mf-gp-rx-table td {
    padding: 8px 10px;
    border-top: 1px solid #eef2f6;
    color: #26384b;
    vertical-align: top;
    line-height: 1.5;
    outline: none;
}
.mf-gp-rx-table td[contenteditable="true"]:focus { background: #fffdf2; box-shadow: inset 0 0 0 2px #f3d98b; }
.mf-gp-rx-table td[data-col="farmaco"] { width: 22%; font-weight: 750; color: var(--mf-text); }
.mf-gp-rx-table td[data-col="tempo"] { width: 14%; }
.mf-gp-rx-table td[data-col="posologia"] { width: 34%; }
.mf-gp-rx-table td[data-col="obs"] { color: #52657a; font-size: 11.2px; }
.mf-gp-rx-num { text-align: center; color: #6b7f95; font-weight: 800; }
.mf-gp-rx-via {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    color: #fff;
    background: #0f7f8c;
    font-size: 9.5px;
    font-weight: 850;
    vertical-align: 1px;
    user-select: none;
}
.mf-gp-rx-table.mf-gp-user-edited { box-shadow: inset 4px 0 0 #b77b00; }

/* ---------- Botões auxiliares ---------- */
.mf-gp-btn-danger { color: #fff; background: #9f2437; border-color: #9f2437; }
.mf-gp-btn-danger:hover { background: #86192b; border-color: #86192b; }
.mf-gp-danger-text { color: #9f2437; }
.mf-gp-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.mf-gp-btn svg { width: 15px; height: 15px; }

/* ---------- Popup: Minhas Prescrições ---------- */
html.mf-gp-modal-open { overflow: hidden; }
.mf-gp-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 18px; }
.mf-gp-modal-backdrop { position: absolute; inset: 0; background: rgba(6,19,35,.62); backdrop-filter: blur(3px); }
.mf-gp-modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(100%, 1020px);
    height: min(100%, 720px);
    overflow: hidden;
    border-radius: 18px;
    color: var(--mf-text);
    background: #fff;
    box-shadow: 0 30px 70px rgba(3,17,31,.35);
    animation: mffade .18s ease;
}
.mf-gp-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 16px;
    color: #fff;
    background:
        radial-gradient(420px 200px at 100% 0%, rgba(15,158,168,.30), transparent 62%),
        linear-gradient(135deg,#123763,#0b2743);
}
.mf-gp-modal-title { display: flex; align-items: flex-start; gap: 12px; }
.mf-gp-modal-title .mf-gp-section-icon { width: 38px; height: 38px; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); }
.mf-gp-modal-title h2 { margin: 0; color: #fff; font-size: 20px; line-height: 1.2; }
.mf-gp-modal-title p { max-width: 640px; margin: 4px 0 0; color: rgba(255,255,255,.76); font-size: 12px; line-height: 1.5; }
.mf-gp-modal-close {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 10px;
    color: #fff;
    background: rgba(255,255,255,.08);
    cursor: pointer;
}
.mf-gp-modal-close:hover { background: rgba(255,255,255,.16); }
.mf-gp-modal-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0,1fr); }
.mf-gp-modal-foot { padding: 9px 20px; border-top: 1px solid var(--mf-border); color: #52657a; background: var(--mf-soft); font-size: 11px; }
.mf-gp-modal-foot span { display: inline-flex; align-items: center; gap: 6px; }
.mf-gp-modal-foot svg { width: 15px; height: 15px; color: #0b6a78; }
.mf-gp-modal-foot .is-error { color: #9f2437; }
.mf-gp-modal-foot .is-error svg { color: #9f2437; }

.mf-gp-myrx-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--mf-border); background: #f8fbfd; }
.mf-gp-myrx-search { position: relative; display: block; padding: 12px; border-bottom: 1px solid var(--mf-border); }
.mf-gp-myrx-search svg { position: absolute; left: 24px; top: 25px; width: 16px; height: 16px; color: #6b7f95; pointer-events: none; }
.mf-gp-myrx-search .mf-gp-input { padding-left: 36px; }
.mf-gp-myrx-folders { flex: 1; overflow: auto; padding: 8px; }
.mf-gp-myrx-folder + .mf-gp-myrx-folder { margin-top: 3px; }
.mf-gp-myrx-folder-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-height: 38px;
    padding: 6px 8px;
    border: 0;
    border-radius: 9px;
    color: #20374e;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    text-align: left;
}
.mf-gp-myrx-folder-toggle:hover { background: #edf3f8; }
.mf-gp-myrx-folder-toggle svg { width: 15px; height: 15px; flex: 0 0 auto; color: #6b7f95; }
.mf-gp-myrx-folder-toggle svg:first-child { transition: transform .15s ease; }
.mf-gp-myrx-folder.open .mf-gp-myrx-folder-toggle svg:first-child { transform: rotate(90deg); }
.mf-gp-myrx-folder-toggle svg:nth-child(2) { color: #d19a1f; }
.mf-gp-myrx-folder-toggle span { flex: 1; min-width: 0; }
.mf-gp-myrx-folder-toggle small { color: #6b7f95; font-size: 10px; font-weight: 700; }
.mf-gp-myrx-diseases { display: grid; gap: 2px; padding: 2px 0 6px 30px; }
.mf-gp-myrx-disease {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #334155;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    text-align: left;
}
.mf-gp-myrx-disease:hover { background: #fff; border-color: #d6e2ec; }
.mf-gp-myrx-disease.active { color: #fff; background: var(--mf-primary); border-color: var(--mf-primary); }
.mf-gp-myrx-disease small { flex: 0 0 auto; padding: 1px 6px; border-radius: 999px; color: #52657a; background: #e8eff5; font-size: 10px; font-weight: 800; }
.mf-gp-myrx-disease small.has-active { color: #fff; background: #0f7f8c; }
.mf-gp-myrx-disease.active small { color: var(--mf-primary); background: #fff; }

.mf-gp-myrx-detail { min-height: 0; overflow: auto; padding: 18px 20px; }
.mf-gp-myrx-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 100%; padding: 30px; text-align: center; color: #52657a; }
.mf-gp-myrx-placeholder strong { color: var(--mf-text); font-size: 15px; }
.mf-gp-myrx-placeholder p { max-width: 420px; margin: 0; font-size: 12.5px; line-height: 1.55; }
.mf-gp-myrx-placeholder small { color: #0b6a78; font-weight: 800; }
.mf-gp-myrx-detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mf-gp-myrx-detail-head > div { flex: 1; min-width: 0; }
.mf-gp-myrx-detail-head span { color: var(--mf-primary-2); font-size: 10.5px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.mf-gp-myrx-detail-head h3 { margin: 1px 0 0; font-size: 18px; line-height: 1.25; }
.mf-gp-myrx-count { padding: 4px 9px; border-radius: 999px; color: var(--mf-primary); background: #eaf2f8; font-size: 11px; font-weight: 800; white-space: nowrap; }
.mf-gp-myrx-back { display: none; place-items: center; width: 34px; height: 34px; border: 1px solid var(--mf-border); border-radius: 9px; color: var(--mf-primary); background: #fff; cursor: pointer; }

.mf-gp-myrx-choice { margin: 0 0 14px; padding: 12px; border: 1px solid #b7dfe3; border-radius: 12px; background: #f5fcfd; }
.mf-gp-myrx-choice legend { padding: 0 5px; color: #0b5a66; font-size: 12px; font-weight: 850; }
.mf-gp-myrx-choice legend em { color: #52657a; font-style: normal; font-weight: 600; }
.mf-gp-myrx-choice { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.mf-gp-myrx-radio {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 7px 10px;
    border: 1px solid #d6e2ec;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
}
.mf-gp-myrx-radio input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: #0f7f8c; }
.mf-gp-myrx-radio strong, .mf-gp-myrx-radio small { display: block; }
.mf-gp-myrx-radio strong { font-size: 12px; line-height: 1.3; }
.mf-gp-myrx-radio small { color: var(--mf-muted); font-size: 10.5px; }
.mf-gp-myrx-radio.selected { border-color: #0f7f8c; background: #e8f6f7; box-shadow: inset 0 0 0 1px #0f7f8c; }

.mf-gp-myrx-list { display: grid; gap: 9px; margin-bottom: 12px; }
.mf-gp-myrx-card { border: 1px solid var(--mf-border); border-radius: 11px; background: #fff; overflow: hidden; }
.mf-gp-myrx-card.active { border-color: #0f7f8c; box-shadow: inset 4px 0 0 #0f7f8c; }
.mf-gp-myrx-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #eef2f6; }
.mf-gp-myrx-card > header strong, .mf-gp-myrx-card > header small { display: block; }
.mf-gp-myrx-card > header strong { font-size: 13px; }
.mf-gp-myrx-card > header small { margin-top: 2px; color: var(--mf-muted); font-size: 10.5px; }
.mf-gp-myrx-card > header small b { color: #0b6a78; }
.mf-gp-myrx-card-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.mf-gp-myrx-confirm { color: #9f2437; font-size: 11px; font-weight: 800; }
.mf-gp-myrx-card pre {
    margin: 0;
    max-height: 140px;
    overflow: auto;
    white-space: pre-wrap;
    padding: 10px 12px;
    color: #334155;
    background: #fbfdff;
    font: 11.2px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.mf-gp-myrx-new { width: 100%; border-style: dashed; }
.mf-gp-myrx-empty-small { padding: 12px; border: 1px dashed var(--mf-border); border-radius: 10px; color: var(--mf-muted); font-size: 12px; text-align: center; }

.mf-gp-myrx-editor { display: grid; gap: 10px; margin-bottom: 12px; padding: 14px; border: 1px solid #9fbfd3; border-radius: 12px; background: #f8fbfd; }
.mf-gp-myrx-editor > strong { color: var(--mf-primary); font-size: 13px; }
.mf-gp-myrx-editor label { display: grid; gap: 5px; color: #334155; font-size: 12px; font-weight: 750; }
.mf-gp-myrx-editor label small { justify-self: end; margin-top: -19px; color: var(--mf-muted); font-size: 10.5px; font-weight: 700; }
.mf-gp-myrx-editor label small.near { color: #9f2437; }
.mf-gp-myrx-editor textarea { min-height: 190px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; }
.mf-gp-myrx-editor-error { padding: 8px 10px; border: 1px solid #efc0c4; border-radius: 8px; color: #9f2437; background: #fff6f7; font-size: 11.5px; }
.mf-gp-myrx-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mf-gp-myrx-editor-actions > div { display: flex; gap: 6px; }

/* ---------- Responsivo ---------- */
@media (max-width: 820px) {
    .mf-gp-assoc-tools { grid-template-columns: 1fr; }
    .mf-gp-rx-head { flex-direction: column; }
    .mf-gp-rx-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 720px) {
    .mf-gp-modal { padding: 0; }
    .mf-gp-modal-panel { width: 100%; height: 100%; border-radius: 0; }
    .mf-gp-modal-head { padding: 14px 14px 12px; }
    .mf-gp-modal-title p { font-size: 11.2px; }
    .mf-gp-modal-body { grid-template-columns: 1fr; }
    .mf-gp-myrx-side { border-right: 0; }
    .mf-gp-myrx-detail { display: none; padding: 14px; }
    .mf-gp-modal.show-detail .mf-gp-myrx-side { display: none; }
    .mf-gp-modal.show-detail .mf-gp-myrx-detail { display: block; }
    .mf-gp-myrx-back { display: inline-grid; }
    .mf-gp-myrx-choice { grid-template-columns: 1fr; }
    .mf-gp-myrx-card > header { flex-direction: column; }
    .mf-gp-myrx-card-actions { justify-content: flex-start; }
}

@media (max-width: 620px) {
    .mf-gp-search-row { grid-template-columns: 1fr 1fr; }
    .mf-gp-search { grid-column: 1 / -1; }
    .mf-gp-filter-toggle { width: 100%; }
    .mf-gp-count { grid-column: 1 / -1; text-align: left; }
    .mf-gp-final-block > header { flex-direction: column; align-items: flex-start; }
    .mf-gp-final-block-actions { justify-content: flex-start; }
    .mf-gp-state-btn { min-width: 0; }
    .mf-gp-rx { padding: 12px; }
    .mf-gp-rx-source, .mf-gp-rx-source .mf-gp-select { width: 100%; max-width: none; }
    .mf-gp-rx-actions > * { flex: 1 1 auto; }
    /* Tabela vira cartões no celular */
    .mf-gp-rx-table-wrap { border: 0; background: transparent; overflow: visible; }
    .mf-gp-rx-table { min-width: 0; }
    .mf-gp-rx-table thead { display: none; }
    .mf-gp-rx-table, .mf-gp-rx-table tbody, .mf-gp-rx-table tr, .mf-gp-rx-table td, .mf-gp-rx-table th { display: block; width: 100% !important; }
    .mf-gp-rx-table tr.mf-gp-rx-cat th { margin-top: 10px; border: 0; border-radius: 8px; }
    .mf-gp-rx-table tr[data-rx-row] { margin-top: 6px; border: 1px solid #d6e2ec; border-radius: 10px; background: #fff; overflow: hidden; }
    .mf-gp-rx-table td { border-top: 1px solid #eef2f6; }
    .mf-gp-rx-table td::before { content: attr(data-label); display: block; margin-bottom: 1px; color: #6b7f95; font-size: 9.5px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
    .mf-gp-rx-table td.mf-gp-rx-num { border-top: 0; text-align: left; background: #f5f8fb; }
}
@media (min-width: 621px) {
    .mf-gp-search-row { grid-template-columns: minmax(0, 1fr) auto auto auto; }
}
.mf-gp-result .mf-gp-rx-text { border: 1px solid #cfe5e8; border-left: 4px solid #0f7f8c; background: #fff; }
.mf-gp-result .mf-gp-rx-text.mf-gp-user-edited { border-left-color: #b77b00; background: #fffdf6; }
@media (max-width: 620px) {
    .mf-gp-rx-table td.mf-gp-rx-num { padding: 5px 10px; font-size: 11px; }
    .mf-gp-rx-table td.mf-gp-rx-num::before { content: "Item "; display: inline; font-size: 11px; letter-spacing: 0; text-transform: none; color: #6b7f95; }
}

/* ==========================================================
   REVISÃO MODULAR 7
   ========================================================== */

/* Filtros por área: todos do mesmo tamanho */
.mf-gp-filter-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 8px;
}
.mf-gp-filter-chip {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    justify-content: space-between;
    border-radius: 10px;
    text-align: left;
}
.mf-gp-filter-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hover/foco com contraste garantido (o tema Astra pinta o texto dos botões de branco no hover) */
[data-mf-prontuario-root] button:focus { outline: none; }
[data-mf-prontuario-root] button:focus-visible { outline: 2px solid #0f9ea8; outline-offset: 2px; }
.mf-gp-filter-chip:hover,
.mf-gp-filter-chip:focus { color: var(--mf-primary); background: #eef5fa; border-color: #b7c9d9; }
.mf-gp-filter-chip.active,
.mf-gp-filter-chip.active:hover,
.mf-gp-filter-chip.active:focus { color: #fff; background: var(--mf-primary); border-color: var(--mf-primary); }
.mf-gp-filter-toggle:focus { color: var(--mf-primary); background: #f3f7fa; }
.mf-gp-filter-toggle.active:focus { color: #fff; background: var(--mf-primary); }
.mf-gp-myrx-toggle:focus { color: #075663; background: #e2f5f7; }
.mf-gp-disease-card:focus { color: var(--mf-primary); background: #eef5fa; }
.mf-gp-btn-secondary:hover, .mf-gp-btn-secondary:focus { color: var(--mf-primary); background: #f3f7fa; }
.mf-gp-btn-ghost:hover, .mf-gp-btn-ghost:focus { color: #334155; background: #eef3f7; }
.mf-gp-btn-safe:hover, .mf-gp-btn-safe:focus { color: var(--mf-success); }
.mf-gp-btn-primary:hover, .mf-gp-btn-primary:focus { color: #fff; }
.mf-gp-danger-text:hover, .mf-gp-danger-text:focus { color: #9f2437; background: #fff3f4; }
.mf-gp-tab:hover, .mf-gp-tab:focus { color: var(--mf-primary); background: rgba(255,255,255,.6); }
.mf-gp-tab.active:hover, .mf-gp-tab.active:focus { background: #fff; }
.mf-gp-choice:hover, .mf-gp-choice:focus { color: #42566d; background: #fafcfd; }
.mf-gp-choice.selected:hover, .mf-gp-choice.selected:focus { color: var(--mf-primary); background: #edf6fb; }
.mf-gp-multi-option:hover, .mf-gp-multi-option:focus { color: #42566d; background: #fafcfd; }
.mf-gp-multi-option.selected:hover, .mf-gp-multi-option.selected:focus { color: #fff; background: var(--mf-primary); }
.mf-gp-state-btn:hover, .mf-gp-state-btn:focus { color: #42566d; background: #fafcfd; }
.mf-gp-disposition-card:hover, .mf-gp-disposition-card:focus { color: #334155; }
.mf-gp-disposition-card.selected:hover, .mf-gp-disposition-card.selected:focus { color: #fff; background: linear-gradient(135deg,#123763,#0c2b4b); }
.mf-gp-exam-head:hover, .mf-gp-exam-head:focus { color: #334155; background: #eef3f7; }
.mf-gp-preview-reset:focus { color: var(--mf-primary); background: #f8fbfd; }
.mf-gp-copy-part:hover, .mf-gp-copy-part:focus { color: #fff; }
.mf-gp-assoc-option:hover, .mf-gp-assoc-option:focus { color: var(--mf-text); }
.mf-gp-myrx-folder-toggle:hover, .mf-gp-myrx-folder-toggle:focus { color: #20374e; background: #edf3f8; }
.mf-gp-myrx-disease:hover, .mf-gp-myrx-disease:focus { color: #334155; background: #fff; }
.mf-gp-myrx-disease.active:hover, .mf-gp-myrx-disease.active:focus { color: #fff; background: var(--mf-primary); }
.mf-gp-search-clear:hover, .mf-gp-search-clear:focus { color: #334155; }

/* Ícones centralizados nos botões de fechar/apagar/voltar */
.mf-gp-modal-close,
.mf-gp-icon-btn,
.mf-gp-myrx-back,
.mf-gp-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
.mf-gp-modal-close svg,
.mf-gp-icon-btn svg,
.mf-gp-myrx-back svg { display: block; flex: 0 0 auto; margin: 0; }
.mf-gp-modal-close svg { width: 18px; height: 18px; }
.mf-gp-modal-close:hover, .mf-gp-modal-close:focus { color: #fff; background: rgba(255,255,255,.18); }
.mf-gp-icon-btn:hover, .mf-gp-icon-btn:focus { color: #9f2437; background: #fff3f4; border-color: #d99aa3; }
.mf-gp-myrx-back:hover, .mf-gp-myrx-back:focus { color: var(--mf-primary); background: #f3f7fa; }
@media (max-width: 720px) { .mf-gp-myrx-back { display: inline-flex; } }
.mf-gp-btn svg { display: block; flex: 0 0 auto; }

/* Botão "Gerenciar Minhas Prescrições" */
.mf-gp-link-btn {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #9fd3d8;
    border-radius: 9px;
    color: #075663;
    background: #e2f5f7;
    text-decoration: none;
    gap: 7px;
}
.mf-gp-link-btn:hover,
.mf-gp-link-btn:focus { color: #fff; background: #0f7f8c; border-color: #0f7f8c; }
.mf-gp-myrx-editor-actions .mf-gp-link-btn { min-height: 32px; padding: 0 11px; }

/* "Como utilizar" em tons claros (hero e rodapé permanecem escuros) */
.mf-gp-intro {
    color: var(--mf-text);
    border: 1px solid var(--mf-border);
    background:
        radial-gradient(520px 320px at 100% 0%, rgba(15,158,168,.09), transparent 64%),
        radial-gradient(420px 300px at 0% 100%, rgba(18,55,99,.06), transparent 68%),
        #fff;
    box-shadow: var(--mf-shadow);
}
.mf-gp-intro::after { border-color: rgba(18,55,99,.06); box-shadow: 0 0 0 55px rgba(18,55,99,.018), 0 0 0 110px rgba(18,55,99,.012); }
.mf-gp-intro-head > span { color: var(--mf-primary-2); }
.mf-gp-intro-head h2 { color: var(--mf-text); }
.mf-gp-intro-head p { color: var(--mf-muted); }
.mf-gp-intro-card {
    color: var(--mf-text);
    border: 1px solid #dce7f0;
    background: #f7fafc;
    box-shadow: none;
}
.mf-gp-intro-card strong { color: var(--mf-text); }
.mf-gp-intro-card p { color: #5b6b7e; }
.mf-gp-step {
    color: #fff;
    border: 0;
    background: linear-gradient(145deg,#16436e,#0d2d4f);
    box-shadow: 0 6px 14px rgba(18,55,99,.14);
}

/* Materiais de apoio na conduta */
.mf-gp-conduta-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: -4px 0 14px;
    padding: 11px 13px;
    border: 1px solid #b7dfe3;
    border-radius: 11px;
    background: #f5fcfd;
}
.mf-gp-conduta-links > strong { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; color: #0b5a66; font-size: 12px; }
.mf-gp-conduta-links > strong svg { width: 15px; height: 15px; }
.mf-gp-conduta-links a {
    display: inline-flex;
    flex-direction: column;
    padding: 7px 11px;
    border: 1px solid #9fd3d8;
    border-radius: 9px;
    color: #075663;
    background: #fff;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}
.mf-gp-conduta-links a small { color: #52657a; font-size: 10.5px; font-weight: 600; }
.mf-gp-conduta-links a:hover { border-color: #0f7f8c; background: #e8f6f7; color: #075663; }

@media (max-width: 620px) {
    .mf-gp-filter-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
    .mf-gp-filter-chip { flex: initial; }
    .mf-gp-rx-foot { flex-direction: column; align-items: stretch; }
    .mf-gp-link-btn { justify-content: center; }
}
.mf-gp-filter-chips { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.mf-gp-filter-chip { font-size: 12px; padding: 7px 8px 7px 11px; }
@media (max-width: 620px) { .mf-gp-filter-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Apoio à classificação (auxiliar, não bloqueia) */
.mf-gp-assist { margin: 14px 0; padding: 14px 16px; border: 1px solid #b7dde2; border-radius: 14px; background: linear-gradient(180deg, #f1fafb, #ffffff); }
.mf-gp-assist[hidden] { display: none; }
.mf-gp-assist-head { display: flex; gap: 10px; align-items: flex-start; color: #0b6a78; }
.mf-gp-assist-head > svg { flex: 0 0 auto; margin-top: 2px; }
.mf-gp-assist-head strong { display: block; font-size: 13px; color: #123763; }
.mf-gp-assist-head span { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.5; color: #52657a; }
.mf-gp-assist ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.mf-gp-assist-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #d6e2ec; border-left: 4px solid #0f7f8c; border-radius: 10px; background: #fff; }
.mf-gp-assist-item.matched { border-left-color: #2e8b57; background: #f6fbf8; }
.mf-gp-assist-item strong { display: block; font-size: 12.5px; color: #123763; }
.mf-gp-assist-item small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: #0b6a78; margin-top: 1px; }
.mf-gp-assist-item span { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.5; color: #334155; }
.mf-gp-assist-apply { flex: 0 0 auto; border: 1px solid #0f7f8c; background: #0f7f8c; color: #fff; border-radius: 8px; padding: 7px 11px; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.mf-gp-assist-apply:hover, .mf-gp-assist-apply:focus { background: #0b6a78; border-color: #0b6a78; color: #fff; }
.mf-gp-assist-ok { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; font-size: 11px; font-weight: 700; color: #2e7d4f; white-space: nowrap; }
.mf-gp-assist-ok svg { width: 14px; height: 14px; }
.mf-gp-assist-inline { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 9px; background: #eef8f9; border: 1px dashed #9fd0d6; font-size: 11.5px; line-height: 1.45; color: #334155; }
.mf-gp-assist-inline > svg { flex: 0 0 auto; width: 15px; height: 15px; color: #0b6a78; }
.mf-gp-assist-inline span { flex: 1 1 auto; }
.mf-gp-assist-inline strong { color: #123763; }
.mf-gp-assist-inline.matched { background: #f1f9f4; border-color: #b9dcc6; color: #2e7d4f; }
.mf-gp-assist-inline.matched > svg { color: #2e7d4f; }
.mf-gp-assist-inline .mf-gp-assist-apply { padding: 5px 9px; }
@media (max-width: 620px) {
    .mf-gp-assist-item { flex-direction: column; align-items: stretch; }
    .mf-gp-assist-apply { width: 100%; }
    .mf-gp-assist-inline { flex-wrap: wrap; }
}

/* Exame físico atualizado a partir da anamnese */
.mf-gp-exam-card.mf-gp-exam-auto { border-color: #9fd0d6; box-shadow: 0 0 0 2px rgba(15, 127, 140, .08); }
.mf-gp-exam-card.mf-gp-exam-auto .mf-gp-exam-head small { color: #0b6a78; font-weight: 700; }
.mf-gp-exam-achados { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; padding: 12px 14px; border: 1px solid #9fd0d6; border-radius: 12px; background: #eef8f9; color: #0b6a78; }
.mf-gp-exam-achados[hidden] { display: none; }
.mf-gp-exam-achados > svg { flex: 0 0 auto; margin-top: 2px; }
.mf-gp-exam-achados strong { display: block; font-size: 12.5px; color: #123763; }
.mf-gp-exam-achados span { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.5; color: #334155; }
.mf-gp-exam-achados small { display: block; margin-top: 4px; font-size: 10.5px; color: #52657a; }

/* Sinais vitais na aba do exame físico */
.mf-gp-exam-card.mf-gp-vitals { grid-column: 1 / -1; padding: 14px 16px; background: #fff; }
.mf-gp-vitals-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.mf-gp-vitals-head strong { display: block; font-size: 13.5px; color: #123763; }
.mf-gp-vitals-head small { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.5; color: #52657a; }
.mf-gp-vitals-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.mf-gp-vitals-grid .mf-gp-field { margin: 0; }
@media (max-width: 900px) { .mf-gp-vitals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .mf-gp-vitals-grid { grid-template-columns: 1fr; } }

/* Conflitos entre anamnese e exame físico */
.mf-gp-conflicts { grid-column: 1 / -1; margin: 12px 0; padding: 14px 16px; border: 1px solid #f0c36d; border-radius: 14px; background: #fffbeb; }
.mf-gp-conflicts[hidden] { display: none; }
.mf-gp-conflicts-head { display: flex; gap: 10px; align-items: flex-start; color: #9a6700; }
.mf-gp-conflicts-head > svg { flex: 0 0 auto; margin-top: 2px; }
.mf-gp-conflicts-head strong { display: block; font-size: 13px; color: #7a4f00; }
.mf-gp-conflicts-head span { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.5; color: #6b5a33; }
.mf-gp-conflicts ul, #mf-gp-validation .mf-gp-conflicts-head + ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.mf-gp-conflicts li, #mf-gp-validation .mf-gp-conflicts-head + ul li { padding: 10px 12px; border: 1px solid #f3dca5; border-radius: 10px; background: #fff; font-size: 12px; line-height: 1.5; color: #334155; }
.mf-gp-conflict-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mf-gp-conflict-btn { border: 1px solid #123763; background: #123763; color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.mf-gp-conflict-btn:hover, .mf-gp-conflict-btn:focus { background: #0d2d52; border-color: #0d2d52; color: #fff; }
.mf-gp-conflict-btn.ghost { background: #fff; color: #123763; }
.mf-gp-conflict-btn.ghost:hover, .mf-gp-conflict-btn.ghost:focus { background: #eef4f8; color: #123763; }
@media (max-width: 620px) { .mf-gp-conflict-btn { width: 100%; text-align: left; } }

/* ---------- Bloqueios da geração: local destacado + navegação ---------- */
.mf-gp-needs { position: relative; border-radius: 12px; outline: 2px solid #e8590c; outline-offset: 4px; background: #fff4ec; box-shadow: 0 0 0 8px #fff4ec; }
.mf-gp-state-list-wrap.mf-gp-needs, .mf-gp-conduta-disposition.mf-gp-needs { padding: 6px; }
.mf-gp-needs-badge { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 8px; padding: 7px 10px; border-radius: 8px; background: #e8590c; color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4; }
.mf-gp-needs-badge svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; }
.mf-gp-state-row.mf-gp-needs-row { border-color: #e8590c !important; background: #ffe8d9 !important; box-shadow: inset 4px 0 0 #e8590c; }
.mf-gp-needs-pulse { animation: mfGpNeedsPulse 1.6s ease-out 1; }
@keyframes mfGpNeedsPulse { 0% { box-shadow: 0 0 0 0 rgba(232, 89, 12, .55); } 70% { box-shadow: 0 0 0 14px rgba(232, 89, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(232, 89, 12, 0); } }
.mf-gp-block-list { list-style: none; margin: 8px 0 0 !important; padding: 0; display: grid; gap: 6px; }
.mf-gp-block-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid #f5c9a8; border-left: 4px solid #e8590c; border-radius: 8px; background: #fff; color: #7a3208; }
.mf-gp-block-go { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 6px 12px; background: #e8590c; color: #fff; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.mf-gp-block-go:hover { background: #c94a08; }
.mf-gp-blocknav { position: fixed; left: 50%; bottom: 16px; z-index: 9999; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 9px 10px 9px 14px; border-radius: 999px; background: #7a2e06; color: #fff; font-size: 12.5px; box-shadow: 0 10px 30px rgba(15, 23, 42, .28); }
.mf-gp-blocknav[hidden] { display: none; }
.mf-gp-blocknav svg { width: 16px; height: 16px; flex: 0 0 auto; }
.mf-gp-blocknav.ready { background: #0f766e; }
.mf-gp-blocknav-btn { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 7px 13px; background: #fff; color: #7a2e06; font-size: 12px; font-weight: 700; cursor: pointer; }
.mf-gp-blocknav.ready .mf-gp-blocknav-btn { color: #0f766e; }
.mf-gp-conflict-mark { outline: 2px dashed #d99a00; outline-offset: 3px; border-radius: 10px; }
.mf-gp-state-row.mf-gp-conflict-mark { background: #fff8e1 !important; }
@media (max-width: 620px) {
    .mf-gp-block-list li { flex-direction: column; align-items: stretch; }
    .mf-gp-blocknav { left: 12px; right: 12px; transform: none; border-radius: 14px; font-size: 12px; }
}

/* ---------- Rodada 10 ---------- */
/* Múltipla escolha */
.mf-gp-multi-tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: #eef4ff; color: #2451a6; font-size: 10.5px; font-weight: 700; vertical-align: middle; }
.mf-gp-choice-multi .mf-gp-choice.selected::before { content: "✓ "; font-weight: 800; }
/* Atalhos de preenchimento (ex.: doses) */
.mf-gp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.mf-gp-chips:empty { display: none; }
.mf-gp-chip { border: 1px dashed #9db4d8; border-radius: 999px; padding: 5px 10px; background: #f6f9ff; color: #1f3f73; font-size: 11.5px; font-weight: 600; cursor: pointer; text-align: left; }
.mf-gp-chip:hover { background: #e8f0ff; border-style: solid; }
/* Sintoma específico acrescentado pelo usuário */
.mf-gp-extra-add { display: flex; gap: 8px; margin-top: 10px; }
.mf-gp-extra-add .mf-gp-input { flex: 1 1 auto; min-width: 0; }
.mf-gp-state-row.is-extra { border-style: dashed; }
.mf-gp-extra-remove { width: 28px; height: 28px; border: 1px solid #e3c4c4; border-radius: 8px; background: #fff; color: #b42318; font-size: 16px; line-height: 1; cursor: pointer; }
.mf-gp-extra-remove:hover { background: #fff1f1; }
/* CID e modo somente exame físico */
.mf-gp-cid { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 6px; background: #eef2f7; color: #334155; font-size: 11.5px; font-style: normal; font-weight: 700; }
.mf-gp-workspace-top .mf-gp-selected { margin-left: auto; }
.mf-gp-examonly-switch { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #d6e0ee; border-radius: 10px; background: #fff; cursor: pointer; }
.mf-gp-examonly-switch[hidden] { display: none; }
.mf-gp-examonly-switch input { width: 16px; height: 16px; }
.mf-gp-examonly-switch strong { display: block; font-size: 12.5px; color: #10233f; }
.mf-gp-examonly-switch small { display: block; font-size: 11px; color: #5b6b80; }
.mf-gp-exam-only .mf-gp-tabs { display: none; }
.mf-gp-exam-only .mf-gp-examonly-switch { border-color: #0f766e; background: #effaf8; }
/* Resultado: quadro do prontuário separado da receita */
.mf-gp-record { padding: 16px; border: 2px solid #cfe0f5; border-radius: 16px; background: #fbfdff; }
.mf-gp-rx-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; color: #5b6b80; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.mf-gp-rx-divider::before, .mf-gp-rx-divider::after { content: ""; flex: 1; height: 1px; background: #d6e0ee; }
.mf-gp-rx-divider[hidden] { display: none; }
.mf-gp-rx-notes { display: flex; gap: 10px; margin: 10px 0 0; padding: 10px 12px; border: 1px solid #f0dca8; border-radius: 10px; background: #fffbef; color: #5c4508; font-size: 12px; }
.mf-gp-rx-notes svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; }
.mf-gp-rx-notes strong { display: block; }
.mf-gp-rx-notes span { display: block; font-size: 11px; opacity: .8; }
.mf-gp-rx-notes ul { margin: 6px 0 0 16px; padding: 0; }
@media (max-width: 620px) {
    .mf-gp-examonly-switch { margin-left: 0; width: 100%; }
    .mf-gp-record { padding: 10px; }
}

/* ---------- Rodada 11: contador dentro da busca e paginação ---------- */
.mf-gp-search-row { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.mf-gp-search input { padding-right: 150px; }
.mf-gp-search .mf-gp-count { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); z-index: 3; min-width: 0; padding: 3px 9px; border-radius: 999px; background: #edf2f7; color: #5b6b80; font-size: 11.5px; font-weight: 700; line-height: 1.4; text-align: right; white-space: nowrap; pointer-events: none; }
.mf-gp-search .mf-gp-search-clear:not([hidden]) ~ .mf-gp-count,
.mf-gp-search:has(.mf-gp-search-clear:not([hidden])) .mf-gp-count { right: 54px; }
.mf-gp-search .mf-gp-search-clear { z-index: 4; }
.mf-gp-pagination { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; }
.mf-gp-page-list { display: flex; align-items: center; gap: 5px; }
.mf-gp-page-btn { min-width: 36px; height: 36px; padding: 0 11px; border: 1px solid #dce5ee; border-radius: 9px; background: #fff; color: #1c3553; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.mf-gp-page-btn:hover:not(:disabled):not(.current) { border-color: #9fbcd8; background: #f2f7fc; }
.mf-gp-page-btn.current { border-color: #123763; background: #123763; color: #fff; cursor: default; }
.mf-gp-page-btn:disabled { opacity: .45; cursor: default; }
.mf-gp-page-dots { padding: 0 2px; color: #7a8699; font-weight: 700; }
.mf-gp-page-info { flex-basis: 100%; text-align: center; color: #6b7a8d; font-size: 11.5px; }
@media (max-width: 900px) {
    .mf-gp-search-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mf-gp-search { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
    .mf-gp-search-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mf-gp-search input { padding-right: 118px; }
    .mf-gp-search-row .mf-gp-filter-toggle { min-width: 0; min-height: 46px; padding: 4px 6px; gap: 5px; font-size: 11px; line-height: 1.15; white-space: normal; text-align: center; }
    .mf-gp-search-row .mf-gp-filter-toggle svg { flex: 0 0 auto; width: 14px; height: 14px; }
    .mf-gp-page-btn.arrow { padding: 0 9px; }
}

/* ---------- Rodada 12: receita (serviço x domicílio, controles), botões e observações ---------- */
.mf-gp-rx-head .mf-gp-rx-title { flex: 1 1 auto; }
.mf-gp-rx-actions { flex: 0 0 auto; }
.mf-gp-rx-actions .mf-gp-btn, .mf-gp-rx-actions .mf-gp-preview-reset { white-space: nowrap; }
.mf-gp-rx-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin: 0 0 12px; padding: 10px 12px; border: 1px dashed #b7dfe3; border-radius: 10px; background: #f7fcfd; }
.mf-gp-rx-control-field { display: flex; flex-direction: column; gap: 3px; }
.mf-gp-rx-control-field span { color: #52657a; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.mf-gp-rx-control-field .mf-gp-input, .mf-gp-rx-control-field .mf-gp-select { min-height: 38px; width: 150px; max-width: 100%; padding: 6px 9px; font-size: 12.5px; }
.mf-gp-rx-control-field .mf-gp-select { width: 230px; }
.mf-gp-rx-control.mf-gp-rx-optional { border-radius: 12px; align-items: flex-start; max-width: 100%; }
.mf-gp-rx-control.mf-gp-rx-optional input { margin-top: 2px; flex: 0 0 auto; }
.mf-gp-rx-control.mf-gp-rx-optional span small { display: block; margin-top: 2px; color: #6b7a8d; font-size: 10.5px; font-weight: 600; }
.mf-gp-rx-part { margin: 0 0 12px; padding: 10px; border: 1px solid #f0d9a8; border-radius: 12px; background: #fffaf0; }
.mf-gp-rx-part-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.mf-gp-rx-part-head strong { display: block; color: #1c3553; font-size: 12.5px; }
.mf-gp-rx-part-head span { display: block; color: #6b7a8d; font-size: 11px; }
.mf-gp-rx-part-head .mf-gp-btn { flex: 0 0 auto; white-space: nowrap; }
.mf-gp-rx-part .mf-gp-rx-text { max-height: 360px; }
.mf-gp-rx-part-home { margin-top: 2px; }
.mf-gp-conduta-notes { display: flex; gap: 10px; margin: 10px 0 0; padding: 10px 12px; border: 1px solid #f0dca8; border-radius: 10px; background: #fffbef; color: #5c4508; font-size: 12px; line-height: 1.5; }
.mf-gp-conduta-notes svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; }
.mf-gp-conduta-notes strong { display: block; }
.mf-gp-conduta-notes > div > span { display: block; font-size: 11px; opacity: .8; }
.mf-gp-conduta-notes ul { margin: 5px 0 0; padding-left: 18px; }
.mf-gp-conduta-notes li + li { margin-top: 3px; }
@media (max-width: 620px) {
    .mf-gp-rx-control-field { flex: 1 1 140px; }
    .mf-gp-rx-control-field .mf-gp-input, .mf-gp-rx-control-field .mf-gp-select { width: 100%; }
    .mf-gp-rx-part-head { flex-direction: column; align-items: stretch; }
}

/* ---------- Rodada 13: identificação, cartões recolhíveis do exame, "não sabe", exame bloqueado ---------- */
.mf-gp-extra-remove { display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 0; flex: 0 0 auto; }
.mf-gp-extra-remove svg { display: block; }
.mf-gp-ident-card { background: #fbfcfe; }
.mf-gp-ident-card .mf-gp-form-grid { grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr) minmax(0, 1.6fr); }
@media (max-width: 820px) { .mf-gp-ident-card .mf-gp-form-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .mf-gp-ident-card .mf-gp-form-grid { grid-template-columns: 1fr; } }
.mf-gp-exam-card.mf-gp-fold, .mf-gp-exam-card.mf-gp-vitals.mf-gp-fold { grid-column: auto; padding: 0; background: #fff; }
.mf-gp-exam-card.mf-gp-fold.open { grid-column: 1 / -1; }
.mf-gp-fold-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; }
.mf-gp-fold-text { flex: 1 1 auto; min-width: 0; }
.mf-gp-fold-text strong { display: block; font-size: 13.5px; color: #123763; }
.mf-gp-fold-text small { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: #52657a; }
.mf-gp-fold.has-data .mf-gp-fold-text small { color: #0f5f6b; font-weight: 700; }
.mf-gp-fold-toggle { flex: 0 0 auto; color: #52657a; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.mf-gp-fold-body { padding: 0 14px 14px; }
.mf-gp-imc { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #f2f7fb; color: #52657a; font-size: 12px; }
.mf-gp-imc strong { color: #123763; font-size: 13px; }
.mf-gp-unknown-chip { margin-left: 8px; padding: 2px 9px; border: 1px solid #d3dee9; border-radius: 999px; background: #fff; color: #52657a; font: inherit; font-size: 10.5px; font-weight: 700; cursor: pointer; vertical-align: middle; }
.mf-gp-unknown-chip.selected { border-color: #123763; background: #123763; color: #fff; }
.mf-gp-noexam { display: flex; gap: 10px; grid-column: 1 / -1; padding: 14px 16px; border: 1px solid #f0dca8; border-radius: 12px; background: #fffbef; color: #5c4508; font-size: 12.5px; line-height: 1.5; }
.mf-gp-noexam svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; }
.mf-gp-noexam strong { display: block; font-size: 13.5px; }
@media (max-width: 620px) { .mf-gp-exam-card.mf-gp-fold { grid-column: 1 / -1; } }
@media (min-width: 821px) { .mf-gp-ident-card .mf-gp-form-grid > .mf-gp-field:last-child:nth-child(odd) { grid-column: auto; } }
/* Calculadoras de escala (NIHSS/Glasgow) */
.mf-gp-calc-btn { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 2px 9px; border: 1px solid #b7dfe3; border-radius: 999px; background: #f2fbfc; color: #0b6a78; font: inherit; font-size: 10.5px; font-weight: 800; cursor: pointer; vertical-align: middle; }
.mf-gp-calc-btn svg { width: 12px; height: 12px; }
.mf-gp-calc-btn.done { border-color: #0f766e; background: #0f766e; color: #fff; }
.mf-gp-scale-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 18px; }
.mf-gp-scale-panel { position: relative; display: flex; flex-direction: column; width: min(100%, 760px); max-height: min(100%, 860px); overflow: hidden; border-radius: 16px; background: #fff; color: var(--mf-text); box-shadow: 0 30px 70px rgba(3,17,31,.35); }
.mf-gp-scale-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid #e3eaf2; }
.mf-gp-scale-panel > header strong { display: block; color: #123763; font-size: 15px; }
.mf-gp-scale-panel > header span { display: block; margin-top: 3px; color: #52657a; font-size: 11.5px; line-height: 1.45; }
.mf-gp-scale-x { flex: 0 0 auto; width: 32px; height: 32px; border: 1px solid #dce5ee; border-radius: 8px; background: #fff; color: #52657a; font-size: 18px; line-height: 1; cursor: pointer; }
.mf-gp-scale-body { flex: 1 1 auto; overflow: auto; padding: 12px 18px; }
.mf-gp-scale-item { padding: 9px 0; border-bottom: 1px dashed #e3eaf2; }
.mf-gp-scale-item strong { display: block; margin-bottom: 6px; color: #1c3553; font-size: 12.5px; }
.mf-gp-scale-options { display: flex; flex-wrap: wrap; gap: 6px; }
.mf-gp-scale-options .mf-gp-choice em { margin-left: 4px; padding: 0 5px; border-radius: 6px; background: rgba(18,55,99,.08); font-style: normal; font-size: 10.5px; }
.mf-gp-scale-panel > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid #e3eaf2; background: #f8fbfd; }
.mf-gp-scale-panel > footer > div:last-child { display: flex; gap: 8px; }
.mf-gp-scale-total { min-width: 0; }
.mf-gp-scale-total span { display: block; color: #52657a; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.mf-gp-scale-total strong { color: #123763; font-size: 20px; }
.mf-gp-scale-total small { display: block; color: #52657a; font-size: 11px; line-height: 1.4; }
@media (max-width: 620px) {
    .mf-gp-scale-modal { padding: 0; }
    .mf-gp-scale-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; }
    .mf-gp-scale-panel > footer { flex-direction: column; align-items: stretch; }
}
.mf-gp-scale-options .mf-gp-choice { border: 1px solid #dce5ee; background: #fff; }
.mf-gp-scale-options .mf-gp-choice.selected { border-color: #123763; background: #eaf1f9; color: #123763; }

/* ===== Ajustes 2026-10: itens extras editáveis, categoria de exame, campos obrigatórios, aviso de mesclagem ===== */
.mf-gp-extra-add { flex-wrap: wrap; }
.mf-gp-extra-category { flex: 0 1 210px; width: auto; min-width: 150px; }
.mf-gp-extra-edit { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 0; flex: 0 0 auto; border: 1px solid #c9d8ea; border-radius: 8px; background: #fff; color: #2451a6; cursor: pointer; }
.mf-gp-extra-edit:hover { background: #eef4ff; }
.mf-gp-extra-edit svg { display: block; }
.mf-gp-state-row.is-extra { flex-wrap: wrap; }
.mf-gp-extra-editor { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mf-gp-extra-editor .mf-gp-input { flex: 1 1 220px; min-width: 0; }
.mf-gp-extra-exam-tag { display: block; margin-top: 3px; color: #2451a6; font-size: 11px; font-weight: 600; }
.mf-gp-extra-exam-tag[hidden] { display: none; }
.mf-gp-req-tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: #fff1f1; color: #b42318; font-size: 10.5px; font-weight: 700; vertical-align: middle; }
.mf-gp-merge-note { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: #fff7e6; color: #9a5b00; font-size: 11.5px; font-weight: 700; cursor: help; }
.mf-gp-merge-note[hidden] { display: none; }
.mf-gp-merge-note svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
/* Cartão de identificação: chegada ocupa a linha inteira quando sobra espaço, mantendo as 3 opções lado a lado. */
.mf-gp-ident-card .mf-gp-choice-row { flex-wrap: wrap; }
@media (max-width: 820px) { .mf-gp-ident-card .mf-gp-form-grid > [data-field-wrapper="chegada"] { grid-column: 1 / -1; } }
@media (max-width: 620px) { .mf-gp-extra-category { flex: 1 1 100%; } }

/* ===== Ajustes 2026-10 (rodada 2) ===== */
/* Cartão de identificação: a ajuda do campo vai para baixo do controle, para os campos ficarem alinhados. */
.mf-gp-ident-card .mf-gp-field > .mf-gp-field-help { order: 3; margin: 6px 0 0; }
.mf-gp-ident-card .mf-gp-field > label { min-height: 20px; }
.mf-gp-ident-card .mf-gp-choice { min-height: 43px; }

/* Busca: lista curta enquanto digita, com botão para ver todas. */
.mf-gp-results-more { grid-column: 1 / -1; justify-self: center; margin-top: 4px; }

/* Topo mais curto no celular: vai direto para a busca. */
@media (max-width: 720px) {
    .mf-gp-hero { padding-top: 22px; padding-bottom: 22px; }
    .mf-gp-hero h1 { font-size: 26px; }
    .mf-gp-hero p, .mf-gp-hero-note { display: none; }
    .mf-gp-hero-grid { margin-top: 10px; gap: 0; }
}

/* Janela simples (preferências, relatos) */
.mf-gp-simple-modal .mf-gp-field { margin-bottom: 10px; }
.mf-gp-simple-modal .mf-gp-field > span { font-weight: 700; font-size: 12.5px; margin-bottom: 5px; }
.mf-gp-report-status { margin-top: 8px; color: #b42318; font-size: 12.5px; }
.mf-gp-simple-modal footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mf-gp-simple-modal footer > div { display: flex; gap: 8px; }

/* Botões do resultado */
.mf-gp-report-btn { margin-left: auto; color: var(--mf-muted, #64748b); }
.mf-gp-result-actions .mf-gp-btn svg, .mf-gp-report-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -3px; }
.mf-gp-result-actions { flex-wrap: wrap; align-items: center; }

/* Motivo da decisão */
.mf-gp-just-card h3 small { font-weight: 500; color: var(--mf-muted, #64748b); font-size: 12px; }
.mf-gp-just-card.mf-gp-just-contrary { border-color: #f0b44c; box-shadow: 0 0 0 3px rgba(240,180,76,.18); }
.mf-gp-just-card.mf-gp-just-contrary .mf-gp-section-help { color: #8a5300; font-weight: 600; }
.mf-gp-refusal-grid { margin-top: 10px; }

/* Checagem de coerência */
.mf-gp-validation[data-kind="coherence"] { border-color: #f0b44c; background: #fffaf0; }
.mf-gp-validation li.sev-alta > span { font-weight: 600; color: #8a2c0d; }
.mf-gp-coherence-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

/* Rascunho */
.mf-gp-draft-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid #f0d9a6; border-radius: 12px; background: #fffaf0; color: #5b3d00; font-size: 13px; }
.mf-gp-draft-banner svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; flex: 0 0 auto; }
.mf-gp-draft-banner span { flex: 1 1 260px; }
.mf-gp-prefs-toggle svg { fill: none; }

/* ===== Rodada 2b: lousa de formatação, preferências, receita, motivo da decisão ===== */
/* Lousa: barra integrada ao topo da caixa de texto */
.mf-gp-editor { border: 1px solid #dbe3ee; border-radius: 12px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.mf-gp-editor:focus-within { border-color: #9cc3dd; box-shadow: 0 0 0 3px rgba(14,165,233,.10); }
.mf-gp-format-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 6px 8px; border-bottom: 1px solid #e6edf4; background: #f8fafc; }
.mf-gp-format-group { display: flex; align-items: center; gap: 2px; padding: 0 6px; }
.mf-gp-format-group + .mf-gp-format-group { border-left: 1px solid #dfe6ee; }
.mf-gp-format-group:first-child { padding-left: 0; }
.mf-gp-format-btn { display: inline-grid; place-items: center; width: 30px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #475569; cursor: pointer; transition: background .12s, color .12s; }
.mf-gp-format-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mf-gp-format-btn circle { fill: currentColor; stroke: none; }
.mf-gp-format-btn:hover { background: #e9eff6; color: #123763; }
.mf-gp-format-btn:active { background: #dbe6f2; }
.mf-gp-format-btn:focus-visible { outline: 2px solid #7db8d9; outline-offset: 1px; }
/* Conteúdo dentro da lousa: sem bordas próprias */
.mf-gp-result .mf-gp-final-block .mf-gp-editor { margin: 0 14px 14px; }
.mf-gp-result .mf-gp-editor pre[data-final-text] { border: 0; border-left: 0; border-radius: 0; box-shadow: none; background: #fff; }
.mf-gp-result .mf-gp-editor pre[data-final-text]:focus { box-shadow: none; background: #fff; }
.mf-gp-editor:has(.mf-gp-user-edited) { border-color: #e2c27a; }
.mf-gp-result .mf-gp-editor pre.mf-gp-user-edited, .mf-gp-editor .mf-gp-rx-text.mf-gp-user-edited { background: #fffdf6; }
.mf-gp-editor .mf-gp-rx-text, .mf-gp-result .mf-gp-editor .mf-gp-rx-text { border: 0; border-radius: 0; box-shadow: none; }
.mf-gp-editor .mf-gp-rx-text:focus { box-shadow: none; }
.mf-gp-final-block pre ul, .mf-gp-final-block pre ol, .mf-gp-rx-text ul, .mf-gp-rx-text ol { margin: 4px 0; padding-left: 22px; white-space: normal; }
.mf-gp-final-block pre li, .mf-gp-rx-text li { white-space: pre-wrap; }
.mf-gp-md-editor .mf-gp-textarea { border: 0; border-radius: 0; box-shadow: none; min-height: 190px; }
.mf-gp-md-editor .mf-gp-textarea:focus { box-shadow: none; }
.mf-gp-md-editor .mf-gp-myrx-textlabel { display: block; margin: 0; }
.mf-gp-editor-hint { display: block; margin-top: 6px; color: var(--mf-muted, #64748b); font-size: 11px; line-height: 1.45; }

/* Ícone da receita alinhado ao bloco de títulos */
.mf-gp-rx-title { align-items: center; }
.mf-gp-rx-title .mf-gp-section-icon.mf-gp-rx-icon { width: 46px; height: 46px; border-radius: 12px; }
.mf-gp-rx-title .mf-gp-section-icon.mf-gp-rx-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Motivo da decisão */
.mf-gp-just-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; }
.mf-gp-just-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.mf-gp-just-toggle[hidden], .mf-gp-just-card[hidden] { display: none; }
.mf-gp-conduta-grid + .mf-gp-just-toggle + .mf-gp-just-card, .mf-gp-just-card { margin-top: 16px; }

/* Preferências */
.mf-gp-prefs-modal .mf-gp-scale-panel { width: min(100%, 600px); }
.mf-gp-simple-modal .mf-gp-scale-panel > header { align-items: center; padding: 16px 20px; }
.mf-gp-simple-modal .mf-gp-modal-head-text { flex: 1 1 auto; min-width: 0; }
.mf-gp-modal-icon { width: 38px; height: 38px; border-radius: 11px; }
.mf-gp-modal-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mf-gp-simple-modal .mf-gp-modal-body { padding: 6px 20px 20px; background: #f7f9fc; }
.mf-gp-pref-group { margin-top: 14px; }
.mf-gp-pref-group h4 { margin: 0 0 8px; color: #5b6b80; font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.mf-gp-prefs-modal .mf-gp-pref-group > .mf-gp-pref { margin: 0; border: 1px solid #e3e9f1; border-radius: 0; background: #fff; }
.mf-gp-prefs-modal .mf-gp-pref-group > .mf-gp-pref + .mf-gp-pref { border-top: 0; }
.mf-gp-prefs-modal .mf-gp-pref-group > .mf-gp-pref:first-of-type { border-radius: 12px 12px 0 0; }
.mf-gp-prefs-modal .mf-gp-pref-group > .mf-gp-pref:last-of-type { border-radius: 0 0 12px 12px; }
.mf-gp-prefs-modal .mf-gp-pref-group > .mf-gp-pref:only-of-type { border-radius: 12px; }
.mf-gp-pref { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; cursor: pointer; transition: background .12s; }
.mf-gp-pref:hover { background: #fbfdff; }
.mf-gp-pref-text { flex: 1 1 auto; min-width: 0; }
.mf-gp-pref-text strong { display: block; color: #17304d; font-size: 13px; }
.mf-gp-pref-text small { display: block; margin-top: 2px; color: #64748b; font-size: 11.5px; line-height: 1.45; }
.mf-gp-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mf-gp-switch { position: relative; flex: 0 0 auto; width: 40px; height: 23px; border-radius: 999px; background: #cbd5e1; transition: background .18s; }
.mf-gp-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25); transition: transform .18s; }
.mf-gp-switch-input:checked + .mf-gp-switch { background: #0f7f8c; }
.mf-gp-switch-input:checked + .mf-gp-switch::after { transform: translateX(17px); }
.mf-gp-switch-input:focus-visible + .mf-gp-switch { outline: 2px solid #7db8d9; outline-offset: 2px; }
.mf-gp-prefs-modal .mf-gp-shortcuts { display: grid; grid-template-columns: 1fr; gap: 0; padding: 4px 14px; border: 1px solid #e3e9f1; border-radius: 12px; background: #fff; }
.mf-gp-prefs-modal .mf-gp-shortcuts li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; color: #334155; font-size: 12.5px; }
.mf-gp-prefs-modal .mf-gp-shortcuts li + li { border-top: 1px dashed #e6ecf3; }
.mf-gp-prefs-modal .mf-gp-shortcuts kbd { order: 2; min-width: 0; padding: 2px 8px; border: 1px solid #d5dde8; border-bottom-width: 2px; border-radius: 6px; background: #f8fafc; color: #1e3a5f; font: 600 11px/1.5 ui-monospace, Consolas, monospace; white-space: nowrap; }
.mf-gp-prefs-toggle svg { fill: none; }
.mf-gp-simple-modal .mf-gp-scale-body.mf-gp-modal-body { display: block; }
.mf-gp-prefs-modal .mf-gp-shortcuts li span { flex: 1 1 auto; min-width: 0; }
.mf-gp-prefs-modal .mf-gp-shortcuts kbd { flex: 0 0 auto; }
.mf-gp-pref-group:first-child { margin-top: 10px; }
.mf-gp-modal-icon { color: #fff; }
.mf-gp-simple-modal .mf-gp-modal-icon { color: var(--mf-primary, #123763); background: #eaf2f8; border: 0; box-shadow: none; }
.mf-gp-md-editor .mf-gp-md-area { min-height: 200px; max-height: 380px; overflow: auto; border: 0; border-radius: 0; box-shadow: none; white-space: pre-wrap; outline: none; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #1f3346; }
.mf-gp-md-editor .mf-gp-md-area:empty::before { content: attr(data-placeholder); color: #94a3b8; white-space: pre-wrap; }
.mf-gp-md-editor .mf-gp-md-area ul { margin: 2px 0; padding-left: 20px; white-space: normal; }
.mf-gp-md-editor .mf-gp-md-area li { white-space: pre-wrap; }

/* ===== Rodada 3 ===== */
/* Barra de busca: busca ocupa o espaço livre; botões lado a lado; Preferências só com ícone. */
.mf-gp-search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mf-gp-search-row > .mf-gp-search { flex: 1 1 360px; min-width: 0; }
.mf-gp-search-row > .mf-gp-filter-toggle { flex: 0 0 auto; width: auto; }
.mf-gp-search-row > .mf-gp-prefs-toggle { width: 46px; padding: 0; justify-content: center; }
.mf-gp-search-row > .mf-gp-prefs-toggle svg { width: 18px; height: 18px; }
@media (max-width: 900px) {
    .mf-gp-search-row > .mf-gp-search { flex-basis: 100%; }
    .mf-gp-search-row > .mf-gp-filter-toggle { flex: 1 1 0; }
    .mf-gp-search-row > .mf-gp-prefs-toggle { flex: 0 0 46px; }
}

/* Formatação sob demanda: botão ao lado do título, barra aparece no próprio cabeçalho */
.mf-gp-fmt { display: inline-flex; align-items: center; min-width: 0; }
.mf-gp-final-block > header > .mf-gp-fmt { margin-right: auto; margin-left: 10px; }
.mf-gp-fmt-toggle { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid #d7e1ec; border-radius: 999px; background: #fff; color: #475569; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.mf-gp-fmt-toggle:hover { background: #eef4fa; color: #123763; border-color: #b9cde3; }
.mf-gp-fmt-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mf-gp-fmt-toggle[hidden] { display: none; }
.mf-gp-fmt .mf-gp-format-bar { flex-wrap: nowrap; padding: 3px 4px; border: 1px solid #dfe7f0; border-radius: 10px; background: #f6f9fc; overflow-x: auto; max-width: 100%; }
.mf-gp-fmt .mf-gp-format-bar[hidden] { display: none; }
.mf-gp-fmt .mf-gp-format-btn { width: 28px; height: 26px; }
.mf-gp-fmt-back { margin-left: 2px; border-left: 1px solid #dfe6ee !important; border-radius: 0 7px 7px 0 !important; color: #94a3b8 !important; }
.mf-gp-fmt-back:hover { color: #b42318 !important; background: #fff1f1 !important; }
.mf-gp-rx-actions > .mf-gp-fmt, .mf-gp-rx-part-head > .mf-gp-fmt { margin-right: auto; }
/* Texto do bloco final com respiro, sem caixa dentro de caixa */
.mf-gp-result .mf-gp-final-block pre[data-final-text] { margin: 0; padding: 16px 18px; }
@media (max-width: 620px) {
    .mf-gp-final-block > header > .mf-gp-fmt { margin-left: 0; }
}

/* Próxima etapa */
.mf-gp-step-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.mf-gp-step-nav .mf-gp-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; vertical-align: -3px; }
.mf-gp-step-next { margin-left: auto; }
.mf-gp-exam-only .mf-gp-step-nav { display: none; }

/* Fechar o card de motivo */
.mf-gp-just-card .mf-gp-section-title { position: relative; }
.mf-gp-just-close { margin-left: auto; width: 30px; height: 30px; border: 1px solid #dce5ee; border-radius: 8px; background: #fff; color: #52657a; font-size: 18px; line-height: 1; cursor: pointer; }
.mf-gp-just-close:hover { background: #fff1f1; color: #b42318; border-color: #f3c7c7; }
.mf-gp-just-close[hidden] { display: none; }
.mf-gp-final-all pre[data-final-text="tudo"] { max-height: 640px; }

/* Rodada 3b: Formatar só com ícone; atalho de Minhas Prescrições ao lado de Copiar receita; lousa da receita */
.mf-gp-fmt-toggle { width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: 8px; }
.mf-gp-fmt-toggle svg { width: 15px; height: 15px; }
.mf-gp-icon-action { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid #b7dfe3; border-radius: 10px; background: #effafb; color: #0b6a78; cursor: pointer; transition: background .12s, border-color .12s; }
.mf-gp-icon-action:hover { background: #e2f5f7; border-color: #97d0d6; color: #075663; }
.mf-gp-icon-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mf-gp-rx .mf-gp-editor { margin-top: 2px; }
.mf-gp-rx .mf-gp-editor .mf-gp-rx-text { border-left: 4px solid #0f7f8c; }
.mf-gp-rx .mf-gp-editor .mf-gp-rx-text.mf-gp-user-edited { border-left-color: #b77b00; }

/* ===== Rodada 4: menos poluição visual ===== */
/* Ajuda em ícone ⓘ */
.mf-gp-help-btn { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; padding: 0; border: 1px solid #c7d4e2; border-radius: 50%; background: #fff; color: #64748b; font: italic 700 10px/1 Georgia, serif; vertical-align: 1px; cursor: pointer; }
.mf-gp-help-btn:hover, .mf-gp-help-btn.open { border-color: #7da7cf; background: #eef4fb; color: #123763; }
.mf-gp-field-help[hidden] { display: none !important; }
.mf-gp-field > .mf-gp-field-help, .mf-gp-state-help { margin: 0 0 7px; padding: 6px 9px; border-radius: 8px; background: #f3f7fb; color: #475569; font-size: 11.5px; line-height: 1.45; }
/* Tag "várias" discreta */
.mf-gp-multi-tag { margin-left: 6px; padding: 0 6px; background: transparent; border: 1px solid #d7e2ef; color: #6b7d93; font-size: 10px; font-weight: 600; text-transform: lowercase; }
/* Opções extras escondidas até "+ N opções" */
.mf-gp-choice-row .mf-gp-choice-extra { display: none; }
.mf-gp-choice-row.show-all .mf-gp-choice-extra, .mf-gp-choice-row .mf-gp-choice-extra.selected { display: inline-flex; }
.mf-gp-choice-more { align-self: center; height: 32px; padding: 0 10px; border: 1px dashed #c3d2e3; border-radius: 9px; background: transparent; color: #2f5d8a; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.mf-gp-choice-more:hover { background: #f1f6fc; border-style: solid; }
/* Itens extras das listas Nega/Presente */
.mf-gp-state-list .mf-gp-state-extra { display: none; }
.mf-gp-state-list.show-all .mf-gp-state-extra, .mf-gp-state-list .mf-gp-state-extra[data-state="presente"], .mf-gp-state-list .mf-gp-state-extra[data-state="nega"] { display: flex; }
.mf-gp-state-more { margin-top: 8px; }
.mf-gp-state-list-head { margin-bottom: 8px; }
.mf-gp-state-list-head > span { display: none; }
/* "Mais detalhes" dentro da seção */
.mf-gp-more-details { margin-top: 12px; border-top: 1px dashed #dbe4ee; padding-top: 10px; }
.mf-gp-more-details > summary { display: inline-flex; align-items: center; gap: 6px; color: #2f5d8a; font-size: 12.5px; font-weight: 700; cursor: pointer; list-style: none; }
.mf-gp-more-details > summary::-webkit-details-marker { display: none; }
.mf-gp-more-details > summary::before { content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: #eaf2fa; font-size: 13px; }
.mf-gp-more-details[open] > summary::before { content: "−"; }
.mf-gp-more-details > .mf-gp-form-grid { margin-top: 12px; }
/* Seção recolhível (ex.: Antecedentes) */
.mf-gp-collapsible > .mf-gp-section-title { width: 100%; border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.mf-gp-collapsible > .mf-gp-section-title h3 { margin: 0; }
.mf-gp-collapse-hint { margin-left: 8px; color: #6b7d93; font-size: 12px; font-weight: 500; }
.mf-gp-collapse-chevron { margin-left: auto; color: #6b7d93; transition: transform .15s; }
.mf-gp-collapsible.open .mf-gp-collapse-chevron { transform: rotate(180deg); }
.mf-gp-collapsible:not(.open) { padding-bottom: 14px; }
.mf-gp-collapsible:not(.open) > .mf-gp-section-title { margin-bottom: 0; }
@media (max-width: 620px) { .mf-gp-collapse-hint { display: none; } }
.mf-gp-extra-add { flex-wrap: nowrap; }
.mf-gp-extra-add .mf-gp-input { flex: 1 1 200px; }
.mf-gp-extra-add .mf-gp-extra-category { flex: 0 0 180px; }
@media (max-width: 620px) { .mf-gp-extra-add { flex-wrap: wrap; } .mf-gp-extra-add .mf-gp-extra-category { flex: 1 1 100%; } }
/* Cabeçalho do módulo: explicação em ⓘ */
.mf-gp-module-heading h2 .mf-gp-help-btn { width: 18px; height: 18px; font-size: 11px; vertical-align: 4px; }
.mf-gp-module-about { margin: -4px 0 14px; padding: 10px 12px; border-radius: 10px; background: #f3f7fb; color: #475569; font-size: 12.5px; line-height: 1.55; }
.mf-gp-module-about p { margin: 0; }
.mf-gp-module-about p + p { margin-top: 6px; }
.mf-gp-module-about[hidden] { display: none; }
/* Conduta: opções compactas */
.mf-gp-conduta-card label { align-items: center; }
.mf-gp-conduta-card label > span > small { display: none; }
.mf-gp-conduta-card { padding-top: 10px; padding-bottom: 10px; }
/* Conduta mais compacta: opções em grade de chips e cartão de perfil mais leve */
.mf-gp-conduta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.mf-gp-conduta-card { min-height: 0 !important; padding: 10px 12px !important; }
.mf-gp-conduta-card.selected:has(.mf-gp-conduta-sub:not([hidden])) { grid-column: 1 / -1; }
.mf-gp-conduta-card label strong { font-size: 13px; }
.mf-gp-conduta-info { padding: 10px 14px !important; color: #1f3346 !important; background: #f3f8fc !important; border: 1px solid #dbe7f2 !important; box-shadow: none !important; }
.mf-gp-conduta-info strong { color: #123763 !important; font-size: 13px; }
.mf-gp-conduta-info span { color: #52657a !important; }
.mf-gp-conduta-info .mf-gp-conduta-info-icon { background: #e3eef8 !important; color: #123763 !important; }
.mf-gp-conduta-grid { grid-auto-flow: row dense; }

/* ===== Conduta: ações em chips + painéis ===== */
.mf-gp-conduta-actions { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--mf-border, #dbe3ee); border-radius: 14px; background: #fff; }
.mf-gp-conduta-actions-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.mf-gp-conduta-actions-head strong { color: #123763; font-size: 14px; }
.mf-gp-conduta-actions-head span { color: #6b7d93; font-size: 12px; }
.mf-gp-conduta-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mf-gp-conduta-chip { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px 0 10px; border: 1px solid #d5e0ec; border-radius: 999px; background: #fff; color: #1f3346; font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; transition: background .14s, border-color .14s, color .14s, box-shadow .14s; }
.mf-gp-conduta-chip:hover { border-color: #9fbcd8; background: #f6f9fd; }
.mf-gp-conduta-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mf-gp-conduta-chip:focus-within { box-shadow: 0 0 0 3px rgba(14,165,233,.15); }
.mf-gp-chip-check { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid #b8c7d8; border-radius: 50%; background: #fff; transition: background .14s, border-color .14s; }
.mf-gp-chip-check svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3; opacity: 0; }
.mf-gp-conduta-chip.selected { border-color: #123763; background: #123763; color: #fff; }
.mf-gp-conduta-chip.selected .mf-gp-chip-check { border-color: #fff; background: #fff; }
.mf-gp-conduta-chip.selected .mf-gp-chip-check svg { stroke: #123763; opacity: 1; }
.mf-gp-conduta-panels { display: grid; gap: 10px; }
.mf-gp-conduta-panels:has(.mf-gp-conduta-sub:not([hidden])) { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #dbe4ee; }
.mf-gp-conduta-actions .mf-gp-conduta-sub { margin: 0; padding: 12px 14px; border: 1px solid #e3eaf2; border-left: 3px solid #123763; border-radius: 10px; background: #f8fbfe; }
.mf-gp-conduta-actions .mf-gp-conduta-sub[hidden] { display: none; }
.mf-gp-conduta-sub-head { margin-bottom: 8px; color: #123763; font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.mf-gp-conduta-sub .mf-gp-choice-row { margin-bottom: 8px; }
.mf-gp-conduta-sub > .mf-gp-input, .mf-gp-conduta-sub > .mf-gp-textarea { margin-top: 6px; }
@media (max-width: 620px) {
    .mf-gp-conduta-chip { flex: 1 1 calc(50% - 8px); min-height: 42px; font-size: 12.5px; }
}

/* ===== Conduta v2: chips iguais (como os filtros), painéis em 2 colunas, ícone de personalizar ===== */
.mf-gp-conduta-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.mf-gp-conduta-chip { width: 100%; min-height: 42px; padding: 0 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.25; }
.mf-gp-conduta-chip > span:last-child { flex: 1 1 auto; min-width: 0; }
.mf-gp-conduta-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.mf-gp-conduta-actions .mf-gp-conduta-sub.wide { grid-column: 1 / -1; }
.mf-gp-conduta-sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; margin: 0; }
.mf-gp-conduta-sub.is-custom .mf-gp-conduta-sub-head, .mf-gp-conduta-sub.wide .mf-gp-conduta-sub-head { margin-bottom: 10px; }
.mf-gp-conduta-sub-tools { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mf-gp-conduta-mode-label { color: #6b7d93; font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.mf-gp-conduta-sub.is-custom .mf-gp-conduta-mode-label { color: #0b6a78; }
.mf-gp-conduta-tool { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #d5e0ec; border-radius: 8px; background: #fff; color: #475569; cursor: pointer; }
.mf-gp-conduta-tool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.mf-gp-conduta-tool:hover { border-color: #9fbcd8; color: #123763; }
.mf-gp-conduta-tool.active { border-color: #0f7f8c; background: #0f7f8c; color: #fff; }
.mf-gp-conduta-days { width: 82px !important; min-height: 32px !important; height: 32px; padding: 4px 8px !important; text-transform: none; font-weight: 600; }
.mf-gp-conduta-sub .mf-gp-input[hidden], .mf-gp-conduta-sub .mf-gp-exam-picker[hidden] { display: none; }
/* Exames: escolhidos + lista organizada sob demanda */
.mf-gp-exam-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mf-gp-exam-empty { color: #8392a5; font-size: 12px; }
.mf-gp-exam-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 10px; border: 1px solid #bcd3e8; border-radius: 999px; background: #eef5fc; color: #123763; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.mf-gp-exam-chip span { color: #6b7d93; font-size: 14px; line-height: 1; }
.mf-gp-exam-chip:hover span { color: #b42318; }
.mf-gp-exam-open { margin-bottom: 8px; }
.mf-gp-exam-groups { display: grid; gap: 10px; margin-bottom: 8px; padding: 10px; border: 1px solid #e3eaf2; border-radius: 10px; background: #fff; }
.mf-gp-exam-groups[hidden] { display: none; }
.mf-gp-exam-group strong { display: block; margin-bottom: 6px; color: #52657a; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 760px) { .mf-gp-conduta-panels { grid-template-columns: 1fr; } }

/* Conduta v3: altura uniforme, × nos painéis, exames sempre por último e largura total ao personalizar */
.mf-gp-conduta-sub-head { min-height: 34px; }
.mf-gp-conduta-days { box-sizing: border-box; height: 32px !important; min-height: 32px !important; max-height: 32px; font-size: 13px !important; }
.mf-gp-conduta-close { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #e3c4c4; border-radius: 8px; background: #fff; color: #b42318; font-size: 18px; line-height: 1; cursor: pointer; }
.mf-gp-conduta-close:hover { background: #fff1f1; }
.mf-gp-conduta-actions .mf-gp-conduta-sub { order: 1; }
.mf-gp-conduta-actions .mf-gp-conduta-sub.is-exams { order: 5; }
.mf-gp-conduta-actions .mf-gp-conduta-sub.wide { order: 9; }
.mf-gp-conduta-actions .mf-gp-conduta-sub.is-exams.is-custom { grid-column: 1 / -1; }
.mf-gp-conduta-sub.is-exams .mf-gp-exam-groups { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.mf-gp-conduta-sub-tools .mf-gp-conduta-days { margin: 0 !important; }

/* Apoio à classificação: cor pela decisão (vermelho = internação/observação, verde = alta, amarelo = outras) */
.mf-gp-assist .mf-gp-assist-item { border: 1px solid transparent !important; border-left-width: 5px !important; }
.mf-gp-assist .mf-gp-assist-item.tone-red { border-color: #b42318 !important; background: #b42318 !important; color: #fff !important; }
.mf-gp-assist .mf-gp-assist-item.tone-green { border-color: #157a4b !important; background: #157a4b !important; color: #fff !important; }
.mf-gp-assist .mf-gp-assist-item.tone-yellow { border-color: #c98a00 !important; background: #fbbf24 !important; color: #3d2a00 !important; }
.mf-gp-assist .mf-gp-assist-item.tone-red strong, .mf-gp-assist .mf-gp-assist-item.tone-green strong { color: #fff !important; }
.mf-gp-assist .mf-gp-assist-item.tone-red span, .mf-gp-assist .mf-gp-assist-item.tone-green span, .mf-gp-assist .mf-gp-assist-item.tone-red small, .mf-gp-assist .mf-gp-assist-item.tone-green small { color: rgba(255,255,255,.88) !important; }
.mf-gp-assist .mf-gp-assist-item.tone-yellow strong { color: #2b1d00 !important; }
.mf-gp-assist .mf-gp-assist-item.tone-yellow span, .mf-gp-assist .mf-gp-assist-item.tone-yellow small { color: #4a3600 !important; }
.mf-gp-assist .mf-gp-assist-item .mf-gp-assist-ok { padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.92); color: #157a4b !important; font-weight: 700; }
.mf-gp-assist .mf-gp-assist-item .mf-gp-assist-ok svg { stroke: #157a4b; }
.mf-gp-assist .mf-gp-assist-item .mf-gp-assist-apply { border: 1px solid #fff !important; background: #fff !important; color: #1f2937 !important; font-weight: 800; }
.mf-gp-assist .mf-gp-assist-item.tone-yellow .mf-gp-assist-apply { border-color: #3d2a00 !important; background: #3d2a00 !important; color: #fff !important; }
.mf-gp-assist .mf-gp-assist-item .mf-gp-assist-apply:hover { filter: brightness(.95); }
.mf-gp-assist .mf-gp-assist-item.tone-green span.mf-gp-assist-ok,
.mf-gp-assist .mf-gp-assist-item.tone-red span.mf-gp-assist-ok,
.mf-gp-assist .mf-gp-assist-item.tone-yellow span.mf-gp-assist-ok { color: #157a4b !important; background: #fff; }

/* ===== Preferências v2: favoritas, ações padrão, documentos ===== */
.mf-gp-disease-item { position: relative; min-width: 0; }
.mf-gp-disease-item > .mf-gp-disease-card { width: 100%; padding-right: 76px; }
.mf-gp-fav-star { position: absolute; top: 50%; right: 44px; transform: translateY(-50%); width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #9aa9ba; font-size: 18px; line-height: 1; cursor: pointer; }
.mf-gp-fav-star:hover { background: #f1f5f9; color: #c98a00; }
.mf-gp-fav-star.on { color: #e0a100; }
.mf-gp-favorites { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.mf-gp-favorites[hidden] { display: none; }
.mf-gp-fav-label { color: #c98a00; font-size: 12px; font-weight: 800; margin-right: 4px; }
.mf-gp-fav-chip { padding: 6px 12px; border: 1px solid #f0d9a6; border-radius: 999px; background: #fffaf0; color: #5b3d00; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.mf-gp-fav-chip:hover { background: #fff3d6; border-color: #e6c27a; }
.mf-gp-pref-box { padding: 12px 14px; border: 1px solid #e3e9f1; border-radius: 12px; background: #fff; }
.mf-gp-pref-note { margin: 0 0 8px; color: #64748b; font-size: 11.5px; line-height: 1.45; }
.mf-gp-pref-fields .mf-gp-pref-note { margin: 6px 0 0; }
.mf-gp-pref-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.mf-gp-pref-actions .mf-gp-conduta-chip { min-height: 38px; font-size: 12px; }
.mf-gp-pref-fields { display: grid; gap: 10px; }
.mf-gp-pref-fields label { display: grid; gap: 4px; }
.mf-gp-pref-fields label > span { color: #17304d; font-size: 12.5px; font-weight: 700; }
/* Estrela de favorita no título da condição (ao lado do ⓘ) */
.mf-gp-module-heading h2 .mf-gp-fav-star { position: static; transform: none; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 4px; font-size: 18px; vertical-align: 1px; }
/* Apoio à classificação — tons revisados: âmbar mais sóbrio (texto claro) e faixa lateral visível em todos */
.mf-gp-assist .mf-gp-assist-item.tone-yellow { border-color: #b8740a !important; background: linear-gradient(135deg, #d38a0c, #b8740a) !important; color: #fff !important; }
.mf-gp-assist .mf-gp-assist-item.tone-yellow strong { color: #fff !important; }
.mf-gp-assist .mf-gp-assist-item.tone-yellow span, .mf-gp-assist .mf-gp-assist-item.tone-yellow small { color: rgba(255,255,255,.9) !important; }
.mf-gp-assist .mf-gp-assist-item.tone-yellow .mf-gp-assist-apply { border-color: #fff !important; background: #fff !important; color: #7a4a00 !important; }
.mf-gp-assist .mf-gp-assist-item.tone-green { border-left-color: #8ee6bd !important; }
.mf-gp-assist .mf-gp-assist-item.tone-red { border-left-color: #ffb3a7 !important; }
.mf-gp-assist .mf-gp-assist-item.tone-yellow { border-left-color: #ffe39a !important; }
/* Resultado calculado ao vivo (escores) */
.mf-gp-computed { display: flex; align-items: center; min-height: 43px; padding: 9px 12px; border: 1px dashed #c7d5e4; border-radius: 9px; background: #f6f9fc; color: #123763; font-size: 13px; font-weight: 700; }
.mf-gp-computed[data-tone="green"] { border: 1px solid #157a4b; background: #157a4b; color: #fff; }
.mf-gp-computed[data-tone="yellow"] { border: 1px solid #b8740a; background: linear-gradient(135deg, #d38a0c, #b8740a); color: #fff; }
.mf-gp-computed[data-tone="red"] { border: 1px solid #b42318; background: #b42318; color: #fff; }

/* ===== Proteção contra o estilo de botões do tema (Astra pinta hover/foco de azul) =====
   Cada botão do gerador mantém sua própria aparência em hover, foco e clique. */
[data-mf-prontuario-root] .mf-gp-fold-head:is(:hover, :focus, :active),
[data-mf-prontuario-root] .mf-gp-exam-head:is(:hover, :focus, :active),
[data-mf-prontuario-root] .mf-gp-collapsible > .mf-gp-section-title:is(:hover, :focus, :active) { background: transparent; color: inherit; box-shadow: none; }
[data-mf-prontuario-root] .mf-gp-fold-head:hover .mf-gp-fold-toggle,
[data-mf-prontuario-root] .mf-gp-exam-head:hover small { color: var(--mf-primary, #123763); }
[data-mf-prontuario-root] .mf-gp-scale-x,
[data-mf-prontuario-root] .mf-gp-scale-x:is(:hover, :focus, :active) { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #dce5ee; border-radius: 8px; background: #fff; color: #52657a; font-size: 18px; line-height: 1; box-shadow: none; }
[data-mf-prontuario-root] .mf-gp-scale-x:hover { background: #fff1f1; color: #b42318; border-color: #f3c7c7; }
[data-mf-prontuario-root] .mf-gp-help-btn:is(:hover, :focus, :active) { background: #eef4fb; color: #123763; border-color: #7da7cf; }
[data-mf-prontuario-root] .mf-gp-fav-star:is(:hover, :focus, :active) { background: #f1f5f9; color: #c98a00; }
[data-mf-prontuario-root] .mf-gp-fav-star.on:is(:hover, :focus, :active) { color: #e0a100; }
[data-mf-prontuario-root] .mf-gp-format-btn:is(:hover, :focus, :active) { background: #e9eff6; color: #123763; }
[data-mf-prontuario-root] .mf-gp-fmt-toggle:is(:hover, :focus, :active) { background: #eef4fa; color: #123763; border-color: #b9cde3; }
[data-mf-prontuario-root] .mf-gp-fmt-back:is(:hover, :focus, :active) { background: #fff1f1 !important; color: #b42318 !important; }
[data-mf-prontuario-root] .mf-gp-extra-edit:is(:hover, :focus, :active) { background: #eef4ff; color: #2451a6; }
[data-mf-prontuario-root] .mf-gp-extra-remove:is(:hover, :focus, :active),
[data-mf-prontuario-root] .mf-gp-conduta-close:is(:hover, :focus, :active),
[data-mf-prontuario-root] .mf-gp-just-close:is(:hover, :focus, :active) { background: #fff1f1; color: #b42318; border-color: #f3c7c7; }
[data-mf-prontuario-root] .mf-gp-icon-btn:is(:hover, :focus, :active) { background: #fff1f1; color: #b42318; }
[data-mf-prontuario-root] .mf-gp-conduta-tool:is(:hover, :focus, :active) { background: #fff; color: #123763; border-color: #9fbcd8; }
[data-mf-prontuario-root] .mf-gp-conduta-tool.active:is(:hover, :focus, :active) { background: #0f7f8c; color: #fff; border-color: #0f7f8c; }
[data-mf-prontuario-root] .mf-gp-choice-more:is(:hover, :focus, :active) { background: #f1f6fc; color: #2f5d8a; }
[data-mf-prontuario-root] .mf-gp-exam-chip:is(:hover, :focus, :active) { background: #e3eefa; color: #123763; }
[data-mf-prontuario-root] .mf-gp-icon-action:is(:hover, :focus, :active) { background: #e2f5f7; color: #075663; border-color: #97d0d6; }
[data-mf-prontuario-root] .mf-gp-fav-chip:is(:hover, :focus, :active) { background: #fff3d6; color: #5b3d00; border-color: #e6c27a; }
[data-mf-prontuario-root] .mf-gp-calc-btn:is(:hover, :focus, :active),
[data-mf-prontuario-root] .mf-gp-unknown-chip:is(:hover, :focus, :active) { background: #eef4fa; color: #123763; }
[data-mf-prontuario-root] .mf-gp-link-btn:is(:hover, :focus, :active) { background: #e2f5f7; color: #075663; }
[data-mf-prontuario-root] .mf-gp-preview-reset:is(:hover, :focus, :active) { background: #fff7e6; color: #8a5300; }
[data-mf-prontuario-root] .mf-gp-copy-part:is(:hover, :focus, :active) { background: #0d2b4d; color: #fff; }
[data-mf-prontuario-root] .mf-gp-state-btn:not(.selected):is(:hover, :focus) { background: #f3f7fb; color: #1f3346; }
[data-mf-prontuario-root] .mf-gp-choice:not(.selected):is(:hover, :focus) { background: #f3f7fb; color: #1f3346; }
[data-mf-prontuario-root] .mf-gp-multi-option:not(.selected):is(:hover, :focus) { background: #f3f7fb; color: #1f3346; }
[data-mf-prontuario-root] .mf-gp-page-btn:not(.current):is(:hover, :focus) { background: #f2f7fc; color: #1c3553; }
[data-mf-prontuario-root] .mf-gp-assoc-option:is(:hover, :focus) { background: #f3f7fb; color: #1f3346; }
[data-mf-prontuario-root] .mf-gp-myrx-back:is(:hover, :focus, :active) { background: #eef4fa; color: #123763; }
[data-mf-prontuario-root] .mf-gp-search-clear:is(:hover, :focus, :active) { background: #eef3f7; color: #334155; }
[data-mf-prontuario-root] .mf-gp-results-more:is(:hover, :focus) { background: #f3f7fa; color: var(--mf-primary, #123763); }
/* Atalhos: lista sem o recuo de lista do tema */
[data-mf-prontuario-root] .mf-gp-prefs-modal .mf-gp-shortcuts { margin: 0 !important; padding: 4px 14px !important; list-style: none !important; }
[data-mf-prontuario-root] .mf-gp-prefs-modal .mf-gp-shortcuts li { margin: 0 !important; }
[data-mf-prontuario-root] .mf-gp-modal-close:is(:hover, :focus, :active), .mf-gp-myrx-modal .mf-gp-modal-close:is(:hover, :focus, :active) { background: rgba(255,255,255,.18); color: #fff; }
[data-mf-prontuario-root] .mf-gp-assist ul, [data-mf-prontuario-root] .mf-gp-conflicts ul, [data-mf-prontuario-root] .mf-gp-block-list { margin: 8px 0 0 !important; padding: 0 !important; list-style: none !important; }
[data-mf-prontuario-root] .mf-gp-conduta-notes ul, [data-mf-prontuario-root] .mf-gp-rx-notes ul { margin: 6px 0 0 !important; padding-left: 18px !important; }
[data-mf-prontuario-root] .mf-gp-assist li, [data-mf-prontuario-root] .mf-gp-conflicts li, [data-mf-prontuario-root] .mf-gp-block-list li { margin-left: 0 !important; }
