
/* ===== Ficha A (Apple): barra lateral con resumen y secciones (solo escritorio ancho) + vista previa de fotografías ===== */
.pd-rail { display: none; }
.pd-prev-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pd-prev-th { position: relative; aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--card-2, #eef1f6); cursor: pointer; transition: transform 160ms cubic-bezier(.23, 1, .32, 1), box-shadow 200ms ease; }
.pd-prev-th:active { transform: scale(.97); }
.pd-prev-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-prev-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px; font-size: .68rem; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .62)); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-prev-more { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--blue, #2563eb); }
.pd-prev-more b { font-size: 1.2rem; }
.pd-prev-more span { font-size: .72rem; color: var(--muted); font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .pd-prev-th:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .18); } }
@media (prefers-reduced-motion: reduce) { .pd-prev-th { transition: none; } }
#patientDetail .pd-section[data-sec="fotos"] { --sec-c: var(--c-rx); }
@media (max-width: 834px) { .pd-prev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 835px) {
  #patientDetail.pd-has-rail { position: relative; padding-left: 244px; }
  #patientDetail.pd-has-rail > .pd-rail { display: block; position: absolute; left: 0; top: 0; bottom: 0; width: 232px; margin: 0 !important; grid-column: auto; grid-row: auto; }
  .pd-rail-in { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; max-height: calc(100vh - 24px); overflow: auto; }
  .pd-rail-back { display: inline-flex; align-items: center; gap: 2px; align-self: flex-start; margin: 0 0 10px -4px; padding: 4px 8px 4px 2px; min-height: 32px; border: 0; background: none; color: var(--blue, #2563eb); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; border-radius: 8px; }
  .pd-rail-back svg { width: 16px; height: 16px; }
  .pd-rail-who { display: flex; align-items: center; gap: 10px; padding: 0 6px 14px; }
  .pd-rail-who .pd-av { width: 38px; height: 38px; font-size: .85rem; }
  .pd-rail-who b { display: block; font-size: .88rem; line-height: 1.25; color: var(--ink); }
  .pd-rail-who .mono { font-size: .72rem; color: var(--muted); }
  .pd-rail-nav { display: flex; flex-direction: column; gap: 1px; }
  .pd-rail-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; background: none; border-radius: 9px; font: inherit; font-size: .84rem; color: var(--ink); cursor: pointer; text-align: left; transition: background-color 160ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1); }
  .pd-rail-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
  .pd-rail-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pd-rail-item em { font-style: normal; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
  .pd-rail-item:active { transform: scale(.97); }
  .pd-rail-facts { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
  .pd-rail-facts h6 { margin: 8px 8px 3px; font-size: .68rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); text-transform: none; }
  .pd-rail-fact { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 3px 8px; font-size: .8rem; color: var(--muted); }
  .pd-rail-fact b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .pd-rail-fact b.pd-rail-ok { color: var(--good, #2E9E6B); }
  .pd-rail-fact b.pd-rail-due { color: var(--warn, #DE9922); font-weight: 600; }
  #patientDetail.pd-has-rail .pd-card:has(> .pd-head) { grid-template-columns: minmax(0, 1fr) !important; }
  #patientDetail.pd-has-rail .pd-card:has(> .pd-head) .pd-back-mini,
  #patientDetail.pd-has-rail .pd-card:has(> .pd-head) .pd-av,
  #patientDetail.pd-has-rail .pd-card:has(> .pd-head) > .pd-stats { display: none !important; }
  #patientDetail.pd-has-rail .pd-card:has(> .pd-head) .pd-title { grid-column: 1; }
  #patientDetail.pd-has-rail .pd-card:has(> .pd-head) .pd-head-actions { grid-column: 1; }
  #patientDetail.pd-has-rail .pd-title h3 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1200px) { .pd-rail-item:hover, .pd-rail-back:hover { background: var(--card-2); } }
@media (prefers-reduced-motion: reduce) { .pd-rail-item { transition: none; } }
.pd-att-note { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.pd-att-note b { color: var(--ink); font-weight: 600; }
.pd-att-warn b { color: var(--warn, #DE9922); }
.bd-card { margin: 0 0 12px; }
.bd-card h2 { display: flex; align-items: center; gap: 8px; }
.bd-card h2 svg { width: 18px; height: 18px; color: var(--muted); }
.bd-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 0; }
.bd-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.bd-list li:first-child { border-top: 0; }
.bd-name { font-weight: 600; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.bd-name small { font-weight: 500; color: var(--muted); font-size: .78rem; }
.bd-note { font-size: .78rem; color: var(--muted); }
.bd-list button { height: 34px; min-height: 34px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; transition: transform 160ms cubic-bezier(.23, 1, .32, 1); }
.bd-list button:active { transform: scale(.97); }
.bd-list button svg { width: 15px; height: 15px; }
@media (max-width: 834px) { .bd-list li { flex-wrap: wrap; } .bd-list button { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .bd-list button { transition: none; } }
