/* Contributing from the app (client/contribute.js): big touch targets, made for a phone */
.ic-entry { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.ic-entry .btn { flex: 1 1 220px; justify-content: center; }
.btn-lg.ic-big, .ic-send { min-height: 52px; padding: 10px 22px; font-size: 1.05rem; }
.ic-form .needs-form .wide, .ic-body .needs-form .wide { grid-column: 1 / -1; }
.ic-bigin { font-size: 1.4rem; font-weight: 600; min-height: 52px; }
.ic-label { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.ic-photo { margin-top: 12px; }
.ic-preview { display: block; max-width: 220px; max-height: 220px; margin-top: 10px; border-radius: var(--radius); border: 1px solid var(--line); }
.ic-preview[hidden] { display: none; }
.ic-done { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-soft-ink); }
.ic-wait { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-3); }
.ic-wait.bad { color: var(--danger); }
.ic-warn { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--g-d); }
.ic-warn ul { margin: 6px 0 4px 18px; }
.ic-head { align-items: center; gap: 14px; }
.ic-lang { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 14px 0; }
.ic-steps { display: flex; flex-direction: column; gap: 12px; }
.ic-step > summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-height: 64px; cursor: pointer; list-style: none; }
.ic-step > summary::-webkit-details-marker { display: none; }
.ic-step[open] > summary .icon:last-child { transform: rotate(180deg); }
.ic-title { display: flex; flex-direction: column; flex: 1; gap: 2px; }
.ic-num { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--surface-3); font-weight: 700; }
.ic-step.needed .ic-num { background: var(--accent); color: oklch(0.215 0.011 220); }
.ic-step.sent .ic-num, .ic-step:not(.needed) .ic-num { background: var(--accent-soft); color: var(--accent-soft-ink); }
.ic-step.is-next { border-color: var(--accent-strong); }
.ic-body { padding: 0 18px 18px; }
.ic-nutr { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; margin-top: 10px; }
.ic-nutr label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.ic-nutr label.sub span:first-child { font-weight: 500; color: var(--muted); }
.ic-unit { display: flex; align-items: center; gap: 6px; }
.ic-unit .input { min-height: 46px; font-size: 1.1rem; }
.ic-unit i { font-style: normal; color: var(--muted); width: 2.2em; }
.ic-nutr .input.changed { box-shadow: 0 0 0 2px var(--g-c); background: var(--accent-soft); }
.ic-cats { gap: 8px; }
.ic-cats .chip span { min-height: 40px; display: inline-flex; align-items: center; }
.ic-donelist { margin-top: 6px; }
.ic-donelist > summary { cursor: pointer; padding: 8px 0; }
.ic-donelist .ic-step { margin-top: 10px; }
.ic-branches { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ic-branch { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; min-height: 52px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.ic-branch.on, .ic-branch:hover { border-color: var(--accent-strong); }
.ic-chosen { padding: 10px 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-soft-ink); }
.ic-account { border-top: 1px solid var(--line); padding-top: 16px; }
.ic-qrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ic-modal { position: fixed; inset: 0; z-index: 230; display: grid; place-items: center; padding: 16px; background: oklch(0.16 0.009 220 / 0.6); }
.ic-login { width: min(520px, 100%); }
.ic-freshbox { margin-top: 16px; }
.ic-freshbox ul { list-style: none; }
@media (max-width: 600px) {
  .ic-entry .btn, .ic-send { width: 100%; }
}
.ic-photo-row { align-items: center; gap: 8px; margin-top: 6px; }
.ic-photo-row [data-photo-edit][hidden] { display: none; }
.ic-photo-row [data-photo-white][hidden] { display: none; }
/* "Which picture?" after the front photo (contribute.js whiteBackground): the photo editor's dark look (.pe) */
.bgw-hint { margin: 2px 0 0; font-size: 0.8rem; color: #c9d2d8; }
.bgw-pair { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 12px; align-items: center; }
.bgw-side { margin: 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bgw-side figcaption { font-size: 0.9rem; font-weight: 700; color: #fff; }
.bgw-pic { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; touch-action: manipulation; }
.bgw-pic img { display: block; max-width: 100%; max-height: calc(100dvh - 290px); border-radius: 8px; }
.bgw-pic.bgw-empty { min-width: 70%; min-height: 160px; display: grid; place-items: center; background: #fff; border-radius: 8px; }
.bgw-wait[hidden] { display: none; }
.bgw-wait { margin: 0; padding: 12px; color: #0b0f12; font-weight: 600; font-size: 0.9rem; text-align: center; }
.bgw-wait:not(.bad)::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 8px; border-radius: 50%; border: 3px solid #bbb; border-top-color: #1d5fa8; animation: wz-spin 0.9s linear infinite; }
@keyframes wz-spin { to { transform: rotate(360deg); } }
.bgw-wait.bad { color: #a8321d; }
.bgw-dots { position: absolute; inset: 0; pointer-events: none; }
.bgw-dots i { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #ffd84d; border: 3px solid #111; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.bgw-empty .bgw-dots { display: none; }
.bgw .pe-tools { padding-top: 0; }
.bgw .pe-help { min-height: 0; }

/* the photo flow: one step per screen (contribute.js runWizard) */
html.wz-open, html.wz-open body { overflow: hidden; }
.wz { position: fixed; inset: 0; z-index: 205; display: flex; flex-direction: column; background: var(--bg, var(--surface)); color: var(--ink); }
.wz [hidden] { display: none !important; }
.wz-top { display: flex; align-items: center; gap: 8px; padding: max(4px, env(safe-area-inset-top)) 8px 4px 4px; border-bottom: 1px solid var(--line); background: var(--surface); }
.wz-back, .wz-x { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; min-width: 48px; padding: 0 10px; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.wz-x { justify-content: center; }
.wz-x .icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.wz-prog { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wz-prog-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wz-prog b { font-size: 0.95rem; }
.wz-fin { padding: 2px 0; border: 0; background: none; color: var(--accent-strong, var(--ink)); font: inherit; font-size: 0.85rem; font-weight: 600; text-decoration: underline; cursor: pointer; text-align: right; }
.wz-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.wz-bar i { display: block; height: 100%; background: var(--accent-strong, var(--accent)); border-radius: 3px; transition: width .2s; }
.wz-main { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px; -webkit-overflow-scrolling: touch; }
.wz-cols { display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin: 0 auto; }
.wz-title { font-size: 1.15rem; line-height: 1.25; margin: 0 0 6px; }
.wz-guide { height: clamp(88px, 17dvh, 170px); margin: 0 0 8px; padding: 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2, var(--surface)); color: var(--ink-2, var(--ink)); }
.wz-guide svg { display: block; width: 100%; height: 100%; }
.wz-tip { margin: 0 0 8px; color: var(--ink-2, var(--ink)); font-size: 0.95rem; }
.wz-shoot { display: flex; gap: 8px; align-items: stretch; }
.wz-take { flex: 1 1 auto; justify-content: center; min-height: 52px; font-size: 1.1rem; }
.wz-file { flex: 0 1 38%; justify-content: center; min-height: 52px; font-size: 0.95rem; text-align: center; }
.wz-photo { display: block; width: 100%; padding: 0; cursor: zoom-in; background: #fff; }
.wz-photo img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: calc(var(--radius) - 2px); }
.wz-cap { margin: 0 0 8px; font-size: 0.95rem; }
.wz-lb { position: fixed; inset: 0; z-index: 220; display: grid; place-items: center; background: rgba(0,0,0,.92); cursor: zoom-out; }
.wz-lb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.wz-thumb { width: 52px; height: 52px; flex: none; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.wz-dense .wz-guide { height: clamp(64px, 11dvh, 96px); padding: 4px; }
.wz-dense .wz-tip { display: none; }
.wz-dense .wz-take, .wz-dense .wz-file { min-height: 46px; }
.wz-dense .wz-title { margin-bottom: 4px; }
.wz-dense .wz-tip { margin-bottom: 8px; font-size: 0.9rem; }
.wz-has .wz-take, .wz-has .wz-file { min-height: 48px; font-size: 1rem; }
.wz-empty { display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-weight: 700; }
.wz-empty .icon { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bad-note { color: var(--danger); min-height: 0; margin: 0; }
.wz-fields:empty { display: none; }
.wz-fields .needs-form { gap: 8px 12px; }
.wz-fields .input { min-height: 44px; }
.wz-wide { display: block; }
.wz-fields textarea.input { min-height: 0; }
.wz-fields .ic-nutr { grid-template-columns: repeat(3, 1fr); gap: 4px 8px; margin-top: 4px; }
.wz-fields .ic-nutr label { font-size: 0.7rem; gap: 2px; justify-content: flex-end; line-height: 1.15; }
.wz-fields .ic-unit { position: relative; }
.wz-fields .ic-unit .input { min-height: 40px; font-size: 1rem; width: 100%; padding-right: 1.9em; padding-left: 8px; }
.wz-fields .ic-unit i { position: absolute; right: 6px; width: auto; font-size: 0.7rem; pointer-events: none; }
.wz-fields .ic-cats { max-height: 38dvh; overflow-y: auto; margin-top: 8px; }
.wz-foot { display: flex; gap: 10px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.wz-foot .btn { flex: 1; justify-content: center; min-height: 48px; font-size: 1.05rem; }
.wz-next.wz-skipping { background: var(--surface-3); color: var(--ink); border-color: var(--line); }
.wz-sum { max-width: 640px; margin: 0 auto; }
.wz-list { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wz-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 6px 10px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.wz-item.sent { border-color: var(--accent-strong, var(--line)); }
.wz-item-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wz-item-t .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz-redo { color: var(--accent-strong, var(--ink-2)); font-size: 0.85rem; font-weight: 600; }
.wz .ic-lang { margin: 10px 0; }
.wz .link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; text-align: left; }
/* a phone held sideways: the picture and the button on the left, the fields on the right */
@media (orientation: landscape) and (max-height: 520px) {
  .wz-top { padding-top: 4px; padding-bottom: 4px; }
  .wz-back, .wz-x { min-height: 40px; }
  .wz-main { padding: 8px 16px; }
  .wz-cols { flex-direction: row; max-width: none; gap: 20px; align-items: flex-start; }
  .wz-media { flex: 1 1 45%; min-width: 0; }
  .wz-fields { flex: 1 1 55%; min-width: 0; }
  .wz-title { font-size: 1.1rem; margin-bottom: 4px; }
  .wz-guide { height: clamp(64px, 27dvh, 100px); padding: 4px; margin-bottom: 4px; }
  .wz-tip { margin-bottom: 6px; font-size: 0.85rem; }
  .wz-take { min-height: 44px; }
  .wz-file { padding: 4px 12px; }
  .wz-foot { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .wz-foot .btn { min-height: 44px; }
  .wz-list { display: grid; grid-template-columns: 1fr 1fr; }
  .wz-fields .ic-nutr { grid-template-columns: repeat(3, 1fr); }
  .wz-fields .ic-cats { max-height: 60dvh; }
}

.wz-lang { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.wz-lang .select { min-height: 40px; }
.wz-note { margin: 0 0 4px; }
.wz-resview .wz-back { visibility: hidden; }
.wz-result { max-width: 520px; margin: 0 auto; text-align: center; padding-top: 8px; }
.wz-result h2 { font-size: 1.3rem; margin: 12px 0; }
.wz-bigtick { display: grid; place-items: center; width: 88px; height: 88px; margin: 8px auto 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent-soft-ink); }
.wz-bigtick .icon { width: 52px; height: 52px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.wz-bigtick.saved { background: var(--surface-3); color: var(--ink); }
.wz-rlines { list-style: none; margin: 0 0 12px; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.wz-rlines li { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.wz-rlines li span { display: inline-block; width: 1.4em; font-weight: 700; }
.wz-rlines li.failed { border-color: var(--danger); color: var(--danger); }
/* "Which picture?": the two cards side by side, one is picked */
.bgw-side { cursor: pointer; }
.bgw-pic { cursor: pointer; outline: 4px solid transparent; outline-offset: 2px; border-radius: 8px; }
.bgw-side[aria-pressed="true"] .bgw-pic { outline-color: #ffd84d; }
.bgw-tick { display: none; position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; background: #ffd84d; color: #111; place-items: center; }
.bgw-tick .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.bgw-side[aria-pressed="true"] .bgw-tick { display: grid; }
.bgw-fixing .bgw-pic { cursor: crosshair; }
.bgw-fixing .bgw-side[data-side="white"] .bgw-pic { cursor: default; }
.bgw-both { margin: 0; font-size: 0.8rem; color: #c9d2d8; text-align: center; }
.bgw .pe-bottom .btn { flex: 1; }
/* short phones (iPhone Safari leaves ~660 px, small Androids 640 px): the drawing and the tip give way, the fields stay */
@media (max-height: 700px) {
  .wz-guide { height: clamp(72px, 13dvh, 100px); padding: 4px; margin-bottom: 4px; }
  .wz-tip { font-size: 0.85rem; margin-bottom: 6px; }
  .wz-title { margin-bottom: 4px; }
  .wz-fields .input { min-height: 40px; }
  .wz-lang { margin-top: 6px; font-size: 0.8rem; }
  .wz-lang .select { min-height: 36px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .wz-guide { height: clamp(52px, 20dvh, 84px); }
  .wz-fields .ic-cats { max-height: 44dvh; }
}
.wz-has .wz-take, .wz-has .wz-file { min-height: 44px; }
.wz-cap { margin: 0 0 4px; }
.wz-photo + .wz-cap + .tiny { margin: 0 0 6px; }
@media (orientation: landscape) and (max-height: 520px) {
  .wz-sum .wz-title { margin: 0 0 4px; font-size: 1rem; }
  .wz-sum .small, .wz-sum .tiny { margin-top: 4px !important; }
  .wz-item { min-height: 54px; }
  .wz-thumb { width: 44px; height: 44px; }
}
.wz-fin { line-height: 1.1; padding: 0; }
.wz-prog b { line-height: 1.1; }
@media (orientation: landscape) and (max-height: 520px) { .wz-list { gap: 4px; } .wz-item { min-height: 50px; } }
@media (orientation: landscape) and (max-height: 520px) { .wz-main { padding-top: 4px; padding-bottom: 4px; } }
.wz-prog b, .wz-fin { white-space: nowrap; }
.wz-take { min-width: 0; }
.wz-take span, .wz-file span { white-space: normal; text-align: center; }
.wz-file { flex: 0 0 auto; padding-left: 12px; padding-right: 12px; }
.wz-fields .needs-form.wz-compact { grid-template-columns: 1fr 1fr; }
.wz-fields .needs-form.wz-compact .wide { grid-column: 1 / -1; }
