/* app.css — tokens + primitives for the public Plantydealz web app.
   Palette derived from the Mobile-App theme (app_theme.dart). Contrast of
   every text/muted/primary pair verified ≥4.5:1 incl. the primary button
   (dark uses --btn-fg white on green, mirroring Mobile-PR #463: 5.13:1).

   Theme mechanics: base :root = light tokens for no-JS. A prefers-color-scheme
   dark block applies only while no data-theme is set (no-JS / pre-paint). Once
   theme.js runs it ALWAYS sets [data-theme], and the explicit [data-theme]
   blocks are authoritative. */

:root {
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-pill: 999px;
  --radius-field: 10px;
  --gap: 16px;

  color-scheme: light dark;
}

:root,
:root[data-theme='light'] {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-border: #e8f5e9;
  --surface-high: #eef3ee;
  --text: #2d3436;
  --text-muted: #5b695d;
  --primary: #2a7a4b;
  --primary-strong: #1b5e20;
  --primary-container: #a8e6cf;
  --on-primary-container: #1b5e20;
  --btn-fg: #1b5e20;
  --chip-bg: #e8f5e9;
  --outline-variant: #d7e2d6;
  --danger: #b3261e;
  /* Amber trust pill — accent = Mobile-#463 label amber (#8D6E00), NOT icon
     amber; bg/border are that accent alpha-blended (14 %/46 %) over --surface,
     precomputed as solids so the pill text (var(--text)) contrast is exact. */
  --warn-accent: #8d6e00;
  --warn-bg: #efebdb;
  --warn-border: #cbbc8a;
  /* Prominent price-tag border = --primary @35 % over --surface (decorative). */
  --tag-prominent-border: #b4d0c0;
}
:root[data-theme='light'] {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0f1a0f;
    --surface: #1a2a1a;
    --surface-border: #2a3d2a;
    --surface-high: #223522;
    --text: #e8f5e9;
    --text-muted: #9db4a0;
    --primary: #a8e6cf;
    --primary-strong: #c8e6c9;
    --primary-container: #2e7d32;
    --on-primary-container: #c8e6c9;
    /* Wie Mobile-PR #463: weisser Button-Text — c8e6c9 auf 2e7d32 waere 3.81:1. */
    --btn-fg: #ffffff;
    --chip-bg: #1e3a1e;
    --outline-variant: #2a3d2a;
    --danger: #f2b8b5;
    --warn-accent: #ffd54f;
    --warn-bg: #3a4221;
    --warn-border: #837932;
    --tag-prominent-border: #4c6c59;
  }
}

:root[data-theme='dark'] {
  --bg: #0f1a0f;
  --surface: #1a2a1a;
  --surface-border: #2a3d2a;
  --surface-high: #223522;
  --text: #e8f5e9;
  --text-muted: #9db4a0;
  --primary: #a8e6cf;
  --primary-strong: #c8e6c9;
  --primary-container: #2e7d32;
  --on-primary-container: #c8e6c9;
  --btn-fg: #ffffff;
  --chip-bg: #1e3a1e;
  --outline-variant: #2a3d2a;
  --danger: #f2b8b5;
  --warn-accent: #ffd54f;
  --warn-bg: #3a4221;
  --warn-border: #837932;
  --tag-prominent-border: #4c6c59;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* — Layout — */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.bar {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding-inline: 16px;
}
.app-header {
  background: var(--bg);
  border-bottom: 1px solid var(--surface-border);
}
.app-header .bar {
  display: flex;
  align-items: center;
  min-height: 56px;
}
.brand {
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.view {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding: 16px;
}
@media (min-width: 720px) {
  .view {
    padding-block: 24px;
  }
}

.app-footer {
  background: var(--bg);
  border-top: 1px solid var(--surface-border);
  padding-block: 16px;
}
.footer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}
.control {
  display: flex;
  flex: 1 1 160px;
  flex-direction: column;
  gap: 0.25rem;
}
.control label {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin-top: 12px;
}
.footer-nav a {
  color: var(--primary);
  font-size: 0.9375rem;
  text-decoration: none;
}
.footer-nav a:hover {
  text-decoration: underline;
}
.footer-nav a[aria-current='page'] {
  font-weight: 700;
  text-decoration: underline;
}

/* — Stacks & typography — */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.section-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.prose p {
  margin: 0 0 0.75rem;
  line-height: 1.6;
}
.prose p:last-child {
  margin-bottom: 0;
}
.text-muted {
  color: var(--text-muted);
}
.disclaimer {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* — Primitives (reused by W-2) — */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  padding: 1rem 1.125rem;
  box-shadow: 0 1px 2px rgba(20, 32, 20, 0.04);
}
:root[data-theme='dark'] .card,
:root:not([data-theme]) .card {
  box-shadow: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  color: var(--on-primary-container);
  font-size: 0.75rem;
  font-weight: 600;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  color: var(--on-primary-container);
  font-size: 0.8125rem;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  background: var(--primary-container);
  color: var(--btn-fg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn.block {
  width: 100%;
}
.btn:hover:not(:disabled) {
  filter: brightness(0.97);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* — Forms — */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  border: 0;
}
.field > label:not(.check),
.field > legend {
  padding: 0;
  color: var(--text);
  font-weight: 600;
}
input[type='text'],
select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-field);
  background: var(--surface);
  font-size: 1rem;
}
input[type='text'][aria-invalid='true'] {
  border-color: var(--danger);
}
.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.875rem;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.storage-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.storage-note .icon {
  display: inline-flex;
  color: var(--primary-strong);
}

/* — Profile summary + placeholder — */
.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.profile-summary {
  margin: 0;
  font-weight: 600;
}
.placeholder p {
  margin: 0;
}

/* — noscript — */
.noscript {
  max-width: 720px;
  margin: 16px auto;
  padding: 0 16px;
}
.noscript p {
  margin: 0.25rem 0;
}

/* ======================================================================
   W-2 Wochenliste — tabs, flyer line, search, chips, feed, offer card v2.
   ====================================================================== */

/* — Retailer tabs (horizontal scroll) — */
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.tab[aria-pressed='true'] {
  background: var(--primary-container);
  border-color: transparent;
  /* --btn-fg (white in dark) not --on-primary-container: the latter is 3.81:1
     on the dark container, the former 5.13:1 — mirrors Mobile-PR #463. */
  color: var(--btn-fg);
}

.tab-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* — Flyer period line — */
.flyer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.flyer-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.flyer-link:hover {
  text-decoration: underline;
}

/* — Search — */
.search-field {
  display: flex;
}
.search-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

/* — Category chips (horizontal scroll) — */
.chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.chips-row .chip {
  flex: 0 0 auto;
  gap: 6px;
  background: var(--surface);
  border-color: var(--surface-border);
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}
.chips-row .chip[aria-pressed='true'] {
  background: var(--primary-container);
  border-color: transparent;
  color: var(--btn-fg);
}
.chip-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

/* — Feed & states — */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feed-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 4px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.spinner {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 2px solid var(--outline-variant);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: pd-spin 0.7s linear infinite;
}
@keyframes pd-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2s;
  }
}
.feed-empty p {
  margin: 0 0 0.75rem;
}
.feed-empty p:last-child {
  margin-bottom: 0;
}
.feed-reset {
  margin-top: 4px;
}
.feed-error {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}
.feed-error > p {
  margin: 0 0 0.75rem;
  color: var(--text);
}
.feed-error-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-field);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  color: var(--text);
  font-size: 0.875rem;
}

/* — Offer card v2 — */
.offer-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(20, 32, 20, 0.04);
}
:root[data-theme='dark'] .offer-card,
:root:not([data-theme]) .offer-card {
  box-shadow: none;
}
.offer-cat-tile {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  /* Both theme variants set inline per card; CSS picks by [data-theme]. */
  background: var(--tile-bg-l);
  color: var(--tile-fg-l);
}
:root[data-theme='dark'] .offer-cat-tile {
  background: var(--tile-bg-d);
  color: var(--tile-fg-d);
}
.offer-body {
  flex: 1 1 auto;
  min-width: 0; /* lets the title ellipsis work inside the flex row */
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.offer-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.offer-store {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* — Validity pill (neutral, calm) — */
.validity-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
}
.validity-pill .pill-icon {
  display: inline-flex;
  color: var(--text-muted);
}

/* — Price zone / tags / badges — */
.price-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.price-zone--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.price-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.price-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 800;
}
.price-badge--prominent {
  background: var(--primary-container);
  border-color: var(--tag-prominent-border);
  color: var(--btn-fg);
}
.price-tag {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 10px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  color: var(--text-muted);
}
.price-tag--prominent {
  background: var(--primary-container);
  border-color: var(--tag-prominent-border);
  color: var(--btn-fg);
}
.price-tag-label {
  font-size: 0.625rem;
  font-weight: 800;
}
.price-tag-value {
  font-size: 0.8125rem;
  font-weight: 700;
}
.price-tag--prominent .price-tag-value {
  font-size: 0.875rem;
}
.price-line {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary-strong);
}
.price-unavailable {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* — Trust hint (amber; text contrast comes from var(--text), not the amber) — */
.trust-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-pill);
  background: var(--warn-bg);
}
.trust-pill-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--warn-accent);
}
.trust-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.6875rem;
  font-weight: 800;
}

/* ======================================================================
   W-3 Offer detail + W-4 feedback flow.
   New text pairs verified ≥4.5:1 in BOTH modes (see PR notes):
   --primary-strong on --bg (feedback confirm) 7.47:1 / 13.3:1; every other
   pair reuses a W-1/W-2-verified pairing (--text / --text-muted / --danger on
   --surface/--bg, category label on its pastel tile, var(--text) on --warn-bg).
   ====================================================================== */

/* — Card → detail navigation (chevron + link affordance) — */
.offer-card--link {
  cursor: pointer;
}
.offer-card--link:hover {
  background: var(--surface-high);
}
.offer-card--link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.offer-chevron {
  align-self: center;
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--text-muted);
}

/* — Detail page shell — */
.detail-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
.detail-back:hover {
  text-decoration: underline;
}
.detail {
  display: flex;
  flex-direction: column;
}

/* — Page image tile (≈60vh) + fullscreen affordance — */
.detail-image {
  position: relative;
  display: block;
  width: 100%;
  height: 60dvh;
  min-height: 240px;
  max-height: 560px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #000;
}
.detail-image--photo {
  padding: 0;
  border: 0;
  cursor: zoom-in;
}
.detail-image-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.detail-image-fs {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}
.detail-image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tile-bg-l);
  color: var(--tile-fg-l);
}
:root[data-theme='dark'] .detail-image--placeholder {
  background: var(--tile-bg-d);
  color: var(--tile-fg-d);
}
.detail-image-leaf {
  display: inline-flex;
}
.detail-image-leaf svg {
  width: 72px;
  height: 72px;
}

/* — Detail body — */
.detail-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
}
.detail-cat-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--tile-bg-l);
  color: var(--tile-fg-l);
  font-size: 0.8125rem;
  font-weight: 600;
}
:root[data-theme='dark'] .detail-cat-chip {
  background: var(--tile-bg-d);
  color: var(--tile-fg-d);
}
.detail-cat-icon {
  display: inline-flex;
}
.detail-cat-icon svg {
  width: 16px;
  height: 16px;
}
.detail-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* — Long-form trust hint (amber, calm) — */
.detail-trust {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-card);
  background: var(--warn-bg);
}
.detail-trust-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-trust-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--warn-accent);
}
.detail-trust-title {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 800;
}
.detail-trust-body {
  margin: 0;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* — Large price zone (reuses renderPrice output; scales the typography) — */
.detail-price {
  margin-top: 4px;
}
.detail-price .price-line {
  font-size: 1.75rem;
}
.detail-price .price-unavailable {
  font-size: 1.125rem;
}
.detail-price .price-tag {
  padding: 10px 14px;
  border-radius: 16px;
}
.detail-price .price-tag-label {
  font-size: 0.6875rem;
}
.detail-price .price-tag-value {
  font-size: 1.25rem;
}
.detail-price .price-tag--prominent .price-tag-value {
  font-size: 1.5rem;
}

/* — Meta list (icon + text rows) — */
.meta-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.meta-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.meta-icon {
  flex: 0 0 auto;
  display: inline-flex;
  margin-top: 1px;
  color: var(--text-muted);
}
.meta-text {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* — Evidence anchor button — */
.detail-flyer {
  gap: 8px;
  margin-top: 8px;
  text-decoration: none;
}
.detail-flyer-icon {
  display: inline-flex;
}

/* — Feedback section — */
.detail-feedback {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-border);
}
.feedback-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feedback-status-head {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.feedback-status-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-field);
  background: var(--surface);
}
.feedback-status-type {
  color: var(--text);
  font-size: 0.875rem;
}
.feedback-status-value {
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}
.feedback-confirm {
  margin: 0;
  color: var(--primary-strong);
  font-size: 0.875rem;
  font-weight: 600;
}
.feedback-helper {
  margin: 0;
  font-size: 0.8125rem;
}

/* — Secondary button (sheet cancel) — */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover {
  background: var(--surface-high);
}

/* — Fullscreen image dialog (native <dialog>) — */
.image-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
}
.image-dialog::backdrop {
  background: rgba(0, 0, 0, 0.9);
}
.image-dialog-scroll {
  width: 100%;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-dialog-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* Let iOS pinch-zoom the image; the scroll container pans the zoomed result. */
  touch-action: pinch-zoom;
}
.image-dialog-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
}

/* — Feedback sheet (native <dialog>, bottom-anchored) — */
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 1px solid var(--surface-border);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}
.sheet::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
.sheet-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 92dvh;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
.sheet-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.sheet-subtitle {
  margin: 0;
  font-size: 0.875rem;
}
.sheet-types {
  gap: 2px;
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}
.radio-row input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}
.radio-label {
  flex: 1 1 auto;
  font-size: 0.9375rem;
}
.radio-row--disabled {
  cursor: default;
}
.radio-row--disabled .radio-label {
  color: var(--text-muted);
}
.radio-note {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: italic;
}
.sheet-textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
  resize: vertical;
}
.sheet-counter {
  align-self: flex-end;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.sheet-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.875rem;
}
.sheet-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.sheet-actions > * {
  flex: 1;
}
