:root {
  --paper: #f4ece4;
  --ink: #241816;
  --muted: #8d736b;
  --rose: #d81e45;
  --rose-deep: #a11232;
  --card: #fffdfb;
  --line: #eadfd6;
  --shadow: 0 10px 30px rgba(60, 32, 24, 0.06);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
  line-height: 1.4;
}

img { max-width: 100%; }

a { color: inherit; }

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

::selection { background: #f8c9d2; }

.phone { min-height: 100dvh; }

.logo, .mark {
  font-family: var(--serif);
  font-weight: 560;
  font-style: italic;
  letter-spacing: -0.03em;
}

.logo {
  font-size: 4.5rem;
  line-height: 0.9;
  margin: 0;
}

.mark {
  font-size: 1.45rem;
  text-decoration: none;
  justify-self: center;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--rose-deep);
}

.who { padding: 18vh 22px 32px; }

.tag, .lede {
  color: #5c463f;
  font-size: 1.05rem;
  margin: 12px 0 0;
}

.who-card {
  width: 100%;
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
  background: var(--card);
  border: 0;
  border-radius: 22px;
  padding: 16px;
  margin-top: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.who-card strong { display: block; font-size: 1.3rem; }

.who-card em {
  color: var(--muted);
  font-style: normal;
}

.who-card:active { transform: scale(0.985); }

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-style: italic;
  flex: none;
}

.arianne .avatar { background: var(--rose); }
.ivan .avatar { background: #3a2924; }

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 8px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}

.back, .bar-action {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.bar-action { justify-self: end; color: var(--rose-deep); }

.pad, .profile { padding: 4px 18px 48px; }

.hello {
  margin: 10px 0 0;
  color: var(--muted);
}

.page-title {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 2.15rem;
  letter-spacing: -0.03em;
  margin: 2px 0 0;
  line-height: 1.05;
}

.kicker {
  margin: 28px 2px 10px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose-deep);
  font-weight: 600;
}

.stack { margin-top: 14px; }

.rowcard {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-radius: 20px;
  padding: 10px;
  margin: 10px 0;
  box-shadow: var(--shadow);
}

.rowmain {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.thumb {
  width: 58px;
  height: 74px;
  border-radius: 14px;
  background: #f0e4dc;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--rose);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rowtext { min-width: 0; display: block; }

.rowtext strong { display: block; }

.rowtext em {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-style: italic;
  font-family: var(--serif);
}

.count {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.chip-btn {
  display: inline-block;
  flex: none;
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--ink);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
}

.waiting {
  margin: 10px 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}

.footer {
  color: var(--muted);
  text-align: center;
  margin: 32px 0 0;
  font-size: 0.85rem;
}

.flash {
  margin: 8px 0 12px;
  background: white;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.flash.bad { background: #fde8ec; }

.editor { padding: 4px 18px 28px; }

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  appearance: none;
}

input::placeholder,
textarea::placeholder { color: #c4b2aa; }

textarea { resize: none; }

input:focus,
textarea:focus,
select:focus { outline: none; }

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

.sheet {
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(36, 24, 22, 0.04), 0 10px 28px rgba(60, 32, 24, 0.05);
}

.sheet-row {
  display: block;
  padding: 11px 16px 12px;
  border-bottom: 1px solid #f3e8e1;
}

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

.sheet-row > span {
  display: block;
  margin: 0 0 1px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sheet-row input,
.sheet-row select {
  font-size: 1.05rem;
  line-height: 1.35;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  appearance: none;
}

.sheet-row select {
  color: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%238d736b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 22px;
}

.sheet-row:focus-within { box-shadow: inset 3px 0 0 var(--rose); }

.prompt-edit {
  display: block;
  margin: 0 0 12px;
  background: var(--card);
  border-radius: 22px;
  padding: 16px 16px 12px;
  box-shadow: 0 1px 2px rgba(36, 24, 22, 0.04), 0 10px 28px rgba(60, 32, 24, 0.05);
}

.prompt-edit > span {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 560;
  letter-spacing: -0.02em;
  display: block;
  margin-bottom: 6px;
}

.prompt-edit textarea {
  min-height: 64px;
  line-height: 1.45;
  font-size: 1.02rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.prompt-edit:focus-within {
  box-shadow: 0 0 0 2px rgba(216, 30, 69, 0.45);
}

.caption {
  margin-top: 8px;
  background: var(--card);
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 1px var(--line);
}

.caption:focus { box-shadow: inset 0 0 0 1.5px var(--rose); }

.poll {
  border: 0;
  margin: 0;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #f3e8e1;
}

.poll legend {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

.pill { position: relative; }

.pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill span {
  display: inline-block;
  border-radius: 999px;
  padding: 7px 12px;
  background: #f6efe9;
  font-size: 0.92rem;
  cursor: pointer;
}

.pill:has(input:checked) span {
  background: var(--ink);
  color: white;
  box-shadow: none;
}

.clear {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 6px 0 0;
  font-size: 0.8rem;
  cursor: pointer;
}

.slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
  margin-top: 12px;
}

.slot:first-child { grid-column: 1 / -1; }

.slot-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, transparent 40%, rgba(36, 24, 22, 0.04)),
    #efe2d9;
}

.slot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.slot-frame.has img { display: block; }

.slot-add {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.slot-hint {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--muted);
}

.slot-frame.has .slot-hint { display: none; }

.file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.slot-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 10, 8, 0.72);
  color: white;
  padding: 6px 10px;
  cursor: pointer;
  display: none;
}

.slot-frame.has .slot-remove { display: block; }

.slot-frame.is-busy { opacity: 0.55; }

.slot-status {
  min-height: 1.1em;
  margin: 6px 2px 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.savebar {
  padding: 22px 0 calc(14px + env(safe-area-inset-bottom));
}

.primary {
  width: 100%;
  border: 0;
  background: var(--rose);
  color: white;
  border-radius: 999px;
  padding: 15px 18px;
  font-weight: 600;
  cursor: pointer;
}

.primary:disabled { opacity: 0.65; }

.byline {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.shot {
  margin: 14px 0;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  background: #1b1412;
}

.shot img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.shot figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 64px 16px 16px;
  color: white;
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1.2;
  background: linear-gradient(transparent, rgba(16, 8, 6, 0.78));
}

.ident h1 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 2.5rem;
  letter-spacing: -0.03em;
  margin: 8px 0 4px;
  line-height: 1.05;
}

.ident h1 span {
  color: var(--muted);
  font-weight: 500;
}

.meta, .from { margin: 0; color: #4d3b36; }

.prompt {
  background: var(--card);
  border-radius: 22px;
  padding: 18px 18px 20px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}

.prompt-q {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.prompt-a {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.22;
  letter-spacing: -0.02em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.vitals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.vital {
  margin: 0;
  background: var(--card);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
}

.nophoto {
  height: 240px;
  border-radius: 22px;
  margin-top: 8px;
  background:
    radial-gradient(circle at 30% 20%, #f8d5dc, transparent 45%),
    #efe2d9;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 5rem;
  color: var(--rose);
}

.alt {
  display: inline-block;
  margin-top: 18px;
  color: var(--rose-deep);
  font-weight: 600;
  text-decoration: none;
}

.edit-again { margin: 22px 0 0; }

@media (min-width: 800px) {
  body {
    background:
      radial-gradient(900px 480px at 50% -10%, #f8d5dc, transparent 55%),
      #e7d5cb;
  }

  .phone {
    width: 420px;
    margin: 28px auto;
    background: var(--paper);
    border-radius: 32px;
    box-shadow: 0 30px 70px rgba(70, 30, 24, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .who-card:active { transform: none; }
}
