/* --- Hinweis zu :hover ---
   Alle :hover-Regeln in dieser Datei stehen in
   @media (hover: hover) and (pointer: fine). Ohne diese Abfrage bleibt auf
   Touch der Hover-Zustand nach dem ersten Tippen kleben – inklusive der
   Schatten und Verläufe, die dann dauerhaft neu gezeichnet werden. */

/* ============================================
   UNIVERSAL CONVERTER - Apple-inspired UI
   Reuses design tokens from ../css/style.css
   (variables, .btn, .hero-orb, .reveal, theme)
   ============================================ */

/* --- Page shell --- */
.cv-body {
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    z-index: 1;
}

/* Subtle radial glow behind everything */
.cv-body::before {
    content: '';
    position: fixed;
    top: -25%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 900px;
    max-width: 130vw;
    background: radial-gradient(circle, rgba(41, 151, 255, 0.07) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: cvGlow 9s ease-in-out infinite alternate;
}
[data-theme="light"] .cv-body::before {
    background: radial-gradient(circle, rgba(0, 113, 227, 0.05) 0%, transparent 70%);
}
@keyframes cvGlow {
    0% { transform: translateX(-50%) scale(1); opacity: 1; }
    100% { transform: translateX(-50%) scale(1.25); opacity: 0.55; }
}

/* --- Minimal top bar (only theme toggle) --- */
.cv-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 56px;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}
.cv-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    color: var(--text);
}
.cv-brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 0 14px rgba(41, 151, 255, 0.6);
    animation: cvDotPulse 3s ease-in-out infinite;
}
@keyframes cvDotPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 14px rgba(41,151,255,0.6); }
    50% { transform: scale(1.25); box-shadow: 0 0 22px rgba(191,90,242,0.7); }
}

/* --- Main layout --- */
.cv-main {
    max-width: 880px;
    margin: 0 auto;
    padding: 9rem 1.5rem 5rem;
    position: relative;
    z-index: 1;
}

/* --- Hero --- */
.cv-hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: cvHeroReveal 1.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes cvHeroReveal {
    from { opacity: 0; transform: translateY(34px) scale(0.98); filter: blur(8px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.cv-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    background: rgba(41, 151, 255, 0.1);
    border: 1px solid rgba(41, 151, 255, 0.22);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}
.cv-eyebrow .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--primary);
    animation: livePulseDot 1.6s ease-in-out infinite;
}
/* Zu lange Pillen brechen auf schmalen Anzeigen zweizeilig um; der Punkt
   sitzt dann mittig neben zwei Zeilen statt vor der ersten. Der als
   .cv-eyebrow-lang ausgezeichnete Teil ist der entbehrliche. */
@media (max-width: 420px) {
    .cv-eyebrow-lang { display: none; }
}
@keyframes livePulseDot {
    0%,100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}
.cv-title {
    font-family: var(--font-heading);
    font-size: clamp(2.6rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.04;
    margin-bottom: 1rem;
    background: linear-gradient(135deg,
        var(--text) 0%, var(--primary) 28%, var(--accent) 52%, var(--primary) 76%, var(--text) 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 8s ease-in-out infinite;
}
.cv-sub {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Big glass card --- */
.cv-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 2.25rem;
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
    transform-style: preserve-3d;
    will-change: transform;
    animation: cvCardIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
@keyframes cvCardIn {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
[data-theme="light"] .cv-card {
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.08);
}
/* Mouse-follow shine */
.cv-card-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%),
        rgba(41, 151, 255, 0.12), transparent 60%);
    z-index: 0;
}
@media (hover: hover) and (pointer: fine) {
    .cv-card:hover .cv-card-shine { opacity: 1; }
}
.cv-card > *:not(.cv-card-shine) { position: relative; z-index: 1; }

/* --- Segmented tabs --- */
.cv-tabs {
    display: flex;
    gap: 0.3rem;
    padding: 0.3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    margin: 0 auto 2rem;
    width: fit-content;
}
[data-theme="light"] .cv-tabs { background: rgba(0,0,0,0.04); }
.cv-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.55rem 1.4rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.cv-tab svg { width: 16px; height: 16px; }
.cv-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(41, 151, 255, 0.35);
}
@media (hover: hover) and (pointer: fine) {
    .cv-tab:not(.active):hover { color: var(--text); }
}

/* --- Panels --- */
.cv-panel { display: none; }
.cv-panel.active {
    display: block;
    animation: cvFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cvFadeIn {
    from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* --- Stages (state machine) --- */
.cv-stage { display: none; }
.cv-stage.active {
    display: block;
    animation: cvStageIn 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cvStageIn {
    from { opacity: 0; transform: translateY(18px) scale(0.98); filter: blur(6px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* --- Dropzone --- */
.cv-drop {
    position: relative;
    border-radius: 22px;
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.025);
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
[data-theme="light"] .cv-drop { background: rgba(0,0,0,0.015); }
/* animated dashed border via SVG-like background */
.cv-drop::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background:
        repeating-linear-gradient(90deg, var(--primary) 0 14px, transparent 14px 28px);
    background-size: 200% 2px;
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0.35;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
/* cvBorderDance verschiebt background-position über die ganze Fläche der
   Ablage – das ist ein Neuzeichnen pro Bild, und es lief auf JEDER Tool-Seite
   dauerhaft, ohne dass jemand hinsah. Jetzt läuft es genau dann, wenn es
   etwas mitteilt: beim Überfahren und während eine Datei über der Ablage
   hängt. Im Ruhezustand steht ein sauberer gestrichelter Rahmen. */
@media (hover: hover) and (pointer: fine) {
    .cv-drop:hover { background: rgba(41, 151, 255, 0.05); transform: translateY(-2px); }
    .cv-drop:hover::before { opacity: 0.6; animation: cvBorderDance 18s linear infinite; }
}
.cv-drop.dragover {
    background: rgba(41, 151, 255, 0.1);
    transform: scale(1.015);
    box-shadow: 0 0 0 1px rgba(41,151,255,0.4), 0 24px 60px rgba(41,151,255,0.18);
}
.cv-drop.dragover::before { opacity: 1; animation: cvBorderDance 4s linear infinite; }
@keyframes cvBorderDance {
    to { background-position: 200% 0; }
}
.cv-drop-icon {
    width: 76px; height: 76px;
    margin: 0 auto 1.25rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(41,151,255,0.18), rgba(191,90,242,0.18));
    color: var(--primary);
    animation: cvFloat 4.5s ease-in-out infinite;
}
.cv-drop-icon svg { width: 38px; height: 38px; }
.cv-drop.dragover .cv-drop-icon { animation: cvBounce 0.7s ease infinite; }
@keyframes cvFloat {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}
@keyframes cvBounce {
    0%,100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-7px) scale(1.08); }
}
.cv-drop h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.cv-drop p { color: var(--text-muted); font-size: 0.95rem; }
.cv-drop .cv-browse { color: var(--primary); font-weight: 600; }

/* --- File info card --- */
.cv-file {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 18px;
    margin-bottom: 1.5rem;
}
[data-theme="light"] .cv-file { background: rgba(0,0,0,0.025); }
.cv-file-icon {
    flex-shrink: 0;
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, rgba(41,151,255,0.2), rgba(191,90,242,0.2));
    color: var(--primary);
}
.cv-file-info { flex: 1; min-width: 0; }
.cv-file-name {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.98rem;
}
.cv-file-meta { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.15rem; }
.cv-file-remove {
    flex-shrink: 0;
    width: 34px; height: 34px;
    border: none;
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
    .cv-file-remove:hover { background: rgba(255,59,48,0.15); color: #ff453a; transform: rotate(90deg); }
}

/* --- Flow: source -> target --- */
.cv-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0.5rem 0 1.75rem;
}
.cv-badge {
    min-width: 92px;
    padding: 0.7rem 1rem;
    border-radius: 14px;
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text);
    text-transform: uppercase;
    transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}
[data-theme="light"] .cv-badge { background: rgba(0,0,0,0.03); }
.cv-badge.src { color: var(--text-muted); }
.cv-badge.dst {
    color: var(--primary);
    border-color: rgba(41,151,255,0.4);
    background: rgba(41,151,255,0.1);
}
.cv-badge.dst.empty { color: var(--text-muted); border-style: dashed; background: transparent; }
.cv-flow-arrow {
    color: var(--primary);
    display: flex;
    animation: cvArrow 1.8s ease-in-out infinite;
}
.cv-flow-arrow svg { width: 30px; height: 30px; }
@keyframes cvArrow {
    0%,100% { transform: translateX(0); opacity: 0.6; }
    50% { transform: translateX(6px); opacity: 1; }
}

/* --- Format selection grid --- */
.cv-section-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}
.cv-formats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}
.cv-fmt {
    appearance: none;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    border-radius: 14px;
    padding: 0.85rem 0.5rem;
    cursor: pointer;
    font-family: var(--font-body);
    text-align: center;
    transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
    opacity: 0;
    transform: translateY(12px) scale(0.95);
    /* Feder statt linearem Ausklang: die Kachel schießt minimal über und
       federt zurück. Kostet nichts extra (reines transform) und ist der
       Unterschied zwischen „erscheint" und „springt herein". */
    animation: cvChipIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
[data-theme="light"] .cv-fmt { background: rgba(0,0,0,0.02); }
@keyframes cvChipIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.cv-fmt-ext {
    display: block;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
}
.cv-fmt-tag {
    display: block;
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
@media (hover: hover) and (pointer: fine) {
    .cv-fmt:hover {
        border-color: rgba(41,151,255,0.4);
        background: rgba(41,151,255,0.07);
        transform: translateY(-3px);
        box-shadow: 0 10px 24px rgba(0,0,0,0.2);
    }
}
.cv-fmt.selected {
    border-color: var(--primary);
    background: rgba(41,151,255,0.14);
    color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), 0 10px 28px rgba(41,151,255,0.25);
    animation: cvPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cv-fmt.selected .cv-fmt-tag { color: var(--primary); opacity: 0.8; }
@keyframes cvPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* --- Action buttons --- */
.cv-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}
.cv-btn-big {
    font-size: 1.05rem;
    padding: 0.95rem 2.2rem;
    overflow: hidden;
    position: relative;
}
.cv-btn-big:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}
/* shine sweep */
.cv-btn-big::after {
    content: '';
    position: absolute;
    top: 0; left: -120%;
    width: 80%; height: 100%;
    background: linear-gradient(110deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    transition: none;
}
@media (hover: hover) and (pointer: fine) {
    .cv-btn-big:not(:disabled):hover::after {
        animation: cvShine 0.9s ease;
    }
}
@keyframes cvShine {
    from { left: -120%; }
    to { left: 130%; }
}

/* --- Progress --- */
.cv-progress { text-align: center; padding: 1rem 0; }
.cv-ring {
    width: 140px; height: 140px;
    margin: 0 auto 1.5rem;
    position: relative;
}
.cv-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.cv-ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 8; }
[data-theme="light"] .cv-ring-bg { stroke: rgba(0,0,0,0.07); }
.cv-ring-fg {
    fill: none;
    stroke: url(#cvGrad);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 377;
    stroke-dashoffset: 377;
    transition: stroke-dashoffset 0.4s cubic-bezier(0.16,1,0.3,1);
}
.cv-ring-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.cv-ring.indeterminate svg { animation: cvSpin 1.1s linear infinite; }
@keyframes cvSpin { to { transform: rotate(270deg); } }
.cv-progress-status {
    color: var(--text);
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}
.cv-progress-hint { color: var(--text-muted); font-size: 0.85rem; }

/* --- Der Hinweis, dass ein Werkzeug auf dem Server rechnet ---
   Stand vorher als .cl-server in clip/clip.css. /bild/hintergrund.html
   brauchte ihn ebenfalls und zog dafür die komplette clip.css mit — was dort
   die Spaltenbreiten, Knopfhöhen und sogar die Bildvorschau verbogen hat.
   Jetzt liegt er hier, wo ihn beide Werkzeugfamilien ohne Nebenwirkung
   erreichen. Aussehen unverändert. */
.cv-server {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.9rem 1.1rem;
    border-radius: 16px;
    background: rgba(255, 159, 10, 0.1);
    border: 1px solid rgba(255, 159, 10, 0.28);
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 1.6rem;
}
.cv-server strong { color: var(--text); }
.cv-server-icon { flex: none; font-size: 1.1rem; line-height: 1.4; }

/* --- Schieberegler ---
   Clip und PDF setzten nur `accent-color` auf das native Element: dünne
   graue Spur, winziger Griff. Compry zeigt auf derselben Seitenfamilie eine
   Verlaufsspur mit großem Griff — der Unterschied ließ die neuen Werkzeuge
   unfertig aussehen. Das hier ist derselbe Regler in Blau. */
.cv-range {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2997ff, #6a8dff 55%, #bf5af2);
    outline: none;
    cursor: pointer;
}
.cv-range::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #2997ff;
    box-shadow: 0 2px 12px rgba(41, 151, 255, 0.5);
    cursor: grab;
    transition: transform 0.15s ease;
}
.cv-range::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.05); }
@media (hover: hover) and (pointer: fine) {
    .cv-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
}
.cv-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #2997ff;
    box-shadow: 0 2px 12px rgba(41, 151, 255, 0.5);
    cursor: grab;
}
/* Auf Touch ist der Griff ein Ziehziel — wie bei Compry etwas größer. */
@media (pointer: coarse) {
    .cv-range { height: 12px; }
    .cv-range::-webkit-slider-thumb { width: 32px; height: 32px; }
    .cv-range::-moz-range-thumb { width: 30px; height: 30px; }
}
.cv-log {
    margin-top: 1rem;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    max-height: 90px;
    overflow: hidden;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
    display: none;
}
.cv-log.show { display: block; }

/* --- Success / Result --- */
.cv-result { text-align: center; padding: 0.5rem 0; }
.cv-check {
    width: 92px; height: 92px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: rgba(48,209,88,0.12);
    display: flex; align-items: center; justify-content: center;
    animation: cvPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.cv-check svg { width: 48px; height: 48px; }
.cv-check circle {
    stroke: #30d158; stroke-width: 3; fill: none;
    stroke-dasharray: 166; stroke-dashoffset: 166;
    animation: cvCheckCircle 0.6s cubic-bezier(0.65,0,0.45,1) forwards;
}
.cv-check path {
    stroke: #30d158; stroke-width: 4; fill: none;
    stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 48; stroke-dashoffset: 48;
    animation: cvCheckMark 0.4s cubic-bezier(0.65,0,0.45,1) 0.45s forwards;
}
@keyframes cvCheckCircle { to { stroke-dashoffset: 0; } }
@keyframes cvCheckMark { to { stroke-dashoffset: 0; } }
.cv-result h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem; font-weight: 700; color: var(--text);
    margin-bottom: 0.35rem;
}
.cv-result-name { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.25rem; word-break: break-all; }
.cv-sizes {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
[data-theme="light"] .cv-sizes { background: rgba(0,0,0,0.025); }
.cv-sizes .from { color: var(--text-muted); }
.cv-sizes .to { color: var(--text); font-weight: 700; }
.cv-sizes .delta { font-weight: 700; }
.cv-sizes .delta.down { color: #30d158; }
.cv-sizes .delta.up { color: #ff9f0a; }
.cv-sizes svg { width: 16px; height: 16px; color: var(--text-muted); }

/* --- Error --- */
.cv-error-box { text-align: center; padding: 0.5rem 0; }
.cv-error-icon {
    width: 80px; height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(255,69,58,0.12);
    color: #ff453a;
    display: flex; align-items: center; justify-content: center;
}
.cv-error-icon svg { width: 42px; height: 42px; }
.cv-error-box h3 { font-family: var(--font-heading); color: var(--text); font-size: 1.3rem; margin-bottom: 0.4rem; }
.cv-error-msg { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1.4rem; max-width: 460px; margin-inline: auto; line-height: 1.5; }

/* --- Text panel --- */
.cv-text-grid { display: flex; flex-direction: column; gap: 1.1rem; }
.cv-text-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; }
.cv-field { flex: 1; min-width: 160px; }
.cv-field label {
    display: block;
    font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted); margin-bottom: 0.45rem;
}
.cv-textarea, .cv-select {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}
.cv-select { cursor: pointer; }
[data-theme="light"] .cv-textarea, [data-theme="light"] .cv-select { background: rgba(0,0,0,0.02); }
.cv-textarea {
    min-height: 150px;
    resize: vertical;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    line-height: 1.5;
}
.cv-textarea:focus, .cv-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(41,151,255,0.14);
}
.cv-text-out-wrap { position: relative; }
.cv-text-actions { display: flex; gap: 0.6rem; margin-top: 0.6rem; flex-wrap: wrap; }
.cv-mini-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
    .cv-mini-btn:hover { color: var(--text); border-color: rgba(41,151,255,0.4); background: rgba(41,151,255,0.08); }
}
.cv-mini-btn svg { width: 15px; height: 15px; }

/* --- Format overview section --- */
.cv-overview { margin-top: 4.5rem; }
.cv-overview h2 {
    text-align: center;
    font-family: var(--font-heading);
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.5rem;
}
/* Die Überschrift darüber ist zentriert, der Untertitel erbte die Zentrierung
   nur im Hero — hier stand er linksbündig in einer zentrierten 540-px-Box und
   ließ ein einzelnes Wort schief in Zeile zwei hängen. */
.cv-overview .cv-sub { margin-bottom: 2.5rem; text-align: center; }
.cv-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
/* Genau vier Karten: auto-fit legt sie bei der üblichen Inhaltsbreite in
   drei Spalten, die vierte steht dann allein und rechts bleiben zwei Drittel
   leer. Zwei Spalten gehen bei vier Karten immer auf. */
.cv-cat-grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 620px) {
    .cv-cat-grid-2 { grid-template-columns: 1fr; }
}
.cv-cat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.5s cubic-bezier(0.16,1,0.3,1);
}
@media (hover: hover) and (pointer: fine) {
    .cv-cat:hover {
        transform: translateY(-4px);
        border-color: rgba(41,151,255,0.25);
        box-shadow: 0 24px 50px rgba(0,0,0,0.25);
    }
}
@media (hover: hover) and (pointer: fine) {
    [data-theme="light"] .cv-cat:hover { box-shadow: 0 24px 50px rgba(0,0,0,0.07); }
}
.cv-cat-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; }
.cv-cat-emoji {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    background: linear-gradient(135deg, rgba(41,151,255,0.16), rgba(191,90,242,0.16));
}
.cv-cat-head h3 { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; color: var(--text); }
.cv-cat-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cv-cat-tag {
    padding: 0.22rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem; font-weight: 600;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
    .cv-cat-tag:hover { color: var(--primary); border-color: rgba(41,151,255,0.3); background: rgba(41,151,255,0.08); }
}

/* --- Footer --- */
.cv-footer {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    position: relative;
    z-index: 1;
}
.cv-footer .priv { display: block; margin-top: 0.35rem; opacity: 0.7; font-size: 0.76rem; }

/* --- Toasts --- */
.cv-toasts {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    z-index: 5000;
    display: flex; flex-direction: column; gap: 0.6rem;
    max-width: 360px;
}
.cv-toast {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    color: var(--text);
    font-size: 0.88rem;
    animation: cvToastIn 0.45s cubic-bezier(0.16,1,0.3,1);
}
.cv-toast.out { animation: cvToastOut 0.4s cubic-bezier(0.16,1,0.3,1) forwards; }
@keyframes cvToastIn { from { opacity: 0; transform: translateX(40px) scale(0.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes cvToastOut { to { opacity: 0; transform: translateX(40px) scale(0.95); } }
.cv-toast .ic { flex-shrink: 0; width: 20px; height: 20px; display: flex; }
.cv-toast.ok .ic { color: #30d158; }
.cv-toast.err .ic { color: #ff453a; }
.cv-toast.info .ic { color: var(--primary); }

/* --- Confetti --- */
.cv-confetti-piece {
    position: fixed;
    width: 10px; height: 14px;
    top: -20px;
    z-index: 4000;
    pointer-events: none;
    will-change: transform, opacity;
}

/* --- Hidden helper --- */
.cv-hidden { display: none !important; }
#cvPdfRender {
    position: fixed; left: -9999px; top: 0;
    width: 794px; background: #fff; color: #111;
    padding: 40px; font-family: Inter, sans-serif;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .cv-main { padding: 7.5rem 1.1rem 4rem; }
    .cv-card { padding: 1.4rem; border-radius: 22px; }
    .cv-drop { padding: 2.5rem 1rem; }
    .cv-formats { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); }
    .cv-flow { gap: 0.6rem; }
    .cv-badge { min-width: 72px; font-size: 0.85rem; padding: 0.6rem 0.7rem; }
    .cv-actions { flex-direction: column; }
    .cv-actions .btn, .cv-actions .cv-btn-big { width: 100%; justify-content: center; }
    .cv-toasts { left: 1rem; right: 1rem; max-width: none; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.05ms !important;
    }
    .cv-drop-icon, .cv-flow-arrow, .cv-brand-dot { animation: none !important; }
}

/* Die tatsaechlich moegliche Dateigroesse steht in der Drop-Zone und wird
   beim Laden aus /capabilities nachgetragen — sie haengt vom freien
   Plattenplatz ab und ist nicht die konfigurierte Obergrenze. */
.cv-drop-limit {
    display: inline-block;
    margin-top: 0.3rem;
    font-size: 0.82rem;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}
