/* Clinical workspace layout over /shared/base.css: sticky frosted topbar, touch-friendly controls,
   polished queue cards, and zero-clutter sign-in experience. */
#top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
#top .spacer { flex: 1; }
#top .who {
  font-size: 0.88em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
#top .brand { display: flex; flex-direction: column; min-width: 0; }
#top .brand-logo { display: block; flex: none; border-radius: 6px; }
#top .brand-notice { flex-basis: 100%; margin: 0; font-size: 0.82em; color: var(--muted); }

nav.roles { display: flex; gap: 4px; flex-wrap: wrap; }
nav.roles a {
  padding: 0.5em 0.95em;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}
nav.roles a:hover { background: var(--surface-2); }
nav.roles a[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

main.wrap { display: grid; gap: 18px; }
button, input, select { min-height: 42px; }
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; color: var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > input { flex: 1; min-width: 12em; }

.results { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.results .pick { width: 100%; text-align: left; justify-content: flex-start; }

.banner {
  border-left: 4px solid var(--accent);
}
.banner h2 { margin: 0 0 4px; font-size: 1.2rem; }
.banner p { margin: 0; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(11.5em, 1fr)); }
.grid input, .grid select { width: 100%; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
legend { font-weight: 600; padding: 0 6px; }
.radios { display: flex; gap: 14px; flex-wrap: wrap; }
.radios label { font-weight: 500; display: inline-flex; gap: 8px; align-items: center; min-height: 40px; margin: 0; cursor: pointer; }

.panel h3 { margin: 14px 0 6px; font-size: 0.98rem; }
.panel ul { margin: 0; padding-left: 1.2em; }

.vitals-today { display: flex; gap: 8px; flex-wrap: wrap; }
.vitals-today span {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 900px) {
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
}

/* Live patient queue list: clean interactive cards. */
.queue h2 { margin: 0 0 6px; font-size: 1.1rem; }
.queue-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.queue-row {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 12px 14px;
  min-width: 0;
  border-radius: var(--radius);
}
.queue-name { flex: 1 1 10em; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.queue-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.queue-meta { flex: 1 1 100%; font-size: 0.88em; overflow-wrap: anywhere; }

.chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8em;
  font-weight: 600;
  white-space: nowrap;
}
.chip.status-waiting { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); color: var(--warn); }
.chip.status-in_service { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--accent); }
.chip.status-finished { color: var(--muted); }
.chip.flag { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); color: var(--bad); }
.chip.current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.queue-list li.current .queue-row {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.queue-list li.new .queue-row { animation: queue-new 2.5s ease-out 2; }
@keyframes queue-new { from { background: var(--accent-soft); } to { background: var(--surface); } }
@media (prefers-reduced-motion: reduce) { .queue-list li.new .queue-row { animation: none; outline: 2px solid var(--accent); } }

.next-step { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
@media (prefers-reduced-motion: no-preference) { .next-step { animation: next-step 1.2s ease-out 2; } }
@keyframes next-step { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

.spinner {
  display: inline-block; width: 1em; height: 1em;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; vertical-align: -0.15em; margin-right: 0.4em;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.pw { display: flex; gap: 8px; }
.pw input { flex: 1; min-width: 0; }
.subtitle { margin: 0; font-size: 0.88em; }

/* Sign-in card polish */
.signin-wrap { max-width: 28rem; padding-top: 40px; }
#signin {
  padding: 28px;
  box-shadow: var(--shadow-md);
  border-top: 4px solid var(--accent);
}
#signin h1 { font-size: 1.4rem; margin-bottom: 8px; }
#eka-signin {
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.signin-logo { display: block; margin: 8px auto 14px; max-width: 100%; border-radius: 10px; }
.signin-notice {
  margin: 0 0 14px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  text-align: center; font-size: 0.88em; background: var(--surface-2);
}

.fold > summary { cursor: pointer; min-height: 42px; display: flex; align-items: center; gap: 8px; list-style: none; }
.fold > summary::before { content: '▸'; color: var(--muted); transition: transform 0.15s ease; }
.fold[open] > summary::before { content: '▾'; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { display: inline; margin: 0; font-size: 1.05rem; }
.fold[open] > summary { margin-bottom: 10px; }

.consult-start h2 { margin: 0 0 10px; font-size: 1.08rem; }
.consult-start p:empty { display: none; }
#scribe-panel:empty { display: none; }
#encounter, #history-body { min-width: 0; overflow-wrap: anywhere; }

nav.roles.switcher { display: flex; flex-wrap: wrap; gap: 4px; }
nav.roles.switcher a.todo { opacity: 0.6; border-style: dashed; }
nav.roles.switcher a.todo::after { content: ' +'; }
body.framed #top { display: none; }
body.framed main.wrap { padding-top: 8px; }
body.framed main.wrap > h1:first-child { display: none; }
.presenter-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; }
.presenter-box .inline { display: flex; gap: 8px; align-items: flex-start; }
.presenter-roles { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; }
.presenter-roles li.ok { color: var(--good); }
.small { font-size: 0.85em; }
.clean-box { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
#clean-ask { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#clean-ask[hidden] { display: none; }
