/* ============================================
   RAW File Viewer - Tool CSS
   Prefix: rfv-
   tools.suritdevelopers.com
   ============================================ */

/* ── Tool color overrides ────────────────── */
:root {
    --rfv-primary:        #3399cc;
    --rfv-primary-light:  rgba(51, 153, 204, 0.12);
    --rfv-primary-dark:   #2277aa;
    --rfv-success:        #339966;
    --rfv-success-light:  rgba(51, 153, 102, 0.12);
    --rfv-warning:        #f59e0b;
    --rfv-danger:         #e64e4e;

    --rfv-bg:             #f8fafc;
    --rfv-bg-elevated:    #ffffff;
    --rfv-bg-secondary:   #f1f5f9;
    --rfv-bg-tertiary:    #e2e8f0;

    --rfv-text:           #1e293b;
    --rfv-text-secondary: #64748b;
    --rfv-text-muted:     #94a3b8;

    --rfv-border:         #e2e8f0;

    --rfv-checker:        #e5e7eb;

    --rfv-error-bg:       #fef2f2;
    --rfv-error-border:   #fecaca;

    --rfv-radius-sm:  6px;
    --rfv-radius-md:  12px;
    --rfv-radius-lg:  16px;
    --rfv-radius-xl:  24px;
    --rfv-radius-full: 9999px;

    --rfv-shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
    --rfv-shadow-md:  0 4px 6px -1px rgba(0,0,0,0.1);
    --rfv-shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.1);
    --rfv-shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --rfv-primary:        #5bb8e8;
    --rfv-primary-light:  rgba(91, 184, 232, 0.15);
    --rfv-primary-dark:   #3399cc;
    --rfv-success:        #4ade80;
    --rfv-success-light:  rgba(74, 222, 128, 0.15);
    --rfv-danger:         #f87171;

    --rfv-bg:             #0f172a;
    --rfv-bg-elevated:    #1e293b;
    --rfv-bg-secondary:   #334155;
    --rfv-bg-tertiary:    #475569;

    --rfv-text:           #f1f5f9;
    --rfv-text-secondary: #94a3b8;
    --rfv-text-muted:     #64748b;

    --rfv-border:         #334155;

    --rfv-checker:        #374151;

    --rfv-error-bg:       rgba(239,68,68,0.12);
    --rfv-error-border:   rgba(248,113,113,0.25);

    --rfv-shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
    --rfv-shadow-md:  0 4px 6px -1px rgba(0,0,0,0.4);
    --rfv-shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.4);
    --rfv-shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.5);
}

/* ── Fix custom_styles.css overflow:hidden clash ── */
.tool-main {
    overflow: visible !important;
}

/* ── Container ───────────────────────────── */
.tool-container {
    max-width: 1000px;
}

/* ── Header ──────────────────────────────── */
.tool-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tool-icon-wrapper {
    width: 60px;
    height: 60px;
    background: var(--rfv-primary);
    border-radius: var(--rfv-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.tool-icon-wrapper svg {
    width: 26px;
    height: 26px;
}

.tool-title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    margin: 0;
    color: var(--rfv-primary);
    letter-spacing: -0.02em;
}

.tool-description {
    font-size: 1.05rem;
    color: var(--rfv-text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ── Tool Main ───────────────────────────── */
.tool-main {
    background: var(--rfv-bg-elevated);
    border-radius: var(--rfv-radius-xl);
    box-shadow: var(--rfv-shadow-xl);
    border: 1px solid var(--rfv-border);
    transition: background-color 0.25s, border-color 0.25s;
}

/* ── Upload Section ──────────────────────── */
.rfv-upload-section {
    padding: 2.5rem;
}

.rfv-upload-area {
    border: 2px dashed var(--rfv-border);
    border-radius: var(--rfv-radius-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--rfv-bg-secondary);
    position: relative;
}

.rfv-upload-area:hover,
.rfv-upload-area.dragover {
    border-color: var(--rfv-primary);
    background: var(--rfv-bg);
    transform: translateY(-2px);
    box-shadow: var(--rfv-shadow-md);
}

.rfv-upload-icon {
    color: var(--rfv-primary);
    margin-bottom: 1.25rem;
    transition: transform 0.3s ease;
}

.rfv-upload-area:hover .rfv-upload-icon {
    transform: translateY(-5px);
}

.rfv-upload-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--rfv-text);
    margin: 0 0 0.4rem;
}

.rfv-upload-subtitle {
    color: var(--rfv-text-secondary);
    margin: 0 0 1rem;
}

.rfv-file-types {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.rfv-file-type-badge {
    background: var(--rfv-primary-light);
    color: var(--rfv-primary);
    padding: 0.3rem 0.75rem;
    border-radius: var(--rfv-radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    transition: background-color 0.25s;
}

.rfv-upload-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--rfv-bg-elevated);
    color: var(--rfv-text-muted);
    padding: 0.4rem 0.9rem;
    border-radius: var(--rfv-radius-full);
    font-size: 0.85rem;
    border: 1px solid var(--rfv-border);
}

/* ── Progress ────────────────────────────── */
.rfv-progress-container {
    margin-top: 1.25rem;
    text-align: center;
}

.rfv-progress-bar-track {
    height: 7px;
    background: var(--rfv-border);
    border-radius: var(--rfv-radius-full);
    overflow: hidden;
}

.rfv-progress-fill {
    height: 100%;
    background: var(--rfv-primary);
    border-radius: var(--rfv-radius-full);
    transition: width 0.35s ease;
    width: 0%;
}

.rfv-progress-text {
    margin: 0.6rem 0 0;
    color: var(--rfv-text-secondary);
    font-size: 0.875rem;
}

/* ── Error ───────────────────────────────── */
.rfv-error-display {
    margin-top: 1.25rem;
    background: var(--rfv-error-bg);
    border: 1px solid var(--rfv-error-border);
    color: var(--rfv-danger);
    padding: 1rem 1.25rem;
    border-radius: var(--rfv-radius-md);
    font-size: 0.925rem;
    line-height: 1.6;
}

.rfv-error-display a {
    color: var(--rfv-primary);
}

/* ── Viewer Section ──────────────────────── */
.rfv-viewer-section {
    /* uses tool-main as container */
}

/* ── File Header ─────────────────────────── */
.rfv-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.5rem;
    background: var(--rfv-bg-secondary);
    border-bottom: 1px solid var(--rfv-border);
    transition: background-color 0.25s, border-color 0.25s;
}

.rfv-file-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.rfv-file-info svg {
    color: var(--rfv-primary);
    flex-shrink: 0;
}

.rfv-file-name {
    font-weight: 600;
    color: var(--rfv-text);
}

.rfv-file-badge {
    padding: 0.2rem 0.65rem;
    background: var(--rfv-bg-tertiary);
    border-radius: var(--rfv-radius-full);
    font-size: 0.78rem;
    color: var(--rfv-text-secondary);
    transition: background-color 0.25s;
}

.rfv-file-badge.rfv-format {
    background: var(--rfv-primary-light);
    color: var(--rfv-primary);
    font-weight: 600;
}

.rfv-file-actions {
    display: flex;
    gap: 0.4rem;
}

.rfv-btn-icon {
    width: 34px;
    height: 34px;
    border: 1px solid var(--rfv-border);
    background: var(--rfv-bg-elevated);
    border-radius: var(--rfv-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rfv-text-secondary);
    transition: all 0.2s ease;
}

.rfv-btn-icon:hover {
    background: var(--rfv-primary);
    color: #fff;
    border-color: var(--rfv-primary);
}

.rfv-btn-icon svg { width: 16px; height: 16px; }

/* ── Preview Section ─────────────────────── */
.rfv-preview-section {
    padding: 1.5rem 2rem;
    background: var(--rfv-bg-secondary);
    border-bottom: 1px solid var(--rfv-border);
    transition: background-color 0.25s, border-color 0.25s;
}

.rfv-preview-wrapper {
    max-width: 600px;
    max-height: 420px;
    margin: 0 auto;
    border-radius: var(--rfv-radius-md);
    overflow: hidden;
    background: repeating-conic-gradient(var(--rfv-checker) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
    border: 1px solid var(--rfv-border);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    transition: border-color 0.25s;
}

.rfv-preview-wrapper img {
    max-width: 100%;
    max-height: 420px;
    display: block;
}

.rfv-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    color: var(--rfv-text-muted);
    text-align: center;
}

.rfv-preview-placeholder svg { margin-bottom: 1rem; opacity: 0.45; }
.rfv-preview-placeholder p   { margin: 0; }

.rfv-no-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--rfv-text-muted);
}
.rfv-no-preview svg { opacity: 0.45; }
.rfv-no-preview p { margin: 0; font-weight: 500; color: var(--rfv-text-secondary); }
.rfv-no-preview span { font-size: 0.82rem; }

/* ── Quick Info Bar ──────────────────────── */
.rfv-quick-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    background: var(--rfv-bg-elevated);
    border-bottom: 1px solid var(--rfv-border);
    transition: background-color 0.25s, border-color 0.25s;
}

.rfv-quick-info-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.rfv-quick-info-item > svg {
    width: 18px;
    height: 18px;
    color: var(--rfv-primary);
    flex-shrink: 0;
}

.rfv-quick-info-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.rfv-quick-label {
    font-size: 0.72rem;
    color: var(--rfv-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rfv-quick-value {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--rfv-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Tabs ────────────────────────────────── */
.rfv-tabs-container {
    background: var(--rfv-bg-elevated);
    transition: background-color 0.25s;
}

.rfv-tabs-header {
    display: flex;
    border-bottom: 1px solid var(--rfv-border);
    padding: 0 0.75rem;
    gap: 0.25rem;
    overflow-x: auto;
    transition: border-color 0.25s;
    scrollbar-width: none;
}

.rfv-tabs-header::-webkit-scrollbar { display: none; }

.rfv-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.875rem 1.1rem;
    background: none;
    border: none;
    color: var(--rfv-text-secondary);
    font-weight: 500;
    font-size: 0.925rem;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s;
}

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

.rfv-tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--rfv-primary);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.rfv-tab-btn.active::after { transform: scaleX(1); }
.rfv-tab-btn svg { width: 16px; height: 16px; }

/* ── EXIF Search ─────────────────────────── */
.rfv-exif-search-wrap {
    display: none;
    padding: 0.75rem 1.5rem;
    background: var(--rfv-bg-secondary);
    border-bottom: 1px solid var(--rfv-border);
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.25s, border-color 0.25s;
}

.rfv-exif-search-wrap svg {
    color: var(--rfv-text-muted);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.rfv-exif-search {
    flex: 1;
    border: 1px solid var(--rfv-border);
    background: var(--rfv-bg-elevated);
    color: var(--rfv-text);
    padding: 0.4rem 0.75rem;
    border-radius: var(--rfv-radius-sm);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.rfv-exif-search:focus { border-color: var(--rfv-primary); }
.rfv-exif-search::placeholder { color: var(--rfv-text-muted); }

/* ── Tab Content ─────────────────────────── */
.rfv-tabs-content { min-height: 280px; }

.rfv-tab-content { display: none; padding: 1.75rem; }
.rfv-tab-content.active { display: block; }

/* ── Info Grid (inside tab) ──────────────── */
.rfv-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.rfv-meta-section {
    background: var(--rfv-bg-secondary);
    border-radius: var(--rfv-radius-md);
    padding: 1.1rem 1.25rem;
    transition: background-color 0.25s;
}

.rfv-meta-section h4 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--rfv-primary);
    margin: 0 0 0.875rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--rfv-border);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rfv-meta-section h4 svg { width: 14px; height: 14px; }

.rfv-info-items {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rfv-info-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
    align-items: baseline;
}

.rfv-info-label {
    color: var(--rfv-text-muted);
    flex-shrink: 0;
}

.rfv-info-value {
    color: var(--rfv-text);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

.rfv-no-meta {
    text-align: center;
    padding: 2.5rem 2rem;
    color: var(--rfv-text-secondary);
    grid-column: 1 / -1;
}

.rfv-no-meta svg {
    width: 40px;
    height: 40px;
    color: var(--rfv-text-muted);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.rfv-no-meta p { margin: 0 0 0.5rem; line-height: 1.6; }

/* ── EXIF Table ──────────────────────────── */
.rfv-exif-table-wrap {
    max-height: 420px;
    overflow-y: auto;
    border-radius: var(--rfv-radius-sm);
}

.rfv-exif-table {
    width: 100%;
    border-collapse: collapse;
}

.rfv-exif-table th,
.rfv-exif-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--rfv-border);
    font-size: 0.875rem;
}

.rfv-exif-table th {
    background: var(--rfv-bg-secondary);
    font-weight: 600;
    color: var(--rfv-text);
    position: sticky;
    top: 0;
    z-index: 1;
}

.rfv-exif-table td:first-child {
    color: var(--rfv-text-muted);
    width: 45%;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.82rem;
}

.rfv-exif-table td:last-child {
    color: var(--rfv-text);
    word-break: break-word;
}

.rfv-exif-table tbody tr:hover {
    background: var(--rfv-bg-secondary);
}

/* ── Hex Viewer ──────────────────────────── */
.rfv-hex-viewer {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.45;
}

.rfv-hex-header {
    display: grid;
    grid-template-columns: 80px 1fr 120px;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: var(--rfv-bg-secondary);
    border-radius: var(--rfv-radius-sm);
    margin-bottom: 0.4rem;
    color: var(--rfv-primary);
    font-weight: 600;
}

.rfv-hex-content {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: auto;
}

.rfv-hex-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px;
    gap: 1rem;
    padding: 0.2rem 1rem;
    transition: background-color 0.1s;
}

.rfv-hex-row:hover { background: var(--rfv-bg-secondary); }

.rfv-hex-offset { color: var(--rfv-primary); }
.rfv-hex-bytes  { color: var(--rfv-text); letter-spacing: 0.05em; }
.rfv-hex-ascii  { color: var(--rfv-text-muted); }

.rfv-hex-more {
    padding: 0.875rem;
    text-align: center;
    color: var(--rfv-text-muted);
    font-size: 0.85rem;
}

/* ── Structure Analysis ──────────────────── */
.rfv-structure-analysis {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.rfv-structure-item {
    background: var(--rfv-bg-secondary);
    border-radius: var(--rfv-radius-md);
    padding: 0.875rem 1.1rem;
    transition: background-color 0.25s;
}

.rfv-structure-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--rfv-primary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rfv-structure-header svg { width: 14px; height: 14px; }

.rfv-structure-value {
    color: var(--rfv-text);
    font-size: 0.9rem;
}

.rfv-structure-markers {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.rfv-marker-row {
    display: flex;
    gap: 1rem;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.82rem;
}

.rfv-marker-offset { color: var(--rfv-primary); font-weight: 500; }
.rfv-marker-name   { color: var(--rfv-text); }

/* ── Export Actions ──────────────────────── */
.rfv-export-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--rfv-bg-secondary);
    border-top: 1px solid var(--rfv-border);
    justify-content: flex-end;
    flex-wrap: wrap;
    transition: background-color 0.25s, border-color 0.25s;
}

/* ── Buttons ─────────────────────────────── */
.rfv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--rfv-radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.rfv-btn svg { width: 16px; height: 16px; }

.rfv-btn-primary {
    background: var(--rfv-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(51,153,204,0.3);
}

.rfv-btn-primary:hover {
    background: var(--rfv-primary-dark);
    transform: translateY(-2px);
}

.rfv-btn-secondary {
    background: var(--rfv-bg-elevated);
    color: var(--rfv-text);
    border: 1px solid var(--rfv-border);
}

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

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

.rfv-btn-success:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ── Related Tools ───────────────────────── */
.rfv-related-tools {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: var(--rfv-bg-elevated);
    border-radius: var(--rfv-radius-lg);
    border: 1px solid var(--rfv-border);
    flex-wrap: wrap;
    transition: background-color 0.25s, border-color 0.25s;
}

.rfv-related-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--rfv-text);
    white-space: nowrap;
}

.rfv-related-label svg { color: var(--rfv-primary); width: 16px; height: 16px; }

.rfv-related-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rfv-related-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.875rem;
    background: var(--rfv-bg-secondary);
    color: var(--rfv-text-secondary);
    text-decoration: none;
    border-radius: var(--rfv-radius-full);
    font-size: 0.84rem;
    font-weight: 500;
    border: 1px solid var(--rfv-border);
    transition: all 0.2s ease;
}

.rfv-related-link:hover {
    background: var(--rfv-primary);
    color: #fff;
    border-color: var(--rfv-primary);
    transform: translateY(-2px);
}

.rfv-related-link svg { width: 14px; height: 14px; }

/* ── Info Sections (outside tool) ────────── */
.rfv-info-sections {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

/* Info cards with white background */
.rfv-info-card {
    background: var(--rfv-bg-elevated);
    border-radius: var(--rfv-radius-xl);
    padding: 2rem;
    box-shadow: var(--rfv-shadow-md);
    border: 1px solid var(--rfv-border);
    transition: background-color 0.25s, border-color 0.25s;
}

.rfv-info-card h2 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.3rem;
    color: var(--rfv-text);
    margin: 0 0 1.5rem;
}

.rfv-info-card h2 svg {
    color: var(--rfv-primary);
    width: 22px;
    height: 22px;
}

.rfv-info-intro {
    color: var(--rfv-text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.7;
}

/* ── Features Grid ───────────────────────── */
.rfv-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
}

.rfv-feature-item {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
}

.rfv-feature-icon {
    width: 38px;
    height: 38px;
    background: var(--rfv-primary-light);
    border-radius: var(--rfv-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rfv-primary);
    flex-shrink: 0;
    transition: background-color 0.25s;
}

.rfv-feature-icon svg { width: 18px; height: 18px; }

.rfv-feature-content h4 {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
    color: var(--rfv-text);
}

.rfv-feature-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--rfv-text-secondary);
    line-height: 1.5;
}

/* ── Formats Grid ────────────────────────── */
.rfv-formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.875rem;
}

.rfv-format-group {
    background: var(--rfv-bg-secondary);
    padding: 0.875rem;
    border-radius: var(--rfv-radius-md);
    text-align: center;
    transition: background-color 0.25s;
}

.rfv-format-group h4 {
    margin: 0 0 0.35rem;
    color: var(--rfv-primary);
    font-size: 0.9rem;
}

.rfv-format-group span {
    color: var(--rfv-text-secondary);
    font-size: 0.82rem;
}

/* ── FAQ ─────────────────────────────────── */
.rfv-faq-list {
    display: grid;
    gap: 0.6rem;
}

.rfv-faq-item {
    border: 1px solid var(--rfv-border);
    border-radius: var(--rfv-radius-md);
    overflow: hidden;
    transition: border-color 0.25s;
}

.rfv-faq-question {
    width: 100%;
    padding: 0.875rem 1.1rem;
    background: var(--rfv-bg-secondary);
    border: none;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--rfv-text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: background-color 0.2s;
}

.rfv-faq-question:hover { background: var(--rfv-bg); }

.rfv-faq-question svg {
    color: var(--rfv-primary);
    transition: transform 0.3s ease;
    width: 18px; height: 18px;
    flex-shrink: 0;
}

.rfv-faq-item.open .rfv-faq-question svg {
    transform: rotate(180deg);
}

.rfv-faq-answer {
    display: none;
    padding: 0 1.1rem 0.875rem;
    background: var(--rfv-bg-elevated);
    transition: background-color 0.25s;
}

.rfv-faq-item.open .rfv-faq-answer { display: block; }

.rfv-faq-answer p {
    margin: 0;
    color: var(--rfv-text-secondary);
    line-height: 1.7;
    font-size: 0.9rem;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
    .rfv-upload-section { padding: 1.75rem 1.25rem; }
    .rfv-upload-area    { padding: 2.5rem 1.25rem; }

    .rfv-file-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .rfv-preview-section,
    .rfv-tab-content { padding: 1.25rem; }

    .rfv-quick-info {
        grid-template-columns: repeat(2, 1fr);
        padding: 1rem 1.25rem;
    }

    .rfv-export-actions {
        flex-direction: column;
        padding: 1.25rem;
    }

    .rfv-btn { width: 100%; }

    .rfv-related-tools  { flex-direction: column; }
    .rfv-related-links  { justify-content: center; }

    .rfv-hex-header, .rfv-hex-row {
        grid-template-columns: 70px 1fr;
    }
    .rfv-hex-ascii { display: none; }
}

@media (max-width: 480px) {
    .rfv-quick-info      { grid-template-columns: 1fr; }
    .rfv-info-grid       { grid-template-columns: 1fr; }
    .rfv-tabs-header     { padding: 0 0.25rem; }

    .rfv-tab-btn {
        padding: 0.75rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* ── Scrollbar ───────────────────────────── */
.rfv-hex-content::-webkit-scrollbar,
.rfv-exif-table-wrap::-webkit-scrollbar {
    width: 6px; height: 6px;
}
.rfv-hex-content::-webkit-scrollbar-track,
.rfv-exif-table-wrap::-webkit-scrollbar-track {
    background: var(--rfv-bg);
}
.rfv-hex-content::-webkit-scrollbar-thumb,
.rfv-exif-table-wrap::-webkit-scrollbar-thumb {
    background: var(--rfv-text-muted);
    border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
