@font-face {
  font-family: "Chao Shi Ji Label";
  src: url("./assets/fonts/chao-shi-ji-label.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Chao Shi Ji Mobile Serif";
  src: url("./assets/fonts/mobile-title.woff") format("woff");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --backdrop: #20251f;
  --ink: #f4eddf;
  --secondary: #c0c4b5;
  --quiet: #aab2a5;
  --accent: #dfc18d;
  --line: #e2e4ce29;
  --serif: "Songti SC", "Noto Serif CJK SC", "Noto Serif SC", "STSong", SimSun, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overscroll-behavior: none; }
html.dialog-scroll-locked { overflow: hidden; }
html.dialog-scroll-locked body {
  position: fixed;
  top: var(--dialog-scroll-top, 0px);
  left: var(--dialog-scroll-left, 0px);
  width: 100%;
  overflow: hidden;
}
body {
  min-height: 100vh;
  margin: 0;
  isolation: isolate;
  background: var(--backdrop);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--backdrop) url("./assets/studio-moss.webp") center / cover no-repeat;
}
button { appearance: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
#table-view { --header-default-top: max(10px, env(safe-area-inset-top, 0px)); }
.table-header { padding: var(--header-default-top) 0 0; }
.header-inner {
  width: min(100% - 44px, 940px);
  min-height: 45px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-actions { display: flex; align-items: center; gap: clamp(11px, 3vw, 21px); }
.account-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--secondary); font-size: 12px; white-space: nowrap; text-decoration: none; }
.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: "Chao Shi Ji Label", var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .1em;
}
.brand-mark {
  flex: none;
  width: 24px;
  height: 24px;
  background: url("./assets/brand-glyph.png") center / contain no-repeat;
}
.pantry-button {
  display: inline-flex;
  min-height: 44px;
  gap: 7px;
  align-items: center;
  padding: 0 0 0 10px;
  background: none;
  color: var(--secondary);
  font-size: 12px;
  white-space: nowrap;
}
.pantry-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("./assets/pantry-basket.png") center / contain no-repeat;
  mask: url("./assets/pantry-basket.png") center / contain no-repeat;
}
.table {
  --plate-size: clamp(176px, 57vw, 256px);
  --plate-top: 16px;
  text-align: center;
}
h1 { margin: 0; font-family: var(--serif); font-size: clamp(27px, 7vw, 43px); font-weight: 600; line-height: 1.25; letter-spacing: .055em; }
.place-setting { margin: clamp(58px, 14vh, 136px) auto 0; max-width: 1060px; }
.wheel {
  position: relative;
  height: calc(var(--plate-size) + var(--plate-top) + 33px);
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  cursor: grab;
  user-select: none;
}
.wheel:focus { outline: none; }
.wheel[data-keyboard-focus]:focus-visible .wheel-track::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 110;
}
.wheel:active { cursor: grabbing; }
.wheel-track { position: absolute; left: 50%; top: var(--plate-top); width: var(--plate-size); height: var(--plate-size); transform: translateX(-50%); }
.wheel-pagination { display: none; }
.plate { position: absolute; inset: 0; margin: 0; pointer-events: none; transform-origin: center; }
.plate > img, .detail-photo > img {
  width: 100%; height: 100%; display: block;
  filter: drop-shadow(11px 19px 12px #0e120eb8) drop-shadow(-2px -2px 7px #c2b39020);
}
.composed-plate {
  position: relative;
  width: 94%;
  aspect-ratio: 1;
  margin: 3% auto;
  border-radius: 50%;
  border: 1px solid #f6ead5cc;
  background:
    radial-gradient(circle closest-side, #0000 73%, #866f523d 75%, #fff5dbb3 79%, #dbccb2 89%, #f5e5cc 95%, #a59174 100%),
    linear-gradient(138deg, #f7ead5, #dbccb2 81%);
  box-shadow: 11px 20px 24px #0e120eb3, inset 2px 2px 1px #fffbefe6;
}
.plate-food {
  position: absolute;
  width: var(--food-size);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
}
.plate-food img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(2px 4px 3px #61492b69); }
.meal-area { padding: 24px 22px calc(30px + env(safe-area-inset-bottom)); padding-top: clamp(19px, 3.6svh, 34px); }
.table-date {
  display: block;
  margin: 0 auto 10px;
  color: rgba(255,255,255,.68);
  font-size: 12px;
  letter-spacing: .08em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#table-view .table-history {
  display: block;
  min-height: 44px;
  margin: 9px auto 0;
  color: rgba(255,255,255,.72);
}
.recipe { max-width: 426px; margin: auto; text-align: center; }
.meal-intro { display: grid; gap: 6px; justify-items: center; }
h2 { margin: 0; font-family: var(--serif); font-size: clamp(21px, 5.6vw, 28px); line-height: 1.35; font-weight: 650; letter-spacing: .03em; }
.meal-description, .meal-note, .meal-feedback { margin: 0; font-size: 12px; line-height: 1.6; letter-spacing: .045em; }
.meal-description { color: var(--secondary); }
.meal-note { color: var(--quiet); }
.meal-feedback { color: var(--accent); }
.serve-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px auto 0;
  min-height: 44px;
  border: 1px solid #dfc18d70;
  padding: 0 21px;
  border-radius: 24px;
  background: #dfc18d0e;
  color: var(--ink);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  transition: background .16s ease, transform .16s ease;
}
.serve-button:active { transform: scale(.97); }
.serve-button[aria-pressed="true"] { background: #dfc18d30; color: #ffdfaa; }
.serve-button:disabled { opacity: .6; cursor: default; }
.back-link {
  color: var(--secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.back-link span {
  width: 7px;
  height: 7px;
  border-right: 1px solid;
  border-top: 1px solid;
  transform: rotate(45deg);
}
.compose-link, .text-button {
  min-height: 42px;
  padding: 0 6px;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
}
.recipe > .serve-button { margin-top: 25px; }
.detail-footer .compose-link { display: block; margin: 4px auto 0; }
.detail-view { padding: max(10px, env(safe-area-inset-top)) 22px calc(30px + env(safe-area-inset-bottom)); }
.detail-header, .detail-recipe { max-width: 560px; margin: auto; }
.back-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding-left: 2px; }
.back-link span { transform: rotate(-135deg); }
.detail-hero {
  display: grid;
  justify-items: center;
  gap: 19px;
  padding: 15px 0 29px;
  text-align: center;
}
.detail-photo { width: clamp(160px, 51vw, 232px); aspect-ratio: 1; }
.detail-intro h1 { font-size: clamp(27px, 7.7vw, 38px); }
#detail-title:focus, #method-title:focus, #cook-title:focus, #cook-finished-title:focus { outline: none; }
.detail-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px 12px; margin-top: 13px; }
.detail-actions .serve-button { margin: 0; }
.detail-actions .serve-button[data-cooking] { background: var(--accent); color: var(--backdrop); }
.detail-note { margin: 8px 0 0; color: var(--secondary); font-size: 13px; line-height: 1.6; }
.detail-photo-note { margin: 5px 0 0; color: var(--quiet); font-size: 12px; }
.detail-section { padding-top: 20px; border-top: 1px solid var(--line); }
.detail-section + .detail-section { margin-top: 27px; }
.detail-section h2 { font-size: 20px; }
.detail-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.detail-section-heading span, .amount { color: var(--quiet); font-size: 12px; }
.ingredients { padding: 0; margin: 0; list-style: none; }
.ingredients li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; min-height: 56px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ingredients li:last-child { border-bottom: 0; }
.ingredient-info { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.ingredient-role { min-width: 40px; color: var(--quiet); font-size: 12px; }
.ingredient-name { display: flex; flex-direction: column; line-height: 1.55; overflow-wrap: anywhere; }
.ingredient-quantity { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.ingredient-quantity button { width: 40px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--accent); font-size: 18px; }
.ingredient-quantity button:disabled { opacity: .35; cursor: default; }
.ingredient-quantity output { min-width: 46px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.swap { grid-column: 1 / -1; justify-self: end; min-height: 38px; padding: 0 1px 0 10px; background: transparent; color: var(--accent); font-size: 12px; text-underline-offset: 4px; }
.method { padding-inline-start: 22px; color: var(--secondary); font-size: 14px; line-height: 1.75; margin: 18px 0 0; }
#method-section { scroll-margin-top: 16px; }
.method li + li { margin-top: 10px; }
.nutrition-values { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0 0; }
.nutrition-values dt { margin-bottom: 4px; color: var(--quiet); font-size: 12px; }
.nutrition-values dd { margin: 0; font-size: 17px; font-weight: 600; }
.nutrition-note, .nutrition-tip { margin: 10px 0 0; color: var(--quiet); font-size: 12px; line-height: 1.6; }
.nutrition-tip { color: var(--accent); }
.nutrition-source { display: inline-block; margin-top: 7px; color: var(--quiet); font-size: 12px; text-underline-offset: 3px; }
.method li::marker { color: var(--accent); }
.detail-footer { margin-top: 24px; text-align: center; }
.detail-footer .cancel-selection { color: var(--quiet); }
.empty { padding-top: 62px; }
.empty p, .dialog-copy { color: var(--secondary); font-size: 14px; line-height: 1.65; }
dialog {
  max-height: calc(100% - 36px);
  width: min(100% - 32px, 444px);
  max-width: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #303a31;
  color: var(--ink);
  box-shadow: 0 20px 65px #10151099;
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog:modal { position: fixed; inset: 0; }
dialog::backdrop { background: #131813c9; touch-action: none; }
.editor-dialog { padding: 17px 21px 22px; }
.cook-dialog { max-width: 436px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.cook-dialog .dialog-head { align-items: start; }
.cook-dialog .dialog-head h2 { line-height: 1.35; margin: 6px 10px 5px 0; }
.cook-dialog .close-button { flex: 0 0 44px; }
.cook-step-count { margin: 16px 0 7px; color: var(--accent); font-size: 12px; letter-spacing: .04em; }
.cook-step-panel progress { display: block; width: 100%; height: 4px; appearance: none; border: 0; border-radius: 5px; accent-color: var(--accent); }
.cook-step-panel progress::-webkit-progress-bar { background: var(--line); border-radius: 5px; }
.cook-step-panel progress::-webkit-progress-value { background: var(--accent); border-radius: 5px; }
.cook-instruction { min-height: 6em; margin: 20px 0 11px; font-size: clamp(17px, 4.8vw, 21px); line-height: 1.65; }
.cook-portions { border-top: 1px solid var(--line); color: var(--secondary); font-size: 13px; }
.cook-portions summary { min-height: 44px; padding-top: 12px; cursor: pointer; }
.cook-portions ul { list-style: none; padding: 0; margin: 0 0 7px; }
.cook-portions li { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; }
.cook-portions li span:last-child { color: var(--ink); white-space: nowrap; }
.cook-finished { display: grid; justify-items: center; gap: 15px; padding: 14px 0 10px; }
.cook-finished .detail-photo { width: 128px; }
.cook-finished h3 { margin: 0; font-family: var(--serif); font-size: 24px; }
.cook-finished p { margin: -9px 0 0; color: var(--quiet); font-size: 13px; }
.cook-finished .cook-history-link { margin: -5px 0 -12px; }
.cook-actions { display: flex; gap: 12px; margin-top: 13px; }
.cook-actions .text-button { min-width: 73px; }
.cook-actions .text-button:disabled { opacity: .45; cursor: default; }
.cook-actions .save-button { flex: 1; width: auto; margin: 0; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { font-size: 24px; }
.dialog-copy { margin: 7px 0 15px; }
.close-button { width: 44px; height: 44px; margin-right: -9px; border-radius: 50%; background: transparent; font-size: 26px; }
.pantry-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: min(33vh, 250px); overflow: auto; }
.pantry-categories { display: flex; gap: 5px; flex-wrap: wrap; margin: -5px 0 10px; }
.pantry-categories button { min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 17px; color: var(--secondary); background: transparent; font-size: 12px; }
.pantry-categories button[aria-pressed="true"] { border-color: var(--accent); background: #dfc18d23; color: var(--accent); }
.pantry-items label { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font-size: 13px; overflow-wrap: anywhere; }
.pantry-items input { margin: 0; accent-color: var(--accent); width: 17px; height: 17px; flex-shrink: 0; }
.save-button { display: block; margin-top: 18px; width: 100%; min-height: 46px; border-radius: 6px; background: var(--accent); color: var(--backdrop); font-weight: 650; }
.save-button:disabled { opacity: .48; cursor: default; }
.editor-dialog input[type="text"], .editor-dialog select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #171c1744;
  color: var(--ink);
  font: 16px var(--sans);
}
.editor-dialog input::placeholder { color: var(--quiet); }
.add-food { display: flex; gap: 8px; margin-top: 11px; }
.editor-dialog select { flex: 0 0 77px; width: auto; padding-inline: 5px; }
.add-food button { flex-shrink: 0; padding-inline: 15px; border-radius: 5px; background: #dfc18d26; color: var(--accent); font-size: 13px; }
.composer-dish { width: 124px; margin: 12px auto 15px; }
.composer-stock { display: flex; justify-content: space-between; align-items: center; color: var(--secondary); font-size: 13px; }
.composer-stock .text-button { margin-right: -6px; }
.composer-options { max-height: min(33vh, 300px); overflow: auto; }
.composer-options fieldset { min-width: 0; margin: 0 0 10px; padding: 0; border: 0; }
.composer-options legend { margin-bottom: 5px; color: var(--accent); font-size: 12px; }
.composer-options .pantry-items { max-height: none; }
.compose-title { display: block; margin: 15px 0 6px; color: var(--secondary); font-size: 13px; }
.pantry-photos { display: block; margin: 8px auto -7px; }
.photo-field { display: block; margin: 8px 0 6px; color: var(--secondary); font-size: 13px; }
#photo-food { width: 100%; }
.photo-upload {
  display: grid;
  place-items: center;
  min-height: 44px;
  margin: 10px 0 0;
  border: 1px solid #dfc18d70;
  border-radius: 5px;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
}
#photo-file:focus-visible + .photo-upload { outline: 2px solid var(--accent); outline-offset: 3px; }
.photo-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photo-previews figure { margin: 0; text-align: center; }
.photo-previews canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  background-color: #eee5d6;
  border-radius: 5px;
}
#photo-original { cursor: crosshair; }
.photo-previews figcaption { margin-top: 5px; color: var(--secondary); font-size: 11px; }
.photo-range { display: flex; align-items: center; gap: 12px; margin-top: 13px; font-size: 13px; }
.photo-range input { flex: 1; min-width: 0; min-height: 31px; accent-color: var(--accent); }
.photo-status { min-height: 1.35em; margin: 8px 0 0; color: var(--secondary); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.account-page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(58px, calc(env(safe-area-inset-top, 0px) + 20px)) 24px calc(30px + env(safe-area-inset-bottom, 0px));
}
.account-content { width: min(100%, 360px); text-align: center; }
.account-brand { display: inline-flex; min-height: 44px; color: var(--ink); text-decoration: none; }
.account-photo {
  display: block;
  width: clamp(142px, 43vw, 206px);
  height: auto;
  margin: clamp(27px, 5.5vh, 50px) auto 21px;
  filter: drop-shadow(8px 13px 14px #0e120eb8);
}
.account-panel h1 { font-size: 25px; }
.account-primary { padding-inline: 23px; background: var(--accent); color: var(--backdrop); text-decoration: none; }
.account-primary:hover { background: #ecd09f; }
.account-local { margin: 13px 0 0; color: var(--quiet); font-size: 12px; line-height: 1.65; }
.account-secondary { display: inline-flex; align-items: center; margin-top: 4px; }
.family-unlock-form { display: grid; justify-items: center; margin-top: 14px; }
.family-unlock-form input[type="password"] {
  width: min(100%, 245px);
  min-height: 46px;
  padding: 9px 13px;
  border: 1px solid #dfc18d53;
  border-radius: 6px;
  background: #171c1744;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  text-align: center;
}
.family-unlock-form input[type="password"]::placeholder { color: var(--quiet); }
.family-unlock-form input[type="password"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.family-pass-error { margin: 9px 0 0; color: #ffcdb2; }
@media (max-width: 640px) {
  #table-view { --header-mobile-top: max(54px, calc(env(safe-area-inset-top, 0px) + 12px)); }
  .table-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-top: var(--header-mobile-top);
  }
  html.dialog-scroll-locked .table-header { top: max(0px, calc(0px - var(--dialog-scroll-top, 0px))); }
  .place-setting { margin-top: max(18px, calc(clamp(58px, 14vh, 136px) + var(--header-default-top) - var(--header-mobile-top))); }
}
@media (min-width: 720px) {
  .table { --plate-size: clamp(272px, 35vw, 338px); --plate-top: 19px; }
  .wheel { height: calc(var(--plate-size) + var(--plate-top) + 39px); }
  .detail-hero { grid-template-columns: auto 1fr; justify-items: start; align-items: center; gap: 36px; padding-bottom: 36px; text-align: left; }
  .detail-actions { justify-content: flex-start; }
}
@media (hover: hover) {
  .pantry-button:hover, .back-link:hover, .account-link:hover { color: var(--ink); }
  .serve-button:hover, .close-button:hover { background-color: #dfc18d26; }
}
@media (prefers-reduced-motion: reduce) {
  .serve-button { transition: none; }
}

@media (max-width: 640px) {
  #table-view {
    --accent: #F2EFE6;
    --mobile-serif: "Songti SC", "Noto Serif SC", "Chao Shi Ji Mobile Serif", serif;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: clip;
  }
  #table-view .brand {
    gap: 6px;
    font-family: var(--mobile-serif);
    font-size: 18px;
    font-weight: 500;
    color: #F2EDE3;
    white-space: nowrap;
  }
  #table-view .brand-mark, #table-view .pantry-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
  }
  #table-view .pantry-icon {
    background: rgba(255,255,255,.8);
    -webkit-mask: url("./assets/pantry-basket-outline.png") center / contain no-repeat;
    mask: url("./assets/pantry-basket-outline.png") center / contain no-repeat;
  }
  #table-view .pantry-button {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    gap: 5px;
    color: rgba(255,255,255,.8);
    font-size: 13px;
  }
  #table-view .wheel {
    height: calc(var(--plate-size) + var(--plate-top) + 8px);
  }
  #table-view .plate {
    filter: drop-shadow(0 24px 24px rgba(0,0,0,.45)) drop-shadow(0 4px 6px rgba(0,0,0,.3));
  }
  #table-view .plate > img {
    filter: none;
    -webkit-mask-image: radial-gradient(ellipse closest-side, #000 91%, rgba(0,0,0,.82) 97%, transparent);
    mask-image: radial-gradient(ellipse closest-side, #000 91%, rgba(0,0,0,.82) 97%, transparent);
  }
  #table-view .plate .composed-plate { box-shadow: inset 2px 2px 1px #fffbefe6; }
  .wheel-pagination {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    height: 4px;
    margin-top: 3px;
    pointer-events: none;
  }
  .wheel-pagination span { width: 4px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.3); }
  .wheel-pagination[data-count="2"] span:last-child { display: none; }
  .wheel-pagination[data-active="0"] span:nth-child(1),
  .wheel-pagination[data-active="1"] span:nth-child(2),
  .wheel-pagination[data-active="2"] span:nth-child(3) { width: 14px; background: rgba(255,255,255,.9); }
  #table-view .meal-area {
    padding-top: clamp(28px, 4.3svh, 44px);
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  }
  #table-view .meal-intro { gap: 0; }
  #meal-title {
    padding-left: .1em;
    color: #F2EDE3;
    font-family: var(--mobile-serif);
    font-size: 24px;
    font-weight: 500;
    letter-spacing: .1em;
    overflow-wrap: anywhere;
  }
  #meal-description { margin-top: 10px; color: rgba(255,255,255,.7); font-size: 14px; letter-spacing: .04em; }
  #meal-note { margin-top: 6px; color: rgba(255,255,255,.55); font-size: 13px; font-variant-numeric: tabular-nums; }
  #table-view .meal-feedback { margin-top: 6px; color: rgba(255,255,255,.7); }
  #table-view .recipe > .serve-button {
    width: 176px;
    height: 48px;
    margin-top: 32px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: #F2EFE6;
    color: #1A1A18;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .04em;
    transition: transform 150ms ease, opacity 150ms ease;
  }
  #table-view .recipe > .serve-button:active { transform: scale(.97); opacity: .85; }
  @supports (clip-path: inset(0 0 -64px)) {
    #table-view .wheel { overflow: visible; clip-path: inset(0 0 -64px); }
  }
  @media (prefers-reduced-motion: reduce) {
    #table-view .recipe > .serve-button { transition: none; }
  }
}

.family-entry { padding-inline: 0; }
#edit-time { display: block; margin: 8px auto 0; }
.family-share-meal { margin-top: 8px; }
.family-dialog h3 { margin: 0; font-family: var(--serif); font-size: 19px; }
.family-tabs, .family-times, .family-feedback { display: flex; flex-wrap: wrap; gap: 7px; }
.family-tabs { margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.family-times { margin: 10px 0 4px; }
.family-tabs button, .family-times button {
  min-height: 40px;
  padding: 0 11px;
  background: transparent;
  color: var(--secondary);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 13px;
}
.family-tabs button[aria-pressed="true"], .family-times button[aria-pressed="true"] {
  border-color: #dfc18d80;
  background: #dfc18d16;
  color: var(--accent);
}
.family-feedback { justify-content: center; margin-top: 7px; }
.family-feedback .text-button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.family-footer, .family-week-heading, .family-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.family-footer { margin-top: 15px; border-top: 1px solid var(--line); }
.family-week-heading .text-button { flex-shrink: 0; }
.family-week-actions {
  display: flex;
  flex-wrap: wrap;
  column-gap: 15px;
  border-bottom: 1px solid var(--line);
}
.family-week-actions button, .family-row-actions button { white-space: nowrap; }
.family-dialog .text-button:disabled { opacity: .42; cursor: default; }
.family-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.family-date-button {
  min-width: 0;
  min-height: 60px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  padding: 4px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--secondary);
  font-size: 11px;
}
.family-date-button[aria-pressed="true"] { color: var(--accent); border-color: #dfc18d80; background: #dfc18d18; }
.family-date { font-family: var(--serif); font-size: 17px; line-height: 1; }
.family-day-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.family-day-dot[hidden] { display: block !important; visibility: hidden; }
#family-week-day { padding-top: 16px; min-height: 124px; }
#family-week-day details { color: var(--secondary); font-size: 13px; }
#family-week-day summary { padding: 6px 0; cursor: pointer; }
.family-week-recipe { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; }
.family-week-recipe h4 { margin: 0 0 4px; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.family-week-recipe p { margin: 2px 0; color: var(--secondary); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.family-week-plate { width: 72px; aspect-ratio: 1; }
.family-week-plate > img { display: block; width: 100%; height: auto; filter: drop-shadow(2px 4px 5px #1119); }
.family-week-plate .composed-plate { box-shadow: 2px 4px 5px #1119; }
.family-row-actions { justify-content: flex-start; gap: 4px 14px; flex-wrap: wrap; }
#family-day-options { display: grid; gap: 10px; }
.family-recommendation {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #171c1728;
}
.family-edit-foods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: 158px;
  overflow: auto;
}
.family-food-choice {
  min-height: 42px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--secondary);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.family-food-choice[aria-pressed="true"] { border-color: #dfc18d80; color: var(--accent); background: #dfc18d18; }
.family-add-food { margin-bottom: 15px; }
.family-shopping { padding-top: 14px; }
.family-shopping-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 8px; }
#family-shopping-list, .family-edit-portions { margin: 0; padding: 0; list-style: none; }
#family-shopping-list li, .family-edit-portions li {
  display: grid;
  align-items: center;
  gap: 3px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
#family-shopping-list li { grid-template-columns: minmax(0, 1fr) auto; padding: 9px 0 4px; }
#family-shopping-list strong { overflow-wrap: anywhere; }
.family-shopping-amount { text-align: right; color: var(--secondary); font-size: 12px; }
.family-on-hand { display: flex; align-items: center; gap: 6px; color: var(--secondary); white-space: nowrap; }
#family-shopping-list button { justify-self: end; white-space: nowrap; }
.family-edit-portions li { grid-template-columns: minmax(0, 1fr) auto auto 44px; }
.family-edit-portions li > span { overflow-wrap: anywhere; }
.family-on-hand input, .family-edit-portions input {
  width: 65px;
  min-height: 44px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #171c1744;
  color: var(--ink);
  font: 16px var(--sans);
}
#family-code {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #171c1744;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  resize: vertical;
  overflow-wrap: anywhere;
}
@media (max-width: 360px) {
  .header-inner { width: calc(100% - 32px); }
  .header-actions { gap: 9px; }
  .pantry-button { padding-left: 0; }
}

.records-week {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  margin: 5px 0 13px;
}
.records-week span { text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.records-week button { white-space: nowrap; }
.records-week button:disabled { opacity: .42; cursor: default; }
.records-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin: 0;
  padding: 14px 0;
  border-block: 1px solid var(--line);
}
.records-summary dt { color: var(--quiet); font-size: 12px; }
.records-summary dd { margin: 4px 0 0; font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.records-note { margin: 13px 0; color: var(--secondary); font-size: 13px; line-height: 1.6; }
.records-day { padding: 12px 0 4px; border-top: 1px solid var(--line); }
.records-day h3 { margin: 0; color: var(--secondary); font-size: 13px; font-weight: 500; }
.records-day ul { margin: 0; padding: 0; list-style: none; }
.records-day li { margin: 9px 0 12px; }
.record-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.record-heading strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.record-heading span { color: var(--quiet); font-size: 12px; font-variant-numeric: tabular-nums; }
.records-day p { margin: 4px 0 0; color: var(--secondary); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
