/* Hasty Dish on a phone (linked after app.css by the mobile frame alone): the same
   garden-to-table look, made compact — a slim header, the counter edge, the main links
   as tabs on a wooden ledge at the foot, one column, thumb-sized controls. */

/* the background drawings scroll with the page (fixed backgrounds stutter on phones)
   and stay fainter, so the small screen is never busy */
body::before { position: absolute; background-size: 220% auto; background-repeat: repeat-y; background-position: center top; opacity: .38; }

/* the frame */
.dd-shell-mobile .dd-frame-bar { gap: .5rem; padding-block: .25rem; }
.dd-shell-mobile .hd-logo { width: 2.3rem; height: 2.3rem; }
.dd-shell-mobile .hd-name { font-size: 1.15rem; }
.dd-shell-mobile .dd-frame-account .who { display: none; }
.dd-shell-mobile .dd-frame-account .signin { font-size: .92rem; }
.dd-shell-mobile .hd-counter { height: 9px; }
.dd-shell-mobile .dd-frame-main { padding-top: 1rem; padding-bottom: 2rem; }
.dd-shell-mobile .dd-frame-adminnav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; scrollbar-width: none; }
.dd-shell-mobile .dd-frame-adminnav a { white-space: nowrap; }
.dd-shell-mobile .dd-frame-tabs { box-shadow: 0 -5px 0 var(--hd-wood-pale), 0 -6px 0 color-mix(in srgb, var(--hd-wood-deep) 25%, transparent); }
.dd-shell-mobile .dd-frame-tabs a, .dd-shell-mobile .dd-frame-tabs .kit-menu > summary { font-size: .78rem; min-height: 3.4rem; padding-top: .7rem; }
.dd-shell-mobile .dd-frame-footer { margin-top: 2rem; padding: 1.5rem 0 6.5rem; }
.dd-shell-mobile .dd-frame-footer::before { background-size: 180% auto; }
.hd-foot-small { display: none; }

/* page heads and panels */
.page-back a { min-block-size: 44px; min-inline-size: 44px; }
.hd-pagehead h1 { font-size: 1.65rem; }
.hd-panel { max-height: none; overflow: visible; padding: 1rem; border-radius: var(--radius, 12px); }
.dd-arrange-side_panel { gap: 1rem; }

/* Account recovery: leave room for the keyboard and give the small link a tap target. */
.dd-shell-mobile .dd-frame-main { --hd-recovery-padding: 1rem; }
.dd-shell-mobile .dd-frame-main .card.narrow:has(
  a:is([href$="/forgot"], [href*="/forgot?"]),
  form:is([action$="/forgot"], [action*="/forgot?"], [action$="/reset"], [action*="/reset?"])
) :is(input[type="email"], input[type="password"], input[autocomplete="username"]) {
  min-block-size: 2.75rem;
  max-inline-size: 100%;
  font-size: max(1rem, 16px);
}
.dd-shell-mobile .dd-frame-main a:is([href$="/forgot"], [href*="/forgot?"]):not(.btn) {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
}

/* the home page */
.hd-hero { min-height: 12rem; padding: 1.25rem; background-position: 70% 40%; border-radius: var(--radius, 12px); }
.hd-hero::before { background: linear-gradient(180deg, color-mix(in srgb, var(--hd-paper) 92%, transparent) 0%, color-mix(in srgb, var(--hd-paper) 70%, transparent) 55%, color-mix(in srgb, var(--hd-paper) 30%, transparent) 100%); }
.hd-hero h1 { font-size: 2rem; }
.hd-hero .lede { font-size: 1rem; }
.hd-builder .dd-arrange-main > * + * { margin-top: 1rem; }
.hd-pantry, .hd-dishes, .hd-go { padding: 1rem; border-radius: var(--radius, 12px); }
.hd-pantry h2, .hd-dishes h2, .hd-refine h2 { font-size: 1.05rem; }
.hd-pantry-row input { font-size: 1rem; }
.hd-dish-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.dish-tile { padding: .35rem .2rem .45rem; }
.dish-tile:hover { transform: none; }
.dish-name { font-size: .88rem; }
.dish-plain { font-size: .78rem; }
.dish-count { font-size: .7rem; }
.dish-tile:not(.is-empty) .dish-count::before { width: .3rem; height: .3rem; margin-right: .2rem; }
.dish-tile[aria-pressed="true"]::after { right: .2rem; top: .2rem; width: 1.35rem; height: 1.35rem; }

.hd-refine > summary { list-style: none; cursor: pointer; margin: 0; }
.hd-refine > summary::-webkit-details-marker { display: none; }
.hd-refine > summary h2 { display: flex; align-items: center; gap: .6rem; margin: 0; }
.hd-refine > summary::after { content: ""; width: .5rem; height: .5rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); flex: 0 0 auto; }
.hd-refine[open] > summary::after { transform: rotate(-135deg); }
.hd-refine > summary .kit-aside { margin: 0 0 0 auto; }
.hd-refine-body { margin-top: .75rem; }
.hd-refine .hd-step { background: var(--accent-soft); color: var(--hd-accent-deep); }

.hd-builder > .hd-go { margin-top: 1rem; position: sticky; bottom: calc(4.25rem + env(safe-area-inset-bottom)); z-index: 5; box-shadow: var(--shadow-2, var(--shadow)); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hd-go { flex-direction: column; align-items: stretch; gap: .5rem; }
.hd-summary { font-size: .9rem; }
.hd-search-btn { width: 100%; }
.sb-chip { padding: .4rem .85rem; }
/* dish families: a thumb-sized handle, the families' chips a touch larger */
.sb-family { padding-right: 3.1rem; }
.sb-family-toggle { min-width: 2.6rem; height: 2.2rem; top: .25rem; }
.sb-children { margin-right: -2.7rem; gap: .35rem; }
.sb-child { padding: .35rem .75rem; font-size: .88rem; }

/* a search: keep the one-column stack and give its edges thumb-sized targets */
.hd-pantry-search { grid-template-columns: 1fr; gap: .75rem; }
[data-view="results"] .kit-cards:has(> .is-front) { --hd-strip-height: 2.4rem; --hd-strip-padding: .55rem; }
[data-view="results"] .kit-card.is-front { flex-direction: column; }
[data-view="results"] .kit-card.is-front .kit-media { flex: none; min-height: 0; aspect-ratio: 16 / 9; }
[data-view="results"] .kit-card.is-front .kit-body { padding: 1rem; }
.dish-ingredients ul { columns: 1; }
/* the ingredients typed: thumb-sized remove and suggestions */
[data-view="terms"] tbody tr { padding: .6rem .45rem .6rem .85rem; }
[data-view="terms"] td:not([data-dd-field]) a { width: 2.4rem; height: 2.4rem; }
[data-view="terms"] td[data-dd-field^="suggest_"]:not(:empty), [data-view="terms"] td[data-dd-field="fix_note"] a { padding: .35rem .85rem; font-size: .9rem; }
.hd-suggest { gap: .4rem; }
.hd-suggest-lead { flex: 0 0 100%; }
.hd-suggest-btn { min-height: 2.4rem; padding: .3rem .95rem; font-size: .92rem; }
.hd-suggest-btn:hover { transform: none; }
[data-view="fix"] { max-width: none; }
[data-view="results"] .kit-pager { justify-content: center; }

/* categories and recipe shelves */
.hd-tastes-art { aspect-ratio: 3 / 1.1; }
.hd-recipe-shelf > .view { margin-bottom: 1rem; }
.hd-recipe-shelf .kit-rows .kit-body { padding: .65rem .75rem; }
.hd-recipe-shelf .kit-rows .kit-title { font-size: 1rem; }
.hd-recipe-shelf [data-dd-field="makes_name"] .kit-value { padding-inline: .45rem; }
.hd-shelf-page > .detail .fields,
.hd-category-record > .detail .fields { padding: 1rem; }

/* a recipe: keep the title, both times rows and the start of the ingredients
   above the bottom tabs without shrinking the ingredient controls. */
.dd-shell-mobile .dd-frame-main:has(> .hd-recipe) { padding-block-start: .7rem; }
.hd-recipe .view.detail .page-head h1 { font-size: 1.75rem; }
.hd-recipe-lead { gap: .35rem; }
.hd-recipe-lead :is(.hd-quick, .hd-recipe-edit, [data-view="tools"]) .btn,
.hd-recipe-lead .hd-cooking-report :is(.hd-cooked-toggle, .hd-cooked-locked > .btn) {
  min-height: 2.25rem; padding: .25rem .45rem; font-size: .85rem;
}
.hd-recipe-lead .hd-cooked-locked .hd-lock-note > .view.text.note { padding: .12rem .45rem; }
.hd-recipe-lead .hd-cooked-locked .hd-lock-note a.btn { font-size: .84rem; }
.hd-recipe-timing :is(.hd-times-table caption, .hd-time-storage, .hd-time-key) { padding-block: .3rem; }
.hd-recipe-timing .hd-times-table :is(th, td) { padding-block: .32rem; }
.hd-recipe-ingredients { margin-block-start: .6rem; padding-block-start: .6rem; }
.hd-recipe-ingredients .card-head { margin-block-end: .4rem; }
.hd-recipe-ingredients .ingredient-lines .hd-measure { margin-block-end: .5rem; }
.hd-recipe-summary .fields { padding: .8rem .9rem; gap: .6rem .85rem; }
.ingredient-lines .hd-measure { width: 100%; max-width: 25rem; }
.hd-measure-options label > span { min-height: 2.75rem; padding-inline: .25rem; }
.ingredient-lines th, .ingredient-lines td { padding: .55rem .45rem; }
.ingredient-lines .hd-ingredient-qty-col { width: 26%; }
/* Leave a little more room for ingredient names followed by a chain of preparations. */
.ingredient-lines .hd-ingredient-category-col { width: 24%; }
.ingredient-lines .hd-ingredient-category { font-size: .88rem; }
.ingredient-lines .hd-ingredient-group th { padding: .45rem .5rem; }
.hd-recipes-for, .hd-tips-for {
  width: 2.75rem; height: 2.75rem; margin-inline-start: .15rem;
  background: radial-gradient(circle closest-side, var(--accent-soft) 0 63%, transparent 66%);
}
.ingredient-lines .hd-component-recipe { min-height: 2.75rem; padding-inline: .35rem; }
.ingredient-lines .hd-ingredient-tip-row > td { padding: .15rem .45rem .55rem; }
.hd-ingredient-tips-panel { padding: .65rem .75rem; }
.hd-ingredient-recipes-popover { inset: auto 0 calc(4.75rem + env(safe-area-inset-bottom)) 0; margin: 0 auto; max-height: min(70vh, 30rem); }
.hd-ingredient-recipes-head .kit-x { min-width: 2.75rem; min-height: 2.75rem; }
.hd-recipe :is(.pairing-lines, .goes-with) { padding: .75rem .85rem; }
.hd-recipe .pairing-lines { --hd-pairing-target: 2.75rem; }
.hd-recipe .goes-with [data-dd-field="dish_title"] { flex-basis: 100%; }
.hd-recipe .goes-with td a { display: inline-flex; align-items: center; min-height: 1.75rem; }
.hd-method { margin-top: 1.25rem; padding: .95rem; }
.hd-method-picks { gap: .45rem; }
.hd-method-lead { flex: 0 0 100%; margin: 0 0 .1rem; }
.hd-method-sep { display: none; }
.btn.hd-method-btn { min-height: 2.75rem; max-width: 100%; padding-inline: .9rem; font-size: .95rem; white-space: normal; }
.btn.hd-method-btn:hover { transform: none; }
.hd-method [data-view="find-methods"] button[type=submit], .hd-method [data-view="find-methods"] .actions .btn { width: 100%; }
.hd-method [data-view="steps"] .kit-acc > summary { min-height: 2.75rem; padding-inline: .7rem; }
.hd-method [data-view="steps"] .kit-acc-body { padding-inline: .8rem; }
.hd-method [data-view="steps"] [data-dd-field="instructions_shown"] { font-size: 1rem; }
.hd-times { margin-block-start: .75rem; }
.hd-times-table caption, .hd-time-storage, .hd-time-key { padding-inline: .6rem; }
.hd-times-table th, .hd-times-table td { padding: .4rem .3rem; }
.hd-times-table tbody th, .hd-times-table td { font-size: .85rem; }
.hd-time-reported small { font-size: .74rem; }
.hd-cooking-report [data-view="cooked"] :is(input, select, button[type="submit"], .hd-cooked-skip) { min-height: 2.75rem; font-size: 1rem; }
.dish-ing-optional { font-size: .82em; }

/* submissions and variations */
.hd-variation-page [data-view="original"].has-media .kit-record { grid-template-columns: minmax(0, 1fr); }
.hd-variation-page [data-view="original"] .kit-figure { width: min(100%, 9rem); }
.hd-submission-page [data-view="status"] .fields { padding: 1rem; }
.hd-submission-page [data-view="next"] .btn, .hd-submission-page [data-view="retry"] button[type=submit] { min-height: 2.75rem; }

/* admin: a drawing under way — the bar takes the row's width, the words beneath */
.view.detail[data-view="info"] [data-dd-field="picture_drawing"]:not(:empty) { max-width: none; font-size: .95rem; }
[data-view="front-page"] td[data-dd-field="picture_drawing"]:not(:empty) { min-width: 10rem; font-size: .85rem; }

/* community: keep names, badges, and notices readable on narrow screens */
.hd-profile-head { gap: .7rem; }
.hd-profile-identity { flex: 1 1 0; }
.hd-profile-name h1 { font-size: 1.55rem; }
.hd-profile-head .actions { flex-basis: 100%; }
.hd-profile-head .btn, .hd-chef-list a { min-height: 2.75rem; }
.hd-head-chefs { padding-inline: .75rem; }
.hd-member-edit [data-view="profile"] .form fieldset { padding-inline: .85rem; }
.hd-member-edit :is(input[name="website"], textarea[name="bio"], #hd-locked-website) { font-size: 1rem; }
.hd-photo-card { padding-inline: .85rem; }
.hd-photo-card .btn { min-height: 2.75rem; }
.hd-photo-controls { flex-basis: 9rem; }

/* tables scroll sideways rather than squeeze */
.table-wrap { overflow-x: auto; }
