/* MetaCleaner Studio Pro — Modern Shadcn/Linear Inspired Dark Studio Theme */
:root {
    --bg-base: #09090b;
    --bg-surface: #121215;
    --bg-surface-elevated: #18181b;
    --bg-subtle: #27272a;
    --bg-hover: #222227;

    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-active: rgba(255, 255, 255, 0.16);
    --border-focus: #10b981;

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-dim: #52525b;

    --primary: #10b981;
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.25);
    
    --accent-cyan: #06b6d4;
    --accent-indigo: #6366f1;
    --danger: #ef4444;
    --warning: #f59e0b;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --header-height: 56px;
    --sidebar-left-width: 320px;
    --sidebar-right-width: 340px;
    --status-bar-height: 38px;
    --footer-height: 28px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Minimal Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* App Root Container (100vh workbench) */
.studio-app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

/* =========================================
   TOP HEADER
========================================= */
.studio-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 50;
    user-select: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.app-brand {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.brand-logo-img {
    height: 42px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.brand-logo-img:hover {
    transform: scale(1.03);
    opacity: 0.95;
}

.workspace-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    color: var(--text-secondary);
    max-width: 240px;
}

.active-file-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-mono);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    flex-shrink: 0;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.metric-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 4px 10px;
    border-radius: var(--radius-md);
}

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

.metric-val {
    font-weight: 600;
    font-family: var(--font-mono);
}

.text-emerald {
    color: #34d399 !important;
}

.text-cyan {
    color: #38bdf8 !important;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.kbd-hint {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    margin-left: 0.3rem;
}

/* =========================================
   BUTTONS (Shadcn Style)
========================================= */
.btn-primary, .btn-secondary, .btn-ghost, .btn-accent-sm, .btn-ghost-sm, .btn-text-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-family: var(--font-ui);
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    user-select: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #052e16;
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.1);
}
.btn-primary:hover:not(:disabled) {
    background: #059669;
    color: #fff;
    box-shadow: 0 0 16px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-subtle);
    border-color: var(--border-active);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
}

.btn-accent-sm {
    background: var(--primary);
    color: #052e16;
    font-weight: 600;
    padding: 4px 10px;
    font-size: 0.76rem;
}
.btn-accent-sm:hover {
    background: #34d399;
}

.btn-ghost-sm {
    background: transparent;
    color: var(--text-secondary);
    padding: 4px 10px;
    font-size: 0.76rem;
    border: 1px solid var(--border-subtle);
}
.btn-ghost-sm:hover {
    background: var(--bg-surface-elevated);
    color: #fff;
}

.btn-text-danger {
    background: transparent;
    color: var(--danger);
    font-size: 0.74rem;
}
.btn-text-danger:hover:not(:disabled) {
    text-decoration: underline;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-md {
    padding: 8px 16px;
    font-size: 0.88rem;
}

.btn-lg {
    padding: 10px 20px;
    font-size: 0.92rem;
}

.btn-block {
    width: 100%;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed !important;
}

/* =========================================
   3-COLUMN MAIN WORKBENCH
========================================= */
.studio-main {
    display: flex;
    height: calc(100vh - var(--header-height) - var(--footer-height));
    width: 100%;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
}

/* =========================================
   LEFT SIDEBAR: QUEUE & METADATA
========================================= */
.sidebar-left {
    width: var(--sidebar-left-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(16, 185, 129, 0.04);
}

.tab-content {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
}

.upload-compact-box {
    margin: 10px 12px 6px 12px;
    border: 1px dashed var(--border-active);
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    background: var(--bg-surface-elevated);
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-compact-box:hover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.04);
}

.compact-drop-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.hidden-input {
    display: none;
}

.file-queue-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.empty-queue-hint {
    margin-top: 2.5rem;
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.empty-queue-hint span {
    display: block;
    font-size: 0.74rem;
    color: var(--text-dim);
    margin-top: 0.35rem;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 8px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.15s ease;
}

.queue-item:hover {
    border-color: var(--border-active);
    background: var(--bg-hover);
}

.queue-item.active {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.07);
}

.queue-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #000;
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
}

.queue-meta {
    flex: 1;
    min-width: 0;
}

.queue-name {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.queue-stats {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.queue-badge-save {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}

.queue-remove-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.queue-item:hover .queue-remove-btn {
    opacity: 1;
}

.queue-remove-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.sidebar-footer-actions {
    padding: 8px 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
}

/* Metadata Inspector Section */
.metadata-inspector-wrap {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inspector-status-banner {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-chip.clean {
    color: var(--primary);
}

.status-chip .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.inspector-status-banner p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.meta-section {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}

.meta-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.badge-subtle {
    font-size: 0.65rem;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.badge-emerald {
    font-size: 0.65rem;
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.meta-tags-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.empty-meta-placeholder {
    color: var(--text-dim);
    font-size: 0.72rem;
    padding: 8px 0;
    text-align: center;
}

.meta-tag-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.25);
}

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

.meta-tag-val {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sanitizer-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
}

.check-row .check-icon {
    color: var(--primary);
    font-weight: 700;
}

.check-row .check-title {
    flex: 1;
    color: var(--text-secondary);
}

.check-row .check-status {
    font-size: 0.65rem;
    color: var(--primary);
    font-weight: 600;
}

/* =========================================
   CENTER WORKBENCH: STAGE & TOOLBARS
========================================= */
.workbench-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    overflow: hidden;
    position: relative;
    min-height: 0;
    min-width: 0;
}

.workbench-toolbar {
    height: 42px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    user-select: none;
    z-index: 20;
}

.tool-modes-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface-elevated);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mode-btn:hover {
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--bg-subtle);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Crop Aspect Ratio Selector */
.crop-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.aspect-pills {
    display: flex;
    align-items: center;
    gap: 4px;
}

.aspect-pill {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.aspect-pill:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

.aspect-pill.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.crop-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon-xs {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-icon-xs:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

.zoom-text {
    font-size: 0.74rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    min-width: 48px;
    text-align: center;
}

/* Stage Canvas Area */
.stage-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    min-width: 0;
    height: 100%;
    background-color: #0c0c0e;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Drop Hero State */
.drop-hero {
    position: absolute;
    inset: 2rem;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(18, 18, 21, 0.4);
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    cursor: pointer;
}

.drop-hero:hover, .drop-hero.dragover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.04);
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.12);
}

.hero-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.hero-content {
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
}

.hero-icon-ring {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.hero-content h1, .hero-content h2, .drop-hero-h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    margin: 0;
}

.hero-content p, .drop-hero-sub {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.or-separator {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.hero-kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* =========================================
   SPLIT COMPARISON VIEW (A/B CURTAIN SLIDER)
========================================= */
.compare-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    max-height: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    padding: 8px;
    box-sizing: border-box;
}

.compare-stage-box {
    position: relative;
    display: block;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    user-select: none;
    transition: width 0.18s cubic-bezier(0.16, 1, 0.3, 1), height 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    background: #000;
}

.compare-base-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    user-select: none;
    pointer-events: none;
    display: block;
}

.compare-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
    pointer-events: none;
}

.compare-overlay-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    user-select: none;
    pointer-events: none;
    display: block;
}

.layer-tag {
    position: absolute;
    top: 16px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    letter-spacing: 0.05em;
    pointer-events: none;
}

.tag-left {
    left: 20px;
    background: rgba(0, 0, 0, 0.65);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-right {
    right: 20px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Draggable Divider Curtain */
.compare-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    cursor: ew-resize;
    z-index: 30;
    transform: translateX(-50%);
}

.divider-line {
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.divider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #18181b;
    border: 2px solid #fff;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.6), 0 0 10px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: ew-resize;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.divider-handle:hover {
    border-color: var(--primary);
    transform: translate(-50%, -50%) scale(1.08);
}

/* =========================================
   CROP STAGE
========================================= */
.crop-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    max-height: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
    box-sizing: border-box;
}

.crop-stage-inner {
    position: relative;
    display: block;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    user-select: none;
    transition: width 0.18s cubic-bezier(0.16, 1, 0.3, 1), height 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    background: #000;
    flex-shrink: 0;
}

.crop-stage-inner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    user-select: none;
    pointer-events: none;
}

/* Interactive Crop Box Overlay */
.crop-box {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
    cursor: move;
    box-sizing: border-box;
}

.crop-grid-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: 
        linear-gradient(to right, transparent 33.3%, rgba(255, 255, 255, 0.25) 33.3%, rgba(255, 255, 255, 0.25) 33.8%, transparent 33.8%, transparent 66.6%, rgba(255, 255, 255, 0.25) 66.6%, rgba(255, 255, 255, 0.25) 67.1%, transparent 67.1%),
        linear-gradient(to bottom, transparent 33.3%, rgba(255, 255, 255, 0.25) 33.3%, rgba(255, 255, 255, 0.25) 33.8%, transparent 33.8%, transparent 66.6%, rgba(255, 255, 255, 0.25) 66.6%, rgba(255, 255, 255, 0.25) 67.1%, transparent 67.1%);
}

.crop-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 2px;
}

.handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.handle-n  { top: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.handle-s  { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.handle-w  { top: 50%; left: -6px; transform: translateY(-50%); cursor: ew-resize; }
.handle-e  { top: 50%; right: -6px; transform: translateY(-50%); cursor: ew-resize; }

/* Workbench Status Bar */
.workbench-status-bar {
    height: var(--status-bar-height);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    font-size: 0.74rem;
    user-select: none;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-tag {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.status-tag.subtle {
    color: var(--text-dim);
}

.status-arrow {
    color: var(--text-dim);
}

.status-right {
    display: flex;
    align-items: center;
}

.live-savings-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
}

.arrow-down {
    color: var(--primary);
    font-weight: 700;
}

.saving-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

/* =========================================
   RIGHT SIDEBAR: OPTIMIZATION CONTROLS
========================================= */
.sidebar-right {
    width: var(--sidebar-right-width);
    background: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.panel-section-title {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
}

.controls-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.control-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.control-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-bubble {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(16, 185, 129, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Format Grid */
.format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.format-btn {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.format-btn:hover {
    border-color: var(--border-active);
    background: var(--bg-hover);
}

.format-btn.active {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
}

.format-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.format-sub {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-align: center;
}

/* Quality Presets */
.quality-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 2px;
}

.preset-pill {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 5px 2px;
    font-size: 0.68rem;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.preset-pill:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

.preset-pill.active {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
    font-weight: 600;
}

.slider-wrapper {
    margin-top: 6px;
}

.studio-slider {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
    height: 4px;
    background: var(--bg-subtle);
    border-radius: 2px;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    color: var(--text-dim);
    margin-top: 4px;
    font-family: var(--font-mono);
}

.studio-select {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: var(--font-ui);
    outline: none;
    cursor: pointer;
}

.studio-select:focus {
    border-color: var(--primary);
}

/* Toggles */
.toggles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.toggle-row input {
    display: none;
}

.toggle-switch {
    width: 30px;
    height: 16px;
    background: var(--bg-subtle);
    border-radius: 999px;
    position: relative;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
}

.toggle-row input:checked + .toggle-switch {
    background: var(--primary);
}

.toggle-row input:checked + .toggle-switch::after {
    transform: translateX(14px);
}

/* Audit Card */
.audit-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.audit-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
}

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

.audit-val {
    font-weight: 600;
}

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

.font-bold {
    font-weight: 700;
}

.sidebar-right-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

/* Hidden canvas */
.hidden-canvas {
    display: none;
}

.hidden {
    display: none !important;
}

/* =========================================
   RESIZE MODULE STYLES (PERCENT & PIXELS)
========================================= */
.resize-mode-tabs {
    display: flex;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.tab-btn-mini {
    flex: 1;
    padding: 5px 6px;
    font-size: 0.7rem;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-btn-mini:hover {
    color: var(--text-primary);
}

.tab-btn-mini.active {
    background: var(--bg-subtle);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.resize-subpanel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.px-inputs-grid {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.px-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    gap: 4px;
}

.px-input-group:focus-within {
    border-color: var(--primary);
}

.px-input-label {
    font-size: 0.68rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-weight: 600;
}

.studio-number-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    outline: none;
    text-align: right;
}

.studio-number-input::-webkit-inner-spin-button,
.studio-number-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.px-unit {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.btn-lock-aspect {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-lock-aspect:hover {
    color: var(--text-primary);
    border-color: var(--border-active);
}

.btn-lock-aspect.active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.12);
}

.px-quick-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.preset-pill-xs {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 4px 2px;
    font-size: 0.64rem;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    font-family: var(--font-mono);
    transition: all 0.15s ease;
}

.preset-pill-xs:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

.preset-pill-xs.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.12);
}

.resize-feedback-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 0.7rem;
}

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

.feedback-val {
    font-weight: 600;
}

/* =========================================
   RESPONSIVE (Tablets & Smaller Viewports)
========================================= */
@media (max-width: 1024px) {
    :root {
        --sidebar-left-width: 260px;
        --sidebar-right-width: 280px;
    }
    .header-center {
        display: none;
    }
}

@media (max-width: 768px) {
    .studio-app {
        height: auto;
        overflow-y: auto;
    }
    .studio-main {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    .sidebar-left, .sidebar-right {
        width: 100%;
        height: auto;
    }
    .workbench-center {
        min-height: 480px;
    }
    .studio-global-footer {
        flex-direction: column;
        height: auto;
        padding: 8px 12px;
        gap: 6px;
    }
    .footer-center {
        display: none;
    }
}

/* =========================================
   LOW HEIGHT VIEWPORT RESPONSIVE (Laptops)
========================================= */
@media (max-height: 800px) {
    :root {
        --header-height: 48px;
        --status-bar-height: 32px;
        --footer-height: 26px;
    }
    .brand-logo-img {
        height: 36px;
        max-width: 155px;
    }
    .controls-scrollable {
        padding: 10px;
        gap: 10px;
    }
    .control-card {
        padding: 9px;
    }
    .panel-section-title {
        padding: 8px 12px;
    }
    .compare-wrapper, .crop-wrapper {
        padding: 4px;
    }
}

/* =========================================
   GLOBAL STUDIO FOOTER
========================================= */
.studio-global-footer {
    height: var(--footer-height);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    font-size: 0.68rem;
    color: var(--text-muted);
    user-select: none;
    z-index: 40;
    flex-shrink: 0;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-copy strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.footer-author-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.footer-author-link:hover {
    color: #34d399;
    text-decoration: underline;
}

.footer-sep {
    color: var(--text-dim);
}

.footer-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
}

.footer-center {
    font-size: 0.68rem;
    color: var(--text-dim);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.68rem;
    cursor: pointer;
    transition: color 0.15s ease;
}

.footer-link-btn:hover {
    color: var(--primary);
}

.footer-version {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.65rem;
}

/* =========================================
   SEO & PRIVACY KNOWLEDGE MODAL
========================================= */
.seo-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.seo-modal-backdrop.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.seo-modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(16, 185, 129, 0.1);
    width: 100%;
    max-width: 780px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { transform: scale(0.96) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

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

.seo-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seo-modal-icon img {
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.seo-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.seo-modal-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: block;
}

.seo-modal-close {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.seo-modal-close:hover {
    border-color: var(--border-active);
    color: #fff;
    background: var(--bg-hover);
}

.seo-modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.seo-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 640px) {
    .seo-info-grid {
        grid-template-columns: 1fr;
    }
}

.seo-info-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: border-color 0.2s ease;
}

.seo-info-card:hover {
    border-color: var(--border-active);
}

.seo-card-icon {
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.seo-info-card h3 {
    font-size: 0.84rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.seo-info-card p {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.seo-faq-section {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.seo-faq-section h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.faq-item {
    margin-bottom: 10px;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item h4 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.faq-item p {
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.seo-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.seo-footer-text {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* =========================================
   ON-PAGE SEO: CYBER-FORENSICS PRIVACY LAB
========================================= */
.seo-guide-section {
    background: radial-gradient(circle at 50% 0%, #12131a 0%, #08080a 65%, #050507 100%);
    border-top: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--text-primary);
    padding: 5rem 1.5rem 7rem;
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.seo-guide-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.6) 50%, transparent 100%);
}

.seo-guide-container {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* Breadcrumbs */
.seo-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.seo-breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.seo-breadcrumbs a:hover {
    color: var(--primary);
}

.seo-breadcrumbs .sep {
    color: var(--text-dim);
}

.seo-breadcrumbs .current {
    color: var(--primary);
    font-weight: 500;
}

/* Guide Header & Forensics Telemetry */
.guide-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.forensics-status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.forensics-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    color: var(--primary);
    font-weight: 600;
}

.pulse-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    animation: radarPulse 2s infinite;
}

@keyframes radarPulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
    100% { opacity: 1; transform: scale(1); }
}

.forensics-sep {
    color: var(--text-dim);
}

.forensics-metric {
    letter-spacing: 0.03em;
}

.guide-main-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.22;
    letter-spacing: -0.025em;
    max-width: 980px;
}

.guide-lead {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 860px;
}

/* =========================================
   BINARY FORENSIC TERMINAL (VISUAL COMPONENT)
========================================= */
.forensic-terminal-card {
    background: #0d0e12;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(16, 185, 129, 0.04);
    overflow: hidden;
}

.terminal-topbar {
    background: #14151b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.terminal-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.terminal-dots .dot.red { background: #ef4444; }
.terminal-dots .dot.yellow { background: #f59e0b; }
.terminal-dots .dot.green { background: #10b981; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.terminal-badge {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    color: var(--primary);
}

.terminal-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    align-items: stretch;
}

.terminal-pane {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem;
}

.terminal-pane.pane-dirty {
    background: rgba(239, 68, 68, 0.02);
    border-right: 1px dashed rgba(255, 255, 255, 0.08);
}

.terminal-pane.pane-clean {
    background: rgba(16, 185, 129, 0.02);
}

.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.pane-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.tag-status-alert {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.tag-status-safe {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.hex-dump {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.hex-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.25);
}

.hex-line.alert {
    background: rgba(239, 68, 68, 0.1);
    border-left: 2px solid #ef4444;
}

.hex-line.warn {
    background: rgba(245, 158, 11, 0.08);
    border-left: 2px solid #f59e0b;
}

.hex-line.ok {
    background: rgba(16, 185, 129, 0.08);
    border-left: 2px solid var(--primary);
}

.hex-addr { color: var(--text-dim); }
.hex-code { color: #fff; font-weight: 600; }
.hex-str { color: var(--text-secondary); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hex-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.hex-tag.tag-header { background: rgba(255, 255, 255, 0.1); color: #fff; }
.hex-tag.tag-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.hex-tag.tag-warning { background: rgba(245, 158, 11, 0.2); color: #fde047; }
.hex-tag.tag-clean { background: rgba(16, 185, 129, 0.2); color: #a7f3d0; }

.pane-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    line-height: 1.4;
}

.pane-footer.danger-bg {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.pane-footer.safe-bg {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

.terminal-flow-bridge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    background: #09090b;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.flow-pill {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.1em;
    padding: 1rem 0;
}

/* =========================================
   VECTORS & FORENSIC CARDS
========================================= */
.vectors-section {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.vectors-header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.vectors-badge, .pipeline-badge, .matrix-badge, .faq-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vectors-title, .pipeline-title, .matrix-title, .faq-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.015em;
}

.forensic-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.forensic-card {
    background: linear-gradient(180deg, #13141a 0%, #0d0e12 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.forensic-card:hover {
    transform: translateY(-3px);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.08);
}

.card-hud-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hud-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hud-icon.radar {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.hud-icon.sensor {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.hud-icon.ai {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.25);
}

.hud-icon.speed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.hud-readout {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.readout-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-dim);
}

.readout-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

.readout-tag.danger { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.readout-tag.warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.readout-tag.cyan { background: rgba(6, 182, 212, 0.15); color: #67e8f9; }
.readout-tag.emerald { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }

.card-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.card-body-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

.card-body-text code {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 1px 5px;
    border-radius: 4px;
}

.card-telemetry-box {
    background: #09090c;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--text-secondary);
}

.card-telemetry-box strong { color: #fff; }
.text-danger { color: #f87171 !important; }
.text-warning { color: #fbbf24 !important; }
.text-cyan { color: #67e8f9 !important; }
.text-emerald { color: #34d399 !important; }

/* =========================================
   PIPELINE STEP BY STEP (WORKFLOW)
========================================= */
.pipeline-section {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.pipeline-header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pipeline-sub, .faq-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.pipeline-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pipeline-step {
    background: #111217;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    gap: 1.25rem;
    position: relative;
}

.step-num-pill {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 800;
    color: #000;
    background: var(--primary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.step-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.step-text {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.step-text kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #fff;
}

.step-text code {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
}

/* =========================================
   FORENSIC AUDIT TABLE MATRIX
========================================= */
.matrix-audit-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.matrix-table-wrap {
    background: #0e0f14;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.forensic-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.86rem;
}

.forensic-table th {
    background: #14161e;
    padding: 16px 20px;
    color: #fff;
    font-weight: 700;
    border-bottom: 2px solid rgba(16, 185, 129, 0.3);
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
}

.forensic-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    vertical-align: middle;
}

.forensic-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.cell-entity {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cell-entity strong {
    color: #fff;
}

.entity-code {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
}

.chip-fmt {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 3px;
}

.status-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.critical { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.status-pill.high { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-pill.medium { background: rgba(6, 182, 212, 0.15); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.3); }
.status-pill.low { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.status-pill.clean { background: rgba(16, 185, 129, 0.15); color: var(--primary); border: 1px solid rgba(16, 185, 129, 0.35); }

/* =========================================
   FAQ ACCORDIONS
========================================= */
.faq-forensic-section {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.faq-accordion-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.forensic-details {
    background: #111217;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
}

.forensic-details[open] {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(16, 185, 129, 0.05);
}

.forensic-summary {
    padding: 18px 24px;
    font-size: 1.02rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    user-select: none;
}

.forensic-summary::-webkit-details-marker { display: none; }

.sum-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.forensic-details[open] .sum-icon {
    transform: rotate(180deg);
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
}

.forensic-answer {
    padding: 0 24px 20px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.65;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 16px;
}

.forensic-answer strong { color: #fff; }
.forensic-answer em { color: var(--primary); font-style: normal; }

/* =========================================
   ENGINEERING & AUTHOR PROFILE (E-E-A-T)
========================================= */
.engineering-card {
    background: linear-gradient(135deg, #13141b 0%, #0d0e13 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.eng-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.eng-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.eng-avatar-wrap img {
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #000;
    display: block;
}

.eng-verified {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--primary);
    color: #000;
    font-size: 0.65rem;
    font-weight: 900;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0d0e13;
}

.eng-details {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.eng-author {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.eng-author a {
    color: var(--primary);
    text-decoration: none;
    transition: text-decoration 0.15s ease;
}

.eng-author a:hover {
    text-decoration: underline;
}

.eng-statement {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.eng-cta-wrap {
    flex-shrink: 0;
}

.eng-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
}

/* Responsive Rules */
@media (max-width: 900px) {
    .terminal-grid {
        grid-template-columns: 1fr;
    }
    .terminal-flow-bridge {
        writing-mode: horizontal-tb;
        padding: 0.75rem;
        border-left: none;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .flow-pill {
        writing-mode: horizontal-tb;
        transform: none;
        padding: 0;
    }
    .engineering-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding: 1.75rem;
    }
}

@media (max-width: 768px) {
    .seo-guide-section {
        padding: 3.5rem 1rem 5rem;
    }
    .guide-main-title {
        font-size: 1.65rem;
    }
    .forensic-cards-grid {
        grid-template-columns: 1fr;
    }
    .pipeline-steps-grid {
        grid-template-columns: 1fr;
    }
    .eng-profile {
        flex-direction: column;
        align-items: flex-start;
    }
}
