:root {
  --primary: #2B1E1A;
  --accent: #A34828;
  --bg: #FAF6F0;
  --surface: #FFFFFF;
  --text: #1F1917;
  --muted: #E8DFC8
}

* {
  box-sizing: border-box
}

html {
  font-size: 16px
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5
}

h1,
h2,
h3 {
  color: var(--primary);
  line-height: 1.2
}

a {
  color: var(--accent)
}

.muted {
  color: #6b5d57
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem
}

.site-header {
  background: #F3EADB;
  color: var(--primary);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 2px 10px rgba(43, 30, 26, .15);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1rem
}

.site-header a {
  color: var(--primary);
  text-decoration: none
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: .1rem 0
}

.brand-logo {
  height: 58px !important;
  max-height: 58px !important;
  width: auto !important;
  max-width: 165px !important;
  object-fit: contain;
  display: block
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .9rem;
  flex: 1
}

.main-nav a {
  padding: .2rem .1rem;
  border-bottom: 2px solid transparent
}

.main-nav a.active,
.main-nav a:hover {
  border-color: var(--accent)
}

.nav-toggle {
  display: none;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: .35rem .65rem;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  margin-left: auto;
}

.nav-toggle:hover {
  background: var(--muted);
}

.font-controls {
  display: flex;
  gap: .25rem;
}

.font-controls button {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: .2rem .5rem;
  cursor: pointer
}

.card {
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem
}

.narrow {
  max-width: 520px
}

label {
  display: block;
  margin: .5rem 0;
  font-weight: 600
}

label.inline {
  display: inline-flex;
  gap: .4rem;
  align-items: center;
  font-weight: 400
}

input,
select,
textarea {
  width: 100%;
  padding: .5rem;
  border: 1px solid var(--muted);
  border-radius: 6px;
  font: inherit;
  background: #fff;
  color: var(--text)
}

input[type=checkbox],
input[type=radio] {
  width: auto
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center
}

.filters input[type=search] {
  flex: 1 1 100%
}

.filters select {
  width: auto;
  flex: 1 1 140px
}

/* ---- Compact Search & Expandable Filters ---- */
.search-filters-card {
  padding: .75rem;
  margin-bottom: 1rem;
}

.search-bar-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  flex: 1 1 280px;
  min-width: 200px;
  display: flex;
  align-items: center;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: .75rem;
  pointer-events: none;
  font-size: .95rem;
  color: #8C7B75;
  opacity: .7;
  z-index: 2;
}

.search-input-wrapper input[type=search] {
  padding-left: 2.2rem;
  padding-right: 2.2rem;
  width: 100%;
  height: 38px;
  line-height: 38px;
}

.search-input-wrapper input[type=search]::-webkit-search-cancel-button,
.search-input-wrapper input[type=search]::-webkit-search-decoration {
  -webkit-appearance: none;
  display: none;
}

.search-clear-btn {
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: #8C7B75;
  font-size: 1rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
  line-height: 1;
}

.search-clear-btn.is-visible {
  display: flex;
}

.search-clear-btn:hover {
  background: #F3EADB;
  color: var(--primary);
}

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}

.filter-toggle-btn.has-active-filters {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  background: #FAF3EB;
}

.filter-count-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 700;
  padding: .1rem .45rem;
  line-height: 1;
}

.filter-caret {
  display: inline-block;
  font-size: .75rem;
  transition: transform .2s ease;
}

.filter-toggle-btn[aria-expanded=true] .filter-caret {
  transform: rotate(180deg);
}

.active-filters-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px solid var(--muted);
  flex-wrap: wrap;
  font-size: .85rem;
}

.active-filters-label {
  color: #6b5d57;
  font-weight: 600;
}

.active-filters-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #F3EADB;
  color: var(--primary);
  padding: .2rem .55rem;
  border-radius: 16px;
  text-decoration: none;
  font-size: .82rem;
  transition: background .15s ease, color .15s ease;
}

.filter-chip:hover {
  background: #E8DFC8;
}

.filter-chip .chip-remove {
  font-size: .75rem;
  color: #8C7B75;
  font-weight: bold;
}

.filter-chip:hover .chip-remove {
  color: #a02020;
}

.filter-chip-clear {
  background: transparent;
  border: 1px dashed var(--accent);
  color: var(--accent);
}

.filter-chip-clear:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
}

.advanced-filters-panel {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--muted);
  animation: kokapi-slide-down .2s ease;
}

@keyframes kokapi-slide-down {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .65rem;
}

.filter-field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin: 0 0 .25rem;
  color: var(--primary);
}

.filter-field select {
  width: 100%;
  padding: .42rem .55rem;
  font-size: .9rem;
  border-radius: 6px;
}

.filter-field-checkbox {
  display: flex;
  align-items: flex-end;
  padding-bottom: .45rem;
}

.filter-field-checkbox label {
  margin: 0;
  font-size: .9rem;
  cursor: pointer;
}

.advanced-filters-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  align-items: center;
  margin-top: .75rem;
  padding-top: .65rem;
  border-top: 1px solid #F3EADB;
  flex-wrap: wrap;
}

/* Autocomplete Suggesties Dropdown */
.search-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(43, 30, 26, .18);
  max-height: 420px;
  overflow-y: auto;
  z-index: 1000;
  -webkit-overflow-scrolling: touch;
}

.suggestion-section-title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #8C7B75;
  padding: .5rem .75rem .25rem;
  font-weight: 700;
  background: #FAF6F0;
  border-bottom: 1px solid #F3EADB;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .75rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid #F8F3EC;
  cursor: pointer;
  transition: background .12s ease;
}

.suggestion-item:hover,
.suggestion-item.is-selected {
  background: #F5EFE6;
  outline: none;
}

.suggestion-thumb-wrap {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.suggestion-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.suggestion-thumb-fallback {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.suggestion-info {
  flex: 1 1 auto;
  min-width: 0;
}

.suggestion-title {
  font-weight: 600;
  color: var(--primary);
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  font-size: .8rem;
  color: #6b5d57;
  margin-top: .15rem;
}

.suggestion-match-badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  background: #F3EADB;
  color: var(--accent);
  padding: .1rem .35rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: .78rem;
}

.suggestion-meta-item {
  display: inline-block;
}

.suggestion-arrow {
  color: #B5A69E;
  font-size: .95rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.suggestion-item:hover .suggestion-arrow,
.suggestion-item.is-selected .suggestion-arrow {
  color: var(--accent);
}

.suggestion-ingredient .suggestion-icon {
  font-size: 1.25rem;
  flex: 0 0 auto;
}

.suggestion-footer {
  background: #FAF6F0;
  border-top: 1px solid #F3EADB;
}

.suggestion-footer-action {
  display: block;
  width: 100%;
  padding: .65rem .75rem;
  text-align: center;
  color: var(--accent);
  font-weight: 600;
  font-size: .88rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.suggestion-footer-action:hover,
.suggestion-footer-action.is-selected {
  background: #F3EADB;
}

.suggestion-empty {
  padding: 1rem;
  text-align: center;
  color: #6b5d57;
  font-size: .9rem;
}

.search-match {
  background: #FFE4B5;
  color: inherit;
  font-weight: 700;
  padding: 0 1px;
  border-radius: 2px;
}

.btn-sm {
  padding: .25rem .55rem;
  font-size: .85rem;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: .5rem .9rem;
  cursor: pointer;
  font: inherit;
  text-decoration: none
}

[hidden] {
  display: none !important;
}

.btn:hover {
  background: var(--accent)
}

.btn-light {
  background: var(--muted);
  color: var(--primary)
}

.btn-light:hover {
  background: #d9cdaa;
  color: var(--primary)
}

.btn-danger {
  background: #fff;
  color: #a02020;
  border: 1px solid #a02020
}

.btn-danger:hover {
  background: #a02020;
  color: #fff
}

.linklike {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font: inherit;
  padding: 0
}

.alert {
  padding: .7rem 1rem;
  border-radius: 6px;
  margin: .75rem 0;
  border: 1px solid var(--muted);
  background: var(--surface)
}

.alert-error {
  border-color: #a02020;
  color: #7a1515
}

.alert-success {
  border-color: #3b7a3b
}

.alert-warning {
  background: #fff3e0;
  border-color: var(--accent)
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem
}

.recipe-card {
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: block
}

.recipe-card:hover {
  box-shadow: 0 2px 10px rgba(43, 30, 26, .2)
}

.recipe-card img,
.no-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block
}

.no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: var(--muted)
}

.card-body {
  padding: .7rem
}

.card-body h3 {
  margin: 0 0 .3rem;
  font-size: 1.05rem
}

.stars {
  color: var(--accent)
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: .4rem 0
}

.source {
  margin: .35rem 0 .75rem;
  font-size: .95rem;
  color: #6b5d57;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.source a {
  color: var(--accent);
  text-decoration: underline;
}

.source-label {
  font-weight: 600;
  color: var(--primary);
  margin-right: .25rem;
}

.badge {
  background: var(--muted);
  color: var(--primary);
  border-radius: 999px;
  padding: .1rem .6rem;
  font-size: .8rem;
  text-decoration: none
}

.badge-green {
  background: #d7ecd3
}

.badge-accent {
  background: var(--accent);
  color: #fff
}

.row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap
}

.row>label {
  flex: 1 1 150px
}

.row-item {
  display: flex;
  gap: .4rem;
  margin-bottom: .4rem;
  align-items: flex-start
}

.w-amount {
  width: 90px;
  flex: none
}

.w-unit {
  width: 130px;
  flex: none
}

.w-group {
  width: 160px;
  flex: none
}

/* Ingrediënten editor */
.ing-header {
  display: grid;
  grid-template-columns: 88px 150px 85px 120px 1fr 38px;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 600;
  color: #6b5d57;
  margin-bottom: .3rem;
  padding: 0 .2rem;
}

.ing-item {
  display: grid;
  grid-template-columns: 88px 150px 85px 120px 1fr 38px;
  gap: .4rem;
  align-items: center;
  margin-bottom: .45rem;
  transition: background-color .2s ease, border-color .2s ease;
}

.ing-item input {
  min-width: 0;
  width: 100%;
}

.ing-item .remove-row {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ing-reorder {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  flex: none;
}

.btn-reorder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--muted);
  background: #fff;
  color: var(--primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  touch-action: manipulation;
  transition: background .15s ease, color .15s ease, opacity .15s ease;
}

.btn-reorder:hover:not(:disabled) {
  background: var(--muted);
  color: var(--accent);
}

.btn-reorder:disabled {
  opacity: .25;
  cursor: not-allowed;
  pointer-events: none;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 36px;
  color: #8c7b75;
  cursor: grab;
  user-select: none;
  font-size: 1.15rem;
  line-height: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.ing-item.is-dragging {
  opacity: .35;
}

.ing-item.drag-over-above {
  outline: 2px dashed var(--accent);
  outline-offset: 1px;
}

.ing-item.drag-over-below {
  outline: 2px dashed var(--accent);
  outline-offset: 1px;
}

.ing-item.row-moved {
  background-color: #F3EADB;
  border-radius: 6px;
}

.letter-nav a {
  margin-right: .4rem;
  font-weight: 700
}

.index-list {
  columns: 3 200px;
  list-style: none;
  padding: 0
}

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

.table th,
.table td {
  padding: .4rem;
  border-bottom: 1px solid var(--muted);
  text-align: left
}

.inline-form {
  display: inline
}

.inline-form input {
  width: auto
}

.recipe-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  align-items: flex-start
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem
}

.rating .star {
  background: none;
  border: 0;
  font-size: 1.8rem;
  color: #cbbf9f;
  cursor: pointer;
  padding: 0 .1rem
}

.rating .star.on {
  color: var(--accent)
}

.notes {
  background: #fff8ec;
  border: 1px solid var(--muted);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: .5rem 1rem;
  margin: 1rem 0
}

.notes h2 {
  margin: .3rem 0;
  font-size: 1.1rem
}

.note {
  margin: .4rem 0
}

.note-meta {
  font-weight: 700
}

.note-actions {
  font-size: .85rem;
  margin-left: .5rem
}

.note-add {
  margin-top: .75rem;
}

.note-add summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  user-select: none;
}

.note-add summary:hover {
  text-decoration: underline;
}

.note-add textarea {
  margin-top: .4rem;
  margin-bottom: .4rem;
  display: block;
}

.recipe-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.5rem;
  margin-top: 1rem
}

@media(max-width:760px) {
  .site-header {
    justify-content: space-between;
    padding: .5rem .75rem;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 2;
  }

  .font-controls {
    order: 3;
  }

  .main-nav {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--muted);
    border-radius: 8px;
    padding: .5rem 0;
    margin-top: .4rem;
    box-shadow: 0 4px 12px rgba(43, 30, 26, .1);
    gap: 0;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--muted);
    font-size: 1.05rem;
  }

  .main-nav a:last-child {
    border-bottom: none;
  }

  .main-nav a.active,
  .main-nav a:hover {
    background: #FAF6F0;
    border-color: var(--muted);
    color: var(--accent);
    border-left: 4px solid var(--accent);
  }

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

  .container {
    padding: .5rem .75rem;
  }

  .card {
    padding: .75rem;
  }

  /* Ingrediënten editor op mobiel: 2 duidelijke regels per ingrediënt */
  .ing-header {
    display: none;
  }

  .ing-item {
    display: grid;
    grid-template-columns: 68px 1fr 1fr 38px;
    grid-template-rows: auto auto;
    gap: .45rem;
    padding: .6rem;
    background: #FAF6F0;
    border: 1px solid var(--muted);
    border-radius: 8px;
    margin-bottom: .6rem;
    box-shadow: 0 1px 3px rgba(43, 30, 26, .04);
  }

  .ing-item .drag-handle {
    display: none;
  }

  .ing-item .ing-reorder {
    grid-column: 1;
    grid-row: 1;
    gap: .25rem;
  }

  .ing-item .btn-reorder {
    width: 31px;
    height: 38px;
    font-size: 1rem;
  }

  .ing-item .ing-name {
    grid-column: 2 / 4;
    grid-row: 1;
  }

  .ing-item .remove-row {
    grid-column: 4;
    grid-row: 1;
    width: 38px;
    height: 38px;
  }

  .ing-item .ing-amount {
    grid-column: 1;
    grid-row: 2;
  }

  .ing-item .ing-unit {
    grid-column: 2;
    grid-row: 2;
  }

  .ing-item .ing-group {
    grid-column: 3 / 5;
    grid-row: 2;
  }

  .search-input-wrapper {
    flex: 1 1 100%;
  }

  .search-bar-row .btn,
  .search-bar-row .filter-toggle-btn {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

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

  .advanced-filters-actions {
    justify-content: stretch;
  }

  .advanced-filters-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media(max-width:480px) {
  .filters-grid {
    grid-template-columns: 1fr;
  }
}

.primary-img {
  width: 100%;
  border-radius: 8px;
  max-height: 360px;
  object-fit: cover
}

.facts {
  list-style: none;
  padding: 0
}

.servings-control {
  display: flex;
  align-items: center;
  gap: .6rem
}

.ingredients,
.steps {
  padding-left: 0;
  list-style: none
}

.ingredients li,
.steps li {
  padding: .35rem 0;
  border-bottom: 1px solid var(--muted)
}

.steps {
  counter-reset: s
}

.steps li label {
  font-weight: 400
}

.ingredients label {
  font-weight: 400
}

.ingredients-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .5rem;
}

.ingredients-box-head h2 {
  margin: 0;
}

.copy-ingredients-btn {
  font-size: .8rem;
  padding: .2rem .5rem;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 4px;
  cursor: pointer;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

.copy-ingredients-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ing-group-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--primary);
  margin-top: .6rem;
  padding-bottom: .15rem;
  border-bottom: 1px dashed var(--muted);
}

li:has(.check:checked) {
  text-decoration: line-through;
  opacity: .55
}

.timer-btn {
  background: var(--accent);
  margin-left: 1.6rem;
  margin-top: .3rem
}

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

.gallery-head h2 {
  margin: 0;
}

.copy-prompt-btn {
  font-size: .8rem;
  padding: .2rem .5rem;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 4px;
  cursor: pointer;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

.copy-prompt-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .75rem
}

.thumb {
  width: 150px
}

.thumb img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  display: block
}

.timer-panel {
  position: fixed;
  right: .75rem;
  bottom: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 50;
  max-width: 260px
}

.timer {
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: .5rem .75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem
}

.timer .time {
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem;
  font-weight: 700
}

.timer button {
  background: var(--muted);
  border: 0;
  border-radius: 4px;
  cursor: pointer
}

.timer.done {
  animation: flash 1s steps(2, start) infinite
}

@keyframes flash {
  50% {
    background: var(--accent)
  }
}

.print-only {
  display: none
}

/* Cooking mode */
body.cooking .site-header,
body.cooking .notes form,
body.cooking .gallery,
body.cooking .actions,
body.cooking .rating {
  display: none
}

body.cooking {
  font-size: 1.35rem;
  background: #fff
}

body.cooking .container {
  max-width: 1300px
}

body.cooking #cook-exit {
  position: fixed;
  top: .6rem;
  right: .6rem;
  z-index: 60
}

@media print {
  @page {
    size: A4;
    margin: 0.7cm
  }

  body {
    background: #fff;
    color: #000;
    font-size: 8.5pt;
    line-height: 1.25
  }

  .no-print,
  .site-header,
  .timer-panel,
  #cook-exit {
    display: none !important
  }

  .print-only {
    display: block
  }

  .container {
    max-width: none;
    padding: 0;
    margin: 0
  }

  /* Compact print header with logo */
  .print-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: .4cm;
    padding-bottom: .08cm;
    margin-bottom: .05cm
  }

  .print-brand {
    display: flex;
    align-items: center;
    flex: none
  }

  .print-logo {
    height: 38px !important;
    max-height: 38px !important;
    width: auto !important;
    max-width: 115px !important;
    object-fit: contain;
    display: block
  }

  .print-title {
    flex: 1;
    min-width: 0
  }

  .screen-title {
    display: none
  }

  h1 {
    font-size: 14pt;
    margin: 0;
    line-height: 1.1
  }

  h2 {
    font-size: 9.5pt;
    margin: .15cm 0 .06cm 0;
    border-bottom: 1px solid #ccc;
    padding-bottom: 1px
  }

  .recipe-head {
    margin-bottom: 0
  }

  .intro {
    font-size: 9.5pt;
    margin: 0 0 .2cm 0;
    line-height: 1.35;
    color: #222
  }

  .badges {
    gap: .1cm;
    margin: .03cm 0 .3cm
  }

  .source {
    font-size: 8pt;
    margin: 0 0 .15cm 0;
    color: #333;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.3;
  }

  .source a {
    color: #000;
    text-decoration: none;
  }

  .source-label {
    font-weight: 600;
  }

  .badge {
    padding: 1px 6px;
    font-size: 6.5pt;
    line-height: 1.4;
    border: 0;
    background: var(--muted) !important;
    color: var(--primary);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact
  }

  .recipe-layout {
    display: grid;
    grid-template-columns: 1fr 2.4fr;
    gap: 0.5cm;
    margin-top: .1cm
  }

  .primary-img {
    max-height: 2.7cm;
    width: 100%;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: .12cm
  }

  .primary-img.portrait {
    max-height: 5.5cm
  }

  .facts {
    margin: 0;
    padding: 0;
    font-size: 8pt;
    display: block
  }

  .facts li,
  .servings-control {
    display: flex;
    align-items: center;
    gap: .15cm;
    height: .42cm;
    margin: 0;
    padding: 0;
    line-height: 1
  }

  .fact-icon {
    display: inline-block;
    width: .45cm;
    text-align: center;
    flex: none
  }

  .servings-control {
    font-size: 8pt;
    margin-bottom: .12cm
  }

  .ingredients,
  .steps {
    margin: 0;
    padding: 0
  }

  .ingredients label,
  .steps label {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 400 !important;
    line-height: 1.25 !important
  }

  .ingredients-box {
    background: var(--primary) !important;
    color: #fff !important;
    border-radius: 3px;
    padding: .12cm .22cm;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact
  }

  .ingredients-box h2 {
    color: #fff;
    font-size: 8.5pt;
    margin: 0 0 .05cm 0;
    border-bottom: 1px solid rgba(255, 255, 255, .4)
  }

  .ing-group-title {
    font-weight: 700 !important;
    font-size: 8pt !important;
    color: #ffd6aa !important;
    margin-top: .08cm !important;
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
  }

  .ingredients li {
    padding: .5px 0 !important;
    border: 0 !important;
    font-size: 8.5pt !important;
    line-height: 1.25 !important;
    color: #fff !important;
    break-inside: avoid;
    text-decoration: none !important;
    opacity: 1 !important
  }

  .steps li {
    padding: 6px 0 !important;
    border-bottom: 1px dotted #ccc !important;
    font-size: 10pt !important;
    line-height: 1.4 !important;
    break-inside: avoid;
    text-decoration: none !important;
    opacity: 1 !important;
    counter-increment: s
  }

  .steps li::marker {
    font-weight: 700
  }

  .notes {
    background: #fafafa;
    border: 1px solid #ccc;
    border-left: 3px solid var(--accent);
    border-radius: 3px;
    padding: .15cm .35cm;
    margin: .15cm 0;
    font-size: 8pt;
    break-inside: avoid
  }

  .notes h2 {
    margin: 0 0 .05cm 0;
    font-size: 8.5pt;
    border-bottom: none
  }

  .note {
    margin: .05cm 0
  }

  a {
    color: #000;
    text-decoration: none
  }
}