/* -
   Razi Image Editor - Image Compressor
   Premium Dark UI with Glassmorphism
   - */

/* - Design Tokens - */
:root {
    --bg:           #eff6ff;
    --bg2:          #ffffff;
    --bg3:          #dbeafe;
    --surface:      rgba(37,99,235,0.05);
    --surface-hover:rgba(37,99,235,0.10);
    --border:       rgba(37,99,235,0.18);
    --border-bright:rgba(37,99,235,0.32);

    --accent:       #2563eb;
    --accent2:      #1d4ed8;
    --accent-glow:  rgba(37,99,235,0.35);
    --green:        #059669;
    --green-dim:    rgba(5,150,105,0.12);
    --red:          #dc2626;
    --yellow:       #b45309;

    --text:         #0f2942;
    --text-muted:   #3f5b78;
    --text-dim:     #7a93b0;

    --radius-sm:    8px;
    --radius:       14px;
    --radius-lg:    20px;
    --radius-xl:    28px;

    --shadow-sm:    0 2px 12px rgba(15,41,66,0.10);
    --shadow:       0 8px 32px rgba(15,41,66,0.14);
    --shadow-glow:  0 0 30px var(--accent-glow);

    --transition:   0.22s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* - Scrollbar - */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 3px; }

/* -
   HEADER
- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255,255,255,0.85);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.brand-icon {
    width: 24px;
    height: 24px;
    display: block;
    border-radius: 6px;
}
.brand-name {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #0c1f3d 30%, var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.brand-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 2px 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* - Brand home link - */
.brand-home-link {
    text-decoration: none;
    font-size: 22px;
    filter: drop-shadow(0 0 8px var(--accent));
    transition: var(--transition);
    line-height: 1;
}
.brand-home-link:hover { filter: drop-shadow(0 0 14px var(--accent2)); transform: scale(1.1); }

/* - Tool nav - */
.tool-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
}
.tool-nav-link {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 50px;
    border: 1px solid transparent;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}
.tool-nav-link:hover {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}
.tool-nav-link.active {
    color: var(--accent2);
    background: rgba(37,99,235,0.12);
    border-color: rgba(37,99,235,0.3);
}

/* -
   BUTTONS
- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    text-decoration: none;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: #fff;
    box-shadow: 0 4px 20px rgba(37,99,235,0.4);
}
.btn-primary:hover {
    box-shadow: 0 6px 28px rgba(37,99,235,0.6);
    filter: brightness(1.1);
}

.btn-ghost {
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--border-bright);
}

.btn-outline {
    background: transparent;
    color: var(--accent2);
    border: 1px solid var(--accent);
}
.btn-outline:hover {
    background: rgba(37,99,235,0.12);
    box-shadow: 0 0 20px rgba(37,99,235,0.25);
}

.btn-green {
    background: linear-gradient(135deg, #047857, var(--green));
    color: #fff;
    box-shadow: 0 4px 20px rgba(5,150,105,0.3);
}
.btn-green:hover {
    box-shadow: 0 6px 28px rgba(5,150,105,0.5);
    filter: brightness(1.1);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* -
   SETTINGS BAR
- */
.settings-bar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    position: sticky;
    top: 64px;
    z-index: 90;
    backdrop-filter: blur(10px);
}
.settings-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.setting-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}
.slider-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
input[type="range"] {
    -webkit-appearance: none;
    width: 130px;
    height: 4px;
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--pct, 75%), #93c5fd var(--pct, 75%));
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    cursor: pointer;
    transition: var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 14px var(--accent);
}
.slider-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent2);
    min-width: 28px;
    text-align: center;
}
select, input[type="number"] {
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}
select:focus, input[type="number"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.18);
}
input[type="number"] { width: 90px; }

/* -
   MAIN CONTENT
- */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

/* -
   DROP ZONE
- */
.drop-zone-section {
    display: flex;
    justify-content: center;
    padding: 40px 0 60px;
}
.drop-zone {
    width: 100%;
    max-width: 700px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 64px 40px;
    text-align: center;
    background: var(--bg2);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(37,99,235,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(37,99,235,0.06);
    box-shadow: 0 0 40px var(--accent-glow);
    transform: scale(1.01);
}
.dz-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
    filter: drop-shadow(0 0 16px rgba(37,99,235,0.4));
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.dz-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #0c1f3d 30%, var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.dz-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}
.dz-btn {
    font-size: 15px;
    padding: 12px 32px;
    cursor: pointer;
}

/* -
   SUMMARY BAR
- */
.summary-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
}
.summary-stat {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}
.summary-stat.highlight {
    color: var(--green);
    font-weight: 700;
    font-size: 15px;
}
.summary-bar .btn-sm { margin-left: auto; }

/* -
   IMAGE GRID
- */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* - Card - */
.img-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    animation: cardIn 0.35s ease both;
    position: relative;
}
@keyframes cardIn {
    from { opacity:0; transform: translateY(20px) scale(0.97); }
    to   { opacity:1; transform: none; }
}
.img-card:hover {
    border-color: var(--border-bright);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* Thumbnail */
.card-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: var(--bg3);
    cursor: zoom-in;
    transition: filter 0.3s;
}
.img-card:hover .card-thumb { filter: brightness(1.05); }

/* State badge */
.card-status {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-pending  { background: rgba(180,83,9,0.15); color: var(--yellow); border: 1px solid rgba(180,83,9,0.3); }
.status-loading  { background: rgba(37,99,235,0.15); color: var(--accent2); border: 1px solid rgba(37,99,235,0.3); }
.status-done     { background: rgba(5,150,105,0.12); color: var(--green);  border: 1px solid rgba(5,150,105,0.3); }
.status-error    { background: rgba(220,38,38,0.12); color: var(--red);   border: 1px solid rgba(220,38,38,0.3); }

/* Card body */
.card-body {
    padding: 14px 16px 16px;
}
.card-filename {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 10px;
}

/* Stats row */
.card-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* Tip panel - shown when image can't be made smaller at current settings */
.card-tip {
    background: rgba(180,83,9,0.06);
    border: 1px solid rgba(180,83,9,0.2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 10px;
}
/* Variant for successfully-compressed images (purple instead of amber) */
.card-tip--success {
    background: rgba(37,99,235,0.06);
    border-color: rgba(37,99,235,0.2);
}
.card-tip--success .tip-heading {
    color: var(--accent2);
}
.card-tip--success .tip-btn {
    background: rgba(37,99,235,0.1);
    border-color: rgba(37,99,235,0.25);
    color: var(--accent2);
}
.card-tip--success .tip-btn:hover {
    background: rgba(37,99,235,0.2);
    border-color: rgba(37,99,235,0.5);
    box-shadow: 0 3px 10px rgba(37,99,235,0.2);
}
.card-tip--success .tip-dim {
    color: rgba(15,118,110,0.6);
}
.tip-heading {
    font-size: 11px;
    font-weight: 600;
    color: #92610a;
    margin-bottom: 8px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.tip-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tip-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.tip-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    min-width: 62px;
}
.tip-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    background: rgba(180,83,9,0.1);
    border: 1px solid rgba(180,83,9,0.25);
    color: #92610a;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.2;
}
.tip-btn:hover {
    background: rgba(180,83,9,0.2);
    border-color: rgba(180,83,9,0.5);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(180,83,9,0.2);
}
.tip-btn.is-selected {
    background: linear-gradient(135deg, rgba(180,83,9,0.95), rgba(217,119,6,0.95));
    border-color: rgba(245,158,11,0.95);
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(180,83,9,0.18), 0 6px 18px rgba(180,83,9,0.32);
}
.tip-btn.is-selected .tip-dim {
    color: rgba(255,255,255,0.85);
}
.tip-btn:active { transform: scale(0.95); }
.tip-dim {
    font-size: 9px;
    font-weight: 500;
    color: rgba(146,97,10,0.75);
    display: block;
}
.stat-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 50px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--bg3);
}
.stat-pill.green {
    color: var(--green);
    border-color: rgba(5,150,105,0.3);
    background: var(--green-dim);
}
.stat-pill.purple {
    color: var(--accent2);
    border-color: rgba(15,118,110,0.3);
    background: rgba(37,99,235,0.1);
}

/* Progress bar */
.card-progress {
    height: 3px;
    background: var(--bg3);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}
.card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
    width: 0;
}

/* Card actions */
.card-actions {
    display: flex;
    gap: 6px;
}
.card-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 7px 10px;
}

/* -
   EXPORT PANEL
- */
.export-panel {
    background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(5,150,105,0.08));
    border: 1px solid rgba(37,99,235,0.25);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    animation: cardIn 0.4s ease;
}
.export-info {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.export-info span {
    color: var(--green);
}
.export-actions {
    display: flex;
    gap: 10px;
}

/* -
   MODAL
- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,60,52,0.45);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}
.modal-overlay.open { display: flex; }

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal-box {
    background: var(--bg2);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(15,41,66,0.22), 0 0 0 1px rgba(37,99,235,0.05);
    animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn {
    from { transform: scale(0.92) translateY(20px); opacity:0; }
    to   { transform: none; opacity:1; }
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(37,99,235,0.10);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}
.modal-close:hover {
    background: rgba(220,38,38,0.15);
    color: var(--red);
    border-color: rgba(220,38,38,0.3);
}
.modal-tabs {
    display: flex;
    gap: 4px;
    padding: 16px 20px 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
    color: var(--accent2);
    border-bottom-color: var(--accent);
    background: rgba(37,99,235,0.08);
}
.modal-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
}
.modal-body img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.modal-img-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.modal-img-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* -
   TOAST
- */
.toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}
.toast {
    background: var(--bg2);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius);
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    box-shadow: var(--shadow);
    animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
    max-width: 340px;
}
@keyframes toastIn {
    from { transform: translateX(60px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-info    { border-left: 3px solid var(--accent); }
.toast.hiding  { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut {
    to { transform: translateX(60px); opacity: 0; }
}

/* -
   LOADING SPINNER
- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(37,99,235,0.25);
    border-top-color: var(--accent2);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -
   INFO / SEO CONTENT SECTION
   (intro copy, how-it-works, FAQ - shared across
   the compressor, images-PDF and PDF-image pages)
- */
.info-section {
    max-width: 1280px;
    margin: 72px auto 0;
    padding: 56px 24px 0;
    border-top: 1px solid var(--border);
}
.info-intro {
    max-width: 760px;
    margin: 0 auto 48px;
    text-align: center;
}
.info-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent2);
    background: rgba(37,99,235,0.1);
    border: 1px solid rgba(37,99,235,0.25);
    border-radius: 50px;
    padding: 5px 14px;
    margin-bottom: 18px;
}
.info-heading {
    font-size: clamp(24px, 3.4vw, 34px);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 14px;
    color: var(--text);
}
.info-lead {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.8;
}
.info-lead + .info-lead { margin-top: 14px; }

.how-it-works {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 56px;
}
.how-step {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 22px;
}
.how-step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 14px;
    background: rgba(37,99,235,0.15);
    color: var(--accent2);
}
.how-step--pdf .how-step-num     { background: rgba(5,150,105,0.15); color: var(--green); }
.how-step--extract .how-step-num { background: rgba(180,83,9,0.15); color: var(--yellow); }
.how-step-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.how-step-text  { font-size: 13px; color: var(--text-muted); line-height: 1.7; }

.faq-section { max-width: 820px; margin: 0 auto 64px; }
.faq-heading {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text);
}
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: var(--bg2);
    overflow: hidden;
    transition: var(--transition);
}
.faq-item:hover { border-color: var(--border-bright); }
.faq-item summary {
    cursor: pointer;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    flex-shrink: 0;
    font-size: 20px;
    font-weight: 400;
    color: var(--accent2);
    transition: var(--transition);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer {
    padding: 0 20px 18px;
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.75;
}

.info-cta {
    max-width: 640px;
    margin: 0 auto 72px;
    text-align: center;
    background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(5,150,105,0.06));
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
}
.info-cta-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.info-cta-text  { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; }
.info-cta .btn  { padding: 12px 28px; font-size: 14px; }

/* -
   REMOVE BACKGROUND TOOL
- */
.rb-workspace {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto 40px;
    padding: 0 24px;
    align-items: start;
}
.rb-canvas-wrap {
    background:
        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: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    position: relative;
    overflow: hidden;
}
.rb-canvas-wrap canvas { max-width: 100%; max-height: 560px; object-fit: contain; border-radius: 6px; box-shadow: 0 8px 30px rgba(15,61,54,0.12); }
.rb-engine-badge {
    position: absolute; top: 14px; left: 14px; z-index: 5;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700;
    padding: 6px 12px; border-radius: 50px;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--border);
    color: var(--accent2);
    box-shadow: 0 4px 14px rgba(15,61,54,0.10);
    backdrop-filter: blur(6px);
}
.rb-canvas-wrap .rb-loading-overlay {
    position: absolute; inset: 0;
    background: rgba(240,253,250,0.9);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; font-size: 14px; color: var(--text-muted); font-weight: 600;
}
.rb-panel {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    height: fit-content;
    position: sticky;
    top: 84px;
}
.rb-section-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 10px;
}
.rb-section-sub { font-size: 12px; color: var(--text-dim); margin: -6px 0 10px; }
.rb-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.rb-swatch {
    width: 40px; height: 40px; border-radius: 10px;
    border: 2px solid var(--border); cursor: pointer;
    transition: var(--transition); position: relative; flex-shrink: 0;
    padding: 0;
}
.rb-swatch:hover { transform: translateY(-2px); }
.rb-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.18); }
.rb-swatch-transparent {
    background:
        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: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
    background-color: #f8fafc;
}
.rb-custom-row { display: flex; align-items: center; gap: 10px; }
.rb-color-input { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--border); cursor: pointer; padding: 0; background: none; }
.rb-upload-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px; border-radius: 10px;
    border: 1.5px dashed var(--border); background: var(--surface);
    color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer;
    transition: var(--transition);
}
.rb-upload-btn:hover { border-color: var(--accent); color: var(--accent2); }
.rb-slider-row { display: flex; align-items: center; gap: 10px; }
.rb-slider-row input[type="range"] { flex: 1; }
.rb-slider-val { font-size: 12px; font-weight: 700; color: var(--accent2); width: 30px; text-align: right; }
.rb-actions { display: flex; flex-direction: column; gap: 10px; }
.rb-use-case-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.rb-use-case-tag {
    font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 50px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
@media (max-width: 900px) {
    .rb-workspace { grid-template-columns: 1fr; }
    .rb-panel { position: static; }
}

/* -
   ACCOUNT / AUTH WIDGET
- */
[data-eie-auth-widget] {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.eie-login-btn { padding: 8px 18px !important; font-size: 13px !important; }
.eie-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px 5px 5px;
    border-radius: 50px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.eie-user-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.eie-pro-pill {
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 50px;
    background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff;
}
.eie-free-pill {
    font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 50px;
    background: var(--bg3); color: var(--text-muted);
}
.eie-logout-btn {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    background: none; border: none; cursor: pointer; padding: 2px 6px;
    text-decoration: underline; text-underline-offset: 2px;
}
.eie-logout-btn:hover { color: var(--accent2); }
.pro-lock-badge {
    position: absolute; top: -6px; right: -6px;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #fff; font-size: 9px; font-weight: 800;
    padding: 2px 5px; border-radius: 6px; letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(217,119,6,0.4);
    pointer-events: none;
}
.rb-swatch.pro-locked { position: relative; opacity: 0.92; }
@media (max-width: 900px) {
    [data-eie-auth-widget] .tool-nav-link { display: none; }
}

/* -
   RESPONSIVE
- */
@media (max-width: 900px) {
    .brand-tag { display: none; }
    .tool-nav { overflow-x: auto; max-width: 44vw; scrollbar-width: none; }
    .tool-nav::-webkit-scrollbar { display: none; }
}

/* Tablet & large phones: let the header wrap onto two rows instead of
   squeezing brand + nav + auth widget into one line. */
@media (max-width: 760px) {
    .site-header { padding: 0 14px; }
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        min-height: 60px;
        padding: 10px 0;
        row-gap: 8px;
        column-gap: 8px;
    }
    .brand { flex: 1 1 auto; min-width: 0; }
    .brand-name { font-size: 16px; }
    .tool-nav { max-width: none; flex: 1 1 100%; margin-left: 0; order: 3; }
    [data-eie-auth-widget] { order: 2; margin-left: auto; }
    #headerActions { order: 4; flex: 1 1 100%; }
    #headerActions .btn { flex: 1; justify-content: center; padding: 10px 12px; font-size: 13px; }
    .settings-bar { padding: 12px 14px; position: static; top: auto; }
    .drop-zone-section, .file-list-section, .info-section, main.main-content { padding-left: 14px; padding-right: 14px; }
}

@media (max-width: 420px) {
    .brand-icon { width: 20px; height: 20px; }
    .brand-name { font-size: 14px; }
    .tool-nav-link { padding: 5px 9px; font-size: 11px; }
    .eie-user-chip { padding: 4px 6px 4px 4px; }
    .eie-user-avatar { display: none; } /* keep the chip compact; Free/Pro status pill remains visible */
}

@media (max-width: 640px) {
    .settings-inner { gap: 14px; }
    .setting-group { flex-wrap: wrap; }
    input[type="range"] { width: 100px; }
    .image-grid { grid-template-columns: 1fr; }
    .export-panel { flex-direction: column; align-items: flex-start; }
    .export-actions { width: 100%; }
    .export-actions .btn { flex: 1; justify-content: center; }
    .modal-body { flex-direction: column; }
    .modal-box { max-width: 94vw; max-height: 92vh; padding: 16px; }
    .dz-icon { font-size: 48px; }
    .dz-title { font-size: 20px; }
    .dz-subtitle { font-size: 13px; }
    .drop-zone { padding: 32px 16px; }
    .info-section { margin-top: 48px; padding-top: 40px; }
    .how-it-works { grid-template-columns: 1fr; }
    .summary-bar { flex-wrap: wrap; gap: 8px; }
    .summary-stat { font-size: 12px; }
    .card-actions { flex-wrap: wrap; }
    .rb-canvas-wrap { padding: 12px; min-height: 300px; }
    .rb-panel { padding: 16px; }
    .rb-swatch { width: 36px; height: 36px; }
    .pdf-toolbar { flex-wrap: wrap; gap: 8px; padding: 0 14px; }
    .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; padding: 0 14px; }
}

@media (max-width: 360px) {
    .dz-title { font-size: 18px; }
    .btn { padding: 8px 14px; font-size: 13px; }
    .btn-sm { padding: 7px 12px; font-size: 12px; }
}