
    :root {
      --bg: #f6f8fb;
      --panel: #ffffff;
      --ink: #172033;
      --muted: #65708a;
      --line: #e3e8f2;
      --brand: #2563eb;
      --brand-strong: #1d4ed8;
      --soft: #eff6ff;
      --danger: #dc2626;
      --warn: #d97706;
      --ok: #059669;
      --shadow: 0 16px 45px rgba(15, 23, 42, .08);
      --radius: 8px;
      --sidebar-bg: #0f172a;
      --sidebar-bg-2: #1e293b;
      --sidebar-ink: #dbeafe;
      --sidebar-muted: #94a3b8;
      --sidebar-accent: #38bdf8;
      --sidebar-highlight: rgba(255,255,255,.12);
      --sidebar-pattern: radial-gradient(circle at top left, rgba(56,189,248,.18), transparent 35%);
      --sidebar-panel-bg: rgba(255,255,255,.08);
    }

    * { box-sizing: border-box; }
    html {
      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
    }
    body {
      margin: 0;
      background: var(--bg);
      color: var(--ink);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      min-height: 100vh;
      overflow-x: hidden;
    }
    body.sidebar-scroll-locked {
      overflow: hidden;
      overscroll-behavior: none;
    }
    button, input, select, textarea { font: inherit; }
    button {
      border: 0;
      border-radius: 7px;
      cursor: pointer;
      background: var(--brand);
      color: #fff;
      padding: 10px 14px;
      font-weight: 700;
    }
    button:hover { background: var(--brand-strong); }
    button.secondary {
      background: #eef2f7;
      color: var(--ink);
    }
    button.secondary:hover { background: #e3e8f0; }
    button.ghost {
      background: transparent;
      color: var(--muted);
      padding: 8px 10px;
    }
    button.danger { background: var(--danger); }
    button.small { padding: 7px 10px; font-size: 13px; }
    input, select, textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 10px 11px;
      background: #fff;
      color: var(--ink);
      outline: none;
    }
    input:focus, select:focus, textarea:focus {
      border-color: #93c5fd;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    }
    textarea { min-height: 88px; resize: vertical; }
    label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
    .password-field {
      position: relative;
      display: block;
    }
    .password-field input { padding-right: 72px; }
    .password-toggle {
      position: absolute;
      right: 6px;
      top: 50%;
      transform: translateY(-50%);
      padding: 6px 9px;
      background: #eef2f7;
      color: var(--ink);
      font-size: 12px;
    }
    .password-toggle:hover { background: #e3e8f0; }

    .hidden { display: none !important; }
    .login-wrap {
      position: relative;
      isolation: isolate;
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 32px 24px;
      overflow: hidden;
      background:
        radial-gradient(circle at 22% 20%, rgba(255,255,255,.92), transparent 22%),
        radial-gradient(circle at 78% 76%, rgba(198, 210, 255, .34), transparent 28%),
        linear-gradient(135deg, #fbfbff 0%, #f1f4ff 48%, #edf2ff 100%);
    }
    .login-wrap::before {
      content: '';
      position: absolute;
      inset: -8% auto -12% -10%;
      width: min(34vw, 420px);
      background:
        repeating-linear-gradient(165deg,
          rgba(169, 176, 204, .12) 0 2px,
          rgba(255,255,255,0) 2px 44px);
      opacity: .9;
      transform: skewX(-10deg);
      pointer-events: none;
    }
    .login-wrap::after {
      content: '';
      position: absolute;
      inset: 14% -8% 6% 42%;
      background:
        radial-gradient(circle at center, rgba(176, 190, 255, .22), transparent 58%);
      filter: blur(20px);
      pointer-events: none;
    }
    .login-card {
      position: relative;
      z-index: 1;
      width: min(410px, 100%);
      background: rgba(255,255,255,.78);
      border: 1px solid rgba(255,255,255,.74);
      border-radius: 24px;
      box-shadow:
        0 28px 70px rgba(95, 112, 168, .18),
        inset 0 1px 0 rgba(255,255,255,.92);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      padding: 38px 36px 40px;
    }
    .login-brand {
      display: grid;
      justify-items: center;
      gap: 16px;
      margin-bottom: 30px;
    }
    .login-title {
      margin: 0;
      color: #35415e;
      font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
      font-size: clamp(24px, 3.3vw, 34px);
      font-weight: 500;
      letter-spacing: .34em;
      text-indent: .34em;
      line-height: 1;
      text-align: center;
    }
    .login-divider {
      width: 50px;
      height: 2px;
      border-radius: 999px;
      background: linear-gradient(90deg, rgba(170, 180, 244, .18), rgba(155, 167, 245, .98), rgba(170, 180, 244, .18));
    }
    .login-form {
      display: grid;
      gap: 18px;
    }
    .login-field {
      display: grid;
      gap: 10px;
    }
    .login-field label {
      display: block;
      color: #8f98b2;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .12em;
    }
    .login-input-wrap {
      position: relative;
      display: flex;
      align-items: center;
    }
    .login-input-icon {
      position: absolute;
      left: 16px;
      display: grid;
      place-items: center;
      color: #a4acc2;
      pointer-events: none;
    }
    .login-input {
      width: 100%;
      min-height: 56px;
      padding: 15px 52px 15px 50px;
      border: 1px solid rgba(191, 199, 225, .58);
      border-radius: 14px;
      background: rgba(255,255,255,.58);
      color: #55627d;
      font-size: 15px;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.82),
        0 10px 24px rgba(223, 229, 247, .24);
    }
    .login-input::placeholder {
      color: #b5bcd0;
    }
    .login-input:focus {
      border-color: #b5bef6;
      box-shadow:
        0 0 0 4px rgba(177, 186, 249, .18),
        inset 0 1px 0 rgba(255,255,255,.9);
    }
    .login-password-toggle {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      width: 34px;
      height: 34px;
      padding: 0;
      border-radius: 999px;
      background: transparent;
      color: #a4acc2;
      display: grid;
      place-items: center;
    }
    .login-password-toggle:hover {
      background: rgba(181, 190, 246, .12);
      color: #7f89aa;
    }
    .login-submit {
      width: 100%;
      min-height: 54px;
      margin-top: 6px;
      border-radius: 12px;
      border: 1px solid rgba(191, 197, 247, .62);
      background: linear-gradient(135deg, rgba(203, 208, 251, .98), rgba(172, 181, 248, .98));
      color: rgba(255,255,255,.96);
      box-shadow: 0 16px 32px rgba(171, 181, 248, .28);
      font-size: 14px;
      font-weight: 500;
      letter-spacing: .22em;
      text-transform: uppercase;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 16px;
      transition: background .2s ease, box-shadow .2s ease, border-color .2s ease, transform .2s ease, filter .2s ease;
    }
    .login-submit::after {
      content: '\2192';
      font-size: 22px;
      line-height: 1;
      font-weight: 400;
    }
    .login-submit:hover {
      background: linear-gradient(135deg, rgba(191, 198, 251, .98), rgba(160, 172, 247, .98));
    }
    .login-submit.is-ready {
      border-color: rgba(134, 148, 241, .92);
      background: linear-gradient(135deg, rgba(157, 168, 248, 1), rgba(122, 136, 236, 1));
      box-shadow: 0 18px 36px rgba(124, 138, 236, .4);
      filter: saturate(1.08);
    }
    .login-submit.is-ready:hover {
      background: linear-gradient(135deg, rgba(144, 156, 244, 1), rgba(109, 124, 231, 1));
      transform: translateY(-1px);
    }
    .login-submit:disabled {
      opacity: .82;
      cursor: wait;
      transform: none;
    }
    h1, h2, h3 { margin: 0; }
    .muted { color: var(--muted); }
    .stack { display: grid; gap: 14px; }
    .error {
      background: #fef2f2;
      color: #991b1b;
      border: 1px solid #fecaca;
      padding: 10px 12px;
      border-radius: 7px;
      font-weight: 700;
      font-size: 14px;
    }

    .shell {
      --mobile-sidebar-width: min(300px, 86vw);
      --mobile-sidebar-offset: 0px;
      display: grid;
      grid-template-columns: 94px 1fr;
      min-height: 100vh;
      transition: grid-template-columns .22s ease;
    }
    .shell.sidebar-expanded { grid-template-columns: 260px 1fr; }
    .sidebar {
      background:
        var(--sidebar-pattern),
        linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
      color: var(--sidebar-ink);
      padding: 18px 12px;
      display: flex;
      flex-direction: column;
      gap: 18px;
      position: sticky;
      top: 0;
      height: 100vh;
      overflow: hidden;
      transition: padding .22s ease, background .22s ease, box-shadow .22s ease;
    }
    .shell.sidebar-expanded .sidebar {
      padding-inline: 18px;
      box-shadow: 14px 0 36px rgba(15, 23, 42, .12);
    }
    .sidebar::before {
      content: '';
      position: absolute;
      inset: 0;
      background:
        radial-gradient(circle at 14% 18%, rgba(255,255,255,.12), transparent 16%),
        radial-gradient(circle at 82% 22%, rgba(255,255,255,.09), transparent 18%),
        linear-gradient(140deg, transparent 30%, rgba(255,255,255,.06), transparent 70%);
      opacity: .8;
      pointer-events: none;
    }
    .sidebar > * { position: relative; z-index: 1; }
    .sidebar .logo { width: 36px; height: 36px; }
    .sidebar .brandline {
      margin-bottom: 0;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
    }
    .sidebar h2 { color: #fff; font-size: 17px; }
    .sidebar-head {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }
    .sidebar-title-group {
      min-width: 0;
      display: grid;
      gap: 2px;
      transition: opacity .18s ease;
    }
    .sidebar-title-group h2 {
      margin: 0;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .sidebar-title-group .muted { color: var(--sidebar-muted) !important; }
    .nav { display: grid; gap: 6px; }
    .nav button {
      background: transparent;
      color: color-mix(in srgb, var(--sidebar-ink) 82%, white 18%);
      text-align: left;
      padding: 10px 11px;
      border-radius: 7px;
      position: relative;
      overflow: hidden;
    }
    .nav button:hover, .nav button.active {
      background: var(--sidebar-highlight);
      color: #fff;
    }
    .nav button.active {
      box-shadow: inset 3px 0 0 var(--sidebar-accent);
    }
    .sidebar-preview-slot {
      display: grid;
      gap: 10px;
      margin-top: 12px;
    }
    .sidebar-preview-card {
      display: grid;
      gap: 8px;
      padding: 11px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,.16);
      background: var(--sidebar-panel-bg);
      color: #fff;
    }
    .sidebar-preview-kicker {
      color: var(--sidebar-muted);
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .06em;
      text-transform: uppercase;
    }
    .sidebar-preview-copy {
      display: grid;
      gap: 4px;
      font-size: 13px;
    }
    .sidebar-preview-copy b {
      font-size: 14px;
    }
    .sidebar-preview-card button {
      width: 100%;
      justify-content: center;
    }
    .userbox {
      margin-top: auto;
      border-top: 1px solid rgba(255,255,255,.12);
      padding-top: 14px;
      display: grid;
      gap: 10px;
      font-size: 13px;
      min-width: 0;
      transition: opacity .18s ease;
    }
    .userbox > div {
      min-width: 0;
    }
    #userName,
    #userRole {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    #userRole { color: var(--sidebar-muted); }
    .userbox .secondary {
      background: rgba(255,255,255,.12);
      color: #fff;
    }
    .userbox .secondary:hover { background: rgba(255,255,255,.2); }
    .userbox .ghost { color: var(--sidebar-muted); }
    .userbox .ghost:hover { color: #fff; }
    .shell:not(.sidebar-expanded) .sidebar-title-group,
    .shell:not(.sidebar-expanded) #userRole,
    .shell:not(.sidebar-expanded) .sidebar-preview-copy,
    .shell:not(.sidebar-expanded) .userbox .secondary,
    .shell:not(.sidebar-expanded) .userbox .ghost {
      display: none;
    }
    .shell:not(.sidebar-expanded) .sidebar .brandline,
    .shell:not(.sidebar-expanded) .sidebar-preview-slot,
    .shell:not(.sidebar-expanded) .userbox {
      justify-items: center;
    }
    .shell:not(.sidebar-expanded) .sidebar-preview-card {
      padding: 6px;
      border-radius: 999px;
    }
    .shell:not(.sidebar-expanded) .sidebar-preview-card button {
      width: auto;
      min-width: 46px;
      padding-left: 10px;
      padding-right: 10px;
    }
    .shell:not(.sidebar-expanded) .sidebar-head {
      width: 100%;
      justify-content: center;
    }
    .shell:not(.sidebar-expanded) .nav button {
      color: transparent;
      min-height: 44px;
      padding: 10px 0;
    }
    .shell:not(.sidebar-expanded) .nav button::after {
      content: attr(data-short);
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      color: color-mix(in srgb, var(--sidebar-ink) 88%, white 12%);
      font-size: 11px;
      font-weight: 900;
      letter-spacing: .04em;
    }
    .shell:not(.sidebar-expanded) .nav button.active::after,
    .shell:not(.sidebar-expanded) .nav button:hover::after {
      color: #fff;
    }
    .content {
      padding: 22px;
      display: grid;
      gap: 18px;
      align-content: start;
      position: relative;
      z-index: 31;
      min-width: 0;
    }
    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      min-width: 0;
    }
    .topbar-main {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .topbar-copy {
      display: grid;
      gap: 4px;
      min-width: 0;
    }
    .topbar h1 { font-size: 31px; }
    .topbar-actions, .print-controls {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      min-width: 0;
    }
    .preview-banner {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 12px;
      border-radius: 999px;
      border: 1px solid rgba(37, 99, 235, .14);
      background: rgba(219, 234, 254, .72);
      color: #1d4ed8;
      font-size: 15px;
      font-weight: 800;
    }
    .preview-banner button {
      background: transparent;
      color: inherit;
      padding: 0;
      min-height: auto;
    }
    .print-controls select { width: 160px; }
    .mobile-menu { display: none; }
    .mobile-sidebar-toggle { display: none; }
    .sidebar-backdrop { display: none; }
    .mobile-app-chip,
    .mobile-user-badge,
    .mobile-insight,
    .mobile-panel-heading,
    .mobile-bottom-nav,
    .mobile-fab,
    .phone-census-view {
      display: none;
    }
    .stats {
      display: grid;
      grid-template-columns: repeat(5, minmax(118px, 1fr));
      gap: 12px;
    }
    .stat {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 14px;
      box-shadow: 0 14px 34px rgba(15, 23, 42, .04);
    }
    .stat b { display: block; font-size: 31px; }
    .stat span { color: var(--muted); font-size: 16px; font-weight: 700; }
    .stat.stat-women {
      border-color: color-mix(in srgb, #BE185D 18%, white);
      background: linear-gradient(180deg, #fff, rgba(190, 24, 93, .05));
    }
    .stat.stat-men {
      border-color: color-mix(in srgb, #0F766E 18%, white);
      background: linear-gradient(180deg, #fff, rgba(15, 118, 110, .05));
    }
    .stat.stat-incidence {
      border-color: color-mix(in srgb, #F59E0B 20%, white);
      background: linear-gradient(180deg, #fff, rgba(245, 158, 11, .06));
    }
    .stat.stat-pending {
      border-color: color-mix(in srgb, #2563EB 18%, white);
      background: linear-gradient(180deg, #fff, rgba(37, 99, 235, .05));
    }
    .toolbar {
      display: grid;
      grid-template-columns: minmax(210px, .72fr) auto 170px auto;
      gap: 10px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 12px;
      min-width: 0;
    }
    .census-filter-group {
      display: inline-flex;
      gap: 6px;
      align-items: center;
      flex-wrap: wrap;
    }
    .census-filter-group.hidden { display: none !important; }
    .filter-toggle {
      min-width: 88px;
      border: 1px solid transparent;
      color: var(--filter-color, #334155);
      background: color-mix(in srgb, var(--filter-color, #334155) 12%, white);
      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--filter-color, #334155) 22%, white);
    }
    .filter-toggle.filter-all { --filter-color: #4B5563; }
    .filter-toggle.filter-women { --filter-color: #BE185D; }
    .filter-toggle.filter-men { --filter-color: #0F766E; }
    .filter-toggle.filter-doctor { --filter-color: #1D4ED8; }
    .filter-toggle:hover {
      border-color: color-mix(in srgb, var(--filter-color, #334155) 72%, white);
      background: color-mix(in srgb, var(--filter-color, #334155) 16%, white);
    }
    .filter-toggle.active {
      background: var(--filter-color, #0f172a);
      border-color: var(--filter-color, #0f172a);
      color: #f8fafc;
      box-shadow: 0 10px 24px color-mix(in srgb, var(--filter-color, #0f172a) 28%, transparent);
    }
    .pending-toolbar {
      grid-template-columns: 1fr auto auto;
      align-items: center;
    }
    .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      overflow: hidden;
      min-width: 0;
    }
    #patientsPanel { overflow: visible; }
    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 16px;
      table-layout: fixed;
    }
    th, td {
      padding: 11px 9px;
      border-bottom: 1px solid var(--line);
      vertical-align: top;
      text-align: left;
    }
    th {
      background: #f8fafc;
      color: #475569;
      font-size: 14px;
      text-transform: uppercase;
      letter-spacing: .04em;
    }
    #patientsTableWrap {
      max-width: 100%;
      overflow: hidden;
    }
    #patientsTableWrap th:nth-child(1),
    #patientsTableWrap td:nth-child(1) { width: 7%; }
    #patientsTableWrap th:nth-child(2),
    #patientsTableWrap td:nth-child(2) { width: 13%; }
    #patientsTableWrap th:nth-child(3),
    #patientsTableWrap td:nth-child(3) { width: 4%; }
    #patientsTableWrap th:nth-child(4),
    #patientsTableWrap td:nth-child(4) { width: 4%; }
    #patientsTableWrap th:nth-child(5),
    #patientsTableWrap td:nth-child(5) { width: 11%; }
    #patientsTableWrap th:nth-child(6),
    #patientsTableWrap td:nth-child(6) { width: 28%; }
    #patientsTableWrap th:nth-child(7),
    #patientsTableWrap td:nth-child(7) { width: 8%; }
    #patientsTableWrap th:nth-child(8),
    #patientsTableWrap td:nth-child(8) { width: 7%; }
    #patientsTableWrap th:nth-child(9),
    #patientsTableWrap td:nth-child(9) { width: 12%; }
    #patientsTableWrap th:nth-child(10),
    #patientsTableWrap td:nth-child(10) { width: 6%; }
    .section-mujeres {
      --section-accent: #BE185D;
      --section-accent-strong: #9d174d;
      --section-halo: rgba(190, 24, 93, .18);
      --section-soft: rgba(190, 24, 93, .06);
    }
    .section-hombres {
      --section-accent: #0F766E;
      --section-accent-strong: #115e59;
      --section-halo: rgba(15, 118, 110, .18);
      --section-soft: rgba(15, 118, 110, .06);
    }
    .tx-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 800;
      background: rgba(148, 163, 184, .14);
      color: #334155;
    }
    .tx-chip.fresh {
      color: #15803d;
      background: rgba(34, 197, 94, .12);
    }
    .tx-chip.warning {
      color: #b45309;
      background: rgba(245, 158, 11, .14);
    }
    .tx-chip.danger {
      color: #b91c1c;
      background: rgba(239, 68, 68, .12);
    }
    .tx-chip::before {
      content: '';
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: currentColor;
      opacity: .88;
    }
    .tx-modal {
      display: grid;
      gap: 16px;
    }
    .tx-modal-head {
      display: grid;
      gap: 10px;
      padding: 14px;
      border-radius: 18px;
      background: linear-gradient(180deg, #f8fbff, #eef4ff);
      border: 1px solid #dbe6f5;
    }
    .tx-modal-kicker {
      color: #64748b;
      font-size: 11px;
      font-weight: 900;
      letter-spacing: .12em;
      text-transform: uppercase;
    }
    .tx-modal-title {
      color: #172033;
      font-size: 24px;
      font-weight: 900;
      line-height: 1.04;
    }
    .tx-modal-meta {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      color: #475467;
      font-size: 12px;
      font-weight: 800;
    }
    .tx-modal-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
      gap: 14px;
      align-items: start;
    }
    .tx-panel {
      display: grid;
      gap: 12px;
      padding: 14px;
      border-radius: 18px;
      border: 1px solid #dde6f2;
      background: #fff;
      box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
    }
    .tx-panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .tx-panel-head.compact {
      align-items: flex-start;
      justify-content: flex-start;
    }
    .tx-panel-title {
      color: #172033;
      font-size: 13px;
      font-weight: 900;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    .tx-panel-copy {
      color: #64748b;
      font-size: 12px;
      font-weight: 700;
    }
    .tx-preview {
      min-height: 146px;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      line-height: 1.38;
      border: 1px solid #dbe4ef;
      border-radius: 16px;
      background: #f8fafc;
      padding: 14px;
    }
    .tx-preview.fresh {
      background: #ecfdf5;
      border-color: #86efac;
    }
    .tx-preview.warning {
      background: #fffbeb;
      border-color: #fcd34d;
    }
    .tx-preview.danger {
      background: #fef2f2;
      border-color: #fca5a5;
    }
    .tx-preview.captured {
      padding: 10px;
      min-height: 0;
      white-space: normal;
    }
    .tx-preview.captured img {
      display: block;
      width: 100%;
      max-height: min(42vh, 380px);
      object-fit: contain;
      border-radius: 12px;
      background: #fff;
    }
    .tx-editor {
      min-height: 220px;
      resize: vertical;
    }
    .tx-editor-camera {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 42px;
      height: 42px;
      min-width: 42px;
      padding: 0;
      border-radius: 999px;
      border: 1px solid #fca5a5;
      background: linear-gradient(180deg, #fee2e2, #fecaca);
      color: #b91c1c;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
    }
    .tx-editor-camera:hover {
      background: linear-gradient(180deg, #fecaca, #fca5a5);
      color: #991b1b;
    }
    .tx-editor-camera svg {
      width: 19px;
      height: 19px;
      display: block;
    }
    .tx-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }
    .tx-history-button {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 1px solid #f59e0b;
      background: linear-gradient(180deg, #fffbeb, #fde68a);
      color: #92400e;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
    }
    .tx-history-button:hover {
      background: linear-gradient(180deg, #fef3c7, #fcd34d);
      color: #78350f;
    }
    .tx-history-panel {
      display: grid;
      gap: 10px;
      padding: 12px;
      border-radius: 16px;
      border: 1px solid #fcd34d;
      background: #fffbeb;
    }
    .tx-history-empty {
      color: #92400e;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.4;
    }
    .tx-history-list {
      display: grid;
      gap: 10px;
    }
    .tx-history-card {
      display: grid;
      gap: 8px;
      padding: 12px;
      border-radius: 14px;
      border: 1px solid #fcd34d;
      background: rgba(255,255,255,.92);
    }
    .tx-history-card-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .tx-history-card-title {
      color: #92400e;
      font-size: 12px;
      font-weight: 900;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    .tx-history-card-date {
      color: #a16207;
      font-size: 12px;
      font-weight: 800;
    }
    .tx-history-card-copy {
      color: #1f2937;
      font-size: 13px;
      line-height: 1.45;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }
    .tx-keep-button {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .tx-keep-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 999px;
      font-size: 14px;
      line-height: 1;
    }
    .tx-primary-actions.hidden {
      display: none;
    }
    .tx-ocr-status {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
      padding: 10px 12px;
      border-radius: 14px;
      background: #f8fbff;
      border: 1px solid #d9e5f3;
      color: #334155;
      font-size: 12px;
      font-weight: 800;
    }
    .tx-ocr-status.loading {
      color: #1d4ed8;
      border-color: #bfdbfe;
      background: #eff6ff;
    }
    .tx-ocr-status.error {
      color: #b91c1c;
      border-color: #fecaca;
      background: #fef2f2;
    }
    .tx-ocr-status-main {
      display: grid;
      gap: 4px;
      flex: 1;
      min-width: 0;
    }
    .tx-ocr-status-copy {
      line-height: 1.35;
    }
    .tx-ocr-status-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 64px;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(37, 99, 235, .12);
      color: #1d4ed8;
      font-size: 12px;
      font-weight: 900;
    }
    .tx-ocr-status.error .tx-ocr-status-badge {
      background: rgba(220, 38, 38, .12);
      color: #b91c1c;
    }
    .tx-ocr-progress {
      width: 100%;
      height: 8px;
      border-radius: 999px;
      background: #dbeafe;
      overflow: hidden;
    }
    .tx-ocr-progress span {
      display: block;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #2563eb, #38bdf8);
      transition: width .24s ease;
    }
    .tx-ocr-preview {
      display: grid;
      gap: 10px;
    }
    .tx-ocr-image-wrap {
      border-radius: 18px;
      overflow: hidden;
      border: 1px solid #dbe4ef;
      background: #f8fafc;
      min-height: 180px;
      display: grid;
      place-items: center;
    }
    .tx-ocr-image-wrap img {
      display: block;
      width: 100%;
      height: auto;
      max-height: 360px;
      object-fit: contain;
    }
    .tx-ocr-hint {
      color: #64748b;
      font-size: 12px;
      line-height: 1.35;
      font-weight: 700;
    }
    .tx-ocr-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .tx-crop-stage-wrap {
      display: grid;
      gap: 10px;
    }
    .tx-crop-frame {
      border-radius: 18px;
      overflow: auto;
      border: 1px solid #dbe4ef;
      background: #eff6ff;
      padding: 10px;
      max-height: 420px;
      display: grid;
      place-items: center;
    }
    .tx-crop-stage {
      position: relative;
      width: 100%;
      max-width: 100%;
      line-height: 0;
      touch-action: none;
      user-select: none;
    }
    .tx-crop-stage img {
      display: block;
      width: 100%;
      height: auto;
      border-radius: 14px;
    }
    .tx-crop-box {
      position: absolute;
      border: 2px solid #2563eb;
      border-radius: 14px;
      box-shadow: 0 0 0 9999px rgba(15, 23, 42, .36);
      cursor: move;
      touch-action: none;
    }
    .tx-crop-handle {
      position: absolute;
      width: 16px;
      height: 16px;
      border-radius: 999px;
      border: 2px solid #fff;
      background: #2563eb;
      box-shadow: 0 8px 16px rgba(37, 99, 235, .28);
    }
    .tx-crop-handle.nw {
      left: -9px;
      top: -9px;
      cursor: nwse-resize;
    }
    .tx-crop-handle.ne {
      right: -9px;
      top: -9px;
      cursor: nesw-resize;
    }
    .tx-crop-handle.sw {
      left: -9px;
      bottom: -9px;
      cursor: nesw-resize;
    }
    .tx-crop-handle.se {
      right: -9px;
      bottom: -9px;
      cursor: nwse-resize;
    }
    .tx-crop-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
      color: #475467;
      font-size: 12px;
      font-weight: 800;
    }
    .tx-crop-launch {
      display: grid;
      gap: 10px;
      padding: 14px;
      border-radius: 18px;
      border: 1px solid #dbe4ef;
      background: linear-gradient(180deg, #f8fbff, #eef6ff);
    }
    .tx-crop-launch-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .tx-crop-launch-title {
      color: #172033;
      font-size: 14px;
      font-weight: 900;
    }
    .tx-crop-launch-copy {
      color: #5b6780;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.4;
    }
    .tx-crop-launch-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .tx-crop-fullscreen {
      position: fixed;
      inset: 0;
      z-index: 2000;
      background: rgba(2, 6, 23, .94);
      color: #e2e8f0;
      display: grid;
      grid-template-rows: auto 1fr auto;
      padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)) 16px;
      gap: 12px;
    }
    .tx-crop-fullscreen-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .tx-crop-fullscreen-title {
      display: grid;
      gap: 4px;
      min-width: 0;
    }
    .tx-crop-fullscreen-title b {
      color: #f8fafc;
      font-size: 15px;
      letter-spacing: .01em;
    }
    .tx-crop-fullscreen-title span {
      color: #94a3b8;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.35;
    }
    .tx-crop-fullscreen-close {
      background: rgba(255,255,255,.08);
      color: #f8fafc;
      border: 1px solid rgba(255,255,255,.12);
    }
    .tx-crop-fullscreen-close:hover {
      background: rgba(255,255,255,.14);
    }
    .tx-crop-fullscreen-stage {
      min-height: 0;
      display: grid;
      place-items: center;
    }
    .tx-crop-fullscreen-frame {
      position: relative;
      width: min(100%, 1100px);
      height: min(100%, calc(100vh - 240px));
      min-height: 320px;
      border-radius: 24px;
      overflow: hidden;
      background: #020617;
      border: 1px solid rgba(148, 163, 184, .28);
      box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
      display: grid;
      place-items: center;
    }
    .tx-crop-fullscreen .tx-crop-stage {
      width: auto;
      max-width: 100%;
      max-height: 100%;
    }
    .tx-crop-fullscreen .tx-crop-stage img {
      width: auto;
      max-width: 100%;
      max-height: min(100%, calc(100vh - 260px));
      object-fit: contain;
      border-radius: 0;
    }
    .tx-crop-fullscreen .tx-crop-box {
      border-width: 3px;
      border-radius: 18px;
      box-shadow:
        0 0 0 9999px rgba(2, 6, 23, .52),
        0 0 0 1px rgba(255,255,255,.18) inset;
    }
    .tx-crop-fullscreen .tx-crop-handle {
      width: 22px;
      height: 22px;
      border-width: 3px;
      background: #f8fafc;
      box-shadow: 0 10px 24px rgba(37, 99, 235, .34);
    }
    .tx-crop-fullscreen .tx-crop-handle.nw {
      left: -12px;
      top: -12px;
    }
    .tx-crop-fullscreen .tx-crop-handle.ne {
      right: -12px;
      top: -12px;
    }
    .tx-crop-fullscreen .tx-crop-handle.sw {
      left: -12px;
      bottom: -12px;
    }
    .tx-crop-fullscreen .tx-crop-handle.se {
      right: -12px;
      bottom: -12px;
    }
    .tx-crop-fullscreen-foot {
      display: grid;
      gap: 10px;
    }
    .tx-crop-fullscreen-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
      color: #cbd5e1;
      font-size: 12px;
      font-weight: 800;
    }
    .tx-crop-fullscreen-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: flex-end;
    }
    .tx-crop-fullscreen-actions .secondary {
      background: rgba(255,255,255,.08);
      color: #f8fafc;
      border: 1px solid rgba(255,255,255,.12);
    }
    .tx-crop-fullscreen-actions .secondary:hover {
      background: rgba(255,255,255,.14);
    }
    .patient-status {
      display: inline-flex;
      margin-top: 6px;
    }
    .patient-status-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      user-select: none;
      border: 0;
      background: transparent;
      padding: 0;
      border-radius: 999px;
      outline: none !important;
      box-shadow: none !important;
      -webkit-tap-highlight-color: transparent;
    }
    .patient-status-toggle:focus,
    .patient-status-toggle:active {
      outline: none;
      box-shadow: none;
      background: transparent;
    }
    .patient-status-toggle .patient-status {
      margin-top: 0;
      padding: 2px 7px;
      font-size: 11px;
      line-height: 1.08;
      letter-spacing: .01em;
      transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
    }
    .patient-status-toggle:hover .patient-status {
      transform: translateY(-1px);
      filter: saturate(1.02);
    }
    .patient-status-toggle:focus-visible .patient-status {
      box-shadow: 0 0 0 2px rgba(15, 23, 42, .14);
    }
    .status-alerts {
      width: auto;
      min-width: 0;
      max-width: none;
    }
    .alert-stack {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
    }
    .alert-empty {
      display: inline-block;
      width: 100%;
      max-width: 100%;
      padding: 8px 10px;
      border-radius: 10px;
      background: #f8fafc;
      color: #64748b;
      border: 1px dashed #cbd5e1;
      font-size: 15px;
    }
    .alert-entry {
      display: inline-flex;
      align-items: flex-start;
      width: auto;
      max-width: 100%;
      position: relative;
      padding: 6px 10px;
      border-radius: 12px;
      border: 1px solid #dbe4ef;
      line-height: 1.3;
      font-size: 16px;
      font-weight: 600;
      overflow: hidden;
    }
    .alert-entry-copy {
      display: block;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      word-break: break-word;
      transition: opacity .14s ease, transform .14s ease, filter .14s ease;
    }
    .alert-entry.pending {
      background: #eff6ff;
      border-color: #93c5fd;
      color: #1e3a8a;
    }
    .alert-entry.incidence {
      background: #fef2f2;
      border-color: #fca5a5;
      color: #991b1b;
    }
    .alert-entry-delete {
      position: absolute;
      inset: 0;
      border: 0;
      background: rgba(15, 23, 42, .72);
      color: #fff;
      border-radius: inherit;
      padding: 8px 10px;
      font-size: 13px;
      font-weight: 800;
      cursor: pointer;
      opacity: 0;
      pointer-events: none;
      transition: opacity .14s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      box-shadow: none;
      backdrop-filter: blur(2px);
    }
    .alert-entry-trash {
      font-size: 15px;
      line-height: 1;
    }
    .alert-entry:hover .alert-entry-delete,
    .alert-entry:focus-within .alert-entry-delete {
      opacity: 1;
      pointer-events: auto;
    }
    .alert-entry:hover .alert-entry-copy,
    .alert-entry:focus-within .alert-entry-copy {
      opacity: .18;
      transform: scale(.99);
      filter: blur(.3px);
    }
    .pill {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 4px 8px;
      font-size: 12px;
      font-weight: 800;
      background: #eef2f7;
      color: #334155;
      white-space: nowrap;
    }
    .pill.status-hospitalizado { background: #dcfce7; color: #166534; }
    .pill.status-referido { background: #e0e7ff; color: #3730a3; }
    .pill.status-pendiente-pase { background: #ffedd5; color: #9a3412; }
    .btn-pending {
      background: #1d4ed8;
      color: #fff;
      border-color: #1d4ed8;
    }
    .btn-pending:hover { background: #1e40af; }
    .btn-incidence {
      background: #dc2626;
      color: #fff;
      border-color: #dc2626;
    }
    .btn-incidence:hover { background: #b91c1c; }
    .btn-evolution {
      background: #eef2ff;
      color: #4338ca;
      border-color: #c7d2fe;
    }
    .btn-evolution:hover { background: #e0e7ff; }
    .longitudinal-card {
      display: grid;
      grid-template-columns: 32px minmax(0,1fr) auto;
      align-items: center;
      width: 100%;
      gap: 10px;
      padding: 10px 12px;
      border: 1px solid #c7d2fe;
      border-radius: 14px;
      background: linear-gradient(135deg, #eef2ff, #f8faff);
      color: #312e81;
      text-align: left;
      box-shadow: 0 6px 16px rgba(79,70,229,.08);
    }
    .longitudinal-card:hover { border-color: #818cf8; background: #e8edff; }
    .longitudinal-card-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #4f46e5; color: #fff; font-weight: 900; }
    .longitudinal-card-copy { display: grid; gap: 2px; min-width: 0; }
    .longitudinal-card-copy b { font-size: 12px; }
    .longitudinal-card-copy small { color: #64748b; font-size: 10px; font-weight: 700; }
    .longitudinal-card-arrow { color: #4f46e5; font-size: 20px; line-height: 1; }
    .longitudinal-timeline { position: relative; display: flex; gap: 14px; overflow-x: auto; padding: 25px 4px 14px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
    .longitudinal-timeline::before { content: ''; position: absolute; top: 8px; left: 10px; right: 10px; height: 2px; background: #c7d2fe; }
    .longitudinal-event { position: relative; flex: 0 0 min(280px, 82vw); scroll-snap-align: start; padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
    .longitudinal-event::before { content: ''; position: absolute; left: 16px; top: -22px; width: 12px; height: 12px; border: 3px solid #fff; border-radius: 50%; background: #4f46e5; box-shadow: 0 0 0 2px #c7d2fe; }
    .longitudinal-event.incidence::before { background: #dc2626; box-shadow: 0 0 0 2px #fecaca; }
    .longitudinal-event.pending::before { background: #d97706; box-shadow: 0 0 0 2px #fde68a; }
    .longitudinal-event-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #334155; font-size: 11px; font-weight: 800; }
    .longitudinal-event-text { margin-top: 7px; color: #334155; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
    .admission-note-toggle {
      padding: 4px 7px;
      border: 1px solid #dbe4ef;
      border-radius: 999px;
      background: #fff;
      color: #64748b;
      font-size: 10px;
      font-weight: 800;
    }
    .admission-note-toggle.is-pending { border-color: #facc15; background: #fef9c3; color: #854d0e; }
    .cards { display: none; }
    .card-section-label {
      display: none;
      align-items: center;
      gap: 8px;
      margin: 8px 0 2px;
      color: var(--section-accent-strong, #334155);
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    .card-section-label::after {
      content: '';
      flex: 1;
      height: 2px;
      border-radius: 999px;
      background: var(--section-accent, #cbd5e1);
    }
    .card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 16px;
      display: grid;
      gap: 12px;
      position: relative;
      overflow: hidden;
    }
    .card.section-mujeres {
      border-color: color-mix(in srgb, #BE185D 28%, white);
      box-shadow: 0 18px 40px rgba(190, 24, 93, .12);
      border-left: 5px solid #F59ABF;
    }
    .card.section-hombres {
      border-color: color-mix(in srgb, #0F766E 28%, white);
      box-shadow: 0 18px 40px rgba(15, 118, 110, .12);
      border-left: 5px solid #2FB8AC;
    }
    .card-head {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: start;
    }
    .card h3 { font-size: 16px; }
    .card-head-main {
      display: grid;
      gap: 6px;
      min-width: 0;
      flex: 1;
    }
    .card-topline {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .card-bed {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 6px 10px;
      background: #eef4ff;
      color: #3159c9;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .02em;
    }
    .card-name {
      font-size: 19px;
      line-height: 1.08;
      font-weight: 900;
      color: #172033;
      text-wrap: balance;
    }
    .card-facts {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      color: #667085;
      font-size: 13px;
      font-weight: 700;
    }
    .card-facts span::after {
      content: '·';
      margin-left: 6px;
      color: #c0cad8;
    }
    .card-facts span:last-child::after {
      content: '';
      margin: 0;
    }
    .card-block {
      display: grid;
      gap: 4px;
    }
    .card-treatment-block {
      gap: 8px;
      padding: 14px;
      border: 1px solid #dbe4ef;
      border-radius: 18px;
      background: #f8fafc;
      transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
    }
    .card-treatment-block.fresh { background: #ecfdf5; border-color: #86efac; }
    .card-treatment-block.warning { background: #fffbeb; border-color: #fcd34d; }
    .card-treatment-block.danger { background: #fef2f2; border-color: #fca5a5; }
    .card-treatment-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .card-treatment-status {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 0 8px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 900;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    .card-treatment-status.fresh { color: #15803d; background: rgba(34, 197, 94, .12); }
    .card-treatment-status.warning { color: #b45309; background: rgba(245, 158, 11, .14); }
    .card-treatment-status.danger { color: #b91c1c; background: rgba(239, 68, 68, .12); }
    .card-treatment-time { color: #667085; font-size: 11px; font-weight: 800; }
    .card-block-label {
      color: #8a95a8;
      font-size: 11px;
      font-weight: 900;
      letter-spacing: .14em;
      text-transform: uppercase;
    }
    .card-block-copy {
      color: #243047;
      font-size: 15px;
      line-height: 1.34;
    }
    .card-team-line {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      color: #516079;
      font-size: 14px;
      font-weight: 700;
    }
    .card-team-line span::after {
      content: '·';
      margin-left: 6px;
      color: #c0cad8;
    }
    .card-team-line span:last-child::after {
      content: '';
      margin: 0;
    }
    .card-block-copy.card-preview {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .card-block-copy.card-preview.diagnosis-preview {
      -webkit-line-clamp: 2;
    }
    .meta {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }
    .actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .card .actions {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
    .card .actions button { min-width: 0; }
    .empty {
      padding: 36px 18px;
      text-align: center;
      color: var(--muted);
      font-weight: 700;
    }

    .modal-root {
      position: relative;
      z-index: 2000;
    }
    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15,23,42,.42);
      display: grid;
      place-items: center;
      padding: 18px;
      z-index: 2000;
    }
    .modal {
      width: min(960px, 100%);
      max-height: 92vh;
      overflow: auto;
      background: #fff;
      border-radius: 10px;
      box-shadow: var(--shadow);
      border: 1px solid var(--line);
    }
    .modal-header {
      position: sticky;
      top: 0;
      background: #fff;
      z-index: 2;
      padding: 16px;
      border-bottom: 1px solid var(--line);
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
    }
    .modal-header.is-titleless {
      justify-content: flex-end;
      border-bottom: 0;
      padding-bottom: 0;
    }
    .modal-header.is-titleless h2 {
      display: none;
    }
    .modal-body { padding: 16px; display: grid; gap: 14px; }
    .modal-body.compact {
      padding: 0;
      gap: 0;
    }
    .print-studio-modal {
      width: min(1240px, 100%);
      border-radius: 24px;
      overflow: hidden;
      background:
        radial-gradient(circle at top left, rgba(96, 165, 250, .14), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 34%);
    }
    .print-studio-body {
      padding: 0;
      gap: 0;
      background: transparent;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      touch-action: pan-y;
      max-height: calc(92vh - 74px);
    }
    .print-studio {
      display: grid;
      gap: 0;
    }
    .print-studio-hero {
      display: grid;
      gap: 10px;
      padding: 22px 24px 18px;
      border-bottom: 1px solid rgba(148, 163, 184, .22);
      background:
        linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(14, 165, 233, .04) 62%, rgba(255, 255, 255, .92));
    }
    .print-studio-kicker {
      color: #2563eb;
      font-size: 12px;
      font-weight: 900;
      letter-spacing: .12em;
      text-transform: uppercase;
    }
    .print-studio-hero h3 {
      margin: 0;
      color: #0f172a;
      font-size: 26px;
      line-height: 1.05;
    }
    .print-studio-hero p {
      margin: 0;
      color: #475569;
      font-size: 15px;
      line-height: 1.5;
      max-width: 760px;
    }
    .print-studio-body-inner {
      display: grid;
      gap: 18px;
      padding: 22px 24px 24px;
    }
    .print-section-card {
      display: grid;
      gap: 14px;
      padding: 18px;
      border: 1px solid rgba(148, 163, 184, .22);
      border-radius: 20px;
      background: rgba(255, 255, 255, .88);
      box-shadow: 0 20px 45px rgba(15, 23, 42, .06);
    }
    .print-section-head {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
      flex-wrap: wrap;
    }
    .print-section-head h4 {
      margin: 0;
      color: #0f172a;
      font-size: 17px;
    }
    .print-section-head p {
      margin: 4px 0 0;
      color: #64748b;
      font-size: 14px;
      max-width: 620px;
    }
    .print-chip-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }
    .print-chip {
      border: 1px solid rgba(148, 163, 184, .26);
      background: #eef4ff;
      color: #1e293b;
      border-radius: 999px;
      padding: 12px 16px;
      font-size: 14px;
      font-weight: 800;
      transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
    }
    .print-chip:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
    }
    .print-chip.is-active {
      border-color: rgba(37, 99, 235, .55);
      background: linear-gradient(135deg, #2563eb, #3b82f6);
      color: #fff;
      box-shadow: 0 14px 30px rgba(37, 99, 235, .26);
    }
    .print-mode-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }
    .print-mode-card {
      display: grid;
      gap: 6px;
      min-height: 110px;
      padding: 16px;
      border-radius: 18px;
      border: 1px solid rgba(148, 163, 184, .24);
      background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.94));
      color: #0f172a;
      text-align: left;
      transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
    }
    .print-mode-card:hover {
      transform: translateY(-1px);
      box-shadow: 0 16px 30px rgba(15, 23, 42, .08);
    }
    .print-mode-card strong {
      font-size: 15px;
      line-height: 1.2;
    }
    .print-mode-card span {
      color: #64748b;
      font-size: 13px;
      line-height: 1.45;
      font-weight: 700;
    }
    .print-mode-card.is-active {
      border-color: rgba(37, 99, 235, .42);
      background: linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(59, 130, 246, .04) 56%, rgba(255,255,255,.98));
      box-shadow: 0 18px 34px rgba(37, 99, 235, .14);
    }
    .print-toolbar-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      justify-content: space-between;
      align-items: center;
    }
    .print-search {
      width: min(380px, 100%);
      border-radius: 14px;
      border: 1px solid rgba(148, 163, 184, .24);
      background: #f8fbff;
      box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
    }
    .print-doctor-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 10px;
      max-height: 320px;
      overflow: auto;
      padding-right: 4px;
    }
    .print-doctor-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 13px 14px;
      border-radius: 16px;
      border: 1px solid rgba(148, 163, 184, .22);
      background: #fff;
      color: #1e293b;
      text-align: left;
      transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
    }
    .print-doctor-item:hover {
      transform: translateY(-1px);
      box-shadow: 0 14px 24px rgba(15, 23, 42, .06);
    }
    .print-doctor-item b {
      font-size: 14px;
      line-height: 1.35;
    }
    .print-doctor-item small {
      color: #64748b;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .04em;
      text-transform: uppercase;
    }
    .print-doctor-check {
      width: 24px;
      height: 24px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, .26);
      background: #fff;
      color: transparent;
      flex: 0 0 auto;
      font-size: 13px;
      font-weight: 900;
    }
    .print-doctor-item.is-selected {
      border-color: rgba(37, 99, 235, .42);
      background: linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(224, 242, 254, .72));
      box-shadow: 0 16px 28px rgba(37, 99, 235, .12);
    }
    .print-doctor-item.is-selected .print-doctor-check {
      border-color: rgba(37, 99, 235, .6);
      background: #2563eb;
      color: #fff;
    }
    .print-doctor-item.is-hidden {
      display: none;
    }
    .print-empty-state {
      padding: 18px;
      border-radius: 16px;
      border: 1px dashed rgba(148, 163, 184, .3);
      background: rgba(248, 250, 252, .86);
      color: #64748b;
      font-weight: 700;
      text-align: center;
    }
    .print-summary-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }
    .print-summary-card {
      display: grid;
      gap: 4px;
      padding: 14px 15px;
      border-radius: 18px;
      border: 1px solid rgba(148, 163, 184, .2);
      background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(241,245,249,.88));
    }
    .print-summary-card b {
      font-size: 24px;
      line-height: 1;
      color: #0f172a;
    }
    .print-summary-card span {
      color: #64748b;
      font-size: 13px;
      font-weight: 800;
      letter-spacing: .04em;
      text-transform: uppercase;
    }
    .print-summary-card small {
      color: #475569;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.45;
    }
    .print-inline-note {
      color: #475569;
      font-size: 13px;
      line-height: 1.5;
      font-weight: 700;
    }
    .print-preview-wrap {
      display: grid;
      gap: 0;
      min-height: min(78vh, 920px);
    }
    .print-preview-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      justify-content: space-between;
      align-items: center;
      padding: 18px 24px;
      border-bottom: 1px solid rgba(148, 163, 184, .22);
      background: linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(255,255,255,.9));
    }
    .print-preview-toolbar h3 {
      margin: 0;
      color: #0f172a;
      font-size: 20px;
    }
    .print-preview-toolbar p {
      margin: 4px 0 0;
      color: #64748b;
      font-size: 14px;
      font-weight: 700;
    }
    .print-preview-frame-wrap {
      padding: 18px;
      background: linear-gradient(180deg, rgba(226, 232, 240, .7), rgba(241, 245, 249, .95));
    }
    .print-preview-frame {
      width: 100%;
      min-height: min(68vh, 860px);
      border: 1px solid rgba(148, 163, 184, .26);
      border-radius: 22px;
      background: #fff;
      box-shadow: 0 24px 50px rgba(15, 23, 42, .12);
    }
    .print-preview-note {
      padding: 0 24px 18px;
      color: #475569;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.5;
      background: rgba(255, 255, 255, .72);
    }
    .loading-card {
      border: 1px dashed var(--line);
      border-radius: var(--radius);
      padding: 18px;
      color: var(--muted);
      font-weight: 700;
      background: #fbfdff;
    }
    .loading-inline {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .loading-inline::before {
      content: '';
      width: 10px;
      height: 10px;
      border-radius: 999px;
      background: var(--brand);
      animation: pulse 1s ease-in-out infinite;
    }
    .form-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
    }
    .wide { grid-column: 1 / -1; }
    .split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .pending-columns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: start; }
    .todo-list { display: grid; gap: 8px; }
    .todo {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 11px;
      display: grid;
      gap: 8px;
      background: #fff;
    }
    .todo-top { display: flex; justify-content: space-between; gap: 10px; }
    .todo-actions {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }
    .pending-header {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }
    .pending-filters {
      display: grid;
      grid-template-columns: 170px minmax(180px, 260px);
      gap: 8px;
      align-items: center;
    }
    .admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
    .admin-shell {
      display: grid;
      gap: 16px;
    }
    .admin-hero {
      display: grid;
      gap: 14px;
      padding: 18px;
      border: 1px solid rgba(37, 99, 235, .12);
      background:
        radial-gradient(circle at top right, rgba(37,99,235,.08), transparent 28%),
        linear-gradient(180deg, #ffffff, #f8fbff);
    }
    .admin-hero-copy {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      align-items: start;
      flex-wrap: wrap;
    }
    .admin-hero-copy h2 { font-size: 26px; }
    .admin-hero-copy p { margin: 6px 0 0; color: var(--muted); max-width: 760px; }
    .admin-summary-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(140px, 1fr));
      gap: 12px;
    }
    .admin-summary-card {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fff;
      padding: 14px;
      display: grid;
      gap: 6px;
      box-shadow: 0 12px 28px rgba(15, 23, 42, .04);
    }
    .admin-summary-card b {
      font-size: 30px;
      line-height: 1;
    }
    .admin-summary-card span {
      color: var(--muted);
      font-weight: 700;
      font-size: 14px;
    }
    .admin-section-block {
      display: grid;
      gap: 12px;
    }
    .admin-section-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }
    .admin-section-head h3 { font-size: 19px; }
    .admin-section-head p {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 14px;
    }
    .admin-section-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      align-items: start;
    }
    .admin-stack-list {
      display: grid;
      gap: 10px;
    }
    .admin-item-card {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fff;
      padding: 14px;
      display: grid;
      gap: 10px;
      box-shadow: 0 12px 28px rgba(15, 23, 42, .03);
    }
    .admin-item-head {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: start;
      flex-wrap: wrap;
    }
    .admin-item-title {
      display: grid;
      gap: 4px;
      min-width: 0;
    }
    .admin-item-title strong {
      font-size: 17px;
      line-height: 1.2;
    }
    .admin-item-kicker {
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .05em;
      text-transform: uppercase;
    }
    .admin-badge-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .admin-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 9px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 800;
      background: #eef2ff;
      color: #3730a3;
      border: 1px solid rgba(79,70,229,.12);
    }
    .admin-badge.ok {
      background: #ecfdf5;
      color: #047857;
      border-color: rgba(4,120,87,.12);
    }
    .admin-badge.warn {
      background: #fff7ed;
      color: #c2410c;
      border-color: rgba(194,65,12,.12);
    }
    .admin-badge.neutral {
      background: #f3f4f6;
      color: #475569;
      border-color: rgba(71,85,105,.12);
    }
    .admin-meta-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px 14px;
    }
    .admin-meta-block {
      display: grid;
      gap: 4px;
      min-width: 0;
    }
    .admin-meta-label {
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .04em;
      text-transform: uppercase;
    }
    .admin-meta-value {
      font-size: 15px;
      font-weight: 700;
      color: var(--ink);
      word-break: break-word;
    }
    .admin-actions-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .admin-log-table td,
    .admin-audit-table td {
      vertical-align: top;
    }
    .admin-history-stack {
      display: grid;
      gap: 12px;
      margin-top: 12px;
    }
    .admin-history-topline {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .admin-history-groups {
      display: grid;
      gap: 12px;
    }
    .admin-history-group {
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      background: #f8fafc;
      padding: 12px;
      display: grid;
      gap: 10px;
    }
    .admin-history-group-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .admin-history-group-head strong {
      color: var(--ink);
      font-size: 14px;
    }
    .admin-history-group-head span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
    }
    .admin-history-toggle {
      display: flex;
      justify-content: flex-start;
    }
    .admin-soft-note {
      color: var(--muted);
      font-size: 13px;
    }
    body[data-theme="roberto"] {
      --sidebar-bg: #07111f;
      --sidebar-bg-2: #151a36;
      --sidebar-ink: #d9e7ff;
      --sidebar-muted: #9cb4df;
      --sidebar-accent: #52e5ff;
      --sidebar-highlight: rgba(82,229,255,.16);
      --sidebar-panel-bg: rgba(34,52,94,.34);
      --sidebar-pattern:
        radial-gradient(circle at 18% 22%, rgba(255,255,255,.34), transparent 1.6%),
        radial-gradient(circle at 73% 18%, rgba(255,255,255,.26), transparent 1.2%),
        radial-gradient(circle at 54% 46%, rgba(255,255,255,.18), transparent 1%),
        linear-gradient(120deg, transparent 45%, rgba(82,229,255,.28) 48%, rgba(82,229,255,.02) 52%, transparent 55%);
    }
    body[data-theme="melisa"] {
      --sidebar-bg: #fff3f5;
      --sidebar-bg-2: #f7d9eb;
      --sidebar-ink: #6f3558;
      --sidebar-muted: #915b79;
      --sidebar-accent: #ff8fb8;
      --sidebar-highlight: rgba(255,143,184,.18);
      --sidebar-panel-bg: rgba(255,255,255,.4);
      --sidebar-pattern:
        radial-gradient(circle at 22% 22%, rgba(255,255,255,.8), transparent 3.3%),
        radial-gradient(circle at 27% 16%, rgba(255,255,255,.56), transparent 2.2%),
        radial-gradient(circle at 17% 16%, rgba(255,255,255,.56), transparent 2.2%),
        radial-gradient(circle at 75% 36%, rgba(255,255,255,.7), transparent 3.2%),
        linear-gradient(180deg, rgba(255,255,255,.3), transparent 58%);
    }
    body[data-theme="haziel"] {
      --sidebar-bg: #071b16;
      --sidebar-bg-2: #163a2c;
      --sidebar-ink: #e3f7ee;
      --sidebar-muted: #a8c8bb;
      --sidebar-accent: #42d17c;
      --sidebar-highlight: rgba(66,209,124,.18);
      --sidebar-panel-bg: rgba(179,201,189,.12);
      --sidebar-pattern:
        linear-gradient(135deg, rgba(192,192,192,.18) 0 10%, transparent 10% 18%, rgba(66,209,124,.14) 18% 22%, transparent 22% 100%),
        radial-gradient(circle at 16% 72%, rgba(255,255,255,.08), transparent 14%),
        radial-gradient(circle at 80% 18%, rgba(255,255,255,.08), transparent 16%);
    }
    body[data-theme="luis"] {
      --sidebar-bg: #171d27;
      --sidebar-bg-2: #2b3441;
      --sidebar-ink: #eef2f7;
      --sidebar-muted: #aab4c3;
      --sidebar-accent: #ff8a32;
      --sidebar-highlight: rgba(255,138,50,.18);
      --sidebar-panel-bg: rgba(255,255,255,.08);
      --sidebar-pattern:
        repeating-linear-gradient(90deg, rgba(255,138,50,.18) 0 10px, transparent 10px 34px),
        linear-gradient(180deg, rgba(255,255,255,.07), transparent 42%),
        radial-gradient(circle at 80% 82%, rgba(255,255,255,.08), transparent 16%);
    }
    body[data-theme="brian"] {
      --sidebar-bg: #101621;
      --sidebar-bg-2: #1f2d46;
      --sidebar-ink: #e8f2ff;
      --sidebar-muted: #9cb5d8;
      --sidebar-accent: #7bb0ff;
      --sidebar-highlight: rgba(123,176,255,.18);
      --sidebar-panel-bg: rgba(255,255,255,.08);
      --sidebar-pattern:
        radial-gradient(circle at 16% 30%, rgba(123,176,255,.32), transparent 2.2%),
        radial-gradient(circle at 31% 56%, rgba(123,176,255,.24), transparent 2.2%),
        radial-gradient(circle at 69% 26%, rgba(123,176,255,.28), transparent 2.2%),
        linear-gradient(115deg, transparent 24%, rgba(123,176,255,.16) 24.6%, transparent 25.2%, transparent 52%, rgba(123,176,255,.16) 52.6%, transparent 53.2%);
    }
    body[data-theme="roberto"] .sidebar-theme-art {
      background:
        radial-gradient(circle at 14% 24%, rgba(255,255,255,.86), transparent 2.2%),
        radial-gradient(circle at 74% 18%, rgba(255,255,255,.74), transparent 1.8%),
        radial-gradient(circle at 48% 54%, rgba(255,255,255,.38), transparent 1.6%),
        linear-gradient(118deg, transparent 42%, rgba(82,229,255,.8) 48%, rgba(82,229,255,.08) 52%, transparent 58%),
        linear-gradient(180deg, rgba(7,17,31,.45), rgba(21,26,54,.15));
    }
    body[data-theme="melisa"] .sidebar-theme-art {
      background:
        radial-gradient(circle at 20% 28%, rgba(255,255,255,.9), transparent 6.2%),
        radial-gradient(circle at 17% 21%, rgba(255,255,255,.74), transparent 3.2%),
        radial-gradient(circle at 24% 21%, rgba(255,255,255,.74), transparent 3.2%),
        radial-gradient(circle at 74% 36%, rgba(255,255,255,.88), transparent 6.1%),
        radial-gradient(circle at 71% 29%, rgba(255,255,255,.68), transparent 3.2%),
        radial-gradient(circle at 78% 29%, rgba(255,255,255,.68), transparent 3.2%),
        linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,143,184,.18));
      color: #7f3e63;
      border-color: rgba(111,53,88,.14);
    }
    body[data-theme="haziel"] .sidebar-theme-art {
      background:
        linear-gradient(135deg, rgba(192,192,192,.34), transparent 12%, transparent 38%, rgba(66,209,124,.24) 38%, rgba(66,209,124,.08) 44%, transparent 44%),
        radial-gradient(circle at 24% 62%, rgba(255,255,255,.16), transparent 18%),
        linear-gradient(180deg, rgba(6,28,20,.28), rgba(22,58,44,.1));
    }
    body[data-theme="luis"] .sidebar-theme-art {
      background:
        repeating-linear-gradient(90deg, rgba(255,138,50,.48) 0 10px, transparent 10px 25px),
        linear-gradient(180deg, rgba(255,255,255,.14), transparent 28%),
        linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,138,50,.08));
    }
    body[data-theme="brian"] .sidebar-theme-art {
      background:
        radial-gradient(circle at 18% 30%, rgba(123,176,255,.95), transparent 3.2%),
        radial-gradient(circle at 34% 58%, rgba(123,176,255,.7), transparent 3.2%),
        radial-gradient(circle at 70% 24%, rgba(123,176,255,.85), transparent 3.2%),
        linear-gradient(118deg, transparent 19%, rgba(123,176,255,.34) 19.6%, transparent 20.2%, transparent 48%, rgba(123,176,255,.26) 48.6%, transparent 49.2%, transparent 61%, rgba(123,176,255,.22) 61.6%, transparent 62.2%),
        linear-gradient(180deg, rgba(16,22,33,.18), rgba(31,45,70,.16));
    }
    .toast-root {
      position: fixed;
      right: 18px;
      bottom: 18px;
      z-index: 40;
      display: grid;
      gap: 10px;
      width: min(340px, calc(100vw - 24px));
    }
    .toast {
      background: rgba(15, 23, 42, .96);
      color: #fff;
      border-radius: 10px;
      padding: 12px 14px;
      box-shadow: 0 18px 42px rgba(15, 23, 42, .24);
      display: grid;
      gap: 10px;
      border: 1px solid rgba(255,255,255,.08);
    }
    .toast.centered {
      position: fixed;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      width: min(360px, calc(100vw - 32px));
      border-radius: 16px;
      box-shadow: 0 24px 56px rgba(15, 23, 42, .28);
      text-align: center;
      z-index: 60;
    }
    .toast.centered .toast-top {
      justify-content: center;
      text-align: center;
    }
    .toast.centered .toast-title,
    .toast.centered .toast-message {
      justify-content: center;
      text-align: center;
    }
    .toast.success { background: rgba(6, 95, 70, .97); }
    .toast.error { background: rgba(127, 29, 29, .97); }
    .toast.saving { background: rgba(29, 78, 216, .97); }
    .toast.syncing { background: rgba(8, 47, 73, .97); }
    .toast-top {
      display: flex;
      align-items: start;
      justify-content: space-between;
      gap: 10px;
    }
    .toast-title {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-weight: 800;
    }
    .toast-title::before {
      content: '';
      width: 10px;
      height: 10px;
      border-radius: 999px;
      background: currentColor;
      opacity: .9;
    }
    .toast.saving .toast-title::before {
      animation: pulse 1s ease-in-out infinite;
    }
    .toast-message {
      color: rgba(255,255,255,.88);
      font-size: 13px;
      line-height: 1.35;
    }
    .toast-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .toast button {
      background: rgba(255,255,255,.14);
      color: #fff;
      padding: 7px 10px;
    }
    .toast button:hover {
      background: rgba(255,255,255,.22);
    }
    .toast button.ghost {
      background: transparent;
      color: rgba(255,255,255,.82);
    }
    @keyframes pulse {
      0%, 100% { transform: scale(1); opacity: .55; }
      50% { transform: scale(1.28); opacity: 1; }
    }

    @media (min-width: 981px) {
      .toolbar input,
      .toolbar select,
      .toolbar button,
      .print-controls button,
      .print-controls select {
        font-size: 16px;
      }
    }

    @media (max-width: 1500px) and (min-width: 981px) {
      .content {
        padding: 16px;
        gap: 14px;
      }
      .topbar h1 { font-size: 28px; }
      .topbar-actions, .print-controls { gap: 6px; }
      .topbar-actions button,
      .print-controls button {
        padding: 9px 12px;
        font-size: 14px;
      }
      .print-controls select { width: 150px; }
      .stats {
        grid-template-columns: repeat(5, minmax(96px, 1fr));
        gap: 9px;
      }
      .stat {
        padding: 11px 12px;
      }
      .stat b { font-size: 27px; }
      .stat span { font-size: 15px; }
      .toolbar {
        grid-template-columns: minmax(240px, 1fr) auto minmax(150px, 180px) auto;
        gap: 8px;
        padding: 10px;
      }
      .census-filter-group {
        flex-wrap: wrap;
        gap: 5px;
      }
      .filter-toggle {
        min-width: 0;
        padding: 9px 12px;
        white-space: nowrap;
        font-size: 14px;
      }
      .toolbar input,
      .toolbar select {
        padding: 9px 10px;
        font-size: 14px;
      }
      table { font-size: 15px; }
      th, td { padding: 8px 6px; }
      th {
        font-size: 13px;
        letter-spacing: .035em;
      }
      .patient-status-toggle .patient-status {
        padding: 2px 6px;
        font-size: 10px;
      }
      .alert-empty,
      .alert-entry {
        padding: 7px 8px;
        font-size: 14px;
        line-height: 1.32;
      }
      .alert-entry-delete {
        padding: 7px 8px;
        font-size: 12px;
        gap: 6px;
      }
      .alert-entry-trash {
        font-size: 13px;
      }
    }

    @media (max-width: 980px) {
      .shell { grid-template-columns: 1fr; }
      .shell.sidebar-expanded { grid-template-columns: 1fr; }
      body { background: linear-gradient(180deg, #f6f8fd, #eef3fb); }
      .sidebar {
        display: flex;
        position: fixed;
        z-index: 30;
        width: var(--mobile-sidebar-width);
        height: 100dvh;
        box-shadow: 18px 0 40px rgba(15, 23, 42, .22);
        border-radius: 0 18px 18px 0;
        transform: translateX(calc(var(--mobile-sidebar-offset) - var(--mobile-sidebar-width)));
        transition: transform .22s ease, box-shadow .22s ease;
        pointer-events: none;
        touch-action: pan-y;
      }
      .sidebar.open {
        pointer-events: auto;
      }
      .shell.mobile-sidebar-open .sidebar,
      .shell.sidebar-dragging .sidebar {
        touch-action: none;
      }
      .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 29;
        display: none;
        pointer-events: none;
        touch-action: none;
        background: transparent;
      }
      .shell.mobile-sidebar-open .sidebar-backdrop,
      .shell.sidebar-dragging .sidebar-backdrop {
        display: block;
        pointer-events: auto;
      }
      .mobile-menu {
        display: none !important;
      }
      .mobile-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        left: 12px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
        z-index: 41;
        width: 50px;
        height: 50px;
        border-radius: 999px;
        padding: 0;
        background: #0f172a;
        color: #fff;
        box-shadow: 0 14px 30px rgba(15, 23, 42, .22);
        font-size: 24px;
        line-height: 1;
      }
      .shell.mobile-sidebar-open .mobile-sidebar-toggle {
        left: calc(var(--mobile-sidebar-width) - 18px);
        background: #fff;
        color: #0f172a;
      }
      .content {
        padding: 10px 10px calc(18px + env(safe-area-inset-bottom, 0px));
        gap: 10px;
        min-height: 100dvh;
        background: linear-gradient(180deg, #f6f8fd, #eef3fb);
        transform: translateX(var(--mobile-sidebar-offset));
        transform-origin: left center;
        transition: transform .22s ease, border-radius .22s ease, box-shadow .22s ease;
        will-change: transform;
      }
      .shell.mobile-sidebar-open .content {
        border-radius: 22px 0 0 22px;
        box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
        pointer-events: none;
        touch-action: none;
        user-select: none;
      }
      .shell.sidebar-dragging .sidebar,
      .shell.sidebar-dragging .content {
        transition: none;
      }
      .shell.sidebar-dragging .content {
        pointer-events: none;
        touch-action: none;
      }
      .topbar {
        position: relative;
        z-index: 12;
        margin: 0;
        padding: 0;
        display: grid;
        gap: 8px;
        background: transparent;
        border-bottom: 0;
        backdrop-filter: none;
      }
      .topbar-main {
        gap: 8px;
        align-items: start;
      }
      .topbar-copy {
        gap: 2px;
      }
      .mobile-app-chip {
        display: inline-flex;
        align-items: center;
        min-height: 38px;
        padding: 0 12px;
        border-radius: 999px;
        background: rgba(255,255,255,.94);
        border: 1px solid rgba(255,255,255,.7);
        box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
        color: #111827;
        font-size: 14px;
        font-weight: 800;
      }
      .topbar h1 {
        font-size: 18px;
        line-height: 1.05;
      }
      #viewSubtitle {
        font-size: 12px;
        color: #6b7280;
        white-space: normal;
        max-width: none;
      }
      .topbar-actions {
        justify-content: flex-end;
        gap: 8px;
        align-items: center;
      }
      #printControls,
      #newPatientBtn {
        display: none !important;
      }
      .mobile-user-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 14px;
        background: rgba(37, 99, 235, .08);
        color: #2563eb;
        font-size: 14px;
        font-weight: 900;
      }
      .preview-banner {
        width: 100%;
        justify-content: space-between;
        border-radius: 12px;
      }
      .topbar-actions > button,
      .print-controls button {
        height: 34px;
        padding: 7px 10px;
        border-radius: 999px;
        font-size: 12px;
      }
      .print-controls select {
        width: 104px;
        height: 34px;
        border-radius: 999px;
        padding: 6px 9px;
        font-size: 12px;
      }
      .stats {
        display: flex;
        gap: 5px;
        overflow-x: auto;
        padding: 0 0 2px;
        scrollbar-width: none;
      }
      .stats::-webkit-scrollbar { display: none; }
      .stat {
        min-width: 86px;
        padding: 9px 10px;
        border-radius: 15px;
        box-shadow: 0 10px 20px rgba(15, 23, 42, .05);
      }
      .stat b { font-size: 16px; line-height: 1; }
      .stat span { font-size: 10px; line-height: 1.1; }
      .mobile-insight {
        display: grid;
        gap: 3px;
        padding: 10px 12px;
        border-radius: 14px;
        background: linear-gradient(180deg, #fff8df, #fffdf2);
        border: 1px solid #f7cc57;
        box-shadow: 0 12px 24px rgba(245, 158, 11, .08);
      }
      .mobile-insight.pending-only {
        background: linear-gradient(180deg, #eff6ff, #f8fbff);
        border-color: #93c5fd;
        box-shadow: 0 18px 32px rgba(37, 99, 235, .08);
      }
      .mobile-insight.clear {
        background: linear-gradient(180deg, #ecfdf5, #f7fffb);
        border-color: #6ee7b7;
        box-shadow: 0 18px 32px rgba(5, 150, 105, .08);
      }
      .mobile-insight-title {
        color: #172033;
        font-size: 14px;
        font-weight: 900;
      }
      .mobile-insight-copy {
        color: #667085;
        font-size: 12px;
        line-height: 1.25;
      }
      .toolbar {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 8px;
        border-radius: 16px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
        background: rgba(255,255,255,.84);
        backdrop-filter: blur(12px);
      }
      .toolbar input {
        grid-column: 1 / -1;
        min-height: 42px;
        border-radius: 14px;
        background: #fff;
      }
      .census-filter-group {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
      }
      .census-filter-group .filter-toggle {
        min-width: 0;
      }
      .toolbar button,
      .toolbar select {
        min-height: 38px;
        padding: 8px 9px;
        border-radius: 12px;
        font-size: 11px;
      }
      .toolbar select {
        background: rgba(255,255,255,.92);
      }
      .pending-toolbar {
        grid-template-columns: 1fr 1fr;
      }
      .pending-toolbar .muted {
        grid-column: 1 / -1;
        font-size: 12px;
      }
      .table-wrap { display: none; }
      .panel {
        border: 0;
        background: transparent;
        overflow: visible;
      }
      .cards {
        display: grid;
        gap: 10px;
      }
      .card {
        gap: 9px;
        padding: 14px;
        border-radius: 18px;
        border: 1px solid #dfe7f1;
        box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
      }
      .card-head {
        gap: 8px;
        align-items: flex-start;
      }
      .card .pill {
        font-size: 11px;
        padding: 4px 8px;
      }
      .card-name {
        font-size: 16px;
      }
      .card-facts {
        font-size: 12px;
      }
      .card-block {
        gap: 3px;
      }
      .card-block-label {
        font-size: 10px;
      }
      .card-block-copy {
        font-size: 13px;
        line-height: 1.28;
      }
      .card-team-line {
        font-size: 13px;
      }
      .card .actions {
        grid-template-columns: 82px minmax(0, 1fr) minmax(0, 1fr);
        gap: 6px;
      }
      .card .actions button {
        border-radius: 12px;
        min-width: 0;
        min-height: 34px;
        padding: 7px 6px;
        font-size: 11px;
      }
      .mobile-panel-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
      }
      .mobile-panel-title {
        color: #111827;
        font-size: 16px;
        font-weight: 900;
      }
      .mobile-panel-copy {
        color: #6b7280;
        font-size: 12px;
        font-weight: 700;
      }
      .mobile-panel-link {
        background: transparent;
        color: #2563eb;
        padding: 0;
        font-size: 12px;
        font-weight: 900;
      }
      .mobile-bottom-nav {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 8px;
        z-index: 18;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 5px;
        padding: 7px;
        border-radius: 18px;
        background: rgba(255,255,255,.96);
        border: 1px solid rgba(226, 232, 240, .9);
        box-shadow: 0 14px 28px rgba(15, 23, 42, .14);
        backdrop-filter: blur(16px);
      }
      .mobile-bottom-nav button {
        display: grid;
        gap: 2px;
        justify-items: center;
        background: transparent;
        color: #667085;
        padding: 7px 4px;
        min-height: 44px;
        border-radius: 12px;
        font-size: 10px;
        font-weight: 800;
      }
      .mobile-bottom-nav button.active {
        background: rgba(37, 99, 235, .08);
        color: #2563eb;
      }
      .mobile-bottom-nav button .nav-mini {
        font-size: 8px;
        letter-spacing: .16em;
        text-transform: uppercase;
      }
      .mobile-bottom-nav button .nav-label {
        font-size: 11px;
        letter-spacing: 0;
        text-transform: none;
      }
      .mobile-fab {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        right: 14px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
        z-index: 19;
        width: 50px;
        height: 50px;
        border-radius: 999px;
        background: linear-gradient(180deg, #2563eb, #1d4ed8);
        color: #fff;
        box-shadow: 0 16px 28px rgba(37, 99, 235, .24);
        font-size: 28px;
        line-height: 1;
        padding: 0;
      }
      .form-grid, .split, .pending-columns, .admin-grid, .admin-section-grid, .admin-summary-grid, .admin-meta-grid, .tx-modal-grid { grid-template-columns: 1fr; }
      .topbar, .topbar-actions { align-items: flex-start; }
      .modal-backdrop {
        align-items: end;
        padding: 0;
        background: rgba(15, 23, 42, .34);
      }
      .modal {
        border-radius: 8px 8px 0 0;
        max-height: 86dvh;
        border: 0;
      }
      .print-studio-modal {
        width: 100%;
        max-height: 92dvh;
        border-radius: 18px 18px 0 0;
      }
      .modal-header {
        padding: 12px 14px;
      }
      .modal-header h2 {
        font-size: 17px;
      }
      .modal-body {
        padding: 12px;
      }
      .tx-modal-head,
      .tx-panel {
        padding: 12px;
        border-radius: 16px;
      }
      .tx-modal-title {
        font-size: 20px;
      }
      .tx-preview {
        min-height: 120px;
        padding: 12px;
      }
      .tx-editor {
        min-height: 180px;
      }
      .print-studio-hero {
        padding: 16px 16px 14px;
      }
      .print-studio-body {
        max-height: calc(92dvh - 62px);
      }
      .print-studio-hero h3 {
        font-size: 22px;
      }
      .print-studio-body-inner {
        padding: 14px 14px 16px;
      }
      .print-section-card {
        padding: 14px;
        border-radius: 18px;
      }
      .print-mode-grid,
      .print-summary-grid,
      .print-doctor-list {
        grid-template-columns: 1fr;
      }
      .print-search {
        width: 100%;
      }
      .print-preview-toolbar,
      .print-preview-note {
        padding-left: 14px;
        padding-right: 14px;
      }
      .print-preview-frame-wrap {
        padding: 12px;
      }
      .print-preview-frame {
        min-height: 58dvh;
        border-radius: 18px;
      }
      .actions button {
        min-height: 34px;
        border-radius: 999px;
      }
      .pending-filters { grid-template-columns: 1fr; width: 100%; }
    }
    @media (max-width: 720px) {
      input, select, textarea { font-size: 16px; }
      .topbar-main {
        align-items: center;
      }
      .mobile-app-chip {
        display: none;
      }
      .topbar-copy {
        gap: 1px;
      }
      .topbar h1 {
        font-size: 17px;
      }
      #viewSubtitle {
        font-size: 11px;
      }
      .toolbar {
        grid-template-columns: 1fr;
      }
      .toolbar input {
        min-height: 40px;
      }
      .toolbar button,
      .toolbar select {
        min-height: 36px;
      }
      .mobile-panel-copy {
        display: none;
      }
      .mobile-fab {
        display: none !important;
      }
      .card {
        padding: 12px;
        border-radius: 16px;
        gap: 8px;
      }
      .card-bed {
        padding: 4px 8px;
        font-size: 10px;
      }
      .card-name {
        font-size: 15px;
      }
      .card-facts {
        font-size: 11px;
        gap: 4px;
      }
      .card-facts span::after {
        margin-left: 4px;
      }
      .card-block-copy {
        font-size: 12px;
      }
      .card-team-line {
        font-size: 12px;
        gap: 4px;
      }
      .card-team-line span::after {
        margin-left: 4px;
      }
    }
    @media (max-width: 560px) {
      button { padding: 8px 10px; }
      .login-wrap {
        padding: 16px;
      }
      .login-card {
        padding: 28px 22px 30px;
        border-radius: 22px;
      }
      .login-title {
        font-size: 24px;
        letter-spacing: .24em;
        text-indent: .24em;
      }
      .login-form {
        gap: 15px;
      }
      .login-input {
        min-height: 52px;
        font-size: 14px;
      }
      .login-submit {
        min-height: 50px;
        font-size: 13px;
      }
      .topbar-main {
        align-items: start;
      }
      .mobile-app-chip {
        max-width: calc(100vw - 128px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .toolbar button { grid-column: auto; }
      .pending-toolbar button { grid-column: auto; }
      .stat { min-width: 78px; }
      .card-section-label {
        display: flex;
      }
      .card {
        margin: 0;
      }
      .card .actions {
        grid-template-columns: 70px 1fr 1fr;
      }
      .mobile-bottom-nav {
        padding: 6px;
        gap: 4px;
      }
      .mobile-bottom-nav button {
        min-height: 42px;
        padding: 6px 2px;
      }
      .empty {
        padding: 22px 12px;
        background: var(--panel);
        border-radius: 8px;
      }
      .todo {
        padding: 10px;
        border-radius: 8px;
      }
      .pending-header {
        align-items: stretch;
      }
      .pending-filters {
        gap: 7px;
      }
    }
    @media (max-width: 430px) {
      .content {
        padding: 8px 8px 82px;
        gap: 8px;
      }
      .mobile-menu {
        width: 38px;
        height: 38px;
      }
      .mobile-menu::before {
        font-size: 18px;
      }
      .mobile-sidebar-toggle {
        width: 46px;
        height: 46px;
        font-size: 22px;
      }
      .mobile-user-badge {
        width: 34px;
        height: 34px;
        font-size: 12px;
      }
      .stats {
        gap: 4px;
      }
      .stat {
        min-width: 74px;
        padding: 8px 9px;
      }
      .stat b {
        font-size: 15px;
      }
      .mobile-insight-title {
        font-size: 13px;
      }
      .mobile-insight-copy {
        font-size: 11px;
      }
      .census-filter-group {
        gap: 6px;
      }
      .card-topline {
        align-items: flex-start;
      }
      .card .actions {
        grid-template-columns: 64px 1fr 1fr;
        gap: 5px;
      }
      .card .actions button {
        min-height: 32px;
        padding: 6px 5px;
        font-size: 10px;
      }
      .mobile-bottom-nav button .nav-mini {
        display: none;
      }
      .mobile-bottom-nav button .nav-label {
        font-size: 10px;
      }
    }
    html.phone-ui body {
      background: linear-gradient(180deg, #f7f9fd, #eef4fb);
    }
    html.phone-ui .login-wrap {
      min-height: 100dvh;
      padding: 14px;
      background:
        radial-gradient(circle at 18% 10%, rgba(255,255,255,.94), transparent 26%),
        radial-gradient(circle at 100% 18%, rgba(179,190,255,.2), transparent 34%),
        linear-gradient(180deg, #f8fbff, #eef2ff);
    }
    html.phone-ui .login-card {
      width: 100%;
      max-width: none;
      padding: 24px 20px 26px;
      border-radius: 18px;
      box-shadow: 0 18px 44px rgba(95, 112, 168, .16);
    }
    html.phone-ui .login-brand {
      margin-bottom: 22px;
      gap: 14px;
    }
    html.phone-ui .login-title {
      font-size: 21px;
      letter-spacing: .2em;
      text-indent: .2em;
    }
    html.phone-ui .login-divider {
      width: 46px;
    }
    html.phone-ui .login-form {
      gap: 14px;
    }
    html.phone-ui .login-field label {
      font-size: 11px;
    }
    html.phone-ui .login-input {
      min-height: 50px;
      font-size: 16px;
      padding-left: 48px;
    }
    html.phone-ui .login-submit {
      min-height: 50px;
      font-size: 13px;
    }
    html.phone-ui .content {
      padding: 0 10px calc(88px + env(safe-area-inset-bottom, 0px));
      gap: 10px;
      min-height: 100dvh;
      transform: none;
      transition: none;
      will-change: auto;
    }
    html.phone-ui .topbar {
      display: none !important;
    }
    html.phone-ui .topbar-main {
      flex: 1;
      min-width: 0;
      gap: 10px;
      align-items: center;
    }
    html.phone-ui .topbar-copy {
      flex: 1;
      min-width: 0;
      gap: 2px;
    }
    html.phone-ui .mobile-menu,
    html.phone-ui .mobile-app-chip,
    html.phone-ui .mobile-sidebar-toggle,
    html.phone-ui #newPatientBtn,
    html.phone-ui #printControls,
    html.phone-ui #patientTools,
    html.phone-ui #patientsTableWrap,
    html.phone-ui #patientsCards,
    html.phone-ui .mobile-panel-heading,
    html.phone-ui .mobile-insight,
    html.phone-ui #stats,
    html.phone-ui .mobile-fab {
      display: none !important;
    }
    html.phone-ui .topbar h1 {
      font-size: 20px;
      line-height: 1.02;
    }
    html.phone-ui #viewSubtitle {
      font-size: 12px;
      line-height: 1.1;
      color: #667085;
    }
    html.phone-ui .topbar-actions {
      flex: 0 0 auto;
      justify-content: flex-end;
      align-items: center;
      padding-top: 0;
    }
    html.phone-ui .mobile-user-badge {
      width: 42px;
      height: 42px;
      border-radius: 15px;
      font-size: 15px;
    }
    html.phone-ui .shell.mobile-sidebar-open .content {
      border-radius: 0;
      box-shadow: none;
      pointer-events: auto;
      touch-action: auto;
      user-select: auto;
    }
    html.phone-ui .panel {
      border: 0;
      background: transparent;
      overflow: visible;
      padding: 0;
    }
    html.phone-ui .phone-census-view {
      display: grid;
      gap: 10px;
    }
    html.phone-ui .phone-scroll-indicator {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, calc(-50% - 12px)) scale(.96);
      z-index: 32;
      min-width: 129px;
      padding: 15px 24px;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, .22);
      background: rgba(15, 23, 42, .86);
      color: #fff;
      box-shadow: 0 16px 34px rgba(15, 23, 42, .22);
      backdrop-filter: blur(16px);
      text-align: center;
      pointer-events: none;
      opacity: 0;
      transition: opacity .16s ease, transform .16s ease;
    }
    html.phone-ui .phone-scroll-indicator.visible {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
    html.phone-ui .phone-scroll-indicator-code {
      display: inline-flex;
      align-items: baseline;
      justify-content: center;
      gap: 8px;
      font-weight: 950;
      letter-spacing: .02em;
      white-space: nowrap;
    }
    html.phone-ui .phone-scroll-indicator-section {
      font-size: 30px;
    }
    html.phone-ui .phone-scroll-indicator-bed {
      font-size: 42px;
      line-height: 1;
    }
    html.phone-ui .phone-census-hero {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      padding: 2px 2px 0;
    }
    html.phone-ui .phone-census-title {
      color: #101828;
      font-size: 19px;
      font-weight: 950;
      line-height: 1.02;
    }
    html.phone-ui .phone-census-count {
      color: #667085;
      font-size: 12px;
      font-weight: 800;
      margin-top: 3px;
    }
    html.phone-ui .phone-print-link {
      min-height: 38px;
      padding: 0 14px;
      border-radius: 999px;
      background: rgba(255,255,255,.92);
      color: #1d4ed8;
      border: 1px solid rgba(191, 219, 254, .9);
      font-size: 12px;
      font-weight: 900;
      box-shadow: 0 10px 24px rgba(148, 163, 184, .16);
    }
    html.phone-ui .phone-new-patient {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-height: 46px;
      padding: 0 14px;
      border-radius: 14px;
      background: linear-gradient(180deg, #2563eb, #1d4ed8);
      color: #fff;
      border: 1px solid #1d4ed8;
      font-size: 14px;
      font-weight: 950;
      white-space: nowrap;
      box-shadow: 0 10px 24px rgba(37, 99, 235, .2);
    }
    html.phone-ui .phone-hero-actions { display: flex; align-items: center; gap: 8px; }
    html.phone-ui .phone-user-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 999px; background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; font-size: 13px; font-weight: 950; box-shadow: 0 10px 24px rgba(148, 163, 184, .16); }
    html.phone-ui .phone-controls {
      display: grid;
      gap: 10px;
      padding: 12px;
      border-radius: 22px;
      background: rgba(255,255,255,.9);
      border: 1px solid rgba(223, 231, 244, .95);
      box-shadow: 0 18px 34px rgba(15, 23, 42, .06);
      backdrop-filter: blur(20px);
    }
    html.phone-ui .phone-search {
      min-height: 48px;
      border-radius: 16px;
      padding: 10px 14px;
      font-size: 16px;
      background: #fff;
      border: 1px solid #dbe4ef;
      box-shadow: inset 0 1px 2px rgba(15, 23, 42, .03);
    }
    html.phone-ui .phone-stats {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
    html.phone-ui .phone-stat {
      display: grid;
      gap: 3px;
      padding: 11px 12px;
      border-radius: 18px;
      background: linear-gradient(180deg, #f8fbff, #eef3ff);
      border: 1px solid #dbe6f5;
      box-shadow: 0 10px 22px rgba(15, 23, 42, .05);
    }
    html.phone-ui .phone-stat strong {
      color: #172033;
      font-size: 20px;
      font-weight: 950;
      line-height: 1;
    }
    html.phone-ui .phone-stat span {
      color: #667085;
      font-size: 10px;
      font-weight: 900;
      letter-spacing: .12em;
      text-transform: uppercase;
    }
    html.phone-ui .phone-filter-row {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
    }
    html.phone-ui .phone-chip,
    html.phone-ui .phone-refresh {
      min-height: 34px;
      padding: 7px 8px;
      border-radius: 12px;
      font-size: 10px;
      font-weight: 900;
      background: #eef2f7;
      color: #344054;
      border: 0;
    }
    html.phone-ui .phone-chip.active.filter-all { background: #4b5563; color: #fff; }
    html.phone-ui .phone-chip.active.filter-women { background: #be185d; color: #fff; }
    html.phone-ui .phone-chip.active.filter-men { background: #0f766e; color: #fff; }
    html.phone-ui .phone-select-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 6px;
      align-items: center;
    }
    html.phone-ui .phone-doctor-select {
      min-height: 38px;
      border-radius: 14px;
      padding: 8px 10px;
      font-size: 12px;
      background: #fff;
      border: 1px solid #dbe4ef;
    }
    html.phone-ui .phone-list {
      display: grid;
      gap: 10px;
      padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    html.phone-ui .phone-group-label {
      padding: 3px 8px 0;
      color: #64748b;
      font-size: 11px;
      font-weight: 900;
      letter-spacing: .12em;
      text-transform: uppercase;
    }
    html.phone-ui .phone-patient-card {
      display: grid;
      gap: 10px;
      padding: 14px;
      border-radius: 24px;
      background: rgba(255,255,255,.96);
      border: 1px solid #e0e8f2;
      box-shadow: 0 18px 34px rgba(15, 23, 42, .08);
    }
    html.phone-ui .phone-patient-card.section-mujeres {
      border-color: rgba(190, 24, 93, .2);
      box-shadow: inset 4px 0 0 rgba(190, 24, 93, .5), 0 18px 34px rgba(15, 23, 42, .08);
    }
    html.phone-ui .phone-patient-card.section-hombres {
      border-color: rgba(15, 118, 110, .2);
      box-shadow: inset 4px 0 0 rgba(15, 118, 110, .5), 0 18px 34px rgba(15, 23, 42, .08);
    }
    html.phone-ui .phone-card-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    html.phone-ui .phone-bed {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 34px;
      padding: 0 12px;
      border-radius: 999px;
      background: #eff6ff;
      color: #1d4ed8;
      font-size: 13px;
      font-weight: 950;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    html.phone-ui .phone-name {
      color: #172033;
      font-size: 22px;
      font-weight: 950;
      line-height: 1.02;
    }
    html.phone-ui .phone-diagnosis {
      color: #667085;
      font-size: 14px;
      font-weight: 500;
      line-height: 1.35;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      overflow: hidden;
      -webkit-line-clamp: 2;
    }
    html.phone-ui .phone-doctor {
      color: #344054;
      font-size: 14px;
      font-weight: 800;
      line-height: 1.3;
    }
    html.phone-ui .phone-doctor small {
      display: block;
      margin-top: 2px;
      color: #667085;
      font-size: 11px;
      font-weight: 800;
    }
    html.phone-ui .phone-meta {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }
    html.phone-ui .phone-meta span {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 0 10px;
      border-radius: 999px;
      background: #fff;
      color: #111827;
      font-size: 12px;
      font-weight: 950;
      border: 1px solid #d5dde8;
    }
    @keyframes phone-alert-cue {
      0%, 100% { transform: translateX(0); opacity: .72; }
      50% { transform: translateX(4px); opacity: 1; }
    }
    html.phone-ui .phone-alert-summary {
      display: grid;
      gap: 6px;
      width: 100%;
      min-width: 0;
    }
    html.phone-ui .phone-alert-empty {
      color: #475467;
      font-size: 13px;
      font-weight: 800;
      line-height: 1.3;
      padding: 2px 2px 0;
    }
    html.phone-ui .phone-alert-swipe-cue {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: #667085;
      font-size: 9px;
      font-weight: 800;
      letter-spacing: .08em;
      text-transform: uppercase;
      white-space: nowrap;
      justify-self: end;
      padding-right: 10px;
    }
    html.phone-ui .phone-alert-swipe-cue::after {
      content: '›';
      font-size: 13px;
      line-height: 1;
      animation: phone-alert-cue 1.5s ease-in-out infinite;
    }
    html.phone-ui .phone-alert-carousel {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      scroll-snap-type: x mandatory;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
    }
    html.phone-ui .phone-alert-carousel.swipeable { padding-right: 34px; }
    html.phone-ui .phone-alert-carousel::-webkit-scrollbar {
      display: none;
    }
    html.phone-ui .phone-alert-item {
      flex: 0 0 100%;
      min-width: 100%;
      scroll-snap-align: start;
      display: grid;
      gap: 6px;
      padding: 12px 14px;
      border-radius: 16px;
      border: 1px solid #dbe4ef;
      background: #fff;
      box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
    }
    html.phone-ui .phone-alert-carousel.swipeable .phone-alert-item {
      flex-basis: calc(100% - 30px);
      min-width: calc(100% - 30px);
    }
    html.phone-ui .phone-alert-item.incidence {
      border-color: #f6caa2;
      background: linear-gradient(180deg, #fffaf4, #fffdf9);
    }
    html.phone-ui .phone-alert-item.pending {
      border-color: #bfd7ff;
      background: linear-gradient(180deg, #f8fbff, #ffffff);
    }
    html.phone-ui .phone-alert-item-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
    }
    html.phone-ui .phone-alert-item-kind {
      display: inline-flex;
      align-items: center;
      min-height: 22px;
      padding: 0 9px;
      border-radius: 999px;
      font-size: 9px;
      font-weight: 900;
      letter-spacing: .12em;
      text-transform: uppercase;
    }
    html.phone-ui .phone-alert-item.incidence .phone-alert-item-kind {
      color: #9a3412;
      background: #ffedd5;
    }
    html.phone-ui .phone-alert-item.pending .phone-alert-item-kind {
      color: #1d4ed8;
      background: #dbeafe;
    }
    html.phone-ui .phone-alert-item-text {
      color: #172033;
      font-size: 15px;
      font-weight: 900;
      line-height: 1.28;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }
    html.phone-ui .phone-alert-item-meta {
      color: #667085;
      font-size: 10px;
      font-weight: 700;
      line-height: 1.25;
    }
    html.phone-ui .phone-alert-item-meta.secondary {
      color: #98a2b3;
    }
    html.phone-ui .phone-actions {
      display: grid;
      grid-template-columns: minmax(0, 1fr) repeat(3, 42px);
      gap: 8px;
      align-items: center;
    }
    html.phone-ui .phone-actions button {
      min-height: 42px;
      border-radius: 14px;
      padding: 8px 10px;
      font-size: 12px;
      font-weight: 900;
    }
    html.phone-ui .phone-action-edit {
      min-width: 0;
    }
    html.phone-ui .phone-action-round {
      width: 42px;
      min-width: 42px;
      height: 42px;
      min-height: 42px;
      border-radius: 999px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      letter-spacing: 0;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.38);
    }
    html.phone-ui .phone-treatment-card {
      display: grid;
      gap: 6px;
      width: 100%;
      padding: 12px 13px;
      border-radius: 20px;
      border: 1px solid #dbe4ef;
      background: #f8fafc;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
    }
    html.phone-ui .phone-treatment-main {
      display: grid;
      gap: 6px;
      width: 100%;
      text-align: left;
      padding: 0;
      background: transparent;
      border: 0;
      color: inherit;
    }
    html.phone-ui .phone-treatment-card.fresh {
      background: #ecfdf5;
      border-color: #86efac;
    }
    html.phone-ui .phone-treatment-card.warning {
      background: #fffbeb;
      border-color: #fcd34d;
    }
    html.phone-ui .phone-treatment-card.danger {
      background: #fef2f2;
      border-color: #fca5a5;
    }
    html.phone-ui .phone-treatment-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
    }
    html.phone-ui .phone-treatment-label {
      color: #667085;
      font-size: 10px;
      font-weight: 900;
      letter-spacing: .12em;
      text-transform: uppercase;
    }
    html.phone-ui .phone-treatment-pill {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 0 8px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 900;
      letter-spacing: .08em;
      text-transform: uppercase;
      background: rgba(148, 163, 184, .14);
      color: #334155;
    }
    html.phone-ui .phone-treatment-pill.fresh {
      color: #15803d;
      background: rgba(34, 197, 94, .12);
    }
    html.phone-ui .phone-treatment-pill.warning {
      color: #b45309;
      background: rgba(245, 158, 11, .14);
    }
    html.phone-ui .phone-treatment-pill.danger {
      color: #b91c1c;
      background: rgba(239, 68, 68, .12);
    }
    html.phone-ui .phone-treatment-preview {
      color: #172033;
      font-size: 13px;
      line-height: 1.36;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      overflow: hidden;
      -webkit-line-clamp: 2;
    }
    html.phone-ui .phone-treatment-main.expanded .phone-treatment-preview {
      -webkit-line-clamp: unset;
    }
    html.phone-ui .phone-treatment-meta {
      color: #667085;
      font-size: 11px;
      font-weight: 800;
    }
    html.phone-ui .phone-treatment-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 2px;
    }
    html.phone-ui .phone-treatment-keep {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 38px;
      padding: 0 14px;
      border-radius: 999px;
      border: 1px solid #93c5fd;
      background: linear-gradient(180deg, #dbeafe, #bfdbfe);
      color: #1d4ed8;
      font-size: 11px;
      font-weight: 950;
      letter-spacing: .04em;
      text-transform: uppercase;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
    }
    html.phone-ui .phone-treatment-keep .phone-treatment-keep-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      border-radius: 999px;
      background: rgba(255,255,255,.78);
      font-size: 14px;
      line-height: 1;
    }
    html.phone-ui .phone-treatment-camera,
    html.phone-ui .phone-treatment-edit,
    html.phone-ui .phone-treatment-confirm {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 38px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 950;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
    }
    html.phone-ui .phone-treatment-camera {
      width: 38px;
      min-width: 38px;
      padding: 0;
      border: 1px solid #fca5a5;
      background: linear-gradient(180deg, #fee2e2, #fecaca);
      color: #b91c1c;
    }
    html.phone-ui .phone-treatment-camera svg {
      width: 18px;
      height: 18px;
      display: block;
    }
    html.phone-ui .phone-treatment-edit {
      width: 38px;
      min-width: 38px;
      margin-left: auto;
      padding: 0;
      border: 1px solid #93c5fd;
      background: linear-gradient(180deg, #dbeafe, #bfdbfe);
      color: #1d4ed8;
    }
    html.phone-ui .phone-treatment-edit svg {
      width: 17px;
      height: 17px;
      display: block;
    }
    html.phone-ui .phone-treatment-confirm {
      padding: 0 14px;
      border: 1px solid #fcd34d;
      background: linear-gradient(180deg, #fef3c7, #fde68a);
      color: #92400e;
      text-transform: uppercase;
      letter-spacing: .04em;
    }
    html.phone-ui .phone-treatment-pending {
      color: #667085;
      font-size: 11px;
      font-weight: 900;
      padding-left: 2px;
    }
    html.phone-ui .tx-keep-button {
      border-radius: 999px;
      padding: 10px 14px;
      background: linear-gradient(180deg, #dbeafe, #bfdbfe);
      color: #1d4ed8;
      border: 1px solid #93c5fd;
      box-shadow: 0 10px 20px rgba(37, 99, 235, .14), inset 0 1px 0 rgba(255,255,255,.75);
    }
    html.phone-ui .tx-keep-button .tx-keep-icon {
      background: rgba(255,255,255,.72);
      color: #1d4ed8;
    }
    html.phone-ui .mobile-bottom-nav {
      position: fixed;
      left: 10px;
      right: 10px;
      bottom: calc(10px + env(safe-area-inset-bottom, 0px));
      z-index: 18;
      display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 3px;
      padding: 5px;
      border-radius: 18px;
      background: rgba(255,255,255,.94);
      border: 1px solid rgba(226, 232, 240, .92);
      box-shadow: 0 18px 36px rgba(15, 23, 42, .16);
      backdrop-filter: blur(18px);
    }
    html.phone-ui .mobile-bottom-nav button {
      display: grid;
      gap: 3px;
      justify-items: center;
      align-content: center;
      background: transparent;
      color: #667085;
      padding: 6px 2px 5px;
      min-height: 52px;
      border-radius: 13px;
      font-size: 11px;
      font-weight: 900;
    }
    html.phone-ui .mobile-bottom-nav button.active {
      background: linear-gradient(180deg, #dbe7ff, #c7d2fe);
      color: #1e3a8a;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
    }
    html.phone-ui .mobile-bottom-nav button .nav-mini {
      display: grid;
      place-items: center;
      line-height: 1;
    }
    html.phone-ui .mobile-bottom-nav button .nav-mini svg {
      width: 24px;
      height: 24px;
      stroke-width: 1.9;
    }
    html.phone-ui .mobile-bottom-nav button .nav-label {
      max-width: 100%;
      overflow: hidden;
      font-size: 9.5px;
      font-weight: 900;
      letter-spacing: 0;
      line-height: 1.1;
      text-overflow: ellipsis;
      text-transform: none;
      white-space: nowrap;
    }
    .mobile-pending-shell { display: grid; gap: 10px; }
    .mobile-panel-actions { display: flex; align-items: center; gap: 8px; }
    .mobile-panel-user { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 11px; background: #eaf1ff; color: #1d4ed8; font-size: 12px; font-weight: 900; }
    .mobile-account-menu { display: grid; gap: 8px; }
    .mobile-account-menu button { min-height: 46px; justify-content: flex-start; text-align: left; }
    .mobile-pending-filter { position: sticky; top: 0; z-index: 8; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.94); box-shadow: 0 8px 20px rgba(15,23,42,.08); backdrop-filter: blur(14px); }
    .mobile-pending-filter button { min-height: 40px; border-radius: 12px; background: transparent; color: #64748b; }
    .mobile-pending-filter button.active { background: #1d4ed8; color: #fff; box-shadow: 0 6px 14px rgba(29,78,216,.2); }
    .mobile-pending-patient-list { display: grid; gap: 10px; }
    .mobile-pending-patient-card { overflow: hidden; border: 1px solid #dbe3ee; border-radius: 18px; background: #fff; box-shadow: 0 10px 24px rgba(15,23,42,.07); }
    .mobile-pending-patient-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 13px; }
    .mobile-pending-bed { padding: 5px 8px; border-radius: 9px; background: #eaf1ff; color: #1d4ed8; font-size: 11px; font-weight: 900; white-space: nowrap; }
    .mobile-pending-patient-copy { min-width: 0; display: grid; gap: 3px; }
    .mobile-pending-patient-copy h3 { margin: 0; font-size: 17px; line-height: 1.2; }
    .mobile-pending-diagnosis { display: -webkit-box; overflow: hidden; color: #475569; font-size: 12px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
    .mobile-pending-patient-copy small { color: #64748b; font-weight: 800; }
    .mobile-history-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 11px; background: #f1f5f9; color: #334155; }
    .mobile-history-button svg { width: 20px; height: 20px; stroke-width: 1.9; }
    .mobile-patient-items { display: grid; gap: 7px; padding: 0 10px 10px; }
    .mobile-patient-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 10px 10px 12px; border-radius: 13px; border-left: 4px solid; }
    .mobile-patient-item.incidence { border-color: #dc2626; background: #fff1f2; color: #991b1b; }
    .mobile-patient-item.pending { border-color: #2563eb; background: #eff6ff; color: #1e3a8a; }
    .mobile-patient-item > div { min-width: 0; display: grid; gap: 2px; }
    .mobile-patient-item b { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
    .mobile-patient-item span { color: #334155; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
    .mobile-patient-item button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px; background: rgba(255,255,255,.72); color: currentColor; }
    .mobile-patient-item button svg { width: 18px; height: 18px; stroke-width: 1.8; }
    .mobile-patient-items-empty { padding: 9px 10px; border-radius: 12px; background: #f8fafc; color: #94a3b8; text-align: center; font-size: 12px; font-weight: 800; }
    html.phone-ui .mobile-pending-shell, html.phone-ui .phone-handover-shell { display: grid; gap: 12px; }
    html.phone-ui .phone-section-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 3px 2px 1px; }
    html.phone-ui .phone-section-kicker { color: #2563eb; font-size: 9px; font-weight: 950; letter-spacing: .13em; text-transform: uppercase; }
    html.phone-ui .phone-section-hero h2 { margin: 3px 0 2px; color: #101828; font-size: 21px; line-height: 1.05; letter-spacing: -.03em; }
    html.phone-ui .phone-section-hero p { margin: 0; color: #667085; font-size: 12px; font-weight: 750; line-height: 1.3; }
    html.phone-ui .phone-section-action { min-height: 38px; padding: 0 13px; border: 1px solid #bfdbfe; border-radius: 999px; background: #fff; color: #1d4ed8; box-shadow: 0 9px 20px rgba(148,163,184,.14); font-size: 11px; font-weight: 900; white-space: nowrap; }
    html.phone-ui .phone-section-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    html.phone-ui .phone-section-stat { display: grid; gap: 3px; min-width: 0; padding: 11px 10px; border: 1px solid #dbe6f5; border-radius: 17px; background: linear-gradient(180deg, #f8fbff, #eef4ff); box-shadow: 0 10px 22px rgba(15,23,42,.05); }
    html.phone-ui .phone-section-stat.warning { border-color: #fed7aa; background: linear-gradient(180deg, #fffaf4, #fff7ed); }
    html.phone-ui .phone-section-stat strong { color: #172033; font-size: 20px; font-weight: 950; line-height: 1; }
    html.phone-ui .phone-section-stat.warning strong { color: #c2410c; }
    html.phone-ui .phone-section-stat span { overflow: hidden; color: #667085; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
    html.phone-ui .mobile-pending-filter { position: static; padding: 4px; border-radius: 15px; box-shadow: 0 10px 22px rgba(15,23,42,.055); }
    html.phone-ui .mobile-pending-filter button { min-height: 38px; font-size: 11px; font-weight: 900; }
    html.phone-ui .mobile-pending-patient-list { gap: 11px; }
    html.phone-ui .mobile-pending-patient-card { border-color: #dbe6f2; border-radius: 20px; box-shadow: 0 13px 28px rgba(15,23,42,.07); }
    html.phone-ui .mobile-pending-patient-head { gap: 9px; padding: 14px 13px 10px; }
    html.phone-ui .mobile-pending-bed { padding: 5px 7px; border-radius: 9px; font-size: 10px; }
    html.phone-ui .mobile-pending-patient-copy h3 { color: #172033; font-size: 16px; font-weight: 950; }
    html.phone-ui .mobile-pending-patient-copy small { font-size: 11px; }
    html.phone-ui .mobile-history-button { width: 34px; height: 34px; border-radius: 50%; background: #f1f5f9; }
    html.phone-ui .mobile-patient-items { gap: 8px; padding: 0 10px 10px; }
    html.phone-ui .mobile-patient-item { min-height: 70px; padding: 10px 9px 10px 11px; border-radius: 14px; }
    html.phone-ui .mobile-patient-item b { font-size: 9px; letter-spacing: .1em; }
    html.phone-ui .mobile-patient-item span { color: #172033; font-size: 13px; font-weight: 750; line-height: 1.35; }
    html.phone-ui .mobile-patient-item button { width: 32px; height: 32px; border-radius: 50%; }
    html.phone-ui .phone-handover-select { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: 18px; background: linear-gradient(135deg, #eff6ff, #f8fbff); color: #1d4ed8; box-shadow: 0 12px 24px rgba(37,99,235,.1); text-align: left; }
    html.phone-ui .phone-handover-select strong { font-size: 13px; }
    html.phone-ui .phone-handover-select span { color: #475569; font-size: 11px; font-weight: 750; }
    html.phone-ui .phone-handover-select b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 16px; }
    html.phone-ui .phone-handover-composer, html.phone-ui .phone-handover-patients { display: grid; gap: 12px; padding: 14px; border: 1px solid #dbe6f2; border-radius: 20px; background: #fff; box-shadow: 0 13px 28px rgba(15,23,42,.06); }
    html.phone-ui .phone-handover-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
    html.phone-ui .phone-handover-card-head h3 { margin: 0; color: #172033; font-size: 16px; }
    html.phone-ui .phone-handover-card-head p { margin: 3px 0 0; color: #667085; font-size: 11px; font-weight: 700; }
    html.phone-ui .phone-handover-card-head button { min-height: 32px; padding: 6px 9px; border-radius: 11px; font-size: 10px; }
    html.phone-ui .phone-handover-text { min-height: 235px; padding: 12px; border: 1px solid #dbe4ef; border-radius: 16px; background: #f8fafc; color: #172033; font-size: 14px; line-height: 1.5; resize: vertical; }
    html.phone-ui .phone-handover-copy { min-height: 44px; border-radius: 14px; }
    html.phone-ui .phone-handover-share { display: grid; gap: 8px; padding-top: 11px; border-top: 1px solid #e8eef5; }
    html.phone-ui .phone-handover-share > span { color: #667085; font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
    html.phone-ui .phone-handover-share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    html.phone-ui .phone-handover-share-grid button { min-height: 42px; padding: 8px; border-radius: 13px; font-size: 11px; white-space: normal; }
    html.phone-ui .phone-handover-patient-list { display: grid; gap: 9px; }
    html.phone-ui .phone-handover-patient { display: grid; gap: 10px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 16px; background: #fbfdff; }
    html.phone-ui .phone-handover-patient-head { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: start; }
    html.phone-ui .phone-handover-patient-bed { padding: 5px 7px; border-radius: 9px; background: #eaf1ff; color: #1d4ed8; font-size: 10px; font-weight: 950; }
    html.phone-ui .phone-handover-patient-head strong { color: #172033; font-size: 14px; line-height: 1.2; }
    html.phone-ui .phone-handover-patient-head small { display: block; margin-top: 3px; color: #667085; font-size: 11px; font-weight: 700; }
    html.phone-ui .phone-handover-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
    html.phone-ui .phone-handover-add input { min-width: 0; min-height: 42px; border-radius: 12px; font-size: 14px; }
    html.phone-ui .phone-handover-add button { min-height: 42px; border-radius: 12px; font-size: 11px; }
    .patient-item-history { display: grid; gap: 9px; }
    .history-item { display: grid; gap: 7px; padding: 12px; border-radius: 14px; border-left: 4px solid; }
    .history-item.incidence { border-color: #dc2626; background: #fff1f2; }
    .history-item.pending { border-color: #2563eb; background: #eff6ff; }
    .history-item-head { display: flex; justify-content: space-between; gap: 8px; }
    .history-item-head span { color: #64748b; font-size: 11px; font-weight: 900; }
    .notification-settings-shell { display: grid; gap: 12px; }
    .notification-settings-intro { padding: 14px; border-radius: 16px; background: #eff6ff; color: #334155; line-height: 1.45; }
    .notification-settings-basics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .notification-setting-card { display: grid; gap: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
    .notification-setting-card > span { font-size: 13px; font-weight: 900; }
    .notification-setting-card small { color: var(--muted); line-height: 1.35; }
    .notification-rules-title { margin: 2px 0 0; }
    .notification-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .notification-rule-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #f8fafc; }
    .notification-rule-card h3 { margin: 0; font-size: 15px; }
    .notification-rule-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
    .notification-rule-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
    .notification-rule-controls label { display: grid; gap: 5px; color: #475569; font-size: 11px; font-weight: 900; }
    .notification-rule-controls select { min-width: 0; }
    @media (max-width: 700px) {
      .notification-settings-basics, .notification-rule-grid { grid-template-columns: 1fr; }
      .notification-rule-controls { grid-template-columns: 1fr; }
    }
    .pending-shell, .handover-stack { display: grid; gap: 16px; max-width: 1240px; }
    .pending-hero, .handover-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px; border: 1px solid #dbe7f7; border-radius: 22px; background: radial-gradient(circle at top right, rgba(37,99,235,.14), transparent 34%), linear-gradient(135deg, #fff, #f4f8ff); box-shadow: 0 16px 34px rgba(15,23,42,.06); }
    .pending-eyebrow, .handover-eyebrow { color: #2563eb; font-size: 11px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
    .pending-hero h2, .handover-hero h2 { margin: 4px 0 3px; color: #0f172a; font-size: 25px; letter-spacing: -.03em; }
    .pending-hero p, .handover-hero p { margin: 0; color: #64748b; font-size: 13px; font-weight: 650; }
    .pending-hero-actions, .handover-hero-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
    .pending-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .pending-summary-card { padding: 15px 16px; border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; box-shadow: 0 8px 20px rgba(15,23,42,.045); }
    .pending-summary-card span { display: block; color: #64748b; font-size: 11px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
    .pending-summary-card strong { display: block; margin-top: 4px; color: #0f172a; font-size: 25px; line-height: 1; }
    .pending-summary-card.pending strong { color: #2563eb; }
    .pending-summary-card.incidence strong { color: #c2410c; }
    .pending-workspace { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); gap: 14px; align-items: start; }
    .pending-board { padding: 16px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; box-shadow: 0 10px 26px rgba(15,23,42,.055); }
    .pending-board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
    .pending-board-head h3 { margin: 0; color: #0f172a; font-size: 17px; }
    .pending-board-head p { margin: 3px 0 0; color: #64748b; font-size: 12px; }
    .pending-board .todo-list { gap: 10px; }
    .pending-board .todo { padding: 13px; border-radius: 15px; border-color: #e2e8f0; box-shadow: none; }
    .pending-board .todo.pending-todo { border-left: 4px solid #2563eb; background: linear-gradient(90deg, #f8fbff, #fff 28%); }
    .pending-board .todo.incidence-todo { border-left: 4px solid #f97316; background: linear-gradient(90deg, #fff8f3, #fff 28%); }
    .pending-board .todo-top { align-items: center; }
    .todo-status { padding: 4px 8px; border-radius: 999px; background: #eaf1ff; color: #1d4ed8; font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
    .incidence-todo .todo-status { background: #fff0e7; color: #c2410c; }
    .todo-patient { color: #0f172a; font-size: 14px; }
    .todo-copy { color: #334155; line-height: 1.45; }
    .pending-board .todo-actions { padding-top: 2px; }
    .handover-hero { align-items: flex-end; }
    .handover-hero-actions { justify-content: flex-end; }
    .handover-selection-count { flex: none; padding: 7px 11px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-size: 11px; font-weight: 900; }
    .handover-picker-launch { min-height: 42px; box-shadow: 0 8px 18px rgba(37, 99, 235, .1); }
    .handover-workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); gap: 14px; align-items: start; }
    .handover-editor-panel, .handover-patients-panel { padding: 18px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; box-shadow: 0 10px 26px rgba(15,23,42,.055); }
    .handover-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .handover-editor-head h3, .handover-patients-panel h3 { margin: 0; color: #0f172a; font-size: 17px; }
    .handover-editor-head p, .handover-patients-panel p { margin: 3px 0 0; color: #64748b; font-size: 12px; }
    .handover-picker-list { display: grid; gap: 8px; }
    .handover-picker-intro { padding: 10px 12px; border-radius: 12px; background: #eff6ff; color: #334155; font-size: 13px; }
    .handover-bed-choice { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
    .handover-bed-choice:active { transform: scale(.99); }
    .handover-bed-choice.selected { border-color: #60a5fa; background: #eff6ff; }
    .handover-bed-choice input { margin: 0; }
    .handover-choice-copy { display: grid; gap: 3px; min-width: 0; }
    .handover-choice-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
    .handover-choice-copy strong, .handover-choice-copy small { overflow-wrap: anywhere; }
    .handover-recent-badge { padding: 3px 7px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
    .handover-picker-done { position: sticky; bottom: 0; width: 100%; min-height: 46px; box-shadow: 0 -8px 18px rgba(255,255,255,.96); }
    .handover-editor-panel { display: grid; gap: 13px; }
    .handover-text { width: 100%; min-height: 310px; resize: vertical; line-height: 1.55; border-color: #dbe3ee; border-radius: 16px; background: #f8fafc; }
    .handover-copy-action { justify-content: flex-end; }
    .handover-share { display: grid; gap: 9px; padding-top: 13px; border-top: 1px solid #e2e8f0; }
    .handover-patient-list { display: grid; gap: 9px; margin-top: 13px; }
    .handover-patient { display: grid; grid-template-columns: 1fr; gap: 9px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 15px; background: #fbfdff; }
    .handover-patient:last-child { border-bottom: 0; }
    .handover-patient input { min-width: 0; }
    .handover-chat { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; }
    .handover-chat-thread { display: grid; gap: 12px; }
    .handover-chat-message { max-width: min(100%, 620px); padding: 14px 16px; border-radius: 18px; line-height: 1.45; box-shadow: 0 8px 20px rgba(15,23,42,.05); }
    .handover-chat-message.bot { justify-self: start; border: 1px solid #dbe7f7; background: #f6f9ff; color: #172033; }
    .handover-chat-message.user { justify-self: end; background: #2563eb; color: #fff; }
    .handover-chat-patient { display: grid; gap: 3px; margin-top: 9px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.72); color: #334155; font-size: 13px; }
    .handover-chat-patient b { color: #1d4ed8; }
    .handover-chat-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
    .handover-chat-actions button { min-height: 42px; border-radius: 13px; }
    .handover-manual-launch { min-height: 52px !important; padding: 10px 18px; background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #38bdf8); box-shadow: 0 12px 22px rgba(37,99,235,.25); font-size: 14px; font-weight: 900; }
    .handover-manual-launch::before { content: '→'; margin-right: 8px; font-size: 18px; }
    .handover-ai-coming { opacity: .58; cursor: not-allowed; }
    .handover-chat-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
    .handover-chat-entry input, .handover-chat-entry textarea { min-width: 0; border-radius: 13px; }
    .handover-chat-entry textarea { min-height: 84px; resize: vertical; }
    .handover-chat-entry.wide { grid-template-columns: 1fr; }
    .dictation-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -4px; }
    .dictation-actions button { min-height: 38px; padding: 7px 11px; }
    .dictation-actions button.recording { background: #b42318; }
    .dictation-note { color: var(--muted); font-size: 12px; font-weight: 700; }
    .handover-chat-patient-picker { display: grid; gap: 8px; }
    .handover-chat-patient-picker button { justify-content: flex-start; text-align: left; min-height: 45px; border-radius: 13px; }
    .handover-chat-warning { margin-top: 9px; padding: 10px; border-radius: 12px; background: #fff1f2; color: #be123c; font-size: 12px; font-weight: 800; }
    .handover-chat-final { display: grid; gap: 11px; padding: 16px; border: 1px solid #bbf7d0; border-radius: 18px; background: #f0fdf4; }
    .handover-chat-final h3 { margin: 0; color: #166534; }
    .handover-chat-final p { margin: 0; color: #365314; font-size: 13px; }
    .handover-share-label { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
    .handover-share-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .handover-share-actions button { min-height: 44px; white-space: normal; }
    @media (max-width: 700px) {
      .pending-hero, .handover-hero { display: grid; align-items: stretch; padding: 17px; border-radius: 18px; gap: 14px; }
      .pending-hero h2, .handover-hero h2 { font-size: 22px; }
      .pending-hero-actions, .handover-hero-actions { justify-content: stretch; }
      .pending-hero-actions button, .handover-hero-actions button { flex: 1; }
      .pending-summary-grid, .pending-workspace, .handover-workspace { grid-template-columns: 1fr; }
      .pending-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
      .pending-summary-card { padding: 12px 10px; border-radius: 15px; }
      .pending-summary-card strong { font-size: 21px; }
      .pending-summary-card span { font-size: 9px; }
      .pending-board, .handover-editor-panel, .handover-patients-panel { padding: 13px; border-radius: 17px; }
      .pending-board-head { display: grid; }
      .handover-text { min-height: 230px; }
      .handover-patient { grid-template-columns: 1fr; gap: 6px; }
    }
  