body.cookbook-page {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.4), transparent 28%),
    linear-gradient(135deg, #f7b26c 0%, #fff2df 52%, #f3c28b 100%);
}

.cookbook-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.toc-panel {
  padding: 18px 16px;
  position: sticky;
  top: 20px;
}

.toc-panel .panel-title {
  padding-bottom: 8px;
  border-bottom: 2px solid var(--orange-dark);
  margin-bottom: 12px;
}

.add-recipe-button {
  width: 100%;
  margin-bottom: 14px;
  background: var(--orange-dark);
}

.add-recipe-button:hover,
.add-recipe-button:focus-visible {
  background: var(--orange-deep);
}

.recipe-toc {
  display: grid;
  gap: 6px;
}

.recipe-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.recipe-link {
  width: 100%;
  padding: 8px 10px;
  border-left: 3px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 0.95rem;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.recipe-link:hover,
.recipe-link:focus-visible {
  background: rgba(151, 206, 204, 0.16);
  border-left-color: var(--teal);
  transform: translateX(2px);
}

.recipe-link.active {
  color: var(--orange-dark);
  border-left-color: var(--orange-dark);
  font-weight: 700;
  background: rgba(249, 143, 69, 0.12);
}

.recipe-rename-input {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: var(--border-soft);
  border-left: 3px solid var(--orange-dark);
  border-radius: 6px;
  background: #fffefb;
  color: var(--ink);
  font-family: "Walter Turncoat", cursive;
  font-size: 0.95rem;
}

.recipe-delete {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: var(--border-soft);
  border-radius: 8px;
  background: #ffe3d6;
  color: var(--orange-dark);
  font-family: "Walter Turncoat", cursive;
  font-size: 1rem;
  line-height: 1;
}

.recipe-delete:hover,
.recipe-delete:focus-visible {
  background: #ffd3bf;
}

.empty-recipes {
  padding: 10px 8px;
  border-radius: 8px;
  background: rgba(255, 248, 240, 0.78);
  color: rgba(51, 51, 51, 0.75);
  font-size: 0.92rem;
}

.cookbook-main {
  display: grid;
  gap: 16px;
}

.back-button {
  justify-self: start;
  background: var(--teal);
  color: var(--ink);
}

.back-button:hover,
.back-button:focus-visible {
  background: #82c1bf;
}

.notebook-paper {
  position: relative;
  min-height: 700px;
  overflow: hidden;
  background: var(--cream);
  padding: 24px;
}

.notebook-paper::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 40px;
  width: 2px;
  background: rgba(196, 66, 26, 0.3);
}

.notebook-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.notebook-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--paper-line);
}

.paper-content {
  position: relative;
  z-index: 1;
  padding-left: 36px;
}

.recipe-header {
  margin-bottom: 10px;
}

.recipe-title {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 2px dashed var(--teal);
  color: var(--orange-dark);
  font-size: 1.8rem;
  line-height: 28px;
  cursor: text;
}

.recipe-title-editor {
  width: 100%;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 2px dashed var(--teal);
  background: transparent;
  color: var(--orange-dark);
  font-family: "Walter Turncoat", cursive;
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 28px;
}

.recipe-title-editor:focus {
  outline: none;
}

.recipe-body {
  max-height: 590px;
  overflow: auto;
  padding-right: 6px;
  font-size: 0.98rem;
  line-height: 28px;
  white-space: pre-wrap;
  cursor: text;
}

.recipe-header.is-refreshing,
.recipe-body.is-refreshing {
  animation: recipe-fade 0.22s ease;
}

.recipe-body p {
  margin: 0;
}

.recipe-body p + p {
  margin-top: 0;
}

.recipe-body-editor {
  width: 100%;
  min-height: 590px;
  padding: 0 6px 0 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 28px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.recipe-body-editor:focus {
  outline: none;
}

.empty-recipe-message {
  color: rgba(51, 51, 51, 0.72);
  font-style: italic;
}

@keyframes recipe-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .cookbook-shell {
    grid-template-columns: 1fr;
  }

  .toc-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .notebook-paper {
    padding: 20px 16px;
  }

  .notebook-paper::before {
    left: 24px;
  }

  .paper-content {
    padding-left: 22px;
  }
}
