:root {
  --bg: #fff8ef;
  --bg-2: #fbefe8;
  --card: rgba(255, 252, 244, 0.92);
  --ink: #33172b;
  --muted: #8d7b83;
  --line: rgba(92, 48, 70, 0.14);
  --brand: #9a3f69;
  --brand-dark: #733052;
  --chip: #f2e7e3;
  --shadow: 0 18px 46px rgba(86, 45, 64, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(154, 63, 105, 0.10), transparent 28rem),
    linear-gradient(180deg, #fffaf4 0%, #fbf2ea 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

.phone-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  background: rgba(255, 248, 239, 0.82);
  overflow: hidden;
}

.hidden { display: none !important; }

.setup-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.setup-card {
  width: 100%;
  padding: 30px 24px;
  border-radius: 34px;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.app-mark {
  width: 62px;
  height: 62px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 34px;
  margin-bottom: 22px;
}

.language-card h1 {
  margin-bottom: 12px;
}

.language-options {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.language-btn {
  min-height: 62px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  border: 1px solid rgba(154, 63, 105, 0.20);
  box-shadow: 0 12px 24px rgba(86, 45, 64, 0.10);
  font-size: 18px;
  font-weight: 850;
}

.language-btn:first-child {
  background: var(--brand);
  color: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: #a96785;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(34px, 9vw, 46px); line-height: 1.08; margin-bottom: 18px; }
h2 { font-size: 23px; line-height: 1.22; margin-bottom: 14px; }
.muted { color: var(--muted); font-size: 16px; line-height: 1.75; }

.profile-form { display: grid; gap: 16px; margin-top: 24px; }
label, .select-label {
  display: grid;
  gap: 8px;
  color: #654f5b;
  font-size: 15px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(98, 56, 75, 0.18);
  background: #fff;
  color: var(--ink);
  border-radius: 22px;
  padding: 15px 16px;
  outline: 0;
}

textarea {
  min-height: 98px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 5px rgba(154, 63, 105, 0.13);
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-btn {
  min-height: 44px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  padding: 0 22px;
  box-shadow: 0 14px 26px rgba(154, 63, 105, 0.24);
  font-size: 15px;
  font-weight: 800;
}

.app-screen {
  min-height: 100vh;
  padding: 18px 18px 118px;
}

.topbar {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0;
  font-size: 22px;
}

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: var(--brand);
  color: #fff;
  font-size: 26px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eee3f5;
  color: #765c8a;
  padding: 9px 16px;
  font-weight: 800;
}

.pill.small {
  font-size: 13px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 6px 18px rgba(64, 37, 49, 0.10);
}

.view { display: none; animation: rise 0.28s ease both; }
.view.active { display: block; }

.hero-card {
  min-height: 360px;
  border-radius: 32px;
  padding: 28px;
  color: white;
  background:
    linear-gradient(0deg, rgba(55, 17, 41, 0.74), rgba(55, 17, 41, 0.54)),
    url("https://images.unsplash.com/photo-1543353071-10c8ba85a904?auto=format&fit=crop&w=1100&q=80") center/cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}

.hero-card.birthday {
  background:
    linear-gradient(0deg, rgba(105, 39, 78, 0.74), rgba(105, 39, 78, 0.50)),
    url("https://images.unsplash.com/photo-1464349095431-e9a21285b5f3?auto=format&fit=crop&w=1100&q=80") center/cover;
}

.glass-pill {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 9px 15px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
  font-weight: 700;
  margin-bottom: 26px;
}

.hero-card h1 {
  font-size: clamp(39px, 11vw, 58px);
  margin-bottom: 24px;
}

.hero-card p {
  font-size: 19px;
  line-height: 1.75;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.soft-card, .wish-card, .dish-card, .plan-item {
  border-radius: 30px;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.soft-card {
  margin-top: 24px;
  padding: 22px;
}

.card-kicker {
  color: #a7909a;
  font-weight: 800;
  margin-bottom: 6px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #f1e6e3;
  padding: 8px;
  border-radius: 999px;
  gap: 4px;
  margin: 18px 0;
}

.segmented button, .chips button {
  border-radius: 999px;
  color: #735f69;
  background: transparent;
  padding: 12px 10px;
  font-weight: 800;
  font-size: 16px;
}

.segmented .selected, .chips .selected {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(154, 63, 105, 0.22);
}

.chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.chips button {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  min-width: 76px;
}

.dish-list, .stack-list {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.dish-card, .plan-item, .wish-card {
  padding: 22px;
  position: relative;
}

.dish-card h2, .plan-item h2, .wish-card h2 {
  font-size: 28px;
  margin: 8px 0 12px;
}

.dish-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
}

.dish-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.ghost-btn {
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--chip);
  color: var(--brand-dark);
  font-weight: 800;
}

.date-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(55px, 1fr));
  gap: 9px;
  overflow-x: auto;
  padding: 18px 0;
}

.date-btn {
  min-height: 78px;
  border-radius: 23px;
  background: var(--chip);
  color: #75606b;
  font-weight: 800;
  display: grid;
  place-items: center;
  gap: 4px;
}

.date-btn span { font-size: 13px; }
.date-btn strong { font-size: 24px; }
.date-btn.selected { background: var(--brand); color: #fff; }

.stars {
  color: var(--brand);
  letter-spacing: 0.15em;
  margin-bottom: 12px;
  font-size: 20px;
}

.wish-card .pill {
  position: absolute;
  right: 20px;
  top: 22px;
}

#wishQuote, .note-bubble {
  margin-top: 20px;
  border-radius: 18px;
  background: #f2ebe8;
  color: #7f6e75;
  padding: 16px;
  line-height: 1.6;
}

.wish-input-label {
  margin-top: 18px;
}
.language-btn small { display: block; font-size: 14px; font-weight: 400; margin-top: 10px; }
.language-btn.selected { outline: 3px solid #9a3f69; outline-offset: 3px; }
.pair-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 0; }
.pair-bar span { flex: 1 1 180px; }
.feedback { position: fixed; z-index: 20; bottom: 115px; left: 50%; transform: translateX(-50%); width: min(90%, 480px); background: #44233b; color: white; padding: 16px 20px; border-radius: 20px; box-shadow: 0 8px 30px #44233b33; }
button:disabled { opacity: .5; cursor: wait; }
.setup-card .date-grid { grid-template-columns: 1fr; }
#joinCode { text-transform: uppercase; }
.profile-form > button, .soft-card > .primary-btn, .wish-card > .primary-btn { justify-self: start; width: fit-content; max-width: 100%; padding: 10px 18px; }
#createKitchen { margin-top: 20px; padding: 10px 18px; }
#joinKitchen { min-height: 44px; font-size: 15px; padding: 10px 18px; }
.pair-code-panel { display: grid; gap: 8px; padding: 14px 16px; margin: 12px 0 20px; background: var(--chip); border-radius: 18px; }
.pair-code-label { font-size: 14px; color: var(--muted); }
.pair-code-value { user-select: all; overflow-wrap: anywhere; font-size: 18px; font-weight: 700; }
#partnerEnergy button { cursor: default; opacity: 1; }
.segmented { overflow-x: auto; }
.segmented button { min-width: 0; overflow-wrap: anywhere; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 432px);
  height: 86px;
  border-radius: 30px;
  background: rgba(255, 252, 244, 0.96);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  box-shadow: 0 18px 42px rgba(88, 54, 68, 0.20);
  backdrop-filter: blur(16px);
  z-index: 20;
}

.bottom-nav button {
  border-radius: 24px;
  background: transparent;
  color: #7b6871;
  display: grid;
  place-items: center;
  gap: 3px;
  font-size: 14px;
  font-weight: 800;
}

.bottom-nav b {
  font: inherit;
}

.bottom-nav span { font-size: 24px; line-height: 1; }
.bottom-nav .active { background: var(--brand); color: white; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 760px) {
  body { padding: 28px 0; }
  .phone-shell {
    min-height: calc(100vh - 56px);
    border-radius: 38px;
    box-shadow: 0 22px 70px rgba(60, 30, 46, 0.16);
  }
  .bottom-nav { bottom: 36px; }
}

@media (max-width: 380px) {
  .date-grid { grid-template-columns: 1fr; }
  .app-screen { padding-left: 14px; padding-right: 14px; }
  .hero-card { min-height: 320px; padding: 24px; }
}
/* V2 test additions preserve the existing theme. */
.test-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 0 16px; color:var(--muted); font-size:14px; }
.test-bar .ghost-btn { padding:9px 12px; font-size:14px; }
.date-strip { display:flex; flex-wrap:nowrap; overflow-x:auto; gap:10px; padding-bottom:12px; scrollbar-width:thin; }
.date-strip .date-btn { flex:0 0 76px; min-height:110px; position:relative; }
.date-strip .locked-date { background:#ded2d4; color:#75656e; }
.date-strip .locked-date strong,.date-strip .locked-date>span:first-child { opacity:.65; }
.date-diamond { display:block; font-size:15px; }
.dish-actions { flex-wrap:wrap; }
.feature-dialog { border:1px solid #e9dee3; border-radius:28px; color:var(--ink); background:var(--card,#fffaf3); width:min(92vw,560px); max-height:85dvh; padding:32px 24px 24px; box-shadow:0 24px 80px #35172b40; }
.feature-dialog::backdrop { background:#35172b66; }
.feature-dialog .close-dialog { float:right; width:32px; height:32px; margin:-14px -10px 4px 8px; font-size:26px; }
.feature-dialog h2 { font-size:24px; margin:0 0 16px; }
.feature-dialog p { line-height:1.7; font-size:16px; }
.feature-dialog .primary-btn { margin-top:16px; }
.feature-dialog .ghost-btn { margin-top:12px; }
.benefit-list { padding-left:22px; font-size:16px; line-height:1.65; }
.benefit-list li { margin:15px 0; }
.benefit-number { font-size:1.22em; font-weight:850; color:var(--brand); white-space:nowrap; }
.avoidance-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:20px 0; }
.avoidance-grid label { display:flex; gap:8px; align-items:center; font-size:16px; }
.avoidance-grid input { width:20px; height:20px; accent-color:var(--brand); }
.ingredient-list { padding:0; list-style:none; }
.ingredient-list li { display:flex; justify-content:space-between; gap:16px; padding:14px 0; border-bottom:1px solid #e9dee3; font-size:16px; }
.payment-options { display:flex; flex-wrap:wrap; gap:12px; }
@media(max-width:420px) { .feature-dialog { padding:28px 20px 20px; } .date-strip .date-btn {flex-basis:68px;} }
.feature-dialog { background:#fffcf4; }
/* Membership: prominent opening, benefits in the middle, quiet closing. */
.membership-layout { display:grid; grid-template-rows:auto auto auto; gap:20px; }
.membership-header { min-height:145px; display:flex; flex-direction:column; justify-content:center; text-align:center; padding:10px 0 2px; }
.feature-dialog h2.membership-title { font-size:clamp(36px,9.5vw,48px); line-height:1.15; font-weight:900; letter-spacing:-.025em; margin:0 0 18px; }
.feature-dialog p.membership-subtitle { font-size:14px; font-weight:400; color:#96848c; line-height:1.7; margin:0; text-align:center; }
.membership-layout .benefit-list { margin:0; padding-left:22px; }
.membership-layout .benefit-list li { margin:0 0 18px; }
.membership-layout .benefit-list li:last-child { margin-bottom:0; }
.membership-footer { min-height:125px; text-align:center; padding-top:12px; }
.feature-dialog p.membership-sharing { font-family:'Kaiti SC','STKaiti','KaiTi','Songti SC','STSong','SimSun',serif; font-size:clamp(12px,3.4vw,15px); font-weight:400; font-style:italic; color:#9b818e; text-align:center; line-height:1.9; margin:0 0 12px; }
.membership-sharing span { display:block; white-space:nowrap; }
@media(min-width:600px) { .membership-header { min-height:165px; } }
.payment-qr { display:block; width:100%; max-width:320px; height:auto; margin:14px auto; border-radius:14px; }
.payment-save { display:block; color:var(--brand-dark); text-align:center; font-size:15px; margin:12px 0; }
.payment-options .selected { background:var(--brand); color:white; }
.bottom-nav button { position:relative; }
.nav-dot { display:block; position:absolute; top:12px; right:calc(50% - 22px); width:9px; height:9px; background:#e84152; border-radius:50%; box-shadow:0 0 0 2px #fffcf4; }
.recipe-steps { padding-left:22px; font-size:16px; line-height:1.75; }
.recipe-steps li { margin:14px 0; padding-left:3px; }
.feature-dialog h3 { font-size:19px; margin-top:24px; }

.membership-title .membership-brand,.membership-title .membership-heading { display:block; }
.membership-brand { white-space:nowrap; }
.payment-poster header { text-align:center; padding:20px 0 24px; }
.feature-dialog .payment-poster header h2 { font-size:clamp(36px,9.5vw,48px); font-weight:900; }
.membership-plans { display:grid; gap:12px; }
.plan-card { width:100%; display:grid; grid-template-columns:1fr auto; gap:8px 14px; text-align:left; border:2px solid #e5d7de; border-radius:22px; padding:18px; color:var(--ink); background:#fffaf5; font:inherit; cursor:pointer; }
.plan-card.selected { border-color:var(--brand); background:#f6e7ee; }
.plan-card>span { font-size:18px; font-weight:750; align-self:center; }
.plan-card>strong { font-size:34px; font-weight:900; color:var(--brand); }
.plan-card>small { grid-column:1/-1; font-size:14px; color:#826d78; }
.feature-dialog .payment-renewal,.feature-dialog .payment-test-note { font-size:14px; color:#826d78; }
.payment-notice { background:#f8e9ec; border:1px solid #e9c5cf; border-radius:20px; padding:18px; margin:24px 0 18px; }
.payment-notice>strong { display:block; color:#9c3054; font-size:22px; line-height:1.5; font-weight:900; }
.payment-notice p { margin:12px 0 0; }
.payment-service a { color:var(--brand); overflow-wrap:anywhere; }
.payment-guides { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:22px 0; }
.payment-guides figure { margin:0; text-align:center; }
.payment-guides img { display:block; width:100%; max-width:180px; height:auto; margin:auto; border-radius:12px; }
.payment-guides figcaption { font-size:14px; margin-top:8px; color:#826d78; }
.payment-next { width:100%; }
.payment-code { padding-top:12px; text-align:center; }
.payment-code code { display:block; padding:14px 8px; border-radius:14px; background:#f3e7eb; font-size:18px; overflow-wrap:anywhere; user-select:all; }
.selected-plan { text-align:center; }
.selected-plan strong { color:var(--brand); font-size:26px; }

.payment-pending { padding:16px; background:#f0e0e9; border-radius:16px; color:#873759; }

.support-form{display:grid;gap:18px;margin:24px 0}.support-form label{display:grid;gap:10px;font-weight:700}.support-form textarea,.support-form select{font:inherit;width:100%;padding:14px;border:1px solid #dfc4d0;border-radius:18px;background:#fffaf6;color:#35172b;box-sizing:border-box}.support-form textarea{resize:vertical}.support-thread{display:block;width:100%;text-align:left;margin:12px 0}.support-thread span{display:block;font-size:.85em;margin-top:6px}.support-message{padding:18px;border:1px solid #e8d8df;border-radius:20px;background:#fff;margin:14px 0;overflow-wrap:anywhere}.support-message p{white-space:pre-wrap;margin:10px 0 0}.support-message time{display:block;font-size:12px;color:#826d78;margin-top:5px}.support-reply{background:#f3e4eb}.support-actions{display:flex;gap:12px;flex-wrap:wrap}.support-room{overflow-wrap:anywhere}

#featureDialog [hidden]{display:none!important}

#editProfile{padding:0;overflow:hidden}#editProfile img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}

.dish-card,.plan-item{position:relative}.record-close{position:absolute;top:12px;right:12px;width:40px;height:40px;border:0;border-radius:50%;background:#f2e5e9;color:#923e6b;font-size:26px;cursor:pointer}.dish-card:has(.record-close) h2,.plan-item:has(.record-close) h2{padding-right:36px}

#learningList{margin-bottom:44px}#learningList .plan-item h2{font-size:1.25rem;line-height:1.45}#learningList .record-close{width:28px;height:28px;font-size:20px;line-height:1}#learningList .plan-item{padding-top:26px;padding-bottom:26px}
