/* ==============================================================================
   LOSSIMG - EDITORIAL CREAM & INDUSTRIAL DESIGN SYSTEM (FULLY RESPONSIVE)
   ============================================================================== */

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

:root {
    /* Palette: Creamy White & Editorial Warmth */
    --bg-page: #FAF8F5;
    --bg-surface: #FFFFFF;
    --bg-surface-elevated: #FFFFFF;
    --bg-muted: #F3EFEA;
    --bg-muted-hover: #ECE6DD;
    --bg-accent-soft: rgba(217, 93, 57, 0.08);

    /* Hairline Tactile Borders */
    --border-color: #E8E2D8;
    --border-subtle: #F0EBE3;
    --border-dark: #D4CBBD;
    --border-accent: rgba(217, 93, 57, 0.35);

    /* Typography */
    --text-primary: #1C1917;
    --text-secondary: #5E5851;
    --text-muted: #948B80;
    --text-inverse: #FFFFFF;

    /* Industrial Accent */
    --accent: #D95D39;
    --accent-hover: #C54C28;
    --accent-active: #AB3E1E;
    --accent-glow: rgba(217, 93, 57, 0.22);

    /* Status Colors */
    --success: #287A38;
    --success-bg: rgba(40, 122, 56, 0.08);
    --danger: #C93B2B;
    --danger-bg: rgba(201, 59, 43, 0.08);
    --warning: #B87818;
    --warning-bg: rgba(184, 120, 24, 0.08);

    /* Fonts */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    /* Elevation & Shadows */
    --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.03), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-md: 0 4px 14px rgba(28, 25, 23, 0.05), 0 1px 3px rgba(28, 25, 23, 0.02);
    --shadow-lg: 0 14px 38px rgba(28, 25, 23, 0.07), 0 2px 8px rgba(28, 25, 23, 0.03);
    --shadow-modal: 0 24px 64px rgba(28, 25, 23, 0.16), 0 4px 16px rgba(28, 25, 23, 0.06);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.14s ease;
    --transition-base: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

/* Subtle Technical Grid Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(var(--border-color) 0.75px, transparent 0.75px);
    background-size: 24px 24px;
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}

::selection {
    background: var(--accent);
    color: var(--text-inverse);
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
}

input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    max-width: 100%;
}

/* ==============================================================================
   LAYOUT CONTAINER
   ============================================================================== */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    min-width: 0;
    padding: 16px 20px 60px; /* Normal clean page padding; no sticky overlap */
}

/* Top Navigation Bar */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    margin: 8px 0 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    gap: 16px;
    flex-wrap: wrap;
    min-width: 0;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
}

.brand-icon img {
    width: 24px;
    height: 24px;
    display: block;
}

.brand-text-block {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.brand-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    background: var(--bg-accent-soft);
    color: var(--accent);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nav Stats & Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.stat-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.stat-value {
    font-weight: 700;
    color: var(--text-primary);
}

.nav-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
    border-color: var(--border-dark);
}

.btn-signout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    background: var(--bg-muted);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-signout:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(201, 59, 43, 0.25);
}

/* ==============================================================================
   MAIN WORKSPACE STAGE & DROPZONE
   ============================================================================== */
.main-stage {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    width: 100%;
}

.dropzone-container {
    position: relative;
    background: var(--bg-surface);
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.dropzone-container.is-dragover {
    border-color: var(--accent);
    background: #FFFBF8;
    box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-md);
    transform: scale(1.004);
}

.corner-mark {
    position: absolute;
    width: 12px;
    height: 12px;
    color: var(--border-dark);
    pointer-events: none;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.corner-tl { top: 8px; left: 8px; }
.corner-tr { top: 8px; right: 8px; }
.corner-bl { bottom: 8px; left: 8px; }
.corner-br { bottom: 8px; right: 8px; }

.dropzone-content {
    max-width: 540px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-width: 0;
}

.dropzone-icon-ring {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-full);
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(28, 25, 23, 0.04);
    transition: var(--transition-base);
}

.dropzone-container.is-dragover .dropzone-icon-ring {
    transform: translateY(-4px);
    background: var(--accent);
    color: var(--text-inverse);
}

.dropzone-title {
    font-size: clamp(1.15rem, 3.5vw, 1.4rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    word-break: break-word;
}

.dropzone-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

.kbd-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-primary);
}

.dropzone-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: var(--text-inverse);
    box-shadow: 0 2px 6px rgba(217, 93, 57, 0.25);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: var(--accent-active);
    transform: translateY(1px);
}

.file-input-hidden {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

/* Compression Quality Controls */
.compression-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    min-width: 0;
}

.control-label-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.indicator-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.quality-slider-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quality-slider {
    accent-color: var(--accent);
    cursor: pointer;
    width: 120px;
}

.quality-badge {
    font-weight: 700;
    color: var(--text-primary);
    min-width: 40px;
}

/* ==============================================================================
   ACTIVE UPLOAD FEEDBACK CARD
   ============================================================================== */
.upload-feedback-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    display: none;
    animation: slideDown 0.22s var(--transition-base);
    min-width: 0;
    width: 100%;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
    flex-wrap: wrap;
}

.feedback-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 0;
    word-break: break-word;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.feedback-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    align-items: start;
    min-width: 0;
}

.feedback-preview-box {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 180px;
}

.feedback-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

.feedback-meta-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    width: 100%;
}

.metrics-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.metric-pill {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
}

.metric-pill-highlight {
    background: var(--success-bg);
    border-color: rgba(40, 122, 56, 0.3);
    color: var(--success);
    font-weight: 700;
}

/* Copy Input Bar */
.copy-strip-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    width: 100%;
}

.copy-strip-label {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.copy-input-bar {
    display: flex;
    align-items: center;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 0;
    width: 100%;
}

.copy-input-bar input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 9px 12px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

.copy-actions-group {
    display: flex;
    align-items: center;
    padding-right: 6px;
    gap: 6px;
    flex-shrink: 0;
}

.btn-copy {
    padding: 5px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.btn-copy:hover {
    background: var(--text-primary);
    color: var(--text-inverse);
    border-color: var(--text-primary);
}

.format-buttons-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-format {
    padding: 5px 9px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    white-space: nowrap;
}

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

/* ==============================================================================
   IN-PAGE LIBRARY ASSETS SECTION (REPLACES STICKY DOCKED BOTTOM SHELF)
   ============================================================================== */
.library-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    width: 100%;
}

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

.library-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.library-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.library-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.library-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.shelf-count-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 3px 9px;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    white-space: nowrap;
}

.library-search-wrapper {
    position: relative;
    max-width: 280px;
    width: 100%;
    min-width: 200px;
}

.library-search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    font-size: 0.82rem;
    outline: none;
    transition: var(--transition-fast);
}

.library-search-input:focus {
    background: var(--bg-surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.search-icon-inside {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* In-Page Natural Responsive Grid */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    min-width: 0;
    width: 100%;
}

.library-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    cursor: pointer;
    position: relative;
    min-width: 0;
}

.library-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.library-thumbnail-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg-muted);
    position: relative;
    overflow: hidden;
}

.library-thumbnail-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.library-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 25, 23, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: var(--transition-fast);
}

.library-card:hover .library-card-overlay {
    opacity: 1;
}

.overlay-action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: var(--transition-fast);
}

.overlay-action-btn:hover {
    background: var(--accent);
    color: #FFFFFF;
}

.library-card-meta {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    background: var(--bg-surface);
}

.library-card-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.library-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.library-card-slug {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-card-size {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.empty-shelf-state {
    grid-column: 1 / -1;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    padding: 36px 16px;
    text-align: center;
    background: var(--bg-muted);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
}

/* ==============================================================================
   MODAL DIALOGS (RESPONSIVE)
   ============================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.5);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-sheet {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    max-width: 760px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.2s var(--transition-base);
    min-width: 0;
}

.modal-backdrop.is-open .modal-sheet {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-page);
    min-width: 0;
}

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

.modal-body {
    padding: 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-width: 0;
}

.modal-image-preview-wrapper {
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    max-height: 360px;
}

.modal-image-preview-wrapper img {
    max-width: 100%;
    max-height: 340px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    display: block;
}

.modal-details-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.details-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.details-label {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    color: var(--text-muted);
}

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

.slug-edit-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.slug-edit-input {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.84rem;
    min-width: 0;
}

.modal-actions-row {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-secondary {
    padding: 8px 14px;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--bg-muted-hover);
    border-color: var(--border-dark);
}

.btn-danger {
    padding: 8px 14px;
    background: var(--danger-bg);
    border: 1px solid rgba(201, 59, 43, 0.25);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--danger);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-danger:hover {
    background: var(--danger);
    color: #FFFFFF;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
    max-width: calc(100vw - 40px);
}

.toast {
    pointer-events: auto;
    background: var(--text-primary);
    color: var(--text-inverse);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.2s var(--transition-base);
    word-break: break-word;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Setup Form */
.setup-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-fast);
}

.form-input:focus {
    background: var(--bg-surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ==============================================================================
   RESPONSIVE OVERHAUL (MOBILE & TABLET SCREEN SIZES)
   ============================================================================== */
@media (max-width: 900px) {
    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 12px 14px 40px;
    }

    .top-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .brand-group {
        justify-content: space-between;
    }

    .nav-actions {
        justify-content: space-between;
        width: 100%;
    }

    .feedback-grid {
        grid-template-columns: 1fr;
    }

    .feedback-preview-box {
        max-width: 100%;
        max-height: 220px;
        margin: 0 auto;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .dropzone-container {
        padding: 30px 16px;
    }

    .compression-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .quality-slider-group {
        justify-content: space-between;
        width: 100%;
    }

    .quality-slider {
        flex: 1;
        max-width: 200px;
    }

    .library-header {
        flex-direction: column;
        align-items: stretch;
    }

    .library-search-wrapper {
        max-width: 100%;
    }

    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .brand-title {
        font-size: 1.05rem;
    }

    .stat-chip {
        padding: 4px 8px;
        font-size: 0.72rem;
    }

    .btn-signout-text {
        display: none; /* Icon-only on very small phones to prevent overflow */
    }

    .btn-signout {
        padding: 7px 10px;
    }

    .dropzone-container {
        padding: 24px 12px;
    }

    .dropzone-icon-ring {
        width: 48px;
        height: 48px;
    }

    .btn-primary {
        width: 100%;
        padding: 12px 16px;
    }

    .copy-input-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .copy-input-bar input {
        border-bottom: 1px solid var(--border-color);
    }

    .copy-actions-group {
        padding: 6px;
        justify-content: flex-end;
    }

    .library-section {
        padding: 16px 12px;
    }

    .library-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .library-card-name {
        font-size: 0.76rem;
    }

    .library-card-slug {
        font-size: 0.68rem;
    }

    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: 100%;
    }
}
