/* App-only first-launch welcome and soft join prompt (preview). */
.cn-welcome {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: linear-gradient(180deg, #f0533a 0%, #e5432a 42%, #fff7ed 42%, #fffdf8 100%);
  color: #111827;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(1.4rem + env(safe-area-inset-top, 0px)) 1.35rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
}
body.cn-app.cn-welcome-open { overflow: hidden; }
body.cn-app.cn-welcome-open .cn-welcome { display: flex; flex-direction: column; align-items: center; }
.cn-welcome-hero {
  width: 100%;
  max-width: 400px;
  text-align: center;
  color: #fff;
  padding: 0.4rem 0.4rem 1.5rem;
}
.cn-welcome-logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 0.85rem;
  background: #fff;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(80, 16, 8, 0.22);
}
.cn-welcome-logo img { width: 52px; height: 52px; }
.cn-welcome-hero h1 {
  font-family: Nunito, sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.cn-welcome-hero h1 span { color: #ffd166; }
.cn-welcome-value {
  margin-top: 0.55rem;
  font-size: 0.98rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.94);
  font-weight: 500;
}
.cn-welcome-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 22px;
  padding: 1.2rem 1.15rem 1.3rem;
  box-shadow: 0 12px 36px rgba(17,24,39,0.14);
  margin-top: -0.3rem;
}
.cn-welcome-benefits { list-style: none; margin: 0 0 1.15rem; padding: 0; }
.cn-welcome-benefits li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #1f2937;
  padding: 0.45rem 0;
}
.cn-welcome-benefits li + li { border-top: 1px solid #f3f4f6; }
.cn-welcome-benefits .dot {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 0.05rem;
  border-radius: 8px;
  background: #fff4ea;
  color: #e5432a;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cn-sso { display: flex; flex-direction: column; gap: 0.65rem; }
.cn-sso-apple, .cn-sso-google, .cn-sso-email, .cn-sso-browse, .cn-sso-later {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  width: 100%; font: inherit; cursor: pointer; text-decoration: none; box-sizing: border-box;
}
/* Apple HIG: black, 44pt min, white label, logo on the left, corner radius matching the sibling buttons. */
.cn-sso-apple {
  min-height: 48px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cn-sso-apple svg { width: 18px; height: 18px; fill: currentColor; }
/* Google branded button: white, gray border, official multicolor G, dark text. */
.cn-sso-google {
  min-height: 48px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #747775;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 500;
}
.cn-sso-google svg { width: 18px; height: 18px; }
.cn-sso-email {
  margin-top: 0.15rem;
  background: none;
  border: 0;
  color: #374151;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 36px;
  padding: 0;
}
.cn-sso-browse, .cn-sso-later {
  background: none;
  border: 0;
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 36px;
  padding: 0;
}
.cn-sso-browse:hover, .cn-sso-email:hover, .cn-sso-later:hover { color: #111827; }

.cn-join {
  position: fixed; inset: 0; z-index: 360;
  background: rgba(17,24,39,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.cn-join[hidden] { display: none; }
.cn-join-card {
  background: #fff;
  width: 100%;
  max-width: 440px;
  border-radius: 18px 18px 0 0;
  padding: 1.25rem 1.2rem calc(1.3rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
}
@media (min-width: 600px) {
  .cn-join { align-items: center; }
  .cn-join-card { border-radius: 18px; padding-bottom: 1.3rem; }
}
.cn-join-card h3 {
  font-family: Nunito, sans-serif;
  font-size: 1.18rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  line-height: 1.25;
  text-align: center;
}
.cn-join-card .cn-join-sub {
  text-align: center;
  color: #6b7280;
  font-size: 0.92rem;
  margin: 0 0 1.05rem;
  line-height: 1.4;
}

.cn-sso-start {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 48px; border: 0; border-radius: 10px;
  background: #111827; color: #fff; font: inherit; font-size: 1.05rem; font-weight: 700;
  cursor: pointer;
}
.cn-sso-start:hover { background: #000; }

/* ---- Welcome v2 (one screen: what CleanNibble is, ways to search, directory, alerts, join / log in / skip) ---- */
.cn-welcome.cnw {
  background: #fff8f2;
  padding: 0 0 calc(0.9rem + env(safe-area-inset-bottom, 0px));
  font-family: Inter, system-ui, -apple-system, sans-serif;
}
.cnw-hero {
  width: 100%;
  box-sizing: border-box;
  background: radial-gradient(120% 90% at 85% 0%, #ff7a59 0%, rgba(255,122,89,0) 60%), linear-gradient(160deg, #f0533a 0%, #e5432a 100%);
  color: #fff;
  text-align: center;
  padding: calc(1.1rem + env(safe-area-inset-top, 0px)) 1.4rem 2.6rem;
  border-radius: 0 0 30px 30px;
  position: relative;
  overflow: hidden;
}
.cnw-hero:after {
  content: ""; position: absolute; right: -60px; top: -70px; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 209, 102, 0.16); pointer-events: none;
}
.cnw-brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.cnw-logo {
  width: 52px; height: 52px; border-radius: 16px; background: #fff; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(80, 16, 8, 0.25), 0 0 0 3px #ffd166;
}
.cnw-logo img { width: 40px; height: 40px; }
.cnw-hero h1 { font-family: Nunito, sans-serif; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; margin: 0; line-height: 1; }
.cnw-hero h1 span { color: #ffd166; }
.cnw-tag { font-family: Nunito, sans-serif; font-size: 1.32rem; font-weight: 800; line-height: 1.2; margin: 0.75rem 0 0.35rem; letter-spacing: -0.01em; }
.cnw-sub { font-size: 0.9rem; line-height: 1.42; margin: 0 auto; max-width: 330px; color: rgba(255,255,255,0.95); }
.cnw-sub strong { color: #ffd166; font-weight: 700; }
.cnw-badges { display: flex; justify-content: center; gap: 0.4rem; margin-top: 0.75rem; flex-wrap: wrap; }
.cnw-badges span {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.01em;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.28); border-radius: 999px; padding: 0.28rem 0.65rem;
}
.cnw-badges svg { width: 14px; height: 14px; color: #ffd166; }
.cnw-card {
  width: calc(100% - 2rem); max-width: 420px; box-sizing: border-box;
  background: #fff; border-radius: 24px; margin: -1.8rem auto 0; position: relative; z-index: 1;
  padding: 1rem 1rem 0.85rem; box-shadow: 0 14px 36px rgba(229, 67, 42, 0.14), 0 2px 6px rgba(17,24,39,0.06);
}
.cnw-card h2 {
  font-family: Nunito, sans-serif; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: #9a3412; margin: 0 0 0.55rem;
}
.cnw-card h2 + .cnw-tiles, .cnw-card h2 + .cnw-chips { margin-top: 0; }
.cnw-tiles { list-style: none; padding: 0; margin: 0 0 0.85rem; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.35rem; }
.cnw-tiles li { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; text-align: center; }
.cnw-ico {
  width: 46px; height: 46px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fff1e9 0%, #ffe3d6 100%); color: #e5432a; box-shadow: inset 0 0 0 1px #ffd9c9;
}
.cnw-tiles li:nth-child(2) .cnw-ico { background: linear-gradient(160deg, #fff6d6 0%, #ffe9a3 100%); color: #b45309; box-shadow: inset 0 0 0 1px #ffe08a; }
.cnw-ico svg { width: 22px; height: 22px; }
.cnw-lbl { font-size: 0.72rem; font-weight: 700; color: #374151; line-height: 1.15; }
.cnw-chips { list-style: none; padding: 0; margin: 0 0 0.8rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.cnw-chips li {
  justify-content: center;
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 600; color: #374151;
  background: #f9fafb; border: 1px solid #eef0f2; border-radius: 999px; padding: 0.3rem 0.62rem;
}
.cnw-chips svg { width: 14px; height: 14px; color: #e5432a; }
.cnw-alert {
  display: flex; gap: 0.65rem; align-items: center; background: #fff7d6; border: 1px solid #ffe08a; border-radius: 16px;
  padding: 0.65rem 0.75rem; margin: 0 0 0.9rem;
}
.cnw-bell { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #ffd166; color: #7a3a00; display: flex; align-items: center; justify-content: center; }
.cnw-bell svg { width: 18px; height: 18px; }
.cnw-alert p { margin: 0; font-size: 0.84rem; line-height: 1.38; color: #4b3a12; }
.cnw-alert strong { color: #111827; }
.cnw-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.cnw-join, .cnw-login, .cnw-skip { width: 100%; font: inherit; cursor: pointer; box-sizing: border-box; }
.cnw-join {
  min-height: 50px; border: 0; border-radius: 14px; color: #fff; font-size: 1.05rem; font-weight: 800; letter-spacing: 0.01em;
  background: linear-gradient(135deg, #ff7a59 0%, #f0533a 45%, #e5432a 100%); box-shadow: 0 10px 22px rgba(229, 67, 42, 0.32);
}
.cnw-join:active { transform: translateY(1px); }
.cnw-login {
  min-height: 46px; background: #fff; color: #e5432a; border: 1.5px solid #f6c9bc; border-radius: 14px; font-size: 1rem; font-weight: 700;
}
.cnw-skip { background: none; border: 0; color: #6b7280; font-size: 0.84rem; font-weight: 500; min-height: 32px; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #d1d5db; }
.cnw-hero, .cnw-card, .cnw-foot { flex: none; }
.cnw-foot { max-width: 360px; margin: 0.8rem auto 0; padding: 0 1.2rem; text-align: center; font-size: 0.72rem; line-height: 1.4; color: #9ca3af; }
.cnw-note { margin: 0.6rem 0 0; color: #b45309; font-size: 0.85rem; text-align: center; }
@media (max-height: 720px) {
  .cnw-foot { display: none; }
  .cnw-logo { width: 44px; height: 44px; border-radius: 14px; }
  .cnw-logo img { width: 34px; height: 34px; }
  .cnw-hero h1 { font-size: 1.65rem; }
  .cnw-hero { padding-top: calc(0.8rem + env(safe-area-inset-top, 0px)); }
  .cnw-lbl { font-size: 0.68rem; }
  .cnw-chips li { padding: 0.24rem 0.5rem; font-size: 0.74rem; }
  .cnw-alert { padding: 0.5rem 0.65rem; }
  .cnw-alert p { font-size: 0.8rem; }
  .cnw-actions { gap: 0.4rem; }
  .cnw-card h2 { margin-bottom: 0.4rem; }
  .cnw-tiles li { gap: 0.2rem; }
  .cnw-tag { margin: 0.45rem 0 0.25rem; }
  .cnw-skip { min-height: 26px; }
  .cn-welcome.cnw { padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px)); }
  .cnw-hero { padding-bottom: 2.2rem; }
  .cnw-tag { font-size: 1.15rem; margin-top: 0.55rem; }
  .cnw-sub { font-size: 0.84rem; }
  .cnw-badges { margin-top: 0.55rem; }
  .cnw-ico { width: 40px; height: 40px; border-radius: 13px; }
  .cnw-card { padding-top: 0.85rem; }
  .cnw-tiles, .cnw-chips, .cnw-alert { margin-bottom: 0.65rem; }
  .cnw-join { min-height: 46px; }
  .cnw-login { min-height: 42px; }
}
