/* ==========================================================================
   LBE Tutors — app.css
   Palette and type are lifted from the La Bonne Education website so the app
   and the site read as one brand.
   ========================================================================== */

:root {
  --blue:      #387d9f;
  --blue-dark: #2c6480;
  --blue-soft: #eaf3f6;
  --cream:     #fffff8;
  --coral:     #ff5620;
  --amber:     #ff9800;
  --sky:       #b0e0e6;
  --mint:      #cfeced;
  --ink:       #272324;
  --grey:      #6b6f72;
  --line:      #dbe6ea;
  --green:     #1d8f5e;
  --green-bg:  #e4f5ec;
  --red:       #c2341c;
  --red-bg:    #fdeae5;

  --font-display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Nunito Sans", "Segoe UI", system-ui, sans-serif;

  --r-card: 16px;
  --r-pill: 100px;
  --shadow: 0 2px 10px rgba(56, 125, 159, .09);
  --tabbar: 66px;
  --column: 720px;   /* width of the content column on wide screens */

  /* Notch and gesture-bar insets, so the app sits right once installed. */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

/* --------------------------------------------------------------- LOGO ---- */

/* Lifted verbatim from the La Bonne Education website (.lbe-logo there), down
   to the em offsets of the graduation cap, so the app and the site show the
   same mark rather than two things that nearly match. Size is set by
   --logo-size on whoever uses it. */

.lbe-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1;
  font-family: var(--font-display);
}
.lbe-logo__mark {
  position: relative;
  display: block;
  height: 0.86em;
  font-size: var(--logo-size, 46px);
  font-weight: 800;
  letter-spacing: -0.06em;
  white-space: nowrap;
  /* The site's wordmark is set in lowercase but displayed uppercase. */
  text-transform: uppercase;
}
.lbe-logo__mark .l { color: var(--logo-l, var(--amber)); }
.lbe-logo__mark .b { color: var(--logo-b, var(--coral)); margin-left: -0.09em; }
.lbe-logo__mark::after {
  content: "";
  position: absolute;
  right: -0.10em;
  top: -0.30em;
  width: 0.60em;
  height: 0.44em;
  background: url("../img/logo-cap.svg") no-repeat center / contain;
  transform: rotate(-9deg);
  pointer-events: none;
}
.lbe-logo__word {
  display: block;
  font-size: calc(var(--logo-size, 46px) * 0.212);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--logo-word, var(--amber));
}
/* On the blue app bar the letters go cream; the cap keeps its dark outline,
   which still reads against cream fill. */
.lbe-logo--light { --logo-l: var(--cream); --logo-b: var(--cream); --logo-word: var(--cream); }

html, body {
  margin: 0;
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--blue);
}

p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

.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;
}

/* ------------------------------------------------------------- LAYOUT ---- */

#app { min-height: 100%; display: flex; flex-direction: column; }

/* The bar spans the window, but its contents line up with the content column
   so the app does not look stretched on a laptop. */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: calc(var(--safe-top) + 12px) 12px;
  padding-inline: max(16px, calc((100% - var(--column)) / 2));
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}
.appbar h1 { color: #fff; font-size: 19px; flex: 1; min-width: 0; }
.appbar .sub { display: block; font: 400 12px/1.3 var(--font-body); opacity: .82; letter-spacing: 0; }

.iconbtn {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff; cursor: pointer;
}
.iconbtn:active { background: rgba(255, 255, 255, .3); }
.iconbtn svg { width: 20px; height: 20px; }

.screen {
  flex: 1;
  padding: 18px 16px calc(var(--tabbar) + var(--safe-bottom) + 26px);
  max-width: var(--column);
  width: 100%;
  margin-inline: auto;
}
.screen--flush { padding-bottom: calc(var(--safe-bottom) + 26px); }

/* ------------------------------------------------------------ TAB BAR ---- */

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 30;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding-bottom: var(--safe-bottom);
  padding-inline: max(0px, calc((100% - var(--column)) / 2));
  background: #fff;
  border-top: 1px solid var(--line);
}
.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--tabbar);
  border: 0;
  background: none;
  color: var(--grey);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.tabbar svg { width: 22px; height: 22px; }
.tabbar button[aria-current="page"] { color: var(--blue); }

/* -------------------------------------------------------------- CARDS ---- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card--tap { cursor: pointer; transition: transform .12s ease; text-align: left; width: 100%; }
.card--tap:active { transform: scale(.985); }

.card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.card__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--blue); }
.card__code { font-size: 12px; font-weight: 700; color: var(--grey); letter-spacing: .04em; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--grey);
  margin-top: 8px;
}
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta svg { width: 14px; height: 14px; flex: none; opacity: .7; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  padding: 3px 11px;
  border-radius: var(--r-pill);
  background: var(--mint);
  color: var(--blue-dark);
  font-size: 12.5px;
  font-weight: 700;
}
.chip--ghost { background: var(--blue-soft); }

.badge {
  flex: none;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: capitalize;
  background: var(--blue-soft);
  color: var(--blue-dark);
}
.badge--open      { background: var(--mint);    color: var(--blue-dark); }
.badge--matching  { background: #fff2df;        color: #a35c00; }
.badge--assigned  { background: var(--green-bg); color: var(--green); }
.badge--closed,
.badge--cancelled { background: #eceff0;        color: var(--grey); }
.badge--applied     { background: var(--blue-soft); color: var(--blue-dark); }
.badge--shortlisted { background: #fff2df;        color: #a35c00; }
.badge--accepted    { background: var(--green-bg); color: var(--green); }
.badge--rejected    { background: var(--red-bg);   color: var(--red); }
.badge--verified    { background: var(--green-bg); color: var(--green); }

/* -------------------------------------------------------------- FORMS ---- */

.field { margin-bottom: 14px; }
.field > label,
.fieldset > legend {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--blue-dark);
}
.req { color: var(--coral); }
.hint { display: block; margin-top: 5px; font-size: 12.5px; color: var(--grey); }

input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23387d9f' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}
textarea { min-height: 96px; resize: vertical; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 1px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Multi-select rendered as tappable pills — far kinder on a phone than a
   native multiple <select>. */
.pillset { display: flex; flex-wrap: wrap; gap: 8px; }
.pillset input { position: absolute; opacity: 0; pointer-events: none; }
.pillset label {
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.pillset input:checked + label {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.pillset input:focus-visible + label { outline: 3px solid var(--sky); }

/* ------------------------------------------------------------ BUTTONS ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 22px;
  border: 2px solid var(--blue);
  border-radius: var(--r-pill);
  background: var(--blue);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn--ghost { background: transparent; color: var(--blue); }
.btn--coral { background: var(--coral); border-color: var(--coral); }
/* Slim buttons sit side by side in a .btnrow, so their labels must not break
   mid-phrase — a button reading "Mark / as / taught" over three lines looks
   broken. Too wide for the row and it simply takes the next line instead. */
.btn--slim  { width: auto; padding: 9px 18px; font-size: 13.5px; border-width: 1.5px; white-space: nowrap; }
.btn--danger { background: transparent; border-color: var(--red); color: var(--red); }

.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar) + var(--safe-bottom) + 16px);
  z-index: 25;
  width: auto;
  padding: 13px 20px;
  font-size: 14.5px;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(255, 86, 32, .38);
}
.fab svg { width: 18px; height: 18px; }

/* --------------------------------------------------------- STRUCTURE ----- */

.section-title {
  margin: 22px 0 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--grey);
}
.section-title:first-child { margin-top: 0; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 520px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 14px;
  box-shadow: var(--shadow);
}
.stat b { display: block; font-family: var(--font-display); font-size: 26px; color: var(--blue); }
.stat span { font-size: 12.5px; color: var(--grey); font-weight: 600; }

.dl { display: grid; grid-template-columns: 118px 1fr; gap: 8px 12px; font-size: 14.5px; }
.dl dt { color: var(--grey); font-weight: 600; }
.dl dd { margin: 0; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.filters select { width: auto; flex: none; padding: 9px 34px 9px 13px; font-size: 14px; border-radius: var(--r-pill); }

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--grey);
}
.empty svg { width: 54px; height: 54px; opacity: .35; margin: 0 auto 12px; }
.empty h3 { font-size: 17px; margin-bottom: 6px; }

.notice {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 14px;
}
.notice--err  { background: var(--red-bg);   color: var(--red); }
.notice--ok   { background: var(--green-bg); color: var(--green); }
.notice--info { background: var(--blue-soft); color: var(--blue-dark); }

.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ------------------------------------------------------------ WELCOME ---- */

.hero { text-align: center; padding: 12px 4px 22px; }
.hero h2 {
  font-size: clamp(23px, 5.6vw, 30px);
  margin-bottom: 10px;
}
.hero p { color: var(--grey); font-size: 15px; max-width: 44ch; margin-inline: auto; }

.hero__photo {
  border-radius: var(--r-card);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  background: var(--mint);
  aspect-ratio: 8 / 5;
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; }

.choice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 16px;
}
.choice__icon {
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--mint);
  color: var(--blue-dark);
}
.choice__icon svg { width: 23px; height: 23px; }
.choice strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--blue);
  margin-bottom: 3px;
}
.choice small { color: var(--grey); font-size: 13.5px; line-height: 1.5; display: block; }

/* ---------------------------------------------------------- ONBOARDING --- */

.auth {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--safe-top) + 32px) 22px calc(var(--safe-bottom) + 32px);
  max-width: 460px;
  margin-inline: auto;
}
.auth__logo { display: flex; justify-content: center; margin-bottom: 18px; }
.auth h2 { text-align: center; font-size: 26px; margin-bottom: 6px; }
.auth__lede { text-align: center; color: var(--grey); margin-bottom: 24px; font-size: 15px; }
.auth__switch { text-align: center; margin-top: 18px; font-size: 14.5px; color: var(--grey); }
.auth__switch button {
  border: 0; background: none; padding: 0;
  color: var(--coral); font-weight: 800; cursor: pointer;
}
/* Signed out, the auth screen sits above the tab bar rather than replacing it. */
.auth--tabbed { padding-bottom: calc(var(--tabbar) + var(--safe-bottom) + 26px); }

.rolepick { display: grid; gap: 10px; margin-bottom: 18px; }
.rolepick input { position: absolute; opacity: 0; pointer-events: none; }
.rolepick label {
  display: block;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: var(--r-card);
  background: #fff;
  cursor: pointer;
}
.rolepick strong { display: block; font-family: var(--font-display); color: var(--blue); }
.rolepick small { color: var(--grey); font-size: 13px; }
.rolepick input:checked + label { border-color: var(--coral); background: #fff6f2; }

/* --------------------------------------------------- PHOTOS & FILES ------ */

/* Name and face travel together in a card header. */
.who { display: flex; align-items: center; gap: 11px; min-width: 0; }

.avatar {
  position: relative;
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--mint);
  color: var(--blue-dark);
}
.avatar b { font-family: var(--font-display); font-size: 15px; letter-spacing: -.02em; }
/* The photo covers the initials once its bytes arrive. */
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.avatar--blank img { display: none; }

.doclist { display: grid; gap: 8px; margin-bottom: 14px; }
.doc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.doc__icon {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue-dark);
}
.doc__icon svg { width: 17px; height: 17px; }
.doc__text { flex: 1; min-width: 0; }
.doc__text strong { display: block; font-family: var(--font-display); font-size: 14.5px; color: var(--blue); }
.doc__text small { display: block; font-size: 12.5px; color: var(--grey); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.iconbtn--quiet { width: 34px; height: 34px; background: var(--blue-soft); color: var(--blue-dark); }
.iconbtn--quiet:active { background: var(--mint); }
.iconbtn--danger { background: var(--red-bg); color: var(--red); }
.iconbtn--quiet svg { width: 17px; height: 17px; }

input[type="file"] {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
}
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 700;
  cursor: pointer;
}

/* Documents open over the app rather than in a browser tab, so an installed
   app never has to hand the person back to Safari or Chrome. */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: rgba(39, 35, 36, .93);
  padding: var(--safe-top) 0 var(--safe-bottom);
}
.viewer__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.viewer__bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer__bar .iconbtn { text-decoration: none; }
.viewer img { flex: 1; width: 100%; min-height: 0; object-fit: contain; }
.viewer iframe { flex: 1; width: 100%; border: 0; background: #fff; }

.viewer--plain { justify-content: center; padding: 20px; }
.linkcard { width: 100%; max-width: 420px; margin: 0 auto; }
.linkcard h3 { font-size: 17px; margin-bottom: 8px; }
.linkcard textarea { min-height: 0; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ------------------------------------------------------------- MISC ------ */

.spinner {
  width: 26px; height: 26px;
  margin: 40px auto;
  border: 3px solid var(--mint);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + var(--safe-bottom) + 22px);
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(92vw, 440px);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .25);
  animation: rise .25s ease;
}
.toast--err { background: var(--red); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ===========================================================================
   The tutor's own side of the app: a home screen that opens on money and the
   next lesson, a calendar, and a conversation. Everything below reuses the
   palette above — nothing here introduces a colour of its own.
   =========================================================================== */

/* ------------------------------------------------------- HOME HEADER ----- */

/* Taller than a plain appbar and carrying a greeting rather than a screen
   title, because this is the first thing a tutor sees each day. */
.appbar--hub {
  /* Not sticky, unlike every other appbar: the wallet card is pulled up over
     this one, and a sticky header would paint on top of it and swallow the
     card's first line. A dashboard header is happy to scroll away.

     `z-index: auto` is not redundant. These bars are flex items of #app, and a
     flex item's z-index applies even when it is not positioned — so .appbar's
     `z-index: 20` would keep stacking this header above the card and hide its
     first line, static or not. */
  position: static;
  z-index: auto;
  padding-block: calc(var(--safe-top) + 18px) 46px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  align-items: flex-start;
  border-radius: 0 0 26px 26px;
}
/* flow-root, not just padding-top:0 — otherwise the wallet card's negative top
   margin collapses out through this box and drags the whole screen up instead
   of lifting the card over the header. */
.screen--hub { padding-top: 0; display: flow-root; }
.greet { flex: 1; min-width: 0; }
.greet span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, .78);
}
.greet h1 { font-size: 25px; margin-top: 2px; }
.appbar--hub .badge { margin-top: 4px; flex: none; }
.appbar--hub .badge svg { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }

/* ----------------------------------------------------------- WALLET ------ */

/* Pulled up over the curved header so the first thing on the screen is the
   number a tutor opens the app for. */
.wallet {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -30px 0 18px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(56, 125, 159, .16);
}
.wallet__main { flex: 1; min-width: 0; }
.wallet__main span { display: block; font-size: 12.5px; font-weight: 700; color: var(--grey); }
.wallet__main b {
  display: block;
  margin: 2px 0 3px;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--coral);
}
.wallet__main small { display: block; font-size: 12.5px; color: var(--grey); }

.wallet__link {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.wallet__link svg { width: 20px; height: 20px; }

/* ------------------------------------------------------ QUICK ACTIONS ---- */

.quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
@media (max-width: 359px) { .quick { grid-template-columns: repeat(2, 1fr); } }

.quick__tile {
  /* Without this a grid item refuses to shrink below its longest word, and the
     four tiles push the row wider than the screen. */
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 6px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: center;
}
.quick__tile:active { transform: scale(.97); }
.quick__icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 14px;
  background: var(--mint);
  color: var(--blue-dark);
}
.quick__icon svg { width: 21px; height: 21px; }
.quick__tile strong {
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--blue);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.quick__tile small {
  font-size: 11px;
  color: var(--grey);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ----------------------------------------------------------- TILES ------- */

/* The money row. Two across on a phone, four on anything wider, so a laptop
   does not show one tall column of almost-empty cards. */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

.tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 14px;
}
.tile b {
  display: block;
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--blue);
  overflow-wrap: anywhere;
}
.tile span { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--grey); }
/* The one number that matters most on each screen. */
.tile--coral { background: #fff6f2; border-color: #ffd9c9; }
.tile--coral b { color: var(--coral); }

/* ------------------------------------------------- SEGMENTED CONTROL ----- */

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--blue-soft);
  border-radius: var(--r-pill);
}
.seg button {
  border: 0;
  border-radius: var(--r-pill);
  padding: 9px 12px;
  background: none;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.seg button[aria-current="true"] { background: #fff; box-shadow: var(--shadow); color: var(--blue); }

/* --------------------------------------------------------- LESSONS ------- */

.lesson--off { opacity: .6; }
.lesson--off .card__title { text-decoration: line-through; }

.badge--awaiting_payment { background: var(--red-bg); color: var(--red); }
.badge--scheduled { background: var(--blue-soft);  color: var(--blue-dark); }
.badge--done      { background: #fff2df;           color: #a35c00; }
.badge--paid      { background: var(--green-bg);   color: var(--green); }

/* ------------------------------------------------------------ CHAT ------- */

.thread { display: block; }
.thread__at { font-size: 12px; font-weight: 700; color: var(--grey); flex: none; }
.thread__last {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--grey);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Room for the composer as well as the tab bar. */
.screen--chat { padding-bottom: calc(var(--tabbar) + var(--safe-bottom) + 86px); }

.bubbles { display: flex; flex-direction: column; gap: 10px; }

.bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  align-self: flex-start;
}
.bubble b { display: block; font-size: 12px; font-weight: 700; color: var(--grey); margin-bottom: 2px; }
.bubble p { margin: 0; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble time { display: block; margin-top: 4px; font-size: 11px; color: var(--grey); }

.bubble--mine {
  align-self: flex-end;
  border-radius: 16px 16px 4px 16px;
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.bubble--mine time { color: rgba(255, 255, 255, .75); }

/* The agency speaking in somebody else's thread should never be mistaken for
   the other party. */
.bubble--agency { background: #fff6f2; border-color: #ffd9c9; }
.bubble--agency b { color: var(--coral); }

.composer {
  position: fixed;
  inset: auto 0 calc(var(--tabbar) + var(--safe-bottom)) 0;
  z-index: 25;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px max(16px, calc((100% - var(--column)) / 2));
  background: #fff;
  border-top: 1px solid var(--line);
}
.composer textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: var(--cream);
  resize: none;
}
.composer textarea:focus { outline: none; border-color: var(--blue); }
.composer .iconbtn { background: var(--coral); }

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

/* ---------------------------------------------------- Nearest MRT picker */
.mrt-field { position: relative; }
.mrt-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px;
  list-style: none; background: #fff; border: 2px solid var(--coral); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .16); max-height: 280px; overflow-y: auto;
}
.mrt-list [role="option"] {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 9px 11px; border-radius: 8px; cursor: pointer; font-size: 14.5px;
}
.mrt-list [role="option"]:hover, .mrt-list .is-active { background: #fff6f2; }
.mrt-list small { color: var(--grey); font-size: 12px; }
.mrt-list .mrt-group {
  padding: 8px 11px 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--blue);
}
.mrt-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mrt-chosen:empty { display: none; }
.chip__x { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 4px; color: inherit; }
[hidden] { display: none !important; }

/* Delete my account (Account screen) */
.danger-zone { border-color: var(--red-bg); margin-top: 22px; }
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--red); list-style: revert; }
.danger-zone[open] summary { margin-bottom: 10px; }
.danger-zone form { margin-top: 12px; }
/* Back button on sign-in style screens (they have no app bar) */
.auth { position: relative; }
.auth__back { position: absolute; top: 12px; left: 12px; background: var(--blue-soft); color: var(--blue); }
