/* The Cookie Company workspace. Brand colours and the Agharti display face come from the website. */

@font-face {
  font-family: "Agharti";
  src: url("/fonts/agharti.woff2") format("woff2");
  font-weight: 1 100;
  font-display: swap;
}

:root {
  --dark: #362618;
  --dark-2: #4a3626;
  --muted: #6f5a49; /* 6.2:1 on cream */
  --cream: #fefae7;
  --paper: #fffdf5;
  --butter: #ffffa8;
  --butter-soft: #fffbd2;
  --baby: #d5ebf8;
  --caramel: #b4521b; /* 4.9:1 on cream */
  --caramel-soft: #fbe5d6;
  --caramel-ink: #8f3f12;
  --green-ink: #3f6b1f;
  --danger: #a3301c;
  --line: rgba(54, 38, 24, 0.11);
  --line-strong: rgba(54, 38, 24, 0.24);
  --shadow: 0 1px 2px rgba(54, 38, 24, 0.05), 0 8px 28px rgba(54, 38, 24, 0.06);
  --display: "Agharti", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --text: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --wide: "wght" 84, "wdth" 100;
  --radius: 14px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --top: 64px;   /* the top bar, which stays at the top of the window (0 on a phone, where it scrolls away) */
  --rail: 70px;  /* the menu of icons */
  --menu: 240px; /* a page's own menu, beside the rail */
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 48px); } /* clear of the top bar and a table's head */
body {
  margin: 0;
  background: var(--cream);
  color: var(--dark);
  font: 400 14px/1.45 var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--caramel); outline-offset: 2px; }
::selection { background: var(--butter); color: var(--dark); }

.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 { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 14px; border-radius: 10px; background: var(--butter); color: var(--dark); font-weight: 600; }
.skip:focus { top: 12px; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dim { color: var(--muted); }

/* ---------------------------------------------------------------- shell */

/* The rail of icons runs the full height of the window on the left. Beside it: the top bar, and the page under it. */
.shell {
  --gutter: clamp(20px, 4vw, 56px);
  display: grid; min-height: 100vh;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "rail top" "rail main";
}

/* The top bar: the page's title (above the page's own menu), its search and its buttons. */
.topbar {
  grid-area: top;
  position: sticky; top: 0; z-index: 7;
  display: grid; align-items: center;
  height: var(--top);
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper);
}
.topbar__page { display: grid; grid-template-columns: var(--menu) minmax(0, 1fr) auto; align-items: center; min-width: 0; }
.topbar__title {
  margin: 0; padding: 0 12px 0 20px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 400 32px/1.1 var(--display); font-variation-settings: var(--wide); letter-spacing: 1.5px; text-transform: lowercase;
}
.topbar__title a { text-decoration: none; transition: color 0.15s; }
.topbar__title a:hover { color: var(--caramel-ink); }
/* a recipe's top bar: "recipes / its name" and its type, where a list has its search */
.topbar__page:has(.topbar__recipe) { grid-template-columns: auto minmax(0, 1fr) auto; }
.topbar__title--back { color: var(--muted); }
.topbar__recipe { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__recipe::before { content: "/"; color: var(--line-strong); font: 400 32px/1 var(--display); }
.topbar__name {
  min-width: 0; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 400 32px/1.1 var(--display); font-variation-settings: var(--wide); letter-spacing: 1.5px; text-transform: lowercase;
}
.topbar__kind { flex: none; margin: 0; }
.topbar__kind:empty { display: none; }
.topbar .search { margin-left: var(--gutter); max-width: 500px; }
.topbar__actions { display: flex; align-items: center; gap: 8px; padding: 0 var(--gutter) 0 16px; }
.topbar .btn { height: 40px; }

/* The rail: a 70px column, the logo at the top (level with the top bar), then the icons. Each icon's name shows
   beside it on hover and on keyboard focus. */
.sidebar {
  grid-area: rail; align-self: start;
  position: sticky; top: 0; z-index: 6; height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: calc((var(--top) - 48px) / 2) 0 14px;
  background: var(--dark); color: var(--cream);
}
.sidebar :focus-visible { outline-color: var(--butter); }
.brand {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; margin-bottom: 22px;
  border-radius: 14px; transition: background-color 0.15s;
}
.brand:hover { background: rgba(255, 255, 168, 0.1); }
.brand img { display: block; width: 40px; height: 40px; }
.nav { display: grid; gap: 8px; }
.nav__link {
  position: relative; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 14px;
  color: rgba(254, 250, 231, 0.72); text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.nav__link .icon { width: 22px; height: 22px; }
.nav__link:hover { background: rgba(255, 255, 168, 0.1); color: var(--cream); }
.nav__link[aria-current="page"] { background: var(--butter); color: var(--dark); }
.nav__label {
  position: absolute; left: calc(100% + 14px); top: 50%;
  padding: 6px 11px; border-radius: 8px;
  background: var(--dark); color: var(--cream); box-shadow: 0 6px 22px rgba(54, 38, 24, 0.28);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  opacity: 0; transform: translate(-4px, -50%); pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
}
.nav__link:hover .nav__label, .nav__link:focus-visible .nav__label { opacity: 1; transform: translate(0, -50%); }

.main { grid-area: main; min-width: 0; padding: 44px var(--gutter) 96px; outline: none; }

/* ---------------------------------------------------------------- search, a list's head */

.search { position: relative; min-width: 0; margin: 0; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 40px 0 40px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--cream);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.search input:hover { border-color: rgba(54, 38, 24, 0.36); }
.search input:focus-visible { outline: none; border-color: var(--caramel); background: #fff; box-shadow: 0 0 0 3px rgba(180, 82, 27, 0.18); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search__key {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  min-width: 20px; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 6px;
  color: var(--muted); font: 600 11px/1.4 var(--text); text-align: center; background: var(--cream);
}
.search input:not(:placeholder-shown) ~ .search__key, .search input:focus ~ .search__key { display: none; }

/* Above a list: what it shows (the part chosen in the menu) and how many, then its filters */
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 42px; margin-bottom: 16px; }
.list-head__meta { min-height: 1.45em; margin: 0; color: var(--muted); }
.list-head__meta strong { color: var(--dark); font-weight: 700; }
.list-head__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }

.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); }
.segmented button {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-weight: 600; transition: background-color 0.15s, color 0.15s;
}
.segmented button:hover { color: var(--dark); }
.segmented button[aria-pressed="true"] { background: var(--dark); color: var(--cream); }
.segmented__count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--caramel-soft); color: var(--caramel-ink); font-size: 12px; line-height: 20px; text-align: center; }
.segmented__count:empty { display: none; }
.segmented button[aria-pressed="true"] .segmented__count { background: var(--butter); color: var(--dark); }

.sort { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.sort select {
  height: 42px; padding: 0 34px 0 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f5a49' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
  color: var(--dark); font-weight: 600; appearance: none;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 999px;
  font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn .icon { width: 17px; height: 17px; }
.btn--primary { background: var(--dark); color: var(--cream); }
.btn--primary:hover { background: var(--dark-2); }
.btn--primary:disabled { opacity: 0.6; }
.btn--quiet { border-color: var(--line-strong); background: var(--paper); color: var(--dark); }
.btn--quiet:hover { background: var(--butter-soft); border-color: rgba(54, 38, 24, 0.36); }
.btn--danger { border-color: rgba(163, 48, 28, 0.35); background: transparent; color: var(--danger); }
.btn--danger:hover { background: rgba(163, 48, 28, 0.07); }
.btn--danger.is-confirming { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--small { height: 32px; padding: 0 13px; font-size: 13px; }
.btn--squeeze { position: relative; } /* on a narrower screen it keeps only its icon: see "smaller screens" */

.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover:not(:disabled) { background: var(--butter-soft); color: var(--dark); }
.icon-btn:disabled { opacity: 0.3; }

/* ---------------------------------------------------------------- the list */

.sheet {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: clip;
  container-type: inline-size; /* its table drops the optional columns when the sheet itself is narrow */
}

.grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.grid thead th {
  position: sticky; top: var(--top); z-index: 1; /* under the top bar */
  padding: 13px 18px;
  background: var(--paper); color: var(--muted);
  box-shadow: inset 0 -1px 0 var(--line-strong); /* a border would stay behind when the row sticks */
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; text-align: left; white-space: nowrap;
}
.grid td, .grid tbody th { padding: 11px 18px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; font-weight: 400; }
.grid .num { text-align: right; white-space: nowrap; }
.grid thead th.num { text-align: right; }

.row { cursor: pointer; transition: background-color 0.12s; }
.row:hover { background: var(--butter-soft); }
.row > th { font-weight: 600; }
.row__open {
  padding: 0; border: 0; background: none; text-align: left;
  font-weight: 650; color: var(--dark);
}
.row__open:focus-visible { outline-offset: 4px; border-radius: 3px; }
.row__note { display: block; margin-top: 1px; color: var(--caramel-ink); font-size: 12.5px; font-weight: 400; } /* a recipe whose cost isn't complete */
.row__category { color: var(--muted); }
.row__status { display: none; margin-left: 6px; }

/* A list (Ingredients, Recipes): compact rows, the cost per kg beside the cost per g, and the first and last
   columns lined up with the text above the list */
.sheet .grid { font-size: 13px; }
.sheet .grid thead th { padding: 10px 14px; font-size: 11px; }
.sheet .grid td, .sheet .grid tbody th { padding: 7px 14px; }
.sheet .grid :is(th, td):first-child { padding-left: var(--gutter); }
.sheet .grid :is(th, td):last-child { padding-right: var(--gutter); }
.sheet .cost__bulk { display: inline; margin-left: 6px; font-size: 12px; }
.sheet .row__note { font-size: 12px; }
.sheet .tag { padding: 0 8px; font-size: 11.5px; line-height: 18px; }
.row--flash { animation: flash 1.8s var(--ease-out); }
@keyframes flash { 0%, 35% { background: var(--butter); } }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--caramel-soft); color: var(--caramel-ink); font-size: 12px; font-weight: 700;
}
.tag--production { background: #e2efd4; color: var(--green-ink); } /* a recipe made for sale */
.tag--research { background: var(--baby); color: #1f4d6b; } /* a recipe still being worked on */
.cost { font-weight: 650; }
.cost__per { color: var(--muted); font-weight: 400; }
.cost__bulk { display: block; color: var(--muted); font-size: 12px; }

.state { display: grid; justify-items: center; gap: 10px; padding: 72px 24px; text-align: center; }
.state__title { margin: 0; font: 400 32px/1 var(--display); font-variation-settings: var(--wide); letter-spacing: 1px; text-transform: lowercase; }
.state__text { margin: 0; max-width: 46ch; color: var(--muted); }
.state__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }

/* ---------------------------------------------------------------- a page with its own menu on the left */

/* .split holds the menu, then what the page shows (a list's head and its sheet, or a recipe), in that order: the
   order on a phone, where the menu becomes a row of chips at the top. On a wide screen the menu takes the left
   column, under the page's title in the top bar. */
.main:has(> .split) { padding: 0; }
.split { display: grid; grid-template-columns: var(--menu) minmax(0, 1fr); grid-template-rows: auto 1fr; }
.split > :not(.submenu) { grid-column: 2; min-width: 0; margin-inline: var(--gutter); }
.split > .submenu + * { margin-top: 26px; }
.split > .sheet { align-self: start; margin: 0 0 96px; border-width: 1px 0; border-radius: 0; box-shadow: none; } /* the full width beside the menu */

.submenu {
  grid-column: 1; grid-row: 1 / -1; align-self: start;
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; overscroll-behavior: contain;
  padding: 26px 10px 28px;
  border-right: 1px solid var(--line); background: var(--paper);
}
.submenu__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 2px 8px 10px; } /* the same with or without an Edit button */
.submenu__title { margin: 0; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.submenu__edit {
  height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: none;
  color: var(--caramel-ink); font-size: 13px; font-weight: 700;
}
.submenu__edit:hover { background: var(--butter-soft); }
.submenu__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.submenu__all { margin-bottom: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.submenu__link {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; border-radius: 10px;
  color: var(--dark); font-weight: 600; line-height: 1.25; text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.submenu__link:hover { background: var(--butter-soft); }
/* the part on screen ("page"), or on a recipe's page the recipe's own type ("true") */
.submenu__link:not([aria-current="false"]) { background: var(--dark); color: var(--cream); }
.submenu__link.is-empty[aria-current="false"] { color: var(--muted); font-weight: 400; } /* nothing in it matches */
.submenu__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.submenu__count { color: var(--muted); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.submenu__link:not([aria-current="false"]) .submenu__count { color: var(--butter); }

.submenu__row { display: flex; align-items: center; min-height: 38px; padding: 3px 2px 3px 10px; border-radius: 10px; }
.submenu__row:hover { background: var(--butter-soft); }
.submenu__row .submenu__name { font-weight: 600; line-height: 1.25; }
.submenu__row .icon-btn { width: 28px; height: 28px; }
.submenu__row .icon-btn:hover:not(:disabled) { background: var(--butter); }
.submenu__hint { margin: 14px 10px 0; color: var(--muted); font-size: 12.5px; }

.rename { display: grid; gap: 8px; padding: 6px 2px 10px; }
.rename input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; font-weight: 600;
}
.rename input:focus-visible { outline: none; border-color: var(--caramel); box-shadow: 0 0 0 3px rgba(180, 82, 27, 0.18); }
.rename__actions { display: flex; gap: 6px; }

/* ---------------------------------------------------------------- the editor panel */

body:has(dialog[open]) { overflow: hidden; } /* the list stays put behind an open panel */

.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(480px, 100%); max-width: 100%; height: 100vh; height: 100dvh; max-height: none;
  padding: 0; border: 0; overflow: hidden;
  background: var(--cream); color: var(--dark);
  box-shadow: -18px 0 60px rgba(54, 38, 24, 0.22);
}
.drawer[open] { animation: slide-in 0.26s var(--ease-out); }
.drawer::backdrop { background: rgba(54, 38, 24, 0.4); animation: fade-in 0.2s ease-out; }
@keyframes slide-in { from { transform: translateX(36px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

.editor { display: flex; flex-direction: column; height: 100%; }
.editor__head { position: relative; padding: 30px 64px 20px 28px; border-bottom: 1px solid var(--line); }
.editor__kicker { margin: 0 0 8px; color: var(--caramel); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.editor__title {
  margin: 0; overflow-wrap: anywhere;
  font: 400 40px/0.9 var(--display); font-variation-settings: var(--wide); letter-spacing: 1.5px; text-transform: lowercase;
}
.editor__close { position: absolute; top: 20px; right: 18px; width: 38px; height: 38px; }
.editor__close .icon { width: 20px; height: 20px; }
.editor__body { position: relative; flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 20px; padding: 22px 28px 32px; }
.editor__foot { display: flex; align-items: center; gap: 8px; padding: 16px 28px; border-top: 1px solid var(--line); background: var(--paper); }
.editor__spacer { flex: 1; }

.alert { margin: 0; padding: 11px 14px; border-radius: 10px; background: rgba(163, 48, 28, 0.08); color: var(--danger); font-weight: 600; }

.field { display: grid; align-content: start; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend, .pack label { padding: 0; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.field > legend { margin-bottom: 6px; }
.optional { margin-left: 4px; color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none; border-color: var(--caramel); box-shadow: 0 0 0 3px rgba(180, 82, 27, 0.18);
}
.field [aria-invalid="true"] { border-color: var(--danger); }
.field__error { margin: 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.field__error:empty { display: none; }

.pack { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.pack > legend { float: left; width: 100%; }
.pack__inputs { display: grid; grid-template-columns: minmax(0, 1fr) 86px minmax(0, 1.25fr); gap: 10px; clear: both; }
.pack__inputs > div { display: grid; gap: 6px; min-width: 0; }
.pack select { appearance: none; padding-right: 26px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f5a49' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; }
.money { position: relative; }
.money__sign { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.money input { padding-left: 28px; }
.pack__cost { margin: 12px 0 0; color: var(--muted); }
.pack__cost strong { color: var(--dark); font-size: 15px; }

.history { padding-top: 4px; }
.history__title { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.history__items { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.history__item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 11px 14px; font-variant-numeric: tabular-nums; }
.history__item + .history__item { border-top: 1px solid var(--line); }
.history__price { font-weight: 650; }
.history__cost { text-align: right; white-space: nowrap; }
.history__when { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.history__change { font-size: 12px; font-weight: 700; }
.history__change.is-up { color: var(--caramel-ink); }
.history__change.is-down { color: var(--green-ink); }

/* ---------------------------------------------------------------- small dialogs and toasts */

.modal { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 16px; background: var(--cream); color: var(--dark); box-shadow: 0 24px 70px rgba(54, 38, 24, 0.3); }
.modal::backdrop { background: rgba(54, 38, 24, 0.4); }
.modal__body { display: grid; gap: 12px; padding: 26px 28px 24px; }
.modal__title { margin: 0; font: 400 30px/1 var(--display); font-variation-settings: var(--wide); letter-spacing: 1px; text-transform: lowercase; overflow-wrap: anywhere; }
.modal__body p { margin: 0; }
.modal__list { margin: 0; padding-left: 18px; max-height: 40vh; overflow-y: auto; }
.modal__list li + li { margin-top: 6px; }
.modal__actions { display: flex; justify-content: flex-end; margin-top: 6px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 20; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast {
  max-width: min(420px, calc(100vw - 40px)); padding: 12px 16px; border-radius: 12px;
  background: var(--dark); color: var(--cream); font-weight: 600;
  box-shadow: 0 12px 32px rgba(54, 38, 24, 0.28);
  animation: toast-in 0.24s var(--ease-out);
}
.toast--error { background: var(--danger); color: #fff; }
.toast--out { opacity: 0; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------------------------------------------------------------- recipes */

a.row__open { text-decoration: none; }
a.row__open:hover { text-decoration: underline; text-underline-offset: 3px; }

.recipe > .alert { margin: 16px var(--gutter); }

/* Two columns, the full width of the page: the recipe (its lines, then the method) on the left; its costs, details
   and where it's used on the right. No gaps between the parts, only lines. On a narrower screen they stack, the
   costs first. */
.main:has(> .recipe) { padding: 0; } /* the page's edges are the recipe's; the bar with Save is the last thing */
.recipe__layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "main side";
  background: var(--paper); /* straight under the top bar, its name above it */
}
.recipe__main { grid-area: main; min-width: 0; }
.recipe__side { grid-area: side; min-width: 0; border-left: 1px solid var(--line-strong); }
.recipe__main > * + *, .recipe__side > * + * { border-top: 1px solid var(--line); }
.recipe__side .summary { grid-template-columns: minmax(0, 1fr); }
.recipe__side .recipe__fields { grid-template-columns: minmax(0, 1fr); }

.panel { padding: 20px 24px; }
.recipe__main > .panel { padding-inline: var(--gutter); } /* in line with the recipe's name */
.panel--flush, .recipe__main > .panel--flush { padding: 0; }
.panel--flush { overflow: clip; }
/* a narrow column drops cost per unit and share of cost (see .opt), then scrolls sideways rather than hiding more */
.lines-panel { overflow-x: auto; container-type: inline-size; }

.recipe__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.field__hint { margin: 0; color: var(--muted); font-size: 12.5px; }
.field__hint:empty { display: none; }

.segmented--radio { width: max-content; }
.segmented--radio label { position: relative; display: inline-flex; }
.segmented--radio input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.segmented--radio span {
  display: inline-flex; align-items: center; height: 34px; padding: 0 16px; border-radius: 999px;
  color: var(--muted); font-weight: 600; transition: background-color 0.15s, color 0.15s;
}
.segmented--radio input:checked + span { background: var(--dark); color: var(--cream); }
.segmented--radio input:focus-visible + span { outline: 2px solid var(--caramel); outline-offset: 2px; }
.segmented--radio input:disabled { cursor: not-allowed; }
.segmented--radio input:disabled + span { opacity: 0.45; }

/* A recipe's lines: compact rows like a list. The ingredient and the amount look like plain text until the row is
   pointed at or the box is used (on a touch screen their outlines always show). */
.lines { font-size: 13px; }
.lines thead th { padding-top: 10px; padding-bottom: 10px; font-size: 11px; }
.lines td, .lines tbody th { padding-top: 3px; padding-bottom: 3px; vertical-align: top; }
.lines :is(th, td) { padding-left: 10px; padding-right: 10px; } /* closer columns: more room for the ingredient */
.lines :is(th, td):first-child { padding-left: var(--gutter); }
.lines :is(th, td):last-child { padding-right: 10px; }
.lines .lines__n { width: 36px; padding-right: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.lines tbody .lines__n, .lines .line__cpu, .lines .line__cost, .lines tbody .lines__share { padding-top: 9px; } /* level with the boxes' text */
.lines .line__what { width: 100%; } /* the ingredient takes the room the numbers don't need */
.line { transition: background-color 0.12s; }
.line:hover, .line:focus-within { background: var(--butter-soft); }
.line__pick {
  width: 100%; min-width: 150px; height: 30px; padding: 0 26px 0 8px;
  border: 1px solid transparent; border-radius: 8px; font-weight: 650; appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f5a49' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 13px;
  transition: border-color 0.12s, background-color 0.12s;
}
.line__note { margin: 1px 9px 3px; color: var(--muted); font-size: 12px; }
.line__note:empty { display: none; }
.line__note--warn { color: var(--caramel-ink); }
.line__note a { color: inherit; font-weight: 700; text-underline-offset: 2px; }
.amount { display: inline-flex; align-items: center; gap: 5px; }
.amount input {
  width: 76px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; text-align: right; font-variant-numeric: tabular-nums;
  transition: border-color 0.12s, background-color 0.12s;
}
.amount__unit { min-width: 18px; color: var(--muted); text-align: left; }
.line:hover :is(.line__pick, .amount input) { border-color: var(--line-strong); background-color: #fff; }
.line__pick:focus-visible, .amount input:focus-visible {
  outline: none; border-color: var(--caramel); background-color: #fff; box-shadow: 0 0 0 3px rgba(180, 82, 27, 0.18);
}
.line--error .line__pick, .line--error .amount input, .amount input[aria-invalid="true"] { border-color: var(--danger); }
@media (hover: none) {
  .line__pick, .amount input { border-color: var(--line-strong); background-color: #fff; }
}
.line__cost { font-weight: 650; }
.line__tools { padding-top: 4px; padding-left: 4px; white-space: nowrap; text-align: right; }
.line__tools .icon-btn { width: 28px; height: 28px; }
.line__tools .icon-btn .icon { width: 16px; height: 16px; }
.share { display: inline-flex; align-items: center; gap: 8px; }
.share__track { width: 60px; height: 6px; border-radius: 3px; background: rgba(54, 38, 24, 0.08); overflow: hidden; }
.share__bar { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--caramel); }
.share__pct { min-width: 30px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.lines tfoot th, .lines tfoot td { padding-top: 9px; padding-bottom: 9px; border-top: 1px solid var(--line-strong); font-weight: 700; }
.lines tfoot th { padding-left: 19px; text-align: left; } /* in line with the ingredients' names */
.lines__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 12px 10px var(--gutter); border-top: 1px solid var(--line); }
.btn--small .icon { width: 15px; height: 15px; }

.summary {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: center; gap: 18px 36px;
  padding: 22px 24px; background: var(--dark); color: var(--cream);
}
.summary__label { margin: 0; color: rgba(254, 250, 231, 0.72); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.summary__value { margin: 8px 0 6px; color: var(--butter); font-size: 36px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.summary__note { margin: 0; color: rgba(254, 250, 231, 0.75); font-size: 13px; }
.summary__note--warn { color: #ffd6b3; }
.summary__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 16px 20px; margin: 0; }
.summary__list div { display: grid; align-content: start; gap: 4px; padding-left: 14px; border-left: 1px solid rgba(254, 250, 231, 0.16); }
.summary__list dt { color: rgba(254, 250, 231, 0.72); font-size: 12.5px; }
.summary__list dd { margin: 0; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary__dim { color: rgba(254, 250, 231, 0.5); font-size: 13px; font-weight: 400; }

.used__title { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.used__list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.used__list a { color: var(--dark); font-weight: 650; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.used__list a:hover { text-decoration-color: currentColor; }

.actionbar {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 12px;
  margin: 0; padding: 14px var(--gutter);
  border-top: 1px solid var(--line); background: rgba(254, 250, 231, 0.95);
  box-shadow: 0 -10px 30px rgba(54, 38, 24, 0.06);
}
.actionbar__status { flex: 1; color: var(--muted); font-weight: 600; text-align: right; }

/* ---------------------------------------------------------------- smaller screens */

@container (max-width: 720px) {
  .grid .opt { display: none; }
  .row__status { display: inline; } /* a recipe's status, beside its name once its own column has gone */
}

@media (max-width: 1120px) {
  /* buttons like Export and Import keep only their icon; the name shows on hover and stays for screen readers */
  .btn--squeeze { width: 40px; padding: 0; }
  .btn--squeeze .btn__label {
    position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

@media (max-width: 1000px) {
  /* a recipe's two columns stack: its costs and details first, then its lines and method */
  .recipe__layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "main"; }
  .recipe__side { border-left: 0; border-bottom: 1px solid var(--line-strong); }
  .recipe__side > .panel, .recipe__side > .summary { padding-inline: var(--gutter); }
  .recipe__side .summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
  .recipe__side .recipe__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .main { padding-top: 30px; }

  /* the top bar's title takes only the room it needs, and the search drops its "/" */
  .topbar__page { grid-template-columns: auto minmax(0, 1fr) auto; }
  .topbar__title { padding-right: 0; font-size: 28px; }
  .topbar .search { margin-left: 18px; }
  .topbar__actions { padding-left: 12px; }
  .search__key { display: none; }
  .search input { padding-right: 14px; }

  /* the menu on the left becomes a row of chips at the top of the page */
  .split { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .split > :not(.submenu) { grid-column: 1; }
  .split > .submenu + * { margin-top: 20px; }
  .submenu {
    grid-column: 1; grid-row: auto; position: static; height: auto; overflow: visible;
    padding: 22px 0 0; border: 0; background: none;
  }
  .submenu__head { padding: 0 calc(var(--gutter) - 10px) 6px var(--gutter); }
  .submenu__list:not(.submenu__list--edit) {
    display: flex; gap: 6px; overflow-x: auto; padding: 2px var(--gutter) 4px; scrollbar-width: none;
    scroll-padding-inline: var(--gutter);
  }
  .submenu__list:not(.submenu__list--edit)::-webkit-scrollbar { display: none; }
  .submenu__list:not(.submenu__list--edit) > li { flex: none; }
  .submenu__all { margin: 0; padding: 0; border: 0; }
  .submenu__list:not(.submenu__list--edit) .submenu__link {
    min-height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px;
    background: var(--paper); white-space: nowrap;
  }
  .submenu__list:not(.submenu__list--edit) .submenu__link:not([aria-current="false"]) { border-color: var(--dark); background: var(--dark); }
  .submenu__list--edit { margin-inline: calc(var(--gutter) - 10px); }
  .submenu__hint { margin-inline: var(--gutter); }
}

@media (max-width: 840px) {
  .recipe__side .summary { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  /* A phone: the rail becomes a dark bar across the top, the logo at the left and the icons with their names at the
     right. Under it, the top bar: the page's title and main button, then the search. Both scroll away with the page. */
  :root { --top: 0px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "rail" "top" "main"; }
  .sidebar { position: static; height: auto; flex-direction: row; gap: 12px; padding: 10px 12px 10px 14px; }
  .brand { width: auto; height: 42px; margin: 0; padding: 0 2px; border-radius: 8px; }
  .brand:hover { background: none; }
  .brand img { width: 92px; height: auto; }
  .nav { display: flex; gap: 4px; margin-left: auto; }
  .nav__link { display: inline-flex; gap: 8px; width: auto; height: 40px; padding: 0 13px; border-radius: 999px; }
  .nav__link .icon { width: 20px; height: 20px; }
  .nav__label {
    position: static; padding: 0; background: none; box-shadow: none;
    color: inherit; font-size: 14px; opacity: 1; transform: none;
  }

  .topbar { position: static; height: auto; border: 0; background: none; }
  /* the title with the main button (Add ingredient, New recipe); then the search, with any small buttons */
  .topbar__page { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 26px var(--gutter) 0; }
  .topbar__page::after { content: ""; order: 2; flex-basis: 100%; } /* the line break between the two */
  .topbar__title { flex: 1 0 auto; margin-right: 4px; padding: 0; font-size: 46px; line-height: 0.9; }
  .topbar__actions { display: contents; }
  .topbar__actions > * { order: 1; }
  .topbar__actions > .btn--squeeze { order: 3; }
  .topbar .search { order: 3; flex: 1 1 180px; max-width: none; margin: 0; }
  .topbar__recipe { order: 3; flex: 1 1 100%; flex-wrap: wrap; gap: 6px 10px; }
  .topbar__recipe::before { content: none; }
  .topbar__name { white-space: normal; overflow-wrap: anywhere; font-size: 30px; line-height: 1; }
  .topbar__title.topbar__title--back { font-size: 26px; } /* smaller than the recipe's name under it */
  .topbar__page:has(.topbar__recipe) { padding-bottom: 18px; } /* the recipe starts straight under it */
  .topbar .btn, .search input { height: 42px; }
  .btn--squeeze { width: 42px; }

  .recipe__side .recipe__fields { grid-template-columns: minmax(0, 1fr); }
  .line__pick { min-width: 0; }
}

@media (max-width: 560px) {
  /* each recipe line becomes a small card: the ingredient, then amount, cost and tools */
  .lines, .lines tbody, .lines tfoot { display: block; }
  .lines thead { display: none; }
  .lines tr.line {
    display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto; align-items: center; gap: 6px 8px;
    padding: 8px 10px 8px 12px; border-top: 1px solid var(--line);
  }
  .lines tr.line:first-child { border-top: 0; }
  .lines tr.line > td { padding: 0 !important; border: 0; }
  .lines .lines__n { grid-area: 1 / 1; }
  .lines .line__what { grid-area: 1 / 2 / 2 / -1; }
  .lines .line__amount { grid-area: 2 / 2; text-align: left; }
  .lines .line__cost { grid-area: 2 / 3; }
  .lines .line__tools { grid-area: 2 / 4; }
  .lines tfoot tr { display: flex; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line-strong); }
  .lines tfoot th, .lines tfoot td { padding: 0; border: 0; }
  .lines tfoot th { flex: 1; }
  .lines tfoot td:empty { display: none; }
  .actionbar .btn { flex: 1; }
  .actionbar__status { display: none; }
}

@media (max-width: 560px) {
  .shell { --gutter: 12px; }
  .main { padding: 24px var(--gutter) 80px; }
  .split > .sheet { margin-bottom: 80px; }
  .topbar__page { padding-top: 22px; }
  .topbar__title { font-size: 42px; }
  .list-head__tools { flex: 1 1 100%; }
  .sort { flex: 1; justify-content: flex-end; }
  .sheet .grid :is(th, td) { padding-inline: 8px; } /* the first and last keep the page's edge */
  .sheet .grid thead th { font-size: 10.5px; }
  .sheet .cost__bulk { display: none; }
  .editor__head { padding: 24px 60px 16px 20px; }
  .editor__body { padding: 18px 20px 28px; }
  .editor__foot { padding: 14px 20px; }
  .pack__inputs { grid-template-columns: minmax(0, 1fr) 80px; }
  .pack__price { grid-column: 1 / -1; }
}

@media (max-width: 400px) {
  /* a small phone: only the page you're on keeps its name beside the icon (the others keep it for screen readers) */
  .nav__link:not([aria-current="page"]) { width: 40px; padding: 0; justify-content: center; }
  .nav__link:not([aria-current="page"]) .nav__label {
    position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  /* the title and the main button still share a line */
  .topbar__title { font-size: 36px; }
  .topbar__actions > .btn:not(.btn--squeeze) { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ================================================================ added 6 Dec 2026: online, orders, products, settings */

[hidden] { display: none !important; }

/* the rail: Open the shop and Settings at the foot; the number of new orders on Orders */
.nav--end { margin-top: auto; }
.nav__badge {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--caramel); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.nav__link[aria-current="page"] .nav__badge { background: var(--dark); color: var(--butter); }

/* ---------------------------------------------------------------- the login */
.login { display: grid; place-content: center; justify-items: center; gap: 22px; min-height: 100vh; min-height: 100dvh; padding: 24px 16px; background: var(--dark); }
.login__card {
  display: grid; gap: 16px; width: min(420px, 100%); padding: 30px 28px 28px;
  border-radius: 22px; background: var(--cream); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.login__logo { width: 170px; height: auto; }
.login__title { margin: 0; text-align: center; font: 400 40px/0.9 var(--display); font-variation-settings: var(--wide); letter-spacing: 1.5px; text-transform: lowercase; }
.login__text { margin: 0; color: var(--muted); text-align: center; }
.login__go { width: 100%; height: 48px; margin-top: 4px; font-size: 15px; }

/* ---------------------------------------------------------------- lists: a second line in a cell; tags */
.row__sub { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; font-weight: 400; }
.submenu__gap { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.tag--new { background: var(--butter); color: var(--dark); }
.tag--confirmed { background: var(--baby); color: #1f4d6b; }
.tag--baking { background: var(--caramel-soft); color: var(--caramel-ink); }
.tag--out { background: #e8e0f5; color: #4b3577; }
.tag--delivered, .tag--paid, .tag--on { background: #e2efd4; color: var(--green-ink); }
.tag--cancelled, .tag--off { background: rgba(54, 38, 24, 0.08); color: var(--muted); }
.tag--unpaid { background: transparent; color: var(--caramel-ink); box-shadow: inset 0 0 0 1px rgba(143, 63, 18, 0.35); }
.row--new > th:first-child { box-shadow: inset 4px 0 0 var(--caramel); }
.topbar__kind .tag { white-space: nowrap; }

/* ---------------------------------------------------------------- one order */
.order__lines { font-size: 13.5px; }
.order__lines thead th { padding: 10px 12px; font-size: 11px; }
.order__lines :is(th, td) { padding-left: 12px; padding-right: 12px; }
.order__lines :is(th, td):first-child { padding-left: var(--gutter); }
.order__lines :is(th, td):last-child { padding-right: var(--gutter); }
.order__lines tbody th { font-weight: 650; }
.order__lines td, .order__lines tbody th { padding-top: 9px; padding-bottom: 9px; vertical-align: top; }
.order__qty { font-weight: 700; }
.order__lines tfoot th, .order__lines tfoot td { padding-top: 6px; padding-bottom: 6px; border-top: 0; font-weight: 400; }
.order__lines tfoot tr:first-child :is(th, td) { padding-top: 12px; border-top: 1px solid var(--line-strong); }
.order__lines tfoot th { padding-left: var(--gutter); text-align: left; }
.order__total :is(th, td) { font-size: 15px; font-weight: 700 !important; }
.order__gst td { color: var(--muted); font-size: 12.5px; padding-left: var(--gutter); }
.order__note { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--butter-soft); white-space: pre-wrap; }
.timeline { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.timeline li { display: flex; justify-content: space-between; gap: 12px; padding-left: 14px; border-left: 2px solid var(--line-strong); }
.timeline time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { position: relative; display: inline-flex; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--paper); color: var(--dark); font-weight: 600; transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.choice:hover span { background: var(--butter-soft); }
.choice input:checked + span { border-color: var(--dark); background: var(--dark); color: var(--cream); }
.choice input:focus-visible + span { outline: 2px solid var(--caramel); outline-offset: 2px; }
.contact__name { margin: 0; font-size: 16px; font-weight: 700; }
.contact__line { margin: 4px 0 0; line-height: 1.5; }
.contact__line a { color: inherit; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------------------------------------------------------------- products */
.products__photo { width: 56px; padding-right: 0 !important; }
.products__photo img, .products__none {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--baby); object-fit: contain;
}
.products__none { color: rgba(54, 38, 24, 0.35); font: 400 22px/1 var(--display); text-transform: lowercase; }
.products__move { white-space: nowrap; }
.products__move .icon-btn { width: 28px; height: 28px; }

.product__photo-panel { display: grid; gap: 12px; justify-items: start; }
.product__card { display: grid; justify-items: center; gap: 4px; width: min(300px, 100%); padding: 14px 18px 18px; border-radius: 18px; background: var(--baby); text-align: center; }
.product__photo { display: grid; place-items: center; width: 100%; aspect-ratio: 1; }
.product__photo img { width: 100%; height: 100%; object-fit: contain; }
.product__photo .products__none { width: 100%; height: 100%; background: none; font-size: 90px; }
.product__card-name { margin: 2px 0 0; font: 400 32px/0.9 var(--display); font-variation-settings: var(--wide); letter-spacing: 1px; text-transform: lowercase; overflow-wrap: anywhere; }
.product__card-price { margin: 4px 0 0; font: 400 22px/1 var(--display); font-variation-settings: var(--wide); }
.product__photo-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.product__photo-tools label { cursor: pointer; }
.product__photo-tools label:focus-within { outline: 2px solid var(--caramel); outline-offset: 2px; }

/* ---------------------------------------------------------------- settings */
.main:has(> .split > .settings) { padding-bottom: 0; }
.settings { display: grid; max-width: 820px; margin-bottom: 0 !important; }
.settings__part { display: grid; gap: 16px; padding: 30px 0 34px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--top) + 8px); }
.settings > form > .settings__part:first-of-type, .settings > .settings__part:first-child { padding-top: 4px; }
.settings__title { margin: 0; font: 400 34px/1 var(--display); font-variation-settings: var(--wide); letter-spacing: 1.2px; text-transform: lowercase; }
.settings__text { margin: -6px 0 0; max-width: 64ch; color: var(--muted); }
.settings__text a { color: var(--dark); font-weight: 650; }
.settings__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.settings__points { display: grid; gap: 14px; }
.settings__point { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.settings__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.settings__list { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.settings__list:empty { display: none; }
.settings__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; }
.settings__item + .settings__item { border-top: 1px solid var(--line); }
.settings__add { display: grid; gap: 12px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.settings__add .used__title { margin: 0; }
.settings__bar { margin: 0 calc(-1 * var(--gutter)); }

@media (max-width: 760px) {
  /* five places in the menu: only the page you're on keeps its name beside its icon */
  .nav { gap: 2px; }
  .nav--end { margin-top: 0; margin-left: 0; }
  .nav__link:not([aria-current="page"]) { width: 40px; padding: 0; justify-content: center; }
  .nav__link:not([aria-current="page"]) .nav__label {
    position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .nav__badge { top: 2px; right: 0; }
  .nav__link[aria-current="page"] .nav__badge { position: static; }
  .settings__point { grid-template-columns: minmax(0, 1fr); }
  .settings__bar { margin: 0 calc(-1 * var(--gutter)); }
}
@media (max-width: 480px) {
  /* a phone: six places and the logo in one row, so every place is its icon (its name stays for screen readers);
     the page you're on is the butter one */
  .sidebar { gap: 6px; padding-inline: 10px 8px; }
  .brand img { width: 72px; }
  .sidebar .nav__link { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .nav__link[aria-current="page"] .nav__label {
    position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .nav__link[aria-current="page"] .nav__badge { position: absolute; }
}
@media (max-width: 360px) {
  .brand img { width: 62px; }
  .sidebar .nav__link { width: 34px; height: 36px; }
  .nav__link .icon { width: 19px; height: 19px; }
}

/* on this computer: a copy, not the real backend */
.copy-note { margin: 0; padding: 6px 14px; background: var(--butter); color: var(--dark); font-size: 12.5px; font-weight: 600; text-align: center; }
.copy-note a { color: inherit; }
@media (min-width: 761px) { body:has(.copy-note) .sidebar { height: calc(100vh - 31px); } } /* the note takes the top 31px */
