:root {
    --primary: #FF6B00;
    --primary-light: #FF8F3D;
    --primary-dark: #CC5200;
    --primary-glow: rgba(255, 107, 0, 0.2);
    --accent: #FF6B00;
    --accent-glow: rgba(255, 107, 0, 0.1);
    --bg-color: #FDF8F6;
    --panel-bg: #FFFFFF;
    --card-bg: #FFF8F3;
    --text-main: #2E1505;
    --text-muted: #806553;
    --glass-border: rgba(255, 107, 0, 0.12);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --success: #16A34A;
    --danger: #DC2626;
    --bg-gradient-dir: linear-gradient(135deg, #FDF8F6 0%, #FFEFE5 100%);
}
.light-theme {
    --primary: #FF6B00;
    --primary-light: #FF8F3D;
    --primary-dark: #CC5200;
    --primary-glow: rgba(255, 107, 0, 0.2);
    --accent: #FF6B00;
    --accent-glow: rgba(255, 107, 0, 0.1);
    --bg-color: #FDF8F6;
    --panel-bg: #FFFFFF;
    --card-bg: #FFF8F3;
    --text-main: #2E1505;
    --text-muted: #806553;
    --glass-border: rgba(255, 107, 0, 0.12);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --success: #16A34A;
    --danger: #DC2626;
    --bg-gradient-dir: linear-gradient(135deg, #FDF8F6 0%, #FFEFE5 100%);
}
.dark-theme {
    --primary: #FF6B00;
    --primary-light: #FF8F3D;
    --primary-dark: #FF6B00;
    --primary-glow: rgba(255, 107, 0, 0.2);
    --accent: #FF6B00;
    --accent-glow: rgba(255, 107, 0, 0.1);
    --bg-color: #0B0F19;
    --panel-bg: #121824;
    --card-bg: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --glass-border: rgba(255, 107, 0, 0.15);
    --nav-bg: rgba(18, 24, 36, 0.95);
    --success: #FF6B00;
    --danger: #FF6B00;
    --bg-gradient-dir: linear-gradient(135deg, #0B0F19 0%, #121824 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Cairo', 'Outfit', sans-serif; }

body {
    background: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-gradient {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--bg-gradient-dir, #ffffff);
    z-index: 0;
}

.phone-frame {
    position: relative;
    width: 420px;
    height: 820px;
    max-height: 95vh;
    background: var(--bg-color);
    border-radius: 40px;
    border: 1px solid #FF6B00;
    box-shadow:
        0 0 0 1px rgba(255, 107, 0, 0.08),
        0 20px 60px rgba(120, 68, 22, 0.12),
        0 0 40px rgba(255, 107, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 30px;
    background: var(--bg-color);
    border-radius: 0 0 18px 18px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.phone-notch .notch-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255, 107, 0, 0.25);
}
.phone-notch .notch-dot:first-child {
    width: 10px; height: 10px;
    background: rgba(255, 107, 0, 0.15);
}
.avatar-text-overlay {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 107, 0,0.25);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 8px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    text-align: center;
    white-space: nowrap;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: 'Cairo', sans-serif;
}
.avatar-text-overlay.show { opacity: 1; }

/* Splash Screen (inside phone frame) */
.splash-screen {
    position: absolute;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FF6B00 0%, #CC5200 100%);
    border-radius: inherit;
    animation: splash-fade 6.5s ease forwards;
    pointer-events: none;
}
@keyframes splash-fade {
    0%,85% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}
.splash-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.splash-svg {
    width: 130px;
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 0 0 transparent);
    animation: glow-final 0.8s 3.2s ease-out forwards;
}
.splash-hand-path {
    fill: none;
    stroke: #FF6B00;
    stroke-width: 18;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    animation: draw-hands 3.2s cubic-bezier(0.68, -0.1, 0.32, 1.4) forwards;
}
@keyframes draw-hands {
    0% { stroke-dashoffset: 2400; stroke-width: 14; }
    40% { stroke-dashoffset: 1200; fill: none; stroke: #FF6B00; stroke-width: 18; }
    70% { stroke-dashoffset: 300; fill: none; stroke: #FF6B00; stroke-width: 20; }
    85% { stroke-dashoffset: 0; fill: rgba(255, 107, 0, 0.05); stroke: #FF6B00; stroke-width: 22; }
    92% { stroke-dashoffset: -40; fill: rgba(255, 107, 0, 0.15); stroke: #FF6B00; stroke-width: 20; }
    100% { stroke-dashoffset: 0; fill: #FFF2E6; stroke: rgba(255, 107, 0, 0.3); stroke-width: 18; }
}
@keyframes glow-final {
    0% { filter: drop-shadow(0 0 5px rgba(255, 107, 0,0.3)); }
    100% { filter: drop-shadow(0 0 35px rgba(255, 107, 0,0.5)) drop-shadow(0 0 60px rgba(255, 107, 0,0.2)); }
}
.splash-glow {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 0,0.15) 0%, transparent 70%);
    opacity: 0;
    animation: glow-appear 1s 2.8s ease-out forwards;
    pointer-events: none;
}
@keyframes glow-appear {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}
.splash-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: white;
    margin-top: 20px;
    letter-spacing: -1px;
    min-height: 3.2rem;
    direction: ltr;
}
.splash-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    animation: char-reveal 0.35s ease-out forwards;
}
@keyframes char-reveal {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}
.splash-sub {
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.55);
    margin-top: 8px;
    opacity: 0;
    animation: splash-rise 0.8s 4.2s ease-out forwards;
}
@keyframes splash-rise {
    0% { transform: translateY(16px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.app-header {
    padding: 40px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 2;
}
.app-header .logo-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.app-header .logo-row i {
    font-size: 1.5rem;
    color: var(--primary-light);
    filter: drop-shadow(0 0 6px var(--primary-glow));
}
.app-header .logo-row h1 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}
.app-header .badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 700;
}
.app-header .header-actions {
    display: flex;
    gap: 12px;
    color: var(--text-muted);
    font-size: 1.1rem;
}
.app-header .header-actions i { cursor: pointer; transition: color 0.3s; }
.app-header .header-actions i:hover { color: var(--primary-light); }

.avatar-section {
    position: relative;
    flex: 1;
    min-height: 0;
    margin: 0 12px;
    border-radius: 24px;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Settings tab: compact avatar preview box */
#settings.active ~ .avatar-section,
.tab-panel#settings.active + * .avatar-section {
    flex: none;
    height: 140px;
    min-height: 0;
}
/* Compact avatar when settings tab is active (managed via JS body class) */
body.settings-active .avatar-section {
    flex: none !important;
    height: 140px !important;
    min-height: 0 !important;
    margin: 6px 12px !important;
}
body.settings-active .content-area {
    flex: 1 !important;
    max-height: calc(100% - 276px) !important;
    min-height: 0 !important;
}
#avatar-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}
#avatar-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.loading-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}
.loading-overlay .spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255, 107, 0, 0.2);
    border-top: 3px solid var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}
.loading-overlay p {
    color: var(--text-muted);
    font-size: 0.8rem;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.content-area {
    flex: 0 0 auto;
    max-height: 38%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 3;
}
.panels-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 107, 0,0.3) transparent;
}
.panels-container::-webkit-scrollbar { width: 3px; }
.panels-container::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: slideUp 0.3s ease-out; }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header { margin-bottom: 12px; }
.panel-header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}
.panel-header p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-grid { display: flex; flex-direction: column; gap: 8px; }
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 16px;
    transition: all 0.3s ease;
}
.glass-card.interactive {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
}
.glass-card.interactive:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 0, 0.08);
    transform: translateY(-1px);
}
.glass-card .card-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(255, 107, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary-light);
    flex-shrink: 0;
}
.glass-card .card-text h3 {
    font-size: 0.9rem;
    font-weight: 600;
}
.glass-card .card-text p {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.camera-container {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #000;
    border: 1px solid var(--glass-border);
}
.camera-container video, .camera-container canvas {
    width: 100%;
    display: block;
}
.camera-controls {
    display: flex;
    gap: 8px;
    padding: 10px 0 4px;
    flex-wrap: wrap;
}
.camera-controls button {
    flex: 1;
    min-width: 80px;
}

.btn-glow {
    background: var(--primary);
    color: var(--text-main);
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: all 0.3s;
}
.btn-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-glow-accent {
    background: var(--primary);
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-secondary {
    background: var(--primary-light);
    color: var(--text-main);
    border: 1px solid var(--primary-light);
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-secondary:hover {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-danger {
    background: var(--primary-dark);
    color: white;
    border: 1px solid var(--primary-dark);
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-danger:hover {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-outline {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: var(--text-main);
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: all 0.3s;
}

.translation-box {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px;
}
.translation-box textarea {
    width: 100%;
    height: 56px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    padding-left: 48px;
    color: var(--text-main);
    resize: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}
.translation-box textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}
.input-group { position: relative; }
.voice-btn {
    position: absolute;
    top: 50%; left: 8px;
    transform: translateY(-50%);
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: all 0.3s ease;
    z-index: 2;
}
.voice-btn.listening {
    animation: pulse-mic 1s infinite;
    background: var(--primary-dark);
    box-shadow: 0 0 20px var(--primary-glow);
}
@keyframes pulse-mic {
    0%,100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.15); }
}
.controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.controls-row .speed-control {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.controls-row .speed-control select {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
}
.controls-row .btn-glow, .controls-row .btn-secondary {
    padding: 8px 14px;
    font-size: 0.75rem;
    flex: 1;
}

.divider {
    text-align: center;
    margin: 14px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    position: relative;
}



.dict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.dict-header .dict-actions {
    display: flex;
    gap: 6px;
}
.dict-header .dict-actions button {
    padding: 6px 10px;
    font-size: 0.65rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 12px;
}
.search-bar i { color: var(--text-muted); font-size: 0.85rem; margin-left: 8px; }
.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    width: 100%;
    font-size: 0.8rem;
}
/* Bigger search bar inside dict manager */
#studio-dict-mgr-view .search-bar {
    padding: 12px 16px;
    margin-bottom: 18px;
}
#studio-dict-mgr-view .search-bar input {
    font-size: 0.95rem;
}
#studio-dict-mgr-view .search-bar i {
    font-size: 1rem;
}
.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.glass-card.small {
    padding: 8px 10px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.glass-card.small:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 0, 0.08);
}
.glass-card.small i {
    display: block;
    font-size: 1.2rem;
    color: var(--primary-light);
    margin-bottom: 4px;
}

/* Dictionary UX tweaks: lower search bar and shrink text */
#dictionary .search-bar {
    margin-top: 18px;
    margin-bottom: 12px;
}
#dictionary .search-bar input {
    font-size: 0.75rem;
}
#dictionary .glass-card.small {
    font-size: 0.7rem;
    padding: 6px 8px;
}
#dictionary .glass-card.small i {
    font-size: 1.05rem;
    margin-bottom: 2px;
}


.settings-list { }
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--glass-border);
}
.setting-item span {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.setting-item span i { color: var(--primary-light); width: 20px; text-align: center; }

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(150,150,150,0.25);
    transition: 0.3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}
input:checked + .slider { background: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.glass-select {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
}

.levels-list { display: flex; flex-direction: column; gap: 8px; }
.level-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.level-item:hover {
    border-color: var(--primary);
}
.level-item .level-info h3 { font-size: 0.85rem; }
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(150,150,150,0.15);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.progress-bar .fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

/* Learning Quiz */
.quiz-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 8px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.85rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 54px;
}
.quiz-choice:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 0, 0.1);
}
.quiz-choice.correct, .quiz-choice.correct:disabled {
    opacity: 1 !important;
    border-color: #22C55E !important;
    background: rgba(34, 197, 94, 0.15) !important;
    color: #15803D !important;
    font-weight: bold;
}
.quiz-choice.wrong, .quiz-choice.wrong:disabled {
    opacity: 1 !important;
    border-color: #EF4444 !important;
    background: rgba(239, 68, 68, 0.15) !important;
    color: #B91C1C !important;
    font-weight: bold;
}
.quiz-choice:disabled {
    cursor: default;
    opacity: 0.8;
}

/* Quiz replay button */
.quiz-replay-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.quiz-replay-btn:hover {
    background: rgba(255, 107, 0,0.3);
    border-color: var(--primary);
    color: var(--primary-light);
}

/* Avatar upload hint */
.avatar-upload-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
}

.toast {
    visibility: hidden;
    min-width: 260px;
    max-width: 85%;
    background: linear-gradient(135deg, var(--primary-light, #FF8F3D) 0%, var(--primary, #FF6B00) 100%);
    color: #ffffff;
    text-align: center;
    border-radius: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    padding: 16px 22px;
    position: absolute;
    z-index: 10000;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 20px 40px rgba(255, 107, 0, 0.35), 0 12px 24px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    pointer-events: none;
}
.toast.show { 
    visibility: visible; 
    animation: toastPopupIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both, toastPopupOut 0.35s ease-in 2.65s both; 
}
@keyframes toastPopupIn { 
    from { 
        opacity: 0; 
        transform: translate(-50%, -40%) scale(0.9); 
    } 
    to { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    } 
}
@keyframes toastPopupOut { 
    from { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    } 
    to { 
        opacity: 0; 
        transform: translate(-50%, -58%) scale(0.92); 
    } 
}

.bottom-nav {
    display: flex;
    background: var(--nav-bg);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 6px 8px 10px;
    flex-shrink: 0;
    backdrop-filter: blur(20px);
    z-index: 10;
    margin-top: auto;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Cairo', sans-serif;
    position: relative;
}
.nav-item i {
    font-size: 1.2rem;
    transition: all 0.3s;
}
.nav-item span {
    font-size: 0.6rem;
    font-weight: 600;
    transition: all 0.3s;
}
.nav-item.active {
    color: var(--primary-light);
}
.nav-item.active i {
    filter: drop-shadow(0 0 6px var(--primary-glow));
}
.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--primary-dark);
    border-radius: 0 0 2px 2px;
}

.step-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 2px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.step-dot.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
    border-color: var(--primary);
    transform: scale(1.1);
}
.step-dot.completed {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

#lab-countdown {
    animation: pulse-countdown 1s infinite;
    pointer-events: none;
    z-index: 100;
}
@keyframes pulse-countdown {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

#record-metadata label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; display: block; }
#record-metadata input, #record-metadata select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-main);
    font-size: 0.8rem;
}
#record-metadata input:focus, #record-metadata select:focus {
    outline: none;
    border-color: var(--primary);
}

#bone-debug {
    display: none !important;
}

@media (max-width: 500px) {
    .phone-frame {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    .phone-notch { display: none; }
    .app-header { padding-top: 50px; }
}
.is-mobile .phone-frame {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
}
.is-mobile .splash-screen { border-radius: 0; }

/* Admin Studio */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.admin-btn {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
}
.admin-btn i { font-size: 1.3rem; color: var(--primary-light); transition: all 0.3s ease; }
.admin-btn:hover {
    background: rgba(255, 107, 0,0.15);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0,0.2);
}
.admin-btn:hover i { color: var(--primary); transform: scale(1.1); }
.studio-sub-view { min-height: 100px; flex: 1; display: flex; flex-direction: column; }
.studio-action-view { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.add-sign-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.add-sign-header .btn-back { flex-shrink: 0; }
.add-sign-name { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.add-sign-name label { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; min-width: 50px; }
.add-sign-name input { flex: 1; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--card-bg); color: var(--text-main); font-family: 'Cairo', sans-serif; font-size: 0.85rem; outline: none; transition: border-color 0.3s; box-sizing: border-box; }
.add-sign-name input:focus { border-color: var(--primary); }
.add-sign-cat { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.add-sign-cat label { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; min-width: 50px; }
.add-sign-cat select { flex: 1; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--card-bg); color: var(--text-main); font-family: 'Cairo', sans-serif; font-size: 0.85rem; outline: none; transition: border-color 0.3s; box-sizing: border-box; }
.add-sign-cat select:focus { border-color: var(--primary); }
.cat-actions { display: flex; gap: 4px; flex-shrink: 0; }
.cat-btn {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--glass-border);
    background: var(--card-bg); color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; transition: all 0.3s ease;
}
.cat-btn:hover { background: rgba(255, 107, 0,0.15); border-color: var(--primary); color: var(--primary-light); }
.cat-inline-input { flex: 1; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--primary); background: var(--card-bg); color: var(--text-main); font-family: 'Cairo', sans-serif; font-size: 0.85rem; outline: none; box-sizing: border-box; }
.add-sign-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.add-card-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}
.add-card-btn i {
    font-size: 1.2rem;
    color: var(--primary-light);
}
.add-card-btn:hover {
    background: rgba(255, 107, 0,0.15);
    border-color: var(--primary);
    transform: translateY(-1px);
}
#add-view-dict-section .studio-dict-sign-item {
    cursor: pointer;
}
#add-view-dict-section .action-btn,
.studio-dict-sign-item .action-btn,
.dict-sign-row .action-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s;
}
#add-view-dict-section .action-btn:hover,
.studio-dict-sign-item .action-btn:hover,
.dict-sign-row .action-btn:hover {
    background: var(--primary-dark);
}
.studio-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: var(--text-muted);
    gap: 10px;
}
.studio-placeholder i { font-size: 2.5rem; opacity: 0.3; }
.studio-placeholder p { font-size: 0.8rem; text-align: center; }
.btn-back {
    background: var(--primary-light);
    border: 1px solid var(--primary-light);
    border-radius: 10px;
    padding: 6px 14px;
    color: white;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.75rem;
    transition: all 0.3s;
}
.btn-back:hover { border-color: var(--primary); color: #fff; }
.btn-discard {
    background: var(--primary-dark);
    color: white;
    border: 1px solid var(--primary-dark);
    border-radius: 10px;
    padding: 6px 14px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.75rem;
    transition: all 0.3s;
}
.btn-discard:hover { background: var(--primary); border-color: var(--primary); }
.studio-select-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.studio-select-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s;
}
.studio-select-item:hover { border-color: var(--primary); background: rgba(255, 107, 0,0.1); }
.studio-select-item .name { font-size: 0.85rem; font-weight: 600; }
.studio-select-item .cat { font-size: 0.65rem; color: var(--text-muted); }
.studio-select-item .action-btn {
    padding: 4px 12px;
    border-radius: 8px;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: all 0.3s;
}
.studio-select-item .action-btn.danger { background: var(--primary-dark); color: white; }
.studio-select-item .action-btn.danger:hover { background: var(--primary); }
.studio-select-item .action-btn.primary { background: var(--primary); color: white; }
.studio-select-item .action-btn.primary:hover { background: var(--primary-dark); }
.studio-select-item .action-btn.success { background: var(--primary-light); color: white; }
.studio-select-item .action-btn.success:hover { background: var(--primary); }

/* Avatar preview title inside avatar-wrapper */
.avatar-preview-title {
    position: absolute;
    top: 4px;
    right: 8px;
    left: auto;
    transform: none;
    z-index: 10;
    padding: 2px 14px;
    border-radius: 12px;
    background: rgba(255, 107, 0, 0.85);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.avatar-preview-title.has-motion {
    background: rgba(76, 175, 80, 0.85);
}

/* Avatar reset button inside avatar-wrapper */
.avatar-reset-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}
.avatar-reset-btn:hover {
    background: rgba(255, 107, 0,0.3);
    border-color: var(--primary);
    color: var(--primary-light);
    transform: rotate(-30deg);
}
.avatar-speed-control {
    position: absolute;
    bottom: 52px;
    left: 8px;
    z-index: 10;
}
.avatar-speed-control select {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    color: var(--primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.75rem;
    outline: none;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.avatar-speed-control select:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

/* Custom Confirm Dialog – centered orange popup style */
.confirm-dialog {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    padding: 20px;
}
.dark-theme .confirm-dialog {
    background: rgba(11, 15, 25, 0.65) !important;
}
.confirm-dialog-content {
    width: 280px;
    max-width: 90%;
    background: #ffffff;
    color: var(--text-main);
    border: 1.5px solid var(--primary);
    border-radius: 20px;
    padding: 22px 20px 18px 20px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 107, 0, 0.1);
    pointer-events: auto;
    animation: confirmZoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: center;
}
.dark-theme .confirm-dialog-content {
    background: #121824 !important;
    border-color: var(--primary) !important;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 107, 0, 0.2) !important;
}
.confirm-dialog-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.5;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.confirm-dialog-content p::before {
    content: '\26A0';
    font-size: 1.3rem;
    color: var(--primary);
    flex-shrink: 0;
}
.confirm-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.confirm-dialog-actions button {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 999px;
    font-size: 0.78rem;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    font-weight: 700;
    transition: filter 0.15s, transform 0.12s;
    white-space: nowrap;
}
.confirm-dialog-actions button:hover {
    filter: brightness(1.1);
}
.confirm-dialog-actions button:active {
    transform: scale(0.95);
}
#confirm-yes {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}
#confirm-no {
    background: var(--primary-light);
    color: #ffffff;
    border: 1px solid var(--primary-light);
}

@keyframes confirmZoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Training mode: fill available space (between header + bottom-nav) */
.phone-frame.has-training .app-header { display: none; }
.phone-frame.has-training .avatar-section { display: none; }
.phone-frame.has-training .studio-sub-view { display: none !important; }
.phone-frame.has-training .content-area { flex: 1; max-height: calc(100% - 62px); min-height: 0; }
.phone-frame.has-training .panels-container { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.phone-frame.has-training .admin-grid { display: none !important; }
.phone-frame.has-training .tab-panel.active { display: flex !important; flex-direction: column; flex: 1; }

/* Training dashboard mode: fill available space, hiding avatar but showing bottom nav */
/* NOTE: studio-train-dashboard-view lives INSIDE studio-sub-view, so we must NOT hide studio-sub-view here */
.phone-frame.has-train-dashboard .app-header { display: none; }
.phone-frame.has-train-dashboard .avatar-section { display: none; }
.phone-frame.has-train-dashboard .content-area { flex: 1; max-height: calc(100% - 62px); min-height: 0; overflow: hidden; }
.phone-frame.has-train-dashboard .panels-container { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.phone-frame.has-train-dashboard .admin-grid { display: none !important; }
.phone-frame.has-train-dashboard .tab-panel.active { display: flex !important; flex-direction: column; flex: 1; min-height: 0; }
.phone-frame.has-train-dashboard .studio-sub-view { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.phone-frame.has-train-dashboard #studio-placeholder { display: none !important; }
.phone-frame.has-train-dashboard #studio-train-dashboard-view { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }

/* Settings overlay view */
.phone-frame.settings-overlay-active .app-header { display: none !important; }
.phone-frame.settings-overlay-active .avatar-section { display: none !important; }
.phone-frame.settings-overlay-active .bottom-nav { display: none !important; }
.phone-frame.settings-overlay-active .content-area { flex: 1 !important; max-height: 100% !important; height: 100% !important; }
.phone-frame.settings-overlay-active .panels-container { display: flex; flex-direction: column; padding: 40px 16px 20px !important; overflow-y: auto !important; }
.phone-frame.settings-overlay-active .tab-panel.active { display: flex !important; flex-direction: column; flex: 1; min-height: 0; }


/* Training split-screen layout — normal flow within phone-frame */
.camera-container.training-split {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    background: #000;
}
.camera-container.training-split #camera-feed-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
    min-height: 0;
    position: relative;
}
.camera-container.training-split #camera-feed-wrapper video {
    display: none;
}
.camera-container.training-split #camera-feed-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.camera-container.training-split #camera-controls-area {
    background: var(--panel-bg);
    border-top: 2px solid var(--primary);
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    gap: 6px;
    align-items: stretch;
}
.camera-container.training-split #camera-controls-area .camera-controls {
    display: flex;
    flex-direction: row;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}
.camera-container.training-split #training-status-panel {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 6px 0;
}

/* Studio dictionary view */
.dict-category-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
}
.dict-category-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary-light);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}
.dict-sign-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 2px;
}
.dict-sign-row + .dict-sign-row {
    border-top: 1px solid rgba(255,255,255,0.04);
}
.dict-sign-name {
    font-size: 0.78rem;
    font-weight: 500;
}
.dict-sign-badges {
    display: flex;
    gap: 6px;
}
.dict-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap; }
.dict-category-card.clickable { cursor: pointer; }
.dict-category-card.clickable:hover { border-color: var(--primary); }
#studio-dict-categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
#studio-dict-category-detail { flex:1; overflow-y:auto; }

/* Trained/Untrained Badges - White and Orange theme */
.badge-trained { background: rgba(255, 107, 0, 0.12); color: var(--primary); border: 1px solid rgba(255, 107, 0, 0.2); }
.badge-untrained { background: rgba(255, 107, 0, 0.12); color: var(--primary-dark); border: 1px solid rgba(255, 107, 0, 0.2); }
.badge-animated { background: rgba(255, 107, 0, 0.12); color: var(--primary); border: 1px solid rgba(255, 107, 0, 0.2); }
.badge-no-anim { background: rgba(255, 107, 0, 0.12); color: var(--primary-dark); border: 1px solid rgba(255, 107, 0, 0.2); }

/* Avatar visibility in studio sub-views is managed entirely by JS (setAvatarVisibility).
   Only CSS-level hides: translate camera (full-screen), training mode, and training dashboard. */

/* Studio Subviews layouts - only active when explicitly set on .phone-frame */
.phone-frame.studio-expanded-avatar-preview .admin-grid { display: none !important; }
.phone-frame.studio-expanded-avatar-preview .avatar-section { display: block !important; height: 180px !important; flex: none !important; margin: 4px 12px !important; }
.phone-frame.studio-expanded-avatar-preview .content-area { flex: 1 !important; max-height: calc(100% - 300px) !important; min-height: 0 !important; }
.phone-frame.studio-expanded-avatar-preview .panels-container { display: flex; flex-direction: column; padding: 12px 16px 4px; overflow: hidden; }
.phone-frame.studio-expanded-avatar-preview .tab-panel.active { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.phone-frame.studio-expanded-avatar-preview .studio-sub-view { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }

.phone-frame.studio-expanded-no-avatar .avatar-section { display: none !important; }
.phone-frame.studio-expanded-no-avatar .admin-grid { display: none !important; }
.phone-frame.studio-expanded-no-avatar .content-area { flex: 1; max-height: calc(100% - 62px); min-height: 0; }
.phone-frame.studio-expanded-no-avatar .panels-container { display: flex; flex-direction: column; padding: 12px 16px 4px; overflow: hidden; }
.phone-frame.studio-expanded-no-avatar .tab-panel.active { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.phone-frame.studio-expanded-no-avatar .studio-sub-view { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }

.phone-frame.studio-expanded-with-avatar .admin-grid { display: none !important; }
.phone-frame.studio-expanded-with-avatar .avatar-section { display: block !important; height: 120px !important; flex: none !important; margin: 4px 12px !important; }
.phone-frame.studio-expanded-with-avatar .content-area { flex: 1 !important; max-height: calc(100% - 240px) !important; min-height: 0 !important; }
.phone-frame.studio-expanded-with-avatar .panels-container { display: flex; flex-direction: column; padding: 12px 16px 4px; overflow: hidden; }
.phone-frame.studio-expanded-with-avatar .tab-panel.active { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.phone-frame.studio-expanded-with-avatar .studio-sub-view { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }

/* Split layout for normal camera (Camera on top, Avatar at the bottom) */
.phone-frame.studio-camera-split {
    display: flex !important;
    flex-direction: column;
}
.phone-frame.studio-camera-split .app-header {
    display: none !important;
}
.phone-frame.studio-camera-split .avatar-section {
    order: 2 !important;
    display: block !important;
}
.phone-frame.studio-camera-split .bottom-nav {
    order: 3 !important;
    display: flex !important;
}
.phone-frame.studio-camera-split .content-area {
    order: 1 !important;
    flex: 1 !important;
    max-height: calc(100% - 186px) !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}
.phone-frame.studio-camera-split .panels-container {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    padding: 0 !important;
    overflow: hidden !important;
}
.phone-frame.studio-camera-split .tab-panel.active {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
.phone-frame.studio-camera-split .studio-sub-view {
    display: none !important; /* Hide form content while recording */
}
.phone-frame.studio-camera-split #camera-container {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    background: #000;
    border: none;
    border-radius: 0;
}
.phone-frame.studio-camera-split #camera-feed-wrapper {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    background: #000;
    min-height: 0 !important;
    position: relative !important;
}
.phone-frame.studio-camera-split #camera-feed-wrapper video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.phone-frame.studio-camera-split #camera-feed-wrapper canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
.phone-frame.studio-camera-split #camera-controls-area {
    background: var(--panel-bg) !important;
    border-top: 1px solid var(--glass-border) !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 10px 16px !important;
    gap: 6px !important;
    align-items: stretch !important;
    flex-shrink: 0 !important;
}

/* Translate camera full-screen view */
.phone-frame.translate-cam .avatar-section { display: none; }
.phone-frame.translate-cam .content-area { flex: 1; max-height: none; }
.phone-frame.translate-cam #translate { display: flex !important; flex-direction: column; flex: 1; }
.phone-frame.translate-cam #translate-camera-container { flex: 1; display: flex; flex-direction: column; padding: 0; margin: 0; border: none; border-radius: 0; }
#translate-camera-container { border: none; border-radius: 0; margin: 0; padding: 0; }
#translate-camera-container .btn-danger { margin: 4px 0 0 0; flex-shrink: 0; width: 100%; }
.phone-frame.translate-cam #translate-feed-wrapper {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    background: #000;
    min-height: 0 !important;
    position: relative !important;
}
.phone-frame.translate-cam #translate-camera-feed {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.phone-frame.translate-cam #translate-output-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
#translate-recognized-history {
    margin-top: 6px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 8px;
    flex-shrink: 0;
    max-height: 120px;
    overflow-y: auto;
}
.recognized-history-title {
    color: #aaa;
    font-size: 0.75rem;
    margin-bottom: 4px;
    text-align: center;
}
#recognized-history-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.recognized-history-item {
    color: var(--text-main);
    font-size: 0.9rem;
    padding: 3px 6px;
    background: rgba(255, 107, 0, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Pulsing hint text for cancel training */
@keyframes pulse-hint {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Close Camera Warning animations */
.warning-glow {
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.4), 0 0 20px rgba(255, 107, 0, 0.7) !important;
    border-color: var(--primary-dark) !important;
    animation: pulseGlow 1.5s infinite alternate;
}

.attention-shake {
    animation: shakeHorizontal 0.45s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3), 0 0 10px rgba(220, 38, 38, 0.5) !important;
    }
    100% {
        box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.6), 0 0 25px rgba(220, 38, 38, 0.9) !important;
    }
}

@keyframes shakeHorizontal {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Login Screen Styles */
.login-screen {
    position: absolute;
    inset: 0;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    color: var(--text-main);
    border-radius: inherit;
    padding: 30px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-card {
    width: 100%;
    max-width: 320px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}


.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.login-logo i {
    font-size: 2.8rem;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.login-logo h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}

.login-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.login-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: right;
    gap: 6px;
}

.login-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.login-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: #fff;
    color: var(--text-main);
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.3s ease;
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.login-btn {
    width: 100%;
    background: var(--primary);
    color: var(--text-main);
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    margin-top: 8px;
    min-height: 48px;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.login-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.login-error {
    color: #ffd1d1;
    font-size: 0.75rem;
    font-weight: 600;
    min-height: 18px;
    margin-top: -4px;
    text-align: center;
}

.admin-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0;
    direction: rtl;
}

.admin-login-divider::before,
.admin-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.admin-login-divider span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.admin-login-btn {
    width: 100%;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    min-height: 44px;
}

.admin-login-btn:hover {
    background: var(--glass-border);
    color: var(--text-main);
}

.admin-back-btn {
    width: 100%;
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    margin-top: -4px;
}

.admin-back-btn:hover {
    color: var(--text-main);
    background: var(--glass-border);
}

.light-theme .admin-login-btn {
    background: transparent !important;
    border-color: rgba(255, 107, 0, 0.12) !important;
    color: #8C6A5C !important;
}

.light-theme .admin-login-btn:hover {
    background: rgba(255, 107, 0, 0.06) !important;
    color: var(--primary) !important;
}

.light-theme .admin-back-btn {
    color: #8C6A5C !important;
}

.light-theme .admin-back-btn:hover {
    color: var(--primary) !important;
    background: rgba(255, 107, 0, 0.06) !important;
}

.about-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.3s;
}

.about-trigger:hover {
    color: var(--primary);
}

.about-trigger i {
    margin-left: 6px;
}

#about-arrow {
    transition: transform 0.3s;
    font-size: 0.75rem;
    color: var(--text-muted);
}

#about-arrow.open {
    transform: rotate(180deg);
}

.about-text {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 4px;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-muted);
    text-align: justify;
}

.about-text.open {
    max-height: 300px;
    padding: 12px 4px 8px;
}

.light-theme .about-trigger {
    color: #806553 !important;
}

.light-theme .about-trigger:hover {
    color: var(--primary) !important;
}

.light-theme .about-text {
    color: #8C6A5C !important;
}

/* Force text inputs, textareas, and select elements to be Dark Slate with White Text in Dark Theme */
.dark-theme input[type="text"],
.dark-theme input[type="password"],
.dark-theme textarea,
.dark-theme select,
.dark-theme select.glass-select,
.dark-theme .login-input,
.dark-theme #record-metadata input,
.dark-theme #record-metadata select {
    background: #1E293B !important;
    color: #F8FAFC !important;
    border: 1px solid rgba(255, 107, 0, 0.3) !important;
}

.dark-theme input::placeholder,
.dark-theme textarea::placeholder {
    color: #94A3B8 !important;
}

/* Force text inputs, textareas, and select elements to be White with Dark Text in Light Theme */
.light-theme input[type="text"],
.light-theme input[type="password"],
.light-theme textarea,
.light-theme select,
.light-theme select.glass-select,
.light-theme .login-input,
.light-theme #record-metadata input,
.light-theme #record-metadata select {
    background: #FFFFFF !important;
    color: #2E1505 !important;
    border: 1px solid rgba(255, 107, 0, 0.15) !important;
}

.light-theme input::placeholder,
.light-theme textarea::placeholder {
    color: #8C6A5C !important;
}

/* Button overrides for light mode to match cream background and stand out with dark orange */
.light-theme .btn-glow {
    background: var(--primary) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2) !important;
}
.light-theme .btn-glow:hover {
    background: var(--primary-dark) !important;
    color: #FFFFFF !important;
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.3) !important;
}

.light-theme .btn-secondary {
    background: #FFF8F3 !important;
    color: var(--primary) !important;
    border: 1px solid rgba(255, 107, 0, 0.15) !important;
}
.light-theme .btn-secondary:hover {
    background: var(--primary) !important;
    color: #FFFFFF !important;
    border-color: var(--primary) !important;
}

.light-theme .btn-danger {
    background: #DC2626 !important;
    color: #FFFFFF !important;
    border: 1px solid #DC2626 !important;
}
.light-theme .btn-danger:hover {
    background: #B91C1C !important;
    border-color: #B91C1C !important;
}

.light-theme .btn-outline {
    background: var(--primary) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2) !important;
}
.light-theme .btn-outline:hover {
    background: var(--primary-dark) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.3) !important;
}

.light-theme .admin-btn {
    background: #FFFFFF !important;
    border: 1px solid rgba(255, 107, 0, 0.12) !important;
    color: var(--text-main) !important;
}
.light-theme .admin-btn i {
    color: var(--primary) !important;
}
.light-theme .admin-btn:hover {
    background: var(--primary) !important;
    color: #FFFFFF !important;
    border-color: var(--primary) !important;
}
.light-theme .admin-btn:hover i {
    color: #FFFFFF !important;
}

.light-theme .login-btn {
    background: var(--primary) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2) !important;
}
.light-theme .login-btn:hover {
    background: var(--primary-dark) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.3) !important;
}

.light-theme .nav-item {
    color: #806553 !important;
}
.light-theme .nav-item.active {
    color: var(--primary) !important;
}
.light-theme .nav-item.active::before {
    background: var(--primary) !important;
}
.light-theme .nav-item.active i {
    filter: drop-shadow(0 0 6px rgba(255, 107, 0, 0.4)) !important;
}

.light-theme .divider::before,
.light-theme .divider::after {
    background: rgba(255, 107, 0, 0.15) !important;
}

.light-theme .glass-card {
    background: #FFFFFF !important;
    border-color: rgba(255, 107, 0, 0.1) !important;
    color: var(--text-main) !important;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.03) !important;
}
.light-theme .glass-card.interactive:hover {
    background: #FFF8F3 !important;
    border-color: var(--primary) !important;
}
.light-theme .glass-card .card-icon {
    background: #FFF8F3 !important;
    color: var(--primary) !important;
}
.light-theme .glass-card.small {
    background: #FFFFFF !important;
    border-color: rgba(255, 107, 0, 0.1) !important;
}
.light-theme .glass-card.small:hover {
    background: #FFF8F3 !important;
    border-color: var(--primary) !important;
}
.light-theme .glass-card.small i {
    color: var(--primary) !important;
}

.light-theme .voice-btn {
    background: var(--primary) !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.25) !important;
}
.light-theme .voice-btn.listening {
    background: #DC2626 !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5) !important;
}

.light-theme .logo-row i {
    color: var(--primary) !important;
    filter: drop-shadow(0 0 6px rgba(255, 107, 0, 0.3)) !important;
}
.light-theme .logo-row h1 {
    color: var(--text-main) !important;
}
.light-theme .app-header .badge {
    background: var(--primary) !important;
    color: #FFFFFF !important;
}
.light-theme .avatar-section {
    background: #FFFFFF !important;
    border: 1px solid rgba(255, 107, 0, 0.12) !important;
}

/* ============================================
   Studio Restructure Styles
   ============================================ */

/* Studio section tabs */
.studio-section-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    padding: 0 4px;
}
.studio-section-btn {
    flex: 1;
    padding: 8px 4px;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.3s;
}
.studio-section-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.studio-section-btn i { margin-left: 4px; }
.studio-section-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Dictionary Manager */
.dict-mgr-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.dict-mgr-actions button {
    flex: 1;
    padding: 12px 14px;
    font-size: 0.85rem;
}

/* Status filter bar */
.dict-status-filter {
    display: flex;
    gap: 3px;
    margin-bottom: 6px;
    overflow-x: auto;
    padding: 2px 0;
}
.filter-btn {
    padding: 4px 10px;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    color: var(--text-muted);
    border-radius: 14px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s;
}
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Sign status badges */
.sign-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.58rem;
    font-weight: 700;
    white-space: nowrap;
    width: fit-content;
}
.badge-draft { background: #6B7280; color: #fff; }
.badge-motion_added { background: #F59E0B; color: #fff; }
.badge-trained { background: #3B82F6; color: #fff; }
.badge-published { background: #10B981; color: #fff; }
.status-complete { background: #10B981; color: #fff; }
.status-needs-train { background: #3B82F6; color: #fff; }
.status-needs-motion { background: #F59E0B; color: #fff; }
.status-empty { background: #6B7280; color: #fff; }

/* Sign card in dictionary manager */
.dict-mgr-sign-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 4px;
    gap: 6px;
}
.dict-mgr-sign-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.dict-mgr-sign-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
}
.dict-mgr-sign-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}
.dict-mgr-sign-actions button {
    padding: 3px 8px;
    font-size: 0.6rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: all 0.2s;
}
.dict-mgr-sign-actions .act-edit { background: var(--primary); color: #fff; }
.dict-mgr-sign-actions .act-delete { background: #EF4444; color: #fff; }
.dict-mgr-sign-actions .act-add-motion { background: #F59E0B; color: #fff; }
.dict-mgr-sign-actions .act-train { background: #3B82F6; color: #fff; }
.dict-mgr-sign-actions .act-publish { background: #10B981; color: #fff; }
.dict-mgr-sign-actions .act-retrain { background: #8B5CF6; color: #fff; }
.dict-mgr-sign-actions .act-unpublish { background: #6B7280; color: #fff; }

/* Category card */
.dict-mgr-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.3s;
}
.dict-mgr-cat-item:hover {
    border-color: var(--primary);
}
.dict-mgr-cat-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}
.dict-mgr-cat-count {
    font-size: 0.65rem;
    color: var(--text-muted);
}
.dict-mgr-cat-actions {
    display: flex;
    gap: 4px;
}
.dict-mgr-cat-actions button {
    padding: 3px 8px;
    font-size: 0.6rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.2s;
}

/* Add sign form */
.add-sign-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}
.add-sign-form label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 2px;
    display: block;
}
.add-sign-form input,
.add-sign-form select,
.add-sign-form textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: 'Cairo', sans-serif;
    font-size: 0.78rem;
}
.add-sign-form textarea {
    resize: vertical;
    min-height: 50px;
}

/* Avatar Library */
.avatar-lib-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.avatar-lib-actions button {
    flex: 1;
    padding: 8px;
    font-size: 0.7rem;
    min-width: 80px;
}
.avatar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 12px;
    justify-content: center;
    overflow-y: auto;
    flex: 1;
    align-content: flex-start;
}
.avatar-card {
    width: 160px;
    height: 220px;
    background: var(--card-bg);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    overflow: hidden;
}
.avatar-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(255,107,0,0.2);
}
.avatar-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(255,107,0,0.35);
}
.avatar-card-preview {
    flex: 1;
    min-height: 150px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px 14px 0 0;
    position: relative;
    overflow: hidden;
}
.avatar-card-preview::before {
    content: '\f007';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 2.5rem;
    color: rgba(255,255,255,0.1);
    position: absolute;
}
.avatar-card-preview[style*="background-image"]::before {
    display: none;
}
.avatar-card-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    padding: 8px 4px;
    word-break: break-word;
    background: rgba(0,0,0,0.2);
}

/* Add sign actions */
.add-sign-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.add-sign-motion-options button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Studio Main Menu */
.studio-main-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 8px;
    flex: 1;
    justify-content: center;
    align-content: flex-start;
}
.studio-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}
.studio-stat-card {
    background: #fff;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: border-color 0.2s;
}
.dark-theme .studio-stat-card {
    background: var(--card-bg);
}
.studio-stat-card .stat-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}
.studio-stat-card .stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
}
.studio-menu-btn {
    flex: 1;
    max-width: 180px;
    padding: 20px 12px;
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 16px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255,107,0,0.3);
}
.studio-menu-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,0,0.4);
}

/* Studio Full Views */
.studio-full-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.dict-mgr-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Inline Add Category */
.add-cat-inline {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px 4px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}
.add-cat-inline input {
    flex: 1;
    min-width: 0;
}

/* Category Item in Dict Manager */
.dict-mgr-cat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 12px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.dict-mgr-cat-item:hover {
    border-color: var(--primary);
}
.dict-mgr-cat-item .cat-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}
.dict-mgr-cat-item .cat-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 4px;
}
.dict-mgr-cat-item .cat-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.cat-action-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.65rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.2s;
}
.cat-action-btn.edit-cat {
    background: rgba(59,130,246,0.15);
    color: #3B82F6;
}
.cat-action-btn.delete-cat {
    background: rgba(239,68,68,0.15);
    color: #EF4444;
}

/* Sign Item in Category Detail */
.dict-mgr-sign-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 14px 16px !important;
    background: var(--card-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    margin-bottom: 8px !important;
    flex-wrap: nowrap !important;
}
.dict-mgr-sign-item .sign-name {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
}
.dict-mgr-sign-item .sign-actions {
    display: flex !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    align-items: center !important;
}
.dict-mgr-sign-item .sign-action-btn {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    border: none !important;
    background: transparent !important;
    color: var(--text-main) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background-color 0.2s, opacity 0.2s !important;
    font-size: 0.9rem !important;
    box-shadow: none !important;
}
.dict-mgr-sign-item .sign-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    opacity: 0.8 !important;
}
.light-theme .dict-mgr-sign-item .sign-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}
