    :root {
      --bg: #f8fafc;
      --card: #ffffff;
      --border: #dbe3ee;
      --text: #0f172a;
      --muted: #64748b;
      --blue-bg: #eff6ff;
      --blue-border: #bfdbfe;
      --blue-text: #1e3a8a;
      --green-bg: #dcfce7;
      --green-text: #166534;
      --amber-bg: #fef3c7;
      --amber-text: #92400e;
      --danger-bg: #fee2e2;
      --danger-text: #991b1b;
      --btn: #0f172a;
      --btn-text: #fff;
      --btn-soft: #e2e8f0;
      --control-height: 42px;
      --radius: 12px;
    }
    * { box-sizing: border-box; }
    html { color-scheme: light; }
    body { margin: 0; font-family: Inter, system-ui, Arial, sans-serif; background: var(--bg); color: var(--text); }
    .wrap { max-width: 1440px; margin: 0 auto; padding: 22px 24px 28px; display: grid; gap: 16px; }
    .topbar { display: flex; justify-content: space-between; gap: 16px; align-items: end; flex-wrap: wrap; }
    h1 { margin: 0; font-size: 34px; line-height: 1.1; }
    h2 { margin: 0; font-size: 22px; }
    p { margin: 0; }
    .banner { padding: 14px 16px; border-radius: 16px; background: var(--blue-bg); border: 1px solid var(--blue-border); color: var(--blue-text); line-height: 1.6; }
    .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
    .card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 20px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); display: grid; gap: 14px; }
    .student-list-card, .student-list-card #studentsList { align-content: start; }
    .helper { color: var(--muted); line-height: 1.55; }
    .label { font-size: 14px; font-weight: 600; color: #334155; display: block; margin-bottom: 6px; }
    input, select, textarea {
      width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 11px 12px;
      font: inherit; color: inherit; background: #fff;
      transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
    }
    input, select { min-height: var(--control-height); }
    input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
    input:focus, select:focus, textarea:focus { outline: 0; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14); }
    input[type="number"] { max-width: 180px; }
    textarea { min-height: 320px; resize: vertical; line-height: 1.55; padding: 14px; border-radius: 14px; }
    .readonly { background: #f8fafc; }
    .buttons, .toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
    button {
      border: 0;
      border-radius: 14px;
      padding: 11px 14px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    }
    button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(15, 23, 42, 0.12); }
    button:not(:disabled):active { transform: translateY(0) scale(0.98); box-shadow: 0 2px 5px rgba(15, 23, 42, 0.1); }
    button:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }
    button:disabled { cursor: not-allowed; opacity: 0.62; transform: none; box-shadow: none; }
    .btn { background: var(--btn); color: var(--btn-text); }
    .btn-soft { background: var(--btn-soft); color: var(--text); }
    .btn-danger { background: var(--danger-bg); color: var(--danger-text); }
    .btn:not(:disabled):hover { background: #1e293b; }
    .btn-soft:not(:disabled):hover { background: #cbd5e1; }
    .btn-danger:not(:disabled):hover { background: #fecaca; }
    .row { display: grid; gap: 10px; }
    .row-2 { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
    .status { display: inline-block; border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700; width: fit-content; }
    .status::before { content: none; }
    .status.connected { background: var(--green-bg); color: var(--green-text); }
    .status.waiting { background: var(--amber-bg); color: var(--amber-text); }
    .mono { border: 1px dashed #cbd5e1; border-radius: 14px; padding: 14px; background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; line-height: 1.6; overflow-wrap: anywhere; }
    .empty { border: 1px dashed #cbd5e1; border-radius: 14px; padding: 18px; color: var(--muted); background: #f8fafc; }
    .notice { color: var(--muted); font-size: 14px; }
    .error { color: #b91c1c; white-space: pre-wrap; line-height: 1.5; }
    .toast { position: fixed; right: 18px; bottom: 18px; background: #0f172a; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18); opacity: 0; transform: translateY(10px); pointer-events: none; transition: 0.18s ease; }
    .toast.show { opacity: 1; transform: translateY(0); }
    .patient-table-wrap { position: relative; width: 100%; min-width: 0; max-width: 100%; border: 1px solid #e2e8f0; border-radius: 16px; overflow: visible; background: #fff; }
    .patient-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; border-radius: inherit; }
    table { width: 100%; border-collapse: collapse; min-width: 1120px; }
    th, td { border-bottom: 1px solid #e2e8f0; padding: 8px 10px; text-align: left; vertical-align: middle; }
    th { height: 40px; background: #f8fafc; font-size: 13px; color: #475569; }
    .patient-sticky-header {
      position: sticky;
      top: 0;
      z-index: 20;
      height: var(--patient-header-height, 38px);
      margin-bottom: calc(-1 * var(--patient-header-height, 38px));
      pointer-events: none;
    }
    .patient-sticky-header-viewport {
      width: 100%;
      height: 100%;
      overflow: hidden;
      border-radius: 15px 15px 0 0;
      box-shadow: 0 2px 5px rgba(15, 23, 42, 0.12);
      transition: border-radius 120ms ease, box-shadow 160ms ease;
    }
    .patient-sticky-header.is-stuck .patient-sticky-header-viewport {
      border-radius: 0;
      box-shadow: 0 5px 14px rgba(15, 23, 42, 0.14);
      border-bottom: 1px solid #cbd5e1;
    }
    .patient-sticky-header-table {
      table-layout: fixed;
    }
    tr:last-child td { border-bottom: 0; }
    .patient-label-cell { font-weight: 700; white-space: nowrap; color: var(--text); }
    .patient-initials-input {
      display: block;
      width: 48px;
      min-height: 28px;
      margin-top: 6px;
      padding: 3px 6px;
      border-radius: 7px;
      font-size: 13px;
      font-weight: 600;
      text-align: center;
      text-decoration: none;
    }
    .patient-initials-input::placeholder { color: #94a3b8; font-weight: 400; }
    .patient-clickable-row.ended-row .patient-initials-input { text-decoration: none; }
    .patient-clickable-row { cursor: pointer; }
    .patient-clickable-row td {
      background: #fff;
      transition: background-color 140ms ease, border-color 140ms ease;
    }
    .patient-clickable-row.patient-row-alt td { background: #fff; }
    .patient-clickable-row:not(.ended-row):not(.selected-row):hover td { background: #f8fafc; }
    .patient-clickable-row.selected-row td { background: #eff6ff; }
    .patient-clickable-row.selected-row:not(.ended-row):hover td { background: #dbeafe; }
    .patient-clickable-row.selected-row td:first-child { box-shadow: inset 3px 0 0 #2563eb; }
    .patient-clickable-row.ended-row td {
      background: #fff1f2;
      color: #9f1239;
      border-bottom-color: #fecdd3;
      text-decoration: line-through;
      text-decoration-color: #e11d48;
      text-decoration-thickness: 2px;
    }
    .patient-clickable-row.ended-row.patient-row-alt td { background: #fff1f2; }
    .patient-clickable-row.ended-row:hover td,
    .patient-clickable-row.ended-row.patient-row-alt:hover td { background: #ffdde3; }
    .patient-clickable-row.ended-row td:first-child { box-shadow: inset 4px 0 0 #e11d48; }
    .patient-clickable-row.ended-row .patient-label-cell { color: #9f1239; text-decoration: line-through #e11d48 2px; }
    .patient-clickable-row.ended-row select { background: #fff7f7; color: #881337; border-color: #fda4af; }
    .patient-clickable-row.ended-row .mini-btn-self { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
    .patient-clickable-row.ended-row .mini-btn-self.active { background: #fecdd3; color: #881337; border-color: #fda4af; }
    .patient-clickable-row.ended-row .btn-soft { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
    .patient-clickable-row.ended-row .mini-btn-danger {
      background: #be123c;
      color: #fff;
      border-color: #be123c;
      box-shadow: 0 3px 8px rgba(190, 18, 60, 0.2);
    }
    .patient-clickable-row.ended-row .mini-btn-danger:not(:disabled):hover { background: #9f1239; border-color: #9f1239; }
    .mini-btn { min-height: 36px; padding: 7px 10px; border-radius: 12px; font-size: 13px; }
    .mini-btn-danger { min-width: 36px; background: #fee2e2; color: #991b1b; }
    .mini-btn-danger:not(:disabled):hover { background: #fecaca; }
    @media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }
.topbar-center { align-items: center; }
    .buttons-end { justify-content: flex-end; }
    .footer-note { text-align: center; color: #64748b; font-size: 13px; padding-top: 4px; }
    .heart-red { color: #dc2626; }

.identity-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
  backdrop-filter: blur(6px);
}
.identity-overlay.show {
  display: flex;
}
@property --border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@property --ray-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.identity-card {
  --border-angle: 0deg;
  --ray-angle: 0deg;
  position: relative;
  width: 100%;
  max-width: 500px;
  border: 0;
  border-radius: 30px;
  padding: 4px;
  overflow: visible;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.3);
  animation: popupFloat 3.6s ease-in-out infinite;
  isolation: isolate;
}
.identity-card::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 34px;
  background: conic-gradient(
    from var(--border-angle),
    #60a5fa,
    #22c55e,
    #f59e0b,
    #ec4899,
    #60a5fa
  );
  animation: borderHueSpin 7s linear infinite;
  z-index: -2;
  filter: saturate(1.15) brightness(1.05);
}
.identity-card::after {
  content: "";
  position: absolute;
  inset: -88px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(250, 204, 21, 0.30) 0 30%, rgba(250, 204, 21, 0) 56%),
    repeating-conic-gradient(
      from var(--ray-angle),
      rgba(250, 204, 21, 0.00) 0deg 7deg,
      rgba(250, 204, 21, 0.40) 7deg 10deg,
      rgba(255, 244, 200, 0.92) 10deg 12.2deg,
      rgba(250, 204, 21, 0.34) 12.2deg 15deg,
      rgba(250, 204, 21, 0.00) 15deg 24deg
    );
  mask: radial-gradient(circle, transparent 0 25%, rgba(0, 0, 0, 0.95) 36%, rgba(0, 0, 0, 0) 68%);
  -webkit-mask: radial-gradient(circle, transparent 0 25%, rgba(0, 0, 0, 0.95) 36%, rgba(0, 0, 0, 0) 68%);
  animation: sunRayDrift 9s ease-in-out infinite;
  pointer-events: none;
  z-index: -3;
  filter: blur(8px) drop-shadow(0 0 26px rgba(250, 204, 21, 0.48));
  opacity: 1;
}
.identity-card-inner {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 26px;
  padding: 24px;
  display: grid;
  gap: 14px;
  backdrop-filter: blur(10px);
}
.identity-title {
  font-size: 24px;
  font-weight: 700;
}
.identity-sub {
  color: #64748b;
  line-height: 1.5;
}
@keyframes borderHueSpin {
  from { --border-angle: 0deg; }
  to { --border-angle: 360deg; }
}
@keyframes sunRayDrift {
  0% { --ray-angle: 0deg; transform: scale(0.97); opacity: 0.92; }
  50% { --ray-angle: 14deg; transform: scale(1.04); opacity: 1; }
  100% { --ray-angle: 0deg; transform: scale(0.97); opacity: 0.92; }
}
@keyframes popupFloat {
  0% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-4px) rotate(-0.8deg); }
  50% { transform: translateY(0) rotate(0.45deg); }
  80% { transform: translateY(4px) rotate(-0.45deg); }
  100% { transform: translateY(0) rotate(0deg); }
}
.mini-btn-self {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
  margin-left: 0;
}
.mini-btn-self:not(:disabled):hover {
  background: #bbf7d0;
  border-color: #86efac;
}
.mini-btn-self.active {
  background: #e2e6ec;
  color: #475569;
  border-color: #d4dae3;
}
.mini-btn-self.active:not(:disabled):hover {
  background: #cbd5e1;
}

.role-cell-stack {
  display: grid;
  grid-template-rows: auto auto;
  gap: 5px;
  justify-items: stretch;
}
.role-cell-stack .mini-btn-self {
  justify-self: center;
  width: 36px;
  min-width: 36px;
  min-height: 32px;
  padding: 5px;
}
.role-cell-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
}
.role-cell-actions .mini-btn-complete {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #64748b;
  text-decoration: none;
}
.mini-btn-complete:not(:disabled):hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}
.mini-btn-complete[aria-pressed="true"] {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}
.mini-btn-complete[aria-pressed="true"]:not(:disabled):hover {
  background: #166534;
  border-color: #166534;
  color: #fff;
}
.ended-row .mini-btn-complete[aria-pressed="true"] {
  background: #f4d6dc;
  border-color: #dfb4bf;
  color: #8f4b5c;
}
.ended-row .mini-btn-complete[aria-pressed="true"]:not(:disabled):hover {
  background: #edc5cf;
  border-color: #d49bab;
  color: #713849;
}
.mini-btn-complete[aria-busy="true"],
.mini-btn-danger[aria-busy="true"] {
  cursor: progress;
}
.role-cell-stack select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding-top: 8px;
  padding-bottom: 8px;
}





.btn-guide {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn-guide:hover {
  background: #b91c1c;
}
.btn-guide-blue {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.btn-guide-blue:hover {
  background: #1d4ed8;
}
.student-guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 120;
  backdrop-filter: blur(4px);
}
.student-guide-overlay.show {
  display: flex;
}
.student-guide-modal {
  width: min(1320px, 98vw);
  height: min(95vh, 1100px);
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  animation: guideOpen 180ms ease-out;
}
.student-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.student-guide-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}
.student-guide-subtitle {
  font-size: 13px;
  color: #64748b;
}
.student-guide-close {
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 12px;
  line-height: 1;
}
.student-guide-close:not(:disabled):hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.student-guide-scroll {
  overflow: auto;
  padding: 18px;
  background: #eef2f7;
}
.student-guide-status {
  color: #475569;
  padding: 12px 6px 18px;
}
.student-guide-pages {
  display: grid;
  gap: 18px;
}
.student-guide-page {
  width: fit-content;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.10);
  overflow: hidden;
}
.student-guide-page-label {
  font-size: 12px;
  color: #64748b;
  padding: 10px 12px 0;
}
.student-guide-page canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
@keyframes guideOpen {
  from { transform: scale(0.97); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.btn-guide-warm {
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
}
.btn-guide-warm:hover {
  background: #d97706;
}
.student-line-block {
  display: grid;
  gap: 6px;
}
.student-line-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.student-line-header .label {
  margin-bottom: 0;
}
.student-line-copy-btn {
  padding: 8px 12px;
}


.student-guide-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.student-guide-zoom-btn {
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 12px;
  line-height: 1;
  min-width: 42px;
}
.student-guide-zoom-btn:not(:disabled):hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.student-guide-zoom-readout {
  background: #eef2f7;
  color: #334155;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 8px 12px;
  line-height: 1;
  min-width: 68px;
}



.guide-password-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 121;
  backdrop-filter: blur(4px);
}
.guide-password-overlay.show {
  display: flex;
}
.guide-password-modal {
  width: min(420px, 92vw);
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  padding: 22px;
  display: grid;
  gap: 14px;
}
.guide-password-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}
.guide-password-subtitle {
  color: #64748b;
  line-height: 1.5;
}

.btn-guide-purple {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}
.btn-guide-purple:hover {
  background: #6d28d9;
}
.student-guide-download-btn {
  background: #0f172a;
  color: #fff;
  border: 1px solid #0f172a;
  border-radius: 12px;
  padding: 8px 12px;
  line-height: 1;
}
.student-guide-download-btn:hover {
  background: #1e293b;
}


.time-divider-row {
  --divider-line: #fb923c;
  --divider-soft: rgba(251, 146, 60, 0.05);
  --divider-soft-strong: rgba(251, 146, 60, 0.15);
  --divider-badge-bg: #fff7ed;
  --divider-text: #9a3412;
  --divider-border: #fdba74;
  --divider-shadow: rgba(251, 146, 60, 0.14);
}
.time-divider-morning {
  --divider-line: #10b981;
  --divider-soft: rgba(16, 185, 129, 0.05);
  --divider-soft-strong: rgba(16, 185, 129, 0.14);
  --divider-badge-bg: #ecfdf5;
  --divider-text: #065f46;
  --divider-border: #6ee7b7;
  --divider-shadow: rgba(16, 185, 129, 0.14);
}
.time-divider-afternoon {
  --divider-line: #3b82f6;
  --divider-soft: rgba(59, 130, 246, 0.05);
  --divider-soft-strong: rgba(59, 130, 246, 0.14);
  --divider-badge-bg: #eff6ff;
  --divider-text: #1e40af;
  --divider-border: #93c5fd;
  --divider-shadow: rgba(59, 130, 246, 0.14);
}
.time-divider-row td {
  padding: 6px 0;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  background: #fff;
}
.time-divider-wrap {
  padding: 8px 0;
  border-top: 1px solid var(--divider-border);
  border-bottom: 1px solid var(--divider-border);
  background: linear-gradient(to right, var(--divider-soft), var(--divider-soft-strong), var(--divider-soft));
  transition: opacity 150ms ease, transform 180ms ease, filter 180ms ease;
}
.time-divider-line {
  position: relative;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.time-divider-line::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  border-top: 2px dashed var(--divider-line);
  transform: translateY(-50%);
}
.time-divider-badge {
  position: relative;
  z-index: 1;
  background: var(--divider-badge-bg);
  color: var(--divider-text);
  border: 1px solid var(--divider-border);
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--divider-shadow);
}

.patient-drop-target-before td {
  box-shadow: inset 0 3px 0 var(--divider-drop-color, #fb923c);
}
.patient-drop-target-after td {
  box-shadow: inset 0 -3px 0 var(--divider-drop-color, #fb923c);
}
.time-divider-badge {
  cursor: grab;
  user-select: none;
}
.time-divider-badge.dragging {
  cursor: grabbing;
}
.time-divider-row.dragging-source .time-divider-wrap {
  opacity: 0.34;
  transform: scale(0.985);
  filter: saturate(0.65);
}
.time-divider-drag-preview {
  position: fixed;
  left: 0;
  top: 0;
  height: 54px;
  padding: 5px;
  border: 1px solid var(--divider-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    0 26px 60px rgba(15, 23, 42, 0.22),
    0 8px 20px var(--divider-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(255, 255, 255, 0.28);
  overflow: hidden;
  pointer-events: none;
  transform:
    translate3d(
      calc(var(--drag-x, 0px) - 50%),
      calc(var(--drag-y, 0px) - 50%),
      0
    )
    scale(0.955)
    rotate(var(--drag-tilt, 0deg));
  transform-origin: center;
  backdrop-filter: blur(18px) saturate(1.45);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  will-change: transform;
  transition: opacity 140ms ease, filter 140ms ease;
  z-index: 10000;
}
.time-divider-drag-preview::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 16px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.08) 38%, rgba(255, 255, 255, 0.2) 68%, rgba(255, 255, 255, 0.54));
  pointer-events: none;
}
.time-divider-drag-preview.releasing {
  opacity: 0;
  filter: blur(2px);
}
.time-divider-drag-preview-line {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(to right, var(--divider-soft), var(--divider-soft-strong), var(--divider-soft));
}
.time-divider-drag-preview-line::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  border-top: 2px dashed var(--divider-line);
  transform: translateY(-50%);
}
.time-divider-drag-preview-badge {
  position: relative;
  z-index: 1;
  padding: 5px 14px;
  border: 1px solid var(--divider-border);
  border-radius: 999px;
  background: var(--divider-badge-bg);
  color: var(--divider-text);
  font-weight: 700;
  box-shadow: 0 4px 12px var(--divider-shadow);
}
.time-divider-landing-overlay {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  animation: dividerLand 280ms cubic-bezier(0.2, 1.2, 0.35, 1) both;
}
.time-divider-landing-overlay .time-divider-wrap {
  width: 100%;
  height: 100%;
}
.time-divider-landing-overlay .time-divider-badge {
  animation: dividerBadgeLand 280ms cubic-bezier(0.2, 1.25, 0.35, 1) both;
}
@keyframes dividerLand {
  0% { transform: translateY(-4px) scaleY(0.975); opacity: 0.7; }
  58% { transform: translateY(1px) scaleY(1.006); opacity: 1; }
  100% { transform: translateY(0) scaleY(1); opacity: 1; }
}
@keyframes dividerBadgeLand {
  0% { transform: scale(0.9); box-shadow: 0 2px 5px var(--divider-shadow); }
  60% { transform: scale(1.035); box-shadow: 0 5px 14px var(--divider-shadow); }
  100% { transform: scale(1); box-shadow: 0 2px 10px var(--divider-shadow); }
}


.update-popup {
  position: fixed;
  top: 18px;
  right: 18px;
  width: min(360px, calc(100vw - 36px));
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  padding: 16px;
  z-index: 140;
  display: none;
}
.update-popup.show {
  display: block;
}
.update-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.update-popup-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.update-popup-date {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.update-popup-close {
  background: #fff;
  color: #64748b;
  border: 1px solid #cbd5e1;
  width: auto;
  min-height: 0;
  border-radius: 10px;
  padding: 6px 10px;
  line-height: 1;
  flex: 0 0 auto;
}
.update-popup-close:not(:disabled):hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}
.update-popup-body {
  margin-top: 10px;
  color: #334155;
  display: grid;
  gap: 8px;
}
.update-popup-line {
  line-height: 1.5;
}
.update-popup-contact {
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.update-popup-contact a {
  color: #2563eb;
  font-weight: 700;
}
.update-popup-contact a:hover {
  color: #1d4ed8;
}
.update-popup-signature {
  color: #64748b;
  font-size: 14px;
}
.update-popup-checkbox {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 16px auto;
  align-items: center;
  justify-content: start;
  justify-items: start;
  column-gap: 10px;
  width: max-content;
  max-width: 100%;
}
.update-popup-checkbox input {
  margin: 0;
  width: 16px;
  height: 16px;
}
.update-popup-checkbox span {
  display: block;
  line-height: 1.2;
  white-space: nowrap;
}

.topbar > .buttons button { min-height: 0; padding: 11px 14px; }
.toolbar { padding: 2px 0; }
.toolbar label { min-width: 180px; }
.toolbar .btn-danger { margin-left: 2px; }
.patient-row-actions { white-space: nowrap; }
.patient-row-actions .mini-btn + .mini-btn { margin-left: 6px; }
.student-editor-row { padding: 10px 0; border-bottom: 1px solid #e1e7ef; }
.student-editor-row:last-child { border-bottom: 0; padding-bottom: 0; }
.student-list-card .buttons { margin-top: -2px; }

.patient-table-scroll {
  scrollbar-color: #aeb9c7 #edf1f5;
  scrollbar-width: thin;
}
.patient-table-scroll::-webkit-scrollbar { height: 10px; }
.patient-table-scroll::-webkit-scrollbar-track { background: #edf1f5; border-radius: 0 0 7px 7px; }
.patient-table-scroll::-webkit-scrollbar-thumb { background: #aeb9c7; border: 2px solid #edf1f5; border-radius: 999px; }
.patient-table-scroll::-webkit-scrollbar-thumb:hover { background: #8794a5; }

@media (max-width: 720px) {
  .wrap { padding: 14px 12px 20px; gap: 12px; }
  h1 { font-size: 26px; }
  .card { padding: 14px; }
  .topbar > .buttons { width: 100%; }
  .topbar > .buttons button { flex: 1 1 auto; }
  .toolbar { align-items: stretch; }
  .toolbar label { width: 100%; }
  input[type="number"] { max-width: none; }
  .toolbar button { flex: 1 1 180px; }
  .update-popup { top: 10px; right: 10px; width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none;
    animation: none;
  }
}
