/**
 * FLOSC Offers, Checkout & Quiz Styles (v1.6.2)
 * ==============================================
 * Updated: 2026-02m-11d
 *
 * Extracted from flosc-app.js inline styles (baseStyles / #flosc-ivr-base-styles).
 * Contains styles for:
 *   - User autoprompts (scroll pills)
 *   - Offer cards, pills, compact, banner, text, featured variants
 *   - Panel offer sections
 *   - Inline checkout UI
 *   - In-chat quiz components
 *
 * ARCHITECTURE:
 * 1. flosc-layout.css   — Structure (flexbox, grid, sizing)
 * 2. flosc-theme.css    — Visual polish, variable consumption
 * 3. flosc-offers.css   — Offer/checkout/quiz components (this file)
 * 4. chat-style-*.css   — Variable definitions (presets)
 * ============================================================================
 */

/* ============================================
   USER AUTOPROMPTS
   ============================================ */
.flosc-user-autoprompts {
    padding: 12px 16px;
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.flosc-replies-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.flosc-replies-scroll::-webkit-scrollbar {
    height: 4px;
}

.flosc-replies-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.flosc-autoprompt-icon {
    font-size: 16px;
}

.flosc-autoprompt-label {
    white-space: nowrap;
}

/* ============================================
   OFFER CARD (Full)
   ============================================ */
.flosc-offer-card {
    background: var(--flosc-offer-gradient);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin: 8px 0;
    position: relative;
}

.flosc-offer-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    color: #fff;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}

.flosc-offer-close:hover {
    opacity: 1;
}

.flosc-offer-content {
    margin-bottom: 16px;
    line-height: 1.6;
}

.flosc-offer-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 16px;
}

.flosc-offer-cta {
    width: 100%;
    padding: 14px 24px !important;
    font-size: 16px !important;
    background: var(--flosc-offer-cta-bg) !important;
}

.flosc-offer-cta:hover {
    background: var(--flosc-offer-cta-hover-bg) !important;
}

.flosc-timer-expired {
    color: var(--flosc-offer-timer-expired);
}

/* ============================================
   OFFER PILL — Compact inline offer pill
   MTS-2026-02-03
   ============================================ */
.flosc-offer-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--flosc-offer-gradient);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    margin: 4px;
}

.flosc-offer-pill:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--flosc-offer-shadow);
}

.flosc-offer-pill-icon {
    font-size: 16px;
}

.flosc-offer-pill-price {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.flosc-offer-pill-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--flosc-offer-badge-bg);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* ============================================
   OFFER COMPACT — Smaller card for PromptPanel
   MTS-2026-02-03
   ============================================ */
.flosc-offer-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--flosc-offer-gradient);
    color: white;
    border-radius: 12px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flosc-offer-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--flosc-offer-shadow);
}

.flosc-offer-compact-icon {
    font-size: 24px;
}

.flosc-offer-compact-content {
    flex: 1;
}

.flosc-offer-compact-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.flosc-offer-compact-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.flosc-offer-compact-price {
    font-weight: 700;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 8px;
}

.flosc-offer-compact-original {
    text-decoration: line-through;
    opacity: 0.7;
    font-size: 12px;
    margin-right: 4px;
}

/* ============================================
   OFFER BANNER — Full-width promotional banner
   MTS-2026-02-03
   ============================================ */
.flosc-offer-banner {
    background: var(--flosc-offer-gradient);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.flosc-offer-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.flosc-offer-banner-content {
    flex: 1;
    z-index: 1;
}

.flosc-offer-banner-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.flosc-offer-banner-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.flosc-offer-banner-cta {
    background: white;
    color: var(--flosc-offer-gradient-start);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1;
    white-space: nowrap;
}

.flosc-offer-banner-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.flosc-offer-banner-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.flosc-offer-banner-timer {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   OFFER TEXT — Simple text-based offer
   MTS-2026-02-03
   ============================================ */
.flosc-offer-text {
    padding: 12px 16px;
    background: var(--flosc-offer-text-bg);
    border-left: 4px solid var(--flosc-offer-gradient-start);
    border-radius: 0 8px 8px 0;
    margin: 8px 0;
}

.flosc-offer-text-content {
    color: var(--flosc-offer-text-color);
    font-size: 14px;
    line-height: 1.5;
}

.flosc-offer-text-link {
    color: var(--flosc-offer-text-link);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.flosc-offer-text-link:hover {
    color: var(--flosc-offer-text-link-hover);
}

/* ============================================
   OFFER FEATURED — Large featured card
   MTS-2026-02-03
   ============================================ */
.flosc-offer-featured {
    background: var(--flosc-offer-gradient);
    color: white;
    border-radius: 16px;
    padding: 24px;
    margin: 16px 0;
    position: relative;
    overflow: hidden;
}

.flosc-offer-featured::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.flosc-offer-featured-badge {
    display: inline-block;
    background: var(--flosc-offer-badge-bg);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.flosc-offer-featured-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.flosc-offer-featured-description {
    font-size: 15px;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 16px;
}

.flosc-offer-featured-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.flosc-offer-featured-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.flosc-offer-featured-pricing {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.flosc-offer-featured-price {
    font-size: 32px;
    font-weight: 700;
}

.flosc-offer-featured-original {
    font-size: 18px;
    text-decoration: line-through;
    opacity: 0.7;
}

.flosc-offer-featured-savings {
    background: var(--flosc-offer-cta-bg);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.flosc-offer-featured-cta {
    width: 100%;
    padding: 16px 24px;
    background: white;
    color: var(--flosc-offer-gradient-start);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.flosc-offer-featured-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.flosc-offer-featured-guarantee {
    text-align: center;
    font-size: 13px;
    opacity: 0.9;
}

/* ============================================
   PANEL OFFERS — PromptPanel offer section
   MTS-2026-02-03
   ============================================ */
.flosc-panel-offers {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.flosc-panel-offers-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--flosc-offer-gradient-start);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.flosc-panel-offers-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

/* ============================================
   INLINE CHECKOUT
   MTS-2026-02-03
   ============================================ */
.flosc-checkout-inline {
    background: var(--flosc-checkout-bg);
    border: 1px solid var(--flosc-checkout-border);
    border-radius: 12px;
    padding: 20px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.flosc-checkout-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--flosc-checkout-border);
}

.flosc-checkout-product-icon {
    font-size: 32px;
}

.flosc-checkout-product-info {
    flex: 1;
}

.flosc-checkout-product-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--flosc-checkout-product-name);
}

.flosc-checkout-product-desc {
    font-size: 13px;
    color: var(--flosc-checkout-product-desc);
}

.flosc-checkout-product-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--flosc-checkout-product-price);
}

.flosc-checkout-form {
    margin-bottom: 16px;
}

.flosc-checkout-field {
    margin-bottom: 12px;
}

.flosc-checkout-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--flosc-checkout-label);
    margin-bottom: 6px;
}

.flosc-checkout-card-element {
    padding: 12px;
    border: 1px solid var(--flosc-checkout-input-border);
    border-radius: 8px;
    background: white;
}

.flosc-checkout-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--flosc-offer-cta-bg);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.flosc-checkout-btn:hover:not(:disabled) {
    background: var(--flosc-offer-cta-hover-bg);
}

.flosc-checkout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.flosc-checkout-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: flosc-spin 0.8s linear infinite;
}

@keyframes flosc-spin {
    to { transform: rotate(360deg); }
}

.flosc-checkout-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--flosc-checkout-footer-text);
}

.flosc-checkout-error {
    color: var(--flosc-checkout-error);
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.flosc-checkout-success {
    text-align: center;
    padding: 24px;
}

.flosc-checkout-success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.flosc-checkout-success-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--flosc-checkout-success);
    margin-bottom: 8px;
}

.flosc-checkout-success-message {
    color: var(--flosc-checkout-product-desc);
    font-size: 14px;
}

/* ============================================
   IN-CHAT QUIZ — v9.3.2
   ============================================ */

/* v1.7.5: Text sequence quiz container */
.flosc-quiz-text-sequence {
    background: var(--flosc-quiz-inline-bg);
    border: 1px solid var(--flosc-quiz-inline-border);
    border-radius: 12px;
    padding: 20px;
    margin: 8px 0;
    text-align: center;
}

.flosc-quiz-text-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.flosc-quiz-text-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--flosc-quiz-inline-border);
    border-radius: 12px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 2px;
    box-sizing: border-box;
    transition: all 0.2s ease;
    background: #fff;
}

.flosc-quiz-text-input:focus {
    outline: none;
    border-color: var(--flosc-quiz-inline-accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.flosc-quiz-hint {
    font-size: 13px;
    color: var(--flosc-checkout-product-desc);
    margin-top: 4px;
}

.flosc-quiz-question {
    background: var(--flosc-quiz-inline-bg);
    border: 1px solid var(--flosc-quiz-inline-border);
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
}

.flosc-quiz-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--flosc-quiz-inline-header);
    font-weight: 600;
}

.flosc-quiz-question-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--flosc-quiz-inline-text);
    margin-bottom: 16px;
    line-height: 1.5;
}

.flosc-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flosc-quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 2px solid var(--flosc-quiz-inline-option-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--flosc-quiz-inline-text);
    text-align: left;
    width: 100%;
}

.flosc-quiz-option:hover {
    border-color: var(--flosc-quiz-inline-option-hover-border);
    background: var(--flosc-quiz-inline-bg);
}

.flosc-quiz-option:active {
    transform: scale(0.98);
}

.flosc-quiz-option-key {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--flosc-quiz-inline-accent);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.flosc-quiz-option-text {
    flex: 1;
}

.flosc-quiz-progress {
    height: 4px;
    background: var(--flosc-quiz-inline-progress-bg);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 12px;
}

.flosc-quiz-progress-bar {
    height: 100%;
    background: var(--flosc-quiz-inline-accent);
    transition: width 0.3s ease;
}

.flosc-quiz-result {
    background: linear-gradient(135deg, var(--flosc-quiz-result-high-start) 0%, var(--flosc-quiz-result-high-end) 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin: 8px 0;
    text-align: center;
}

.flosc-quiz-result.low-score {
    background: linear-gradient(135deg, var(--flosc-quiz-result-low-start) 0%, var(--flosc-quiz-result-low-end) 100%);
}

.flosc-quiz-result.medium-score {
    background: linear-gradient(135deg, var(--flosc-quiz-result-mid-start) 0%, var(--flosc-quiz-result-mid-end) 100%);
}

.flosc-quiz-result-score {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 8px;
}

.flosc-quiz-result-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.flosc-quiz-result-cta {
    display: inline-block;
    padding: 12px 24px;
    background: white;
    color: var(--flosc-quiz-result-cta-text);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.flosc-quiz-result-cta:hover {
    transform: scale(1.05);
}

/* ============================================
   QUIZ SCORE CIRCLE — v1.7.5
   Used by showQuizResults() in flosc-app.js
   ============================================ */
.flosc-quiz-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    background: conic-gradient(var(--flosc-offer-cta-bg) 0deg, var(--flosc-quiz-score-ring) 0deg);
    position: relative;
}

.flosc-quiz-score-circle::after {
    content: '';
    position: absolute;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: inherit;
    background: linear-gradient(135deg, var(--flosc-quiz-result-high-start) 0%, var(--flosc-quiz-result-high-end) 100%);
}

.flosc-quiz-result.low-score .flosc-quiz-score-circle::after {
    background: linear-gradient(135deg, var(--flosc-quiz-result-low-start) 0%, var(--flosc-quiz-result-low-end) 100%);
}

.flosc-quiz-result.medium-score .flosc-quiz-score-circle::after {
    background: linear-gradient(135deg, var(--flosc-quiz-result-mid-start) 0%, var(--flosc-quiz-result-mid-end) 100%);
}

.flosc-quiz-score-value {
    font-size: 28px;
    font-weight: 700;
    color: white;
    z-index: 1;
}

/* v8.0.7: Pulsing animation while server scores audio */
.flosc-score-preparing {
    animation: flosc-score-pulse 2s ease-in-out infinite;
}

@keyframes flosc-score-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

.flosc-quiz-score-label {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.flosc-quiz-breakdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 15px;
    font-weight: 500;
}

.flosc-quiz-breakdown .correct {
    color: var(--flosc-quiz-result-correct);
}

.flosc-quiz-breakdown .incorrect {
    color: var(--flosc-quiz-result-incorrect);
}

/* ============================================
   LeSAEp IPA PRONUNCIATION QUIZ — v8.0.0
   In-chat phrase record + phoneme analysis
   ============================================ */

:root {
    --flosc-ipa-high: #34d399;
    --flosc-ipa-med: #fbbf24;
    --flosc-ipa-low: #f87171;
}

.flosc-ipa-phrase-card {
    background: var(--flosc-quiz-inline-bg);
    border: 1px solid var(--flosc-quiz-inline-border);
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
}

.flosc-ipa-phrase-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--flosc-quiz-inline-header);
    margin-bottom: 12px;
}

.flosc-ipa-phrase-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--flosc-quiz-inline-text);
    margin-bottom: 16px;
    line-height: 1.4;
}

.flosc-ipa-phrase-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-direction: row-reverse;
}

.flosc-ipa-record-btn {
    padding: 10px 20px;
    background: var(--flosc-quiz-record-bg);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.flosc-ipa-record-btn:hover {
    background: var(--flosc-quiz-record-hover-bg);
}

.flosc-ipa-record-btn.recording {
    animation: flosc-ipa-pulse 1.2s ease-in-out infinite;
}

.flosc-ipa-record-btn.completed {
    background: #d1d5db;
    color: #6b7280;
    cursor: default;
    font-size: 18px;
    animation: none;
}

.flosc-ipa-record-btn.completed:hover {
    background: #d1d5db;
}

@keyframes flosc-ipa-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
}

.flosc-ipa-status {
    font-size: 13px;
    color: var(--flosc-checkout-product-desc, #71717a);
}

.flosc-ipa-progress {
    height: 4px;
    background: var(--flosc-quiz-inline-progress-bg, #e5e7eb);
    border-radius: 2px;
    overflow: hidden;
}

.flosc-ipa-progress-bar {
    height: 100%;
    background: var(--flosc-quiz-inline-accent);
    transition: width 0.3s ease;
}

/* IPA Result block */
.flosc-ipa-result {
    background: var(--flosc-quiz-inline-bg);
    border: 1px solid var(--flosc-quiz-inline-border);
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
}

.flosc-ipa-result-header {
    margin-bottom: 8px;
}

.flosc-ipa-result-phrase {
    font-size: 13px;
    font-weight: 600;
    color: var(--flosc-quiz-inline-accent);
}

.flosc-ipa-playback {
    margin-bottom: 12px;
}

.flosc-ipa-playback audio {
    width: 100%;
    height: 36px;
    border-radius: 8px;
}

.flosc-ipa-summary-line {
    font-size: 12px;
    color: var(--flosc-checkout-product-desc, #71717a);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--flosc-quiz-inline-border);
}

.flosc-ipa-c-high { color: var(--flosc-ipa-high); }
.flosc-ipa-c-med { color: var(--flosc-ipa-med); }
.flosc-ipa-c-low { color: var(--flosc-ipa-low); }

/* Word card */
.flosc-ipa-word-card {
    border: 1px solid var(--flosc-quiz-inline-border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
}

.flosc-ipa-word-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.flosc-ipa-word {
    font-size: 16px;
    font-weight: 600;
}

.flosc-ipa-word-score {
    font-size: 14px;
    font-weight: 700;
}

/* IPA reference rows */
.flosc-ipa-rows {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--flosc-quiz-inline-border);
}

.flosc-ipa-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.flosc-ipa-label {
    width: 100px;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--flosc-checkout-product-desc, #71717a);
}

.flosc-ipa-val {
    font-size: 14px;
    font-family: 'Gentium Plus', 'Charis SIL', serif;
}

.flosc-ipa-espeak { opacity: 0.5; }
.flosc-ipa-mw { color: #7cb8ff; }
.flosc-ipa-da1ni5 { color: #d4aaff; }
.flosc-ipa-scored { color: var(--flosc-ipa-high); font-weight: 600; }

/* Phoneme confidence bars */
.flosc-ipa-ph {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.flosc-ipa-ph-sym {
    width: 28px;
    text-align: right;
    font-size: 14px;
    font-family: 'Gentium Plus', 'Charis SIL', serif;
    font-weight: 600;
    flex-shrink: 0;
}

.flosc-ipa-ph-track {
    flex: 1;
    height: 16px;
    background: var(--flosc-quiz-inline-progress-bg, rgba(0,0,0,0.1));
    border-radius: 4px;
    overflow: hidden;
}

.flosc-ipa-ph-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.flosc-ipa-ph-high { background: var(--flosc-ipa-high); }
.flosc-ipa-ph-med { background: var(--flosc-ipa-med); }
.flosc-ipa-ph-low { background: var(--flosc-ipa-low); }

.flosc-ipa-ph-pct {
    width: 48px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    font-family: 'SF Mono', 'JetBrains Mono', Monaco, monospace;
    flex-shrink: 0;
}

/* Quiz summary card */
.flosc-ipa-final {
    background: linear-gradient(135deg, var(--flosc-quiz-result-high-start) 0%, var(--flosc-quiz-result-high-end) 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin: 8px 0;
    text-align: center;
}

.flosc-ipa-final.medium-score {
    background: linear-gradient(135deg, var(--flosc-quiz-result-mid-start) 0%, var(--flosc-quiz-result-mid-end) 100%);
}

.flosc-ipa-final.low-score {
    background: linear-gradient(135deg, var(--flosc-quiz-result-low-start) 0%, var(--flosc-quiz-result-low-end) 100%);
}

.flosc-ipa-final-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.flosc-ipa-final-stats {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.flosc-ipa-weak-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.flosc-ipa-weak-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.flosc-ipa-weak-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.flosc-ipa-weak-sym {
    font-family: 'Gentium Plus', 'Charis SIL', serif;
    font-size: 16px;
    font-weight: 600;
}

/* ── IPA Accordion (post-login phrase results) ── */
.flosc-ipa-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
}

.flosc-ipa-accordion-item {
    border: 1px solid var(--flosc-border, #e0e0e0);
    border-radius: 8px;
    overflow: hidden;
}

.flosc-ipa-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    background: var(--flosc-bg-secondary, #f8f8f8);
    list-style: none;
}

.flosc-ipa-accordion-header::-webkit-details-marker {
    display: none;
}

.flosc-ipa-accordion-item[open] > .flosc-ipa-accordion-header {
    border-bottom: 1px solid var(--flosc-border, #e0e0e0);
}

.flosc-ipa-accordion-phrase {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flosc-ipa-accordion-score {
    flex-shrink: 0;
    font-weight: 700;
    margin-left: 12px;
}

.flosc-ipa-accordion-body {
    padding: 12px 14px;
}

/* ============================================
   IPA RECORDING — WAVEFORM VISUALIZER
   v8.0.1: WhatsApp-style scrolling waveform.
   Hidden until recording starts — no idle bars.
   ============================================ */

.flosc-ipa-waveform {
    flex: 1;
    height: 40px;
    position: relative;
    overflow: hidden;
    display: none;
}

.flosc-ipa-waveform.active {
    display: block;
}

.flosc-ipa-waveform-canvas {
    display: none;
    width: 100%;
    height: 100%;
}

.flosc-ipa-waveform.active .flosc-ipa-waveform-canvas {
    display: block;
}

/* ── Quiz Escape Hatch ("That's too hard!") ── */
.flosc-quiz-escape-hatch {
    text-align: center;
    padding: 4px 0;
}

.flosc-quiz-escape-link {
    font-size: 13px;
    color: var(--flosc-quiz-inline-accent, #3b82f6);
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.flosc-quiz-escape-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ============================================
   IPA FLY-OFF — POST-RECORD ANIMATION
   ============================================ */

.flosc-ipa-flyoff {
    position: relative;
    height: 0;
    overflow: visible;
    pointer-events: none;
}

.flosc-ipa-fly-symbol {
    position: fixed;
    font-size: 16px;
    font-weight: 600;
    color: rgb(107, 114, 128);
    pointer-events: none;
    z-index: 9999;
    animation: flosc-ipa-flyup 1s ease-out forwards;
}

@keyframes flosc-ipa-flyup {
    0% {
        opacity: 0.73;
        transform: translate(0, 0) scale(1);
    }
    20% {
        opacity: 0.6;
        transform: translate(-8px, -80px) scale(0.97);
    }
    45% {
        opacity: 0.4;
        transform: translate(-30px, -140px) scale(0.88);
    }
    100% {
        opacity: 0;
        transform: translate(-45vw, -45vh) scale(0.5);
    }
}

/* ============================================
   CONSENT GATE
   ============================================ */

.flosc-consent-card {
    background: var(--flosc-quiz-inline-bg, #f8fafc);
    border: 1px solid var(--flosc-quiz-inline-border, #e5e7eb);
    border-radius: 12px;
    padding: 20px;
    margin: 8px 0;
}

.flosc-consent-header {
    font-size: 15px;
    font-weight: 700;
    color: var(--flosc-quiz-inline-text, #111827);
    margin-bottom: 10px;
}

.flosc-consent-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--flosc-quiz-inline-text, #111827);
    margin-bottom: 12px;
}

.flosc-consent-legal {
    font-size: 11px;
    line-height: 1.5;
    color: var(--flosc-checkout-product-desc, #71717a);
    margin-bottom: 16px;
}

.flosc-consent-btn {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: #1fad0d;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flosc-consent-btn:hover {
    opacity: 0.9;
}

.flosc-consent-btn.agreed {
    background: #22c55e;
    cursor: default;
}

.flosc-consent-btn:disabled {
    opacity: 0.7;
}

/* ===== IPA Quiz: 5-Step Progress Bar ===== */
.flosc-ipa-step-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}
.flosc-ipa-step {
    flex: 1;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}
.flosc-ipa-step-completed {
    background: #e5e7eb;
    color: #9ca3af;
}
.flosc-ipa-step-check {
    color: #22c55e;
    font-size: 11px;
    position: absolute;
    top: -2px;
    right: 3px;
}
.flosc-ipa-step-active {
    background: var(--flosc-quiz-inline-accent, #3b82f6);
    color: #fff;
}
.flosc-ipa-step-upcoming {
    background: var(--flosc-quiz-inline-progress-bg, #e5e7eb);
    color: #9ca3af;
}

/* Sweep animation: light sweeps across blocks 3 times then stops */
.flosc-ipa-step-sweep .flosc-ipa-step {
    animation: flosc-step-sweep 0.6s ease-in-out 3;
}
.flosc-ipa-step-sweep .flosc-ipa-step:nth-child(1) { animation-delay: 0s; }
.flosc-ipa-step-sweep .flosc-ipa-step:nth-child(2) { animation-delay: 0.08s; }
.flosc-ipa-step-sweep .flosc-ipa-step:nth-child(3) { animation-delay: 0.16s; }
.flosc-ipa-step-sweep .flosc-ipa-step:nth-child(4) { animation-delay: 0.24s; }
.flosc-ipa-step-sweep .flosc-ipa-step:nth-child(5) { animation-delay: 0.32s; }

@keyframes flosc-step-sweep {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
}

/* Record button mild pulse (call to action) */
.flosc-ipa-record-pulse {
    animation: flosc-record-pulse 2.5s ease-in-out infinite;
}
@keyframes flosc-record-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.25); }
    50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}
.flosc-ipa-record-btn.recording {
    animation: flosc-ipa-pulse 1.2s ease-in-out infinite;
}

/* Phrase text entrance animation */
.flosc-ipa-phrase-entrance {
    animation: flosc-phrase-enter 0.5s ease-out;
}
@keyframes flosc-phrase-enter {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ===== IPA Accordion: hint, chevron arrows ===== */
.flosc-ipa-accordion-hint {
    font-size: 13px;
    color: var(--flosc-checkout-product-desc, #71717a);
    text-align: center;
    margin-bottom: 10px;
    font-style: italic;
}
.flosc-ipa-accordion-chevron {
    display: inline-block;
    font-size: 12px;
    margin-right: 6px;
    transition: transform 0.2s ease;
    color: var(--flosc-checkout-product-desc, #71717a);
}
.flosc-ipa-accordion-item[open] > .flosc-ipa-accordion-header .flosc-ipa-accordion-chevron {
    transform: rotate(90deg);
}

/* ── Quiz Tier Selection ── */
.flosc-tier-card {
    background: var(--flosc-surface, #ffffff);
    border: 1px solid var(--flosc-border, #e5e7eb);
    border-radius: 12px;
    padding: 16px;
    max-width: 380px;
}
.flosc-tier-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--flosc-text, #1e293b);
}
.flosc-tier-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.flosc-tier-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid var(--flosc-border, #e5e7eb);
    border-radius: 10px;
    background: var(--flosc-surface, #ffffff);
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.3s, transform 0.2s;
    text-align: left;
}
.flosc-tier-btn:hover:not(:disabled) {
    border-color: var(--flosc-quiz-inline-accent, #3b82f6);
    transform: translateY(-1px);
}
.flosc-tier-emoji {
    font-size: 22px;
    flex-shrink: 0;
}
.flosc-tier-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.flosc-tier-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--flosc-text, #1e293b);
}
.flosc-tier-desc {
    font-size: 11px;
    color: var(--flosc-muted, #71717a);
}
.flosc-tier-btn.selected {
    border-color: var(--flosc-quiz-inline-accent, #3b82f6);
    background: #eff6ff;
}
.flosc-tier-btn.dimmed {
    opacity: 0.35;
    pointer-events: none;
}
.flosc-tier-mic-note {
    font-size: 11px;
    color: var(--flosc-muted, #71717a);
    margin-top: 10px;
    text-align: center;
}

/* Escape hatch inline text (Advanced tier) */
.flosc-quiz-escape-text {
    font-size: 12px;
    color: var(--flosc-muted, #71717a);
}

/* ── Admin IPA Detail: Word Rows & Phoneme Chips ── */
.flosc-ipa-word-row {
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--flosc-border, #e0e0e0);
}
.flosc-ipa-word-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.flosc-ipa-word-row strong {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}
.flosc-ipa-phoneme-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.flosc-ipa-phoneme-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border: 1.5px solid;
    border-radius: 12px;
    font-size: 13px;
    background: var(--flosc-bg-secondary, #f8f8f8);
}

/* ── Session Sidebar: Rename & Delete Buttons ── */
.flosc-session-actions {
    display: none;
    margin-left: auto;
    flex-shrink: 0;
    gap: 2px;
}
.flosc-session-item:hover .flosc-session-actions {
    display: flex;
}
.flosc-session-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 12px;
    opacity: 0.5;
    transition: opacity 0.15s ease;
    line-height: 1;
}
.flosc-session-action:hover {
    opacity: 1;
}
