/* Aleena 2026. Tokens are the Figma local variables, same names with / → - */

:root {
  /* 2026 app */
  --text-primary: #1a1d3a;
  --text-secondary: #5b6078;
  --text-muted: #9a9eb2;
  --text-inverse: #ffffff;
  --surface-card: #ffffff;
  --surface-sunk: #f3f4f8;
  --border-hairline: #ecedf3;
  --accent-aleena: #3e4fd6;
  --accent-aleena-text: #27338f;
  --accent-aleena-bg: #eef0fc;
  --state-extracted: #0f8c7f;
  --state-extracted-text: #0a5a52;
  --state-extracted-bg: #e3f4f1;
  --state-open: #c7861c;
  --state-open-text: #7a500c;
  --state-open-bg: #fdf3e2;
  --state-escalate: #d0453f;
  --state-escalate-text: #8e2420;
  --state-escalate-bg: #fdedec;

  /* Portfolio */
  --portfolio-ink: #0f0f10;
  --portfolio-secondary: rgba(15, 15, 16, 0.58);
  --portfolio-accent: #d44819;
  --portfolio-paper: #fafaf8;

  --font-app: 'Inter', system-ui, sans-serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--portfolio-paper);
  color: var(--portfolio-ink);
}

p {
  margin: 0;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ─── Page layout ─────────────────────────────────────────────────────── */

.stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 380px minmax(0, 560px);
  justify-content: center;
  align-items: center;
  gap: 96px;
  padding: 48px 48px;
}

/* ─── Phone ───────────────────────────────────────────────────────────── */

.phone {
  width: 380px;
  height: min(844px, calc(100vh - 48px));
  min-height: 600px;
  background: var(--surface-card);
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--font-app);
  color: var(--text-primary);
  box-shadow:
    0 0 0 1px rgba(15, 15, 16, 0.06),
    0 24px 60px -24px rgba(26, 29, 58, 0.25);
}

/* Status bar (9:972) */
.status-bar {
  flex: none;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 20px 0 24px;
}
.status-bar__time {
  flex: 1;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
}

/* Visit header (9:980) */
.visit-header {
  flex: none;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 0 16px;
}
.visit-header__patient {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 500;
  white-space: nowrap;
  min-width: 0;
}
.visit-header__name {
  font-size: 18px;
  line-height: 24px;
  letter-spacing: -0.09px;
}
.visit-header__sub {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}
.sheet-toggle {
  display: none;
}

/* Protocol strip (9:986) */
.strip {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0 16px 20px;
}
.strip__label-row {
  display: flex;
  align-items: flex-start;
  padding-right: 20px;
  font-weight: 500;
}
.strip__label {
  flex: 1;
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.66px;
  color: var(--text-secondary);
}
.strip__count {
  font-size: 14px;
  line-height: 20px;
}
.strip__pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-right: 20px;
  scroll-snap-type: x proximity;
}
.strip__pills::-webkit-scrollbar {
  display: none;
}
.strip__pills .pill {
  scroll-snap-align: start;
}

/* Protocol pill (9:956) */
.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 10px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-app);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}
.pill--captured {
  background: var(--accent-aleena-bg);
  color: var(--accent-aleena-text);
}
.pill--open {
  background: var(--state-open-bg);
  color: var(--state-open-text);
}
.pill--extracted {
  background: var(--state-extracted-bg);
  color: var(--state-extracted-text);
}
button.pill:hover {
  box-shadow: inset 0 0 0 1px var(--state-open);
}
button.pill:focus-visible,
.btn:focus-visible,
.capture-row__marker:focus-visible,
.chip:focus-visible {
  outline: 2px solid var(--accent-aleena);
  outline-offset: 2px;
}

/* Thread */
.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px;
  scrollbar-width: none;
}
.thread::-webkit-scrollbar {
  display: none;
}
@media (pointer: fine) {
  .thread {
    cursor: grab;
  }
  .thread button {
    cursor: pointer;
  }
  .thread input {
    cursor: text;
  }
}
@media (pointer: fine) {
  .strip__pills {
    cursor: grab;
  }
}
.strip__pills.is-dragging,
.strip__pills.is-gliding {
  scroll-snap-type: none;
}
.thread img,
.strip__pills img {
  -webkit-user-drag: none;
}
/* Mouse drags scroll the conversation, so its text isn't selectable with a
   mouse. Fields inside it still are. */
@media (pointer: fine) {
  .thread,
  .strip__pills {
    -webkit-user-select: none;
    user-select: none;
  }
  .thread input {
    -webkit-user-select: text;
    user-select: text;
  }
}
.thread.is-dragging,
.thread.is-dragging *,
.strip__pills.is-dragging,
.strip__pills.is-dragging * {
  cursor: grabbing;
  user-select: none;
}
.thread > :first-child {
  margin-top: auto;
}
.row {
  display: flex;
  width: 100%;
}
.row--end {
  justify-content: flex-end;
}
.row > .card {
  flex: 1;
  min-width: 0;
}

.day-divider {
  align-self: center;
  font-weight: 500;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.26px;
  color: var(--text-muted);
}

/* Bubble / health worker */
.bubble--worker {
  max-width: 298px;
  background: var(--accent-aleena-bg);
  padding: 12px 18px;
  border-radius: 22px 22px 6px 22px;
  font-size: 18px;
  line-height: 27px;
  letter-spacing: -0.09px;
  overflow-wrap: anywhere;
}
/* Phase 2: transcripts get a mic marker */
.bubble--voice::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -1px;
  background: url('icons/mic.svg') center / contain no-repeat;
}

/* Bubble / Aleena: Title / 22 */
.bubble--aleena {
  padding: 4px 24px 4px 0;
  font-weight: 600;
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.22px;
}
.aleena-line {
  font-size: 18px;
  line-height: 27px;
  letter-spacing: -0.09px;
}

/* Cards */
.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px;
  border-radius: 24px;
  overflow: hidden;
}
.card--sunk {
  background: var(--surface-sunk);
}
.card--escalate {
  background: var(--state-escalate-bg);
  gap: 12px;
}
/* The capture card stacks rows with no gap; spacing comes from the rows */
.card:has(> .capture-row) {
  gap: 0;
}
.card__gap {
  height: 8px;
  flex: none;
}
.card__kicker {
  font-weight: 500;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.26px;
  color: var(--text-secondary);
}
.card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.card__actions--stack {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}
.card--summary .card__actions {
  width: 100%;
  margin-top: 14px;
}
.card__resolved {
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

/* Button (9:963) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-app);
  font-weight: 500;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.26px;
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent-aleena);
  color: var(--text-inverse);
}
.btn--secondary {
  background: var(--surface-card);
  color: var(--text-primary);
}
.btn--escalate {
  background: var(--state-escalate);
  color: var(--text-inverse);
}
.btn--block {
  width: 100%;
}
.btn:hover {
  filter: brightness(0.95);
}

/* Capture row (9:964) */
.capture-row,
.inline-edit {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border-hairline);
}
.capture-row__field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.capture-row__label {
  font-size: 15px;
  line-height: 22px;
  color: var(--text-secondary);
}
.capture-row__value {
  font-weight: 500;
  font-size: 18px;
  line-height: 27px;
  letter-spacing: -0.09px;
}
.capture-row__value--extracted {
  color: var(--state-extracted-text);
}
.capture-row__value--captured {
  color: var(--text-primary);
}
.capture-row__value--flag {
  color: var(--state-escalate-text);
}
.capture-row__note {
  margin-left: 8px;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--text-muted);
}
.capture-row__marker {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-app);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
  white-space: nowrap;
}
button.capture-row__marker:hover {
  color: var(--text-secondary);
}
.capture-row__marker--flag {
  color: var(--state-escalate-text);
}

/* Inline edit + direct input (not in Figma) */
.inline-edit {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.inline-edit__fields {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-edit__sep,
.inline-edit__unit {
  font-size: 15px;
  color: var(--text-secondary);
}
.num-input {
  width: 80px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  background: var(--surface-card);
  font-family: var(--font-app);
  font-weight: 500;
  font-size: 18px;
  color: var(--text-primary);
}
.num-input::placeholder {
  font-weight: 400;
  font-size: 15px;
  color: var(--text-muted);
}
.field-error {
  margin-top: 8px;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--state-escalate-text);
}
.field-error[hidden] {
  display: none;
}
.flag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.card__done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

/* In-card calendar (not in Figma) */
.date-picker {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-card);
}
.cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cal__title {
  font-weight: 500;
  font-size: 15px;
  line-height: 22px;
}
.cal__nav {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-primary);
}
.cal__nav:hover:not(:disabled) {
  background: var(--surface-sunk);
}
.cal__nav:disabled {
  color: var(--border-hairline);
  cursor: default;
}
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
  text-align: center;
}
.cal__wd {
  padding: 2px 0 4px;
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
}
.cal__day {
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  font-family: var(--font-app);
  font-size: 15px;
  color: var(--text-primary);
}
.cal__day:hover:not(:disabled) {
  background: var(--accent-aleena-bg);
}
.cal__day:disabled {
  color: var(--text-muted);
  opacity: 0.5;
  cursor: default;
}
.cal__day.is-today {
  box-shadow: inset 0 0 0 1px var(--text-muted);
}
.cal__day.is-selected,
.cal__day.is-selected:hover {
  background: var(--accent-aleena);
  color: var(--text-inverse);
  box-shadow: none;
}
.cal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-hairline);
}
.cal__picked {
  font-weight: 500;
  font-size: 15px;
  line-height: 20px;
  color: var(--state-extracted-text);
}
.num-input:focus {
  outline: 2px solid var(--accent-aleena);
  outline-offset: -1px;
}
.check-chip {
  padding: 6px 14px;
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  background: var(--surface-card);
  font-family: var(--font-app);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-primary);
}
.check-chip[aria-pressed='true'] {
  background: var(--state-escalate-bg);
  border-color: var(--state-escalate-bg);
  color: var(--state-escalate-text);
}

/* Flag pill (180:1172) */
.flag-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  background: var(--state-escalate-bg);
  font-weight: 500;
  font-size: 14px;
  line-height: 17px;
  color: var(--state-escalate-text);
}

/* Still open (11:1118) */
.still-open {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.still-open__note {
  font-size: 15px;
  line-height: 22px;
  color: var(--state-open-text);
}
.still-open__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Interpretation card (frame 01) */
.interp__value {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  font-weight: 600;
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.22px;
  color: var(--state-extracted-text);
}
.interp__value .icon {
  flex: none;
}
.interp__source {
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
}

/* Plausibility card (frame 05) */
.plaus__title {
  font-weight: 600;
  font-size: 22px;
  line-height: 27px;
  color: var(--state-open-text);
}
.plaus__body {
  font-size: 16px;
  line-height: 19px;
  color: var(--text-secondary);
}

/* Counselling card (frame 05) */
.counselling__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.counselling__hint {
  font-weight: 500;
  font-size: 14px;
  line-height: 17px;
  color: var(--text-muted);
}

/* Escalation card (frame 03) */
.escalate__heading {
  font-weight: 600;
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.22px;
  color: var(--state-escalate-text);
}
.panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 8px;
  border-radius: 16px;
  background: var(--surface-card);
}
.trend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--border-hairline);
}
.trend-row__visit {
  flex: none;
  width: 64px;
  font-size: 15px;
  line-height: 22px;
  color: var(--text-secondary);
}
.trend-row__reading {
  flex: 1;
  font-weight: 500;
  font-size: 18px;
  line-height: 27px;
  letter-spacing: -0.09px;
  color: var(--state-escalate-text);
}
.trend-row__reading--muted {
  font-weight: 400;
  font-size: 15px;
  color: var(--text-muted);
}
.trend-row__marker {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--state-escalate-text);
}
.panel__text {
  padding: 6px 0;
  border-top: 1px solid var(--border-hairline);
  font-size: 15px;
  line-height: 22px;
  color: var(--text-primary);
}
.scope-note {
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
}

/* Visit summary (not in Figma) */
.summary__review {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
}

.summary__review .flag-pill {
  border-radius: 14px;
}

/* Typing indicator (not in Figma) */
.typing {
  display: flex;
  gap: 5px;
  padding: 10px 0;
}
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1s infinite ease-in-out;
}
.typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .typing span {
    animation: none;
    opacity: 0.6;
  }
}

/* Composer (9:1015) */
.composer {
  flex: none;
  height: 80px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--surface-card);
}
.composer__field {
  flex: 1;
  min-width: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 0 20px;
  border-radius: 26px;
  background: var(--surface-sunk);
}
.composer__field:focus-within {
  box-shadow: inset 0 0 0 2px var(--accent-aleena-bg);
}
.composer__field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-family: var(--font-app);
  font-size: 18px;
  line-height: 27px;
  letter-spacing: -0.09px;
  color: var(--text-primary);
}
.composer__field input::placeholder {
  color: var(--text-muted);
}
.composer__mic {
  position: relative;
  display: flex;
  padding: 0;
  border: 0;
  background: none;
  cursor: not-allowed;
  opacity: 0.6;
}
.composer__mic::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  right: -12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--text-primary);
  color: var(--text-inverse);
  font-family: var(--font-app);
  font-weight: 500;
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.composer__mic:hover::after,
.composer__mic:focus-visible::after {
  opacity: 1;
}
/* Listening (voice demo, not in Figma) */
.composer--listening .composer__field {
  box-shadow: inset 0 0 0 2px var(--accent-aleena);
}
.composer--listening .composer__field input {
  text-overflow: clip;
}
.composer--listening .composer__mic {
  opacity: 1;
  cursor: default;
}
.composer--listening .composer__mic::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--accent-aleena-bg);
  z-index: -1;
  animation: listening 1.2s ease-in-out infinite;
}
.composer--listening .composer__mic {
  z-index: 0;
}
.composer--listening .composer__mic::after {
  opacity: 0;
}
@keyframes listening {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .composer--listening .composer__mic::before {
    animation: none;
  }
}
.composer__send {
  flex: none;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 26px;
  background: var(--accent-aleena);
}
.composer__send:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ─── Demo panel (portfolio caption column) ───────────────────────────── */

.demo {
  font-family: var(--font-sans);
  font-optical-sizing: auto;
}
.demo__sheet {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.demo__close {
  display: none;
}
.demo__eyebrow {
  font-weight: 500;
  font-size: 18px;
  line-height: 23px;
  letter-spacing: 1.44px;
  text-transform: uppercase;
  color: var(--portfolio-secondary);
}
.demo__title {
  margin: 12px 0 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 56px;
  line-height: 58px;
  letter-spacing: -2.24px;
}
.demo__rule {
  width: 32px;
  height: 2px;
  margin: 40px 0 20px;
  background: var(--portfolio-accent);
}
.demo__lead {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 36px;
  letter-spacing: -0.56px;
}
.demo__meta {
  margin-top: 16px;
  font-size: 18px;
  line-height: 28px;
  color: var(--portfolio-secondary);
}
.demo__label {
  margin: 36px 0 12px;
  font-weight: 500;
  font-size: 14px;
  line-height: 18px;
  letter-spacing: 1.12px;
  text-transform: uppercase;
  color: var(--portfolio-secondary);
}
.demo__chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.chip {
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid rgba(15, 15, 16, 0.14);
  border-radius: 14px;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 24px;
  text-align: left;
  color: var(--portfolio-ink);
  transition: border-color 0.15s, color 0.15s;
}
.chip:hover {
  border-color: var(--portfolio-accent);
  color: var(--portfolio-accent);
}
.chip::before {
  content: '“';
}
.chip::after {
  content: '”';
}
.voice-sample {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 10px;
  border: 1px solid rgba(15, 15, 16, 0.14);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-sans);
  text-align: left;
  color: var(--portfolio-ink);
  transition: border-color 0.15s;
}
.voice-sample:hover,
.voice-sample--playing {
  border-color: var(--portfolio-accent);
}
.voice-sample:focus-visible {
  outline: 2px solid var(--portfolio-accent);
  outline-offset: 2px;
}
.voice-sample__icon {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--portfolio-accent);
}
/* play triangle */
.voice-sample__icon::before {
  content: '';
  position: absolute;
  top: 13px;
  left: 16px;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent var(--portfolio-paper);
}
/* stop square */
.voice-sample--playing .voice-sample__icon::before {
  top: 14px;
  left: 14px;
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 2px;
  background: var(--portfolio-paper);
}
.voice-sample__text {
  display: flex;
  flex-direction: column;
}
.voice-sample__label {
  font-weight: 500;
  font-size: 17px;
  line-height: 24px;
}
.voice-sample__meta {
  font-size: 14px;
  line-height: 20px;
  color: var(--portfolio-secondary);
}
/* Primary: type into the phone */
.demo__start {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 32px;
}
.demo__start-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  color: var(--portfolio-ink);
}
/* Points at the phone (left on desktop, down on mobile) */
.demo__arrow {
  width: 28px;
  height: 2px;
  background: var(--portfolio-accent);
  position: relative;
  flex: none;
}
.demo__arrow::before {
  content: '';
  position: absolute;
  left: -1px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-left: 2px solid var(--portfolio-accent);
  border-bottom: 2px solid var(--portfolio-accent);
  transform: rotate(45deg);
}
.demo__start-body {
  margin-top: 8px;
  font-size: 18px;
  line-height: 28px;
  color: var(--portfolio-secondary);
}
.demo__cta {
  margin-top: 20px;
  padding: 14px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--portfolio-accent);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 22px;
  color: var(--portfolio-paper);
}
.demo__cta:hover {
  filter: brightness(0.92);
}
.demo__cta:focus-visible {
  outline: 2px solid var(--portfolio-accent);
  outline-offset: 3px;
}
.demo__start .demo__meta {
  margin-top: 16px;
  font-size: 15px;
  line-height: 22px;
}

/* Secondary: samples */
.demo__secondary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(15, 15, 16, 0.08);
}
.demo__secondary .demo__label {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 1.04px;
}
.demo__secondary .demo__chips {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}
.demo__secondary .chip {
  padding: 6px 12px;
  border-color: rgba(15, 15, 16, 0.1);
  border-radius: 10px;
  font-size: 14px;
  line-height: 20px;
  color: var(--portfolio-secondary);
}
.demo__secondary .chip:hover {
  color: var(--portfolio-accent);
}
.demo__secondary .voice-sample {
  gap: 10px;
  margin-top: 4px;
  padding: 6px 14px 6px 6px;
  border-color: rgba(15, 15, 16, 0.1);
}
.demo__secondary .voice-sample__icon {
  width: 28px;
  height: 28px;
}
.demo__secondary .voice-sample__icon::before {
  top: 9px;
  left: 11px;
  border-width: 5px 0 5px 8px;
}
.demo__secondary .voice-sample--playing .voice-sample__icon::before {
  top: 9px;
  left: 9px;
  width: 10px;
  height: 10px;
  border: 0;
}
.demo__secondary .voice-sample__label {
  font-size: 14px;
  line-height: 20px;
  color: var(--portfolio-ink);
}
.demo__secondary .voice-sample__meta {
  font-size: 12px;
  line-height: 16px;
}

/* Composer nudge when "Start typing" is pressed */
.composer--nudge .composer__field {
  animation: nudge 0.9s ease-out 1;
}
@keyframes nudge {
  0% {
    box-shadow: inset 0 0 0 2px var(--accent-aleena), 0 0 0 0 rgba(62, 79, 214, 0.35);
  }
  100% {
    box-shadow: inset 0 0 0 2px var(--accent-aleena-bg), 0 0 0 12px rgba(62, 79, 214, 0);
  }
}

.demo__reset {
  margin-top: 24px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 17px;
  color: var(--portfolio-ink);
  text-decoration: underline;
  text-decoration-color: var(--portfolio-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.demo__reset:hover {
  color: var(--portfolio-accent);
}

.banner {
  position: fixed;
  z-index: 30;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--portfolio-ink);
  color: var(--portfolio-paper);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
}
.banner[hidden] {
  display: none;
}

.scrim {
  display: none;
}

/* ─── Mid widths ──────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .stage {
    gap: 56px;
    padding: 32px;
  }
  .demo__title {
    font-size: 44px;
    line-height: 48px;
  }
  .demo__lead {
    font-size: 24px;
    line-height: 32px;
  }
}

/* ─── Mobile: the phone UI is the page; the demo panel is a sheet ─────── */

@media (max-width: 760px) {
  .stage {
    display: block;
    min-height: 0;
    padding: 0;
  }
  .phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .status-bar {
    display: none;
  }
  .visit-header {
    padding-top: env(safe-area-inset-top);
    height: calc(72px + env(safe-area-inset-top));
  }
  .composer {
    height: calc(80px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sheet-toggle {
    display: inline-flex;
    flex: none;
    padding: 8px 14px;
    border: 1px solid rgba(15, 15, 16, 0.14);
    border-radius: 999px;
    background: var(--portfolio-paper);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 14px;
    color: var(--portfolio-ink);
  }
  .demo {
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85dvh;
    overflow-y: auto;
    padding: 28px 16px calc(28px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    background: var(--portfolio-paper);
    transform: translateY(100%);
    transition: transform 0.25s ease;
    visibility: hidden;
  }
  .sheet-open .demo {
    transform: none;
    visibility: visible;
  }
  .demo__close {
    display: block;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 0;
    background: none;
    font-size: 28px;
    color: var(--portfolio-secondary);
  }
  .demo__eyebrow {
    font-size: 14px;
    line-height: 18px;
  }
  .demo__title {
    font-size: 36px;
    line-height: 40px;
    letter-spacing: -1.2px;
  }
  .demo__rule {
    margin: 20px 0 14px;
  }
  .demo__lead {
    font-size: 21px;
    line-height: 28px;
  }
  .demo__meta {
    font-size: 16px;
    line-height: 24px;
  }
  .demo__label {
    margin-top: 22px;
  }
  .demo__start {
    margin-top: 20px;
  }
  .demo__start-title {
    font-size: 20px;
    line-height: 28px;
  }
  .demo__arrow {
    display: none;
  }
  .demo__start-body {
    font-size: 16px;
    line-height: 24px;
  }
  .demo__secondary {
    margin-top: 24px;
  }
  .chip {
    font-size: 16px;
  }
  .scrim {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(15, 15, 16, 0.32);
  }
  .sheet-open .scrim {
    display: block;
  }
  .banner {
    top: auto;
    left: 16px;
    right: 16px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    max-width: none;
    transform: none;
    border-radius: 12px;
    text-align: center;
  }
}

@media (max-width: 400px) {
  .thread {
    padding: 16px;
  }
  .bubble--worker {
    max-width: 85%;
  }
}
