:root {
  --bg: #f6f3eb;
  --surface: #fffdf8;
  --text: #26342b;
  --muted: #687168;
  --green: #27533d;
  --green-hover: #193d2b;
  --green-soft: #e2ece4;
  --orange: #cf6838;
  --orange-soft: #f5e2d6;
  --border: #dcd6c8;
  --danger: #a74326;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

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

a {
  color: inherit;
}

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

.site-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--orange);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-name,
h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--green);
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.hero {
  max-width: 680px;
  padding: 54px 0 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.65rem, 7vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
}

.hero-copy {
  max-width: 600px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.filter-panel,
.form-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.filter-panel {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.field-label {
  color: #4e5a51;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: white;
}

input,
select {
  height: 48px;
  min-height: 48px;
  padding: 0 12px;
}

select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%2326342b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

textarea {
  min-height: 120px;
  padding: 12px;
  line-height: 1.55;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 83, 61, 0.12);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--green);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--green-hover);
}

.button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.button-secondary {
  border: 1px solid var(--border);
  color: var(--green);
  background: white;
}

.button-secondary:hover {
  background: var(--green-soft);
}

.button-danger {
  background: var(--danger);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 42px 0 16px;
}

.section-heading h2,
.form-panel h2,
.admin-list-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.result-count {
  color: var(--muted);
  font-size: 0.85rem;
}

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

.recipe-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.recipe-card-accent {
  height: 5px;
  background: var(--orange);
}

.recipe-card:nth-child(even) .recipe-card-accent {
  background: #6f916e;
}

.recipe-card-body {
  padding: 20px;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: #3f5547;
  background: var(--green-soft);
  font-size: 0.7rem;
  font-weight: 800;
}

.pill-time {
  background: var(--orange-soft);
}

.recipe-card h3 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.ingredient-preview {
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.recipe-details {
  border-top: 1px solid var(--border);
  padding-top: 13px;
}

.recipe-details summary {
  min-height: 30px;
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.recipe-details summary::-webkit-details-marker {
  display: none;
}

.recipe-details summary::after {
  content: "+";
  float: right;
  font-size: 1rem;
}

.recipe-details[open] summary::after {
  content: "−";
}

.recipe-details h4 {
  margin: 15px 0 7px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.recipe-details ul {
  margin: 0;
  padding-left: 18px;
  color: #4f5a52;
  font-size: 0.87rem;
  line-height: 1.6;
}

.instructions {
  margin: 0;
  color: #4f5a52;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.empty-state,
.loading-state {
  grid-column: 1 / -1;
  padding: 48px 20px;
  border: 1px dashed #cfc7b7;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong,
.loading-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.admin-hero {
  max-width: 650px;
  padding: 46px 0 30px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
  padding-bottom: 64px;
}

.form-panel {
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 4px;
}

.status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 700;
}

.status.error {
  color: var(--danger);
}

.admin-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
  padding: 4px 1px;
}

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

.admin-recipe {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.admin-recipe h3 {
  margin: 0 0 4px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
}

.admin-recipe p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-recipe-actions {
  display: flex;
  gap: 7px;
}

.icon-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--green);
  background: white;
  font-size: 0.77rem;
  font-weight: 800;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--green-soft);
}

.icon-button.delete {
  color: var(--danger);
}

.site-footer {
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 800px) {
  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .filter-panel .button {
    grid-column: 1 / -1;
  }

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

@media (max-width: 600px) {
  .shell {
    width: min(100% - 24px, 1000px);
  }

  .site-header {
    min-height: 64px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .header-link {
    min-height: 40px;
    padding: 0 12px;
  }

  .hero,
  .admin-hero {
    padding: 36px 0 24px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.25rem);
  }

  .hero-copy {
    margin-top: 14px;
    font-size: 0.94rem;
  }

  .filter-panel,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    padding: 14px;
  }

  .field-wide,
  .filter-panel .button {
    grid-column: auto;
  }

  .recipe-grid {
    grid-template-columns: 1fr;
    gap: 11px;
    padding-bottom: 48px;
  }

  .section-heading {
    margin-top: 34px;
  }

  .recipe-card-body,
  .form-panel {
    padding: 16px;
  }

  .admin-layout {
    gap: 28px;
    padding-bottom: 48px;
  }

  .form-actions,
  .form-actions .button {
    width: 100%;
  }

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

  .admin-recipe-actions,
  .admin-recipe-actions .icon-button {
    width: 100%;
  }

  .admin-recipe-actions .icon-button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
