html:has(body.epicrisis-page) {
  scroll-behavior: smooth;
}

@layer organisms {
  .epicrisis-shell {
    background:
      radial-gradient(circle at top left, rgb(255 255 255 / 0.3), transparent 18rem),
      radial-gradient(circle at bottom right, rgb(81 131 196 / 0.18), transparent 24rem),
      var(--color-brand-gradient-soft),
      var(--color-surface-muted);
    color: var(--color-text);
  }

  .epicrisis-content {
    width: min(100% - 2rem, 94rem);
    margin: 0 auto;
    padding: clamp(var(--space-4), 2vw, var(--space-7));
  }

  .epicrisis-top-sentinel {
    inline-size: 100%;
    block-size: 1px;
    margin-block-start: -1px;
    pointer-events: none;
  }

  .epicrisis-sections {
    gap: clamp(var(--space-4), 2vw, var(--space-6));
  }

  .epicrisis-header-actions {
    justify-content: center;
  }

  .epicrisis-header-actions .ui-button--ghost {
    border-color: transparent;
    background: transparent;
    color: var(--cidti-white);
    box-shadow: none;
  }

  .epicrisis-header-actions .ui-button--ghost:hover,
  .epicrisis-header-actions .ui-button--ghost:focus-visible {
    border-color: rgb(255 255 255 / 0.9);
    background: rgb(255 255 255 / 0.96);
    color: #16324e;
  }

  .epicrisis-hero {
    overflow: hidden;
    margin-top: var(--space-12);
    padding: clamp(var(--space-4), 2vw, var(--space-6));
  }

  .epicrisis-hero__copy {
    display: grid;
    gap: var(--space-4);
  }

  .epicrisis-hero__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
  }

  .epicrisis-hero__heading h1 {
    margin: 0;
  }

  .epicrisis-hero__summary {
    margin-bottom: 0;
  }

  .epicrisis-kv-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .epicrisis-kv {
    display: grid;
    gap: var(--space-1);
  }

  .epicrisis-kv span {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .epicrisis-kv strong {
    font-size: var(--font-size-sm);
  }

  .epicrisis-kv small {
    color: var(--color-text-subtle);
    font-size: var(--font-size-xs);
  }

  .epicrisis-hero__stats {
    align-content: start;
  }

  .epicrisis-status {
    max-width: 44rem;
    margin: var(--space-12) auto 0;
  }

  .epicrisis-status__heading {
    display: grid;
    gap: var(--space-2);
  }

  .epicrisis-status__heading h1 {
    margin: 0;
  }

  .epicrisis-status__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    color: var(--color-text-subtle);
    font-size: var(--font-size-sm);
  }

  .epicrisis-status__message {
    color: var(--color-text-muted);
    line-height: var(--line-height-relaxed);
  }

  .epicrisis-status__actions {
    margin-top: var(--space-2);
  }

  .epicrisis-page .container {
    display: grid;
    gap: clamp(var(--space-4), 2vw, var(--space-6));
  }

  .epicrisis-page .card {
    border: var(--border-width) solid color-mix(in srgb, var(--color-brand-support) 14%, white);
    border-radius: 1rem;
    background:
      radial-gradient(circle at top right, rgb(255 255 255 / 0.48), transparent 18rem),
      linear-gradient(180deg, rgb(255 255 255 / 0.96), rgb(255 255 255 / 0.9));
    box-shadow: var(--shadow-sm);
    padding: clamp(var(--space-4), 2vw, var(--space-6));
  }

  .epicrisis-page .card h2 {
    margin-bottom: var(--space-4);
    border-bottom: 2px solid color-mix(in srgb, var(--color-brand-primary) 32%, white);
    color: var(--color-brand-support);
    padding-bottom: var(--space-3);
    font-size: clamp(1.45rem, 2vw, 1.85rem);
  }

  .epicrisis-page .card h3 {
    margin: var(--space-5) 0 var(--space-3);
    border-left: 4px solid var(--color-brand-primary);
    color: var(--color-brand-support);
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    padding-left: var(--space-3);
  }

  .epicrisis-page .card h4,
  .epicrisis-page .card h5 {
    color: var(--color-brand-support);
  }

  .epicrisis-page .section-header {
    margin: calc(-1 * clamp(var(--space-4), 2vw, var(--space-6))) calc(-1 * clamp(var(--space-4), 2vw, var(--space-6)))
      var(--space-5);
    border-radius: 1rem 1rem 0 0;
    background: linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-brand-support) 90%, black) 0%,
      color-mix(in srgb, var(--color-brand-support) 70%, var(--color-brand-primary)) 100%
    );
    color: var(--cidti-white);
    font-size: clamp(1.1rem, 1.7vw, 1.3rem);
    font-weight: 700;
    padding: var(--space-4) clamp(var(--space-4), 2vw, var(--space-6));
  }

  .epicrisis-page .documento-info,
  .epicrisis-page .resumen-texto,
  .epicrisis-page .hallazgos-section {
    border-radius: 1rem;
    background: color-mix(in srgb, white 84%, var(--color-brand-support-soft) 16%);
    color: var(--color-text);
    padding: var(--space-4);
  }

  .epicrisis-page .documento-info {
    border-left: 4px solid var(--color-brand-support);
  }

  .epicrisis-page .resumen-texto {
    border-left: 4px solid var(--color-brand-primary);
    line-height: var(--line-height-loose);
  }

  .epicrisis-page .hallazgos-section {
    border-left: 4px solid var(--color-brand-support);
    line-height: var(--line-height-loose);
  }

  .epicrisis-page .hallazgos-section h4 {
    margin-top: 0;
  }

  .epicrisis-page table {
    width: 100%;
    margin: var(--space-4) 0;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: var(--radius-lg);
  }

  .epicrisis-page th,
  .epicrisis-page td {
    border: 1px solid var(--color-border);
    padding: 0.85rem 0.9rem;
    text-align: left;
    vertical-align: top;
  }

  .epicrisis-page th {
    background: color-mix(in srgb, var(--color-brand-support) 90%, white);
    color: var(--cidti-white);
    font-size: var(--font-size-sm);
    font-weight: 700;
  }

  .epicrisis-page tr:nth-child(even) {
    background: color-mix(in srgb, var(--color-brand-support-soft) 36%, white);
  }

  .epicrisis-page .muted {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
  }

  .epicrisis-page .badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xs);
    font-weight: 700;
    margin-left: var(--space-2);
    padding-inline: var(--space-3);
  }

  .epicrisis-page .badge-pre {
    background: color-mix(in srgb, var(--color-info-bg) 78%, white);
    color: var(--color-info);
  }

  .epicrisis-page .badge-post {
    background: color-mix(in srgb, var(--color-success-bg) 84%, white);
    color: var(--color-success);
  }

  .epicrisis-page .badge-post--warning {
    background: color-mix(in srgb, var(--color-warning-bg) 90%, white);
    color: var(--color-warning);
  }

  .epicrisis-page .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-4);
  }

  .epicrisis-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    border: var(--border-width) solid transparent;
    border-radius: var(--radius-md);
    background: var(--color-brand-support);
    color: var(--cidti-white);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 700;
    padding: 0.7rem 1rem;
    text-decoration: none;
    transition:
      background var(--transition-fast),
      transform var(--transition-fast);
  }

  .epicrisis-page .btn:hover {
    background: color-mix(in srgb, var(--color-brand-support) 80%, black);
    transform: translateY(-1px);
  }

  .epicrisis-page .btn-secondary {
    background: var(--color-text-muted);
  }

  .epicrisis-page .btn-success {
    background: var(--color-success);
  }

  .cache-badge {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-info-bg) 88%, white);
    color: var(--color-info);
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding-inline: var(--space-3);
  }

  .epicrisis-selection-note {
    margin-bottom: var(--space-3);
  }

  .epicrisis-inline-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
  }

  .selection-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .selection-grid--supporting {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: var(--space-4);
  }

  .selection-box {
    display: grid;
    gap: var(--space-3);
    align-content: start;
    border: var(--border-width) solid color-mix(in srgb, var(--color-brand-primary) 16%, white);
    border-radius: 1rem;
    background: color-mix(in srgb, white 90%, var(--color-brand-primary-soft) 10%);
    padding: var(--space-4);
  }

  .selection-box--stacked {
    margin-top: var(--space-4);
  }

  .selection-box h4 {
    margin: 0;
  }

  .selection-list {
    min-height: 16rem;
    max-height: 20rem;
    overflow-y: auto;
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface-raised);
    padding: var(--space-3);
  }

  .selection-item {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    font-size: var(--font-size-sm);
  }

  .selection-item + .selection-item {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid color-mix(in srgb, var(--color-border) 80%, white);
  }

  .selection-item--stacked {
    display: grid;
    gap: var(--space-1);
  }

  .selection-item input[type="checkbox"] {
    margin-top: 0.12rem;
  }

  .selection-item-content {
    display: grid;
    gap: var(--space-1);
    min-width: 0;
  }

  .selection-extra,
  .aid-filter,
  .epicrisis-page input[type="text"] {
    width: 100%;
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-raised);
    color: var(--color-text);
    font: inherit;
    padding: 0.75rem 0.85rem;
  }

  .selection-extra {
    min-height: 6.75rem;
    resize: vertical;
  }

  .selection-extra:focus,
  .aid-filter:focus,
  .epicrisis-page input[type="text"]:focus,
  .epicrisis-page textarea:focus,
  .epicrisis-page select:focus {
    border-color: var(--color-brand-primary);
    box-shadow: var(--focus-ring);
    outline: none;
  }

  .aid-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
  }

  .aid-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    border: var(--border-width) solid color-mix(in srgb, var(--color-border-strong) 75%, white);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, white 78%, var(--color-brand-support-soft) 22%);
    color: var(--color-text-muted);
    font-size: 0.7rem;
    line-height: 1;
    padding-inline: 0.45rem;
    white-space: nowrap;
  }

  .aid-badge.alert {
    border-color: var(--color-warning-border);
    background: var(--color-warning-bg);
    color: var(--color-warning);
  }

  .aid-badge.blocked {
    border-color: var(--color-error-border);
    background: var(--color-error-bg);
    color: var(--color-error);
  }

  .epicrisis-page pre {
    font-family: var(--font-secondary);
  }

  .epicrisis-scroll-top {
    position: fixed;
    inset-inline-end: clamp(var(--space-3), 2vw, var(--space-5));
    inset-block-end: clamp(var(--space-4), 3vw, var(--space-6));
    z-index: var(--z-header);
    border-color: rgb(255 255 255 / 0.7);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, white 72%, var(--color-brand-primary) 28%);
    box-shadow:
      0 18px 42px rgb(38 50 56 / 0.22),
      0 6px 18px rgb(38 50 56 / 0.12);
    color: var(--color-brand-support);
    backdrop-filter: blur(16px);
    transition:
      opacity var(--transition-fast),
      transform var(--transition-fast),
      visibility var(--transition-fast),
      background var(--transition-fast),
      color var(--transition-fast),
      border-color var(--transition-fast);
  }

  .epicrisis-scroll-top svg {
    inline-size: 1rem;
    block-size: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
  }

  .epicrisis-scroll-top:hover {
    border-color: color-mix(in srgb, var(--color-brand-support) 42%, white);
    background: var(--color-brand-support);
    color: var(--cidti-white);
  }

  body.epicrisis-scroll-top-managed .epicrisis-scroll-top {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.75rem) scale(0.96);
  }

  body.epicrisis-scroll-top-managed .epicrisis-scroll-top.epicrisis-scroll-top--visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .epicrisis-print-frame {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border: 0;
    visibility: hidden;
  }

  .agente-qx-status--error {
    color: #b91c1c;
  }

  .agente-qx-status--idle {
    color: #4b5563;
  }

  .is-hidden {
    display: none !important;
  }

  .epicrisis-stack-lg {
    display: grid;
    gap: var(--space-4);
  }

  .epicrisis-mt-lg {
    margin-top: var(--space-5);
  }

  .epicrisis-panel {
    border-left: 5px solid var(--color-brand-primary);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, white 86%, var(--color-brand-support-soft) 14%);
    padding: var(--space-5);
  }

  .epicrisis-panel--patient {
    background: #e8f4fd;
    border-left-color: #0d6efd;
  }

  .epicrisis-panel--summary {
    background: #f8f9fa;
    border-left-color: #007bff;
  }

  .epicrisis-panel--procedures {
    background: #e7f3ff;
    border-left-color: #0066cc;
  }

  .epicrisis-panel--medications {
    background: #f0f9ff;
    border-left-color: #06b6d4;
  }

  .epicrisis-panel--success {
    background: #f0f8f0;
    border-left-color: #28a745;
  }

  .epicrisis-panel--neutral {
    border-left-width: 4px;
    background: #f8f9fa;
    border-left-color: #6c757d;
    padding: var(--space-4);
  }

  .epicrisis-panel--info {
    background: #f3f4f6;
    border-left-color: #8b5cf6;
    padding: var(--space-4);
  }

  .epicrisis-panel--warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
  }

  .epicrisis-panel--glosa {
    background: #fff3cd;
    border-left-color: #ffc107;
  }

  .epicrisis-panel__title {
    margin: 0 0 var(--space-3);
    color: var(--color-brand-support);
    font-size: 1.1em;
  }

  .epicrisis-panel__title--underlined {
    border-bottom: 2px solid currentColor;
    font-size: 1.2em;
    padding-bottom: var(--space-2);
  }

  .epicrisis-panel--patient .epicrisis-panel__title,
  .epicrisis-panel--patient .epicrisis-key-value__value--accent {
    color: #0d6efd;
  }

  .epicrisis-panel--summary .epicrisis-panel__title {
    color: #2a5298;
  }

  .epicrisis-panel--procedures .epicrisis-panel__title {
    color: #0066cc;
  }

  .epicrisis-panel--medications .epicrisis-panel__title {
    color: #06b6d4;
  }

  .epicrisis-panel--success .epicrisis-panel__title {
    color: #28a745;
  }

  .epicrisis-panel--info .epicrisis-panel__title {
    color: #4b5563;
  }

  .epicrisis-panel--warning .epicrisis-panel__title,
  .epicrisis-panel--warning .epicrisis-callout,
  .epicrisis-panel--warning .epicrisis-note {
    color: #78350f;
  }

  .epicrisis-panel--glosa .epicrisis-note {
    color: #856404;
  }

  .epicrisis-callout {
    margin: 0;
    color: var(--color-text);
    font-size: 0.95em;
    line-height: var(--line-height-relaxed);
  }

  .epicrisis-callout + .epicrisis-callout {
    margin-top: var(--space-3);
  }

  .epicrisis-note {
    margin: 0 0 var(--space-3);
    font-size: 0.95em;
    line-height: var(--line-height-relaxed);
  }

  .epicrisis-text-justified {
    margin: 0;
    color: #333;
    line-height: 1.8;
    text-align: justify;
  }

  .epicrisis-list {
    margin: 0;
    padding-left: 1.6rem;
    line-height: 2;
  }

  .epicrisis-list li {
    color: #333;
  }

  .epicrisis-list li + li {
    margin-top: var(--space-2);
  }

  .epicrisis-list--mono li {
    font-family: "Courier New", monospace;
    font-size: 0.95em;
  }

  .epicrisis-patient-table {
    margin: 0;
    background: white;
  }

  .epicrisis-key-value {
    width: 35%;
    background: #f1f8ff;
    font-weight: 600;
  }

  .epicrisis-key-value__value--accent {
    color: #0d6efd;
    font-size: 1.05em;
    font-weight: 600;
  }

  .epicrisis-text-center {
    text-align: center;
  }

  .epicrisis-text-sm {
    font-size: 0.9em;
  }

  .epicrisis-col-35 {
    width: 35%;
  }

  .epicrisis-col-50 {
    width: 50%;
  }

  .epicrisis-col-65 {
    width: 65%;
  }

  .epicrisis-col-25 {
    width: 25%;
  }

  .epicrisis-col-15 {
    width: 15%;
  }

  .epicrisis-col-10 {
    width: 10%;
  }

  .section-header--violet {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  }

  .soat-form-controls {
    display: flex;
    gap: var(--space-3);
  }

  .codigo-input-group {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
  }

  .codigo-input-group input[name="codigo_soat"] {
    flex: 0 0 120px;
  }

  .codigo-input-group input[name="descripcion"] {
    flex: 1;
  }

  .codigo-input-remove {
    min-width: 2.5rem;
    padding-inline: 0.75rem;
  }

  .soat-results-list {
    display: grid;
    gap: var(--space-5);
  }

  .soat-summary {
    border: 2px solid #d1d5db;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    margin-top: var(--space-5);
    padding: var(--space-5);
  }

  .soat-summary__title,
  .soat-block__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
  }

  .soat-summary__icon {
    font-size: 1.3em;
  }

  .soat-summary__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
  }

  .soat-summary__card {
    border-left: 4px solid #8b5cf6;
    border-radius: var(--radius-md);
    background: white;
    padding: var(--space-4);
    text-align: center;
  }

  .soat-summary__card--cie10 {
    border-left-color: #3b82f6;
  }

  .soat-summary__card--cups {
    border-left-color: #10b981;
  }

  .soat-summary__value {
    font-size: 2em;
    font-weight: 700;
    color: #8b5cf6;
  }

  .soat-summary__card--cie10 .soat-summary__value {
    color: #3b82f6;
  }

  .soat-summary__card--cups .soat-summary__value {
    color: #10b981;
  }

  .soat-summary__label {
    margin-top: var(--space-1);
    color: #6b7280;
    font-size: 0.9em;
  }

  .soat-result-card {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.05);
    margin-bottom: var(--space-5);
    padding: var(--space-5);
  }

  .soat-result-card__header {
    margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-5)) var(--space-5);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: var(--space-4);
  }

  .soat-result-card__heading {
    margin: 0;
    color: white;
    font-size: 1.15em;
  }

  .soat-result-card__code {
    font-size: 1.1em;
    font-weight: 700;
  }

  .soat-result-card__description {
    margin: var(--space-2) 0 0;
    font-size: 0.95em;
    opacity: 0.95;
  }

  .soat-block {
    border-left: 5px solid #3b82f6;
    border-radius: var(--radius-lg);
    background: #dbeafe;
    margin-bottom: var(--space-4);
    padding: 18px;
  }

  .soat-block--cie10-secondary {
    border-left-color: #6366f1;
    background: #e0e7ff;
  }

  .soat-block--cups-primary {
    border-left-color: #10b981;
    background: #d1fae5;
  }

  .soat-block--cups-secondary {
    border-left-color: #34d399;
    background: #d1fae5;
  }

  .soat-block--analysis {
    border-left-color: #f59e0b;
    background: #fef3c7;
    margin-bottom: 0;
  }

  .soat-block__title {
    color: #1e40af;
    font-size: 1.1em;
  }

  .soat-block--cie10-secondary .soat-block__title {
    color: #4338ca;
    font-size: 1em;
  }

  .soat-block--cups-primary .soat-block__title {
    color: #065f46;
  }

  .soat-block--cups-secondary .soat-block__title {
    color: #047857;
    font-size: 1em;
  }

  .soat-block--analysis .soat-block__title {
    color: #92400e;
    font-size: 1em;
  }

  .soat-block__icon {
    font-size: 1.2em;
  }

  .soat-block__icon--lg {
    font-size: 1.3em;
  }

  .soat-entry {
    border: 1px solid #93c5fd;
    border-radius: var(--radius-md);
    background: white;
    padding: var(--space-4);
  }

  .soat-entry--secondary {
    border-color: #c7d2fe;
    margin-bottom: var(--space-3);
    padding: 12px;
  }

  .soat-entry--cups {
    border-color: #6ee7b7;
  }

  .soat-entry--cups-alt {
    border-color: #a7f3d0;
    margin-bottom: var(--space-3);
    padding: 12px;
  }

  .soat-entry--analysis {
    border-color: #fcd34d;
    max-height: 400px;
    overflow-y: auto;
  }

  .soat-entry__row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
  }

  .soat-entry__row--compact {
    gap: var(--space-2);
    margin-bottom: var(--space-2);
  }

  .soat-token {
    border-radius: var(--radius-md);
    background: #3b82f6;
    color: white;
    font-size: 1.05em;
    font-weight: 700;
    padding: 6px 14px;
  }

  .soat-token--secondary {
    border-radius: 4px;
    background: #6366f1;
    font-size: 0.9em;
    font-weight: 600;
    padding: 4px 10px;
  }

  .soat-token--cups {
    background: #10b981;
    letter-spacing: 1px;
  }

  .soat-token--cups-alt {
    border-radius: 4px;
    background: #34d399;
    font-size: 0.9em;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 4px 10px;
  }

  .soat-entry__description {
    flex: 1;
    color: #1e40af;
    font-weight: 600;
  }

  .soat-entry__description--secondary {
    color: #4338ca;
    font-size: 0.9em;
    font-weight: 500;
  }

  .soat-entry__description--cups {
    color: #065f46;
    font-size: 0.95em;
  }

  .soat-entry__description--cups-alt {
    color: #047857;
    font-size: 0.9em;
    font-weight: 500;
  }

  .soat-justification {
    margin: var(--space-3) 0 0;
    border-radius: 4px;
    background: #f0f9ff;
    color: #374151;
    font-size: 0.9em;
    line-height: 1.6;
    padding: var(--space-3);
  }

  .soat-justification strong {
    color: #1e40af;
  }

  .soat-justification--secondary {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 0.85em;
    line-height: 1.5;
    padding-left: 12px;
  }

  .soat-justification--secondary em {
    font-style: italic;
  }

  .soat-justification--cups {
    background: #ecfdf5;
  }

  .soat-justification--cups strong {
    color: #065f46;
  }

  .soat-analysis-pre {
    margin: 0;
    color: #374151;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9em;
    line-height: 1.7;
    white-space: pre-wrap;
  }
}

@media (max-width: 80rem) {
  .selection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 64rem) {
  .epicrisis-header-actions {
    gap: var(--space-2);
  }

  .epicrisis-kv-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 48rem) {
  .epicrisis-content {
    width: min(100% - 1rem, 94rem);
    padding: var(--space-3) 0 var(--space-5);
  }

  .epicrisis-header-actions {
    justify-content: center;
  }

  .selection-grid,
  .selection-grid--supporting {
    grid-template-columns: 1fr;
  }

  .epicrisis-scroll-top {
    inset-inline-end: var(--space-3);
    inset-block-end: var(--space-4);
    min-height: 2.5rem;
    padding-inline: 0.9rem;
  }
}
