marmar-context / web / context / src / app.css
app.css
Raw
/* Context's calm clinical style (moodboard, 31 Oct 2026): white pages on a
 * zinc frame, grey doing the work, one solid green action, tinted state pills
 * and DM Mono for codes and keys. The new screens use the same values as
 * Tailwind tokens in theme.css; keep the two lists in step. */
@font-face {
  font-family: "Inter Variable";
  src: url("/assets/inter-variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/assets/dm-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/assets/dm-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #f4f4f5;
  --surface: #fff;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --cell: #52525b;
  --muted: #71717a;
  --subtle: #a1a1aa;
  --line: #e4e4e7;
  --line-soft: #f0f0f1;
  --line-input: #e4e4e7;
  --line-hover: #d4d4d8;
  --fill: #f4f4f5;
  --fill-2: #f7f7f8;
  --brand: #2cc295;
  --brand-soft: #e7f7ee;
  --brand-line: #bfe9d2;
  --brand-strong: #0c7c5c;
  --primary: #0c7c5c;
  --success: #17a35d;
  --warning: #f59e0b;
  --amber: #a8590a;
  --amber-soft: #fef4e2;
  --amber-line: #f7dca8;
  --red: #c42b1c;
  --red-dot: #e5383b;
  --red-soft: #fdecec;
  --red-line: #f8c9c5;
  --gradient-ink: #0c7c5c;
  --shadow-ink: none;
  --shadow-float: 0 10px 24px -14px rgba(24, 24, 27, 0.22);
  --shadow-lift: 0 0 0 1px #efeff1;
  --shadow-pop: 0 0 0 1px #ececee, 0 18px 40px -12px rgba(24, 24, 27, 0.22);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --hatch: none;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar: 256px;
  font-family: "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
* {
  box-sizing: border-box;
}
*,
::before,
::after {
  border-color: var(--line);
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 500;
}
strong {
  font-weight: 550;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
select,
input,
summary {
  touch-action: manipulation;
}
button,
summary {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
a {
  color: var(--brand-strong);
}
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.4);
}
::selection {
  background: rgba(31, 41, 55, 0.12);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* Buttons: flat grey by default, one solid green primary, 34px, 8px radius. */
.button {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--fill);
  color: #27272a;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), box-shadow 0.18s var(--ease), color 0.18s, transform 0.1s ease-out;
}
.button:hover:not(:disabled) {
  background: #e9e9eb;
  color: var(--ink);
}
.button:active:not(:disabled) {
  transform: translateY(1px);
}
.button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand);
}
.button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.button.primary {
  background: var(--primary);
  color: #fff;
}
.button.primary:hover:not(:disabled) {
  background: #0a6a4f;
  color: #fff;
}
.button.large {
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
}
.button.dashed {
  width: 100%;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-2);
}
.link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}
.link:hover:not(:disabled) {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link.quiet {
  color: var(--muted);
}
.link:disabled {
  opacity: 0.45;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
}
.icon-button:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
}

/* Fields */
select,
input:not([type="checkbox"]):not([type="file"]),
textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 0.8px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  line-height: 20px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:hover,
input:not([type="checkbox"]):not([type="file"]):hover,
textarea:hover {
  border-color: var(--line-hover);
}
select:focus-visible,
input:not([type="checkbox"]):not([type="file"]):focus-visible,
textarea:focus-visible {
  border-color: var(--subtle);
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.2);
}
select {
  appearance: none;
  padding-right: 30px;
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath d='M216 96l-88 88-88-88' fill='none' stroke='%236b7280' stroke-width='24' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 10px center / 12px;
}
select:disabled,
input:disabled,
textarea:disabled {
  background-color: #f7f7f7;
  color: var(--muted);
  cursor: not-allowed;
}
textarea {
  resize: vertical;
}
::placeholder {
  color: var(--muted);
}
input[type="checkbox"] {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  appearance: none;
  border: 0.8px solid var(--line-hover);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
input[type="checkbox"]:hover {
  border-color: var(--subtle);
}
input[type="checkbox"]:checked {
  border-color: var(--primary);
  background: var(--gradient-ink);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M72 132l36 36 76-80' fill='none' stroke='white' stroke-width='28' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}
input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Badges: a small white chip with a coloured dot. */
.badge,
.tag,
.tier,
.status {
  --dot: var(--subtle);
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  width: fit-content;
  height: 24px;
  padding: 0 8px;
  border: 0.8px solid var(--line-input);
  border-radius: 6px;
  background: var(--surface);
  color: var(--cell);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.badge::before,
.tag::before,
.tier::before,
.status::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
}
.tag.new,
.status.green {
  --dot: var(--success);
}
.tier,
.status.amber {
  --dot: var(--warning);
}
.tier.today,
.tier.get_help_now,
.status.red {
  --dot: var(--red-dot);
}
.tier.good_to_know {
  --dot: var(--subtle);
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--fill-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.icon-chip {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 0.8px solid var(--brand-line);
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

/* Frames: a muted, hatched frame with a title row around a white panel. */
.frame {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 4px;
  border-radius: 12px;
  background: var(--fill) var(--hatch);
  box-shadow: inset 0 0 0 0.8px var(--line);
  animation: rise 0.6s var(--ease) both;
}
.frame-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 8px;
  color: var(--ink-2);
}
.frame-head > svg {
  flex: none;
}
.frame-head h2,
.frame-head h3 {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.frame-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.frame-body {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px 14px 14px;
  border: 0.8px solid var(--line-input);
  border-radius: 12px;
  background: var(--surface);
}
.frame-body.flush {
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.card {
  border: 0.8px solid var(--line-input);
  border-radius: 12px;
  background: var(--surface);
}

/* App shell: sidebar, sticky header, white workspace. */
.shell {
  display: flex;
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex: none;
  flex-direction: column;
  width: var(--sidebar);
  height: 100dvh;
  background: var(--bg);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  padding: 14px 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand img {
  display: block;
  width: 24px;
  height: 24px;
  transition: transform 0.3s var(--ease);
}
.brand:hover img {
  transform: scale(1.05) rotate(-8deg);
}
.sidebar-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 16px 12px 12px;
}
.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group > p {
  margin-bottom: 6px;
  padding: 0 4px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.6;
  text-transform: uppercase;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0.8px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1;
  text-align: left;
  transition: color 0.15s, background-color 0.15s;
}
.nav-item:hover {
  background: rgba(0, 0, 0, 0.035);
  color: var(--ink);
}
.nav-item svg {
  flex: none;
  transition: transform 0.2s, color 0.2s;
}
.nav-item:hover svg {
  transform: scale(1.1);
}
.nav-item > span:first-of-type {
  flex: 1;
}
.nav-item[aria-current="page"] {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 7px 0 rgba(0, 0, 0, 0.04);
}
.nav-item[aria-current="page"] svg {
  color: var(--brand-strong);
}
.nav-count {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.nav-item[aria-current="page"] .nav-count {
  background: var(--gradient-ink);
  color: #fff;
}
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0.8px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.sidebar-foot > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.sidebar-foot strong {
  font-size: 13px;
  font-weight: 500;
}
.sidebar-foot small {
  color: var(--muted);
  font-size: 12px;
}
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.32);
}
.sidebar.open {
  position: absolute;
  inset: 0 auto 0 0;
  width: min(300px, 86vw);
  height: 100%;
  box-shadow: var(--shadow-pop);
  animation: slide-in 0.3s var(--ease) both;
}
@keyframes slide-in {
  from {
    transform: translateX(-24px);
    opacity: 0;
  }
}
.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
  background: var(--surface);
  box-shadow: inset 0 0 0 0.8px var(--line);
}
.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: inset 0.8px 0 0 var(--line), inset -0.8px 0 0 var(--line);
}
.appbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: rgba(156, 163, 175, 0.4);
}
.menu-toggle {
  display: none;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}
.crumbs > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 0.8px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--brand-strong);
  box-shadow: var(--shadow-float);
}
.crumb-parent {
  flex: none;
  color: var(--muted);
}
.appbar-end {
  display: flex;
  align-items: center;
  gap: 12px;
}
.save-pill,
.env-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}
.save-pill.busy .dot {
  background: var(--warning);
}
.save-pill.bad {
  color: var(--red);
  font-weight: 500;
}
.save-pill.bad .dot {
  background: var(--red-dot);
}
.env-chip {
  height: 26px;
  padding: 0 8px;
  border: 0.8px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 500;
}
.env-chip .dot {
  background: var(--warning);
}
.env-chip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.env-chip small::before {
  content: "· ";
}

/* Page */
.page {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  padding: 20px 24px 0;
}
.page-head,
.patient {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  animation: rise 0.6s var(--ease) both;
}
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 24px;
}
.page-head h1,
.patient-meta h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.page-head p,
.patient-meta p {
  grid-column: 1;
  max-width: 720px;
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 13px;
}
.page-head .button {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.patient-meta {
  flex: 1;
  min-width: 0;
}
.patient-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.patient-actions select {
  width: 280px;
  min-height: 32px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.lead {
  max-width: 760px;
  color: var(--ink-2);
  font-size: 13px;
}
.footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 24px;
  border-top: 0.8px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.hint {
  color: var(--muted);
  font-size: 12px;
}

/* Banners */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 0.8px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
}
.banner > svg {
  flex: none;
  margin-top: 1px;
}
.banner > div:not(.banner-actions) {
  flex: 1;
}
.banner strong {
  font-weight: 500;
}
.banner p {
  color: var(--ink-2);
  font-size: 13px;
}
.banner.warn {
  border-color: var(--amber-line);
  background: var(--amber-soft);
  color: #92400e;
}
.banner.warn > svg {
  color: var(--amber);
}
.banner.error {
  border-color: var(--red-line);
  background: var(--red-soft);
}
.banner.error > svg {
  color: var(--red);
}
.banner.quiet {
  align-items: center;
  border-color: var(--brand-line);
  background: var(--brand-soft);
}
.banner.quiet > svg {
  color: var(--brand-strong);
}
.banner.quiet p {
  flex: 1;
}
.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* More menu */
.menu {
  position: relative;
}
.menu summary {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0.8px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  list-style: none;
}
.menu summary:hover,
.menu[open] summary {
  border-color: var(--line-hover);
  color: var(--ink);
}
.menu summary::-webkit-details-marker {
  display: none;
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 35;
  width: 272px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  animation: rise 0.25s var(--ease) both;
}
.menu-panel > button,
.menu-panel > label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.menu-panel > button:hover:not(:disabled),
.menu-panel > label:hover {
  background: var(--fill-2);
  color: var(--ink);
}
.menu-panel > button:disabled,
.menu-panel > label.disabled {
  opacity: 0.45;
}
.menu-panel input[type="file"] {
  display: none;
}
.menu-panel p {
  margin: 4px 6px 4px;
  padding: 8px 4px 2px;
  border-top: 0.8px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* Steps: the section tabs from the dashboard. */
.stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 4px;
  border-radius: 12px;
  background: var(--fill) var(--hatch);
  box-shadow: inset 0 0 0 0.8px var(--line);
  list-style: none;
}
.stepper button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 0.8px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
}
.stepper button:hover:not(:disabled) {
  color: var(--ink);
}
.stepper button.current {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 7px 0 rgba(0, 0, 0, 0.04);
}
.stepper button:disabled {
  opacity: 0.55;
}
.step-num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border: 0.8px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.stepper .current .step-num {
  border-color: var(--primary);
  background: var(--gradient-ink);
  color: #fff;
  box-shadow: var(--shadow-ink);
}
.stepper .done .step-num {
  border-color: var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.step-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  line-height: 1.1;
}
.step-text strong {
  font-size: 13px;
  font-weight: 500;
}
.step-text small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Working state */
.working {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px 8px 8px;
  border: 0.8px solid var(--brand-line);
  border-radius: 12px;
  background: var(--brand-soft);
  font-size: 13px;
}
.working img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  animation: bob 1.6s ease-in-out infinite;
}
.working div {
  flex: 1;
}
.working strong {
  font-weight: 500;
}
.working p {
  color: var(--ink-2);
  font-size: 12px;
}
@keyframes bob {
  50% {
    transform: translateY(-3px);
  }
}

/* Records step */
.records {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.record-list {
  gap: 6px;
  padding: 6px;
}
.record {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 0.8px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  transition: background-color 0.15s;
}
.record:hover:not(:disabled) {
  background: var(--fill-2);
}
.record svg {
  flex: none;
  margin-top: 1px;
  color: var(--subtle);
}
.record span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.record strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record small {
  color: var(--muted);
  font-size: 12px;
}
.record[aria-current="true"] {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.record[aria-current="true"] svg {
  color: var(--brand-strong);
}
.record-list .button.dashed {
  margin-top: 4px;
}
.record-list .hint {
  padding: 2px 4px 4px;
}

/* Document */
.doc {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.doc-tabs {
  display: flex;
  gap: 20px;
  padding: 0 16px;
  overflow-x: auto;
  border-bottom: 0.8px solid var(--line);
  scrollbar-width: none;
}
.doc-tabs button {
  position: relative;
  flex: none;
  max-width: 220px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-tabs button:hover {
  color: var(--ink);
}
.doc-tabs button[aria-selected="true"] {
  color: var(--ink);
  font-weight: 500;
}
.doc-tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-ink);
}
.doc-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 10px;
}
.doc-head h3 {
  margin-top: 4px;
  font-size: 16px;
}
.doc-date {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.doc-lines {
  margin: 0;
  padding: 2px 0 12px;
  list-style: none;
  font-size: 13px;
  line-height: 1.6;
}
.doc-lines li {
  display: grid;
  grid-template-columns: 40px 1fr;
  padding: 2px 16px 2px 0;
  border-left: 2px solid transparent;
}
.doc-lines .ln {
  padding-right: 12px;
  color: var(--subtle);
  font-size: 11px;
  line-height: 20.8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.doc-lines .lt {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.doc-lines li.highlight {
  border-left-color: var(--warning);
  background: var(--amber-soft);
}
.doc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 0.8px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}
.doc-foot > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.doc-foot-actions {
  display: flex;
  gap: 16px;
}
.clarification-box {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border: 0.8px solid var(--brand-line);
  border-radius: 8px;
  background: var(--brand-soft);
  font-size: 13px;
}
.clarification-box strong {
  font-weight: 500;
}
.clarification-box p {
  color: var(--ink-2);
}
blockquote {
  margin: 8px 0;
  padding: 6px 10px;
  border-left: 2px solid var(--line-hover);
  border-radius: 0 6px 6px 0;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 16px;
}
.editor label {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}
.editor textarea {
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.row-end {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

/* Review step */
.review {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}
.review-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.review-source {
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 160px);
  overflow: auto;
}
.review-source > .frame-head {
  position: sticky;
  top: -4px;
  z-index: 1;
  margin: -4px -4px 0;
  padding: 10px 12px 6px;
  background: var(--fill) var(--hatch);
  border-radius: 12px 12px 0 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.section-head h2 {
  font-size: 18px;
  letter-spacing: -0.01em;
}
.section-head p {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 13px;
}
.callout {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.callout > svg {
  flex: none;
  margin-top: 1px;
}
.callout strong {
  font-weight: 500;
}
.callout.warn {
  border: 0.8px solid var(--amber-line);
  background: var(--amber-soft);
}
.callout.warn > svg {
  color: var(--amber);
}
.callout p {
  color: var(--ink-2);
}
.attention {
  padding: 12px 14px;
  border: 0.8px solid var(--amber-line);
  border-radius: 12px;
  background: var(--amber-soft);
}
.attention h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--amber);
  font-size: 14px;
}
.attention > p {
  margin: 4px 0 6px;
  font-size: 12px;
}
.attention-item {
  padding: 10px 0 4px;
  border-top: 0.8px solid var(--amber-line);
  font-size: 13px;
}
.attention-item:first-of-type {
  border-top: 0;
}
.attention-item blockquote {
  margin-top: 0;
  border-left-color: var(--warning);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filters button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 6px 0 12px;
  border: 0.8px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s;
}
.filters button:hover {
  border-color: var(--line-hover);
  color: var(--ink);
}
.filters button span {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--fill-2);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.filters button[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--gradient-ink);
  color: #fff;
  box-shadow: var(--shadow-ink);
}
.filters button[aria-pressed="true"] span {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.fact {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-top: 0.8px solid var(--line-soft);
  transition: background-color 0.15s;
}
.fact:first-child {
  border-top: 0;
}
.fact.exclude .fact-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--line-hover);
}
.fact.exclude .fact-icon {
  opacity: 0.55;
}
.fact.conflict,
.fact.problem {
  background: var(--amber-soft);
}
.fact-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 0.8px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
}
.fact-icon.medicine {
  border-color: var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.fact-icon.allergy {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: var(--red);
}
.fact-icon.condition {
  border-color: var(--amber-line);
  background: var(--amber-soft);
  color: var(--amber);
}
.fact-body {
  flex: 1;
  min-width: 0;
}
.fact-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.fact-title strong {
  font-size: 14px;
  font-weight: 500;
}
.fact-title span {
  color: var(--ink-2);
  font-size: 13px;
}
.fact-problem {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  color: var(--amber);
  font-size: 12px;
}
.fact-problem svg {
  flex: none;
  margin-top: 2px;
}
.fact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 4px;
}
.decision {
  display: flex;
  flex: none;
  gap: 4px;
}
.decision button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border: 0.8px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.decision button:hover:not(:disabled) {
  border-color: var(--line-hover);
  color: var(--ink);
}
.decision button:active:not(:disabled) {
  transform: scale(0.97);
}
.decision button:disabled {
  opacity: 0.45;
}
.decision button[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--gradient-ink);
  color: #fff;
  box-shadow: var(--shadow-ink);
}
.decision button[aria-pressed="true"]:last-child {
  border-color: #374151;
  background: linear-gradient(180deg, #6b7280 0%, #374151 70%);
  box-shadow: none;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  color: var(--ink-2);
  font-size: 13px;
  text-align: center;
}
.empty svg {
  color: var(--brand-strong);
}
.empty strong {
  font-weight: 500;
}
.notes-check ul {
  margin: -6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}
.notes-check li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  padding: 8px 0;
  border-top: 0.8px solid var(--line-soft);
}
.notes-check li > span {
  flex: 1 1 260px;
  color: var(--ink-2);
}
.notes-check li .link.quiet {
  flex: none;
  width: 170px;
}
.notes-check .frame-body > p {
  font-size: 12px;
}
.ack,
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
}
.ack {
  padding: 10px 12px;
  border: 0.8px solid var(--brand-line);
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--ink);
}
.drawer {
  border: 0.8px solid var(--line-input);
  border-radius: 12px;
  background: var(--surface);
}
.drawer summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  list-style: none;
}
.drawer summary:hover {
  color: var(--ink);
}
.drawer summary::-webkit-details-marker {
  display: none;
}
.drawer summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.2s;
}
.drawer[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}
.drawer > :not(summary) {
  margin-right: 14px;
  margin-left: 14px;
}
.drawer > :last-child {
  margin-bottom: 14px;
}
.drawer > p {
  font-size: 13px;
}
.drawer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px 0;
  border-top: 0.8px solid var(--line-soft);
  font-size: 13px;
}

/* Findings step */
.results {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
}
.answer {
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
}
.answer img {
  flex: none;
  width: 96px;
  height: 96px;
  object-fit: contain;
}
.answer-body {
  flex: 1;
  min-width: 0;
}
.answer h2 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.answer p {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 13px;
}
.compare {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--subtle);
}
.compare div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 150px;
  padding: 10px 12px 12px;
  border: 0.8px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.compare small {
  color: var(--muted);
  font-size: 12px;
}
.compare strong {
  color: var(--ink);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.compare .with-context {
  border-color: var(--brand-line);
  background: var(--brand-soft);
}
.compare .with-context strong {
  color: var(--primary);
}
/* Personal factors: what this check knew about the patient. */
.profile {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
  padding: 6px;
}
.profile-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 0.8px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.profile-item:hover:not(:disabled) {
  border-color: var(--line-hover);
  box-shadow: var(--shadow-float);
}
.profile-item:disabled {
  cursor: default;
}
.profile-label {
  color: var(--muted);
  font-size: 12px;
}
.profile-item strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-item small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.profile-item.used .dot {
  background: var(--success);
}
.profile-item.not_assessed .dot {
  background: var(--warning);
}
.profile-item.missing {
  border-style: dashed;
  background: transparent;
}
.profile-item.missing strong {
  color: var(--muted);
}
.profile-item.missing .dot {
  background: var(--subtle);
}

/* Medicine by medicine, and monitoring. */
.plan-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-top: 0.8px solid var(--line-soft);
}
.plan-row:first-child {
  border-top: 0;
}
.plan-body {
  flex: 1;
  min-width: 0;
}
.plan-body p {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 13px;
}
.plan-body .plan-findings {
  color: var(--amber);
  font-weight: 500;
}
.plan-status {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.findings {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.finding {
  padding: 14px 16px;
  border: 0.8px solid var(--line-input);
  border-radius: 10px;
  background: var(--surface);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.finding:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}
.finding-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.finding h3 {
  font-size: 16px;
  letter-spacing: -0.01em;
}
.finding-why {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 13px;
}
.finding-todo {
  margin-top: 12px;
  padding: 10px 12px;
  border: 0.8px solid var(--line-soft);
  border-radius: 8px;
  background: #f9fafb;
  font-size: 13px;
}
.finding-todo strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}
.finding-evidence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.finding-evidence small {
  margin-right: 2px;
  color: var(--muted);
  font-size: 12px;
}
.evidence-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 0.8px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.evidence-chip span {
  color: var(--muted);
  font-weight: 400;
}
.evidence-chip:hover {
  border-color: var(--line-hover);
  box-shadow: var(--shadow-float);
}
.finding-more {
  margin-top: 12px;
  font-size: 13px;
}
.finding-more summary {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 500;
}
.finding-more > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0.8px solid var(--line-soft);
  color: var(--ink-2);
}
.finding-more a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gap {
  padding: 10px 0;
  border-top: 0.8px solid var(--line-soft);
  font-size: 13px;
}
.gap strong {
  font-weight: 500;
}
.gap p {
  color: var(--ink-2);
}
.trace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 0;
}
.trace div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 0.8px solid var(--line-soft);
  font-size: 13px;
}
.trace dt {
  color: var(--muted);
}
.trace dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

/* Action bar: sticky at the bottom of the workspace. */
.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: auto -24px 0;
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  border-top: 0.8px solid var(--line);
  background: var(--surface);
}
/* Netlify Free injects a "Powered by Netlify" badge (202 by 64px) in the
 * bottom-right corner of the hosted preview; keep the main action clear of it. */
body:has(#nl-badge-frame) .actionbar {
  padding-right: 220px;
}
body:has(#nl-badge-frame) .toast {
  bottom: 96px;
}
.actionbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.actionbar-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-width: 0;
}
.actionbar-info > label:not(.check) {
  color: var(--muted);
  font-size: 12px;
}
.actionbar-info select {
  width: auto;
  min-height: 32px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 12px;
  font-weight: 500;
}
.actionbar progress {
  width: 120px;
  height: 6px;
  appearance: none;
  border: 0;
  border-radius: 99px;
  background: var(--fill-2);
  overflow: hidden;
}
.actionbar progress::-webkit-progress-bar {
  background: var(--fill-2);
}
.actionbar progress::-webkit-progress-value {
  background: var(--gradient-ink);
}
.actionbar progress::-moz-progress-bar {
  background: var(--gradient-ink);
}
.actionbar .hint {
  font-size: 13px;
}
.actionbar .hint.blocked {
  color: var(--amber);
  font-weight: 500;
}
.actionbar .hint.ready {
  color: var(--brand-strong);
  font-weight: 500;
}

/* Patients, how it works, tests */
.case {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-top: 0.8px solid var(--line-soft);
  transition: background-color 0.15s;
}
.case:first-child {
  border-top: 0;
}
.case:hover {
  background: #fcfcfc;
}
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 0.8px solid var(--line);
  border-radius: 50%;
  background: var(--fill-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
}
.case-body {
  flex: 1;
  min-width: 0;
}
.case-body h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.case-body p {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 13px;
}
.case-body small {
  color: var(--muted);
  font-size: 12px;
}
.how {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.how .frame-head h2 {
  color: var(--muted);
  font-size: 13px;
}
.how h3 {
  font-size: 15px;
}
.how p {
  color: var(--ink-2);
  font-size: 13px;
}
.how .frame-body {
  gap: 6px;
}
.scope {
  margin-bottom: 24px;
}
.scope .frame-body {
  gap: 0;
  padding-top: 4px;
  padding-bottom: 4px;
}
.scope-row {
  display: grid;
  grid-template-columns: 180px 160px 1fr;
  align-items: start;
  gap: 4px 16px;
  padding: 12px 0;
  border-top: 0.8px solid var(--line-soft);
  font-size: 13px;
}
.scope-row:first-child {
  border-top: 0;
}
.scope-row strong {
  font-weight: 500;
}
.scope-row p {
  color: var(--ink-2);
}
.tests {
  margin-bottom: 24px;
}
.test-row {
  display: grid;
  grid-template-columns: 20px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 0.8px solid var(--line-soft);
  font-size: 13px;
}
.test-row:first-child {
  border-top: 0;
}
.test-row small {
  color: var(--muted);
  font-size: 12px;
}
.test-row .pass {
  color: var(--success);
}
.test-row .fail {
  color: var(--red-dot);
}
.page > .empty.card {
  border-style: dashed;
}

/* Dialogs */
.dialog {
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}
.dialog[open] {
  animation: rise 0.35s var(--ease) both;
}
.dialog::backdrop {
  background: rgba(15, 23, 42, 0.32);
}
.dialog form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 20px;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: -4px;
}
.dialog h2 {
  font-size: 16px;
}
.dialog form > p {
  color: var(--ink-2);
  font-size: 13px;
}
.dialog form > label:not(.check):not(.dropzone) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}
.dialog .row-end {
  margin-top: 2px;
  padding-top: 14px;
  border-top: 0.8px solid var(--line-soft);
}
.dialog .clarification-box {
  margin: 0;
}
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px;
  border: 0.8px dashed var(--line-hover);
  border-radius: 10px;
  background: var(--fill) var(--hatch);
  color: var(--brand-strong);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone.compact {
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  padding: 12px;
}
.dropzone:hover,
.dropzone:focus-within {
  border-color: var(--brand-strong);
  background-color: var(--brand-soft);
}
.dropzone strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}
.dropzone small {
  color: var(--muted);
  font-size: 12px;
}
.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: -4px 0 0;
  padding: 0;
  list-style: none;
}
.file-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 3px 3px 10px;
  border: 0.8px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.file-list span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-list small {
  color: var(--muted);
  font-size: 12px;
}
.paste summary {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 500;
}
.paste textarea {
  margin-top: 8px;
}
.form-error {
  padding: 8px 10px;
  border: 0.8px solid var(--red-line);
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
}

/* Sign-in */
.signin-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg) var(--hatch);
  overflow: auto;
}
.signin {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(400px, 100%);
  padding: 24px;
  border: 0.8px solid var(--line-input);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  animation: rise 0.6s var(--ease) both;
}
.signin-mark {
  width: 32px;
  height: auto;
}
.signin-yasmar {
  position: absolute;
  top: -12px;
  right: 16px;
  width: 88px;
}
.signin h1 {
  margin-top: 10px;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.signin > p {
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 13px;
}
.signin label {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}
.signin .button {
  margin-top: 6px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  transform: translateX(-50%);
  box-shadow: var(--shadow-pop);
}
.toast svg {
  flex: none;
  color: var(--brand-strong);
}

/* Narrow laptop: the sidebar becomes a sheet. */
@media (max-width: 1023px) {
  .shell > .sidebar {
    display: none;
  }
  .menu-toggle {
    display: inline-grid;
    margin-left: -6px;
  }
  .appbar {
    justify-content: flex-start;
    padding: 0 16px;
  }
  .appbar-end {
    margin-left: auto;
  }
  .page {
    padding: 16px 16px 0;
  }
  .actionbar {
    margin: auto -16px 0;
    padding-right: 16px;
    padding-left: 16px;
  }
}

/* Tablet */
@media (max-width: 980px) {
  .review {
    grid-template-columns: minmax(0, 1fr);
  }
  .review-source {
    position: static;
    max-height: none;
  }
  .how {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .patient-actions {
    width: 100%;
  }
  .patient-actions select {
    flex: 1;
    width: auto;
  }
}

/* Phone */
@media (max-width: 680px) {
  .env-chip small,
  .crumb-parent,
  .crumb-icon {
    display: none;
  }
  .save-pill {
    font-size: 0;
    gap: 0;
  }
  .save-pill .dot {
    width: 8px;
    height: 8px;
  }
  .page-head {
    grid-template-columns: 1fr;
  }
  .page-head h1,
  .patient-meta h1 {
    font-size: 20px;
  }
  .page-head .button {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
  .patient-actions {
    flex-wrap: wrap;
  }
  .patient-actions select {
    flex: 1 1 100%;
  }
  .patient-actions .button {
    flex: 1;
  }
  .stepper button {
    gap: 6px;
    height: 40px;
    padding: 0 8px;
  }
  .step-text small {
    display: none;
  }
  .records {
    grid-template-columns: minmax(0, 1fr);
  }
  .record-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .record {
    flex: 1 1 150px;
  }
  .record-list .button.dashed {
    flex: 1 1 100%;
  }
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }
  .section-head .button {
    align-self: flex-start;
  }
  .fact {
    flex-wrap: wrap;
    padding: 12px;
  }
  .fact-body {
    flex-basis: calc(100% - 40px);
  }
  .decision {
    width: calc(100% - 40px);
    margin-left: 40px;
  }
  .decision button {
    flex: 1;
  }
  .doc-head,
  .doc-foot {
    padding-right: 12px;
    padding-left: 12px;
  }
  .doc-lines li {
    grid-template-columns: 30px 1fr;
    padding-right: 12px;
  }
  .doc-lines .ln {
    padding-right: 8px;
  }
  .answer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
  }
  .answer img {
    width: 64px;
    height: 64px;
  }
  .answer h2 {
    font-size: 18px;
  }
  .compare {
    flex-wrap: wrap;
    gap: 8px;
  }
  .compare > svg {
    display: none;
  }
  .compare div {
    flex: 1 1 130px;
    min-width: 0;
  }
  .trace {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .plan-row {
    flex-wrap: wrap;
  }
  .plan-status {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    padding-left: 40px;
  }
  .plan-row:not(:has(.fact-icon)) .plan-status {
    padding-left: 0;
  }
  .actionbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .actionbar .button.large {
    width: 100%;
  }
  body:has(#nl-badge-frame) .actionbar {
    padding-right: 16px;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  .actionbar progress {
    width: 64px;
  }
  .actionbar .hint {
    font-size: 12px;
  }
  .case {
    flex-wrap: wrap;
  }
  .case > .button {
    width: 100%;
  }
  .how {
    grid-template-columns: minmax(0, 1fr);
  }
  .scope-row {
    grid-template-columns: 1fr auto;
  }
  .scope-row p {
    grid-column: 1 / -1;
  }
  .test-row {
    grid-template-columns: 20px 1fr auto;
  }
  .test-row small {
    display: none;
  }
  .toast {
    bottom: 150px;
  }
}

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