:root {
  --ink: #24332c;
  --muted: #66736b;
  --paper: #f5f0e6;
  --surface: rgba(255, 253, 248, 0.92);
  --surface-solid: #fffdf8;
  --line: rgba(45, 74, 60, 0.14);
  --accent: #d85d3f;
  --accent-dark: #aa3d27;
  --leaf: #2f6c50;
  --leaf-soft: #dcebdd;
  --sun: #efb74f;
  --shadow: 0 18px 50px rgba(53, 57, 43, 0.09);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(239, 183, 79, 0.2), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(79, 126, 96, 0.14), transparent 34rem),
    var(--paper);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 12px;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  background: rgba(250, 247, 239, 0.82);
  box-shadow: 0 12px 30px rgba(48, 57, 44, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px 14px 18px 10px;
  color: #fff8eb;
  background: var(--accent);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 25px;
  font-weight: 800;
  transform: rotate(-3deg);
  box-shadow: inset 0 -4px 0 rgba(85, 24, 14, 0.12);
}

.brand strong {
  display: block;
  letter-spacing: 0.02em;
  font-size: 17px;
}

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

.main-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(52, 74, 60, 0.05);
}

.nav-button {
  border: 0;
  border-radius: 11px;
  padding: 9px 15px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-button:hover {
  color: var(--ink);
}

.nav-button.is-active {
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: 0 4px 14px rgba(46, 63, 52, 0.08);
}

main {
  min-height: calc(100vh - 180px);
}

.view {
  display: none;
  padding: 42px 0 64px;
  animation: view-in 260ms ease both;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  align-items: end;
  gap: 32px;
  min-height: 350px;
  padding: clamp(34px, 6vw, 78px);
  border-radius: 34px;
  color: #fffaf1;
  background:
    linear-gradient(115deg, rgba(32, 66, 50, 0.98), rgba(47, 108, 80, 0.92)),
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(255, 255, 255, 0.035) 18px 19px);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "鲜";
  position: absolute;
  right: -20px;
  bottom: -82px;
  color: rgba(255, 255, 255, 0.055);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 330px;
  line-height: 1;
  transform: rotate(-8deg);
  pointer-events: none;
}

.hero-copy,
.hero-note {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f8c970;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 800px;
  margin: 0;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: clamp(42px, 6vw, 80px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

h2 {
  margin: 0;
  font-size: clamp(27px, 3vw, 42px);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

h3 {
  margin: 0;
  font-size: 20px;
}

.hero-lead {
  max-width: 700px;
  margin: 22px 0 0;
  color: rgba(255, 250, 241, 0.78);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-note {
  align-self: end;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 21px;
  background: rgba(244, 232, 209, 0.09);
  backdrop-filter: blur(8px);
}

.hero-note-label {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #f8c970;
  background: rgba(248, 201, 112, 0.12);
  font-size: 11px;
  font-weight: 800;
}

.hero-note strong {
  display: block;
  font-size: 19px;
}

.hero-note p {
  margin: 9px 0 0;
  color: rgba(255, 250, 241, 0.65);
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 10px 17px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.button-primary {
  color: #fff9ef;
  background: var(--accent);
  box-shadow: 0 9px 22px rgba(154, 53, 32, 0.18);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.hero .button-primary {
  color: var(--ink);
  background: #f8c970;
  box-shadow: none;
}

.hero .button-primary:hover {
  background: #ffda8c;
}

.button-quiet {
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.78);
}

.hero .button-quiet {
  color: #fffaf1;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.button-danger {
  color: #9f3926;
  border-color: rgba(159, 57, 38, 0.2);
  background: rgba(216, 93, 63, 0.08);
}

.button-small {
  min-height: 36px;
  border-color: var(--line);
  padding: 7px 12px;
  background: var(--surface-solid);
  font-size: 13px;
}

.sync-entry {
  flex: 0 0 auto;
  color: #fff;
  border-color: var(--leaf);
  background: var(--leaf);
  white-space: nowrap;
}

.sync-status {
  color: #7f5412;
  background: rgba(239, 183, 79, 0.2);
}

.full-width {
  width: 100%;
}

.control-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 24px 0 42px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.66);
}

.control-strip label,
.settings-field,
.manual-fields label {
  display: grid;
  gap: 5px;
}

.control-strip label > span,
.settings-field > span,
.manual-fields label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

select,
input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 11px;
  color: var(--ink);
  background: var(--surface-solid);
  outline: none;
}

select:focus,
input:focus {
  border-color: rgba(47, 108, 80, 0.58);
  box-shadow: 0 0 0 3px rgba(47, 108, 80, 0.09);
}

.control-strip select {
  min-width: 126px;
}

.rule-pill {
  align-self: stretch;
  display: flex;
  align-items: center;
  min-height: 42px;
  border-radius: 12px;
  padding: 9px 13px;
  color: var(--leaf);
  background: var(--leaf-soft);
  font-size: 12px;
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 0 2px 22px;
}

.section-heading > p {
  max-width: 480px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.section-heading.wide {
  margin-bottom: 28px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.plan-card {
  display: flex;
  min-height: 500px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 11px 32px rgba(48, 57, 44, 0.055);
  transition: 180ms ease;
}

.plan-card:hover {
  border-color: rgba(47, 108, 80, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(48, 57, 44, 0.09);
}

.plan-card.is-approved {
  border-color: rgba(47, 108, 80, 0.6);
  box-shadow: 0 0 0 3px rgba(47, 108, 80, 0.08), 0 18px 44px rgba(48, 57, 44, 0.08);
}

.plan-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 93, 63, 0.1);
}

.plan-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-letter {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--leaf);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 800;
}

.score-badge {
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--leaf);
  background: var(--leaf-soft);
  font-size: 11px;
  font-weight: 800;
}

.plan-card h3 {
  margin-top: 18px;
  font-size: 24px;
}

.plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 14px;
}

.meta-chip {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: rgba(48, 61, 53, 0.055);
  font-size: 11px;
  font-weight: 700;
}

.dish-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.dish-row:last-child {
  border-bottom: 0;
}

.dish-copy {
  min-width: 0;
}

.dish-copy strong {
  display: block;
  font-size: 14px;
}

.dish-copy small {
  color: var(--muted);
  font-size: 11px;
}

.pick-button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.pick-button.is-picked {
  color: var(--accent-dark);
  border-color: rgba(216, 93, 63, 0.32);
  background: rgba(216, 93, 63, 0.09);
}

.plan-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
}

.reason {
  color: var(--muted);
  font-size: 11px;
}

.reason::before {
  content: "✓";
  margin-right: 4px;
  color: var(--leaf);
  font-weight: 900;
}

.vote-area {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.vote-people {
  display: flex;
  min-height: 29px;
  flex-wrap: wrap;
  gap: 5px;
}

.vote-person {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: rgba(48, 61, 53, 0.055);
  font-size: 11px;
}

.vote-person[data-vote="yes"] {
  color: var(--leaf);
  background: var(--leaf-soft);
}

.vote-person[data-vote="no"] {
  color: #9f3926;
  background: rgba(216, 93, 63, 0.1);
}

.vote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.vote-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  background: var(--surface-solid);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.vote-actions .vote-yes {
  color: var(--leaf);
  border-color: rgba(47, 108, 80, 0.2);
}

.vote-actions .vote-no {
  color: #9f3926;
  border-color: rgba(216, 93, 63, 0.18);
}

.approve-plan {
  margin-top: 9px;
}

.picked-tray {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 17px 20px;
  border: 1px solid rgba(216, 93, 63, 0.2);
  border-radius: 18px;
  background: #fff5e9;
}

.picked-tray[hidden] {
  display: none;
}

.picked-tray p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.picked-actions {
  display: flex;
  gap: 8px;
}

.selected-panel {
  margin-top: 36px;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.selected-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.selected-heading p {
  margin: 5px 0 0;
  color: var(--muted);
}

.selected-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 24px;
  margin-top: 25px;
}

.subsection {
  border-radius: 21px;
  padding: 20px;
  background: rgba(246, 243, 235, 0.7);
}

.subsection h3 {
  margin-bottom: 13px;
}

.portion-list,
.shopping-list {
  display: grid;
  gap: 9px;
}

.portion-row,
.shopping-row {
  display: grid;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--surface-solid);
}

.portion-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.portion-row strong,
.shopping-row strong {
  display: block;
  font-size: 14px;
}

.portion-row small,
.shopping-row small {
  color: var(--muted);
  font-size: 11px;
}

.portion-kcal {
  color: var(--accent-dark);
  font-weight: 800;
}

.shopping-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.shopping-amount {
  text-align: right;
  font-weight: 800;
}

.shopping-amount small {
  display: block;
  font-weight: 500;
}

.shopping-subtitle {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feedback-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.feedback-row span {
  margin-right: 5px;
  color: var(--muted);
  font-size: 12px;
}

.manual-layout,
.settings-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 20px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(48, 57, 44, 0.055);
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading p,
.panel > p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.manual-fields {
  display: grid;
  gap: 15px;
  margin: 20px 0;
}

.manual-fields select {
  width: 100%;
}

.nutrition-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 18px 0;
}

.nutrition-stat {
  border-radius: 15px;
  padding: 14px;
  background: rgba(247, 242, 231, 0.88);
}

.nutrition-stat strong {
  display: block;
  font-size: 22px;
}

.nutrition-stat span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.simple-dish-list,
.ingredient-summary {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.simple-dish-list li,
.ingredient-summary li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}

.simple-dish-list li:last-child,
.ingredient-summary li:last-child {
  border-bottom: 0;
}

.library-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.search-field {
  flex: 1 1 280px;
}

.search-field input {
  width: min(100%, 430px);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.7);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.filter-chip.is-active {
  color: #fff;
  border-color: var(--leaf);
  background: var(--leaf);
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.recipe-card {
  display: flex;
  min-height: 248px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  cursor: pointer;
  transition: 170ms ease;
}

.recipe-card:hover {
  border-color: rgba(47, 108, 80, 0.36);
  transform: translateY(-2px);
}

.recipe-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.recipe-category {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--leaf);
  background: var(--leaf-soft);
}

.recipe-card h3 {
  margin-top: 18px;
}

.recipe-card p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.recipe-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 11px;
}

.dislike-button {
  border: 0;
  padding: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 16px;
}

.dislike-button.is-disliked {
  color: var(--accent);
}

.member-list {
  display: grid;
  gap: 14px;
}

.member-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(252, 250, 244, 0.76);
}

.member-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.member-name {
  width: min(190px, 60%);
  border: 0;
  padding-left: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 800;
}

.member-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.toggle-label input {
  min-height: auto;
}

.member-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.member-fields label {
  display: grid;
  gap: 4px;
}

.member-fields label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.member-fields input,
.member-fields select {
  min-width: 0;
  width: 100%;
}

.energy-result {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--leaf);
  background: var(--leaf-soft);
  font-size: 12px;
}

.energy-result.is-fallback {
  color: #805c18;
  background: rgba(239, 183, 79, 0.16);
}

.settings-sidebar {
  display: grid;
  gap: 18px;
}

.locked-rule {
  display: grid;
  gap: 4px;
  margin: 16px 0;
  padding: 13px 14px;
  border-radius: 13px;
  color: var(--leaf);
  background: var(--leaf-soft);
}

.locked-rule span {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.settings-field {
  margin-top: 13px;
}

.fine-print {
  line-height: 1.6;
}

.stacked-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 44px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

dialog {
  width: min(680px, calc(100% - 28px));
  max-height: calc(100vh - 48px);
  border: 0;
  border-radius: 26px;
  padding: 0;
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: 0 30px 100px rgba(28, 38, 31, 0.26);
}

dialog::backdrop {
  background: rgba(24, 35, 28, 0.48);
  backdrop-filter: blur(5px);
}

#recipe-dialog-content {
  padding: 30px;
}

#sync-dialog-content {
  padding: 30px;
}

.sync-dialog-title {
  margin: 5px 48px 8px 0;
  font-size: 34px;
}

.sync-intro {
  color: var(--muted);
}

.sync-link-list {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.sync-link-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(247, 242, 231, 0.7);
}

.sync-link-card strong {
  display: block;
  font-size: 14px;
}

.sync-link-card code {
  display: block;
  max-width: 420px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-room-code {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 6px 0 14px;
  border-radius: 10px;
  padding: 7px 10px;
  color: var(--leaf);
  background: var(--leaf-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sync-local-note {
  margin-top: 18px;
  padding: 13px 14px;
  border-radius: 13px;
  color: var(--muted);
  background: rgba(47, 108, 80, 0.07);
  font-size: 12px;
}

.sync-local-note strong {
  color: var(--ink);
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  cursor: pointer;
  font-size: 22px;
}

.dialog-title {
  margin: 5px 48px 5px 0;
  font-size: 34px;
}

.dialog-subtitle {
  color: var(--muted);
}

.dialog-columns {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 22px;
  margin-top: 24px;
}

.step-list {
  margin: 0;
  padding-left: 20px;
}

.step-list li {
  margin-bottom: 11px;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 28px;
  max-width: calc(100% - 32px);
  border-radius: 14px;
  padding: 11px 16px;
  color: #fff;
  background: rgba(36, 51, 44, 0.96);
  box-shadow: 0 12px 40px rgba(23, 31, 26, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: 180ms ease;
}

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

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 4px 34px;
  color: var(--muted);
  font-size: 11px;
}

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

@media (max-width: 1120px) {
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-card:nth-child(3) {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .recipe-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 760px);
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
  }

  .sync-entry {
    width: 100%;
  }

  .nav-button {
    flex: 1 0 auto;
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
    padding: 34px 26px;
  }

  .hero-note {
    max-width: 430px;
  }

  .plan-grid,
  .manual-layout,
  .settings-layout,
  .selected-columns {
    grid-template-columns: 1fr;
  }

  .plan-card:nth-child(3) {
    grid-column: auto;
  }

  .section-heading,
  .selected-heading,
  .picked-tray,
  .library-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading > p {
    text-align: left;
  }

  .recipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .brand small {
    display: none;
  }

  .topbar {
    padding: 9px;
  }

  .main-nav {
    padding: 3px;
  }

  .nav-button {
    padding: 8px 10px;
    font-size: 12px;
  }

  .view {
    padding-top: 24px;
  }

  h1 {
    font-size: 45px;
  }

  .hero {
    border-radius: 25px;
  }

  .hero-lead {
    font-size: 14px;
  }

  .control-strip {
    align-items: stretch;
  }

  .control-strip label {
    flex: 1 1 130px;
  }

  .control-strip select {
    width: 100%;
    min-width: 0;
  }

  .rule-pill {
    flex: 1 1 130px;
  }

  .plan-card {
    min-height: auto;
  }

  .picked-actions {
    width: 100%;
  }

  .picked-actions .button {
    flex: 1;
  }

  .recipe-grid {
    grid-template-columns: 1fr;
  }

  .member-fields,
  .nutrition-hero,
  .dialog-columns {
    grid-template-columns: 1fr;
  }

  .dialog-title {
    font-size: 29px;
  }

  .sync-dialog-title {
    font-size: 29px;
  }

  .sync-link-card {
    grid-template-columns: 1fr auto;
  }

  .sync-link-card code {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
