/* ===== Key-Scout – im Look der Startseite ===== */
.tool-keyscout-wrapper {
    position: relative;
    overflow: hidden;
    padding: clamp(56px, 9vw, 110px) 0 clamp(64px, 8vw, 100px);
    background:
        radial-gradient(60% 50% at 78% 30%, rgba(236, 15, 46, 0.22), transparent 70%),
        linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
        var(--bg);
}
.tool-keyscout-wrapper::after { /* Raster nach unten ausblenden */
    content: "";
    position: absolute; inset: auto 0 0;
    height: 40%;
    background: linear-gradient(transparent, var(--bg));
    pointer-events: none;
}
.identity-app {
    position: relative; z-index: 1;
    width: min(1120px, 100% - 32px);
    margin-inline: auto;
}
.identity-stage-body { position: relative; }

/* ----- Kopf ----- */
.identity-copy { position: relative; z-index: 2; max-width: 720px; }
.ks-kicker {
    display: inline-flex; align-items: center; gap: 12px;
    margin: 0 0 22px;
    color: var(--muted);
    font: 500 0.78rem/1 var(--font-mono);
    letter-spacing: 0.14em; text-transform: uppercase;
}
.identity-copy h1 {
    margin: 0 0 18px;
    font: 700 clamp(3.2rem, 9vw, 7.5rem)/0.9 var(--font-display);
    letter-spacing: -0.04em;
    color: var(--text);
}
.identity-copy h1 em {
    font-style: normal; /* wie im Rest der Seite: gleiche Schrift, nur rot */
    color: var(--red);
}
.ks-lead {
    margin: 0 0 36px;
    max-width: 30em;
    color: var(--muted);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.6;
}

/* ----- Dropzone ----- */
.identity-dropzone {
    display: grid; justify-items: center; gap: 8px;
    width: 100%;
    padding: 40px 24px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius);
    background: rgba(16, 16, 18, 0.72);
    backdrop-filter: blur(6px);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: border-color .3s var(--ease), background .3s var(--ease), transform .3s var(--ease);
}
.identity-dropzone:hover,
.identity-dropzone:focus-visible,
.identity-dropzone.dragover {
    border-color: var(--red);
    background: rgba(236, 15, 46, 0.09);
    outline: none;
}
.identity-dropzone.dragover { transform: scale(1.01); }
.identity-dropzone.is-busy { cursor: progress; opacity: .7; }
.ks-upload-icon {
    width: 44px; height: 44px;
    padding: 10px;
    border-radius: 50%;
    background: var(--red);
    fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    margin-bottom: 6px;
    transition: transform .3s var(--ease);
}
.identity-dropzone:hover .ks-upload-icon { transform: translateY(-3px); }
.identity-dropzone strong { font: 600 1.2rem var(--font-display); }
.identity-dropzone span {
    color: var(--muted-2);
    font: 0.75rem var(--font-mono);
    letter-spacing: 0.08em; text-transform: uppercase;
}
.ks-privacy { margin: 14px 0 0; color: var(--muted-2); font-size: .85rem; }

/* ----- Status ----- */
.identity-status-line {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    margin-top: 20px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    font-size: .9rem;
}
.identity-status-line[hidden] { display: none; }
.identity-status-line strong { font-family: var(--font-display); }
.identity-status-line span:last-child { color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); }
.is-running .status-dot { background: var(--red); animation: rec 1.8s ease-out infinite; }
.is-done .status-dot { background: #3ecf8e; }
.is-error .status-dot { background: #f5a524; }

/* ----- Deko rechts neben Überschrift + Einleitung (alle drei Tools) -----
   Vertikal mittig zum linken Block (Überschrift bis Upload), rechts in der freien Spalte daneben.
   Nur ab 1100 px Breite – darunter wäre neben dem Text kein Platz, dann lieber gar nicht als überlappend. */
.ms-start, .sc-start, .ks-start { position: relative; }
.tool-visual {
    position: absolute; top: 50%; right: 0; translate: 0 -50%;
    width: clamp(260px, 24vw, 340px); aspect-ratio: 1;
    pointer-events: none;
}
.tool-visual svg { width: 100%; height: 100%; overflow: visible; }
.tool-visual text { font: 500 15px var(--font-mono); fill: var(--muted); text-anchor: middle; }
@media (max-width: 1099px) { .tool-visual { display: none; } }
/* Platz für die Grafik: linke Spalte bei allen Tools gleich breit (Key-Scout hat das Upload-Feld schon in .identity-copy) */
@media (min-width: 1100px) { .ms .ms-drops, .ms .ms-options, .sc .sc-drop, .sc .sc-options { max-width: 720px; } }

/* Mix-Scout: Lautheitsring – roter Bogen + Punkt = Short-term (schwankt), Zahl = Integrated, grüner Bogen = übliches Streaming-Fenster −14 bis −8 */
.msg-ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.msg-zone { fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; opacity: .8; }
.msg-track { fill: none; stroke: var(--line); stroke-width: 4; stroke-linecap: round; }
.msg-level { fill: none; stroke: var(--red); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 70 100; animation: msg-level 2.6s ease-in-out infinite; }
.msg-head { fill: var(--red); transform-origin: 160px 160px; transform: rotate(54deg); animation: msg-head 2.6s ease-in-out infinite; }
.msg-head circle { stroke: var(--bg); stroke-width: 3; }
.msg-core { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.5; }
.tool-visual .msg-val { font-size: 34px; font-weight: 600; fill: var(--text); }
.tool-visual .msg-unit { font-size: 12px; letter-spacing: .12em; }
.tool-visual .msg-tick { font-size: 12px; fill: var(--muted-2); }
@keyframes msg-level { 0%, 100% { stroke-dasharray: 70 100; } 25% { stroke-dasharray: 62 100; } 50% { stroke-dasharray: 74 100; } 75% { stroke-dasharray: 66 100; } }
@keyframes msg-head { 0%, 100% { transform: rotate(54deg); } 25% { transform: rotate(32.4deg); } 50% { transform: rotate(64.8deg); } 75% { transform: rotate(43.2deg); } }

/* Stem-Check: Prüflinie fährt über die Spuren, danach wird jede grün abgehakt */
.scv-lane { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.5; }
.scv-wave { fill: var(--muted-2); }
.scv-scan { fill: var(--red); animation: scv-scan 4s linear infinite; }
.scv-ring { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.scv-tick { fill: none; stroke: var(--ok); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; animation: scv-tick 4s ease-out infinite; }
.tool-visual .scv-name { font-size: 12px; text-anchor: start; }
@keyframes scv-scan { 0% { transform: translateX(0); opacity: 1; } 50% { transform: translateX(176px); opacity: 1; } 56%, 100% { transform: translateX(176px); opacity: 0; } }
@keyframes scv-tick { 0%, 50% { stroke-dashoffset: 1; opacity: 0; } 62%, 92% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .msg-level, .msg-head, .scv-scan, .scv-tick { animation: none; } .scv-scan { opacity: 0; } }

/* Key-Scout: Quintenzirkel. Ruhe: tastet langsam die Tonarten ab · Analyse: schnell · fertig: steht auf dem Ergebnis */
.identity-particle-layer { display: none; }
.ks-wheel { translate: calc(var(--shift-x, 0px) * .4) calc(var(--shift-y, 0px) * .4); transition: translate .6s var(--ease); }
.ks-wheel text { font: 500 15px var(--font-mono); fill: var(--muted); text-anchor: middle; transition: fill .3s; }
.ks-wheel text.is-minor { font-size: 12px; fill: var(--muted-2); }
.ks-wheel text.is-hit { fill: var(--text); font-weight: 600; }
.ksw-ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.ksw-sweep { transform-origin: 160px 160px; transform: rotate(var(--at, 0deg)); animation: ksw-scan 12s steps(12) infinite; transition: transform .8s var(--ease); }
.ksw-sweep path { fill: var(--red-soft); stroke: var(--red); stroke-width: 1.5; }
.ksw-core { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.5; }
.ksw-beat { fill: none; stroke: var(--red); stroke-width: 2; transform-origin: 160px 160px; animation: ksw-beat .667s ease-out infinite; } /* 90 BPM */
.ks-wheel .ksw-mid { font-size: 17px; font-weight: 600; fill: var(--text); }
.ks-wheel .ksw-sub { font-size: 12px; fill: var(--muted); }
@keyframes ksw-scan { to { transform: rotate(360deg); } }
@keyframes ksw-beat { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.45); } }
.identity-stage.is-running .ksw-sweep { animation-duration: 2.4s; }
.identity-stage.is-running .ksw-beat { animation-duration: .4s; }
.identity-stage.is-done .ksw-sweep { animation: none; }
.identity-stage.is-done .ks-wheel .ksw-mid { fill: var(--red-ink); }
@media (prefers-reduced-motion: reduce) { .ksw-sweep, .ksw-beat { animation: none; } }

/* ----- Ergebnisse ----- */
.identity-results { position: relative; z-index: 2; margin-top: 48px; }
.identity-results[hidden], .identity-card-grid[hidden], .identity-review-cta[hidden], .identity-loader[hidden] { display: none; }

.identity-loader {
    position: relative;
    width: 64px; height: 64px;
    margin: 24px auto;
}
.loader-orbit {
    position: absolute; inset: 0;
    border: 2px solid transparent;
    border-top-color: var(--red);
    border-radius: 50%;
    animation: ks-spin 1s linear infinite;
}
.loader-orbit-delayed { inset: 10px; border-top-color: var(--text); animation-duration: 1.6s; animation-direction: reverse; }
.loader-core { position: absolute; inset: 26px; border-radius: 50%; background: var(--red); }
@keyframes ks-spin { to { transform: rotate(360deg); } }

/* Ergebnis: ein Panel mit drei Werten (Trennlinien statt drei loser Karten) */
.identity-card-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 70%, transparent), var(--surface));
    box-shadow: 0 30px 60px -40px rgba(0, 0, 0, .8);
    overflow: hidden;
    animation: ks-in .6s var(--ease) both;
}
.identity-card-grid::before { /* feine rote Lichtkante oben */
    content: ""; position: absolute; inset: 0 0 auto; height: 1px;
    background: linear-gradient(90deg, transparent, var(--red) 25%, color-mix(in srgb, var(--red) 40%, transparent) 60%, transparent);
}
.identity-card {
    position: relative;
    display: flex; flex-direction: column;
    padding: 28px 28px 26px;
    animation: ks-in .6s var(--ease) both;
}
.identity-card + .identity-card { border-left: 1px solid var(--line); }
.identity-card.is-key { background: radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--red) 16%, transparent), transparent 65%); }
.identity-card:nth-child(2) { animation-delay: .08s; }
.identity-card:nth-child(3) { animation-delay: .16s; }
@keyframes ks-in { from { opacity: 0; transform: translateY(16px); } }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.identity-card .label,
.identity-review-cta .label {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--muted);
    font: 500 .72rem var(--font-mono);
    letter-spacing: .14em; text-transform: uppercase;
}
.metric-chip {
    padding: 4px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--muted);
    font: .68rem var(--font-mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.metric-chip.good { color: #3ecf8e; border-color: rgba(62, 207, 142, .35); }
.metric-chip.warn { color: #f5a524; border-color: rgba(245, 165, 36, .35); }
.metric-chip.bad  { color: var(--red); border-color: rgba(236, 15, 46, 0.54); }
.card-value {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
    margin: 26px 0 18px;
    font: 700 clamp(2.6rem, 4.4vw, 3.6rem)/1 var(--font-display);
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}
.is-key .card-value { color: var(--red-hi); text-shadow: 0 0 18px color-mix(in srgb, var(--red) 55%, transparent), 0 0 44px color-mix(in srgb, var(--red) 25%, transparent); }
.card-value small { font: 500 .8rem var(--font-mono); letter-spacing: .14em; color: var(--muted); text-shadow: none; }
/* Sicherheit der Schätzung als Balken (Wert --v 0–1 und Ton aus tool-keyscout.js) */
.ks-bar { display: block; height: 3px; margin-bottom: 16px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ks-bar i { display: block; height: 100%; width: calc(var(--v, 0) * 100%); border-radius: inherit; background: var(--muted-2); transition: width 1s .35s var(--ease); }
[data-tone="good"] .ks-bar i { background: #3ecf8e; }
[data-tone="warn"] .ks-bar i { background: #f5a524; }
[data-tone="bad"] .ks-bar i { background: var(--red); }
/* Puls im erkannten Tempo neben „BPM“, Taktpunkte laufen einmal pro Takt durch (erster betont) */
.ks-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: ks-pulse var(--beat, .5s) ease-out infinite; }
@keyframes ks-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 70%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
.ks-beats { display: inline-flex; align-items: center; gap: 7px; align-self: center; }
.ks-beats i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); animation: ks-tick calc(var(--beat, .5s) * var(--n, 4)) linear infinite; animation-delay: calc(var(--beat, .5s) * var(--i, 0)); }
.ks-beats i:first-child { width: 12px; height: 12px; }
@keyframes ks-tick { 0% { background: var(--red); box-shadow: 0 0 12px var(--red); } 20%, 100% { background: var(--line-2); box-shadow: none; } }
.card-copy { margin: auto 0 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }

/* ----- Mix-Review CTA ----- */
.identity-review-cta {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center; gap: 32px;
    margin-top: 16px;
    padding: 32px;
    border: 1px solid rgba(236, 15, 46, 0.47);
    border-radius: var(--radius);
    background: radial-gradient(80% 120% at 100% 0%, rgba(236, 15, 46, 0.24), transparent 60%), var(--surface);
    animation: ks-in .6s .24s var(--ease) both;
}
.identity-review-cta h2 {
    margin: 10px 0 8px;
    font: 700 clamp(1.4rem, 2.6vw, 2rem)/1.15 var(--font-display);
    letter-spacing: -0.02em;
}
.identity-review-cta p { margin: 0; color: var(--muted); line-height: 1.6; max-width: 46em; }
.review-cta-action { display: grid; justify-items: end; gap: 4px; text-align: right; }
.review-cta-action strong { font: 700 2rem var(--font-display); }
.review-cta-action span { color: var(--muted-2); font: .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; }
.identity-cta-button {
    margin-top: 12px;
    padding: 14px 26px;
    border: 0; border-radius: 999px;
    background: var(--red); color: #fff;
    font: 600 1rem var(--font-display);
    cursor: pointer;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.identity-cta-button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px rgba(236, 15, 46, 0.94); }

.file-input-hidden { display: none; }

/* ----- Mobil ----- */
@media (max-width: 860px) {

    .identity-card-grid { grid-template-columns: 1fr; }
    .identity-card { padding: 22px; }
    .identity-card + .identity-card { border-left: 0; border-top: 1px solid var(--line); }
    .card-value { margin: 16px 0 14px; }
    .identity-review-cta { grid-template-columns: 1fr; gap: 20px; padding: 24px; }
    .review-cta-action { justify-items: start; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    .identity-bars span, .identity-card, .identity-card-grid, .identity-review-cta, .loader-orbit, .ks-pulse, .ks-beats i { animation: none; }
}

/* Key-Scout: weitere Angebote unter dem Hinweis */
.ks-offer-alts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; }
