:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --card: #ffffff;
  --ink: #17233d;
  --muted: #66748c;
  --line: #e1e7f1;
  --accent: #004eb6;
  --accent-soft: #e8f0fd;
  --orange: #ff9a00;
  --danger: #b3453c;
  --shadow: 0 14px 34px rgba(23, 35, 61, 0.09);
  --shadow-sm: 0 5px 16px rgba(23, 35, 61, 0.06);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 16%, rgba(214, 228, 250, 0.9) 0, transparent 34%),
    radial-gradient(circle at 82% 76%, rgba(255, 233, 205, 0.7) 0, transparent 38%),
    #f3f6fb;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 72px;
  padding: 28px;
}

.stage-copy {
  width: 360px;
  max-width: 34vw;
}

.stage-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #5c6a83;
  margin-bottom: 34px;
}

.stage-brand img {
  height: 21px;
  width: auto;
  display: block;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 107, 87, 0.12);
}

.stage-eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #8a978f;
  text-transform: uppercase;
}

.stage-copy h1 {
  margin: 0;
  font-size: clamp(38px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.stage-desc {
  margin: 22px 0 28px;
  font-size: 14px;
  line-height: 1.85;
  color: #5f6f66;
}

.stage-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(34, 53, 45, 0.12);
}

.stage-steps li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(34, 53, 45, 0.1);
  font-size: 13px;
  color: #4c5e54;
}

.stage-steps span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9aa69f;
}

.stage-note {
  margin-top: 24px;
  font-size: 11px;
  line-height: 1.7;
  color: #97a29b;
}

/* Phone shell */
.phone {
  width: 390px;
  height: min(844px, calc(100vh - 56px));
  min-height: 620px;
  background: #101714;
  border-radius: 50px;
  padding: 9px;
  box-shadow:
    0 40px 90px rgba(24, 39, 32, 0.34),
    0 8px 22px rgba(24, 39, 32, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  flex: 0 0 auto;
}

.app {
  position: relative;
  height: 100%;
  border-radius: 41px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.statusbar {
  flex: 0 0 auto;
  height: 30px;
  padding: 8px 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-icons svg {
  height: 10px;
  fill: currentColor;
  stroke: none;
}

.status-icons .sig { width: 15px; }
.status-icons .wifi { width: 14px; }
.status-icons .batt { width: 21px; }
.status-icons .batt rect:first-child { fill: none; stroke: currentColor; stroke-width: 1; }
.status-icons .batt rect:nth-child(2) { fill: currentColor; }
.status-icons .batt path { stroke: currentColor; stroke-width: 1.2; }

.screen-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.screen.active {
  display: flex;
  animation: screenIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 16px 6px;
}

.topbar-title {
  min-width: 0;
}

.topbar-title h2 {
  margin: 1px 0 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.step-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #93a098;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
}

.icon-btn:active { transform: scale(0.96); }

.progress-steps {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 0 16px 8px;
}

.progress-steps i {
  height: 4px;
  flex: 1;
  border-radius: 3px;
  background: #e2dcd1;
  transition: background 0.2s;
}

.progress-steps i.on { background: var(--accent); }

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 24px;
  scrollbar-width: none;
}

.scroll::-webkit-scrollbar { display: none; }

.screen.main .scroll { padding-bottom: 100px; }

.actions {
  flex: 0 0 auto;
  padding: 10px 16px 14px;
  background: linear-gradient(to top, var(--bg) 72%, rgba(244, 241, 234, 0));
}

.actions .btn + .btn { margin-top: 8px; }

.home-indicator {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 118px;
  height: 5px;
  border-radius: 4px;
  background: rgba(34, 53, 45, 0.22);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 30;
}

/* Generic buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.16s, background 0.16s, box-shadow 0.16s;
}

.btn:active { transform: scale(0.985); }

.btn .icon { width: 20px; height: 20px; }

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 9px 20px rgba(47, 107, 87, 0.22);
}

.btn.soft {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 3px 10px rgba(34, 53, 45, 0.03);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  min-height: 48px;
  font-size: 14px;
}

.btn.danger { background: var(--danger); color: #fff; }

.btn.hero-btn {
  background: #f0a15f;
  color: #2b1a0d;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.btn.hero-btn .icon:last-child { margin-left: auto; }

.text-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.text-link.center {
  display: block;
  margin: 12px auto 0;
  font-size: 13px;
}

.fineprint {
  margin: 14px 2px 0;
  font-size: 10.5px;
  line-height: 1.7;
  color: #94a098;
}

.lead {
  margin: 2px 2px 14px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

.chev { margin-left: auto; color: #b3ada1; width: 18px; height: 18px; }

/* Home */
.home-head {
  flex: 0 0 auto;
  padding: 18px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-kicker {
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: #8c9a92;
}

.home-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.avatar {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 15px;
  border: 1px solid rgba(0, 78, 182, 0.14);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(23, 35, 61, 0.06);
}

.avatar img {
  width: 26px;
  height: 26px;
  display: block;
}

.hero-logo {
  position: relative;
  display: block;
  height: 19px;
  width: auto;
  margin-bottom: 12px;
}

.home-hero {
  position: relative;
  overflow: hidden;
  margin: 8px 0 20px;
  padding: 24px 22px 20px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 0%, rgba(255, 154, 0, 0.38) 0, transparent 42%),
    linear-gradient(145deg, #062a5e 0%, #08408f 56%, #0b57bd 100%);
  color: #fff;
  box-shadow: 0 18px 38px rgba(6, 42, 94, 0.28);
}

.hero-orbit {
  position: absolute;
  width: 250px;
  height: 250px;
  right: -96px;
  top: -108px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 0 0 26px rgba(255, 255, 255, 0.04),
    0 0 0 62px rgba(255, 255, 255, 0.025);
}

.hero-pill {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.85);
}

.home-hero h1 {
  position: relative;
  margin: 12px 0 2px;
  font-size: 31px;
  line-height: 1.18;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.hero-range {
  position: relative;
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.66);
  letter-spacing: 0.02em;
}

.hero-copy {
  position: relative;
  margin: 16px 0 19px;
  font-size: 12px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.7);
}

.hero-btn {
  position: relative;
  min-height: 56px;
  font-size: 16px;
}

.section-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 2px 2px 9px;
}

.section-row h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.last-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.last-card:active { transform: scale(0.99); }

.mini-poster {
  width: 62px;
  height: 82px;
  border-radius: 9px;
  background: var(--p-bg);
  color: var(--p-ink);
  padding: 8px 7px;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.mp-kicker {
  font-size: 5px;
  letter-spacing: 0.1em;
  color: var(--p-accent);
  font-weight: 700;
}

.mp-title {
  font-size: 9px;
  font-weight: 800;
  margin: 2px 0 6px;
}

.mini-poster i {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.14;
  margin-bottom: 4px;
}

.mini-poster i:nth-child(3n) { width: 74%; }

.last-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.last-meta strong { font-size: 14px; }

.last-meta span { font-size: 11px; color: var(--muted); }

.last-meta em {
  margin-top: 4px;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 1px;
}

.last-meta em .icon { width: 14px; height: 14px; }

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

.quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(34, 53, 45, 0.03);
}

.quick-card:active { transform: scale(0.985); }

.q-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 5px;
}

.q-icon .icon { width: 18px; height: 18px; }

.q-icon-warm { background: #fbede0; color: #b86b30; }

.quick-card strong { font-size: 13px; }

.quick-card em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
}

.first-tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 15px;
  background: #fbf3df;
  border: 1px solid #f0e2bd;
}

.tip-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #fff;
  color: #b8862d;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.tip-icon .icon { width: 14px; height: 14px; }

.first-tip p {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: #7a6a45;
}

.first-tip strong { color: #594a2b; }

/* Input */
.upload-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.upload-card:active { transform: scale(0.99); }

.u-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.upload-card.alt .u-icon { background: #fdf0e2; color: #bf7134; }
.upload-card.quiet .u-icon { background: #f1ede5; color: #7d877f; }

.u-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.u-copy strong { font-size: 15px; }

.u-copy span {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.upload-card.quiet {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}

.example-card {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 2px 8px;
}

.soft-badge {
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
}

.fake-shot {
  position: relative;
  overflow: hidden;
  height: 166px;
  padding: 12px;
  border: 1px solid #ece6db;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 4px #fbfaf7;
}

.shot-title {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.shot-table {
  border-top: 1px solid #eee8dc;
}

.shot-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 2px 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f0ece3;
  font-size: 7.5px;
  line-height: 1.45;
  color: #5e6a63;
}

.shot-row b {
  font-size: 8px;
  color: #2f3f36;
  padding-top: 1px;
}

.shot-row span:nth-child(2) { color: #8a938d; }

.shot-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38px;
  background: linear-gradient(to top, #fff, rgba(255, 255, 255, 0));
}

/* Verify */
.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 13px;
  margin-bottom: 11px;
  border: 1px solid #efdfb2;
  border-radius: 15px;
  background: #fff8e3;
}

.banner.ok {
  border-color: #cfe6d8;
  background: #ecf6ef;
}

.b-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fff;
  color: #bd8a26;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.banner.ok .b-icon { color: var(--accent); }
.b-icon .icon { width: 15px; height: 15px; }

.banner strong {
  display: block;
  font-size: 12px;
  color: #66542e;
}

.banner.ok strong { color: #2f5d47; }

.banner p {
  margin: 2px 0 0;
  font-size: 10.5px;
  line-height: 1.55;
  color: #907d52;
}

.banner.ok p { color: #668273; }

.banner .text-link {
  margin-left: auto;
  padding-top: 3px;
  color: #9b671f;
  white-space: nowrap;
  font-size: 11px;
}

.banner.ok .text-link { color: var(--accent); }

.week-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px 10px 13px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.week-info div { flex: 1; min-width: 0; }
.week-info strong { display: block; font-size: 13px; letter-spacing: -0.01em; }
.week-info span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }

.meal-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px 9px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.meal-switch > span:first-child {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.seg {
  display: flex;
  margin-left: auto;
  padding: 3px;
  border-radius: 10px;
  background: #f1ede5;
}

.seg button {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 8px;
  color: #8b948d;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.seg button.on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.seg.small button { padding: 5px 9px; font-size: 11px; }

.demo-tag {
  font-size: 8px;
  color: #a38f6e;
  border: 1px solid #e4d8c1;
  border-radius: 5px;
  padding: 2px 4px;
  letter-spacing: 0.04em;
}

.day-card {
  margin-bottom: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(34, 53, 45, 0.03);
}

.day-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 5px;
}

.day-head strong { font-size: 16px; letter-spacing: -0.02em; }
.day-head span { font-size: 10px; color: #8d99ab; }

.day-kind {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf3fd;
  color: var(--accent);
  font-style: normal;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.day-kind.single {
  background: #fff2dd;
  color: #9a5b08;
}

.meal-row {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px dashed #eee8dc;
}

.meal-row:first-of-type { border-top: 0; }

.meal-label {
  flex: 0 0 38px;
  padding-top: 5px;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.dishes {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.dish {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 4px 8px 4px 5px;
  border: 1px solid #e3eaf4;
  border-radius: 9px;
  background: #f8fafd;
  font-size: 12px;
  line-height: 1.35;
  color: #26364f;
  cursor: pointer;
}

.dish-role {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 17px;
  padding: 0 3px;
  border-radius: 5px;
  background: #e9f0fb;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
}

.dish.low .dish-role {
  background: #f4dfa4;
  color: #815408;
}

.dish:active { transform: scale(0.97); }

.dish.low {
  border-color: #e8cf84;
  background: #fff3c9;
  box-shadow: 0 0 0 2px rgba(232, 207, 132, 0.24);
}

.dish.low::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 5px;
  border-radius: 50%;
  background: #c58a1d;
  vertical-align: middle;
}

.meal-add {
  width: 28px;
  height: 28px;
  border: 1px dashed #d8d0c1;
  border-radius: 9px;
  background: transparent;
  color: #a79d8c;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* Templates */
.tpl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 2px 0 4px;
}

.tpl-card {
  position: relative;
  padding: 7px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #fff;
  text-align: left;
  box-shadow: 0 3px 10px rgba(34, 53, 45, 0.04);
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

.tpl-card:active { transform: scale(0.985); }

.tpl-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.12);
}

.tpl-thumb {
  height: 120px;
  overflow: hidden;
  padding: 10px;
  border-radius: 10px;
  background: var(--p-bg);
  color: var(--p-ink);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.045);
}

.tt-head {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--p-accent);
}

.tt-title {
  margin: 2px 0 4px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.tt-rule {
  width: 22px;
  height: 2px;
  margin-bottom: 7px;
  border-radius: 1px;
  background: var(--p-accent);
}

.tt-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}

.tt-img {
  width: 21px;
  height: 21px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--p-accent), var(--p-soft));
  flex: 0 0 auto;
}

.tt-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tt-lines i {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.17;
}

.tt-lines i:nth-child(2) { width: 68%; }

.tpl-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  padding: 7px 30px 1px 2px;
}

.tpl-meta strong { font-size: 12px; }
.tpl-meta span { font-size: 9px; color: var(--muted); }

.tpl-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.09);
}

.tpl-check {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: none;
  place-items: center;
  box-shadow: 0 2px 8px rgba(47, 107, 87, 0.3);
}

.tpl-check .icon { width: 12px; height: 12px; stroke-width: 3; }
.tpl-card.selected .tpl-check { display: grid; }

/* Preview */
.preview-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 1px 2px 8px;
  font-size: 11px;
  color: var(--muted);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3c9a72;
  box-shadow: 0 0 0 4px rgba(60, 154, 114, 0.12);
}

.preview-meta .text-link { margin-left: auto; }

.preview-warn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  margin: -1px 0 9px;
  border: 1px solid #efdfb2;
  border-radius: 12px;
  background: #fff8e3;
  color: #8a6a2c;
  font-size: 10.5px;
  line-height: 1.45;
}

.preview-warn[hidden] { display: none; }
.preview-warn .icon { width: 14px; height: 14px; color: #bd8a26; flex: 0 0 auto; }
.preview-warn .text-link { margin-left: auto; color: #9b671f; font-size: 10.5px; white-space: nowrap; }

.poster-wrap {
  position: relative;
  padding: 10px;
  border-radius: 20px;
  background: #ded7c9;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.poster-scroll {
  max-height: 50vh;
  min-height: 280px;
  overflow-y: auto;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.13);
  scrollbar-width: none;
}

.poster-scroll::-webkit-scrollbar { display: none; }

.poster-fade {
  display: none;
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 34px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(to top, rgba(222, 215, 201, 0.9), rgba(222, 215, 201, 0));
  pointer-events: none;
}

.preview-hint {
  margin: 9px 2px 0;
  font-size: 10.5px;
  line-height: 1.6;
  color: #8e9a92;
  text-align: center;
}

.action-row {
  display: flex;
  gap: 9px;
  margin-top: 8px;
}

.action-row .btn {
  flex: 1;
  min-height: 47px;
  font-size: 14px;
}

/* Poster — branded weekly menu */
.poster {
  width: 100%;
  min-height: 100%;
  background: var(--p-bg, #faf6ec);
  color: var(--p-ink, #1f332a);
  font-family: var(--p-font, var(--sans));
  --p-band: color-mix(in srgb, var(--p-accent) 82%, #10231b);
  --p-card: #fff;
  --p-line: color-mix(in srgb, var(--p-ink) 13%, transparent);
  --p-muted: color-mix(in srgb, var(--p-ink) 56%, transparent);
  --p-gold: color-mix(in srgb, var(--p-accent) 45%, #b79b63);
  transition: background 0.2s, color 0.2s;
}

.poster.theme-t13 {
  --p-band: #1d3a2c;
  --p-card: #fffdf8;
  --p-line: #e7dfcb;
  --p-muted: #7c8072;
  --p-gold: #b49a63;
}

.poster.theme-t04 {
  --p-band: #15281f;
  --p-card: rgba(255, 255, 255, 0.045);
  --p-line: rgba(255, 255, 255, 0.16);
  --p-muted: rgba(248, 241, 223, 0.66);
  --p-gold: #e0c68c;
}

.p-top,
.p-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  overflow: hidden;
  background: var(--p-band);
  color: #fff;
}

.p-top::before {
  content: '';
  position: absolute;
  right: -44px;
  top: -58px;
  width: 138px;
  height: 138px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.045), 0 0 0 40px rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.p-logo {
  position: relative;
  display: block;
  width: auto;
  height: 22px;
}

.p-top .p-logo { height: 24px; }
.p-foot .p-logo { height: 19px; }

.p-hotline {
  position: relative;
  flex: 0 0 auto;
  text-align: right;
  line-height: 1.2;
}

.p-hotline span {
  display: block;
  font-size: 6.4px;
  letter-spacing: 0.18em;
  opacity: 0.74;
}

.p-hotline strong {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.p-body { padding: 20px 14px 16px; }

.p-hero {
  margin-bottom: 15px;
  text-align: center;
}

.p-kicker {
  display: block;
  color: var(--p-gold);
  font-size: 6.3px;
  letter-spacing: 0.22em;
}

.p-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 7px;
}

.p-title-row h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.10em;
}

.p-orn {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 1px;
  background: color-mix(in srgb, var(--p-gold) 62%, transparent);
}

.p-orn::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  width: 4px;
  height: 4px;
  background: var(--p-gold);
  transform: translateY(-50%) rotate(45deg);
}

.p-orn.flip { transform: scaleX(-1); }

.p-sub {
  margin-top: 8px;
  color: var(--p-muted);
  font-size: 8.2px;
  letter-spacing: 0.04em;
}

.p-sub i {
  margin: 0 6px;
  font-style: normal;
  opacity: 0.5;
}

.p-promo-line {
  display: inline-block;
  margin-top: 7px;
  color: var(--p-gold);
  font-family: var(--serif);
  font-size: 8.4px;
  letter-spacing: 0.04em;
}

.p-promo-line::before,
.p-promo-line::after {
  content: '·';
  margin: 0 6px;
  opacity: 0.75;
}

.p-day {
  margin-bottom: 11px;
  padding: 12px 11px 13px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: var(--p-card);
}

.p-day-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.p-day-badge {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  padding: 4px 0 5px;
  border: 1px solid var(--p-line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--p-soft) 55%, var(--p-card));
}

.p-day-badge span {
  color: var(--p-muted);
  font-size: 6px;
  letter-spacing: 0.14em;
}

.p-day-badge strong {
  font-size: 12.5px;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.p-day-mood {
  min-width: 0;
  overflow: hidden;
  color: var(--p-muted);
  font-size: 7.4px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-day-pill {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3.5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--p-accent) 10%, var(--p-card));
  color: var(--p-accent);
  font-size: 6.8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.p-dishes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.p-dishes.cols-3 { grid-template-columns: repeat(3, 1fr); }
.p-dishes.cols-2 { grid-template-columns: repeat(2, 1fr); }

.p-dish {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.p-dish-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--p-soft);
}

.p-dish-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-dish-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 1px dashed color-mix(in srgb, var(--p-accent) 40%, transparent);
  background: var(--p-soft);
  color: var(--p-accent);
  font-size: 6.5px;
  line-height: 1.3;
  text-align: center;
}

.p-change {
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--p-accent);
  font-size: 6.5px;
  font-style: normal;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.15s;
}

.poster.picking .p-change,
.p-dish:hover .p-change,
.p-feature-photo:hover .p-change { opacity: 1; }

.poster.picking .p-dish-photo,
.poster.picking .p-feature-photo {
  outline: 2px solid color-mix(in srgb, var(--p-accent) 55%, transparent);
  outline-offset: 2px;
}

.p-dish-role {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  color: var(--p-accent);
  font-size: 6.4px;
  letter-spacing: 0.06em;
}

.p-dish-role > i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.p-dish-name {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.p-dish-desc {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--p-muted);
  font-size: 6.4px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-feature {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: 12px;
}

.p-feature-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.5 / 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: var(--p-soft);
  cursor: pointer;
}

.p-feature-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-feature-info { min-width: 0; }

.p-feature-kicker {
  display: block;
  overflow: hidden;
  color: var(--p-gold);
  font-size: 6.2px;
  letter-spacing: 0.14em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-feature-name {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.p-feature-rule {
  display: block;
  width: 22px;
  height: 1px;
  margin: 6px 0 5px;
  background: var(--p-gold);
}

.p-feature-desc {
  margin: 0;
  color: var(--p-muted);
  font-size: 7.2px;
  line-height: 1.55;
}

.p-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.p-tags span {
  padding: 2px 5px;
  border: 1px solid var(--p-line);
  border-radius: 999px;
  color: var(--p-muted);
  font-size: 5.8px;
  letter-spacing: 0.02em;
}

.p-tips {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--p-line);
}

.p-tips-label {
  color: var(--p-gold);
  font-size: 6.4px;
  letter-spacing: 0.28em;
  text-align: center;
}

.p-tip-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 10px;
}

.p-tip strong {
  display: block;
  color: var(--p-ink);
  font-size: 7.8px;
  line-height: 1.35;
}

.p-tip p {
  margin: 3px 0 0;
  color: var(--p-muted);
  font-size: 6.3px;
  line-height: 1.6;
}

.p-foot { padding: 12px 16px; }

.p-foot-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.p-foot-brand > i {
  flex: 0 0 auto;
  width: 1px;
  height: 15px;
  background: rgba(255, 255, 255, 0.28);
}

.p-foot-slogan {
  overflow: hidden;
  font-size: 6.8px;
  letter-spacing: 0.03em;
  opacity: 0.82;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Tabs */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  height: 68px;
  padding: 6px 14px 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(255, 253, 249, 0.94);
  border-top: 1px solid rgba(34, 53, 45, 0.08);
  backdrop-filter: blur(14px);
  transition: transform 0.22s, opacity 0.22s;
}

.app.tab-hidden .tabbar {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.tabbar button {
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 58px;
  padding: 4px 8px;
  border-radius: 12px;
  color: #98a29b;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
}

.tabbar button .icon { width: 20px; height: 20px; }

.tabbar button.on { color: var(--accent); }

/* Gallery */
.library-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid #dce9e0;
  border-radius: 15px;
  background: #edf5f0;
}

.lb-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fff;
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.lb-icon .icon { width: 15px; height: 15px; }

.library-banner p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.55;
  color: #6d8175;
}

.library-banner strong { font-size: 12px; color: #2f5b46; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 13px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: #a3ada6;
}

.search-box .icon { width: 18px; height: 18px; }

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}

.search-box input::placeholder { color: #a9b2ab; }

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gallery-card {
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: #fff;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 3px 12px rgba(34, 53, 45, 0.05);
  cursor: pointer;
}

.gallery-card:active { transform: scale(0.985); }

.gallery-img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #eee;
  overflow: hidden;
}

.gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.use-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(16, 23, 20, 0.55);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.gallery-meta {
  padding: 8px 9px 9px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}

.gallery-meta strong { font-size: 12px; }
.gallery-meta span { font-size: 9px; color: var(--muted); }

.empty-state {
  grid-column: 1 / -1;
  padding: 38px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* History */
.history-list { display: flex; flex-direction: column; gap: 11px; }

.history-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.history-card:active { transform: scale(0.99); }

.history-thumb {
  width: 64px;
  height: 84px;
  border-radius: 8px;
  padding: 8px 7px;
  background: var(--p-bg);
  color: var(--p-ink);
  flex: 0 0 auto;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.history-thumb b {
  display: block;
  font-size: 5px;
  letter-spacing: 0.08em;
  color: var(--p-accent);
  margin-bottom: 2px;
}

.history-thumb strong {
  display: block;
  font-size: 9px;
  margin-bottom: 7px;
}

.history-thumb i {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.16;
  margin-bottom: 4px;
}

.history-meta { min-width: 0; flex: 1; }
.history-meta .h-top { display: flex; align-items: center; gap: 6px; }
.history-meta strong { font-size: 14px; }

.history-meta .h-tag {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 8px;
  font-weight: 700;
}

.history-meta p {
  margin: 3px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}

.history-meta em {
  display: inline-block;
  margin-top: 5px;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
}

.history-meta em.muted { color: #a6afa8; }

/* Settings */
.settings-card {
  padding: 14px;
  margin-bottom: 11px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(34, 53, 45, 0.03);
}

.settings-card .field-label { margin-top: 0; }

.settings-card .fineprint { margin-top: 7px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f1ece2;
}

.setting-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.setting-row:first-child { padding-top: 1px; }

.setting-row strong { display: block; font-size: 13px; }
.setting-row span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); line-height: 1.45; }

.switch {
  width: 48px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #d8d3c8;
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
  transition: background 0.18s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s;
}

.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }

.promo-options {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.promo-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: #41506b;
  font-size: 11.5px;
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
}

.promo-option.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #123a76;
}

.promo-radio {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  border: 1.5px solid #c3cddd;
  border-radius: 50%;
  background: #fff;
}

.promo-option.on .promo-radio {
  border: 4px solid var(--accent);
}

.reset-btn { min-height: 48px; font-size: 14px; margin-top: 2px; }

.about-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #f0ece3;
  color: #6e7a72;
}

.about-card strong { font-size: 12px; color: #46564d; }
.about-card p { margin: 5px 0 0; font-size: 10.5px; line-height: 1.65; }
.about-card .about-version { color: #9aa49d; font-size: 9px; }

/* Field */
.field-label {
  display: block;
  margin: 12px 2px 6px;
  font-size: 11px;
  color: var(--muted);
}

.input {
  width: 100%;
  height: 50px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  outline: none;
  font-size: 16px;
}

.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.1); }

.textarea {
  height: 176px;
  padding: 11px 13px;
  line-height: 1.75;
  font-size: 12px;
  resize: none;
}

.role-pick {
  display: flex;
  gap: 6px;
  margin: 2px 0 4px;
}

.role-chip {
  flex: 1;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.role-chip.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Overlay */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 28, 24, 0.55);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.2s ease both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.scan-card {
  width: 100%;
  padding: 16px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.3);
}

.scan-shot {
  position: relative;
  overflow: hidden;
  height: 190px;
  padding: 13px;
  border: 1px solid #eee7db;
  border-radius: 13px;
  background: #fff;
}

.scan-shot .shot-title {
  font-size: 9px;
  font-weight: 800;
  margin-bottom: 8px;
}

.scan-shot .shot-row {
  grid-template-columns: 34px 1fr;
  padding: 6px 0;
  font-size: 7.5px;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2f80ff, transparent);
  box-shadow: 0 0 16px #2f80ff;
  animation: scan 1.7s ease-in-out infinite;
}

@keyframes scan {
  0% { top: 7%; }
  50% { top: 90%; }
  100% { top: 7%; }
}

.scan-title {
  margin: 14px 0 2px;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
}

.scan-sub {
  text-align: center;
  font-size: 10.5px;
  color: var(--muted);
}

.progress {
  height: 6px;
  margin-top: 13px;
  border-radius: 4px;
  background: #eee9df;
  overflow: hidden;
}

.progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  animation: fill 1.95s linear forwards;
}

@keyframes fill { to { width: 100%; } }

.gen-card {
  width: 210px;
  padding: 22px 18px;
  border-radius: 22px;
  background: #fff;
  text-align: center;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.3);
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 13px;
  border: 3px solid #e5ded2;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.gen-card strong { display: block; font-size: 15px; }
.gen-card span { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }

/* Sheets */
#sheetRoot {
  position: absolute;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

#sheetRoot.open { pointer-events: auto; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 28, 24, 0.42);
  opacity: 0;
  transition: opacity 0.22s;
}

#sheetRoot.open .sheet-backdrop { opacity: 1; }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88%;
  overflow-y: auto;
  padding: 9px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.2);
  transform: translateY(102%);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  scrollbar-width: none;
}

.sheet::-webkit-scrollbar { display: none; }
#sheetRoot.open .sheet { transform: translateY(0); }

.sheet-grab {
  width: 36px;
  height: 4px;
  margin: 0 auto 11px;
  border-radius: 3px;
  background: #ded6c7;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sheet-head h3 {
  margin: 1px 0 0;
  font-size: 21px;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.sheet-sub {
  margin: 2px 2px 12px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.sheet-actions {
  display: flex;
  gap: 9px;
  margin-top: 13px;
}

.sheet-actions .btn { flex: 1; min-height: 50px; font-size: 15px; }

.danger-link {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  border: 0;
  background: none;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.compare {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  margin-bottom: 6px;
  border: 1px solid #efdfb2;
  border-radius: 14px;
  background: #fff8e3;
}

.compare > div { display: flex; flex-direction: column; gap: 2px; }
.compare span { font-size: 9px; color: #9b8555; }
.compare .wrong { font-size: 17px; font-weight: 800; color: #b28a35; text-decoration: line-through; }
.compare .right { font-size: 18px; font-weight: 800; color: var(--accent); }
.compare .arrow { width: 22px; height: 22px; color: #c5a85f; flex: 0 0 auto; }

.cand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 12px;
}

.cand {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  background: #eee;
  cursor: pointer;
}

.cand img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cand.on { border-color: var(--accent); }

.cand-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: none;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.cand.on .cand-check { display: grid; }

.cand.none {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px dashed #d9d1c2;
  background: #f5f1e8;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.lib-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-bottom: 10px;
  border-radius: 15px;
  overflow: hidden;
  background: #eee;
}

.lib-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Save sheet */
.save-sheet { text-align: center; }

.big-check {
  width: 62px;
  height: 62px;
  margin: 6px auto 11px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.big-check .icon { width: 28px; height: 28px; stroke-width: 2.4; }

.save-sheet h3 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }

.fake-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 13px 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #faf8f3;
  text-align: left;
}

.ff-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.fake-file strong { display: block; font-size: 11px; }
.fake-file span { display: block; margin-top: 2px; font-size: 9px; color: var(--muted); }
.fake-file .icon { width: 20px; height: 20px; margin-left: auto; color: var(--accent); }

.save-sheet .btn { margin-top: 8px; }

/* Toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: 96px;
  z-index: 120;
  max-width: 82%;
  padding: 10px 16px;
  border-radius: 999px;
  background: #22352d;
  color: #fff;
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 步骤页没有底部导航，提示条抬高，避免压住操作按钮 */
.app.tab-hidden .toast { bottom: 152px; }

/* 底部面板打开时，提示条移到顶部，不挡住面板里的按钮 */
#sheetRoot.open ~ .toast {
  top: 20px;
  bottom: auto;
  transform: translate(-50%, -10px);
}
#sheetRoot.open ~ .toast.show { transform: translate(-50%, 0); }

/* Theme palettes */
.theme-t01 { --p-accent: #2f6b57; --p-bg: #ffffff; --p-ink: #1f2b26; --p-soft: #edf4ef; --p-radius: 18px; }
.theme-t02 { --p-accent: #b85c24; --p-bg: #fff8ee; --p-ink: #3a2a1c; --p-soft: #fbe9d2; --p-radius: 20px; }
.theme-t03 { --p-accent: #2f7a4f; --p-bg: #f3fbf5; --p-ink: #1f3b2c; --p-soft: #e2f3e8; --p-radius: 16px; }
.theme-t04 { --p-accent: #f0dfb6; --p-bg: #203c34; --p-ink: #f8f1df; --p-soft: #2c4b42; --p-radius: 10px; }
.theme-t05 { --p-accent: #7a2e2e; --p-bg: #f7f2e7; --p-ink: #2b2620; --p-soft: #ece4d3; --p-radius: 3px; }
.theme-t06 { --p-accent: #b3352c; --p-bg: #fff5ef; --p-ink: #3b1f1a; --p-soft: #f9e0d5; --p-radius: 14px; }
.theme-t07 { --p-accent: #b84c74; --p-bg: #fff7fb; --p-ink: #4a2b38; --p-soft: #ffe5ef; --p-radius: 24px; }
.theme-t08 { --p-accent: #2f6fb3; --p-bg: #f4f9ff; --p-ink: #1c2f45; --p-soft: #e1eefc; --p-radius: 18px; }
.theme-t09 { --p-accent: #5f7040; --p-bg: #f7f5ee; --p-ink: #33382c; --p-soft: #ece9dc; --p-radius: 16px; }
.theme-t10 { --p-accent: #111111; --p-bg: #ffffff; --p-ink: #111111; --p-soft: #f0f0f0; --p-radius: 1px; }
.theme-t11 { --p-accent: #004eb6; --p-bg: #f7f9fd; --p-ink: #17233d; --p-soft: #e7eefb; --p-radius: 12px; }
.theme-t12 { --p-accent: #a9642b; --p-bg: #fffaf2; --p-ink: #3d3024; --p-soft: #f8ecd9; --p-radius: 22px; }
.theme-t13 { --p-accent: #1d3a2c; --p-bg: #faf6ec; --p-ink: #1f332a; --p-soft: #f0e9d8; --p-radius: 12px; }

.font-sans { --p-font: var(--sans); }
.font-serif { --p-font: var(--serif); }
.font-kai { --p-font: var(--kai); }

/* Mobile full screen */
@media (max-width: 760px) {
  body { background: var(--bg); }
  .stage { display: block; min-height: 100dvh; padding: 0; }
  .stage-copy { display: none; }
  .phone {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg);
  }
  .app { border-radius: 0; }
  .statusbar, .home-indicator { display: none; }
  .poster-scroll { max-height: 52vh; }
}

@media (max-width: 980px) and (min-width: 761px) {
  .stage { gap: 28px; padding: 18px; }
  .stage-copy { max-width: 300px; }
  .stage-copy h1 { font-size: 40px; }
}

@media (max-width: 860px) {
  .stage-copy { display: none; }
  .stage { justify-content: center; }
}

@media (max-height: 720px) and (min-width: 761px) {
  .phone { height: 640px; min-height: 0; }
  .poster-scroll { max-height: 300px; }
}

/* ------------------------------------------------------------------ *
 *  v2.0 additions: auth gate, real export preview, library states
 * ------------------------------------------------------------------ */

.phone { position: relative; }

.text-link.danger { color: var(--danger); }

.auth-gate {
  position: absolute;
  inset: 9px;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 22px;
  border-radius: 41px;
  background: var(--bg);
  overflow-y: auto;
  scrollbar-width: none;
}

.auth-gate::-webkit-scrollbar { display: none; }
.auth-gate[hidden] { display: none; }

.auth-card { width: 100%; max-width: 320px; }

.auth-logo {
  width: 138px;
  height: auto;
  display: block;
  margin-bottom: 20px;
}

.auth-kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #93a098;
}

.auth-card h1 {
  margin: 6px 0 8px;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.auth-sub {
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.auth-error {
  min-height: 18px;
  margin: 8px 2px 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--danger);
}

.auth-submit {
  width: 100%;
  margin-top: 10px;
  min-height: 54px;
  font-size: 16px;
}

.auth-gate .fineprint { margin-top: 16px; }

/* Real poster preview inside the save sheet */
.save-preview {
  max-height: 280px;
  margin: 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f3efe6;
  overflow: auto;
  scrollbar-width: thin;
}

.save-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.save-sheet a.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-top: 8px;
}

/* Gallery / library loading and empty covers */
.lib-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px 10px;
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

.lib-loading .spinner {
  width: 20px;
  height: 20px;
  margin: 0;
  border-width: 2px;
}

.gallery-none {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #a9b2ab;
  background: #f1eee7;
}

.history-thumb.thumbed { padding: 0; background: #eee; }
.history-thumb.thumbed img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mini-poster.thumbed { padding: 0; background: #eee; }
.mini-poster.thumbed img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Poster placeholder for a day without dishes */
.p-empty {
  padding: 30px 14px;
  border: 1px dashed rgba(31, 51, 42, 0.18);
  border-radius: 14px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--p-ink, #1f332a);
  opacity: 0.55;
}

@media (max-width: 760px) {
  .auth-gate {
    inset: 0;
    border-radius: 0;
    padding: 40px 24px;
  }
}
