/* ==========================================================================
   TERMINAL MOBILE — Touch-optimized CRT terminal for phones/tablets
   Imports shared retro-terminal.css, overrides for mobile viewport
   ========================================================================== */

/* ── Base: Full viewport flex layout ── */
html.terminal-mobile {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

body.terminal-mobile-body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: #050508 !important;
    display: flex !important;
    flex-direction: column !important;
    line-height: normal !important;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

/* ── Mobile monitor container ── */
.mobile-term-viewport {
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2px;
}

/* ── CRT Monitor mobile overrides ── */
.mobile-term-viewport .retro-monitor {
    width: 100%;
    padding: 2px 2px 1px;
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.mobile-term-viewport .retro-monitor-bezel {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 3px;
    width: 100%;
    max-width: 100%;
    border-radius: 6px 6px 4px 4px;
}

.mobile-term-viewport .retro-monitor-screen {
    flex: 1 1 0%;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-term-viewport .kilde-terminal-container {
    flex: 1 1 0%;
    min-height: 0;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden;
}

/* Hide stand/base/plaque on mobile to save vertical space */
.mobile-term-viewport .retro-monitor-stand,
.mobile-term-viewport .retro-monitor-base,
.mobile-term-viewport .retro-monitor-plaque {
    display: none !important;
}

/* Smaller label */
.mobile-term-viewport .retro-monitor-label {
    font-size: 6px;
    top: 2px;
    right: 8px;
}

/* ── Chin adjustments for mobile — compact ── */
.mobile-term-viewport .retro-monitor-chin {
    padding: 2px 4px 2px;
    gap: 4px;
    flex-wrap: nowrap;
    min-height: 0;
}

/* Hide knobs and vents on mobile — too small to be useful */
.mobile-term-viewport .retro-monitor-controls,
.mobile-term-viewport .retro-monitor-vents {
    display: none;
}

/* Enlarge theme dots for touch */
.mobile-term-viewport .theme-dot {
    width: 20px;
    height: 20px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-term-viewport .theme-dot.active {
    transform: none;
    box-shadow: 0 0 6px currentColor, 0 0 12px currentColor;
}

.mobile-term-viewport .retro-theme-dots {
    gap: 2px;
}

/* ── Pimped-up chin brand ── */
.mobile-term-viewport .chin-brand {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 8px;
}

.mobile-term-viewport .chin-logo {
    font-size: 10px;
    filter: drop-shadow(0 0 3px rgba(0, 255, 249, 0.5));
}

.mobile-term-viewport .chin-skn {
    font-weight: 700;
    color: #00fff9;
    text-shadow: 0 0 4px rgba(0, 255, 249, 0.6), 0 0 10px rgba(0, 255, 249, 0.3);
    letter-spacing: 1.5px;
}

.mobile-term-viewport .chin-skn.chin-k {
    color: #ff00ff;
    text-shadow: 0 0 4px rgba(255, 0, 255, 0.6), 0 0 10px rgba(255, 0, 255, 0.3);
}

.mobile-term-viewport .chin-ver {
    color: #39ff14;
    font-weight: 400;
    font-size: 7px;
    text-shadow: 0 0 3px rgba(57, 255, 20, 0.4);
}

.mobile-term-viewport .chin-tag {
    color: #ffb000;
    font-size: 6px;
    letter-spacing: 1px;
    text-shadow: 0 0 3px rgba(255, 176, 0, 0.4);
}

.mobile-term-viewport .chin-sep {
    height: 6px;
}

/* ── Mouse mode, Paste, Help buttons in chin ── */
.tb-mouse-toggle,
.tb-paste-btn,
.tb-help-btn {
    min-width: 28px !important;
    min-height: 24px !important;
    padding: 2px 4px !important;
    font-size: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}

.tb-paste-btn:active {
    border-color: #00fff9;
    background: rgba(0, 255, 249, 0.12);
    box-shadow: 0 0 6px rgba(0, 255, 249, 0.3);
}

.tb-mouse-toggle.active {
    border-color: #39ff14;
    background: rgba(57, 255, 20, 0.12);
    box-shadow: 0 0 6px rgba(57, 255, 20, 0.3);
}

/* Mouse mode active indicator on terminal */
.mouse-mode-active {
    outline: 1px solid rgba(57, 255, 20, 0.2);
    outline-offset: -1px;
}

/* ── Back button mobile ── */
.mobile-back-btn {
    position: absolute;
    top: 2px;
    left: 2px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 6px 10px;
    color: rgba(255, 255, 255, 0.25);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: all 0.2s;
    min-width: 44px;
    min-height: 36px;
}

.mobile-back-btn:active {
    color: #00fff9;
    background: rgba(0, 255, 249, 0.1);
}

/* ==========================================================================
   SPECIAL KEYS TOOLBAR
   ========================================================================== */

.mobile-toolbar {
    flex-shrink: 0;
    background: #0d0d14;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3px 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 10;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.toolbar-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    justify-content: center;
    align-items: center;
}

.toolbar-row.hidden {
    display: none;
}

/* Slide-in animation for toggled rows */
.toolbar-row.slide-in {
    animation: toolbarSlideIn 200ms ease-out;
}

@keyframes toolbarSlideIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ── Toolbar buttons ── */
.tb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.tb-btn:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.95);
}

/* Arrow keys — slightly wider */
.tb-btn.tb-arrow {
    min-width: 40px;
    font-size: 14px;
}

/* Fn key row buttons — smaller */
.tb-btn.tb-fn {
    min-width: 32px;
    font-size: 9px;
    padding: 4px 3px;
    flex: 1;
    max-width: 48px;
}

/* Symbols row buttons */
.tb-btn.tb-sym {
    min-width: 34px;
    font-size: 12px;
    flex: 1;
    max-width: 48px;
}

/* ── Sticky modifier states ── */
.tb-btn.tb-modifier.active {
    color: #00fff9;
    border-color: #00fff9;
    background: rgba(0, 255, 249, 0.12);
    box-shadow: 0 0 6px rgba(0, 255, 249, 0.3), inset 0 0 4px rgba(0, 255, 249, 0.1);
}

/* ── Click mode toggle states ── */
.tb-btn.tb-mode.active {
    color: #ff00ff;
    border-color: #ff00ff;
    background: rgba(255, 0, 255, 0.12);
    box-shadow: 0 0 6px rgba(255, 0, 255, 0.3), inset 0 0 4px rgba(255, 0, 255, 0.1);
}

/* ── Toggle buttons (Fn, ...) ── */
.tb-btn.tb-toggle {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
}

.tb-btn.tb-toggle.active {
    color: #ffb000;
    border-color: rgba(255, 176, 0, 0.4);
    background: rgba(255, 176, 0, 0.08);
}

/* ── Spacer between button groups ── */
.tb-spacer {
    width: 4px;
    flex-shrink: 0;
}

/* ==========================================================================
   GESTURE TOAST NOTIFICATIONS
   ========================================================================== */

.gesture-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 20, 0.92);
    border: 1px solid rgba(0, 255, 249, 0.2);
    border-radius: 8px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.5px;
    z-index: 100;
    pointer-events: none;
    white-space: nowrap;
    animation: toastFade 2.5s ease-out forwards;
}

@keyframes toastFade {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
    10% { opacity: 1; transform: translateX(-50%) translateY(0); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-5px); }
}

.gesture-toast .toast-icon {
    margin-right: 6px;
    color: #00fff9;
}

/* ==========================================================================
   ROTATE HINT OVERLAY
   ========================================================================== */

.rotate-hint {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(5, 5, 8, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    animation: rotateHintFade 3s ease-out forwards;
    pointer-events: none;
}

@keyframes rotateHintFade {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

.rotate-hint-icon {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(0, 255, 249, 0.4);
    border-radius: 8px;
    position: relative;
    animation: rotatePhone 1.5s ease-in-out infinite;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.rotate-hint-icon::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 2px;
    background: rgba(0, 255, 249, 0.3);
    border-radius: 1px;
}

.rotate-hint-text {
    color: rgba(255, 255, 255, 0.5);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
}

/* ==========================================================================
   PWA INSTALL BANNER
   ========================================================================== */

.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 50%, #1a1a2e 100%);
    border-top: 2px solid rgba(0, 255, 249, 0.3);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    animation: pwaSlideUp 300ms ease-out;
}

@keyframes pwaSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.pwa-install-banner.hiding {
    animation: pwaSlideDown 200ms ease-in forwards;
}

@keyframes pwaSlideDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

.pwa-banner-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
}

.pwa-banner-title {
    color: #00fff9;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.pwa-banner-desc {
    color: rgba(255, 255, 255, 0.5);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    line-height: 1.4;
}

.pwa-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-btn {
    padding: 8px 14px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    min-height: 36px;
    touch-action: manipulation;
}

.pwa-btn-install {
    background: rgba(0, 255, 249, 0.15);
    border: 1px solid rgba(0, 255, 249, 0.4);
    color: #00fff9;
}

.pwa-btn-install:active {
    background: rgba(0, 255, 249, 0.25);
}

.pwa-btn-dismiss {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.4);
}

.pwa-btn-dismiss:active {
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   CONTEXT MENU (Long-press)
   ========================================================================== */

.mobile-context-menu {
    position: fixed;
    z-index: 300;
    background: #1a1a2e;
    border: 1px solid rgba(0, 255, 249, 0.2);
    border-radius: 8px;
    padding: 4px 0;
    min-width: 140px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 255, 249, 0.05);
    animation: ctxMenuIn 150ms ease-out;
}

@keyframes ctxMenuIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.ctx-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.5px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    min-height: 40px;
    touch-action: manipulation;
}

.ctx-menu-item:active {
    background: rgba(0, 255, 249, 0.08);
    color: #00fff9;
}

.ctx-menu-item .ctx-icon {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.ctx-menu-sep {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 2px 8px;
}

/* ==========================================================================
   MOBILE HEADER BAR
   ========================================================================== */

.mobile-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: rgba(10, 10, 20, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    min-height: 32px;
    z-index: 10;
}

.mobile-header-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(0, 255, 249, 0.3);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.mobile-header-back {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 6px 8px;
    min-width: 44px;
    min-height: 36px;
    border-radius: 4px;
}

.mobile-header-back:active {
    background: rgba(255, 255, 255, 0.05);
    color: #00fff9;
}

.mobile-header-settings {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 14px;
    padding: 6px 8px;
    min-width: 44px;
    min-height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
}

.mobile-header-settings:active {
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   CONNECTION LED override for mobile
   ========================================================================== */

.mobile-term-viewport #connectionLed.connected {
    background: #00fff9;
    box-shadow: 0 0 4px #00fff9, 0 0 8px rgba(0, 255, 249, 0.4);
}

/* ==========================================================================
   SETTINGS PANEL
   ========================================================================== */

.mobile-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(5, 5, 8, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 150ms ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mobile-settings-panel {
    background: #1a1a2e;
    border: 1px solid rgba(0, 255, 249, 0.15);
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-settings-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #00fff9;
    letter-spacing: 1px;
    text-align: center;
}

.mobile-settings-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-settings-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.mobile-settings-link {
    display: block;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-align: center;
    min-height: 40px;
    line-height: 20px;
}

.mobile-settings-link:active {
    background: rgba(255, 255, 255, 0.08);
}

.mobile-settings-close {
    padding: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    cursor: pointer;
    min-height: 40px;
}

.mobile-settings-close:active {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   ENTER / BACKSPACE buttons — highlighted for visibility
   ========================================================================== */

.tb-btn.tb-enter {
    background: rgba(57, 255, 20, 0.1);
    border-color: rgba(57, 255, 20, 0.2);
    color: #39ff14;
    font-size: 14px;
}

.tb-btn.tb-essential[data-action="bksp"] {
    font-size: 14px;
    color: rgba(255, 85, 85, 0.7);
}

/* ==========================================================================
   HELP POPUP
   ========================================================================== */

.mobile-help-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(5, 5, 8, 0.95);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
    animation: fadeIn 150ms ease-out;
}

.mobile-help-panel {
    background: linear-gradient(180deg, #1a1a2e 0%, #12121f 100%);
    border: 1px solid rgba(0, 255, 249, 0.15);
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: auto 0;
}

.help-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #00fff9;
    text-align: center;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(0, 255, 249, 0.4);
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0, 255, 249, 0.1);
}

.help-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.help-section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #ff00ff;
    letter-spacing: 0.5px;
    text-shadow: 0 0 4px rgba(255, 0, 255, 0.3);
}

.help-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    padding-left: 4px;
}

.help-item strong {
    color: rgba(255, 255, 255, 0.9);
}

.help-item code {
    background: rgba(0, 255, 249, 0.08);
    border: 1px solid rgba(0, 255, 249, 0.15);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 10px;
    color: #00fff9;
}

.help-item kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'JetBrains Mono', monospace;
}

.help-item.help-tip {
    background: rgba(255, 176, 0, 0.06);
    border-left: 2px solid rgba(255, 176, 0, 0.3);
    padding: 4px 8px;
    border-radius: 0 4px 4px 0;
    margin-top: 4px;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

.help-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.help-table td {
    padding: 4px 6px;
    color: rgba(255, 255, 255, 0.6);
    vertical-align: top;
}

.help-table .help-gesture {
    color: #00fff9;
    white-space: nowrap;
    width: 1%;
    font-weight: 600;
}

.help-close-btn {
    padding: 12px;
    background: linear-gradient(135deg, rgba(0, 255, 249, 0.12), rgba(255, 0, 255, 0.08));
    border: 1px solid rgba(0, 255, 249, 0.3);
    border-radius: 8px;
    color: #00fff9;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    min-height: 44px;
    text-align: center;
    text-shadow: 0 0 6px rgba(0, 255, 249, 0.4);
    transition: all 0.2s;
}

.help-close-btn:active {
    background: linear-gradient(135deg, rgba(0, 255, 249, 0.2), rgba(255, 0, 255, 0.15));
    transform: scale(0.98);
}

/* Hide global elements on mobile terminal page */
body.terminal-mobile-body .offline-banner,
body.terminal-mobile-body .sw-status,
body.terminal-mobile-body .cookie-popup,
body.terminal-mobile-body .whatsapp-float,
body.terminal-mobile-body .code-refs-widget {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   CAST / STREAM POPUP
   ═══════════════════════════════════════════════════════════════ */

.mobile-cast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    backdrop-filter: blur(4px);
}

.mobile-cast-panel {
    background: #0f1118;
    border: 1px solid #00fff933;
    border-radius: 12px;
    padding: 20px;
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0,255,249,0.1);
}

.cast-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #00fff9;
    text-align: center;
    margin-bottom: 4px;
}

.cast-subtitle {
    font-size: 12px;
    color: #8892b0;
    text-align: center;
    margin-bottom: 16px;
}

.cast-section {
    margin-bottom: 12px;
}

.cast-section-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #ccd6f6;
    margin-bottom: 6px;
}

.cast-desc {
    font-size: 12px;
    color: #8892b0;
    margin: 0 0 8px;
    line-height: 1.4;
}

.cast-note {
    font-size: 10px;
    color: #5a6785;
    margin: 6px 0 0;
    font-style: italic;
}

.cast-action-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cast-action-btn.cast-start {
    background: linear-gradient(135deg, #00fff922, #00fff911);
    border: 1px solid #00fff944;
    color: #00fff9;
}
.cast-action-btn.cast-start:active {
    background: #00fff933;
    transform: scale(0.98);
}

.cast-action-btn.cast-stop {
    background: linear-gradient(135deg, #ff555522, #ff555511);
    border: 1px solid #ff555544;
    color: #ff5555;
}
.cast-action-btn.cast-stop:active {
    background: #ff555533;
}

.cast-steps {
    padding: 4px 0 4px 8px;
}

.cast-step {
    font-size: 12px;
    color: #a8b2d1;
    padding: 3px 0;
    line-height: 1.4;
}

.cast-step strong {
    color: #ccd6f6;
}

.cast-divider {
    height: 1px;
    background: #1e2640;
    margin: 14px 0;
}

.cast-protocols {
    margin-bottom: 16px;
}

.cast-protocol-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.cast-protocol {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    padding: 4px 6px;
    background: #0a0e17;
    border-radius: 6px;
    border: 1px solid #1e264033;
}

.cast-proto-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.cast-proto-name {
    color: #ccd6f6;
    font-weight: 500;
    flex-shrink: 0;
}

.cast-proto-status {
    font-size: 9px;
    margin-left: auto;
    white-space: nowrap;
}

.cast-proto-status.cast-yes {
    color: #50fa7b;
}

.cast-proto-status.cast-na {
    color: #5a6785;
}

.cast-unavailable {
    opacity: 0.5;
}

/* Cast button glow when casting */
.tb-cast-btn.casting {
    color: #00fff9 !important;
    text-shadow: 0 0 8px #00fff9;
    animation: castPulse 2s ease-in-out infinite;
}
@keyframes castPulse {
    0%, 100% { text-shadow: 0 0 4px #00fff9; }
    50% { text-shadow: 0 0 12px #00fff9, 0 0 20px #00fff966; }
}
