:root {
  --black: #171717;
  --black-2: #202020;
  --ink: #111111;
  --paper: #f2efe7;
  --paper-2: #e7e3d9;
  --white: #fffefa;
  --muted: #716f68;
  --line: rgba(17, 17, 17, 0.16);
  --line-dark: rgba(255, 255, 255, 0.18);
  --yellow: #ffdc00;
  --lime: #8fff00;
  --red: #ff2b2b;
  --shadow: 0 28px 80px rgba(11, 11, 11, 0.16);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(17, 17, 17, 0.035) 1px) 0 0 / 25% 100%,
    var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--black);
  color: var(--white);
  letter-spacing: 0.18em;
  font-size: 12px;
}

.boot__mark {
  width: 54px;
  height: 54px;
  border: 2px solid var(--yellow);
  border-radius: 50%;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(20px, 4vw, 64px);
  color: var(--white);
  background: rgba(23, 23, 23, 0.97);
  border-bottom: 1px solid var(--line-dark);
  backdrop-filter: blur(20px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.brand__mark {
  width: 44px;
  height: 44px;
  color: var(--yellow);
}

.brand > span {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.14em;
}

.brand small {
  color: rgba(255, 255, 255, 0.54);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.topbar__tools {
  display: flex;
  align-items: center;
  gap: 20px;
}

.role-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
}

.role-switch > span {
  margin: 0 10px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-switch button {
  padding: 8px 13px;
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}

.role-switch button[aria-pressed="true"] {
  color: var(--black);
  background: var(--yellow);
}

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.identity__avatar,
.patient-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.identity > span:last-child {
  display: grid;
  gap: 2px;
}

.identity strong {
  font-size: 12px;
}

.identity small {
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.install-button {
  color: var(--yellow);
  border-color: rgba(255, 220, 0, 0.44);
}

.app-main {
  min-height: calc(100vh - 82px);
}

.home-screen,
.workspace-screen {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 76px) clamp(20px, 4vw, 64px) 120px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.hero-grid {
  min-height: 366px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.7fr);
  color: var(--white);
  background: var(--black);
  border-radius: 0 0 34px 0;
  overflow: hidden;
}

.hero-grid__copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(34px, 6vw, 84px);
  border-right: 1px solid var(--line-dark);
}

.hero-grid__copy::before,
.hero-grid__copy::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-grid__copy::before {
  inset: 0 33.333% 0 auto;
  width: 1px;
  background: var(--line-dark);
}

.hero-grid__copy::after {
  width: min(260px, 30vw);
  height: min(260px, 30vw);
  top: -38%;
  right: 8%;
  border: 1px solid rgba(255, 220, 0, 0.5);
  border-radius: 50%;
}

.hero-grid__copy .eyebrow {
  color: var(--yellow);
}

.hero-grid h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(54px, 7.5vw, 116px);
  font-weight: 300;
  letter-spacing: -0.065em;
  line-height: 0.86;
}

.hero-grid__copy > p:last-child {
  max-width: 610px;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: clamp(16px, 1.5vw, 21px);
  font-weight: 300;
  line-height: 1.4;
}

.hero-grid__signal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(34px, 5vw, 70px);
  background:
    linear-gradient(var(--line-dark) 1px, transparent 1px) 0 0 / 100% 33.333%,
    var(--black-2);
}

.signal-dot {
  width: 11px;
  height: 11px;
  display: inline-block;
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(143, 255, 0, 0.08);
}

.signal-dot--yellow {
  background: var(--yellow);
  box-shadow: 0 0 0 8px rgba(255, 220, 0, 0.08);
}

.hero-grid__signal small {
  margin-top: 34px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.hero-grid__signal strong {
  max-width: 330px;
  margin-top: 12px;
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 300;
  line-height: 1.04;
}

.hero-grid__signal > span:last-child {
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
}

.module-section {
  margin-top: clamp(60px, 8vw, 110px);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.section-heading > span,
.content-panel__heading > span {
  color: var(--muted);
  font-size: 12px;
}

.section-heading--compact {
  margin: 54px 0 0;
}

.section-heading--compact h2 {
  font-size: clamp(32px, 4vw, 48px);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-left: 1px solid var(--line);
}

.module-card {
  position: relative;
  min-height: 280px;
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 16px 22px;
  padding: clamp(28px, 4vw, 52px);
  text-align: left;
  color: var(--ink);
  background: rgba(255, 254, 250, 0.36);
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  overflow: hidden;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.module-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -105px;
  bottom: -105px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.18;
  transition: transform 260ms ease;
}

.module-card:hover {
  z-index: 1;
  color: var(--white);
  background: var(--black);
  transform: translateY(-4px);
}

.module-card:hover::after {
  transform: scale(1.4);
}

.module-card--anamnese:hover,
.module-card--acompanhamento:hover {
  color: var(--ink);
  background: var(--yellow);
}

.module-card__number {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.module-card:hover .module-card__number,
.module-card:hover .module-card__copy > span {
  color: inherit;
  opacity: 0.6;
}

.module-card__icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  grid-row: 2;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.module-card__copy {
  display: flex;
  flex-direction: column;
  align-self: center;
  grid-row: 2;
}

.module-card__copy small {
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.module-card__copy strong {
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 300;
  letter-spacing: -0.045em;
}

.module-card__copy > span {
  max-width: 390px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.module-card__open {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 2;
  align-self: end;
  font-size: 12px;
  font-weight: 600;
}

.journey-strip {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: clamp(70px, 9vw, 120px) 0 0;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.journey-strip::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 11px;
  height: 40px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.journey-strip div {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.journey-strip i {
  position: absolute;
  top: -32px;
  width: 8px;
  height: 8px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.journey-strip .is-current {
  color: var(--ink);
  font-weight: 700;
}

.journey-strip .is-current i {
  background: var(--yellow);
  box-shadow: 0 0 0 7px rgba(255, 220, 0, 0.22);
}

.workspace-header {
  min-height: 190px;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: start;
  justify-self: start;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
}

.workspace-header__title h1 {
  margin: 0;
  font-size: clamp(52px, 7vw, 96px);
  font-weight: 300;
  letter-spacing: -0.065em;
  line-height: 0.86;
}

.workspace-header__title > p:last-child {
  max-width: 670px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.workspace-header__actions {
  align-self: end;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.button--dark {
  color: var(--white);
  background: var(--black);
}

.button--yellow {
  color: var(--ink);
  background: var(--yellow);
}

.upload-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-control label {
  cursor: pointer;
}

.patient-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  border-left: 1px solid var(--line);
}

.patient-workspace--solo {
  grid-template-columns: 1fr;
  border-left: 0;
}

.patient-rail {
  border-right: 1px solid var(--line);
}

.patient-rail__heading {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.patient-rail__heading b {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper-2);
  border-radius: 50%;
}

.patient-row {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px 17px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.patient-row.is-active {
  background: var(--yellow);
}

.patient-row > span:nth-child(2) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.patient-row strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-row small {
  color: var(--muted);
  font-size: 10px;
}

.patient-detail {
  min-width: 0;
  padding: clamp(26px, 4vw, 54px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.patient-detail__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.patient-avatar--large {
  width: 66px;
  height: 66px;
  background: var(--black);
  color: var(--white);
  border: 0;
  font-size: 15px;
}

.patient-detail__header h2,
.transcript-panel__head h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 300;
  letter-spacing: -0.04em;
}

.patient-detail__header > div:nth-child(2) > span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.next-appointment {
  display: grid;
  gap: 6px;
  padding: 14px 18px;
  border-left: 2px solid var(--yellow);
}

.next-appointment small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.next-appointment strong {
  font-size: 13px;
}

.marker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 42px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.marker-card {
  min-width: 0;
  padding: 22px;
  background: rgba(255, 254, 250, 0.34);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.marker-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.marker-card > div b {
  padding: 4px 7px;
  border-radius: 99px;
  font-size: 9px;
}

.tone-lime {
  color: #365e00;
  background: rgba(143, 255, 0, 0.24);
}

.tone-yellow {
  color: #6b5c00;
  background: rgba(255, 220, 0, 0.26);
}

.tone-red {
  color: #8f0000;
  background: rgba(255, 43, 43, 0.17);
}

.tone-neutral {
  color: var(--muted);
  background: var(--paper-2);
}

.marker-card > strong {
  display: block;
  margin-top: 22px;
  font-size: clamp(27px, 3vw, 42px);
  font-weight: 300;
  letter-spacing: -0.045em;
}

.marker-card > strong small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.marker-card > i {
  position: relative;
  height: 2px;
  display: block;
  margin-top: 22px;
  background: var(--paper-2);
  overflow: hidden;
}

.marker-card > i span {
  width: 68%;
  height: 100%;
  display: block;
}

.tone-bg-lime { background: var(--lime); }
.tone-bg-yellow { background: var(--yellow); }
.tone-bg-red { background: var(--red); }
.tone-bg-neutral { background: #8a8983; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.7fr);
  gap: 22px;
  margin-top: 22px;
}

.content-panel {
  min-width: 0;
  background: rgba(255, 254, 250, 0.46);
  border: 1px solid var(--line);
}

.content-panel__heading {
  min-height: 92px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.content-panel__heading h3 {
  margin: 0;
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.035em;
}

.exam-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 90px auto 40px;
  align-items: center;
  gap: 12px;
  padding: 12px 17px;
  border-bottom: 1px solid var(--line);
}

.exam-row:last-child {
  border-bottom: 0;
}

.exam-row__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  border-radius: 50%;
}

.exam-row__name {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.exam-row__name strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exam-row__name small,
.exam-row__date {
  color: var(--muted);
  font-size: 10px;
}

.status {
  justify-self: start;
  padding: 5px 8px;
  color: var(--muted);
  background: var(--paper-2);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.status--novo,
.status--pendente,
.status--na-fila {
  color: var(--ink);
  background: var(--yellow);
}

.status--ativo,
.status--revisado,
.status--comentado {
  color: #365e00;
  background: rgba(143, 255, 0, 0.24);
}

.timeline {
  padding: 8px 22px 22px;
}

.timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 4px 12px;
  padding: 17px 0 17px 20px;
  border-left: 1px solid var(--line);
}

.timeline article i {
  position: absolute;
  top: 21px;
  left: -5px;
  width: 9px;
  height: 9px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.timeline time {
  grid-row: span 2;
  color: var(--muted);
  font-size: 9px;
}

.timeline strong {
  font-size: 11px;
}

.timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.prototype-note,
.privacy-warning {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.anamnese-grid {
  display: grid;
  grid-template-columns: 250px minmax(380px, 1.2fr) minmax(280px, 0.72fr);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.transcript-panel,
.copilot-panel {
  min-width: 0;
  padding: clamp(24px, 3vw, 40px);
  border-right: 1px solid var(--line);
}

.transcript-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.recording-state,
.idle-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--muted);
  background: var(--paper-2);
  border-radius: 999px;
  font-size: 10px;
}

.recording-state {
  color: var(--white);
  background: var(--red);
}

.recording-state i {
  width: 7px;
  height: 7px;
  background: var(--white);
  border-radius: 50%;
  animation: breathe 1.2s ease-in-out infinite;
}

@keyframes breathe {
  50% { opacity: 0.3; }
}

.consent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  padding: 14px;
  background: rgba(255, 254, 250, 0.5);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 11px;
}

.consent-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--black);
}

.consent-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.transcript-feed {
  height: 460px;
  margin-top: 18px;
  padding-right: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.transcript-turn {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  margin: 0 0 16px;
}

.transcript-turn > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--black);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
}

.transcript-turn--patient > span {
  color: var(--ink);
  background: var(--yellow);
}

.transcript-turn > div {
  padding: 14px 16px;
  background: rgba(255, 254, 250, 0.54);
  border: 1px solid var(--line);
}

.transcript-turn strong {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
}

.transcript-turn p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.transcript-turn--live > div {
  border-style: dashed;
}

.transcript-controls {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.record-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.record-button.is-recording {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.copilot-panel {
  color: var(--white);
  background: var(--black);
}

.copilot-panel > .eyebrow {
  color: var(--yellow);
}

.copilot-empty {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border-top: 1px solid var(--line-dark);
}

.copilot-empty h3,
.copilot-result h3 {
  margin: 24px 0 10px;
  font-size: clamp(27px, 3vw, 42px);
  font-weight: 300;
  letter-spacing: -0.04em;
}

.copilot-empty p,
.copilot-result p {
  color: rgba(255, 255, 255, 0.56);
  font-size: 13px;
  line-height: 1.55;
}

.copilot-empty > span {
  margin-top: 18px;
  padding: 6px 9px;
  color: var(--yellow);
  border: 1px solid rgba(255, 220, 0, 0.35);
  border-radius: 999px;
  font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.copilot-result {
  margin-top: 35px;
}

.copilot-result__status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.theme-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}

.theme-list span {
  padding: 7px 10px;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.copilot-result dl {
  margin: 32px 0 0;
  border-top: 1px solid var(--line-dark);
}

.copilot-result dl div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-dark);
  font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.copilot-result dt {
  color: rgba(255, 255, 255, 0.43);
}

.research-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(310px, 0.7fr);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.research-main,
.research-aside {
  min-width: 0;
  padding: clamp(28px, 4vw, 56px);
  border-right: 1px solid var(--line);
}

.research-prompt {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: clamp(24px, 4vw, 46px);
  color: var(--white);
  background: var(--black);
  border-radius: 0 0 28px 0;
}

.research-prompt > div {
  display: flex;
  align-items: center;
  gap: 13px;
  grid-column: 1 / -1;
}

.research-prompt label {
  font-size: 12px;
  font-weight: 700;
}

.research-prompt textarea {
  min-height: 104px;
  padding: 18px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-dark);
  border-radius: 0;
  resize: vertical;
}

.research-prompt textarea::placeholder {
  color: rgba(255, 255, 255, 0.36);
}

.research-prompt .button {
  align-self: end;
}

.research-list article {
  min-height: 104px;
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.research-list__number {
  color: var(--muted);
  font-size: 10px;
}

.research-list h3 {
  max-width: 780px;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

.research-list p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.research-aside {
  color: var(--white);
  background: var(--black);
}

.research-aside > .eyebrow {
  color: var(--yellow);
}

.research-aside h2 {
  max-width: 360px;
  margin: 54px 0;
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.research-aside ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-dark);
}

.research-aside li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 0;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--line-dark);
  font-size: 12px;
}

.research-aside li span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

.contract-status {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 46px;
}

.contract-status div {
  display: grid;
  gap: 5px;
}

.contract-status strong {
  font-size: 12px;
}

.contract-status small {
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
  line-height: 1.4;
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.7fr) minmax(0, 1.45fr);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.invite-card {
  padding: clamp(30px, 5vw, 64px);
  color: var(--white);
  background: var(--black);
}

.invite-card > .eyebrow {
  color: var(--yellow);
}

.invite-card h2 {
  max-width: 360px;
  margin: 36px 0 16px;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.invite-card > p:not(.eyebrow) {
  max-width: 410px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 13px;
  line-height: 1.5;
}

.invite-card form {
  display: grid;
  gap: 16px;
  margin-top: 50px;
}

.invite-card label {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invite-card input,
.invite-card select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-dark);
  border-radius: 0;
  text-transform: none;
  letter-spacing: 0;
}

.invite-card select option {
  color: var(--ink);
}

.invite-card .button {
  justify-self: start;
  margin-top: 12px;
}

.access-list {
  border-left: 0;
  border-top: 0;
}

.access-table__head,
.access-table__row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(110px, 0.65fr) 100px 80px;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.access-table__head {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.access-table__row {
  font-size: 11px;
}

.access-table__row > span:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-table__row i {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--black);
  border-radius: 50%;
  font-style: normal;
  font-size: 10px;
}

.chat-launcher {
  position: fixed;
  z-index: 60;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  height: 64px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 16px 6px 7px;
  color: var(--white);
  background: var(--black);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 180ms ease;
}

.chat-launcher:hover {
  transform: translateY(-3px);
}

.chat-launcher.is-open {
  transform: translateY(90px);
}

.chat-launcher__avatar,
.fred-avatar {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 50%;
}

.chat-launcher__avatar .realure-mark {
  width: 42px;
  height: 42px;
}

.chat-launcher > span:nth-child(2) {
  display: grid;
  gap: 1px;
  min-width: 90px;
  text-align: left;
}

.chat-launcher small {
  color: rgba(255, 255, 255, 0.48);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.chat-launcher strong {
  font-size: 15px;
  letter-spacing: 0.16em;
}

.chat-drawer {
  position: fixed;
  z-index: 55;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  width: min(720px, calc(100vw - 48px));
  height: min(720px, calc(100vh - 112px));
  display: flex;
  flex-direction: column;
  color: var(--white);
  background: var(--black);
  border: 1px solid var(--line-dark);
  border-radius: 28px 28px 0 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(30px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 180ms ease, transform 180ms ease;
}

.chat-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-drawer__head {
  min-height: 88px;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-dark);
}

.fred-avatar {
  width: 52px;
  height: 52px;
}

.fred-avatar .realure-mark {
  width: 44px;
  height: 44px;
}

.chat-drawer__head > div:nth-child(2) {
  display: grid;
}

.chat-drawer__head small {
  color: var(--yellow);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.chat-drawer__head strong {
  margin-top: 2px;
  font-size: 20px;
  font-weight: 400;
}

.chat-drawer__head span {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 9px;
}

.chat-drawer__head span i {
  width: 6px;
  height: 6px;
  background: var(--lime);
  border-radius: 50%;
}

.chat-drawer__head > button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: transparent;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  cursor: pointer;
}

.chat-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  flex: 1;
}

.chat-body--admin {
  grid-template-columns: 205px minmax(0, 1fr);
}

.thread-list {
  min-width: 0;
  border-right: 1px solid var(--line-dark);
  overflow-y: auto;
}

.thread-list button {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 15px 13px;
  color: var(--white);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-dark);
  cursor: pointer;
}

.thread-list button.is-active {
  color: var(--ink);
  background: var(--yellow);
}

.thread-list .patient-avatar {
  width: 34px;
  height: 34px;
  font-size: 9px;
}

.thread-list button > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.thread-list strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-list small {
  color: inherit;
  font-size: 8px;
  opacity: 0.52;
}

.conversation {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.conversation__patient {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-dark);
}

.conversation__patient .patient-avatar {
  width: 36px;
  height: 36px;
  font-size: 9px;
}

.conversation__patient > div {
  display: grid;
  gap: 2px;
}

.conversation__patient strong {
  font-size: 11px;
}

.conversation__patient small {
  color: rgba(255, 255, 255, 0.42);
  font-size: 8px;
}

.message-feed {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.message {
  max-width: 84%;
  margin-bottom: 14px;
}

.message p {
  margin: 0;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 14px 14px 14px 2px;
  font-size: 12px;
  line-height: 1.45;
}

.message > span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 8px;
}

.message--patient,
.message--doctor {
  margin-left: auto;
}

.message--patient p,
.message--doctor p {
  background: var(--yellow);
  border-radius: 14px 14px 2px 14px;
}

.message--patient > span,
.message--doctor > span {
  text-align: right;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-dark);
}

.chat-composer textarea {
  min-height: 42px;
  max-height: 100px;
  padding: 12px 14px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-dark);
  border-radius: 22px;
  resize: none;
}

.chat-composer textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.chat-composer button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.chat-disclaimer {
  margin: 0;
  padding: 0 18px 13px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 8px;
  line-height: 1.4;
}

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 28px;
  max-width: min(520px, calc(100vw - 40px));
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  color: var(--white);
  background: var(--black);
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  font-size: 11px;
}

.toast > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  border-radius: 50%;
}

.toast button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-left: auto;
  color: var(--white);
  background: transparent;
  border: 0;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .role-switch > span,
  .identity > span:last-child {
    display: none;
  }

  .hero-grid {
    grid-template-columns: 1.25fr 0.75fr;
  }

  .workspace-header {
    grid-template-columns: 110px 1fr;
  }

  .workspace-header__actions {
    grid-column: 2;
  }

  .patient-workspace {
    grid-template-columns: 225px minmax(0, 1fr);
  }

  .marker-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .anamnese-grid {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .anamnese-grid > .copilot-panel {
    grid-column: 2;
  }

  .copilot-empty {
    min-height: 320px;
  }
}

@media (max-width: 760px) {
  body {
    background: var(--paper);
  }

  .topbar {
    height: 68px;
    gap: 12px;
    padding: 0 14px;
  }

  .brand__mark {
    width: 38px;
    height: 38px;
  }

  .brand small,
  .identity,
  .install-button {
    display: none;
  }

  .topbar__tools {
    gap: 8px;
  }

  .role-switch button {
    padding: 7px 10px;
    font-size: 10px;
  }

  .app-main {
    min-height: calc(100vh - 68px);
  }

  .home-screen,
  .workspace-screen {
    padding: 18px 14px 110px;
  }

  .hero-grid {
    min-height: 0;
    grid-template-columns: 1fr;
    border-radius: 0 0 24px 0;
  }

  .hero-grid__copy {
    min-height: 330px;
    padding: 28px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
  }

  .hero-grid h1 {
    font-size: clamp(52px, 17vw, 76px);
  }

  .hero-grid__copy > p:last-child {
    font-size: 15px;
  }

  .hero-grid__signal {
    min-height: 200px;
    padding: 28px 24px;
  }

  .hero-grid__signal small {
    margin-top: 24px;
  }

  .module-section {
    margin-top: 60px;
  }

  .section-heading {
    align-items: center;
  }

  .section-heading h2 {
    font-size: 44px;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-card {
    min-height: 230px;
    grid-template-columns: 48px 1fr;
    padding: 26px 22px;
  }

  .module-card__icon {
    width: 46px;
    height: 46px;
  }

  .module-card__copy strong {
    font-size: 34px;
  }

  .journey-strip div:nth-child(2),
  .journey-strip div:nth-child(4) {
    display: none;
  }

  .journey-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .workspace-header {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 12px 2px 26px;
  }

  .workspace-header__actions {
    grid-column: 1;
  }

  .workspace-header__title h1 {
    font-size: 58px;
  }

  .upload-control {
    align-items: stretch;
  }

  .upload-control .button {
    flex: 1;
  }

  .patient-workspace,
  .patient-workspace--solo,
  .anamnese-grid,
  .research-layout,
  .access-layout {
    grid-template-columns: 1fr;
    border-left: 0;
  }

  .patient-rail {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .patient-rail__heading {
    display: none;
  }

  .patient-row {
    width: 220px;
    flex: 0 0 220px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .patient-detail,
  .transcript-panel,
  .copilot-panel,
  .research-main,
  .research-aside {
    padding: 26px 18px;
  }

  .patient-detail__header {
    grid-template-columns: auto 1fr;
  }

  .next-appointment {
    grid-column: 1 / -1;
  }

  .marker-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 28px;
  }

  .marker-card {
    padding: 16px;
  }

  .marker-card > strong {
    font-size: 28px;
  }

  .exam-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .exam-row__date,
  .exam-row .status {
    display: none;
  }

  .anamnese-grid > .copilot-panel {
    grid-column: 1;
  }

  .transcript-feed {
    height: 430px;
  }

  .transcript-controls {
    flex-direction: column;
  }

  .record-button,
  .transcript-controls .button {
    justify-content: center;
  }

  .research-prompt {
    grid-template-columns: 1fr;
    padding: 24px 18px;
  }

  .research-prompt .button {
    justify-self: stretch;
  }

  .research-list article {
    grid-template-columns: 30px 1fr auto;
  }

  .research-list article .status {
    display: none;
  }

  .access-table {
    overflow-x: auto;
  }

  .access-table__head,
  .access-table__row {
    min-width: 650px;
  }

  .chat-launcher {
    right: 14px;
    bottom: 14px;
  }

  .chat-drawer {
    inset: 74px 8px 8px;
    width: auto;
    height: auto;
    border-radius: 22px 22px 0 22px;
  }

  .chat-body--admin {
    grid-template-columns: 1fr;
  }

  .thread-list {
    display: flex;
    flex: 0 0 auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
    overflow-x: auto;
  }

  .thread-list button {
    width: 180px;
    flex: 0 0 180px;
    border-right: 1px solid var(--line-dark);
    border-bottom: 0;
  }

  .message-feed {
    padding: 16px;
  }

  .toast {
    bottom: 88px;
  }
}

@media (max-width: 430px) {
  .brand > span {
    display: none;
  }

  .marker-grid {
    grid-template-columns: 1fr;
  }

  .chat-launcher > span:nth-child(2) {
    display: none;
  }

  .chat-launcher {
    width: 62px;
    padding: 5px;
  }

  .chat-launcher > .icon {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
