:root {
  --background: #f5f3ee;
  --foreground: #1d1c19;
  --card: #efece4;
  --muted-foreground: #6a665c;
  --border: #d6d0c2;
  --border-strong: #b9b1a0;
  /* Colours from the Ela logo: blue leads, coral marks errors, peach is decoration only. */
  --accent: #3a62d8;
  --accent-hover: #2c4cb8;
  --accent-light: #7b9bf3;
  --accent-foreground: #f5f3ee;
  --coral: #b04128;
  --peach: #f99f85;
  --on-dark-muted: #c2bbab;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-6: 48px;
  --sp-8: 64px;
  --sp-12: 96px;
  /* The whole type scale: four sizes. */
  --text-sm: 0.8125rem;
  --text-base: 1rem;
  --text-lg: clamp(1.75rem, 1.45rem + 1vw, 2.25rem);
  --text-display: clamp(2.5rem, 1.6rem + 3.8vw, 4.25rem);
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font-family: var(--font-sans); cursor: pointer; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) max(var(--sp-2), calc((100% - 1152px) / 2));
  border-bottom: 1px solid var(--border);
}
.brand {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem; /* wordmark, sized as a logo rather than text */
  letter-spacing: -0.01em;
  text-decoration: none;
}
.mark {
  width: 12px;
  height: 12px;
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--peach);
}
.nav { grid-column: 2; display: none; gap: var(--sp-3); }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 2px solid transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}
.nav a:hover { border-bottom-color: var(--accent); }
.signin {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--foreground);
  background: transparent;
  color: var(--foreground);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}
.signin:hover { background: var(--foreground); color: var(--background); }

body.app .nav,
body.app #signin,
body.app #welcome,
body.app .site-foot { display: none; }
body:not(.app) #app { display: none; }

/* ---------- Shared form controls ---------- */

label {
  display: block;
  margin: var(--sp-2) 0 6px;
  font-size: var(--text-sm);
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-base);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus,
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.primary {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: var(--sp-3);
  padding: 14px var(--sp-2);
  border: 0;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: var(--text-base);
  font-weight: 600;
}
button.primary:hover { background: var(--accent-hover); }
button.primary[disabled] { opacity: 0.5; cursor: default; }

button.secondary {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: var(--sp-2);
  padding: 12px var(--sp-2);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  font-size: var(--text-base);
  font-weight: 600;
}
button.secondary:hover { border-color: var(--foreground); }

.err, .ok {
  margin-top: var(--sp-2);
  padding: var(--sp-2);
  border: 1px solid;
  border-left-width: 4px;
  font-size: var(--text-sm);
}
.err { border-color: var(--coral); color: var(--coral); }
.ok { border-color: var(--accent); color: var(--accent-hover); }

.muted { margin: 0 0 var(--sp-2); color: var(--muted-foreground); font-size: var(--text-sm); }
.center { text-align: center; }

/* ---------- Welcome page ---------- */

#welcome { overflow-x: hidden; overflow-x: clip; }

#welcome h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hero {
  display: grid;
  gap: var(--sp-6);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-2) var(--sp-8);
}
.hero-text { max-width: 640px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin: 0 0 var(--sp-3);
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: var(--text-sm);
  font-weight: 500;
}
.tag .dot { width: 8px; height: 8px; background: var(--coral); flex: none; }

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero h1 span { display: block; color: var(--accent); }

.lede { max-width: 34em; margin: var(--sp-3) 0 0; color: var(--muted-foreground); }

.start { margin-top: var(--sp-4); }
.start-fields { display: grid; gap: var(--sp-2); }
.start label { margin-top: 0; }
.start button.primary { margin-top: var(--sp-2); }
.hint { margin: var(--sp-1) 0 0; color: var(--muted-foreground); font-size: var(--text-sm); }
.hint a { color: var(--accent); font-weight: 600; }
.switch { margin: 0; font-size: var(--text-sm); }
.switch button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.howlink {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}
.howlink .circle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--foreground);
  border-radius: 50%;
}
.howlink:hover .circle { background: var(--foreground); color: var(--background); }

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3) 0;
  margin: var(--sp-6) 0 0;
}
.facts div { padding-left: var(--sp-2); border-left: 1px solid var(--border); }
.facts div:nth-child(odd) { padding-left: 0; border-left: 0; }
.facts dt {
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  line-height: 1.1;
}
.facts dd { margin: 4px 0 0; color: var(--muted-foreground); font-size: var(--text-sm); }

/* Hero visual: a real shop page on a phone, with flat bands behind it. */
.hero-visual { position: relative; }
.stage { position: relative; }

.band {
  position: absolute;
  left: -100vw;
  right: -100vw;
  z-index: 0;
  padding: 10px 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--accent-foreground);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.band-1 { top: 120px; background: var(--accent); transform: rotate(-6deg); }
.band-2 { top: 400px; background: var(--peach); transform: rotate(4deg); }

.phone {
  position: relative;
  z-index: 1;
  width: 272px;
  margin: 0 auto;
  padding: 10px;
  background: var(--foreground);
  border-radius: 32px;
  box-shadow: 0 24px 48px -24px rgba(29, 28, 25, 0.5);
}
.screen {
  display: flex;
  flex-direction: column;
  min-height: 500px;
  overflow: hidden;
  border-radius: 22px;
  background: var(--background);
  font-size: var(--text-sm);
}
.ms-head { padding: var(--sp-3) var(--sp-2) 12px; text-align: center; }
.ms-head b { display: block; font-family: var(--font-display); font-size: var(--text-base); font-weight: 600; }
.ms-head i { display: block; width: 20px; height: 2px; margin: 6px auto; background: var(--accent); }
.ms-head small { color: var(--muted-foreground); font-size: var(--text-sm); }
.ms-cat {
  padding: 12px var(--sp-2) 4px;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ms-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 8px var(--sp-2);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.ms-item .cb { flex: none; width: 16px; height: 16px; border: 1.5px solid var(--border-strong); }
.ms-item.on .cb { position: relative; background: var(--accent); border-color: var(--accent); }
.ms-item.on .cb::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--accent-foreground);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.ms-item .n { flex: 1; font-weight: 600; }
.ms-item .q { padding: 0 6px; border: 1px solid var(--border); }
.ms-item.out { opacity: 0.45; }
.ms-bar span:last-child { white-space: nowrap; }
.ms-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: auto 12px 12px;
  padding: 12px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-weight: 600;
}

.steps {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--sp-2);
  margin: var(--sp-6) 0 0;
  padding: 0;
  list-style: none;
}
.step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-2);
  background: var(--background);
  border: 1px solid var(--border);
}
.step .ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: var(--accent-foreground);
}
.step .ico svg { width: 20px; height: 20px; }
.step h3 { margin: 0; padding-right: var(--sp-3); font-size: var(--text-base); font-weight: 600; }
.step p { margin: 4px 0 0; color: var(--muted-foreground); font-size: var(--text-sm); }
.step .num {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  color: var(--muted-foreground);
  font-family: var(--font-display);
  font-size: var(--text-sm);
}

/* Orders section: dark band with the real WhatsApp message format. */
.receive { background: var(--foreground); color: var(--background); }
.receive .inner,
.pricing .inner {
  display: grid;
  gap: var(--sp-6);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-2);
}
.receive .copy p { margin: var(--sp-2) 0 0; color: var(--on-dark-muted); max-width: 36em; }

.ticks { display: grid; gap: 12px; margin: var(--sp-3) 0 0; padding: 0; list-style: none; }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 10px;
  height: 10px;
  background: var(--accent);
}
.receive .ticks li::before { background: var(--accent-light); }

.chat {
  width: 100%;
  max-width: 440px;
  justify-self: center;
  padding: var(--sp-2);
  background: #26241f;
  border: 1px solid #3a372f;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #3a372f;
  font-weight: 600;
}
.chat-head small { display: block; color: var(--on-dark-muted); font-size: var(--text-sm); font-weight: 400; }
.chat-head .av {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--accent);
  font-family: var(--font-display);
}
.bubble {
  max-width: 88%;
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: var(--text-sm);
  line-height: 1.45;
  white-space: pre-line;
}
.bubble.in { background: var(--background); color: var(--foreground); }
.bubble.out { margin-left: auto; background: var(--accent); color: var(--accent-foreground); }
.bubble time { display: block; text-align: right; opacity: 0.6; }

/* Pricing */
.pricing .copy p { margin: var(--sp-2) 0 0; max-width: 36em; }
.pricing .copy p.small { color: var(--muted-foreground); font-size: var(--text-sm); }
.price-card { padding: var(--sp-4) var(--sp-3); background: var(--card); border: 1px solid var(--foreground); }
.eyebrow {
  margin: 0;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.price { margin: var(--sp-1) 0 0; color: var(--muted-foreground); }
.price strong {
  margin-right: 6px;
  color: var(--foreground);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-display);
  line-height: 1;
}
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: var(--sp-4);
  background: var(--accent);
  color: var(--accent-foreground);
  font-weight: 600;
  text-decoration: none;
}
.cta:hover { background: var(--accent-hover); }

/* Questions */
.faq .inner { max-width: 760px; margin: 0 auto; padding: var(--sp-8) var(--sp-2) var(--sp-12); }
#welcome .faq h2 { margin-bottom: var(--sp-3); }
details { border-top: 1px solid var(--border); }
details:last-child { border-bottom: 1px solid var(--border); }
summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
  min-height: 56px;
  padding: var(--sp-2) 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-weight: 400; }
details[open] summary::after { content: "−"; }
details p { max-width: 60ch; margin: 0 0 var(--sp-2); color: var(--muted-foreground); }

/* Mobile thumb-zone button, hidden while another start button is on screen. */
.dock {
  position: fixed;
  left: var(--sp-2);
  right: var(--sp-2);
  bottom: calc(var(--sp-2) + env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 var(--sp-2);
  background: var(--accent);
  color: var(--accent-foreground);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px -8px rgba(29, 28, 25, 0.5);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.dock.away { transform: translateY(150%); opacity: 0; pointer-events: none; }

.site-foot { border-top: 1px solid var(--border); }
.site-foot .inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-3);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-2) var(--sp-12);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}
.site-foot p { margin: 0; }
.site-foot ul { display: flex; flex-wrap: wrap; gap: 0 var(--sp-3); margin: 0; padding: 0; list-style: none; }
.site-foot a { display: inline-flex; align-items: center; min-height: 44px; }

@media (min-width: 480px) {
  .start-fields { grid-template-columns: 1fr 1fr; }
  .start button.primary { width: auto; padding: 14px var(--sp-4); }
}

@media (min-width: 760px) {
  .hero { padding: var(--sp-8) var(--sp-3) var(--sp-12); }
  .facts { grid-template-columns: repeat(4, auto); justify-content: start; }
  .facts div, .facts div:nth-child(odd) { padding: 0 var(--sp-2); border-left: 1px solid var(--border); }
  .facts div:first-child { padding-left: 0; border-left: 0; }

  .hero-visual {
    display: grid;
    grid-template-columns: 272px minmax(0, 400px);
    justify-content: center;
    align-items: center;
    gap: var(--sp-6);
    padding: var(--sp-6) 0;
  }
  .band { left: 50%; transform-origin: left center; }
  .steps { margin: 0; }
  .step:nth-child(2) { margin-left: var(--sp-4); --reach: 80px; }
  .step::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    width: var(--reach, 48px);
    height: 1px;
    background: var(--border-strong);
  }
  .step::after {
    content: "";
    position: absolute;
    top: calc(50% - 3px);
    right: calc(100% + var(--reach, 48px) - 4px);
    width: 7px;
    height: 7px;
    background: var(--accent);
  }

  .receive .inner, .pricing .inner { padding: var(--sp-12) var(--sp-3); }
  .faq .inner { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .site-foot .inner { padding: var(--sp-4) var(--sp-3); }
  .dock { display: none; }
}

@media (min-width: 900px) {
  .nav { display: flex; }
  .receive .inner { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: center; }
  .pricing .inner { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
}

@media (min-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; }
  .facts { grid-template-columns: repeat(2, auto); }
  .facts div:nth-child(odd) { padding: 0 var(--sp-4) 0 0; border-left: 0; }
  .facts div:nth-child(even) { padding: 0 0 0 var(--sp-4); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dock { transition: none; }
}

/* ---------- Seller app ---------- */

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-2) var(--sp-6);
}
#app h1 {
  margin: 0 0 var(--sp-1);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
#app h2 {
  margin: var(--sp-4) 0 var(--sp-1);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card {
  margin-top: var(--sp-2);
  padding: var(--sp-2);
  background: var(--card);
  border: 1px solid var(--border);
}

.tpls { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-1); }
.tpl {
  min-height: 44px;
  padding: var(--sp-2);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--foreground);
  text-align: left;
  font-size: var(--text-sm);
  font-weight: 600;
}
.tpl.sel { border: 2px solid var(--accent); color: var(--accent-hover); }

.rows .r { display: grid; grid-template-columns: 1fr 90px 44px; gap: 6px; margin-bottom: 6px; }
.rows .r input { min-height: 44px; padding: 11px; }
.rows .x {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--coral);
  font-size: 1.3rem;
  line-height: 1;
}

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-1); }
.stat {
  padding: var(--sp-2);
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
  font-size: var(--text-sm);
}
.stat b { display: block; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; }

.linkbox { display: flex; gap: var(--sp-1); }
.linkbox input { flex: 1; min-width: 0; }
.linkbox button.primary { width: auto; margin-top: 0; padding: 0 var(--sp-2); }

.qr { display: flex; justify-content: center; padding: var(--sp-2) 0; }
.qr svg, .qr img { width: 180px; height: 180px; }

.actions { display: grid; gap: var(--sp-1); margin-top: var(--sp-2); }
a.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--foreground);
  text-align: center;
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
}
a.btn.wa { background: var(--accent); border-color: var(--accent); color: var(--accent-foreground); }

.stock {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-1);
  min-height: 44px;
  padding: var(--sp-1) 0;
  border-bottom: 1px solid var(--border);
}
.stock:last-child { border-bottom: 0; }
.stock label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 400;
}
.stock input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }

/* ---------- Who can see the shop ---------- */
.vis-line { margin: var(--sp-1) 0 0; }
.vis-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.vis-form legend { margin: 0 0 var(--sp-1); padding: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
label.vis {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 var(--sp-1);
  padding: 12px var(--sp-2);
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 400;
  cursor: pointer;
}
label.vis:has(input:checked) { border: 2px solid var(--accent); padding: 11px 15px; }
label.vis input { flex: none; width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; padding: 0; accent-color: var(--accent); }
label.vis b { display: block; font-size: var(--text-base); }
label.vis small { display: block; margin-top: 2px; color: var(--muted-foreground); font-size: var(--text-sm); line-height: 1.4; }
.pin-box input { font-size: 1.25rem; letter-spacing: 0.25em; }
.vis-form + .secondary { margin-top: var(--sp-1); }
