:root {
  --bg: #faf7f2;
  --card: #fff;
  --ink: #2a2520;
  --muted: #8a8178;
  --accent: #1e896e;
  --accent-bg: #ddffec;
  --accent-bg-hover: #adefc9;
  --accent-ink: #166450;
  --line: #ece6dd;
  --danger: #a63d2f;
  --shadow: 0 6px 24px rgba(40, 30, 20, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  padding-top: env(safe-area-inset-top);
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }
h1, h2, h3, h4, h5, h6 {
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.view-suspended {
  position: fixed; inset: 0; visibility: hidden; pointer-events: none;
}
.empty { color: var(--muted); padding: 40px 20px; }

header.site { padding: 28px 0 8px; }
.title-row { display: flex; align-items: center; gap: 40px; }
header.site h1 {
  margin: 0; font-size: 26px; letter-spacing: -.5px;
}
.wordmark {
  display: inline-block; color: var(--accent); transform-origin: center bottom;
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-optical-sizing: auto; font-weight: 700;
}
.wordmark:hover { animation: logo-wiggle .35s ease-in-out; }
.wordmark-o { position: relative; display: inline-block; }
.wordmark-o-first { bottom: -.076923em; rotate: 350deg; }
.wordmark-o-second { top: -.076923em; rotate: 6deg; }
.site-nav { display: flex; align-items: center; gap: 12px; }
.site-nav a, .site-nav span {
  display: block; padding: 8px 20px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 600;
}
.site-nav a {
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.2px;
}
.site-nav-icon { width: 20px; height: 20px; margin-right: 8px; vertical-align: middle; }
.site-nav a .site-nav-icon { margin-right: 10px; }
.site-nav a:hover { color: var(--ink); }
.site-nav .active {
  color: var(--accent-ink); background: rgb(30 137 110 / 7%); text-decoration: underline; text-decoration-color: #03d295; text-underline-offset: 4px;
}
.key-button {
  width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid transparent; border-radius: 50%; background: transparent;
  color: var(--muted); cursor: pointer; padding: 0;
}
.key-button:hover { color: var(--ink); background: var(--card); border-color: var(--line); }
.key-button.active { color: var(--accent); }
.key-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.add-form {
  display: flex; gap: 8px; margin: 24px 0 14px; padding: 8px;
  border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
}
.add-form input {
  min-width: 0; flex: 1; border: 0; outline: 0; padding: 8px 10px; color: var(--ink); background: transparent;
}
.primary, .retry-button {
  border: 0; border-radius: 11px; background: var(--accent-bg); color: var(--accent-ink);
  padding: 9px 16px; cursor: pointer; font-weight: 650;
}
.primary:hover, .retry-button:hover { background: var(--accent-bg-hover); }
.primary:disabled { opacity: .55; cursor: wait; }
.offline {
  padding: 8px 12px; margin: 12px 0; border: 1px solid #e1b5a9;
  border-radius: 10px; color: var(--danger); background: #fff7f5; font-size: 14px;
}

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 26px; }
.filter-dropdown { position: relative; }
.filter-button {
  display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
  color: var(--ink); cursor: pointer;
}
.filter-button:hover { border-color: #d8cfc4; }
.filter-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-button.selected { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-ink); }
.filter-label { color: #03291f; font-size: 16px; line-height: 1.25; font-weight: 650; letter-spacing: -.3px; }
.filter-button svg { margin-left: 3px; color: var(--muted); transition: transform .18s ease; }
.filter-button[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--accent); }
.filter-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: max(100%, 190px);
  margin: 0; padding: 6px; list-style: none; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); box-shadow: 0 14px 34px rgba(40, 30, 20, .14);
}
.filter-menu[hidden] { display: none; }
.filter-menu li {
  position: relative; padding: 9px 34px 9px 11px; border-radius: 9px; white-space: nowrap; cursor: pointer;
}
.filter-menu li:hover, .filter-menu li:focus { background: var(--bg); outline: none; }
.filter-menu li[aria-selected="true"] { background: var(--accent-bg); color: var(--accent-ink); font-weight: 650; }
.filter-menu li[aria-selected="true"]::after { content: "✓"; position: absolute; right: 11px; color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; padding-bottom: 60px; }
.card {
  display: block; overflow: hidden; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card[href]:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(40, 30, 20, .14); }
.card .img, .hero .img {
  aspect-ratio: 4/3; background: #eadfd2; object-fit: cover; display: block; width: 100%;
}
.image-placeholder { display: grid !important; place-items: center; color: var(--muted); font-size: 36px; }
.card .body { padding: 16px 18px 20px; }
.card h3 { margin: 0 0 12px; color: #03291f; font-size: 20px; line-height: 1.25; letter-spacing: -.3px; }
.recipe-card .body { padding: 16px 17px 18px; }
.recipe-card h3 { margin: 0; }
.card-time { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 12px; line-height: 1; }
.card-time svg { flex: 0 0 auto; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12.5px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.pending-card { border: 1px dashed #d8c9bb; box-shadow: none; }
.pending-visual { aspect-ratio: 4/3; display: grid; place-items: center; background: linear-gradient(120deg, #f0e8df, #faf7f2, #f0e8df); background-size: 200% 100%; animation: shimmer 1.8s infinite linear; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid #d9cdc1; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.pending-card.failed { border-color: #e1b5a9; }
.pending-card.failed .pending-visual { animation: none; color: var(--danger); }
.retry-button { margin-top: 12px; padding: 7px 12px; font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes logo-wiggle {
  25% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
  75% { transform: rotate(-1deg); }
}

@media (prefers-reduced-motion: reduce) {
  .wordmark:hover { animation: none; }
}

.back { display: inline-block; margin: 22px 0 24px; color: var(--muted); font-size: 14px; }
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.hero.card { overflow: visible; }
.hero .img { border-radius: 16px 0 0 16px; box-shadow: none; }
.hero-content {
  align-self: stretch; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 24px 40px 38px;
}
.hero-copy { align-self: flex-end; }
.hero-time { align-self: flex-start; display: flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; }
.hero h2 { margin: 4px 0 8px; font-size: 32px; letter-spacing: -.6px; line-height: 1.15; text-wrap-style: pretty; }
.hero .desc { color: var(--muted); margin: 0; text-wrap-style: pretty; }
.source { display: inline-block; justify-self: end; align-self: start; color: var(--accent-ink); font-size: 14px; margin: -4px -12px 0 0; }
.source:hover { text-decoration: underline; text-decoration-color: #03d295; text-underline-offset: 4px; }
.meta { display: flex; gap: 24px; margin: 40px 0 0; }
.meta b { display: block; font-size: 18px; }
.meta span { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.serv-select { position: relative; display: flex; align-items: center; gap: 12px; }
#serv-btn { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 5px 14px; }
#serv-btn b { font-size: 18px; }
#serv-btn svg { color: var(--muted); transition: transform .18s; }
#serv-btn[aria-expanded="true"] { border-color: var(--accent); }
#serv-btn[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--accent); }
#serv-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(40, 30, 20, .16); display: grid; grid-template-columns: repeat(4, 40px); gap: 4px; }
#serv-menu[hidden] { display: none; }
#serv-menu li { height: 36px; display: grid; place-items: center; border-radius: 9px; cursor: pointer; font-size: 15px; }
#serv-menu li:hover { background: var(--bg); }
#serv-menu li[aria-selected="true"] { background: var(--accent-bg); color: var(--accent-ink); font-weight: 600; }

.cols { display: grid; grid-template-columns: 300px 1fr; gap: 40px; margin: 40px 0 80px; align-items: start; }
.ingredients { position: sticky; top: 20px; }
.ingredients h3, .steps h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 0 0 14px; }
.ingredients h3 { font-weight: normal; }
.ingredients ul { list-style: none; margin: 0; padding: 0; }
.ingredients li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.ingredients .group {
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.3px;
  margin-top: 16px;
}
.progress { position: sticky; top: 0; background: var(--bg); padding: 14px 0 10px; z-index: 5; }
.progress .bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .25s ease; }
.progress .label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.steps ol { list-style: none; counter-reset: step; margin: 0; padding: 0; }
#steplist { padding-top: 1px; }
.steps li { counter-increment: step; position: relative; padding: 16px 16px 16px 60px; border-radius: 12px; margin-bottom: 10px; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 11px; width: 30px; height: 30px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); display: grid; place-items: center; font-weight: 600; font-size: 14px; color: var(--muted); transition: all .15s; }
.steps li.current { background: var(--card); border-color: var(--accent); box-shadow: var(--shadow); }
.steps li.current::before { border-color: var(--accent); color: var(--accent); }
.steps li.done { color: var(--muted); }
.steps li.done::before { content: "✓"; background: var(--accent-bg); border-color: var(--accent); color: var(--accent-ink); }

@media (min-width: 761px) {
  .hero h2 { margin-top: 8px; margin-bottom: 12px; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 24px; }
  .title-row { flex-wrap: wrap; gap: 14px; }
  .site-nav { order: 3; flex-basis: 100%; }
  .hero, .cols { grid-template-columns: 1fr; }
  .hero { gap: 28px; }
  .hero.card { position: relative; margin-left: -24px; margin-right: -24px; }
  .hero .img { border-radius: 16px 16px 0 0; }
  .hero-content { grid-template-rows: auto auto; padding: 0 24px 28px; }
  .hero-copy { margin: 0; }
  .hero h2 { color: #02291f; }
  .meta { margin-top: 28px; }
  .source {
    position: absolute; top: 14px; right: 10px; margin: 0; padding: 2px 8px;
    border-radius: 20px; background: rgba(255, 255, 255, .75); color: #02291f; font-size: 12px;
  }
  .ingredients { position: static; }
  .add-form { flex-wrap: wrap; }
  .add-form input { flex-basis: 100%; }
  .add-form .primary { width: 100%; }
  .filter-dropdown { flex: 1 1 0; }
  .filter-button { justify-content: space-between; width: 100%; }
  .filter-menu { right: 0; }
}

.account-wrap { max-width: 480px; margin: 8vh auto; padding: 0 24px; }
.account-brand { font-size: 42px; margin-bottom: 24px; letter-spacing: -.8077px; }
.account-card { padding: 28px; margin-bottom: 24px; }
.account-card h1 { font-size: 28px; line-height: 1.15; margin: 0 0 12px; }
.account-card h2 { margin: 0 0 12px; font-size: 22px; }
.account-card p { color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.account-form { display: grid; gap: 16px; margin: 0 0 12px; }
.account-form label { display: grid; gap: 8px; font-size: 14px; }
.account-form input { width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: inherit; }
.account-form .checkbox-label { display: flex; align-items: flex-start; gap: 10px; }
.account-form input[type="checkbox"] { width: auto; flex: none; margin-top: 3px; }
.account-form [role="status"] { margin: 0; }
.account-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; }
.account-links a { text-decoration: underline; text-underline-offset: 3px; }
.settings-wrap { max-width: 720px; padding-bottom: 40px; }
.account-card button { padding: 11px 18px; border-radius: 10px; cursor: pointer; }
.account-card .danger { color: #8c2020; background: #fff0ed; border: 1px solid #e4bbb4; }
button:disabled { opacity: .6; cursor: wait; }
.detail-nav { display: flex; align-items: center; justify-content: space-between; }
.account-button { display: inline-flex; align-items: center; justify-content: center; }
.raw-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
@media (max-width: 480px) { .account-card { padding: 22px; } .account-wrap { margin-top: 30px; } }

.account-card .form-message { margin: 0; padding: 12px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.account-card .form-message[hidden] { display: none; }
.account-card .form-message--error { color: #8c2020; background: #fff0ed; border-color: #e4bbb4; }
.account-card .form-message--success { color: #145c3b; background: #e6f8ec; border-color: #aedbbd; }
.account-card .form-message--pending { color: var(--muted); background: var(--bg); }
