:root {
  color-scheme: light;
  --bg: #fff8ef;
  --card: #ffffff;
  --ink: #2b2433;
  --muted: #6c6275;
  --line: #eadfd2;
  --primary: #d9483b;
  --primary-ink: #ffffff;
  --accent: #0f7c78;
  --accent-soft: #dff3f1;
  --star: #f5a623;
  --google: #4285f4;
  --warn-bg: #fff0c9;
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Gujarati", "Noto Sans Devanagari", sans-serif;
  font-size: 20px;
  line-height: 1.45;
}

main {
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 12px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

button, a {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.setup {
  background: var(--warn-bg);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 16px;
}

/* Top bar: back button on the left, language switch on the right. */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}

.icon-button {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 48px;
  font-size: 18px;
}

.lang-switch {
  display: flex;
  margin-left: auto;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}

.lang-switch button {
  min-width: 48px;
  min-height: 40px;
  padding: 0 10px;
  background: none;
  border: none;
  border-radius: 999px;
  font-size: 18px;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.logo {
  display: block;
  width: 168px;
  height: 168px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: #fff;
}

h1 {
  margin: 0;
  text-align: center;
  font-size: 26px;
  line-height: 1.25;
}

h2 {
  margin: 8px 0 0;
  font-size: 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.thanks {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 18px;
}

/* Brand icons are single-colour SVGs, painted with a mask. */
.brand-icon {
  display: inline-block;
  flex: none;
  width: 32px;
  height: 32px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.google-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px;
  background: var(--card);
  border: 3px solid var(--google);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(66, 133, 244, 0.18);
  text-align: left;
}

.google-card .brand-icon { width: 48px; height: 48px; color: var(--google); }
.google-card strong { display: block; font-size: 23px; line-height: 1.2; }
.google-card .mini-stars { display: block; color: var(--star); font-size: 22px; letter-spacing: 2px; }
.google-card small { display: block; color: var(--muted); font-size: 16px; }

.social {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.social a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 14px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
}



.stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 8px 0;
}

.star {
  flex: 1;
  max-width: 68px;
  height: 68px;
  padding: 0;
  background: none;
  border: none;
  font-size: 50px;
  line-height: 1;
  color: var(--star);
}

.chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 92px;
  padding: 8px 4px;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.2;
}

.chip .emoji { font-size: 30px; line-height: 1; }

.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: 600;
}

.draft-card {
  display: block;
  width: 100%;
  padding: 18px;
  background: var(--card);
  border: 3px dashed var(--primary);
  border-radius: var(--radius);
  text-align: left;
}

.draft-card p { margin: 0 0 12px; font-size: 20px; }

.draft-card .tap {
  display: block;
  padding: 12px;
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  text-align: center;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px;
}

.secondary {
  min-height: 56px;
  padding: 10px;
  background: var(--card);
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius);
  font-weight: 600;
}

.primary {
  display: block;
  width: 100%;
  min-height: 68px;
  padding: 16px;
  background: var(--primary);
  color: var(--primary-ink);
  border: none;
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.steps .emoji { font-size: 32px; line-height: 1; }

.text-link {
  display: block;
  padding: 12px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 17px;
  text-align: center;
  text-decoration: underline;
}

.status {
  margin: 0;
  color: var(--primary);
  font-size: 17px;
  text-align: center;
}

/* Make every option look like a button you can press. */
.google-card, .social a, .chip, .draft-card, .secondary, .primary {
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.google-card:active, .social a:active, .chip:active, .draft-card:active, .secondary:active, .primary:active {
  transform: scale(0.97);
}

.google-card {
  background: linear-gradient(180deg, #ffffff, #f2f7ff);
  box-shadow: 0 6px 0 #2f6fd6, 0 10px 22px rgba(66, 133, 244, 0.25);
  margin-bottom: 6px;
}
.google-card:active { box-shadow: 0 2px 0 #2f6fd6; transform: translateY(4px); }

.google-card .tap-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 14px;
  background: var(--google);
  color: #fff;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  animation: nudge 1.6s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .google-card .tap-pill { animation: none; }
}

.go {
  margin-left: auto;
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.google-card .go { width: 44px; height: 44px; background: var(--google); color: #fff; font-size: 32px; }

.social a {
  box-shadow: 0 4px 0 var(--line), 0 6px 14px rgba(43, 36, 51, 0.08);
}
.social a:active { box-shadow: 0 1px 0 var(--line); transform: translateY(3px); }
.social a .label { color: var(--ink); }

/* Smaller chips, four in a row. */
.chips { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.chip { min-height: 70px; padding: 6px 2px; border-width: 2px; border-radius: 14px; font-size: 13px; }
.chip .emoji { font-size: 24px; }
.chips.full .chip[aria-pressed="false"] { opacity: 0.45; }

.toast {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: rgba(255, 248, 239, 0.97);
  text-align: center;
}
.toast strong { color: var(--accent); font-size: 28px; }
.toast span { font-size: 20px; }

/* Social cards are narrow: smaller icon and a plain arrow so text fits. */
.social a { gap: 8px; padding: 10px; font-size: 17px; }
.social a .brand-icon { width: 28px; height: 28px; }
.social a .label { min-width: 0; }
.social a .go { width: 16px; height: auto; background: none; font-size: 24px; color: var(--muted); }

/* Arrow drawn with CSS so it sits exactly in the middle of its circle
   (the "›" text character sits off-centre in many fonts). */

.go::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: -4px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  transform: rotate(45deg);
}
.google-card .go::after { width: 12px; height: 12px; margin-left: -5px; border-width: 4px; }
.social a .go { display: grid; place-items: center; height: 24px; }

/* Before a star is chosen, stars glow one after another and a hand bounces
   below them, so customers see the stars are to be tapped. */
.stars.hint .star { animation: star-wave 2s ease-in-out infinite; }
.stars.hint .star:nth-child(2) { animation-delay: 0.15s; }
.stars.hint .star:nth-child(3) { animation-delay: 0.3s; }
.stars.hint .star:nth-child(4) { animation-delay: 0.45s; }
.stars.hint .star:nth-child(5) { animation-delay: 0.6s; }

@keyframes star-wave {
  0%, 60%, 100% { transform: scale(1); text-shadow: none; }
  25% { transform: scale(1.25); text-shadow: 0 0 14px rgba(245, 166, 35, 0.8); }
}

.star-hint {
  margin: -4px 0 0;
  text-align: center;
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  animation: nudge 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .stars.hint .star, .star-hint { animation: none; }
}

/* While a new suggestion is loading. */
.draft-card.loading p { opacity: 0.45; }
.draft-card:disabled .tap { opacity: 0.5; }
