/* Bombelli Analytics, Grundgerüst der Gratis-Tools (GEO-Check, Agent-Readiness-Check), Redesign Oktober 2026.
   Nur zusammen mit system.css. Einbinden im Fragment:
   <!-- head-ersatz --><link rel="stylesheet" href="/assets26/tool.css?v=1"><!-- /head-ersatz -->

   Die Klassen und IDs stammen aus dem Markup und den Inline-Skripten der Live-Tools und dürfen nicht umbenannt werden.
   Variante C: Preussischblau heisst hier immer: fehlt, schwach, hier ansetzen. Erfolg bleibt Tinte und ruhig.
   Ladebalken und Radar bleiben Tinte, damit Preussischblau im Ergebnis nur eine Bedeutung hat.

   Eingabe
     .tool-eingabe           Rahmen um Formular und Hilfetexte (frei wählbar, nur Abstand)
     .scan-form              Eingabezeile: Feld .scan-input plus Knopf .btn (#scan-btn), auf dem Handy untereinander
     .scan-helper            Kleintext unter der Zeile, <code> wird als Chip gesetzt
     .scan-error (#scan-error) Fehlermeldung des Scans, vom Skript per hidden ein- und ausgeblendet
     .tool-dunkel            auf einen dunklen Seitenkopf setzen, dann kehrt sich die Eingabezeile um
   Laden
     .loading (#loading)     Band mit .loading-row (.loading-dot, .loading-msg) und Balken .loading-track > .loading-fill (Breite setzt das Skript)
   Ergebnis
     .result-wrap (#score-block)  Band für Gesamtwert
     .result-bento           zwei Spalten: .score-hero (Ring .score-ring, .score-num, .score-of, .grade-pill.grade-a … grade-f,
                             .score-url, .score-meta) und .profile-card (Radar #radar-svg mit .radar-grid/.radar-axis/.radar-label/
                             .radar-area/.radar-dot, Legende .profile-legend > .pl-row > .pl-name/.pl-sub/.pl-score.lvl-hi|mid|lo/.pl-info)
     .ring-fg.lvl-hi|lvl-mid|lvl-lo  Ringfarbe nach Höhe, lvl-lo ist gelb
   Befunde
     .checks-block (#checks-block)  Band mit .checks-h, .checks-lead
     .check-group            Kategorie: .check-group-head (.check-group-name, .check-group-gloss, .check-group-score)
     .check-card             <details> je Prüfpunkt, Status über .st-pass / .st-warn / .st-fail
                             summary: .check-dot, .check-main (.check-row > .check-label + .check-status, .check-detail), .check-arrow
                             Inhalt: .check-body > .check-block (.check-block-k Titel, .check-block-v Text), .snippet-head,
                             .snippet-copy (+ .is-done), pre.snippet, a.spec-link
   Opt-in (Freischaltung per E-Mail)
     .gate (#gate)           Behälter. .gate-locked.blurred zeigt den verschwommenen Rest, ohne .blurred ist er frei
     .gate-wall (#gate-wall) liegt über dem verschwommenen Teil, .gate-card mit .gate-h, .gate-p
     .gate-form              .gate-email, .gate-check (Checkbox mit Text), .btn, .gate-error, .gate-micro
   Sonstiges
     [hidden]                bleibt immer unsichtbar, auch wenn eine Klasse display setzt
     .scroll-progress        Fortschrittsbalken aus app.js, im Redesign ausgeblendet
*/

[hidden] { display: none !important; }
.scroll-progress { display: none !important; }

/* ============ Eingabe ============ */
.tool-eingabe { margin-top: 34px; max-width: 760px; }
.scan-form { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; transition: box-shadow .2s; }
.scan-form:focus-within { box-shadow: 0 0 0 4px var(--gelb); }
.scan-input { flex: 1 1 auto; min-width: 0; min-height: 52px; padding: 0 18px; border: 0; background: transparent; font: 500 1.2rem/1.2 var(--sans); color: var(--ink); letter-spacing: -.01em; }
.scan-input::placeholder { color: #8A8A8A; }
.scan-input:focus { outline: none; }
.scan-form .btn { flex: none; min-height: 52px; }
.scan-form .btn:disabled { opacity: .55; cursor: progress; transform: none; }
.scan-form .btn:disabled:hover { background: var(--ink); color: #fff; box-shadow: none; }
.scan-helper { margin-top: 14px; font-size: .92rem; color: var(--ink-3); line-height: 1.55; }
.scan-helper code { font: 500 .88em/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--paper-2); color: var(--ink); padding: .25em .5em; border-radius: 999px; white-space: nowrap; }
.scan-helper a { color: var(--ink); font-weight: 600; }
.scan-error { margin-top: 14px; padding: 14px 18px; border-radius: 12px; background: var(--gelb); color: var(--ink); font-weight: 600; font-size: .98rem; }

.tool-dunkel .scan-form { border-color: #fff; background: #fff; }
.tool-dunkel .scan-form:focus-within { box-shadow: 0 0 0 4px var(--gelb); }
.tool-dunkel .scan-helper { color: rgba(255,255,255,.7); }
.tool-dunkel .scan-helper code { background: #2A2A2A; color: #fff; }
.tool-dunkel .scan-helper a { color: #fff; }

/* ============ Laden ============ */
.loading { padding: 48px 0 56px; }
.loading .wrap > * { max-width: 760px; }
.loading-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.loading-dot { width: 12px; height: 12px; border-radius: 999px; background: var(--ink); animation: tool-puls 1.1s ease-in-out infinite; }
.loading-msg { font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; }
.loading-track { height: 10px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.loading-fill { width: 0; height: 100%; background: var(--ink); border-radius: 999px; transition: width .9s var(--ease-2); }
@keyframes tool-puls { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ============ Ergebnis: Gesamtwert ============ */
.result-wrap { padding: clamp(56px, 7vw, 96px) 0 clamp(32px, 4vw, 48px); scroll-margin-top: 80px; }
.result-bento { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); align-items: stretch; }
.score-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; padding: 32px; border: 2px solid var(--ink); border-radius: 18px; }
.score-ring { position: relative; width: 168px; height: 168px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--paper-2); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--ink); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset 1.2s var(--ease-2); }
.ring-fg.lvl-lo { stroke: var(--gelb-2); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-num { font-size: 3.6rem; font-weight: 800; letter-spacing: -.05em; line-height: .9; font-variant-numeric: tabular-nums; }
.score-of { font-size: .92rem; color: var(--ink-3); margin-top: 4px; }
.score-side { display: grid; gap: 10px; justify-items: start; }
.grade-pill { display: inline-grid; place-items: center; min-width: 64px; height: 64px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--ink); font-size: 2rem; font-weight: 800; letter-spacing: -.04em; }
.grade-pill.grade-a, .grade-pill.grade-b { background: var(--ink); color: #fff; }
.grade-pill.grade-d, .grade-pill.grade-f { background: var(--gelb); }
.score-url { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.score-meta { font-size: .95rem; color: var(--ink-2); }

.profile-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 28px; background: var(--paper-2); border-radius: 18px; }
.radar-wrap svg { width: 100%; height: auto; max-width: 300px; display: block; margin: 0 auto; overflow: visible; }
.radar-grid { fill: none; stroke: #D2D2D2; stroke-width: 1; }
.radar-axis { stroke: #D2D2D2; stroke-width: 1; }
.radar-label { font: 600 11.5px var(--sans); fill: var(--ink-2); }
.radar-area { fill: rgba(20,20,20,.1); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.radar-dot { fill: var(--ink); }
.profile-legend { display: grid; }
.pl-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule-2); }
.pl-row:first-child { border-top: 2px solid var(--ink); }
.pl-name { font-weight: 700; font-size: .98rem; letter-spacing: -.01em; }
.pl-sub { font-size: .84rem; color: var(--ink-3); margin-top: 2px; }
.pl-score { font-weight: 800; font-size: 1.5rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; padding: 0 .15em; border-radius: 6px; }
.pl-score.lvl-lo { background: var(--gelb); }
.pl-info { font-size: .9rem; font-weight: 600; color: var(--ink-3); }

/* ============ Befunde ============ */
.checks-block { padding: clamp(24px, 3vw, 40px) 0 clamp(72px, 9vw, 120px); }
.checks-h { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.8rem); line-height: 1.05; font-weight: 800; letter-spacing: -.035em; }
.checks-lead { margin-top: 14px; max-width: 40em; color: var(--ink-2); font-size: 1.05rem; }
#checks-teaser { margin-top: 36px; }
.check-group + .check-group { margin-top: 40px; }
.check-group-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.check-group-name { font-size: 1.35rem; font-weight: 800; letter-spacing: -.025em; }
.check-group-gloss { color: var(--ink-3); font-size: .95rem; margin-top: 4px; }
.check-group-score { font-size: 2rem; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.check-group-score span { font-size: .95rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-left: 2px; }

.check-card { border-bottom: 1px solid var(--rule); }
.check-card summary { list-style: none; display: grid; grid-template-columns: 28px minmax(0, 1fr) 20px; gap: 16px; align-items: start; padding: 18px 0; cursor: pointer; min-height: 44px; }
.check-card summary::-webkit-details-marker { display: none; }
.check-card summary:hover .check-label { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
.check-dot { position: relative; width: 24px; height: 24px; margin-top: 1px; border-radius: 999px; border: 2px solid var(--ink); }
.st-pass .check-dot { background: var(--ink); }
.st-pass .check-dot::after { content: ''; position: absolute; left: 6px; top: 5px; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.st-warn .check-dot { background: linear-gradient(90deg, var(--ink) 50%, #fff 50%); }
.st-fail .check-dot { background: var(--gelb); }
.st-fail .check-dot::after { content: '!'; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 13px; line-height: 1; }
.check-main { display: grid; gap: 4px; min-width: 0; }
.check-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.check-label { font-weight: 700; font-size: 1.06rem; letter-spacing: -.01em; }
.check-status { font-size: .82rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--paper-2); }
.st-pass .check-status { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.st-fail .check-status { background: var(--gelb); }
.check-detail { color: var(--ink-2); font-size: .97rem; overflow-wrap: anywhere; }
.check-arrow { font-size: 1.5rem; line-height: 1; transition: transform .25s var(--ease); color: var(--ink-3); }
.check-card[open] .check-arrow { transform: rotate(90deg); }
.check-body { display: grid; gap: 16px; padding: 0 0 24px 44px; }
.check-block-k { font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
.check-block-v { color: var(--ink-2); font-size: .97rem; max-width: 46em; }
.check-block-v ul { list-style: disc; padding-left: 1.2em; display: grid; gap: 4px; }
.snippet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.snippet-head .check-block-k { margin-bottom: 0; }
.snippet-copy { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); font: 700 .85rem var(--sans); color: var(--ink); cursor: pointer; transition: background .2s; }
.snippet-copy::before { content: ''; position: absolute; inset: -4px; }
.snippet-copy { position: relative; }
.snippet-copy:hover { background: var(--paper-2); }
.snippet-copy.is-done { background: var(--ink); color: #fff; }
pre.snippet { margin: 0; background: var(--ink); color: #F2F2F2; padding: 16px 18px; border-radius: 12px; overflow-x: auto; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; max-width: 100%; }
.spec-link { justify-self: start; font-weight: 700; font-size: .95rem; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .2em; text-decoration-color: var(--rule-2); padding: 8px 0; }
.spec-link:hover { text-decoration-color: var(--ink); }

/* ============ Opt-in ============ */
.gate { position: relative; margin-top: 40px; }
.gate-locked.blurred { min-height: 380px; max-height: 560px; overflow: hidden; filter: blur(5px); opacity: .5; pointer-events: none; user-select: none; }
.gate-locked.blurred + .gate-wall { position: absolute; inset: 0; display: grid; place-items: start center; padding: 40px 0 0; }
.gate-card { width: min(100%, 580px); padding: clamp(24px, 4vw, 40px); background: #fff; border: 2px solid var(--ink); border-radius: 18px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.35); }
.gate-h { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.gate-p { margin-top: 12px; color: var(--ink-2); }
.gate-form { display: grid; gap: 14px; margin-top: 22px; }
.gate-email { width: 100%; min-height: 54px; padding: 12px 16px; border: 1.5px solid var(--rule-2); border-radius: 12px; font: 400 1.05rem var(--sans); color: var(--ink); background: #fff; }
.gate-email:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29,78,137,.28); }
.gate-check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; font-size: .92rem; color: var(--ink-2); line-height: 1.45; cursor: pointer; min-height: 44px; }
.gate-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.gate-check a { color: var(--ink); text-decoration: underline; text-underline-offset: .15em; }
.gate-form .btn { justify-content: center; margin-top: 4px; }
.gate-form .btn:disabled { opacity: .55; cursor: progress; }
.gate-error { padding: 12px 16px; border-radius: 12px; background: var(--gelb); font-weight: 600; font-size: .95rem; }
.gate-micro { font-size: .84rem; color: var(--ink-3); }

/* ============ Handy ============ */
/* ============ Variante C, 20.10.: Befund auf einen Blick ============
   Vorher war «Bestanden» (schwarzer Punkt, umrandete Pille) lauter als «Fehlt» (blasse Pille).
   Jetzt: fehlt = volle Preussischblau-Pille mit weisser Schrift und vollem Punkt, bestanden = Umriss und graue Schrift.
   Die Selektoren sind spezifischer als die in variante-c.css, weil jene mit !important arbeiten. */
details.check-card { border-radius: 0 !important; }
.check-card.st-pass .check-dot { background: #fff; border-color: var(--ink); }
.check-card.st-pass .check-dot::after { border-color: var(--ink); left: 5.5px; top: 5.5px; }
.check-card.st-pass .check-status { background: transparent; box-shadow: none; color: var(--ink-3); padding-left: 0; padding-right: 0; font-weight: 600; }
.check-card.st-warn .check-status { background: var(--paper-2); color: var(--ink); }
.check-card.st-fail .check-dot { background: var(--akzent) !important; border-color: var(--akzent); }
.check-card.st-fail .check-dot::after { color: #fff; }
.check-card.st-fail .check-status { background: var(--akzent) !important; color: #fff !important; }
.grade-pill.grade-d, .grade-pill.grade-f { border-color: var(--akzent); }
.score-url { font-weight: 600; }
.check-group-score.lvl-lo { color: var(--akzent); }
/* Score-neutrale Gruppe (Commerce) zeigt «Info» statt Zahl: klein und grau, nicht wie ein Wert */
.check-group-score:not([class*="lvl-"]) { font-size: 1rem; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.check-group-score.lvl-lo span { color: var(--akzent); opacity: .75; }
/* Lange Snippets dürfen das Raster nicht sprengen (am Handy lief die Seite vorher seitlich über) */
.check-body { grid-template-columns: minmax(0, 1fr); }
.check-block { min-width: 0; }

/* Englische Tools (.en-tool, Klassen aus den Live-Skripten: .chk, .chk-status, .cat-val, .grp-val).
   Gleiche Regel wie oben: Missing laut, Pass leise. Spezifischer als variante-c.css. */
.en-tool .chk.st-pass .chk-status { background: transparent !important; box-shadow: none; color: var(--ink-3); padding-left: 0; font-weight: 600; }
.en-tool .chk.st-pass .chk-status::before { content: '\2713\00a0'; color: var(--ink); }
.en-tool .chk.st-warn .chk-status { background: var(--paper-2); box-shadow: none; }
.en-tool .chk.st-fail .chk-status { background: var(--akzent) !important; color: #fff !important; box-shadow: none !important; }
.en-tool .chk.st-fail .chk-label { color: var(--ink); }
.en-tool .chk-body { grid-template-columns: minmax(0, 1fr); }
/* Kategorie- und Gruppenwerte unter 45 (gleiche Schwelle wie lvl-lo im deutschen Skript) */
.en-tool .cat-val.lo, .en-tool .grp-val.lo { color: var(--akzent); }
.en-tool .field input:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px rgba(29,78,137,.28); }

@media (max-width: 960px) {
  .result-bento { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .scan-form { flex-direction: column; align-items: stretch; border-radius: 18px; padding: 8px; }
  .scan-input { min-height: 52px; padding: 0 12px; font-size: 1.1rem; }
  .scan-form .btn { justify-content: center; width: 100%; }
  /* Handy 18.10.: Ring und Note nebeneinander, Adresse und Satz darunter, statt drei Stockwerke */
  .score-hero { grid-template-columns: auto minmax(0, 1fr); gap: 18px 20px; align-items: center; padding: 22px; }
  .score-side { display: contents; }
  .grade-pill { justify-self: start; }
  .score-url, .score-meta { grid-column: 1 / -1; }
  .score-ring { width: 124px; height: 124px; }
  .score-num { font-size: 2.9rem; }
  .profile-card { grid-template-columns: 1fr; gap: 12px; padding: 20px; }
  .radar-wrap svg { max-width: 228px; }
  /* Variante C: am Handy zuerst die Zahlen je Kategorie, das Radar als Bild danach */
  .profile-legend { order: -1; }
  .loading { padding: 32px 0 40px; }
  .scan-helper code { font-size: .95em; }
  .check-label { font-size: 1.04rem; line-height: 1.3; }
  .gate-card { padding: 24px 20px; }
  .check-card summary { grid-template-columns: 24px minmax(0, 1fr) 16px; gap: 12px; }
  .check-body { padding-left: 0; }
  .check-group-head { flex-direction: column; align-items: start; gap: 6px; }
  .gate-locked.blurred { min-height: 640px; max-height: 720px; }
  .gate-locked.blurred + .gate-wall { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-dot { animation: none; }
}
