:root {
  color-scheme: light;
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --bg: #f0f4fd;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-elevated: rgba(255, 255, 255, 0.98);
  --border: rgba(15, 23, 42, 0.08);
  --text: #0b1524;
  --muted: #4b5563;
  --muted-strong: #6b7280;
  --accent: #d4af37;
  --accent-soft: rgba(212, 175, 55, 0.15);
  --accent-strong: #fbbf24;
  --highlight: #0b1524;
}

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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 120, 20, 0.45), transparent 45%),
    radial-gradient(circle at 70% 10%, rgba(255, 90, 0, 0.55), transparent 40%),
    radial-gradient(circle at 85% 40%, rgba(255, 200, 120, 0.35), transparent 50%),
    linear-gradient(180deg, #120202 0%, #1a0c0c 35%, #340707 70%, #0c0303 100%);
  background-size: cover;
  color: #fdf6e9;
}

a {
  color: var(--accent);
}

.page-shell {
  position: relative;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto 48px;
}

.site-header {
  position: relative;
  border-radius: 28px;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-image:
    linear-gradient(180deg, rgba(10, 8, 5, 0.85), rgba(10, 8, 5, 0.25)),
    url('header-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
}

.site-header-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-branding h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
}

.site-branding p,
.site-meta p {
  margin: 4px 0;
  color: var(--muted);
  max-width: 640px;
}

.site-header .site-branding h1 {
  color: #fff;
}

.site-header .site-branding p {
  color: rgba(255, 255, 255, 0.85);
}

.site-header .pill {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted-strong);
  font-size: 14px;
}

.tab-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
}

.tab-bar button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 26px;
  background: rgba(255, 255, 255, 0.08);
  color: #f7f2e8;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.tab-bar button.active {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  color: #1a0606;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  border-color: transparent;
  transform: translateY(-1px);
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section {
  background: transparent;
  border-radius: 0;
  border: none;
  padding: 28px 0;
  box-shadow: none;
  display: none;
}

.section.active {
  display: block;
}

.section-heading h2 {
  margin: 0 0 6px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.user-view .muted,
.admin-view .muted {
  color: var(--muted);
}

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

.menu-toggle {
  border-radius: 22px;
  width: auto;
  min-width: 58px;
  height: 52px;
  padding: 0 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 70;
  overflow: hidden;
  gap: 10px;
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-toggle-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.menu-toggle-icon span {
  display: block;
  width: 26px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}

.menu-toggle-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.menu-toggle::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.menu-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
}

.menu-toggle::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}


.header-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.drawer {
  position: fixed;
  top: 32px;
  right: 32px;
  z-index: 50;
  width: 320px;
  max-height: calc(100vh - 64px);
  border-radius: 28px;
  background-image:
    linear-gradient(rgba(5, 6, 12, 0.85), rgba(5, 6, 12, 0.55)),
    url('header-bg.png');
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 24px;
  overflow-y: auto;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
  color: #fff;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.drawer-header img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.drawer h3 {
  margin: 0 0 12px;
  color: #c4c4c4;
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 8px;
}

.accordion-button {
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  color: #fff;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.accordion-button[data-has-recipes="1"] {
  background: #d9d9d9;
  color: #050708;
  border-radius: 12px;
  padding: 6px 12px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.accordion-button span:last-child {
  font-size: 13px;
  color: #c4c4c4;
}

.accordion-item {
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.4);
  transition: background 0.2s ease;
}

.accordion-item.active {
  background: rgba(255, 255, 255, 0.1);
}

.accordion-body {
  margin-top: 8px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.accordion-body.open {
  max-height: 400px;
}

.accordion-body .category-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(210, 210, 210, 0.95), rgba(180, 180, 180, 0.95));
  color: #050708;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 0.01em;
}

.accordion-body .category-link span:first-child {
  text-align: left;
  white-space: normal;
}

.accordion-body .category-link span:last-child {
  font-size: 12px;
  color: rgba(5, 7, 8, 0.7);
  font-weight: 500;
  text-transform: uppercase;
  justify-self: end;
  align-self: flex-start;
}

.accordion-body .category-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.35);
}

.accordion-footer {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  padding-top: 12px;
}

.drawer-cta {
  text-align: center;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

.drawer-cta.button-overview {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(242,242,247,0.9));
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: #0b1524;
}

.drawer-cta.button-chat {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #03101e;
  border: none;
}

.drawer-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.35);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}

.gallery img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 12px;
}

.category-block {
  background: linear-gradient(180deg, rgba(5, 5, 12, 0.65), rgba(8, 2, 1, 0.85));
  border-radius: 24px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
  margin-bottom: 20px;
}

.category-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.category-label {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.category-count {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.polaroid-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.polaroid-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 12px 12px 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.polaroid-card::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  pointer-events: none;
}

.polaroid-frame {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.polaroid-frame img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.polaroid-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.polaroid-meta strong {
  font-size: 16px;
  color: #0b1524;
}

.polaroid-intro {
  margin: 0;
  color: #4b5563;
  min-height: 44px;
}

.polaroid-toggle {
  border: none;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 255, 255, 0.6));
  color: #050708;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.1);
}

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

.polaroid-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.polaroid-details.open {
  max-height: 380px;
  opacity: 1;
}

.polaroid-details div {
  margin-top: 10px;
}

.polaroid-details strong {
  display: block;
  margin-bottom: 6px;
  color: #0b1524;
}

.polaroid-details ul,
.polaroid-details ol {
  margin: 0;
  padding-left: 18px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
}
.polaroid-meta a {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #050708;
  font-weight: 600;
  text-decoration: none;
}

.admin-polaroids {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-category .polaroid-grid {
  gap: 18px;
}

.polaroid-card.admin {
  background: #f5f6fb;
}

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

.admin-card-form, .admin-delete-form {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.admin-card-form.open, .admin-delete-form.open {
  display: flex;
}

.admin-card-form input,
.admin-card-form textarea {
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  padding: 8px 10px;
  font-size: 14px;
}

.admin-card-form-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.admin-card-form button, .admin-delete-form button {
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}

.admin-card-form button {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #050708;
}

.admin-delete-form {
  display: flex;
}

.admin-delete-form .danger {
  background: #ff5656;
  color: #fff;
}

.ingredients,
.steps {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
}

.ingredients strong,
.steps strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
}

.ingredients ul,
.steps ol {
  margin: 0;
  padding-left: 18px;
  color: #f0f3ff;
}

.recipe-action a {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b0f15;
  font-weight: 600;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-search input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  padding: 10px 12px;
  background: #fff;
  color: #0b1524;
  font-weight: 500;
}

.admin-search label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #0b1524;
}

.polaroid-card.admin.hidden {
  display: none;
}

.admin-category.hidden {
  display: none;
}

.image-action-row {
  margin-top: 8px;
  display: flex;
}

.image-action-button {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fbff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.admin-block {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-block h3 {
  margin: 0;
}

.admin-block form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dynamic-list {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dynamic-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.dynamic-list__add {
  border: none;
  background: transparent;
  color: #f5f1ea;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.dynamic-list__add:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dynamic-list__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dynamic-list__fallback {
  width: 100%;
  min-height: 90px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  background: rgba(12, 16, 26, 0.85);
  color: #fdf6e9;
  resize: vertical;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

.dynamic-list.dynamic-list--active .dynamic-list__fallback {
  display: none;
}

.dynamic-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dynamic-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.9);
  color: #0b0c0f;
  font-size: 14px;
}

.dynamic-row__remove {
  border: none;
  background: rgba(255, 255, 255, 0.4);
  color: #0b0c0f;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s ease;
}

.dynamic-row__remove:hover {
  background: rgba(255, 255, 255, 0.8);
}

.dynamic-input-wrapper {
  grid-column: 1 / -1;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.input-grid label {
  font-size: 13px;
  color: #fdf6eb;
  display: block;
  margin-bottom: 4px;
}

.input-grid input,
.input-grid textarea,
.input-grid select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(7, 10, 18, 0.9);
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
}

.input-grid textarea {
  min-height: 90px;
  resize: vertical;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.actions-row button {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b0f15;
}

.actions-row button.danger {
  background: #ff5656;
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 86, 86, 0.35);
}

.message {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(30, 142, 255, 0.4);
  background: rgba(30, 142, 255, 0.1);
  color: #e4f1ff;
}

.message.success {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.12);
  color: #fff7df;
}

.error {
  border: 1px solid rgba(240, 68, 68, 0.4);
  background: rgba(240, 68, 68, 0.1);
  color: #ffe0e0;
  border-radius: 12px;
  padding: 12px 16px;
}

.hint {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted-strong);
}

.chat-panel {
  background: var(--panel-elevated);
  border-radius: 28px;
  border: 1px solid var(--border);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-window {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 18px;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
}

.message-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--highlight), #74ddff);
  color: #0b0f15;
}

.message-bubble.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.chat-form textarea {
  flex: 1;
  min-height: 80px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px;
  resize: vertical;
  background: rgba(7, 10, 18, 0.9);
  color: #fff;
}

.chat-form button {
  border: none;
  border-radius: 16px;
  padding: 0 20px;
  height: 48px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b0f15;
  cursor: pointer;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--highlight);
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 12px;
}

.recipe-detail-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  background: #ffffff;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15);
  color: var(--text);
}

.recipe-detail-hero img {
  width: min(340px, 100%);
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.recipe-detail-hero h1 {
  margin: 12px 0 4px;
  font-size: clamp(32px, 4vw, 42px);
}

.recipe-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.recipe-detail-grid article {
  min-height: 260px;
  background: #ffffff;
  border-radius: 22px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  color: var(--text);
}

.recipe-detail-grid article strong {
  color: #0b1524;
}

@media (max-width: 768px) {
  .page-shell {
    padding: 16px;
  }

  .drawer {
    width: 90%;
    right: 50%;
    left: unset;
    transform: translate(50%, -120%);
  }

  .drawer.open {
    transform: translate(50%, 0);
  }

  .menu-toggle {
    top: 16px;
    right: 16px;
  }
}

/* --- Revamped drawer & CTA buttons --- */
body.drawer-visible,
body.overlay-open {
  overflow: hidden;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button.primary {
  background: linear-gradient(135deg, #ffda7b, #ff9a62);
  color: #1f1306;
  box-shadow: 0 15px 35px rgba(255, 154, 98, 0.35);
}

.button.ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

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

.drawer {
  position: fixed;
  right: 24px;
  top: 24px;
  bottom: 24px;
  width: min(380px, calc(100% - 32px));
  height: auto;
  padding: 28px;
  border-radius: 30px;
  background: rgba(8, 8, 15, 0.85);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fdfcf8;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-shadow: 0 45px 90px rgba(0, 0, 0, 0.4);
  transform: translateX(130%);
  transition: transform 0.35s ease;
  z-index: 80;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.stat-chip span {
  display: block;
  font-size: 22px;
  font-weight: 700;
}

.stat-chip p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
}

.drawer-chips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  width: 100%;
}

.drawer-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  padding: 10px 16px;
  background: rgba(9, 8, 15, 0.35);
  color: inherit;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  gap: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.drawer-chip small {
  display: block;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.drawer-chip strong {
  font-size: 14px;
  letter-spacing: 0.04em;
}

.drawer-chip:hover {
  background: rgba(255, 255, 255, 0.08);
}

.drawer-chip__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  align-items: flex-start;
  text-align: left;
}

.drawer-chip__badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.drawer-chip__badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.drawer-chip__badge span {
  font-size: 20px;
}

.drawer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
}

.drawer-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.drawer-footer__actions {
  display: flex;
  gap: 10px;
}

/* --- Recipe filters --- */
.recipe-filters {
  width: 100%;
  margin-bottom: 18px;
}

.filter-field {
  width: 100%;
}

.filter-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
}

.filter-field input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 10px 16px;
  font-size: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* --- Recipe cards grid --- */
.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.polaroid-card {
  border-radius: 26px;
  padding: 16px;
  background: linear-gradient(175deg, rgba(255, 255, 255, 0.9), rgba(248, 243, 234, 0.95));
  border: 1px solid rgba(12, 12, 24, 0.08);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.polaroid-frame img {
  height: 220px;
}

.polaroid-meta strong {
  font-size: 18px;
  color: #1c1111;
}

.polaroid-intro {
  min-height: 48px;
  color: #4a4037;
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(60, 26, 0, 0.08);
  color: #3c1a00;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.meta-chip[hidden],
.meta-chip:empty {
  display: none;
}

.meta-chip[data-chip-type='servings']::before {
  content: '👤';
  margin-right: 6px;
}

.meta-chip[data-chip-type='duration']::before {
  content: '⏱️';
  margin-right: 6px;
}

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

.polaroid-toggle {
  border-radius: 12px;
  border: none;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(255, 208, 170, 0.8), rgba(255, 238, 214, 0.95));
  color: #3c1a00;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.polaroid-toggle.ghost {
  background: transparent;
  border: 1px solid rgba(60, 26, 0, 0.2);
  color: #3c1a00;
}

[data-recipe-card].hidden {
  display: none;
}

[data-category-block].hidden {
  display: none;
}

/* --- Overlay detail view --- */
.recipe-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 200;
}

.recipe-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.recipe-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(8px);
}

.recipe-overlay__panel {
  position: relative;
  width: min(960px, calc(100% - 32px));
  max-height: calc(100vh - 60px);
  background: #fff;
  border-radius: 32px;
  padding: 28px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 24px;
  overflow-y: auto;
}

.overlay-media img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 24px;
}

.overlay-content h3 {
  margin: 8px 0 6px;
  font-size: clamp(26px, 3vw, 36px);
}

.overlay-content {
  color: #1c1e25;
}

.overlay-intro {
  margin: 0 0 16px;
  color: #4a4a4a;
}

.overlay-meta {
  margin-bottom: 16px;
}

.overlay-meta.hidden {
  display: none;
}

.overlay-meta .meta-chip {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.overlay-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.overlay-columns h4 {
  margin-bottom: 8px;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist li {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  width: 100%;
  cursor: pointer;
  color: #1c1e25;
}

.checklist input {
  width: 16px;
  height: 16px;
}

.overlay-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.85);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.overlay-close:hover {
  background: rgba(255, 255, 255, 0.95);
}

.site-footer {
  margin-top: 80px;
  padding: 32px 20px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(8, 10, 12, 0) 0%, rgba(8, 10, 12, 0.35) 100%);
}

.site-footer__links {
  width: min(960px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.site-footer__links a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-footer__links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

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

@media (max-width: 640px) {
  .drawer {
    width: calc(100% - 24px);
    left: 50%;
    right: auto;
    transform: translate(-50%, -130%);
    top: 16px;
    bottom: 16px;
    padding: 20px;
  }

  .drawer.open {
    transform: translate(-50%, 0);
  }

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

  .drawer-footer__actions {
    flex-direction: column;
  }

  .filter-field {
    width: 100%;
  }

  .polaroid-frame img {
    height: 190px;
  }

  .polaroid-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .polaroid-toggle {
    flex: 1 0 auto;
    white-space: nowrap;
    text-align: center;
  }

  .recipe-overlay__panel {
    padding: 18px;
  }
}
