* { box-sizing: border-box; }
body {
  margin: 0;
  font-family:
    Inter,
    "Segoe UI",
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    "PingFang SC",
    "Hiragino Sans GB",
    "Noto Sans CJK SC",
    "Noto Sans SC",
    Arial,
    sans-serif;
  background: #ffffff;
  color: #18212f;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  max-width: var(--ew-rail-max, 1400px);
  margin-left: auto;
  margin-right: auto;
  padding: 18px var(--ew-rail-pad-x, 24px);
  background: #000000;
  color: #ffffff;
  border-bottom: 1px solid #333333;
  box-shadow: none;
  box-sizing: border-box;
}
.topbar-links {
  margin: 0 0 8px;
  font-size: 0.88rem;
}
.topbar-links a {
  color: #8ab4ff;
  text-decoration: none;
}
.topbar-links a:hover {
  color: #c5d9ff;
  text-decoration: underline;
}
.topbar h1 { margin: 0 0 4px; font-size: 1.4rem; color: #ffffff; }
.topbar p { margin: 0; color: #cccccc; }
.topbar .cuisine-style-label {
  color: #e8e8e8;
}
.topbar .toggle {
  color: #e8e8e8;
}
.deal-focus-status {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: #8ab4ff;
  min-height: 1.2em;
}

/* Weekly cuisine recommendations (after 菜系 pick) */
.weekly-rec-panel {
  margin: 0 auto 16px;
  max-width: var(--ew-rail-max, 1400px);
  width: 100%;
  box-sizing: border-box;
  padding: 0 var(--ew-rail-pad-x, 24px);
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
}
.weekly-rec-panel__inner {
  padding: 16px 20px 18px;
  max-width: 100%;
  margin: 0;
}
.weekly-rec-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 8px;
}
.weekly-rec-panel__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
}
.weekly-rec-panel__week {
  margin: 0;
  font-size: 0.82rem;
  color: #5c5c5c;
}
.weekly-rec-panel__hint {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: #5c5c5c;
  line-height: 1.45;
  max-width: 900px;
}
.weekly-rec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.weekly-rec-item {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.weekly-rec-item__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
}
.weekly-rec-item__name button,
.weekly-rec-item__name a.weekly-rec-item__dishlink {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: #0b5fff;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.weekly-rec-item__name button:hover,
.weekly-rec-item__name a.weekly-rec-item__dishlink:hover {
  color: #0047c7;
}
.weekly-rec-item__src {
  margin: 0;
  font-size: 0.8rem;
  color: #444;
  line-height: 1.35;
}
.weekly-rec-item__inline-flyer-pct {
  font-weight: 600;
  color: #0f766e;
  font-variant-numeric: tabular-nums;
}
.weekly-rec-item__flyer-pct-solo {
  margin: 2px 0 0;
  padding: 4px 8px;
  font-size: 0.82rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  line-height: 1.3;
  max-width: 10rem;
}
.weekly-rec-item__flyer-pct-solo--only {
  margin-top: 0;
}
.weekly-rec-item__flyer-pool-summary {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #475569;
  font-variant-numeric: tabular-nums;
}
.weekly-rec-item__flyer-pool-summary--warn {
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 6px;
  padding: 4px 8px;
}
.weekly-rec-item__src--flyer-pct-only {
  color: #0f766e;
}
.weekly-rec-item__links a {
  cursor: pointer;
  pointer-events: auto;
}
.weekly-rec-item__mat {
  margin: 0;
  font-size: 0.8rem;
  color: #5c5c5c;
  line-height: 1.4;
}
.weekly-rec-item__mat-detail {
  margin: 2px 0 0;
  padding-top: 6px;
  border-top: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.weekly-rec-item__mat-detail-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0b5fff;
  letter-spacing: 0.02em;
}
.weekly-rec-item__mat-section--cuisine {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fafbfc;
}
.weekly-rec-item__mat-section-head--cuisine {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}
.weekly-rec-item__mat-grouped {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.weekly-rec-item__mat-pool-stats {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.weekly-rec-item__mat-items--cuisine {
  margin: 0;
  padding-left: 1rem;
}
.weekly-rec-item__mat-section {
  margin: 0;
}
.weekly-rec-item__mat-section-head {
  margin: 0 0 4px;
}
.weekly-rec-item__mat-cat {
  font-size: 0.76rem;
  font-weight: 600;
  color: #333;
}
.weekly-rec-item__mat-items {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #5c5c5c;
}
.weekly-rec-item__mat-items li {
  margin-bottom: 2px;
}
.weekly-rec-item__mat-items li:last-child {
  margin-bottom: 0;
}
.weekly-rec-item__links {
  margin: 4px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #5c5c5c;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.weekly-rec-item__links-label {
  font-weight: 600;
  color: #0b5fff;
  flex-shrink: 0;
}
.weekly-rec-item__links-nav a {
  color: #0b5fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.weekly-rec-item__links-nav a:hover {
  color: #0047c7;
}

.weekly-rec-item__wish {
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
/* Weekly pick star row: one warm gold look for every score (outline ☆ glyphs read grey in many fonts if we only set brown on the button). */
.weekly-rec-item__starsbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  color: #92400e;
  line-height: 1.2;
  user-select: none;
  margin: 0;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #b45309;
  background: linear-gradient(180deg, #fffbeb 0%, #fde68a 55%, #fcd34d 100%);
  cursor: default;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", "DejaVu Sans",
    sans-serif;
  font-weight: 600;
  -webkit-text-fill-color: currentColor;
}
.weekly-rec-item__starsbtn .weekly-rec-item__stars-glyphs {
  color: #ca8a04;
  -webkit-text-fill-color: #ca8a04;
}
.weekly-rec-item__starsbtn .weekly-rec-item__stars-value {
  color: #92400e;
  -webkit-text-fill-color: #92400e;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0;
}
/* Kept for older HTML/SSR; same look as base so “top pick” vs mid rating does not change color. */
.weekly-rec-item__starsbtn.weekly-rec-item__starsbtn--full {
  color: #92400e;
  border-color: #b45309;
  background: linear-gradient(180deg, #fffbeb 0%, #fde68a 55%, #fcd34d 100%);
}
.weekly-rec-item__starsbtn:hover {
  border-color: #92400e;
  background: linear-gradient(180deg, #fffbeb 0%, #fcd34d 100%, #fbbf24 100%);
}
.weekly-rec-item__starsbtn.weekly-rec-item__starsbtn--full:hover {
  border-color: #92400e;
  background: linear-gradient(180deg, #fffbeb 0%, #fcd34d 100%, #fbbf24 100%);
}
/* No / near-zero score: still amber so it matches other cards (not cold grey). */
.weekly-rec-item__starsbtn.weekly-rec-item__starsbtn--none {
  color: #a16207;
  border-color: #d97706;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 90%, #fde68a 100%);
  font-weight: 500;
}
.weekly-rec-item__starsbtn.weekly-rec-item__starsbtn--none .weekly-rec-item__stars-glyphs {
  color: #ca8a04;
  -webkit-text-fill-color: #ca8a04;
  opacity: 0.75;
}
.weekly-rec-item__starsbtn.weekly-rec-item__starsbtn--none .weekly-rec-item__stars-value {
  color: #a16207;
  -webkit-text-fill-color: #a16207;
}
.weekly-rec-item__wish .weekly-rec-item__wishbtn,
.weekly-rec-item__wish button:not(.weekly-rec-item__starsbtn) {
  font: inherit;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #6366f1;
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  cursor: pointer;
}
.weekly-rec-item__wish .weekly-rec-item__wishbtn:hover,
.weekly-rec-item__wish button:not(.weekly-rec-item__starsbtn):hover {
  background: rgba(99, 102, 241, 0.22);
  color: #3730a3;
}
.weekly-rec-item__wish .weekly-rec-item__wishbtn.--on,
.weekly-rec-item__wish button:not(.weekly-rec-item__starsbtn).--on {
  border-color: #ec4899;
  background: rgba(244, 114, 182, 0.15);
  color: #9d174d;
}

/* Embedded recipe tutorials (YouTube / Bilibili) on weekly cards and dish detail */
.recipe-video-embed {
  margin: 8px 0 0;
  width: 100%;
  max-width: 100%;
}
.recipe-video-embed__title {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0b5fff;
  letter-spacing: 0.02em;
}
.recipe-video-embed__ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #0f0f0f;
  border: 1px solid #e5e5e5;
}
.recipe-video-embed__frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Fallback when no direct video URL: Google Video / other search links */
.recipe-video-embed--search {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.recipe-video-embed__hint {
  margin: 0 0 8px;
  font-size: 0.76rem;
  color: #4b5563;
  line-height: 1.45;
}
.recipe-video-embed__search-nav {
  font-size: 0.8rem;
  line-height: 1.5;
}
.recipe-video-embed__search-nav a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}
.recipe-video-embed__search-nav a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .weekly-rec-panel {
    margin: 0 auto 12px;
  }
  .weekly-rec-list {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 641px) and (max-width: 1080px) {
  .weekly-rec-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Weekly meal plan ↔ supermarket Compare sheet (promotion cross-match) */
.guide-promo-hits {
  max-width: var(--ew-rail-max, 1400px);
  margin: 0 auto 28px;
  padding: 18px var(--ew-rail-pad-x, 24px) 22px;
  background: #f0f4f8;
  border: 1px solid #c5d8f0;
  border-radius: 12px;
}
.guide-promo-hits__title {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 600;
  color: #1a1a1a;
}
.guide-promo-hits__note {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #5c5c5c;
}
.guide-promo-hits__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guide-promo-hit,
.weekly-promo-hit {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 12px 14px;
}
.guide-promo-hit__product,
.weekly-promo-hit__product {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1a1a1a;
}
.guide-promo-hit__badge,
.weekly-promo-hit__badge {
  margin: 0 0 6px;
  font-size: 0.76rem;
  line-height: 1.4;
  color: #b45309;
  font-weight: 600;
}
.guide-promo-hit__match,
.weekly-promo-hit__match {
  margin: 0 0 6px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #0b5fff;
}
.guide-promo-hit__memo,
.weekly-promo-hit__memo {
  margin: 0 0 6px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #5c5c5c;
}
.guide-promo-hit__links,
.weekly-promo-hit__links {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #5c5c5c;
}
.guide-promo-hit__links a,
.weekly-promo-hit__links a {
  color: #0b5fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.guide-promo-hit__links a:hover,
.weekly-promo-hit__links a:hover {
  color: #0047c7;
}
.weekly-promo-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5e5e5;
}
.weekly-promo-wrap__title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
}
.weekly-promo-wrap__note {
  margin: 0 0 12px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #5c5c5c;
}
.weekly-promo-hits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.table-hint.subtle {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: #5c6b82;
  line-height: 1.35;
}
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cuisine-style-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #18212f;
}
.cuisine-style-label__text {
  white-space: nowrap;
  font-weight: 600;
}
.cuisine-style-select {
  min-width: 9.5rem;
  max-width: min(42vw, 220px);
  border: 1px solid #c8c8c8;
  background: #ffffff;
  color: #18212f;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}
.cuisine-style-select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
.actions input[type="search"] {
  width: 260px;
  max-width: 42vw;
  border: 1px solid #c8c8c8;
  background: #ffffff;
  color: #18212f;
  padding: 9px 12px;
  border-radius: 8px;
}
.toggle { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }

.layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 16px;
  max-width: var(--ew-rail-max, 1400px);
  margin-left: auto;
  margin-right: auto;
  padding: 16px var(--ew-rail-pad-x, 24px);
  box-sizing: border-box;
}
.panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.07);
  padding: 14px;
}
.panel h2 { margin: 0 0 12px; font-size: 1.05rem; }
.poster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.poster-header h2 { margin: 0; }
.danger-btn {
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: #c62828;
  color: #fff;
  cursor: pointer;
  font-size: 0.88rem;
}
.danger-btn:hover { background: #a91f1f; }
.upload-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 14px;
  align-items: center;
}
.upload-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}
.upload-form label.checkbox-row {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #4a5568;
}
.upload-form label.checkbox-row input {
  margin-top: 3px;
  flex-shrink: 0;
}
.upload-form button {
  padding: 10px 12px;
  background: #0b6bcb;
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.upload-form button:hover { background: #0958a6; }
.upload-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.status { margin: 10px 0 0; color: #30425f; font-size: 0.9rem; }
.status.is-busy {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #eef3f9;
  border: 1px solid #c5d0e0;
  font-weight: 600;
}

.flyer-inventory-panel {
  margin-bottom: 8px;
}
.flyer-inventory-wrap {
  max-height: min(72vh, 920px);
  overflow: auto;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fafbfd;
}
.flyer-inventory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.flyer-inventory-table th,
.flyer-inventory-table td {
  border-bottom: 1px solid #e4eaf2;
  padding: 6px 10px;
  vertical-align: top;
  text-align: left;
}
.flyer-inventory-table th {
  position: sticky;
  top: 0;
  background: #eef3f9;
  z-index: 1;
  font-weight: 600;
}
.flyer-inventory-line {
  white-space: nowrap;
  width: 3.2rem;
  color: #5a6b82;
}
.flyer-inventory-text {
  word-break: break-word;
}
.flyer-inventory-price {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.help {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #5c6b82;
  line-height: 1.35;
}
.help.subtle {
  font-size: 0.78rem;
  color: #6b7a90;
}
.help.subtle code {
  font-size: 0.9em;
  background: #eef2f8;
  padding: 1px 5px;
  border-radius: 4px;
}
.side-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 10px 0 4px;
}
.side-actions button {
  padding: 9px 10px;
  border-radius: 8px;
  border: 0;
  background: #144a92;
  color: #fff;
  cursor: pointer;
}
.side-actions button:hover { background: #113e7b; }
.side-actions--workflow {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-actions .workflow-btn {
  font-weight: 600;
  width: 100%;
  color: #fff;
}
.side-actions .workflow-btn--scan {
  background: #0d7359;
}
.side-actions .workflow-btn--scan:hover:not(:disabled) {
  background: #0a5c48;
}
.side-actions .workflow-btn--combined {
  background: #5b21b6;
}
.side-actions .workflow-btn--combined:hover:not(:disabled) {
  background: #4c1d95;
}
.side-actions .workflow-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.workflow-short-hint {
  margin: 0 0 4px;
  font-size: 0.78rem;
  color: #5c6b82;
  line-height: 1.35;
}
.regenerate-ocr-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.35;
  max-width: 320px;
}
.regenerate-ocr-toggle input {
  margin-top: 3px;
  flex-shrink: 0;
}
.coverage-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.coverage-backdrop[hidden] {
  display: none !important;
}
.coverage-modal {
  background: #fff;
  border-radius: 12px;
  max-width: min(640px, 100%);
  max-height: min(86vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  z-index: 9999;
}
.coverage-modal-title {
  margin: 0;
  padding: 14px 18px 8px;
  font-size: 1.05rem;
  border-bottom: 1px solid #e2e8f0;
}
.coverage-modal-body {
  padding: 12px 18px;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #1e293b;
}
.coverage-modal-body .cov-stats {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.coverage-modal-body .cov-stats li {
  margin: 4px 0;
}
.coverage-modal-body .cov-section {
  margin: 12px 0 6px;
  font-weight: 700;
  font-size: 0.88rem;
}
.coverage-modal-body .cov-list {
  margin: 0;
  padding-left: 1.1rem;
  max-height: 200px;
  overflow: auto;
}
.coverage-modal-body .cov-hint {
  margin-top: 12px;
  color: #475569;
  font-size: 0.78rem;
}
.coverage-modal-close {
  margin: 8px 18px 14px;
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #0b5fff;
  background: #0b5fff;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.coverage-modal-close:hover {
  background: #0047c7;
  border-color: #0047c7;
}
.wc-verify-sheet-btn {
  margin: 8px;
  width: calc(100% - 16px);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #94a3b8;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.wc-verify-sheet-btn:hover {
  background: #e2e8f0;
}
.wc-ai-flyer-read-btn {
  margin: 8px;
  width: calc(100% - 16px);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #0b5fff;
  background: #eef4ff;
  color: #0b3d91;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.wc-ai-flyer-read-btn:hover:not(:disabled) {
  background: #dce8ff;
}
.wc-ai-flyer-read-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
a.wc-ai-flyer-xlsx-link {
  display: block;
  margin: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #0f766e;
  background: #ecfdf5;
  color: #0f5132;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
a.wc-ai-flyer-xlsx-link:hover {
  background: #d1fae5;
}
.wc-ai-provider-wrap {
  margin: 6px 8px 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wc-ai-provider-lab {
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
}
select.wc-ai-provider-select {
  width: calc(100% - 0px);
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.78rem;
  color: #0f172a;
}
.coverage-modal.vision-extract-modal {
  max-width: min(1020px, 100%);
}
.vision-extract-meta {
  margin: 0;
  padding: 0 18px 8px;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.4;
}
.coverage-modal-body.vision-extract-body {
  max-height: min(70vh, 560px);
  padding-top: 4px;
  overflow-x: auto;
}
.wc-vision-section {
  margin-top: 14px;
}
.wc-vision-section:first-child {
  margin-top: 0;
}
.wc-vision-section-title {
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 650;
  color: #0f172a;
}
.wc-vision-section-note {
  margin: 0 0 10px;
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.35;
}
.wc-vision-section--ai {
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
}
.wc-vision-section--flyer-xlsx {
  margin-top: 0;
}
.wc-vision-section--workbook {
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
a.wc-vision-flyer-xlsx-dl {
  display: inline-block;
  margin: 4px 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #0f766e;
  background: #ecfdf5;
  color: #0f5132;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
a.wc-vision-flyer-xlsx-dl:hover {
  background: #d1fae5;
}
table.wc-vision-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
table.wc-vision-table th,
table.wc-vision-table td {
  border: 1px solid #e2e8f0;
  padding: 6px 8px;
  vertical-align: top;
  word-break: break-word;
}
table.wc-vision-table thead th {
  background: #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 1;
}
.wc-blend-ai-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 8px;
  font-size: 0.82rem;
  color: #334155;
}
.wc-ai-flyer-persisted {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #c5d8f0;
  background: #f8fbff;
}
.wc-ai-flyer-persisted-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
}
.wc-ai-flyer-persisted-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wc-ai-flyer-persist-card {
  margin: 0;
}
.wc-ai-flyer-persist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.wc-ai-flyer-persist-head h4 {
  margin: 0;
  font-size: 0.85rem;
  flex: 1 1 auto;
}
.wc-ai-flyer-persist-meta {
  font-size: 0.75rem;
  color: #64748b;
}
.wc-ai-flyer-clear-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid #94a3b8;
  background: #fff;
  cursor: pointer;
}
.wc-ai-flyer-clear-btn:hover {
  background: #f1f5f9;
}
td.price.price--ai-flyer-hint {
  font-weight: 600;
  color: #6d28d9;
  background: #faf5ff;
}
.excel-workbook-panel {
  margin: 12px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #c5d8f0;
  background: #f0f7ff;
}
.excel-workbook-title {
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}
.excel-workbook-intro {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.45;
}
.excel-workbook-intro a {
  font-weight: 600;
  color: #0b6bcb;
}
.excel-workbook-intro a:hover {
  color: #094d94;
}
.excel-workbook-meta {
  margin: 0;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
}
.side-actions .danger-btn {
  background: #c62828;
}
.side-actions .danger-btn:hover { background: #a91f1f; }

.table-wrap { overflow: auto; max-height: 78vh; border: 1px solid #e6ebf2; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
thead th {
  position: sticky;
  top: 0;
  background: #eff4ff;
  z-index: 1;
  border-bottom: 1px solid #d8e2f2;
}
th, td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid #edf1f7;
  font-size: 0.92rem;
}
tbody tr:hover { background: #f8fbff; }
td.price { font-weight: 600; color: #0b6bcb; }
td.price.price--clickable {
  padding: 0;
}
td.price.price--clickable a.price-link {
  display: block;
  padding: 9px 10px;
  color: inherit;
  font-weight: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
td.price.price--clickable a.price-link:hover {
  background: rgba(11, 107, 203, 0.1);
}
td.price.price--clickable a.price-link:focus-visible {
  outline: 2px solid #0b6bcb;
  outline-offset: -2px;
}
td.memo { color: #8a5b00; }
td.empty { color: #b6c0d1; }

.ad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.right-panel { align-self: start; }
.ad-card {
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.ad-card h3 {
  margin: 0;
  padding: 7px 8px;
  font-size: 0.85rem;
  background: #f2f6fc;
  border-bottom: 1px solid #e6ebf2;
}
.ad-card-sub {
  padding: 2px 8px 6px;
  font-size: 0.72rem;
  color: #6b7a90;
  font-family: ui-monospace, monospace;
  background: #f8fafc;
  border-bottom: 1px solid #e6ebf2;
}
.ad-card-preview-box {
  position: relative;
  min-height: 170px;
  background: #f4f6fb;
  border-bottom: 1px solid #e6ebf2;
}
.ad-card-preview-placeholder {
  padding: 24px 12px;
  text-align: center;
  font-size: 0.78rem;
  color: #6b7a90;
  line-height: 1.4;
}
.ad-card-preview-img {
  width: 100%;
  display: block;
  height: 170px;
  object-fit: cover;
}
.wc-show-flyer-preview-btn {
  display: block;
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0;
  background: #144a92;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.wc-show-flyer-preview-btn:hover {
  background: #113e7b;
}
.combined-text-only-hint {
  padding: 14px 12px;
  font-size: 0.8rem;
  color: #5c6b82;
  line-height: 1.4;
  background: #f4f6fb;
  border-bottom: 1px solid #e6ebf2;
}
.img-missing {
  padding: 20px 12px;
  text-align: center;
  color: #7b8698;
  font-size: 0.9rem;
}

.combined-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}
.combined-card {
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  scroll-margin-top: 12px;
}
.combined-card.combined-card--focus {
  box-shadow: 0 0 0 3px #0b6bcb, 0 10px 28px rgba(11, 107, 203, 0.18);
  transition: box-shadow 0.2s ease;
}
/* Exactly one hero image per product card (no multi-image layout). */
.combined-visual {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f4f6fb;
  border-radius: 10px 10px 0 0;
}
.combined-hero-wrap {
  position: relative;
  width: 100%;
  min-height: 200px;
  background: #eef1f6;
}
.combined-image-prompt {
  padding: 28px 14px;
  text-align: center;
  font-size: 0.82rem;
  color: #5c6b82;
  line-height: 1.45;
  max-width: 100%;
}
.combined-snippet-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 10px 12px;
  background: #fff;
  border-top: 1px solid #e6ebf2;
}
.wc-snippet-btn {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #c5d0e0;
  background: #f8fafc;
  color: #1e293b;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.wc-snippet-btn:hover:not(:disabled) {
  background: #eef2f8;
}
.wc-snippet-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.wc-snippet-btn--primary {
  background: #0b6bcb;
  border-color: #0b6bcb;
  color: #fff;
}
.wc-snippet-btn--primary:hover:not(:disabled) {
  background: #0958ad;
}
.wc-scan-flyer-btn {
  display: block;
  width: calc(100% - 16px);
  margin: 0 8px 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0;
  background: #144a92;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.wc-scan-flyer-btn:hover:not(:disabled) {
  background: #113e7b;
}
.wc-scan-flyer-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.combined-card img.combined-hero {
  width: 100%;
  height: auto;
  max-height: min(70vh, 560px);
  object-fit: contain;
  object-position: center top;
  display: block;
  background: #eef1f6;
  cursor: pointer;
}
/* Shown until lazy snippet request starts */
.combined-card img.combined-hero.combined-hero-pending {
  min-height: 200px;
}
.combined-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 10px 8px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.85) 55%, transparent 100%);
  pointer-events: none;
  text-align: left;
}
.combined-overlay-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.25;
  text-shadow: none;
}
.combined-overlay-store {
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #5c5c5c;
  text-shadow: none;
}
.combined-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 140px;
  padding: 16px 12px;
  text-align: center;
  font-size: 0.82rem;
  color: #5c6b82;
  background: #eef2f8;
}
.combined-placeholder strong {
  display: block;
  color: #18212f;
  font-size: 0.9rem;
}
.combined-placeholder span {
  font-size: 0.78rem;
  line-height: 1.35;
}
.combined-meta {
  padding: 8px 10px 10px;
}
.combined-meta .name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 8px;
}
.combined-img-caption {
  font-size: 0.72rem;
  color: #6b778c;
  padding: 4px 8px 0;
  background: #fff;
}
.combined-price-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.combined-price-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.82rem;
}
.combined-price-primary {
  font-size: 0.95rem;
}
.combined-price-primary .price {
  font-size: 1.05rem;
}
.combined-price-secondary {
  margin-top: 6px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #6b778c;
}
.combined-meta .store {
  color: #4a5b75;
  flex: 1;
  min-width: 0;
}
.combined-meta .price {
  color: #0b6bcb;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .table-wrap { max-height: none; }
  .ad-grid { grid-template-columns: 1fr 1fr; }
  .combined-grid { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
}
@media (max-width: 700px) {
  .ad-grid { grid-template-columns: 1fr; }
  .combined-grid { grid-template-columns: 1fr; }
}

/* Registered-dietitian-style cuisine merge panels (regional guides + combine hub) */
.guide-rd-nutrition-host {
  margin: 0 0 16px;
}
.guide-rd-nutrition {
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  padding: 10px 14px 12px;
  color: #0f172a;
}
.guide-rd-nutrition__summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0b3a6e;
  list-style: none;
}
.guide-rd-nutrition__summary::-webkit-details-marker {
  display: none;
}
.guide-rd-nutrition__lead {
  margin: 8px 0 10px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #334155;
}
.guide-rd-nutrition__list {
  margin: 0 0 10px 1rem;
  padding: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #1e293b;
}
.guide-rd-nutrition__list li {
  margin-bottom: 6px;
}
.guide-rd-nutrition__disclaimer {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #64748b;
}

/* Latest saved “Match flyer to cuisine dishes” (regional-guides + regional-cuisine-guide nav). */
.rg-flyer-latest-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 8px 0 4px;
  border-bottom: 1px solid #e5e7eb;
}
.rg-flyer-latest-toolbar__meta {
  flex: 1 1 12rem;
  font-size: 0.8rem;
  color: #4b5563;
  line-height: 1.35;
  min-width: 0;
}
.rg-flyer-latest-toolbar__refresh {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #94a3b8;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
}
.rg-flyer-latest-toolbar__refresh:hover {
  background: #e2e8f0;
}
.rg-flyer-latest-toolbar__refresh:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.rg-flyer-latest-toolbar__compare {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
}
.rg-flyer-latest-toolbar__compare:hover {
  text-decoration: underline;
  color: #0047c7;
}
.rg-flyer-latest-toolbar__primary--disabled {
  opacity: 0.55;
}
/* Multi-run toolbar: up to four match blocks in a row (wraps on narrow viewports). */
.rg-flyer-latest-toolbar--stacked {
  align-items: stretch;
}
.rg-flyer-latest-toolbar__entries {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px 14px;
  width: 100%;
}
.rg-flyer-latest-toolbar__entry {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  flex: 1 1 200px;
  min-width: min(100%, 176px);
  max-width: min(100%, 300px);
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafbfc;
}
.rg-flyer-latest-toolbar__entry .rg-flyer-latest-toolbar__meta {
  flex: 0 1 auto;
  width: 100%;
  max-width: 100%;
}
.rg-flyer-latest-toolbar__primary--earlier {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}
.rg-flyer-latest-toolbar__cuisine-note {
  margin: 0;
  width: 100%;
  font-size: 0.76rem;
  line-height: 1.4;
  color: #475569;
}

/* Per-菜系: distinct dishes in pool that overlapped flyer lines / dishes in pool (see flyer_cuisine_match_rates). */
.rg-flyer-cuisine-rates {
  margin: 4px 0 0;
  max-height: 220px;
  overflow: auto;
  width: 100%;
}
.rg-flyer-cuisine-rates__title {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.3;
}

/* Collapsible breakdown: summary shows intro copy; table hidden until opened. */
.rg-flyer-cuisine-rates__details {
  margin: 0;
  width: 100%;
}
.rg-flyer-cuisine-rates__summary {
  cursor: pointer;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
  list-style-position: outside;
}
.rg-flyer-cuisine-rates__expand-hint {
  font-weight: 500;
  color: #64748b;
  font-size: 0.92em;
}
.rg-flyer-cuisine-rates__details[open] .rg-flyer-cuisine-rates__summary {
  margin-bottom: 8px;
}
.rg-flyer-cuisine-rates__details > .rg-flyer-cuisine-rates__table {
  margin-top: 2px;
}

.rg-flyer-cuisine-rates__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
  line-height: 1.35;
}
.rg-flyer-cuisine-rates__table th,
.rg-flyer-cuisine-rates__table td {
  padding: 2px 6px 2px 0;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
.rg-flyer-cuisine-rates__table th {
  text-align: left;
  color: #64748b;
  font-weight: 600;
}
.rg-flyer-cuisine-rates__num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* One row of store links, then one full-width % table (regional guides / hub guides). */
.rg-flyer-latest-toolbar__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  width: 100%;
  margin: 0 0 12px;
}
.rg-flyer-latest-toolbar__chip {
  flex: 0 0 auto;
}
.rg-flyer-latest-toolbar__rates {
  width: 100%;
}
.rg-flyer-latest-toolbar__earlier {
  margin: 10px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #475569;
}
.rg-flyer-cuisine-rates--prominent {
  max-height: none;
  margin-top: 0;
}
.rg-flyer-cuisine-rates--prominent .rg-flyer-cuisine-rates__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}
.rg-flyer-cuisine-rates--prominent .rg-flyer-cuisine-rates__summary {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}
.rg-flyer-cuisine-rates--prominent .rg-flyer-cuisine-rates__expand-hint {
  font-size: 0.82rem;
}
.rg-flyer-cuisine-rates--prominent .rg-flyer-cuisine-rates__table {
  font-size: 0.88rem;
}
.rg-flyer-cuisine-rates__pct {
  text-align: right;
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f766e;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.wc-flyer-seven-cuisine-rates {
  margin-bottom: 10px;
}

.wc-flyer-seven-cuisine-rates.rg-flyer-cuisine-rates--prominent {
  margin-top: 14px;
  margin-bottom: 0;
}

/* Product detail: flyer pool % inline after cuisine value (toggle via cuisine label). */
.pd-cuisine__dt--flyer-toggle {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.pd-cuisine__inline-flyer-pct {
  font-weight: 600;
  color: #0f766e;
  font-variant-numeric: tabular-nums;
}
.pd-cuisine__flyer-pct-solo {
  display: block;
  margin-top: 6px;
  padding: 6px 10px;
  max-width: 14rem;
  font-size: 0.95rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #5eead4;
  border-radius: 8px;
  line-height: 1.3;
}
