:root {
  --paper: #ffffff;
  --ink: #111214;
  --soft: #6d6e74;
  --faint: #a4a5ab;
  --line: rgba(17, 18, 20, 0.08);
  --chip: #f2f2f4;
  --accent: #3d5afe;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.toast { width: min(372px, calc(100vw - 32px)); }
/* the card: GSAP moves and scales this element; the CSS shadow lives on it too */
.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(17, 18, 20, 0.04), 0 14px 34px -18px rgba(17, 18, 20, 0.28);
  transition: box-shadow 0.35s ease;
  will-change: transform;
}
@media (hover: hover) {
  .card:hover { box-shadow: 0 1px 2px rgba(17, 18, 20, 0.05), 0 20px 40px -18px rgba(17, 18, 20, 0.34); }
}
.head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 14px;
}
.av {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--chip);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-stretch: 105%;
}
.txt { flex: 1; min-width: 0; }
.meta { display: flex; align-items: baseline; gap: 8px; }
.name { font-size: 14px; font-weight: 620; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when {
  position: relative;
  display: inline-flex;
  overflow: hidden;
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}
.when > span { display: inline-flex; align-items: center; gap: 3px; }
.when svg { width: 13px; height: 13px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msg {
  position: relative;
  overflow: hidden;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--soft);
  white-space: nowrap;
}
.msg > span { display: block; overflow: hidden; text-overflow: ellipsis; }
.msg .you { color: var(--faint); }
.reply {
  flex: none;
  appearance: none;
  border: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  will-change: transform;
}
.reply__label { display: inline-block; }
@media (hover: hover) {
  .reply:hover { background: #e7e7ea; }
}
.reply[aria-expanded="true"] { background: var(--ink); color: #ffffff; }
.reply:focus-visible, .send:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.drawer { height: 0; overflow: hidden; }
.drawer__in { padding: 0 14px 14px 64px; position: relative; }
.rule {
  display: block;
  height: 1px;
  background: var(--line);
  transform-origin: 0 50%;
  margin-bottom: 12px;
}
.field { display: flex; align-items: center; gap: 8px; }
.field__box {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 36px;
  border-radius: 12px;
  background: var(--chip);
  transition: box-shadow 0.25s ease;
}
.field__box:focus-within { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.field__input {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  caret-color: var(--accent);
}
.field__input::placeholder { color: var(--faint); }
/* the mirror measures the typed text, so the drawn caret can follow it while the field types by itself */
.field__mirror {
  position: absolute;
  left: 12px;
  top: 0;
  visibility: hidden;
  white-space: pre;
  font-size: 14px;
}
.field__caret {
  position: absolute;
  left: 11.5px;
  top: 9px;
  width: 1.5px;
  height: 18px;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}
.send {
  flex: none;
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}
.send:disabled { cursor: default; }
.send__body {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e4e4e8;
  overflow: hidden;
  transition: background-color 0.25s ease;
  will-change: transform;
}
.send:not(:disabled) .send__body { background: var(--accent); box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.send svg { width: 18px; height: 18px; fill: none; stroke: #ffffff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.tick-src { position: absolute; }

@media (max-width: 380px) {
  .head { gap: 10px; padding: 12px; }
  .drawer__in { padding: 0 12px 12px 60px; }
  .name, .msg { font-size: 13.5px; }
}
