:root {
  --paper: #f4efe6;
  --paper-deep: #ebe3d4;
  --ink: #2a241b;
  --ink-soft: #6b6154;
  --rule: #d9cfc0;
  --sage: #5b6b4a;
  --sage-deep: #445236;
  --terracotta: #c45c26;
  --terracotta-deep: #a4481b;
  --cream: #fffaf3;
  --white: #fffdf9;
  --danger: #9b2c2c;
  --focus: #c45c26;
  --sidebar-w: 320px;
  --drawer-w: 380px;
  --drawer-peek: 3.15rem;
  --font-ui: "Figtree", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
}

.left-panel {
  position: relative;
  background: var(--paper-deep);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.user-plug {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}

.user-dot {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  flex-shrink: 0;
  line-height: 1;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.user-new {
  margin-left: 0.35rem;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  background: var(--terracotta);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.28rem 0.7rem;
}

.user-new:hover {
  background: var(--terracotta-deep);
}

.brand {
  padding: 1.1rem 1.25rem 0.95rem;
  border-bottom: 1px solid var(--rule);
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--sage-deep);
}

.brand p {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.url-box {
  padding: 0.9rem 1.1rem 0.8rem;
  border-bottom: 1px solid var(--rule);
}

.url-intro {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.url-form {
  display: flex;
  gap: 0.45rem;
}

.url-ai-notice {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.4;
}

.url-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.875rem;
}

.url-form input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.15);
}

.url-form button,
.btn {
  font: inherit;
  border: none;
  cursor: pointer;
  border-radius: 8px;
}

.url-form button {
  background: var(--terracotta);
  color: #fff;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.url-form button:hover,
.btn.primary:hover {
  background: var(--terracotta-deep);
}

.url-form button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.filter-wrap {
  padding: 0.65rem 1.1rem 0.35rem;
}

.filter-wrap input {
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.875rem;
}

.filter-wrap input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.15);
}

.list-hint {
  margin: 0;
  padding: 0 1.15rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.recipe-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0 1.5rem;
}

.recipe-nav:empty::before,
.type-group + .empty-hint {
  display: none;
}

.empty-list {
  padding: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.type-group {
  margin-bottom: 0.85rem;
}

.type-label {
  margin: 0 1.15rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
}

.recipe-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.85rem 0.28rem 1.05rem;
  cursor: pointer;
}

.recipe-row:hover {
  background: rgba(255, 253, 249, 0.55);
}

.recipe-row.is-selected {
  background: var(--cream);
  box-shadow: inset 3px 0 0 var(--terracotta);
}

.recipe-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sage);
  flex: 0 0 auto;
  cursor: pointer;
}

.recipe-row .recipe-name {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0.2rem 0;
  font-size: 0.9375rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.recipe-row .recipe-title-text {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-row .nav-version {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.recipe-row .recipe-flag {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #ddd8d0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recipe-row .recipe-flag:hover,
.recipe-row .recipe-flag:focus-visible {
  background: rgba(0, 0, 0, 0.04);
  outline: none;
}

.recipe-row .recipe-flag svg {
  display: block;
}

.recipe-row .recipe-flag[data-color="0"] { color: #ddd8d0; }
.recipe-row .recipe-flag[data-color="1"] { color: #e53935; }
.recipe-row .recipe-flag[data-color="2"] { color: #fb8c00; }
.recipe-row .recipe-flag[data-color="3"] { color: #fdd835; }
.recipe-row .recipe-flag[data-color="4"] { color: #43a047; }
.recipe-row .recipe-flag[data-color="5"] { color: #00acc1; }
.recipe-row .recipe-flag[data-color="6"] { color: #1e88e5; }
.recipe-row .recipe-flag[data-color="7"] { color: #3949ab; }
.recipe-row .recipe-flag[data-color="8"] { color: #8e24aa; }
.recipe-row .recipe-flag[data-color="9"] { color: #d81b60; }
.recipe-row .recipe-flag[data-color="10"] { color: #6d4c41; }

.recipe-row .recipe-delete {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9a9388;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recipe-row .recipe-delete:hover,
.recipe-row .recipe-delete:focus-visible {
  color: #6f6a62;
  background: rgba(0, 0, 0, 0.05);
}

.recipe-row .recipe-delete svg {
  display: block;
}

.recipe-panel {
  position: relative;
  min-width: 0;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 250, 243, 0.4), transparent 8rem),
    var(--paper);
}

.recipe-inner {
  max-width: 720px;
  margin: 0;
  padding: 2.25rem 2.5rem 4rem;
}

.recipe-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.btn.ghost:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
  background: var(--white);
}

.btn.primary {
  background: var(--terracotta);
  color: #fff;
  padding: 0.4rem 0.8rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.recipe-title {
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.65rem;
}

.recipe-title-input {
  display: block;
  width: 100%;
  margin: 0 0 0.65rem;
  padding: 0 0 0.2rem;
  border: none;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.recipe-title-input:focus {
  outline: none;
  border-bottom-color: var(--terracotta);
}

.recipe-type-input {
  min-width: 9rem;
  max-width: 14rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(91, 107, 74, 0.12);
  color: var(--sage-deep);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recipe-type-input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.15);
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  align-items: center;
  margin-bottom: 2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.recipe-meta a {
  color: var(--sage-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.recipe-meta a:hover {
  color: var(--terracotta);
}

.recipe-origin {
  font-style: italic;
}

.type-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(91, 107, 74, 0.12);
  color: var(--sage-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
}

.version-pill {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 0;
  border-radius: 999px;
  background: rgba(42, 36, 27, 0.08);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.version-pill select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 1.35rem 0.15rem 0.55rem;
  margin: 0;
  cursor: pointer;
  border-radius: 999px;
}

.version-pill::after {
  content: "";
  position: absolute;
  right: 0.42rem;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  transform: translateY(-35%);
  opacity: 0.7;
}

.version-pill select:disabled {
  cursor: default;
  opacity: 0.7;
}

.version-pill select:focus {
  outline: none;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
}

.section-head .section-title {
  margin: 0;
  flex: 1;
  padding-bottom: 0;
  border-bottom: none;
}

.ingredient-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.ingredient-list li {
  padding: 0.38rem 0;
  border-bottom: 1px dotted var(--rule);
  font-size: 1rem;
  line-height: 1.4;
}

.ingredient-list.is-editing li {
  border-bottom: none;
  padding: 0.28rem 0;
}

.ing-empty {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.ing-edit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.ing-edit-row input,
.ing-edit-row select {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  padding: 0.38rem 0.5rem;
}

.ing-edit-row input:focus,
.ing-edit-row select:focus,
.instructions.is-editing:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.15);
}

.ing-qty {
  width: 4.6rem;
}

.ing-unit {
  width: 5rem;
}

.ing-name {
  flex: 1 1 8rem;
  min-width: 7rem;
}

.ing-area {
  width: 8rem;
}

.ing-remove {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9a9388;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ing-remove:hover,
.ing-remove:focus-visible {
  color: #6f6a62;
  background: rgba(0, 0, 0, 0.05);
}

.instructions {
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0;
}

.instructions p {
  margin: 0 0 0.7rem;
}

.instructions p:last-child {
  margin-bottom: 0;
}

.instructions ol {
  margin: 0;
  padding-left: 1.4rem;
}

.instructions li {
  margin: 0.2rem 0;
}

.instructions li + li {
  margin-top: 0.4rem;
}

.instructions.is-editing {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--white);
  padding: 0.85rem 0.95rem;
  min-height: 12rem;
}

.notes-done {
  justify-content: flex-start;
  margin: 1.35rem 0 0.25rem;
}

.notes-head {
  margin-top: 1.5rem;
}

.notes-autosave {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.notes-hint {
  margin: -0.15rem 0 0.65rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.4;
}

.notes-editor {
  white-space: pre-wrap;
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--white);
  padding: 0.85rem 0.95rem;
  min-height: 7.5rem;
}

.notes-editor:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.15);
}

.notes-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-soft);
}

.empty-recipe {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  color: var(--ink-soft);
}

.empty-recipe svg {
  width: 72px;
  height: 72px;
  margin-bottom: 1rem;
  color: var(--sage);
}

.empty-recipe h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--ink);
  margin: 0 0 0.4rem;
}

.empty-recipe p {
  margin: 0;
  max-width: 28rem;
}

.shopping-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(var(--drawer-w), 100vw);
  background: var(--white);
  border-left: 1px solid var(--rule);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.drawer-handle {
  display: none;
  position: absolute;
  top: 0.5rem;
  left: 0.35rem;
  z-index: 3;
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.drawer-handle svg {
  display: none;
  width: 22px;
  height: 22px;
}

.shopping-drawer.is-open .drawer-handle .icon-close {
  display: block;
}

.shopping-drawer.is-open.is-peek .drawer-handle .icon-close {
  display: none;
}

.shopping-drawer.is-open.is-peek .drawer-handle .icon-menu {
  display: block;
}

@media (max-width: 640px) {
  .shopping-drawer.is-open .drawer-handle {
    display: flex;
  }

  .shopping-drawer.is-open .drawer-header {
    padding-left: 3.3rem;
  }

  .shopping-drawer.is-open.is-peek {
    transform: translateX(calc(100% - var(--drawer-peek)));
  }

  .shopping-drawer.is-open.is-peek .drawer-handle {
    top: 0;
    left: 0;
    width: var(--drawer-peek);
    height: 3.5rem;
    border-radius: 0;
    background: var(--white);
  }

  .shopping-drawer.is-open.is-peek .drawer-header,
  .shopping-drawer.is-open.is-peek .drawer-body {
    pointer-events: none;
  }
}

@media (min-width: 861px) {
  body:has(.shopping-drawer.is-open) .recipe-panel {
    padding-right: var(--drawer-w);
  }
}

.drawer-header {
  padding: 1.2rem 1.15rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.drawer-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.drawer-header h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0;
}

.drawer-header .sub {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.drawer-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.struck-clear-pill {
  display: inline-flex;
  align-items: center;
  border: none;
  cursor: pointer;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  background: rgba(91, 107, 74, 0.14);
  color: var(--sage-deep);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.struck-clear-pill:hover {
  background: rgba(91, 107, 74, 0.24);
}

.struck-clear-pill[hidden] {
  display: none !important;
}

.struck-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

.struck-hint[hidden] {
  display: none !important;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem 2rem;
}

.area-block {
  margin-bottom: 1.35rem;
}

.area-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.area-block h3 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 700;
}

.area-add {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--sage);
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.area-add:hover,
.area-add:focus-visible {
  color: var(--sage-deep);
  background: rgba(91, 107, 74, 0.14);
  outline: none;
}

.area-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.area-block li {
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--rule);
  font-size: 0.95rem;
}

.area-block li.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.shop-item-text {
  min-width: 0;
  flex: 1;
}

.shop-extra-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9a9388;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shop-extra-remove:hover,
.shop-extra-remove:focus-visible {
  color: var(--danger);
  background: rgba(155, 44, 44, 0.08);
  outline: none;
}

.shop-add-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  cursor: default;
  border-bottom: none;
  padding-top: 0.5rem;
}

.shop-add-row[hidden] {
  display: none !important;
}

.shop-add-qty,
.shop-add-name {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  padding: 0.38rem 0.5rem;
}

.shop-add-qty {
  width: 4.4rem;
  flex-shrink: 0;
}

.shop-add-name {
  flex: 1;
  min-width: 0;
}

.shop-add-qty:focus,
.shop-add-name:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.15);
}

.area-block li.shop-item:hover,
.area-block li.shop-item:focus-visible {
  background: rgba(91, 107, 74, 0.08);
  outline: none;
}

.area-block li.shop-item.is-struck,
.area-block li.shop-item.is-struck s {
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.shop-print-hint {
  margin: 1.15rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.toast {
  position: fixed;
  left: 50%;
  top: 1.1rem;
  transform: translateX(-50%) translateY(calc(-100% - 2rem));
  background: var(--ink);
  color: var(--cream);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  z-index: 120;
  max-width: min(28rem, calc(100vw - 2rem));
  transition: transform 0.25s ease;
}

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

.toast.is-error {
  background: var(--danger);
}

.saving-veil {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(244, 239, 230, 0.72);
  align-items: center;
  justify-content: center;
  z-index: 5;
  flex-direction: column;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 600;
}

.left-panel.is-saving .saving-veil {
  display: flex;
}

.saving-wait {
  margin: 0;
  max-width: 14rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-soft);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--rule);
  border-top-color: var(--terracotta);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

@media (max-width: 860px) {
  html, body {
    height: auto;
    overflow: auto;
  }
  .app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }
  .left-panel {
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .recipe-nav {
    flex: none;
    overflow: visible;
  }
  .recipe-panel {
    min-height: 50vh;
  }
  .empty-recipe {
    min-height: 0;
    padding: 2.25rem 1.5rem 3rem;
  }
  .recipe-inner {
    padding: 1.5rem 1.15rem 3rem;
  }
  .recipe-title,
  .recipe-title-input {
    font-size: 1.85rem;
  }
}

@media print {
  html, body {
    height: auto;
    overflow: visible;
    background: #fff;
    color: #000;
  }

  .left-panel,
  .toast,
  .saving-veil,
  .no-print {
    display: none !important;
  }

  body.print-recipe .shopping-drawer {
    display: none !important;
  }

  body.print-recipe .app {
    display: block;
    height: auto;
  }

  body.print-recipe .recipe-panel {
    overflow: visible;
    background: #fff;
    padding-right: 0;
  }

  body.print-recipe .recipe-inner {
    max-width: none;
    padding: 0;
  }

  body.print-recipe .ingredient-list {
    column-count: 3;
    column-gap: 1.4rem;
    column-rule: 1px solid #ddd;
    column-fill: balance;
  }

  body.print-recipe .ingredient-list li {
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
  }

  body.print-shopping .app,
  body.print-shopping .left-panel,
  body.print-shopping .recipe-panel {
    display: none !important;
  }

  body.print-shopping .shopping-drawer {
    position: static;
    transform: none;
    width: 100%;
    height: auto;
    border: none;
    display: block;
  }

  body.print-shopping .drawer-header {
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
  }

  body.print-shopping .drawer-body {
    overflow: visible;
    column-count: 3;
    column-gap: 1.4rem;
    column-rule: 1px solid #ddd;
    column-fill: balance;
  }

  body.print-shopping .area-block {
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 0.95rem;
  }

  body.print-shopping .area-block h3 {
    break-after: avoid-column;
  }

  body.print-shopping .shop-item.is-struck {
    display: none !important;
  }

  body.print-shopping .area-block:not(:has(.shop-item:not(.is-struck))) {
    display: none !important;
  }

  body.print-recipe .ing-remove,
  body.print-recipe #add-ingredient,
  body.print-recipe .edit-only {
    display: none !important;
  }

  body.print-recipe .ing-edit-row input,
  body.print-recipe .ing-edit-row select {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
  }

  body.print-recipe .instructions.is-editing,
  body.print-recipe .notes-editor {
    border: none;
    box-shadow: none;
    padding: 0;
    min-height: 0;
    background: transparent;
  }

  body.print-recipe .notes-editor:empty,
  body.print-recipe .notes-editor:empty::before,
  body.print-recipe .notes-hint,
  body.print-recipe .notes-autosave,
  body.print-recipe .notes-head:has(+ .notes-hint + .notes-editor:empty) {
    display: none !important;
  }

  a[href]::after {
    content: none !important;
  }
}
