﻿
    /* =========================================
       SPEECH TO TEXT — PREMIUM UI
       ========================================= */
    .da-wrapper {
        --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
        --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
        display: flex;
        justify-content: center;
            padding: clamp(0px, 5vw, 0px) 20px;
    }

    .da-panel {
        position: relative;                
        width: 100%;
        max-width: 1200px;
        border-radius: 28px;
        padding: clamp(28px, 5vw, 56px);
        overflow: hidden;
    }

    

    /* ---------- HERO ---------- */
    .da-hero { text-align: center; max-width: 750px; margin: 0 auto; padding: clamp(10px, 4vw, 30px) 0; }

    .da-hero-badge {
        display: inline-flex; align-items: center; gap: 8px;
        font-size: 12.5px; font-weight: 800; letter-spacing: 0.3px;
        color: var(--primary-color); background: var(--primary-light);
        padding: 7px 16px; border-radius: 100px; margin-bottom: 22px;
    }

    .da-hero-title {
        font-size: clamp(30px, 4.4vw, 44px);
        font-weight: 900;
        line-height: 1.15;
        letter-spacing: -0.025em;
        color: var(--text-main);
        margin-bottom: 16px;
    }

    .da-hero-title em {
        font-style: normal;
        background: linear-gradient(120deg, var(--primary-color), var(--primary-gradient-end));
        -webkit-background-clip: text; background-clip: text; color: transparent;
    }

    .da-hero-desc { font-size: 16.5px; color: var(--text-muted); line-height: 1.7; margin-bottom: 36px; }

    /* ---------- ALERTS ---------- */
    .no-support { display: none; align-items: center; gap: 12px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #ef4444; padding: 16px 20px; border-radius: 16px; margin-bottom: 24px; font-size: 14px; font-weight: 600; line-height: 1.5; }
    .no-support.show { display: flex; }

    /* ---------- CONTROLS BAR ---------- */
    /* ── Comparison Panel & Analytics ── */
    .comparison-panel {
        background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 24px;
        padding: 28px; margin-top: 32px; box-shadow: 0 10px 30px rgba(0,0,0,0.02); margin-bottom: 40px;
    }
    .cp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
    .cp-title { font-size: 16px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 10px; }
    .cp-badge { font-size: 12px; font-weight: 800; padding: 6px 14px; border-radius: 100px; }
    .badge-high { background: color-mix(in srgb, var(--success, #10b981) 15%, transparent); color: var(--success, #10b981); border: 1px solid color-mix(in srgb, var(--success, #10b981) 30%, transparent); }

    .cp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
    .cp-card { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
    .cpc-header { display: flex; justify-content: space-between; align-items: center; }
    .cpc-title { font-size: 13.5px; font-weight: 800; color: var(--text-main); }
    .cpc-tag { font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 6px; }
    .cpc-tag.success { background: color-mix(in srgb, var(--success, #10b981) 15%, transparent); color: var(--success, #10b981); }

    .cpc-body { display: flex; flex-direction: column; gap: 10px; }
    .cpc-stat-row { font-size: 13px; color: var(--text-muted); display: flex; justify-content: space-between; }
    .cpc-stat-row strong { color: var(--text-main); font-weight: 700; }
    .cpc-progress-bar { width: 100%; height: 8px; background: var(--border-color); border-radius: 100px; overflow: hidden; margin-top: 4px; }
    .cpc-progress-fill { height: 100%; background: var(--primary-color); border-radius: 100px; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
    .cpc-progress-fill.bg-gradient { background: linear-gradient(90deg, var(--primary-color), var(--primary-gradient-end)); }
    .controls-bar { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 12px 20px; display: flex; align-items: center; gap: 16px; margin-bottom: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); flex-wrap: wrap; }
    
    .lang-select-wrap { display: flex; align-items: center; gap: 8px; background: var(--bg-body); border: 1px solid var(--border-color); padding: 4px 12px; border-radius: 8px; }
    .lang-label { font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
    .lang-select { background: transparent; border: none; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-main); outline: none; cursor: pointer; max-width: 200px; text-overflow: ellipsis; }
    
    .ctrl-sep { width: 1px; height: 24px; background: var(--border-color); margin: 0 4px; }
    
    .toggle-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
    .toggle-track { width: 36px; height: 20px; background: var(--border-color); border-radius: 100px; position: relative; transition: background 0.3s; }
    .toggle-track.on { background: var(--primary-color); }
    .toggle-thumb { width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: transform 0.3s var(--ease-spring); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
    .toggle-track.on .toggle-thumb { transform: translateX(16px); }
    
    .ctrl-btn { background: rgba(var(--primary-color-rgb), 0.05); border: 1px solid rgba(var(--primary-color-rgb), 0.1); border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 800; color: var(--text-main); display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; white-space: nowrap; }

    /* ---------- MIC STAGE ---------- */
    .mic-stage { background: linear-gradient(135deg, var(--card-bg), var(--bg-body)); border: 1px solid var(--border-color); border-radius: 20px; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; margin-bottom: 24px; min-height: 280px; box-shadow: 0 10px 30px rgba(0,0,0,0.02); }
    
    .wave-wrap { position: absolute; bottom: 0; left: 0; width: 100%; height: 80px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; opacity: 0.15; pointer-events: none; z-index: 0; }
    .wave-bar { width: 6px; background: var(--primary-color); border-radius: 4px 4px 0 0; transition: height 0.1s; }
    
    .mic-btn-outer { position: relative; z-index: 1; margin-bottom: 24px; display: flex; align-items: center; justify-content: center; width: 100px; height: 100px; }
    .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--primary-color); opacity: 0; transform: scale(0.8); pointer-events: none; }
    
    .mic-stage.listening .ring:nth-child(1) { animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite; }
    .mic-stage.listening .ring:nth-child(2) { animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite 0.6s; }
    .mic-stage.listening .ring:nth-child(3) { animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite 1.2s; }
    
    @keyframes ping {
        0% { transform: scale(0.8); opacity: 0.8; }
        100% { transform: scale(2.2); opacity: 0; }
    }
    
    .mic-btn { width: 80px; height: 80px; border-radius: 50%; background: var(--primary-color); border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s var(--ease-spring); box-shadow: 0 8px 24px rgba(var(--primary-color-rgb), 0.3); z-index: 2; position: relative; }
    .mic-btn:hover { transform: scale(1.05); }
    .mic-btn:active { transform: scale(0.95); }
    .mic-btn.listening { background: #ef4444; box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3); animation: pulse 2s infinite; }
    
    @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.05); }
        100% { transform: scale(1); }
    }
    
    .mic-status { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text-main); z-index: 1; margin-bottom: 8px; }
    .status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); transition: background 0.3s; }
    .mic-stage.listening .status-dot { background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
    
    .interim-text { z-index: 1; font-size: 16px; color: var(--text-muted); font-style: italic; min-height: 24px; text-align: center; max-width: 80%; opacity: 0.7; }

    /* ---------- TRANSCRIPT PANEL ---------- */
    .transcript-panel { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.02); margin-bottom: 24px; transition: border-color 0.2s; }
    .transcript-panel:focus-within { border-color: var(--primary-color); }
    
    .tp-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-color); background: var(--bg-body); flex-wrap: wrap; gap: 12px; }
    .tp-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text-main); }
    .tp-actions { display: flex; align-items: center; gap: 12px; }
    
    .tp-meta { background: rgba(var(--primary-color-rgb), 0.1); border: 1px solid rgba(var(--primary-color-rgb), 0.2); font-size: 11px; font-weight: 800; color: var(--primary-color); padding: 4px 10px; border-radius: 100px; }

    .dir-toggle { display: flex; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 2px; }
    .dir-btn { background: transparent; border: none; padding: 4px 8px; font-size: 11px; font-weight: 800; color: var(--text-muted); border-radius: 6px; cursor: pointer; transition: all 0.2s; }
    .dir-btn.active { background: var(--bg-body); color: var(--primary-color); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

    .ta-input { width: 100%; min-height: 250px; background: transparent; border: none; padding: 20px; font-size: 16px; line-height: 1.6; color: var(--text-main); outline: none; resize: vertical; transition: font-size 0.2s; }

    .tp-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border-color); background: var(--bg-body); flex-wrap: wrap; gap: 12px; }
    .tp-footer-left { display: flex; gap: 8px; flex-wrap: wrap; }
    
    .act-btn { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 800; color: var(--text-main); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
    .act-btn:hover { border-color: var(--primary-color); transform: translateY(-1px); }
    .act-btn.danger { color: #ef4444; }
    .act-btn.danger:hover { border-color: #ef4444; background: rgba(239,68,68,0.05); }
    .act-btn.copied { background: #22c55e !important; border-color: #22c55e !important; color: #fff !important; }

    /* ---------- STATS ROW ---------- */
    .stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
    .sc { background: var(--card-bg); border-radius: 16px; padding: 20px; border: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; text-align: center; transition: transform 0.2s; }
    .sc:hover { transform: translateY(-2px); }
    .sc-ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
    
    .sc-ico.red { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
    .sc-ico.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
    .sc-ico.green { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
    .sc-ico.warn { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
    
    .sc-val { font-size: 28px; font-weight: 900; color: var(--text-main); line-height: 1; margin-bottom: 4px; transition: transform 0.3s; }
    .sc-lbl { font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
    .sc-val.popped { transform: scale(1.3); color: var(--primary-color); }

    /* ---------- HISTORY SECTION ---------- */
    .history-section { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; overflow: hidden; margin-bottom: 32px; }
    .hs-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-color); background: var(--bg-body); }
    .hs-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text-main); }
    
    .history-list { display: flex; flex-direction: column; max-height: 400px; overflow-y: auto; }
    .history-empty { padding: 40px; text-align: center; color: var(--text-muted); font-size: 14px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0.6; }
    
    .history-item { display: flex; align-items: flex-start; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border-color); transition: background 0.2s; }
    .history-item:hover { background: rgba(var(--primary-color-rgb), 0.02); }
    .history-item:last-child { border-bottom: none; }
    
    .hi-icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(var(--primary-color-rgb), 0.1); color: var(--primary-color); display: flex; align-items: center; justify-content: center; flex-shrink: 0; mt-2; }
    .hi-body { flex: 1; min-width: 0; }
    .hi-text { font-size: 14px; color: var(--text-main); line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; opacity: 0.9; }
    .hi-meta { display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 700; color: var(--text-muted); flex-wrap: wrap; }
    .hi-tag { background: var(--bg-body); padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border-color); }
    
    .hi-actions { display: flex; gap: 8px; }
    .hi-btn { background: transparent; border: none; padding: 6px; color: var(--text-muted); border-radius: 6px; cursor: pointer; transition: all 0.2s; }
    .hi-btn:hover { background: var(--bg-body); color: var(--primary-color); }
    .hi-btn.del:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
