/* ═══════════════════════════════════════════════════════════════
   APK Decoder — CTF Reverse Engineering Web Tool
   Dark Cyberpunk Theme
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ─── CSS Custom Properties ─── */
:root {
    --bg-deep: #0a0e1a;
    --bg-base: #0f1320;
    --bg-surface: #151a2e;
    --bg-card: #1a2040;
    --bg-elevated: #1f2750;
    --bg-hover: #252d5a;
    --bg-active: #2a3366;

    --border-subtle: rgba(100, 120, 200, 0.12);
    --border-default: rgba(100, 120, 200, 0.2);
    --border-bright: rgba(100, 180, 255, 0.35);

    --text-primary: #e8ecf4;
    --text-secondary: #8892b0;
    --text-muted: #5a6380;
    --text-inverse: #0a0e1a;

    --accent-cyan: #00d4ff;
    --accent-purple: #a855f7;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --accent-pink: #ec4899;
    --accent-blue: #3b82f6;
    --accent-lime: #84cc16;

    --gradient-primary: linear-gradient(135deg, #00d4ff, #7c3aed);
    --gradient-green: linear-gradient(135deg, #10b981, #059669);
    --gradient-orange: linear-gradient(135deg, #f59e0b, #d97706);
    --gradient-red: linear-gradient(135deg, #ef4444, #dc2626);
    --gradient-pink: linear-gradient(135deg, #ec4899, #a855f7);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-cyan: 0 0 20px rgba(0, 212, 255, 0.15);
    --shadow-glow-purple: 0 0 20px rgba(168, 85, 247, 0.15);

    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    --header-h: 52px;
    --sidebar-w: 280px;
    --details-w: 340px;
    --shortcuts-h: 44px;
}

/* ─── Reset & Base ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    height: 100%;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-deep);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 140, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 140, 255, 0.35);
}

::selection {
    background: rgba(0, 212, 255, 0.3);
    color: #fff;
}

/* ─── Header ─── */
.header {
    height: var(--header-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    flex-shrink: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: fit-content;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
    user-select: none;
}

.logo-icon {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.4));
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.7));
    }
}

.logo-text {
    font-weight: 800;
    font-size: 1.15rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.header-center {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.file-badge {
    background: var(--bg-card);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-cyan);
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.btn svg {
    flex-shrink: 0;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-glow-cyan);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn-danger {
    background: var(--gradient-red);
    color: #fff;
}

.btn-success {
    background: var(--gradient-green);
    color: #fff;
}

/* ─── Main Layout ─── */
.main-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ─── Welcome / Drop Zone ─── */
.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.dropzone {
    width: 100%;
    max-width: 640px;
    padding: 60px 40px;
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-xl);
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    background: rgba(15, 19, 32, 0.6);
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.04);
    box-shadow: var(--shadow-glow-cyan);
}

.dropzone-icon {
    margin-bottom: 20px;
}

.dropzone-icon svg {
    width: 80px;
    height: 80px;
}

.dropzone-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.dropzone-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.dropzone-subtitle strong {
    color: var(--accent-cyan);
}

.dropzone-formats {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.format-tag {
    background: var(--bg-card);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-purple);
    border: 1px solid var(--border-subtle);
}

/* ─── Loading State ─── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.loading-detail {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 8px;
}

/* ─── App Layout (after APK loaded) ─── */
.app-workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ─── Sidebar (File Tree) ─── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.sidebar-search {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-search input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-family: var(--font-mono);
    outline: none;
    transition: border-color var(--transition-fast);
}

.sidebar-search input:focus {
    border-color: var(--accent-cyan);
}

.sidebar-search input::placeholder {
    color: var(--text-muted);
}

.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: 0.8rem;
    white-space: nowrap;
    user-select: none;
}

.tree-item:hover {
    background: var(--bg-hover);
}

.tree-item.active {
    background: var(--bg-active);
    color: var(--accent-cyan);
}

.tree-item.is-dir {
    font-weight: 600;
}

.tree-item .tree-icon {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
}

.tree-item .tree-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-item .tree-size {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.tree-indent {
    display: inline-block;
    width: 16px;
    flex-shrink: 0;
}

.tree-toggle {
    cursor: pointer;
    transition: transform var(--transition-fast);
    color: var(--text-muted);
    font-size: 0.65rem;
}

.tree-toggle.collapsed {
    transform: rotate(-90deg);
}

/* ─── Center Panel ─── */
.center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Tabs */
.tab-bar {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    flex-shrink: 0;
}

.tab {
    padding: 8px 18px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.tab.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.05);
}

.tab .tab-icon {
    font-size: 0.9rem;
}

/* Viewer Area */
.viewer-area {
    flex: 1;
    overflow: auto;
    padding: 0;
    background: var(--bg-base);
    position: relative;
}

/* Hex Viewer */
.hex-container {
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.hex-row {
    display: flex;
    gap: 0;
    line-height: 1.7;
    white-space: pre;
}

.hex-offset {
    color: var(--text-muted);
    min-width: 80px;
    user-select: none;
}

.hex-bytes {
    color: var(--accent-cyan);
    min-width: 400px;
    letter-spacing: 0.05em;
}

.hex-bytes .null-byte {
    color: var(--text-muted);
    opacity: 0.4;
}

.hex-bytes .high-byte {
    color: var(--accent-orange);
}

.hex-bytes .printable-byte {
    color: var(--accent-cyan);
}

.hex-ascii {
    color: var(--accent-green);
    border-left: 1px solid var(--border-subtle);
    padding-left: 12px;
    margin-left: 12px;
}

.hex-ascii .non-printable {
    color: var(--text-muted);
    opacity: 0.3;
}

.hex-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.78rem;
}

.hex-toolbar label {
    color: var(--text-muted);
}

.hex-toolbar input,
.hex-toolbar select {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 3px 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    outline: none;
}

.hex-toolbar input:focus,
.hex-toolbar select:focus {
    border-color: var(--accent-cyan);
}

/* String Viewer */
.strings-container {
    padding: 12px 16px;
}

.string-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.string-item:hover {
    background: var(--bg-hover);
}

.string-offset {
    color: var(--text-muted);
    font-size: 0.72rem;
    min-width: 70px;
    flex-shrink: 0;
    user-select: none;
}

.string-value {
    color: var(--accent-green);
    word-break: break-all;
    flex: 1;
}

.string-value .highlight {
    background: rgba(245, 158, 11, 0.3);
    color: var(--accent-orange);
    border-radius: 2px;
    padding: 0 2px;
}

.string-item.is-flag .string-value {
    color: var(--accent-orange);
    font-weight: 600;
}

.strings-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.strings-toolbar input {
    flex: 1;
    min-width: 150px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 5px 10px;
    font-size: 0.78rem;
    outline: none;
}

.strings-toolbar input:focus {
    border-color: var(--accent-cyan);
}

.strings-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* XML Viewer */
.xml-container {
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
    color: var(--text-secondary);
}

.xml-tag {
    color: var(--accent-cyan);
}

.xml-attr-name {
    color: var(--accent-purple);
}

.xml-attr-value {
    color: var(--accent-green);
}

.xml-comment {
    color: var(--text-muted);
    font-style: italic;
}

.xml-text {
    color: var(--accent-orange);
}

/* Smali Viewer */
.smali-container {
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.7;
}

.smali-line {
    display: flex;
    gap: 0;
}

.smali-linenum {
    min-width: 50px;
    color: var(--text-muted);
    user-select: none;
    text-align: right;
    padding-right: 16px;
    opacity: 0.5;
}

.smali-code {
    flex: 1;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.smali-keyword {
    color: var(--accent-purple);
    font-weight: 600;
}

.smali-directive {
    color: var(--accent-cyan);
}

.smali-type {
    color: var(--accent-green);
}

.smali-string {
    color: var(--accent-orange);
}

.smali-comment {
    color: var(--text-muted);
    font-style: italic;
}

.smali-register {
    color: var(--accent-pink);
}

.smali-number {
    color: var(--accent-lime);
}

.smali-label {
    color: var(--accent-orange);
    font-weight: 600;
}

/* Image Viewer */
.image-viewer {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 24px;
    background: repeating-conic-gradient(var(--bg-card) 0% 25%, var(--bg-surface) 0% 50%) 0 0 / 20px 20px;
}

.image-viewer img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* ─── Right Panel (Details) ─── */
.details-panel {
    width: var(--details-w);
    background: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.details-section {
    padding: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.details-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.details-section-title .section-icon {
    font-size: 0.85rem;
}

/* APK Info */
.apk-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    font-size: 0.78rem;
}

.apk-info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.apk-info-value {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    word-break: break-all;
}

/* Stats cards */
.stats-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-mini {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
}

.stat-mini-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
}

.stat-mini-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* CTF Scanner */
.ctf-scan-section {
    overflow-y: auto;
    flex: 1;
}

.ctf-scan-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ctf-scan-btn.primary-scan {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-glow-cyan);
}

.ctf-scan-btn.primary-scan:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.ctf-scan-btn.secondary-scan {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.ctf-scan-btn.secondary-scan:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Flag Format Input */
.flag-format-group {
    margin-bottom: 10px;
}

.flag-format-group label {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.flag-format-group input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    outline: none;
}

.flag-format-group input:focus {
    border-color: var(--accent-cyan);
}

.flag-format-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* CTF Results */
.ctf-results {
    margin-top: 10px;
}

.ctf-result-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ctf-result-item:hover {
    border-color: var(--accent-cyan);
    background: var(--bg-hover);
}

.ctf-result-file {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ctf-result-value {
    font-family: var(--font-mono);
    color: var(--accent-orange);
    font-weight: 600;
    word-break: break-all;
}

.ctf-result-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 4px;
}

.ctf-result-badge.flag {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-orange);
}

.ctf-result-badge.b64 {
    background: rgba(168, 85, 247, 0.2);
    color: var(--accent-purple);
}

.ctf-result-badge.url {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

/* Decoder Tool */
.decoder-section {
    padding: 14px;
}

.decoder-textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    resize: vertical;
    min-height: 60px;
    outline: none;
    margin-bottom: 8px;
}

.decoder-textarea:focus {
    border-color: var(--accent-cyan);
}

.decoder-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.decoder-btn {
    padding: 4px 8px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.decoder-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.decoder-btn.active {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.decoder-output {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-green);
    min-height: 40px;
    word-break: break-all;
    max-height: 120px;
    overflow-y: auto;
}

/* Permissions List */
.permission-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.permission-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.permission-dot.dangerous {
    background: var(--accent-red);
}

.permission-dot.normal {
    background: var(--accent-green);
}

.permission-dot.unknown {
    background: var(--text-muted);
}

/* ─── Shortcuts Bar ─── */
.shortcuts-bar {
    height: var(--shortcuts-h);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    overflow-x: auto;
    flex-shrink: 0;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.shortcut-key {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ─── Modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    backdrop-filter: blur(6px);
    animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 250ms ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Shortcuts Reference Modal */
.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.shortcut-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 8px;
    grid-column: 1 / -1;
}

.shortcut-ref {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
}

.shortcut-ref:hover {
    background: var(--bg-card);
}

.shortcut-ref-label {
    color: var(--text-secondary);
}

.shortcut-ref-keys {
    display: flex;
    gap: 4px;
}

/* ADB Reference */
.adb-grid {
    display: grid;
    gap: 6px;
}

.adb-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.adb-item:hover {
    border-color: var(--accent-cyan);
}

.adb-cmd {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-cyan);
    margin-bottom: 3px;
}

.adb-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* OS badge (only for OS-specific commands/steps) */
.os-badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-right: 8px;
    border: 1px solid rgba(100, 120, 200, 0.25);
    background: rgba(100, 120, 200, 0.10);
    color: var(--text-secondary);
}

.os-badge.os-linux {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
}

.os-badge.os-windows {
    border-color: rgba(0, 212, 255, 0.35);
    background: rgba(0, 212, 255, 0.10);
    color: var(--accent-cyan);
}

.os-badge.os-any {
    border-color: rgba(136, 146, 176, 0.28);
    background: rgba(136, 146, 176, 0.08);
    color: var(--text-secondary);
}

.os-badge.os-gui {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-orange);
}

.os-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

.adb-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.adb-line .adb-cmd {
    margin-bottom: 0;
}

/* ─── Toast Notifications ─── */
.toast-container {
    position: fixed;
    bottom: 60px;
    right: 20px;
    z-index: 600;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 0.8rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 300ms ease;
    max-width: 350px;
}

.toast.success {
    border-color: var(--accent-green);
}

.toast.error {
    border-color: var(--accent-red);
}

.toast.info {
    border-color: var(--accent-cyan);
}

@keyframes toastIn {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-exit {
    animation: toastOut 300ms ease forwards;
}

@keyframes toastOut {
    to {
        transform: translateX(30px);
        opacity: 0;
    }
}

/* ─── Empty States ─── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    text-align: center;
    min-height: 200px;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.85rem;
}

.empty-state-sub {
    font-size: 0.75rem;
    margin-top: 6px;
    color: var(--text-muted);
}

/* ─── Context Menu ─── */
.context-menu {
    position: fixed;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px 0;
    z-index: 700;
    min-width: 180px;
    animation: fadeIn 100ms ease;
}

.context-item {
    padding: 7px 14px;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background var(--transition-fast);
}

.context-item:hover {
    background: var(--bg-hover);
}

.context-sep {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
    :root {
        --sidebar-w: 220px;
        --details-w: 280px;
    }
}

@media (max-width: 900px) {
    .details-panel {
        display: none;
    }

    :root {
        --details-w: 0px;
    }
}

@media (max-width: 700px) {
    .sidebar {
        display: none;
    }

    :root {
        --sidebar-w: 0px;
    }
}

/* ─── Progress Bar ─── */
.progress-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 200ms ease;
    width: 0%;
}

/* ─── Bookmarks ─── */
.bookmark-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.bookmark-item:last-child {
    border-bottom: none;
}

.bookmark-remove {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.bookmark-remove:hover {
    color: var(--accent-red);
}

.bookmark-text {
    font-family: var(--font-mono);
    color: var(--accent-green);
    word-break: break-all;
}

.bookmark-file {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* No bookmarks */
.no-bookmarks {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    padding: 16px;
}

/* ─── Animations ─── */
.fade-in {
    animation: fadeIn 300ms ease;
}

.slide-in-left {
    animation: slideInLeft 300ms ease;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ─── Utilities ─── */
.hidden {
    display: none !important;
}

.mono {
    font-family: var(--font-mono);
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-cyan {
    color: var(--accent-cyan);
}

.text-green {
    color: var(--accent-green);
}

.text-orange {
    color: var(--accent-orange);
}

.text-purple {
    color: var(--accent-purple);
}

.text-red {
    color: var(--accent-red);
}

.text-muted {
    color: var(--text-muted);
}

/* ─── OP Button Glow ─── */
@keyframes opGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.3), 0 0 40px rgba(245, 158, 11, 0.1);
    }

    50% {
        box-shadow: 0 0 35px rgba(239, 68, 68, 0.5), 0 0 60px rgba(245, 158, 11, 0.25);
        transform: scale(1.01);
    }
}
