/* ============================================================
   Supplement Stack — scoped to body .hc-ss-wrap (page)
   Dashboard card uses .hc-ss-card (inside .herclarity-module)
   Modal overlay is root-level (.hc-ss-modal-overlay)
   All classes prefixed hc-ss- to avoid theme conflicts.
   ============================================================ */

/* ── Box-sizing reset ───────────────────────────────────────── */

body .hc-ss-wrap,
body .hc-ss-wrap *,
.hc-ss-modal-overlay,
.hc-ss-modal-overlay * {
  box-sizing: border-box;
}

/* ─────────────────────────────────────────────────────────────
   DASHBOARD CARD  (rendered inside .herclarity-module)
   ──────────────────────────────────────────────────────────── */

.hc-ss-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Empty state — longer copy */
.hc-ss-card__empty-text {
  font-size: 0.9375rem;
  color: var(--hc-text-soft);
  line-height: 1.6;
  margin: 0;
}

/* Populated state — count line */
.hc-ss-card__count {
  font-size: 0.9375rem;
  color: var(--hc-text);
  font-weight: 600;
  margin: 0;
}

/* Ingredient overlap flag — soft green, question mark */
.hc-ss-card__overlap {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  color: #2d6a4f;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0;
  line-height: 1.4;
}

.hc-ss-card__overlap-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #4ade80;
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

.hc-ss-card__tagline {
  font-size: 0.875rem;
  color: var(--hc-text-soft, #6b7280);
  margin: 0;
  line-height: 1.5;
}

.hc-ss-card__footer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hc-ss-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hc-ss-card__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--hc-text);
  padding: 8px 0;
  border-bottom: 1px solid var(--hc-border);
  line-height: 1.3;
}

.hc-ss-card__item:last-child {
  border-bottom: none;
}

.hc-ss-card__item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hc-accent);
  flex-shrink: 0;
}

.hc-ss-card__item-amount {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--hc-text-soft);
  white-space: nowrap;
}

.hc-ss-card__more {
  font-size: 0.8125rem;
  color: var(--hc-text-soft);
  padding-top: 4px;
}

/* Text link CTA (populated state) */
.hc-ss-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--hc-accent);
  text-decoration: none;
  transition: opacity 0.15s;
}

.hc-ss-card__cta:hover {
  opacity: 0.78;
  text-decoration: none;
  color: var(--hc-accent);
}

/* Button-style CTA (empty state) */
.hc-ss-card__cta--btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hc-text, #243127);
  color: #fff;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 4px;
  transition: opacity 0.15s;
}

.hc-ss-card__cta--btn:hover {
  opacity: 0.88;
  color: #fff;
  text-decoration: none;
}

/* ─────────────────────────────────────────────────────────────
   FULL STACK PAGE  (body .hc-ss-wrap)
   ──────────────────────────────────────────────────────────── */

body .hc-ss-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 24px 64px;
  font-size: 1rem;
  line-height: var(--hc-line-height, 1.55);
  color: var(--hc-text, #243127);
}

/* ── Page header ────────────────────────────────────────────── */

body .hc-ss-wrap .hc-ss-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

body .hc-ss-wrap .hc-ss-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--hc-text, #243127);
  margin: 0 0 6px;
  line-height: 1.2;
}

body .hc-ss-wrap .hc-ss-subtitle {
  font-size: 0.9375rem;
  color: var(--hc-text-soft, #617067);
  margin: 0;
}

/* ── Primary action button ──────────────────────────────────── */

body .hc-ss-wrap .hc-ss-btn-primary,
.hc-ss-modal-overlay .hc-ss-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--hc-text, #243127);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

body .hc-ss-wrap .hc-ss-btn-primary:hover,
.hc-ss-modal-overlay .hc-ss-btn-primary:hover {
  opacity: 0.88;
}

body .hc-ss-wrap .hc-ss-btn-primary:disabled,
.hc-ss-modal-overlay .hc-ss-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Ghost / secondary buttons ──────────────────────────────── */

body .hc-ss-wrap .hc-ss-btn-ghost,
.hc-ss-modal-overlay .hc-ss-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--hc-text-soft, #617067);
  border: 1px solid var(--hc-border, #dfe6df);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

body .hc-ss-wrap .hc-ss-btn-ghost:hover,
.hc-ss-modal-overlay .hc-ss-btn-ghost:hover {
  background: var(--hc-surface-soft, #f3f5f2);
  color: var(--hc-text, #243127);
}

body .hc-ss-wrap .hc-ss-btn-ghost:disabled,
.hc-ss-modal-overlay .hc-ss-btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

body .hc-ss-wrap .hc-ss-btn-ghost--danger,
.hc-ss-modal-overlay .hc-ss-btn-ghost--danger {
  color: #9c3d3d;
  border-color: #f0d0d0;
}

body .hc-ss-wrap .hc-ss-btn-ghost--danger:hover,
.hc-ss-modal-overlay .hc-ss-btn-ghost--danger:hover {
  background: #fdf2f2;
  color: #7a2d2d;
  border-color: #e8b8b8;
}

/* Text link button (inline) */
body .hc-ss-wrap .hc-ss-btn-link,
.hc-ss-modal-overlay .hc-ss-btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--hc-accent, #6f8f76);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body .hc-ss-wrap .hc-ss-btn-link:hover,
.hc-ss-modal-overlay .hc-ss-btn-link:hover {
  opacity: 0.75;
}

/* ── Overlap warning banner ─────────────────────────────────── */

/* ── Overlap section ────────────────────────────────────────── */

body .hc-ss-wrap .hc-ss-overlap-section {
  margin-bottom: 32px;
}

body .hc-ss-wrap .hc-ss-overlap-section__header {
  margin-bottom: 14px;
}

body .hc-ss-wrap .hc-ss-overlap-section__title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px;
}

body .hc-ss-wrap .hc-ss-overlap-section__note {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

body .hc-ss-wrap .hc-ss-overlap-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fffbeb;
  border: 1.5px solid #f0c060;
  border-radius: var(--hc-radius-sm, 12px);
  padding: 16px 18px;
  margin-bottom: 12px;
}

body .hc-ss-wrap .hc-ss-overlap-banner__body {
  flex: 1;
  min-width: 0;
}

body .hc-ss-wrap .hc-ss-overlap-banner__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #78460a;
  margin: 0 0 4px;
}

body .hc-ss-wrap .hc-ss-overlap-banner__text {
  font-size: 0.875rem;
  color: #92540c;
  margin: 0 0 6px;
  line-height: 1.5;
}

body .hc-ss-wrap .hc-ss-overlap-banner__provider {
  font-size: 0.8125rem;
  color: #b07820;
  margin: 0;
  font-style: italic;
}

body .hc-ss-wrap .hc-ss-overlap-banner__dismiss {
  background: none;
  border: none;
  padding: 0;
  font-size: 1.1rem;
  color: #b07820;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

body .hc-ss-wrap .hc-ss-overlap-banner__dismiss:hover {
  opacity: 1;
}

/* ── Disclaimer ─────────────────────────────────────────────── */

/* ── Ingredient summary ─────────────────────────────────────── */

body .hc-ss-wrap .hc-ss-summary {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 28px;
}

body .hc-ss-wrap .hc-ss-summary__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

body .hc-ss-wrap .hc-ss-summary__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

body .hc-ss-wrap .hc-ss-summary__list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 24px;
}

@media (max-width: 600px) {
  body .hc-ss-wrap .hc-ss-summary__list { columns: 1; }
  body .hc-ss-wrap { padding-left: 12px; padding-right: 12px; }
}

body .hc-ss-wrap .hc-ss-summary__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.875rem;
  color: #374151;
  padding: 4px 0;
  border-bottom: 1px solid #e5e7eb;
  break-inside: avoid;
  line-height: 1.4;
}

body .hc-ss-wrap .hc-ss-summary__name {
  flex: 1;
  min-width: 0;
}

body .hc-ss-wrap .hc-ss-summary__amount {
  font-size: 0.8125rem;
  color: #6b7280;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Page footer & back button ──────────────────────────────── */

body .hc-ss-wrap .hc-ss-page-footer {
  margin-top: 40px;
  margin-bottom: 16px;
}

body .hc-ss-wrap .hc-ss-back-btn {
  font-size: 0.875rem;
}

/* ── Disclaimer ─────────────────────────────────────────────── */

body .hc-ss-wrap .hc-ss-disclaimer {
  font-size: 0.8125rem;
  color: #9ca3af;
  line-height: 1.6;
  margin-top: 0;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

/* ── Print styles ───────────────────────────────────────────── */

@media print {
  .hc-ss-btn-primary, .hc-ss-btn-ghost, .hc-ss-product__actions,
  .hc-ss-overlap-banner__dismiss, .hc-ss-back-btn, .hc-ss-page-footer,
  #hc-ss-add-btn, .hc-ss-print-btn { display: none !important; }
  body .hc-ss-wrap .hc-ss-summary__list { columns: 2; }
  body .hc-ss-wrap .hc-ss-product { break-inside: avoid; }
}

/* ── Empty state ────────────────────────────────────────────── */

body .hc-ss-wrap .hc-ss-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--hc-surface, #fff);
  border: 1px solid var(--hc-border, #dfe6df);
  border-radius: var(--hc-radius, 20px);
  box-shadow: var(--hc-shadow);
}

body .hc-ss-wrap .hc-ss-empty__icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
  line-height: 1;
}

body .hc-ss-wrap .hc-ss-empty__title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--hc-text);
  margin: 0 0 8px;
}

body .hc-ss-wrap .hc-ss-empty__text {
  font-size: 0.9375rem;
  color: var(--hc-text-soft);
  margin: 0 0 20px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Product list ───────────────────────────────────────────── */

body .hc-ss-wrap .hc-ss-product-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Product card ───────────────────────────────────────────── */

body .hc-ss-wrap .hc-ss-product {
  background: var(--hc-surface, #fff);
  border: 1px solid var(--hc-border, #dfe6df);
  border-radius: var(--hc-radius, 20px);
  box-shadow: var(--hc-shadow);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

body .hc-ss-wrap .hc-ss-product--paused {
  opacity: 0.7;
}

body .hc-ss-wrap .hc-ss-product__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  flex-wrap: wrap;
}

body .hc-ss-wrap .hc-ss-product__info {
  flex: 1;
  min-width: 0;
}

body .hc-ss-wrap .hc-ss-product__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--hc-text);
  margin: 0 0 3px;
  line-height: 1.3;
}

/* Sub-line: brand text + ingredient toggle inline */
body .hc-ss-wrap .hc-ss-product__sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

body .hc-ss-wrap .hc-ss-product__brand-text {
  font-size: 0.8125rem;
  color: var(--hc-text-soft);
}

body .hc-ss-wrap .hc-ss-product__no-ing {
  font-size: 0.8125rem;
  color: var(--hc-text-soft);
  font-style: italic;
}

/* Ingredient expand toggle */
body .hc-ss-wrap .hc-ss-ing-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--hc-accent, #6f8f76);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.15s;
  line-height: 1;
}

body .hc-ss-wrap .hc-ss-ing-toggle:hover {
  opacity: 0.75;
}

body .hc-ss-wrap .hc-ss-product__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body .hc-ss-wrap .hc-ss-product__actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── Status badges ──────────────────────────────────────────── */

body .hc-ss-wrap .hc-ss-badge,
.hc-ss-modal-overlay .hc-ss-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1;
}

body .hc-ss-wrap .hc-ss-badge--active {
  background: var(--hc-accent-soft, #e8efe9);
  color: var(--hc-accent, #6f8f76);
}

body .hc-ss-wrap .hc-ss-badge--paused {
  background: var(--hc-surface-soft, #f3f5f2);
  color: var(--hc-text-soft, #617067);
}

body .hc-ss-wrap .hc-ss-badge--review {
  background: #fef3c7;
  color: #92400e;
}

/* ── Ingredient list (collapsed by default, expanded on toggle) ─ */

body .hc-ss-wrap .hc-ss-ingredient-list {
  display: none; /* hidden until .hc-ss-product--expanded */
  border-top: 1px solid var(--hc-border, #dfe6df);
  padding: 10px 18px 14px;
}

body .hc-ss-wrap .hc-ss-product--expanded .hc-ss-ingredient-list {
  display: block;
}

body .hc-ss-wrap .hc-ss-ingredient-list__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hc-text-soft);
  margin: 0 0 8px;
}

body .hc-ss-wrap .hc-ss-ingredient-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hc-border, #dfe6df);
  font-size: 0.9rem;
}

body .hc-ss-wrap .hc-ss-ingredient-row:last-child {
  border-bottom: none;
}

body .hc-ss-wrap .hc-ss-ingredient-row__name {
  flex: 1;
  color: var(--hc-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .hc-ss-wrap .hc-ss-ingredient-row__amount {
  font-size: 0.8125rem;
  color: var(--hc-text-soft);
  white-space: nowrap;
}

body .hc-ss-wrap .hc-ss-ingredient-row__flag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

body .hc-ss-wrap .hc-ss-ingredient-row__flag--review {
  background: #fef3c7;
  color: #92400e;
  border: none;
  cursor: pointer;
}
body .hc-ss-wrap .hc-ss-ingredient-row__flag--review:hover {
  background: #fde68a;
}

body .hc-ss-wrap .hc-ss-ingredient-row__flag--overlap {
  background: #fee2e2;
  color: #991b1b;
}

body .hc-ss-wrap .hc-ss-ingredient-row__no-match {
  font-size: 0.75rem;
  color: #6b7280;
  padding: 3px 0 6px 0;
  line-height: 1.4;
}
body .hc-ss-wrap .hc-ss-ingredient-row__no-match a {
  color: #6b7280;
  text-decoration: underline;
}

/* ── Loading state (shimmer) ────────────────────────────────── */

body .hc-ss-wrap .hc-ss-loading {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body .hc-ss-wrap .hc-ss-loading__card {
  background: var(--hc-surface, #fff);
  border: 1px solid var(--hc-border, #dfe6df);
  border-radius: var(--hc-radius, 20px);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body .hc-ss-wrap .hc-ss-loading__line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef2ee 0%, #f7f9f7 50%, #eef2ee 100%);
  background-size: 200% 100%;
  animation: hc-ss-shimmer 1.5s infinite linear;
}

body .hc-ss-wrap .hc-ss-loading__line--lg { width: 60%; }
body .hc-ss-wrap .hc-ss-loading__line--sm { width: 38%; }

@keyframes hc-ss-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Error state ────────────────────────────────────────────── */

body .hc-ss-wrap .hc-ss-error {
  background: #fdf2f2;
  border: 1.5px solid #f0c8c8;
  border-radius: var(--hc-radius-sm, 12px);
  padding: 16px 20px;
  font-size: 0.9375rem;
  color: #7a2d2d;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────
   ADD SUPPLEMENT MODAL  (.hc-ss-modal-overlay, root level)
   ──────────────────────────────────────────────────────────── */

.hc-ss-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 49, 39, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 9999;
  padding: 0;
  /* slide up from bottom on mobile */
  animation: hc-ss-overlay-in 0.2s ease;
}

@keyframes hc-ss-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (min-width: 600px) {
  .hc-ss-modal-overlay {
    align-items: center;
    padding: 24px;
  }
}

.hc-ss-modal {
  background: var(--hc-surface, #fff);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: hc-ss-modal-in 0.25s ease;
}

@keyframes hc-ss-modal-in {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@media (min-width: 600px) {
  .hc-ss-modal {
    border-radius: var(--hc-radius, 20px);
    max-width: 540px;
    max-height: 88vh;
  }
}

/* Drag handle (mobile) */
.hc-ss-modal__handle {
  width: 36px;
  height: 4px;
  background: var(--hc-border, #dfe6df);
  border-radius: 999px;
  margin: 12px auto 0;
}

@media (min-width: 600px) {
  .hc-ss-modal__handle { display: none; }
}

.hc-ss-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--hc-border, #dfe6df);
  position: sticky;
  top: 0;
  background: var(--hc-surface, #fff);
  z-index: 1;
  border-radius: inherit;
}

.hc-ss-modal__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--hc-text, #243127);
  margin: 0;
}

.hc-ss-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--hc-surface-soft, #f3f5f2);
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--hc-text-soft, #617067);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.hc-ss-modal__close:hover {
  background: var(--hc-border, #dfe6df);
  color: var(--hc-text, #243127);
}

.hc-ss-modal__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hc-ss-modal__footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid var(--hc-border, #dfe6df);
}

/* ── Form fields (inside modal) ─────────────────────────────── */

.hc-ss-modal-overlay .hc-ss-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hc-ss-modal-overlay .hc-ss-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hc-ss-modal-overlay .hc-ss-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--hc-text, #243127);
}

.hc-ss-modal-overlay .hc-ss-label--optional {
  font-weight: 400;
  color: var(--hc-text-soft, #617067);
  font-size: 0.875rem;
}

.hc-ss-modal-overlay .hc-ss-input,
.hc-ss-modal-overlay .hc-ss-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--hc-border, #dfe6df);
  border-radius: var(--hc-radius-sm, 12px);
  font-size: 0.9375rem;
  color: var(--hc-text, #243127);
  background: var(--hc-surface, #fff);
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.hc-ss-modal-overlay .hc-ss-input:focus,
.hc-ss-modal-overlay .hc-ss-select:focus {
  border-color: var(--hc-accent, #6f8f76);
}

.hc-ss-modal-overlay .hc-ss-input--error,
.hc-ss-modal-overlay .hc-ss-select--error {
  border-color: #c0392b;
}

.hc-ss-modal-overlay .hc-ss-field-error {
  font-size: 0.8125rem;
  color: #c0392b;
  margin: 0;
}

/* Hint text below a field */
.hc-ss-modal-overlay .hc-ss-hint {
  font-size: 0.8125rem;
  color: var(--hc-text-soft, #617067);
  margin: 0;
  line-height: 1.45;
}

/* ── Photo-first primary block ──────────────────────────────── */

.hc-ss-modal-overlay .hc-ss-photo-primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 8px 0 4px;
}

/* Invisible file input layered over the button */
.hc-ss-modal-overlay .hc-ss-photo-zone {
  position: relative;
  display: inline-block;
}

.hc-ss-modal-overlay .hc-ss-photo-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* The prominent photo upload button */
.hc-ss-modal-overlay .hc-ss-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--hc-text, #243127);
  color: #fff;
  border-radius: 999px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  user-select: none;
}

.hc-ss-modal-overlay .hc-ss-photo-btn:hover {
  opacity: 0.88;
}

.hc-ss-modal-overlay .hc-ss-photo-btn__icon {
  font-size: 1.1rem;
  line-height: 1;
}

.hc-ss-modal-overlay .hc-ss-photo-helper {
  font-size: 0.875rem;
  color: var(--hc-text-soft, #617067);
  margin: 0;
  line-height: 1.5;
}

/* "Enter manually instead" link */
.hc-ss-modal-overlay .hc-ss-manual-link-wrap {
  text-align: center;
  margin: 4px 0 0;
}

.hc-ss-modal-overlay .hc-ss-manual-link-wrap .hc-ss-btn-link {
  font-size: 0.8125rem;
  color: var(--hc-text-soft, #617067);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Thumbnail preview (after photo selected) */
.hc-ss-modal-overlay .hc-ss-photo-preview {
  position: relative;
  border-radius: var(--hc-radius-sm, 12px);
  overflow: hidden;
  background: var(--hc-surface-soft);
}

.hc-ss-modal-overlay .hc-ss-photo-preview img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
}

.hc-ss-modal-overlay .hc-ss-photo-preview__clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(36, 49, 39, 0.65);
  border: none;
  color: #fff;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.hc-ss-modal-overlay .hc-ss-photo-preview__clear:hover {
  background: rgba(36, 49, 39, 0.9);
}

/* ── AI scanning state ──────────────────────────────────────── */

.hc-ss-modal-overlay .hc-ss-scanning {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 20px;
  text-align: center;
}

.hc-ss-modal-overlay .hc-ss-scanning__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--hc-accent-soft, #e8efe9);
  border-top-color: var(--hc-accent, #6f8f76);
  border-radius: 50%;
  animation: hc-ss-spin 0.75s linear infinite;
}

@keyframes hc-ss-spin {
  to { transform: rotate(360deg); }
}

.hc-ss-modal-overlay .hc-ss-scanning__text {
  font-size: 0.9375rem;
  color: var(--hc-text-soft, #617067);
  margin: 0;
}

/* ── Ingredient edit rows (manual entry / AI result) ────────── */

.hc-ss-modal-overlay .hc-ss-ing-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hc-ss-modal-overlay .hc-ss-ing-list__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hc-text-soft);
  margin-bottom: 4px;
}

.hc-ss-modal-overlay .hc-ss-ing-row {
  display: grid;
  grid-template-columns: 1fr 90px 80px 32px;
  gap: 8px;
  align-items: center;
}

.hc-ss-modal-overlay .hc-ss-ing-row__name,
.hc-ss-modal-overlay .hc-ss-ing-row__amount,
.hc-ss-modal-overlay .hc-ss-ing-row__unit {
  padding: 9px 12px;
  border: 1.5px solid var(--hc-border, #dfe6df);
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--hc-text, #243127);
  background: var(--hc-surface, #fff);
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.hc-ss-modal-overlay .hc-ss-ing-row__name:focus,
.hc-ss-modal-overlay .hc-ss-ing-row__amount:focus,
.hc-ss-modal-overlay .hc-ss-ing-row__unit:focus {
  border-color: var(--hc-accent, #6f8f76);
}

.hc-ss-modal-overlay .hc-ss-ing-row__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--hc-text-soft, #617067);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.hc-ss-modal-overlay .hc-ss-ing-row__remove:hover {
  background: #fdf2f2;
  color: #9c3d3d;
}

.hc-ss-modal-overlay .hc-ss-ing-add-row {
  margin-top: 4px;
}

/* ── Divider with label ─────────────────────────────────────── */

.hc-ss-modal-overlay .hc-ss-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--hc-text-soft);
  margin: 4px 0;
}

.hc-ss-modal-overlay .hc-ss-divider::before,
.hc-ss-modal-overlay .hc-ss-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hc-border);
}

/* ── Inline form error banner (modal) ───────────────────────── */

.hc-ss-modal-overlay .hc-ss-form-error {
  background: #fdf2f2;
  border: 1.5px solid #f0c8c8;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.875rem;
  color: #7a2d2d;
  line-height: 1.5;
  margin: 0;
}

/* ── Delete confirmation modal (second layer) ───────────────── */

.hc-ss-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 49, 39, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
  box-sizing: border-box;
}

.hc-ss-confirm-box {
  background: var(--hc-surface, #fff);
  border-radius: var(--hc-radius, 20px);
  padding: 28px 24px 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(28, 44, 32, 0.18);
}

.hc-ss-confirm-box__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--hc-text);
  margin: 0 0 10px;
}

.hc-ss-confirm-box__text {
  font-size: 0.9375rem;
  color: var(--hc-text-soft);
  margin: 0 0 20px;
  line-height: 1.55;
}

.hc-ss-confirm-box__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 599px) {
  body .hc-ss-wrap {
    padding: 24px 0 56px;
  }

  body .hc-ss-wrap .hc-ss-title {
    font-size: 1.4rem;
  }

  body .hc-ss-wrap .hc-ss-header {
    flex-direction: column;
    align-items: flex-start;
  }

  body .hc-ss-wrap .hc-ss-product__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  body .hc-ss-wrap .hc-ss-product__meta {
    width: 100%;
    justify-content: space-between;
  }

  .hc-ss-modal-overlay .hc-ss-ing-row {
    grid-template-columns: 1fr 80px 70px 32px;
    gap: 6px;
  }

  .hc-ss-modal-overlay .hc-ss-field-row {
    grid-template-columns: 1fr;
  }
}
