@import url('https://fonts.googleapis.com/css2?family=Bentham&display=swap');

:root {
  --bg: #f4ecde;
  --bg-soft: #fbf6ee;
  --panel: #fffdfa;
  --text: #2f261f;
  --muted: #6b5f52;
  --line: #d6cab8;
  --accent: #8c4e2a;
  --danger: #b34132;
  --radius-lg: 24px;
  --radius-md: 14px;
  --shadow: 0 18px 40px rgba(60, 37, 16, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: 'Avenir Next', 'Nunito Sans', 'Segoe UI', sans-serif;
  background:
    radial-gradient(1200px 600px at -10% -20%, #fff8eb 0%, rgba(255, 248, 235, 0) 60%),
    radial-gradient(900px 500px at 110% -10%, #ead6bb 0%, rgba(234, 214, 187, 0) 55%),
    linear-gradient(180deg, #f5eddf 0%, #ecdfcc 100%);
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(206, 187, 161, 0.55);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background:
    linear-gradient(160deg, rgba(255, 252, 246, 0.88), rgba(241, 228, 207, 0.78)),
    radial-gradient(circle at 15% -30%, rgba(141, 80, 42, 0.18), transparent 52%);
  backdrop-filter: blur(14px);
}

.brand h1 {
  margin: 0;
  font-size: 1.34rem;
  font-family: 'Bentham', serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.brand h1,
body[data-route='recipe'] .brand h1,
body[data-route='add'] .brand h1,
body[data-route='edit'] .brand h1,
body[data-route='drafts'] .brand h1,
body[data-route='settings'] .brand h1 {
  font-family: 'Bentham', serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(184, 154, 122, 0.4);
  overflow-x: auto;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav-links a:hover {
  border-color: rgba(136, 96, 56, 0.35);
  background: rgba(255, 255, 255, 0.7);
}

.top-nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nav-gear {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 1.1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(184, 154, 122, 0.4);
  flex: 0 0 auto;
}

.nav-gear:hover {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(136, 96, 56, 0.35);
}

.app-message {
  min-height: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  max-width: 280px;
  text-align: right;
}

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

.app-message.info {
  color: #6b4d2f;
}

.app-content {
  padding: 18px 22px 30px;
  width: min(1280px, 100%);
  margin: 0 auto;
}

.screen {
  display: grid;
  gap: 18px;
}

.card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(141, 117, 90, 0.18);
  box-shadow: var(--shadow);
  padding: 20px;
}

.screen-title {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.screen-header {
  display: grid;
  gap: 10px;
}

.screen-description,
.section-subtitle,
.future-hint {
  margin: 0;
  color: var(--muted);
}

.section-title {
  margin: 0 0 4px;
}

.list-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.list-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: white;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.list-main {
  font-weight: 600;
}

.list-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

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

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

.recipe-form {
  display: grid;
  gap: 18px;
}

.form-section {
  display: grid;
  gap: 10px;
}

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

.field-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.image-preview {
  min-height: 90px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
}

.preview-img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.editor-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 100px 170px 1fr 1fr 200px auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 8px;
}

.step-row {
  grid-template-columns: 1fr 180px auto;
}

.tiny-btn {
  min-width: 42px;
  padding: 8px 10px;
}

.form-actions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.draft-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.draft-title {
  margin: 0;
}

.draft-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.recipe-layout {
  display: grid;
  gap: 16px;
}

.library-hero {
  display: grid;
  gap: 12px;
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(255, 249, 237, 0.86), rgba(255, 249, 237, 0) 60%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(242, 228, 206, 0.9));
}

.hero-eyebrow {
  margin: 0;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7f6349;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-stat {
  min-width: 140px;
  border: 1px solid rgba(146, 112, 78, 0.26);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.62);
  display: grid;
  gap: 2px;
}

.hero-stat strong {
  font-size: 1.28rem;
}

.hero-stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.featured-card {
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(122, 85, 51, 0.3);
  box-shadow: 0 24px 50px rgba(46, 29, 13, 0.14);
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  min-height: 260px;
  background: #1f1d22;
}

.featured-media {
  background-size: cover;
  background-position: center;
}

.featured-body {
  padding: 24px;
  background:
    radial-gradient(circle at 0% 100%, rgba(178, 88, 36, 0.52), rgba(178, 88, 36, 0) 54%),
    linear-gradient(160deg, #25282b, #3f2a1f);
  color: #f4e9de;
  display: grid;
  gap: 10px;
  align-content: center;
}

.featured-title {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.5rem);
  line-height: 1.05;
}

.search-input {
  width: 100%;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-btn {
  background: #eadfce;
  color: #5c412b;
}

.tab-btn.active {
  background: #8f5f3b;
  color: #fff;
}

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

.recipe-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  border: 1px solid rgba(120, 97, 72, 0.18);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px rgba(50, 32, 14, 0.14);
}

.recipe-card:focus {
  outline: 2px solid #8f5f3b;
  outline-offset: 1px;
}

.card-media {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
}

.no-photo-media {
  background: linear-gradient(135deg, #f2e6d3, #deccb4);
}

.card-body {
  padding: 12px;
  display: grid;
  gap: 6px;
}

.card-title {
  margin: 0;
  font-size: 1.1rem;
}

.card-meta {
  margin: 0;
  color: var(--muted);
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-tag {
  background: #ede1cf;
  color: #5f4329;
}

.empty-state {
  text-align: left;
  color: var(--muted);
  padding: 24px;
  display: grid;
  gap: 10px;
}

.empty-title {
  margin: 0;
  color: var(--text);
}

.add-block {
  display: grid;
  gap: 10px;
}

.import-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 140px;
  padding: 10px;
  background: #fff;
  display: grid;
  place-items: center;
}

.file-preview-badge {
  color: var(--muted);
  font-size: 0.95rem;
}

.loader {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #dec8ac;
  border-top-color: #8f5f3b;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.recipe-hero {
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  min-height: 270px;
  box-shadow: var(--shadow);
}

.recipe-hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(0);
}

.recipe-hero-main {
  position: relative;
  z-index: 1;
  min-height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(to top, rgba(17, 13, 8, 0.64), rgba(17, 13, 8, 0.15));
}

.recipe-hero.no-photo .recipe-hero-main {
  color: #2b2520;
  background: linear-gradient(to top, rgba(255, 250, 242, 0.8), rgba(255, 250, 242, 0.25));
}

.tags-line {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.8rem;
}

.recipe-hero.no-photo .tag-pill {
  background: #eadac5;
  color: #5b3a22;
}

.recipe-title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.recipe-subtitle {
  margin: 0;
  opacity: 0.9;
}

.recipe-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.step-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
}

.persons-value {
  min-width: 70px;
  text-align: center;
}

.static-meta {
  margin-right: auto;
  font-size: 0.95rem;
  opacity: 0.95;
}

.recipe-content {
  display: grid;
  gap: 14px;
}

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

.ingredients-list,
.steps-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.ingredient-item,
.step-text {
  font-size: 1.05rem;
}

.step-time {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.85rem;
  color: var(--muted);
}

.notes-text {
  margin: 0;
  color: #584f44;
}

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

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

input,
select,
textarea {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: #fff;
}

button {
  border: none;
  border-radius: 999px;
  padding: 9px 13px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ghost-btn {
  background: #efe4d6;
  color: #58361d;
}

.danger-btn {
  background: #c35f4a;
}

/* Reference-inspired Recipe Presentation */
.recipe-screen {
  gap: 14px;
}

.recipe-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
}

.block-title {
  display: grid;
  gap: 10px;
  background: linear-gradient(160deg, #fffdf8, #f5ece0);
}

.block-photo {
  padding: 12px;
  background: #fff;
}

.photo-frame {
  border-radius: 18px;
  height: min(34vh, 280px);
  width: 100%;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(122, 85, 51, 0.22);
}

.recipe-headline {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.panel-subtitle {
  margin: 0;
  font-size: 0.98rem;
}

.light-headline {
  color: #2a1f18;
}

.light-subtitle {
  color: #6e6152;
}

.metric-grid-light {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card-light {
  background: #fff;
  border: 1px solid #dfd4c3;
}

.metric-label-light {
  color: #7a6550;
}

.metric-value-light {
  color: #2f241c;
}

.split-blocks {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(340px, 1.2fr);
  gap: 14px;
  background: transparent;
}

.ingredients-col {
  border-right: none;
}

.directions-col {
  border-left: none;
}

.metric-grid {
  display: grid;
  gap: 8px;
}

.metric-card {
  border-radius: 14px;
  padding: 9px 10px;
  min-height: 66px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 1.15rem;
}

.persons-card {
  gap: 6px;
}

.persons-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.step-btn {
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
}

.persons-value {
  min-width: 36px;
  text-align: center;
}

.panel-actions-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.panel-action-btn {
  border-radius: 14px;
  padding: 10px;
  background: rgba(224, 116, 61, 0.2);
  border: 1px solid rgba(244, 168, 118, 0.34);
  color: #ffe5d0;
  font-weight: 600;
}

.panel-summary {
  margin: 6px 0 0;
  color: #ead9ca;
  line-height: 1.45;
}

.recipe-detail-col {
  padding: 20px 18px 24px;
}

.ingredients-col {
  background: #f3f3f8;
}

.directions-col {
  background: #f8f8fc;
}

.detail-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-title {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.detail-meta {
  margin: 0;
  color: #7b7780;
  font-size: 0.92rem;
}

.yield-badge {
  font-size: 0.84rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: #d9d9df;
  color: #3f3d44;
  font-weight: 600;
}

.ingredient-pills {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.ingredient-pill {
  border-radius: 14px;
  background: #fafafd;
  border: 1px solid #dfdfea;
  color: #35323a;
  padding: 12px 14px;
  line-height: 1.38;
}

.directions-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.direction-step {
  border-bottom: 1px solid #dfdfe7;
  padding-bottom: 12px;
}

.step-kicker {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #4c4852;
  letter-spacing: 0.04em;
}

.step-text {
  margin: 0;
  color: #1f1d24;
  line-height: 1.4;
}

.step-time {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.82rem;
  color: #7a7781;
}

.notes-card {
  margin-top: 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #dfdde7;
  padding: 12px;
}

.notes-title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.notes-text {
  margin: 0;
  color: #4a4652;
}

/* Editorial Recipe Redesign */
.recipe-editorial {
  gap: 18px;
}

.ed-hero {
  position: relative;
  min-height: clamp(360px, 52vh, 560px);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 28px 56px rgba(48, 31, 16, 0.18);
}

.ed-hero-media,
.ed-hero-blur,
.ed-hero-shade {
  position: absolute;
  inset: 0;
}

.ed-hero-media {
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.ed-hero-blur {
  background-size: cover;
  background-position: center;
  filter: blur(18px);
  transform: scale(1.08);
  opacity: 0.45;
}

.ed-hero-shade {
  background:
    radial-gradient(85% 120% at 0% 100%, rgba(150, 79, 32, 0.56), rgba(150, 79, 32, 0) 55%),
    linear-gradient(180deg, rgba(20, 22, 22, 0.48), rgba(20, 22, 22, 0.68));
}

.ed-no-photo .ed-hero-media,
.ed-no-photo .ed-hero-blur {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 234, 203, 0.4), rgba(255, 234, 203, 0) 50%),
    linear-gradient(140deg, #5b4738, #2e3133);
}

.ed-hero-content {
  position: relative;
  z-index: 2;
  min-height: inherit;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: clamp(18px, 3vw, 34px);
  color: #fff6ec;
}

.ed-top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ed-ghost-btn,
.ed-primary-btn,
.ed-step-btn {
  border: 1px solid rgba(255, 244, 231, 0.34);
  border-radius: 999px;
  color: #fff4e7;
  background: rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.ed-primary-btn {
  background: rgba(186, 97, 48, 0.35);
  border-color: rgba(248, 188, 146, 0.48);
}

.ed-title {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  max-width: 16ch;
  text-wrap: balance;
}

.ed-subtitle {
  margin: 0;
  color: rgba(245, 232, 220, 0.92);
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  line-height: 1.4;
  max-width: 56ch;
}

.ed-meta-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(244, 228, 211, 0.34);
  background: rgba(36, 30, 23, 0.35);
  padding: 7px 12px;
}

.ed-meta-token {
  font-size: 0.95rem;
  color: #f6ecdf;
}

.ed-meta-dot {
  color: rgba(244, 233, 220, 0.7);
}

.ed-meta-persons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ed-step-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
}

.ed-persons-value {
  min-width: 22px;
  text-align: center;
  font-size: 1rem;
}

.ed-meta-persons-label {
  color: rgba(248, 238, 227, 0.84);
  font-size: 0.92rem;
}

.ed-content-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(380px, 1.12fr);
  gap: 14px;
  position: relative;
}

.ed-card {
  border-radius: 22px;
  background: #fffefc;
  border: 1px solid rgba(174, 148, 120, 0.24);
  padding: 22px;
  box-shadow: 0 10px 28px rgba(58, 39, 22, 0.08);
}

.ed-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ed-card-title {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: #241b14;
  font-weight: 700;
}

.ed-card-subtitle {
  color: #7c6e61;
  font-size: 0.95rem;
}

.ed-ingredients-list,
.ed-steps-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 11px;
}

.ed-ingredient-line {
  line-height: 1.5;
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  color: #251f19;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(146, 121, 97, 0.2);
}

.ed-step-item {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 192, 170, 0.45);
}

.ed-step-index {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7c6956;
}

.ed-step-text {
  margin: 6px 0 0;
  line-height: 1.52;
  font-size: clamp(1rem, 1.36vw, 1.18rem);
  color: #241d18;
}

.ed-step-time {
  display: inline-block;
  margin-top: 8px;
  color: #7c6e63;
  font-size: 0.86rem;
}

/* Glassmorphism léger ciblé: blocs Ingrédients + Préparation uniquement */
.ed-content-grid .ed-card {
  border-radius: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ed-content-grid .ed-card-subtitle {
  color: #695d52;
}

.ed-notes-card {
  max-width: 900px;
}

.ed-notes-text {
  margin: 6px 0 0;
  line-height: 1.5;
  color: #4a4138;
}

/* Premium iPad Recipe Sheet */
body[data-route='recipe'] {
  background: #e9decd;
}

body[data-route='recipe'] .top-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 16px 22px;
  background: rgba(20, 15, 11, 0.46);
  border-bottom-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body[data-route='recipe'] .brand h1,
body[data-route='recipe'] .nav-gear,
body[data-route='recipe'] .app-message {
  color: #f4ede4;
}

body[data-route='recipe'] .nav-links {
  display: none;
}

body[data-route='recipe'] .brand p,
body[data-route='recipe'] #app-message {
  display: none;
}

body[data-route='recipe'] .brand h1 {
  margin: 0;
  color: #f8efe4;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
}

body[data-route='recipe'] .brand-home-link {
  cursor: pointer;
}

body[data-route='recipe'] .brand-home-link:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.58);
  outline-offset: 6px;
  border-radius: 6px;
}

body[data-route='recipe'] .nav-gear {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body[data-route='recipe'] .nav-gear:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.rp-ghost-btn:hover,
.rp-ghost-btn:focus-visible,
.rp-edit-btn:hover,
.rp-edit-btn:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.48);
  outline: none;
}

body[data-route='recipe'] .app-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 0 30px;
}

.rp-page {
  position: relative;
  isolation: isolate;
  min-height: calc(100dvh - 110px);
  z-index: 0;
}

.rp-bg-media,
.rp-bg-blur,
.rp-bg-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.rp-bg-media,
.rp-bg-blur {
  object-fit: cover;
}

.rp-bg-media {
  z-index: -30;
  filter: brightness(0.7) saturate(0.86);
}

.rp-bg-blur {
  z-index: -20;
  filter: blur(24px) brightness(0.62) saturate(0.84);
  transform: scale(1.04);
  opacity: 0.66;
}

.rp-bg-overlay {
  z-index: -10;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15));
}

.rp-no-photo .rp-bg-media,
.rp-no-photo .rp-bg-blur {
  display: none;
}

.rp-no-photo .rp-bg-overlay {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15)),
    linear-gradient(145deg, #d8c6aa, #b9a287);
}

.rp-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-inline: clamp(24px, 5vw, 72px);
  box-sizing: border-box;
  display: grid;
  gap: 20px;
  position: relative;
  z-index: 2;
  justify-items: stretch;
}

.rp-header {
  padding: clamp(18px, 2.8vw, 34px) 0 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  row-gap: 6px;
  align-items: start;
  max-width: none;
  justify-items: stretch;
  text-align: left;
}

.rp-ghost-btn,
.rp-edit-btn,
.rp-step-btn {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  color: #fbf5ec;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.rp-ghost-btn {
  width: fit-content;
  padding: 8px 14px;
}

.rp-edit-btn {
  position: static;
  justify-self: end;
  align-self: start;
  grid-column: 2;
  grid-row: 1;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rp-edit-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.rp-edit-label {
  line-height: 1;
}

.rp-title {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  margin: 0;
  font-family: 'Iowan Old Style', 'Baskerville', 'Times New Roman', serif;
  font-size: clamp(2.6rem, 5.2vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: #f8f2e7;
  text-wrap: balance;
}

.rp-subtitle {
  margin: 0;
  font-size: 1.15rem;
  color: rgba(248, 237, 226, 0.95);
}

.rp-meta-line {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  font-size: 1.06rem;
  color: #f2e9dd;
}

.rp-meta-token {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rp-meta-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #fbf5ec;
  font-size: 0.82rem;
  line-height: 1;
}

.rp-meta-text {
  line-height: 1.2;
}

.rp-dot {
  opacity: 0.62;
  margin: 0 2px;
}

.rp-meta-persons {
  gap: 8px;
}

.rp-step-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  font-size: 1rem;
}

.rp-persons-value {
  min-width: 24px;
  text-align: center;
  margin: 0;
  font-size: 1.05em;
}

.rp-persons-label {
  margin-left: 2px;
}

.rp-floating-cards {
  display: grid;
  grid-template-columns: minmax(260px, 0.33fr) minmax(0, 0.67fr);
  gap: 18px;
  align-items: start;
  justify-items: stretch;
}

.rp-card {
  background: rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.14);
  border-radius: 24px;
  padding: 24px 26px;
}

.rp-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.rp-card-title {
  margin: 0;
  color: #1f1914;
  font-family: 'Iowan Old Style', 'Baskerville', 'Times New Roman', serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.rp-card-info {
  font-size: 1.02rem;
  color: #4f4337;
}

.rp-ingredients-list,
.rp-steps-list {
  margin: 0;
  padding: 0;
}

.rp-ingredients-list {
  padding-left: 1.2rem;
}

.rp-ingredient-item {
  color: #2a231d;
  line-height: 1.5;
  font-size: clamp(1.05rem, 1.55vw, 1.34rem);
  padding: 10px 0;
  border-bottom: 1px solid rgba(66, 52, 41, 0.12);
}

.rp-ingredient-item:last-child {
  border-bottom: 0;
}

.rp-steps-list {
  list-style: none;
  display: grid;
  gap: 16px;
}

.rp-step-item {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(66, 52, 41, 0.12);
}

.rp-step-item:last-child {
  border-bottom: 0;
}

.rp-step-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8c5f44;
}

.rp-step-text {
  margin: 0;
  line-height: 1.52;
  color: #2a231d;
  font-size: clamp(1.06rem, 1.55vw, 1.34rem);
}

@media (max-width: 900px) {
  .top-nav {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .top-nav-right {
    justify-content: space-between;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .editor-row,
  .step-row {
    grid-template-columns: 1fr;
  }

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

  .ed-hero {
    min-height: 330px;
  }

  .ed-content-grid {
    grid-template-columns: 1fr;
  }

  .ed-meta-line {
    width: 100%;
    border-radius: 14px;
  }

  .ed-card {
    padding: 16px;
  }

  body[data-route='recipe'] .app-content {
    padding: 14px 16px 24px;
  }

  .rp-header {
    max-width: none;
    padding-top: 12px;
  }

  .rp-edit-btn {
    position: static;
    width: fit-content;
    transform: none;
    margin-top: 2px;
  }

  .rp-meta-line {
    font-size: 0.98rem;
  }

  .rp-floating-cards {
    grid-template-columns: 1fr;
  }

  .rp-card {
    padding: 18px;
  }

  .rp-card-title {
    font-size: clamp(1.7rem, 6vw, 2.25rem);
  }

  .split-blocks {
    grid-template-columns: 1fr;
  }

  .ingredients-col {
    border-bottom: none;
  }

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

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-media {
    min-height: 200px;
  }

  .app-message {
    text-align: left;
    max-width: none;
  }
}

@media (min-width: 901px) {
  .recipe-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Unified Premium Language - All Non-Recipe Screens */
body:not([data-route='recipe']) {
  background:
    radial-gradient(1100px 620px at -10% -20%, #fff7ea 0%, rgba(255, 247, 234, 0) 62%),
    radial-gradient(900px 520px at 110% -10%, #e7d2b5 0%, rgba(231, 210, 181, 0) 55%),
    linear-gradient(180deg, #f3ebdd 0%, #e9dbc6 100%);
}

body:not([data-route='recipe']) .screen-title,
body:not([data-route='recipe']) .section-title,
body:not([data-route='recipe']) .card-title,
body:not([data-route='recipe']) .draft-title,
body:not([data-route='recipe']) .detail-title {
  font-family: 'Iowan Old Style', 'Baskerville', 'Times New Roman', serif;
  letter-spacing: -0.01em;
}

body:not([data-route='recipe']) .card,
body:not([data-route='recipe']) .list-row,
body:not([data-route='recipe']) .draft-item,
body:not([data-route='recipe']) .recipe-card,
body:not([data-route='recipe']) .featured-card,
body:not([data-route='recipe']) .import-preview {
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.08);
  border-radius: 24px;
}

body:not([data-route='recipe']) button {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(150deg, rgba(143, 95, 59, 0.9), rgba(121, 78, 47, 0.88));
  box-shadow: 0 8px 18px rgba(73, 45, 24, 0.18);
}

body:not([data-route='recipe']) .ghost-btn,
body:not([data-route='recipe']) .tab-btn {
  background: rgba(255, 255, 255, 0.36);
  color: #4f3521;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

body:not([data-route='recipe']) .tab-btn.active {
  background: rgba(143, 95, 59, 0.9);
  color: #fff7ee;
  border-color: rgba(255, 255, 255, 0.25);
}

body:not([data-route='recipe']) input,
body:not([data-route='recipe']) select,
body:not([data-route='recipe']) textarea {
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #2f261f;
}

body:not([data-route='recipe']) .field-label,
body:not([data-route='recipe']) .list-meta,
body:not([data-route='recipe']) .screen-description,
body:not([data-route='recipe']) .section-subtitle {
  color: #655a4d;
}

/* Library */
body[data-route='library'] .top-nav {
  display: none;
}

body[data-route='library'] .app-shell {
  grid-template-rows: 1fr;
}

body[data-route='library'] .app-content {
  padding-top: 24px;
}

.library-screen {
  position: relative;
  isolation: isolate;
  min-height: calc(100dvh - 44px);
}

.library-bg-stack,
.library-bg-layer,
.library-bg-shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.library-bg-stack {
  z-index: -20;
}

.library-bg-layer {
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(0.75) brightness(0.58);
  transform: scale(1.08);
  opacity: 0;
  transition: opacity 1400ms ease;
}

.library-bg-layer.is-active {
  opacity: 1;
}

.library-bg-shade {
  z-index: 2;
  background:
    radial-gradient(110% 140% at 0% 0%, rgba(40, 30, 18, 0.36), rgba(40, 30, 18, 0.12)),
    linear-gradient(120deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.14));
}

.library-shell {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 30px;
}

.library-screen .library-hero {
  gap: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.library-screen .screen-title {
  margin-bottom: 0;
  color: #f7efe3;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
}

.search-shell {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 18px;
  padding: 5px 8px;
}

.search-shell .search-input {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 10px;
  color: #f8f0e6;
}

.search-shell .search-input::placeholder {
  color: rgba(248, 238, 226, 0.78);
}

.search-shell .search-input:focus {
  outline: none;
}

.library-screen .hero-actions {
  margin-top: 4px;
}

.library-screen .category-tabs {
  display: flex;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 4px;
  background: transparent;
  border: none;
}

.library-screen .category-tabs::-webkit-scrollbar {
  display: none;
}

.library-screen .tab-btn {
  flex: 0 0 auto;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #463425;
  box-shadow: 0 4px 14px rgba(33, 23, 14, 0.06);
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.library-screen .tab-btn:hover {
  transform: scale(1.03);
  background: rgba(255, 255, 255, 0.66);
}

.library-screen .tab-btn.active {
  background: rgba(180, 140, 100, 0.25);
  color: #3f2d1f;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow:
    0 6px 16px rgba(58, 36, 18, 0.1),
    0 0 0 1px rgba(195, 154, 113, 0.22) inset;
}

.library-screen .recipe-grid {
  gap: 22px;
}

.recipe-card,
.featured-card {
  overflow: hidden;
}

.recipe-card:hover {
  transform: translateY(-3px) scale(1.01);
}

.library-screen .recipe-card {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.12);
}

.library-screen .recipe-card:focus {
  outline-color: rgba(255, 246, 236, 0.8);
}

.library-screen .featured-card {
  position: relative;
  min-height: 216px;
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.16);
  display: block;
}

.library-screen .featured-media {
  position: absolute;
  inset: 0;
}

.library-screen .featured-body {
  position: relative;
  min-height: 216px;
  padding: 20px 22px;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 6px;
  background:
    linear-gradient(90deg, rgba(24, 18, 14, 0.08) 0%, rgba(24, 18, 14, 0.56) 58%, rgba(24, 18, 14, 0.74) 100%),
    radial-gradient(circle at 0% 100%, rgba(172, 102, 58, 0.42), rgba(172, 102, 58, 0) 56%);
}

.library-screen .featured-body .screen-description {
  color: rgba(244, 232, 220, 0.9);
  max-width: 55ch;
}

.library-screen .featured-title {
  color: #fff6ea;
  max-width: 16ch;
}

.library-screen .featured-body button {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: none;
}

/* Add */
.add-header {
  text-align: center;
}

.add-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.add-choice-card {
  min-height: 260px;
  align-content: start;
}

.add-choice-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.36);
  color: #6f472a;
}

/* Import */
.import-main-card {
  max-width: 760px;
  margin: 0 auto;
}

.import-main-card .loader {
  width: 30px;
  height: 30px;
}

/* Edit / Correction */
.edit-premium-form {
  display: grid;
  gap: 14px;
}

.edit-header-card {
  margin-bottom: 2px;
}

.edit-section {
  gap: 12px;
}

.edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: none;
  padding-top: 18px;
}

.editor-row {
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
  padding: 10px;
}

.image-preview {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.46);
}

/* Settings / Drafts */
.settings-screen .inline-form {
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 10px;
}

.draft-list {
  gap: 12px;
}

@media (max-width: 900px) {
  .add-choices {
    grid-template-columns: 1fr;
  }
}

/* Library Structure (strict hierarchy) */
body[data-route='library'] .top-nav {
  display: none;
}

body[data-route='library'] .app-shell {
  grid-template-rows: 1fr;
}

body[data-route='library'] .app-content {
  padding-top: 24px;
}

body[data-route='library'] .library-screen.has-bg::before,
body[data-route='library'] .library-screen.has-bg::after {
  display: none;
}

body[data-route='library'] .library-screen {
  min-height: calc(100dvh - 44px);
}

body[data-route='library'] .library-bg-stack,
body[data-route='library'] .library-bg-layer,
body[data-route='library'] .library-bg-shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body[data-route='library'] .library-bg-stack {
  z-index: -20;
}

body[data-route='library'] .library-bg-layer {
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(0.68) brightness(0.52);
  transform: scale(1.1);
  opacity: 0;
  transition: opacity 1400ms ease;
}

body[data-route='library'] .library-bg-layer.is-active {
  opacity: 1;
}

body[data-route='library'] .library-bg-shade {
  z-index: 2;
  background:
    radial-gradient(120% 145% at 0% 0%, rgba(33, 24, 15, 0.37), rgba(33, 24, 15, 0.12)),
    linear-gradient(118deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.14));
}

body[data-route='library'] .library-shell {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 32px;
}

body[data-route='library'] .library-headline-row {
  display: grid;
  grid-template-columns: minmax(200px, auto) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

body[data-route='library'] .library-page-title {
  margin: 0;
  color: #f8efe4;
  font-size: clamp(44px, 4.2vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.012em;
}

body[data-route='library'] .library-title-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

body[data-route='library'] .library-title-info {
  display: grid;
  gap: 2px;
}

body[data-route='library'] .library-title-time,
body[data-route='library'] .library-title-count {
  margin: 0;
}

body[data-route='library'] .library-title-time {
  color: rgba(248, 239, 228, 0.88);
  font-size: 1.05rem;
  line-height: 1.2;
  font-weight: 500;
}

body[data-route='library'] .library-title-count {
  color: rgba(248, 239, 228, 0.64);
  font-size: 0.86rem;
  line-height: 1.3;
  font-weight: 500;
}

body[data-route='library'] .library-search-column {
  display: grid;
  gap: 8px;
}

body[data-route='library'] .search-shell {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body[data-route='library'] .library-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

body[data-route='library'] .library-search-row .search-shell {
  flex: 1;
  min-width: 0;
}

body[data-route='library'] .settings-icon-button {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body[data-route='library'] .settings-icon-button:hover,
body[data-route='library'] .settings-icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

body[data-route='library'] .search-shell .search-input {
  background: transparent;
  border: none;
  box-shadow: none;
  height: 52px;
  padding: 0;
  color: #f7eee2;
  font-size: 16px;
}

body[data-route='library'] .search-shell .search-input::placeholder {
  color: rgba(247, 237, 223, 0.72);
}

body[data-route='library'] .search-shell .search-input:focus {
  outline: none;
}

body[data-route='library'] .library-filters-row {
  display: block;
}

body[data-route='library'] .category-tabs {
  display: flex;
  gap: 12px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

body[data-route='library'] .category-tabs::-webkit-scrollbar {
  display: none;
}

body[data-route='library'] .tab-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background-color 160ms ease, color 160ms ease;
}

body[data-route='library'] .tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

body[data-route='library'] .tab-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  box-shadow: none;
}

body[data-route='library'] .library-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
  width: 100%;
}

body[data-route='library'] .action-widget {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  color: #f6eee2;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, backdrop-filter 160ms ease;
}

body[data-route='library'] .action-widget-add {
  align-items: center;
}

body[data-route='library'] .action-widget-add .action-widget-body {
  gap: 2px;
}

body[data-route='library'] .action-widget-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

body[data-route='library'] .action-mini-btn {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: none;
  padding: 0 12px;
}

body[data-route='library'] .action-mini-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

body[data-route='library'] .action-widget:hover {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

body[data-route='library'] .action-widget-add:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

body[data-route='library'] .action-widget:active {
  background: rgba(255, 255, 255, 0.12);
}

body[data-route='library'] .action-widget-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.65);
  border: none;
  background: transparent;
}

body[data-route='library'] .action-widget-body {
  display: grid;
  gap: 1px;
}

body[data-route='library'] .action-widget-title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.85);
}

body[data-route='library'] .action-widget-meta {
  font-size: 10px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.55);
}

body[data-route='library'] .featured-card {
  position: relative;
  min-height: 236px;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 26px 58px rgba(0, 0, 0, 0.16);
  display: block;
}

body[data-route='library'] .featured-media {
  position: absolute;
  inset: 0;
}

body[data-route='library'] .featured-body {
  position: relative;
  min-height: 236px;
  padding: 24px;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 8px;
  background:
    linear-gradient(90deg, rgba(24, 18, 14, 0.08) 0%, rgba(24, 18, 14, 0.58) 58%, rgba(24, 18, 14, 0.76) 100%),
    radial-gradient(circle at 0% 100%, rgba(172, 102, 58, 0.44), rgba(172, 102, 58, 0) 56%);
}

body[data-route='library'] .featured-body .screen-description {
  color: rgba(244, 232, 220, 0.9);
  max-width: 55ch;
}

body[data-route='library'] .featured-title {
  color: #fff6ea;
  max-width: 16ch;
}

body[data-route='library'] .featured-body button {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: none;
}

body[data-route='library'] .recipe-grid {
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-route='library'] .recipe-card {
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.12);
}

body[data-route='library'] .empty-state .library-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

@media (orientation: landscape) and (min-width: 1024px) {
  body[data-route='library'] .recipe-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body[data-route='library'] .library-headline-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  body[data-route='library'] .search-shell {
    min-width: 0;
    width: 100%;
  }

  body[data-route='library'] .library-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 760px) {
  body[data-route='library'] .library-quick-actions {
    grid-template-columns: 1fr;
  }
}

/* Add + Import Unification (strict, CSS-only overrides) */
body[data-route='add'],
body[data-route='import'] {
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(255, 248, 235, 0.9) 0%, transparent 60%),
    radial-gradient(900px 500px at 110% -10%, rgba(234, 214, 187, 0.8) 0%, transparent 55%),
    linear-gradient(180deg, #f3ebdd 0%, #e7d7c2 100%);
}

body[data-route='add'] .app-content,
body[data-route='import'] .app-content {
  max-width: 1000px;
}

body[data-route='add'] .screen,
body[data-route='import'] .screen {
  gap: 22px;
}

body[data-route='add'] .add-header {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 24px;
  padding: 18px 20px;
  text-align: center;
}

body[data-route='add'] .add-header h1 {
  font-size: 28px;
  margin: 0;
  letter-spacing: -0.01em;
}

body[data-route='add'] .add-header p {
  margin-top: 6px;
  color: #6b5f52;
  font-size: 14px;
}

body[data-route='add'] .add-choices {
  gap: 20px;
}

body[data-route='add'] .add-choice-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  border-radius: 28px;
  padding: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body[data-route='add'] .add-choice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

body[data-route='add'] .add-choice-icon {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #8c4e2a;
}

body[data-route='add'] button,
body[data-route='import'] button {
  background: linear-gradient(145deg, #8c4e2a, #7a4324);
  border: none;
  box-shadow: 0 6px 16px rgba(73, 45, 24, 0.25);
}

body[data-route='add'] .ghost-btn,
body[data-route='import'] .ghost-btn {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #4f3521;
}

body[data-route='add'] button,
body[data-route='add'] .nav-links a,
body[data-route='add'] .tab-btn,
body[data-route='import'] button,
body[data-route='import'] .nav-links a,
body[data-route='import'] .tab-btn {
  outline: none;
  border: 1px solid transparent;
}

body[data-route='import'] .import-preview {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px dashed rgba(255, 255, 255, 0.5);
  border-radius: 18px;
}

body[data-route='import'] .import-preview:hover {
  background: rgba(255, 255, 255, 0.65);
}

body[data-route='import'] .loader,
body[data-route='add'] .loader {
  border: 3px solid rgba(222, 200, 172, 0.5);
  border-top-color: #8f5f3b;
}

/* Add Page Upgrade (strict) */
.page-add {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

.page-add .card-section {
  background: #fffdf8;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.page-add .card-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #2b2520;
}

.page-add .edit-header {
  background: #f8f3ea;
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.page-add .edit-header p {
  margin-top: 6px;
  font-size: 14px;
  color: #6f6558;
}

input[type='file'] {
  display: none;
}

.page-add .image-upload {
  border-radius: 16px;
  border: 1px dashed #d8cfbf;
  background: #faf6ee;
  padding: 32px;
  text-align: center;
  cursor: pointer;
}

.page-add .image-main {
  display: block;
  font-weight: 600;
  color: #2b2520;
  margin-bottom: 6px;
}

.page-add .image-sub {
  display: block;
  font-size: 14px;
  color: #6f6558;
  margin-bottom: 16px;
}

.page-add .btn-upload {
  background: #2b2520;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
}

.page-add input,
.page-add textarea,
.page-add select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e3dacb;
  padding: 12px 14px;
  font-size: 15px;
  background: #fffdf8;
}

.page-add input:focus,
.page-add textarea:focus {
  outline: none;
  border-color: #c5b9a5;
  box-shadow: 0 0 0 2px rgba(197, 185, 165, 0.2);
}

.page-add label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #6f6558;
}

.page-add .btn-primary {
  background: #2b2520;
  color: white;
  border-radius: 14px;
  padding: 12px 20px;
  border: none;
}

.page-add .btn-secondary {
  background: transparent;
  border: 1px solid #d8cfbf;
  color: #2b2520;
}

.page-add .btn-danger {
  background: transparent;
  color: #a05a5a;
}

.page-add button {
  min-height: 44px;
}

/* Add Page Upgrade enforcement against older route-level overrides */
body[data-route='add'] .page-add {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

body[data-route='add'] .page-add .card-section {
  background: #fffdf8;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

body[data-route='add'] .page-add .card-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #2b2520;
}

body[data-route='add'] .page-add .edit-header {
  background: #f8f3ea;
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

body[data-route='add'] .page-add .edit-header p {
  margin-top: 6px;
  font-size: 14px;
  color: #6f6558;
}

body[data-route='add'] .page-add .image-upload {
  border-radius: 16px;
  border: 1px dashed #d8cfbf;
  background: #faf6ee;
  padding: 32px;
  text-align: center;
  cursor: pointer;
}

body[data-route='add'] .page-add .image-main {
  display: block;
  font-weight: 600;
  color: #2b2520;
  margin-bottom: 6px;
}

body[data-route='add'] .page-add .image-sub {
  display: block;
  font-size: 14px;
  color: #6f6558;
  margin-bottom: 16px;
}

body[data-route='add'] .page-add .btn-upload {
  background: #2b2520;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
}

body[data-route='add'] .page-add input,
body[data-route='add'] .page-add textarea,
body[data-route='add'] .page-add select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e3dacb;
  padding: 12px 14px;
  font-size: 15px;
  background: #fffdf8;
}

body[data-route='add'] .page-add input:focus,
body[data-route='add'] .page-add textarea:focus {
  outline: none;
  border-color: #c5b9a5;
  box-shadow: 0 0 0 2px rgba(197, 185, 165, 0.2);
}

body[data-route='add'] .page-add label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #6f6558;
}

body[data-route='add'] .page-add .btn-primary {
  background: #2b2520;
  color: white;
  border-radius: 14px;
  padding: 12px 20px;
  border: none;
}

body[data-route='add'] .page-add .btn-secondary {
  background: transparent;
  border: 1px solid #d8cfbf;
  color: #2b2520;
}

body[data-route='add'] .page-add .btn-danger {
  background: transparent;
  color: #a05a5a;
}

body[data-route='add'] .page-add button {
  min-height: 44px;
}

/* Add Page Mandatory Fixes */
html,
body {
  overflow-x: hidden;
}

.app-shell,
.app-content,
.page-add,
.page-add * {
  box-sizing: border-box;
}

body[data-route='add'] .page-add {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 24px;
  overflow-x: hidden;
  position: relative;
  z-index: 0;
}

body[data-route='add'] .page-add::before {
  content: '';
  position: fixed;
  inset: 0;
  /* TODO: add local blurred recipe background image at ./assets/recipe-bg.jpg */
  background-image: url('./assets/recipe-bg.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(18px);
  transform: scale(1.06);
  opacity: 0.18;
  z-index: -2;
  pointer-events: none;
}

body[data-route='add'] .page-add::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(246, 242, 233, 0.72);
  z-index: -1;
  pointer-events: none;
}

body[data-route='add'] .page-add .card-section,
body[data-route='add'] .page-add .edit-header {
  width: 100%;
  max-width: 100%;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body[data-route='add'] .page-add input,
body[data-route='add'] .page-add textarea,
body[data-route='add'] .page-add select,
body[data-route='add'] .page-add button {
  max-width: 100%;
}

body[data-route='add'] .page-add .add-choices,
body[data-route='add'] .page-add .add-block,
body[data-route='add'] .page-add .card-section {
  min-width: 0;
}

/* Add Page Final Match */
html,
body {
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.app-shell,
.app-content,
.page-add,
.page-add * {
  max-width: 100%;
}

body.add-mode {
  position: relative;
  --add-bg-image: url('./assets/recipe-bg.jpg');
  background:
    linear-gradient(rgba(246, 242, 233, 0.58), rgba(246, 242, 233, 0.58)),
    var(--add-bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

body.add-mode::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--add-bg-image);
  background-size: cover;
  background-position: center;
  filter: blur(14px);
  transform: scale(1.04);
  opacity: 0.38;
  z-index: -2;
  pointer-events: none;
}

body.add-mode::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(246, 242, 233, 0.62);
  z-index: -1;
  pointer-events: none;
}

body[data-route='add'] .page-add::before,
body[data-route='add'] .page-add::after {
  display: none;
}

.page-add {
  width: min(100%, 980px);
  margin: 0;
  padding: 24px 0 88px 0;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.page-add .add-card {
  width: 100%;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(216, 207, 191, 0.55);
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(67, 47, 30, 0.1);
  padding: 24px 28px;
  margin-bottom: 12px;
  overflow: hidden;
}

.page-add .edit-header {
  padding: 22px 28px;
}

.page-add .edit-header h1,
.page-add .edit-header h2 {
  margin: 0 0 12px 0;
  font-size: 28px;
  line-height: 1.15;
  color: #2b2520;
}

.page-add .edit-header p {
  margin: 0;
  font-size: 15px;
  color: #6f6558;
}

.page-add .add-card h2,
.page-add .add-card h3 {
  margin: 0 0 18px 0;
  font-size: 24px;
  line-height: 1.15;
  color: #2b2520;
}

.page-add .image-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: stretch;
}

.page-add .image-dropzone {
  min-height: 220px;
  border: 1px dashed #d8cfbf;
  border-radius: 14px;
  background: rgba(250, 246, 238, 0.76);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
}

.page-add .image-dropzone input[type='file'] {
  display: none;
}

.page-add .image-main {
  display: block;
  margin-top: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #2b2520;
}

.page-add .image-sub {
  display: block;
  margin-top: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #6f6558;
}

.page-add .btn-upload {
  min-height: 44px;
  border-radius: 999px;
  border: none;
  padding: 0 22px;
  background: #9b6a43;
  color: #fffdf8;
  font-size: 15px;
  font-weight: 600;
}

.page-add .image-preview-panel {
  border: 1px solid rgba(216, 207, 191, 0.55);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.68);
  padding: 18px;
}

.page-add .image-preview-panel p,
.page-add .image-preview-panel label {
  margin: 0 0 12px 0;
  color: #6f6558;
  font-size: 14px;
}

.page-add .image-preview-box {
  height: 112px;
  border-radius: 12px;
  border: 1px solid #e3dacb;
  background: rgba(250, 246, 238, 0.75);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.page-add .image-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-add .btn-remove-image {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border-radius: 999px;
  border: 1px solid #ead8d5;
  background: rgba(255, 253, 248, 0.76);
  color: #b44b43;
}

.page-add input:not([type='file']),
.page-add textarea,
.page-add select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid #e3dacb;
  background: rgba(255, 253, 248, 0.92);
  padding: 12px 14px;
  color: #2b2520;
  font-size: 15px;
  font-family: inherit;
  box-shadow: none;
  appearance: none;
}

.page-add textarea {
  min-height: 84px;
  resize: vertical;
}

.page-add input:focus,
.page-add textarea:focus,
.page-add select:focus {
  outline: none;
  border-color: #b89573;
  box-shadow: 0 0 0 3px rgba(155, 106, 67, 0.14);
}

.page-add label {
  display: block;
  margin: 0 0 7px 0;
  color: #6f6558;
  font-size: 14px;
}

.page-add .form-row,
.page-add .ingredient-row,
.page-add .step-row,
.page-add .preparation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 12px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}

.page-add .form-row > *,
.page-add .ingredient-row > *,
.page-add .step-row > *,
.page-add .preparation-row > * {
  min-width: 0;
  max-width: 100%;
}

.page-add .step-row textarea,
.page-add .preparation-row textarea,
.page-add .step-row input[type='number'],
.page-add .preparation-row input[type='number'] {
  width: 100%;
  max-width: 100%;
}

.page-add .add-line-button {
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(216, 207, 191, 0.42);
  background: rgba(255, 253, 248, 0.64);
  color: #5a4636;
  font-size: 16px;
  font-weight: 500;
}

.page-add .add-actions-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  width: 100%;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(216, 207, 191, 0.55);
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(67, 47, 30, 0.12);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 16px;
  align-items: center;
}

.page-add .add-actions-bar button {
  min-height: 44px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
}

.page-add .btn-primary {
  background: #9b6a43;
  color: #fffdf8;
  border: 1px solid #9b6a43;
}

.page-add .btn-secondary {
  background: rgba(255, 253, 248, 0.72);
  color: #5a4636;
  border: 1px solid #e3dacb;
}

.page-add .btn-danger {
  background: rgba(255, 253, 248, 0.72);
  color: #b44b43;
  border: 1px solid #ead8d5;
}

@media (max-width: 900px) {
  .page-add {
    width: 100%;
    padding: 20px 16px 88px 16px;
  }

  .page-add .image-layout {
    grid-template-columns: 1fr;
  }

  .page-add .image-preview-panel {
    display: none;
  }

  .page-add .add-actions-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-add .form-row,
  .page-add .ingredient-row,
  .page-add .step-row,
  .page-add .preparation-row {
    grid-template-columns: 1fr;
  }
}

/* Add page: no blur on windows, blur on background only */
body.add-mode::before {
  filter: blur(80px);
  opacity: 0.42;
}

body.add-mode::after {
  background: rgba(246, 242, 233, 0.5);
}

.page-add .add-card,
.page-add .edit-header,
.page-add .add-actions-bar,
.page-add .image-preview-panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.page-add .add-card {
  background: rgba(255, 253, 248, 0.84);
}

.page-add .edit-header {
  background: rgba(248, 243, 234, 0.84);
}

.page-add .add-actions-bar {
  background: rgba(255, 253, 248, 0.84);
}

.page-add .image-preview-panel {
  background: rgba(255, 253, 248, 0.58);
}

/* Add Page - premium alignment with Library */
body[data-route='add'] {
  position: relative;
  color: #f6eee2;
  background: #17110d;
}

body[data-route='add']::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -20;
  pointer-events: none;
  background-image: var(--add-bg-image, url('./assets/recipe-bg.jpg'));
  background-size: cover;
  background-position: center;
  filter: blur(42px) saturate(0.7) brightness(0.5);
  transform: scale(1.1);
  opacity: 0.85;
}

body[data-route='add']::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -19;
  pointer-events: none;
  background:
    radial-gradient(120% 145% at 0% 0%, rgba(33, 24, 15, 0.4), rgba(33, 24, 15, 0.14)),
    linear-gradient(118deg, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.16));
}

body[data-route='add'] .app-shell {
  position: relative;
  z-index: 2;
}

body[data-route='add'] .top-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 16px 22px;
  background: rgba(20, 15, 11, 0.46);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body[data-route='add'] .nav-links {
  display: none;
}

body[data-route='add'] .brand p {
  display: none;
}

body[data-route='add'] #app-message {
  display: block;
  color: rgba(247, 237, 223, 0.92);
  max-width: 460px;
  text-align: right;
}

body[data-route='add'] #app-message.error {
  color: #ffd8d2;
}

body[data-route='add'] .brand h1 {
  margin: 0;
  color: #f8efe4;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
}

body[data-route='add'] .brand-home-link {
  cursor: pointer;
}

body[data-route='add'] .brand-home-link:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.58);
  outline-offset: 6px;
  border-radius: 6px;
}

body[data-route='add'] .nav-gear {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body[data-route='add'] .nav-gear:hover,
body[data-route='add'] .nav-gear:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  outline: none;
}

body[data-route='add'] .app-content {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px 22px 34px;
}

body[data-route='add'] .add-screen.page-add {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 4;
  gap: 32px;
}

body[data-route='add'] .add-premium-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

body[data-route='add'] .add-premium-card {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body[data-route='add'] .add-premium-card .section-title {
  margin: 0;
  color: #fff6ea;
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
}

body[data-route='add'] .add-premium-card .screen-description {
  color: rgba(247, 237, 223, 0.8);
}

body[data-route='add'] .add-import-input {
  display: none;
}

body[data-route='add'] .add-file-status {
  margin: 0;
  color: rgba(247, 237, 223, 0.74);
  font-size: 0.92rem;
}

body[data-route='add'] .add-file-preview {
  margin-top: -6px;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

body[data-route='add'] .add-file-preview-name {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  line-height: 1.2;
}

body[data-route='add'] .add-file-preview-meta {
  color: rgba(247, 237, 223, 0.66);
  font-size: 0.79rem;
  line-height: 1.2;
}

body[data-route='add'] .add-premium-btn {
  justify-self: start;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.15);
  color: #fff6ea;
  box-shadow: none;
  font-size: 0.94rem;
  font-weight: 600;
}

body[data-route='add'] .add-premium-btn:hover,
body[data-route='add'] .add-premium-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.46);
  outline: none;
}

body[data-route='add'] .add-premium-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

body[data-route='add'] .add-manual-form {
  display: grid;
  gap: 12px;
}

body[data-route='add'] .add-manual-field {
  display: grid;
  gap: 7px;
  margin: 0;
}

body[data-route='add'] .add-manual-label {
  color: rgba(247, 237, 223, 0.78);
  font-size: 0.86rem;
  line-height: 1.25;
}

body[data-route='add'] .add-manual-form input,
body[data-route='add'] .add-manual-form textarea,
body[data-route='add'] .add-manual-form select {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff6ea;
  padding: 10px 12px;
  font-size: 0.95rem;
  box-shadow: none;
}

body[data-route='add'] .add-manual-form textarea {
  min-height: 92px;
  resize: vertical;
}

body[data-route='add'] .add-manual-form input::placeholder,
body[data-route='add'] .add-manual-form textarea::placeholder {
  color: rgba(247, 237, 223, 0.54);
}

body[data-route='add'] .add-manual-form input:focus,
body[data-route='add'] .add-manual-form textarea:focus,
body[data-route='add'] .add-manual-form select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

body[data-route='add'] .add-manual-submit {
  margin-top: 4px;
}

body[data-route='add'] .add-manual-host {
  min-width: 0;
}

body[data-route='add'] .add-manual-host .edit-screen {
  gap: 16px;
}

body[data-route='add'] .add-manual-host .card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body[data-route='add'] .add-manual-host .screen-title,
body[data-route='add'] .add-manual-host .section-title {
  color: #fff6ea;
}

body[data-route='add'] .add-manual-host .field-label,
body[data-route='add'] .add-manual-host .screen-description,
body[data-route='add'] .add-manual-host .section-subtitle {
  color: rgba(247, 237, 223, 0.76);
}

body[data-route='add'] .add-manual-host input,
body[data-route='add'] .add-manual-host textarea,
body[data-route='add'] .add-manual-host select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff6ea;
}

body[data-route='add'] .add-manual-host input::placeholder,
body[data-route='add'] .add-manual-host textarea::placeholder {
  color: rgba(247, 237, 223, 0.56);
}

body[data-route='add'] .add-manual-host input:focus,
body[data-route='add'] .add-manual-host textarea:focus,
body[data-route='add'] .add-manual-host select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.11);
}

body[data-route='add'] .add-manual-host .editor-row,
body[data-route='add'] .add-manual-host .image-preview {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body[data-route='add'] .add-manual-host .preview-img {
  border-radius: 10px;
}

body[data-route='add'] .add-manual-host .ghost-btn,
body[data-route='add'] .add-manual-host .danger-btn,
body[data-route='add'] .add-manual-host .form-actions > button {
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff6ea;
}

body[data-route='add'] .add-manual-host .danger-btn {
  background: rgba(174, 78, 66, 0.36);
  border-color: rgba(216, 134, 125, 0.42);
  color: #ffe7e0;
}

body[data-route='add'] .add-manual-host .ghost-btn {
  background: rgba(255, 255, 255, 0.1);
}

body[data-route='add'] .add-manual-host .form-actions > button:not(.ghost-btn):not(.danger-btn) {
  background: rgba(155, 106, 67, 0.62);
  border-color: rgba(205, 161, 122, 0.42);
}

body[data-route='add'] .add-manual-host button:hover,
body[data-route='add'] .add-manual-host button:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

body[data-route='add'] .add-manual-host .danger-btn:hover,
body[data-route='add'] .add-manual-host .danger-btn:focus-visible {
  background: rgba(174, 78, 66, 0.48);
}

@media (max-width: 760px) {
  body[data-route='add'] .top-nav {
    padding: 14px 16px;
  }

  body[data-route='add'] .app-content {
    padding: 18px 16px 28px;
  }

  body[data-route='add'] .add-premium-card {
    padding: 20px;
    border-radius: 20px;
  }
}

/* Edit Page - visual alignment with Library/Add */
body[data-route='edit'] {
  position: relative;
  color: #f6eee2;
  background: #17110d;
}

body[data-route='edit']::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -20;
  pointer-events: none;
  background-image: var(--add-bg-image, url('./assets/recipe-bg.jpg'));
  background-size: cover;
  background-position: center;
  filter: blur(42px) saturate(0.7) brightness(0.5);
  transform: scale(1.1);
  opacity: 0.85;
}

body[data-route='edit']::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -19;
  pointer-events: none;
  background:
    radial-gradient(120% 145% at 0% 0%, rgba(33, 24, 15, 0.4), rgba(33, 24, 15, 0.14)),
    linear-gradient(118deg, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.16));
}

body[data-route='edit'] .app-shell {
  position: relative;
  z-index: 2;
}

body[data-route='edit'] .top-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 16px 22px;
  background: rgba(20, 15, 11, 0.46);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body[data-route='edit'] .nav-links {
  display: none;
}

body[data-route='edit'] .brand p,
body[data-route='edit'] #app-message {
  display: none;
}

body[data-route='edit'] .brand h1 {
  margin: 0;
  color: #f8efe4;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
}

body[data-route='edit'] .brand-home-link {
  cursor: pointer;
}

body[data-route='edit'] .brand-home-link:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.58);
  outline-offset: 6px;
  border-radius: 6px;
}

body[data-route='edit'] .nav-gear {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body[data-route='edit'] .nav-gear:hover,
body[data-route='edit'] .nav-gear:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  outline: none;
}

body[data-route='edit'] .app-content {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px 22px 34px;
}

body[data-route='edit'] .edit-screen {
  position: relative;
  z-index: 4;
  gap: 22px;
}

body[data-route='edit'] .edit-screen .card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
  border-radius: 24px;
  padding: 22px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body[data-route='edit'] .edit-header-card {
  margin-bottom: 0;
}

body[data-route='edit'] .screen-title,
body[data-route='edit'] .section-title {
  color: #fff6ea;
}

body[data-route='edit'] .field-label,
body[data-route='edit'] .screen-description,
body[data-route='edit'] .section-subtitle {
  color: rgba(247, 237, 223, 0.76);
}

body[data-route='edit'] input,
body[data-route='edit'] textarea,
body[data-route='edit'] select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff6ea;
}

body[data-route='edit'] input::placeholder,
body[data-route='edit'] textarea::placeholder {
  color: rgba(247, 237, 223, 0.56);
}

body[data-route='edit'] input:focus,
body[data-route='edit'] textarea:focus,
body[data-route='edit'] select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.11);
}

body[data-route='edit'] .editor-row,
body[data-route='edit'] .image-preview {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body[data-route='edit'] .preview-img {
  border-radius: 10px;
}

body[data-route='edit'] .edit-screen button {
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff6ea;
}

body[data-route='edit'] .edit-screen .ghost-btn {
  background: rgba(255, 255, 255, 0.1);
}

body[data-route='edit'] .edit-screen .danger-btn {
  background: rgba(174, 78, 66, 0.36);
  border-color: rgba(216, 134, 125, 0.42);
  color: #ffe7e0;
}

body[data-route='edit'] .edit-screen .form-actions > button:not(.ghost-btn):not(.danger-btn) {
  background: rgba(155, 106, 67, 0.62);
  border-color: rgba(205, 161, 122, 0.42);
}

body[data-route='edit'] .edit-screen button:hover,
body[data-route='edit'] .edit-screen button:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

body[data-route='edit'] .edit-screen .danger-btn:hover,
body[data-route='edit'] .edit-screen .danger-btn:focus-visible {
  background: rgba(174, 78, 66, 0.48);
}

@media (max-width: 760px) {
  body[data-route='edit'] .top-nav {
    padding: 14px 16px;
  }

  body[data-route='edit'] .app-content {
    padding: 18px 16px 28px;
  }

  body[data-route='edit'] .edit-screen .card {
    padding: 18px;
    border-radius: 20px;
  }
}

/* Edit overflow hardening */
body[data-route='edit'],
body[data-route='edit'] .app-shell,
body[data-route='edit'] .app-content,
body[data-route='edit'] .edit-screen,
body[data-route='edit'] .recipe-form,
body[data-route='edit'] .form-section,
body[data-route='edit'] .card {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body[data-route='edit'] {
  overflow-x: hidden;
}

body[data-route='edit'] .app-content {
  overflow-x: hidden;
  padding-right: 22px;
  padding-left: 22px;
}

body[data-route='edit'] .edit-screen .card {
  width: 100%;
}

body[data-route='edit'] .field > input,
body[data-route='edit'] .field > textarea,
body[data-route='edit'] .field > select,
body[data-route='edit'] input[type='file'] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body[data-route='edit'] .editor-row {
  grid-template-columns: minmax(72px, 100px) minmax(120px, 160px) minmax(0, 1fr) minmax(0, 1fr) minmax(140px, 180px) auto;
  width: 100%;
  max-width: 100%;
}

body[data-route='edit'] .step-row {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 180px) auto;
}

body[data-route='edit'] .editor-row > * {
  min-width: 0;
  max-width: 100%;
}

body[data-route='edit'] .row-actions {
  flex-wrap: wrap;
}

/* Drafts Page - aligned with Library visual system */
body[data-route='drafts'] {
  position: relative;
  color: #f6eee2;
  background: #17110d;
}

body[data-route='drafts']::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -25;
  pointer-events: none;
  background-image: url('./assets/recipe-bg.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(38px) saturate(0.66) brightness(0.5);
  transform: scale(1.08);
  opacity: 0.62;
}

body[data-route='drafts']::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -24;
  pointer-events: none;
  background:
    radial-gradient(120% 145% at 0% 0%, rgba(33, 24, 15, 0.36), rgba(33, 24, 15, 0.12)),
    linear-gradient(118deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.14));
}

body[data-route='drafts'] .app-shell {
  position: relative;
  z-index: 2;
}

body[data-route='drafts'] .top-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 16px 22px;
  background: rgba(20, 15, 11, 0.46);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body[data-route='drafts'] .nav-links {
  display: none;
}

body[data-route='drafts'] .brand p,
body[data-route='drafts'] #app-message {
  display: none;
}

body[data-route='drafts'] .brand h1 {
  margin: 0;
  color: #f8efe4;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
}

body[data-route='drafts'] .brand-home-link {
  cursor: pointer;
}

body[data-route='drafts'] .brand-home-link:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.58);
  outline-offset: 6px;
  border-radius: 6px;
}

body[data-route='drafts'] .nav-gear {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body[data-route='drafts'] .nav-gear:hover,
body[data-route='drafts'] .nav-gear:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  outline: none;
}

body[data-route='drafts'] .app-content {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px 22px 34px;
}

body[data-route='drafts'] .drafts-screen {
  position: relative;
  min-height: calc(100dvh - 44px);
}

body[data-route='drafts'] .drafts-bg-stack,
body[data-route='drafts'] .drafts-bg-layer,
body[data-route='drafts'] .drafts-bg-shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body[data-route='drafts'] .drafts-bg-stack {
  z-index: -20;
}

body[data-route='drafts'] .drafts-bg-layer {
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(0.68) brightness(0.52);
  transform: scale(1.1);
  opacity: 0;
  transition: opacity 1400ms ease;
}

body[data-route='drafts'] .drafts-bg-layer.is-active {
  opacity: 1;
}

body[data-route='drafts'] .drafts-bg-shade {
  z-index: 2;
  background:
    radial-gradient(120% 145% at 0% 0%, rgba(33, 24, 15, 0.37), rgba(33, 24, 15, 0.12)),
    linear-gradient(118deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.14));
}

body[data-route='drafts'] .drafts-shell {
  position: relative;
  z-index: 4;
  display: block;
}

body[data-route='drafts'] .drafts-main-card {
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body[data-route='drafts'] .drafts-title {
  margin: 0;
  color: #fff6ea;
}

body[data-route='drafts'] .drafts-main-card .screen-description {
  color: rgba(247, 237, 223, 0.8);
}

body[data-route='drafts'] .drafts-create-btn {
  justify-self: start;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.15);
  color: #fff6ea;
  box-shadow: none;
  font-size: 0.94rem;
  font-weight: 600;
}

body[data-route='drafts'] .drafts-create-btn:hover,
body[data-route='drafts'] .drafts-create-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.46);
  outline: none;
}

body[data-route='drafts'] .drafts-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  height: auto;
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

body[data-route='drafts'] .drafts-item-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 14px;
  align-items: center;
  height: 96px;
  padding: 12px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  margin: 0;
}

body[data-route='drafts'] .draft-main {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
}

body[data-route='drafts'] .draft-title {
  margin: 0;
  color: #fff6ea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.22;
}

body[data-route='drafts'] .draft-meta {
  margin: 0;
  color: rgba(247, 237, 223, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

body[data-route='drafts'] .drafts-item-card .row-actions {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

body[data-route='drafts'] .drafts-item-card .ghost-btn,
body[data-route='drafts'] .drafts-item-card .danger-btn {
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

body[data-route='drafts'] .drafts-item-card .ghost-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff6ea;
}

body[data-route='drafts'] .drafts-item-card .ghost-btn:hover,
body[data-route='drafts'] .drafts-item-card .ghost-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

body[data-route='drafts'] .drafts-item-card .danger-btn {
  background: rgba(174, 78, 66, 0.3);
  border-color: rgba(216, 134, 125, 0.42);
  color: #ffe7e0;
}

body[data-route='drafts'] .drafts-item-card .danger-btn:hover,
body[data-route='drafts'] .drafts-item-card .danger-btn:focus-visible {
  background: rgba(174, 78, 66, 0.42);
  outline: none;
}

@media (max-width: 760px) {
  body[data-route='drafts'] .top-nav {
    padding: 14px 16px;
  }

  body[data-route='drafts'] .app-content {
    padding: 18px 16px 28px;
  }

  body[data-route='drafts'] .drafts-item-card {
    height: 92px;
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* Settings Page - aligned with Library visual system */
body[data-route='settings'] {
  position: relative;
  color: #f6eee2;
  background: #17110d;
}

body[data-route='settings']::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -25;
  pointer-events: none;
  background-image: url('./assets/recipe-bg.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(38px) saturate(0.66) brightness(0.5);
  transform: scale(1.08);
  opacity: 0.62;
}

body[data-route='settings']::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -24;
  pointer-events: none;
  background:
    radial-gradient(120% 145% at 0% 0%, rgba(33, 24, 15, 0.36), rgba(33, 24, 15, 0.12)),
    linear-gradient(118deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.14));
}

body[data-route='settings'] .app-shell {
  position: relative;
  z-index: 2;
}

body[data-route='settings'] .top-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 16px 22px;
  background: rgba(20, 15, 11, 0.46);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body[data-route='settings'] .nav-links {
  display: none;
}

body[data-route='settings'] .brand p,
body[data-route='settings'] #app-message {
  display: none;
}

body[data-route='settings'] .brand h1 {
  margin: 0;
  color: #f8efe4;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
}

body[data-route='settings'] .brand-home-link {
  cursor: pointer;
}

body[data-route='settings'] .brand-home-link:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.58);
  outline-offset: 6px;
  border-radius: 6px;
}

body[data-route='settings'] .nav-gear {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body[data-route='settings'] .nav-gear:hover,
body[data-route='settings'] .nav-gear:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  outline: none;
}

body[data-route='settings'] .app-content {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px 22px 34px;
}

body[data-route='settings'] .settings-screen {
  position: relative;
  min-height: calc(100dvh - 44px);
}

body[data-route='settings'] .settings-bg-stack,
body[data-route='settings'] .settings-bg-layer,
body[data-route='settings'] .settings-bg-shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body[data-route='settings'] .settings-bg-stack {
  z-index: -20;
}

body[data-route='settings'] .settings-bg-layer {
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(0.68) brightness(0.52);
  transform: scale(1.1);
  opacity: 0;
  transition: opacity 1400ms ease;
}

body[data-route='settings'] .settings-bg-layer.is-active {
  opacity: 1;
}

body[data-route='settings'] .settings-bg-shade {
  z-index: 2;
  background:
    radial-gradient(120% 145% at 0% 0%, rgba(33, 24, 15, 0.37), rgba(33, 24, 15, 0.12)),
    linear-gradient(118deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.14));
}

body[data-route='settings'] .settings-shell {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 18px;
}

body[data-route='settings'] .settings-main-card {
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body[data-route='settings'] .settings-main-card .screen-title,
body[data-route='settings'] .settings-main-card .section-title {
  margin: 0;
  color: #fff6ea;
}

body[data-route='settings'] .settings-main-card .screen-description,
body[data-route='settings'] .settings-main-card .section-subtitle,
body[data-route='settings'] .settings-main-card .future-hint {
  color: rgba(247, 237, 223, 0.8);
}

body[data-route='settings'] .settings-list {
  display: grid;
  gap: 12px;
  margin-top: 2px;
}

body[data-route='settings'] .settings-backup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

body[data-route='settings'] .settings-backup-btn {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: #fff6ea;
  box-shadow: none;
}

body[data-route='settings'] .settings-backup-btn:hover,
body[data-route='settings'] .settings-backup-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

body[data-route='settings'] .settings-backup-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body[data-route='settings'] .settings-list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body[data-route='settings'] .settings-list-row .list-main {
  color: #fff6ea;
}

body[data-route='settings'] .settings-list-row .list-meta {
  color: rgba(247, 237, 223, 0.7);
}

body[data-route='settings'] .settings-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-route='settings'] .settings-row-actions .ghost-btn,
body[data-route='settings'] .settings-row-actions .danger-btn {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

body[data-route='settings'] .settings-row-actions .ghost-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff6ea;
}

body[data-route='settings'] .settings-row-actions .ghost-btn:hover,
body[data-route='settings'] .settings-row-actions .ghost-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

body[data-route='settings'] .settings-row-actions .danger-btn {
  background: rgba(174, 78, 66, 0.3);
  border-color: rgba(216, 134, 125, 0.42);
  color: #ffe7e0;
}

body[data-route='settings'] .settings-row-actions .danger-btn:hover,
body[data-route='settings'] .settings-row-actions .danger-btn:focus-visible {
  background: rgba(174, 78, 66, 0.42);
  outline: none;
}

body[data-route='settings'] .settings-inline-form {
  margin-top: 4px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body[data-route='settings'] .settings-inline-form input {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff6ea;
}

body[data-route='settings'] .settings-inline-form input::placeholder {
  color: rgba(247, 237, 223, 0.6);
}

body[data-route='settings'] .settings-inline-form button {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  color: #fff6ea;
  box-shadow: none;
}

body[data-route='settings'] .settings-inline-form button:hover,
body[data-route='settings'] .settings-inline-form button:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

@media (max-width: 760px) {
  body[data-route='settings'] .top-nav {
    padding: 14px 16px;
  }

  body[data-route='settings'] .app-content {
    padding: 18px 16px 28px;
  }

  body[data-route='settings'] .settings-list-row {
    flex-direction: column;
    align-items: flex-start;
  }

  body[data-route='settings'] .settings-inline-form {
    grid-template-columns: 1fr;
  }

  body[data-route='settings'] .settings-backup-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
