/* ---------- Font: ABC Areal (the design's typeface) ---------- */
/* Regular / Medium / Bold are the three weights the Figma text styles use
   (400, 500, 700). Anything else falls back to the system fonts. */
@font-face {
  font-family: "ABC Areal";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/ABCAreal-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "ABC Areal";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/ABCAreal-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "ABC Areal";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/ABCAreal-Bold.woff2") format("woff2");
}

/* ---------- Figma variables (Klaus design file) ---------- */
:root {
  /* Typography: ABC Areal, then the system fonts. The --text-* tokens are the
     Figma text styles (weight, size / line-height, family); use them as
     `font: var(--text-body-medium-regular)`. */
  --font-family-base: "ABC Areal";
  --font-stack: var(--font-family-base), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --text-title: 700 28px/36px var(--font-stack); /* Title (with --letter-spacing-title) */
  --text-section-title: 700 18px/26px var(--font-stack); /* Section title */
  --text-body-large-regular: 400 18px/26px var(--font-stack);
  --text-body-large-medium: 500 18px/26px var(--font-stack);
  --text-body-large-bold: 700 18px/26px var(--font-stack);
  --text-body-medium-regular: 400 16px/24px var(--font-stack);
  --text-body-medium-medium: 500 16px/24px var(--font-stack);
  --text-body-medium-bold: 700 16px/24px var(--font-stack);
  --text-body-small-regular: 400 14px/20px var(--font-stack);
  --text-body-small-medium: 500 14px/20px var(--font-stack);
  --text-body-small-bold: 700 14px/20px var(--font-stack);
  --text-caption-medium: 500 12px/16px var(--font-stack); /* Caption/Medium (with --letter-spacing-caption) */
  --letter-spacing-title: -0.8px;
  --letter-spacing-caption: 0.8px;

  /* Spacing */
  --spacing-none: 0;
  --spacing-s: 12px;
  --spacing-m: 16px;
  --spacing-l: 24px;
  --spacing-top: 27px;
  --spacing-bottom: 62px;

  /* Stroke */
  --stroke-light: 1px;

  /* Colors */
  --color-black: #000000;
  --color-white: #ffffff;
  --color-gray-10: #f2f4f8;
  --color-gray-20: #dde1e6;
  --color-gray-30: #c1c7cd;
  --color-gray-40: #a2a9b0;
  --color-gray-60: #697077;
  --color-gray-100: #121619;
}

:root {
  --bg: #ffffff;
  --text: #121619;
  --text-secondary: #697077;
  --text-disabled: #a2a9b0;
  --action-bg: #121619;
  --action-bg-disabled: #c1c7cd;
  --surface: #ffffff;
  --border: #dde1e6;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-stack);
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

button {
  font-family: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Main screen ---------- */

/* The conversation scrolls underneath the floating top pill and the bottom
   input panel, so both are layered above it instead of taking up flow space. */

#main-screen {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
  pointer-events: none;
}

.top-bar button {
  pointer-events: auto;
}

.top-slot {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
}

.top-slot-end {
  justify-content: flex-end;
  gap: 10px; /* "Sign up" beside "Finish" in a guest's session */
}

/* Klaus sits at the left of the bar, 96px, while a session runs (app.js moves him here). */
.top-klaus-slot {
  flex: none;
  width: 96px;
  height: 96px;
}

.top-klaus-slot:empty {
  display: none;
}

.top-klaus-slot .klaus {
  width: 96px;
  height: 96px;
}

/* A session's bar: 16px all round, the pills level with the top of Klaus. */
#main-screen[data-screen="session"] .top-bar {
  align-items: flex-start;
  padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
  padding-bottom: 16px;
}

/* The pills in the top bar: "Sign up" for guests, the learner's name when signed in,
   the practice streak beside it, "Finish" during a session. "Send" is the dark one. */
.pill {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 8px 12px;
  border: 0.5px solid var(--border);
  border-radius: 32px;
  background: var(--bg);
  color: var(--text);
  font: var(--text-body-medium-medium);
  white-space: nowrap;
  cursor: pointer;
}

/* Signed in, "Finish" and "Send" have 16px sides; a guest's two pills have 12px. */
#main-screen[data-account="member"] .pill {
  padding-inline: 16px;
}

/* Off while Klaus is thinking; the design doesn't gray it. */
.pill:disabled {
  cursor: default;
}

.pill-dark {
  border: none;
  background: var(--action-bg);
  color: var(--color-white);
}


.conversation-area {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding:
    calc(env(safe-area-inset-top, 0px) + var(--top-offset, 80px))
    16px
    calc(var(--input-panel-height, 67px) + 24px);
  text-align: left;
}

/* Where the content starts, as in the design: in a session the bar is 128 tall (16 + Klaus
   at 96 + 16) and the text follows 16 below it; the home screen's bar is 56 tall (the 40px
   pills) with 16 + 48 before Klaus; the end screen has no bar, Klaus is 24 from the top. */
#main-screen[data-screen="session"] {
  --top-offset: 144px;
}

/* The home screen: a row at the top, Klaus filling what's left, then the bubble or the intro,
   48px apart (less on short screens), and "Start chat" in the panel at the bottom. */
#main-screen[data-screen="start"] {
  --top-offset: 16px;
}

#main-screen[data-screen="start"] .conversation-area {
  gap: min(48px, 5.5vh);
  padding-bottom: calc(var(--input-panel-height, 90px) + 16px);
}

.home-top {
  display: flex;
  flex-shrink: 0;
  align-self: stretch;
  align-items: center;
  justify-content: space-between;
}

#main-screen[data-screen="done"] {
  --top-offset: 24px;
}

.klaus {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
}

.klaus-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
}

.klaus[data-expression="default"] .klaus-img[data-expression="default"],
.klaus[data-expression="blinking"] .klaus-img[data-expression="blinking"],
.klaus[data-expression="happy"] .klaus-img[data-expression="happy"],
.klaus[data-expression="bummed"] .klaus-img[data-expression="bummed"] {
  visibility: visible;
}

/* The home screen: Klaus, full body, takes the height that's left (up to the 432px of the
   new-user design), so he is smaller where there's a bubble under him or the screen is short. */
.home-klaus {
  position: relative;
  flex: 1 1 0;
  align-self: stretch;
  min-height: 140px;
  max-height: 432px;
  margin-block: auto;
}

/* Two stacked pictures, like the face: one visible at a time, so there's no flash on swap. */
.home-klaus-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  visibility: hidden;
}

.home-klaus[data-expression="default"] .home-klaus-img[data-expression="default"],
.home-klaus[data-expression="blinking"] .home-klaus-img[data-expression="blinking"] {
  visibility: visible;
}

/* A new user's home: the title and line under Klaus, with 24px above and below. */
.intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  width: 100%;
  max-width: 560px;
  align-self: center;
  padding-block: 24px;
  text-align: center;
}

/* Klaus's speech bubbles: a carousel as wide as the screen, one whole bubble per slide. The
   top padding of a slide is the room for the bubble's point; the side padding puts bubbles
   32px apart. A bubble is an outlined white shape (a 1px border, no shadow) with a point
   towards Klaus. */
.bubble-block {
  flex-shrink: 0;
  align-self: stretch;
  margin-inline: -16px;
}

.bubble-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.bubble-track::-webkit-scrollbar {
  display: none;
}

.bubble-slide {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 100%;
  padding: 16px 16px 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.bubble {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  max-width: 370px;
  margin-inline: auto;
}

.bubble-card {
  box-sizing: border-box;
  flex: 1;
  min-width: 0;
  min-height: 136px;
  padding: 24px;
  border-radius: 38px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border); /* until squircle.js draws the shape and its outline */
  overflow-wrap: anywhere;
}

/* The point towards Klaus: the shape from the design's bubble outline (its fill covers the
   card's border between its two ends). */
.bubble::before {
  content: "";
  position: absolute;
  top: -15.19px;
  left: calc(50% - 36.127px);
  width: 72.254px;
  height: 16.193px;
  background: url("assets/icons/bubble-point.svg") no-repeat center / 100% 100%;
}

.bubble-title,
.bubble-text {
  margin: 0;
}

.bubble-title {
  color: var(--text);
  font: var(--text-title);
  letter-spacing: var(--letter-spacing-title);
}

.bubble-text {
  color: var(--text-secondary);
  font: var(--text-body-large-regular);
}

.bubble-slide .skeleton-bar:nth-of-type(1) {
  width: 45%;
}

.bubble-slide .skeleton-bar:nth-of-type(2) {
  width: 100%;
}

.bubble-slide .skeleton-bar:nth-of-type(3) {
  width: 70%;
}

/* 8px dots, 4px apart, 16px under the bubble. The row is 8px tall as in the design; the
   buttons are bigger than their dots, to be easy to hit, and reach out over the space around. */
.bubble-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 8px;
  margin-top: 16px;
}

.bubble-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 12px;
  height: 24px;
  margin-block: -8px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.bubble-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 32px;
  background: var(--color-gray-10);
}

.bubble-dot[aria-current="true"]::before {
  background: var(--action-bg);
}

.response-text {
  width: 100%;
  max-width: 560px;
  color: var(--text);
  font: var(--text-body-large-regular);
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.response-text.enter {
  animation: response-in 200ms ease forwards;
}

.response-text.leave {
  animation: response-out 200ms ease forwards;
}

@keyframes response-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes response-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.error-banner {
  max-width: 560px;
  background: var(--error-bg);
  color: var(--error-text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.chat-turn {
  width: 100%;
}

/* The start and end-of-session screens: a title and text next to Klaus. */
.screen-message {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 560px;
  overflow-wrap: anywhere;
}

.screen-title {
  margin: 0;
  color: var(--text);
  font: var(--text-title);
  letter-spacing: var(--letter-spacing-title);
}

.screen-lead {
  margin: 0;
  color: var(--text);
  font: var(--text-body-large-regular);
  white-space: pre-wrap;
}

/* While Klaus is thinking, or writing a summary: three bars where his lines will be. */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.skeleton-bar {
  height: 16px;
  border-radius: 32px;
  background: var(--color-gray-10);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-lines {
  max-width: 560px;
  padding-block: 8px;
}

.skeleton-bar:nth-of-type(2) {
  width: 74.32%; /* 275 of 370 */
}

.skeleton-bar:nth-of-type(3) {
  width: 87.84%; /* 325 of 370 */
}

@keyframes skeleton-pulse {
  50% {
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar {
    animation: none;
  }
}

.screen-lead.is-secondary {
  color: var(--text-secondary);
}

.input-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}

/* The floating panels at the bottom (the text field and the word bank): translucent white
   with a blur, 32px top corners and a soft shadow all round, no border. */
.message-pill,
.tile-bank {
  border-radius: 32px 32px 0 0;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.12);
}

.message-pill {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin: 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}

.message-textarea {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  color: var(--text);
  font: var(--text-body-large-regular);
  resize: none;
  max-height: 138px; /* five lines */
  overflow-y: auto;
  padding: 4px 0;
}

.message-textarea::placeholder {
  color: var(--text-disabled);
  opacity: 1;
}

.message-textarea:focus {
  outline: none;
}

.send-fab {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--action-bg-disabled);
  color: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.send-fab:not(:disabled) {
  background: var(--action-bg);
}

.send-fab:disabled {
  cursor: not-allowed;
}

/* ---------- Word tiles (tile exercises) ---------- */
/* Klaus's message ends with a bank of words at the bottom of the screen. Tapping one moves it
   under the message, where the sentence is built; tapping it there sends it back, and the
   tiles in the sentence can be dragged into a different order. The tiles are 42px tall
   (26px text, 8px above and below); the chosen ones have a 0.5px outline, drawn inside. */
.tiles {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.tile {
  padding: 8px 16px;
  border: none;
  border-radius: 32px;
  background: var(--color-gray-10);
  color: var(--text);
  font: var(--text-body-large-regular);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tile:disabled {
  cursor: not-allowed;
}

/* Chosen words: white with a thin outline, and draggable (so no touch scrolling from them). */
.sentence-tiles .tile {
  background: var(--bg);
  box-shadow: inset 0 0 0 0.5px var(--border);
  touch-action: none;
  cursor: grab;
}

.sentence-tiles .tile.is-dragging {
  position: relative;
  z-index: 3;
  cursor: grabbing;
  box-shadow: inset 0 0 0 0.5px var(--border), 0 0 16px rgba(0, 0, 0, 0.06);
}

/* The bank sits in a panel like the one the text field has (see "The floating panels"),
   with the home indicator's room below. */
.tile-bank {
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}

/* Under Klaus's message: a full-width rule 33px below the text, then the chosen words. */
.sentence {
  width: 100%;
  margin-top: 9px; /* the area's 24px gap plus this */
}

.sentence-rule {
  height: 1px;
  margin-inline: -16px; /* edge to edge, out of the area's padding */
  background: var(--color-gray-10);
}

.sentence-tiles {
  margin-top: 31px;
}

/* Under the home and end screens there's only a button, 16px from the sides: "Done" sits just
   above the home indicator, "Start chat" has 24px under it as well. */
.start-panel {
  padding: 0 16px max(16px, env(safe-area-inset-bottom, 0px));
}

#main-screen[data-screen="start"] .start-panel {
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
}

.home-pill {
  box-sizing: border-box;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 32px;
  background: var(--color-gray-10);
  color: var(--text);
  font: var(--text-body-large-medium);
  white-space: nowrap;
  cursor: pointer;
}

/* "Start chat": the full width of the panel, 50px. */
.home-pill-dark {
  width: 100%;
  height: 50px;
  padding: 0 24px;
  border: none;
  background: var(--action-bg);
  color: var(--color-white);
}

.home-pill-dark:disabled {
  background: var(--action-bg-disabled);
  cursor: not-allowed;
}

/* The streak is a label, not a button: lightning bolt and the number of days. */
.home-pill-streak {
  height: 42px;
  padding: 0 16px 0 8px;
  cursor: default;
}

/* The profile button: a 40px circle around the person glyph. */
.home-pill-icon {
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
}

.home-pill-signup {
  height: 40px;
  margin-left: auto;
  padding: 0 16px;
  font: var(--text-body-medium-medium);
}

.start-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 24px;
  background: var(--color-gray-100);
  color: var(--color-white);
  font: var(--text-body-medium-medium);
  cursor: pointer;
}

.start-btn:disabled {
  background: var(--action-bg-disabled);
  cursor: not-allowed;
}

/* ---------- "You" dialog ---------- */

.you-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(18, 22, 25, 0.4);
}

.you-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 370px;
  height: 100%;
  max-height: 750px;
  border-radius: 32px;
  background: var(--surface);
  overflow: hidden;
}

.you-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--color-gray-10);
}

/* 40px icon buttons: the icon files draw their own gray circles. */
.you-icon-btn {
  display: flex;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.you-icon-btn img {
  display: block;
}

.you-close-btn {
  margin-left: auto;
}

.you-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Sign in / sign up steps and other forms ---------- */

.you-form {
  justify-content: space-between;
  gap: 24px;
  padding: 24px 16px;
  overflow-y: auto;
}

.you-form-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.you-klaus {
  display: block;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
}

.you-intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-wrap: anywhere;
}

.you-title {
  margin: 0;
  color: var(--text);
  font: var(--text-title);
  letter-spacing: var(--letter-spacing-title);
}

.you-body {
  margin: 0;
  color: var(--text-secondary);
  font: var(--text-body-medium-regular);
}

/* A filled text field whose label floats up while it's focused or filled. */
.field {
  position: relative;
  display: block;
  flex-shrink: 0;
  height: 56px;
  border-radius: 8px;
  background: var(--color-gray-10);
  cursor: text;
}

.field:focus-within {
  box-shadow: inset 0 0 0 1px var(--action-bg);
}

.field-label {
  position: absolute;
  left: 16px;
  top: 16px;
  color: var(--text-disabled);
  font: var(--text-body-medium-regular);
  letter-spacing: 0;
  pointer-events: none;
  transition:
    top 120ms ease,
    font-size 120ms ease,
    line-height 120ms ease,
    letter-spacing 120ms ease;
}

.field:focus-within .field-label,
.field:has(input:not(:placeholder-shown)) .field-label {
  top: 8px;
  color: var(--color-gray-100);
  font: var(--text-caption-medium);
  letter-spacing: var(--letter-spacing-caption);
}

.field input {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text);
  font: var(--text-body-medium-regular);
}

.field input:focus {
  outline: none;
}

/* There's no error color in the design (see "Known gap" in CLAUDE.md). */
.you-error {
  margin: -8px 0 0;
  color: var(--text);
  font: var(--text-body-small-regular);
}

/* Small quiet actions under a form's fields ("Forgot password?", "Send a new code"). Not in Figma. */
.you-link {
  align-self: flex-start;
  margin: -8px 0 0;
  padding: 8px 0;
  border: none;
  background: none;
  color: var(--text-secondary);
  font: var(--text-body-medium-medium);
  text-decoration: underline;
  cursor: pointer;
}

.you-link:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
  text-decoration: none;
}

.you-note {
  margin: -8px 0 0;
  color: var(--text-secondary);
  font: var(--text-body-small-regular);
}

.you-button {
  flex-shrink: 0;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 24px;
  background: var(--color-gray-100);
  color: var(--color-white);
  font: var(--text-body-medium-medium);
  cursor: pointer;
}

.you-button:disabled {
  background: var(--action-bg-disabled);
  cursor: not-allowed;
}

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

/* ---------- Profile ---------- */

.you-profile {
  gap: 24px;
  padding: 24px 16px;
  overflow-y: auto;
}

/* The profile and the screens under it have no rule below the close and back buttons. */
.you-sheet[data-view="profile"] .you-header,
.you-sheet[data-view="newemail"] .you-header,
.you-sheet[data-view="password"] .you-header,
.you-sheet[data-view="logout"] .you-header,
.you-sheet[data-view="delete"] .you-header {
  border-bottom: none;
}

.profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  overflow-wrap: anywhere;
}

/* 64px circle around the 32px person glyph. */
.profile-avatar {
  display: flex;
  padding: 16px;
  border-radius: 32px;
  background: var(--color-gray-10);
}

.profile-rule {
  flex-shrink: 0;
  width: 100%;
  height: 0;
  margin: 0;
  border: none;
  border-top: 1px solid var(--color-gray-10);
}

.profile-note {
  margin: -8px 0 0;
  color: var(--text-secondary);
  font: var(--text-body-small-regular);
  text-align: center;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

/* "Delete account" sits at the foot of the sheet. */
.profile-cell-last {
  margin-top: auto;
}

.profile-cell img {
  flex-shrink: 0;
}

/* 12px between a row's icon and its text, 16px before the chevron. */
.profile-cell img:last-child {
  margin-left: 4px;
}

.profile-cell-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.profile-cell-primary {
  font: var(--text-body-medium-medium);
}

/* ---------- Chat history ---------- */

.history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 16px 32px;
}

.history-date {
  align-self: center;
  display: inline-flex;
  align-items: center;
  height: 29px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font: var(--text-body-small-medium);
}

.history-date:not(:first-child) {
  margin-top: 16px;
}

.history-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.history-avatar,
.history-avatar-spacer {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

.history-avatar {
  border-radius: 50%;
}

/* The learner's thumbnail is their initial. */
.history-avatar.is-user {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--action-bg);
  color: var(--color-gray-10);
  font: var(--text-body-medium-medium);
}

.history-bubble {
  min-width: 0;
  padding: 12px;
  border-radius: 24px 24px 24px 0;
  background: var(--color-gray-10);
  color: var(--text);
  font: var(--text-body-medium-regular);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Smoothed corners (squircle.js) ---------- */
/* The designs use Figma's corner smoothing (66%). Safari has no CSS for it, so squircle.js
   paints the shape as a background; these say what each container is painted with. */
.you-sheet {
  --sq-fill: var(--surface);
}

.bubble-card {
  --sq-fill: var(--bg);
  --sq-stroke: var(--border);
}

.message-pill,
.tile-bank {
  --sq-fill: rgba(255, 255, 255, 0.88);
}

.history-bubble {
  --sq-fill: var(--color-gray-10);
}

.field {
  --sq-fill: var(--color-gray-10);
  --sq-focus-stroke: var(--action-bg);
}

/* Once the shape is drawn, the element's own (circular) background, border and shadow go. */
.sq-on.sq-on {
  background-color: transparent;
  background-image: var(--sq-image);
  background-repeat: no-repeat;
  background-origin: border-box;
  background-clip: border-box;
  background-size: 100% 100%;
  border-color: transparent;
  box-shadow: none;
}

.field.sq-on.sq-on:focus-within {
  background-image: var(--sq-image-focus);
}

/* A shadow that follows the drawn shape (16px box-shadow blur = 8px here). */
.message-pill.sq-on,
.tile-bank.sq-on {
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.12));
}
