.scan-halal-view {
  --smh-bg: #f6f7f4;
  --smh-card: #ffffff;
  --smh-text: #142019;
  --smh-muted: #69756e;
  --smh-green: #0f6b43;
  --smh-green-2: #e7f4ed;
  --smh-gold: #b6974b;
  --smh-amber: #a96500;
  --smh-amber-bg: #fff4d8;
  --smh-red: #a82b2b;
  --smh-red-bg: #fdeaea;
  --smh-border: #e4e8e4;
  --smh-radius: 22px;
}
.scan-halal-view, .scan-halal-view * { box-sizing: border-box; }
.scan-halal-view { margin:0; background:var(--smh-bg); color:var(--smh-text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.scan-halal-view #halal-scanner { max-width: 520px; margin: 0 auto; min-height: 100vh; }
.smh-shell { padding: 24px 18px 40px; }
.smh-header,.smh-product-head,.smh-row,.smh-status { display:flex; align-items:center; }
.smh-header { justify-content:space-between; gap:16px; margin-bottom:8px; }
.scan-halal-view h1 { font-size:30px; line-height:1.08; margin:4px 0 8px; letter-spacing:-.03em; }
.scan-halal-view h2 { letter-spacing:-.02em; }
.smh-kicker { font-size:11px; letter-spacing:.13em; font-weight:800; color:var(--smh-green); text-transform:uppercase; }
.smh-mark { width:46px; height:46px; border-radius:50%; display:grid; place-items:center; background:var(--smh-green); color:white; font-size:22px; box-shadow:0 6px 18px rgba(15,107,67,.2); }
.smh-sub { color:var(--smh-muted); line-height:1.5; margin:0 0 22px; }
.scan-halal-view button,.scan-halal-view input,.scan-halal-view textarea { font:inherit; }
.scan-halal-view button { cursor:pointer; }
.smh-primary,.smh-secondary { width:100%; border-radius:16px; min-height:54px; padding:13px 18px; font-weight:800; border:0; }
.smh-primary { background:var(--smh-green); color:white; box-shadow:0 8px 18px rgba(15,107,67,.15); }
.smh-secondary { background:white; color:var(--smh-text); border:1px solid var(--smh-border); margin-top:10px; }
.smh-divider { display:flex; align-items:center; gap:12px; color:#9aa39d; font-size:12px; margin:21px 0; }
.smh-divider:before,.smh-divider:after { content:""; height:1px; background:var(--smh-border); flex:1; }
.smh-manual label { display:block; font-size:13px; font-weight:800; margin-bottom:8px; }
.smh-row { gap:8px; }
.smh-row input { flex:1; min-width:0; height:50px; border:1px solid var(--smh-border); border-radius:14px; padding:0 14px; background:white; }
.smh-row button { height:50px; border:0; border-radius:14px; padding:0 16px; background:var(--smh-green); color:#fff; font-weight:800; }
.smh-row button:disabled { background:#e9eeeb; color:#8b948e; cursor:not-allowed; }
.smh-link { width:100%; background:transparent; border:0; color:var(--smh-green); font-weight:800; padding:18px 4px; }
.smh-disclaimer,.smh-legal { color:var(--smh-muted); font-size:12px; line-height:1.5; }
.smh-legal { border-top:1px solid var(--smh-border); padding-top:16px; margin-top:22px; }
.smh-notice { border:1px solid #ead9a5; background:#fff9e9; padding:12px 14px; border-radius:14px; font-size:13px; margin-bottom:16px; }
.smh-hidden { display:none; }
.smh-back { border:0; background:transparent; color:var(--smh-green); padding:0 0 18px; font-weight:800; }
.smh-camera-wrap { position:relative; border-radius:24px; overflow:hidden; min-height:300px; background:#111; box-shadow:0 12px 28px rgba(0,0,0,.12); }
#smh-camera { min-height:300px; }
#smh-camera video { object-fit:cover!important; }
.smh-scan-line { position:absolute; z-index:3; left:10%; right:10%; top:50%; height:2px; background:#fff; box-shadow:0 0 12px rgba(255,255,255,.8); pointer-events:none; }
.smh-center { text-align:center; padding-top:30vh; }
.smh-spinner { width:36px; height:36px; border:3px solid #dfe5e0; border-top-color:var(--smh-green); border-radius:50%; margin:0 auto 18px; animation:smhSpin .8s linear infinite; }
@keyframes smhSpin { to { transform:rotate(360deg); } }
.smh-empty-icon { width:66px; height:66px; display:grid; place-items:center; border-radius:50%; background:#ecefec; font-size:32px; font-weight:800; color:#718077; margin:24px 0 18px; }
.smh-textarea { width:100%; border:1px solid var(--smh-border); border-radius:16px; padding:14px; resize:vertical; background:#fff; margin-bottom:12px; line-height:1.5; }
.smh-product-head { align-items:flex-start; gap:15px; margin-bottom:18px; }
.smh-product-img,.smh-product-placeholder { width:88px; height:88px; border-radius:18px; object-fit:contain; background:white; border:1px solid var(--smh-border); flex:0 0 auto; }
.smh-product-placeholder { display:grid; place-items:center; font-size:32px; color:#9aa49e; }
.smh-product-head h1 { font-size:24px; margin-top:3px; }
.smh-code { color:var(--smh-muted); font-size:12px; }
.smh-status { align-items:flex-start; gap:12px; border-radius:18px; padding:16px; border:1px solid transparent; }
.smh-status-icon { flex:0 0 34px; width:34px; height:34px; border-radius:50%; display:grid; place-items:center; font-weight:900; font-size:20px; }
.smh-status strong { display:block; font-size:17px; margin:1px 0 5px; }
.smh-status p { margin:0; font-size:13px; line-height:1.45; }
.smh-green { background:#e6f4ec; border-color:#c5e5d3; color:#075b36; }
.smh-green .smh-status-icon { background:#0f6b43; color:white; }
.smh-green-soft { background:#eef6f1; border-color:#d7e8de; color:#315e47; }
.smh-green-soft .smh-status-icon { background:#4f8769; color:white; }
.smh-amber { background:var(--smh-amber-bg); border-color:#efd9a3; color:#704600; }
.smh-amber .smh-status-icon { background:#b56c00; color:white; }
.smh-red { background:var(--smh-red-bg); border-color:#efc6c6; color:#7f1f1f; }
.smh-red .smh-status-icon { background:#a82b2b; color:white; }
.smh-label-note,.smh-cert { border:1px solid var(--smh-border); background:#fff; border-radius:14px; padding:12px 14px; margin-top:10px; font-size:13px; line-height:1.4; }
.smh-cert { border-color:#cde1d5; background:#f0f8f3; }
.smh-section-title { font-size:17px; margin:22px 0 9px; }
.smh-finding { background:#fff; border:1px solid var(--smh-border); border-radius:16px; padding:14px; margin-bottom:8px; }
.smh-finding-title { font-weight:850; }
.smh-finding p { color:var(--smh-muted); margin:5px 0 6px; font-size:13px; line-height:1.45; }
.smh-finding small { color:#7c8780; line-height:1.4; display:block; }
.smh-details { background:#fff; border:1px solid var(--smh-border); border-radius:16px; padding:14px; margin-top:18px; }
.smh-details summary { font-weight:800; cursor:pointer; }
.smh-details p { color:var(--smh-muted); font-size:13px; line-height:1.55; }
@media (prefers-color-scheme: dark) {
  .scan-halal-view { --smh-bg:#101512; --smh-card:#171d19; --smh-text:#edf3ef; --smh-muted:#a3afa7; --smh-border:#29332d; --smh-green-2:#183b29; }
  .smh-row input,.smh-textarea,.smh-secondary,.smh-product-img,.smh-product-placeholder,.smh-label-note,.smh-finding,.smh-details { background:#171d19; color:var(--smh-text); }
  .smh-row button { background:#252e28; color:var(--smh-text); }
  .smh-green-soft { background:#162c20; border-color:#254a34; color:#cce9d8; }
}

/* v1.1 — alternative halal */
.smh-alt-cta { margin-top:16px; }
.smh-source-pill { display:inline-block; margin:0 0 16px; padding:8px 11px; border-radius:999px; background:#eef3ef; color:var(--smh-muted); font-size:11px; font-weight:800; }
.smh-alt-list { display:grid; gap:11px; }
.smh-alt-card { display:flex; gap:13px; background:#fff; border:1px solid var(--smh-border); border-radius:18px; padding:12px; }
.smh-alt-img,.smh-alt-placeholder { width:82px; height:82px; flex:0 0 82px; border-radius:15px; object-fit:contain; background:#f7f8f6; border:1px solid var(--smh-border); }
.smh-alt-placeholder { display:grid; place-items:center; color:#98a39b; font-size:28px; }
.smh-alt-body { min-width:0; }
.smh-alt-badge { display:inline-block; color:#075b36; background:#e6f4ec; border-radius:999px; padding:5px 8px; font-size:10px; font-weight:900; letter-spacing:.03em; }
.smh-alt-card h3 { margin:7px 0 2px; font-size:16px; line-height:1.2; }
.smh-alt-brand { color:var(--smh-muted); font-size:12px; }
.smh-alt-proof { margin-top:7px; color:#315e47; font-size:11px; font-weight:800; line-height:1.35; }
.smh-alt-meta { margin-top:4px; color:var(--smh-muted); font-size:11px; line-height:1.35; }
.smh-empty-alt { text-align:left; background:#fff; border:1px solid var(--smh-border); border-radius:18px; padding:16px; }
.smh-empty-alt .smh-empty-icon { margin:0 0 12px; }
.smh-empty-alt h2 { margin:0 0 6px; font-size:18px; }
.smh-empty-alt p { margin:0; color:var(--smh-muted); font-size:13px; line-height:1.5; }
@media (prefers-color-scheme: dark) {
  .smh-source-pill { background:#202923; }
  .smh-alt-card,.smh-empty-alt { background:#171d19; }
  .smh-alt-img,.smh-alt-placeholder { background:#131814; }
}

/* ---- Stati delle alternative -------------------------------------------
   Il verde resta riservato a HALAL CERTIFICATO. "Non risultano ingredienti
   haram" usa l'ambra: e un'assenza di segnali, non una certificazione. */
:root {
  --smh-orange: #b4530b;
  --smh-orange-bg: #ffeeda;
}

.smh-alt-card { border-left:4px solid transparent; }
.smh-alt-card.smh-alt-green  { border-left-color:var(--smh-green); }
.smh-alt-card.smh-alt-amber  { border-left-color:var(--smh-amber); }
.smh-alt-card.smh-alt-orange { border-left-color:var(--smh-orange); }
.smh-alt-card.smh-alt-red    { border-left-color:var(--smh-red); }

.smh-alt-green  .smh-alt-badge { color:#075b36;         background:var(--smh-green-2); }
.smh-alt-amber  .smh-alt-badge { color:var(--smh-amber); background:var(--smh-amber-bg); }
.smh-alt-orange .smh-alt-badge { color:var(--smh-orange);background:var(--smh-orange-bg); }
.smh-alt-red    .smh-alt-badge { color:var(--smh-red);   background:var(--smh-red-bg); }

.smh-alt-status-text { margin:6px 0 0; font-size:12px; line-height:1.4; color:var(--smh-muted); }
.smh-alt-findings { margin:6px 0 0; padding-left:16px; font-size:11px; color:var(--smh-muted); line-height:1.45; }
.smh-alt-findings li { margin:1px 0; }
.smh-alt-proof a { color:inherit; }

.smh-alt-separate { margin-top:22px; padding-top:18px; border-top:1px solid rgba(0,0,0,.08); }
.smh-alt-section { font-size:15px; font-weight:900; margin:0 0 10px; }
.smh-notice-warn { border-left:4px solid var(--smh-orange); background:var(--smh-orange-bg); color:#6d3406; }
