:root {
  color-scheme: light;
  --bg: #f3f2f2;
  --surface: #eae9e9;
  --ink: #201e1d;
  --accent: #ec3013;
  --accent-dark: #ae1800;
  --divider: color-mix(in srgb, #201e1d 40%, transparent);
  --neutral-100: #f8f4f4;
  --neutral-200: #eae7e7;
  --neutral-300: #d7d3d3;
  --neutral-500: #9b9797;
  --neutral-700: #605d5d;
  --danger: #ae1800;
  --font: "Archivo", system-ui, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: var(--font); }
body { min-height: 100vh; margin: 0; background: var(--bg); font-size: 15px; line-height: 1.55; }
body.filters-open { overflow: hidden; }
body.photo-lightbox-open { overflow: hidden; }
.site-frame { width: min(1280px, 100%); min-height: 100vh; margin-inline: auto; border-right: 1px solid var(--divider); border-left: 1px solid var(--divider); background: var(--bg); }
.site-frame-login { width: 100%; border: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--font); font-weight: 800; line-height: 1.12; letter-spacing: -.015em; }
h1 { font-size: clamp(28px, 4vw, 42px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
fieldset { min-width: 0; }
:focus { outline: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; white-space: nowrap; }
.preserve-lines { white-space: pre-line; }
.meta-text { color: color-mix(in srgb, var(--ink) 55%, transparent); font-family: var(--mono); font-size: 11px; letter-spacing: .02em; }
.meta-label { color: color-mix(in srgb, var(--ink) 55%, transparent); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.section-kicker { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.environment-banner { padding: 4px 12px; background: var(--accent); color: var(--bg); text-align: center; font-size: 12px; font-weight: 800; text-transform: uppercase; }

.site-nav { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 12px 16px; border-bottom: 2px solid var(--divider); background: var(--bg); }
.nav-brand { margin-right: auto; color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: .04em; text-decoration: none; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--ink); font-size: 14px; text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--accent); }
.nav-menu { position: relative; }
.nav-menu summary { display: grid; width: 40px; height: 40px; cursor: pointer; list-style: none; place-items: center; border: 1px solid var(--divider); font-size: 19px; font-weight: 800; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu-panel { position: absolute; z-index: 50; top: 48px; right: 0; display: grid; width: 190px; border: 2px solid var(--ink); background: var(--bg); }
.nav-menu-panel a, .nav-menu-panel button { display: block; width: 100%; min-height: 44px; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--divider); background: transparent; color: var(--ink); font-weight: 600; text-align: left; text-decoration: none; }

.button { display: inline-flex; min-height: 44px; cursor: pointer; align-items: center; justify-content: flex-start; gap: 6px; padding: 9px 14px; border: 1px solid transparent; border-radius: 0; background: transparent; font-weight: 800; line-height: 1.2; text-align: left; text-decoration: none; }
.button:disabled { cursor: wait; opacity: .45; }
.button-primary { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.button-primary:hover { background: #dd2b0f; }
.button-secondary { border-color: var(--divider); background: transparent; color: var(--ink); }
.button-secondary:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.button-ghost { border-color: transparent; background: transparent; color: var(--ink); }
.button-ghost:hover { color: var(--accent); }
.compact-button { min-height: 40px; padding: 8px 12px; font-size: 13px; }
.text-button { min-height: 40px; cursor: pointer; border: 0; background: transparent; color: var(--accent); font-weight: 800; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.icon-button { display: grid; width: 44px; height: 44px; cursor: pointer; place-items: center; border: 1px solid var(--divider); background: transparent; color: var(--ink); font-size: 24px; font-weight: 800; text-decoration: none; }
.field { display: grid; gap: 5px; color: color-mix(in srgb, var(--ink) 70%, transparent); font-size: 12px; }
.input { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--divider); border-radius: 0; background: var(--surface); caret-color: var(--accent); font-size: 14px; }
.input:hover { border-color: color-mix(in srgb, var(--ink) 60%, transparent); }
.input:focus-visible { border-color: var(--accent); outline-offset: 0; }
textarea.input { min-height: 96px; resize: vertical; }
.plain-fieldset, .filter-group { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.plain-fieldset > legend, .filter-group > legend { margin-bottom: 7px; padding: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.form-grid { display: grid; gap: 12px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack-form { display: grid; gap: 16px; margin-top: 24px; }
.form-actions, .dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.segmented { display: flex; border: 1px solid var(--divider); }
.segmented > label { min-width: 0; flex: 1; }
.segmented input { position: absolute; width: 0; height: 0; pointer-events: none; opacity: 0; }
.segmented > label > span, .segmented > button { display: flex; min-height: 42px; cursor: pointer; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border: 0; border-right: 1px solid var(--divider); background: var(--bg); font-size: 13px; }
.segmented > :last-child > span, .segmented > button:last-child { border-right: 0; }
.segmented input:checked + span, .segmented > button.active { background: var(--ink); color: var(--bg); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.equal-segments { width: 100%; }
.compact-segmented { flex-direction: column; }
.compact-segmented > label > span { justify-content: flex-start; border-right: 0; border-bottom: 1px solid var(--divider); }
.compact-segmented > label:last-child > span { border-bottom: 0; }

.check-row { display: flex; min-height: 40px; cursor: pointer; align-items: center; gap: 9px; font-size: 14px; }
.check-row > input { position: absolute; width: 0; height: 0; opacity: 0; }
.check-box { display: block; width: 16px; height: 16px; flex: none; border: 1px solid var(--divider); background: var(--bg); }
.check-row > input:checked + .check-box { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--bg); }
.check-row > input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-label { display: inline-flex; align-items: center; gap: 6px; }
.filter-count { color: color-mix(in srgb, var(--ink) 55%, transparent); }
.status-mark { position: relative; display: inline-flex; width: 11px; height: 11px; flex: none; align-items: flex-end; overflow: hidden; border: 2px solid var(--ink); }
.status-mark::after { width: 100%; content: ""; background: var(--ink); }
.status-mark.status-tried::after { height: 33%; }
.status-mark.status-yummy::after { height: 66%; }
.status-mark.status-favorite { border-color: var(--accent); background: var(--accent); }
.status-mark.status-favorite::after, .status-mark.status-idea::after { display: none; }
.status-badge { display: inline-flex; width: fit-content; align-items: center; gap: 5px; border: 0; background: transparent; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
button.status-badge { min-height: 40px; cursor: pointer; }
.status-control { display: flex; align-items: center; gap: 8px; }
.status-picker { display: flex; width: fit-content; flex-wrap: wrap; border: 1px solid var(--divider); }
.status-option { min-height: 42px; cursor: pointer; padding: 8px 10px; border: 0; border-right: 1px solid var(--divider); background: var(--bg); }
.status-option:last-child { border-right: 0; }
.status-option.selected { background: var(--surface); }
.tag-list, .filter-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag, .filter-tag > span { display: inline-flex; min-height: 28px; align-items: center; padding: 4px 10px; border: 1px solid transparent; background: var(--neutral-100); color: var(--ink); font-size: 11px; }
.filter-tag { cursor: pointer; }
.filter-tag input { position: absolute; width: 0; height: 0; opacity: 0; }
.filter-tag > span { min-height: 34px; border-color: var(--accent); background: transparent; color: var(--accent); font-size: 12px; }
.filter-tag input:checked + span { background: var(--accent); color: var(--bg); }

.index-layout { display: grid; min-height: calc(100vh - 64px); grid-template-columns: 264px minmax(0, 1fr); }
.filter-sidebar { display: flex; flex-direction: column; gap: 20px; padding: 20px; border-right: 2px solid var(--divider); }
.mobile-filter-heading { display: none; }
.filter-group { padding-top: 16px; border-top: 2px solid var(--divider); }
.filter-sidebar .filter-group:nth-of-type(1) { padding-top: 0; border-top: 0; }
.filter-options { display: grid; gap: 2px; }
.filter-actions { display: grid; gap: 6px; }
.index-content { min-width: 0; padding: 20px; }
.mobile-search-row, .mobile-time-filter { display: none; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.index-title-row { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--divider); }
.index-title-row h1 { font-size: 25px; }
.active-filter-summary { margin-bottom: 12px; padding: 9px 10px; border-left: 2px solid var(--accent); background: var(--surface); font-family: var(--mono); font-size: 11px; }
.recipe-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.recipe-card { display: flex; min-width: 0; flex-direction: column; gap: 8px; padding: 10px; background: var(--surface); color: var(--ink); text-decoration: none; }
.recipe-card:focus-visible { outline-offset: -2px; }
.recipe-card-image { display: flex; aspect-ratio: 4 / 3; align-items: flex-end; overflow: hidden; background: repeating-linear-gradient(135deg, var(--neutral-200) 0 6px, var(--neutral-300) 6px 12px); }
.recipe-card-image img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { align-items: center; justify-content: center; background: var(--neutral-200); }
.recipe-card-body { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 7px; }
.recipe-card-title { display: -webkit-box; overflow: hidden; font-size: 17px; line-height: 1.15; text-wrap: pretty; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.recipe-card-meta { margin-top: auto; color: color-mix(in srgb, var(--ink) 55%, transparent); font-family: var(--mono); font-size: 10px; line-height: 1.5; }
.loading-state { grid-column: 1 / -1; padding: 28px; border: 2px solid var(--divider); color: color-mix(in srgb, var(--ink) 55%, transparent); font-family: var(--mono); text-align: center; }
.empty-state { padding: 28px; border: 2px solid var(--divider); text-align: center; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { margin-bottom: 14px; }
.recent-section { margin-top: 24px; padding-top: 16px; border-top: 2px solid var(--divider); }
.recent-section > h2 { margin-bottom: 12px; }
.recent-table-wrap { overflow-x: auto; }
.recent-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.recent-table th { padding: 8px; border-bottom: 2px solid var(--divider); color: color-mix(in srgb, var(--ink) 60%, transparent); font-size: 11px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.recent-table td { padding: 8px; border-bottom: 1px solid var(--divider); }
.recent-table a { color: var(--ink); font-weight: 600; }
.recent-mobile { display: none; }
.mobile-sticky-action { display: none; }

.mobile-recipe-bar { display: none; }
.page-loading { margin: 24px; }
.recipe-hero { display: grid; grid-template-columns: minmax(0, 1fr) 420px; border-bottom: 2px solid var(--divider); }
.hero-copy { display: flex; min-width: 0; flex-direction: column; gap: 12px; padding: 24px; }
.hero-copy h1 { max-width: 24ch; font-size: 40px; text-wrap: pretty; }
.recipe-summary { max-width: 60ch; font-size: 16px; }
.recipe-time-stats { display: flex; margin: auto 0 0; border-top: 2px solid var(--divider); border-bottom: 2px solid var(--divider); }
.recipe-time-stats > div { min-width: 0; flex: 1; padding: 9px 10px; border-left: 1px solid var(--divider); }
.recipe-time-stats > div:first-child { padding-left: 0; border-left: 0; }
.recipe-time-stats .time-total dd { font-weight: 800; }
.recipe-stats { display: flex; gap: 0; margin: 0; border-bottom: 2px solid var(--divider); }
.recipe-stats > div { min-width: 0; flex: 1; padding: 9px 10px; border-left: 1px solid var(--divider); }
.recipe-stats > div:first-child { padding-left: 0; border-left: 0; }
.recipe-time-stats dt, .recipe-stats dt { color: color-mix(in srgb, var(--ink) 55%, transparent); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.recipe-time-stats dd, .recipe-stats dd { margin: 2px 0 0; font-family: var(--mono); font-size: 14px; }
.recipe-stats dd a { display: block; max-width: 25ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-image { display: flex; height: 330px; min-height: 0; align-items: flex-end; overflow: hidden; border-left: 2px solid var(--divider); background: repeating-linear-gradient(135deg, var(--neutral-200) 0 8px, var(--neutral-300) 8px 16px); }
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.hero-image-clickable { cursor: zoom-in; }
.recipe-body { display: grid; grid-template-columns: 400px minmax(0, 1fr); }
.ingredients-column { display: flex; flex-direction: column; gap: 16px; padding: 24px; border-right: 2px solid var(--divider); }
.method-column { display: flex; min-width: 0; flex-direction: column; gap: 20px; padding: 24px; }
.content-heading { font-size: 20px; }
.yield-panel { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface); }
.yield-heading { display: flex; align-items: center; justify-content: space-between; }
.yield-heading h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.yield-main-controls { display: flex; gap: 8px; }
.yield-step { width: 44px; height: 44px; flex: none; justify-content: center; padding: 0; background: var(--bg); font-size: 20px; }
.yield-value { display: flex; min-width: 0; height: 44px; flex: 1; align-items: center; justify-content: center; border: 2px solid var(--ink); background: var(--bg); font-size: 18px; font-weight: 800; }
.yield-value input { width: 54px; border: 0; background: transparent; font-size: inherit; font-weight: inherit; text-align: right; }
.yield-value input:focus-visible { outline-offset: -2px; }
.yield-value span { margin-left: 5px; }
.yield-multipliers { background: var(--bg); }
.yield-multipliers button { flex: 1; min-width: 0; }
.mobile-custom-yield { display: none !important; }
.yield-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.yield-note .text-button { flex: none; font-size: 12px; }
.scaling-unavailable { display: grid; gap: 8px; padding: 14px; border: 2px solid var(--divider); }
.ingredient-heading-row { align-items: center; }
.compact-switch { flex: none; }
.compact-switch > button { min-height: 40px; padding: 7px 12px; }
.ingredient-group + .ingredient-group, .instruction-group + .instruction-group { margin-top: 20px; }
.ingredient-group-title, .instruction-group-title { margin-bottom: 8px; color: var(--accent); }
.ingredient-list { margin: 0; padding: 0; border-top: 1px solid var(--divider); list-style: none; }
.ingredient-item { display: grid; grid-template-columns: minmax(70px, auto) minmax(0, 1fr) 44px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--divider); }
.ingredient-quantity { min-width: 70px; color: var(--accent-dark); font-weight: 800; }
.not-scaled-quantity { color: var(--ink); }
.optional-label { display: inline-flex; margin-left: 7px; padding: 1px 5px; border: 1px solid var(--divider); font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.shopping-add-all { width: 100%; justify-content: flex-start; }
.ingredient-add-button { display: grid; width: 44px; height: 44px; cursor: pointer; place-items: center; border: 1px solid var(--divider); background: var(--bg); color: var(--ink); font-size: 20px; font-weight: 800; }
.ingredient-add-button:disabled { cursor: wait; background: var(--ink); color: var(--bg); opacity: 1; }
.nutrition-section { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 2px solid var(--divider); }
.nutrition-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: 1px solid var(--divider); }
.nutrition-values > div { min-width: 0; padding: 9px 7px; border-left: 1px solid var(--divider); }
.nutrition-values > div:first-child { border-left: 0; }
.nutrition-values dt { color: color-mix(in srgb, var(--ink) 55%, transparent); font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.nutrition-values dd { margin: 2px 0 0; font-size: 17px; font-weight: 800; }
.method-section { display: flex; flex-direction: column; gap: 12px; }
.instruction-item { display: flex; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--divider); }
.instruction-item + .instruction-item { padding-top: 12px; }
.instruction-number { min-width: 22px; font-size: 18px; }
.instruction-item p { max-width: 70ch; font-size: 16px; }
.detail-section { padding-top: 16px; border-top: 2px solid var(--divider); }
.recipe-notes { display: grid; gap: 9px; margin: 10px 0 0; padding: 0; list-style: none; }
.recipe-notes li { position: relative; padding-left: 18px; }
.recipe-notes li::before { position: absolute; top: .48em; left: 0; width: 8px; height: 8px; content: ""; background: var(--accent); }
.photo-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.photo-section { display: flex; min-width: 0; flex-direction: column; gap: 8px; }
.section-title-inline { display: flex; align-items: baseline; gap: 8px; }
.photo-grid { display: grid; gap: 8px; }
.reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo-gallery { min-width: 0; }
.photo-carousel { position: relative; }
.photo-carousel-stage, .photo-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo-card { position: relative; aspect-ratio: 1; margin: 0; overflow: hidden; background: var(--neutral-200); }
.photo-open-button { display: block; width: 100%; height: 100%; cursor: zoom-in; padding: 0; border: 0; background: transparent; }
.photo-open-button:disabled { cursor: default; }
.photo-card img { width: 100%; height: 100%; object-fit: contain; }
.photo-is-cover { border: 2px solid var(--accent); }
.cover-label { position: absolute; bottom: 3px; left: 3px; padding: 1px 4px; background: var(--accent); color: var(--bg); font-family: var(--mono); font-size: 8px; text-transform: uppercase; }
.photo-cover-button { position: absolute; bottom: 4px; left: 4px; min-height: 30px; cursor: pointer; padding: 3px 6px; border: 1px solid var(--ink); background: var(--bg); font-size: 10px; font-weight: 800; }
.photo-delete-button { position: absolute; z-index: 2; top: 4px; right: 4px; display: grid; width: 32px; height: 32px; cursor: pointer; place-items: center; border: 1px solid var(--ink); background: var(--bg); color: var(--ink); font-size: 20px; font-weight: 800; line-height: 1; }
.photo-carousel-arrow { position: absolute; z-index: 2; top: 50%; display: grid; width: 38px; height: 44px; cursor: pointer; transform: translateY(-50%); place-items: center; border: 1px solid var(--ink); background: color-mix(in srgb, var(--bg) 90%, transparent); color: var(--ink); font-size: 30px; line-height: 1; }
.photo-carousel-previous { left: 5px; }
.photo-carousel-next { right: 5px; }
.photo-carousel-count { position: absolute; z-index: 2; right: 5px; bottom: 5px; padding: 2px 5px; background: color-mix(in srgb, var(--ink) 78%, transparent); color: var(--bg); font-family: var(--mono); font-size: 9px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-lightbox { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; overflow: hidden; padding: 24px; border: 0; background: color-mix(in srgb, var(--ink) 90%, transparent); }
.photo-lightbox[open] { display: grid; place-items: center; }
.photo-lightbox::backdrop { background: color-mix(in srgb, var(--ink) 80%, transparent); }
.photo-lightbox-content { position: relative; display: grid; width: min(1120px, calc(100vw - 96px)); max-width: 100%; height: min(820px, calc(100vh - 64px)); height: min(820px, calc(100svh - 64px)); max-height: 100%; min-width: 0; min-height: 0; overflow: hidden; place-items: center; background: #111; }
.photo-lightbox-content img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.photo-lightbox-close, .photo-lightbox-arrow { position: absolute; z-index: 2; display: grid; cursor: pointer; place-items: center; border: 1px solid var(--bg); background: color-mix(in srgb, var(--ink) 75%, transparent); color: var(--bg); }
.photo-lightbox-close { top: 10px; right: 10px; width: 44px; height: 44px; font-size: 27px; line-height: 1; }
.photo-lightbox-arrow { top: 50%; width: 46px; height: 56px; transform: translateY(-50%); font-size: 34px; line-height: 1; }
.photo-lightbox-previous { left: 10px; }
.photo-lightbox-next { right: 10px; }
.photo-lightbox-count { position: absolute; z-index: 2; bottom: 10px; left: 50%; padding: 3px 7px; transform: translateX(-50%); background: color-mix(in srgb, var(--ink) 75%, transparent); color: var(--bg); font-family: var(--mono); font-size: 11px; }
.photo-empty { display: grid; min-height: 90px; place-items: center; background: var(--neutral-200); color: color-mix(in srgb, var(--ink) 55%, transparent); font-family: var(--mono); font-size: 10px; }
.inline-upload { display: grid; gap: 10px; padding: 10px; border: 1px solid var(--divider); }
.photo-drop { display: grid; min-height: 58px; cursor: pointer; place-items: center; gap: 3px; padding: 10px; border: 1px dashed var(--divider); color: var(--accent); font-size: 12px; font-weight: 800; text-align: center; }
.photo-drop span { color: color-mix(in srgb, var(--ink) 65%, transparent); font-size: 10px; font-weight: 500; }
.photo-drop:focus-visible, .photo-drop.photo-drop-active { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 2px; }
.photo-drop input { width: 100%; margin-top: 8px; color: var(--ink); }
.diary-section { display: flex; flex-direction: column; gap: 16px; }
.diary-section > .section-title-row h2 { font-size: 20px; }
.diary-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.diary-entry { display: flex; min-width: 0; flex-direction: column; gap: 8px; padding-left: 14px; border-left: 2px solid var(--divider); }
.diary-entry.latest { border-left-color: var(--accent); }
.diary-entry-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.diary-entry-heading h3 { font-size: 16px; }
.rating-squares { display: inline-flex; flex: none; gap: 3px; }
.rating-squares span { width: 9px; height: 9px; border: 1px solid var(--divider); }
.rating-squares span.filled { border-color: var(--ink); background: var(--ink); }
.diary-changes { padding-top: 8px; border-top: 1px solid var(--divider); font-size: 13px; }
.diary-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.diary-empty { grid-column: 1 / -1; }

.form-dialog { width: min(640px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 20px; overflow-y: auto; border: 2px solid var(--ink); border-radius: 0; background: var(--bg); }
.form-dialog::backdrop { background: color-mix(in srgb, var(--ink) 55%, transparent); }
.form-dialog form { display: grid; gap: 16px; }
.form-status { min-height: 18px; margin: 0; color: color-mix(in srgb, var(--ink) 70%, transparent); font-family: var(--mono); font-size: 11px; }
.form-status:empty { display: none; }
.form-status-error { color: var(--accent); font-weight: 700; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--divider); }
.dialog-actions { justify-content: flex-end; padding-top: 12px; border-top: 2px solid var(--divider); }
.dialog-actions .form-status { flex-basis: 100%; width: 100%; }
.rating-picker { display: grid; grid-template-columns: repeat(5, 44px); gap: 6px; }
.rating-picker input { position: absolute; width: 0; height: 0; opacity: 0; }
.rating-picker span { display: grid; width: 44px; height: 44px; cursor: pointer; place-items: center; border: 1px solid var(--divider); font-weight: 800; }
.rating-picker input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.upload-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.upload-preview-item { position: relative; min-width: 0; }
.upload-preview-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.upload-preview-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-preview-placeholder { display: grid !important; place-items: center; width: 100%; aspect-ratio: 1; background: var(--surface); color: var(--accent); font-size: 30px; font-weight: 800; }
.upload-preview-status { margin-top: 4px; }
.upload-preview-preparing { color: var(--accent); }
.upload-preview-error { color: var(--accent); white-space: normal !important; }
.upload-preview-remove { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; cursor: pointer; border: 1px solid var(--ink); background: var(--bg); color: var(--ink); font-size: 18px; font-weight: 800; }

.shopping-page { width: min(820px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 80px; }
.shopping-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--divider); }
.shopping-header h1 { font-size: 34px; }
.shopping-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#shopping-clear { color: var(--accent); padding-inline: 4px; }
#shopping-clear:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.shopping-list-content { display: grid; gap: 18px; padding-top: 18px; }
.shopping-section { display: grid; gap: 8px; }
.shopping-items { display: grid; border-top: 1px solid var(--divider); }
.shopping-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.shopping-item > input { width: 22px; height: 22px; margin: 11px; accent-color: var(--accent); }
.shopping-item-body { min-width: 0; }
.shopping-item-line { display: flex; min-width: 0; align-items: center; gap: 10px; }
.shopping-item-name { min-width: 0; flex: 1; font-size: 15px; }
.shopping-item-name strong { font-family: var(--font); font-weight: 800; }
.shopping-source-inline, .shopping-sources { color: color-mix(in srgb, var(--ink) 55%, transparent); font-family: var(--mono); font-size: 10px; }
.shopping-source-inline { flex: none; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shopping-sources { display: grid; gap: 3px; margin: 4px 0 0; padding: 0; list-style: none; }
.shopping-remove { display: grid; width: 36px; height: 36px; flex: none; cursor: pointer; place-items: center; border: 1px solid var(--divider); background: transparent; color: var(--ink); font-size: 20px; font-weight: 800; }
.shopping-item-checked { color: color-mix(in srgb, var(--ink) 45%, transparent); }
.shopping-item-checked .shopping-item-name { text-decoration: line-through; text-decoration-thickness: 1px; }
.shopping-clear-dialog { width: min(540px, calc(100% - 32px)); }
.shopping-clear-dialog form { gap: 18px; }
.shopping-clear-copy { display: grid; gap: 14px; }
.shopping-clear-copy h2 { font-size: 26px; }
.shopping-clear-copy p:not(.meta-text) { font-size: 18px; line-height: 1.45; }
.shopping-clear-actions { display: grid; gap: 12px; }
.shopping-clear-actions .button { width: 100%; justify-content: flex-start; padding: 18px 20px; font-size: 18px; }
.editor-shell { width: min(820px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 100px; }
.editor-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; border-bottom: 2px solid var(--divider); }
.editor-header > div { display: flex; align-items: baseline; gap: 10px; }
.editor-header h1 { font-size: 25px; }
.editor-form { display: grid; gap: 0; }
.editor-section { display: grid; gap: 16px; padding: 24px 0; border-bottom: 2px solid var(--divider); }
.editor-section > h2, .editor-section .section-title-row h2 { font-size: 20px; }
.title-input { min-height: 50px; font-size: 18px; font-weight: 800; }
.yield-editor-grid { grid-template-columns: 1fr 2fr; }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.four-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inline-check { width: fit-content; }
.repeatable-list { display: grid; gap: 12px; }
.repeatable-row { position: relative; display: grid; grid-template-columns: 44px repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 14px; border: 1px solid var(--divider); }
.repeatable-row legend { padding: 0 6px; font-weight: 800; }
.drag-handle { width: 44px; min-height: 44px; cursor: grab; border: 1px solid var(--divider); background: var(--bg); font-size: 20px; }
.group-field { grid-column: span 2; }
.ingredient-name-field, .instruction-text-field { grid-column: span 3; }
.scalable-field { grid-column: 2 / span 3; }
.remove-row { justify-self: end; }
.add-row-button { width: fit-content; }
.reference-editor-section .photo-grid:empty { display: none; }
.sticky-form-actions { position: sticky; z-index: 20; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 12px; border: 2px solid var(--divider); background: var(--bg); }
.sticky-form-actions .button-primary { order: 1; }

.login-shell { display: grid; min-height: 100vh; padding: 24px; place-items: center; }
.login-card { display: grid; width: min(440px, 100%); gap: 12px; padding: 28px; border: 2px solid var(--ink); background: var(--surface); }
.login-card h1 { font-size: 36px; text-transform: uppercase; }
.form-error { padding: 10px; border-left: 2px solid var(--danger); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); color: var(--danger); }
.toast { position: fixed; z-index: 100; right: 18px; bottom: 18px; max-width: min(360px, calc(100% - 36px)); padding: 12px 16px; transform: translateY(15px); background: var(--ink); color: var(--bg); opacity: 0; pointer-events: none; transition: .18s ease; }
.toast-visible { transform: translateY(0); opacity: 1; }
.toast-error { background: var(--danger); }

@media (max-width: 1100px) {
  .recipe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .recipe-hero { grid-template-columns: minmax(0, 1fr) 360px; }
  .recipe-body { grid-template-columns: 360px minmax(0, 1fr); }
}

@media (max-width: 820px) {
  body { padding-bottom: 70px; }
  .site-frame { border-right: 0; border-left: 0; }
  body:has(#recipe-detail) .site-nav, body:has(#recipe-editor) .site-nav { display: none; }
  .site-nav { min-height: 58px; padding: 8px 12px; }
  .nav-brand { font-size: 15px; }
  .nav-links, .nav-add, .nav-recipe-action { display: none; }
  .nav-menu summary { width: 40px; height: 40px; }
  .index-layout { display: block; min-height: auto; }
  .filter-sidebar { position: fixed; z-index: 60; inset: 0; display: none; overflow-y: auto; padding: 16px; border: 0; background: var(--bg); }
  .filter-sidebar.filter-visible { display: flex; }
  .mobile-filter-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 2px solid var(--divider); }
  .mobile-filter-heading h2 { font-size: 20px; }
  .filter-sidebar > .search-field { display: none; }
  .filter-options.two-up-mobile { grid-template-columns: 1fr 1fr; }
  .mobile-time-filter { display: grid; }
  .filter-actions { position: sticky; bottom: -16px; margin: 0 -16px -16px; padding: 12px 16px; border-top: 2px solid var(--divider); background: var(--bg); }
  .filter-actions .button { justify-content: center; }
  .index-content { padding: 16px; }
  .mobile-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 14px; }
  .mobile-search-row .button { min-width: 88px; justify-content: center; }
  .index-title-row { align-items: flex-end; }
  .index-title-row h1 { font-size: 23px; }
  .index-title-row .meta-text { max-width: 50%; text-align: right; }
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .recipe-card { padding: 8px; }
  .recipe-card-title { font-size: 15px; -webkit-line-clamp: 4; }
  .recipe-card-meta { font-size: 9px; }
  .recent-table-wrap { display: none; }
  .recent-mobile { display: grid; }
  .recent-mobile-row { display: flex; min-height: 64px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--divider); color: var(--ink); text-decoration: none; }
  .recent-mobile-row div { display: grid; }
  .mobile-sticky-action { position: fixed; z-index: 25; right: 0; bottom: 0; left: 0; display: flex; min-height: 58px; justify-content: center; }
  .mobile-recipe-bar { display: flex; min-height: 50px; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 2px solid var(--divider); }
  .mobile-recipe-bar a { color: var(--ink); font-weight: 800; text-decoration: none; }
  .recipe-hero { display: flex; flex-direction: column; border-bottom: 0; }
  .hero-image { order: -1; width: 100%; height: auto; min-height: 0; aspect-ratio: 16 / 9; border: 0; border-bottom: 2px solid var(--divider); }
  .hero-copy { gap: 10px; padding: 16px; }
  .hero-copy h1 { font-size: 27px; }
  .recipe-summary { font-size: 14px; }
  .recipe-time-stats, .recipe-stats { width: 100%; }
  .recipe-time-stats > div, .recipe-stats > div { padding: 8px; }
  .recipe-time-stats > div:first-child, .recipe-stats > div:first-child { padding-left: 0; }
  .recipe-time-stats dd, .recipe-stats dd { font-size: 12px; }
  .source-stat { flex-basis: 100%; }
  .recipe-body { display: block; }
  .ingredients-column, .method-column { gap: 16px; padding: 16px; border: 0; }
  .method-column { padding-top: 0; }
  .yield-panel { margin-bottom: 2px; }
  .mobile-custom-yield { display: flex !important; }
  .yield-multipliers > button { min-height: 40px; padding: 6px 3px; font-size: 12px; }
  .ingredient-item { padding: 10px 0; }
  .ingredient-quantity { min-width: 74px; }
  .instruction-item p { font-size: 15px; }
  .nutrition-values dd { font-size: 16px; }
  .photo-sections { grid-template-columns: 1fr; gap: 18px; }
  .photo-carousel-stage, .photo-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-lightbox { padding: 12px; }
  .photo-lightbox-content { width: calc(100vw - 24px); height: calc(100vh - 24px); height: calc(100svh - 24px); }
  .photo-lightbox-close { top: 6px; right: 6px; }
  .photo-lightbox-previous { left: 6px; }
  .photo-lightbox-next { right: 6px; }
  .diary-list { grid-template-columns: 1fr; }
  .diary-entry { padding-bottom: 16px; }
  .diary-section > .section-title-row .open-diary { display: none; }
  .form-dialog { width: 100%; max-width: none; height: 100%; max-height: none; padding: 16px; border: 0; }
  .form-dialog form { min-height: 100%; }
  .shopping-clear-dialog { width: min(540px, calc(100% - 32px)); height: fit-content; max-height: calc(100vh - 32px); max-height: calc(100svh - 32px); padding: 20px; border: 2px solid var(--ink); }
  .shopping-clear-dialog form { min-height: 0; }
  .dialog-actions { position: sticky; bottom: -16px; margin: auto -16px -16px; padding: 12px 16px; background: var(--bg); }
  .dialog-actions .button { flex: 1; justify-content: center; }
  .status-entry-options { flex-wrap: wrap; }
  .status-entry-options > label { min-width: 50%; }
  .status-entry-options > label > span { border-bottom: 1px solid var(--divider); }
  .editor-shell { width: auto; margin: 0 16px; padding-bottom: 70px; }
  .editor-header { position: sticky; z-index: 20; top: 0; background: var(--bg); }
  .editor-header > div { display: grid; gap: 2px; }
  .editor-section { padding: 20px 0; }
  .status-editor { display: grid; grid-template-columns: repeat(2, 1fr); }
  .status-editor > label > span { border-bottom: 1px solid var(--divider); }
  .repeatable-row { grid-template-columns: 44px repeat(2, minmax(0, 1fr)); padding: 10px; }
  .group-field { grid-column: 2 / -1; }
  .ingredient-name-field, .instruction-text-field { grid-column: 1 / -1; }
  .scalable-field { grid-column: 1 / span 2; }
  .sticky-form-actions { right: 0; bottom: 0; left: 0; margin: 0 -16px; border-right: 0; border-bottom: 0; border-left: 0; }
  .sticky-form-actions .button { flex: 1; justify-content: center; }
}

@media (max-width: 520px) {
  .two-columns { grid-template-columns: 1fr; }
  .three-columns, .four-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rating-picker { grid-template-columns: repeat(5, 1fr); }
  .rating-picker span { width: 100%; }
  .upload-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-title-row { align-items: flex-start; }
  .editor-section .section-title-row { display: grid; }
  .yield-editor-grid { grid-template-columns: 1fr 2fr; }
}

@media (max-width: 680px) {
  .shopping-page { width: auto; padding: 16px 16px 80px; }
  .shopping-header { align-items: flex-end; }
  .shopping-header h1 { font-size: 28px; }
  .shopping-item-line { display: grid; grid-template-columns: minmax(0, 1fr) 36px; grid-template-areas: "name remove" "source remove"; gap: 3px 10px; align-items: center; }
  .shopping-item-name { grid-area: name; }
  .shopping-source-inline { grid-area: source; max-width: none; }
  .shopping-remove { grid-area: remove; }
  .ingredient-item { grid-template-columns: minmax(74px, auto) minmax(0, 1fr) 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
