/* ============================================
   GIF to ICO Converter
   Light Mode Default + Dark Mode Support
   Red Theme (#e64e4e) - ConvertICO
   ============================================ */

/* --- CSS Variables: Light Mode (Default) --- */
:root {
    --primary: #e64e4e;
    --primary-light: #fef2f2;
    --primary-dark: #c53030;

    --success: #339966;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #e64e4e;
    --danger-light: #fee2e2;

    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-secondary: #f1f5f9;

    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border: #e2e8f0;

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

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

    --transition: 0.2s ease;
}

/* --- Dark Mode Variables --- */
[data-theme="dark"] {
    --primary: #f87171;
    --primary-light: rgba(248, 113, 113, 0.15);
    --primary-dark: #ef4444;

    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);

    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --bg-secondary: #1e293b;

    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --border: #334155;

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

/* --- Base Reset --- */
* { box-sizing: border-box; }

/* --- Tool Description Override --- */
.tool-description {
    max-width: 800px !important;
}

/* --- Tool Icon Override (single color, no gradient) --- */
.tool-icon-wrapper {
    background: var(--primary) !important;
    box-shadow: var(--shadow-md) !important;
}

/* --- Tool Title Override (single color, no gradient) --- */
.tool-title {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    color: var(--primary) !important;
}

/* --- Tool Main Overflow Fix --- */
.tool-main {
    overflow: visible !important;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    position: relative;
}

/* =============================================
   UPLOAD SECTION
   ============================================= */
.gti-upload-section {
    padding: 2.5rem;
}

.gti-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg);
    position: relative;
}

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

.gti-upload-icon {
    color: var(--primary);
    margin-bottom: 1.25rem;
    transition: transform var(--transition);
}

.gti-upload-area:hover .gti-upload-icon {
    transform: translateY(-4px);
}

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

.gti-upload-subtitle {
    color: var(--text-secondary);
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

.gti-upload-hint {
    display: inline-block;
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

/* =============================================
   EDITOR SECTION
   ============================================= */
.gti-editor-section {
    animation: gti-fadeIn 0.35s ease;
}

.gti-file-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 1rem 1.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.gti-file-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.gti-file-info-item i {
    color: var(--primary);
    flex-shrink: 0;
}

.gti-animated-badge {
    background: var(--primary-light);
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-full);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.78rem;
    border: 1px solid var(--primary);
}

.gti-animated-badge i {
    color: var(--primary);
}

/* --- Editor Grid --- */
.gti-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.gti-preview-panel,
.gti-controls-panel {
    padding: 1.75rem;
    /* Prevent grid column from expanding beyond 1fr when filmstrip or other
       wide content is present. Without this, the column blows out to min-content. */
    min-width: 0;
}

.gti-preview-panel {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
}

.gti-panel-header {
    margin-bottom: 1.25rem;
}

.gti-panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.gti-panel-header h3 i {
    color: var(--primary);
}

/* --- Image Preview --- */
.gti-image-preview-container {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gti-image-preview {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    /* Checkerboard for transparency */
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

[data-theme="dark"] .gti-image-preview {
    background-image:
        linear-gradient(45deg, #334155 25%, transparent 25%),
        linear-gradient(-45deg, #334155 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #334155 75%),
        linear-gradient(-45deg, transparent 75%, #334155 75%);
    background-color: var(--bg-elevated);
}

.gti-image-preview img {
    max-width: 100%;
    max-height: 280px;
    border-radius: var(--radius-sm);
}

.gti-preview-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.6rem 0.875rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--primary);
}

.gti-preview-hint i { flex-shrink: 0; }

/* --- Controls --- */
.gti-control-section {
    margin-bottom: 1.5rem;
}

.gti-section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gti-section-label i { color: var(--primary); }

.gti-label-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0;
}

.gti-frame-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.gti-frame-info i { color: var(--primary); flex-shrink: 0; }

/* --- Size Checkboxes --- */
.gti-sizes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.gti-size-cb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.5rem 0.25rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.78rem;
    color: var(--text);
}

.gti-size-cb:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.gti-size-cb:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.gti-size-cb input[type="checkbox"] {
    width: 14px !important;
    height: 14px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 3px !important;
    background-color: var(--bg-elevated) !important;
    margin-right: 0 !important;
    flex-shrink: 0;
}

.gti-size-cb input[type="checkbox"]:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.gti-size-cb input[type="checkbox"]:checked:after {
    font-size: 10px !important;
}

/* --- Presets --- */
.gti-presets {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.gti-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.gti-preset-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.gti-preset-btn i { width: 13px; height: 13px; }

/* --- Quality Slider --- */
.gti-quality-wrapper { padding: 0.25rem 0; }

.gti-quality-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    transition: opacity var(--transition);
    cursor: pointer;
}

.gti-quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform var(--transition);
}

.gti-quality-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

.gti-quality-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

.gti-quality-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.gti-quality-labels span:nth-child(2) {
    font-weight: 600;
    color: var(--primary);
}

/* --- Checkboxes Grid --- */
.gti-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gti-checkbox-opt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.875rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.85rem;
    color: var(--text);
}

.gti-checkbox-opt:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.gti-checkbox-opt:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.gti-checkbox-opt input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 3px !important;
    background-color: var(--bg-elevated) !important;
    margin-right: 0 !important;
    flex-shrink: 0;
}

.gti-checkbox-opt input[type="checkbox"]:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.gti-checkbox-opt input[type="checkbox"]:checked:after {
    font-size: 11px !important;
}

/* --- Option Row --- */
.gti-option-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0.6rem;
}

.gti-option-row label {
    font-size: 0.83rem;
    color: var(--text-secondary);
    min-width: 90px;
    flex-shrink: 0;
}

.gti-dropdown {
    flex: 1;
    padding: 0.55rem 0.875rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--bg-elevated);
    color: var(--text);
    font-size: 0.83rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    cursor: pointer;
    transition: all var(--transition);
}

.gti-dropdown:hover { border-color: var(--primary); }
.gti-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230, 78, 78, 0.15);
}

.gti-input {
    flex: 1;
    padding: 0.55rem 0.875rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--bg-elevated);
    color: var(--text);
    font-size: 0.83rem;
    transition: all var(--transition);
}

.gti-input:hover { border-color: var(--primary); }
.gti-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230, 78, 78, 0.15);
}

/* --- Action Bar --- */
.gti-action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.875rem;
    padding: 1.25rem 1.75rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

/* --- Buttons --- */
.gti-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.375rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
}

.gti-btn i { flex-shrink: 0; }

.gti-btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 3px 10px rgba(230, 78, 78, 0.3);
}

.gti-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(230, 78, 78, 0.4);
    color: white;
}

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

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

.gti-btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.gti-btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* =============================================
   PROCESSING OVERLAY
   ============================================= */
.gti-processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.93);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(3px);
    border-radius: var(--radius-xl);
}

[data-theme="dark"] .gti-processing-overlay {
    background: rgba(15, 23, 42, 0.93);
}

.gti-processing-content { text-align: center; padding: 2rem; }

.gti-processing-spinner {
    color: var(--primary);
    margin-bottom: 1.25rem;
}

.gti-spin { animation: gti-spin 0.9s linear infinite; }

@keyframes gti-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.gti-processing-status {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    margin: 0 0 1.25rem;
}

.gti-progress-bar-container {
    width: 280px;
    max-width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 0.6rem;
}

.gti-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.gti-progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =============================================
   RESULTS SECTION
   ============================================= */
.gti-results-section {
    padding: 2.5rem;
    text-align: center;
    animation: gti-fadeIn 0.35s ease;
}

.gti-results-header { margin-bottom: 1.75rem; }

.gti-success-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.375rem;
    background: var(--success-light);
    border-radius: var(--radius-full);
    color: var(--success);
    border: 1px solid var(--success);
}

.gti-success-badge h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.gti-results-info {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    margin: 0 auto 1.75rem;
    max-width: 380px;
    border: 1px solid var(--border);
}

.gti-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.gti-info-row:last-child { border-bottom: none; }
.gti-info-row span:first-child { color: var(--text-secondary); }
.gti-info-row span:last-child { font-weight: 600; color: var(--text); }

.gti-results-actions {
    display: flex;
    justify-content: center;
    gap: 0.875rem;
    flex-wrap: wrap;
}

/* =============================================
   ERROR MESSAGE
   ============================================= */
.gti-error {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1.25rem 1.75rem;
    padding: 1rem 1.25rem;
    background: var(--danger-light);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 0.9rem;
    text-align: left;
}

.gti-error-main {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.gti-error-contact {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding-left: 1.75rem;
}

.gti-error-contact a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.gti-error-contact a:hover { text-decoration: underline; }

/* =============================================
   RELATED TOOLS
   ============================================= */
.gti-related-tools {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-top: 1.75rem;
    padding: 1.1rem 1.375rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.gti-related-label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.gti-related-links {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

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

.gti-related-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.gti-related-link i { width: 13px; height: 13px; }

/* =============================================
   INFO SECTIONS
   ============================================= */
.gti-info-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.75rem;
}

/* Info cards: white card with border and soft shadow */
.gti-info-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem 2rem;
    box-shadow: var(--shadow-sm);
}

.gti-info-card h2 {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.2rem;
    color: var(--text);
    margin: 0 0 1.25rem;
}

.gti-info-card h2 i {
    color: var(--primary);
    flex-shrink: 0;
}

.gti-info-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 0.875rem;
    font-size: 0.95rem;
}

.gti-info-card p:last-child { margin-bottom: 0; }

.gti-info-card p a,
.gti-info-card li a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.gti-info-card p a:hover,
.gti-info-card li a:hover { text-decoration: underline; }

/* --- Steps List --- */
.gti-steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: gti-step;
}

.gti-steps-list li {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 1.1rem;
    counter-increment: gti-step;
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 0.95rem;
}

.gti-steps-list li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: calc(0.9rem - 1px);
    top: 2rem;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.gti-steps-list li::before {
    content: counter(gti-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.875rem;
    height: 1.875rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    z-index: 1;
}

/* --- Mode Tags --- */
.gti-mode-explanations { display: grid; gap: 0.875rem; }

.gti-mode-explain {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
}

.gti-mode-tag {
    flex-shrink: 0;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.gti-mode-tag.first  { background: var(--primary); }
.gti-mode-tag.last   { background: #339966; }
.gti-mode-tag.best   { background: #3399cc; }
.gti-mode-tag.custom { background: #9b59b6; }

.gti-mode-explain p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- Pro Tip --- */
.gti-pro-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.875rem 1.1rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--primary);
    margin-top: 0.875rem;
}

.gti-pro-tip i {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.gti-pro-tip span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

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

.gti-faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.gti-faq-question:hover { background: var(--primary-light); color: var(--primary); }

.gti-faq-question i {
    color: var(--primary);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

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

.gti-faq-answer {
    display: none;
    padding: 0 1.1rem 0.875rem;
    background: var(--bg-elevated);
}

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

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

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes gti-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 860px) {
    .gti-editor-grid { grid-template-columns: 1fr; }
    .gti-preview-panel {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .gti-file-info-bar { justify-content: flex-start; }
}

@media (max-width: 640px) {
    .gti-upload-section,
    .gti-results-section { padding: 1.75rem 1.25rem; }

    .gti-preview-panel,
    .gti-controls-panel { padding: 1.25rem; }

    .gti-sizes-grid { grid-template-columns: repeat(4, 1fr); }

    .gti-action-bar {
        flex-direction: column;
        padding: 1.25rem;
    }

    .gti-btn { width: 100%; }

    .gti-results-actions { flex-direction: column; }

    .gti-related-tools { flex-direction: column; }

    .gti-option-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }

    .gti-option-row label { min-width: auto; }

    .gti-mode-explain { flex-direction: column; }
}

@media (max-width: 400px) {
    .gti-sizes-grid { grid-template-columns: repeat(2, 1fr); }
    .gti-file-info-bar {
        flex-direction: column;
        gap: 0.625rem;
    }
}

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

/* =============================================
   FILMSTRIP
   ============================================= */
.gti-filmstrip-wrap {
    margin-top: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg);
}

.gti-filmstrip-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.45rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gti-filmstrip-header i { color: var(--primary); }

.gti-filmstrip {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 0.5rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    min-height: 76px;
    align-items: center;
}

.gti-filmstrip::-webkit-scrollbar { height: 4px; }
.gti-filmstrip::-webkit-scrollbar-track { background: transparent; }
.gti-filmstrip::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.gti-filmstrip-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 0.25rem 0.5rem;
}

.gti-filmstrip-thumb {
    flex-shrink: 0;
    position: relative;
    width: 56px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all var(--transition);
    margin-right: 4px;
}

.gti-filmstrip-thumb:last-child { margin-right: 0; }

.gti-filmstrip-thumb img {
    display: block;
    width: 56px;
    height: 52px;
    object-fit: contain;
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}

[data-theme="dark"] .gti-filmstrip-thumb img {
    background-image:
        linear-gradient(45deg, #334155 25%, transparent 25%),
        linear-gradient(-45deg, #334155 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #334155 75%),
        linear-gradient(-45deg, transparent 75%, #334155 75%);
}

.gti-filmstrip-num {
    display: block;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 1px 0 2px;
    background: var(--bg);
    transition: color var(--transition);
    line-height: 1.2;
}

.gti-filmstrip-thumb:hover {
    border-color: var(--primary);
}

.gti-filmstrip-thumb:hover .gti-filmstrip-num {
    color: var(--primary);
}

.gti-filmstrip-thumb.gti-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.gti-filmstrip-thumb.gti-active .gti-filmstrip-num {
    color: var(--primary);
    background: var(--primary-light);
}

/* =============================================
   BACKGROUND COLOR PICKER
   ============================================= */
.gti-bg-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
    margin-top: -3px; /* snug under checkbox */
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    animation: gti-fadeIn 0.2s ease;
}

.gti-bg-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-weight: 500;
}

.gti-swatches {
    display: flex;
    gap: 5px;
    align-items: center;
}

.gti-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    outline: 1px solid rgba(0,0,0,0.15);
    outline-offset: 0;
    flex-shrink: 0;
}

.gti-swatch:hover {
    transform: scale(1.2);
    border-color: var(--primary);
    outline-color: transparent;
}

.gti-swatch.active {
    border-color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--primary-light);
    outline-color: transparent;
}

.gti-custom-color-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    margin-left: auto;
}

.gti-color-native {
    width: 28px;
    height: 24px;
    padding: 1px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}

.gti-color-native::-webkit-color-swatch-wrapper { padding: 0; }
.gti-color-native::-webkit-color-swatch { border: none; border-radius: 3px; }
.gti-color-native::-moz-color-swatch { border: none; border-radius: 3px; }

.gti-color-hex-display {
    font-size: 0.72rem;
    font-family: monospace;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.02em;
}
