/*
 * ChefCraft: the look of the old Next.js app, translated by hand from its Tailwind classes
 * (app/globals.css and the class names in each page). Values are Tailwind's: spacing in
 * 0.25rem steps, breakpoints sm 640px, md 768px, lg 1024px.
 */

/* ------------------------------------------------------------------ fonts */

@font-face {
  font-family: 'Marcellus';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/marcellus-400-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Marcellus';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/marcellus-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/karla-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/karla.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/space-grotesk-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/space-grotesk.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ----------------------------------------------------------------- tokens */

:root {
  --paper: #e9e6e0;
  --card: #f6f0e7;
  --surface: #fffdf9;
  --ink: #2c2420;
  --body: #4d423a;
  --muted: #6f6357;
  --faint: #9a8b7c;

  --basil: #2f7d4f;
  --basil-dark: #2a7047;
  --basil-soft: #d9ecdf;
  --basil-softtext: #22603a;
  --basil-glyph: #eaf5ee;

  --line: #e7ddcf;
  --line-inner: #ece2d4;
  --input-line: #e2d6c6;
  --divider: #e3d7c8;
  --outline: #d9ccbb;
  --star: #c99a2e;
  --star-empty: #d3c3ab;
  --danger: #a23c34;
  --tab-track: #efe4d6;

  --shadow-card: 0 24px 60px -30px rgba(60, 40, 25, 0.4);
  --shadow-pill: 0 2px 6px -2px rgba(60, 40, 25, 0.25);
  --food-warm: linear-gradient(135deg, #e7efe4 0%, #efe1d0 55%, #e6d3bd 100%);

  --font-display: 'Marcellus', serif;
  --font-sans: 'Karla', system-ui, Arial, Helvetica, sans-serif;
  --font-eyebrow: 'Space Grotesk', sans-serif;

  color-scheme: light;
}

/* ------------------------------------------------------- reset (preflight) */

*,
::before,
::after,
::backdrop,
::file-selector-button {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid var(--line);
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

ol, ul, menu {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: inherit;
}

b, strong {
  font-weight: bolder;
}

img, svg, video {
  display: block;
  vertical-align: middle;
}

img {
  max-width: 100%;
  height: auto;
}

button, input, select, textarea, ::file-selector-button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background-color: transparent;
  border-radius: 0;
  opacity: 1;
}

button, [role='button'] {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

textarea {
  resize: vertical;
}

::placeholder {
  color: var(--faint);
  opacity: 1;
}

table {
  border-collapse: collapse;
  text-indent: 0;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------- shared pieces */

/* Small uppercase eyebrow label used above section headings */
.cc-eyebrow {
  font-family: var(--font-eyebrow);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--basil);
}

/* The primary panel/card surface used across screens */
.cc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.spinner {
  border: 4px solid rgba(47, 125, 79, 0.15);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: var(--basil);
  animation: spin 1s ease infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }

.link {
  color: var(--basil);
  font-weight: 700;
}
.link:hover { color: var(--basil-dark); }

/* The "C" logo mark next to "ChefCraft" */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--basil);
  color: var(--basil-glyph);
  font-family: var(--font-display);
  font-size: 17px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 21px;
  color: var(--ink);
}
.site-nav .brand-name { letter-spacing: 0.3px; }

/* Buttons. Sizes follow the old pages: lg = hero/forms, md = "+ Add Recipe", sm = actions/dialogs. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--basil); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--basil-dark); }
.btn-outline { border: 1px solid var(--outline); color: var(--body); }
.btn-outline:hover:not(:disabled) { background: var(--surface); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { opacity: 0.9; }
.btn-ghost-danger { color: var(--danger); }
.btn-ghost-danger:hover:not(:disabled) { background: rgba(162, 60, 52, 0.05); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-lg { padding: 0.875rem 1.5rem; border-radius: 11px; }
.btn-md { padding: 0.75rem 1.25rem; border-radius: 11px; }
.btn-form { padding: 0.75rem 1.5rem; border-radius: 11px; }
.btn-form-10 { padding: 0.75rem 1.5rem; border-radius: 10px; }
.btn-sm { padding: 0.625rem 1.25rem; border-radius: 10px; font-size: 14px; }
.btn-sm-tight { padding: 0.625rem 1rem; border-radius: 10px; font-size: 14px; }
.btn-block { width: 100%; padding: 0.875rem 0; border-radius: 11px; }
.btn-nav { padding: 0.625rem 1.25rem; border-radius: 11px; }

/* Text fields */
.label {
  display: block;
  font-size: 14px;
  line-height: 1.4286;
  font-weight: 600;
  color: var(--body);
  margin-bottom: 0.5rem;
}
.input {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--input-line);
  border-radius: 11px;
  padding: 0.875rem 1rem;
  color: var(--ink);
  font-size: 15px;
}
.input:focus { outline: none; border-color: var(--basil); }
.input-md { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.input-sm {
  border-radius: 10px;
  padding: 0.625rem 0.875rem;
  font-size: 14px;
  line-height: 1.4286;
}

/* Error and notice boxes */
.error-box {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(162, 60, 52, 0.1);
  color: var(--danger);
  font-size: 14px;
}
.success-box {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: var(--basil-soft);
  color: var(--basil-softtext);
  font-size: 14px;
}

/* Page titles */
.title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.2;
  color: var(--ink);
}
@media (min-width: 640px) {
  .title-34 { font-size: 34px; }
  .title-32 { font-size: 32px; }
}
.lead {
  font-size: 15px;
  color: var(--muted);
}
.h2 {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.3333;
  color: var(--ink);
}
.h3 {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink);
}

/* Card paddings */
.pad { padding: 1.5rem; }
@media (min-width: 640px) {
  .pad { padding: 2.5rem; }
  .pad-8 { padding: 2rem; }
}
.narrow-2xl { max-width: 42rem; margin-left: auto; margin-right: auto; }
.narrow-4xl { max-width: 56rem; margin-left: auto; margin-right: auto; }

/* ----------------------------------------------------------- page layout */

.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-nav__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-toggle {
  display: block;
  color: var(--ink);
}
.nav-toggle:focus { outline: none; }
.nav-toggle svg { width: 1.5rem; height: 1.5rem; }
.nav-links {
  display: none;
  align-items: center;
  gap: 1.5rem;
}
.nav-link {
  padding: 0.25rem;
  font-weight: 600;
  font-size: 15px;
  color: var(--body);
  transition: color 0.15s;
}
.nav-link:hover,
.nav-link.is-current { color: var(--basil); }
.nav-count {
  color: var(--faint);
  font-weight: 500;
}
.nav-mobile {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 4rem;
  z-index: 40;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.profile { position: relative; }
.profile-button {
  display: flex;
  align-items: center;
}
.profile-button:focus { outline: none; }
.avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
}
.profile-menu {
  position: absolute;
  right: 0;
  z-index: 50;
  margin-top: 0.75rem;
  width: 13rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  font-size: 15px;
}
.profile-menu a,
.profile-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  color: var(--body);
}
.profile-menu a:hover {
  background: var(--card);
  color: var(--ink);
}
.profile-menu .menu-sep { border-top: 1px solid var(--line-inner); }
.profile-menu .menu-logout {
  color: var(--danger);
  font-weight: 600;
}
.profile-menu .menu-logout:hover { background: var(--card); }

@media (min-width: 640px) {
  .site-nav__inner { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .site-nav__inner { padding-left: 2rem; padding-right: 2rem; }
  .nav-toggle { display: none; }
  .nav-links { display: flex; }
  .nav-mobile { display: none; }
}

.page-main {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  flex-grow: 1;
  padding: 2rem 1rem;
}
@media (min-width: 640px) {
  .page-main { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .page-main { padding-left: 2rem; padding-right: 2rem; }
}

.site-footer {
  text-align: center;
  padding: 1.5rem 0;
  font-size: 14px;
  line-height: 1.4286;
  color: var(--faint);
}

.loading-card {
  padding: 2.5rem;
  color: var(--muted);
}

.error-page { padding: 2.5rem; }
.error-page .lead { margin: 0.5rem 0 1.5rem; }

/* ------------------------------------------------------------- landing */

.home { overflow: hidden; }
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding: 2rem;
}
.hero-text { align-self: center; }
.hero-text .cc-eyebrow { margin-bottom: 1rem; }
.hero-title {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 1rem;
}
.hero-lead {
  font-size: 17px;
  line-height: 1.625;
  color: var(--muted);
  max-width: 28rem;
  margin-bottom: 1.75rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
}
.hero-art {
  position: relative;
  border-radius: 1rem;
  min-height: 280px;
  background-image: var(--food-warm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-art svg {
  width: 7rem;
  height: 7rem;
  color: rgba(47, 125, 79, 0.35);
}
.values { padding: 0 2rem 3rem; }
.values-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.values-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.value-card {
  background: var(--surface);
  border: 1px solid var(--line-inner);
  border-radius: 1rem;
  padding: 1.5rem;
}
.value-card .h3 { margin-bottom: 0.5rem; }
.value-card p {
  font-size: 15px;
  line-height: 1.625;
  color: var(--muted);
}
@media (min-width: 640px) {
  .hero { padding: 3rem; }
  .hero-title { font-size: 48px; }
  .values { padding: 0 3rem 3rem; }
}
@media (min-width: 768px) {
  .values-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; }
}

/* ---------------------------------------------------------- auth pages */

.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem 0;
}
.auth-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 56rem;
  min-height: 520px;
}
.auth-art {
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  background-image: var(--food-warm);
}
.auth-art blockquote {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.25;
  color: var(--ink);
}
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
}
.auth-heading { margin-bottom: 2rem; }
.auth-heading .cc-eyebrow {
  display: block;
  margin-bottom: 0.75rem;
}
.auth-title {
  display: block;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.auth-sub {
  display: block;
  font-size: 15px;
  color: var(--muted);
}
.field { margin-bottom: 18px; }
.field-last { margin-bottom: 1.5rem; }
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.label-row .small-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--basil);
  margin-bottom: 0.5rem;
}
.label-row .small-link:hover { color: var(--basil-dark); }
.auth-panel .btn-block { margin-bottom: 18px; }
.auth-note {
  font-size: 14px;
  line-height: 1.4286;
  color: var(--muted);
  text-align: center;
}
.auth-text {
  font-size: 15px;
  line-height: 1.625;
  color: var(--body);
  margin-bottom: 1rem;
}
.auth-panel .error-box { margin-bottom: 18px; }
.captcha { margin-bottom: 18px; }
.captcha:empty { display: none; }
@media (min-width: 640px) {
  .auth-panel { padding: 3rem; }
}
@media (min-width: 768px) {
  .auth-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-art { display: flex; }
}

/* ------------------------------------------------------- recipe lists */

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.search {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.search-lg { margin-bottom: 1.75rem; }
.search .input {
  flex: 1 1 0%;
  min-width: 0;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}
.search .btn {
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 600;
}
.chips {
  display: flex;
  gap: 0.625rem;
  margin-bottom: 1.75rem;
}
.chip {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 13px;
  line-height: 20px; /* the old chips measured 36px high */
  background: var(--basil-soft);
  color: var(--basil-softtext);
  transition: background-color 0.15s, color 0.15s;
}
.chip:hover { background: rgba(217, 236, 223, 0.7); }
.chip.is-on { background: var(--basil); color: #fff; }
.list-title { margin-bottom: 1rem; }
.empty {
  margin-top: 0.5rem;
  color: var(--muted);
}
.recipe-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .recipe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.recipe-card {
  border: 1px solid var(--line-inner);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.recipe-card:hover { box-shadow: var(--shadow-card); }
.recipe-card a { display: block; }
.recipe-card-image {
  position: relative;
  height: 150px;
}
.recipe-card-image .placeholder {
  position: absolute;
  inset: 0;
}
.star-pill {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  background: var(--surface);
  box-shadow: var(--shadow-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.star-pill:hover { transform: scale(1.05); }
.star { width: 1em; height: 1em; fill: currentColor; }
.star.is-on { color: var(--star); }
.star.is-off { color: var(--star-empty); }
.recipe-card-body { padding: 18px; }
.recipe-card-body .h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recipe-card-body p {
  font-size: 13px;
  color: var(--faint);
  margin-top: 0.375rem;
}

/* Gradient stand-in for recipe photos (see placeholder.ts) */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.placeholder-0 { background: linear-gradient(135deg, #dfeadd 0%, #c6dcc9 100%); }
.placeholder-1 { background: linear-gradient(135deg, #f2e7d5 0%, #e5cfb1 100%); }
.placeholder-2 { background: linear-gradient(135deg, #ecdccb 0%, #dbc0a5 100%); }
.placeholder-3 { background: linear-gradient(135deg, #e9e7d6 0%, #d5d3b6 100%); }
.placeholder-4 { background: linear-gradient(135deg, #f0e3d9 0%, #e2c9bd 100%); }
.placeholder-5 { background: linear-gradient(135deg, #e0e8e0 0%, #ccdccf 100%); }
.monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: rgba(255, 253, 249, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
  font-family: var(--font-display);
  color: rgba(44, 36, 32, 0.4);
  user-select: none;
}
.monogram-thumb { width: 2.75rem; height: 2.75rem; font-size: 18px; line-height: 1.5556; }
.monogram-card { width: 4rem; height: 4rem; font-size: 30px; line-height: 1.2; }
.monogram-header { width: 6rem; height: 6rem; font-size: 48px; line-height: 1; }

/* ------------------------------------------------------- recipe detail */

.recipe-detail { overflow: hidden; }
.recipe-detail > .placeholder { height: 220px; }
.detail-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}
.star-big {
  font-size: 24px;
  line-height: 1;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.25rem;
  font-size: 13px;
  color: var(--faint);
  margin-bottom: 1.5rem;
}
.detail-meta a {
  color: var(--basil);
  word-break: break-all;
}
.detail-meta a:hover { text-decoration: underline; }
.detail-ingredients-title { margin-bottom: 0.75rem; }
.ingredient-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.75rem;
}
.ingredient-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 15px;
  color: var(--body);
  border-bottom: 1px dashed var(--divider);
  padding: 0.625rem 0;
}
.ingredient-list .amount {
  color: var(--faint);
  text-align: right;
}
.detail-steps-title { margin-bottom: 0.875rem; }
.step-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 2rem;
}
.step-list li {
  display: flex;
  gap: 0.875rem;
}
.step-number {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: var(--basil-soft);
  color: var(--basil);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-list .step-text {
  font-size: 15px;
  color: var(--body);
  line-height: 1.625;
  padding-top: 0.125rem;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.detail-actions .push-right { margin-left: auto; }

/* "Cook now" on the recipe page, and cook mode (/recipes/:id/cook): one step per screen */
.cook-now { margin: -0.5rem 0 1.75rem; }

.cook-body { min-height: 100dvh; }
.cook {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  height: 100dvh;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.cook-loading { margin: auto; color: var(--muted); }
.cook-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.cook-heading { min-width: 0; }
.cook-name {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cook-counter {
  font-family: var(--font-eyebrow);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--basil);
}
.cook-close {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: -0.25rem -0.25rem 0 0;
  border-radius: 9999px;
  color: var(--body);
  transition: background-color 0.15s;
}
.cook-close:hover { background: var(--card); }
.cook-close-icon {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
}
.cook-progress {
  display: flex;
  gap: 4px;
  margin: 0.875rem 0 0;
}
.cook-progress span {
  flex: 1;
  height: 5px;
  border-radius: 9999px;
  background: var(--outline);
}
.cook-progress .is-done,
.cook-progress .is-current { background: var(--basil); }
.cook-stage {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: 1.25rem;
  padding: 1.5rem 0.25rem;
}
.cook-number {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  background: var(--basil-soft);
  color: var(--basil);
  font-weight: 700;
  font-size: 22px;
}
.cook-text {
  font-size: 24px;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
@media (min-width: 640px) {
  .cook-text { font-size: 30px; }
}
.cook-empty { color: var(--muted); font-size: 18px; text-align: center; }
.cook-nav {
  display: grid;
  padding-top: 0.75rem;
  grid-template-columns: 1fr 2fr;
  gap: 0.75rem;
}
.cook-btn {
  min-height: 60px;
  border-radius: 14px;
  font-size: 18px;
}

/* Confirm dialog */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.dialog {
  padding: 1.75rem;
  max-width: 28rem;
  width: 100%;
  margin: 0 1rem;
}
.dialog .h2 { margin-bottom: 0.75rem; }
.dialog p {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}
body.no-scroll { overflow: hidden; }

/* ---------------------------------------------------- recipe form (editor) */

.recipe-form {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.form-grid-lists {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) {
  .form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Ingredients and steps are stacked (the old form put them side by side from 1024px). */
.list-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.add-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--basil);
}
.add-link:hover { color: var(--basil-dark); }
.rows {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.ingredient-row {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
}
/* The old form squeezed the name field to nothing (two width classes fought); the name gets the room now. */
.ingredient-row .ing-name { flex: 1 1 0%; min-width: 0; }
.ingredient-row .ing-small { flex: none; width: 6.5rem; }
.remove-button {
  flex: none;
  width: 2.25rem;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}
.remove-button:hover:not(:disabled) { color: var(--danger); }
.remove-button:disabled { opacity: 0.4; cursor: not-allowed; }
.step-wrap { position: relative; }
.drop-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.25rem;
  margin-top: -0.25rem;
  background: var(--basil);
  border-radius: 9999px;
  z-index: 10;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}
.step-item {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  padding: 0.25rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}
.step-item.is-dragging {
  opacity: 0.7;
  transform: scale(1.05);
  background: var(--surface);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}
.drag-handle {
  cursor: move;
  padding: 0.375rem;
  margin-top: 0.25rem;
  color: var(--faint);
  transition: color 0.15s;
}
.drag-handle:hover { color: var(--body); }
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 1.25rem; height: 1.25rem; }
.step-item .step-number { margin-top: 0.375rem; }
.step-item textarea {
  flex: 1 1 0%;
  min-width: 0;
  line-height: 1.625;
}
.step-item .remove-button { margin-top: 0.125rem; }
.form-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

/* ---------------------------------------------------------- add recipe */

.tabs {
  display: flex;
  gap: 0.375rem;
  background: var(--tab-track);
  border-radius: 0.75rem;
  padding: 0.375rem;
  margin-bottom: 1.75rem;
}
.tab {
  flex: 1 1 0%;
  text-align: center;
  padding: 0.625rem 0;
  border-radius: 9px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4286;
  color: var(--muted);
  transition: color 0.15s, background-color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'] {
  background: var(--surface);
  color: var(--basil);
  box-shadow: var(--shadow-pill);
}
.stack-form {
  display: flex;
  flex-direction: column;
}
.stack-form .label { margin-bottom: 0.625rem; }
.stack-form .input { margin-bottom: 18px; }
.mono { font-family: var(--font-eyebrow); }
.info-box {
  margin-top: 1.5rem;
  padding: 18px;
  border-radius: 0.75rem;
  background: var(--basil-soft);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.info-icon {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: var(--basil);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1.4286;
  font-weight: 700;
}
.info-box span:last-child {
  font-size: 14px;
  color: var(--basil-softtext);
  line-height: 1.625;
}
.editor-hint {
  font-size: 14px;
  line-height: 1.4286;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.result-box {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line-inner);
  border-radius: 1rem;
}
.result-box .spinner { margin-top: 1rem; }
.result-box .h2 { margin-bottom: 1rem; }
.result-box .h3.first { margin-top: 1rem; margin-bottom: 0.5rem; }
.result-box .h3.second { margin-top: 1.5rem; margin-bottom: 0.5rem; }
.preview-table {
  width: 100%;
  font-size: 15px;
}
.preview-table thead tr {
  background: var(--card);
  text-align: left;
  color: var(--body);
}
.preview-table th,
.preview-table td {
  border: 1px solid var(--line-inner);
  padding: 0.5rem 1rem;
}
.preview-table th { font-weight: 600; }
.preview-table td { color: var(--body); }
.preview-steps {
  list-style: decimal inside;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 15px;
  color: var(--body);
}
.preview-steps li { margin-top: 0.25rem; }
.result-box .save { margin-top: 1.5rem; }
.result-box .error-box { margin-top: 1rem; }

/* ------------------------------------------------------- shopping list */

.shopping-sub { margin-top: 0.375rem; }
.shopping-empty { margin-top: 1.5rem; color: var(--muted); }
.shopping-group { margin-top: 2rem; }
.shopping-group .h3 { margin-bottom: 0.75rem; }
.shopping-items {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.shopping-items li {
  border: 1px solid var(--line-inner);
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.check-button {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.375rem;
  border: 2px solid var(--outline);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1.4286;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.check-button:hover {
  background: var(--basil);
  border-color: var(--basil);
  color: #fff;
}
.shopping-items h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.shopping-items p {
  font-size: 13px;
  color: var(--faint);
  margin-top: 0.125rem;
}

/* ------------------------------------------------------------ account */

.account { display: flex; flex-direction: column; gap: 2rem; }
.account .title { margin-bottom: 0.375rem; }
.account .lead { margin-bottom: 1.75rem; }
.account .field { margin-bottom: 1.25rem; }
.account .field-last { margin-bottom: 1.5rem; }
.account .error-box,
.account .success-box { margin-bottom: 1.25rem; }
.file-input {
  display: block;
  width: 100%;
  font-size: 14px;
  line-height: 1.4286;
  color: var(--muted);
  cursor: pointer;
}
.file-input::file-selector-button {
  margin-right: 1rem;
  padding: 0.625rem 1.25rem;
  border-radius: 10px;
  border: 0;
  background: var(--basil-soft);
  color: var(--basil-softtext);
  font-weight: 600;
  cursor: pointer;
}
.file-input:hover::file-selector-button { background: rgba(217, 236, 223, 0.7); }
.avatar-preview {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.avatar-preview img {
  width: 6rem;
  height: 6rem;
  border-radius: 9999px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
}

/* -------------------------------------------------------------- admin */

.table-wrap { overflow-x: auto; }
.users-table {
  width: 100%;
  font-size: 14px;
  color: var(--body);
}
.users-table th {
  text-align: left;
  font-weight: 600;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}
.users-table td {
  padding: 0.75rem;
  border-bottom: 1px dashed var(--divider);
  vertical-align: top;
}
.users-table .num { text-align: right; }
.user-cell { display: flex; flex-direction: column; }
.user-name { font-weight: 600; color: var(--ink); }
.user-email { color: var(--faint); font-size: 13px; }
.badge {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0.25rem 0.25rem 0;
}
.badge-ok { background: var(--basil-soft); color: var(--basil-softtext); }
.badge-warn { background: rgba(201, 154, 46, 0.18); color: #7a5a12; }
.badge-admin { background: var(--tab-track); color: var(--body); }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.row-actions .btn { padding: 0.375rem 0.75rem; border-radius: 9px; font-size: 13px; }
.actions-toggle::after { content: " \25BE"; }
.action-menu {
  position: fixed;
  z-index: 50;
  width: 11rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  font-size: 14px;
}
.action-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.625rem 1rem;
  color: var(--body);
}
.action-menu button:hover:not(:disabled) { background: var(--card); color: var(--ink); }
.action-menu button:disabled { opacity: 0.5; cursor: not-allowed; }
.action-menu li + li { border-top: 1px solid var(--line-inner); }
.action-menu .menu-danger { color: var(--danger); font-weight: 600; }
.action-menu .menu-danger:hover:not(:disabled) { color: var(--danger); }

/* ------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  top: 1em;
  right: 1em;
  z-index: 9999;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 6px 30px 6px 12px;
  border-radius: 6px;
  background: #fff;
  color: #757575;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-family: sans-serif;
  font-size: 14px;
  overflow: hidden;
  cursor: pointer;
  animation: toast-in 0.4s ease;
}
.toast-icon {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.toast-success .toast-icon { background: #07bc0c; }
.toast-error .toast-icon { background: #e74c3c; }
.toast-close {
  position: absolute;
  top: 6px;
  right: 6px;
  color: #000;
  opacity: 0.3;
  font-size: 14px;
  line-height: 1;
}
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  width: 100%;
  transform-origin: left;
  animation: toast-progress 5s linear forwards;
}
.toast-success .toast-progress { background: #07bc0c; }
.toast-error .toast-progress { background: #e74c3c; }
.toast:hover .toast-progress { animation-play-state: paused; }
@keyframes toast-in {
  from { transform: translateX(110%); }
  to { transform: translateX(0); }
}
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
@media (max-width: 480px) {
  .toasts { left: 0; right: 0; top: 0; width: 100%; padding: 4px; }
}

/* ----------------------------------------------------------- dev outbox */

.dev-mail { padding: 1.5rem; margin-top: 1.5rem; }
.dev-mail pre {
  white-space: pre-wrap;
  font-size: 14px;
  margin-top: 0.75rem;
}
.dev-mail a { color: var(--basil); text-decoration: underline; }

/* ------------------------------------------------- page-specific spacing */

.pad-detail { padding: 1.5rem; }
.pad-new { padding: 1.5rem; }
@media (min-width: 640px) {
  .pad-detail,
  .pad-new { padding: 2rem; }
}
.active-title,
.new-title,
.edit-title { margin-bottom: 0.375rem; }
.active-lead,
.new-lead,
.users-lead { margin-bottom: 1.75rem; }
.edit-lead { margin-bottom: 0.5rem; }
.users-lead { margin-top: 0.375rem; }
#error.error-box + .table-wrap,
.users-table + * { margin-top: 1rem; }
.dev-links { margin-top: 1.5rem; }
