:root {
  --paper: #f5efe6;
  --paper-deep: #e8dccd;
  --card: #fffdf8;
  --ink: #1e2923;
  --muted: #68736c;
  --line: rgba(38, 57, 46, 0.14);
  --green: #244f3b;
  --green-bright: #347153;
  --red: #ad3d2c;
  --warm: #e7a84d;
  --shadow: 0 18px 50px rgba(43, 48, 40, 0.10);
  --serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(71, 67, 52, 0.13) 0 0.6px, transparent 0.8px),
    radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.8) 0 0.7px, transparent 0.9px);
  background-size: 9px 11px, 13px 15px;
}

.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;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--green);
}

.boot-mark,
.brand-mark {
  display: grid;
  place-items: center;
  border-radius: 50% 50% 46% 54%;
  color: #fff8eb;
  background: var(--green);
  font-family: var(--serif);
}

.boot-mark {
  width: 64px;
  height: 64px;
  font-size: 28px;
  animation: breathe 1.7s ease-in-out infinite;
}

@keyframes breathe {
  50% { transform: translateY(-5px) rotate(-3deg); }
}

.member-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(20, 48, 35, 0.92), rgba(20, 48, 35, 0.72)),
    url("/assets/stitch/home-hero.jpg") center / cover;
}

.gate-card {
  width: min(100%, 470px);
  padding: 46px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 30px 8px 30px 8px;
  color: #fffdf5;
  background: rgba(23, 49, 37, 0.78);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
}

.gate-card h1 {
  margin: 14px 0 12px;
  font-family: var(--serif);
  font-size: clamp(34px, 8vw, 52px);
  line-height: 1.1;
  font-weight: 700;
}

.gate-card p {
  margin: 0 0 30px;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.8;
}

.member-form {
  display: grid;
  gap: 12px;
}

.member-form label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.member-form input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  outline: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.member-form input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.member-form input:focus {
  border-color: var(--warm);
  box-shadow: 0 0 0 3px rgba(231, 168, 77, 0.18);
}

.app-shell {
  width: min(100%, 1500px);
  margin: 0 auto;
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  min-height: 84px;
  padding: 14px clamp(24px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 239, 230, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  font-size: 22px;
  box-shadow: 5px 5px 0 rgba(173, 61, 44, 0.14);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.6);
}

.nav-item {
  position: relative;
  min-width: 92px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: 180ms ease;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: var(--green);
}

.nav-badge {
  position: absolute;
  top: -7px;
  right: 1px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--paper);
  border-radius: 20px;
  color: #fff;
  background: var(--red);
  font-size: 10px;
  line-height: 16px;
}

.member-button {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
}

.member-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-family: var(--serif);
}

.member-button span:last-child {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

main {
  padding: 28px clamp(24px, 5vw, 76px) 70px;
}

.view {
  animation: rise 320ms ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}

.hero {
  position: relative;
  min-height: min(660px, calc(100vh - 142px));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.5fr);
  align-items: end;
  gap: 30px;
  overflow: hidden;
  padding: clamp(36px, 7vw, 90px);
  border-radius: 4px 54px 4px 54px;
  color: #fffaf0;
  background:
    linear-gradient(90deg, rgba(14, 29, 22, 0.88) 0%, rgba(14, 29, 22, 0.56) 48%, rgba(14, 29, 22, 0.12) 100%),
    url("/assets/stitch/home-hero.jpg") center / cover;
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 2px 45px 2px 45px;
  pointer-events: none;
}

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

.eyebrow {
  display: inline-block;
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.eyebrow.light {
  color: #f1c883;
}

.hero h1,
.page-heading h1,
.profile-hero h1 {
  margin: 18px 0;
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 82px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-copy > p {
  max-width: 510px;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(15px, 1.6vw, 19px);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

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

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

.button.primary {
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 20px rgba(36, 79, 59, 0.18);
}

.button.warm {
  color: #332817;
  background: #f0c16f;
}

.button.glass {
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.button.outline {
  border-color: var(--green);
  color: var(--green);
  background: transparent;
}

.button.danger {
  color: var(--red);
  background: #f6e6df;
}

.button.wide {
  width: 100%;
}

.hero-note {
  position: relative;
  z-index: 1;
  align-self: end;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 24px 4px 24px 4px;
  background: rgba(17, 39, 29, 0.58);
  backdrop-filter: blur(14px);
}

.hero-note span,
.hero-note small,
.hero-note strong {
  display: block;
}

.hero-note span {
  color: #efc982;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.hero-note strong {
  margin: 10px 0 8px;
  font-family: var(--serif);
  font-size: 26px;
}

.hero-note small {
  color: rgba(255, 255, 255, 0.65);
}

.home-intro,
.section-heading,
.page-heading.split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.home-intro {
  margin: 76px 0 26px;
}

.home-intro h2,
.section-heading h2,
.profile-card h2 {
  margin: 9px 0 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 46px);
}

.home-intro > p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.chip-row,
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.55);
  font-size: 12px;
  cursor: pointer;
}

.chip:hover,
.chip.active {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

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

.recipe-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 28px 4px 28px 4px;
  background: var(--card);
  box-shadow: 0 12px 34px rgba(55, 54, 43, 0.06);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.recipe-cover {
  position: relative;
  aspect-ratio: 1.22;
  overflow: hidden;
  background: var(--paper-deep);
  cursor: pointer;
}

.recipe-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.recipe-card:hover .recipe-cover img {
  transform: scale(1.04);
}

.time-pill {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(22, 34, 27, 0.74);
  font-size: 11px;
  backdrop-filter: blur(7px);
}

.recipe-body {
  padding: 18px;
}

.recipe-body h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  cursor: pointer;
}

.recipe-body p {
  min-height: 44px;
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.card-actions {
  display: flex;
  gap: 6px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  color: #fff;
  background: var(--green);
}

.recent-section,
.history-section {
  margin-top: 72px;
}

.horizontal-recipes {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 28%);
  gap: 16px;
  margin-top: 24px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scrollbar-color: var(--paper-deep) transparent;
}

.horizontal-recipe {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  cursor: pointer;
}

.horizontal-recipe img {
  width: 92px;
  height: 78px;
  object-fit: cover;
  border-radius: 12px;
}

.horizontal-recipe strong {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
}

.horizontal-recipe small {
  color: var(--muted);
}

.page-heading {
  padding: clamp(32px, 6vw, 78px) 0 42px;
}

.page-heading h1 {
  color: var(--green);
}

.search-panel {
  display: grid;
  gap: 20px;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: 30px 6px 30px 6px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.search-main {
  display: flex;
  gap: 12px;
}

.search-main input {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 18px;
  border: 0;
  border-bottom: 2px solid var(--green);
  outline: none;
  color: var(--ink);
  background: #f7f1e8;
  font-family: var(--serif);
  font-size: 18px;
}

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

.search-filters label,
.battle-form label,
.form-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-filters input,
.search-filters select,
.battle-form input,
.battle-form select,
.form-dialog input,
.form-dialog select,
.form-dialog textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #fffcf7;
}

.form-dialog textarea {
  resize: vertical;
  line-height: 1.6;
}

.search-filters input:focus,
.search-filters select:focus,
.battle-form input:focus,
.battle-form select:focus,
.form-dialog input:focus,
.form-dialog select:focus,
.form-dialog textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(36, 79, 59, 0.1);
}

.search-result-heading {
  margin-top: 58px;
}

.result-count {
  color: var(--muted);
  font-size: 13px;
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 24px;
}

.order-card,
.order-summary,
.profile-card {
  border: 1px solid var(--line);
  border-radius: 30px 6px 30px 6px;
  background: var(--card);
  box-shadow: 0 10px 34px rgba(55, 54, 43, 0.05);
}

.order-card {
  padding: clamp(18px, 3vw, 32px);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.order-card-header h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 30px;
}

.status-label {
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--green);
  background: #e5eee8;
  font-size: 11px;
  font-weight: 800;
}

.order-items {
  display: grid;
}

.order-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px dashed var(--line);
}

.order-item img {
  width: 92px;
  height: 78px;
  object-fit: cover;
  border-radius: 14px;
}

.order-item h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 20px;
}

.order-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.quantity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.quantity button {
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.order-summary {
  height: max-content;
  padding: 28px;
  color: #fffaf1;
  background: var(--green);
}

.order-summary h3 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: 26px;
}

.ingredient-list {
  display: grid;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
}

.ingredient-check {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  cursor: pointer;
}

.ingredient-check input {
  accent-color: var(--warm);
}

.ingredient-check.checked span {
  opacity: 0.5;
  text-decoration: line-through;
}

.order-summary .button {
  margin-top: 24px;
}

.history-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.history-columns > div {
  min-width: 0;
}

.history-columns h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.history-item strong,
.history-item span {
  display: block;
}

.history-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.profile-hero {
  min-height: 330px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(20px, 4vw, 50px);
  margin-top: 18px;
  padding: clamp(28px, 6vw, 74px);
  border-radius: 4px 50px 4px 50px;
  color: #fff;
  background:
    linear-gradient(100deg, rgba(26, 54, 41, 0.94), rgba(26, 54, 41, 0.58)),
    url("/assets/stitch/profile-cover.jpg") center / cover;
  box-shadow: var(--shadow);
}

.profile-avatar-large {
  width: clamp(90px, 12vw, 150px);
  height: clamp(90px, 12vw, 150px);
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 64px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.profile-hero h1 {
  margin: 10px 0;
  font-size: clamp(38px, 6vw, 68px);
}

.profile-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: -28px auto 42px;
  width: min(92%, 900px);
  position: relative;
  z-index: 2;
}

.stat-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px 5px 20px 5px;
  text-align: center;
  background: var(--card);
  box-shadow: var(--shadow);
}

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  color: var(--green);
  font-family: var(--serif);
  font-size: 30px;
}

.stat-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.profile-card {
  padding: clamp(20px, 3vw, 32px);
}

.profile-card.battle-card {
  grid-column: 1 / -1;
}

.section-heading.compact {
  align-items: center;
}

.section-heading.compact h2 {
  font-size: 28px;
}

.text-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: var(--red);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.mini-recipe-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.mini-recipe {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 8px;
  border-radius: 14px;
  cursor: pointer;
}

.mini-recipe:hover {
  background: #f6f0e7;
}

.mini-recipe img {
  width: 68px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
}

.mini-recipe strong,
.mini-recipe small {
  display: block;
}

.mini-recipe strong {
  font-family: var(--serif);
  font-size: 17px;
}

.mini-recipe small {
  margin-top: 4px;
  color: var(--muted);
}

.battle-form {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 22px;
}

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

.battle-result {
  margin-top: 18px;
  padding: 18px;
  border-left: 4px solid var(--warm);
  color: var(--green);
  background: #f7ebd5;
  line-height: 1.7;
}

.recipe-dialog,
.form-dialog {
  width: min(94vw, 980px);
  max-height: 92vh;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 30px 6px 30px 6px;
  background: var(--card);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.38);
}

.recipe-dialog::backdrop,
.form-dialog::backdrop {
  background: rgba(19, 30, 24, 0.68);
  backdrop-filter: blur(7px);
}

.dialog-close {
  position: sticky;
  z-index: 4;
  top: 14px;
  float: right;
  width: 40px;
  height: 40px;
  margin: 14px 14px -54px 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(24, 38, 30, 0.76);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.detail-cover {
  width: 100%;
  max-height: 470px;
  aspect-ratio: 16 / 8;
  object-fit: cover;
}

.detail-content {
  padding: clamp(24px, 5vw, 56px);
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.detail-title-row h2 {
  margin: 8px 0;
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 58px);
}

.detail-summary {
  max-width: 700px;
  color: var(--muted);
  line-height: 1.8;
}

.detail-meta,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.detail-meta span,
.detail-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--green);
  background: #edf2ed;
  font-size: 11px;
  font-weight: 700;
}

.detail-columns {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(28px, 6vw, 70px);
  margin-top: 40px;
}

.detail-columns h3 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 26px;
}

.detail-ingredients {
  display: grid;
  gap: 10px;
}

.detail-ingredient {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.detail-steps {
  display: grid;
  gap: 18px;
  counter-reset: step;
}

.detail-step {
  position: relative;
  padding-left: 54px;
  color: var(--muted);
  line-height: 1.75;
}

.detail-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-family: var(--serif);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
}

.form-dialog {
  width: min(94vw, 720px);
}

.form-dialog form {
  display: grid;
  gap: 17px;
  padding: clamp(28px, 6vw, 58px);
}

.form-dialog h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 34px;
}

.form-dialog small {
  font-weight: 400;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.empty-state,
.error-state {
  grid-column: 1 / -1;
  padding: 50px 24px;
  border: 1px dashed var(--line);
  border-radius: 24px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 253, 248, 0.45);
}

.empty-state strong,
.error-state strong {
  display: block;
  margin-bottom: 7px;
  color: var(--green);
  font-family: var(--serif);
  font-size: 22px;
}

.skeleton {
  min-height: 330px;
  border-radius: 28px;
  background: linear-gradient(90deg, #ede5d9 25%, #f8f4ed 42%, #ede5d9 60%);
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% { background-position: -120% 0; }
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 34px;
  max-width: calc(100vw - 40px);
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: rgba(24, 44, 34, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: 200ms ease;
}

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

.mobile-nav {
  display: none;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(24px, 5vw, 76px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

footer strong {
  color: var(--green);
  font-family: var(--serif);
}

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .desktop-nav {
    display: none;
  }

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

  .battle-form {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: min(calc(100% - 28px), 520px);
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
    background: rgba(26, 52, 40, 0.94);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
    transform: translateX(-50%);
    backdrop-filter: blur(16px);
  }

  .mobile-nav button {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 8px 5px;
    border: 0;
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    font-size: 10px;
  }

  .mobile-nav button span {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-nav button.active {
    color: var(--green);
    background: #fff7ea;
  }

  .mobile-nav b {
    position: absolute;
    top: 1px;
    right: 14px;
    min-width: 17px;
    padding: 2px 4px;
    border-radius: 999px;
    color: #fff;
    background: var(--red);
    font-size: 9px;
  }

  main {
    padding-bottom: 120px;
  }
}

@media (max-width: 800px) {
  .site-header {
    min-height: 72px;
    padding: 10px 16px;
  }

  .brand small,
  .member-button span:last-child {
    display: none;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  main {
    padding: 16px 14px 115px;
  }

  .hero {
    min-height: 610px;
    grid-template-columns: 1fr;
    padding: 44px 28px 32px;
    border-radius: 4px 34px 4px 34px;
    background:
      linear-gradient(0deg, rgba(14, 29, 22, 0.92) 0%, rgba(14, 29, 22, 0.4) 70%, rgba(14, 29, 22, 0.12) 100%),
      url("/assets/stitch/home-hero.jpg") center / cover;
  }

  .hero::before {
    inset: 11px;
    border-radius: 2px 27px 2px 27px;
  }

  .hero h1,
  .page-heading h1 {
    font-size: clamp(40px, 13vw, 58px);
  }

  .hero-note {
    padding: 18px;
  }

  .home-intro,
  .section-heading,
  .page-heading.split {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .home-intro {
    margin-top: 52px;
  }

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

  .recipe-card {
    border-radius: 20px 3px 20px 3px;
  }

  .recipe-body {
    padding: 13px;
  }

  .recipe-body h3 {
    font-size: 18px;
  }

  .recipe-body p {
    min-height: 39px;
    font-size: 12px;
  }

  .recipe-card-footer > span {
    display: none;
  }

  .horizontal-recipes {
    grid-auto-columns: 82%;
  }

  .search-main {
    display: grid;
  }

  .search-filters {
    grid-template-columns: 1fr;
  }

  .order-layout {
    grid-template-columns: 1fr;
  }

  .order-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .order-item img {
    width: 72px;
    height: 68px;
  }

  .order-item > .icon-button {
    position: absolute;
    right: 34px;
  }

  .history-columns,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-card.battle-card {
    grid-column: auto;
  }

  .profile-hero {
    min-height: 420px;
    grid-template-columns: 1fr;
    justify-items: start;
    align-content: end;
  }

  .profile-hero .button {
    position: absolute;
    top: 35px;
    right: 30px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-top: -18px;
  }

  .battle-form,
  .field-pair {
    grid-template-columns: 1fr;
  }

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

  .detail-title-row {
    display: block;
  }

  .gate-card {
    padding: 34px 24px;
  }

  footer {
    display: none;
  }
}

@media (max-width: 460px) {
  .recipe-grid {
    grid-template-columns: 1fr;
  }

  .recipe-cover {
    aspect-ratio: 1.55;
  }

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

  .detail-actions .button,
  .dialog-actions .button {
    flex: 1;
  }
}

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