/* BoxUpdater UI - Dashboard Layout */

/* Main layout structure */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 20px;
    background: var(--color-header);
    color: white;
    flex-shrink: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.navbar-brand img {
    height: 28px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-username {
    font-size: 14px;
    opacity: 0.9;
}

.navbar-logout {
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}

.navbar-logout:hover {
    background: rgba(255,255,255,0.25);
}

/* Main content wrapper */
.main-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--color-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.2s ease;
}

.sidebar.collapsed {
    width: 56px;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-toggle button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
}

.sidebar-toggle button:hover {
    color: white;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.menu-item.active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-left-color: var(--color-primary);
}

.menu-item-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.menu-item-text {
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .menu-item-text {
    display: none;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 12px;
}

.menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 8px 12px;
}

/* Content area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tab ribbon */
.tab-ribbon {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 20px;
    background: white;
    border-bottom: 1px solid var(--color-border);
    height: 42px;
    flex-shrink: 0;
}

.tab-ribbon.hidden {
    display: none;
}

.tab-item {
    padding: 10px 16px;
    color: var(--color-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.tab-item:hover {
    color: var(--color-text);
}

.tab-item.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Content panels */
.content-panels {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* Panel header */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.panel-header h2 {
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: 8px;
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Stat cards */
.stat-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
}

.stat-card-label {
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--color-text);
}

.stat-card-sub {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Box list */
.box-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.box-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.box-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.box-item-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.box-item-icon {
    width: 44px;
    height: 44px;
    background: var(--color-app-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.box-item-details h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
}

.box-item-details p {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

.box-item-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.box-item-actions {
    display: flex;
    gap: 8px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal.modal-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-app-bg);
}

/* Search bar */
.search-bar {
    position: relative;
    max-width: 300px;
}

.search-bar input {
    padding-left: 36px;
}

.search-bar-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Command panel */
.command-panel {
    background: #1E293B;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
}

.command-input {
    display: flex;
    gap: 8px;
}

.command-input input {
    flex: 1;
    background: #0F172A;
    border: 1px solid #334155;
    color: #E2E8F0;
    font-family: inherit;
}

.command-input input:focus {
    border-color: var(--color-primary);
}

.command-output {
    margin-top: 12px;
    padding: 12px;
    background: #0F172A;
    border-radius: 4px;
    color: #94A3B8;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Login page specific */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-header) 0%, var(--color-sidebar) 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    margin: 0 0 8px 0;
    color: var(--color-header);
}

.login-header p {
    margin: 0;
    color: var(--color-text-muted);
}

.login-form .form-row {
    margin-bottom: 20px;
}

.login-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

.login-error {
    background: #FEE2E2;
    color: #991B1B;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.login-error.show {
    display: block;
}

/* App list styles */
.app-tabs {
    display: flex;
    gap: 8px;
}

.app-list {
    max-height: 300px;
    overflow-y: auto;
}

.app-table {
    width: 100%;
    font-size: 13px;
}

.app-table th,
.app-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.app-table th {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.app-name {
    font-weight: 500;
}

.app-package {
    font-size: 11px;
    word-break: break-all;
}

.app-actions {
    white-space: nowrap;
}

.app-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
}

.app-actions .btn-warning {
    background: #FEF3C7;
    color: #92400E;
}

/* Deploy APK Tree View */
.deploy-group {
    margin-bottom: 4px;
}

/* Command target tree: compact rows so more groups fit without scrolling */
#cmdSourceTree .deploy-group { margin-bottom: 0; }
#cmdSourceTree .deploy-group-header { padding: 2px 6px; }
#cmdSourceTree .deploy-box-item { padding: 2px 6px; }

.deploy-group-header {
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.deploy-group-header:hover {
    background: #f0f0f0;
}

.deploy-group-header .expand-icon {
    font-size: 10px;
    width: 14px;
    color: #666;
}

.deploy-box-item {
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.deploy-box-item:hover {
    background: #e8f5e9;
}

.deploy-target-item:hover {
    opacity: 0.8;
}

/* ========== Apps Split Pane Layout ========== */
.apps-split-container {
    display: flex;
    gap: 16px;
    min-height: 400px;
}

.apps-list-pane {
    flex: 0 0 350px;
    border-right: 1px solid var(--color-border);
    padding-right: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.apps-viewer-pane {
    flex: 1;
    min-width: 0;
    overflow: auto;
}

.app-list-container {
    flex: 1;
    overflow-y: auto;
    max-height: 600px;
}

.app-list-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.app-list-item:hover {
    background: var(--color-app-bg);
    border-color: var(--color-border);
}

.app-list-item.selected {
    background: #E3F2FD;
    border-color: var(--color-primary);
}

.app-list-item-info {
    flex: 1;
    min-width: 0;
}

.app-list-item-info .app-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-list-item-info .app-package {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-list-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.app-action-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.app-action-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.app-version {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* App Viewer Placeholder */
.app-viewer-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    color: var(--color-text-muted);
}

/* App Viewer Header */
.app-viewer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.app-viewer-title h4 {
    margin: 0 0 4px 0;
}

.app-viewer-title span {
    font-size: 12px;
    word-break: break-all;
}

.app-viewer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.app-viewer-actions .btn {
    white-space: nowrap;
}

/* App Viewer Content */
.app-viewer-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.app-viewer-section h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.app-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.app-info-grid div {
    display: flex;
    gap: 8px;
}

.app-info-grid label {
    font-weight: 500;
    color: var(--color-text-muted);
}

/* App Settings Header */
.app-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.app-settings-header h5 {
    margin: 0;
}

/* Settings File Groups */
.settings-file-group {
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.settings-file-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--color-app-bg);
    cursor: pointer;
    user-select: none;
}

.settings-file-header:hover {
    background: #e8e8e8;
}

.settings-file-header .expand-icon {
    font-size: 10px;
    width: 14px;
    color: #666;
}

.settings-file-content {
    padding: 0;
}

/* Settings Table */
.settings-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.settings-table th,
.settings-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.settings-table th {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    background: #fafafa;
}

.settings-table tr:last-child td {
    border-bottom: none;
}

.setting-name {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    word-break: break-all;
}

.setting-value {
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.setting-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    min-width: 0;
}

.setting-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.setting-save-btn {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 12px;
}

.setting-textarea {
    min-height: 60px;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.setting-actions {
    width: 50px;
    text-align: center;
}

/* Setting Type Badges */
.setting-type {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.setting-type-string {
    background: #E3F2FD;
    color: #1565C0;
}

.setting-type-int,
.setting-type-long {
    background: #E8F5E9;
    color: #2E7D32;
}

.setting-type-float {
    background: #FFF3E0;
    color: #E65100;
}

.setting-type-boolean {
    background: #F3E5F5;
    color: #7B1FA2;
}

/* App Info Bar - Condensed app info */
.app-info-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 12px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 12px;
}

/* Manila Folder Tabs */
.manila-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    border-bottom: 2px solid var(--color-border);
    position: relative;
}

.manila-tab {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    color: var(--color-text-muted);
    transition: all 0.15s ease;
    position: relative;
    top: 2px;
}

.manila-tab:hover {
    background: #eaeaea;
}

.manila-tab.active {
    background: var(--color-surface-bg);
    color: var(--color-primary);
    border-color: var(--color-border);
    border-bottom: 2px solid var(--color-surface-bg);
    z-index: 1;
}

.manila-tab-content {
    background: var(--color-surface-bg);
    padding: 16px 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Commands card: Box Commands / Launcher Commands panes. Separate class from
   .tab-pane so the app viewer's tab switcher cannot toggle these. */
.box-cmd-pane {
    display: none;
}

.box-cmd-pane.active {
    display: block;
}

.tab-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

/* Permissions Styles */
.permissions-section {
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.permissions-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 13px;
}

.permissions-section-header:hover {
    background: #eef0f2;
}

.permissions-section-content {
    padding: 0;
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.permissions-table th,
.permissions-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.permissions-table th {
    background: #fafafa;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.permissions-table tr:last-child td {
    border-bottom: none;
}

.permissions-table tr:hover td {
    background: #f9fafb;
}

.perm-name {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Diagnostic Toggle in Card Header */
.diagnostic-toggle {
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .apps-split-container {
        flex-direction: column;
    }

    .apps-list-pane {
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding-right: 0;
        padding-bottom: 16px;
        max-height: 250px;
    }

    .app-list-container {
        max-height: 200px;
    }
}

/* Hold-to-action button (e.g., uninstall) */
.hold-btn {
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.hold-btn-text {
    position: relative;
    z-index: 1;
}

.hold-btn-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.3);
    transition: none;
    z-index: 0;
}

.hold-btn:active .hold-btn-progress {
    background: rgba(255, 255, 255, 0.4);
}

/* Recent Commands collapse arrow */
#boxRecentCommands details > summary::-webkit-details-marker { display: none; }
#boxRecentCommands details[open] > summary .rc-arrow { transform: rotate(90deg); }

/* Square card (1:1 aspect, header + body that fills the rest) */
.square-card {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.square-card .card-header { flex: 0 0 auto; }
.square-card-body {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#boxScreenshotImg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.screenshot-status {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    background: rgba(255, 255, 255, 0.85);
    padding: 2px 8px;
    border-radius: 4px;
    pointer-events: none;
}
.screenshot-spinner {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Box info 2-column table */
.box-info-table { width: 100%; border-collapse: collapse; }
.box-info-table th {
    padding: 2px 8px;
    white-space: nowrap;
    vertical-align: middle;
    width: 1%;
}
.box-info-table td {
    padding: 2px 12px 2px 3px;
    vertical-align: middle;
}

/* Send LCmd panel — grouped launcher command buttons */
.lcmd-group {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.lcmd-group:last-of-type {
    border-bottom: none;
}

.lcmd-group-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.lcmd-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Send LCmd — package picker */
.lcmd-pkg-list {
    margin-top: 8px;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 4px;
}

.lcmd-pkg-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.lcmd-pkg-row:hover {
    background: #f0f0f0;
}

.lcmd-pkg-row.selected {
    background: #e3f0fb;
    outline: 1px solid var(--color-primary);
}

.lcmd-pkg-name {
    font-family: monospace;
    word-break: break-all;
}

.lcmd-pkg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Send LCmd — diagnostic mode selection */
.lcmd-diag-btn.active {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}

.lcmd-diag-btn.active:hover {
    background: #276b2a;
}
