:root {
  --ink: #1a1208; --parchment: #faf7f2; --gold: #c8973a;
  --dark: #2c2416; --border: #d4c9b0; --muted: #7a6a50; --body-col: #5a4e3c;
  --ui-radius-sm: 4px;
  --ui-radius-md: 6px;
  --ui-radius-lg: 8px;
  --ui-radius-xl: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { font-family: 'Source Sans 3', sans-serif; background: #1c1710; color: #e8dfc8; min-height: 100vh; display: flex; flex-direction: column; }

/* ── AUTH (legacy) ── */
.landing-body { display: flex; flex-direction: column; min-height: 100vh; }
.auth-screen { flex: 1; display: flex; align-items: center; justify-content: center; background: #1c1710; background-image: radial-gradient(ellipse at 30% 40%, #2c2010 0%, transparent 60%), radial-gradient(ellipse at 70% 70%, #1a1008 0%, transparent 50%); }
.auth-box { background: #241e14; border: 1px solid #3a3020; border-radius: var(--ui-radius-xl); padding: 48px 40px; text-align: center; max-width: 380px; width: 90%; }
.auth-logo { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; color: var(--parchment); margin-bottom: 10px; }
.auth-logo span { color: var(--gold); }
.auth-sub { font-size: 12px; font-weight: 300; color: #9a8c78; margin-bottom: 32px; line-height: 1.6; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--parchment); color: var(--ink); border: none; border-radius: var(--ui-radius-lg); padding: 13px 20px; font-family: 'Source Sans 3', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.2s; margin-bottom: 16px; text-decoration: none; }
.google-btn:hover { background: #fff; }
.auth-note { font-size: 10px; font-weight: 300; color: #5a5040; }

/* ── TOP BAR ── */
.topbar {
  background: var(--dark);
  border-bottom: 3px solid var(--gold);
  padding: 14px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 24px;
}
.topbar-title { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; color: var(--parchment); }
.topbar-title span { color: var(--gold); }
.topbar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 700;
  color: var(--parchment); text-decoration: none;
  display: flex;
  align-items: center;
  gap: 9px;
}
.topbar-brand span { color: var(--gold); }
.land-logo,
.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.logo-mark {
  width: 22px;
  height: 16px;
  flex-shrink: 0;
  position: relative;
  top: -1px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.topbar-link {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: #9a8c78;
  text-decoration: none; transition: color 0.2s;
}
.topbar-link:hover, .topbar-link.active { color: var(--gold); }
.nav-library {
  position: relative;
  padding-bottom: 2px;
}
.nav-library.active {
  color: var(--gold);
}
.nav-library.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;
  height: 2px;
  background: var(--gold);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}
.topbar-auth-slot { display: inline-block; min-width: 56px; text-align: center; }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gold); }
.user-name { font-size: 11px; font-weight: 300; color: #9a8c78; }
.topbar-pro-badge {
  background: var(--gold);
  color: var(--dark);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  margin-left: 4px;
}
.signout-btn {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: #c8b898;
  text-decoration: none; transition: color 0.2s;
}
.signout-btn:hover { color: var(--gold); }
.nav-signin-btn {
  background: var(--gold); color: var(--dark);
  border-radius: var(--ui-radius-lg);
  padding: 8px 18px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; transition: background 0.2s;
}
.nav-signin-btn:hover { background: #d9a840; }

/* ── LAYOUT ── */
.main { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar { width: 300px; flex-shrink: 0; background: #241e14; border-right: 1px solid #3a3020; display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.tabs { display: flex; flex-shrink: 0; border-bottom: 1px solid #3a3020; }
.sidebar-tabs-content { flex: 1; overflow-y: auto; }
.tab {
  flex: 1; padding: 13px 8px; text-align: center;
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: #9a8c78;
  cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s;
}
.tab.active { color: #d4a840; border-bottom-color: #d4a840; }
.tab-pro-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.tab-panel { flex: 1; overflow-y: auto; display: none; flex-direction: column; }
.tab-panel.active { display: flex; }

.panel-section { padding: 15px 18px; border-bottom: 1px solid #3a3020; }
.panel-section:last-child { border-bottom: none; }
.sidebar-secondary-action {
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.panel-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: #c8b898; margin-bottom: 9px;
}

input[type="password"], input[type="text"], textarea {
  width: 100%; background: #1a1510; border: 1px solid #4a4030;
  border-radius: var(--ui-radius-md);
  color: #f0e8d8; font-family: 'Source Sans 3', sans-serif;
  font-size: 14px; font-weight: 300; padding: 9px 11px; line-height: 1.5;
  outline: none; transition: border-color 0.2s; resize: vertical;
}
input[type="password"]:focus, input[type="text"]:focus, textarea:focus { border-color: var(--gold); }
input::placeholder, textarea::placeholder { color: #6a5e4a; }
.hint {
  font-size: 12px; font-weight: 300; color: #9a8c78;
  margin-top: 7px; line-height: 1.6;
}
.input-hint {
  font-size: 10px;
  color: #6a5e4a;
  line-height: 1.6;
  margin-top: 6px;
}
kbd {
  font-size: 9px;
  background: #3a3020;
  color: #c8b898;
  padding: 1px 5px;
  border-radius: 2px;
  font-family: 'Source Sans 3', sans-serif;
}
textarea.recipe-input { min-height: 150px; }

/* ── INPUT MODE TOGGLE ── */
.input-mode-toggle {
  display: flex;
  gap: 0;
  border: 1px solid #3a3020;
  border-radius: var(--ui-radius-md);
  overflow: hidden;
}
.imt-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #7a6e5a;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: relative;
}
.imt-btn + .imt-btn { border-left: 1px solid #3a3020; }
.imt-btn:hover { color: #c8b898; background: #1a1510; }
.imt-btn.active { background: #2c2416; color: var(--gold); }
.imt-btn[data-pro="true"] { opacity: 0.7; }
.imt-btn[data-pro="true"]:hover { opacity: 1; }

.imt-pro-badge {
  background: var(--gold);
  color: var(--dark);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1px 4px;
  text-transform: uppercase;
}
.input-tab-badge {
  background: var(--gold);
  color: var(--dark);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.imt-limit-badge {
  background: #3a3020;
  color: #c8b898;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 4px;
  text-transform: uppercase;
}

.btn-primary {
  width: 100%; background: var(--gold); color: var(--dark); border: none;
  border-radius: var(--ui-radius-lg);
  padding: 14px; font-family: 'Source Sans 3', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; cursor: pointer; transition: background 0.2s;
}
.btn-primary:hover { background: #d9a840; }
.btn-primary:disabled { background: #5a4e30; color: #8a7a50; cursor: not-allowed; }
#generateBtn {
  text-transform: none;
  letter-spacing: 0.08em;
}

.btn-secondary {
  width: 100%; background: transparent; color: #c8b898;
  border: 1px solid #4a4030; border-radius: var(--ui-radius-lg); padding: 11px;
  font-family: 'Source Sans 3', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-secondary:disabled {
  border-color: #4a4030;
  color: #6a5e4a;
  cursor: not-allowed;
  opacity: 0.75;
}
.btn-secondary:disabled:hover {
  border-color: #4a4030;
  color: #6a5e4a;
}
.btn-signin-save {
  width: 100%;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: var(--ui-radius-lg);
  padding: 11px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.2s;
}
.btn-signin-save:hover {
  background: var(--gold);
  color: var(--dark);
}

@media (min-width: 768px) {
  .main.desktop-card-empty #tab-create #sidebarSaveSection,
  .main.desktop-card-empty #tab-create #shareSection,
  .main.desktop-card-empty #tab-create #printSection,
  .main.desktop-card-empty #tab-create #themeSection {
    display: none !important;
  }

  .main.desktop-card-ready #tab-create #sidebarSaveSection,
  .main.desktop-card-ready #tab-create #shareSection,
  .main.desktop-card-ready #tab-create #printSection {
    display: none !important;
  }
}
.signin-wrap-copy {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: #bda985;
}
.signin-wrap-copy a {
  color: #d8b16c;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.signin-wrap-copy a:hover {
  color: var(--gold);
}

.photo-upload-area {
  --photo-upload-frame-color: rgba(200,151,58,0.35);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  border: none;
  box-shadow: inset 0 0 0 1.5px var(--photo-upload-frame-color);
  padding: 28px 16px 24px;
  text-align: center;
  transition: box-shadow 0.2s, background 0.2s;
  margin-top: 8px;
  gap: 8px;
  height: auto;
  min-height: 220px;
  border-radius: var(--ui-radius-xl);
  background: rgba(200,151,58,0.03);
}
.photo-upload-area:hover {
  --photo-upload-frame-color: var(--gold);
  background: rgba(200,151,58,0.06);
}
.photo-upload-icon {
  font-size: 34px;
  line-height: 1.15;
  display: inline-block;
  margin: 0 0 4px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.photo-upload-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  line-height: 1.1;
  color: #f0e8d8;
}
.photo-upload-text {
  font-size: 13px;
  font-weight: 300;
  color: #c8b898;
  margin-bottom: 2px;
  max-width: 340px;
  line-height: 1.5;
}
.photo-upload-divider {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7a60;
}
.photo-upload-cta {
  width: 100%;
  max-width: 280px;
  border: 1px solid rgba(200,151,58,0.55);
  border-radius: var(--ui-radius-lg);
  padding: 11px 12px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.photo-upload-cta-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--dark);
}
.photo-upload-cta-primary:hover {
  background: #d9a840;
  border-color: #d9a840;
}
.photo-upload-cta-secondary {
  background: transparent;
  color: #d5bb8b;
}
.photo-upload-cta-secondary:hover {
  background: rgba(200,151,58,0.08);
  color: #efd8ab;
  border-color: var(--gold);
}
.photo-upload-file {
  min-height: 18px;
  font-size: 11px;
  color: #d4a84a;
}
.photo-upload-reset {
  margin-top: 2px;
  border: none;
  background: transparent;
  color: #8a7a60;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  cursor: pointer;
}
.photo-upload-reset:hover {
  color: #d5bb8b;
}
.photo-upload-usage {
  margin-top: 2px;
  margin-bottom: 0;
  text-align: center;
  color: #8a7a60;
}
.photo-upload-area.is-processing {
  --photo-upload-frame-color: var(--gold);
  background: rgba(200,151,58,0.08);
}
.photo-upload-area.is-processing .photo-upload-cta {
  opacity: 0.6;
  pointer-events: none;
}
.photo-selection-panel {
  margin-top: 12px;
  border: 1px solid rgba(200,151,58,0.35);
  border-radius: var(--ui-radius-xl);
  background: rgba(200,151,58,0.04);
  padding: 12px;
}
.photo-selection-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: #f0e8d8;
  margin-bottom: 4px;
}
.photo-selection-text {
  font-size: 12px;
  line-height: 1.45;
  color: #c8b898;
  margin-bottom: 10px;
}
.photo-selection-list {
  display: grid;
  gap: 8px;
}
.photo-selection-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  border: 1px solid rgba(200,151,58,0.45);
  border-radius: var(--ui-radius-lg);
  background: rgba(200,151,58,0.02);
  color: #f2eadb;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.photo-selection-option:hover {
  border-color: var(--gold);
  background: rgba(200,151,58,0.08);
}
.photo-selection-option-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.photo-selection-option-summary {
  font-size: 11px;
  color: #bca97d;
}

.recipe-by-row {
  margin-top: 14px;
}
.recipe-by-label {
  margin-bottom: 6px;
}
.recipe-by-hint {
  margin-top: 6px;
}
.panel-gate {
  text-align: center;
  border-radius: var(--ui-radius-xl);
  padding: 24px 16px;
}
.panel-gate-icon {
  font-size: 28px;
  margin-bottom: 12px;
}
.panel-gate-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--parchment);
  margin-bottom: 8px;
}
.panel-gate-sub {
  font-size: 12px;
  font-weight: 300;
  color: #9a8c78;
  margin-bottom: 16px;
  line-height: 1.6;
}
.panel-gate-btn {
  display: inline-block;
  background: var(--gold);
  color: var(--dark);
  border-radius: var(--ui-radius-lg);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 20px;
  text-decoration: none;
}

.status-msg {
  font-size: 13px; font-weight: 300; color: #d4a84a;
  margin-top: 8px; min-height: 18px;
}
.generation-progress[hidden] {
  display: none !important;
}
.generation-progress {
  margin-top: 10px;
  border-radius: var(--ui-radius-xl);
  padding: 12px 12px 10px;
  background: rgba(200,151,58,0.05);
  border: 1px solid rgba(200,151,58,0.12);
}
.generation-progress-track {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(200, 151, 58, 0.12);
  border: 1px solid rgba(200, 151, 58, 0.2);
  border-radius: 999px;
  overflow: hidden;
}
.generation-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(200,151,58,0.72) 0%, #c8973a 55%, #e0b965 100%);
  box-shadow: 0 0 18px rgba(200,151,58,0.18);
  transition: width 220ms ease;
}
.generation-progress-label {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(212, 168, 74, 0.86);
}
.error-msg {
  font-size: 13px; font-weight: 300; color: #c87060; margin-top: 8px;
}
.upgrade-prompt {
  background: #2c2010;
  border: 1px solid var(--gold);
  border-left: 3px solid var(--gold);
  border-radius: var(--ui-radius-xl);
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 300;
  color: #e8dfc8;
  line-height: 1.5;
}
.upgrade-prompt-later {
  margin-top: 8px;
  background: transparent;
  border: none;
  color: #b9a07a;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
}
.upgrade-prompt-later:hover { color: var(--gold); }

.badge { display: inline-block; background: var(--gold); color: var(--dark); font-size: 8px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 6px; margin-left: 7px; vertical-align: middle; }
.badge.badge-inline { margin-left: 6px; transform: translateY(-1px); }

/* ── LIBRARY ── */
.repo-empty { padding: 24px 18px; font-size: 12px; font-weight: 300; color: #5a5040; font-style: italic; text-align: center; }
.repo-loading { padding: 24px 18px; font-size: 11px; color: #5a5040; text-align: center; }
.library-page-header {
  padding: 18px;
  border-bottom: 1px solid #3a3020;
  background: #1f1a12;
  position: relative;
}
.library-page-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.library-page-title {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: #faf7f2;
  line-height: 1.2;
}
.library-page-count {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9a8c78;
}
.lib-header-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lib-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.lib-header-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 12px;
  flex-wrap: wrap;
}
.lib-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.lib-search-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid rgba(200, 151, 58, 0.22);
  border-radius: 999px;
  background: rgba(18, 15, 10, 0.72);
  min-height: 38px;
}
.lib-search-icon {
  color: rgba(200, 151, 58, 0.54);
  font-size: 12px;
  line-height: 1;
}
.lib-search-input {
  width: min(320px, 34vw);
  min-width: 180px;
  border: none;
  background: transparent;
  color: #f4efe3;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  outline: none;
}
.lib-search-input::placeholder {
  color: rgba(244, 239, 227, 0.42);
}
.lib-sort-wrap {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
.lib-sort-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(200, 151, 58, 0.22);
  border-radius: 999px;
  background: rgba(18, 15, 10, 0.72);
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(242, 235, 220, 0.82) 50%),
    linear-gradient(135deg, rgba(242, 235, 220, 0.82) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: #f2ebdc;
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 9px 34px 9px 14px;
  min-height: 34px;
  outline: none;
}
.lib-filter-trigger,
.lib-filter-panel-link,
.lib-filter-panel-close {
  border: 1px solid rgba(200, 151, 58, 0.24);
  background: rgba(18, 15, 10, 0.72);
  color: rgba(232, 223, 200, 0.88);
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  min-height: 38px;
  padding: 0 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.lib-filter-trigger:hover,
.lib-filter-panel-link:hover,
.lib-filter-panel-close:hover {
  border-color: rgba(200, 151, 58, 0.42);
  color: #f2ebdc;
  background: rgba(200, 151, 58, 0.08);
}
.lib-filter-trigger.is-active {
  border-color: rgba(200, 151, 58, 0.6);
  color: #c8973a;
}
.lib-filter-layer[hidden] {
  display: none !important;
}
.lib-filter-layer {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 24;
}
.lib-filter-backdrop {
  display: none;
}
.lib-filter-panel {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(200, 151, 58, 0.24);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(28, 22, 15, 0.98) 0%, rgba(19, 15, 10, 0.98) 100%);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
  padding: 18px;
}
.lib-filter-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.lib-filter-panel-eyebrow {
  font-family: 'Montserrat', sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(200, 151, 58, 0.54);
}
.lib-filter-panel-title {
  margin: 6px 0 0;
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  line-height: 1.1;
  color: #f7f2e7;
  font-weight: 400;
}
.lib-filter-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lib-filter-panel-link,
.lib-filter-panel-close {
  min-height: 32px;
  padding: 0 12px;
}
.lib-filter-panel-close {
  width: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 50%;
}
.lib-filter-panel-groups {
  display: grid;
  gap: 16px;
}
.lib-filter-group {
  display: grid;
  gap: 10px;
}
.lib-filter-group-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(200, 151, 58, 0.6);
}
.lib-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lib-filter-more-btn {
  justify-self: start;
  border: none;
  background: transparent;
  padding: 0;
  color: rgba(200, 151, 58, 0.72);
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.lib-filter-more-btn:hover {
  color: #f4d28d;
}
.lib-filter-option {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(200, 151, 58, 0.22);
  background: transparent;
  color: rgba(232, 223, 200, 0.74);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.lib-filter-option:hover {
  border-color: rgba(200, 151, 58, 0.44);
  color: #f7f2e7;
}
.lib-filter-option.is-active {
  background: rgba(200, 151, 58, 0.12);
  border-color: rgba(200, 151, 58, 0.68);
  color: #f4d28d;
}
.lib-filter-group-empty {
  font-size: 13px;
  color: rgba(244, 239, 227, 0.44);
  font-style: italic;
}
.library-view-toggle {
  display: inline-flex;
  border: 1px solid #3a3020;
  border-radius: var(--ui-radius-md);
  background: #14110d;
  overflow: hidden;
}
.library-view-btn {
  border: none;
  background: transparent;
  color: #7a6e5a;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 10px;
  cursor: pointer;
}
.library-view-btn + .library-view-btn {
  border-left: 1px solid #3a3020;
}
.library-view-btn.active {
  color: var(--gold);
  background: rgba(200, 151, 58, 0.1);
}
.tab-panel-library.library-view-grid #repoList {
  display: none;
}
.tab-panel-library.library-view-grid .mobile-library-grid {
  display: grid;
}
.tab-panel-library.library-view-list .mobile-library-grid {
  display: none;
}
.lib-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
}
.lib-filters[hidden] {
  display: none !important;
}
.lib-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(200, 151, 58, 0.28);
  background: rgba(200, 151, 58, 0.09);
  color: #f0d28e;
  font-family: 'Montserrat', sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.lib-filter-chip-remove,
.lib-filter-chip-clear {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  padding: 0;
}
.lib-filter-chip-clear {
  background: transparent;
  border: 1px solid rgba(200, 151, 58, 0.16);
  color: rgba(244, 239, 227, 0.66);
}
.lib-empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 40px 24px;
  min-height: 220px;
  text-align: center;
  grid-column: 1 / -1;
}
.lib-empty-state-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  line-height: 1.1;
  color: #f6f0e2;
}
.lib-empty-state-copy {
  max-width: 320px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(232, 223, 200, 0.66);
}
.lib-empty-state-btn {
  padding: 9px 16px;
  border: 1px solid rgba(200, 151, 58, 0.3);
  border-radius: 999px;
  background: transparent;
  color: #f0d28e;
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.lib-empty-state-btn:hover {
  background: rgba(200, 151, 58, 0.08);
}
.lib-results-meta {
  padding-top: 6px;
  color: rgba(232, 223, 200, 0.58);
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.lib-results-meta[hidden] {
  display: none !important;
}
.main.library-only {
  overflow-y: auto;
}
.main.library-only .preview-area,
.main.library-only .tabs,
.main.library-only .sidebar-footer,
.main.library-only #tab-create,
.main.library-only #tab-settings {
  display: none !important;
}
.main.library-only + .mobile-tab-bar {
  display: none !important;
}
.main.library-only .sidebar {
  width: 100%;
  margin: 0;
  border-right: none;
  background: transparent;
  height: auto;
}
.main.library-only .sidebar-tabs-content {
  overflow: visible;
}
.main.library-only #tab-library {
  display: flex !important;
}

/* Library edit modal (all viewports) */
.lib-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lib-edit-modal[hidden] {
  display: none !important;
}

.lib-edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.lib-edit-panel {
  position: relative;
  background: #1e1a12;
  border: 1px solid rgba(200, 151, 58, 0.3);
  border-radius: 8px;
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lib-edit-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(200, 151, 58, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.lib-edit-body {
  overflow-y: auto;
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.lib-edit-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lib-edit-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lib-edit-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(200, 151, 58, 0.15);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.lib-delete-panel {
  width: 420px;
  max-width: calc(100vw - 32px);
}

.lib-delete-body {
  gap: 12px;
}

.lib-delete-copy {
  color: rgba(240, 232, 216, 0.82);
  font-size: 15px;
  line-height: 1.55;
}

.lib-delete-confirm {
  background: linear-gradient(135deg, #b46650 0%, #9f4f3a 100%);
  border-color: rgba(190, 101, 76, 0.92);
  color: #fff6f1;
}

.lib-delete-confirm:hover {
  background: linear-gradient(135deg, #c2735b 0%, #ab5944 100%);
  border-color: rgba(210, 121, 95, 0.96);
}

@media (max-width: 767px) {
  .lib-edit-modal {
    align-items: flex-end;
    z-index: 260;
  }

  .lib-edit-panel {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - var(--app-mobile-nav-height, 56px));
    border-radius: 12px 12px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .lib-edit-header {
    padding: 14px 16px 10px;
  }

  .lib-edit-body {
    padding: 14px 16px;
    gap: 16px;
  }

  .lib-edit-2col {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .lib-edit-footer {
    padding: 12px 16px;
  }

  .lib-delete-panel {
    width: 100%;
    max-width: 100%;
  }
}

@media (min-width: 768px) {
  .main.library-only #tab-library.library-redesign {
    display: block !important;
    width: 100%;
    background: transparent;
  }

  .tab-panel-library.library-redesign .mobile-library-grid {
    display: none !important;
  }

  .tab-panel-library.library-redesign .lib-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px 14px;
    position: relative;
  }

  .tab-panel-library.library-redesign .lib-title {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    color: white;
    font-weight: 400;
  }

  .tab-panel-library.library-redesign .lib-count {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(200,151,58,0.5);
    font-weight: 600;
    display: block;
  }

  .tab-panel-library.library-redesign .lib-view-toggle {
    display: flex;
    border: 1px solid rgba(200,151,58,0.3);
    border-radius: 3px;
    overflow: hidden;
  }

  .tab-panel-library.library-redesign .lib-toggle-btn {
    background: transparent;
    border: none;
    padding: 8px 18px;
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(200,151,58,0.4);
    cursor: pointer;
    transition: all 0.15s;
  }

  .tab-panel-library.library-redesign .lib-toggle-btn:not(:last-child) {
    border-right: 1px solid rgba(200,151,58,0.3);
  }

  .tab-panel-library.library-redesign .lib-toggle-btn.active {
    background: rgba(200,151,58,0.12);
    color: #c8973a;
  }

  .tab-panel-library.library-redesign .lib-toggle-btn:hover:not(.active) {
    color: rgba(200,151,58,0.7);
    background: rgba(200,151,58,0.05);
  }

  .tab-panel-library.library-redesign .lib-filters {
    padding: 4px 32px 18px;
  }

  .tab-panel-library.library-redesign .lib-results-meta {
    padding: 0 32px 18px;
  }

  .tab-panel-library.library-redesign .lib-list-view {
    display: flex;
    gap: 0;
    padding: 0 32px 32px;
    min-height: 0;
    overflow: hidden;
  }

  .tab-panel-library.library-redesign .lib-list-panel {
    width: 360px;
    flex-shrink: 0;
    overflow-y: auto;
    border: 1px solid rgba(200,151,58,0.15);
    border-radius: 4px 0 0 4px;
    max-height: none;
    background: rgba(18, 15, 10, 0.72);
  }

  .tab-panel-library.library-redesign .lib-list-view.is-sparse .lib-list-panel {
    align-self: flex-start;
    height: auto !important;
    max-height: none !important;
  }

  .tab-panel-library.library-redesign .lib-list-view.is-sparse .lib-preview-panel {
    min-height: 520px;
  }

  .tab-panel-library.library-redesign .lib-list-row {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(200,151,58,0.08);
    cursor: pointer;
    transition: background 0.15s, opacity 0.18s ease, transform 0.18s ease, max-height 0.18s ease, padding 0.18s ease, margin 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .tab-panel-library.library-redesign .lib-list-row.is-removing {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
  }

  .tab-panel-library.library-redesign .lib-list-row:hover {
    background: rgba(200,151,58,0.045);
  }

  .tab-panel-library.library-redesign .lib-list-row.active {
    background: rgba(200,151,58,0.08);
    box-shadow: inset 2px 0 0 #c8973a;
  }

  .tab-panel-library.library-redesign .lib-row-info {
    display: grid;
    gap: 7px;
  }

  .tab-panel-library.library-redesign .lib-row-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .tab-panel-library.library-redesign .lib-row-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: white;
    line-height: 1.2;
    min-width: 0;
    flex: 1 1 auto;
  }

  .tab-panel-library.library-redesign .lib-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
  }

  .tab-panel-library.library-redesign .lib-row-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: rgba(232,223,200,0.55);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .tab-panel-library.library-redesign .lib-source-marker {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid rgba(200,151,58,0.34);
    border-radius: 999px;
    background: rgba(200,151,58,0.08);
    color: #f1d08d;
    font-family: 'Montserrat', sans-serif;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .tab-panel-library.library-redesign .lib-pin-btn {
    border: 1px solid rgba(200,151,58,0.18);
    background: rgba(255,255,255,0.01);
    color: rgba(232,223,200,0.6);
    font-family: 'Montserrat', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    flex: 0 0 auto;
  }

  .tab-panel-library.library-redesign .lib-pin-btn:hover {
    border-color: rgba(200,151,58,0.34);
    color: #f0d28e;
  }

  .tab-panel-library.library-redesign .lib-pin-btn.active {
    background: rgba(200,151,58,0.12);
    border-color: rgba(200,151,58,0.52);
    color: #f4d28d;
  }

  .tab-panel-library.library-redesign .lib-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }

  .tab-panel-library.library-redesign .lib-action-btn {
    padding: 6px 11px;
    border: 1px solid rgba(200,151,58,0.18);
    background: rgba(255,255,255,0.01);
    color: rgba(232,223,200,0.62);
    font-family: 'Montserrat', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 999px;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tab-panel-library.library-redesign .lib-action-btn:hover {
    background: rgba(200,151,58,0.08);
    border-color: rgba(200,151,58,0.3);
    color: #f0d28e;
  }

  .tab-panel-library.library-redesign .lib-action-btn.danger {
    border-color: rgba(200, 110, 92, 0.2);
    color: rgba(224, 146, 126, 0.84);
  }

  .tab-panel-library.library-redesign .lib-action-btn.danger:hover {
    background: rgba(200, 110, 92, 0.08);
    border-color: rgba(224, 146, 126, 0.36);
    color: #f0b1a1;
  }

  .tab-panel-library.library-redesign .lib-action-btn.primary {
    background: linear-gradient(135deg, #d8ae57 0%, #c8973a 55%, #b67f24 100%);
    color: #2c2416;
    border-color: #c8973a;
    box-shadow: 0 10px 24px rgba(186, 134, 36, 0.18);
  }

  .tab-panel-library.library-redesign .lib-action-btn.primary:hover {
    background: linear-gradient(135deg, #dfb866 0%, #d1a04a 55%, #bf892d 100%);
  }

  .tab-panel-library.library-redesign .lib-action-btn.is-secondary {
    opacity: 0;
    pointer-events: none;
    transform: translateY(2px);
    transition:
      opacity 0.15s ease,
      transform 0.15s ease,
      border-color 0.15s ease,
      background 0.15s ease,
      color 0.15s ease;
  }

  .tab-panel-library.library-redesign .lib-list-row:hover .lib-action-btn.is-secondary,
  .tab-panel-library.library-redesign .lib-list-row.active .lib-action-btn.is-secondary,
  .tab-panel-library.library-redesign .lib-list-row:focus-within .lib-action-btn.is-secondary {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .tab-panel-library.library-redesign .lib-preview-panel {
    flex: 1;
    border: 1px solid rgba(200,151,58,0.15);
    border-left: none;
    border-radius: 0 4px 4px 0;
    background: rgba(255,255,255,0.02);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
  }

  .tab-panel-library.library-redesign .lib-preview-inner {
    position: relative;
    min-height: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  .tab-panel-library.library-redesign .lib-preview-inner .cards-wrapper {
    max-width: none;
    margin: 0;
  }

  .lib-card-measure-root {
    position: absolute;
    left: -9999px;
    top: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: -1;
  }

  .tab-panel-library.library-redesign .lib-preview-inner .card-label {
    display: none;
  }

  .tab-panel-library.library-redesign .lib-grid-view {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    padding: 0 32px 32px;
  }

  .tab-panel-library.library-redesign .lib-grid-thumb {
    display: block;
    text-decoration: none;
    border: 1px solid rgba(200,151,58,0.25);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, opacity 0.18s ease;
    position: relative;
    background: #111;
  }

  .tab-panel-library.library-redesign .lib-grid-thumb.is-removing {
    opacity: 0;
    transform: scale(0.96);
    box-shadow: none;
  }

  .tab-panel-library.library-redesign .lib-grid-action-stack {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .tab-panel-library.library-redesign .lib-grid-edit-btn {
    border: 1px solid rgba(200,151,58,0.55);
    background: rgba(44,36,22,0.9);
    color: #e8dfc8;
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 6px;
  }

  .tab-panel-library.library-redesign .lib-grid-source-pill {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    border: 1px solid rgba(200,151,58,0.65);
    background: rgba(44,36,22,0.92);
    color: #f1d08d;
    font-family: 'Montserrat', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 999px;
  }

  .tab-panel-library.library-redesign .lib-grid-edit-btn:hover {
    border-color: rgba(200,151,58,0.8);
    color: #c8973a;
  }

  .tab-panel-library.library-redesign .lib-grid-edit-btn.active {
    border-color: rgba(200,151,58,0.76);
    background: rgba(200,151,58,0.14);
    color: #f4d28d;
  }

  .tab-panel-library.library-redesign .lib-grid-edit-btn.danger {
    border-color: rgba(200, 110, 92, 0.52);
    color: #f0c6bc;
  }

  .tab-panel-library.library-redesign .lib-grid-edit-btn.danger:hover {
    border-color: rgba(224, 146, 126, 0.82);
    color: #f4b4a4;
  }

  .tab-panel-library.library-redesign .lib-grid-thumb:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    border-color: rgba(200,151,58,0.5);
  }

  .tab-panel-library.library-redesign .lib-grid-thumb::before {
    content: '';
    display: block;
    padding-top: var(--lib-thumb-ratio, calc(432 / 688 * 100%));
  }

  .tab-panel-library.library-redesign .lib-grid-scale {
    position: absolute;
    top: 0;
    left: 0;
    width: 688px;
    transform-origin: top left;
    pointer-events: none;
  }

  .tab-panel-library.library-redesign .lib-grid-scale .cards-wrapper {
    max-width: none;
    margin: 0;
  }

  .tab-panel-library.library-redesign .lib-grid-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: linear-gradient(transparent, rgba(44,36,22,0.85));
  }

  .tab-panel-library.library-redesign .lib-grid-title {
    font-family: 'Playfair Display', serif;
    font-size: 11px;
    color: white;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tab-panel-library.library-redesign .lib-grid-scale .card-label {
    display: none;
  }

  .lib-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .lib-edit-modal[hidden] {
    display: none;
  }

  .lib-edit-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
  }

  .lib-edit-panel {
    position: relative;
    background: #1e1a12;
    border: 1px solid rgba(200,151,58,0.3);
    border-radius: 8px;
    width: 560px;
    max-width: calc(100vw - 32px);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .lib-edit-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(200,151,58,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }

  .lib-edit-title {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: white;
    font-weight: 400;
  }

  .lib-edit-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.15s;
  }

  .lib-edit-close:hover {
    color: white;
  }

  .lib-edit-body {
    overflow-y: auto;
    padding: 20px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .lib-edit-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .lib-edit-section-label {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #c8973a;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .lib-edit-add {
    background: none;
    border: 1px solid rgba(200,151,58,0.35);
    color: rgba(200,151,58,0.65);
    font-family: 'Montserrat', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s;
  }

  .lib-edit-add:hover {
    background: rgba(200,151,58,0.08);
    color: #c8973a;
  }

  .lib-edit-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .lib-edit-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
  }

  .lib-edit-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(200,151,58,0.2);
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    padding: 9px 12px;
    border-radius: 3px;
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
  }

  .lib-edit-input:focus {
    border-color: rgba(200,151,58,0.55);
  }

  .illustration-combobox {
    position: relative;
  }

  .illustration-combobox-input {
    padding-right: 38px;
  }

  .illustration-combobox-toggle {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    padding: 0;
    border: none;
    border-left: 1px solid rgba(200,151,58,0.2);
    background: transparent;
    color: rgba(200,151,58,0.85);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
  }

  .illustration-combobox-toggle:hover {
    background: rgba(200,151,58,0.08);
  }

  .illustration-combobox-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    z-index: 30;
    border: 1px solid rgba(200,151,58,0.28);
    border-radius: 4px;
    background: #211a12;
    box-shadow: 0 12px 30px rgba(0,0,0,0.28);
  }

  .illustration-combobox-option,
  .illustration-combobox-empty {
    width: 100%;
    display: block;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: #f3eadb;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    text-align: left;
  }

  .illustration-combobox-option {
    cursor: pointer;
  }

  .illustration-combobox-option:hover,
  .illustration-combobox-option.is-active {
    background: rgba(200,151,58,0.14);
    color: #f5d18b;
  }

  .illustration-combobox-empty {
    color: rgba(255,255,255,0.5);
  }

  .lib-edit-textarea {
    resize: vertical;
    min-height: 72px;
  }

  .lib-edit-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .lib-ing-row,
  .lib-step-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 6px;
  }

  .lib-ing-row .lib-edit-input[data-field="name"] {
    flex: 2;
  }

  .lib-ing-row .lib-edit-input[data-field="amount"] {
    flex: 1;
  }

  .lib-ing-row .drag-handle,
  .lib-step-row .drag-handle {
    color: rgba(200,151,58,0.3);
    cursor: grab;
    padding: 10px 4px;
    font-size: 14px;
    flex-shrink: 0;
    user-select: none;
  }

  .lib-step-row .drag-handle:active {
    cursor: grabbing;
  }

  .lib-step-num {
    color: #c8973a;
    font-weight: 700;
    font-size: 12px;
    padding: 10px 4px;
    flex-shrink: 0;
    min-width: 18px;
  }

  .lib-step-row textarea.lib-edit-input {
    flex: 1;
    resize: none;
    min-height: 58px;
  }

  .lib-row-del {
    background: none;
    border: none;
    color: rgba(255,255,255,0.18);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 5px;
    transition: color 0.15s;
    flex-shrink: 0;
  }

  .lib-row-del:hover {
    color: rgba(220,80,80,0.65);
  }

  .lib-edit-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(200,151,58,0.15);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
  }

  .lib-edit-cancel {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.45);
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s;
  }

  .lib-edit-cancel:hover {
    color: white;
    border-color: rgba(255,255,255,0.3);
  }

  .lib-edit-save {
    background: #c8973a;
    border: 1px solid #c8973a;
    color: #2c2416;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 10px 24px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s;
  }

  .lib-edit-save:hover {
    background: #d4a44a;
  }

  .lib-edit-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

@media (max-width: 768px) {
  .lib-edit-modal {
    align-items: flex-start;
    padding: 12px;
    box-sizing: border-box;
  }

  .lib-edit-panel {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 24px);
  }

  .lib-edit-body {
    min-height: 0;
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
  }

  .lib-edit-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    background: #1e1a12;
  }

  .lib-edit-cancel,
  .lib-edit-save {
    flex: 1;
  }

  .lib-desktop-shell {
    display: block;
  }

  .lib-desktop-shell .lib-list-view,
  .lib-desktop-shell .lib-grid-view,
  .lib-desktop-shell .lib-card-store {
    display: none !important;
  }

  .lib-filters {
    padding: 12px 16px 0;
  }

  .lib-results-meta {
    padding: 8px 16px 0;
  }

  .lib-header,
  .library-page-header {
    padding: 16px;
  }

  .lib-header-right {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .lib-toolbar {
    width: 100%;
    gap: 8px;
  }

  .lib-search-field {
    flex: 1 1 100%;
    width: 100%;
  }

  .lib-search-input {
    width: 100%;
    min-width: 0;
  }

  .lib-sort-wrap {
    flex: 1 1 auto;
  }

  .lib-sort-select {
    width: 100%;
    max-width: 100%;
  }

  .lib-filter-trigger {
    flex: 0 0 auto;
  }

  .lib-filter-layer {
    position: fixed;
    inset: 0;
    top: auto;
    right: auto;
    z-index: 120;
  }

  .lib-filter-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    background: rgba(6, 5, 4, 0.54);
  }

  .lib-filter-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: min(72vh, 640px);
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .lib-filter-panel-head {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, rgba(28, 22, 15, 0.98) 0%, rgba(28, 22, 15, 0.96) 100%);
    padding-bottom: 10px;
    z-index: 1;
  }

  .lib-filter-panel-title {
    font-size: 20px;
  }
}

.repo-item { padding: 12px 18px; border-bottom: 1px solid #3a3020; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; transition: background 0.15s, opacity 0.18s ease, transform 0.18s ease, max-height 0.18s ease, padding 0.18s ease; }
.repo-item:hover { background: #2e2618; }
.repo-item.active { background: #352c1c; border-left: 2px solid var(--gold); }
.repo-item.is-removing { opacity: 0; transform: translateY(-8px); max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }
.repo-item-info { flex: 1; min-width: 0; }
.repo-item-title {
  font-family: 'Playfair Display', serif; font-size: 14px;
  font-weight: 700; color: #e8dfc8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.repo-item-source {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border: 1px solid rgba(200,151,58,0.5);
  border-radius: 999px;
  background: rgba(200,151,58,0.12);
  color: #d7b16a;
  font-family: 'Montserrat', sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}
.repo-item-source-wrap {
  margin-top: 4px;
}
.repo-item-meta { font-size: 11px; font-weight: 300; color: #7a6e5a; margin-top: 3px; }
.repo-count {
  font-size: 10px; font-weight: 600; color: #7a6e5a;
  letter-spacing: 0.1em; padding: 11px 18px;
  border-bottom: 1px solid #3a3020; text-transform: uppercase;
}
.btn-danger { background: transparent; color: #8a5050; border: none; padding: 4px 7px; font-size: 11px; cursor: pointer; transition: color 0.2s; }
.btn-danger:hover { color: #c87060; }
.account-info { font-size: 11px; font-weight: 300; color: #9a8c78; line-height: 1.7; }
.account-info strong { color: #e8dfc8; font-weight: 600; }
.plan-badge-pro {
  background: var(--gold);
  color: var(--dark);
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  display: inline-block;
  padding: 3px 8px;
}
.plan-date {
  font-size: 11px;
  font-weight: 400;
  color: #9a8c78;
  margin: 4px 0 10px;
  letter-spacing: 0.02em;
}
.plan-date-cancelled {
  color: #c87060;
}
.plan-badge-free {
  background: #1a1510;
  color: #8c7a5b;
  border: 1px solid #3a3020;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  display: inline-block;
  padding: 3px 8px;
}
.btn-cancel-subscription {
  width: 100%;
  background: #3a1b18;
  color: #efc2bb;
  border: 1px solid #8f3d31;
  padding: 11px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 10px;
}
.btn-cancel-subscription:hover { background: #4a2320; }
.btn-cancel-subscription:disabled { opacity: 0.6; cursor: not-allowed; }
.cancel-status {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12px;
  color: #bcae92;
}
.settings-support-link {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #3a3020;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-support-link a {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.06em;
}
.settings-support-link a:hover { text-decoration: underline; }
.settings-support-hint {
  font-size: 10px;
  font-weight: 300;
  color: #6a5e4a;
  line-height: 1.5;
}
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid #2a2010;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.sidebar-footer-link {
  font-size: 10px;
  font-weight: 400;
  color: #5a4e3c;
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.15s;
}
.sidebar-footer-link:hover { color: var(--gold); }
.sidebar-footer-sep {
  font-size: 10px;
  color: #3a3020;
}

/* ── LIBRARY ITEM ACTIONS ── */
.repo-item-actions {
  display: flex; gap: 0;
  border-bottom: 1px solid #3a3020;
  background: #1e1810;
}
.repo-action-btn {
  flex: 1; background: transparent; border: none;
  border-right: 1px solid #3a3020;
  color: #9a8c78; font-family: 'Source Sans 3', sans-serif;
  font-size: 9px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 9px 4px;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.repo-action-btn:last-child { border-right: none; }
.repo-action-btn:hover { background: #2a2418; color: var(--gold); }

.repo-action-edit  { }
.repo-action-share { }
.repo-action-print { }

/* ── INLINE EDIT PANEL ── */
.repo-edit-panel {
  background: #1a1510;
  border-bottom: 1px solid #3a3020;
  padding: 12px 14px;
  animation: slideDown 0.15s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.repo-edit-textarea {
  width: 100%; background: #0f0d0a;
  border: 1px solid #3a3020; color: #e8dfc8;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 11px; font-weight: 300; line-height: 1.6;
  padding: 8px 10px; resize: vertical;
  min-height: 120px; max-height: 280px;
  outline: none; transition: border-color 0.2s;
}
.repo-edit-textarea:focus { border-color: var(--gold); }
.repo-edit-actions {
  display: flex; gap: 8px; margin-top: 8px; align-items: center;
}
.repo-edit-regen {
  flex: 1; background: var(--gold); color: var(--dark); border: none;
  padding: 9px 12px; font-family: 'Source Sans 3', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; cursor: pointer; transition: background 0.2s;
}
.repo-edit-regen:hover    { background: #d9a840; }
.repo-edit-regen:disabled { background: #5a4e30; color: #8a7a50; cursor: not-allowed; }
.repo-edit-cancel {
  background: transparent; border: 1px solid #3a3020; color: #6a5e4a;
  padding: 9px 12px; font-family: 'Source Sans 3', sans-serif;
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; cursor: pointer; transition: all 0.2s;
}
.repo-edit-cancel:hover { border-color: #6a5e4a; color: #9a8c78; }
.repo-edit-status {
  font-size: 11px; font-weight: 300; color: var(--gold);
  margin-top: 7px; min-height: 14px;
}
.repo-edit-save {
  width: 100%; background: transparent;
  border: 1px solid var(--gold); color: var(--gold);
  padding: 9px; font-family: 'Source Sans 3', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; cursor: pointer; margin-top: 8px;
  transition: all 0.2s;
}
.repo-edit-save:hover    { background: var(--gold); color: var(--dark); }
.repo-edit-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── PORTRAIT CARD ── */
.portrait-card-wrapper,
.landscape-card-wrapper {
  width: 100%;
}

.portrait-card-wrapper {
  overflow: visible;
}

.portrait-card-wrapper-multi {
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 151, 58, 0.45) rgba(44, 36, 22, 0.12);
}

.portrait-card-wrapper-multi .portrait-card {
  scroll-snap-align: center;
}

.portrait-card-wrapper-row {
  overflow: visible !important;
}

.share-card-wrap.share-portrait-active {
  max-width: min(100%, 1180px);
}

.share-card-wrap.share-portrait-active .share-card-primary-actions {
  position: relative;
  z-index: 2;
  margin-bottom: 24px;
}

.share-card-wrap #portrait-card-wrapper.portrait-card-wrapper-multi {
  box-sizing: border-box;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

.share-card-wrap #portrait-card-wrapper.portrait-card-wrapper-row {
  margin-top: 6px;
}

.portrait-card {
  --pc-header-scale: 1;
  --pc-meta-scale: 1;
  --pc-ingredients-scale: 1;
  --pc-steps-scale: 1;
  --pc-footer-scale: 1;
  width: 540px;
  height: 960px;
  background: var(--parchment);
  border: 2px solid var(--gold);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  font-family: 'Montserrat', sans-serif;
  box-shadow: 0 4px 24px rgba(44, 36, 22, 0.18), 0 1px 4px rgba(44, 36, 22, 0.1);
}

.pc-bar {
  height: 8px;
  background: linear-gradient(90deg, var(--dark) 0%, var(--gold) 50%, var(--dark) 100%);
  flex-shrink: 0;
}

.pc-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(200, 151, 58, 0.3);
  flex-shrink: 0;
  position: relative;
  padding-right: 100px;
}

.pc-category {
  font-size: calc(10px * var(--pc-header-scale));
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
}

.pc-page-label {
  font-size: calc(9px * var(--pc-header-scale));
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(122, 106, 82, 0.9);
  font-weight: 700;
  margin-bottom: 8px;
}

.pc-title {
  font-family: 'Playfair Display', serif;
  font-size: calc(40px * var(--pc-header-scale));
  color: #3a2e1e;
  line-height: 1.1;
  margin-bottom: 10px;
}

.pc-description {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: calc(14px * var(--pc-header-scale));
  color: #7a6a52;
  line-height: 1.4;
  margin-bottom: 6px;
}

.pc-author {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: calc(12px * var(--pc-header-scale));
  color: #7a6a52;
}

.pc-meta {
  display: flex;
  border-bottom: 1px solid rgba(200, 151, 58, 0.3);
  flex-shrink: 0;
}

.pc-meta-item {
  flex: 1;
  padding: 14px 16px;
  text-align: center;
  border-right: 1px solid rgba(200, 151, 58, 0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pc-meta-item:last-child {
  border-right: none;
}

.pc-meta-label {
  font-size: calc(9px * var(--pc-meta-scale));
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.pc-meta-value {
  font-size: calc(13px * var(--pc-meta-scale));
  color: #3a2e1e;
  font-weight: 700;
}

.pc-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.pc-body.pc-body-method-only .pc-steps {
  padding-left: 18px;
  padding-right: 18px;
}

.pc-body.pc-body-method-only .pc-ingredients-note {
  display: none;
}

.pc-body.pc-body-method-only .pc-steps {
  width: 100%;
  padding: 22px 24px;
}

.portrait-card-method-only .pc-col-label,
.portrait-card-ingredients-only .pc-col-label {
  font-size: calc(10px * var(--pc-steps-scale));
  margin-bottom: 14px;
}

.portrait-card-method-only .pc-header,
.portrait-card-ingredients-only .pc-header {
  padding: 22px 26px 18px;
}

.portrait-card-method-only .pc-title,
.portrait-card-ingredients-only .pc-title {
  line-height: 1.03;
  margin-bottom: 4px;
}

.portrait-card-method-only .pc-meta-item,
.portrait-card-ingredients-only .pc-meta-item {
  padding: 8px 14px;
}

.pc-body.pc-body-ingredients-only .pc-ingredients {
  width: 100%;
  border-right: none;
  padding: 18px 18px 20px;
  box-sizing: border-box;
}

.portrait-card-ingredients-only .pc-table thead th {
  font-size: calc(10px * var(--pc-ingredients-scale));
  padding: 6px 10px;
}

.portrait-card-ingredients-only .pc-table tbody td {
  font-size: calc(12px * var(--pc-ingredients-scale));
  padding: 5px 10px;
}

.portrait-card-ingredients-only .pc-table tbody td.pc-amount {
  font-size: calc(11px * var(--pc-ingredients-scale));
}

.pc-body.pc-body-ingredients-only .pc-steps {
  display: none;
}

.pc-ingredients {
  width: 44%;
  border-right: 1px solid rgba(200, 151, 58, 0.3);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pc-ingredients.pc-ingredients-note {
  justify-content: flex-start;
  padding: 18px 14px;
}

.pc-ingredients-note-text {
  padding: 8px 14px 0;
  font-size: calc(11px * var(--pc-ingredients-scale));
  line-height: 1.45;
  color: #7a6a52;
  font-style: italic;
}

.pc-ingredients-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.pc-col-label {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  padding: 0 14px;
  margin-bottom: 10px;
  display: block;
  flex-shrink: 0;
}

.pc-ingredients .pc-col-label {
  font-size: calc(9px * var(--pc-ingredients-scale));
}

.pc-steps .pc-col-label {
  font-size: calc(9px * var(--pc-steps-scale));
}

.portrait-card-ingredients-only .pc-ingredients .pc-col-label {
  font-size: calc(10px * var(--pc-ingredients-scale));
}

.portrait-card-method-only .pc-steps .pc-col-label {
  font-size: calc(10px * var(--pc-steps-scale));
}

.pc-ingredients-head .pc-col-label {
  padding: 0;
  margin-bottom: 0;
}

.pc-illustration {
  position: absolute;
  top: 7px;
  right: 10px;
  width: 96px;
  height: 96px;
  pointer-events: none;
}

.pc-illustration-img {
  width: 96px;
  height: 96px;
  opacity: 0.55;
  filter: invert(60%) sepia(40%) saturate(500%) hue-rotate(5deg);
}

.pc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.pc-table thead tr {
  background: var(--dark);
}

.pc-table thead th {
  font-size: calc(9px * var(--pc-ingredients-scale));
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--parchment);
  padding: 5px 10px;
  text-align: left;
  font-weight: 600;
}

.pc-table thead th:last-child {
  text-align: right;
}

.pc-table.pc-table-single-col thead th:last-child {
  text-align: left;
}

.pc-table tbody tr:nth-child(even) {
  background: #f0ebe0;
}

.pc-table tbody td {
  font-size: calc(11px * var(--pc-ingredients-scale));
  color: #3a2e1e;
  padding: 5px 10px;
  line-height: 1.3;
  vertical-align: top;
}

.pc-table tbody td.pc-amount {
  text-align: right;
  font-weight: 700;
  font-size: calc(10px * var(--pc-ingredients-scale));
}

.pc-table.pc-table-single-col tbody td {
  width: 100%;
}

.pc-steps {
  flex: 1;
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pc-step {
  display: flex;
  gap: 10px;
  margin-bottom: calc(10px * var(--pc-steps-scale));
  align-items: flex-start;
}

.pc-step-num {
  color: var(--gold);
  font-weight: 700;
  font-size: calc(12px * var(--pc-steps-scale));
  min-width: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.pc-step-text {
  font-size: calc(11px * var(--pc-steps-scale));
  color: #3a2e1e;
  line-height: 1.36;
}

.portrait-card-method-only .pc-step {
  gap: 13px;
  margin-bottom: calc(13px * var(--pc-steps-scale));
}

.portrait-card-method-only .pc-step-num {
  font-size: calc(14px * var(--pc-steps-scale));
  min-width: 18px;
}

.portrait-card-method-only .pc-step-text {
  font-size: calc(12.5px * var(--pc-steps-scale));
  line-height: 1.42;
}

.pc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid rgba(200, 151, 58, 0.3);
  background: #f0ebe0;
  flex-shrink: 0;
}

.pc-footer-left {
  font-size: calc(10px * var(--pc-footer-scale));
  color: #3a2e1e;
  font-weight: 700;
}

.pc-footer-right {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: calc(10px * var(--pc-footer-scale));
  color: #7a6a52;
}

/* ── FORMAT TOGGLE ── */
.format-toggle {
  display: flex;
  width: 100%;
  max-width: 640px;
  margin: 0 auto 20px;
  box-sizing: border-box;
}

.format-btn {
  flex: 1;
  white-space: nowrap;
  padding: 13px 8px;
  background: rgba(44,36,22,0.6);
  border: 1px solid rgba(200,151,58,0.3);
  color: rgba(200,151,58,0.5);
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.format-btn:not(:last-child) {
  border-right: none;
}

.format-btn.active {
  background: rgba(200,151,58,0.12);
  color: #c8973a;
  border-color: rgba(200,151,58,0.6);
}

/* Mobile: portrait default */
@media (max-width: 767px) {
  #portrait-card-wrapper  { display: block; }
  #landscape-card-wrapper { display: none; }
}

.share-card-wrap.share-card-wrapper {
  flex-direction: column;
  align-items: center !important;
  overflow: visible !important;
}

@media (min-width: 768px) {
  #portrait-card-wrapper  { display: none; }
  #landscape-card-wrapper { display: block; }
}

/* ── MOBILE LIBRARY GRID ── */
.mobile-library-grid {
  display: none;
}

.mobile-library-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 12px;
  font-size: 12px;
  color: #7a6e5a;
  border: 1px solid #3a3020;
  background: #1a1510;
  font-style: italic;
}

@media (max-width: 768px) {
  #repoList {
    display: none;
  }

  .mobile-library-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
  }

  .mobile-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 540 / 960;
    overflow: hidden;
    border-radius: 3px;
    border: 1px solid rgba(200, 151, 58, 0.35);
    position: relative;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.18s ease;
    background: #faf7f2;
  }

  .mobile-thumb.is-removing {
    opacity: 0;
    transform: scale(0.96);
    box-shadow: none;
  }

  .mobile-thumb-action-stack {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .mobile-thumb-edit {
    border: 1px solid rgba(200,151,58,0.6);
    background: rgba(44,36,22,0.92);
    color: #e8dfc8;
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 6px;
  }

  .mobile-thumb-edit.active {
    border-color: rgba(200,151,58,0.76);
    background: rgba(200,151,58,0.16);
    color: #f4d28d;
  }

  .mobile-thumb-edit.danger {
    border-color: rgba(200, 110, 92, 0.58);
    color: #f2c9c0;
  }

  .mobile-thumb-source-pill {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    border: 1px solid rgba(200,151,58,0.65);
    background: rgba(44,36,22,0.92);
    color: #f1d08d;
    font-family: 'Montserrat', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 999px;
  }

  .mobile-thumb-edit:active {
    transform: scale(0.98);
  }

  .mobile-thumb:active {
    transform: scale(0.97);
  }

  .mobile-thumb-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 540px;
    height: 960px;
    transform-origin: top left;
    pointer-events: none;
  }

  .mobile-thumb-inner .portrait-card {
    box-shadow: none;
    border-width: 1px;
  }

  .library-view-toggle,
  .tab-panel-library.library-redesign .lib-view-toggle {
    display: none;
  }
}

/* ── PREVIEW ── */
.preview-area {
  flex: 1;
  display: flex;
  position: relative;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px 32px 76px;
  box-sizing: border-box;
  background-color: #f0ebe0;
  background-image:
    linear-gradient(rgba(200,151,58,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,151,58,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.preview-generation-overlay[hidden] {
  display: none !important;
}

.preview-generation-overlay {
  position: absolute;
  inset: 24px 32px 76px;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(240,235,224,0.56) 0%, rgba(240,235,224,0.76) 100%);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.preview-generation-panel {
  width: min(460px, calc(100% - 40px));
  padding: 24px 24px 20px;
  border: 1px solid rgba(200,151,58,0.34);
  border-radius: var(--ui-radius-xl);
  background: rgba(30, 23, 13, 0.92);
  box-shadow: 0 22px 48px rgba(30, 23, 13, 0.28);
  text-align: center;
  color: #efe5d2;
}

.preview-generation-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(226, 198, 136, 0.78);
}

.preview-generation-title {
  margin-top: 10px;
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.08;
  color: #f6ead2;
}

.preview-generation-subtitle {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(239, 229, 210, 0.82);
}

.preview-generation-progress-track {
  position: relative;
  width: 100%;
  height: 12px;
  margin-top: 18px;
  background: rgba(200,151,58,0.12);
  border: 1px solid rgba(200,151,58,0.28);
  border-radius: 999px;
  overflow: hidden;
}

.preview-generation-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(214,172,86,0.72) 0%, #d3a84e 50%, #e7c67a 100%);
  box-shadow: 0 0 24px rgba(224, 185, 101, 0.26);
  transition: width 220ms ease;
}

.preview-generation-progress-label {
  margin-top: 10px;
  min-height: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(226, 198, 136, 0.9);
}

.preview-area.is-generating #previewEmpty,
.preview-area.is-generating #cardResultWrapper {
  opacity: 0.78;
}

.cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
  width: max-content;
  margin: 0 auto;
  transform-origin: top center;
  position: relative;
  max-width: 100%;
}

.card-result-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mobile-card-actions {
  display: none;
}

.card-wrap,
.rcm-card-wrap,
.card-outer-wrap {
  overflow: visible;
  max-width: 100%;
}

.mobile-card-hint {
  text-align: center;
  font-size: 10px;
  color: #6a5e4a;
  letter-spacing: 0.08em;
  margin-top: 8px;
  font-style: italic;
  opacity: 1;
  transition: opacity 1s;
}

.mobile-card-hint.fade-out {
  opacity: 0;
}

.card-fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(44,36,22,0.7);
  color: var(--gold);
  border: 1px solid rgba(200,151,58,0.3);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 12;
  border-radius: 2px;
}
.cards-wrapper:hover .card-fullscreen-btn {
  opacity: 1;
}

/* ── GHOST CARD ── */
@keyframes ghostPulse {
  0%, 100% { opacity: 0.82; }
  50%       { opacity: 0.62; }
}

.ghost-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 360px;
  padding: 24px;
  box-sizing: border-box;
}
.ghost-card {
  width: 100%;
  max-width: 660px;
  background: rgba(250,247,242,0.78);
  border: 1.5px dashed rgba(200,151,58,0.42);
  position: relative;
  animation: ghostPulse 2.8s ease-in-out infinite;
  display: flex;
  flex-direction: column;
}
.ghost-top-band {
  height: 18px;
  background: rgba(44,36,22,0.16);
  display: flex;
  align-items: center;
  padding: 0 12px;
}
.ghost-band-bar {
  width: 80px;
  height: 4px;
  background: rgba(200,151,58,0.3);
  border-radius: 1px;
}
.ghost-gold-accent {
  height: 4px;
  background: rgba(200,151,58,0.26);
}
.ghost-body {
  display: flex;
  flex: 1;
  padding: 16px;
  min-height: 260px;
}
.ghost-left {
  flex: 0 0 44%;
  padding-right: 14px;
  display: flex;
  flex-direction: column;
}
.ghost-right {
  flex: 1;
  padding-left: 14px;
  display: flex;
  flex-direction: column;
}
.ghost-col-divider {
  width: 1px;
  background: rgba(212,201,176,0.62);
  flex-shrink: 0;
}

.ghost-eyebrow {
  height: 5px;
  width: 80px;
  background: rgba(200,151,58,0.34);
  margin-bottom: 10px;
  border-radius: 1px;
}
.ghost-title-line {
  height: 14px;
  background: rgba(44,36,22,0.18);
  margin-bottom: 6px;
  border-radius: 2px;
}
.ghost-text-line {
  height: 7px;
  background: rgba(44,36,22,0.12);
  margin-bottom: 5px;
  border-radius: 1px;
}
.ghost-section-label {
  height: 5px;
  width: 70px;
  background: rgba(200,151,58,0.3);
  margin-bottom: 8px;
  border-radius: 1px;
}
.ghost-footer-line {
  height: 6px;
  background: rgba(44,36,22,0.1);
  margin-top: 12px;
  border-radius: 1px;
}
.ghost-table-header {
  height: 14px;
  background: rgba(44,36,22,0.2);
  margin-bottom: 2px;
}
.ghost-table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 14px;
  padding: 0 4px;
  margin-bottom: 2px;
  background: rgba(250,247,242,0.5);
}
.ghost-row-alt { background: rgba(244,239,230,0.5); }
.ghost-cell {
  height: 6px;
  background: rgba(44,36,22,0.12);
  border-radius: 1px;
}

.ghost-step {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.ghost-step-num {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(200,151,58,0.34);
  flex-shrink: 0;
  margin-top: 2px;
}
.ghost-step-content { flex: 1; }
.ghost-step-verb {
  height: 6px;
  width: 36px;
  background: rgba(44,36,22,0.2);
  margin-bottom: 6px;
  border-radius: 1px;
}

/* Width utilities */
.ghost-w-15 { width: 15%; } .ghost-w-18 { width: 18%; }
.ghost-w-20 { width: 20%; } .ghost-w-40 { width: 40%; }
.ghost-w-45 { width: 45%; } .ghost-w-50 { width: 50%; }
.ghost-w-55 { width: 55%; } .ghost-w-60 { width: 60%; }
.ghost-w-65 { width: 65%; } .ghost-w-70 { width: 70%; }
.ghost-w-75 { width: 75%; } .ghost-w-80 { width: 80%; }
.ghost-w-85 { width: 85%; } .ghost-w-90 { width: 90%; }

/* CTA overlay */
.ghost-cta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  background: rgba(240,235,224,0.22);
}
.ghost-cta-icon {
  font-size: 22px;
  color: rgba(200,151,58,0.78);
  line-height: 1;
}
.ghost-cta-text {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-style: italic;
  font-weight: 400;
  color: rgba(200,151,58,0.88);
  letter-spacing: 0.02em;
}

/* On wide screens, show two cards side by side */
@media (min-width: 1400px) {
  .cards-wrapper.two-cards {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 48px;
  }
  .cards-wrapper.two-cards .card-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

.card-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: #9a8878;
  margin-bottom: 8px; text-align: center;
}

/* ── RECIPE CARD ── */
.recipe-card {
  width: 6in; height: 4in;
  background: var(--parchment);
  position: relative; overflow: hidden;
  box-shadow: 0 4px 24px rgba(44,36,22,0.18), 0 1px 4px rgba(44,36,22,0.1);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.recipe-card::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 10; opacity: 0.5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"); }
.c-top-band   { background: var(--dark); height: 5px; flex-shrink: 0; }
.c-accent-bar { background: var(--gold); height: 3px; flex-shrink: 0; }
.c-body { display: flex; flex: 1; overflow: hidden; box-sizing: border-box; }

.c-left { flex: 0 0 44%; min-width: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 11px 11px 10px 13px; gap: 7px; position: relative; z-index: 2; overflow: hidden; }
.c-left-main { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }
.c-ingredients-wrap { flex: 1; min-height: 0; overflow: hidden; margin-bottom: 4px; }
.c-header { padding-right: 66px; }
.c-eyebrow { font-size: 7pt; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 2px; }
.c-title { --title-min-size: 11.5pt; font-family: 'Playfair Display', serif; font-size: 14pt; font-weight: 700; color: var(--ink); line-height: 1.1; }
.c-subtitle { --subtitle-min-size: 5.6pt; display: block; max-width: 100%; min-width: 0; font-family: 'Playfair Display', serif; font-style: italic; font-size: 8.5pt; line-height: 1.14; color: var(--muted); margin-top: 1px; white-space: normal; overflow: hidden; overflow-wrap: anywhere; }
.c-header-compact { padding-right: 86px; }
.c-header-compact .c-title { --title-min-size: 9.4pt; font-size: 12pt; line-height: 1.04; }
.c-header-compact .c-eyebrow { font-size: 6.2pt; margin-bottom: 1px; }
.c-header-compact .c-subtitle { --subtitle-min-size: 5.2pt; display: block; max-height: 17.2pt; padding-bottom: 1.5px; font-size: 7pt; line-height: 1.16; }
.c-author { font-size: 7.5pt; font-weight: 400; color: #9a8c78; margin-top: 2px; font-style: italic; font-family: 'Playfair Display', serif; }
.c-section-label { font-size: 7pt; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.c-illustration { position: absolute; top: 4px; right: 16px; width: 54px; height: 54px; pointer-events: none; }
.c-illustration-img { width: 54px; height: 54px; opacity: 0.55; filter: invert(60%) sepia(40%) saturate(500%) hue-rotate(5deg); }
.c-illustration-compact { top: 10px; right: 9px; width: 62px; height: 62px; }
.c-illustration-img-compact { width: 62px; height: 62px; opacity: 0.5; }

.c-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.c-col-name { width: 56%; }
.c-col-amt { width: 44%; }
.c-table.c-table-single-col .c-col-name { width: 100%; }
.c-thead { background: var(--dark); }
.c-th { font-family: 'Source Sans 3', sans-serif; font-size: 6.5pt; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #e8dfc8; padding: 3px 5px; }
.c-th-left { text-align: left; }
.c-th-right { text-align: right; padding-right: 6px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.c-table.c-table-single-col .c-th-right { display: none; }
.c-td { padding: 1.5px 5px; font-size: 8pt; color: var(--body-col); font-weight: 300; white-space: normal; vertical-align: top; box-sizing: border-box; }
.c-table-relaxed .c-td { padding: 2.2px 5px; font-size: 8.7pt; }
.c-table-relaxed .c-th { padding: 3.4px 5px; font-size: 6.8pt; }
.c-table-compact .c-td { padding: 1px 5px; font-size: 7pt; }
.c-table-compact .c-th { padding: 2px 5px; font-size: 6pt; }
.c-table-ultra .c-td { padding: 0.6px 4px; font-size: 6.2pt; }
.c-table-ultra .c-th { padding: 1px 4px; font-size: 5.6pt; }
.c-table-micro .c-td { padding: 0.4px 3px; font-size: 5.6pt; }
.c-table-micro .c-th { padding: 0.8px 3px; font-size: 5.1pt; }
.c-td-name { text-align: left; font-weight: 400; white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.3; padding-right: 4px; hyphens: auto; }
.c-td-amt { text-align: right; padding-right: 6px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; font-family: 'Playfair Display', serif; font-weight: 700; color: var(--ink); line-height: 1.2; hyphens: auto; }
.c-table.c-table-single-col .c-td-amt { display: none; }
.c-td-name-text,
.c-td-amt-text {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.c-td-name-text { line-height: 1.3; }
.c-td-amt-text { line-height: 1.2; text-align: right; }
.c-table-compact .c-td-amt-text { font-size: 6.25pt; line-height: 1.1; }
.c-table-ultra .c-td-name-text { line-height: 1.12; }
.c-table-ultra .c-td-amt-text { font-size: 5.7pt; line-height: 1.02; }
.c-table-micro .c-td-name-text { line-height: 1.04; }
.c-table-micro .c-td-amt-text { font-size: 5.1pt; line-height: 1; }
.c-tr-even { background: #f4efe6; }

.ff-collection-bar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.ff-collection-bar-rule {
  background: var(--gold);
}

.ff-collection-bar-body {
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ff-collection-bar-body span {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.portrait-card .ff-collection-bar-rule {
  height: 2px;
}

.portrait-card .ff-collection-bar-body {
  height: 28px;
}

.portrait-card .ff-collection-bar-body span {
  font-size: 11px;
  letter-spacing: 0.26em;
}

.recipe-card .ff-collection-bar-rule {
  height: 1.5px;
}

.recipe-card .ff-collection-bar-body {
  height: 20px;
}

.recipe-card .ff-collection-bar-body span {
  font-size: 9px;
  letter-spacing: 0.22em;
}

.ff-fannie-card .pc-kitchen-notes,
.ff-fannie-card .c-kitchen-notes {
  border: 0.5px solid rgba(200, 151, 58, 0.35);
  background: rgba(200, 151, 58, 0.05);
}

.ff-fannie-card .pc-kitchen-notes {
  margin: 10px 0 0;
  padding: 7px 10px;
}

.ff-fannie-card .c-kitchen-notes {
  margin-top: 6px;
  padding: 5px 7px;
}

.ff-fannie-card .pc-kitchen-notes-label,
.ff-fannie-card .c-kitchen-notes-label {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold);
}

.ff-fannie-card .pc-kitchen-notes-label {
  font-size: 7px;
  letter-spacing: 0.2em;
  margin-bottom: 4px;
}

.ff-fannie-card .c-kitchen-notes-label {
  font-size: 6pt;
  letter-spacing: 0.18em;
  margin-bottom: 2px;
}

.ff-fannie-card .pc-kitchen-notes-list,
.ff-fannie-card .c-kitchen-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ff-fannie-card .pc-kitchen-notes-list li,
.ff-fannie-card .c-kitchen-notes-list li {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: #8a6830;
}

.ff-fannie-card .pc-kitchen-notes-list li {
  font-size: 9.5px;
  line-height: 1.45;
}

.ff-fannie-card .c-kitchen-notes-list li {
  font-size: 7pt;
  line-height: 1.35;
}

.ff-fannie-card .pc-kitchen-notes-list li + li,
.ff-fannie-card .c-kitchen-notes-list li + li {
  margin-top: 3px;
}

.ff-fannie-card .pc-xref,
.ff-fannie-card .c-xref {
  color: #8a6020;
  border-bottom: 1px solid rgba(138, 96, 32, 0.42);
  cursor: pointer;
}

.ff-fannie-card .pc-ingredient-link,
.ff-fannie-card .c-ingredient-link {
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  color: #8a6020;
  font-weight: 600;
  border-bottom: 1px dotted rgba(138, 96, 32, 0.55);
  border-bottom-style: dotted;
  text-decoration: none;
  cursor: pointer;
}

.ff-fannie-card .pc-ingredient-link:hover,
.ff-fannie-card .pc-ingredient-link:focus-visible,
.ff-fannie-card .pc-ingredient-link:active,
.ff-fannie-card .c-ingredient-link:hover,
.ff-fannie-card .c-ingredient-link:focus-visible,
.ff-fannie-card .c-ingredient-link:active {
  color: #8a6020;
  border-bottom-style: solid;
  outline: none;
}

.ff-fannie-card .c-component-amount {
  color: #8a6020;
  font-style: italic;
  white-space: nowrap;
}

.ff-fannie-card .pc-xref {
  font-size: 10px;
}

.ff-fannie-card .c-xref {
  font-size: 7pt;
}

.ff-fannie-card .pc-step-xref,
.ff-fannie-card .c-step-xref {
  display: block;
  margin-top: 2px;
}

.c-left-footer { margin-top: auto; margin-bottom: 0; font-size: 7.5pt; font-weight: 300; color: #9a8c78; line-height: 1.35; border-top: 1px solid var(--border); padding-top: 8px; padding-bottom: 0; flex-shrink: 0; }
.c-cook-time { font-family: 'Playfair Display', serif; font-weight: 700; color: #1a1208; font-size: 7.8pt; line-height: 1.2; margin-bottom: 2px; }
.c-note,
.c-tip-note { font-style: italic; font-size: 7.5pt; color: #666; }
.c-right { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; padding: 11px 13px 10px 11px; position: relative; z-index: 2; overflow: hidden; }
.c-right-col { display: flex; flex-direction: column; justify-content: space-between; min-height: 100%; height: 100%; gap: 6px; }
.c-right-main { --method-scale: 1; display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.c-step { display: flex; gap: calc(6px * var(--method-scale)); align-items: baseline; margin-bottom: calc(3px * var(--method-scale)); width: 100%; min-width: 0; }
.c-step-num { font-family: 'Playfair Display', serif; font-size: calc(8pt * var(--method-scale)); font-weight: 700; color: var(--gold); min-width: calc(14px * var(--method-scale)); flex-shrink: 0; }
.c-step-label { font-weight: 600; color: var(--ink); font-size: calc(7pt * var(--method-scale)); text-transform: uppercase; letter-spacing: 0.06em; margin-right: calc(3px * var(--method-scale)); }
.c-step-text { display: block; flex: 1 1 auto; min-width: 0; max-width: 100%; font-size: calc(8pt * var(--method-scale)); color: #3a3028; font-weight: 300; line-height: 1.25; overflow-wrap: break-word; }
.c-step.c-step-relaxed { gap: calc(7px * var(--method-scale)); margin-bottom: calc(4px * var(--method-scale)); }
.c-step.c-step-relaxed .c-step-num { font-size: calc(8.8pt * var(--method-scale)); min-width: calc(15px * var(--method-scale)); }
.c-step.c-step-relaxed .c-step-label { font-size: calc(7.4pt * var(--method-scale)); letter-spacing: 0.07em; margin-right: calc(3px * var(--method-scale)); }
.c-step.c-step-relaxed .c-step-text { font-size: calc(8.8pt * var(--method-scale)); line-height: 1.28; }
.c-step.c-step-expanded { gap: calc(8px * var(--method-scale)); margin-bottom: calc(4.6px * var(--method-scale)); }
.c-step.c-step-expanded .c-step-num { font-size: calc(9.6pt * var(--method-scale)); min-width: calc(17px * var(--method-scale)); }
.c-step.c-step-expanded .c-step-label { font-size: calc(7.8pt * var(--method-scale)); letter-spacing: 0.08em; margin-right: calc(3px * var(--method-scale)); }
.c-step.c-step-expanded .c-step-text { font-size: calc(9.6pt * var(--method-scale)); line-height: 1.32; }
.c-step.c-step-compact { gap: calc(5px * var(--method-scale)); margin-bottom: calc(2px * var(--method-scale)); }
.c-step.c-step-compact .c-step-num { font-size: calc(7pt * var(--method-scale)); min-width: calc(12px * var(--method-scale)); }
.c-step.c-step-compact .c-step-label { font-size: calc(6pt * var(--method-scale)); letter-spacing: 0.05em; margin-right: calc(2px * var(--method-scale)); }
.c-step.c-step-compact .c-step-text { font-size: calc(7pt * var(--method-scale)); line-height: 1.16; }
.c-step.c-step-ultra { gap: calc(4px * var(--method-scale)); margin-bottom: calc(1.6px * var(--method-scale)); }
.c-step.c-step-ultra .c-step-num { font-size: calc(6.3pt * var(--method-scale)); min-width: calc(10px * var(--method-scale)); }
.c-step.c-step-ultra .c-step-label { font-size: calc(5.5pt * var(--method-scale)); letter-spacing: 0.04em; margin-right: calc(2px * var(--method-scale)); }
.c-step.c-step-ultra .c-step-text { font-size: calc(6.3pt * var(--method-scale)); line-height: 1.1; }
.c-step.c-step-micro { gap: calc(3px * var(--method-scale)); margin-bottom: calc(1.2px * var(--method-scale)); }
.c-step.c-step-micro .c-step-num { font-size: calc(5.8pt * var(--method-scale)); min-width: calc(9px * var(--method-scale)); }
.c-step.c-step-micro .c-step-label { font-size: calc(5pt * var(--method-scale)); letter-spacing: 0.03em; margin-right: calc(1.5px * var(--method-scale)); }
.c-step.c-step-micro .c-step-text { font-size: calc(5.8pt * var(--method-scale)); line-height: 1.06; }
.c-step.c-step-nano { gap: calc(2.4px * var(--method-scale)); margin-bottom: calc(0.9px * var(--method-scale)); }
.c-step.c-step-nano .c-step-num { font-size: calc(5.2pt * var(--method-scale)); min-width: calc(8px * var(--method-scale)); }
.c-step.c-step-nano .c-step-label { font-size: calc(4.6pt * var(--method-scale)); letter-spacing: 0.02em; margin-right: calc(1px * var(--method-scale)); }
.c-step.c-step-nano .c-step-text { font-size: calc(5.2pt * var(--method-scale)); line-height: 1.02; }
.c-card-footer { border-top: 1px solid var(--border); padding-top: 5px; padding-bottom: 0; margin-top: auto; margin-bottom: 0; display: flex; justify-content: space-between; flex-shrink: 0; }
.c-footer-note { font-size: 7.5pt; font-weight: 300; color: #9a8c78; font-style: italic; font-family: 'Playfair Display', serif; }
.c-tip-note,
.c-footer-note { display: inline-block; margin-bottom: 2px; padding-bottom: 2px; line-height: 1.3; }
.c-steps-stack { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; min-width: 0; overflow: hidden; }
.c-steps-stack-inner { width: 100%; min-width: 0; }
.c-steps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; flex: 1; min-height: 0; overflow: hidden; }
.c-steps-grid-col { min-width: 0; }
.c-steps-grid.c-steps-grid-relaxed { gap: 0 16px; }
.c-steps-grid.c-steps-grid-expanded { gap: 0 18px; }
.c-steps-grid.c-steps-grid-compact { gap: 0 10px; }
.c-steps-grid.c-steps-grid-ultra { gap: 0 7px; }
.c-steps-grid.c-steps-grid-micro { gap: 0 5px; }
.c-steps-grid.c-steps-grid-nano { gap: 0 3px; }
.cards-wrapper.two-cards .c-left { padding-bottom: 8px; }
.cards-wrapper.two-cards .c-right { padding-bottom: 8px; }
.cards-wrapper.two-cards .c-left-footer,
.cards-wrapper.two-cards .c-card-footer { margin-bottom: 0; padding-bottom: 0; }

.placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 12px; opacity: 0.3; }
.placeholder p { font-family: 'Playfair Display', serif; font-style: italic; font-size: 13px; color: var(--muted); }

.app-footer {
  position: fixed; bottom: 0; right: 0;
  padding: 6px 16px;
  font-size: 10px; font-weight: 300; color: #6a5e4a;
  display: flex; gap: 14px; align-items: center;
  background: rgba(24,18,8,0.7);
}
.app-footer-brand {
  color: #c8b898;
  font-family: 'Playfair Display', serif;
  font-size: 11px;
  font-weight: 700;
}
.app-footer a { color: #9a8c78; text-decoration: none; transition: color 0.2s; }
.app-footer a:hover { color: var(--gold); }

.fullscreen-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,18,8,0.985);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
}
.fullscreen-overlay.active {
  display: flex;
}
.fullscreen-card-wrap {
  position: relative;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  height: 90vh;
  overflow: hidden;
}
.fullscreen-card-wrap .cards-wrapper {
  margin-bottom: 0 !important;
  max-width: none !important;
}
.fullscreen-close {
  position: fixed;
  top: 16px;
  right: 16px;
  background: rgba(200,151,58,0.15);
  border: 1px solid rgba(200,151,58,0.3);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  cursor: pointer;
  z-index: 1001;
}
.fullscreen-hint {
  font-size: 10px;
  color: #7a6a50;
  margin-top: 12px;
  letter-spacing: 0.08em;
}

.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--dark); border-top: 2px solid var(--gold);
  padding: 14px 32px; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; z-index: 1000;
  font-size: 12px; font-weight: 300; color: #9a8c78;
}
.cookie-banner a { color: var(--gold); }
.cookie-btn {
  background: var(--gold); color: var(--dark); border: none;
  padding: 8px 20px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background 0.2s;
}
.cookie-btn:hover { background: #d9a840; }

/* ── PRINT ── */
@media print {
  /* Force all background colors and images to print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  @page {
    size: 6in 4in;
    margin: 0;
  }

  html,
  body {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .main,
  .preview-area {
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    overflow: visible !important;
    min-height: 0 !important;
  }

  /* Hard print isolation: hide all app chrome, then opt-in print containers only */
  body > * {
    display: none !important;
  }

  .main,
  .preview-area,
  .card-result-wrapper,
  .recipe-page,
  .recipe-page-card-section,
  #landscape-card-wrapper,
  .share-page-container,
  .share-card-section,
  .share-card-wrap,
  .share-card-wrapper {
    display: block !important;
  }

  .cards-wrapper:not(.print-target) {
    display: none !important;
  }

  .cards-wrapper.print-target {
    display: block !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    transform: none !important;
    gap: 0 !important;
    width: 6in !important;
    height: 4in !important;
    min-height: 4in !important;
    max-width: none !important;
    overflow: hidden !important;
  }

  .cards-wrapper.print-target:not(.two-cards) {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: auto !important;
    padding: 4mm !important;
  }

  .cards-wrapper.print-target > .card-label,
  .card-group > .card-label {
    display: none !important;
  }

  .cards-wrapper.print-target > .recipe-card {
    position: absolute !important;
    top: calc(50% - 192px) !important;
    left: calc(50% - 288px) !important;
    width: 576px !important;
    height: 384px !important;
    min-height: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transform: scale(0.92126) !important;
    transform-origin: center center !important;
    overflow: hidden !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .cards-wrapper.print-target.two-cards {
    display: block !important;
    width: 6in !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }

  .cards-wrapper.print-target.two-cards .card-group {
    display: block !important;
    box-sizing: border-box !important;
    width: 6in !important;
    height: 4in !important;
    margin: 0 !important;
    padding: 4mm !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
    overflow: hidden !important;
  }

  .cards-wrapper.print-target.two-cards .card-group > .recipe-card {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    left: auto !important;
    transform: none !important;
  }

  .cards-wrapper.print-target.two-cards .card-group + .card-group {
    page-break-before: always !important;
    break-before: page !important;
  }

  .cards-wrapper.print-target.two-cards .card-group:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .recipe-card {
    box-shadow: none !important;
  }

  /* Hide UI elements */
  .app-topbar,
  .topbar,
  .sidebar,
  .mobile-tab-bar,
  .card-actions,
  .card-fullscreen-btn,
  .fullscreen-overlay,
  .preview-label,
  .card-label,
  .recipe-page-content,
  .recipe-page-related,
  .recipe-page-cta,
  .recipe-page-conversion-block,
  .conversion-block,
  .recipe-page-back-row,
  .ghost-wrap,
  .app-footer,
  .cookie-banner,
  button,
  nav {
    display: none !important;
  }

  /* Shared page: print only the card region */
  .share-conversion-block,
  .mobile-recipe-layout,
  .share-action-btns,
  .print-instructions,
  #generated-share-suites,
  .generated-share-suites,
  .share-suite,
  .share-suite-grid,
  .share-suite-loading,
  .share-suite-helper,
  .mobile-card-actions {
    display: none !important;
  }

  .conversion-block {
    display: none !important;
  }

  .share-page-container,
  .share-card-section,
  .share-card-wrap {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  .share-card-wrapper,
  .card-container {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  .recipe-page,
  .recipe-page-card-section,
  #landscape-card-wrapper,
  .landscape-card-wrapper {
    width: auto !important;
    max-width: none !important;
  }

  /* Print only 4x6 landscape card output */
  #portrait-card-wrapper,
  .portrait-card-wrapper,
  .format-toggle {
    display: none !important;
  }

  #landscape-card-wrapper,
  .landscape-card-wrapper {
    display: block !important;
  }
}

@media (max-width: 1100px) {
  .topbar {
    flex-wrap: wrap;
    justify-content: space-between;
    row-gap: 10px;
  }
  .topbar-right {
    justify-content: flex-end;
    flex-wrap: wrap;
    width: 100%;
    gap: 16px;
  }
}

/* ── PRINT GUIDE ── */
.print-guide-toggle {
  width: 100%; background: transparent; border: none;
  color: #9a8c78; font-family: 'Source Sans 3', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-align: left; padding: 8px 0 4px; cursor: pointer;
  transition: color 0.2s;
}
.print-guide-toggle:hover { color: var(--gold); }

.print-guide-intro {
  font-size: 11px; font-weight: 300; color: #9a8c78;
  line-height: 1.5; margin: 8px 0 12px;
}

.print-guide-rule {
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 10px;
}
.print-guide-num {
  font-family: 'Playfair Display', serif; font-size: 13px;
  font-weight: 700; color: var(--gold); min-width: 16px;
  flex-shrink: 0; line-height: 1.3;
}
.print-guide-title {
  font-size: 11px; font-weight: 600; color: #c8b898;
  margin-bottom: 2px; letter-spacing: 0.04em;
}
.print-guide-text {
  font-size: 10px; font-weight: 300; color: #7a6e5a; line-height: 1.5;
}

/* Browser tabs */
.print-browser-tabs {
  display: flex; gap: 3px; margin: 14px 0 8px; flex-wrap: wrap;
}
.pbr-tab {
  background: #1a1510; border: 1px solid #3a3020;
  color: #6a5e4a; font-family: 'Source Sans 3', sans-serif;
  font-size: 9px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 8px; cursor: pointer;
  transition: all 0.15s;
}
.pbr-tab:hover { border-color: var(--gold); color: #9a8c78; }
.pbr-tab.active { background: #2c2416; border-color: var(--gold); color: var(--gold); }

/* Step list */
.pbr-steps {
  display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px;
}
.pbr-step {
  font-size: 11px; font-weight: 300; color: #9a8c78;
  padding-left: 12px; position: relative; line-height: 1.5;
}
.pbr-step::before {
  content: '→'; position: absolute; left: 0;
  color: var(--gold); font-size: 9px; top: 2px;
}
.pbr-step strong { color: #c8b898; font-weight: 600; }
.pbr-key {
  display: inline-block; background: #1a1510; border: 1px solid #3a3020;
  color: #9a8c78; font-size: 9px; padding: 1px 5px;
  font-family: monospace; border-radius: 2px;
}

.print-shop-link {
  display: block; font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); text-decoration: none;
  margin-top: 4px; transition: color 0.2s;
}
.print-shop-link:hover { color: #d9a840; }

/* ══════════════════════════════════════════
   CARD THEMES
   ══════════════════════════════════════════ */

/* ── THEME: LIGHT & AIRY ── */
.recipe-card.theme-airy {
  background: #ffffff;
}
.recipe-card.theme-airy .c-top-band { background: #8faa8f; height: 4px; }
.recipe-card.theme-airy .c-accent-bar { background: #b8cdb8; height: 2px; }
.recipe-card.theme-airy .c-eyebrow { color: #6a8f6a; }
.recipe-card.theme-airy .c-title { color: #1a2a1a; }
.recipe-card.theme-airy .c-subtitle { color: #6a7a6a; }
.recipe-card.theme-airy .c-author { color: #8a9a8a; }
.recipe-card.theme-airy .c-section-label { color: #6a8f6a; }
.recipe-card.theme-airy .c-thead { background: #4a6a4a; }
.recipe-card.theme-airy .c-th { color: #f0f4f0; }
.recipe-card.theme-airy .c-td { color: #3a4a3a; }
.recipe-card.theme-airy .c-td-amt { color: #1a2a1a; }
.recipe-card.theme-airy .c-tr-even { background: #f0f4f0; }
.recipe-card.theme-airy .c-step-num { color: #6a8f6a; }
.recipe-card.theme-airy .c-step-label { color: #1a2a1a; }
.recipe-card.theme-airy .c-step-text { color: #3a4a3a; }
.recipe-card.theme-airy .c-left { border-right-color: #d0dcd0; }
.recipe-card.theme-airy .c-left-footer { color: #8a9a8a; border-top-color: #d0dcd0; }
.recipe-card.theme-airy .c-card-footer { border-top-color: #d0dcd0; }
.recipe-card.theme-airy .c-footer-note { color: #8a9a8a; }
.recipe-card.theme-airy .badge { background: #6a8f6a; color: #fff; }

/* ── THEME: RUSTIC ── */
.recipe-card.theme-rustic {
  background: #c4a882;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}
.recipe-card.theme-rustic .c-top-band { background: #3d2610; height: 6px; }
.recipe-card.theme-rustic .c-accent-bar { background: #a0522d; height: 2px; }
.recipe-card.theme-rustic .c-eyebrow { color: #a0522d; letter-spacing: 0.22em; }
.recipe-card.theme-rustic .c-title { color: #1a0e06; }
.recipe-card.theme-rustic .c-subtitle { color: #6b4c2a; }
.recipe-card.theme-rustic .c-author { color: #8a6a4a; }
.recipe-card.theme-rustic .c-section-label { color: #a0522d; }
.recipe-card.theme-rustic .c-thead { background: #3d2610; }
.recipe-card.theme-rustic .c-th { color: #e8d5b8; }
.recipe-card.theme-rustic .c-td { color: #4a3020; }
.recipe-card.theme-rustic .c-td-amt { color: #1a0e06; }
.recipe-card.theme-rustic .c-tr-even { background: #b89870; }
.recipe-card.theme-rustic .c-step-num { color: #a0522d; }
.recipe-card.theme-rustic .c-step-label { color: #1a0e06; }
.recipe-card.theme-rustic .c-step-text { color: #3a2010; }
.recipe-card.theme-rustic .c-left { border-right-color: #9a7a5a; }
.recipe-card.theme-rustic .c-left-footer { color: #7a5a3a; border-top-color: #9a7a5a; }
.recipe-card.theme-rustic .c-card-footer { border-top-color: #9a7a5a; }
.recipe-card.theme-rustic .c-footer-note { color: #7a5a3a; }
.recipe-card.theme-rustic .badge { background: #a0522d; color: #fff; }

/* ── THEME: MODERN ── */
.recipe-card.theme-modern {
  background: #ffffff;
}
.recipe-card.theme-modern .c-top-band { background: #1a1a1a; height: 6px; }
.recipe-card.theme-modern .c-accent-bar { background: #d0d0d0; height: 1px; }
.recipe-card.theme-modern .c-eyebrow {
  color: #888; font-family: 'Source Sans 3', sans-serif;
  font-size: 6.5pt; letter-spacing: 0.2em;
}
.recipe-card.theme-modern .c-title {
  --title-min-size: 10.75pt;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13pt; font-weight: 700; color: #111; letter-spacing: -0.02em;
}
.recipe-card.theme-modern .c-subtitle {
  --subtitle-min-size: 5.9pt;
  font-family: 'Source Sans 3', sans-serif;
  font-style: normal; font-size: 8pt; color: #666;
}
.recipe-card.theme-modern .c-author {
  font-family: 'Source Sans 3', sans-serif;
  font-style: normal; color: #aaa;
}
.recipe-card.theme-modern .c-section-label { color: #333; }
.recipe-card.theme-modern .c-thead { background: #1a1a1a; }
.recipe-card.theme-modern .c-th { color: #fff; letter-spacing: 0.1em; }
.recipe-card.theme-modern .c-td { color: #444; }
.recipe-card.theme-modern .c-td-amt {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700; color: #111;
}
.recipe-card.theme-modern .c-tr-even { background: #f5f5f5; }
.recipe-card.theme-modern .c-step-num { color: #333; }
.recipe-card.theme-modern .c-step-label {
  font-family: 'Source Sans 3', sans-serif; color: #111;
}
.recipe-card.theme-modern .c-step-text { color: #444; }
.recipe-card.theme-modern .c-left { border-right-color: #e0e0e0; }
.recipe-card.theme-modern .c-left-footer { color: #999; border-top-color: #e0e0e0; }
.recipe-card.theme-modern .c-card-footer { border-top-color: #e0e0e0; }
.recipe-card.theme-modern .c-footer-note {
  font-family: 'Source Sans 3', sans-serif; font-style: normal; color: #999;
}
.recipe-card.theme-modern .badge { background: #1a1a1a; color: #fff; }

/* ── THEME SELECTOR ── */
.theme-selector {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px;
}
.theme-swatch {
  width: 48px; height: 32px; border: 2px solid transparent;
  cursor: pointer; transition: border-color 0.15s; position: relative;
  overflow: hidden; flex-shrink: 0;
}
.theme-swatch.active { border-color: var(--gold); }
.theme-swatch:hover { border-color: #7a6a50; }
.theme-swatch-band { height: 5px; }
.theme-swatch-body { flex: 1; height: 27px; }
.theme-swatch-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 6px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; text-align: center;
  padding: 1px 0; background: rgba(0,0,0,0.3); color: #fff;
}

/* Pro lock overlay on swatches */
.theme-swatch.locked { opacity: 0.45; cursor: not-allowed; }
.theme-swatch.locked::after {
  content: '⚷';
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%);
  font-size: 11px; color: rgba(255,255,255,0.8);
}

/* ── MOBILE LAYOUT ── */
.mobile-tab-bar {
  display: none;
}

.mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  color: #6a5e4a;
  transition: color 0.15s;
  padding: 0;
}

.mobile-tab.active {
  color: var(--gold);
  border-top: 2px solid var(--gold);
  margin-top: -2px;
}

.mobile-tab-icon {
  font-size: 16px;
  line-height: 1;
}

.mobile-tab-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mobile-new-card-bar {
  display: none;
}

.mobile-new-card-bar[hidden] {
  display: none !important;
}

@media (max-width: 767px) {
  .preview-generation-overlay {
    inset: 12px 12px 88px;
  }

  .generation-progress {
    margin-top: 12px;
    padding: 10px 12px 11px;
    border: 1px solid rgba(200,151,58,0.24);
    background: rgba(31, 23, 13, 0.72);
  }

  .generation-progress-track {
    height: 12px;
  }

  .generation-progress-label {
    margin-top: 8px;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: rgba(226, 198, 136, 0.9);
  }

  .preview-generation-panel {
    width: min(420px, calc(100% - 20px));
    padding: 20px 18px 18px;
  }

  .preview-generation-title {
    font-size: 22px;
  }

  .preview-generation-subtitle {
    font-size: 12px;
  }

  body.recipes-page-body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  .card-result-wrapper,
  .generated-card-container {
    visibility: hidden;
  }

  .card-result-wrapper.ready,
  .generated-card-container.ready {
    visibility: visible;
  }

  .mobile-card-actions.ready {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
  }

  .mobile-card-actions-row {
    display: flex;
    width: 100%;
  }

  .mobile-card-action-btn {
    flex: 1;
    padding: 14px 8px;
    background: transparent;
    border: 1px solid #c8973a;
    color: #c8973a;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .mobile-card-actions-row .mobile-card-action-btn:not(:last-child) {
    border-right: none;
  }

  .mobile-card-action-btn.save-library-btn {
    flex: 0 0 auto;
    width: 100%;
    background: var(--gold);
    border-color: var(--gold);
    color: var(--dark);
    font-weight: 700;
    letter-spacing: 0.1em;
    min-height: 46px;
  }

  .mobile-card-action-btn.new-card-btn {
    width: 100%;
    background: transparent;
    border-color: #4a4030;
    color: #c8b898;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
  }

  .mobile-card-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }

  .mobile-new-card-bar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 8px);
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(36,30,20,0.98);
    border: 1px solid rgba(200,151,58,0.35);
    box-shadow: 0 -8px 24px rgba(0,0,0,0.25);
    z-index: 219;
  }

  /* Product decision: suppress the old "new card" banner bar on mobile. */
  .mobile-new-card-bar,
  body.mobile-input-collapsed-visible .mobile-new-card-bar {
    display: none !important;
  }

  .mobile-new-card-label {
    color: rgba(240,235,224,0.9);
    font-size: 11px;
    letter-spacing: 0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
  }

  .mobile-new-card-btn {
    flex-shrink: 0;
    background: rgba(200,151,58,0.14);
    border: 1px solid rgba(200,151,58,0.6);
    color: #c8973a;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 9px 12px;
    cursor: pointer;
  }

}

@media (min-width: 768px) {
  .mobile-card-actions {
    display: none !important;
  }

  .mobile-new-card-bar {
    display: none !important;
  }
}

@media (max-width: 768px) {
  body.mobile-pre-generation {
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--dark);
  }

  body.mobile-create-panel-open {
    overflow: hidden;
    background: var(--dark);
  }

  body.mobile-pre-generation .preview-area {
    display: none;
  }

  body.mobile-create-panel-open .preview-area {
    display: none;
  }

  #previewEmpty {
    display: none !important;
  }

  #printSection {
    display: none !important;
  }

  #themeSection {
    display: none;
  }

  body.mobile-has-generated-card.mobile-pro-tier #tab-create #themeSection {
    display: block !important;
  }

  body.mobile-input-collapsed-visible .preview-area {
    padding-bottom: 156px;
  }

  .main {
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
    background: var(--dark);
    /* Let the document own vertical scrolling on mobile to avoid Safari/iOS
       resetting the inner app scroller during browser-chrome resizes. */
    overflow: visible;
  }

  .sidebar {
    width: 100%;
    height: auto;
    min-height: 0;
    border-right: none;
    overflow: visible;
    background: transparent;
  }

  .tabs,
  .sidebar-footer {
    display: none;
  }

  .sidebar-tabs-content {
    overflow: visible;
    pointer-events: none;
  }

  .tab-panel {
    display: none !important;
    position: fixed;
    bottom: 56px;
    left: 0;
    right: 0;
    max-height: 60vh;
    overflow-y: auto;
    background: #241e14;
    border-top: 1px solid #3a3020;
    z-index: 220;
    pointer-events: auto;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.35);
  }

  .tab-panel.mobile-active {
    display: flex !important;
  }

  .main:not(.library-only) #tab-create,
  .main:not(.library-only) #tab-library,
  .main:not(.library-only) #tab-settings {
    display: none !important;
  }

  .main:not(.library-only) #tab-create.mobile-active,
  .main:not(.library-only) #tab-library.mobile-active,
  .main:not(.library-only) #tab-settings.mobile-active {
    display: flex !important;
  }

  .main:not(.library-only) #tab-create.mobile-active {
    top: var(--app-mobile-nav-height, 56px);
    bottom: 56px;
    max-height: none;
    height: auto;
    overflow: hidden;
    border-top: none;
    z-index: 235;
    box-shadow: none;
    background: #241e14;
  }

  #imtPhoto { order: 1; }
  #imtPaste { order: 2; }
  #imtUrl { order: 3; }

  #tab-create .panel-section {
    padding-top: 12px;
    padding-bottom: 12px;
    padding-left: max(14px, calc(env(safe-area-inset-left, 0px) + 10px));
    padding-right: max(14px, calc(env(safe-area-inset-right, 0px) + 10px));
  }

  #tab-create .panel-section:first-child {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-x: visible;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #tab-create .panel-section:nth-child(2) {
    flex-shrink: 0;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  #tab-create .panel-section:nth-child(3) {
    display: none;
  }

  #tab-create .input-mode-toggle {
    flex-shrink: 0;
    margin-bottom: 10px;
  }

  #tab-create #pasteMode,
  #tab-create #urlMode,
  #tab-create #photoMode {
    display: none;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
  }

  #tab-create #photoMode {
    padding-left: 1px;
    padding-right: 1px;
  }

  #tab-create #pasteMode .panel-label,
  #tab-create #urlMode .panel-label {
    margin-top: 0 !important;
  }

  #tab-create #pasteMode .recipe-input {
    flex: 1;
    min-height: 0;
    margin-bottom: 6px;
  }

  #tab-create #photoMode .photo-upload-area {
    flex: 0 0 auto;
    min-height: auto;
    height: auto;
    width: 100%;
    max-width: none;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 20px 14px 14px;
    justify-content: flex-start !important;
    gap: 10px;
    overflow: hidden;
  }

  #tab-create #photoMode .photo-upload-usage {
    margin-top: 4px;
  }

  #tab-create #pasteMode .input-hint,
  #tab-create #urlMode .hint {
    display: none;
  }

  #tab-create #photoMode .photo-upload-icon {
    display: none !important;
  }

  #tab-create #photoMode .photo-upload-title {
    margin-top: 0;
    padding-top: 2px;
    line-height: 1.2;
  }

  #tab-create #photoMode .panel-gate {
    flex: 1;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
  }

  #tab-create .recipe-by-row {
    margin-top: 12px;
    display: block !important;
    gap: 6px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    clear: both;
  }

  #tab-create .recipe-by-label {
    display: block !important;
    margin: 0 0 6px 0 !important;
    line-height: 1.2;
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  #tab-create .recipe-by-row #authorName {
    display: block !important;
    width: 100% !important;
    min-width: 100% !important;
    margin: 0 !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    float: none !important;
    clear: both;
  }

  #tab-create .recipe-by-hint {
    display: none;
  }

  #tab-create #dailyLimitHint {
    margin-top: 7px !important;
    margin-bottom: 0;
    color: #8a7a60;
  }

  #tab-create #statusMsg,
  #tab-create #errorMsg {
    margin-top: 6px;
    min-height: 0;
  }

  .main.library-only {
    flex-direction: column;
  }

  .main.library-only .sidebar {
    width: 100%;
    height: 0;
    overflow: hidden;
    background: transparent;
    border-right: none;
  }

  .main.library-only .sidebar-tabs-content {
    overflow: hidden;
    pointer-events: auto;
  }

  .main.library-only .tab-panel {
    display: none !important;
    position: fixed;
    top: var(--app-mobile-nav-height, 56px);
    bottom: 56px;
    left: 0;
    right: 0;
    max-height: none;
    overflow-y: auto;
    background: #241e14;
    border-top: none;
    z-index: 235;
    box-shadow: none;
  }

  .main.library-only .tab-panel.mobile-active {
    display: flex !important;
  }

  .preview-area {
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 16px;
    padding-bottom: 72px;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .preview-area.generated-ready {
    background: var(--dark);
    background-image: none;
  }

  .ghost-wrap {
    min-height: 0;
    padding: 8px;
    align-items: flex-start;
  }

  .ghost-card {
    max-width: 100%;
  }

  .card-result-wrapper,
  .generated-card-container,
  #landscape-card-wrapper,
  .landscape-card-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .cards-wrapper {
    width: max-content;
    max-width: none;
    min-width: 0;
    margin: 0;
    overflow: visible;
  }

  .card-wrapper,
  .card-outer,
  .rcm-card-wrap {
    width: 100%;
    max-width: 100%;
  }

  .two-cards,
  .rcm-card-outer,
  .card-outer,
  .rcm-card,
  .recipe-card {
    cursor: default;
    -webkit-tap-highlight-color: transparent;
  }

  .preview-label,
  .card-preview-label,
  [class*="recipe-card-label"],
  .card-label {
    display: none !important;
  }

  .mobile-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--dark);
    border-top: 2px solid var(--gold);
    display: flex;
    align-items: stretch;
    z-index: 230;
  }

  .topbar {
    padding: 12px 16px;
    min-height: 56px;
  }

  .topbar-right > .topbar-link,
  .topbar-right > .signout-btn {
    display: none;
  }

  .user-avatar {
    display: none;
  }

  .topbar-right {
    width: auto;
    gap: 8px;
  }

  .app-footer {
    display: none;
  }

  .cards-wrapper .card-fullscreen-btn {
    display: none;
  }

  .fullscreen-overlay.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    transform: none;
    padding: 8px;
    overflow: hidden;
  }

  .fullscreen-card-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  .fullscreen-close {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 4px 10px;
  }

  .fullscreen-hint {
    display: none;
  }
}

@media (max-width: 767px) {
  .generated-card-container #format-toggle {
    display: none;
  }

  .generated-card-container.ready #format-toggle {
    display: flex;
  }
}

/* Mobile edit trigger + bottom sheet (shared card page only) */
.mob-edit-trigger {
  display: none;
}

.mob-sheet-overlay {
  display: none;
}

.mob-sheet {
  display: none;
}

@media (max-width: 767px) {
  .mob-edit-trigger {
    display: flex;
    justify-content: center;
    margin: 12px 0 4px;
    padding: 0 12px;
    box-sizing: border-box;
  }

  .mob-edit-trigger-btn {
    background: transparent;
    border: 1px solid #c8973a;
    color: #c8973a;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 11px 28px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s;
    width: 100%;
  }

  .mob-edit-trigger-btn:hover {
    background: rgba(200,151,58,0.08);
    color: #c8973a;
  }

  .mob-sheet-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  .mob-sheet-overlay.visible {
    opacity: 1;
    pointer-events: all;
  }

  .mob-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 901;
    background: #1e1a12;
    border-top: 1px solid rgba(200,151,58,0.3);
    border-radius: 16px 16px 0 0;
    max-height: 90dvh;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .mob-sheet.open {
    transform: translateY(0);
  }

  .mob-sheet-handle-wrap {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
    cursor: grab;
    flex-shrink: 0;
  }

  .mob-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(200,151,58,0.3);
    border-radius: 2px;
  }

  .mob-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 14px;
    border-bottom: 1px solid rgba(200,151,58,0.12);
    flex-shrink: 0;
  }

  .mob-sheet-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: white;
    font-weight: 400;
    margin: 0;
  }

  .mob-sheet-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
  }

  .mob-sheet-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  .mob-sheet-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mob-sheet-section-label {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #c8973a;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mob-sheet-add {
    background: none;
    border: 1px solid rgba(200,151,58,0.35);
    color: rgba(200,151,58,0.65);
    font-family: 'Montserrat', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 2px;
  }

  .mob-sheet-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .mob-sheet-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
  }

  .mob-sheet-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(200,151,58,0.2);
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    padding: 10px 12px;
    border-radius: 3px;
    width: 100%;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
  }

  .mob-sheet-input:focus {
    border-color: rgba(200,151,58,0.55);
  }

  .illustration-combobox {
    position: relative;
  }

  .illustration-combobox-input {
    padding-right: 38px;
  }

  .illustration-combobox-toggle {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    padding: 0;
    border: none;
    border-left: 1px solid rgba(200,151,58,0.2);
    background: transparent;
    color: rgba(200,151,58,0.85);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
  }

  .illustration-combobox-toggle:hover {
    background: rgba(200,151,58,0.08);
  }

  .illustration-combobox-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    z-index: 30;
    border: 1px solid rgba(200,151,58,0.28);
    border-radius: 4px;
    background: #211a12;
    box-shadow: 0 12px 30px rgba(0,0,0,0.28);
  }

  .illustration-combobox-option,
  .illustration-combobox-empty {
    width: 100%;
    display: block;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: #f3eadb;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    text-align: left;
  }

  .illustration-combobox-option {
    cursor: pointer;
  }

  .illustration-combobox-option:hover,
  .illustration-combobox-option.is-active {
    background: rgba(200,151,58,0.14);
    color: #f5d18b;
  }

  .illustration-combobox-empty {
    color: rgba(255,255,255,0.5);
  }

  .mob-sheet-textarea {
    resize: none;
    min-height: 72px;
  }

  .mob-sheet-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .mob-ing-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
  }

  .mob-ing-row .mob-sheet-input[data-field="name"] {
    flex: 2;
  }

  .mob-ing-row .mob-sheet-input[data-field="amount"] {
    flex: 1;
  }

  .mob-step-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin-bottom: 6px;
  }

  .mob-drag-handle {
    color: rgba(200,151,58,0.3);
    cursor: grab;
    padding: 10px 3px;
    font-size: 14px;
    flex-shrink: 0;
    user-select: none;
  }

  .mob-step-num {
    color: #c8973a;
    font-weight: 700;
    font-size: 12px;
    padding: 10px 3px;
    flex-shrink: 0;
    min-width: 16px;
  }

  .mob-step-row textarea.mob-sheet-input {
    flex: 1;
    min-height: 58px;
  }

  .mob-row-del {
    background: none;
    border: none;
    color: rgba(255,255,255,0.18);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 4px;
    flex-shrink: 0;
  }

  .mob-sheet-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 12px 20px calc(28px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(200,151,58,0.12);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    background: #1e1a12;
  }

  .mob-sheet-cancel {
    flex: 1;
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.45);
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 13px;
    cursor: pointer;
    border-radius: 3px;
  }

  .mob-sheet-save {
    flex: 2;
    background: #c8973a;
    border: 1px solid #c8973a;
    color: #2c2416;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 13px;
    cursor: pointer;
    border-radius: 3px;
  }

  .mob-sheet-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

/* =============================================
   SEO RECIPES PAGES
   ============================================= */

.mobile-only  { display: none; }
.desktop-only { display: flex; gap: 8px; }

@media (max-width: 767px) {
  .mobile-only  { display: block; }
  .desktop-only { display: none !important; }
}

.share-suite {
  width: 100%;
  margin-top: 12px;
}

.share-suite-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
}

.share-suite-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 6px;
  background: transparent;
  border: 1px solid rgba(200,151,58,0.35);
  color: rgba(200,151,58,0.7);
  font-family: 'Montserrat', sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.share-suite-btn.primary {
  background: rgba(200,151,58,0.12);
  color: #c8973a;
}

.share-suite-btn:hover:not(:disabled) {
  background: rgba(200,151,58,0.08);
  color: #c8973a;
}

.share-suite-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.share-suite-icon {
  font-size: 16px;
  line-height: 1;
}

.share-suite-label {
  font-size: 8px;
}

@media (min-width: 768px) {
  .share-suite-btn {
    flex-direction: row;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 2px;
    font-size: 9px;
  }
}

.share-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #2c2416;
  border: 1px solid rgba(200,151,58,0.4);
  color: #c8973a;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}

.share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =============================================
   RECIPE PAGE
   ============================================= */

.recipe-page {
  width: 100%;
  min-width: 0;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px 72px;
}

.recipe-page-card-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
  width: 100%;
  min-width: 0;
}

.recipe-page #landscape-card-wrapper {
  width: 100%;
  overflow: hidden;
}

@media screen and (min-width: 768px) {
  .recipe-page-card-section {
    --recipe-card-desktop-width: clamp(620px, 74vw, 1180px);
    width: var(--recipe-card-desktop-width);
    margin-left: calc(50% - (var(--recipe-card-desktop-width) / 2));
    margin-right: calc(50% - (var(--recipe-card-desktop-width) / 2));
  }

  .recipe-page #landscape-card-wrapper {
    overflow: visible;
  }
}

.recipe-page-card-section .format-toggle {
  margin-left: auto;
  margin-right: auto;
}

.recipe-page-card-section .share-suite.mobile-only {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.recipe-page-card-section .share-suite.desktop-only {
  width: auto;
  margin: 12px auto 0;
  justify-content: center;
}

@media (min-width: 768px) {
  .recipe-page #portrait-card-wrapper {
    min-height: 675.56px;
  }

  .recipe-page #portrait-card-wrapper .portrait-card {
    transform-origin: top center;
    transform: scale(0.7037037);
  }
}

.recipe-page-content {
  max-width: 640px;
  margin: 0 auto 56px;
}

.recipe-page-eyebrow {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #c8973a;
  font-weight: 700;
  margin-bottom: 10px;
}

.recipe-page-title {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  color: white;
  line-height: 1.15;
  font-weight: 400;
  margin-bottom: 10px;
}

.recipe-rating-widget {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin: 2px 0 12px;
}

.recipe-rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.recipe-rating-star {
  border: none;
  background: transparent;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  padding: 0;
  margin: 0;
  min-width: 18px;
}

.recipe-rating-star.is-filled {
  color: #c8973a;
}

.recipe-rating-star:focus-visible {
  outline: 1px solid rgba(200,151,58,0.7);
  outline-offset: 2px;
}

.recipe-rating-star:disabled {
  cursor: wait;
  opacity: 0.75;
}

.recipe-rating-summary {
  color: #d6c9af;
  font-size: 14px;
  line-height: 1.2;
}

.recipe-rating-label {
  color: rgba(200,184,152,0.8);
  font-size: 12px;
  line-height: 1.2;
}

.recipe-rating-message {
  color: #c8973a;
  font-size: 12px;
  line-height: 1.2;
}

.recipe-rating-message.is-error {
  color: #d28787;
}

.recipe-page-desc {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 15px;
  color: #c8b898;
  line-height: 1.55;
  margin-bottom: 6px;
}

.recipe-page-author {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 13px;
  color: rgba(200,184,152,0.6);
  margin-bottom: 24px;
}

.recipe-page-meta {
  display: flex;
  gap: 0;
  border: 1px solid rgba(200,151,58,0.2);
  border-radius: 3px;
  margin-bottom: 32px;
  overflow: hidden;
}

.recipe-page-meta-item {
  flex: 1;
  padding: 12px 16px;
  text-align: center;
  border-right: 1px solid rgba(200,151,58,0.15);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recipe-page-meta-item:last-child {
  border-right: none;
}

.recipe-page-meta-label {
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c8973a;
  font-weight: 700;
}

.recipe-page-meta-value {
  font-size: 13px;
  color: white;
  font-weight: 600;
}

.recipe-page-section {
  margin-bottom: 28px;
}

.recipe-page-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: white;
  font-weight: 400;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(200,151,58,0.15);
}

.recipe-page-ingredients {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recipe-page-ingredient {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
  color: #c8b898;
}

.recipe-ing-link {
  color: #e0bb73;
  text-decoration: none;
  border-bottom: 1px dotted rgba(224,187,115,0.58);
}

.recipe-ing-link:hover,
.recipe-ing-link:focus-visible {
  color: #f0d49d;
  border-bottom-style: solid;
  outline: none;
}

.recipe-ing-amount {
  font-weight: 700;
  color: white;
  min-width: 80px;
  flex-shrink: 0;
}

.recipe-page-steps {
  padding-left: 0;
  margin: 0;
  list-style: none;
  counter-reset: steps;
}

.recipe-page-step {
  counter-increment: steps;
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
  color: #c8b898;
  line-height: 1.6;
  align-items: flex-start;
}

.recipe-page-step::before {
  content: counter(steps);
  color: #c8973a;
  font-weight: 700;
  font-size: 13px;
  min-width: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.recipe-page-notes {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 14px;
  color: rgba(200,184,152,0.7);
  line-height: 1.6;
}

.recipe-page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 24px;
}

.recipe-page-tag {
  padding: 5px 12px;
  border: 1px solid rgba(200,151,58,0.25);
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(200,151,58,0.5);
  text-decoration: none;
  transition: all 0.15s;
}

.recipe-page-tag:hover {
  border-color: rgba(200,151,58,0.5);
  color: #c8973a;
}

.recipe-page-conversion-block,
.conversion-block,
.recipe-page-cta {
  position: relative;
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 36px 24px;
  box-sizing: border-box;
  text-align: center;
  background: #2c2416;
  border-top: 1px solid rgba(250,247,242,0.1);
  border-bottom: 1px solid rgba(200,151,58,0.2);
  overflow: hidden;
}

.recipe-page-conversion-block::before,
.conversion-block::before,
.recipe-page-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(200,151,58,0.16), transparent 48%),
    radial-gradient(circle at 88% 82%, rgba(250,247,242,0.1), transparent 54%),
    repeating-linear-gradient(
      -33deg,
      rgba(250,247,242,0.03) 0 2px,
      transparent 2px 20px
    );
  opacity: 0.8;
}

.conversion-block-inner,
.recipe-page-cta-inner {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  margin: 0 auto;
}

.conversion-block-headline,
.recipe-page-cta-headline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 4.2vw, 40px);
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: #c8973a;
  font-weight: 400;
  margin: 0 0 12px;
}

.conversion-block-copy,
.recipe-page-cta-sub {
  margin: 0 auto 22px;
  color: #faf7f2;
  font-size: 15px;
  line-height: 1.55;
  max-width: 38ch;
}

.conversion-block-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 30px;
  border: 1px solid rgba(44,36,22,0.2);
  background: #c8973a;
  color: #2c2416;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.conversion-block-cta:hover {
  background: #ddb569;
  transform: translateY(-1px);
}

.conversion-block-cta:focus-visible {
  outline: 2px solid #faf7f2;
  outline-offset: 2px;
}

.recipe-page-cta-nudge {
  font-size: 11px;
  color: rgba(200,151,58,0.6);
  margin-top: 10px;
  font-style: italic;
}

@media (min-width: 768px) {
  .recipe-page-conversion-block,
  .conversion-block {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .conversion-block-headline {
    margin-bottom: 6px;
  }

  .conversion-block-copy {
    margin-bottom: 10px;
  }

  .conversion-block-cta {
    width: auto !important;
    min-height: 0;
    margin-left: auto;
    margin-right: auto;
    padding: 8px 20px;
    font-size: 10px;
    letter-spacing: 0.08em;
    line-height: 1.1;
  }
}

.recipe-page-related {
  margin-bottom: 40px;
}

.recipe-page-related-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: white;
  font-weight: 400;
  margin-bottom: 20px;
}

.recipe-page-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.recipe-related-card {
  text-decoration: none;
  display: block;
  transition: transform 0.15s;
}

.recipe-related-card:hover {
  transform: translateY(-2px);
}

.recipe-related-thumb {
  width: 100%;
  aspect-ratio: 688 / 432;
  overflow: hidden;
  border: 1px solid rgba(200,151,58,0.25);
  border-radius: 3px;
  margin-bottom: 8px;
  background: #2c2416;
  transition: border-color 0.15s;
}

.recipe-related-card:hover .recipe-related-thumb {
  border-color: rgba(200,151,58,0.5);
}

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

.recipe-related-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recipe-related-category {
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #c8973a;
  font-weight: 700;
}

.recipe-related-title {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  color: white;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-related-time {
  font-size: 9px;
  color: rgba(200,151,58,0.5);
  font-weight: 600;
}

/* =============================================
   RECIPES INDEX — CORRECTED
   ============================================= */

body.recipes-page-body {
  background: #1a1208;
  color: #e8dfc8;
}

.recipes-index {
  min-height: 100vh;
  background: #1a1208;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 18px 80px;
}

.recipes-index-header {
  margin-bottom: 28px;
}

.recipes-index-title {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  color: #ffffff;
  font-weight: 400;
  margin-bottom: 8px;
}

.recipes-index-sub {
  font-size: 13px;
  color: #c8b898;
  line-height: 1.5;
}

.recipes-search-wrap {
  position: relative;
  margin-bottom: 20px;
  max-width: 480px;
}

.recipes-search-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(200,151,58,0.3);
  border-radius: 3px;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  padding: 12px 44px 12px 40px;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.recipes-search-input:focus {
  border-color: rgba(200,151,58,0.6);
}

.recipes-search-input::placeholder {
  color: rgba(255,255,255,0.3);
}

.recipes-search-input::-webkit-search-cancel-button {
  display: none;
}

.recipes-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(200,151,58,0.5);
  font-size: 17px;
  pointer-events: none;
  line-height: 1;
}

.recipes-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
}

.recipes-search-clear:hover {
  color: rgba(255,255,255,0.6);
}

.recipes-index-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
}

.recipes-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(200,151,58,0.3);
  background: transparent;
  color: rgba(200,151,58,0.6);
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.15s;
}

.recipes-chip.active {
  background: #c8973a;
  color: #2c2416;
  border-color: #c8973a;
}

.recipes-chip:hover:not(.active) {
  border-color: rgba(200,151,58,0.6);
  color: #c8973a;
}

.recipes-index-section {
  margin-bottom: 12px;
}

.recipes-index-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: #ffffff;
  font-weight: 400;
  margin-bottom: 16px;
}

.recipes-index-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.recipes-grid-item {
  position: relative;
  display: block;
  min-width: 0;
  transition: transform 0.15s;
}

.recipes-grid-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.recipes-grid-link:hover,
.recipes-grid-link:visited,
.recipes-grid-link:active {
  text-decoration: none;
  color: inherit;
}

.recipes-grid-item:hover {
  transform: translateY(-3px);
}

.recipes-grid-thumb {
  width: 100%;
  aspect-ratio: 688 / 432;
  overflow: hidden;
  border: 1px solid rgba(200,151,58,0.25);
  border-radius: 3px;
  margin-bottom: 10px;
  background: #2c2416;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.recipes-grid-item:hover .recipes-grid-thumb {
  border-color: rgba(200,151,58,0.55);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

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

.recipes-grid-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}

.recipes-grid-thumb-title {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  color: rgba(200,151,58,0.5);
  text-align: center;
  line-height: 1.3;
}

.recipes-grid-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.recipes-grid-category {
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #c8973a;
  font-weight: 700;
}

.recipes-grid-title {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  color: #ffffff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.recipes-grid-link .recipes-grid-title {
  color: #ffffff !important;
  text-decoration: none !important;
}

.recipes-grid-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recipes-save-btn {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #c8973a;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.88;
  line-height: 1;
  text-decoration: none;
  transition: opacity 0.14s ease, color 0.14s ease;
}

.recipes-save-btn:hover {
  opacity: 1;
  color: #dcb86c;
}

.recipes-save-btn.saved {
  opacity: 1;
}

.recipes-save-btn:focus {
  outline: none;
}

.recipes-save-btn:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.recipes-save-icon {
  display: block;
  flex-shrink: 0;
}

.recipes-save-icon path {
  fill: none;
  stroke: currentColor;
  transition: fill 0.14s ease, stroke 0.14s ease;
}

.recipes-save-icon.saved path,
.recipes-save-btn.saved .recipes-save-icon path {
  fill: currentColor;
}

.recipes-grid-meta {
  display: flex;
  gap: 10px;
  font-size: 9px;
  color: rgba(200,151,58,0.45);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.recipes-no-results {
  text-align: center;
  padding: 56px 24px;
  color: rgba(200,184,152,0.45);
  font-size: 14px;
  font-style: italic;
}

.recipes-no-results-clear {
  background: none;
  border: none;
  color: #c8973a;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 6px;
  font-style: normal;
}

.recipes-mobile-discover {
  display: none;
}

.recipes-desktop-only {
  display: block;
}

.recipes-index-filters-mobile {
  display: none;
}

.recipes-index-filters-desktop {
  display: flex;
}

.recipes-mobile-featured-link,
.recipes-mobile-thumb-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.recipes-mobile-featured-link:hover,
.recipes-mobile-featured-link:visited,
.recipes-mobile-featured-link:active,
.recipes-mobile-thumb-link:hover,
.recipes-mobile-thumb-link:visited,
.recipes-mobile-thumb-link:active {
  text-decoration: none;
  color: inherit;
}

.recipes-mobile-featured-panel {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(200,151,58,0.38);
  background:
    radial-gradient(circle at top right, rgba(200,151,58,0.18), transparent 34%),
    linear-gradient(145deg, rgba(54, 38, 19, 0.97), rgba(24, 16, 8, 0.98));
  box-shadow: 0 24px 54px rgba(0,0,0,0.28);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.recipes-mobile-featured-bar {
  height: 4px;
  background: linear-gradient(90deg, #f4ddaa 0%, #c8973a 35%, #8f5f16 70%, #f4ddaa 100%);
}

.recipes-mobile-featured-bar.bottom {
  height: 3px;
}

.recipes-mobile-featured-inner {
  position: relative;
  padding: 20px 18px 18px;
  padding-right: 94px;
  min-width: 0;
}

.recipes-mobile-featured-illustration {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 56px;
  height: 56px;
  pointer-events: none;
}

.recipes-mobile-featured-illustration-img {
  width: 56px;
  height: 56px;
  opacity: 0.7;
  filter: brightness(0) invert(86%) sepia(30%) saturate(600%) hue-rotate(355deg);
}

.recipes-mobile-featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(200,151,58,0.16);
  color: #f1cb7d;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.recipes-mobile-featured-kicker {
  color: #c8973a;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.recipes-mobile-featured-title {
  margin: 8px 0 8px;
  color: #ffffff;
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.08;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recipes-mobile-featured-desc {
  margin: 0;
  color: rgba(245,233,211,0.8);
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
}

.recipes-mobile-featured-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.recipes-mobile-featured-stat {
  border: 1px solid rgba(200,151,58,0.26);
  border-radius: 999px;
  padding: 7px 10px;
  color: #f2d08a;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recipes-mobile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.recipes-mobile-section-title {
  margin: 0;
  color: #ffffff;
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
}

.recipes-mobile-section-link {
  border: none;
  background: none;
  padding: 0;
  color: #c8973a;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.recipes-mobile-results,
.recipes-mobile-row {
  margin-bottom: 26px;
  overflow: hidden;
}

.recipes-mobile-featured-card,
.recipes-mobile-results-list {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.recipes-mobile-results-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.recipes-mobile-row-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 40px 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
  overscroll-behavior-x: contain;
}

.recipes-mobile-row-track::-webkit-scrollbar {
  display: none;
}

.recipes-mobile-thumb {
  flex: 0 0 200px;
  width: 200px;
  min-width: 0;
  max-width: 100%;
}

.recipes-mobile-thumb.is-wide {
  flex-basis: auto;
  width: 100%;
}

.recipes-mobile-thumb-sheet {
  position: relative;
  min-height: 266px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(200,151,58,0.42);
  background: #f5ead7;
  box-shadow: 0 18px 38px rgba(0,0,0,0.22);
}

.recipes-mobile-thumb.is-wide .recipes-mobile-thumb-sheet {
  min-height: 0;
}

.recipes-mobile-thumb-topbar {
  height: 3px;
  background: linear-gradient(90deg, #f0dca7 0%, #c8973a 36%, #916114 70%, #f0dca7 100%);
}

.recipes-mobile-thumb-bottombar {
  height: 2px;
  background: linear-gradient(90deg, #f0dca7 0%, #c8973a 36%, #916114 70%, #f0dca7 100%);
}

.recipes-mobile-thumb-inner {
  padding: 12px 12px 14px;
  padding-right: 62px;
}

.recipes-mobile-thumb-illustration {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  pointer-events: none;
}

.recipes-mobile-thumb-illustration-img {
  width: 38px;
  height: 38px;
  opacity: 0.55;
  filter: invert(60%) sepia(40%) saturate(500%) hue-rotate(5deg);
}

.recipes-mobile-thumb-cuisine {
  margin-bottom: 6px;
  color: #b57d1f;
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.recipes-mobile-thumb-title {
  margin: 0 0 6px;
  color: #251a0d;
  font-family: 'Playfair Display', serif;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recipes-mobile-thumb-desc {
  margin: 0 0 12px;
  color: #6c5030;
  font-size: 12px;
  font-style: italic;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}

.recipes-mobile-mini-table {
  border: 1px solid rgba(52,38,19,0.12);
  border-radius: 11px;
  overflow: hidden;
  background: rgba(255,255,255,0.35);
}

.recipes-mobile-mini-head,
.recipes-mobile-mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.recipes-mobile-mini-head {
  background: #2b2012;
  color: #f7ecd9;
  font-family: 'Montserrat', sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 8px;
}

.recipes-mobile-mini-row {
  padding: 7px 8px;
  color: #3b2a15;
  font-size: 10px;
  line-height: 1.3;
}

.recipes-mobile-mini-row:nth-child(even) {
  background: rgba(200,151,58,0.09);
}

.recipes-mobile-mini-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipes-mobile-mini-amount {
  color: #7a603c;
  text-align: right;
}

.recipes-mobile-thumb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: rgba(200,151,58,0.88);
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recipes-mobile-thumb-rating {
  color: #e0b95d;
}

.recipes-mobile-save-btn {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: none;
  margin: 8px 0 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c8973a;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.recipes-mobile-save-btn.saved {
  color: #dfbf72;
}

.recipes-mobile-save-prefix {
  font-size: 13px;
  line-height: 1;
}

.library-save-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9800;
}

.library-save-auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 2, 0.68);
}

.library-save-auth-dialog {
  position: relative;
  width: min(420px, calc(100% - 28px));
  margin: min(18vh, 120px) auto 0;
  background: #2c2416;
  border: 1px solid rgba(200,151,58,0.42);
  border-radius: 10px;
  padding: 22px 20px 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  color: #faf7f2;
}

.library-save-auth-dialog h3 {
  margin: 0 0 8px;
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 400;
  color: #ffffff;
}

.library-save-auth-dialog p {
  margin: 0 0 16px;
  color: #c8b898;
  font-size: 14px;
  line-height: 1.45;
}

.library-save-auth-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: transparent;
  color: #a88f6f;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  width: 28px;
  height: 28px;
}

.library-save-auth-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  border: 1px solid rgba(200,151,58,0.55);
  color: #c8973a;
  border-radius: 6px;
  padding: 11px 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 8px;
}

.library-save-auth-btn.primary {
  background: #c8973a;
  color: #2c2416;
  border-color: #c8973a;
}

.library-save-auth-btn:hover {
  border-color: #d3a858;
  color: #f1cc85;
}

.library-save-auth-btn.primary:hover {
  background: #d3a858;
  color: #2c2416;
}

.library-save-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(14px);
  background: #2c2416;
  color: #c8973a;
  border: 1px solid rgba(200,151,58,0.45);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 9900;
  white-space: nowrap;
}

.library-save-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

  .recipe-page-title {
    font-size: 26px;
  }

  .recipe-rating-widget {
    margin-bottom: 10px;
  }

  .recipe-page-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .recipe-page-cta,
  .recipe-page-conversion-block,
  .conversion-block {
    padding: 28px 20px;
  }

  .recipe-page-cta-headline,
  .conversion-block-headline {
    font-size: 20px;
  }

  .recipe-page-cta-sub,
  .conversion-block-copy {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .conversion-block-cta {
    width: 100%;
  }

  body.recipes-page-body {
    overflow-x: hidden;
  }

  body.recipes-page-body .site-nav {
    overflow-x: clip;
  }

  body.recipes-page-body .site-nav .site-nav-links {
    display: none;
  }

  body.recipes-page-body .site-nav .site-nav-inner {
    min-height: 56px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
    align-items: center;
  }

  .recipes-index {
    padding: 28px 16px 92px;
    overflow-x: clip;
    max-width: 100%;
  }

  .recipes-index-title {
    font-size: 31px;
    margin-bottom: 8px;
  }

  .recipes-index-sub {
    max-width: none;
    font-size: 15px;
    line-height: 1.55;
    color: #d9c8a7;
  }

  .recipes-index-header {
    margin-bottom: 14px;
  }

  .recipes-search-wrap {
    max-width: 100%;
    margin-bottom: 14px;
  }

  .recipes-search-input {
    border-radius: 15px;
    border-color: rgba(200,151,58,0.62);
    font-size: 15px;
    padding: 14px 44px 14px 42px;
    background: rgba(255,255,255,0.05);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  }

  .recipes-search-icon {
    left: 15px;
    color: rgba(200,151,58,0.88);
  }

  .recipes-index-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    margin: 0 0 22px;
    padding: 0 0 4px;
    max-width: 100%;
    overscroll-behavior-x: contain;
  }

  .recipes-index-filters-mobile {
    display: flex;
  }

  .recipes-index-filters-desktop {
    display: none;
  }

  .recipes-index-filters::-webkit-scrollbar {
    display: none;
  }

  .recipes-chip {
    flex-shrink: 0;
    padding: 10px 16px;
    border-color: rgba(200,151,58,0.55);
    color: rgba(214,184,120,0.92);
    font-size: 10px;
  }

  .recipes-mobile-discover {
    display: block;
  }

  .recipes-mobile-featured-wrap {
    margin-bottom: 26px;
  }

  .recipes-desktop-only {
    display: none;
  }

  .recipes-no-results {
    padding: 12px 0 24px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .recipes-index-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
