.study-complete-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  padding: 32px 18px;
  overflow: auto;
  background: rgba(24, 34, 45, 0.64);
}

.study-complete-card {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
}

.study-complete-card h2 {
  margin: 0;
  font-size: 30px;
}

.study-return-message {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #155f59;
}

.study-download-button {
  min-height: 64px;
  font-size: 22px;
  font-weight: 850;
}

.mini-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
}

.action-text {
  min-width: 0;
}

.action-item strong,
.action-item span {
  display: block;
}

.action-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.action-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.action-meta span {
  margin-top: 0;
  white-space: nowrap;
}

.action-text strong {
  font-size: 15px;
  line-height: 1.25;
}

.action-text span {
  max-width: 76ch;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.action-item .mini-actions {
  justify-content: flex-start;
}

.event-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.event-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
}

.event-item.active-event {
  border-color: rgba(66, 111, 152, 0.36);
  background: #f3f8fc;
}

.event-main {
  min-width: 0;
}

.event-item strong,
.event-item span {
  display: block;
}

.event-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.archive-warning {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(185, 74, 85, 0.28);
  border-radius: 8px;
  background: #fff3f4;
  color: #6e2c32;
}

.archive-warning strong {
  display: block;
  margin-bottom: 6px;
  color: #8b2e35;
}

.archive-warning p {
  margin: 0 0 10px;
  color: #6e2c32;
}

.care-confirmation {
  border-color: #bed3e8;
  background: #eef5fc;
  color: #234e71;
}

.care-confirmation strong,
.care-confirmation p {
  color: #234e71;
}

.checkline {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-weight: 800;
}

.checkline input {
  margin-top: 3px;
}

.daily-notes-editor {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.compact-head {
  margin-bottom: 10px;
}

.daily-note-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid rgba(198, 207, 214, 0.7);
}

.daily-note-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.daily-note-row .textarea {
  min-height: 72px;
}

.compact-empty {
  min-height: 0;
  padding: 10px;
  text-align: left;
}

.compact-details {
  border-top: 1px solid rgba(198, 207, 214, 0.72);
  padding-top: 10px;
}

.compact-details summary {
  cursor: pointer;
  color: #536678;
  font-weight: 850;
}

.event-list.nested {
  margin-top: 10px;
}

.registry-readiness {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 850;
}

.registry-readiness span {
  font-size: 20px;
  line-height: 1;
}

.registry-readiness small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.05;
  max-width: 70px;
  text-align: center;
}

.registry-readiness.ok {
  border-color: #5e8c61;
  background: #edf7ee;
}

.registry-readiness.warn {
  border-color: #c9963a;
  background: #fff7e6;
}

.registry-readiness.danger {
  border-color: #b94a55;
  background: #fff1f2;
}

.registry-score-large {
  width: 112px;
  height: 112px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 3px solid #5e8c61;
  background: #edf7ee;
  color: #2f6d46;
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 14px;
}

.registry-check {
  position: relative;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
}

.registry-check::before {
  position: absolute;
  left: 12px;
  top: 13px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.registry-check.complete {
  border-color: rgba(94, 140, 97, 0.3);
  background: #f1f8f2;
}

.registry-check.complete::before {
  content: "✓";
  background: #5e8c61;
  color: #fff;
}

.registry-check.outstanding {
  border-color: rgba(185, 74, 85, 0.35);
  background: #fff3f4;
}

.registry-check.outstanding::before {
  content: "!";
  background: #b94a55;
  color: #fff;
}

.registry-fix-button {
  margin-top: 8px;
  background: #b94a55;
  color: #fff;
}

.guide {
  display: grid;
  gap: 16px;
}

.guide-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid rgba(34, 119, 111, 0.22);
  border-radius: 8px;
  background: linear-gradient(145deg, #fffdf9 0%, var(--soft-teal) 100%);
}

.guide-hero h3,
.guide-roles h3 {
  margin: 0 0 6px;
  color: #2f4658;
}

.guide-hero p,
.guide-steps p {
  margin: 0;
  color: var(--muted);
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guide-steps article {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
}

.guide-steps strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.guide-roles {
  padding: 14px;
  border-radius: 8px;
  background: #f7f4ec;
  border: 1px solid var(--line);
}

.guide-roles div {
  display: grid;
  gap: 8px;
}

.guide-roles span {
  color: var(--muted);
}

.guide-roles strong {
  color: var(--ink);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef1eb;
  color: #3e5062;
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.badge.ok {
  background: var(--soft-ok);
  color: var(--ok);
}

.badge.warn {
  background: var(--soft-warn);
  color: var(--warn);
}

.badge.danger {
  background: var(--soft-danger);
  color: var(--danger);
}

.badge.neutral {
  background: #e8eef2;
  color: #3e5062;
}

.flag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chart {
  width: 100%;
  height: 270px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 18px 4px 2px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
}

.bar-wrap {
  flex: 1;
  min-width: 68px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  text-align: center;
}

.bar {
  width: 100%;
  min-height: 10px;
  border-radius: 8px 8px 3px 3px;
  background: var(--accent-2);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  font-weight: 760;
}

.bar.abnormal {
  background: var(--danger);
}

.bar-wrap:nth-child(2n) .bar:not(.abnormal) {
  background: var(--accent);
}

.bar-wrap:nth-child(3n) .bar:not(.abnormal) {
  background: var(--accent-5);
}

.bar-wrap:nth-child(4n) .bar:not(.abnormal) {
  background: var(--accent-3);
}

.bar-label {
  min-height: 34px;
  font-size: 12px;
  color: var(--muted);
}

.patient-top {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail {
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
  background: rgba(255, 253, 249, 0.68);
  border-radius: 7px;
  padding: 8px 9px;
}

.detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.detail strong {
  font-size: 14px;
}

