:root {
  color: #172026;
  background: #f2f4f5;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f2f4f5;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  min-height: 42px;
  border: 1px solid #c5d0d5;
  border-radius: 8px;
  background: #ffffff;
  color: #172026;
  font: inherit;
  font-weight: 700;
  padding: 0 14px;
}

button {
  cursor: pointer;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 17px;
}

p {
  color: #5d6a72;
}

.shell {
  width: min(430px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  background: #f8faf9;
  box-shadow: 0 0 0 1px rgba(14, 23, 31, 0.08), 0 24px 80px rgba(14, 23, 31, 0.18);
  position: relative;
}

.screen {
  min-height: 100svh;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
  display: grid;
  align-content: start;
  gap: 16px;
}

.screen.center {
  place-content: center;
  text-align: center;
}

.bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.bar h1 {
  text-align: center;
}

.tabs,
.chips,
.actionsRow,
.pills,
.timeline {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.tabs button,
.chips button,
.pills span,
.timeline span {
  border-radius: 999px;
  white-space: nowrap;
}

.tabs .active,
.chips .active,
.primary,
.create {
  background: #172026;
  border-color: #172026;
  color: #ffffff;
}

.feed,
.templates {
  display: grid;
  gap: 14px;
}

.iosHero {
  min-height: 192px;
  display: grid;
  align-content: end;
  gap: 16px;
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(52, 199, 89, 0.18), rgba(47, 125, 246, 0.16)),
    #ffffff;
  border: 1px solid #d7e0e4;
}

.iosHero span,
.iosHint span {
  color: #66727b;
  font-size: 13px;
  font-weight: 700;
}

.iosHero h2 {
  margin-top: 4px;
  max-width: 14em;
  font-size: 29px;
  line-height: 1.08;
}

.iosHint {
  display: grid;
  gap: 4px;
  border: 1px solid #d7e0e4;
  border-radius: 8px;
  padding: 12px;
  background: #f8faf9;
}

.apiStatus {
  display: grid;
  gap: 2px;
  border: 1px solid #d7e0e4;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.apiStatus strong {
  color: #41505a;
  font-size: 13px;
}

.apiStatus span,
.errorText,
.shareUrl {
  color: #72808a;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.apiStatus.live {
  border-color: #2daf89;
}

.errorText {
  color: #b7435b;
}

.shareUrl {
  border: 1px dashed #c5d0d5;
  border-radius: 8px;
  padding: 10px;
  background: #f8faf9;
}

.post,
.template,
.resultCard,
.creator,
.readyHero {
  border: 1px solid #d7e0e4;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.postHero,
.templateArt,
.detailHero,
.resultHero,
.photoWell {
  min-height: 190px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(45, 175, 137, 0.28), rgba(242, 189, 74, 0.28)),
    #edf3f2;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.postHero strong,
.detailHero strong,
.resultHero strong {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: #172026;
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 28px;
  background: hsl(var(--h), 74%, 56%);
  color: rgba(255, 255, 255, 0.88);
  display: grid;
  place-items: center;
  font-size: 50px;
  box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.14);
}

.bottomNav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(430px, 100vw);
  height: calc(74px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid #d7e0e4;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.bottomNav button {
  min-height: 48px;
  padding: 0;
  font-size: 12px;
}

.bottomNav .create {
  font-size: 26px;
  border-radius: 999px;
}

.creator label {
  display: grid;
  gap: 8px;
  color: #41505a;
  font-weight: 800;
}

.photoWell {
  min-height: 180px;
  grid-template-columns: 1fr auto 1fr;
  padding: 18px;
}

.objectPreview,
.characterPreview {
  display: grid;
  place-items: center;
  gap: 8px;
  color: #5d6a72;
  font-size: 12px;
}

.objectPreview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid #c5d0d5;
}

.arrow {
  font-size: 28px;
  color: #72808a;
}

.progress {
  width: 280px;
  max-width: 80vw;
  height: 12px;
  border-radius: 999px;
  background: #d9e2e6;
  overflow: hidden;
}

.progress span {
  height: 100%;
  display: block;
  background: #2daf89;
  transition: width 0.2s ease;
}

.bigPulse .avatar {
  width: 120px;
  height: 120px;
  border-radius: 36px;
}

.readyHero {
  text-align: center;
  justify-items: center;
}

.readyHero input {
  text-align: center;
  font-size: 24px;
}

.pills span {
  background: #edf3f2;
  border: 1px solid #d7e0e4;
  padding: 8px 10px;
  color: #41505a;
  font-weight: 800;
}

.meters {
  width: 100%;
  display: grid;
  gap: 10px;
}

.meters label,
.selectedCharacter {
  display: grid;
  gap: 6px;
  color: #41505a;
  font-size: 13px;
  font-weight: 800;
}

meter {
  width: 100%;
}

.template {
  grid-template-columns: 112px minmax(0, 1fr);
}

.templateArt {
  min-height: 112px;
}

.template p,
.lead,
.resultCard p {
  font-size: 14px;
}

.selectedCharacter {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  border: 1px solid #d7e0e4;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.selectedCharacter .avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  font-size: 26px;
}

.resultHero {
  min-height: 260px;
}

.timeline span {
  background: #172026;
  color: #ffffff;
  padding: 8px 10px;
  font-weight: 800;
}

@media (max-width: 430px) {
  .shell {
    width: 100vw;
    box-shadow: none;
  }
}
