/* Ro & Smag - shared styles. Mobile first: phone layout is the default,
   wider screens get extra columns further down. */

/* ------------------------------------------------------------------ Fonts */
@font-face {
  font-family: "Lexend";
  src: url("../fonts/lexend-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------------- Colours */
:root {
  --cream: #fdf6e3;
  --card: #ffffff;
  --border: #e6dcc3;
  --terracotta: #9a3b22;
  --terracotta-dark: #7c2e19;
  --green: #3e6b48;
  --green-dark: #2f5237;
  --gold: #b8741a;
  --notes: #fdf0d8;
  --chip: #f3ecda;
  --text: #2b2118;
  --muted: #5e5246;
  --focus: #1f5fbf;

  --radius-card: 18px;
  --radius-box: 14px;
  --touch: 48px;

  --font: "Lexend", system-ui, sans-serif;
  --text-size: 1.125rem; /* 18px - Settings will change this later */
  --line: 1.65;
}

/* "Extra-readable font" switch (Settings, phase 5) */
:root.font-readable {
  --font: "Atkinson Hyperlegible", system-ui, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  font-size: var(--root-size, 100%); /* "Tekststørrelse" in Settings scales everything */
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-size);
  line-height: var(--line);
  letter-spacing: 0.01em;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}
h1 {
  color: var(--terracotta);
  font-size: 1.9rem;
  font-weight: 700;
}
h2 {
  color: var(--green);
  font-size: 1.35rem;
  font-weight: 600;
}
h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--terracotta);
}

img {
  max-width: 100%;
  display: block;
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--card);
  padding: 10px 16px;
  border-radius: var(--radius-box);
  z-index: 10;
}
.skip-link:focus {
  top: 8px;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* ----------------------------------------------------------------- Layout */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
.page-narrow {
  max-width: 760px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--terracotta);
  text-decoration: none;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--touch);
  padding-right: 12px;
  color: var(--terracotta);
  font-weight: 600;
  text-decoration: none;
}

.section {
  margin-top: 32px;
}

/* ------------------------------------------------------------------ Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 10px 20px;
  border-radius: var(--radius-box);
  border: 2px solid var(--terracotta);
  background: var(--terracotta);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  background: var(--terracotta-dark);
  border-color: var(--terracotta-dark);
}
.btn-green {
  background: var(--green);
  border-color: var(--green);
}
.btn-green:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}
.btn-ghost {
  background: var(--card);
  color: var(--terracotta);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--chip);
  border-color: var(--border);
}
.btn-small {
  min-height: 44px;
  padding: 6px 14px;
  font-size: 1rem;
}
.btn-block {
  width: 100%;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn:disabled:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
}
.btn-green:disabled:hover {
  background: var(--green);
  border-color: var(--green);
}
.btn-ghost:disabled:hover {
  background: var(--card);
  border-color: var(--border);
}

.soon-badge {
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--chip);
  color: var(--muted);
  border-radius: 999px;
  padding: 1px 8px;
}

/* -------------------------------------------------------------- Tag chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--chip);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.95rem;
}
button.chip {
  border: 1px solid var(--border);
  min-height: 44px;
  padding: 6px 10px 6px 14px;
  cursor: pointer;
}
button.chip:hover {
  border-color: var(--terracotta);
}

/* ---------------------------------------------------------------- Avatar */
.avatar-link {
  display: inline-flex;
  border-radius: 50%;
  min-width: var(--touch);
  min-height: var(--touch);
  align-items: center;
  justify-content: center;
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.avatar-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 0.85rem;
}
.avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

/* ----------------------------------------------------------------- Stars */
.stars {
  display: inline-flex;
  gap: 1px;
  color: var(--gold);
  vertical-align: middle;
}
.star {
  width: 1.15em;
  height: 1.15em;
}

/* --------------------------------------------- The ONE shared dropdown style */
.dropdown {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  overflow: hidden;
}
.dropdown.is-open {
  border-color: var(--terracotta);
}
.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--touch);
  padding: 8px 14px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.dropdown-label {
  color: var(--muted);
}
.dropdown-value {
  font-weight: 600;
  flex: 1;
}
.chevron {
  transition: transform 0.15s;
  color: var(--terracotta);
}
.is-open > .dropdown-toggle .chevron,
.is-open .search-row .chevron {
  transform: rotate(180deg);
}
.dropdown-list {
  list-style: none;
  margin: 0;
  padding: 4px 0 8px;
  border-top: 1px solid var(--border);
  max-height: 320px;
  overflow-y: auto;
}
.dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.dropdown-option:hover,
.dropdown-option:focus-visible {
  background: var(--chip);
}
.dropdown-option[aria-pressed="true"] {
  font-weight: 600;
}
.option-check {
  width: 1.25em;
  height: 1.25em;
  color: var(--green);
  flex: none;
}

/* Search box (uses the same dropdown box) */
.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 0 14px;
  min-height: 52px;
}
.search-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  padding: 12px 0;
  outline: none;
}
.search-row:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
  border-radius: var(--radius-box);
}
.search-row .icon {
  color: var(--muted);
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  color: var(--terracotta);
}
.icon-button:hover {
  background: var(--chip);
}

/* Collapsible tag groups inside the dropdown */
.tag-group + .tag-group {
  border-top: 1px solid var(--border);
}
.tag-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  background: none;
  border: 0;
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
}
.tag-group-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}
.tag-group-list {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
}
.tag-count {
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: auto;
}

/* --------------------------------------------------------------- Notices */
.notice {
  padding: 14px 18px;
  border-radius: var(--radius-box);
  background: var(--card);
  border: 1px solid var(--border);
}
.notice-error {
  border-color: var(--terracotta);
  color: var(--terracotta-dark);
}
.muted {
  color: var(--muted);
}
.loading {
  color: var(--muted);
  padding: 24px 0;
}

/* ===================================================================== HOME */
.home-hero {
  text-align: center;
  padding: 8px 0 8px;
}
.home-hero h1 {
  font-size: 2.3rem;
  margin-bottom: 4px;
}
.home-hero p {
  color: var(--muted);
}

.home-search {
  max-width: 640px;
  margin: 0 auto;
}
.home-search .search-row {
  padding-right: 6px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 96px;
  padding: 16px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  color: var(--terracotta);
  font-weight: 600;
  text-decoration: none;
  height: 100%;
}
.tile:hover {
  border-color: var(--terracotta);
}
.tile-all {
  background: var(--chip);
}

.shortcuts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  color: var(--green);
  font-weight: 600;
  text-align: left;
}
.shortcut:disabled {
  cursor: not-allowed;
}
.shortcut:disabled > span:first-of-type {
  opacity: 0.7;
}
.shortcut .soon-badge {
  margin-left: auto;
}

/* ------------------------------------------------------------ Recipe cards */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.recipe-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.recipe-card:hover {
  border-color: var(--terracotta);
}
.card-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
/* No photo yet: a low strip instead of a big empty box */
.card-photo.photo-placeholder {
  aspect-ratio: 5 / 1;
}
.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip);
  color: var(--border);
}
.placeholder-icon {
  width: 40%;
  height: 40%;
  max-width: 96px;
  max-height: 96px;
  color: #d9ccaa;
}
.recipe-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recipe-card h3 {
  color: var(--terracotta);
  margin: 0;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--muted);
  font-size: 0.95rem;
}
.meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ================================================================ BROWSE */
.browse-tools {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}
.picked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.result-count {
  color: var(--muted);
  margin: 0 0 12px;
}
.link-button {
  background: none;
  border: 0;
  color: var(--terracotta);
  text-decoration: underline;
  min-height: 44px;
  padding: 0 8px;
  cursor: pointer;
}

/* ================================================================ RECIPE */
.recipe-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-card);
}
.recipe-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.recipe-title-row h1 {
  margin: 0;
}
.recipe-tags {
  margin: 12px 0 0;
}

.ratings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin-top: 16px;
}
.rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.rating-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 16px 0 0;
}
.facts div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.facts dt {
  color: var(--muted);
}
.facts dt::after {
  content: ":";
}
.facts dd {
  margin: 0;
  font-weight: 600;
}

.recipe-panel {
  display: grid;
  gap: 4px;
  margin-top: 20px;
  padding: 8px 16px;
}
.panel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}
.panel-row + .panel-row {
  border-top: 1px solid var(--border);
}

.gadgets-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  background: none;
  border: 0;
  padding: 4px 0;
  text-align: left;
  cursor: pointer;
}
.gadgets-toggle .label {
  color: var(--muted);
}
.gadgets-toggle .value {
  flex: 1;
  font-weight: 600;
}
.gadgets-static {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.gadget-list {
  padding: 4px 0 12px;
}

/* Switch ("Hold skærmen tændt") */
.switch-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  background: none;
  border: 0;
  padding: 4px 0;
  text-align: left;
  cursor: pointer;
}
.switch-row:disabled {
  cursor: not-allowed;
}
.switch-text {
  flex: 1;
  display: grid;
}
.switch-text strong {
  font-weight: 600;
}
.switch-text small {
  color: var(--muted);
  font-size: 0.9rem;
}
.switch {
  position: relative;
  flex: none;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  background: #cfc6b3;
  transition: background 0.15s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
[aria-checked="true"] .switch {
  background: var(--green);
}
[aria-checked="true"] .switch::after {
  transform: translateX(24px);
}
.switch-row:disabled .switch {
  opacity: 0.5;
}

/* Servings stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stepper-label {
  color: var(--muted);
  flex: 1;
}
.stepper-value {
  min-width: 7em;
  text-align: center;
  font-weight: 700;
  font-size: 1.15rem;
}
.stepper button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--terracotta);
  background: var(--card);
  color: var(--terracotta);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.stepper button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Ingredients */
.ingredient-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ingredient {
  border-bottom: 1px solid var(--border);
}
.ingredient:last-child {
  border-bottom: 0;
}
.ingredient label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 56px;
  padding: 12px 0;
  cursor: pointer;
}
.ingredient input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 28px;
  height: 28px;
  margin: 0;
  border: 2px solid var(--green);
  border-radius: 8px;
  background: var(--card);
  display: grid;
  place-content: center;
  cursor: pointer;
}
.ingredient input[type="checkbox"]::after {
  content: "";
  width: 14px;
  height: 8px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}
.ingredient input[type="checkbox"]:checked {
  background: var(--green);
}
.ingredient input[type="checkbox"]:checked::after {
  opacity: 1;
}
.ingredient-text {
  flex: 1;
}
.amount {
  font-weight: 700;
}
.ingredient input:checked ~ .ingredient-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.linked-product {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 12px 42px;
  padding: 6px 12px 6px 6px;
  background: var(--chip);
  border-radius: 12px;
  font-size: 0.95rem;
  width: fit-content;
}
.linked-product img,
.linked-product .photo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}
.linked-product .placeholder-icon {
  width: 24px;
  height: 24px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* Notes (above the steps) */
.notes-panel {
  background: var(--notes);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  white-space: pre-line;
}
.notes-panel h2 {
  margin-bottom: 6px;
}

/* Steps */
.step-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.step-button {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 16px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  line-height: var(--line);
}
.step-number {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--green);
  color: var(--green);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.step-text {
  flex: 1;
  white-space: pre-line;
}
.step-button[aria-pressed="true"] {
  background: #f4f7f2;
}
.step-button[aria-pressed="true"] .step-number {
  background: var(--green);
  color: #fff;
}
.step-button[aria-pressed="true"] .step-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.step-timer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0 16px 16px 66px;
}
.timer-display {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.3rem;
  min-width: 4.5em;
}
.timer-done {
  color: var(--terracotta);
  font-weight: 700;
}
.step.is-ringing {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px var(--terracotta);
}

.cooked-row {
  margin-top: 24px;
}

/* ================================================================== LOGIN */
.login-card {
  max-width: 440px;
  margin: 24px auto 0;
}
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}
.field label {
  font-weight: 600;
}
.input {
  width: 100%;
  min-height: var(--touch);
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid #c9bc9c;
  border-radius: var(--radius-box);
}
.password-box {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border: 1px solid #c9bc9c;
  border-radius: var(--radius-box);
  overflow: hidden;
}
.password-box .input {
  border: 0;
  border-radius: 0;
}
.password-box:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.password-box .input:focus-visible {
  outline: none;
}
.password-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 88px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--chip);
  color: var(--terracotta);
  font-weight: 600;
  cursor: pointer;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--touch);
  margin-bottom: 18px;
  cursor: pointer;
}
.check-row input {
  width: 24px;
  height: 24px;
  accent-color: var(--green);
}
.form-error {
  margin-bottom: 16px;
}
.login-links {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  justify-items: center;
}
.forgot-help {
  margin-top: 4px;
  background: var(--notes);
  border-radius: var(--radius-box);
  padding: 12px 16px;
}

/* ============================================================ PHASE 3 */
.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.title-row h1 {
  margin: 0;
}
.shortcut-primary {
  color: #fff;
  background: var(--terracotta);
  border-color: var(--terracotta);
  text-decoration: none;
}
.shortcut-primary:hover {
  background: var(--terracotta-dark);
}

.btn-danger {
  background: var(--card);
  color: #a3261b;
  border-color: #a3261b;
}
.btn-danger:hover {
  background: #a3261b;
  border-color: #a3261b;
  color: #fff;
}

/* ------------------------------------------------------------ Form parts */
.recipe-form {
  display: grid;
  gap: 16px;
}
.form-card {
  display: grid;
  gap: 4px;
}
.field-label {
  font-weight: 600;
  margin: 0;
}
.field-help {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}
.field-error {
  color: #a3261b;
  font-weight: 600;
  margin: 0;
}
.input[aria-invalid="true"] {
  border-color: #a3261b;
  border-width: 2px;
}
.fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
  min-width: 0;
}
.fieldset legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 8px;
}
.form-card > .fieldset legend {
  color: var(--green);
  font-size: 1.2rem;
}
.textarea {
  resize: vertical;
  min-height: 88px;
  line-height: var(--line);
}
.input-short {
  max-width: 7em;
}
.input-medium {
  max-width: 14em;
}
.inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.inline-row .input {
  flex: 1;
  min-width: 10em;
}
.tag-chips {
  margin-bottom: 4px;
}
.notes-field .textarea {
  background: var(--notes);
}

.makes-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.makes-row .field {
  margin-bottom: 0;
}
.makes-unit {
  flex: 1;
  min-width: 14em;
}

/* Gadget multi-select: the list scrolls inside a fixed height */
.dropdown-panel {
  border-top: 1px solid var(--border);
}
.dropdown-panel .search-row {
  border-bottom: 1px solid var(--border);
}
.check-list {
  border-top: 0;
  height: 240px;
  max-height: 240px;
}
.check-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 14px;
  cursor: pointer;
}
.check-option:hover {
  background: var(--chip);
}
.check-option input {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
  flex: none;
}
.add-option {
  color: var(--terracotta);
  font-weight: 600;
}
.list-empty {
  padding: 10px 14px;
}

/* Rows: ingredients and steps */
.edit-rows {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 10px;
}
.edit-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fffdf7;
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
}
.edit-row .input,
.quick-row .input {
  padding-left: 10px;
  padding-right: 10px;
}
.ingredient-row {
  grid-template-columns: 8em 1fr;
  grid-template-areas:
    "amount unit"
    "name name"
    "buttons buttons"
    "panel panel";
}
.row-amount {
  grid-area: amount;
}
.row-unit {
  grid-area: unit;
}
.row-name {
  grid-area: name;
}
.row-buttons {
  grid-area: buttons;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.row-buttons .icon-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.row-buttons .remove-row {
  color: #a3261b;
}
.row-header {
  display: none;
}
.step-row {
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "num text"
    "num timer"
    "buttons buttons";
  align-items: start;
}
.step-row .step-number {
  grid-area: num;
  margin-top: 6px;
}
.row-text {
  grid-area: text;
}
.row-timer {
  grid-area: timer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.row-label {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Photo */
.photo-preview {
  width: 100%;
  max-width: 420px;
  margin: 6px 0 10px;
}
.photo-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-box);
}
.photo-preview .photo-placeholder {
  aspect-ratio: 5 / 2;
  border-radius: var(--radius-box);
}
.file-input:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  bottom: 0;
  padding: 12px 0;
  background: linear-gradient(to top, var(--cream) 75%, rgba(253, 246, 227, 0));
}
.form-actions .btn {
  flex: 1;
  min-width: 8em;
  white-space: nowrap;
}
.form-actions .btn[type="submit"] {
  flex: 2;
}

/* Delete */
.delete-section {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.delete-confirm {
  border-color: #a3261b;
}

/* Tags used before: tap to add */
.tag-suggestion-box {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}
.tag-suggestions {
  max-height: 168px;
  overflow-y: auto;
  padding: 2px;
}
button.chip-suggestion {
  background: var(--card);
  border: 1px dashed #c9bc9c;
  padding: 6px 14px 6px 10px;
  color: var(--text);
}
button.chip-suggestion .icon {
  width: 1em;
  height: 1em;
  color: var(--green);
}

/* Optional step: tick box in the form, label on the recipe page */
.row-timer {
  flex-wrap: wrap;
}
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  color: var(--muted);
}
.check-inline input {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}
.optional-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  vertical-align: 2px;
  text-decoration: none;
}
.step.is-optional {
  border-style: dashed;
  border-color: #c9bc9c;
}

/* ------------------------------------------------------------- Tabs (Ny) */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  flex: 1;
  min-height: var(--touch);
  padding: 10px 12px;
  background: none;
  border: 0;
  border-bottom: 4px solid transparent;
  margin-bottom: -2px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  color: var(--terracotta);
  border-bottom-color: var(--terracotta);
}
.tab-panel {
  display: grid;
  gap: 16px;
}
.paste-box {
  min-height: 200px;
  font-size: 1rem;
}
.prompt-card summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
}
.prompt-text {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--chip);
  border-radius: var(--radius-box);
  padding: 12px 14px;
  margin: 10px 0;
}

/* --------------------------------------------------------------- Stars */
.star-picker {
  display: inline-flex;
  gap: 2px;
}
.star-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--gold);
  cursor: pointer;
}
.star-button:hover {
  background: var(--chip);
}
.star-button .star {
  width: 30px;
  height: 30px;
}
.star-picker-large .star-button {
  min-width: 56px;
  min-height: 56px;
}
.star-picker-large .star {
  width: 42px;
  height: 42px;
}
.rating-toggle {
  min-height: 44px;
  padding: 0;
  font-size: 0.95rem;
}
.rate-panel {
  margin-top: 12px;
  display: grid;
  justify-items: start;
  gap: 4px;
}
.rate-title {
  margin: 0;
}
.rating-status {
  margin: 4px 0 0;
  min-height: 1em;
}

/* ------------------------------------------------- Cooked today, quick add */
.cooked-feedback {
  margin-top: 10px;
}
.cooked-status {
  margin: 0;
  font-weight: 600;
  color: var(--green);
}
.quick-add {
  margin-top: 12px;
}
.quick-add h3 {
  color: var(--green);
}
.quick-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 5.5em 6.5em 1fr;
  grid-template-areas:
    "amount unit unit"
    "name name name"
    "submit submit submit";
}
.quick-row .btn {
  grid-area: submit;
  justify-self: start;
}

/* ============================================================ PHASE 4 */
.status-line {
  margin: 8px 0 0;
  min-height: 1em;
}
.tag-group-title {
  margin: 0;
  padding: 8px 14px 2px;
  color: var(--green);
  font-weight: 600;
}

/* ------------------------------------------------------- Product list */
.product-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
}
.product-group-heading {
  margin: 0;
  font-size: 1.1rem;
}
.product-group-toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name chevron" "meta chevron";
  align-items: center;
  gap: 0 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 16px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.product-group-toggle .group-name {
  grid-area: name;
  color: var(--terracotta);
  font-weight: 700;
}
.product-group-toggle .group-meta {
  grid-area: meta;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}
.product-group-toggle .chevron {
  grid-area: chevron;
}
.product-group-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}
.product-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px;
}
.section .product-list {
  padding: 0;
}
.product-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-top: 1px solid var(--border);
}
.section .product-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  background: var(--card);
  margin-bottom: 8px;
}
.product-row.is-favourite {
  background: #fff8ea;
}
.product-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
  padding: 4px;
}
.product-link:hover .product-name {
  text-decoration: underline;
}
.product-thumb {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
}
.product-thumb.photo-placeholder .placeholder-icon {
  width: 32px;
  height: 32px;
}
.product-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.product-name {
  overflow-wrap: anywhere; /* boxes grow with their text */
}
.product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.9rem;
}
.product-meta .chip {
  font-size: 0.85rem;
  padding: 2px 10px;
}
.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--muted);
}
.rating-favorit {
  color: var(--gold);
}
.rating-ogsaa_god {
  color: var(--green);
}
.rating-spring_over {
  color: #a3261b;
}
.badge-star {
  width: 1em;
  height: 1em;
  fill: currentColor;
}
.star-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--gold);
  cursor: pointer;
}
.star-toggle .star-icon {
  width: 26px;
  height: 26px;
}
.star-toggle[aria-pressed="true"] {
  border-color: var(--gold);
  cursor: default;
}
.star-toggle[aria-pressed="true"] .star-icon {
  fill: currentColor;
}

/* ----------------------------------------------------- Product details */
.product-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-box);
  overflow: hidden;
  background: var(--card);
}
.segment {
  min-height: 48px;
  padding: 8px 16px;
  border: 0;
  border-right: 1px solid var(--border);
  background: none;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.segment:last-child {
  border-right: 0;
}
.segment[aria-pressed="true"] {
  background: var(--green);
  color: #fff;
}
.segment.is-pending {
  outline: 3px dashed var(--terracotta);
  outline-offset: -5px;
  color: var(--terracotta);
}
.ask-panel {
  margin-top: 12px;
}
.product-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
}
.product-facts div {
  display: contents;
}
.link-list {
  margin: 0;
  padding-left: 1.2em;
}
.link-list li {
  margin-bottom: 6px;
}
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.history-entry {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.history-head {
  margin: 0;
}
.history-note {
  margin: 4px 0 0;
  background: var(--chip);
  border-radius: 10px;
  padding: 6px 12px;
}
a.linked-product {
  color: inherit;
  text-decoration: none;
}
a.linked-product:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------- Add / edit product */
.type-panel {
  margin: 4px 0 12px 36px;
}
.type-list {
  height: 220px;
  max-height: 220px;
}
.radio-option {
  padding-left: 0;
}
.radio-option input,
.check-option input[type="radio"] {
  accent-color: var(--green);
}

/* ------------------------------------------------------- Shopping list */
.add-item {
  margin: 16px 0;
}
.add-item-row {
  display: grid;
  gap: 0 12px;
  grid-template-columns: 1fr;
}
.more-options summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
}
.more-options-body {
  display: grid;
  gap: 4px;
  padding-top: 4px;
}
.add-item .btn-green {
  justify-self: start;
  margin-top: 8px;
}
.list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 16px;
}
.shop-store {
  margin-bottom: 16px;
  padding: 12px 16px;
}
.shop-store-heading {
  color: var(--terracotta);
  margin: 0 0 4px;
}
.shop-section-heading {
  color: var(--green);
  font-size: 1rem;
  margin: 12px 0 2px;
}
.shop-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.shop-item {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.shop-item:last-child {
  border-bottom: 0;
}
.shop-item-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0;
  min-height: 56px;
  cursor: pointer;
}
.shop-item-main input {
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  accent-color: var(--green);
}
.shop-item-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.shop-item-name {
  overflow-wrap: anywhere;
}
.shop-item-version {
  color: var(--green);
  font-size: 0.9rem;
}
.shop-item-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}
.shop-item.is-ticked .shop-item-name {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.shop-basket {
  background: #f7f3e8;
}
.basket-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* -------------------------------------- Link an ingredient to a product */
.row-buttons .row-link {
  margin-right: auto; /* link on the left, arrows + bin on the right */
  min-width: 0;
  flex: 0 1 auto;
}
.link-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px dashed #c9bc9c;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.link-toggle.is-linked {
  border-style: solid;
  border-color: var(--green);
  color: var(--green);
  font-weight: 600;
}
.link-toggle span {
  overflow-wrap: anywhere;
}
.link-panel {
  grid-area: panel;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-box);
  background: var(--chip);
}
.link-types {
  height: 180px;
  max-height: 180px;
  background: var(--card);
}
.version-fieldset {
  margin: 0;
}
.version-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
}
.scope-question {
  border: 2px solid var(--terracotta);
  border-radius: var(--radius-box);
  background: var(--card);
  padding: 12px;
}
.scope-question .field-label {
  margin-bottom: 8px;
}

/* =========================================== Phase 4 follow-up changes */
/* Photos use the same frames as the crop window: recipes 4:3, products square */
.recipe-photo {
  aspect-ratio: 4 / 3;
}
.product-photo {
  display: block;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: #fff;
}
.product-thumb,
.shop-photo {
  background: #fff;
}

/* Edit product: square photo preview */
.photo-preview.is-square {
  max-width: 280px;
}
.photo-preview.is-square img,
.photo-preview.is-square .photo-placeholder {
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid var(--border);
}

/* Edit product: the type box */
.type-fieldset {
  margin: 0;
}
.type-fieldset legend {
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.type-fieldset .radio-option {
  padding-left: 0;
}

/* Tags on product rows */
.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip-tag {
  font-size: 0.8rem;
  padding: 1px 10px;
}

/* "Køb 2 × 400 g" next to a linked product */
.buy-packs {
  color: var(--green);
}

/* Shopping list row: [tick] [photo] [text] [who] [bin] */
.shop-item {
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.shop-tick {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-left: -8px;
  border-radius: 12px;
  cursor: pointer;
}
.shop-tick:hover {
  background: var(--chip);
}
.shop-tick input {
  width: 28px;
  height: 28px;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}
.shop-who {
  flex: none;
  width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.shop-when {
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--muted);
}
.shop-photo {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.shop-item-text {
  flex: 1;
}
.shop-item-version {
  font-size: 0.85rem;
}

/* "Tilpas billedet" crop window */
.crop-dialog {
  border: 0;
  border-radius: var(--radius-card);
  padding: 20px;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  background: var(--cream);
  color: var(--text);
}
.crop-dialog::backdrop {
  background: rgba(43, 33, 24, 0.6);
}
.crop-dialog h2 {
  color: var(--terracotta);
}
.crop-frame {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}
.crop-canvas {
  border-radius: 12px;
  border: 2px solid var(--terracotta);
  touch-action: none; /* dragging moves the photo, not the page */
  cursor: grab;
  background: #fff;
}
.crop-canvas:active {
  cursor: grabbing;
}
.crop-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.crop-slider {
  flex: 1;
  min-height: 44px;
  accent-color: var(--terracotta);
}
.crop-presets {
  margin: 4px 0 8px;
}
.crop-actions {
  position: static;
  background: none;
  padding: 0;
}

/* ============================================================ PHASE 5 */
.settings {
  display: grid;
  gap: 16px;
}
a.shortcut,
.avatar-link {
  text-decoration: none;
}
.settings-card h2 {
  margin-bottom: 12px;
}
.settings-card .field-label {
  margin-bottom: 8px;
}
.who-card {
  display: flex;
  align-items: center;
  gap: 14px;
}
.who-card .avatar {
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
}
/* The three size buttons show their own size (in px, so they don't scale themselves) */
.segment-size-small {
  font-size: 16px;
}
.segment-size-normal {
  font-size: 18px;
}
.segment-size-large {
  font-size: 21px;
}
.settings-preview {
  margin: 14px 0 8px;
  padding: 12px 16px;
  background: var(--notes);
  border-radius: var(--radius-box);
}

.share-row {
  margin-top: 12px;
}
.share-panel {
  margin-top: 12px;
  display: grid;
  gap: 4px;
}

.guest-notice {
  margin: 20px auto 0;
  max-width: 640px;
  text-align: center;
}
.inbox {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.inbox-item {
  display: grid;
  gap: 8px;
  border-color: var(--green);
  border-width: 2px;
}
.inbox-item h3 {
  color: var(--terracotta);
  margin: 0;
}
.inbox-message {
  margin: 0;
  font-style: italic;
}

/* ===================================================== Wider screens */
@media (min-width: 600px) {
  .tiles {
    grid-template-columns: repeat(3, 1fr);
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .shortcuts {
    grid-template-columns: 1fr 1fr;
  }
  .browse-tools {
    grid-template-columns: 1fr minmax(220px, 300px);
    align-items: start;
  }
  .browse-tools .picked,
  .browse-tools .picked-wrap {
    grid-column: 1 / -1;
  }

  /* Ingredient rows on one line, with a header above */
  .ingredient-row {
    grid-template-columns: 6em 7em 1fr;
    grid-template-areas:
      "amount unit name"
      "buttons buttons buttons"
      "panel panel panel";
    align-items: center;
  }
  .add-item-row {
    grid-template-columns: 2fr 1fr;
  }
  .row-header {
    display: grid;
    grid-template-columns: 6em 7em 1fr;
    gap: 8px;
    padding: 0 11px 4px;
    color: var(--muted);
    font-size: 0.9rem;
  }
  .step-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "num text buttons"
      "num timer buttons";
  }
  .row-buttons {
    align-self: start;
  }
  .quick-row {
    grid-template-columns: 6em 7em 1fr auto;
    grid-template-areas: "amount unit name submit";
  }
}

@media (min-width: 960px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
  h1 {
    font-size: 2.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ----------------------------------------- After phase 5: origin + history */
/* "Fra Lerhusene" in the top-right corner of the photo of a shared recipe/product */
.photo-frame {
  position: relative;
}
.product-photo-frame {
  max-width: 360px;
}
.photo-frame > img {
  display: block;
}
.origin-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 14px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--green);
  color: var(--green);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.4;
}
.photo-frame .origin-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
  max-width: calc(100% - 20px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

/* Inbox: small "Opskrift" / "Produkt" label above the name */
.inbox-kind {
  margin: 0;
  color: var(--green);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Product history with more than 3 changes: a box that shows the 3 newest changes
   and scrolls for the rest. product.js measures the exact height; this max-height
   (3 x a one-line change + a one-line note) is only the starting guess. */
.history-scroll {
  position: relative; /* so product.js can measure the entries from the box's top */
  box-sizing: content-box;
  max-height: calc(3 * (2 * var(--line) * 1em + 16px) + 2 * 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}
.history-scroll:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
}
.history-more {
  margin: 8px 0 0;
}
.history-entry .avatar-small {
  flex: none; /* don't let a long line squeeze the avatar */
}