/* Scoped recognition feedback card + native dialog.
   Forest green / offwhite, restrained; only wm-rec-* selectors. */
.wm-rec-card {
  --wm-rec-ink: #173d2b;
  --wm-rec-muted: #5d6f62;
  --wm-rec-line: #d7e0d5;
  --wm-rec-paper: #f8faf5;
  --wm-rec-accent: #205c43;
  margin: 12px 0;
  padding: 12px;
  color: var(--wm-rec-ink);
  background: var(--wm-rec-paper);
  border: 1px solid var(--wm-rec-line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(23, 61, 43, .05);
}
.wm-rec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wm-rec-title { font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.wm-rec-badge {
  flex: none; max-width: 62%; padding: 4px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--wm-rec-accent);
  background: #e8f0e8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wm-rec-detail { margin: 7px 0 0; color: var(--wm-rec-muted); font-size: 13px; line-height: 1.5; }
.wm-rec-foods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wm-rec-chip {
  max-width: 100%; padding: 3px 8px; border-radius: 8px;
  color: var(--wm-rec-ink); background: #edf3ea; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wm-rec-cta {
  width: 100%; min-height: 44px; margin-top: 10px; padding: 9px 12px;
  border: 1px solid var(--wm-rec-accent); border-radius: 10px;
  background: var(--wm-rec-accent); color: #fff; font: inherit; font-weight: 700;
  cursor: pointer;
}
.wm-rec-cta:focus-visible { outline: 3px solid #9bc4a6; outline-offset: 2px; }
.wm-rec-card[data-state="empty"] { background: #fbfcf8; }
.wm-rec-card[data-state="offline"] .wm-rec-badge { color: #6b5a2e; background: #f4ecd8; }
.wm-rec-card[data-state="failed"] .wm-rec-badge { color: #7a3d30; background: #f6e8e2; }
.wm-rec-card[data-state="confirmed"] .wm-rec-badge { color: #2e5a44; background: #e5f0e7; }

#wm-rec-home { scroll-margin-top: 12px; }
#wm-rec-records { margin-bottom: 12px; }

body.wm-rec-modal-open { overflow: hidden; }

.wm-rec-dialog {
  --wm-rec-ink: #173d2b;
  --wm-rec-muted: #5d6f62;
  --wm-rec-line: #d7e0d5;
  --wm-rec-paper: #fbfcf8;
  --wm-rec-accent: #205c43;
  width: min(560px, calc(100vw - 24px));
  max-width: 560px;
  max-height: min(84vh, 720px);
  padding: 0;
  color: var(--wm-rec-ink);
  background: var(--wm-rec-paper);
  border: 1px solid var(--wm-rec-line);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(12, 35, 24, .22);
  margin: auto;
  overflow: hidden;
}
.wm-rec-dialog::backdrop { background: rgba(10, 27, 19, .42); }
.wm-rec-panel {
  position: relative;
  max-height: min(84vh, 720px);
  overflow: auto;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  overscroll-behavior: contain;
}
.wm-rec-dialog-title { margin: 0 48px 12px 0; font-size: 18px; line-height: 1.35; font-weight: 800; }
.wm-rec-dialog-title:focus { outline: none; }
.wm-rec-x {
  position: absolute; top: 10px; right: 10px;
  min-width: 44px; min-height: 44px; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 10px;
  color: var(--wm-rec-muted); background: transparent; font: inherit; font-size: 13px;
  cursor: pointer;
}
.wm-rec-x:focus-visible, .wm-rec-record:focus-visible, .wm-rec-primary:focus-visible,
.wm-rec-secondary:focus-visible, .wm-rec-remove:focus-visible, .wm-rec-input:focus-visible {
  outline: 3px solid #9bc4a6; outline-offset: 2px;
}
.wm-rec-empty, .wm-rec-meta { margin: 8px 0 12px; color: var(--wm-rec-muted); font-size: 13px; line-height: 1.55; }
.wm-rec-list { display: grid; gap: 8px; }
.wm-rec-record {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 44px; padding: 9px 10px; text-align: left;
  border: 1px solid var(--wm-rec-line); border-radius: 11px;
  color: var(--wm-rec-ink); background: #f6f9f3; font: inherit; cursor: pointer;
}
.wm-rec-record-main { display: grid; gap: 2px; min-width: 0; }
.wm-rec-record-time { font-size: 14px; font-weight: 700; }
.wm-rec-record-status { font-size: 12px; color: var(--wm-rec-accent); }
.wm-rec-record-foods { font-size: 12px; color: var(--wm-rec-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-rec-thumb { width: 48px; height: 48px; flex: none; border-radius: 8px; object-fit: cover; background: #e8ede5; }
.wm-rec-form { display: grid; gap: 10px; margin-top: 6px; }
.wm-rec-food-list { display: grid; gap: 8px; }
.wm-rec-food-row { display: flex; align-items: center; gap: 8px; }
.wm-rec-input {
  flex: 1; min-width: 0; min-height: 44px; padding: 9px 10px; box-sizing: border-box;
  border: 1px solid var(--wm-rec-line); border-radius: 10px;
  background: #fff; color: var(--wm-rec-ink); font: inherit; font-size: 16px;
}
.wm-rec-remove {
  min-width: 44px; min-height: 44px; padding: 8px; border: 1px solid var(--wm-rec-line);
  border-radius: 10px; background: #fff; color: var(--wm-rec-muted); font: inherit; font-size: 13px; cursor: pointer;
}
.wm-rec-primary, .wm-rec-secondary {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  font: inherit; font-weight: 700; cursor: pointer;
}
.wm-rec-primary { border: 1px solid var(--wm-rec-accent); background: var(--wm-rec-accent); color: #fff; }
.wm-rec-secondary { border: 1px solid var(--wm-rec-line); background: #fff; color: var(--wm-rec-ink); }
.wm-rec-error { margin: 8px 0; padding: 9px 10px; border-radius: 9px; color: #7a3d30; background: #f8ebe5; font-size: 13px; line-height: 1.45; }
.wm-rec-dialog :disabled { opacity: .55; cursor: default; }

@media (max-width: 430px) {
  .wm-rec-card { padding: 11px; margin: 10px 0; }
  .wm-rec-dialog { width: calc(100vw - 16px); max-height: 88vh; border-radius: 14px; }
  .wm-rec-panel { padding: 16px 13px calc(16px + env(safe-area-inset-bottom)); }
}
@media (min-width: 760px) {
  .wm-rec-card { padding: 14px 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .wm-rec-card, .wm-rec-dialog, .wm-rec-record { transition: none !important; animation: none !important; }
}

/* r2: compact records card, subtitle, stale/disabled editor */
.wm-rec-card-compact { padding-bottom: 10px; }
.wm-rec-card-compact .wm-rec-detail {
  margin: 4px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wm-rec-card-compact .wm-rec-cta { margin-top: 7px; }
.wm-rec-subtitle { margin: -4px 0 10px; color: var(--wm-rec-muted); font-size: 12px; line-height: 1.45; }
.wm-rec-stale { border-color: #d9b7a9; }
.wm-rec-primary:disabled, .wm-rec-secondary:disabled, .wm-rec-x:disabled,
.wm-rec-remove:disabled, .wm-rec-input:disabled { opacity: .55; cursor: default; }
.wm-rec-busy-note { color: var(--wm-rec-muted); font-size: 12px; }

/* Keep recognition visible without pushing the proven capture actions away. */
#wm-rec-home { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 12px; margin:4px 0; }
#wm-rec-home .wm-rec-head { grid-column:1; justify-content:flex-start; flex-wrap:wrap; gap:6px 10px; }
#wm-rec-home .wm-rec-detail { grid-column:1; margin:0; }
#wm-rec-home .wm-rec-foods { grid-column:1; margin:0; gap:4px; }
#wm-rec-home .wm-rec-cta { grid-column:2; grid-row:1 / span 3; width:auto; margin:0; align-self:center; padding:10px 14px; font-size:14px; }
#wm-rec-home:has(.wm-rec-foods) .wm-rec-detail { display:none; }
.wm-rec-panel > .wm-rec-thumb { width:100%; height:160px; object-fit:contain; margin-bottom:12px; }

/* records-v2: hidden reminder, per-record inline result, edit-screen detail */
#wm-rec-reminder[hidden], .wm-rec-reminder[hidden] { display: none !important; }
.wm-rec-reminder {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px;
  margin: 10px 0 0; padding: 10px 12px; color: var(--wm-rec-ink, #173d2b);
  background: #f4f8f1; border: 1px solid #d7e0d5; border-radius: 12px;
}
.wm-rec-reminder-title { font-size: 14px; font-weight: 800; }
.wm-rec-reminder-detail { grid-column: 1; color: #5d6f62; font-size: 12px; line-height: 1.4; }
.wm-rec-reminder-cta {
  grid-column: 2; grid-row: 1 / span 2; min-height: 44px; padding: 7px 12px;
  border: 1px solid #205c43; border-radius: 10px; background: #205c43; color: #fff;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
#all-list .rec.wm-rec-enriched {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto;
  align-items: center; gap: 3px 10px; padding: 10px;
}
#all-list .rec.wm-rec-enriched > .thumb { grid-column: 1; grid-row: 1; }
#all-list .rec.wm-rec-enriched > .rec-body { grid-column: 2; grid-row: 1; }
#all-list .rec.wm-rec-enriched > .chev { grid-column: 3; grid-row: 1; }
#all-list .rec.wm-rec-enriched > .wm-rec-inline { grid-column: 1 / -1; grid-row: 2; }
.wm-rec-inline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px;
  min-height: 34px; margin-top: 3px; padding-top: 7px;
  border-top: 1px solid #e2e9df; color: #173d2b; font-size: 12px; line-height: 1.45;
}
.wm-rec-inline-status { flex: none; font-weight: 700; color: #205c43; }
.wm-rec-inline-status:is(:only-child) { color: #5d6f62; }
.wm-rec-inline-foods { flex: 1 1 150px; min-width: 0; color: #405447; overflow-wrap: anywhere; }
.wm-rec-inline-open {
  flex: none; min-height: 44px; padding: 7px 11px; border: 1px solid #cddccc; border-radius: 9px;
  background: #fff; color: #205c43; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.wm-rec-inline-open:focus-visible, .wm-rec-reminder-cta:focus-visible, .wm-rec-edit-detail button:focus-visible {
  outline: 3px solid #9bc4a6; outline-offset: 2px;
}
.wm-rec-edit-detail {
  margin: 12px 0 10px; padding: 10px 12px; color: #173d2b;
  background: #f4f8f1; border: 1px solid #d7e0d5; border-radius: 12px;
}
.wm-rec-edit-title { font-size: 14px; font-weight: 800; margin-right: 8px; }
.wm-rec-edit-status { font-size: 12px; color: #205c43; }
.wm-rec-edit-foods { margin: 5px 0; color: #405447; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.wm-rec-edit-note { margin: 4px 0; color: #7a5a2e; font-size: 12px; line-height: 1.4; }
.wm-rec-edit-detail .wm-rec-inline-open { margin-top: 4px; }
.wm-rec-reminder, .wm-rec-inline, .wm-rec-edit-detail { max-width: 100%; box-sizing: border-box; }
@media (max-width: 430px) {
  #all-list .rec.wm-rec-enriched { grid-template-columns: auto minmax(0, 1fr); }
  #all-list .rec.wm-rec-enriched > .chev { display: none; }
  #all-list .rec.wm-rec-enriched > .wm-rec-inline { grid-column: 1 / -1; }
  .wm-rec-reminder { grid-template-columns: minmax(0, 1fr) auto; padding: 9px 10px; }
  .wm-rec-reminder-cta { padding: 6px 9px; }
}

/* progress-v3: restrained spinner only while online server work exists */
.wm-rec-spinner {
  display: inline-block; width: 13px; height: 13px; flex: none; margin-right: 6px;
  border: 2px solid #cbd9c8; border-top-color: #205c43; border-radius: 50%;
  vertical-align: -2px; animation: wm-rec-spin 1s linear infinite;
}
.wm-rec-reminder-title { display: flex; align-items: center; min-width: 0; }
.wm-rec-reminder-title-text { min-width: 0; overflow-wrap: anywhere; }
.wm-rec-reminder-detail { overflow-wrap: anywhere; }
.wm-rec-reminder-hint { grid-column: 1; color: #6a786d; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.wm-rec-reminder-cta { grid-row: 1 / span 4; align-self: center; }
.wm-rec-inline .wm-rec-spinner, .wm-rec-edit-detail .wm-rec-spinner { width: 11px; height: 11px; border-width: 2px; margin-right: 4px; }
@keyframes wm-rec-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .wm-rec-spinner { animation: none !important; border-top-color: #5d6f62; }
}
@media (max-width: 430px) {
  .wm-rec-reminder-cta { grid-row: 1 / span 4; }
}
