:root {
  --paper: #fff5e8;
  --phone: #fffaf2;
  --card: #ffffff;
  --ink: #17110c;
  --muted: #786b60;
  --line: #f0dfcc;
  --brand: #ff4d00;
  --brand-2: #ff6a1a;
  --brand-soft: #fff0e7;
  --green: #22a35a;
  --green-soft: #edf9ed;
  --shadow: 0 18px 50px rgba(90, 52, 17, .16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 13%, rgba(255, 191, 99, .32), transparent 26%),
    radial-gradient(circle at 85% 20%, rgba(255, 104, 31, .18), transparent 28%),
    linear-gradient(135deg, #fff0d8 0%, #fff8ee 46%, #ffe9cc 100%);
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px;
}

.phone {
  position: relative;
  width: min(100%, 390px);
  height: 844px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border-radius: 34px;
  background: var(--phone);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .85);
}

.notch {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 50%;
  width: 134px;
  height: 29px;
  transform: translateX(-50%);
  border-radius: 0 0 18px 18px;
  background: #050505;
}

.statusbar {
  position: absolute;
  z-index: 19;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  color: #050505;
  font-size: 14px;
  font-weight: 800;
}

.screen {
  position: absolute;
  inset: 44px 0 72px;
  display: none;
  overflow-y: auto;
  padding: 18px 18px 28px;
  scrollbar-width: none;
}

.screen::-webkit-scrollbar { display: none; }
.screen.is-active { display: block; }

.phone.is-login .screen {
  bottom: 0;
}

.phone.is-login .bottom-nav {
  display: none;
}

.home-head,
.topline {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  font-weight: 900;
  color: var(--brand);
}

.brand b {
  color: var(--ink);
  font-weight: 800;
}

.play-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
}

.ghost-pill,
.text-btn,
.icon-btn {
  border: 0;
  background: #fff;
  color: var(--brand);
  font-weight: 800;
}

.ghost-pill {
  height: 31px;
  padding: 0 12px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(76, 46, 20, .08);
  font-size: 12px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  background: transparent;
}

.text-btn {
  background: transparent;
  font-size: 12px;
}

.topline strong {
  font-size: 17px;
}

.hero-copy {
  text-align: center;
  margin: 28px auto 18px;
}

.hero-copy h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.18;
  font-weight: 950;
}

.hero-copy h1 span {
  color: var(--brand);
}

.hero-copy p {
  width: 260px;
  margin: 10px auto 0;
  color: #5f544b;
  font-size: 14px;
  line-height: 1.7;
}

.login-copy {
  margin-top: 74px;
}

.login-card,
.records-card {
  border: 1px solid rgba(239, 223, 204, .9);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 10px 28px rgba(80, 44, 12, .06);
}

.login-card {
  display: grid;
  gap: 13px;
  margin-top: 42px;
  padding: 16px;
  border-radius: 17px;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.login-card input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  outline: 0;
  border-radius: 12px;
  padding: 0 13px;
  background: #fffaf5;
  color: var(--ink);
}

.login-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.video-preview {
  width: 236px;
  margin: 0 auto -18px;
  padding: 10px;
  border-radius: 13px;
  background: #101010;
  color: #fff;
  box-shadow: 0 18px 34px rgba(21, 12, 6, .22);
}

.creator-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 9px;
}

.creator-row b {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--brand);
}

.avatar {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff2e4;
  color: var(--ink);
}

.pan-scene {
  position: relative;
  height: 132px;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at center, rgba(255, 122, 32, .9) 0 10%, transparent 12%),
    radial-gradient(ellipse at 50% 58%, #3a2a1d 0 34%, #111 35% 56%, transparent 57%),
    linear-gradient(145deg, #54351f, #1b1510 58%, #090807);
}

.food-dot {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f34a19;
  box-shadow: 38px 16px 0 #f0bd32, 76px 4px 0 #2ba95f, 118px 23px 0 #f34a19;
}

.dot-1 { left: 34px; top: 42px; }
.dot-2 { left: 72px; top: 76px; transform: scale(.8); }
.dot-3 { left: 118px; top: 48px; transform: scale(.65); }

.play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--brand);
  font-size: 24px;
}

.input-card,
.upload-card,
.resolver-card,
.dish-card,
.summary-card,
.progress-card,
.metric-grid > div,
.mini-action,
.tab-panel,
.cart-list,
.nutrition-card {
  border: 1px solid rgba(239, 223, 204, .9);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 28px rgba(80, 44, 12, .06);
}

.input-card {
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding: 14px;
  border-radius: 17px;
}

textarea {
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  min-height: 70px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #fffaf5;
  color: var(--ink);
  line-height: 1.5;
}

.primary-btn,
.secondary-btn {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 13px;
  font-weight: 900;
}

.primary-btn {
  margin-top: 10px;
  color: #fff;
  background: linear-gradient(180deg, #ff6d1e, #ff3900);
}

.secondary-btn {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

button:disabled {
  opacity: .62;
  cursor: wait;
}

.mini-action:disabled {
  cursor: not-allowed;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 22px;
  color: #aa9a8e;
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.upload-card {
  padding: 10px;
  border-radius: 15px;
}

.upload-card input {
  width: 100%;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.resolver-card {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 13px;
  border-radius: 15px;
  font-size: 12px;
  color: var(--muted);
}

.records-card {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
}

.records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.records-list {
  display: grid;
  gap: 9px;
}

.record-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffaf5;
  color: var(--ink);
  text-align: left;
}

.record-main {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.record-row b {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.record-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.record-row em {
  color: var(--brand);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.record-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.record-actions button {
  min-width: 62px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.record-row.is-running em {
  color: #1c7f45;
}

.record-row.is-error em {
  color: #b12c1d;
}

.record-empty {
  padding: 24px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.resolver-card strong {
  color: var(--ink);
  font-size: 13px;
}

.resolver-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resolver-chip {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: #f6eee4;
  color: var(--muted);
}

.resolver-chip.on {
  color: var(--green);
  background: var(--green-soft);
}

.error-card {
  margin-top: 14px;
  padding: 13px;
  border-radius: 13px;
  background: #fff0ef;
  border: 1px solid #ffd4cc;
  color: #b12c1d;
  font-size: 13px;
  line-height: 1.6;
}

.error-card details { margin-top: 8px; }
.error-card pre { white-space: pre-wrap; word-break: break-word; }

.ai-orb {
  position: relative;
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  margin: 68px auto 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff7c25 0 54%, #ff4d00 55% 100%);
  color: #fff;
  box-shadow: 0 16px 36px rgba(255, 77, 0, .28);
  animation: breathe 1.5s ease-in-out infinite;
}

.ai-orb span {
  font-size: 48px;
  transform: translateX(4px);
}

.ai-orb b {
  position: absolute;
  right: -8px;
  bottom: 12px;
  padding: 7px 9px;
  border-radius: 10px;
  background: #ffbd5e;
  font-size: 18px;
}

@keyframes breathe {
  50% { transform: scale(1.045); }
}

#loadingView h2 {
  margin: 0;
  text-align: center;
  font-size: 21px;
}

.loading-note,
.tip {
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.progress-card {
  margin-top: 34px;
  padding: 12px 16px;
  border-radius: 15px;
}

.progress-step {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  min-height: 44px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.progress-step:first-child { border-top: 0; }
.progress-step b {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 11px;
}

.progress-step em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.progress-step.is-done b {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.progress-step.is-current b {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.progress-step.is-current em { color: var(--brand); }
.tip { margin-top: 28px; }

.dish-card {
  display: grid;
  grid-template-columns: 122px 1fr;
  gap: 14px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 16px;
}

.dish-cover {
  min-height: 130px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background:
    radial-gradient(circle at 28% 36%, #e43e19 0 9px, transparent 10px),
    radial-gradient(circle at 56% 48%, #eeb837 0 9px, transparent 10px),
    radial-gradient(circle at 72% 26%, #2ba95f 0 9px, transparent 10px),
    linear-gradient(145deg, #5d3722, #1c1510);
}

.dish-cover img {
  width: 100%;
  height: 100%;
  min-height: 130px;
  object-fit: cover;
}

.dish-cover span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: var(--brand);
}

.dish-main h2 {
  margin: 8px 0 8px;
  font-size: 26px;
  line-height: 1.15;
}

.tag-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 22px;
}

.tag-row span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
}

.dish-main p {
  margin: 10px 0;
  color: #41372f;
  font-size: 13px;
}

.dish-main strong {
  color: var(--brand);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 16px;
}

.metric-grid > div {
  min-height: 84px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 9px 4px;
  border-radius: 13px;
  text-align: center;
}

.metric-grid span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff7ef;
}

.metric-grid b { font-size: 15px; }
.metric-grid em { color: var(--muted); font-size: 11px; font-style: normal; }

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.mini-action {
  height: 69px;
  display: grid;
  place-items: center start;
  padding: 0 15px;
  border-radius: 14px;
  color: var(--ink);
  text-align: left;
}

.mini-action b { font-size: 15px; }
.mini-action span { color: var(--muted); font-size: 12px; }

.summary-card {
  margin: 14px 0 12px;
  padding: 14px;
  border-radius: 14px;
  color: #4c4036;
  font-size: 13px;
  line-height: 1.6;
}

.tabs {
  position: sticky;
  top: -18px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 -18px 10px;
  padding: 10px 18px 0;
  background: rgba(255, 250, 242, .94);
  backdrop-filter: blur(10px);
}

.tabs button {
  height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.tabs button.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.tab-panel {
  display: none;
  padding: 14px;
  border-radius: 15px;
}

.tab-panel.is-active { display: block; }

h3 {
  margin: 4px 0 10px;
  font-size: 15px;
}

h3:not(:first-child) { margin-top: 18px; }

.ingredient-list,
.step-list,
.cart-list {
  display: grid;
  gap: 8px;
}

.ingredient-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.ingredient-row:first-child { border-top: 0; }

.food-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff3e7;
  font-size: 18px;
}

.ingredient-row b,
.cart-row b {
  display: block;
  font-size: 14px;
}

.ingredient-row small,
.cart-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.ingredient-row em {
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  text-align: right;
}

.step-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 11px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.step-row:first-child { border-top: 0; }

.step-row.no-thumb {
  grid-template-columns: 1fr;
}

.step-thumb {
  position: relative;
  width: 86px;
  height: 66px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(145deg, #5d3722, #1c1510);
}

.step-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.step-index {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.step-row b {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  line-height: 1.35;
}

.inline-index {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  vertical-align: 2px;
}

.step-row span {
  color: var(--muted);
  font-size: 12px;
}

.nutrition-card {
  padding: 14px;
  border-radius: 15px;
  color: #4c4036;
  font-size: 13px;
  line-height: 1.6;
}

.nutrition-card .note {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.nutrition-card .note:first-child { border-top: 0; }

.cart-summary {
  display: flex;
  justify-content: space-between;
  margin: 18px 0 12px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.cart-list {
  padding: 13px;
  border-radius: 15px;
}

.cart-section {
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.cart-row {
  display: grid;
  grid-template-columns: 28px 1fr auto 72px;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.cart-row:first-child { border-top: 0; }

.cart-check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
}

.cart-price {
  color: #574940;
  font-size: 12px;
}

.qty {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.qty button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  color: var(--brand);
  background: #fff1e7;
}

.checkout-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 72px;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 112px;
  gap: 10px;
  align-items: center;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 250, 242, .96);
}

.checkout-bar label {
  color: var(--ink);
  font-size: 13px;
}

.checkout-bar strong {
  color: var(--brand);
}

.checkout-bar button {
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.bottom-nav {
  position: absolute;
  z-index: 18;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, .96);
  backdrop-filter: blur(12px);
}

.bottom-nav button {
  position: relative;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: #16100b;
  font-size: 11px;
  font-weight: 800;
}

.bottom-nav span {
  font-size: 21px;
  line-height: 1;
}

.bottom-nav button.is-active {
  color: var(--brand);
}

.bottom-nav i {
  position: absolute;
  top: 9px;
  right: 23px;
  min-width: 17px;
  height: 17px;
  display: none;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-style: normal;
}

.bottom-nav i.has-items { display: grid; }

@media (max-width: 430px) {
  .stage { padding: 0; }
  .phone {
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    border: 0;
  }
}
