:root {
  --lilac: #e8e4f2;
  --cream: #fffdf8;
  --ink: #1a1a1a;
  --wine: #9b1e4e;
  --muted: #8a8580;
  --line: #ece8e1;
  --field: #ffffff;
  --ok: #2f7a4d;
  --danger: #b4232c;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --tap: 48px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--lilac);
  padding: 18px 12px calc(28px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.sheet {
  width: min(100%, 640px);
  margin: 0 auto;
  background: var(--cream);
  border-radius: 28px;
  padding: 28px 18px 20px;
  box-shadow: 0 16px 40px rgba(70, 55, 110, 0.08);
}

.brand {
  display: flex;
  justify-content: center;
  padding: 4px 8px 10px;
}

.logo {
  display: block;
  width: min(86%, 320px);
  height: auto;
}

.lede {
  margin: 0 auto 28px;
  max-width: 22rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.block-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.saved {
  min-height: 1em;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.saved.is-saving { color: var(--ink); }
.saved.is-saved { color: var(--ok); }
.saved.is-error { color: var(--danger); }

.grow {
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--field);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
  field-sizing: content;
  outline: none;
}

.grow:focus {
  box-shadow: 0 0 0 1.5px var(--wine);
}

.photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.photos:empty { display: none; }

.photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f3efe8;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.8);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: 132px;
  padding: 0 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 1px #ddd6cc;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.upload-btn:active {
  background: #f7f3ec;
}

.status {
  position: sticky;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 8px 20px rgba(70, 55, 110, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
}

.status[data-state="saving"] { color: var(--ink); }
.status[data-state="saved"] { color: var(--ok); }
.status[data-state="error"] { color: var(--danger); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot.off { opacity: 0.45; }

@media (min-width: 720px) {
  body { padding: 36px 20px 48px; }
  .sheet {
    padding: 42px 40px 28px;
    border-radius: 36px;
  }
  .logo { width: min(70%, 380px); }
  .photos { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 380px) {
  .sheet { padding: 22px 14px 16px; }
  .grow { padding: 12px 13px; }
}
