.mg-shell{--mg-ink:#13283d;--mg-blue:#2674d9;--mg-mint:#22a78a;--mg-line:#dce8ef;max-width:1600px;margin:0 auto;padding:22px;color:var(--mg-ink);font-family:"Inter","Segoe UI",sans-serif}.mg-hero{display:flex;justify-content:space-between;gap:22px;align-items:center;padding:24px 28px;border:1px solid var(--mg-line);border-radius:24px;background:linear-gradient(115deg,#f8fcff 0%,#eef9f6 100%);box-shadow:0 16px 40px rgba(25,76,106,.08)}.mg-eyebrow{color:var(--mg-mint);font-size:12px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.mg-hero h1{margin:5px 0;font-size:clamp(25px,3vw,39px);letter-spacing:-.04em}.mg-hero p{margin:0;color:#617588}.mg-hero-actions,.mg-actions{display:flex;gap:10px;flex-wrap:wrap}.mg-btn{border:0;border-radius:13px;padding:11px 16px;font-weight:750;cursor:pointer;display:inline-flex;align-items:center;gap:7px;background:#eaf1f6;color:var(--mg-ink)}.mg-btn.primary{background:var(--mg-ink);color:#fff}.mg-btn.accent{background:var(--mg-blue);color:#fff}.mg-btn:focus-visible,.mg-step:focus-visible{outline:3px solid rgba(38,116,217,.3);outline-offset:2px}.mg-grid{display:grid;grid-template-columns:minmax(260px,340px) minmax(0,1fr);gap:18px;margin-top:18px}.mg-panel{border:1px solid var(--mg-line);border-radius:20px;background:#fff;box-shadow:0 8px 25px rgba(28,60,80,.05)}.mg-side{padding:18px;align-self:start;position:sticky;top:18px}.mg-side h2,.mg-work h2{margin:0 0 6px;font-size:18px}.mg-search{width:100%;box-sizing:border-box;border:1px solid var(--mg-line);border-radius:12px;padding:12px;margin:12px 0;font:inherit}.mg-patient-list{max-height:330px;overflow:auto}.mg-patient{width:100%;display:flex;gap:11px;align-items:center;text-align:left;border:0;background:transparent;border-radius:13px;padding:10px;cursor:pointer}.mg-patient:hover,.mg-patient.active{background:#edf7f5}.mg-avatar{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:#dff4ee;color:#147761;font-weight:800}.mg-patient small{display:block;color:#718394;margin-top:3px}.mg-recent{border-top:1px solid var(--mg-line);margin-top:15px;padding-top:15px}.mg-recent-item{padding:9px 0;border-bottom:1px solid #edf2f5;font-size:13px}.mg-work{padding:22px;min-width:0}.mg-patient-strip{display:grid;grid-template-columns:auto 1fr repeat(3,auto);gap:14px;align-items:center;padding:15px;border-radius:16px;background:#f4f8fb;margin-bottom:16px}.mg-patient-strip strong{display:block}.mg-patient-strip span{color:#6a7e90;font-size:13px}.mg-steps{display:flex;gap:7px;overflow:auto;padding:3px 0 14px}.mg-step{white-space:nowrap;border:1px solid var(--mg-line);background:#fff;border-radius:999px;padding:9px 13px;font-weight:700;color:#647789;cursor:pointer}.mg-step.active{background:var(--mg-ink);border-color:var(--mg-ink);color:white}.mg-section{display:none}.mg-section.active{display:block;animation:mgIn .18s ease-out}.mg-section-head{margin:7px 0 17px}.mg-section-head h3{margin:0;font-size:24px;letter-spacing:-.02em}.mg-section-head p{margin:5px 0 0;color:#718394}.mg-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.mg-field{display:flex;flex-direction:column;gap:6px;min-width:0}.mg-field.full{grid-column:1/-1}.mg-field label{font-size:12px;font-weight:800;letter-spacing:.035em;color:#52687b;text-transform:uppercase}.mg-field input,.mg-field select,.mg-field textarea{width:100%;box-sizing:border-box;border:1px solid #cfdee7;border-radius:12px;padding:11px 12px;background:#fff;color:var(--mg-ink);font:inherit}.mg-field textarea{min-height:92px;resize:vertical}.mg-subtitle{grid-column:1/-1;margin:10px 0 -2px;padding-top:12px;border-top:1px solid var(--mg-line);font-size:15px}.mg-vitals{display:grid;grid-template-columns:repeat(4,minmax(110px,1fr));gap:10px;grid-column:1/-1}.mg-repeat{grid-column:1/-1;border:1px solid var(--mg-line);border-radius:15px;padding:13px}.mg-repeat-row{display:grid;grid-template-columns:1fr 2fr auto;gap:8px;margin-bottom:8px}.mg-med-row{grid-template-columns:1.4fr repeat(5,1fr) auto}.mg-empty{padding:52px 20px;text-align:center;color:#708394}.mg-docs{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.mg-doc{border:1px solid var(--mg-line);border-radius:15px;padding:16px;background:#f9fbfc;cursor:pointer;text-align:left}.mg-doc strong{display:block;margin-bottom:4px}.mg-footer{display:flex;justify-content:space-between;gap:12px;border-top:1px solid var(--mg-line);padding-top:16px;margin-top:20px}@keyframes mgIn{from{opacity:0;transform:translateY(5px)}}@media(prefers-reduced-motion:reduce){.mg-section.active{animation:none}}@media(max-width:900px){.mg-grid{grid-template-columns:1fr}.mg-side{position:static}.mg-patient-list{max-height:190px}.mg-vitals{grid-template-columns:repeat(2,1fr)}.mg-patient-strip{grid-template-columns:auto 1fr}.mg-patient-strip>span{display:none}.mg-docs{grid-template-columns:1fr 1fr}}@media(max-width:600px){.mg-shell{padding:10px}.mg-hero{align-items:flex-start;flex-direction:column;padding:20px}.mg-work{padding:15px}.mg-fields{grid-template-columns:1fr}.mg-field.full,.mg-subtitle{grid-column:auto}.mg-repeat-row,.mg-med-row{grid-template-columns:1fr}.mg-docs{grid-template-columns:1fr}.mg-footer{position:sticky;bottom:0;background:white;padding:12px 0}.mg-hero-actions{width:100%}.mg-hero-actions .mg-btn{flex:1;justify-content:center}}
/* Expediente longitudinal de Medicina General */
.mg-side-head,.mg-repeat-title{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.mg-count{display:grid;place-items:center;min-width:28px;height:28px;border-radius:999px;background:#e3f2ee;color:#18745f;font-size:12px;font-weight:800}.mg-empty.compact{padding:20px 8px}.mg-recent-item{width:100%;display:flex;justify-content:space-between;gap:8px;align-items:center;text-align:left;border:0;background:transparent;cursor:pointer}.mg-recent-item span,.mg-recent-item small{display:block}.mg-recent-item em,.mg-status{font-style:normal;font-size:11px;font-weight:800;border-radius:999px;padding:5px 8px;background:#fff1cf;color:#8b6200}.mg-recent-item em.closed,.mg-status.closed{background:#dcf4ec;color:#16705b}.mg-recent-item.active{background:#edf7f5;border-radius:11px;padding-inline:9px}.mg-status.new{background:#e8f0ff;color:#245fb1}.mg-timeline{grid-column:1/-1;border:1px solid #d6e5ea;border-radius:15px;background:#f8fbfc;padding:12px}.mg-timeline summary{cursor:pointer;font-weight:800}.mg-timeline article{display:grid;grid-template-columns:95px 1fr;gap:12px;padding:12px 0;border-top:1px solid #e2ebef}.mg-timeline article:first-of-type{margin-top:10px}.mg-timeline time{font-size:12px;font-weight:800;color:#23846e}.mg-timeline p{margin:0 0 4px;font-size:13px}.mg-timeline-empty{grid-column:1/-1;border-left:4px solid #2a9d84;background:#edf8f5;padding:12px 14px;border-radius:0 12px 12px 0;color:#536d78}.mg-repeat-title small{display:block;color:#718394;margin-top:3px}.mg-dx-row{grid-template-columns:112px minmax(130px,.7fr) minmax(240px,2fr) auto}.mg-primary-dx{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:800;color:#406176}.mg-primary-dx input{width:17px;height:17px}.mg-med-row{grid-template-columns:1.35fr repeat(7,minmax(105px,1fr)) auto;overflow-x:auto;padding-bottom:5px}.mg-rips-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:10px;border-top:1px solid #dce8ef;padding-top:14px}.mg-doc{position:relative}.mg-doc em{position:absolute;right:10px;top:10px;font-size:9px;font-style:normal;font-weight:900;letter-spacing:.08em;color:#2674d9}.mg-btn:disabled,.mg-field input:disabled,.mg-field textarea:disabled,.mg-field select:disabled{opacity:.62;cursor:not-allowed}.mg-status{align-self:center}.mg-empty>.material-symbols-outlined{font-size:44px}
@media(max-width:900px){.mg-med-row{grid-template-columns:1fr 1fr}.mg-dx-row{grid-template-columns:100px 1fr 1.7fr auto}.mg-hero-actions{justify-content:flex-end}}
@media(max-width:600px){.mg-dx-row,.mg-med-row{grid-template-columns:1fr}.mg-primary-dx{padding:8px}.mg-rips-actions{flex-direction:column}.mg-rips-actions .mg-btn{justify-content:center}.mg-status{width:100%;box-sizing:border-box;text-align:center}.mg-timeline article{grid-template-columns:1fr}.mg-hero-actions{justify-content:stretch}}

/* Ventana clínica: el expediente se trabaja sin perder el panel principal. */
.mg-hub{max-width:1500px;margin:0 auto;padding:26px;font-family:"Inter","Segoe UI",sans-serif;color:#13283d}.mg-hub-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:26px 30px;border:1px solid #dce8ef;border-radius:24px;background:linear-gradient(120deg,#fff 0%,#eef9f6 100%);box-shadow:0 18px 46px rgba(20,55,77,.08)}.mg-hub-hero h1{margin:5px 0;font-size:clamp(28px,3vw,42px);letter-spacing:-.045em}.mg-hub-hero p{margin:0;color:#65798b}.mg-hub-grid{display:grid;grid-template-columns:minmax(280px,360px) 1fr;gap:18px;margin-top:18px}.mg-hub-grid .mg-side{position:static}.mg-hub-guide{min-height:430px;padding:38px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:radial-gradient(circle at 50% 20%,#effaf7,#fff 58%)}.mg-hub-guide>.material-symbols-outlined{font-size:72px;color:#22a78a}.mg-hub-guide h2{font-size:27px;margin:15px 0 6px}.mg-hub-guide p{max-width:560px;color:#65798b;margin:0 0 20px;line-height:1.6}
.mg-modal{--mg-ink:#13283d;--mg-blue:#2674d9;--mg-mint:#22a78a;--mg-line:#dce8ef;position:fixed;inset:0;z-index:2147482000;display:grid;place-items:center;padding:18px;background:rgba(9,27,43,.44);backdrop-filter:blur(8px);font-family:"Inter","Segoe UI",sans-serif;color:var(--mg-ink)}.mg-window{width:min(1540px,calc(100vw - 36px));height:min(940px,calc(100dvh - 36px));display:grid;grid-template-rows:auto auto minmax(0,1fr);overflow:hidden;border:1px solid rgba(255,255,255,.78);border-radius:24px;background:#f7fafc;box-shadow:0 28px 90px rgba(4,24,40,.32);transition:width .2s ease,height .2s ease,border-radius .2s ease}.mg-window.maximized{width:100vw;height:100dvh;border-radius:0}.mg-window.minimized{position:fixed;right:22px;bottom:18px;width:min(520px,calc(100vw - 32px));height:64px;display:block;border-radius:18px}.mg-window.minimized .mg-window-patient,.mg-window.minimized .mg-window-body{display:none}.mg-window-bar{height:62px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;padding:9px 13px 9px 18px;background:#13283d;color:#fff}.mg-window-title{display:flex;align-items:center;gap:11px;min-width:0}.mg-window-title>.material-symbols-outlined{width:40px;height:40px;display:grid;place-items:center;border-radius:12px;background:#22a78a}.mg-window-title b,.mg-window-title small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mg-window-title small{margin-top:2px;color:#b8cfdf;font-size:11px}.mg-window-controls{display:flex;gap:5px}.mg-window-controls button{width:38px;height:38px;display:grid;place-items:center;border:0;border-radius:10px;background:rgba(255,255,255,.1);color:#fff;cursor:pointer}.mg-window-controls button:hover{background:rgba(255,255,255,.2)}.mg-window-controls button.danger:hover{background:#d74f5b}.mg-window-controls .material-symbols-outlined{font-size:20px}.mg-window-patient{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 20px;border-bottom:1px solid var(--mg-line);background:#fff}.mg-window-patient>div:first-child{display:flex;align-items:center;gap:11px;min-width:190px}.mg-window-patient strong,.mg-window-patient small{display:block}.mg-window-patient small{color:#6a7e90;margin-top:2px}.mg-clinical-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.mg-btn.whatsapp{background:#e3f8ee;color:#087a4f}.mg-btn.whatsapp:hover{background:#c9f0df}.mg-window-body{overflow:auto;padding:20px 24px 26px;background:#f7fafc}.mg-window-body>.mg-patient-strip{display:none}.mg-window-body .mg-steps{position:sticky;top:-20px;z-index:8;margin:-20px -24px 20px;padding:14px 24px;background:rgba(247,250,252,.96);border-bottom:1px solid var(--mg-line);backdrop-filter:blur(10px)}.mg-window-body .mg-section{max-width:1380px;margin:0 auto;padding:24px;border:1px solid var(--mg-line);border-radius:20px;background:#fff;box-shadow:0 8px 24px rgba(22,57,78,.045)}.mg-window-body .mg-footer{max-width:1380px;margin:16px auto 0}.mg-document-renderer{font-family:Arial,sans-serif;color:#172536}.mg-ai-panel{max-width:1380px;margin:0 auto 18px}
@media(max-width:900px){.mg-hub{padding:14px}.mg-hub-grid{grid-template-columns:1fr}.mg-hub-guide{min-height:260px}.mg-modal{padding:0}.mg-window,.mg-window.maximized{width:100vw;height:100dvh;border-radius:0}.mg-window-patient{align-items:flex-start;flex-direction:column}.mg-clinical-actions{width:100%;justify-content:flex-start;overflow-x:auto;flex-wrap:nowrap;padding-bottom:3px}.mg-clinical-actions>*{flex:0 0 auto}.mg-window-body{padding:14px}.mg-window-body .mg-steps{top:-14px;margin:-14px -14px 14px;padding:11px 14px}.mg-window-body .mg-section{padding:17px}.mg-hub-hero{align-items:flex-start;flex-direction:column}}
@media(max-width:600px){.mg-window{grid-template-rows:auto auto minmax(0,1fr)}.mg-window-bar{height:58px;padding-left:10px}.mg-window-controls button{width:34px}.mg-window-controls button:nth-child(2){display:none}.mg-window-title b{font-size:13px;max-width:165px}.mg-window-title small{max-width:165px}.mg-window-title>.material-symbols-outlined{width:36px;height:36px}.mg-window-patient{padding:10px 12px}.mg-window-patient>div:first-child{display:none}.mg-clinical-actions .mg-status{display:none}.mg-clinical-actions .mg-btn{padding:9px 11px;font-size:12px}.mg-hub-hero{padding:21px}.mg-hub-guide{padding:24px}.mg-window.minimized{right:8px;bottom:8px;width:calc(100vw - 16px)}}

/* Ordenes CUPS y consentimiento informado */
.swal2-container.mg-swal-layer{z-index:2147483600!important;padding:16px!important}
.swal2-container.app-toast-layer{z-index:2147483647!important}
.swal2-container.mg-swal-layer .swal2-popup.mg-document-picker{width:min(640px,calc(100vw - 32px))!important;max-width:calc(100vw - 32px)!important;box-sizing:border-box!important;overflow:hidden!important;padding:30px!important}
.swal2-container.mg-swal-layer .mg-document-picker .swal2-title{padding:0!important;font-size:clamp(27px,4vw,42px)!important;line-height:1.08!important}
.swal2-container.mg-swal-layer .mg-document-picker select.mg-document-select{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important;margin:26px 0 0!important}
.swal2-container.mg-swal-layer .mg-document-picker .swal2-actions{margin:26px auto 0!important}
@media(max-width:600px){.swal2-container.mg-swal-layer .swal2-popup.mg-document-picker{padding:22px 16px!important}.swal2-container.mg-swal-layer .mg-document-picker .swal2-title{font-size:28px!important}.swal2-container.mg-swal-layer .mg-document-picker select.mg-document-select{font-size:18px!important}}
.mg-order-row{grid-template-columns:minmax(115px,.7fr) minmax(250px,1.7fr) minmax(210px,1.2fr) auto}
.mg-cups-popup{position:absolute;left:0;right:38px;top:calc(100% - 5px);z-index:45;max-height:320px;overflow:auto;padding:7px;border:1px solid #cbdce8;border-radius:14px;background:#fff;box-shadow:0 18px 45px rgba(19,40,61,.18)}
.mg-cups-option{display:grid;grid-template-columns:78px 1fr;gap:10px;width:100%;padding:9px 10px;border:0;border-radius:9px;background:transparent;text-align:left;color:#203449;cursor:pointer}
.mg-cups-option:hover,.mg-cups-option:focus{background:#edf7f5;outline:none}.mg-cups-option strong{color:#166c5d}.mg-cups-option span{line-height:1.3}
.mg-consent-choice{display:flex;flex-wrap:wrap;gap:12px 24px;min-height:45px;align-items:center;padding:10px 12px;border:1px solid #cfdee7;border-radius:12px;background:#f9fbfc}
.mg-consent-choice label{display:flex;align-items:center;gap:8px;font-size:13px;color:#294357;text-transform:none;letter-spacing:0;cursor:pointer}.mg-consent-choice input{width:18px;height:18px}
#medicina-general-root .mg-new-history{min-height:48px;padding:12px 19px!important;border:1px solid #175cae!important;background:linear-gradient(135deg,#173d69,#2479d8)!important;color:#fff!important;box-shadow:0 12px 28px rgba(31,105,190,.25)!important;font-weight:850!important;letter-spacing:.01em;white-space:nowrap}
#medicina-general-root .mg-new-history:hover{background:linear-gradient(135deg,#102f52,#176cc8)!important;transform:translateY(-1px);box-shadow:0 16px 32px rgba(31,105,190,.32)!important}
#medicina-general-root .mg-new-history:focus-visible{outline:3px solid rgba(36,121,216,.3)!important;outline-offset:3px}
#medicina-general-root .mg-new-history:disabled{background:#d8e2eb!important;border-color:#c9d5df!important;color:#718394!important;box-shadow:none!important;transform:none;cursor:not-allowed}
#medicina-general-root .mg-new-history-large{min-width:245px;justify-content:center;font-size:15px}
@media(max-width:900px){.mg-order-row{grid-template-columns:minmax(105px,.7fr) minmax(220px,1.5fr) minmax(180px,1fr) auto}}
@media(max-width:600px){.mg-order-row{grid-template-columns:1fr}.mg-cups-popup{right:0;top:72px}.mg-consent-choice{align-items:flex-start;flex-direction:column}#medicina-general-root .mg-new-history{width:100%;justify-content:center}}

/* Estación clínica compacta: más información útil por pantalla. */
@media(min-width:1100px){
  .mg-window-bar{height:52px}.mg-window-title>.material-symbols-outlined{width:34px;height:34px}.mg-window-controls button{width:34px;height:34px}
  .mg-window-patient{padding:9px 18px}.mg-window-patient .mg-avatar{width:38px;height:38px}.mg-clinical-actions .mg-btn{min-height:38px;padding:8px 12px;font-size:12px}.mg-clinical-actions .material-symbols-outlined{font-size:18px}
  .mg-window-body{padding:12px 18px 16px}.mg-window-body .mg-steps{top:-12px;margin:-12px -18px 12px;padding:9px 18px}.mg-step{padding:7px 11px;font-size:12px}
  .mg-window-body .mg-section{padding:16px 18px}.mg-section-head{display:flex;align-items:baseline;gap:14px;margin:0 0 12px}.mg-section-head h3{font-size:20px}.mg-section-head p{margin:0;font-size:12px}
  .mg-fields{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 12px}.mg-field{gap:4px}.mg-field label{font-size:10px}.mg-field input,.mg-field select,.mg-field textarea{min-height:38px;padding:8px 10px;border-radius:9px}.mg-field textarea{min-height:68px}
  .mg-section[data-section="2"] .mg-field.full,.mg-section[data-section="3"] .mg-field.full{grid-column:span 2}.mg-section[data-section="3"] .mg-vitals{grid-template-columns:repeat(5,minmax(100px,1fr))}
  .mg-footer{position:sticky;bottom:-16px;z-index:7;margin-top:12px!important;padding:9px 0 0!important;background:linear-gradient(transparent,#fff 24%)}
}
.mg-rips-actions{align-items:center}.mg-rips-copy{margin-right:auto}.mg-rips-copy b,.mg-rips-copy small{display:block}.mg-rips-copy small{margin-top:3px;color:#718394;font-size:11px;font-weight:500}
.mg-btn.mg-danger{border:1px solid #f1c4ca;background:#fff3f4;color:#a82435}.mg-btn.mg-danger:hover{background:#ffe4e7;color:#881b2a}
.mg-validation-list{display:grid;gap:7px;margin:15px 0 0;text-align:left}.mg-validation-list>div{display:flex;align-items:center;gap:8px;padding:9px 11px;border:1px solid #f1d2a9;border-radius:10px;background:#fff8ec;color:#754b14;font-size:14px;font-weight:700}.mg-validation-list .material-symbols-outlined{font-size:18px;color:#d97706}

/* Copiloto clínico continuo de Medicina General. */
.mg-window{position:relative}
.mg-voice-dock{position:absolute;right:22px;bottom:18px;z-index:30;display:grid;grid-template-columns:auto minmax(180px,1fr) auto;align-items:center;gap:11px;width:min(570px,calc(100% - 44px));padding:10px 11px;border:1px solid rgba(164,178,224,.6);border-radius:18px;background:rgba(255,255,255,.94);box-shadow:0 16px 44px rgba(30,49,91,.2);backdrop-filter:blur(20px) saturate(150%)}.mg-voice-orb{position:relative;display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:linear-gradient(145deg,#edf4ff,#e9e7ff);color:#4f46c8}.mg-voice-orb:before{content:"";position:absolute;inset:-5px;border:2px solid transparent;border-radius:inherit}.mg-voice-copy{min-width:0}.mg-voice-copy b,.mg-voice-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mg-voice-copy b{font-size:12px}.mg-voice-copy small{margin-top:3px;color:#718394;font-size:10px}.mg-voice-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:0;border-radius:12px;padding:10px 13px;background:#172f46;color:#fff;font-weight:800;cursor:pointer}.mg-voice-button .material-symbols-outlined{font-size:19px}.mg-voice-dock.recording{border-color:#f0a8b4}.mg-voice-dock.recording .mg-voice-orb{background:#fce7eb;color:#b4233b}.mg-voice-dock.recording .mg-voice-orb:before{border-color:rgba(210,45,75,.35);animation:mgVoicePulse 1.4s ease-out infinite}.mg-voice-dock.recording .mg-voice-button{background:#b4233b}.mg-voice-target{border-color:#665bd4!important;box-shadow:0 0 0 3px rgba(102,91,212,.13)!important}.mg-voice-filled{border-left:3px solid #665bd4!important}@keyframes mgVoicePulse{0%{transform:scale(.9);opacity:1}100%{transform:scale(1.35);opacity:0}}@media(max-width:700px){.mg-voice-dock{right:8px;bottom:8px;width:calc(100% - 16px);grid-template-columns:auto 1fr}.mg-voice-button{grid-column:1/-1}.mg-voice-copy small{max-width:230px}}
.mg-ai-btn{background:linear-gradient(135deg,#405de6,#7748d8);color:#fff}.mg-ai-panel{display:none;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:16px;border:1px solid #d9d6f4;border-radius:17px;background:linear-gradient(120deg,#fbfbff,#f4f8ff);box-shadow:0 12px 30px rgba(65,72,160,.09)}.mg-ai-panel.open{display:grid}.mg-ai-panel label{display:block;margin-bottom:6px;color:#303c69;font-size:11px;font-weight:850;letter-spacing:.06em;text-transform:uppercase}.mg-ai-panel textarea{width:100%;min-height:88px;box-sizing:border-box;padding:11px 12px;border:1px solid #cfd5ec;border-radius:11px;background:#fff;color:#172536;font:inherit;resize:vertical}.mg-ai-panel textarea:focus{outline:3px solid rgba(87,75,211,.14);border-color:#685bd4}.mg-ai-panel small{display:block;margin-top:6px;color:#66758a;line-height:1.4}.mg-ai-actions{display:flex;flex-direction:column;justify-content:center;gap:8px;min-width:180px}.mg-ai-actions .mg-btn{justify-content:center}.mg-ai-actions .recording{background:#b4233b;color:#fff;box-shadow:0 0 0 5px rgba(180,35,59,.12)}.mg-ai-status{grid-column:1/-1;color:#40507b;font-size:12px;font-weight:750}.mg-ai-review{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.mg-ai-review:empty{display:none}.mg-ai-review>div{display:flex;align-items:flex-start;gap:7px;padding:8px 10px;border-radius:9px;background:#edf3ff;color:#3e5572;font-size:12px}.mg-ai-review>div.alert{background:#fff4e8;color:#854d0e}.mg-ai-review .material-symbols-outlined{font-size:17px}.mg-ai-filled{border-color:#8c80df!important;box-shadow:inset 3px 0 #685bd4}.mg-field-mic{display:none!important}@media(max-width:700px){.mg-ai-panel.open{grid-template-columns:1fr}.mg-ai-actions{min-width:0;flex-direction:row}.mg-ai-actions .mg-btn{flex:1}.mg-ai-review{grid-template-columns:1fr}}

/* Expediente longitudinal: pacientes arriba, historias clínicas debajo. */
.mg-side{display:flex;flex-direction:column;min-height:0}.mg-side .mg-side-head{padding-bottom:12px;border-bottom:1px solid var(--mg-line)}.mg-side .mg-side-head h2{font-size:20px;letter-spacing:-.025em}.mg-side .mg-side-head small{display:block;margin-top:3px;line-height:1.4;color:#718394}.mg-side .mg-patient-list{max-height:285px;margin-top:8px;padding-right:4px}.mg-side .mg-patient{min-height:58px;padding:8px 9px;border:1px solid transparent}.mg-side .mg-patient.active{border-color:#cbe7df;background:#edf8f5;box-shadow:inset 3px 0 #168b75}.mg-side .mg-patient:not(.active):hover{border-color:#e1ebf0;background:#f7fafb}.mg-history-list{margin-top:16px;padding-top:16px;border-top:1px solid var(--mg-line)}.mg-history-list>header{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:10px}.mg-history-list h3{margin:2px 0 0;font-size:18px;letter-spacing:-.025em}.mg-history-kicker{color:#168b75;font-size:10px;font-weight:850;letter-spacing:.09em;text-transform:uppercase}.mg-history-list>div{display:grid;gap:8px}.mg-history-list .mg-recent-item{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:10px;align-items:center;width:100%;padding:10px;border:1px solid #dce8ed;border-radius:13px;background:#fff;box-shadow:0 4px 12px rgba(19,40,61,.035);transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease}.mg-history-list .mg-recent-item:hover{transform:translateY(-1px);border-color:#acd9ce;box-shadow:0 8px 18px rgba(19,40,61,.08)}.mg-history-list .mg-recent-item.active{padding:10px;border-color:#168b75;background:#f2faf8;box-shadow:0 0 0 2px rgba(22,139,117,.09)}.mg-history-date{display:grid;place-items:center;align-self:stretch;padding:5px 3px;border-radius:9px;background:#edf7f5;color:#146f5f;text-align:center}.mg-history-date b{font-size:17px;line-height:1}.mg-history-date small{margin-top:3px;color:#527a72;font-size:9px;font-weight:750;text-transform:uppercase}.mg-history-data{min-width:0;text-align:left}.mg-history-data b,.mg-history-data small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mg-history-data b{font-size:12px}.mg-history-data small{margin-top:3px;color:#607586;font-size:10px}.mg-history-data .mg-history-folio{color:#8a9aa6;font-size:9px}.mg-history-action{display:flex;align-items:center;gap:2px}.mg-history-action em{white-space:nowrap}.mg-history-action>.material-symbols-outlined{color:#8da0ad;font-size:18px}.mg-history-empty{display:grid;justify-items:center;gap:5px;padding:20px 12px;border:1px dashed #cddde4;border-radius:13px;background:#fafcfd;color:#718394;text-align:center}.mg-history-empty .material-symbols-outlined{font-size:28px;color:#20a086}.mg-history-empty p{margin:0;font-size:12px;line-height:1.45}@media(max-width:900px){.mg-side .mg-patient-list{max-height:220px}.mg-history-list .mg-recent-item{grid-template-columns:45px minmax(0,1fr) auto}}@media(prefers-reduced-motion:reduce){.mg-history-list .mg-recent-item{transition:none}.mg-history-list .mg-recent-item:hover{transform:none}}

/* El selector de pacientes vive exclusivamente dentro de Nueva historia clínica. */
.mg-hub-grid:has(.mg-history-board){grid-template-columns:1fr}.mg-history-board{padding:24px}.mg-history-board-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;padding-bottom:17px;border-bottom:1px solid var(--mg-line)}.mg-history-board-head h2{margin:3px 0 4px;font-size:24px;letter-spacing:-.035em}.mg-history-board-head p{margin:0;color:#687d8e}.mg-history-board>.mg-history-list{margin:0;padding:18px 0 0;border:0}.mg-history-board>.mg-history-list>div{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.mg-history-board .mg-recent-item{min-height:82px;padding:12px 14px;grid-template-columns:52px minmax(0,1fr) auto}.mg-history-board .mg-history-data b{font-size:14px}.mg-history-board .mg-history-data small{font-size:11px}.mg-history-board .mg-history-empty{grid-column:1/-1;padding:42px 20px}.mg-history-board .mg-history-empty .mg-btn{margin-top:8px}.mg-history-board .mg-history-empty .mg-btn>.material-symbols-outlined{font-size:18px;color:inherit}@media(max-width:760px){.mg-history-board{padding:17px}.mg-history-board>.mg-history-list>div{grid-template-columns:1fr}.mg-history-board-head{align-items:flex-start}.mg-history-board .mg-recent-item{grid-template-columns:47px minmax(0,1fr) auto}}
