/* 1andonly.care — Consultorio (panel del doctor y su equipo, páginas del paciente y receta impresa) */
.cx-badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; margin-left: auto; }
.dash-nav button .cx-badge { margin-left: auto; }
.cx-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cx-link:hover { text-decoration: underline; }
.cx-link .ico { width: 16px; height: 16px; }
.cx-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cx-danger { color: var(--danger) !important; }
.cx-warn { background: rgba(255, 92, 122, .12) !important; color: var(--danger) !important; }
.cx-warn-t { color: var(--danger); font-weight: 600; display: flex; gap: 8px; align-items: flex-start; }
.cx-ok { color: var(--deal-fg); font-weight: 600; display: flex; gap: 8px; align-items: flex-start; }
.cx-warn-t .ico, .cx-ok .ico { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.cx-only { font-size: 11px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.cx-only .ico { width: 13px; height: 13px; }
.field-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cx-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.is-busy { opacity: .65; pointer-events: none; }

/* arranque guiado */
.cx-start-h { display: flex; justify-content: space-between; align-items: baseline; }
.cx-start h3 small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.cx-progress { height: 6px; border-radius: 99px; background: var(--soft2); overflow: hidden; margin: 4px 0 12px; }
.cx-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--purple2), var(--accent)); border-radius: 99px; }
.cx-steps { list-style: none; display: grid; gap: 8px; margin: 0 0 10px; padding: 0; }
.cx-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.cx-steps li span:nth-child(2) { flex: 1; }
.cx-steps li.ok span:nth-child(2) { color: var(--muted); text-decoration: line-through; }
.cx-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; flex: none; }
.cx-steps li.ok .cx-dot { background: var(--purple); border-color: var(--purple); color: #fff; }
.cx-dot .ico { width: 13px; height: 13px; }

/* listas de pacientes */
.cx-toolbar { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.cx-search { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.cx-search .inp { flex: 1; }
.cx-search .sel { max-width: 190px; }
.cx-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.cx-count { margin: 4px 0 8px; }
.cx-plist, .cx-pick { display: grid; gap: 2px; }
.cx-pick { max-height: 52vh; overflow-y: auto; margin: 10px 0; }
.cx-prow, .cx-irow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px; border-radius: 12px; background: none; border: 0; color: var(--text); cursor: pointer; font: inherit; }
.cx-prow:hover, .cx-irow:hover { background: var(--hover-bg); }
.cx-irow.on { background: rgba(157, 139, 255, .15); }
.cx-irow .cx-pmain small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-irow .cx-pside small { white-space: nowrap; font-size: 11.5px; }
.cx-ava { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--purple2), var(--purple)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.cx-ava.lg { width: 54px; height: 54px; font-size: 18px; border-radius: 16px; }
.cx-pmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cx-pmain b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-pmain small { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; overflow: hidden; }
.cx-pside { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.cx-pside small { color: var(--muted); font-size: 12px; }
.cx-src-pl { display: inline-flex; align-items: center; gap: 4px; background: rgba(61, 31, 217, .12) !important; color: var(--accent) !important; }
.cx-src-pl .ico { width: 12px; height: 12px; }
.cx-st-nuevo { background: rgba(11, 111, 184, .14) !important; color: var(--info) !important; }
.cx-st-valoracion { background: rgba(157, 139, 255, .18) !important; color: var(--accent) !important; }
.cx-st-cotizado { background: rgba(255, 207, 92, .18) !important; color: var(--gold) !important; }
.cx-st-programado { background: rgba(20, 184, 166, .16) !important; color: #0f9488 !important; }
.cx-st-tratamiento { background: rgba(61, 31, 217, .16) !important; color: var(--purple2) !important; }
.cx-st-seguimiento, .cx-st-alta { background: rgba(47, 125, 31, .14) !important; color: var(--deal-fg) !important; }
.cx-st-inactivo { background: var(--soft2) !important; color: var(--muted) !important; }
.cx-empty { text-align: center; color: var(--muted); padding: 26px 10px; display: grid; gap: 10px; justify-items: center; font-size: 14px; max-width: 520px; margin: 0 auto; }
.ico.big { width: 38px; height: 38px; opacity: .5; }

/* ficha del paciente */
.cx-form { display: grid; gap: 12px; }
.cx-form-h { display: flex; justify-content: space-between; align-items: baseline; }
.cx-form-h h3 { margin: 0; }
.cx-dhead { display: grid; gap: 12px; margin-bottom: 16px; }
.cx-dname { display: flex; gap: 14px; align-items: center; }
.cx-dname h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.cx-dname p { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cx-dhead .sel { width: auto; min-width: 170px; }
.cx-cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cx-notes { display: grid; gap: 10px; margin-top: 14px; }
.cx-note { border-left: 3px solid var(--accent); padding: 6px 0 6px 12px; font-size: 14px; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.cx-note-h { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.cx-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cx-mini li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13.5px; }
.cx-mini li > b, .cx-mini li > span { display: flex; flex-direction: column; }
.cx-mini small { color: var(--muted); font-size: 12px; display: block; }
.cx-danger-zone { display: grid; gap: 4px; padding: 4px 2px 18px; }
.kv.cx-kv dd { overflow-wrap: anywhere; }

/* mensajes */
.cx-inbox { display: grid; grid-template-columns: minmax(250px, .85fr) minmax(0, 1.6fr); gap: 18px; align-items: start; }
.cx-ilist { max-height: 72vh; overflow-y: auto; }
.cx-thread { display: flex; flex-direction: column; gap: 10px; min-height: 360px; }
.cx-th-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cx-th-h > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cx-msgs { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; min-height: 200px; overflow-y: auto; padding: 6px 2px; }
.cx-b { max-width: 82%; align-self: flex-start; background: var(--soft2); border-radius: 16px 16px 16px 4px; padding: 10px 13px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.cx-b.mine { align-self: flex-end; background: linear-gradient(135deg, var(--purple2), var(--purple)); color: #fff; border-radius: 16px 16px 4px 16px; }
.cx-b.sys { align-self: center; background: none; color: var(--muted); font-size: 13px; }
.cx-b small { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
.cx-th-back { display: none; }
.cx-composer { display: flex; gap: 8px; align-items: flex-end; }
.cx-composer textarea { flex: 1; resize: vertical; min-height: 46px; }

/* recetas y equipo */
.cx-rxlist { display: grid; gap: 2px; margin-top: 8px; }
.cx-rxrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.cx-rxrow:first-child { border-top: 0; }
.cx-rxrow small { color: var(--muted); }

/* marca */
.cx-logo-up { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.cx-logo-up > div:nth-child(2) { display: grid; gap: 6px; justify-items: start; max-width: 420px; }
.cx-logo-prev { width: 96px; height: 96px; border-radius: 18px; background: #fff; border: 1px solid var(--line2); display: grid; place-items: center; overflow: hidden; color: #3D1FD9; font-weight: 800; font-size: 26px; }
.cx-logo-prev img { width: 100%; height: 100%; object-fit: contain; }
.cx-logo-prev.busy { opacity: .5; }
.cx-color { display: flex; gap: 8px; align-items: center; }
.cx-color input[type=color] { width: 46px; height: 40px; border: 1px solid var(--line2); border-radius: 10px; padding: 2px; background: var(--panel); cursor: pointer; }
.cx-color .inp { max-width: 110px; font-family: ui-monospace, monospace; }
.cx-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.cx-swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line2); cursor: pointer; }
.cx-bprev { border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; background: #fff; color: #14102e; max-width: 460px; }
.cx-bprev-h { background: var(--b); color: var(--bi); padding: 12px 16px; display: flex; gap: 10px; align-items: center; }
.cx-bprev-h img { width: 34px; height: 34px; border-radius: 8px; background: #fff; object-fit: contain; }
.cx-bprev-b { padding: 14px 16px; font-size: 13px; display: grid; gap: 8px; }
.cx-bprev-b i { height: 4px; width: 46%; border-radius: 4px; background: var(--b2); }
.cx-bprev small { display: block; padding: 0 16px 12px; color: #6b6690; font-size: 11px; }
.cx-navlogo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; }

/* modales */
.cx-modal { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); }
.cx-modal.wide { max-width: 820px; }
.cx-modal > .close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; color: var(--muted); z-index: 2; }
.cx-modal h2 { font-size: 21px; font-weight: 700; padding-right: 36px; display: flex; align-items: center; gap: 8px; }
.cx-items { display: grid; gap: 10px; }
.cx-item { border: 1px solid var(--line2); border-radius: 14px; padding: 12px; display: grid; gap: 10px; margin: 0; }
.cx-item legend { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 6px; display: flex; gap: 8px; align-items: center; }
.cx-legal { font-size: 13.5px; line-height: 1.6; color: var(--text-soft); }
.cx-legal a, .cx-form .consent a { color: var(--accent); text-decoration: underline; }

/* receta: vista previa e impresión */
.cx-rxprev { display: grid; gap: 14px; }
.cx-rxprev-box { background: #e9e7f3; border-radius: 14px; padding: 14px; overflow: auto; }
.rx-sheet { position: relative; background: #fff; color: #14102e; font-family: var(--font); width: 100%; max-width: 7.7in; margin: 0 auto; padding: 0.28in 0.32in 0.18in; box-sizing: border-box; display: flex; flex-direction: column; font-size: 10pt; line-height: 1.35; border-radius: 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; overflow: hidden; }
.rx-sheet.half { min-height: 4.9in; }
.rx-sheet.letter { min-height: 9.9in; }
.rx-h { display: flex; gap: 14px; align-items: flex-start; }
.rx-logo { width: 0.85in; height: 0.85in; object-fit: contain; flex: none; }
.rx-doc { flex: 1; display: flex; flex-direction: column; gap: 1px; font-size: 8.6pt; color: #3a3560; }
.rx-doc > b { font-size: 13pt; color: var(--b); letter-spacing: -.01em; }
.rx-doc b { color: #14102e; }
.rx-doc > b:first-child { color: var(--b); }
.rx-meta { text-align: right; display: flex; flex-direction: column; font-size: 8.4pt; color: #6b6690; }
.rx-meta b { font-size: 15pt; color: #14102e; letter-spacing: .04em; }
.rx-bar { height: 4px; border-radius: 4px; margin: 8px 0 8px; background: linear-gradient(90deg, var(--b), var(--b2)); }
.rx-pt, .rx-pt2 { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 9pt; }
.rx-pt2 { margin-top: 3px; }
.rx-body { flex: 1; display: grid; grid-template-columns: 0.42in 1fr; gap: 0 6px; margin-top: 10px; align-content: start; }
.rx-sym { font-size: 24pt; font-weight: 800; color: var(--b); line-height: 1; }
.rx-items { margin: 0; padding-left: 16px; display: grid; gap: 6px; }
.rx-items li { font-size: 10pt; }
.rx-items li div { font-size: 9.4pt; color: #3a3560; }
.rx-items em { display: block; font-size: 9pt; color: #6b6690; }
.rx-ins { grid-column: 2; margin-top: 8px; font-size: 9.4pt; }
.rx-f { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: end; margin-top: 12px; padding-top: 8px; border-top: 1px solid #e6e2fa; }
.rx-addr { font-size: 8.2pt; color: #3a3560; align-self: end; }
.rx-sign { display: flex; flex-direction: column; align-items: center; width: 1.9in; }
.rx-sign i { display: block; width: 100%; border-bottom: 1px solid #14102e; height: 0.42in; }
.rx-sign span { font-size: 7.8pt; color: #6b6690; margin-top: 2px; }
.rx-qr { display: flex; gap: 6px; align-items: center; font-size: 7pt; color: #3a3560; line-height: 1.3; }
.rx-qr svg { width: 0.78in; height: 0.78in; }
.rx-pw { text-align: right; font-size: 6.8pt; color: #8b87ab; margin-top: 4px; }
.rx-void { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54pt; font-weight: 900; color: rgba(229, 72, 77, .22); transform: rotate(-18deg); pointer-events: none; }
#cxPrint { display: none; }
@media print {
  @page { size: letter portrait; margin: 0.4in; }
  html.cx-printing body > *:not(#cxPrint) { display: none !important; }
  html.cx-printing, html.cx-printing body { background: #fff !important; }
  html.cx-printing #cxPrint { display: block !important; }
  html.cx-printing #cxPrint .rx-sheet { border-radius: 0; max-width: none; width: 7.7in; }
  html.cx-printing #cxPrint .rx-sheet.half { height: 4.95in; min-height: 0; border-bottom: 1px dashed #b9b5d4; }
  html.cx-printing #cxPrint .rx-sheet.letter { height: 10.1in; min-height: 0; }
}

/* páginas del paciente, verificación e invitación */
.cx-page { padding-top: 26px; padding-bottom: 40px; max-width: 1040px; }
.cx-ph { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 18px 20px; border-radius: 18px; background: var(--b); color: var(--bi); margin-bottom: 18px; }
.cx-ph h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.cx-ph p { opacity: .85; font-size: 14px; }
.cx-ph > div:nth-child(2) { flex: 1; }
.cx-ph .btn-ghost { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); color: inherit; }
.cx-ph-logo { width: 58px; height: 58px; border-radius: 14px; background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--b); font-weight: 800; font-size: 20px; }
.cx-ph-logo img { width: 100%; height: 100%; object-fit: contain; }
.cx-ph .verified .ico { width: 20px; height: 20px; vertical-align: -3px; }
.cx-pt-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cx-page .cx-b.mine { background: var(--b); color: var(--bi); }
.cx-page .btn-primary { background: var(--b); color: var(--bi); box-shadow: none; }
.cx-consent summary { cursor: pointer; font-size: 14px; line-height: 1.5; }
.cx-consent[open] summary { margin-bottom: 12px; }
.cx-pw { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }
.cx-pw a { color: var(--accent); }
.cx-verify { max-width: 640px; margin: 20px auto; display: grid; gap: 12px; }
.cx-verify h1 { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.cx-verify h1 .ico { width: 28px; height: 28px; }
.cx-verify.good h1 { color: var(--deal-fg); }
.cx-verify.bad h1 { color: var(--danger); }
.cx-vform { margin-top: 6px; }
.cx-vform .inp { max-width: 240px; font-family: ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }

/* botón de mensaje en el sitio del doctor */
.ds-cta .cx-msg { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .45); color: #fff; }
.ds-cta .cx-msg:hover { background: rgba(255, 255, 255, .24); }
.ds-bar .cx-msg { background: var(--soft2); color: var(--text); border: 1px solid var(--line2); }

@media screen and (max-width: 900px) {
  .cx-cols, .cx-inbox, .cx-pt-grid { grid-template-columns: 1fr; }
  .cx-inbox.has-th .cx-ilist { display: none; }
  .cx-th-back { display: inline-flex; }
  .field-row.four { grid-template-columns: 1fr 1fr; }
  .rx-f { grid-template-columns: 1fr; }
}

/* acceso: Turnstile y Google */
.acc-ts:empty { display: none; }
.acc-ts { min-height: 0; }
.acc-g { display: grid; gap: 10px; }
.acc-gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.acc-gbtn:hover { background: #f8f9fa; }
.acc-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.acc-or::before, .acc-or::after { content: ''; flex: 1; height: 1px; background: var(--line2); }
