/* ===========================
   Glass Container
   =========================== */

.glass-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.glass-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.04) 50%,
            rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.glass-success {
    background: rgba(255, 255, 255, 0.06);
}

.glass-error {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Mobile: more transparent glass to see webcam better */
@media (max-width: 768px) {
    .glass-container {
        background: rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(24px);
    }
}

/* ===========================
   Glass Button
   =========================== */

.glass-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 600;
    cursor: pointer;
    /* Optimize: specific transitions instead of 'all' */
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.glass-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.15) 0%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.glass-button:active {
    transform: scale(0.98);
}

/* ===========================
   Draggable Container
   =========================== */

.draggable-container {
    position: absolute;
    cursor: move;
    user-select: none;
    z-index: 10;
}

.draggable-container.dragging {
    cursor: grabbing;
    z-index: 20;
}

/* ===========================
   Webcam Capture Controls
   =========================== */

.webcam-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.webcam-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.webcam-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
}

.webcam-toggle-btn.paused {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Mobile: even smaller, minimal */
@media (max-width: 768px) {
    .webcam-toggle-btn {
        width: 32px;
        height: 32px;
    }
    
    .webcam-toggle-btn svg {
        width: 16px;
        height: 16px;
    }
}

.webcam-status {
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 9999px;
    font-size: 0.75rem;
    color: #d1d5db;
}

.webcam-status.error {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Processing Pill (Mobile: top-right) */
.processing-pill {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.processing-pill.error {
    background: rgba(255, 59, 48, 0.2);
    color: rgba(255, 100, 100, 0.95);
    border-color: rgba(255, 59, 48, 0.3);
}

/* Mobile: move webcam status aside to avoid overlap with caption */
@media (max-width: 768px) {
    .webcam-status {
        font-size: 0.6875rem;
        padding: 4px 8px;
        margin-top: 6px;
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ===========================
   Prompt Input
   =========================== */

.prompt-input-container {
    width: 420px;
    max-width: 90vw;
}

.prompt-textarea {
    width: 100%;
    min-height: 100px;
    max-height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    color: white;
    font-size: 0.875rem;
    resize: vertical;
    font-family: inherit;
}

/* Mobile: compact textarea */
@media (max-width: 768px) {
    .prompt-textarea {
        min-height: 60px;
        max-height: 100px;
        font-size: 0.8125rem;
        padding: 0.625rem;
    }
    
    /* Hide suggestion label on mobile to save space */
    .prompt-input-container .text-gray-400 {
        display: none;
    }
    
    /* Make main label smaller */
    .prompt-input-container .text-sm {
        font-size: 0.6875rem;
        margin-bottom: 0.375rem;
    }
    
    .live-caption-container .text-sm {
        font-size: 0.6875rem;
        margin-bottom: 0.375rem;
    }
}

.prompt-textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

.prompt-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.prompt-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* Mobile: horizontal scrolling suggestions */
@media (max-width: 768px) {
    .prompt-suggestions {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 6px;
        margin-top: 8px;
        padding-bottom: 4px;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    }
    
    .prompt-suggestions::-webkit-scrollbar {
        height: 4px;
    }
    
    .prompt-suggestions::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .prompt-suggestions::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }
}

.prompt-suggestion-chip {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    white-space: nowrap;
    /* Optimize: specific transitions */
    transition: transform 0.2s ease, background 0.2s ease;
}

.prompt-suggestion-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

/* Mobile: smaller suggestion chips */
@media (max-width: 768px) {
    .prompt-suggestion-chip {
        padding: 5px 10px;
        font-size: 0.6875rem;
        flex-shrink: 0;
    }
}

/* ===========================
   Prompt Input - Mobile Bottom Sheet
   =========================== */

.prompt-input-bottom-sheet {
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 32px);
    width: 100%;
    max-height: 32vh;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 101;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    overflow: hidden;
}

.prompt-input-bottom-sheet.collapsed {
    max-height: calc(56px + env(safe-area-inset-bottom));
}

.prompt-input-bottom-sheet.expanded {
    max-height: 32vh;
}

/* Prompt Header */
.prompt-input-header {
    display: flex;
    flex-direction: column;
    padding: 8px 16px 10px;
    cursor: pointer;
    user-select: none;
}

.prompt-input-header:active {
    background: rgba(255, 255, 255, 0.05);
}

.prompt-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto 8px;
}

.prompt-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.prompt-title-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.prompt-chevron {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* Prompt Content */
.prompt-input-content {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    max-height: calc(32vh - 56px);
    overflow-y: auto;
}

.prompt-input-bottom-sheet.collapsed .prompt-input-content {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
}

.prompt-input-bottom-sheet .prompt-textarea {
    min-height: 70px;
    max-height: 120px;
    font-size: 0.9375rem;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.prompt-input-bottom-sheet .prompt-textarea:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ===========================
   Live Caption
   =========================== */

.live-caption-container {
    min-width: 300px;
    max-width: 500px;
}

/* Mobile: more compact caption container */
@media (max-width: 768px) {
    .live-caption-container {
        min-width: auto;
        max-width: calc(100vw - 1.5rem);
    }
}

.live-caption-text {
    font-size: 1rem;
    line-height: 1.5;
    color: #f3f4f6;
    word-wrap: break-word;
}

/* Mobile: smaller caption text */
@media (max-width: 768px) {
    .live-caption-text {
        font-size: 0.875rem;
        line-height: 1.4;
    }
}

/* ===========================
   Live Caption - Mobile Bottom Sheet
   =========================== */

.live-caption-bottom-sheet {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 32px);
    width: 100%;
    max-height: 40vh;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    overflow: hidden;
}

.live-caption-bottom-sheet.collapsed {
    max-height: calc(56px + env(safe-area-inset-bottom));
    bottom: calc(16px + env(safe-area-inset-bottom));
}

.live-caption-bottom-sheet.expanded {
    max-height: 40vh;
    bottom: 16px;
}

.live-caption-bottom-sheet.caption-paused {
    opacity: 0.7;
}

/* Caption Header - Compact 56px with clear hierarchy */
.live-caption-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    min-height: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    user-select: none;
    gap: 12px;
}

.live-caption-header:active {
    background: rgba(255, 255, 255, 0.04);
}

/* Live Pill Indicator */
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.live-pill-dot {
    width: 6px;
    height: 6px;
    background: #ff3b30;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.live-pill.streaming .live-pill-dot {
    animation: pulse 0.8s ease-in-out infinite;
}

.live-pill-text {
    color: rgba(255, 255, 255, 0.9);
}

/* Caption Controls */
.caption-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.caption-control-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.caption-control-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

.caption-control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.caption-chevron {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* Caption Content */
.live-caption-content {
    padding: 12px 16px;
    max-height: calc(40vh - 64px - env(safe-area-inset-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.live-caption-content::-webkit-scrollbar {
    width: 4px;
}

.live-caption-content::-webkit-scrollbar-track {
    background: transparent;
}

.live-caption-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.live-caption-bottom-sheet .live-caption-text {
    font-size: 15px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.95);
    word-wrap: break-word;
    text-wrap: pretty;
    margin: 0;
    opacity: 0;
    animation: fadeInCaption 0.4s ease-out forwards;
}

/* Waiting state - subtle */
.live-caption-text:not(.live-caption-error):not(.live-caption-streaming) {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
}

/* Fade-in animation */
@keyframes fadeInCaption {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.live-caption-bottom-sheet.collapsed .live-caption-content {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
}

.live-caption-streaming {
    opacity: 0.7;
}

.live-caption-error {
    color: rgba(255, 100, 100, 0.9);
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* ===========================
   Loading Screen (Apple Premium)
   =========================== */

.loading-screen-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.loading-content {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(60px);
    -webkit-backdrop-filter: blur(60px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 3rem 3.5rem;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7),
                inset 0 1px 0 rgba(255, 255, 255, 0.1),
                0 0 100px rgba(255, 255, 255, 0.02);
    text-align: center;
    max-width: 520px;
    width: 100%;
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Typography */
.loading-title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: rgba(255, 255, 255, 0.98);
    margin-bottom: 0.75rem;
}

.loading-subtitle {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 2.5rem;
}

.loading-step {
    font-size: 0.9375rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
    letter-spacing: 0.01em;
}

.loading-step-error {
    color: rgba(255, 100, 100, 0.9);
}

/* Progress Section */
.loading-progress-section {
    margin-bottom: 1.5rem;
    transition: opacity 0.5s ease-out;
}

.loading-progress-bar-container {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    height: 6px;
    overflow: visible;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.loading-progress-bar-fill {
    position: relative;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 9999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.loading-progress-percent {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.625rem;
    font-weight: 500;
    color: #0F0F0F;
    letter-spacing: 0.02em;
}

/* Micro Log */
.loading-micro-log {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
}

.loading-micro-log::after {
    content: '';
    animation: dotAnimation 1.5s infinite;
}

@keyframes dotAnimation {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Error Button */
.loading-error-button {
    margin-top: 2rem;
    padding: 0.875rem 2.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0F0F0F;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.01em;
}

.loading-error-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.loading-error-button:active {
    transform: scale(0.98);
}

/* Error Icon */
.error-icon-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
}

.error-icon {
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.7);
}

/* ===========================
   Webcam Permission Dialog (Apple Premium)
   =========================== */

.webcam-permission-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.webcam-permission-content {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(60px);
    -webkit-backdrop-filter: blur(60px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 3rem 3.5rem;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7),
                inset 0 1px 0 rgba(255, 255, 255, 0.1),
                0 0 100px rgba(255, 255, 255, 0.02);
    text-align: center;
    max-width: 520px;
    width: 100%;
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.3s ease-out;
}

/* Camera Icon */
.webcam-permission-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 2rem;
    color: rgba(255, 255, 255, 0.6);
    animation: fadeIn 0.6s ease-out 0.2s backwards;
}

.webcam-permission-icon svg {
    width: 100%;
    height: 100%;
}

/* Typography */
.webcam-permission-title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: rgba(255, 255, 255, 0.98);
    margin-bottom: 0.75rem;
}

.webcam-permission-subtitle {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 2rem;
}

.webcam-permission-description {
    font-size: 0.9375rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
    letter-spacing: 0.01em;
    line-height: 1.5;
}

.webcam-permission-error {
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(255, 100, 100, 0.9);
    margin-bottom: 1.5rem;
    letter-spacing: 0.01em;
}

/* Micro Log */
.webcam-permission-micro-log {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
}

.webcam-permission-micro-log::after {
    content: '';
    animation: dotAnimation 1.5s infinite;
}

/* Button */
.webcam-permission-button {
    margin-top: 2rem;
    padding: 0.875rem 2.5rem;
    background: rgba(255, 255, 255, 0.97);
    border: none;
    border-radius: 14px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0F0F0F;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.01em;
}

.webcam-permission-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.webcam-permission-button:active {
    transform: scale(0.98);
}

/* ===========================
   Status Indicator
   =========================== */

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===========================
   Numbered Badge
   =========================== */

.numbered-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.8);
}

/* ===========================
   Icon Inline
   =========================== */

.icon-inline {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    pointer-events: none;
}

/* ===========================
   Responsive Design
   Mobile-optimized UI with touch-friendly controls
   =========================== */

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .glass-button,
    .webcam-capture-button,
    .suggestion-chip {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }
    
    /* Disable hover effects on touch */
    .glass-button:hover,
    .suggestion-chip:hover {
        transform: none;
    }
    
    /* Active state for touch feedback */
    .glass-button:active,
    .suggestion-chip:active {
        transform: scale(0.97);
        opacity: 0.8;
    }
}

/* Tablet and smaller */
@media (max-width: 1024px) {
    .draggable-container {
        /* Easier to grab on tablets */
        cursor: grab;
    }
    
    .live-caption-content {
        font-size: 1.125rem;
    }
}

/* Tablet portrait and smaller */
@media (max-width: 768px) {
    /* Desktop prompt positioning (not used on mobile - mobile uses bottom sheet) */
    .prompt-input-container {
        display: none;
    }

    /* Live caption - bottom sheet on mobile, desktop uses old style */
    .live-caption-container {
        min-width: auto;
        max-width: calc(100vw - 1.5rem);
        left: 50% !important;
        top: 0.75rem !important;
        right: auto !important;
        transform: translateX(-50%);
        position: fixed !important;
    }
    
    .live-caption-container .p-4 {
        padding: 0.75rem !important;
    }
    
    .live-caption-content {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Disable dragging on mobile (fixed positions) */
    .draggable-container {
        cursor: default !important;
    }
    
    .draggable-container:active {
        cursor: default !important;
    }

    /* Loading screen */
    .loading-content {
        padding: 2.5rem 2rem;
        max-width: calc(100vw - 2rem);
    }

    .loading-title {
        font-size: 1.5rem;
    }

    .loading-subtitle {
        font-size: 0.6875rem;
        letter-spacing: 0.08em;
    }

    .loading-step {
        font-size: 0.875rem;
    }
    
    .loading-micro-log {
        font-size: 0.6875rem;
    }

    .loading-error-button {
        padding: 0.875rem 2.5rem;
        font-size: 0.875rem;
        min-height: 48px;
    }

    /* Webcam permission dialog */
    .webcam-permission-content {
        padding: 2.5rem 2rem;
        max-width: calc(100vw - 2rem);
    }

    .webcam-permission-title {
        font-size: 1.5rem;
    }

    .webcam-permission-subtitle {
        font-size: 0.6875rem;
    }
    
    .webcam-permission-button {
        min-height: 48px;
    }
    
    /* Webcam controls */
    .webcam-capture-container {
        top: 1rem;
        left: 1rem;
    }
    
    .webcam-capture-button {
        width: 52px;
        height: 52px;
    }
    
    /* Suggestion chips */
    .suggestion-chips {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 1rem;
    }
    
    .suggestion-chip {
        font-size: 0.8125rem;
        padding: 0.625rem 1.25rem;
    }
}

/* Mobile devices - extra compact */
@media (max-width: 640px) {
    .live-caption-container {
        max-width: calc(100vw - 1rem);
        top: 0.5rem !important;
    }
    
    .live-caption-container .p-4 {
        padding: 0.625rem !important;
    }
    
    .live-caption-container .text-sm {
        font-size: 0.75rem !important;
    }
    
    .live-caption-content {
        font-size: 0.9375rem;
        padding: 1rem;
    }
    
    .loading-content {
        padding: 2rem 1.5rem;
    }
    
    .loading-title {
        font-size: 1.375rem;
    }
    
    .webcam-permission-content {
        padding: 2rem 1.5rem;
    }
    
    .webcam-permission-title {
        font-size: 1.375rem;
    }
    
    .webcam-permission-icon {
        width: 56px;
        height: 56px;
    }
    
    .webcam-capture-button {
        width: 48px;
        height: 48px;
    }
    
    .suggestion-chip {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
}

/* Small mobile devices */
@media (max-width: 375px) {
    .loading-title,
    .webcam-permission-title {
        font-size: 1.25rem;
    }
    
    .loading-subtitle,
    .webcam-permission-subtitle {
        font-size: 0.625rem;
    }
    
    .live-caption-content {
        font-size: 0.875rem;
    }
    
    .prompt-input {
        font-size: 0.8125rem;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .loading-content,
    .webcam-permission-content {
        padding: 1.5rem 2rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .loading-title,
    .webcam-permission-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .loading-subtitle,
    .webcam-permission-subtitle {
        margin-bottom: 1rem;
    }
    
    .webcam-permission-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 1rem;
    }
    
    /* Prompt bottom sheet - landscape compact */
    .prompt-input-bottom-sheet {
        max-height: 28vh;
        bottom: calc(60px + env(safe-area-inset-bottom));
    }
    
    .prompt-input-bottom-sheet.collapsed {
        max-height: calc(52px + env(safe-area-inset-bottom));
    }
    
    .prompt-input-content {
        max-height: calc(28vh - 52px);
    }
    
    .prompt-textarea {
        min-height: 50px !important;
        max-height: 70px !important;
    }
    
    /* Caption bottom sheet - landscape compact */
    .live-caption-bottom-sheet {
        max-height: 30vh;
        bottom: 12px;
    }
    
    .live-caption-bottom-sheet.collapsed {
        max-height: calc(56px + env(safe-area-inset-bottom));
        bottom: calc(12px + env(safe-area-inset-bottom));
    }
    
    .live-caption-content {
        max-height: calc(30vh - 56px - env(safe-area-inset-bottom));
    }
    
    /* Desktop caption */
    .live-caption-container {
        top: 0.5rem !important;
        max-height: 30vh;
        overflow-y: auto;
    }
    
    .live-caption-container .p-4 {
        padding: 0.5rem !important;
    }
    
    .live-caption-text {
        font-size: 0.8125rem;
        line-height: 1.3;
    }
}